@usherlabs/cex-broker 0.2.52 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/cli.js +364 -71
- package/dist/index.js +365 -72
- package/dist/index.js.map +14 -13
- package/package.json +5 -28
- package/dist/commands/cex-canonical-orderbook-export.d.ts +0 -23
- package/dist/commands/cex-canonical-orderbook-export.js +0 -34275
- package/dist/commands/cex-canonical-orderbook-export.js.map +0 -266
- package/dist/commands/market-data-vendor-backfill.d.ts +0 -24
- package/dist/commands/market-data-vendor-backfill.js +0 -34930
- package/dist/commands/market-data-vendor-backfill.js.map +0 -268
- package/dist/handlers/execute-action/context.d.ts +0 -50
- package/dist/handlers/execute-action/deposit.d.ts +0 -2
- package/dist/handlers/execute-action/handler.d.ts +0 -19
- package/dist/handlers/execute-action/index.d.ts +0 -10
- package/dist/handlers/execute-action/internal-transfer.d.ts +0 -2
- package/dist/handlers/execute-action/order-book-call.d.ts +0 -3
- package/dist/handlers/execute-action/orders.d.ts +0 -2
- package/dist/handlers/execute-action/pass-through.d.ts +0 -2
- package/dist/handlers/execute-action/perp-config.d.ts +0 -2
- package/dist/handlers/execute-action/registry.d.ts +0 -5
- package/dist/handlers/execute-action/treasury-call.d.ts +0 -2
- package/dist/handlers/execute-action/withdraw.d.ts +0 -2
- package/dist/handlers/subscribe/broker-lifecycle.d.ts +0 -13
- package/dist/handlers/subscribe/handler.d.ts +0 -20
- package/dist/handlers/subscribe/index.d.ts +0 -2
- package/dist/handlers/types.d.ts +0 -23
- package/dist/helpers/account-balance-archive-poller.d.ts +0 -19
- package/dist/helpers/auth.d.ts +0 -5
- package/dist/helpers/balance-update-archive-consumer.d.ts +0 -16
- package/dist/helpers/binance-user-data-normalization.d.ts +0 -3
- package/dist/helpers/binance-user-data-stream.d.ts +0 -58
- package/dist/helpers/broker-execution-archive/capture.d.ts +0 -41
- package/dist/helpers/broker-execution-archive/index.d.ts +0 -7
- package/dist/helpers/broker-execution-archive/journal-export.d.ts +0 -20
- package/dist/helpers/broker-execution-archive/loss-journal.d.ts +0 -36
- package/dist/helpers/broker-execution-archive/redact.d.ts +0 -7
- package/dist/helpers/broker-execution-archive/rows.d.ts +0 -134
- package/dist/helpers/broker-execution-archive/types.d.ts +0 -26
- package/dist/helpers/broker-execution-archive/withdrawal-observation-tracker.d.ts +0 -23
- package/dist/helpers/broker-execution-archive/writer.d.ts +0 -105
- package/dist/helpers/broker.d.ts +0 -38
- package/dist/helpers/canonical-orderbook-export/exact-selection.d.ts +0 -21
- package/dist/helpers/canonical-orderbook-export/exporter.d.ts +0 -26
- package/dist/helpers/canonical-orderbook-export/parquet-projection.d.ts +0 -19
- package/dist/helpers/constants.d.ts +0 -36
- package/dist/helpers/deposit-archive-poller.d.ts +0 -66
- package/dist/helpers/deposit.d.ts +0 -5
- package/dist/helpers/exchange-credentials.d.ts +0 -10
- package/dist/helpers/fill-archive-poller.d.ts +0 -42
- package/dist/helpers/grpc/broker.d.ts +0 -5
- package/dist/helpers/grpc/callbacks.d.ts +0 -9
- package/dist/helpers/grpc/payload.d.ts +0 -9
- package/dist/helpers/grpc/status.d.ts +0 -8
- package/dist/helpers/index.d.ts +0 -44
- package/dist/helpers/logger.d.ts +0 -13
- package/dist/helpers/market-data-archive/canonical-orderbook.d.ts +0 -20
- package/dist/helpers/market-data-archive/capture-context.d.ts +0 -53
- package/dist/helpers/market-data-archive/capture-contract.d.ts +0 -30
- package/dist/helpers/market-data-archive/capture.d.ts +0 -22
- package/dist/helpers/market-data-archive/index.d.ts +0 -13
- package/dist/helpers/market-data-archive/legacy-migration.d.ts +0 -37
- package/dist/helpers/market-data-archive/ohlcv-bar-tracker.d.ts +0 -11
- package/dist/helpers/market-data-archive/ohlcv-bootstrap.d.ts +0 -1
- package/dist/helpers/market-data-archive/ohlcv-history.d.ts +0 -8
- package/dist/helpers/market-data-archive/orderbook-depth.d.ts +0 -5
- package/dist/helpers/market-data-archive/orderbook-sampler.d.ts +0 -12
- package/dist/helpers/market-data-archive/parse-stream.d.ts +0 -26
- package/dist/helpers/market-data-archive/rows.d.ts +0 -14
- package/dist/helpers/market-data-archive/types.d.ts +0 -83
- package/dist/helpers/market-data-preparation/conformance-fixtures.d.ts +0 -128
- package/dist/helpers/market-data-preparation/contracts.d.ts +0 -2970
- package/dist/helpers/market-data-preparation/file-job.d.ts +0 -38
- package/dist/helpers/market-data-preparation/required-clock-qualification.d.ts +0 -43
- package/dist/helpers/market-data-preparation/source-tape-dependencies.d.ts +0 -19
- package/dist/helpers/market-data-preparation/source-tape-operation.d.ts +0 -109
- package/dist/helpers/market-data-source-forensics.d.ts +0 -400
- package/dist/helpers/market-data-vendor-backfill/archive-reader.d.ts +0 -26
- package/dist/helpers/market-data-vendor-backfill/batching.d.ts +0 -10
- package/dist/helpers/market-data-vendor-backfill/conformance-fixtures.d.ts +0 -78
- package/dist/helpers/market-data-vendor-backfill/contracts.d.ts +0 -358
- package/dist/helpers/market-data-vendor-backfill/core.d.ts +0 -101
- package/dist/helpers/market-data-vendor-backfill/cryptohftdata.d.ts +0 -118
- package/dist/helpers/market-data-vendor-backfill/forwarder-client.d.ts +0 -25
- package/dist/helpers/market-data-vendor-backfill/identity.d.ts +0 -10
- package/dist/helpers/market-data-vendor-backfill/manifests.d.ts +0 -61
- package/dist/helpers/market-data-vendor-backfill/promotion.d.ts +0 -10
- package/dist/helpers/market-data-vendor-backfill/qualification.d.ts +0 -20
- package/dist/helpers/market-data-vendor-backfill/selection.d.ts +0 -30
- package/dist/helpers/market-data-vendor-backfill/semantic-verification.d.ts +0 -25
- package/dist/helpers/market-type.d.ts +0 -16
- package/dist/helpers/order-activity-tracker.d.ts +0 -22
- package/dist/helpers/order-book.d.ts +0 -79
- package/dist/helpers/order-telemetry.d.ts +0 -50
- package/dist/helpers/otel.d.ts +0 -83
- package/dist/helpers/passive-order.d.ts +0 -8
- package/dist/helpers/public-market-data-feed/identity.d.ts +0 -12
- package/dist/helpers/public-market-data-feed/index.d.ts +0 -5
- package/dist/helpers/public-market-data-feed/orderbook-coalescing-evidence.d.ts +0 -79
- package/dist/helpers/public-market-data-feed/orderbook-profile.d.ts +0 -54
- package/dist/helpers/public-market-data-feed/subscriber-buffer.d.ts +0 -31
- package/dist/helpers/public-market-data-feed/supervisor.d.ts +0 -82
- package/dist/helpers/shared/errors.d.ts +0 -14
- package/dist/helpers/shared/guards.d.ts +0 -2
- package/dist/helpers/source-tape-sandbox.d.ts +0 -82
- package/dist/helpers/source-tape.d.ts +0 -165
- package/dist/helpers/stream-health-publisher.d.ts +0 -41
- package/dist/helpers/trace-context.d.ts +0 -8
- package/dist/helpers/transfer-network.d.ts +0 -12
- package/dist/helpers/travel-rule-deposit-reconciler.d.ts +0 -159
- package/dist/helpers/travel-rule.d.ts +0 -75
- package/dist/helpers/treasury-discovery.d.ts +0 -17
- package/dist/helpers/user-asset-archive-poller.d.ts +0 -19
- package/dist/helpers/user-data-stream-supervisor.d.ts +0 -27
- package/dist/helpers/verity.d.ts +0 -5
- package/dist/index.d.ts +0 -56
- package/dist/market-data-preparation/fixtures/conformance-v3.json +0 -621
- package/dist/market-data-preparation/policies/capability-policy.json +0 -39
- package/dist/market-data-preparation/policies/resource-policy.json +0 -16
- package/dist/market-data-preparation/policies/source-tape-capability-v1.json +0 -35
- package/dist/market-data-preparation/schema-manifest.json +0 -66
- package/dist/market-data-preparation/schemas/archive-selection-v1.schema.json +0 -224
- package/dist/market-data-preparation/schemas/backfill-request-v1.schema.json +0 -166
- package/dist/market-data-preparation/schemas/backfill-result-v2.schema.json +0 -212
- package/dist/market-data-preparation/schemas/canonical-orderbook-export-request-v1.schema.json +0 -61
- package/dist/market-data-preparation/schemas/canonical-orderbook-export-result-v2.schema.json +0 -252
- package/dist/market-data-preparation/schemas/order-book-depth-summary-parquet-projection-v1.schema.json +0 -256
- package/dist/market-data-preparation/schemas/order-book-levels-parquet-projection-v1.schema.json +0 -220
- package/dist/market-data-preparation/schemas/preparation-product-pin-v2.schema.json +0 -176
- package/dist/market-data-preparation/schemas/promotion-receipt-v1.schema.json +0 -175
- package/dist/market-data-preparation/schemas/required-clock-v1.schema.json +0 -47
- package/dist/market-data-preparation/schemas/source-forensics-ledger-v1.schema.json +0 -463
- package/dist/market-data-preparation/schemas/source-qualification-record-v1.schema.json +0 -394
- package/dist/market-data-preparation.d.ts +0 -11
- package/dist/market-data-preparation.js +0 -37488
- package/dist/market-data-preparation.js.map +0 -277
- package/dist/market-data-vendor-backfill.d.ts +0 -21
- package/dist/market-data-vendor-backfill.js +0 -22463
- package/dist/market-data-vendor-backfill.js.map +0 -199
- package/dist/proto/node.descriptor.d.ts +0 -127
- package/dist/proto-loader-options.d.ts +0 -7
- package/dist/proto-package-definition.d.ts +0 -2
- package/dist/schemas/action-payloads.d.ts +0 -88
- package/dist/server.d.ts +0 -10
- package/dist/types.d.ts +0 -100
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../node_modules/ajv/dist/compile/codegen/code.js", "../node_modules/ajv/dist/compile/codegen/scope.js", "../node_modules/ajv/dist/compile/codegen/index.js", "../node_modules/ajv/dist/compile/util.js", "../node_modules/ajv/dist/compile/names.js", "../node_modules/ajv/dist/compile/errors.js", "../node_modules/ajv/dist/compile/validate/boolSchema.js", "../node_modules/ajv/dist/compile/rules.js", "../node_modules/ajv/dist/compile/validate/applicability.js", "../node_modules/ajv/dist/compile/validate/dataType.js", "../node_modules/ajv/dist/compile/validate/defaults.js", "../node_modules/ajv/dist/vocabularies/code.js", "../node_modules/ajv/dist/compile/validate/keyword.js", "../node_modules/ajv/dist/compile/validate/subschema.js", "../node_modules/fast-deep-equal/index.js", "../node_modules/json-schema-traverse/index.js", "../node_modules/ajv/dist/compile/resolve.js", "../node_modules/ajv/dist/compile/validate/index.js", "../node_modules/ajv/dist/runtime/validation_error.js", "../node_modules/ajv/dist/compile/ref_error.js", "../node_modules/ajv/dist/compile/index.js", "../node_modules/fast-uri/lib/utils.js", "../node_modules/fast-uri/lib/schemes.js", "../node_modules/fast-uri/index.js", "../node_modules/ajv/dist/runtime/uri.js", "../node_modules/ajv/dist/core.js", "../node_modules/ajv/dist/vocabularies/core/id.js", "../node_modules/ajv/dist/vocabularies/core/ref.js", "../node_modules/ajv/dist/vocabularies/core/index.js", "../node_modules/ajv/dist/vocabularies/validation/limitNumber.js", "../node_modules/ajv/dist/vocabularies/validation/multipleOf.js", "../node_modules/ajv/dist/runtime/ucs2length.js", "../node_modules/ajv/dist/vocabularies/validation/limitLength.js", "../node_modules/ajv/dist/vocabularies/validation/pattern.js", "../node_modules/ajv/dist/vocabularies/validation/limitProperties.js", "../node_modules/ajv/dist/vocabularies/validation/required.js", "../node_modules/ajv/dist/vocabularies/validation/limitItems.js", "../node_modules/ajv/dist/runtime/equal.js", "../node_modules/ajv/dist/vocabularies/validation/uniqueItems.js", "../node_modules/ajv/dist/vocabularies/validation/const.js", "../node_modules/ajv/dist/vocabularies/validation/enum.js", "../node_modules/ajv/dist/vocabularies/validation/index.js", "../node_modules/ajv/dist/vocabularies/applicator/additionalItems.js", "../node_modules/ajv/dist/vocabularies/applicator/items.js", "../node_modules/ajv/dist/vocabularies/applicator/prefixItems.js", "../node_modules/ajv/dist/vocabularies/applicator/items2020.js", "../node_modules/ajv/dist/vocabularies/applicator/contains.js", "../node_modules/ajv/dist/vocabularies/applicator/dependencies.js", "../node_modules/ajv/dist/vocabularies/applicator/propertyNames.js", "../node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js", "../node_modules/ajv/dist/vocabularies/applicator/properties.js", "../node_modules/ajv/dist/vocabularies/applicator/patternProperties.js", "../node_modules/ajv/dist/vocabularies/applicator/not.js", "../node_modules/ajv/dist/vocabularies/applicator/anyOf.js", "../node_modules/ajv/dist/vocabularies/applicator/oneOf.js", "../node_modules/ajv/dist/vocabularies/applicator/allOf.js", "../node_modules/ajv/dist/vocabularies/applicator/if.js", "../node_modules/ajv/dist/vocabularies/applicator/thenElse.js", "../node_modules/ajv/dist/vocabularies/applicator/index.js", "../node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js", "../node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js", "../node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js", "../node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js", "../node_modules/ajv/dist/vocabularies/dynamic/index.js", "../node_modules/ajv/dist/vocabularies/validation/dependentRequired.js", "../node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js", "../node_modules/ajv/dist/vocabularies/validation/limitContains.js", "../node_modules/ajv/dist/vocabularies/next.js", "../node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js", "../node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js", "../node_modules/ajv/dist/vocabularies/unevaluated/index.js", "../node_modules/ajv/dist/vocabularies/format/format.js", "../node_modules/ajv/dist/vocabularies/format/index.js", "../node_modules/ajv/dist/vocabularies/metadata.js", "../node_modules/ajv/dist/vocabularies/draft2020.js", "../node_modules/ajv/dist/vocabularies/discriminator/types.js", "../node_modules/ajv/dist/vocabularies/discriminator/index.js", "../node_modules/ajv/dist/refs/json-schema-2020-12/index.js", "../node_modules/ajv/dist/2020.js", "../node_modules/@opentelemetry/api/build/src/platform/node/globalThis.js", "../node_modules/@opentelemetry/api/build/src/platform/node/index.js", "../node_modules/@opentelemetry/api/build/src/platform/index.js", "../node_modules/@opentelemetry/api/build/src/version.js", "../node_modules/@opentelemetry/api/build/src/internal/semver.js", "../node_modules/@opentelemetry/api/build/src/internal/global-utils.js", "../node_modules/@opentelemetry/api/build/src/diag/ComponentLogger.js", "../node_modules/@opentelemetry/api/build/src/diag/types.js", "../node_modules/@opentelemetry/api/build/src/diag/internal/logLevelLogger.js", "../node_modules/@opentelemetry/api/build/src/api/diag.js", "../node_modules/@opentelemetry/api/build/src/baggage/internal/baggage-impl.js", "../node_modules/@opentelemetry/api/build/src/baggage/internal/symbol.js", "../node_modules/@opentelemetry/api/build/src/baggage/utils.js", "../node_modules/@opentelemetry/api/build/src/context/context.js", "../node_modules/@opentelemetry/api/build/src/diag/consoleLogger.js", "../node_modules/@opentelemetry/api/build/src/metrics/NoopMeter.js", "../node_modules/@opentelemetry/api/build/src/metrics/Metric.js", "../node_modules/@opentelemetry/api/build/src/propagation/TextMapPropagator.js", "../node_modules/@opentelemetry/api/build/src/context/NoopContextManager.js", "../node_modules/@opentelemetry/api/build/src/api/context.js", "../node_modules/@opentelemetry/api/build/src/trace/trace_flags.js", "../node_modules/@opentelemetry/api/build/src/trace/invalid-span-constants.js", "../node_modules/@opentelemetry/api/build/src/trace/NonRecordingSpan.js", "../node_modules/@opentelemetry/api/build/src/trace/context-utils.js", "../node_modules/@opentelemetry/api/build/src/trace/spancontext-utils.js", "../node_modules/@opentelemetry/api/build/src/trace/NoopTracer.js", "../node_modules/@opentelemetry/api/build/src/trace/ProxyTracer.js", "../node_modules/@opentelemetry/api/build/src/trace/NoopTracerProvider.js", "../node_modules/@opentelemetry/api/build/src/trace/ProxyTracerProvider.js", "../node_modules/@opentelemetry/api/build/src/trace/SamplingResult.js", "../node_modules/@opentelemetry/api/build/src/trace/span_kind.js", "../node_modules/@opentelemetry/api/build/src/trace/status.js", "../node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-validators.js", "../node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-impl.js", "../node_modules/@opentelemetry/api/build/src/trace/internal/utils.js", "../node_modules/@opentelemetry/api/build/src/context-api.js", "../node_modules/@opentelemetry/api/build/src/diag-api.js", "../node_modules/@opentelemetry/api/build/src/metrics/NoopMeterProvider.js", "../node_modules/@opentelemetry/api/build/src/api/metrics.js", "../node_modules/@opentelemetry/api/build/src/metrics-api.js", "../node_modules/@opentelemetry/api/build/src/propagation/NoopTextMapPropagator.js", "../node_modules/@opentelemetry/api/build/src/baggage/context-helpers.js", "../node_modules/@opentelemetry/api/build/src/api/propagation.js", "../node_modules/@opentelemetry/api/build/src/propagation-api.js", "../node_modules/@opentelemetry/api/build/src/api/trace.js", "../node_modules/@opentelemetry/api/build/src/trace-api.js", "../node_modules/@opentelemetry/api/build/src/index.js", "../src/helpers/market-data-vendor-backfill/contracts.ts", "../src/helpers/market-data-archive/capture-contract.ts", "../node_modules/@loglayer/plugin-opentelemetry/dist/index.mjs", "../node_modules/@loglayer/shared/dist/index.js", "../node_modules/@loglayer/transport/dist/index.js", "../node_modules/@loglayer/transport-tslog/dist/index.js", "../node_modules/@loglayer/plugin/dist/index.js", "../node_modules/@loglayer/context-manager/dist/index.js", "../node_modules/@loglayer/log-level-manager/dist/index.js", "../node_modules/loglayer/dist/index.js", "../node_modules/non-error/index.js", "../node_modules/serialize-error/error-constructors.js", "../node_modules/serialize-error/index.js", "../node_modules/tslog/dist/esm/prettyLogStyles.js", "../node_modules/tslog/dist/esm/formatTemplate.js", "../node_modules/tslog/dist/esm/formatNumberAddZeros.js", "../node_modules/tslog/dist/esm/urlToObj.js", "../node_modules/tslog/dist/esm/runtime/nodejs/index.js", "../node_modules/tslog/dist/esm/BaseLogger.js", "../node_modules/tslog/dist/esm/index.js", "../src/helpers/logger.ts", "../src/helpers/market-data-vendor-backfill/identity.ts", "../node_modules/canonicalize/lib/canonicalize.js", "../src/helpers/market-data-vendor-backfill/manifests.ts", "../src/helpers/market-data-archive/canonical-orderbook.ts", "../src/helpers/market-data-vendor-backfill/batching.ts", "../src/helpers/market-data-vendor-backfill/cryptohftdata.ts", "../node_modules/fzstd/esm/index.mjs", "../node_modules/hyparquet/src/constants.js", "../node_modules/hyparquet/src/wkb.js", "../node_modules/hyparquet/src/convert.js", "../node_modules/hyparquet/src/schema.js", "../node_modules/hyparquet/src/thrift.js", "../node_modules/hyparquet/src/geoparquet.js", "../node_modules/hyparquet/src/metadata.js", "../node_modules/hyparquet/src/indexes.js", "../node_modules/hyparquet/src/xxhash.js", "../node_modules/hyparquet/src/bloom.js", "../node_modules/hyparquet/src/utils.js", "../node_modules/hyparquet/src/filter.js", "../node_modules/hyparquet/src/plan.js", "../node_modules/hyparquet/src/variant.js", "../node_modules/hyparquet/src/assemble.js", "../node_modules/hyparquet/src/delta.js", "../node_modules/hyparquet/src/encoding.js", "../node_modules/hyparquet/src/plain.js", "../node_modules/hyparquet/src/snappy.js", "../node_modules/hyparquet/src/datapage.js", "../node_modules/hyparquet/src/column.js", "../node_modules/hyparquet/src/rowgroup.js", "../node_modules/hyparquet/src/read.js", "../src/helpers/market-data-vendor-backfill/semantic-verification.ts", "../src/helpers/source-tape.ts", "../src/helpers/market-data-vendor-backfill/promotion.ts", "../src/helpers/market-data-vendor-backfill/conformance-fixtures.ts", "../src/helpers/market-data-preparation/contracts.ts", "../src/helpers/market-data-preparation/conformance-fixtures.ts", "../src/helpers/market-data-source-forensics.ts", "../src/helpers/market-data-preparation/file-job.ts", "../src/helpers/market-data-vendor-backfill/selection.ts", "../src/helpers/market-data-vendor-backfill/archive-reader.ts", "../src/helpers/market-data-vendor-backfill/qualification.ts", "../src/helpers/market-data-vendor-backfill/core.ts", "../src/helpers/market-data-vendor-backfill/forwarder-client.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class\nclass _CodeOrName {\n}\nexports._CodeOrName = _CodeOrName;\nexports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;\nclass Name extends _CodeOrName {\n constructor(s) {\n super();\n if (!exports.IDENTIFIER.test(s))\n throw new Error(\"CodeGen: name must be a valid identifier\");\n this.str = s;\n }\n toString() {\n return this.str;\n }\n emptyStr() {\n return false;\n }\n get names() {\n return { [this.str]: 1 };\n }\n}\nexports.Name = Name;\nclass _Code extends _CodeOrName {\n constructor(code) {\n super();\n this._items = typeof code === \"string\" ? [code] : code;\n }\n toString() {\n return this.str;\n }\n emptyStr() {\n if (this._items.length > 1)\n return false;\n const item = this._items[0];\n return item === \"\" || item === '\"\"';\n }\n get str() {\n var _a;\n return ((_a = this._str) !== null && _a !== void 0 ? _a : (this._str = this._items.reduce((s, c) => `${s}${c}`, \"\")));\n }\n get names() {\n var _a;\n return ((_a = this._names) !== null && _a !== void 0 ? _a : (this._names = this._items.reduce((names, c) => {\n if (c instanceof Name)\n names[c.str] = (names[c.str] || 0) + 1;\n return names;\n }, {})));\n }\n}\nexports._Code = _Code;\nexports.nil = new _Code(\"\");\nfunction _(strs, ...args) {\n const code = [strs[0]];\n let i = 0;\n while (i < args.length) {\n addCodeArg(code, args[i]);\n code.push(strs[++i]);\n }\n return new _Code(code);\n}\nexports._ = _;\nconst plus = new _Code(\"+\");\nfunction str(strs, ...args) {\n const expr = [safeStringify(strs[0])];\n let i = 0;\n while (i < args.length) {\n expr.push(plus);\n addCodeArg(expr, args[i]);\n expr.push(plus, safeStringify(strs[++i]));\n }\n optimize(expr);\n return new _Code(expr);\n}\nexports.str = str;\nfunction addCodeArg(code, arg) {\n if (arg instanceof _Code)\n code.push(...arg._items);\n else if (arg instanceof Name)\n code.push(arg);\n else\n code.push(interpolate(arg));\n}\nexports.addCodeArg = addCodeArg;\nfunction optimize(expr) {\n let i = 1;\n while (i < expr.length - 1) {\n if (expr[i] === plus) {\n const res = mergeExprItems(expr[i - 1], expr[i + 1]);\n if (res !== undefined) {\n expr.splice(i - 1, 3, res);\n continue;\n }\n expr[i++] = \"+\";\n }\n i++;\n }\n}\nfunction mergeExprItems(a, b) {\n if (b === '\"\"')\n return a;\n if (a === '\"\"')\n return b;\n if (typeof a == \"string\") {\n if (b instanceof Name || a[a.length - 1] !== '\"')\n return;\n if (typeof b != \"string\")\n return `${a.slice(0, -1)}${b}\"`;\n if (b[0] === '\"')\n return a.slice(0, -1) + b.slice(1);\n return;\n }\n if (typeof b == \"string\" && b[0] === '\"' && !(a instanceof Name))\n return `\"${a}${b.slice(1)}`;\n return;\n}\nfunction strConcat(c1, c2) {\n return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str `${c1}${c2}`;\n}\nexports.strConcat = strConcat;\n// TODO do not allow arrays here\nfunction interpolate(x) {\n return typeof x == \"number\" || typeof x == \"boolean\" || x === null\n ? x\n : safeStringify(Array.isArray(x) ? x.join(\",\") : x);\n}\nfunction stringify(x) {\n return new _Code(safeStringify(x));\n}\nexports.stringify = stringify;\nfunction safeStringify(x) {\n return JSON.stringify(x)\n .replace(/\\u2028/g, \"\\\\u2028\")\n .replace(/\\u2029/g, \"\\\\u2029\");\n}\nexports.safeStringify = safeStringify;\nfunction getProperty(key) {\n return typeof key == \"string\" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _ `[${key}]`;\n}\nexports.getProperty = getProperty;\n//Does best effort to format the name properly\nfunction getEsmExportName(key) {\n if (typeof key == \"string\" && exports.IDENTIFIER.test(key)) {\n return new _Code(`${key}`);\n }\n throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`);\n}\nexports.getEsmExportName = getEsmExportName;\nfunction regexpCode(rx) {\n return new _Code(rx.toString());\n}\nexports.regexpCode = regexpCode;\n//# sourceMappingURL=code.js.map",
|
|
6
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0;\nconst code_1 = require(\"./code\");\nclass ValueError extends Error {\n constructor(name) {\n super(`CodeGen: \"code\" for ${name} not defined`);\n this.value = name.value;\n }\n}\nvar UsedValueState;\n(function (UsedValueState) {\n UsedValueState[UsedValueState[\"Started\"] = 0] = \"Started\";\n UsedValueState[UsedValueState[\"Completed\"] = 1] = \"Completed\";\n})(UsedValueState || (exports.UsedValueState = UsedValueState = {}));\nexports.varKinds = {\n const: new code_1.Name(\"const\"),\n let: new code_1.Name(\"let\"),\n var: new code_1.Name(\"var\"),\n};\nclass Scope {\n constructor({ prefixes, parent } = {}) {\n this._names = {};\n this._prefixes = prefixes;\n this._parent = parent;\n }\n toName(nameOrPrefix) {\n return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix);\n }\n name(prefix) {\n return new code_1.Name(this._newName(prefix));\n }\n _newName(prefix) {\n const ng = this._names[prefix] || this._nameGroup(prefix);\n return `${prefix}${ng.index++}`;\n }\n _nameGroup(prefix) {\n var _a, _b;\n if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || (this._prefixes && !this._prefixes.has(prefix))) {\n throw new Error(`CodeGen: prefix \"${prefix}\" is not allowed in this scope`);\n }\n return (this._names[prefix] = { prefix, index: 0 });\n }\n}\nexports.Scope = Scope;\nclass ValueScopeName extends code_1.Name {\n constructor(prefix, nameStr) {\n super(nameStr);\n this.prefix = prefix;\n }\n setValue(value, { property, itemIndex }) {\n this.value = value;\n this.scopePath = (0, code_1._) `.${new code_1.Name(property)}[${itemIndex}]`;\n }\n}\nexports.ValueScopeName = ValueScopeName;\nconst line = (0, code_1._) `\\n`;\nclass ValueScope extends Scope {\n constructor(opts) {\n super(opts);\n this._values = {};\n this._scope = opts.scope;\n this.opts = { ...opts, _n: opts.lines ? line : code_1.nil };\n }\n get() {\n return this._scope;\n }\n name(prefix) {\n return new ValueScopeName(prefix, this._newName(prefix));\n }\n value(nameOrPrefix, value) {\n var _a;\n if (value.ref === undefined)\n throw new Error(\"CodeGen: ref must be passed in value\");\n const name = this.toName(nameOrPrefix);\n const { prefix } = name;\n const valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref;\n let vs = this._values[prefix];\n if (vs) {\n const _name = vs.get(valueKey);\n if (_name)\n return _name;\n }\n else {\n vs = this._values[prefix] = new Map();\n }\n vs.set(valueKey, name);\n const s = this._scope[prefix] || (this._scope[prefix] = []);\n const itemIndex = s.length;\n s[itemIndex] = value.ref;\n name.setValue(value, { property: prefix, itemIndex });\n return name;\n }\n getValue(prefix, keyOrRef) {\n const vs = this._values[prefix];\n if (!vs)\n return;\n return vs.get(keyOrRef);\n }\n scopeRefs(scopeName, values = this._values) {\n return this._reduceValues(values, (name) => {\n if (name.scopePath === undefined)\n throw new Error(`CodeGen: name \"${name}\" has no value`);\n return (0, code_1._) `${scopeName}${name.scopePath}`;\n });\n }\n scopeCode(values = this._values, usedValues, getCode) {\n return this._reduceValues(values, (name) => {\n if (name.value === undefined)\n throw new Error(`CodeGen: name \"${name}\" has no value`);\n return name.value.code;\n }, usedValues, getCode);\n }\n _reduceValues(values, valueCode, usedValues = {}, getCode) {\n let code = code_1.nil;\n for (const prefix in values) {\n const vs = values[prefix];\n if (!vs)\n continue;\n const nameSet = (usedValues[prefix] = usedValues[prefix] || new Map());\n vs.forEach((name) => {\n if (nameSet.has(name))\n return;\n nameSet.set(name, UsedValueState.Started);\n let c = valueCode(name);\n if (c) {\n const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const;\n code = (0, code_1._) `${code}${def} ${name} = ${c};${this.opts._n}`;\n }\n else if ((c = getCode === null || getCode === void 0 ? void 0 : getCode(name))) {\n code = (0, code_1._) `${code}${c}${this.opts._n}`;\n }\n else {\n throw new ValueError(name);\n }\n nameSet.set(name, UsedValueState.Completed);\n });\n }\n return code;\n }\n}\nexports.ValueScope = ValueScope;\n//# sourceMappingURL=scope.js.map",
|
|
7
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0;\nconst code_1 = require(\"./code\");\nconst scope_1 = require(\"./scope\");\nvar code_2 = require(\"./code\");\nObject.defineProperty(exports, \"_\", { enumerable: true, get: function () { return code_2._; } });\nObject.defineProperty(exports, \"str\", { enumerable: true, get: function () { return code_2.str; } });\nObject.defineProperty(exports, \"strConcat\", { enumerable: true, get: function () { return code_2.strConcat; } });\nObject.defineProperty(exports, \"nil\", { enumerable: true, get: function () { return code_2.nil; } });\nObject.defineProperty(exports, \"getProperty\", { enumerable: true, get: function () { return code_2.getProperty; } });\nObject.defineProperty(exports, \"stringify\", { enumerable: true, get: function () { return code_2.stringify; } });\nObject.defineProperty(exports, \"regexpCode\", { enumerable: true, get: function () { return code_2.regexpCode; } });\nObject.defineProperty(exports, \"Name\", { enumerable: true, get: function () { return code_2.Name; } });\nvar scope_2 = require(\"./scope\");\nObject.defineProperty(exports, \"Scope\", { enumerable: true, get: function () { return scope_2.Scope; } });\nObject.defineProperty(exports, \"ValueScope\", { enumerable: true, get: function () { return scope_2.ValueScope; } });\nObject.defineProperty(exports, \"ValueScopeName\", { enumerable: true, get: function () { return scope_2.ValueScopeName; } });\nObject.defineProperty(exports, \"varKinds\", { enumerable: true, get: function () { return scope_2.varKinds; } });\nexports.operators = {\n GT: new code_1._Code(\">\"),\n GTE: new code_1._Code(\">=\"),\n LT: new code_1._Code(\"<\"),\n LTE: new code_1._Code(\"<=\"),\n EQ: new code_1._Code(\"===\"),\n NEQ: new code_1._Code(\"!==\"),\n NOT: new code_1._Code(\"!\"),\n OR: new code_1._Code(\"||\"),\n AND: new code_1._Code(\"&&\"),\n ADD: new code_1._Code(\"+\"),\n};\nclass Node {\n optimizeNodes() {\n return this;\n }\n optimizeNames(_names, _constants) {\n return this;\n }\n}\nclass Def extends Node {\n constructor(varKind, name, rhs) {\n super();\n this.varKind = varKind;\n this.name = name;\n this.rhs = rhs;\n }\n render({ es5, _n }) {\n const varKind = es5 ? scope_1.varKinds.var : this.varKind;\n const rhs = this.rhs === undefined ? \"\" : ` = ${this.rhs}`;\n return `${varKind} ${this.name}${rhs};` + _n;\n }\n optimizeNames(names, constants) {\n if (!names[this.name.str])\n return;\n if (this.rhs)\n this.rhs = optimizeExpr(this.rhs, names, constants);\n return this;\n }\n get names() {\n return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {};\n }\n}\nclass Assign extends Node {\n constructor(lhs, rhs, sideEffects) {\n super();\n this.lhs = lhs;\n this.rhs = rhs;\n this.sideEffects = sideEffects;\n }\n render({ _n }) {\n return `${this.lhs} = ${this.rhs};` + _n;\n }\n optimizeNames(names, constants) {\n if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)\n return;\n this.rhs = optimizeExpr(this.rhs, names, constants);\n return this;\n }\n get names() {\n const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names };\n return addExprNames(names, this.rhs);\n }\n}\nclass AssignOp extends Assign {\n constructor(lhs, op, rhs, sideEffects) {\n super(lhs, rhs, sideEffects);\n this.op = op;\n }\n render({ _n }) {\n return `${this.lhs} ${this.op}= ${this.rhs};` + _n;\n }\n}\nclass Label extends Node {\n constructor(label) {\n super();\n this.label = label;\n this.names = {};\n }\n render({ _n }) {\n return `${this.label}:` + _n;\n }\n}\nclass Break extends Node {\n constructor(label) {\n super();\n this.label = label;\n this.names = {};\n }\n render({ _n }) {\n const label = this.label ? ` ${this.label}` : \"\";\n return `break${label};` + _n;\n }\n}\nclass Throw extends Node {\n constructor(error) {\n super();\n this.error = error;\n }\n render({ _n }) {\n return `throw ${this.error};` + _n;\n }\n get names() {\n return this.error.names;\n }\n}\nclass AnyCode extends Node {\n constructor(code) {\n super();\n this.code = code;\n }\n render({ _n }) {\n return `${this.code};` + _n;\n }\n optimizeNodes() {\n return `${this.code}` ? this : undefined;\n }\n optimizeNames(names, constants) {\n this.code = optimizeExpr(this.code, names, constants);\n return this;\n }\n get names() {\n return this.code instanceof code_1._CodeOrName ? this.code.names : {};\n }\n}\nclass ParentNode extends Node {\n constructor(nodes = []) {\n super();\n this.nodes = nodes;\n }\n render(opts) {\n return this.nodes.reduce((code, n) => code + n.render(opts), \"\");\n }\n optimizeNodes() {\n const { nodes } = this;\n let i = nodes.length;\n while (i--) {\n const n = nodes[i].optimizeNodes();\n if (Array.isArray(n))\n nodes.splice(i, 1, ...n);\n else if (n)\n nodes[i] = n;\n else\n nodes.splice(i, 1);\n }\n return nodes.length > 0 ? this : undefined;\n }\n optimizeNames(names, constants) {\n const { nodes } = this;\n let i = nodes.length;\n while (i--) {\n // iterating backwards improves 1-pass optimization\n const n = nodes[i];\n if (n.optimizeNames(names, constants))\n continue;\n subtractNames(names, n.names);\n nodes.splice(i, 1);\n }\n return nodes.length > 0 ? this : undefined;\n }\n get names() {\n return this.nodes.reduce((names, n) => addNames(names, n.names), {});\n }\n}\nclass BlockNode extends ParentNode {\n render(opts) {\n return \"{\" + opts._n + super.render(opts) + \"}\" + opts._n;\n }\n}\nclass Root extends ParentNode {\n}\nclass Else extends BlockNode {\n}\nElse.kind = \"else\";\nclass If extends BlockNode {\n constructor(condition, nodes) {\n super(nodes);\n this.condition = condition;\n }\n render(opts) {\n let code = `if(${this.condition})` + super.render(opts);\n if (this.else)\n code += \"else \" + this.else.render(opts);\n return code;\n }\n optimizeNodes() {\n super.optimizeNodes();\n const cond = this.condition;\n if (cond === true)\n return this.nodes; // else is ignored here\n let e = this.else;\n if (e) {\n const ns = e.optimizeNodes();\n e = this.else = Array.isArray(ns) ? new Else(ns) : ns;\n }\n if (e) {\n if (cond === false)\n return e instanceof If ? e : e.nodes;\n if (this.nodes.length)\n return this;\n return new If(not(cond), e instanceof If ? [e] : e.nodes);\n }\n if (cond === false || !this.nodes.length)\n return undefined;\n return this;\n }\n optimizeNames(names, constants) {\n var _a;\n this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);\n if (!(super.optimizeNames(names, constants) || this.else))\n return;\n this.condition = optimizeExpr(this.condition, names, constants);\n return this;\n }\n get names() {\n const names = super.names;\n addExprNames(names, this.condition);\n if (this.else)\n addNames(names, this.else.names);\n return names;\n }\n}\nIf.kind = \"if\";\nclass For extends BlockNode {\n}\nFor.kind = \"for\";\nclass ForLoop extends For {\n constructor(iteration) {\n super();\n this.iteration = iteration;\n }\n render(opts) {\n return `for(${this.iteration})` + super.render(opts);\n }\n optimizeNames(names, constants) {\n if (!super.optimizeNames(names, constants))\n return;\n this.iteration = optimizeExpr(this.iteration, names, constants);\n return this;\n }\n get names() {\n return addNames(super.names, this.iteration.names);\n }\n}\nclass ForRange extends For {\n constructor(varKind, name, from, to) {\n super();\n this.varKind = varKind;\n this.name = name;\n this.from = from;\n this.to = to;\n }\n render(opts) {\n const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind;\n const { name, from, to } = this;\n return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts);\n }\n get names() {\n const names = addExprNames(super.names, this.from);\n return addExprNames(names, this.to);\n }\n}\nclass ForIter extends For {\n constructor(loop, varKind, name, iterable) {\n super();\n this.loop = loop;\n this.varKind = varKind;\n this.name = name;\n this.iterable = iterable;\n }\n render(opts) {\n return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);\n }\n optimizeNames(names, constants) {\n if (!super.optimizeNames(names, constants))\n return;\n this.iterable = optimizeExpr(this.iterable, names, constants);\n return this;\n }\n get names() {\n return addNames(super.names, this.iterable.names);\n }\n}\nclass Func extends BlockNode {\n constructor(name, args, async) {\n super();\n this.name = name;\n this.args = args;\n this.async = async;\n }\n render(opts) {\n const _async = this.async ? \"async \" : \"\";\n return `${_async}function ${this.name}(${this.args})` + super.render(opts);\n }\n}\nFunc.kind = \"func\";\nclass Return extends ParentNode {\n render(opts) {\n return \"return \" + super.render(opts);\n }\n}\nReturn.kind = \"return\";\nclass Try extends BlockNode {\n render(opts) {\n let code = \"try\" + super.render(opts);\n if (this.catch)\n code += this.catch.render(opts);\n if (this.finally)\n code += this.finally.render(opts);\n return code;\n }\n optimizeNodes() {\n var _a, _b;\n super.optimizeNodes();\n (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNodes();\n (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();\n return this;\n }\n optimizeNames(names, constants) {\n var _a, _b;\n super.optimizeNames(names, constants);\n (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);\n (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants);\n return this;\n }\n get names() {\n const names = super.names;\n if (this.catch)\n addNames(names, this.catch.names);\n if (this.finally)\n addNames(names, this.finally.names);\n return names;\n }\n}\nclass Catch extends BlockNode {\n constructor(error) {\n super();\n this.error = error;\n }\n render(opts) {\n return `catch(${this.error})` + super.render(opts);\n }\n}\nCatch.kind = \"catch\";\nclass Finally extends BlockNode {\n render(opts) {\n return \"finally\" + super.render(opts);\n }\n}\nFinally.kind = \"finally\";\nclass CodeGen {\n constructor(extScope, opts = {}) {\n this._values = {};\n this._blockStarts = [];\n this._constants = {};\n this.opts = { ...opts, _n: opts.lines ? \"\\n\" : \"\" };\n this._extScope = extScope;\n this._scope = new scope_1.Scope({ parent: extScope });\n this._nodes = [new Root()];\n }\n toString() {\n return this._root.render(this.opts);\n }\n // returns unique name in the internal scope\n name(prefix) {\n return this._scope.name(prefix);\n }\n // reserves unique name in the external scope\n scopeName(prefix) {\n return this._extScope.name(prefix);\n }\n // reserves unique name in the external scope and assigns value to it\n scopeValue(prefixOrName, value) {\n const name = this._extScope.value(prefixOrName, value);\n const vs = this._values[name.prefix] || (this._values[name.prefix] = new Set());\n vs.add(name);\n return name;\n }\n getScopeValue(prefix, keyOrRef) {\n return this._extScope.getValue(prefix, keyOrRef);\n }\n // return code that assigns values in the external scope to the names that are used internally\n // (same names that were returned by gen.scopeName or gen.scopeValue)\n scopeRefs(scopeName) {\n return this._extScope.scopeRefs(scopeName, this._values);\n }\n scopeCode() {\n return this._extScope.scopeCode(this._values);\n }\n _def(varKind, nameOrPrefix, rhs, constant) {\n const name = this._scope.toName(nameOrPrefix);\n if (rhs !== undefined && constant)\n this._constants[name.str] = rhs;\n this._leafNode(new Def(varKind, name, rhs));\n return name;\n }\n // `const` declaration (`var` in es5 mode)\n const(nameOrPrefix, rhs, _constant) {\n return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant);\n }\n // `let` declaration with optional assignment (`var` in es5 mode)\n let(nameOrPrefix, rhs, _constant) {\n return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant);\n }\n // `var` declaration with optional assignment\n var(nameOrPrefix, rhs, _constant) {\n return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant);\n }\n // assignment code\n assign(lhs, rhs, sideEffects) {\n return this._leafNode(new Assign(lhs, rhs, sideEffects));\n }\n // `+=` code\n add(lhs, rhs) {\n return this._leafNode(new AssignOp(lhs, exports.operators.ADD, rhs));\n }\n // appends passed SafeExpr to code or executes Block\n code(c) {\n if (typeof c == \"function\")\n c();\n else if (c !== code_1.nil)\n this._leafNode(new AnyCode(c));\n return this;\n }\n // returns code for object literal for the passed argument list of key-value pairs\n object(...keyValues) {\n const code = [\"{\"];\n for (const [key, value] of keyValues) {\n if (code.length > 1)\n code.push(\",\");\n code.push(key);\n if (key !== value || this.opts.es5) {\n code.push(\":\");\n (0, code_1.addCodeArg)(code, value);\n }\n }\n code.push(\"}\");\n return new code_1._Code(code);\n }\n // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)\n if(condition, thenBody, elseBody) {\n this._blockNode(new If(condition));\n if (thenBody && elseBody) {\n this.code(thenBody).else().code(elseBody).endIf();\n }\n else if (thenBody) {\n this.code(thenBody).endIf();\n }\n else if (elseBody) {\n throw new Error('CodeGen: \"else\" body without \"then\" body');\n }\n return this;\n }\n // `else if` clause - invalid without `if` or after `else` clauses\n elseIf(condition) {\n return this._elseNode(new If(condition));\n }\n // `else` clause - only valid after `if` or `else if` clauses\n else() {\n return this._elseNode(new Else());\n }\n // end `if` statement (needed if gen.if was used only with condition)\n endIf() {\n return this._endBlockNode(If, Else);\n }\n _for(node, forBody) {\n this._blockNode(node);\n if (forBody)\n this.code(forBody).endFor();\n return this;\n }\n // a generic `for` clause (or statement if `forBody` is passed)\n for(iteration, forBody) {\n return this._for(new ForLoop(iteration), forBody);\n }\n // `for` statement for a range of values\n forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) {\n const name = this._scope.toName(nameOrPrefix);\n return this._for(new ForRange(varKind, name, from, to), () => forBody(name));\n }\n // `for-of` statement (in es5 mode replace with a normal for loop)\n forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) {\n const name = this._scope.toName(nameOrPrefix);\n if (this.opts.es5) {\n const arr = iterable instanceof code_1.Name ? iterable : this.var(\"_arr\", iterable);\n return this.forRange(\"_i\", 0, (0, code_1._) `${arr}.length`, (i) => {\n this.var(name, (0, code_1._) `${arr}[${i}]`);\n forBody(name);\n });\n }\n return this._for(new ForIter(\"of\", varKind, name, iterable), () => forBody(name));\n }\n // `for-in` statement.\n // With option `ownProperties` replaced with a `for-of` loop for object keys\n forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) {\n if (this.opts.ownProperties) {\n return this.forOf(nameOrPrefix, (0, code_1._) `Object.keys(${obj})`, forBody);\n }\n const name = this._scope.toName(nameOrPrefix);\n return this._for(new ForIter(\"in\", varKind, name, obj), () => forBody(name));\n }\n // end `for` loop\n endFor() {\n return this._endBlockNode(For);\n }\n // `label` statement\n label(label) {\n return this._leafNode(new Label(label));\n }\n // `break` statement\n break(label) {\n return this._leafNode(new Break(label));\n }\n // `return` statement\n return(value) {\n const node = new Return();\n this._blockNode(node);\n this.code(value);\n if (node.nodes.length !== 1)\n throw new Error('CodeGen: \"return\" should have one node');\n return this._endBlockNode(Return);\n }\n // `try` statement\n try(tryBody, catchCode, finallyCode) {\n if (!catchCode && !finallyCode)\n throw new Error('CodeGen: \"try\" without \"catch\" and \"finally\"');\n const node = new Try();\n this._blockNode(node);\n this.code(tryBody);\n if (catchCode) {\n const error = this.name(\"e\");\n this._currNode = node.catch = new Catch(error);\n catchCode(error);\n }\n if (finallyCode) {\n this._currNode = node.finally = new Finally();\n this.code(finallyCode);\n }\n return this._endBlockNode(Catch, Finally);\n }\n // `throw` statement\n throw(error) {\n return this._leafNode(new Throw(error));\n }\n // start self-balancing block\n block(body, nodeCount) {\n this._blockStarts.push(this._nodes.length);\n if (body)\n this.code(body).endBlock(nodeCount);\n return this;\n }\n // end the current self-balancing block\n endBlock(nodeCount) {\n const len = this._blockStarts.pop();\n if (len === undefined)\n throw new Error(\"CodeGen: not in self-balancing block\");\n const toClose = this._nodes.length - len;\n if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) {\n throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`);\n }\n this._nodes.length = len;\n return this;\n }\n // `function` heading (or definition if funcBody is passed)\n func(name, args = code_1.nil, async, funcBody) {\n this._blockNode(new Func(name, args, async));\n if (funcBody)\n this.code(funcBody).endFunc();\n return this;\n }\n // end function definition\n endFunc() {\n return this._endBlockNode(Func);\n }\n optimize(n = 1) {\n while (n-- > 0) {\n this._root.optimizeNodes();\n this._root.optimizeNames(this._root.names, this._constants);\n }\n }\n _leafNode(node) {\n this._currNode.nodes.push(node);\n return this;\n }\n _blockNode(node) {\n this._currNode.nodes.push(node);\n this._nodes.push(node);\n }\n _endBlockNode(N1, N2) {\n const n = this._currNode;\n if (n instanceof N1 || (N2 && n instanceof N2)) {\n this._nodes.pop();\n return this;\n }\n throw new Error(`CodeGen: not in block \"${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}\"`);\n }\n _elseNode(node) {\n const n = this._currNode;\n if (!(n instanceof If)) {\n throw new Error('CodeGen: \"else\" without \"if\"');\n }\n this._currNode = n.else = node;\n return this;\n }\n get _root() {\n return this._nodes[0];\n }\n get _currNode() {\n const ns = this._nodes;\n return ns[ns.length - 1];\n }\n set _currNode(node) {\n const ns = this._nodes;\n ns[ns.length - 1] = node;\n }\n}\nexports.CodeGen = CodeGen;\nfunction addNames(names, from) {\n for (const n in from)\n names[n] = (names[n] || 0) + (from[n] || 0);\n return names;\n}\nfunction addExprNames(names, from) {\n return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;\n}\nfunction optimizeExpr(expr, names, constants) {\n if (expr instanceof code_1.Name)\n return replaceName(expr);\n if (!canOptimize(expr))\n return expr;\n return new code_1._Code(expr._items.reduce((items, c) => {\n if (c instanceof code_1.Name)\n c = replaceName(c);\n if (c instanceof code_1._Code)\n items.push(...c._items);\n else\n items.push(c);\n return items;\n }, []));\n function replaceName(n) {\n const c = constants[n.str];\n if (c === undefined || names[n.str] !== 1)\n return n;\n delete names[n.str];\n return c;\n }\n function canOptimize(e) {\n return (e instanceof code_1._Code &&\n e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== undefined));\n }\n}\nfunction subtractNames(names, from) {\n for (const n in from)\n names[n] = (names[n] || 0) - (from[n] || 0);\n}\nfunction not(x) {\n return typeof x == \"boolean\" || typeof x == \"number\" || x === null ? !x : (0, code_1._) `!${par(x)}`;\n}\nexports.not = not;\nconst andCode = mappend(exports.operators.AND);\n// boolean AND (&&) expression with the passed arguments\nfunction and(...args) {\n return args.reduce(andCode);\n}\nexports.and = and;\nconst orCode = mappend(exports.operators.OR);\n// boolean OR (||) expression with the passed arguments\nfunction or(...args) {\n return args.reduce(orCode);\n}\nexports.or = or;\nfunction mappend(op) {\n return (x, y) => (x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._) `${par(x)} ${op} ${par(y)}`);\n}\nfunction par(x) {\n return x instanceof code_1.Name ? x : (0, code_1._) `(${x})`;\n}\n//# sourceMappingURL=index.js.map",
|
|
8
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0;\nconst codegen_1 = require(\"./codegen\");\nconst code_1 = require(\"./codegen/code\");\n// TODO refactor to use Set\nfunction toHash(arr) {\n const hash = {};\n for (const item of arr)\n hash[item] = true;\n return hash;\n}\nexports.toHash = toHash;\nfunction alwaysValidSchema(it, schema) {\n if (typeof schema == \"boolean\")\n return schema;\n if (Object.keys(schema).length === 0)\n return true;\n checkUnknownRules(it, schema);\n return !schemaHasRules(schema, it.self.RULES.all);\n}\nexports.alwaysValidSchema = alwaysValidSchema;\nfunction checkUnknownRules(it, schema = it.schema) {\n const { opts, self } = it;\n if (!opts.strictSchema)\n return;\n if (typeof schema === \"boolean\")\n return;\n const rules = self.RULES.keywords;\n for (const key in schema) {\n if (!rules[key])\n checkStrictMode(it, `unknown keyword: \"${key}\"`);\n }\n}\nexports.checkUnknownRules = checkUnknownRules;\nfunction schemaHasRules(schema, rules) {\n if (typeof schema == \"boolean\")\n return !schema;\n for (const key in schema)\n if (rules[key])\n return true;\n return false;\n}\nexports.schemaHasRules = schemaHasRules;\nfunction schemaHasRulesButRef(schema, RULES) {\n if (typeof schema == \"boolean\")\n return !schema;\n for (const key in schema)\n if (key !== \"$ref\" && RULES.all[key])\n return true;\n return false;\n}\nexports.schemaHasRulesButRef = schemaHasRulesButRef;\nfunction schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) {\n if (!$data) {\n if (typeof schema == \"number\" || typeof schema == \"boolean\")\n return schema;\n if (typeof schema == \"string\")\n return (0, codegen_1._) `${schema}`;\n }\n return (0, codegen_1._) `${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;\n}\nexports.schemaRefOrVal = schemaRefOrVal;\nfunction unescapeFragment(str) {\n return unescapeJsonPointer(decodeURIComponent(str));\n}\nexports.unescapeFragment = unescapeFragment;\nfunction escapeFragment(str) {\n return encodeURIComponent(escapeJsonPointer(str));\n}\nexports.escapeFragment = escapeFragment;\nfunction escapeJsonPointer(str) {\n if (typeof str == \"number\")\n return `${str}`;\n return str.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n}\nexports.escapeJsonPointer = escapeJsonPointer;\nfunction unescapeJsonPointer(str) {\n return str.replace(/~1/g, \"/\").replace(/~0/g, \"~\");\n}\nexports.unescapeJsonPointer = unescapeJsonPointer;\nfunction eachItem(xs, f) {\n if (Array.isArray(xs)) {\n for (const x of xs)\n f(x);\n }\n else {\n f(xs);\n }\n}\nexports.eachItem = eachItem;\nfunction makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName, }) {\n return (gen, from, to, toName) => {\n const res = to === undefined\n ? from\n : to instanceof codegen_1.Name\n ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to)\n : from instanceof codegen_1.Name\n ? (mergeToName(gen, to, from), from)\n : mergeValues(from, to);\n return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res;\n };\n}\nexports.mergeEvaluated = {\n props: makeMergeEvaluated({\n mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => {\n gen.if((0, codegen_1._) `${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._) `${to} || {}`).code((0, codegen_1._) `Object.assign(${to}, ${from})`));\n }),\n mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => {\n if (from === true) {\n gen.assign(to, true);\n }\n else {\n gen.assign(to, (0, codegen_1._) `${to} || {}`);\n setEvaluated(gen, to, from);\n }\n }),\n mergeValues: (from, to) => (from === true ? true : { ...from, ...to }),\n resultToName: evaluatedPropsToName,\n }),\n items: makeMergeEvaluated({\n mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._) `${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)),\n mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._) `${to} > ${from} ? ${to} : ${from}`)),\n mergeValues: (from, to) => (from === true ? true : Math.max(from, to)),\n resultToName: (gen, items) => gen.var(\"items\", items),\n }),\n};\nfunction evaluatedPropsToName(gen, ps) {\n if (ps === true)\n return gen.var(\"props\", true);\n const props = gen.var(\"props\", (0, codegen_1._) `{}`);\n if (ps !== undefined)\n setEvaluated(gen, props, ps);\n return props;\n}\nexports.evaluatedPropsToName = evaluatedPropsToName;\nfunction setEvaluated(gen, props, ps) {\n Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._) `${props}${(0, codegen_1.getProperty)(p)}`, true));\n}\nexports.setEvaluated = setEvaluated;\nconst snippets = {};\nfunction useFunc(gen, f) {\n return gen.scopeValue(\"func\", {\n ref: f,\n code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code)),\n });\n}\nexports.useFunc = useFunc;\nvar Type;\n(function (Type) {\n Type[Type[\"Num\"] = 0] = \"Num\";\n Type[Type[\"Str\"] = 1] = \"Str\";\n})(Type || (exports.Type = Type = {}));\nfunction getErrorPath(dataProp, dataPropType, jsPropertySyntax) {\n // let path\n if (dataProp instanceof codegen_1.Name) {\n const isNumber = dataPropType === Type.Num;\n return jsPropertySyntax\n ? isNumber\n ? (0, codegen_1._) `\"[\" + ${dataProp} + \"]\"`\n : (0, codegen_1._) `\"['\" + ${dataProp} + \"']\"`\n : isNumber\n ? (0, codegen_1._) `\"/\" + ${dataProp}`\n : (0, codegen_1._) `\"/\" + ${dataProp}.replace(/~/g, \"~0\").replace(/\\\\//g, \"~1\")`; // TODO maybe use global escapePointer\n }\n return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : \"/\" + escapeJsonPointer(dataProp);\n}\nexports.getErrorPath = getErrorPath;\nfunction checkStrictMode(it, msg, mode = it.opts.strictSchema) {\n if (!mode)\n return;\n msg = `strict mode: ${msg}`;\n if (mode === true)\n throw new Error(msg);\n it.self.logger.warn(msg);\n}\nexports.checkStrictMode = checkStrictMode;\n//# sourceMappingURL=util.js.map",
|
|
9
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"./codegen\");\nconst names = {\n // validation function arguments\n data: new codegen_1.Name(\"data\"), // data passed to validation function\n // args passed from referencing schema\n valCxt: new codegen_1.Name(\"valCxt\"), // validation/data context - should not be used directly, it is destructured to the names below\n instancePath: new codegen_1.Name(\"instancePath\"),\n parentData: new codegen_1.Name(\"parentData\"),\n parentDataProperty: new codegen_1.Name(\"parentDataProperty\"),\n rootData: new codegen_1.Name(\"rootData\"), // root data - same as the data passed to the first/top validation function\n dynamicAnchors: new codegen_1.Name(\"dynamicAnchors\"), // used to support recursiveRef and dynamicRef\n // function scoped variables\n vErrors: new codegen_1.Name(\"vErrors\"), // null or array of validation errors\n errors: new codegen_1.Name(\"errors\"), // counter of validation errors\n this: new codegen_1.Name(\"this\"),\n // \"globals\"\n self: new codegen_1.Name(\"self\"),\n scope: new codegen_1.Name(\"scope\"),\n // JTD serialize/parse name for JSON string and position\n json: new codegen_1.Name(\"json\"),\n jsonPos: new codegen_1.Name(\"jsonPos\"),\n jsonLen: new codegen_1.Name(\"jsonLen\"),\n jsonPart: new codegen_1.Name(\"jsonPart\"),\n};\nexports.default = names;\n//# sourceMappingURL=names.js.map",
|
|
10
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0;\nconst codegen_1 = require(\"./codegen\");\nconst util_1 = require(\"./util\");\nconst names_1 = require(\"./names\");\nexports.keywordError = {\n message: ({ keyword }) => (0, codegen_1.str) `must pass \"${keyword}\" keyword validation`,\n};\nexports.keyword$DataError = {\n message: ({ keyword, schemaType }) => schemaType\n ? (0, codegen_1.str) `\"${keyword}\" keyword must be ${schemaType} ($data)`\n : (0, codegen_1.str) `\"${keyword}\" keyword is invalid ($data)`,\n};\nfunction reportError(cxt, error = exports.keywordError, errorPaths, overrideAllErrors) {\n const { it } = cxt;\n const { gen, compositeRule, allErrors } = it;\n const errObj = errorObjectCode(cxt, error, errorPaths);\n if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : (compositeRule || allErrors)) {\n addError(gen, errObj);\n }\n else {\n returnErrors(it, (0, codegen_1._) `[${errObj}]`);\n }\n}\nexports.reportError = reportError;\nfunction reportExtraError(cxt, error = exports.keywordError, errorPaths) {\n const { it } = cxt;\n const { gen, compositeRule, allErrors } = it;\n const errObj = errorObjectCode(cxt, error, errorPaths);\n addError(gen, errObj);\n if (!(compositeRule || allErrors)) {\n returnErrors(it, names_1.default.vErrors);\n }\n}\nexports.reportExtraError = reportExtraError;\nfunction resetErrorsCount(gen, errsCount) {\n gen.assign(names_1.default.errors, errsCount);\n gen.if((0, codegen_1._) `${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._) `${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null)));\n}\nexports.resetErrorsCount = resetErrorsCount;\nfunction extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }) {\n /* istanbul ignore if */\n if (errsCount === undefined)\n throw new Error(\"ajv implementation error\");\n const err = gen.name(\"err\");\n gen.forRange(\"i\", errsCount, names_1.default.errors, (i) => {\n gen.const(err, (0, codegen_1._) `${names_1.default.vErrors}[${i}]`);\n gen.if((0, codegen_1._) `${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._) `${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath)));\n gen.assign((0, codegen_1._) `${err}.schemaPath`, (0, codegen_1.str) `${it.errSchemaPath}/${keyword}`);\n if (it.opts.verbose) {\n gen.assign((0, codegen_1._) `${err}.schema`, schemaValue);\n gen.assign((0, codegen_1._) `${err}.data`, data);\n }\n });\n}\nexports.extendErrors = extendErrors;\nfunction addError(gen, errObj) {\n const err = gen.const(\"err\", errObj);\n gen.if((0, codegen_1._) `${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._) `[${err}]`), (0, codegen_1._) `${names_1.default.vErrors}.push(${err})`);\n gen.code((0, codegen_1._) `${names_1.default.errors}++`);\n}\nfunction returnErrors(it, errs) {\n const { gen, validateName, schemaEnv } = it;\n if (schemaEnv.$async) {\n gen.throw((0, codegen_1._) `new ${it.ValidationError}(${errs})`);\n }\n else {\n gen.assign((0, codegen_1._) `${validateName}.errors`, errs);\n gen.return(false);\n }\n}\nconst E = {\n keyword: new codegen_1.Name(\"keyword\"),\n schemaPath: new codegen_1.Name(\"schemaPath\"), // also used in JTD errors\n params: new codegen_1.Name(\"params\"),\n propertyName: new codegen_1.Name(\"propertyName\"),\n message: new codegen_1.Name(\"message\"),\n schema: new codegen_1.Name(\"schema\"),\n parentSchema: new codegen_1.Name(\"parentSchema\"),\n};\nfunction errorObjectCode(cxt, error, errorPaths) {\n const { createErrors } = cxt.it;\n if (createErrors === false)\n return (0, codegen_1._) `{}`;\n return errorObject(cxt, error, errorPaths);\n}\nfunction errorObject(cxt, error, errorPaths = {}) {\n const { gen, it } = cxt;\n const keyValues = [\n errorInstancePath(it, errorPaths),\n errorSchemaPath(cxt, errorPaths),\n ];\n extraErrorProps(cxt, error, keyValues);\n return gen.object(...keyValues);\n}\nfunction errorInstancePath({ errorPath }, { instancePath }) {\n const instPath = instancePath\n ? (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}`\n : errorPath;\n return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)];\n}\nfunction errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) {\n let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str) `${errSchemaPath}/${keyword}`;\n if (schemaPath) {\n schPath = (0, codegen_1.str) `${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`;\n }\n return [E.schemaPath, schPath];\n}\nfunction extraErrorProps(cxt, { params, message }, keyValues) {\n const { keyword, data, schemaValue, it } = cxt;\n const { opts, propertyName, topSchemaRef, schemaPath } = it;\n keyValues.push([E.keyword, keyword], [E.params, typeof params == \"function\" ? params(cxt) : params || (0, codegen_1._) `{}`]);\n if (opts.messages) {\n keyValues.push([E.message, typeof message == \"function\" ? message(cxt) : message]);\n }\n if (opts.verbose) {\n keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._) `${topSchemaRef}${schemaPath}`], [names_1.default.data, data]);\n }\n if (propertyName)\n keyValues.push([E.propertyName, propertyName]);\n}\n//# sourceMappingURL=errors.js.map",
|
|
11
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0;\nconst errors_1 = require(\"../errors\");\nconst codegen_1 = require(\"../codegen\");\nconst names_1 = require(\"../names\");\nconst boolError = {\n message: \"boolean schema is false\",\n};\nfunction topBoolOrEmptySchema(it) {\n const { gen, schema, validateName } = it;\n if (schema === false) {\n falseSchemaError(it, false);\n }\n else if (typeof schema == \"object\" && schema.$async === true) {\n gen.return(names_1.default.data);\n }\n else {\n gen.assign((0, codegen_1._) `${validateName}.errors`, null);\n gen.return(true);\n }\n}\nexports.topBoolOrEmptySchema = topBoolOrEmptySchema;\nfunction boolOrEmptySchema(it, valid) {\n const { gen, schema } = it;\n if (schema === false) {\n gen.var(valid, false); // TODO var\n falseSchemaError(it);\n }\n else {\n gen.var(valid, true); // TODO var\n }\n}\nexports.boolOrEmptySchema = boolOrEmptySchema;\nfunction falseSchemaError(it, overrideAllErrors) {\n const { gen, data } = it;\n // TODO maybe some other interface should be used for non-keyword validation errors...\n const cxt = {\n gen,\n keyword: \"false schema\",\n data,\n schema: false,\n schemaCode: false,\n schemaValue: false,\n params: {},\n it,\n };\n (0, errors_1.reportError)(cxt, boolError, undefined, overrideAllErrors);\n}\n//# sourceMappingURL=boolSchema.js.map",
|
|
12
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRules = exports.isJSONType = void 0;\nconst _jsonTypes = [\"string\", \"number\", \"integer\", \"boolean\", \"null\", \"object\", \"array\"];\nconst jsonTypes = new Set(_jsonTypes);\nfunction isJSONType(x) {\n return typeof x == \"string\" && jsonTypes.has(x);\n}\nexports.isJSONType = isJSONType;\nfunction getRules() {\n const groups = {\n number: { type: \"number\", rules: [] },\n string: { type: \"string\", rules: [] },\n array: { type: \"array\", rules: [] },\n object: { type: \"object\", rules: [] },\n };\n return {\n types: { ...groups, integer: true, boolean: true, null: true },\n rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object],\n post: { rules: [] },\n all: {},\n keywords: {},\n };\n}\nexports.getRules = getRules;\n//# sourceMappingURL=rules.js.map",
|
|
13
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0;\nfunction schemaHasRulesForType({ schema, self }, type) {\n const group = self.RULES.types[type];\n return group && group !== true && shouldUseGroup(schema, group);\n}\nexports.schemaHasRulesForType = schemaHasRulesForType;\nfunction shouldUseGroup(schema, group) {\n return group.rules.some((rule) => shouldUseRule(schema, rule));\n}\nexports.shouldUseGroup = shouldUseGroup;\nfunction shouldUseRule(schema, rule) {\n var _a;\n return (schema[rule.keyword] !== undefined ||\n ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== undefined)));\n}\nexports.shouldUseRule = shouldUseRule;\n//# sourceMappingURL=applicability.js.map",
|
|
14
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0;\nconst rules_1 = require(\"../rules\");\nconst applicability_1 = require(\"./applicability\");\nconst errors_1 = require(\"../errors\");\nconst codegen_1 = require(\"../codegen\");\nconst util_1 = require(\"../util\");\nvar DataType;\n(function (DataType) {\n DataType[DataType[\"Correct\"] = 0] = \"Correct\";\n DataType[DataType[\"Wrong\"] = 1] = \"Wrong\";\n})(DataType || (exports.DataType = DataType = {}));\nfunction getSchemaTypes(schema) {\n const types = getJSONTypes(schema.type);\n const hasNull = types.includes(\"null\");\n if (hasNull) {\n if (schema.nullable === false)\n throw new Error(\"type: null contradicts nullable: false\");\n }\n else {\n if (!types.length && schema.nullable !== undefined) {\n throw new Error('\"nullable\" cannot be used without \"type\"');\n }\n if (schema.nullable === true)\n types.push(\"null\");\n }\n return types;\n}\nexports.getSchemaTypes = getSchemaTypes;\n// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\nfunction getJSONTypes(ts) {\n const types = Array.isArray(ts) ? ts : ts ? [ts] : [];\n if (types.every(rules_1.isJSONType))\n return types;\n throw new Error(\"type must be JSONType or JSONType[]: \" + types.join(\",\"));\n}\nexports.getJSONTypes = getJSONTypes;\nfunction coerceAndCheckDataType(it, types) {\n const { gen, data, opts } = it;\n const coerceTo = coerceToTypes(types, opts.coerceTypes);\n const checkTypes = types.length > 0 &&\n !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0]));\n if (checkTypes) {\n const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong);\n gen.if(wrongType, () => {\n if (coerceTo.length)\n coerceData(it, types, coerceTo);\n else\n reportTypeError(it);\n });\n }\n return checkTypes;\n}\nexports.coerceAndCheckDataType = coerceAndCheckDataType;\nconst COERCIBLE = new Set([\"string\", \"number\", \"integer\", \"boolean\", \"null\"]);\nfunction coerceToTypes(types, coerceTypes) {\n return coerceTypes\n ? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === \"array\" && t === \"array\"))\n : [];\n}\nfunction coerceData(it, types, coerceTo) {\n const { gen, data, opts } = it;\n const dataType = gen.let(\"dataType\", (0, codegen_1._) `typeof ${data}`);\n const coerced = gen.let(\"coerced\", (0, codegen_1._) `undefined`);\n if (opts.coerceTypes === \"array\") {\n gen.if((0, codegen_1._) `${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen\n .assign(data, (0, codegen_1._) `${data}[0]`)\n .assign(dataType, (0, codegen_1._) `typeof ${data}`)\n .if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data)));\n }\n gen.if((0, codegen_1._) `${coerced} !== undefined`);\n for (const t of coerceTo) {\n if (COERCIBLE.has(t) || (t === \"array\" && opts.coerceTypes === \"array\")) {\n coerceSpecificType(t);\n }\n }\n gen.else();\n reportTypeError(it);\n gen.endIf();\n gen.if((0, codegen_1._) `${coerced} !== undefined`, () => {\n gen.assign(data, coerced);\n assignParentData(it, coerced);\n });\n function coerceSpecificType(t) {\n switch (t) {\n case \"string\":\n gen\n .elseIf((0, codegen_1._) `${dataType} == \"number\" || ${dataType} == \"boolean\"`)\n .assign(coerced, (0, codegen_1._) `\"\" + ${data}`)\n .elseIf((0, codegen_1._) `${data} === null`)\n .assign(coerced, (0, codegen_1._) `\"\"`);\n return;\n case \"number\":\n gen\n .elseIf((0, codegen_1._) `${dataType} == \"boolean\" || ${data} === null\n || (${dataType} == \"string\" && ${data} && ${data} == +${data})`)\n .assign(coerced, (0, codegen_1._) `+${data}`);\n return;\n case \"integer\":\n gen\n .elseIf((0, codegen_1._) `${dataType} === \"boolean\" || ${data} === null\n || (${dataType} === \"string\" && ${data} && ${data} == +${data} && !(${data} % 1))`)\n .assign(coerced, (0, codegen_1._) `+${data}`);\n return;\n case \"boolean\":\n gen\n .elseIf((0, codegen_1._) `${data} === \"false\" || ${data} === 0 || ${data} === null`)\n .assign(coerced, false)\n .elseIf((0, codegen_1._) `${data} === \"true\" || ${data} === 1`)\n .assign(coerced, true);\n return;\n case \"null\":\n gen.elseIf((0, codegen_1._) `${data} === \"\" || ${data} === 0 || ${data} === false`);\n gen.assign(coerced, null);\n return;\n case \"array\":\n gen\n .elseIf((0, codegen_1._) `${dataType} === \"string\" || ${dataType} === \"number\"\n || ${dataType} === \"boolean\" || ${data} === null`)\n .assign(coerced, (0, codegen_1._) `[${data}]`);\n }\n }\n}\nfunction assignParentData({ gen, parentData, parentDataProperty }, expr) {\n // TODO use gen.property\n gen.if((0, codegen_1._) `${parentData} !== undefined`, () => gen.assign((0, codegen_1._) `${parentData}[${parentDataProperty}]`, expr));\n}\nfunction checkDataType(dataType, data, strictNums, correct = DataType.Correct) {\n const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;\n let cond;\n switch (dataType) {\n case \"null\":\n return (0, codegen_1._) `${data} ${EQ} null`;\n case \"array\":\n cond = (0, codegen_1._) `Array.isArray(${data})`;\n break;\n case \"object\":\n cond = (0, codegen_1._) `${data} && typeof ${data} == \"object\" && !Array.isArray(${data})`;\n break;\n case \"integer\":\n cond = numCond((0, codegen_1._) `!(${data} % 1) && !isNaN(${data})`);\n break;\n case \"number\":\n cond = numCond();\n break;\n default:\n return (0, codegen_1._) `typeof ${data} ${EQ} ${dataType}`;\n }\n return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond);\n function numCond(_cond = codegen_1.nil) {\n return (0, codegen_1.and)((0, codegen_1._) `typeof ${data} == \"number\"`, _cond, strictNums ? (0, codegen_1._) `isFinite(${data})` : codegen_1.nil);\n }\n}\nexports.checkDataType = checkDataType;\nfunction checkDataTypes(dataTypes, data, strictNums, correct) {\n if (dataTypes.length === 1) {\n return checkDataType(dataTypes[0], data, strictNums, correct);\n }\n let cond;\n const types = (0, util_1.toHash)(dataTypes);\n if (types.array && types.object) {\n const notObj = (0, codegen_1._) `typeof ${data} != \"object\"`;\n cond = types.null ? notObj : (0, codegen_1._) `!${data} || ${notObj}`;\n delete types.null;\n delete types.array;\n delete types.object;\n }\n else {\n cond = codegen_1.nil;\n }\n if (types.number)\n delete types.integer;\n for (const t in types)\n cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct));\n return cond;\n}\nexports.checkDataTypes = checkDataTypes;\nconst typeError = {\n message: ({ schema }) => `must be ${schema}`,\n params: ({ schema, schemaValue }) => typeof schema == \"string\" ? (0, codegen_1._) `{type: ${schema}}` : (0, codegen_1._) `{type: ${schemaValue}}`,\n};\nfunction reportTypeError(it) {\n const cxt = getTypeErrorContext(it);\n (0, errors_1.reportError)(cxt, typeError);\n}\nexports.reportTypeError = reportTypeError;\nfunction getTypeErrorContext(it) {\n const { gen, data, schema } = it;\n const schemaCode = (0, util_1.schemaRefOrVal)(it, schema, \"type\");\n return {\n gen,\n keyword: \"type\",\n data,\n schema: schema.type,\n schemaCode,\n schemaValue: schemaCode,\n parentSchema: schema,\n params: {},\n it,\n };\n}\n//# sourceMappingURL=dataType.js.map",
|
|
15
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.assignDefaults = void 0;\nconst codegen_1 = require(\"../codegen\");\nconst util_1 = require(\"../util\");\nfunction assignDefaults(it, ty) {\n const { properties, items } = it.schema;\n if (ty === \"object\" && properties) {\n for (const key in properties) {\n assignDefault(it, key, properties[key].default);\n }\n }\n else if (ty === \"array\" && Array.isArray(items)) {\n items.forEach((sch, i) => assignDefault(it, i, sch.default));\n }\n}\nexports.assignDefaults = assignDefaults;\nfunction assignDefault(it, prop, defaultValue) {\n const { gen, compositeRule, data, opts } = it;\n if (defaultValue === undefined)\n return;\n const childData = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(prop)}`;\n if (compositeRule) {\n (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`);\n return;\n }\n let condition = (0, codegen_1._) `${childData} === undefined`;\n if (opts.useDefaults === \"empty\") {\n condition = (0, codegen_1._) `${condition} || ${childData} === null || ${childData} === \"\"`;\n }\n // `${childData} === undefined` +\n // (opts.useDefaults === \"empty\" ? ` || ${childData} === null || ${childData} === \"\"` : \"\")\n gen.if(condition, (0, codegen_1._) `${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);\n}\n//# sourceMappingURL=defaults.js.map",
|
|
16
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0;\nconst codegen_1 = require(\"../compile/codegen\");\nconst util_1 = require(\"../compile/util\");\nconst names_1 = require(\"../compile/names\");\nconst util_2 = require(\"../compile/util\");\nfunction checkReportMissingProp(cxt, prop) {\n const { gen, data, it } = cxt;\n gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => {\n cxt.setParams({ missingProperty: (0, codegen_1._) `${prop}` }, true);\n cxt.error();\n });\n}\nexports.checkReportMissingProp = checkReportMissingProp;\nfunction checkMissingProp({ gen, data, it: { opts } }, properties, missing) {\n return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._) `${missing} = ${prop}`)));\n}\nexports.checkMissingProp = checkMissingProp;\nfunction reportMissingProp(cxt, missing) {\n cxt.setParams({ missingProperty: missing }, true);\n cxt.error();\n}\nexports.reportMissingProp = reportMissingProp;\nfunction hasPropFunc(gen) {\n return gen.scopeValue(\"func\", {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n ref: Object.prototype.hasOwnProperty,\n code: (0, codegen_1._) `Object.prototype.hasOwnProperty`,\n });\n}\nexports.hasPropFunc = hasPropFunc;\nfunction isOwnProperty(gen, data, property) {\n return (0, codegen_1._) `${hasPropFunc(gen)}.call(${data}, ${property})`;\n}\nexports.isOwnProperty = isOwnProperty;\nfunction propertyInData(gen, data, property, ownProperties) {\n const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} !== undefined`;\n return ownProperties ? (0, codegen_1._) `${cond} && ${isOwnProperty(gen, data, property)}` : cond;\n}\nexports.propertyInData = propertyInData;\nfunction noPropertyInData(gen, data, property, ownProperties) {\n const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} === undefined`;\n return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond;\n}\nexports.noPropertyInData = noPropertyInData;\nfunction allSchemaProperties(schemaMap) {\n return schemaMap ? Object.keys(schemaMap).filter((p) => p !== \"__proto__\") : [];\n}\nexports.allSchemaProperties = allSchemaProperties;\nfunction schemaProperties(it, schemaMap) {\n return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p]));\n}\nexports.schemaProperties = schemaProperties;\nfunction callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {\n const dataAndSchema = passSchema ? (0, codegen_1._) `${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;\n const valCxt = [\n [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)],\n [names_1.default.parentData, it.parentData],\n [names_1.default.parentDataProperty, it.parentDataProperty],\n [names_1.default.rootData, names_1.default.rootData],\n ];\n if (it.opts.dynamicRef)\n valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]);\n const args = (0, codegen_1._) `${dataAndSchema}, ${gen.object(...valCxt)}`;\n return context !== codegen_1.nil ? (0, codegen_1._) `${func}.call(${context}, ${args})` : (0, codegen_1._) `${func}(${args})`;\n}\nexports.callValidateCode = callValidateCode;\nconst newRegExp = (0, codegen_1._) `new RegExp`;\nfunction usePattern({ gen, it: { opts } }, pattern) {\n const u = opts.unicodeRegExp ? \"u\" : \"\";\n const { regExp } = opts.code;\n const rx = regExp(pattern, u);\n return gen.scopeValue(\"pattern\", {\n key: rx.toString(),\n ref: rx,\n code: (0, codegen_1._) `${regExp.code === \"new RegExp\" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})`,\n });\n}\nexports.usePattern = usePattern;\nfunction validateArray(cxt) {\n const { gen, data, keyword, it } = cxt;\n const valid = gen.name(\"valid\");\n if (it.allErrors) {\n const validArr = gen.let(\"valid\", true);\n validateItems(() => gen.assign(validArr, false));\n return validArr;\n }\n gen.var(valid, true);\n validateItems(() => gen.break());\n return valid;\n function validateItems(notValid) {\n const len = gen.const(\"len\", (0, codegen_1._) `${data}.length`);\n gen.forRange(\"i\", 0, len, (i) => {\n cxt.subschema({\n keyword,\n dataProp: i,\n dataPropType: util_1.Type.Num,\n }, valid);\n gen.if((0, codegen_1.not)(valid), notValid);\n });\n }\n}\nexports.validateArray = validateArray;\nfunction validateUnion(cxt) {\n const { gen, schema, keyword, it } = cxt;\n /* istanbul ignore if */\n if (!Array.isArray(schema))\n throw new Error(\"ajv implementation error\");\n const alwaysValid = schema.some((sch) => (0, util_1.alwaysValidSchema)(it, sch));\n if (alwaysValid && !it.opts.unevaluated)\n return;\n const valid = gen.let(\"valid\", false);\n const schValid = gen.name(\"_valid\");\n gen.block(() => schema.forEach((_sch, i) => {\n const schCxt = cxt.subschema({\n keyword,\n schemaProp: i,\n compositeRule: true,\n }, schValid);\n gen.assign(valid, (0, codegen_1._) `${valid} || ${schValid}`);\n const merged = cxt.mergeValidEvaluated(schCxt, schValid);\n // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true)\n // or if all properties and items were evaluated (it.props === true && it.items === true)\n if (!merged)\n gen.if((0, codegen_1.not)(valid));\n }));\n cxt.result(valid, () => cxt.reset(), () => cxt.error(true));\n}\nexports.validateUnion = validateUnion;\n//# sourceMappingURL=code.js.map",
|
|
17
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = void 0;\nconst codegen_1 = require(\"../codegen\");\nconst names_1 = require(\"../names\");\nconst code_1 = require(\"../../vocabularies/code\");\nconst errors_1 = require(\"../errors\");\nfunction macroKeywordCode(cxt, def) {\n const { gen, keyword, schema, parentSchema, it } = cxt;\n const macroSchema = def.macro.call(it.self, schema, parentSchema, it);\n const schemaRef = useKeyword(gen, keyword, macroSchema);\n if (it.opts.validateSchema !== false)\n it.self.validateSchema(macroSchema, true);\n const valid = gen.name(\"valid\");\n cxt.subschema({\n schema: macroSchema,\n schemaPath: codegen_1.nil,\n errSchemaPath: `${it.errSchemaPath}/${keyword}`,\n topSchemaRef: schemaRef,\n compositeRule: true,\n }, valid);\n cxt.pass(valid, () => cxt.error(true));\n}\nexports.macroKeywordCode = macroKeywordCode;\nfunction funcKeywordCode(cxt, def) {\n var _a;\n const { gen, keyword, schema, parentSchema, $data, it } = cxt;\n checkAsyncKeyword(it, def);\n const validate = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate;\n const validateRef = useKeyword(gen, keyword, validate);\n const valid = gen.let(\"valid\");\n cxt.block$data(valid, validateKeyword);\n cxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid);\n function validateKeyword() {\n if (def.errors === false) {\n assignValid();\n if (def.modifying)\n modifyData(cxt);\n reportErrs(() => cxt.error());\n }\n else {\n const ruleErrs = def.async ? validateAsync() : validateSync();\n if (def.modifying)\n modifyData(cxt);\n reportErrs(() => addErrs(cxt, ruleErrs));\n }\n }\n function validateAsync() {\n const ruleErrs = gen.let(\"ruleErrs\", null);\n gen.try(() => assignValid((0, codegen_1._) `await `), (e) => gen.assign(valid, false).if((0, codegen_1._) `${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._) `${e}.errors`), () => gen.throw(e)));\n return ruleErrs;\n }\n function validateSync() {\n const validateErrs = (0, codegen_1._) `${validateRef}.errors`;\n gen.assign(validateErrs, null);\n assignValid(codegen_1.nil);\n return validateErrs;\n }\n function assignValid(_await = def.async ? (0, codegen_1._) `await ` : codegen_1.nil) {\n const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self;\n const passSchema = !((\"compile\" in def && !$data) || def.schema === false);\n gen.assign(valid, (0, codegen_1._) `${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying);\n }\n function reportErrs(errors) {\n var _a;\n gen.if((0, codegen_1.not)((_a = def.valid) !== null && _a !== void 0 ? _a : valid), errors);\n }\n}\nexports.funcKeywordCode = funcKeywordCode;\nfunction modifyData(cxt) {\n const { gen, data, it } = cxt;\n gen.if(it.parentData, () => gen.assign(data, (0, codegen_1._) `${it.parentData}[${it.parentDataProperty}]`));\n}\nfunction addErrs(cxt, errs) {\n const { gen } = cxt;\n gen.if((0, codegen_1._) `Array.isArray(${errs})`, () => {\n gen\n .assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`)\n .assign(names_1.default.errors, (0, codegen_1._) `${names_1.default.vErrors}.length`);\n (0, errors_1.extendErrors)(cxt);\n }, () => cxt.error());\n}\nfunction checkAsyncKeyword({ schemaEnv }, def) {\n if (def.async && !schemaEnv.$async)\n throw new Error(\"async keyword in sync schema\");\n}\nfunction useKeyword(gen, keyword, result) {\n if (result === undefined)\n throw new Error(`keyword \"${keyword}\" failed to compile`);\n return gen.scopeValue(\"keyword\", typeof result == \"function\" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) });\n}\nfunction validSchemaType(schema, schemaType, allowUndefined = false) {\n // TODO add tests\n return (!schemaType.length ||\n schemaType.some((st) => st === \"array\"\n ? Array.isArray(schema)\n : st === \"object\"\n ? schema && typeof schema == \"object\" && !Array.isArray(schema)\n : typeof schema == st || (allowUndefined && typeof schema == \"undefined\")));\n}\nexports.validSchemaType = validSchemaType;\nfunction validateKeywordUsage({ schema, opts, self, errSchemaPath }, def, keyword) {\n /* istanbul ignore if */\n if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) {\n throw new Error(\"ajv implementation error\");\n }\n const deps = def.dependencies;\n if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) {\n throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(\",\")}`);\n }\n if (def.validateSchema) {\n const valid = def.validateSchema(schema[keyword]);\n if (!valid) {\n const msg = `keyword \"${keyword}\" value is invalid at path \"${errSchemaPath}\": ` +\n self.errorsText(def.validateSchema.errors);\n if (opts.validateSchema === \"log\")\n self.logger.error(msg);\n else\n throw new Error(msg);\n }\n }\n}\nexports.validateKeywordUsage = validateKeywordUsage;\n//# sourceMappingURL=keyword.js.map",
|
|
18
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0;\nconst codegen_1 = require(\"../codegen\");\nconst util_1 = require(\"../util\");\nfunction getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) {\n if (keyword !== undefined && schema !== undefined) {\n throw new Error('both \"keyword\" and \"schema\" passed, only one allowed');\n }\n if (keyword !== undefined) {\n const sch = it.schema[keyword];\n return schemaProp === undefined\n ? {\n schema: sch,\n schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`,\n errSchemaPath: `${it.errSchemaPath}/${keyword}`,\n }\n : {\n schema: sch[schemaProp],\n schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`,\n errSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}`,\n };\n }\n if (schema !== undefined) {\n if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) {\n throw new Error('\"schemaPath\", \"errSchemaPath\" and \"topSchemaRef\" are required with \"schema\"');\n }\n return {\n schema,\n schemaPath,\n topSchemaRef,\n errSchemaPath,\n };\n }\n throw new Error('either \"keyword\" or \"schema\" must be passed');\n}\nexports.getSubschema = getSubschema;\nfunction extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) {\n if (data !== undefined && dataProp !== undefined) {\n throw new Error('both \"data\" and \"dataProp\" passed, only one allowed');\n }\n const { gen } = it;\n if (dataProp !== undefined) {\n const { errorPath, dataPathArr, opts } = it;\n const nextData = gen.let(\"data\", (0, codegen_1._) `${it.data}${(0, codegen_1.getProperty)(dataProp)}`, true);\n dataContextProps(nextData);\n subschema.errorPath = (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`;\n subschema.parentDataProperty = (0, codegen_1._) `${dataProp}`;\n subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty];\n }\n if (data !== undefined) {\n const nextData = data instanceof codegen_1.Name ? data : gen.let(\"data\", data, true); // replaceable if used once?\n dataContextProps(nextData);\n if (propertyName !== undefined)\n subschema.propertyName = propertyName;\n // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr\n }\n if (dataTypes)\n subschema.dataTypes = dataTypes;\n function dataContextProps(_nextData) {\n subschema.data = _nextData;\n subschema.dataLevel = it.dataLevel + 1;\n subschema.dataTypes = [];\n it.definedProperties = new Set();\n subschema.parentData = it.data;\n subschema.dataNames = [...it.dataNames, _nextData];\n }\n}\nexports.extendSubschemaData = extendSubschemaData;\nfunction extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) {\n if (compositeRule !== undefined)\n subschema.compositeRule = compositeRule;\n if (createErrors !== undefined)\n subschema.createErrors = createErrors;\n if (allErrors !== undefined)\n subschema.allErrors = allErrors;\n subschema.jtdDiscriminator = jtdDiscriminator; // not inherited\n subschema.jtdMetadata = jtdMetadata; // not inherited\n}\nexports.extendSubschemaMode = extendSubschemaMode;\n//# sourceMappingURL=subschema.js.map",
|
|
19
|
-
"'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n",
|
|
20
|
-
"'use strict';\n\nvar traverse = module.exports = function (schema, opts, cb) {\n // Legacy support for v0.3.1 and earlier.\n if (typeof opts == 'function') {\n cb = opts;\n opts = {};\n }\n\n cb = opts.cb || cb;\n var pre = (typeof cb == 'function') ? cb : cb.pre || function() {};\n var post = cb.post || function() {};\n\n _traverse(opts, pre, post, schema, '', schema);\n};\n\n\ntraverse.keywords = {\n additionalItems: true,\n items: true,\n contains: true,\n additionalProperties: true,\n propertyNames: true,\n not: true,\n if: true,\n then: true,\n else: true\n};\n\ntraverse.arrayKeywords = {\n items: true,\n allOf: true,\n anyOf: true,\n oneOf: true\n};\n\ntraverse.propsKeywords = {\n $defs: true,\n definitions: true,\n properties: true,\n patternProperties: true,\n dependencies: true\n};\n\ntraverse.skipKeywords = {\n default: true,\n enum: true,\n const: true,\n required: true,\n maximum: true,\n minimum: true,\n exclusiveMaximum: true,\n exclusiveMinimum: true,\n multipleOf: true,\n maxLength: true,\n minLength: true,\n pattern: true,\n format: true,\n maxItems: true,\n minItems: true,\n uniqueItems: true,\n maxProperties: true,\n minProperties: true\n};\n\n\nfunction _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {\n if (schema && typeof schema == 'object' && !Array.isArray(schema)) {\n pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n for (var key in schema) {\n var sch = schema[key];\n if (Array.isArray(sch)) {\n if (key in traverse.arrayKeywords) {\n for (var i=0; i<sch.length; i++)\n _traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);\n }\n } else if (key in traverse.propsKeywords) {\n if (sch && typeof sch == 'object') {\n for (var prop in sch)\n _traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);\n }\n } else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {\n _traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);\n }\n }\n post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n }\n}\n\n\nfunction escapeJsonPtr(str) {\n return str.replace(/~/g, '~0').replace(/\\//g, '~1');\n}\n",
|
|
21
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0;\nconst util_1 = require(\"./util\");\nconst equal = require(\"fast-deep-equal\");\nconst traverse = require(\"json-schema-traverse\");\n// TODO refactor to use keyword definitions\nconst SIMPLE_INLINED = new Set([\n \"type\",\n \"format\",\n \"pattern\",\n \"maxLength\",\n \"minLength\",\n \"maxProperties\",\n \"minProperties\",\n \"maxItems\",\n \"minItems\",\n \"maximum\",\n \"minimum\",\n \"uniqueItems\",\n \"multipleOf\",\n \"required\",\n \"enum\",\n \"const\",\n]);\nfunction inlineRef(schema, limit = true) {\n if (typeof schema == \"boolean\")\n return true;\n if (limit === true)\n return !hasRef(schema);\n if (!limit)\n return false;\n return countKeys(schema) <= limit;\n}\nexports.inlineRef = inlineRef;\nconst REF_KEYWORDS = new Set([\n \"$ref\",\n \"$recursiveRef\",\n \"$recursiveAnchor\",\n \"$dynamicRef\",\n \"$dynamicAnchor\",\n]);\nfunction hasRef(schema) {\n for (const key in schema) {\n if (REF_KEYWORDS.has(key))\n return true;\n const sch = schema[key];\n if (Array.isArray(sch) && sch.some(hasRef))\n return true;\n if (typeof sch == \"object\" && hasRef(sch))\n return true;\n }\n return false;\n}\nfunction countKeys(schema) {\n let count = 0;\n for (const key in schema) {\n if (key === \"$ref\")\n return Infinity;\n count++;\n if (SIMPLE_INLINED.has(key))\n continue;\n if (typeof schema[key] == \"object\") {\n (0, util_1.eachItem)(schema[key], (sch) => (count += countKeys(sch)));\n }\n if (count === Infinity)\n return Infinity;\n }\n return count;\n}\nfunction getFullPath(resolver, id = \"\", normalize) {\n if (normalize !== false)\n id = normalizeId(id);\n const p = resolver.parse(id);\n return _getFullPath(resolver, p);\n}\nexports.getFullPath = getFullPath;\nfunction _getFullPath(resolver, p) {\n const serialized = resolver.serialize(p);\n return serialized.split(\"#\")[0] + \"#\";\n}\nexports._getFullPath = _getFullPath;\nconst TRAILING_SLASH_HASH = /#\\/?$/;\nfunction normalizeId(id) {\n return id ? id.replace(TRAILING_SLASH_HASH, \"\") : \"\";\n}\nexports.normalizeId = normalizeId;\nfunction resolveUrl(resolver, baseId, id) {\n id = normalizeId(id);\n return resolver.resolve(baseId, id);\n}\nexports.resolveUrl = resolveUrl;\nconst ANCHOR = /^[a-z_][-a-z0-9._]*$/i;\nfunction getSchemaRefs(schema, baseId) {\n if (typeof schema == \"boolean\")\n return {};\n const { schemaId, uriResolver } = this.opts;\n const schId = normalizeId(schema[schemaId] || baseId);\n const baseIds = { \"\": schId };\n const pathPrefix = getFullPath(uriResolver, schId, false);\n const localRefs = {};\n const schemaRefs = new Set();\n traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => {\n if (parentJsonPtr === undefined)\n return;\n const fullPath = pathPrefix + jsonPtr;\n let innerBaseId = baseIds[parentJsonPtr];\n if (typeof sch[schemaId] == \"string\")\n innerBaseId = addRef.call(this, sch[schemaId]);\n addAnchor.call(this, sch.$anchor);\n addAnchor.call(this, sch.$dynamicAnchor);\n baseIds[jsonPtr] = innerBaseId;\n function addRef(ref) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const _resolve = this.opts.uriResolver.resolve;\n ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref);\n if (schemaRefs.has(ref))\n throw ambiguos(ref);\n schemaRefs.add(ref);\n let schOrRef = this.refs[ref];\n if (typeof schOrRef == \"string\")\n schOrRef = this.refs[schOrRef];\n if (typeof schOrRef == \"object\") {\n checkAmbiguosRef(sch, schOrRef.schema, ref);\n }\n else if (ref !== normalizeId(fullPath)) {\n if (ref[0] === \"#\") {\n checkAmbiguosRef(sch, localRefs[ref], ref);\n localRefs[ref] = sch;\n }\n else {\n this.refs[ref] = fullPath;\n }\n }\n return ref;\n }\n function addAnchor(anchor) {\n if (typeof anchor == \"string\") {\n if (!ANCHOR.test(anchor))\n throw new Error(`invalid anchor \"${anchor}\"`);\n addRef.call(this, `#${anchor}`);\n }\n }\n });\n return localRefs;\n function checkAmbiguosRef(sch1, sch2, ref) {\n if (sch2 !== undefined && !equal(sch1, sch2))\n throw ambiguos(ref);\n }\n function ambiguos(ref) {\n return new Error(`reference \"${ref}\" resolves to more than one schema`);\n }\n}\nexports.getSchemaRefs = getSchemaRefs;\n//# sourceMappingURL=resolve.js.map",
|
|
22
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getData = exports.KeywordCxt = exports.validateFunctionCode = void 0;\nconst boolSchema_1 = require(\"./boolSchema\");\nconst dataType_1 = require(\"./dataType\");\nconst applicability_1 = require(\"./applicability\");\nconst dataType_2 = require(\"./dataType\");\nconst defaults_1 = require(\"./defaults\");\nconst keyword_1 = require(\"./keyword\");\nconst subschema_1 = require(\"./subschema\");\nconst codegen_1 = require(\"../codegen\");\nconst names_1 = require(\"../names\");\nconst resolve_1 = require(\"../resolve\");\nconst util_1 = require(\"../util\");\nconst errors_1 = require(\"../errors\");\n// schema compilation - generates validation function, subschemaCode (below) is used for subschemas\nfunction validateFunctionCode(it) {\n if (isSchemaObj(it)) {\n checkKeywords(it);\n if (schemaCxtHasRules(it)) {\n topSchemaObjCode(it);\n return;\n }\n }\n validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it));\n}\nexports.validateFunctionCode = validateFunctionCode;\nfunction validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) {\n if (opts.code.es5) {\n gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => {\n gen.code((0, codegen_1._) `\"use strict\"; ${funcSourceUrl(schema, opts)}`);\n destructureValCxtES5(gen, opts);\n gen.code(body);\n });\n }\n else {\n gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body));\n }\n}\nfunction destructureValCxt(opts) {\n return (0, codegen_1._) `{${names_1.default.instancePath}=\"\", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._) `, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`;\n}\nfunction destructureValCxtES5(gen, opts) {\n gen.if(names_1.default.valCxt, () => {\n gen.var(names_1.default.instancePath, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.instancePath}`);\n gen.var(names_1.default.parentData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentData}`);\n gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentDataProperty}`);\n gen.var(names_1.default.rootData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.rootData}`);\n if (opts.dynamicRef)\n gen.var(names_1.default.dynamicAnchors, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`);\n }, () => {\n gen.var(names_1.default.instancePath, (0, codegen_1._) `\"\"`);\n gen.var(names_1.default.parentData, (0, codegen_1._) `undefined`);\n gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `undefined`);\n gen.var(names_1.default.rootData, names_1.default.data);\n if (opts.dynamicRef)\n gen.var(names_1.default.dynamicAnchors, (0, codegen_1._) `{}`);\n });\n}\nfunction topSchemaObjCode(it) {\n const { schema, opts, gen } = it;\n validateFunction(it, () => {\n if (opts.$comment && schema.$comment)\n commentKeyword(it);\n checkNoDefault(it);\n gen.let(names_1.default.vErrors, null);\n gen.let(names_1.default.errors, 0);\n if (opts.unevaluated)\n resetEvaluated(it);\n typeAndKeywords(it);\n returnResults(it);\n });\n return;\n}\nfunction resetEvaluated(it) {\n // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated\n const { gen, validateName } = it;\n it.evaluated = gen.const(\"evaluated\", (0, codegen_1._) `${validateName}.evaluated`);\n gen.if((0, codegen_1._) `${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._) `${it.evaluated}.props`, (0, codegen_1._) `undefined`));\n gen.if((0, codegen_1._) `${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._) `${it.evaluated}.items`, (0, codegen_1._) `undefined`));\n}\nfunction funcSourceUrl(schema, opts) {\n const schId = typeof schema == \"object\" && schema[opts.schemaId];\n return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._) `/*# sourceURL=${schId} */` : codegen_1.nil;\n}\n// schema compilation - this function is used recursively to generate code for sub-schemas\nfunction subschemaCode(it, valid) {\n if (isSchemaObj(it)) {\n checkKeywords(it);\n if (schemaCxtHasRules(it)) {\n subSchemaObjCode(it, valid);\n return;\n }\n }\n (0, boolSchema_1.boolOrEmptySchema)(it, valid);\n}\nfunction schemaCxtHasRules({ schema, self }) {\n if (typeof schema == \"boolean\")\n return !schema;\n for (const key in schema)\n if (self.RULES.all[key])\n return true;\n return false;\n}\nfunction isSchemaObj(it) {\n return typeof it.schema != \"boolean\";\n}\nfunction subSchemaObjCode(it, valid) {\n const { schema, gen, opts } = it;\n if (opts.$comment && schema.$comment)\n commentKeyword(it);\n updateContext(it);\n checkAsyncSchema(it);\n const errsCount = gen.const(\"_errs\", names_1.default.errors);\n typeAndKeywords(it, errsCount);\n // TODO var\n gen.var(valid, (0, codegen_1._) `${errsCount} === ${names_1.default.errors}`);\n}\nfunction checkKeywords(it) {\n (0, util_1.checkUnknownRules)(it);\n checkRefsAndKeywords(it);\n}\nfunction typeAndKeywords(it, errsCount) {\n if (it.opts.jtd)\n return schemaKeywords(it, [], false, errsCount);\n const types = (0, dataType_1.getSchemaTypes)(it.schema);\n const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types);\n schemaKeywords(it, types, !checkedTypes, errsCount);\n}\nfunction checkRefsAndKeywords(it) {\n const { schema, errSchemaPath, opts, self } = it;\n if (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self.RULES)) {\n self.logger.warn(`$ref: keywords ignored in schema at path \"${errSchemaPath}\"`);\n }\n}\nfunction checkNoDefault(it) {\n const { schema, opts } = it;\n if (schema.default !== undefined && opts.useDefaults && opts.strictSchema) {\n (0, util_1.checkStrictMode)(it, \"default is ignored in the schema root\");\n }\n}\nfunction updateContext(it) {\n const schId = it.schema[it.opts.schemaId];\n if (schId)\n it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId);\n}\nfunction checkAsyncSchema(it) {\n if (it.schema.$async && !it.schemaEnv.$async)\n throw new Error(\"async schema in sync schema\");\n}\nfunction commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) {\n const msg = schema.$comment;\n if (opts.$comment === true) {\n gen.code((0, codegen_1._) `${names_1.default.self}.logger.log(${msg})`);\n }\n else if (typeof opts.$comment == \"function\") {\n const schemaPath = (0, codegen_1.str) `${errSchemaPath}/$comment`;\n const rootName = gen.scopeValue(\"root\", { ref: schemaEnv.root });\n gen.code((0, codegen_1._) `${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`);\n }\n}\nfunction returnResults(it) {\n const { gen, schemaEnv, validateName, ValidationError, opts } = it;\n if (schemaEnv.$async) {\n // TODO assign unevaluated\n gen.if((0, codegen_1._) `${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._) `new ${ValidationError}(${names_1.default.vErrors})`));\n }\n else {\n gen.assign((0, codegen_1._) `${validateName}.errors`, names_1.default.vErrors);\n if (opts.unevaluated)\n assignEvaluated(it);\n gen.return((0, codegen_1._) `${names_1.default.errors} === 0`);\n }\n}\nfunction assignEvaluated({ gen, evaluated, props, items }) {\n if (props instanceof codegen_1.Name)\n gen.assign((0, codegen_1._) `${evaluated}.props`, props);\n if (items instanceof codegen_1.Name)\n gen.assign((0, codegen_1._) `${evaluated}.items`, items);\n}\nfunction schemaKeywords(it, types, typeErrors, errsCount) {\n const { gen, schema, data, allErrors, opts, self } = it;\n const { RULES } = self;\n if (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) {\n gen.block(() => keywordCode(it, \"$ref\", RULES.all.$ref.definition)); // TODO typecast\n return;\n }\n if (!opts.jtd)\n checkStrictTypes(it, types);\n gen.block(() => {\n for (const group of RULES.rules)\n groupKeywords(group);\n groupKeywords(RULES.post);\n });\n function groupKeywords(group) {\n if (!(0, applicability_1.shouldUseGroup)(schema, group))\n return;\n if (group.type) {\n gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers));\n iterateKeywords(it, group);\n if (types.length === 1 && types[0] === group.type && typeErrors) {\n gen.else();\n (0, dataType_2.reportTypeError)(it);\n }\n gen.endIf();\n }\n else {\n iterateKeywords(it, group);\n }\n // TODO make it \"ok\" call?\n if (!allErrors)\n gen.if((0, codegen_1._) `${names_1.default.errors} === ${errsCount || 0}`);\n }\n}\nfunction iterateKeywords(it, group) {\n const { gen, schema, opts: { useDefaults }, } = it;\n if (useDefaults)\n (0, defaults_1.assignDefaults)(it, group.type);\n gen.block(() => {\n for (const rule of group.rules) {\n if ((0, applicability_1.shouldUseRule)(schema, rule)) {\n keywordCode(it, rule.keyword, rule.definition, group.type);\n }\n }\n });\n}\nfunction checkStrictTypes(it, types) {\n if (it.schemaEnv.meta || !it.opts.strictTypes)\n return;\n checkContextTypes(it, types);\n if (!it.opts.allowUnionTypes)\n checkMultipleTypes(it, types);\n checkKeywordTypes(it, it.dataTypes);\n}\nfunction checkContextTypes(it, types) {\n if (!types.length)\n return;\n if (!it.dataTypes.length) {\n it.dataTypes = types;\n return;\n }\n types.forEach((t) => {\n if (!includesType(it.dataTypes, t)) {\n strictTypesError(it, `type \"${t}\" not allowed by context \"${it.dataTypes.join(\",\")}\"`);\n }\n });\n narrowSchemaTypes(it, types);\n}\nfunction checkMultipleTypes(it, ts) {\n if (ts.length > 1 && !(ts.length === 2 && ts.includes(\"null\"))) {\n strictTypesError(it, \"use allowUnionTypes to allow union type keyword\");\n }\n}\nfunction checkKeywordTypes(it, ts) {\n const rules = it.self.RULES.all;\n for (const keyword in rules) {\n const rule = rules[keyword];\n if (typeof rule == \"object\" && (0, applicability_1.shouldUseRule)(it.schema, rule)) {\n const { type } = rule.definition;\n if (type.length && !type.some((t) => hasApplicableType(ts, t))) {\n strictTypesError(it, `missing type \"${type.join(\",\")}\" for keyword \"${keyword}\"`);\n }\n }\n }\n}\nfunction hasApplicableType(schTs, kwdT) {\n return schTs.includes(kwdT) || (kwdT === \"number\" && schTs.includes(\"integer\"));\n}\nfunction includesType(ts, t) {\n return ts.includes(t) || (t === \"integer\" && ts.includes(\"number\"));\n}\nfunction narrowSchemaTypes(it, withTypes) {\n const ts = [];\n for (const t of it.dataTypes) {\n if (includesType(withTypes, t))\n ts.push(t);\n else if (withTypes.includes(\"integer\") && t === \"number\")\n ts.push(\"integer\");\n }\n it.dataTypes = ts;\n}\nfunction strictTypesError(it, msg) {\n const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;\n msg += ` at \"${schemaPath}\" (strictTypes)`;\n (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes);\n}\nclass KeywordCxt {\n constructor(it, def, keyword) {\n (0, keyword_1.validateKeywordUsage)(it, def, keyword);\n this.gen = it.gen;\n this.allErrors = it.allErrors;\n this.keyword = keyword;\n this.data = it.data;\n this.schema = it.schema[keyword];\n this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data;\n this.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword, this.$data);\n this.schemaType = def.schemaType;\n this.parentSchema = it.schema;\n this.params = {};\n this.it = it;\n this.def = def;\n if (this.$data) {\n this.schemaCode = it.gen.const(\"vSchema\", getData(this.$data, it));\n }\n else {\n this.schemaCode = this.schemaValue;\n if (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) {\n throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`);\n }\n }\n if (\"code\" in def ? def.trackErrors : def.errors !== false) {\n this.errsCount = it.gen.const(\"_errs\", names_1.default.errors);\n }\n }\n result(condition, successAction, failAction) {\n this.failResult((0, codegen_1.not)(condition), successAction, failAction);\n }\n failResult(condition, successAction, failAction) {\n this.gen.if(condition);\n if (failAction)\n failAction();\n else\n this.error();\n if (successAction) {\n this.gen.else();\n successAction();\n if (this.allErrors)\n this.gen.endIf();\n }\n else {\n if (this.allErrors)\n this.gen.endIf();\n else\n this.gen.else();\n }\n }\n pass(condition, failAction) {\n this.failResult((0, codegen_1.not)(condition), undefined, failAction);\n }\n fail(condition) {\n if (condition === undefined) {\n this.error();\n if (!this.allErrors)\n this.gen.if(false); // this branch will be removed by gen.optimize\n return;\n }\n this.gen.if(condition);\n this.error();\n if (this.allErrors)\n this.gen.endIf();\n else\n this.gen.else();\n }\n fail$data(condition) {\n if (!this.$data)\n return this.fail(condition);\n const { schemaCode } = this;\n this.fail((0, codegen_1._) `${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`);\n }\n error(append, errorParams, errorPaths) {\n if (errorParams) {\n this.setParams(errorParams);\n this._error(append, errorPaths);\n this.setParams({});\n return;\n }\n this._error(append, errorPaths);\n }\n _error(append, errorPaths) {\n ;\n (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths);\n }\n $dataError() {\n (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError);\n }\n reset() {\n if (this.errsCount === undefined)\n throw new Error('add \"trackErrors\" to keyword definition');\n (0, errors_1.resetErrorsCount)(this.gen, this.errsCount);\n }\n ok(cond) {\n if (!this.allErrors)\n this.gen.if(cond);\n }\n setParams(obj, assign) {\n if (assign)\n Object.assign(this.params, obj);\n else\n this.params = obj;\n }\n block$data(valid, codeBlock, $dataValid = codegen_1.nil) {\n this.gen.block(() => {\n this.check$data(valid, $dataValid);\n codeBlock();\n });\n }\n check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) {\n if (!this.$data)\n return;\n const { gen, schemaCode, schemaType, def } = this;\n gen.if((0, codegen_1.or)((0, codegen_1._) `${schemaCode} === undefined`, $dataValid));\n if (valid !== codegen_1.nil)\n gen.assign(valid, true);\n if (schemaType.length || def.validateSchema) {\n gen.elseIf(this.invalid$data());\n this.$dataError();\n if (valid !== codegen_1.nil)\n gen.assign(valid, false);\n }\n gen.else();\n }\n invalid$data() {\n const { gen, schemaCode, schemaType, def, it } = this;\n return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema());\n function wrong$DataType() {\n if (schemaType.length) {\n /* istanbul ignore if */\n if (!(schemaCode instanceof codegen_1.Name))\n throw new Error(\"ajv implementation error\");\n const st = Array.isArray(schemaType) ? schemaType : [schemaType];\n return (0, codegen_1._) `${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`;\n }\n return codegen_1.nil;\n }\n function invalid$DataSchema() {\n if (def.validateSchema) {\n const validateSchemaRef = gen.scopeValue(\"validate$data\", { ref: def.validateSchema }); // TODO value.code for standalone\n return (0, codegen_1._) `!${validateSchemaRef}(${schemaCode})`;\n }\n return codegen_1.nil;\n }\n }\n subschema(appl, valid) {\n const subschema = (0, subschema_1.getSubschema)(this.it, appl);\n (0, subschema_1.extendSubschemaData)(subschema, this.it, appl);\n (0, subschema_1.extendSubschemaMode)(subschema, appl);\n const nextContext = { ...this.it, ...subschema, items: undefined, props: undefined };\n subschemaCode(nextContext, valid);\n return nextContext;\n }\n mergeEvaluated(schemaCxt, toName) {\n const { it, gen } = this;\n if (!it.opts.unevaluated)\n return;\n if (it.props !== true && schemaCxt.props !== undefined) {\n it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName);\n }\n if (it.items !== true && schemaCxt.items !== undefined) {\n it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName);\n }\n }\n mergeValidEvaluated(schemaCxt, valid) {\n const { it, gen } = this;\n if (it.opts.unevaluated && (it.props !== true || it.items !== true)) {\n gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name));\n return true;\n }\n }\n}\nexports.KeywordCxt = KeywordCxt;\nfunction keywordCode(it, keyword, def, ruleType) {\n const cxt = new KeywordCxt(it, def, keyword);\n if (\"code\" in def) {\n def.code(cxt, ruleType);\n }\n else if (cxt.$data && def.validate) {\n (0, keyword_1.funcKeywordCode)(cxt, def);\n }\n else if (\"macro\" in def) {\n (0, keyword_1.macroKeywordCode)(cxt, def);\n }\n else if (def.compile || def.validate) {\n (0, keyword_1.funcKeywordCode)(cxt, def);\n }\n}\nconst JSON_POINTER = /^\\/(?:[^~]|~0|~1)*$/;\nconst RELATIVE_JSON_POINTER = /^([0-9]+)(#|\\/(?:[^~]|~0|~1)*)?$/;\nfunction getData($data, { dataLevel, dataNames, dataPathArr }) {\n let jsonPointer;\n let data;\n if ($data === \"\")\n return names_1.default.rootData;\n if ($data[0] === \"/\") {\n if (!JSON_POINTER.test($data))\n throw new Error(`Invalid JSON-pointer: ${$data}`);\n jsonPointer = $data;\n data = names_1.default.rootData;\n }\n else {\n const matches = RELATIVE_JSON_POINTER.exec($data);\n if (!matches)\n throw new Error(`Invalid JSON-pointer: ${$data}`);\n const up = +matches[1];\n jsonPointer = matches[2];\n if (jsonPointer === \"#\") {\n if (up >= dataLevel)\n throw new Error(errorMsg(\"property/index\", up));\n return dataPathArr[dataLevel - up];\n }\n if (up > dataLevel)\n throw new Error(errorMsg(\"data\", up));\n data = dataNames[dataLevel - up];\n if (!jsonPointer)\n return data;\n }\n let expr = data;\n const segments = jsonPointer.split(\"/\");\n for (const segment of segments) {\n if (segment) {\n data = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`;\n expr = (0, codegen_1._) `${expr} && ${data}`;\n }\n }\n return expr;\n function errorMsg(pointerType, up) {\n return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`;\n }\n}\nexports.getData = getData;\n//# sourceMappingURL=index.js.map",
|
|
23
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass ValidationError extends Error {\n constructor(errors) {\n super(\"validation failed\");\n this.errors = errors;\n this.ajv = this.validation = true;\n }\n}\nexports.default = ValidationError;\n//# sourceMappingURL=validation_error.js.map",
|
|
24
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst resolve_1 = require(\"./resolve\");\nclass MissingRefError extends Error {\n constructor(resolver, baseId, ref, msg) {\n super(msg || `can't resolve reference ${ref} from id ${baseId}`);\n this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref);\n this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef));\n }\n}\nexports.default = MissingRefError;\n//# sourceMappingURL=ref_error.js.map",
|
|
25
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0;\nconst codegen_1 = require(\"./codegen\");\nconst validation_error_1 = require(\"../runtime/validation_error\");\nconst names_1 = require(\"./names\");\nconst resolve_1 = require(\"./resolve\");\nconst util_1 = require(\"./util\");\nconst validate_1 = require(\"./validate\");\nclass SchemaEnv {\n constructor(env) {\n var _a;\n this.refs = {};\n this.dynamicAnchors = {};\n let schema;\n if (typeof env.schema == \"object\")\n schema = env.schema;\n this.schema = env.schema;\n this.schemaId = env.schemaId;\n this.root = env.root || this;\n this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || \"$id\"]);\n this.schemaPath = env.schemaPath;\n this.localRefs = env.localRefs;\n this.meta = env.meta;\n this.$async = schema === null || schema === void 0 ? void 0 : schema.$async;\n this.refs = {};\n }\n}\nexports.SchemaEnv = SchemaEnv;\n// let codeSize = 0\n// let nodeCount = 0\n// Compiles schema in SchemaEnv\nfunction compileSchema(sch) {\n // TODO refactor - remove compilations\n const _sch = getCompilingSchema.call(this, sch);\n if (_sch)\n return _sch;\n const rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId); // TODO if getFullPath removed 1 tests fails\n const { es5, lines } = this.opts.code;\n const { ownProperties } = this.opts;\n const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties });\n let _ValidationError;\n if (sch.$async) {\n _ValidationError = gen.scopeValue(\"Error\", {\n ref: validation_error_1.default,\n code: (0, codegen_1._) `require(\"ajv/dist/runtime/validation_error\").default`,\n });\n }\n const validateName = gen.scopeName(\"validate\");\n sch.validateName = validateName;\n const schemaCxt = {\n gen,\n allErrors: this.opts.allErrors,\n data: names_1.default.data,\n parentData: names_1.default.parentData,\n parentDataProperty: names_1.default.parentDataProperty,\n dataNames: [names_1.default.data],\n dataPathArr: [codegen_1.nil], // TODO can its length be used as dataLevel if nil is removed?\n dataLevel: 0,\n dataTypes: [],\n definedProperties: new Set(),\n topSchemaRef: gen.scopeValue(\"schema\", this.opts.code.source === true\n ? { ref: sch.schema, code: (0, codegen_1.stringify)(sch.schema) }\n : { ref: sch.schema }),\n validateName,\n ValidationError: _ValidationError,\n schema: sch.schema,\n schemaEnv: sch,\n rootId,\n baseId: sch.baseId || rootId,\n schemaPath: codegen_1.nil,\n errSchemaPath: sch.schemaPath || (this.opts.jtd ? \"\" : \"#\"),\n errorPath: (0, codegen_1._) `\"\"`,\n opts: this.opts,\n self: this,\n };\n let sourceCode;\n try {\n this._compilations.add(sch);\n (0, validate_1.validateFunctionCode)(schemaCxt);\n gen.optimize(this.opts.code.optimize);\n // gen.optimize(1)\n const validateCode = gen.toString();\n sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`;\n // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount))\n if (this.opts.code.process)\n sourceCode = this.opts.code.process(sourceCode, sch);\n // console.log(\"\\n\\n\\n *** \\n\", sourceCode)\n const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode);\n const validate = makeValidate(this, this.scope.get());\n this.scope.value(validateName, { ref: validate });\n validate.errors = null;\n validate.schema = sch.schema;\n validate.schemaEnv = sch;\n if (sch.$async)\n validate.$async = true;\n if (this.opts.code.source === true) {\n validate.source = { validateName, validateCode, scopeValues: gen._values };\n }\n if (this.opts.unevaluated) {\n const { props, items } = schemaCxt;\n validate.evaluated = {\n props: props instanceof codegen_1.Name ? undefined : props,\n items: items instanceof codegen_1.Name ? undefined : items,\n dynamicProps: props instanceof codegen_1.Name,\n dynamicItems: items instanceof codegen_1.Name,\n };\n if (validate.source)\n validate.source.evaluated = (0, codegen_1.stringify)(validate.evaluated);\n }\n sch.validate = validate;\n return sch;\n }\n catch (e) {\n delete sch.validate;\n delete sch.validateName;\n if (sourceCode)\n this.logger.error(\"Error compiling schema, function code:\", sourceCode);\n // console.log(\"\\n\\n\\n *** \\n\", sourceCode, this.opts)\n throw e;\n }\n finally {\n this._compilations.delete(sch);\n }\n}\nexports.compileSchema = compileSchema;\nfunction resolveRef(root, baseId, ref) {\n var _a;\n ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);\n const schOrFunc = root.refs[ref];\n if (schOrFunc)\n return schOrFunc;\n let _sch = resolve.call(this, root, ref);\n if (_sch === undefined) {\n const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref]; // TODO maybe localRefs should hold SchemaEnv\n const { schemaId } = this.opts;\n if (schema)\n _sch = new SchemaEnv({ schema, schemaId, root, baseId });\n }\n if (_sch === undefined)\n return;\n return (root.refs[ref] = inlineOrCompile.call(this, _sch));\n}\nexports.resolveRef = resolveRef;\nfunction inlineOrCompile(sch) {\n if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs))\n return sch.schema;\n return sch.validate ? sch : compileSchema.call(this, sch);\n}\n// Index of schema compilation in the currently compiled list\nfunction getCompilingSchema(schEnv) {\n for (const sch of this._compilations) {\n if (sameSchemaEnv(sch, schEnv))\n return sch;\n }\n}\nexports.getCompilingSchema = getCompilingSchema;\nfunction sameSchemaEnv(s1, s2) {\n return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;\n}\n// resolve and compile the references ($ref)\n// TODO returns AnySchemaObject (if the schema can be inlined) or validation function\nfunction resolve(root, // information about the root schema for the current schema\nref // reference to resolve\n) {\n let sch;\n while (typeof (sch = this.refs[ref]) == \"string\")\n ref = sch;\n return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);\n}\n// Resolve schema, its root and baseId\nfunction resolveSchema(root, // root object with properties schema, refs TODO below SchemaEnv is assigned to it\nref // reference to resolve\n) {\n const p = this.opts.uriResolver.parse(ref);\n const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);\n let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, undefined);\n // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests\n if (Object.keys(root.schema).length > 0 && refPath === baseId) {\n return getJsonPointer.call(this, p, root);\n }\n const id = (0, resolve_1.normalizeId)(refPath);\n const schOrRef = this.refs[id] || this.schemas[id];\n if (typeof schOrRef == \"string\") {\n const sch = resolveSchema.call(this, root, schOrRef);\n if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== \"object\")\n return;\n return getJsonPointer.call(this, p, sch);\n }\n if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== \"object\")\n return;\n if (!schOrRef.validate)\n compileSchema.call(this, schOrRef);\n if (id === (0, resolve_1.normalizeId)(ref)) {\n const { schema } = schOrRef;\n const { schemaId } = this.opts;\n const schId = schema[schemaId];\n if (schId)\n baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);\n return new SchemaEnv({ schema, schemaId, root, baseId });\n }\n return getJsonPointer.call(this, p, schOrRef);\n}\nexports.resolveSchema = resolveSchema;\nconst PREVENT_SCOPE_CHANGE = new Set([\n \"properties\",\n \"patternProperties\",\n \"enum\",\n \"dependencies\",\n \"definitions\",\n]);\nfunction getJsonPointer(parsedRef, { baseId, schema, root }) {\n var _a;\n if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== \"/\")\n return;\n for (const part of parsedRef.fragment.slice(1).split(\"/\")) {\n if (typeof schema === \"boolean\")\n return;\n const partSchema = schema[(0, util_1.unescapeFragment)(part)];\n if (partSchema === undefined)\n return;\n schema = partSchema;\n // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def?\n const schId = typeof schema === \"object\" && schema[this.opts.schemaId];\n if (!PREVENT_SCOPE_CHANGE.has(part) && schId) {\n baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);\n }\n }\n let env;\n if (typeof schema != \"boolean\" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) {\n const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref);\n env = resolveSchema.call(this, root, $ref);\n }\n // even though resolution failed we need to return SchemaEnv to throw exception\n // so that compileAsync loads missing schema.\n const { schemaId } = this.opts;\n env = env || new SchemaEnv({ schema, schemaId, root, baseId });\n if (env.schema !== env.root.schema)\n return env;\n return undefined;\n}\n//# sourceMappingURL=index.js.map",
|
|
26
|
-
"'use strict'\n\n/** @type {(value: string) => boolean} */\nconst isUUID = RegExp.prototype.test.bind(/^[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)$/u)\n\n/** @type {(value: string) => boolean} */\nconst isHexPair = RegExp.prototype.test.bind(/^[\\da-f]{2}$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isUnreserved = RegExp.prototype.test.bind(/^[\\da-z\\-._~]$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isPathCharacter = RegExp.prototype.test.bind(/^[\\da-z\\-._~!$&'()*+,;=:@/]$/iu)\n\n/**\n * @param {Array<string>} input\n * @returns {string}\n */\nfunction stringArrayToHexStripped (input) {\n let acc = ''\n let code = 0\n let i = 0\n\n for (i = 0; i < input.length; i++) {\n code = input[i].charCodeAt(0)\n if (code === 48) {\n continue\n }\n if (!((code >= 48 && code <= 57) || (code >= 65 && code <= 70) || (code >= 97 && code <= 102))) {\n return ''\n }\n acc += input[i]\n break\n }\n\n for (i += 1; i < input.length; i++) {\n code = input[i].charCodeAt(0)\n if (!((code >= 48 && code <= 57) || (code >= 65 && code <= 70) || (code >= 97 && code <= 102))) {\n return ''\n }\n acc += input[i]\n }\n return acc\n}\n\n/**\n * @typedef {Object} GetIPV6Result\n * @property {boolean} error - Indicates if there was an error parsing the IPv6 address.\n * @property {string} address - The parsed IPv6 address.\n * @property {string} [zone] - The zone identifier, if present.\n */\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nconst nonSimpleDomain = RegExp.prototype.test.bind(/[^!\"$&'()*+,\\-.;=_`a-z{}~]/u)\n\n/**\n * @param {Array<string>} buffer\n * @returns {boolean}\n */\nfunction consumeIsZone (buffer) {\n buffer.length = 0\n return true\n}\n\n/**\n * @param {Array<string>} buffer\n * @param {Array<string>} address\n * @param {GetIPV6Result} output\n * @returns {boolean}\n */\nfunction consumeHextets (buffer, address, output) {\n if (buffer.length) {\n const hex = stringArrayToHexStripped(buffer)\n if (hex !== '') {\n address.push(hex)\n } else {\n output.error = true\n return false\n }\n buffer.length = 0\n }\n return true\n}\n\n/**\n * @param {string} input\n * @returns {GetIPV6Result}\n */\nfunction getIPV6 (input) {\n let tokenCount = 0\n const output = { error: false, address: '', zone: '' }\n /** @type {Array<string>} */\n const address = []\n /** @type {Array<string>} */\n const buffer = []\n let endipv6Encountered = false\n let endIpv6 = false\n\n let consume = consumeHextets\n\n for (let i = 0; i < input.length; i++) {\n const cursor = input[i]\n if (cursor === '[' || cursor === ']') { continue }\n if (cursor === ':') {\n if (endipv6Encountered === true) {\n endIpv6 = true\n }\n if (!consume(buffer, address, output)) { break }\n if (++tokenCount > 7) {\n // not valid\n output.error = true\n break\n }\n if (i > 0 && input[i - 1] === ':') {\n endipv6Encountered = true\n }\n address.push(':')\n continue\n } else if (cursor === '%') {\n if (!consume(buffer, address, output)) { break }\n // switch to zone detection\n consume = consumeIsZone\n } else {\n buffer.push(cursor)\n continue\n }\n }\n if (buffer.length) {\n if (consume === consumeIsZone) {\n output.zone = buffer.join('')\n } else if (endIpv6) {\n address.push(buffer.join(''))\n } else {\n address.push(stringArrayToHexStripped(buffer))\n }\n }\n output.address = address.join('')\n return output\n}\n\n/**\n * @typedef {Object} NormalizeIPv6Result\n * @property {string} host - The normalized host.\n * @property {string} [escapedHost] - The escaped host.\n * @property {boolean} isIPV6 - Indicates if the host is an IPv6 address.\n */\n\n/**\n * @param {string} host\n * @returns {NormalizeIPv6Result}\n */\nfunction normalizeIPv6 (host) {\n if (findToken(host, ':') < 2) { return { host, isIPV6: false } }\n const ipv6 = getIPV6(host)\n\n if (!ipv6.error) {\n let newHost = ipv6.address\n let escapedHost = ipv6.address\n if (ipv6.zone) {\n newHost += '%' + ipv6.zone\n escapedHost += '%25' + ipv6.zone\n }\n return { host: newHost, isIPV6: true, escapedHost }\n } else {\n return { host, isIPV6: false }\n }\n}\n\n/**\n * @param {string} str\n * @param {string} token\n * @returns {number}\n */\nfunction findToken (str, token) {\n let ind = 0\n for (let i = 0; i < str.length; i++) {\n if (str[i] === token) ind++\n }\n return ind\n}\n\n/**\n * @param {string} path\n * @returns {string}\n *\n * @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n */\nfunction removeDotSegments (path) {\n let input = path\n const output = []\n let nextSlash = -1\n let len = 0\n\n // eslint-disable-next-line no-cond-assign\n while (len = input.length) {\n if (len === 1) {\n if (input === '.') {\n break\n } else if (input === '/') {\n output.push('/')\n break\n } else {\n output.push(input)\n break\n }\n } else if (len === 2) {\n if (input[0] === '.') {\n if (input[1] === '.') {\n break\n } else if (input[1] === '/') {\n input = input.slice(2)\n continue\n }\n } else if (input[0] === '/') {\n if (input[1] === '.' || input[1] === '/') {\n output.push('/')\n break\n }\n }\n } else if (len === 3) {\n if (input === '/..') {\n if (output.length !== 0) {\n output.pop()\n }\n output.push('/')\n break\n }\n }\n if (input[0] === '.') {\n if (input[1] === '.') {\n if (input[2] === '/') {\n input = input.slice(3)\n continue\n }\n } else if (input[1] === '/') {\n input = input.slice(2)\n continue\n }\n } else if (input[0] === '/') {\n if (input[1] === '.') {\n if (input[2] === '/') {\n input = input.slice(2)\n continue\n } else if (input[2] === '.') {\n if (input[3] === '/') {\n input = input.slice(3)\n if (output.length !== 0) {\n output.pop()\n }\n continue\n }\n }\n }\n }\n\n // Rule 2E: Move normal path segment to output\n if ((nextSlash = input.indexOf('/', 1)) === -1) {\n output.push(input)\n break\n } else {\n output.push(input.slice(0, nextSlash))\n input = input.slice(nextSlash)\n }\n }\n\n return output.join('')\n}\n\n/**\n * Re-escape RFC 3986 gen-delims that must not appear literally in the host.\n * After the URI regex parses, these characters cannot be literal in the host\n * field, so any that appear after decoding came from percent-encoding and\n * must be restored to prevent authority structure changes.\n *\n * @param {string} host\n * @param {boolean} isIP - true for IPv4/IPv6 hosts (skip colon re-escaping)\n * @returns {string}\n */\nconst HOST_DELIMS = { '@': '%40', '/': '%2F', '?': '%3F', '#': '%23', ':': '%3A' }\nconst HOST_DELIM_RE = /[@/?#:]/g\nconst HOST_DELIM_NO_COLON_RE = /[@/?#]/g\n\nfunction reescapeHostDelimiters (host, isIP) {\n const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE\n re.lastIndex = 0\n return host.replace(re, (ch) => HOST_DELIMS[ch])\n}\n\n/**\n * Normalizes percent escapes and optionally decodes only unreserved ASCII bytes.\n * Reserved delimiters such as `%2F` and `%2E` stay escaped.\n *\n * @param {string} input\n * @param {boolean} [decodeUnreserved=false]\n * @returns {string}\n */\nfunction normalizePercentEncoding (input, decodeUnreserved = false) {\n if (input.indexOf('%') === -1) {\n return input\n }\n\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n if (input[i] === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n const normalizedHex = hex.toUpperCase()\n const decoded = String.fromCharCode(parseInt(normalizedHex, 16))\n\n if (decodeUnreserved && isUnreserved(decoded)) {\n output += decoded\n } else {\n output += '%' + normalizedHex\n }\n\n i += 2\n continue\n }\n }\n\n output += input[i]\n }\n\n return output\n}\n\n/**\n * Normalizes path data without turning reserved escapes into live path syntax.\n * Valid escapes are uppercased, raw unsafe characters are escaped, and only\n * unreserved bytes that are not `.` are decoded.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction normalizePathEncoding (input) {\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n if (input[i] === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n const normalizedHex = hex.toUpperCase()\n const decoded = String.fromCharCode(parseInt(normalizedHex, 16))\n\n if (decoded !== '.' && isUnreserved(decoded)) {\n output += decoded\n } else {\n output += '%' + normalizedHex\n }\n\n i += 2\n continue\n }\n }\n\n if (isPathCharacter(input[i])) {\n output += input[i]\n } else {\n output += escape(input[i])\n }\n }\n\n return output\n}\n\n/**\n * Escapes a component while preserving existing valid percent escapes.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction escapePreservingEscapes (input) {\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n if (input[i] === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n output += '%' + hex.toUpperCase()\n i += 2\n continue\n }\n }\n\n output += escape(input[i])\n }\n\n return output\n}\n\n/**\n * @param {import('../types/index').URIComponent} component\n * @returns {string|undefined}\n */\nfunction recomposeAuthority (component) {\n const uriTokens = []\n\n if (component.userinfo !== undefined) {\n uriTokens.push(component.userinfo)\n uriTokens.push('@')\n }\n\n if (component.host !== undefined) {\n let host = unescape(component.host)\n if (!isIPv4(host)) {\n const ipV6res = normalizeIPv6(host)\n if (ipV6res.isIPV6 === true) {\n host = `[${ipV6res.escapedHost}]`\n } else {\n host = reescapeHostDelimiters(host, false)\n }\n }\n uriTokens.push(host)\n }\n\n if (typeof component.port === 'number' || typeof component.port === 'string') {\n uriTokens.push(':')\n uriTokens.push(String(component.port))\n }\n\n return uriTokens.length ? uriTokens.join('') : undefined\n};\n\nmodule.exports = {\n nonSimpleDomain,\n recomposeAuthority,\n reescapeHostDelimiters,\n normalizePercentEncoding,\n normalizePathEncoding,\n escapePreservingEscapes,\n removeDotSegments,\n isIPv4,\n isUUID,\n normalizeIPv6,\n stringArrayToHexStripped\n}\n",
|
|
27
|
-
"'use strict'\n\nconst { isUUID } = require('./utils')\nconst URN_REG = /([\\da-z][\\d\\-a-z]{0,31}):((?:[\\w!$'()*+,\\-.:;=@]|%[\\da-f]{2})+)/iu\n\nconst supportedSchemeNames = /** @type {const} */ (['http', 'https', 'ws',\n 'wss', 'urn', 'urn:uuid'])\n\n/** @typedef {supportedSchemeNames[number]} SchemeName */\n\n/**\n * @param {string} name\n * @returns {name is SchemeName}\n */\nfunction isValidSchemeName (name) {\n return supportedSchemeNames.indexOf(/** @type {*} */ (name)) !== -1\n}\n\n/**\n * @callback SchemeFn\n * @param {import('../types/index').URIComponent} component\n * @param {import('../types/index').Options} options\n * @returns {import('../types/index').URIComponent}\n */\n\n/**\n * @typedef {Object} SchemeHandler\n * @property {SchemeName} scheme - The scheme name.\n * @property {boolean} [domainHost] - Indicates if the scheme supports domain hosts.\n * @property {SchemeFn} parse - Function to parse the URI component for this scheme.\n * @property {SchemeFn} serialize - Function to serialize the URI component for this scheme.\n * @property {boolean} [skipNormalize] - Indicates if normalization should be skipped for this scheme.\n * @property {boolean} [absolutePath] - Indicates if the scheme uses absolute paths.\n * @property {boolean} [unicodeSupport] - Indicates if the scheme supports Unicode.\n */\n\n/**\n * @param {import('../types/index').URIComponent} wsComponent\n * @returns {boolean}\n */\nfunction wsIsSecure (wsComponent) {\n if (wsComponent.secure === true) {\n return true\n } else if (wsComponent.secure === false) {\n return false\n } else if (wsComponent.scheme) {\n return (\n wsComponent.scheme.length === 3 &&\n (wsComponent.scheme[0] === 'w' || wsComponent.scheme[0] === 'W') &&\n (wsComponent.scheme[1] === 's' || wsComponent.scheme[1] === 'S') &&\n (wsComponent.scheme[2] === 's' || wsComponent.scheme[2] === 'S')\n )\n } else {\n return false\n }\n}\n\n/** @type {SchemeFn} */\nfunction httpParse (component) {\n if (!component.host) {\n component.error = component.error || 'HTTP URIs must have a host.'\n }\n\n return component\n}\n\n/** @type {SchemeFn} */\nfunction httpSerialize (component) {\n const secure = String(component.scheme).toLowerCase() === 'https'\n\n // normalize the default port\n if (component.port === (secure ? 443 : 80) || component.port === '') {\n component.port = undefined\n }\n\n // normalize the empty path\n if (!component.path) {\n component.path = '/'\n }\n\n // NOTE: We do not parse query strings for HTTP URIs\n // as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n // and not the HTTP spec.\n\n return component\n}\n\n/** @type {SchemeFn} */\nfunction wsParse (wsComponent) {\n// indicate if the secure flag is set\n wsComponent.secure = wsIsSecure(wsComponent)\n\n // construct resouce name\n wsComponent.resourceName = (wsComponent.path || '/') + (wsComponent.query ? '?' + wsComponent.query : '')\n wsComponent.path = undefined\n wsComponent.query = undefined\n\n return wsComponent\n}\n\n/** @type {SchemeFn} */\nfunction wsSerialize (wsComponent) {\n// normalize the default port\n if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === '') {\n wsComponent.port = undefined\n }\n\n // ensure scheme matches secure flag\n if (typeof wsComponent.secure === 'boolean') {\n wsComponent.scheme = (wsComponent.secure ? 'wss' : 'ws')\n wsComponent.secure = undefined\n }\n\n // reconstruct path from resource name\n if (wsComponent.resourceName) {\n const [path, query] = wsComponent.resourceName.split('?')\n wsComponent.path = (path && path !== '/' ? path : undefined)\n wsComponent.query = query\n wsComponent.resourceName = undefined\n }\n\n // forbid fragment component\n wsComponent.fragment = undefined\n\n return wsComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnParse (urnComponent, options) {\n if (!urnComponent.path) {\n urnComponent.error = 'URN can not be parsed'\n return urnComponent\n }\n const matches = urnComponent.path.match(URN_REG)\n if (matches) {\n const scheme = options.scheme || urnComponent.scheme || 'urn'\n urnComponent.nid = matches[1].toLowerCase()\n urnComponent.nss = matches[2]\n const urnScheme = `${scheme}:${options.nid || urnComponent.nid}`\n const schemeHandler = getSchemeHandler(urnScheme)\n urnComponent.path = undefined\n\n if (schemeHandler) {\n urnComponent = schemeHandler.parse(urnComponent, options)\n }\n } else {\n urnComponent.error = urnComponent.error || 'URN can not be parsed.'\n }\n\n return urnComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnSerialize (urnComponent, options) {\n if (urnComponent.nid === undefined) {\n throw new Error('URN without nid cannot be serialized')\n }\n const scheme = options.scheme || urnComponent.scheme || 'urn'\n const nid = urnComponent.nid.toLowerCase()\n const urnScheme = `${scheme}:${options.nid || nid}`\n const schemeHandler = getSchemeHandler(urnScheme)\n\n if (schemeHandler) {\n urnComponent = schemeHandler.serialize(urnComponent, options)\n }\n\n const uriComponent = urnComponent\n const nss = urnComponent.nss\n uriComponent.path = `${nid || options.nid}:${nss}`\n\n options.skipEscape = true\n return uriComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnuuidParse (urnComponent, options) {\n const uuidComponent = urnComponent\n uuidComponent.uuid = uuidComponent.nss\n uuidComponent.nss = undefined\n\n if (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) {\n uuidComponent.error = uuidComponent.error || 'UUID is not valid.'\n }\n\n return uuidComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnuuidSerialize (uuidComponent) {\n const urnComponent = uuidComponent\n // normalize UUID\n urnComponent.nss = (uuidComponent.uuid || '').toLowerCase()\n return urnComponent\n}\n\nconst http = /** @type {SchemeHandler} */ ({\n scheme: 'http',\n domainHost: true,\n parse: httpParse,\n serialize: httpSerialize\n})\n\nconst https = /** @type {SchemeHandler} */ ({\n scheme: 'https',\n domainHost: http.domainHost,\n parse: httpParse,\n serialize: httpSerialize\n})\n\nconst ws = /** @type {SchemeHandler} */ ({\n scheme: 'ws',\n domainHost: true,\n parse: wsParse,\n serialize: wsSerialize\n})\n\nconst wss = /** @type {SchemeHandler} */ ({\n scheme: 'wss',\n domainHost: ws.domainHost,\n parse: ws.parse,\n serialize: ws.serialize\n})\n\nconst urn = /** @type {SchemeHandler} */ ({\n scheme: 'urn',\n parse: urnParse,\n serialize: urnSerialize,\n skipNormalize: true\n})\n\nconst urnuuid = /** @type {SchemeHandler} */ ({\n scheme: 'urn:uuid',\n parse: urnuuidParse,\n serialize: urnuuidSerialize,\n skipNormalize: true\n})\n\nconst SCHEMES = /** @type {Record<SchemeName, SchemeHandler>} */ ({\n http,\n https,\n ws,\n wss,\n urn,\n 'urn:uuid': urnuuid\n})\n\nObject.setPrototypeOf(SCHEMES, null)\n\n/**\n * @param {string|undefined} scheme\n * @returns {SchemeHandler|undefined}\n */\nfunction getSchemeHandler (scheme) {\n return (\n scheme && (\n SCHEMES[/** @type {SchemeName} */ (scheme)] ||\n SCHEMES[/** @type {SchemeName} */(scheme.toLowerCase())])\n ) ||\n undefined\n}\n\nmodule.exports = {\n wsIsSecure,\n SCHEMES,\n isValidSchemeName,\n getSchemeHandler,\n}\n",
|
|
28
|
-
"'use strict'\n\nconst { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require('./lib/utils')\nconst { SCHEMES, getSchemeHandler } = require('./lib/schemes')\n\n/**\n * @template {import('./types/index').URIComponent|string} T\n * @param {T} uri\n * @param {import('./types/index').Options} [options]\n * @returns {T}\n */\nfunction normalize (uri, options) {\n if (typeof uri === 'string') {\n uri = /** @type {T} */ (normalizeString(uri, options))\n } else if (typeof uri === 'object') {\n uri = /** @type {T} */ (parse(serialize(uri, options), options))\n }\n return uri\n}\n\n/**\n * @param {string} baseURI\n * @param {string} relativeURI\n * @param {import('./types/index').Options} [options]\n * @returns {string}\n */\nfunction resolve (baseURI, relativeURI, options) {\n const schemelessOptions = options ? Object.assign({ scheme: 'null' }, options) : { scheme: 'null' }\n const { parsed: baseParsed, malformedAuthorityOrPort: baseMalformed } = parseWithStatus(baseURI, schemelessOptions)\n const { parsed: relativeParsed, malformedAuthorityOrPort: relativeMalformed } = parseWithStatus(relativeURI, schemelessOptions)\n if (baseMalformed || relativeMalformed) {\n throw new Error(baseParsed.error || relativeParsed.error || 'URI is malformed.')\n }\n const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true)\n schemelessOptions.skipEscape = true\n return serialize(resolved, schemelessOptions)\n}\n\n/**\n * @param {import ('./types/index').URIComponent} base\n * @param {import ('./types/index').URIComponent} relative\n * @param {import('./types/index').Options} [options]\n * @param {boolean} [skipNormalization=false]\n * @returns {import ('./types/index').URIComponent}\n */\nfunction resolveComponent (base, relative, options, skipNormalization) {\n /** @type {import('./types/index').URIComponent} */\n const target = {}\n if (!skipNormalization) {\n base = parse(serialize(base, options), options) // normalize base component\n relative = parse(serialize(relative, options), options) // normalize relative component\n }\n options = options || {}\n\n if (!options.tolerant && relative.scheme) {\n target.scheme = relative.scheme\n // target.authority = relative.authority;\n target.userinfo = relative.userinfo\n target.host = relative.host\n target.port = relative.port\n target.path = removeDotSegments(relative.path || '')\n target.query = relative.query\n } else {\n if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n // target.authority = relative.authority;\n target.userinfo = relative.userinfo\n target.host = relative.host\n target.port = relative.port\n target.path = removeDotSegments(relative.path || '')\n target.query = relative.query\n } else {\n if (!relative.path) {\n target.path = base.path\n if (relative.query !== undefined) {\n target.query = relative.query\n } else {\n target.query = base.query\n }\n } else {\n if (relative.path[0] === '/') {\n target.path = removeDotSegments(relative.path)\n } else {\n if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n target.path = '/' + relative.path\n } else if (!base.path) {\n target.path = relative.path\n } else {\n target.path = base.path.slice(0, base.path.lastIndexOf('/') + 1) + relative.path\n }\n target.path = removeDotSegments(target.path)\n }\n target.query = relative.query\n }\n // target.authority = base.authority;\n target.userinfo = base.userinfo\n target.host = base.host\n target.port = base.port\n }\n target.scheme = base.scheme\n }\n\n target.fragment = relative.fragment\n\n return target\n}\n\n/**\n * @param {import ('./types/index').URIComponent|string} uriA\n * @param {import ('./types/index').URIComponent|string} uriB\n * @param {import ('./types/index').Options} options\n * @returns {boolean}\n */\nfunction equal (uriA, uriB, options) {\n const normalizedA = normalizeComparableURI(uriA, options)\n const normalizedB = normalizeComparableURI(uriB, options)\n\n return normalizedA !== undefined && normalizedB !== undefined && normalizedA.toLowerCase() === normalizedB.toLowerCase()\n}\n\n/**\n * @param {Readonly<import('./types/index').URIComponent>} cmpts\n * @param {import('./types/index').Options} [opts]\n * @returns {string}\n */\nfunction serialize (cmpts, opts) {\n const component = {\n host: cmpts.host,\n scheme: cmpts.scheme,\n userinfo: cmpts.userinfo,\n port: cmpts.port,\n path: cmpts.path,\n query: cmpts.query,\n nid: cmpts.nid,\n nss: cmpts.nss,\n uuid: cmpts.uuid,\n fragment: cmpts.fragment,\n reference: cmpts.reference,\n resourceName: cmpts.resourceName,\n secure: cmpts.secure,\n error: ''\n }\n const options = Object.assign({}, opts)\n const uriTokens = []\n\n // find scheme handler\n const schemeHandler = getSchemeHandler(options.scheme || component.scheme)\n\n // perform scheme specific serialization\n if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options)\n\n if (component.path !== undefined) {\n if (!options.skipEscape) {\n component.path = escapePreservingEscapes(component.path)\n\n if (component.scheme !== undefined) {\n component.path = component.path.split('%3A').join(':')\n }\n } else {\n component.path = normalizePercentEncoding(component.path)\n }\n }\n\n if (options.reference !== 'suffix' && component.scheme) {\n uriTokens.push(component.scheme, ':')\n }\n\n const authority = recomposeAuthority(component)\n if (authority !== undefined) {\n if (options.reference !== 'suffix') {\n uriTokens.push('//')\n }\n\n uriTokens.push(authority)\n\n if (component.path && component.path[0] !== '/') {\n uriTokens.push('/')\n }\n }\n if (component.path !== undefined) {\n let s = component.path\n\n if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n s = removeDotSegments(s)\n }\n\n if (\n authority === undefined &&\n s[0] === '/' &&\n s[1] === '/'\n ) {\n // don't allow the path to start with \"//\"\n s = '/%2F' + s.slice(2)\n }\n\n uriTokens.push(s)\n }\n\n if (component.query !== undefined) {\n uriTokens.push('?', component.query)\n }\n\n if (component.fragment !== undefined) {\n uriTokens.push('#', component.fragment)\n }\n return uriTokens.join('')\n}\n\nconst URI_PARSE = /^(?:([^#/:?]+):)?(?:\\/\\/((?:([^#/?@]*)@)?(\\[[^#/?\\]]+\\]|[^#/:?]*)(?::(\\d*))?))?([^#?]*)(?:\\?([^#]*))?(?:#((?:.|[\\n\\r])*))?/u\n\n// Captures the authority component (between \"//\" and the next \"/\", \"?\" or \"#\"),\n// with or without a scheme prefix, for the literal-backslash rejection below.\nconst AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\\/\\/([^/?#]*)/\n\n// Captures the leading authority-introducer region after an optional scheme: a\n// run of forward slashes, backslashes, and the characters the WHATWG URL parser\n// removes before parsing (TAB U+0009, LF U+000A, CR U+000D). A valid introducer\n// is exactly \"//\". Node treats \"\\\" as \"/\" on special schemes and strips those\n// characters first, so forms like \"\\\\\", \"/\\\", \"\\/\", \"/<TAB>/\", or a leading\n// \"<TAB>//\" reach an authority in Node while fast-uri's URI_PARSE folds them into\n// the path group (host confusion / SSRF / redirect bypass).\nconst AUTHORITY_INTRODUCER_REGION = /^(?:[^#/:?]+:)?([/\\\\\\t\\n\\r]*)/\n\n/**\n * @param {import('./types/index').URIComponent} parsed\n * @param {RegExpMatchArray} matches\n * @returns {string|undefined}\n */\nfunction getParseError (parsed, matches) {\n if (matches[2] !== undefined && parsed.path && parsed.path[0] !== '/') {\n return 'URI path must start with \"/\" when authority is present.'\n }\n\n if (typeof parsed.port === 'number' && (parsed.port < 0 || parsed.port > 65535)) {\n return 'URI port is malformed.'\n }\n\n return undefined\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {{ parsed: import('./types/index').URIComponent, malformedAuthorityOrPort: boolean }}\n */\nfunction parseWithStatus (uri, opts) {\n const options = Object.assign({}, opts)\n /** @type {import('./types/index').URIComponent} */\n const parsed = {\n scheme: undefined,\n userinfo: undefined,\n host: '',\n port: undefined,\n path: '',\n query: undefined,\n fragment: undefined\n }\n\n let malformedAuthorityOrPort = false\n\n let isIP = false\n if (options.reference === 'suffix') {\n if (options.scheme) {\n uri = options.scheme + ':' + uri\n } else {\n uri = '//' + uri\n }\n }\n\n // A literal backslash (U+005C) is not a valid RFC 3986 URI character and is\n // not an authority delimiter. Reject it in the authority rather than\n // rewriting it: normalizing \"\\\" -> \"/\" (WHATWG error recovery) could silently\n // change the resource identified by an otherwise-invalid input, and lets \"\\\"\n // act as a host delimiter here while Node's native URL parses a different\n // host (SSRF / redirect / origin-allowlist bypass). Percent-encoded %5C is\n // untouched and remains valid encoded data.\n const authorityMatch = uri.match(AUTHORITY_PREFIX)\n if (authorityMatch !== null && authorityMatch[1].indexOf('\\\\') !== -1) {\n parsed.error = 'URI authority must not contain a literal backslash.'\n malformedAuthorityOrPort = true\n }\n\n // Reject a malformed or whitespace-smuggled authority introducer. fast-uri\n // only recognizes a literal \"//\"; anything else in the leading separator run\n // (a backslash, or a \"//\" that appears only after removing the TAB/LF/CR that\n // Node strips) means the authority fast-uri parses differs from the one Node's\n // URL resolves. Reject rather than rewrite, mirroring the literal-backslash\n // guard above. Percent-encoded forms (%5C, %09) are untouched, valid data.\n const introducerMatch = uri.match(AUTHORITY_INTRODUCER_REGION)\n if (introducerMatch !== null) {\n const region = introducerMatch[1]\n const normalizedRegion = region.replace(/[\\t\\n\\r]/g, '')\n // Two or more leading separators introduce an authority.\n if (normalizedRegion.length >= 2) {\n if (normalizedRegion.slice(0, 2) !== '//') {\n parsed.error = parsed.error || 'URI authority must not contain a literal backslash.'\n malformedAuthorityOrPort = true\n } else if (region.length !== normalizedRegion.length) {\n parsed.error = parsed.error || 'URI authority introducer must not contain whitespace.'\n malformedAuthorityOrPort = true\n }\n }\n }\n\n const matches = uri.match(URI_PARSE)\n\n if (matches) {\n // store each component\n parsed.scheme = matches[1]\n parsed.userinfo = matches[3]\n parsed.host = matches[4]\n parsed.port = parseInt(matches[5], 10)\n parsed.path = matches[6] || ''\n parsed.query = matches[7]\n parsed.fragment = matches[8]\n\n // fix port number\n if (isNaN(parsed.port)) {\n parsed.port = matches[5]\n }\n\n const parseError = getParseError(parsed, matches)\n if (parseError !== undefined) {\n parsed.error = parsed.error || parseError\n malformedAuthorityOrPort = true\n }\n\n if (parsed.host) {\n const ipv4result = isIPv4(parsed.host)\n if (ipv4result === false) {\n const ipv6result = normalizeIPv6(parsed.host)\n parsed.host = ipv6result.host.toLowerCase()\n isIP = ipv6result.isIPV6\n } else {\n isIP = true\n }\n }\n if (parsed.scheme === undefined && parsed.userinfo === undefined && parsed.host === undefined && parsed.port === undefined && parsed.query === undefined && !parsed.path) {\n parsed.reference = 'same-document'\n } else if (parsed.scheme === undefined) {\n parsed.reference = 'relative'\n } else if (parsed.fragment === undefined) {\n parsed.reference = 'absolute'\n } else {\n parsed.reference = 'uri'\n }\n\n // check for reference errors\n if (options.reference && options.reference !== 'suffix' && options.reference !== parsed.reference) {\n parsed.error = parsed.error || 'URI is not a ' + options.reference + ' reference.'\n }\n\n // find scheme handler\n const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme)\n\n // check if scheme can't handle IRIs\n if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n // if host component is a domain name\n if (parsed.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost)) && isIP === false && nonSimpleDomain(parsed.host)) {\n // convert Unicode IDN -> ASCII IDN\n try {\n parsed.host = new URL('http://' + parsed.host).hostname\n } catch (e) {\n parsed.error = parsed.error || \"Host's domain name can not be converted to ASCII: \" + e\n }\n }\n // convert IRI -> URI\n }\n\n if (!schemeHandler || (schemeHandler && !schemeHandler.skipNormalize)) {\n if (uri.indexOf('%') !== -1) {\n if (parsed.scheme !== undefined) {\n parsed.scheme = unescape(parsed.scheme)\n }\n if (parsed.host !== undefined) {\n parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP)\n }\n }\n if (parsed.path) {\n parsed.path = normalizePathEncoding(parsed.path)\n }\n if (parsed.fragment) {\n try {\n parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment))\n } catch {\n parsed.error = parsed.error || 'URI malformed'\n }\n }\n }\n\n // perform scheme specific parsing\n if (schemeHandler && schemeHandler.parse) {\n schemeHandler.parse(parsed, options)\n }\n } else {\n parsed.error = parsed.error || 'URI can not be parsed.'\n }\n return { parsed, malformedAuthorityOrPort }\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns\n */\nfunction parse (uri, opts) {\n return parseWithStatus(uri, opts).parsed\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {string}\n */\nfunction normalizeString (uri, opts) {\n return normalizeStringWithStatus(uri, opts).normalized\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {{ normalized: string, malformedAuthorityOrPort: boolean }}\n */\nfunction normalizeStringWithStatus (uri, opts) {\n const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts)\n return {\n normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),\n malformedAuthorityOrPort\n }\n}\n\n/**\n * @param {import ('./types/index').URIComponent|string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {string|undefined}\n */\nfunction normalizeComparableURI (uri, opts) {\n if (typeof uri === 'string') {\n const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts)\n return malformedAuthorityOrPort ? undefined : normalized\n }\n\n if (typeof uri === 'object') {\n return serialize(uri, opts)\n }\n}\n\nconst fastUri = {\n SCHEMES,\n normalize,\n resolve,\n resolveComponent,\n equal,\n serialize,\n parse\n}\n\nmodule.exports = fastUri\nmodule.exports.default = fastUri\nmodule.exports.fastUri = fastUri\n",
|
|
29
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst uri = require(\"fast-uri\");\nuri.code = 'require(\"ajv/dist/runtime/uri\").default';\nexports.default = uri;\n//# sourceMappingURL=uri.js.map",
|
|
30
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;\nvar validate_1 = require(\"./compile/validate\");\nObject.defineProperty(exports, \"KeywordCxt\", { enumerable: true, get: function () { return validate_1.KeywordCxt; } });\nvar codegen_1 = require(\"./compile/codegen\");\nObject.defineProperty(exports, \"_\", { enumerable: true, get: function () { return codegen_1._; } });\nObject.defineProperty(exports, \"str\", { enumerable: true, get: function () { return codegen_1.str; } });\nObject.defineProperty(exports, \"stringify\", { enumerable: true, get: function () { return codegen_1.stringify; } });\nObject.defineProperty(exports, \"nil\", { enumerable: true, get: function () { return codegen_1.nil; } });\nObject.defineProperty(exports, \"Name\", { enumerable: true, get: function () { return codegen_1.Name; } });\nObject.defineProperty(exports, \"CodeGen\", { enumerable: true, get: function () { return codegen_1.CodeGen; } });\nconst validation_error_1 = require(\"./runtime/validation_error\");\nconst ref_error_1 = require(\"./compile/ref_error\");\nconst rules_1 = require(\"./compile/rules\");\nconst compile_1 = require(\"./compile\");\nconst codegen_2 = require(\"./compile/codegen\");\nconst resolve_1 = require(\"./compile/resolve\");\nconst dataType_1 = require(\"./compile/validate/dataType\");\nconst util_1 = require(\"./compile/util\");\nconst $dataRefSchema = require(\"./refs/data.json\");\nconst uri_1 = require(\"./runtime/uri\");\nconst defaultRegExp = (str, flags) => new RegExp(str, flags);\ndefaultRegExp.code = \"new RegExp\";\nconst META_IGNORE_OPTIONS = [\"removeAdditional\", \"useDefaults\", \"coerceTypes\"];\nconst EXT_SCOPE_NAMES = new Set([\n \"validate\",\n \"serialize\",\n \"parse\",\n \"wrapper\",\n \"root\",\n \"schema\",\n \"keyword\",\n \"pattern\",\n \"formats\",\n \"validate$data\",\n \"func\",\n \"obj\",\n \"Error\",\n]);\nconst removedOptions = {\n errorDataPath: \"\",\n format: \"`validateFormats: false` can be used instead.\",\n nullable: '\"nullable\" keyword is supported by default.',\n jsonPointers: \"Deprecated jsPropertySyntax can be used instead.\",\n extendRefs: \"Deprecated ignoreKeywordsWithRef can be used instead.\",\n missingRefs: \"Pass empty schema with $id that should be ignored to ajv.addSchema.\",\n processCode: \"Use option `code: {process: (code, schemaEnv: object) => string}`\",\n sourceCode: \"Use option `code: {source: true}`\",\n strictDefaults: \"It is default now, see option `strict`.\",\n strictKeywords: \"It is default now, see option `strict`.\",\n uniqueItems: '\"uniqueItems\" keyword is always validated.',\n unknownFormats: \"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).\",\n cache: \"Map is used as cache, schema object as key.\",\n serialize: \"Map is used as cache, schema object as key.\",\n ajvErrors: \"It is default now.\",\n};\nconst deprecatedOptions = {\n ignoreKeywordsWithRef: \"\",\n jsPropertySyntax: \"\",\n unicode: '\"minLength\"/\"maxLength\" account for unicode characters by default.',\n};\nconst MAX_EXPRESSION = 200;\n// eslint-disable-next-line complexity\nfunction requiredOptions(o) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;\n const s = o.strict;\n const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize;\n const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0;\n const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp;\n const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default;\n return {\n strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true,\n strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true,\n strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : \"log\",\n strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : \"log\",\n strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false,\n code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp },\n loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION,\n loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION,\n meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true,\n messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true,\n inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true,\n schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : \"$id\",\n addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true,\n validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true,\n validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true,\n unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true,\n int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true,\n uriResolver: uriResolver,\n };\n}\nclass Ajv {\n constructor(opts = {}) {\n this.schemas = {};\n this.refs = {};\n this.formats = {};\n this._compilations = new Set();\n this._loading = {};\n this._cache = new Map();\n opts = this.opts = { ...opts, ...requiredOptions(opts) };\n const { es5, lines } = this.opts.code;\n this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines });\n this.logger = getLogger(opts.logger);\n const formatOpt = opts.validateFormats;\n opts.validateFormats = false;\n this.RULES = (0, rules_1.getRules)();\n checkOptions.call(this, removedOptions, opts, \"NOT SUPPORTED\");\n checkOptions.call(this, deprecatedOptions, opts, \"DEPRECATED\", \"warn\");\n this._metaOpts = getMetaSchemaOptions.call(this);\n if (opts.formats)\n addInitialFormats.call(this);\n this._addVocabularies();\n this._addDefaultMetaSchema();\n if (opts.keywords)\n addInitialKeywords.call(this, opts.keywords);\n if (typeof opts.meta == \"object\")\n this.addMetaSchema(opts.meta);\n addInitialSchemas.call(this);\n opts.validateFormats = formatOpt;\n }\n _addVocabularies() {\n this.addKeyword(\"$async\");\n }\n _addDefaultMetaSchema() {\n const { $data, meta, schemaId } = this.opts;\n let _dataRefSchema = $dataRefSchema;\n if (schemaId === \"id\") {\n _dataRefSchema = { ...$dataRefSchema };\n _dataRefSchema.id = _dataRefSchema.$id;\n delete _dataRefSchema.$id;\n }\n if (meta && $data)\n this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false);\n }\n defaultMeta() {\n const { meta, schemaId } = this.opts;\n return (this.opts.defaultMeta = typeof meta == \"object\" ? meta[schemaId] || meta : undefined);\n }\n validate(schemaKeyRef, // key, ref or schema object\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n data // to be validated\n ) {\n let v;\n if (typeof schemaKeyRef == \"string\") {\n v = this.getSchema(schemaKeyRef);\n if (!v)\n throw new Error(`no schema with key or ref \"${schemaKeyRef}\"`);\n }\n else {\n v = this.compile(schemaKeyRef);\n }\n const valid = v(data);\n if (!(\"$async\" in v))\n this.errors = v.errors;\n return valid;\n }\n compile(schema, _meta) {\n const sch = this._addSchema(schema, _meta);\n return (sch.validate || this._compileSchemaEnv(sch));\n }\n compileAsync(schema, meta) {\n if (typeof this.opts.loadSchema != \"function\") {\n throw new Error(\"options.loadSchema should be a function\");\n }\n const { loadSchema } = this.opts;\n return runCompileAsync.call(this, schema, meta);\n async function runCompileAsync(_schema, _meta) {\n await loadMetaSchema.call(this, _schema.$schema);\n const sch = this._addSchema(_schema, _meta);\n return sch.validate || _compileAsync.call(this, sch);\n }\n async function loadMetaSchema($ref) {\n if ($ref && !this.getSchema($ref)) {\n await runCompileAsync.call(this, { $ref }, true);\n }\n }\n async function _compileAsync(sch) {\n try {\n return this._compileSchemaEnv(sch);\n }\n catch (e) {\n if (!(e instanceof ref_error_1.default))\n throw e;\n checkLoaded.call(this, e);\n await loadMissingSchema.call(this, e.missingSchema);\n return _compileAsync.call(this, sch);\n }\n }\n function checkLoaded({ missingSchema: ref, missingRef }) {\n if (this.refs[ref]) {\n throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`);\n }\n }\n async function loadMissingSchema(ref) {\n const _schema = await _loadSchema.call(this, ref);\n if (!this.refs[ref])\n await loadMetaSchema.call(this, _schema.$schema);\n if (!this.refs[ref])\n this.addSchema(_schema, ref, meta);\n }\n async function _loadSchema(ref) {\n const p = this._loading[ref];\n if (p)\n return p;\n try {\n return await (this._loading[ref] = loadSchema(ref));\n }\n finally {\n delete this._loading[ref];\n }\n }\n }\n // Adds schema to the instance\n addSchema(schema, // If array is passed, `key` will be ignored\n key, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.\n _meta, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.\n _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead.\n ) {\n if (Array.isArray(schema)) {\n for (const sch of schema)\n this.addSchema(sch, undefined, _meta, _validateSchema);\n return this;\n }\n let id;\n if (typeof schema === \"object\") {\n const { schemaId } = this.opts;\n id = schema[schemaId];\n if (id !== undefined && typeof id != \"string\") {\n throw new Error(`schema ${schemaId} must be string`);\n }\n }\n key = (0, resolve_1.normalizeId)(key || id);\n this._checkUnique(key);\n this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true);\n return this;\n }\n // Add schema that will be used to validate other schemas\n // options in META_IGNORE_OPTIONS are alway set to false\n addMetaSchema(schema, key, // schema key\n _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema\n ) {\n this.addSchema(schema, key, true, _validateSchema);\n return this;\n }\n // Validate schema against its meta-schema\n validateSchema(schema, throwOrLogError) {\n if (typeof schema == \"boolean\")\n return true;\n let $schema;\n $schema = schema.$schema;\n if ($schema !== undefined && typeof $schema != \"string\") {\n throw new Error(\"$schema must be a string\");\n }\n $schema = $schema || this.opts.defaultMeta || this.defaultMeta();\n if (!$schema) {\n this.logger.warn(\"meta-schema not available\");\n this.errors = null;\n return true;\n }\n const valid = this.validate($schema, schema);\n if (!valid && throwOrLogError) {\n const message = \"schema is invalid: \" + this.errorsText();\n if (this.opts.validateSchema === \"log\")\n this.logger.error(message);\n else\n throw new Error(message);\n }\n return valid;\n }\n // Get compiled schema by `key` or `ref`.\n // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)\n getSchema(keyRef) {\n let sch;\n while (typeof (sch = getSchEnv.call(this, keyRef)) == \"string\")\n keyRef = sch;\n if (sch === undefined) {\n const { schemaId } = this.opts;\n const root = new compile_1.SchemaEnv({ schema: {}, schemaId });\n sch = compile_1.resolveSchema.call(this, root, keyRef);\n if (!sch)\n return;\n this.refs[keyRef] = sch;\n }\n return (sch.validate || this._compileSchemaEnv(sch));\n }\n // Remove cached schema(s).\n // If no parameter is passed all schemas but meta-schemas are removed.\n // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.\n // Even if schema is referenced by other schemas it still can be removed as other schemas have local references.\n removeSchema(schemaKeyRef) {\n if (schemaKeyRef instanceof RegExp) {\n this._removeAllSchemas(this.schemas, schemaKeyRef);\n this._removeAllSchemas(this.refs, schemaKeyRef);\n return this;\n }\n switch (typeof schemaKeyRef) {\n case \"undefined\":\n this._removeAllSchemas(this.schemas);\n this._removeAllSchemas(this.refs);\n this._cache.clear();\n return this;\n case \"string\": {\n const sch = getSchEnv.call(this, schemaKeyRef);\n if (typeof sch == \"object\")\n this._cache.delete(sch.schema);\n delete this.schemas[schemaKeyRef];\n delete this.refs[schemaKeyRef];\n return this;\n }\n case \"object\": {\n const cacheKey = schemaKeyRef;\n this._cache.delete(cacheKey);\n let id = schemaKeyRef[this.opts.schemaId];\n if (id) {\n id = (0, resolve_1.normalizeId)(id);\n delete this.schemas[id];\n delete this.refs[id];\n }\n return this;\n }\n default:\n throw new Error(\"ajv.removeSchema: invalid parameter\");\n }\n }\n // add \"vocabulary\" - a collection of keywords\n addVocabulary(definitions) {\n for (const def of definitions)\n this.addKeyword(def);\n return this;\n }\n addKeyword(kwdOrDef, def // deprecated\n ) {\n let keyword;\n if (typeof kwdOrDef == \"string\") {\n keyword = kwdOrDef;\n if (typeof def == \"object\") {\n this.logger.warn(\"these parameters are deprecated, see docs for addKeyword\");\n def.keyword = keyword;\n }\n }\n else if (typeof kwdOrDef == \"object\" && def === undefined) {\n def = kwdOrDef;\n keyword = def.keyword;\n if (Array.isArray(keyword) && !keyword.length) {\n throw new Error(\"addKeywords: keyword must be string or non-empty array\");\n }\n }\n else {\n throw new Error(\"invalid addKeywords parameters\");\n }\n checkKeyword.call(this, keyword, def);\n if (!def) {\n (0, util_1.eachItem)(keyword, (kwd) => addRule.call(this, kwd));\n return this;\n }\n keywordMetaschema.call(this, def);\n const definition = {\n ...def,\n type: (0, dataType_1.getJSONTypes)(def.type),\n schemaType: (0, dataType_1.getJSONTypes)(def.schemaType),\n };\n (0, util_1.eachItem)(keyword, definition.type.length === 0\n ? (k) => addRule.call(this, k, definition)\n : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)));\n return this;\n }\n getKeyword(keyword) {\n const rule = this.RULES.all[keyword];\n return typeof rule == \"object\" ? rule.definition : !!rule;\n }\n // Remove keyword\n removeKeyword(keyword) {\n // TODO return type should be Ajv\n const { RULES } = this;\n delete RULES.keywords[keyword];\n delete RULES.all[keyword];\n for (const group of RULES.rules) {\n const i = group.rules.findIndex((rule) => rule.keyword === keyword);\n if (i >= 0)\n group.rules.splice(i, 1);\n }\n return this;\n }\n // Add format\n addFormat(name, format) {\n if (typeof format == \"string\")\n format = new RegExp(format);\n this.formats[name] = format;\n return this;\n }\n errorsText(errors = this.errors, // optional array of validation errors\n { separator = \", \", dataVar = \"data\" } = {} // optional options with properties `separator` and `dataVar`\n ) {\n if (!errors || errors.length === 0)\n return \"No errors\";\n return errors\n .map((e) => `${dataVar}${e.instancePath} ${e.message}`)\n .reduce((text, msg) => text + separator + msg);\n }\n $dataMetaSchema(metaSchema, keywordsJsonPointers) {\n const rules = this.RULES.all;\n metaSchema = JSON.parse(JSON.stringify(metaSchema));\n for (const jsonPointer of keywordsJsonPointers) {\n const segments = jsonPointer.split(\"/\").slice(1); // first segment is an empty string\n let keywords = metaSchema;\n for (const seg of segments)\n keywords = keywords[seg];\n for (const key in rules) {\n const rule = rules[key];\n if (typeof rule != \"object\")\n continue;\n const { $data } = rule.definition;\n const schema = keywords[key];\n if ($data && schema)\n keywords[key] = schemaOrData(schema);\n }\n }\n return metaSchema;\n }\n _removeAllSchemas(schemas, regex) {\n for (const keyRef in schemas) {\n const sch = schemas[keyRef];\n if (!regex || regex.test(keyRef)) {\n if (typeof sch == \"string\") {\n delete schemas[keyRef];\n }\n else if (sch && !sch.meta) {\n this._cache.delete(sch.schema);\n delete schemas[keyRef];\n }\n }\n }\n }\n _addSchema(schema, meta, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {\n let id;\n const { schemaId } = this.opts;\n if (typeof schema == \"object\") {\n id = schema[schemaId];\n }\n else {\n if (this.opts.jtd)\n throw new Error(\"schema must be object\");\n else if (typeof schema != \"boolean\")\n throw new Error(\"schema must be object or boolean\");\n }\n let sch = this._cache.get(schema);\n if (sch !== undefined)\n return sch;\n baseId = (0, resolve_1.normalizeId)(id || baseId);\n const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId);\n sch = new compile_1.SchemaEnv({ schema, schemaId, meta, baseId, localRefs });\n this._cache.set(sch.schema, sch);\n if (addSchema && !baseId.startsWith(\"#\")) {\n // TODO atm it is allowed to overwrite schemas without id (instead of not adding them)\n if (baseId)\n this._checkUnique(baseId);\n this.refs[baseId] = sch;\n }\n if (validateSchema)\n this.validateSchema(schema, true);\n return sch;\n }\n _checkUnique(id) {\n if (this.schemas[id] || this.refs[id]) {\n throw new Error(`schema with key or id \"${id}\" already exists`);\n }\n }\n _compileSchemaEnv(sch) {\n if (sch.meta)\n this._compileMetaSchema(sch);\n else\n compile_1.compileSchema.call(this, sch);\n /* istanbul ignore if */\n if (!sch.validate)\n throw new Error(\"ajv implementation error\");\n return sch.validate;\n }\n _compileMetaSchema(sch) {\n const currentOpts = this.opts;\n this.opts = this._metaOpts;\n try {\n compile_1.compileSchema.call(this, sch);\n }\n finally {\n this.opts = currentOpts;\n }\n }\n}\nAjv.ValidationError = validation_error_1.default;\nAjv.MissingRefError = ref_error_1.default;\nexports.default = Ajv;\nfunction checkOptions(checkOpts, options, msg, log = \"error\") {\n for (const key in checkOpts) {\n const opt = key;\n if (opt in options)\n this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`);\n }\n}\nfunction getSchEnv(keyRef) {\n keyRef = (0, resolve_1.normalizeId)(keyRef); // TODO tests fail without this line\n return this.schemas[keyRef] || this.refs[keyRef];\n}\nfunction addInitialSchemas() {\n const optsSchemas = this.opts.schemas;\n if (!optsSchemas)\n return;\n if (Array.isArray(optsSchemas))\n this.addSchema(optsSchemas);\n else\n for (const key in optsSchemas)\n this.addSchema(optsSchemas[key], key);\n}\nfunction addInitialFormats() {\n for (const name in this.opts.formats) {\n const format = this.opts.formats[name];\n if (format)\n this.addFormat(name, format);\n }\n}\nfunction addInitialKeywords(defs) {\n if (Array.isArray(defs)) {\n this.addVocabulary(defs);\n return;\n }\n this.logger.warn(\"keywords option as map is deprecated, pass array\");\n for (const keyword in defs) {\n const def = defs[keyword];\n if (!def.keyword)\n def.keyword = keyword;\n this.addKeyword(def);\n }\n}\nfunction getMetaSchemaOptions() {\n const metaOpts = { ...this.opts };\n for (const opt of META_IGNORE_OPTIONS)\n delete metaOpts[opt];\n return metaOpts;\n}\nconst noLogs = { log() { }, warn() { }, error() { } };\nfunction getLogger(logger) {\n if (logger === false)\n return noLogs;\n if (logger === undefined)\n return console;\n if (logger.log && logger.warn && logger.error)\n return logger;\n throw new Error(\"logger must implement log, warn and error methods\");\n}\nconst KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i;\nfunction checkKeyword(keyword, def) {\n const { RULES } = this;\n (0, util_1.eachItem)(keyword, (kwd) => {\n if (RULES.keywords[kwd])\n throw new Error(`Keyword ${kwd} is already defined`);\n if (!KEYWORD_NAME.test(kwd))\n throw new Error(`Keyword ${kwd} has invalid name`);\n });\n if (!def)\n return;\n if (def.$data && !(\"code\" in def || \"validate\" in def)) {\n throw new Error('$data keyword must have \"code\" or \"validate\" function');\n }\n}\nfunction addRule(keyword, definition, dataType) {\n var _a;\n const post = definition === null || definition === void 0 ? void 0 : definition.post;\n if (dataType && post)\n throw new Error('keyword with \"post\" flag cannot have \"type\"');\n const { RULES } = this;\n let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType);\n if (!ruleGroup) {\n ruleGroup = { type: dataType, rules: [] };\n RULES.rules.push(ruleGroup);\n }\n RULES.keywords[keyword] = true;\n if (!definition)\n return;\n const rule = {\n keyword,\n definition: {\n ...definition,\n type: (0, dataType_1.getJSONTypes)(definition.type),\n schemaType: (0, dataType_1.getJSONTypes)(definition.schemaType),\n },\n };\n if (definition.before)\n addBeforeRule.call(this, ruleGroup, rule, definition.before);\n else\n ruleGroup.rules.push(rule);\n RULES.all[keyword] = rule;\n (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd));\n}\nfunction addBeforeRule(ruleGroup, rule, before) {\n const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before);\n if (i >= 0) {\n ruleGroup.rules.splice(i, 0, rule);\n }\n else {\n ruleGroup.rules.push(rule);\n this.logger.warn(`rule ${before} is not defined`);\n }\n}\nfunction keywordMetaschema(def) {\n let { metaSchema } = def;\n if (metaSchema === undefined)\n return;\n if (def.$data && this.opts.$data)\n metaSchema = schemaOrData(metaSchema);\n def.validateSchema = this.compile(metaSchema, true);\n}\nconst $dataRef = {\n $ref: \"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#\",\n};\nfunction schemaOrData(schema) {\n return { anyOf: [schema, $dataRef] };\n}\n//# sourceMappingURL=core.js.map",
|
|
31
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst def = {\n keyword: \"id\",\n code() {\n throw new Error('NOT SUPPORTED: keyword \"id\", use \"$id\" for schema ID');\n },\n};\nexports.default = def;\n//# sourceMappingURL=id.js.map",
|
|
32
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.callRef = exports.getValidate = void 0;\nconst ref_error_1 = require(\"../../compile/ref_error\");\nconst code_1 = require(\"../code\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst names_1 = require(\"../../compile/names\");\nconst compile_1 = require(\"../../compile\");\nconst util_1 = require(\"../../compile/util\");\nconst def = {\n keyword: \"$ref\",\n schemaType: \"string\",\n code(cxt) {\n const { gen, schema: $ref, it } = cxt;\n const { baseId, schemaEnv: env, validateName, opts, self } = it;\n const { root } = env;\n if (($ref === \"#\" || $ref === \"#/\") && baseId === root.baseId)\n return callRootRef();\n const schOrEnv = compile_1.resolveRef.call(self, root, baseId, $ref);\n if (schOrEnv === undefined)\n throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref);\n if (schOrEnv instanceof compile_1.SchemaEnv)\n return callValidate(schOrEnv);\n return inlineRefSchema(schOrEnv);\n function callRootRef() {\n if (env === root)\n return callRef(cxt, validateName, env, env.$async);\n const rootName = gen.scopeValue(\"root\", { ref: root });\n return callRef(cxt, (0, codegen_1._) `${rootName}.validate`, root, root.$async);\n }\n function callValidate(sch) {\n const v = getValidate(cxt, sch);\n callRef(cxt, v, sch, sch.$async);\n }\n function inlineRefSchema(sch) {\n const schName = gen.scopeValue(\"schema\", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch });\n const valid = gen.name(\"valid\");\n const schCxt = cxt.subschema({\n schema: sch,\n dataTypes: [],\n schemaPath: codegen_1.nil,\n topSchemaRef: schName,\n errSchemaPath: $ref,\n }, valid);\n cxt.mergeEvaluated(schCxt);\n cxt.ok(valid);\n }\n },\n};\nfunction getValidate(cxt, sch) {\n const { gen } = cxt;\n return sch.validate\n ? gen.scopeValue(\"validate\", { ref: sch.validate })\n : (0, codegen_1._) `${gen.scopeValue(\"wrapper\", { ref: sch })}.validate`;\n}\nexports.getValidate = getValidate;\nfunction callRef(cxt, v, sch, $async) {\n const { gen, it } = cxt;\n const { allErrors, schemaEnv: env, opts } = it;\n const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil;\n if ($async)\n callAsyncRef();\n else\n callSyncRef();\n function callAsyncRef() {\n if (!env.$async)\n throw new Error(\"async schema referenced by sync schema\");\n const valid = gen.let(\"valid\");\n gen.try(() => {\n gen.code((0, codegen_1._) `await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`);\n addEvaluatedFrom(v); // TODO will not work with async, it has to be returned with the result\n if (!allErrors)\n gen.assign(valid, true);\n }, (e) => {\n gen.if((0, codegen_1._) `!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e));\n addErrorsFrom(e);\n if (!allErrors)\n gen.assign(valid, false);\n });\n cxt.ok(valid);\n }\n function callSyncRef() {\n cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v));\n }\n function addErrorsFrom(source) {\n const errs = (0, codegen_1._) `${source}.errors`;\n gen.assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`); // TODO tagged\n gen.assign(names_1.default.errors, (0, codegen_1._) `${names_1.default.vErrors}.length`);\n }\n function addEvaluatedFrom(source) {\n var _a;\n if (!it.opts.unevaluated)\n return;\n const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated;\n // TODO refactor\n if (it.props !== true) {\n if (schEvaluated && !schEvaluated.dynamicProps) {\n if (schEvaluated.props !== undefined) {\n it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props);\n }\n }\n else {\n const props = gen.var(\"props\", (0, codegen_1._) `${source}.evaluated.props`);\n it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name);\n }\n }\n if (it.items !== true) {\n if (schEvaluated && !schEvaluated.dynamicItems) {\n if (schEvaluated.items !== undefined) {\n it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items);\n }\n }\n else {\n const items = gen.var(\"items\", (0, codegen_1._) `${source}.evaluated.items`);\n it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name);\n }\n }\n }\n}\nexports.callRef = callRef;\nexports.default = def;\n//# sourceMappingURL=ref.js.map",
|
|
33
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst id_1 = require(\"./id\");\nconst ref_1 = require(\"./ref\");\nconst core = [\n \"$schema\",\n \"$id\",\n \"$defs\",\n \"$vocabulary\",\n { keyword: \"$comment\" },\n \"definitions\",\n id_1.default,\n ref_1.default,\n];\nexports.default = core;\n//# sourceMappingURL=index.js.map",
|
|
34
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst ops = codegen_1.operators;\nconst KWDs = {\n maximum: { okStr: \"<=\", ok: ops.LTE, fail: ops.GT },\n minimum: { okStr: \">=\", ok: ops.GTE, fail: ops.LT },\n exclusiveMaximum: { okStr: \"<\", ok: ops.LT, fail: ops.GTE },\n exclusiveMinimum: { okStr: \">\", ok: ops.GT, fail: ops.LTE },\n};\nconst error = {\n message: ({ keyword, schemaCode }) => (0, codegen_1.str) `must be ${KWDs[keyword].okStr} ${schemaCode}`,\n params: ({ keyword, schemaCode }) => (0, codegen_1._) `{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`,\n};\nconst def = {\n keyword: Object.keys(KWDs),\n type: \"number\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt) {\n const { keyword, data, schemaCode } = cxt;\n cxt.fail$data((0, codegen_1._) `${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=limitNumber.js.map",
|
|
35
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst error = {\n message: ({ schemaCode }) => (0, codegen_1.str) `must be multiple of ${schemaCode}`,\n params: ({ schemaCode }) => (0, codegen_1._) `{multipleOf: ${schemaCode}}`,\n};\nconst def = {\n keyword: \"multipleOf\",\n type: \"number\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt) {\n const { gen, data, schemaCode, it } = cxt;\n // const bdt = bad$DataType(schemaCode, <string>def.schemaType, $data)\n const prec = it.opts.multipleOfPrecision;\n const res = gen.let(\"res\");\n const invalid = prec\n ? (0, codegen_1._) `Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}`\n : (0, codegen_1._) `${res} !== parseInt(${res})`;\n cxt.fail$data((0, codegen_1._) `(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=multipleOf.js.map",
|
|
36
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// https://mathiasbynens.be/notes/javascript-encoding\n// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode\nfunction ucs2length(str) {\n const len = str.length;\n let length = 0;\n let pos = 0;\n let value;\n while (pos < len) {\n length++;\n value = str.charCodeAt(pos++);\n if (value >= 0xd800 && value <= 0xdbff && pos < len) {\n // high surrogate, and there is a next character\n value = str.charCodeAt(pos);\n if ((value & 0xfc00) === 0xdc00)\n pos++; // low surrogate\n }\n }\n return length;\n}\nexports.default = ucs2length;\nucs2length.code = 'require(\"ajv/dist/runtime/ucs2length\").default';\n//# sourceMappingURL=ucs2length.js.map",
|
|
37
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst ucs2length_1 = require(\"../../runtime/ucs2length\");\nconst error = {\n message({ keyword, schemaCode }) {\n const comp = keyword === \"maxLength\" ? \"more\" : \"fewer\";\n return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} characters`;\n },\n params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,\n};\nconst def = {\n keyword: [\"maxLength\", \"minLength\"],\n type: \"string\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt) {\n const { keyword, data, schemaCode, it } = cxt;\n const op = keyword === \"maxLength\" ? codegen_1.operators.GT : codegen_1.operators.LT;\n const len = it.opts.unicode === false ? (0, codegen_1._) `${data}.length` : (0, codegen_1._) `${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`;\n cxt.fail$data((0, codegen_1._) `${len} ${op} ${schemaCode}`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=limitLength.js.map",
|
|
38
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code_1 = require(\"../code\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst error = {\n message: ({ schemaCode }) => (0, codegen_1.str) `must match pattern \"${schemaCode}\"`,\n params: ({ schemaCode }) => (0, codegen_1._) `{pattern: ${schemaCode}}`,\n};\nconst def = {\n keyword: \"pattern\",\n type: \"string\",\n schemaType: \"string\",\n $data: true,\n error,\n code(cxt) {\n const { data, $data, schema, schemaCode, it } = cxt;\n // TODO regexp should be wrapped in try/catchs\n const u = it.opts.unicodeRegExp ? \"u\" : \"\";\n const regExp = $data ? (0, codegen_1._) `(new RegExp(${schemaCode}, ${u}))` : (0, code_1.usePattern)(cxt, schema);\n cxt.fail$data((0, codegen_1._) `!${regExp}.test(${data})`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=pattern.js.map",
|
|
39
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst error = {\n message({ keyword, schemaCode }) {\n const comp = keyword === \"maxProperties\" ? \"more\" : \"fewer\";\n return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} properties`;\n },\n params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,\n};\nconst def = {\n keyword: [\"maxProperties\", \"minProperties\"],\n type: \"object\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt) {\n const { keyword, data, schemaCode } = cxt;\n const op = keyword === \"maxProperties\" ? codegen_1.operators.GT : codegen_1.operators.LT;\n cxt.fail$data((0, codegen_1._) `Object.keys(${data}).length ${op} ${schemaCode}`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=limitProperties.js.map",
|
|
40
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code_1 = require(\"../code\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: ({ params: { missingProperty } }) => (0, codegen_1.str) `must have required property '${missingProperty}'`,\n params: ({ params: { missingProperty } }) => (0, codegen_1._) `{missingProperty: ${missingProperty}}`,\n};\nconst def = {\n keyword: \"required\",\n type: \"object\",\n schemaType: \"array\",\n $data: true,\n error,\n code(cxt) {\n const { gen, schema, schemaCode, data, $data, it } = cxt;\n const { opts } = it;\n if (!$data && schema.length === 0)\n return;\n const useLoop = schema.length >= opts.loopRequired;\n if (it.allErrors)\n allErrorsMode();\n else\n exitOnErrorMode();\n if (opts.strictRequired) {\n const props = cxt.parentSchema.properties;\n const { definedProperties } = cxt.it;\n for (const requiredKey of schema) {\n if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === undefined && !definedProperties.has(requiredKey)) {\n const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;\n const msg = `required property \"${requiredKey}\" is not defined at \"${schemaPath}\" (strictRequired)`;\n (0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired);\n }\n }\n }\n function allErrorsMode() {\n if (useLoop || $data) {\n cxt.block$data(codegen_1.nil, loopAllRequired);\n }\n else {\n for (const prop of schema) {\n (0, code_1.checkReportMissingProp)(cxt, prop);\n }\n }\n }\n function exitOnErrorMode() {\n const missing = gen.let(\"missing\");\n if (useLoop || $data) {\n const valid = gen.let(\"valid\", true);\n cxt.block$data(valid, () => loopUntilMissing(missing, valid));\n cxt.ok(valid);\n }\n else {\n gen.if((0, code_1.checkMissingProp)(cxt, schema, missing));\n (0, code_1.reportMissingProp)(cxt, missing);\n gen.else();\n }\n }\n function loopAllRequired() {\n gen.forOf(\"prop\", schemaCode, (prop) => {\n cxt.setParams({ missingProperty: prop });\n gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error());\n });\n }\n function loopUntilMissing(missing, valid) {\n cxt.setParams({ missingProperty: missing });\n gen.forOf(missing, schemaCode, () => {\n gen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties));\n gen.if((0, codegen_1.not)(valid), () => {\n cxt.error();\n gen.break();\n });\n }, codegen_1.nil);\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=required.js.map",
|
|
41
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst error = {\n message({ keyword, schemaCode }) {\n const comp = keyword === \"maxItems\" ? \"more\" : \"fewer\";\n return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} items`;\n },\n params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,\n};\nconst def = {\n keyword: [\"maxItems\", \"minItems\"],\n type: \"array\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt) {\n const { keyword, data, schemaCode } = cxt;\n const op = keyword === \"maxItems\" ? codegen_1.operators.GT : codegen_1.operators.LT;\n cxt.fail$data((0, codegen_1._) `${data}.length ${op} ${schemaCode}`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=limitItems.js.map",
|
|
42
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// https://github.com/ajv-validator/ajv/issues/889\nconst equal = require(\"fast-deep-equal\");\nequal.code = 'require(\"ajv/dist/runtime/equal\").default';\nexports.default = equal;\n//# sourceMappingURL=equal.js.map",
|
|
43
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst dataType_1 = require(\"../../compile/validate/dataType\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst equal_1 = require(\"../../runtime/equal\");\nconst error = {\n message: ({ params: { i, j } }) => (0, codegen_1.str) `must NOT have duplicate items (items ## ${j} and ${i} are identical)`,\n params: ({ params: { i, j } }) => (0, codegen_1._) `{i: ${i}, j: ${j}}`,\n};\nconst def = {\n keyword: \"uniqueItems\",\n type: \"array\",\n schemaType: \"boolean\",\n $data: true,\n error,\n code(cxt) {\n const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt;\n if (!$data && !schema)\n return;\n const valid = gen.let(\"valid\");\n const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : [];\n cxt.block$data(valid, validateUniqueItems, (0, codegen_1._) `${schemaCode} === false`);\n cxt.ok(valid);\n function validateUniqueItems() {\n const i = gen.let(\"i\", (0, codegen_1._) `${data}.length`);\n const j = gen.let(\"j\");\n cxt.setParams({ i, j });\n gen.assign(valid, true);\n gen.if((0, codegen_1._) `${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j));\n }\n function canOptimize() {\n return itemTypes.length > 0 && !itemTypes.some((t) => t === \"object\" || t === \"array\");\n }\n function loopN(i, j) {\n const item = gen.name(\"item\");\n const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong);\n const indices = gen.const(\"indices\", (0, codegen_1._) `{}`);\n gen.for((0, codegen_1._) `;${i}--;`, () => {\n gen.let(item, (0, codegen_1._) `${data}[${i}]`);\n gen.if(wrongType, (0, codegen_1._) `continue`);\n if (itemTypes.length > 1)\n gen.if((0, codegen_1._) `typeof ${item} == \"string\"`, (0, codegen_1._) `${item} += \"_\"`);\n gen\n .if((0, codegen_1._) `typeof ${indices}[${item}] == \"number\"`, () => {\n gen.assign(j, (0, codegen_1._) `${indices}[${item}]`);\n cxt.error();\n gen.assign(valid, false).break();\n })\n .code((0, codegen_1._) `${indices}[${item}] = ${i}`);\n });\n }\n function loopN2(i, j) {\n const eql = (0, util_1.useFunc)(gen, equal_1.default);\n const outer = gen.name(\"outer\");\n gen.label(outer).for((0, codegen_1._) `;${i}--;`, () => gen.for((0, codegen_1._) `${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._) `${eql}(${data}[${i}], ${data}[${j}])`, () => {\n cxt.error();\n gen.assign(valid, false).break(outer);\n })));\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=uniqueItems.js.map",
|
|
44
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst equal_1 = require(\"../../runtime/equal\");\nconst error = {\n message: \"must be equal to constant\",\n params: ({ schemaCode }) => (0, codegen_1._) `{allowedValue: ${schemaCode}}`,\n};\nconst def = {\n keyword: \"const\",\n $data: true,\n error,\n code(cxt) {\n const { gen, data, $data, schemaCode, schema } = cxt;\n if ($data || (schema && typeof schema == \"object\")) {\n cxt.fail$data((0, codegen_1._) `!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`);\n }\n else {\n cxt.fail((0, codegen_1._) `${schema} !== ${data}`);\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=const.js.map",
|
|
45
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst equal_1 = require(\"../../runtime/equal\");\nconst error = {\n message: \"must be equal to one of the allowed values\",\n params: ({ schemaCode }) => (0, codegen_1._) `{allowedValues: ${schemaCode}}`,\n};\nconst def = {\n keyword: \"enum\",\n schemaType: \"array\",\n $data: true,\n error,\n code(cxt) {\n const { gen, data, $data, schema, schemaCode, it } = cxt;\n if (!$data && schema.length === 0)\n throw new Error(\"enum must have non-empty array\");\n const useLoop = schema.length >= it.opts.loopEnum;\n let eql;\n const getEql = () => (eql !== null && eql !== void 0 ? eql : (eql = (0, util_1.useFunc)(gen, equal_1.default)));\n let valid;\n if (useLoop || $data) {\n valid = gen.let(\"valid\");\n cxt.block$data(valid, loopEnum);\n }\n else {\n /* istanbul ignore if */\n if (!Array.isArray(schema))\n throw new Error(\"ajv implementation error\");\n const vSchema = gen.const(\"vSchema\", schemaCode);\n valid = (0, codegen_1.or)(...schema.map((_x, i) => equalCode(vSchema, i)));\n }\n cxt.pass(valid);\n function loopEnum() {\n gen.assign(valid, false);\n gen.forOf(\"v\", schemaCode, (v) => gen.if((0, codegen_1._) `${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));\n }\n function equalCode(vSchema, i) {\n const sch = schema[i];\n return typeof sch === \"object\" && sch !== null\n ? (0, codegen_1._) `${getEql()}(${data}, ${vSchema}[${i}])`\n : (0, codegen_1._) `${data} === ${sch}`;\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=enum.js.map",
|
|
46
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst limitNumber_1 = require(\"./limitNumber\");\nconst multipleOf_1 = require(\"./multipleOf\");\nconst limitLength_1 = require(\"./limitLength\");\nconst pattern_1 = require(\"./pattern\");\nconst limitProperties_1 = require(\"./limitProperties\");\nconst required_1 = require(\"./required\");\nconst limitItems_1 = require(\"./limitItems\");\nconst uniqueItems_1 = require(\"./uniqueItems\");\nconst const_1 = require(\"./const\");\nconst enum_1 = require(\"./enum\");\nconst validation = [\n // number\n limitNumber_1.default,\n multipleOf_1.default,\n // string\n limitLength_1.default,\n pattern_1.default,\n // object\n limitProperties_1.default,\n required_1.default,\n // array\n limitItems_1.default,\n uniqueItems_1.default,\n // any\n { keyword: \"type\", schemaType: [\"string\", \"array\"] },\n { keyword: \"nullable\", schemaType: \"boolean\" },\n const_1.default,\n enum_1.default,\n];\nexports.default = validation;\n//# sourceMappingURL=index.js.map",
|
|
47
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateAdditionalItems = void 0;\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`,\n params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`,\n};\nconst def = {\n keyword: \"additionalItems\",\n type: \"array\",\n schemaType: [\"boolean\", \"object\"],\n before: \"uniqueItems\",\n error,\n code(cxt) {\n const { parentSchema, it } = cxt;\n const { items } = parentSchema;\n if (!Array.isArray(items)) {\n (0, util_1.checkStrictMode)(it, '\"additionalItems\" is ignored when \"items\" is not an array of schemas');\n return;\n }\n validateAdditionalItems(cxt, items);\n },\n};\nfunction validateAdditionalItems(cxt, items) {\n const { gen, schema, data, keyword, it } = cxt;\n it.items = true;\n const len = gen.const(\"len\", (0, codegen_1._) `${data}.length`);\n if (schema === false) {\n cxt.setParams({ len: items.length });\n cxt.pass((0, codegen_1._) `${len} <= ${items.length}`);\n }\n else if (typeof schema == \"object\" && !(0, util_1.alwaysValidSchema)(it, schema)) {\n const valid = gen.var(\"valid\", (0, codegen_1._) `${len} <= ${items.length}`); // TODO var\n gen.if((0, codegen_1.not)(valid), () => validateItems(valid));\n cxt.ok(valid);\n }\n function validateItems(valid) {\n gen.forRange(\"i\", items.length, len, (i) => {\n cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid);\n if (!it.allErrors)\n gen.if((0, codegen_1.not)(valid), () => gen.break());\n });\n }\n}\nexports.validateAdditionalItems = validateAdditionalItems;\nexports.default = def;\n//# sourceMappingURL=additionalItems.js.map",
|
|
48
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateTuple = void 0;\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst code_1 = require(\"../code\");\nconst def = {\n keyword: \"items\",\n type: \"array\",\n schemaType: [\"object\", \"array\", \"boolean\"],\n before: \"uniqueItems\",\n code(cxt) {\n const { schema, it } = cxt;\n if (Array.isArray(schema))\n return validateTuple(cxt, \"additionalItems\", schema);\n it.items = true;\n if ((0, util_1.alwaysValidSchema)(it, schema))\n return;\n cxt.ok((0, code_1.validateArray)(cxt));\n },\n};\nfunction validateTuple(cxt, extraItems, schArr = cxt.schema) {\n const { gen, parentSchema, data, keyword, it } = cxt;\n checkStrictTuple(parentSchema);\n if (it.opts.unevaluated && schArr.length && it.items !== true) {\n it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items);\n }\n const valid = gen.name(\"valid\");\n const len = gen.const(\"len\", (0, codegen_1._) `${data}.length`);\n schArr.forEach((sch, i) => {\n if ((0, util_1.alwaysValidSchema)(it, sch))\n return;\n gen.if((0, codegen_1._) `${len} > ${i}`, () => cxt.subschema({\n keyword,\n schemaProp: i,\n dataProp: i,\n }, valid));\n cxt.ok(valid);\n });\n function checkStrictTuple(sch) {\n const { opts, errSchemaPath } = it;\n const l = schArr.length;\n const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false);\n if (opts.strictTuples && !fullTuple) {\n const msg = `\"${keyword}\" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path \"${errSchemaPath}\"`;\n (0, util_1.checkStrictMode)(it, msg, opts.strictTuples);\n }\n }\n}\nexports.validateTuple = validateTuple;\nexports.default = def;\n//# sourceMappingURL=items.js.map",
|
|
49
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst items_1 = require(\"./items\");\nconst def = {\n keyword: \"prefixItems\",\n type: \"array\",\n schemaType: [\"array\"],\n before: \"uniqueItems\",\n code: (cxt) => (0, items_1.validateTuple)(cxt, \"items\"),\n};\nexports.default = def;\n//# sourceMappingURL=prefixItems.js.map",
|
|
50
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst code_1 = require(\"../code\");\nconst additionalItems_1 = require(\"./additionalItems\");\nconst error = {\n message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`,\n params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`,\n};\nconst def = {\n keyword: \"items\",\n type: \"array\",\n schemaType: [\"object\", \"boolean\"],\n before: \"uniqueItems\",\n error,\n code(cxt) {\n const { schema, parentSchema, it } = cxt;\n const { prefixItems } = parentSchema;\n it.items = true;\n if ((0, util_1.alwaysValidSchema)(it, schema))\n return;\n if (prefixItems)\n (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems);\n else\n cxt.ok((0, code_1.validateArray)(cxt));\n },\n};\nexports.default = def;\n//# sourceMappingURL=items2020.js.map",
|
|
51
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: ({ params: { min, max } }) => max === undefined\n ? (0, codegen_1.str) `must contain at least ${min} valid item(s)`\n : (0, codegen_1.str) `must contain at least ${min} and no more than ${max} valid item(s)`,\n params: ({ params: { min, max } }) => max === undefined ? (0, codegen_1._) `{minContains: ${min}}` : (0, codegen_1._) `{minContains: ${min}, maxContains: ${max}}`,\n};\nconst def = {\n keyword: \"contains\",\n type: \"array\",\n schemaType: [\"object\", \"boolean\"],\n before: \"uniqueItems\",\n trackErrors: true,\n error,\n code(cxt) {\n const { gen, schema, parentSchema, data, it } = cxt;\n let min;\n let max;\n const { minContains, maxContains } = parentSchema;\n if (it.opts.next) {\n min = minContains === undefined ? 1 : minContains;\n max = maxContains;\n }\n else {\n min = 1;\n }\n const len = gen.const(\"len\", (0, codegen_1._) `${data}.length`);\n cxt.setParams({ min, max });\n if (max === undefined && min === 0) {\n (0, util_1.checkStrictMode)(it, `\"minContains\" == 0 without \"maxContains\": \"contains\" keyword ignored`);\n return;\n }\n if (max !== undefined && min > max) {\n (0, util_1.checkStrictMode)(it, `\"minContains\" > \"maxContains\" is always invalid`);\n cxt.fail();\n return;\n }\n if ((0, util_1.alwaysValidSchema)(it, schema)) {\n let cond = (0, codegen_1._) `${len} >= ${min}`;\n if (max !== undefined)\n cond = (0, codegen_1._) `${cond} && ${len} <= ${max}`;\n cxt.pass(cond);\n return;\n }\n it.items = true;\n const valid = gen.name(\"valid\");\n if (max === undefined && min === 1) {\n validateItems(valid, () => gen.if(valid, () => gen.break()));\n }\n else if (min === 0) {\n gen.let(valid, true);\n if (max !== undefined)\n gen.if((0, codegen_1._) `${data}.length > 0`, validateItemsWithCount);\n }\n else {\n gen.let(valid, false);\n validateItemsWithCount();\n }\n cxt.result(valid, () => cxt.reset());\n function validateItemsWithCount() {\n const schValid = gen.name(\"_valid\");\n const count = gen.let(\"count\", 0);\n validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));\n }\n function validateItems(_valid, block) {\n gen.forRange(\"i\", 0, len, (i) => {\n cxt.subschema({\n keyword: \"contains\",\n dataProp: i,\n dataPropType: util_1.Type.Num,\n compositeRule: true,\n }, _valid);\n block();\n });\n }\n function checkLimits(count) {\n gen.code((0, codegen_1._) `${count}++`);\n if (max === undefined) {\n gen.if((0, codegen_1._) `${count} >= ${min}`, () => gen.assign(valid, true).break());\n }\n else {\n gen.if((0, codegen_1._) `${count} > ${max}`, () => gen.assign(valid, false).break());\n if (min === 1)\n gen.assign(valid, true);\n else\n gen.if((0, codegen_1._) `${count} >= ${min}`, () => gen.assign(valid, true));\n }\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=contains.js.map",
|
|
52
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0;\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst code_1 = require(\"../code\");\nexports.error = {\n message: ({ params: { property, depsCount, deps } }) => {\n const property_ies = depsCount === 1 ? \"property\" : \"properties\";\n return (0, codegen_1.str) `must have ${property_ies} ${deps} when property ${property} is present`;\n },\n params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._) `{property: ${property},\n missingProperty: ${missingProperty},\n depsCount: ${depsCount},\n deps: ${deps}}`, // TODO change to reference\n};\nconst def = {\n keyword: \"dependencies\",\n type: \"object\",\n schemaType: \"object\",\n error: exports.error,\n code(cxt) {\n const [propDeps, schDeps] = splitDependencies(cxt);\n validatePropertyDeps(cxt, propDeps);\n validateSchemaDeps(cxt, schDeps);\n },\n};\nfunction splitDependencies({ schema }) {\n const propertyDeps = {};\n const schemaDeps = {};\n for (const key in schema) {\n if (key === \"__proto__\")\n continue;\n const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps;\n deps[key] = schema[key];\n }\n return [propertyDeps, schemaDeps];\n}\nfunction validatePropertyDeps(cxt, propertyDeps = cxt.schema) {\n const { gen, data, it } = cxt;\n if (Object.keys(propertyDeps).length === 0)\n return;\n const missing = gen.let(\"missing\");\n for (const prop in propertyDeps) {\n const deps = propertyDeps[prop];\n if (deps.length === 0)\n continue;\n const hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties);\n cxt.setParams({\n property: prop,\n depsCount: deps.length,\n deps: deps.join(\", \"),\n });\n if (it.allErrors) {\n gen.if(hasProperty, () => {\n for (const depProp of deps) {\n (0, code_1.checkReportMissingProp)(cxt, depProp);\n }\n });\n }\n else {\n gen.if((0, codegen_1._) `${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`);\n (0, code_1.reportMissingProp)(cxt, missing);\n gen.else();\n }\n }\n}\nexports.validatePropertyDeps = validatePropertyDeps;\nfunction validateSchemaDeps(cxt, schemaDeps = cxt.schema) {\n const { gen, data, keyword, it } = cxt;\n const valid = gen.name(\"valid\");\n for (const prop in schemaDeps) {\n if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop]))\n continue;\n gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), () => {\n const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid);\n cxt.mergeValidEvaluated(schCxt, valid);\n }, () => gen.var(valid, true) // TODO var\n );\n cxt.ok(valid);\n }\n}\nexports.validateSchemaDeps = validateSchemaDeps;\nexports.default = def;\n//# sourceMappingURL=dependencies.js.map",
|
|
53
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: \"property name must be valid\",\n params: ({ params }) => (0, codegen_1._) `{propertyName: ${params.propertyName}}`,\n};\nconst def = {\n keyword: \"propertyNames\",\n type: \"object\",\n schemaType: [\"object\", \"boolean\"],\n error,\n code(cxt) {\n const { gen, schema, data, it } = cxt;\n if ((0, util_1.alwaysValidSchema)(it, schema))\n return;\n const valid = gen.name(\"valid\");\n gen.forIn(\"key\", data, (key) => {\n cxt.setParams({ propertyName: key });\n cxt.subschema({\n keyword: \"propertyNames\",\n data: key,\n dataTypes: [\"string\"],\n propertyName: key,\n compositeRule: true,\n }, valid);\n gen.if((0, codegen_1.not)(valid), () => {\n cxt.error(true);\n if (!it.allErrors)\n gen.break();\n });\n });\n cxt.ok(valid);\n },\n};\nexports.default = def;\n//# sourceMappingURL=propertyNames.js.map",
|
|
54
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code_1 = require(\"../code\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst names_1 = require(\"../../compile/names\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: \"must NOT have additional properties\",\n params: ({ params }) => (0, codegen_1._) `{additionalProperty: ${params.additionalProperty}}`,\n};\nconst def = {\n keyword: \"additionalProperties\",\n type: [\"object\"],\n schemaType: [\"boolean\", \"object\"],\n allowUndefined: true,\n trackErrors: true,\n error,\n code(cxt) {\n const { gen, schema, parentSchema, data, errsCount, it } = cxt;\n /* istanbul ignore if */\n if (!errsCount)\n throw new Error(\"ajv implementation error\");\n const { allErrors, opts } = it;\n it.props = true;\n if (opts.removeAdditional !== \"all\" && (0, util_1.alwaysValidSchema)(it, schema))\n return;\n const props = (0, code_1.allSchemaProperties)(parentSchema.properties);\n const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties);\n checkAdditionalProperties();\n cxt.ok((0, codegen_1._) `${errsCount} === ${names_1.default.errors}`);\n function checkAdditionalProperties() {\n gen.forIn(\"key\", data, (key) => {\n if (!props.length && !patProps.length)\n additionalPropertyCode(key);\n else\n gen.if(isAdditional(key), () => additionalPropertyCode(key));\n });\n }\n function isAdditional(key) {\n let definedProp;\n if (props.length > 8) {\n // TODO maybe an option instead of hard-coded 8?\n const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, \"properties\");\n definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key);\n }\n else if (props.length) {\n definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._) `${key} === ${p}`));\n }\n else {\n definedProp = codegen_1.nil;\n }\n if (patProps.length) {\n definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._) `${(0, code_1.usePattern)(cxt, p)}.test(${key})`));\n }\n return (0, codegen_1.not)(definedProp);\n }\n function deleteAdditional(key) {\n gen.code((0, codegen_1._) `delete ${data}[${key}]`);\n }\n function additionalPropertyCode(key) {\n if (opts.removeAdditional === \"all\" || (opts.removeAdditional && schema === false)) {\n deleteAdditional(key);\n return;\n }\n if (schema === false) {\n cxt.setParams({ additionalProperty: key });\n cxt.error();\n if (!allErrors)\n gen.break();\n return;\n }\n if (typeof schema == \"object\" && !(0, util_1.alwaysValidSchema)(it, schema)) {\n const valid = gen.name(\"valid\");\n if (opts.removeAdditional === \"failing\") {\n applyAdditionalSchema(key, valid, false);\n gen.if((0, codegen_1.not)(valid), () => {\n cxt.reset();\n deleteAdditional(key);\n });\n }\n else {\n applyAdditionalSchema(key, valid);\n if (!allErrors)\n gen.if((0, codegen_1.not)(valid), () => gen.break());\n }\n }\n }\n function applyAdditionalSchema(key, valid, errors) {\n const subschema = {\n keyword: \"additionalProperties\",\n dataProp: key,\n dataPropType: util_1.Type.Str,\n };\n if (errors === false) {\n Object.assign(subschema, {\n compositeRule: true,\n createErrors: false,\n allErrors: false,\n });\n }\n cxt.subschema(subschema, valid);\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=additionalProperties.js.map",
|
|
55
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst validate_1 = require(\"../../compile/validate\");\nconst code_1 = require(\"../code\");\nconst util_1 = require(\"../../compile/util\");\nconst additionalProperties_1 = require(\"./additionalProperties\");\nconst def = {\n keyword: \"properties\",\n type: \"object\",\n schemaType: \"object\",\n code(cxt) {\n const { gen, schema, parentSchema, data, it } = cxt;\n if (it.opts.removeAdditional === \"all\" && parentSchema.additionalProperties === undefined) {\n additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, \"additionalProperties\"));\n }\n const allProps = (0, code_1.allSchemaProperties)(schema);\n for (const prop of allProps) {\n it.definedProperties.add(prop);\n }\n if (it.opts.unevaluated && allProps.length && it.props !== true) {\n it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);\n }\n const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p]));\n if (properties.length === 0)\n return;\n const valid = gen.name(\"valid\");\n for (const prop of properties) {\n if (hasDefault(prop)) {\n applyPropertySchema(prop);\n }\n else {\n gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties));\n applyPropertySchema(prop);\n if (!it.allErrors)\n gen.else().var(valid, true);\n gen.endIf();\n }\n cxt.it.definedProperties.add(prop);\n cxt.ok(valid);\n }\n function hasDefault(prop) {\n return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined;\n }\n function applyPropertySchema(prop) {\n cxt.subschema({\n keyword: \"properties\",\n schemaProp: prop,\n dataProp: prop,\n }, valid);\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=properties.js.map",
|
|
56
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code_1 = require(\"../code\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst util_2 = require(\"../../compile/util\");\nconst def = {\n keyword: \"patternProperties\",\n type: \"object\",\n schemaType: \"object\",\n code(cxt) {\n const { gen, schema, data, parentSchema, it } = cxt;\n const { opts } = it;\n const patterns = (0, code_1.allSchemaProperties)(schema);\n const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema[p]));\n if (patterns.length === 0 ||\n (alwaysValidPatterns.length === patterns.length &&\n (!it.opts.unevaluated || it.props === true))) {\n return;\n }\n const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties;\n const valid = gen.name(\"valid\");\n if (it.props !== true && !(it.props instanceof codegen_1.Name)) {\n it.props = (0, util_2.evaluatedPropsToName)(gen, it.props);\n }\n const { props } = it;\n validatePatternProperties();\n function validatePatternProperties() {\n for (const pat of patterns) {\n if (checkProperties)\n checkMatchingProperties(pat);\n if (it.allErrors) {\n validateProperties(pat);\n }\n else {\n gen.var(valid, true); // TODO var\n validateProperties(pat);\n gen.if(valid);\n }\n }\n }\n function checkMatchingProperties(pat) {\n for (const prop in checkProperties) {\n if (new RegExp(pat).test(prop)) {\n (0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`);\n }\n }\n }\n function validateProperties(pat) {\n gen.forIn(\"key\", data, (key) => {\n gen.if((0, codegen_1._) `${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => {\n const alwaysValid = alwaysValidPatterns.includes(pat);\n if (!alwaysValid) {\n cxt.subschema({\n keyword: \"patternProperties\",\n schemaProp: pat,\n dataProp: key,\n dataPropType: util_2.Type.Str,\n }, valid);\n }\n if (it.opts.unevaluated && props !== true) {\n gen.assign((0, codegen_1._) `${props}[${key}]`, true);\n }\n else if (!alwaysValid && !it.allErrors) {\n // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false)\n // or if all properties were evaluated (props === true)\n gen.if((0, codegen_1.not)(valid), () => gen.break());\n }\n });\n });\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=patternProperties.js.map",
|
|
57
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst util_1 = require(\"../../compile/util\");\nconst def = {\n keyword: \"not\",\n schemaType: [\"object\", \"boolean\"],\n trackErrors: true,\n code(cxt) {\n const { gen, schema, it } = cxt;\n if ((0, util_1.alwaysValidSchema)(it, schema)) {\n cxt.fail();\n return;\n }\n const valid = gen.name(\"valid\");\n cxt.subschema({\n keyword: \"not\",\n compositeRule: true,\n createErrors: false,\n allErrors: false,\n }, valid);\n cxt.failResult(valid, () => cxt.reset(), () => cxt.error());\n },\n error: { message: \"must NOT be valid\" },\n};\nexports.default = def;\n//# sourceMappingURL=not.js.map",
|
|
58
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code_1 = require(\"../code\");\nconst def = {\n keyword: \"anyOf\",\n schemaType: \"array\",\n trackErrors: true,\n code: code_1.validateUnion,\n error: { message: \"must match a schema in anyOf\" },\n};\nexports.default = def;\n//# sourceMappingURL=anyOf.js.map",
|
|
59
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: \"must match exactly one schema in oneOf\",\n params: ({ params }) => (0, codegen_1._) `{passingSchemas: ${params.passing}}`,\n};\nconst def = {\n keyword: \"oneOf\",\n schemaType: \"array\",\n trackErrors: true,\n error,\n code(cxt) {\n const { gen, schema, parentSchema, it } = cxt;\n /* istanbul ignore if */\n if (!Array.isArray(schema))\n throw new Error(\"ajv implementation error\");\n if (it.opts.discriminator && parentSchema.discriminator)\n return;\n const schArr = schema;\n const valid = gen.let(\"valid\", false);\n const passing = gen.let(\"passing\", null);\n const schValid = gen.name(\"_valid\");\n cxt.setParams({ passing });\n // TODO possibly fail straight away (with warning or exception) if there are two empty always valid schemas\n gen.block(validateOneOf);\n cxt.result(valid, () => cxt.reset(), () => cxt.error(true));\n function validateOneOf() {\n schArr.forEach((sch, i) => {\n let schCxt;\n if ((0, util_1.alwaysValidSchema)(it, sch)) {\n gen.var(schValid, true);\n }\n else {\n schCxt = cxt.subschema({\n keyword: \"oneOf\",\n schemaProp: i,\n compositeRule: true,\n }, schValid);\n }\n if (i > 0) {\n gen\n .if((0, codegen_1._) `${schValid} && ${valid}`)\n .assign(valid, false)\n .assign(passing, (0, codegen_1._) `[${passing}, ${i}]`)\n .else();\n }\n gen.if(schValid, () => {\n gen.assign(valid, true);\n gen.assign(passing, i);\n if (schCxt)\n cxt.mergeEvaluated(schCxt, codegen_1.Name);\n });\n });\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=oneOf.js.map",
|
|
60
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst util_1 = require(\"../../compile/util\");\nconst def = {\n keyword: \"allOf\",\n schemaType: \"array\",\n code(cxt) {\n const { gen, schema, it } = cxt;\n /* istanbul ignore if */\n if (!Array.isArray(schema))\n throw new Error(\"ajv implementation error\");\n const valid = gen.name(\"valid\");\n schema.forEach((sch, i) => {\n if ((0, util_1.alwaysValidSchema)(it, sch))\n return;\n const schCxt = cxt.subschema({ keyword: \"allOf\", schemaProp: i }, valid);\n cxt.ok(valid);\n cxt.mergeEvaluated(schCxt);\n });\n },\n};\nexports.default = def;\n//# sourceMappingURL=allOf.js.map",
|
|
61
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: ({ params }) => (0, codegen_1.str) `must match \"${params.ifClause}\" schema`,\n params: ({ params }) => (0, codegen_1._) `{failingKeyword: ${params.ifClause}}`,\n};\nconst def = {\n keyword: \"if\",\n schemaType: [\"object\", \"boolean\"],\n trackErrors: true,\n error,\n code(cxt) {\n const { gen, parentSchema, it } = cxt;\n if (parentSchema.then === undefined && parentSchema.else === undefined) {\n (0, util_1.checkStrictMode)(it, '\"if\" without \"then\" and \"else\" is ignored');\n }\n const hasThen = hasSchema(it, \"then\");\n const hasElse = hasSchema(it, \"else\");\n if (!hasThen && !hasElse)\n return;\n const valid = gen.let(\"valid\", true);\n const schValid = gen.name(\"_valid\");\n validateIf();\n cxt.reset();\n if (hasThen && hasElse) {\n const ifClause = gen.let(\"ifClause\");\n cxt.setParams({ ifClause });\n gen.if(schValid, validateClause(\"then\", ifClause), validateClause(\"else\", ifClause));\n }\n else if (hasThen) {\n gen.if(schValid, validateClause(\"then\"));\n }\n else {\n gen.if((0, codegen_1.not)(schValid), validateClause(\"else\"));\n }\n cxt.pass(valid, () => cxt.error(true));\n function validateIf() {\n const schCxt = cxt.subschema({\n keyword: \"if\",\n compositeRule: true,\n createErrors: false,\n allErrors: false,\n }, schValid);\n cxt.mergeEvaluated(schCxt);\n }\n function validateClause(keyword, ifClause) {\n return () => {\n const schCxt = cxt.subschema({ keyword }, schValid);\n gen.assign(valid, schValid);\n cxt.mergeValidEvaluated(schCxt, valid);\n if (ifClause)\n gen.assign(ifClause, (0, codegen_1._) `${keyword}`);\n else\n cxt.setParams({ ifClause: keyword });\n };\n }\n },\n};\nfunction hasSchema(it, keyword) {\n const schema = it.schema[keyword];\n return schema !== undefined && !(0, util_1.alwaysValidSchema)(it, schema);\n}\nexports.default = def;\n//# sourceMappingURL=if.js.map",
|
|
62
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst util_1 = require(\"../../compile/util\");\nconst def = {\n keyword: [\"then\", \"else\"],\n schemaType: [\"object\", \"boolean\"],\n code({ keyword, parentSchema, it }) {\n if (parentSchema.if === undefined)\n (0, util_1.checkStrictMode)(it, `\"${keyword}\" without \"if\" is ignored`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=thenElse.js.map",
|
|
63
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst additionalItems_1 = require(\"./additionalItems\");\nconst prefixItems_1 = require(\"./prefixItems\");\nconst items_1 = require(\"./items\");\nconst items2020_1 = require(\"./items2020\");\nconst contains_1 = require(\"./contains\");\nconst dependencies_1 = require(\"./dependencies\");\nconst propertyNames_1 = require(\"./propertyNames\");\nconst additionalProperties_1 = require(\"./additionalProperties\");\nconst properties_1 = require(\"./properties\");\nconst patternProperties_1 = require(\"./patternProperties\");\nconst not_1 = require(\"./not\");\nconst anyOf_1 = require(\"./anyOf\");\nconst oneOf_1 = require(\"./oneOf\");\nconst allOf_1 = require(\"./allOf\");\nconst if_1 = require(\"./if\");\nconst thenElse_1 = require(\"./thenElse\");\nfunction getApplicator(draft2020 = false) {\n const applicator = [\n // any\n not_1.default,\n anyOf_1.default,\n oneOf_1.default,\n allOf_1.default,\n if_1.default,\n thenElse_1.default,\n // object\n propertyNames_1.default,\n additionalProperties_1.default,\n dependencies_1.default,\n properties_1.default,\n patternProperties_1.default,\n ];\n // array\n if (draft2020)\n applicator.push(prefixItems_1.default, items2020_1.default);\n else\n applicator.push(additionalItems_1.default, items_1.default);\n applicator.push(contains_1.default);\n return applicator;\n}\nexports.default = getApplicator;\n//# sourceMappingURL=index.js.map",
|
|
64
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.dynamicAnchor = void 0;\nconst codegen_1 = require(\"../../compile/codegen\");\nconst names_1 = require(\"../../compile/names\");\nconst compile_1 = require(\"../../compile\");\nconst ref_1 = require(\"../core/ref\");\nconst def = {\n keyword: \"$dynamicAnchor\",\n schemaType: \"string\",\n code: (cxt) => dynamicAnchor(cxt, cxt.schema),\n};\nfunction dynamicAnchor(cxt, anchor) {\n const { gen, it } = cxt;\n it.schemaEnv.root.dynamicAnchors[anchor] = true;\n const v = (0, codegen_1._) `${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`;\n const validate = it.errSchemaPath === \"#\" ? it.validateName : _getValidate(cxt);\n gen.if((0, codegen_1._) `!${v}`, () => gen.assign(v, validate));\n}\nexports.dynamicAnchor = dynamicAnchor;\nfunction _getValidate(cxt) {\n const { schemaEnv, schema, self } = cxt.it;\n const { root, baseId, localRefs, meta } = schemaEnv.root;\n const { schemaId } = self.opts;\n const sch = new compile_1.SchemaEnv({ schema, schemaId, root, baseId, localRefs, meta });\n compile_1.compileSchema.call(self, sch);\n return (0, ref_1.getValidate)(cxt, sch);\n}\nexports.default = def;\n//# sourceMappingURL=dynamicAnchor.js.map",
|
|
65
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.dynamicRef = void 0;\nconst codegen_1 = require(\"../../compile/codegen\");\nconst names_1 = require(\"../../compile/names\");\nconst ref_1 = require(\"../core/ref\");\nconst def = {\n keyword: \"$dynamicRef\",\n schemaType: \"string\",\n code: (cxt) => dynamicRef(cxt, cxt.schema),\n};\nfunction dynamicRef(cxt, ref) {\n const { gen, keyword, it } = cxt;\n if (ref[0] !== \"#\")\n throw new Error(`\"${keyword}\" only supports hash fragment reference`);\n const anchor = ref.slice(1);\n if (it.allErrors) {\n _dynamicRef();\n }\n else {\n const valid = gen.let(\"valid\", false);\n _dynamicRef(valid);\n cxt.ok(valid);\n }\n function _dynamicRef(valid) {\n // TODO the assumption here is that `recursiveRef: #` always points to the root\n // of the schema object, which is not correct, because there may be $id that\n // makes # point to it, and the target schema may not contain dynamic/recursiveAnchor.\n // Because of that 2 tests in recursiveRef.json fail.\n // This is a similar problem to #815 (`$id` doesn't alter resolution scope for `{ \"$ref\": \"#\" }`).\n // (This problem is not tested in JSON-Schema-Test-Suite)\n if (it.schemaEnv.root.dynamicAnchors[anchor]) {\n const v = gen.let(\"_v\", (0, codegen_1._) `${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`);\n gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid));\n }\n else {\n _callRef(it.validateName, valid)();\n }\n }\n function _callRef(validate, valid) {\n return valid\n ? () => gen.block(() => {\n (0, ref_1.callRef)(cxt, validate);\n gen.let(valid, true);\n })\n : () => (0, ref_1.callRef)(cxt, validate);\n }\n}\nexports.dynamicRef = dynamicRef;\nexports.default = def;\n//# sourceMappingURL=dynamicRef.js.map",
|
|
66
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst dynamicAnchor_1 = require(\"./dynamicAnchor\");\nconst util_1 = require(\"../../compile/util\");\nconst def = {\n keyword: \"$recursiveAnchor\",\n schemaType: \"boolean\",\n code(cxt) {\n if (cxt.schema)\n (0, dynamicAnchor_1.dynamicAnchor)(cxt, \"\");\n else\n (0, util_1.checkStrictMode)(cxt.it, \"$recursiveAnchor: false is ignored\");\n },\n};\nexports.default = def;\n//# sourceMappingURL=recursiveAnchor.js.map",
|
|
67
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst dynamicRef_1 = require(\"./dynamicRef\");\nconst def = {\n keyword: \"$recursiveRef\",\n schemaType: \"string\",\n code: (cxt) => (0, dynamicRef_1.dynamicRef)(cxt, cxt.schema),\n};\nexports.default = def;\n//# sourceMappingURL=recursiveRef.js.map",
|
|
68
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst dynamicAnchor_1 = require(\"./dynamicAnchor\");\nconst dynamicRef_1 = require(\"./dynamicRef\");\nconst recursiveAnchor_1 = require(\"./recursiveAnchor\");\nconst recursiveRef_1 = require(\"./recursiveRef\");\nconst dynamic = [dynamicAnchor_1.default, dynamicRef_1.default, recursiveAnchor_1.default, recursiveRef_1.default];\nexports.default = dynamic;\n//# sourceMappingURL=index.js.map",
|
|
69
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst dependencies_1 = require(\"../applicator/dependencies\");\nconst def = {\n keyword: \"dependentRequired\",\n type: \"object\",\n schemaType: \"object\",\n error: dependencies_1.error,\n code: (cxt) => (0, dependencies_1.validatePropertyDeps)(cxt),\n};\nexports.default = def;\n//# sourceMappingURL=dependentRequired.js.map",
|
|
70
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst dependencies_1 = require(\"./dependencies\");\nconst def = {\n keyword: \"dependentSchemas\",\n type: \"object\",\n schemaType: \"object\",\n code: (cxt) => (0, dependencies_1.validateSchemaDeps)(cxt),\n};\nexports.default = def;\n//# sourceMappingURL=dependentSchemas.js.map",
|
|
71
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst util_1 = require(\"../../compile/util\");\nconst def = {\n keyword: [\"maxContains\", \"minContains\"],\n type: \"array\",\n schemaType: \"number\",\n code({ keyword, parentSchema, it }) {\n if (parentSchema.contains === undefined) {\n (0, util_1.checkStrictMode)(it, `\"${keyword}\" without \"contains\" is ignored`);\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=limitContains.js.map",
|
|
72
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst dependentRequired_1 = require(\"./validation/dependentRequired\");\nconst dependentSchemas_1 = require(\"./applicator/dependentSchemas\");\nconst limitContains_1 = require(\"./validation/limitContains\");\nconst next = [dependentRequired_1.default, dependentSchemas_1.default, limitContains_1.default];\nexports.default = next;\n//# sourceMappingURL=next.js.map",
|
|
73
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst names_1 = require(\"../../compile/names\");\nconst error = {\n message: \"must NOT have unevaluated properties\",\n params: ({ params }) => (0, codegen_1._) `{unevaluatedProperty: ${params.unevaluatedProperty}}`,\n};\nconst def = {\n keyword: \"unevaluatedProperties\",\n type: \"object\",\n schemaType: [\"boolean\", \"object\"],\n trackErrors: true,\n error,\n code(cxt) {\n const { gen, schema, data, errsCount, it } = cxt;\n /* istanbul ignore if */\n if (!errsCount)\n throw new Error(\"ajv implementation error\");\n const { allErrors, props } = it;\n if (props instanceof codegen_1.Name) {\n gen.if((0, codegen_1._) `${props} !== true`, () => gen.forIn(\"key\", data, (key) => gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key))));\n }\n else if (props !== true) {\n gen.forIn(\"key\", data, (key) => props === undefined\n ? unevaluatedPropCode(key)\n : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key)));\n }\n it.props = true;\n cxt.ok((0, codegen_1._) `${errsCount} === ${names_1.default.errors}`);\n function unevaluatedPropCode(key) {\n if (schema === false) {\n cxt.setParams({ unevaluatedProperty: key });\n cxt.error();\n if (!allErrors)\n gen.break();\n return;\n }\n if (!(0, util_1.alwaysValidSchema)(it, schema)) {\n const valid = gen.name(\"valid\");\n cxt.subschema({\n keyword: \"unevaluatedProperties\",\n dataProp: key,\n dataPropType: util_1.Type.Str,\n }, valid);\n if (!allErrors)\n gen.if((0, codegen_1.not)(valid), () => gen.break());\n }\n }\n function unevaluatedDynamic(evaluatedProps, key) {\n return (0, codegen_1._) `!${evaluatedProps} || !${evaluatedProps}[${key}]`;\n }\n function unevaluatedStatic(evaluatedProps, key) {\n const ps = [];\n for (const p in evaluatedProps) {\n if (evaluatedProps[p] === true)\n ps.push((0, codegen_1._) `${key} !== ${p}`);\n }\n return (0, codegen_1.and)(...ps);\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=unevaluatedProperties.js.map",
|
|
74
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`,\n params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`,\n};\nconst def = {\n keyword: \"unevaluatedItems\",\n type: \"array\",\n schemaType: [\"boolean\", \"object\"],\n error,\n code(cxt) {\n const { gen, schema, data, it } = cxt;\n const items = it.items || 0;\n if (items === true)\n return;\n const len = gen.const(\"len\", (0, codegen_1._) `${data}.length`);\n if (schema === false) {\n cxt.setParams({ len: items });\n cxt.fail((0, codegen_1._) `${len} > ${items}`);\n }\n else if (typeof schema == \"object\" && !(0, util_1.alwaysValidSchema)(it, schema)) {\n const valid = gen.var(\"valid\", (0, codegen_1._) `${len} <= ${items}`);\n gen.if((0, codegen_1.not)(valid), () => validateItems(valid, items));\n cxt.ok(valid);\n }\n it.items = true;\n function validateItems(valid, from) {\n gen.forRange(\"i\", from, len, (i) => {\n cxt.subschema({ keyword: \"unevaluatedItems\", dataProp: i, dataPropType: util_1.Type.Num }, valid);\n if (!it.allErrors)\n gen.if((0, codegen_1.not)(valid), () => gen.break());\n });\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=unevaluatedItems.js.map",
|
|
75
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst unevaluatedProperties_1 = require(\"./unevaluatedProperties\");\nconst unevaluatedItems_1 = require(\"./unevaluatedItems\");\nconst unevaluated = [unevaluatedProperties_1.default, unevaluatedItems_1.default];\nexports.default = unevaluated;\n//# sourceMappingURL=index.js.map",
|
|
76
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst error = {\n message: ({ schemaCode }) => (0, codegen_1.str) `must match format \"${schemaCode}\"`,\n params: ({ schemaCode }) => (0, codegen_1._) `{format: ${schemaCode}}`,\n};\nconst def = {\n keyword: \"format\",\n type: [\"number\", \"string\"],\n schemaType: \"string\",\n $data: true,\n error,\n code(cxt, ruleType) {\n const { gen, data, $data, schema, schemaCode, it } = cxt;\n const { opts, errSchemaPath, schemaEnv, self } = it;\n if (!opts.validateFormats)\n return;\n if ($data)\n validate$DataFormat();\n else\n validateFormat();\n function validate$DataFormat() {\n const fmts = gen.scopeValue(\"formats\", {\n ref: self.formats,\n code: opts.code.formats,\n });\n const fDef = gen.const(\"fDef\", (0, codegen_1._) `${fmts}[${schemaCode}]`);\n const fType = gen.let(\"fType\");\n const format = gen.let(\"format\");\n // TODO simplify\n gen.if((0, codegen_1._) `typeof ${fDef} == \"object\" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._) `${fDef}.type || \"string\"`).assign(format, (0, codegen_1._) `${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._) `\"string\"`).assign(format, fDef));\n cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt()));\n function unknownFmt() {\n if (opts.strictSchema === false)\n return codegen_1.nil;\n return (0, codegen_1._) `${schemaCode} && !${format}`;\n }\n function invalidFmt() {\n const callFormat = schemaEnv.$async\n ? (0, codegen_1._) `(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))`\n : (0, codegen_1._) `${format}(${data})`;\n const validData = (0, codegen_1._) `(typeof ${format} == \"function\" ? ${callFormat} : ${format}.test(${data}))`;\n return (0, codegen_1._) `${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;\n }\n }\n function validateFormat() {\n const formatDef = self.formats[schema];\n if (!formatDef) {\n unknownFormat();\n return;\n }\n if (formatDef === true)\n return;\n const [fmtType, format, fmtRef] = getFormat(formatDef);\n if (fmtType === ruleType)\n cxt.pass(validCondition());\n function unknownFormat() {\n if (opts.strictSchema === false) {\n self.logger.warn(unknownMsg());\n return;\n }\n throw new Error(unknownMsg());\n function unknownMsg() {\n return `unknown format \"${schema}\" ignored in schema at path \"${errSchemaPath}\"`;\n }\n }\n function getFormat(fmtDef) {\n const code = fmtDef instanceof RegExp\n ? (0, codegen_1.regexpCode)(fmtDef)\n : opts.code.formats\n ? (0, codegen_1._) `${opts.code.formats}${(0, codegen_1.getProperty)(schema)}`\n : undefined;\n const fmt = gen.scopeValue(\"formats\", { key: schema, ref: fmtDef, code });\n if (typeof fmtDef == \"object\" && !(fmtDef instanceof RegExp)) {\n return [fmtDef.type || \"string\", fmtDef.validate, (0, codegen_1._) `${fmt}.validate`];\n }\n return [\"string\", fmtDef, fmt];\n }\n function validCondition() {\n if (typeof formatDef == \"object\" && !(formatDef instanceof RegExp) && formatDef.async) {\n if (!schemaEnv.$async)\n throw new Error(\"async format in sync schema\");\n return (0, codegen_1._) `await ${fmtRef}(${data})`;\n }\n return typeof format == \"function\" ? (0, codegen_1._) `${fmtRef}(${data})` : (0, codegen_1._) `${fmtRef}.test(${data})`;\n }\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=format.js.map",
|
|
77
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst format_1 = require(\"./format\");\nconst format = [format_1.default];\nexports.default = format;\n//# sourceMappingURL=index.js.map",
|
|
78
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.contentVocabulary = exports.metadataVocabulary = void 0;\nexports.metadataVocabulary = [\n \"title\",\n \"description\",\n \"default\",\n \"deprecated\",\n \"readOnly\",\n \"writeOnly\",\n \"examples\",\n];\nexports.contentVocabulary = [\n \"contentMediaType\",\n \"contentEncoding\",\n \"contentSchema\",\n];\n//# sourceMappingURL=metadata.js.map",
|
|
79
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst core_1 = require(\"./core\");\nconst validation_1 = require(\"./validation\");\nconst applicator_1 = require(\"./applicator\");\nconst dynamic_1 = require(\"./dynamic\");\nconst next_1 = require(\"./next\");\nconst unevaluated_1 = require(\"./unevaluated\");\nconst format_1 = require(\"./format\");\nconst metadata_1 = require(\"./metadata\");\nconst draft2020Vocabularies = [\n dynamic_1.default,\n core_1.default,\n validation_1.default,\n (0, applicator_1.default)(true),\n format_1.default,\n metadata_1.metadataVocabulary,\n metadata_1.contentVocabulary,\n next_1.default,\n unevaluated_1.default,\n];\nexports.default = draft2020Vocabularies;\n//# sourceMappingURL=draft2020.js.map",
|
|
80
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiscrError = void 0;\nvar DiscrError;\n(function (DiscrError) {\n DiscrError[\"Tag\"] = \"tag\";\n DiscrError[\"Mapping\"] = \"mapping\";\n})(DiscrError || (exports.DiscrError = DiscrError = {}));\n//# sourceMappingURL=types.js.map",
|
|
81
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst types_1 = require(\"../discriminator/types\");\nconst compile_1 = require(\"../../compile\");\nconst ref_error_1 = require(\"../../compile/ref_error\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag\n ? `tag \"${tagName}\" must be string`\n : `value of tag \"${tagName}\" must be in oneOf`,\n params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._) `{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`,\n};\nconst def = {\n keyword: \"discriminator\",\n type: \"object\",\n schemaType: \"object\",\n error,\n code(cxt) {\n const { gen, data, schema, parentSchema, it } = cxt;\n const { oneOf } = parentSchema;\n if (!it.opts.discriminator) {\n throw new Error(\"discriminator: requires discriminator option\");\n }\n const tagName = schema.propertyName;\n if (typeof tagName != \"string\")\n throw new Error(\"discriminator: requires propertyName\");\n if (schema.mapping)\n throw new Error(\"discriminator: mapping is not supported\");\n if (!oneOf)\n throw new Error(\"discriminator: requires oneOf keyword\");\n const valid = gen.let(\"valid\", false);\n const tag = gen.const(\"tag\", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(tagName)}`);\n gen.if((0, codegen_1._) `typeof ${tag} == \"string\"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName }));\n cxt.ok(valid);\n function validateMapping() {\n const mapping = getMapping();\n gen.if(false);\n for (const tagValue in mapping) {\n gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`);\n gen.assign(valid, applyTagSchema(mapping[tagValue]));\n }\n gen.else();\n cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName });\n gen.endIf();\n }\n function applyTagSchema(schemaProp) {\n const _valid = gen.name(\"valid\");\n const schCxt = cxt.subschema({ keyword: \"oneOf\", schemaProp }, _valid);\n cxt.mergeEvaluated(schCxt, codegen_1.Name);\n return _valid;\n }\n function getMapping() {\n var _a;\n const oneOfMapping = {};\n const topRequired = hasRequired(parentSchema);\n let tagRequired = true;\n for (let i = 0; i < oneOf.length; i++) {\n let sch = oneOf[i];\n if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {\n const ref = sch.$ref;\n sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref);\n if (sch instanceof compile_1.SchemaEnv)\n sch = sch.schema;\n if (sch === undefined)\n throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);\n }\n const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];\n if (typeof propSch != \"object\") {\n throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have \"properties/${tagName}\"`);\n }\n tagRequired = tagRequired && (topRequired || hasRequired(sch));\n addMappings(propSch, i);\n }\n if (!tagRequired)\n throw new Error(`discriminator: \"${tagName}\" must be required`);\n return oneOfMapping;\n function hasRequired({ required }) {\n return Array.isArray(required) && required.includes(tagName);\n }\n function addMappings(sch, i) {\n if (sch.const) {\n addMapping(sch.const, i);\n }\n else if (sch.enum) {\n for (const tagValue of sch.enum) {\n addMapping(tagValue, i);\n }\n }\n else {\n throw new Error(`discriminator: \"properties/${tagName}\" must have \"const\" or \"enum\"`);\n }\n }\n function addMapping(tagValue, i) {\n if (typeof tagValue != \"string\" || tagValue in oneOfMapping) {\n throw new Error(`discriminator: \"${tagName}\" values must be unique strings`);\n }\n oneOfMapping[tagValue] = i;\n }\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=index.js.map",
|
|
82
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst metaSchema = require(\"./schema.json\");\nconst applicator = require(\"./meta/applicator.json\");\nconst unevaluated = require(\"./meta/unevaluated.json\");\nconst content = require(\"./meta/content.json\");\nconst core = require(\"./meta/core.json\");\nconst format = require(\"./meta/format-annotation.json\");\nconst metadata = require(\"./meta/meta-data.json\");\nconst validation = require(\"./meta/validation.json\");\nconst META_SUPPORT_DATA = [\"/properties\"];\nfunction addMetaSchema2020($data) {\n ;\n [\n metaSchema,\n applicator,\n unevaluated,\n content,\n core,\n with$data(this, format),\n metadata,\n with$data(this, validation),\n ].forEach((sch) => this.addMetaSchema(sch, undefined, false));\n return this;\n function with$data(ajv, sch) {\n return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch;\n }\n}\nexports.default = addMetaSchema2020;\n//# sourceMappingURL=index.js.map",
|
|
83
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv2020 = void 0;\nconst core_1 = require(\"./core\");\nconst draft2020_1 = require(\"./vocabularies/draft2020\");\nconst discriminator_1 = require(\"./vocabularies/discriminator\");\nconst json_schema_2020_12_1 = require(\"./refs/json-schema-2020-12\");\nconst META_SCHEMA_ID = \"https://json-schema.org/draft/2020-12/schema\";\nclass Ajv2020 extends core_1.default {\n constructor(opts = {}) {\n super({\n ...opts,\n dynamicRef: true,\n next: true,\n unevaluated: true,\n });\n }\n _addVocabularies() {\n super._addVocabularies();\n draft2020_1.default.forEach((v) => this.addVocabulary(v));\n if (this.opts.discriminator)\n this.addKeyword(discriminator_1.default);\n }\n _addDefaultMetaSchema() {\n super._addDefaultMetaSchema();\n const { $data, meta } = this.opts;\n if (!meta)\n return;\n json_schema_2020_12_1.default.call(this, $data);\n this.refs[\"http://json-schema.org/schema\"] = META_SCHEMA_ID;\n }\n defaultMeta() {\n return (this.opts.defaultMeta =\n super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined));\n }\n}\nexports.Ajv2020 = Ajv2020;\nmodule.exports = exports = Ajv2020;\nmodule.exports.Ajv2020 = Ajv2020;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = Ajv2020;\nvar validate_1 = require(\"./compile/validate\");\nObject.defineProperty(exports, \"KeywordCxt\", { enumerable: true, get: function () { return validate_1.KeywordCxt; } });\nvar codegen_1 = require(\"./compile/codegen\");\nObject.defineProperty(exports, \"_\", { enumerable: true, get: function () { return codegen_1._; } });\nObject.defineProperty(exports, \"str\", { enumerable: true, get: function () { return codegen_1.str; } });\nObject.defineProperty(exports, \"stringify\", { enumerable: true, get: function () { return codegen_1.stringify; } });\nObject.defineProperty(exports, \"nil\", { enumerable: true, get: function () { return codegen_1.nil; } });\nObject.defineProperty(exports, \"Name\", { enumerable: true, get: function () { return codegen_1.Name; } });\nObject.defineProperty(exports, \"CodeGen\", { enumerable: true, get: function () { return codegen_1.CodeGen; } });\nvar validation_error_1 = require(\"./runtime/validation_error\");\nObject.defineProperty(exports, \"ValidationError\", { enumerable: true, get: function () { return validation_error_1.default; } });\nvar ref_error_1 = require(\"./compile/ref_error\");\nObject.defineProperty(exports, \"MissingRefError\", { enumerable: true, get: function () { return ref_error_1.default; } });\n//# sourceMappingURL=2020.js.map",
|
|
84
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._globalThis = void 0;\n/** only globals that common to node and browsers are allowed */\n// eslint-disable-next-line node/no-unsupported-features/es-builtins\nexports._globalThis = typeof globalThis === 'object' ? globalThis : global;\n//# sourceMappingURL=globalThis.js.map",
|
|
85
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./globalThis\"), exports);\n//# sourceMappingURL=index.js.map",
|
|
86
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./node\"), exports);\n//# sourceMappingURL=index.js.map",
|
|
87
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VERSION = void 0;\n// this is autogenerated file, see scripts/version-update.js\nexports.VERSION = '1.9.0';\n//# sourceMappingURL=version.js.map",
|
|
88
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isCompatible = exports._makeCompatibilityCheck = void 0;\nconst version_1 = require(\"../version\");\nconst re = /^(\\d+)\\.(\\d+)\\.(\\d+)(-(.+))?$/;\n/**\n * Create a function to test an API version to see if it is compatible with the provided ownVersion.\n *\n * The returned function has the following semantics:\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param ownVersion version which should be checked against\n */\nfunction _makeCompatibilityCheck(ownVersion) {\n const acceptedVersions = new Set([ownVersion]);\n const rejectedVersions = new Set();\n const myVersionMatch = ownVersion.match(re);\n if (!myVersionMatch) {\n // we cannot guarantee compatibility so we always return noop\n return () => false;\n }\n const ownVersionParsed = {\n major: +myVersionMatch[1],\n minor: +myVersionMatch[2],\n patch: +myVersionMatch[3],\n prerelease: myVersionMatch[4],\n };\n // if ownVersion has a prerelease tag, versions must match exactly\n if (ownVersionParsed.prerelease != null) {\n return function isExactmatch(globalVersion) {\n return globalVersion === ownVersion;\n };\n }\n function _reject(v) {\n rejectedVersions.add(v);\n return false;\n }\n function _accept(v) {\n acceptedVersions.add(v);\n return true;\n }\n return function isCompatible(globalVersion) {\n if (acceptedVersions.has(globalVersion)) {\n return true;\n }\n if (rejectedVersions.has(globalVersion)) {\n return false;\n }\n const globalVersionMatch = globalVersion.match(re);\n if (!globalVersionMatch) {\n // cannot parse other version\n // we cannot guarantee compatibility so we always noop\n return _reject(globalVersion);\n }\n const globalVersionParsed = {\n major: +globalVersionMatch[1],\n minor: +globalVersionMatch[2],\n patch: +globalVersionMatch[3],\n prerelease: globalVersionMatch[4],\n };\n // if globalVersion has a prerelease tag, versions must match exactly\n if (globalVersionParsed.prerelease != null) {\n return _reject(globalVersion);\n }\n // major versions must match\n if (ownVersionParsed.major !== globalVersionParsed.major) {\n return _reject(globalVersion);\n }\n if (ownVersionParsed.major === 0) {\n if (ownVersionParsed.minor === globalVersionParsed.minor &&\n ownVersionParsed.patch <= globalVersionParsed.patch) {\n return _accept(globalVersion);\n }\n return _reject(globalVersion);\n }\n if (ownVersionParsed.minor <= globalVersionParsed.minor) {\n return _accept(globalVersion);\n }\n return _reject(globalVersion);\n };\n}\nexports._makeCompatibilityCheck = _makeCompatibilityCheck;\n/**\n * Test an API version to see if it is compatible with this API.\n *\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param version version of the API requesting an instance of the global API\n */\nexports.isCompatible = _makeCompatibilityCheck(version_1.VERSION);\n//# sourceMappingURL=semver.js.map",
|
|
89
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unregisterGlobal = exports.getGlobal = exports.registerGlobal = void 0;\nconst platform_1 = require(\"../platform\");\nconst version_1 = require(\"../version\");\nconst semver_1 = require(\"./semver\");\nconst major = version_1.VERSION.split('.')[0];\nconst GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(`opentelemetry.js.api.${major}`);\nconst _global = platform_1._globalThis;\nfunction registerGlobal(type, instance, diag, allowOverride = false) {\n var _a;\n const api = (_global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {\n version: version_1.VERSION,\n });\n if (!allowOverride && api[type]) {\n // already registered an API of this type\n const err = new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${type}`);\n diag.error(err.stack || err.message);\n return false;\n }\n if (api.version !== version_1.VERSION) {\n // All registered APIs must be of the same version exactly\n const err = new Error(`@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${version_1.VERSION}`);\n diag.error(err.stack || err.message);\n return false;\n }\n api[type] = instance;\n diag.debug(`@opentelemetry/api: Registered a global for ${type} v${version_1.VERSION}.`);\n return true;\n}\nexports.registerGlobal = registerGlobal;\nfunction getGlobal(type) {\n var _a, _b;\n const globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version;\n if (!globalVersion || !(0, semver_1.isCompatible)(globalVersion)) {\n return;\n }\n return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type];\n}\nexports.getGlobal = getGlobal;\nfunction unregisterGlobal(type, diag) {\n diag.debug(`@opentelemetry/api: Unregistering a global for ${type} v${version_1.VERSION}.`);\n const api = _global[GLOBAL_OPENTELEMETRY_API_KEY];\n if (api) {\n delete api[type];\n }\n}\nexports.unregisterGlobal = unregisterGlobal;\n//# sourceMappingURL=global-utils.js.map",
|
|
90
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiagComponentLogger = void 0;\nconst global_utils_1 = require(\"../internal/global-utils\");\n/**\n * Component Logger which is meant to be used as part of any component which\n * will add automatically additional namespace in front of the log message.\n * It will then forward all message to global diag logger\n * @example\n * const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' });\n * cLogger.debug('test');\n * // @opentelemetry/instrumentation-http test\n */\nclass DiagComponentLogger {\n constructor(props) {\n this._namespace = props.namespace || 'DiagComponentLogger';\n }\n debug(...args) {\n return logProxy('debug', this._namespace, args);\n }\n error(...args) {\n return logProxy('error', this._namespace, args);\n }\n info(...args) {\n return logProxy('info', this._namespace, args);\n }\n warn(...args) {\n return logProxy('warn', this._namespace, args);\n }\n verbose(...args) {\n return logProxy('verbose', this._namespace, args);\n }\n}\nexports.DiagComponentLogger = DiagComponentLogger;\nfunction logProxy(funcName, namespace, args) {\n const logger = (0, global_utils_1.getGlobal)('diag');\n // shortcut if logger not set\n if (!logger) {\n return;\n }\n args.unshift(namespace);\n return logger[funcName](...args);\n}\n//# sourceMappingURL=ComponentLogger.js.map",
|
|
91
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiagLogLevel = void 0;\n/**\n * Defines the available internal logging levels for the diagnostic logger, the numeric values\n * of the levels are defined to match the original values from the initial LogLevel to avoid\n * compatibility/migration issues for any implementation that assume the numeric ordering.\n */\nvar DiagLogLevel;\n(function (DiagLogLevel) {\n /** Diagnostic Logging level setting to disable all logging (except and forced logs) */\n DiagLogLevel[DiagLogLevel[\"NONE\"] = 0] = \"NONE\";\n /** Identifies an error scenario */\n DiagLogLevel[DiagLogLevel[\"ERROR\"] = 30] = \"ERROR\";\n /** Identifies a warning scenario */\n DiagLogLevel[DiagLogLevel[\"WARN\"] = 50] = \"WARN\";\n /** General informational log message */\n DiagLogLevel[DiagLogLevel[\"INFO\"] = 60] = \"INFO\";\n /** General debug log message */\n DiagLogLevel[DiagLogLevel[\"DEBUG\"] = 70] = \"DEBUG\";\n /**\n * Detailed trace level logging should only be used for development, should only be set\n * in a development environment.\n */\n DiagLogLevel[DiagLogLevel[\"VERBOSE\"] = 80] = \"VERBOSE\";\n /** Used to set the logging level to include all logging */\n DiagLogLevel[DiagLogLevel[\"ALL\"] = 9999] = \"ALL\";\n})(DiagLogLevel = exports.DiagLogLevel || (exports.DiagLogLevel = {}));\n//# sourceMappingURL=types.js.map",
|
|
92
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createLogLevelDiagLogger = void 0;\nconst types_1 = require(\"../types\");\nfunction createLogLevelDiagLogger(maxLevel, logger) {\n if (maxLevel < types_1.DiagLogLevel.NONE) {\n maxLevel = types_1.DiagLogLevel.NONE;\n }\n else if (maxLevel > types_1.DiagLogLevel.ALL) {\n maxLevel = types_1.DiagLogLevel.ALL;\n }\n // In case the logger is null or undefined\n logger = logger || {};\n function _filterFunc(funcName, theLevel) {\n const theFunc = logger[funcName];\n if (typeof theFunc === 'function' && maxLevel >= theLevel) {\n return theFunc.bind(logger);\n }\n return function () { };\n }\n return {\n error: _filterFunc('error', types_1.DiagLogLevel.ERROR),\n warn: _filterFunc('warn', types_1.DiagLogLevel.WARN),\n info: _filterFunc('info', types_1.DiagLogLevel.INFO),\n debug: _filterFunc('debug', types_1.DiagLogLevel.DEBUG),\n verbose: _filterFunc('verbose', types_1.DiagLogLevel.VERBOSE),\n };\n}\nexports.createLogLevelDiagLogger = createLogLevelDiagLogger;\n//# sourceMappingURL=logLevelLogger.js.map",
|
|
93
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiagAPI = void 0;\nconst ComponentLogger_1 = require(\"../diag/ComponentLogger\");\nconst logLevelLogger_1 = require(\"../diag/internal/logLevelLogger\");\nconst types_1 = require(\"../diag/types\");\nconst global_utils_1 = require(\"../internal/global-utils\");\nconst API_NAME = 'diag';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry internal\n * diagnostic API\n */\nclass DiagAPI {\n /**\n * Private internal constructor\n * @private\n */\n constructor() {\n function _logProxy(funcName) {\n return function (...args) {\n const logger = (0, global_utils_1.getGlobal)('diag');\n // shortcut if logger not set\n if (!logger)\n return;\n return logger[funcName](...args);\n };\n }\n // Using self local variable for minification purposes as 'this' cannot be minified\n const self = this;\n // DiagAPI specific functions\n const setLogger = (logger, optionsOrLogLevel = { logLevel: types_1.DiagLogLevel.INFO }) => {\n var _a, _b, _c;\n if (logger === self) {\n // There isn't much we can do here.\n // Logging to the console might break the user application.\n // Try to log to self. If a logger was previously registered it will receive the log.\n const err = new Error('Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation');\n self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);\n return false;\n }\n if (typeof optionsOrLogLevel === 'number') {\n optionsOrLogLevel = {\n logLevel: optionsOrLogLevel,\n };\n }\n const oldLogger = (0, global_utils_1.getGlobal)('diag');\n const newLogger = (0, logLevelLogger_1.createLogLevelDiagLogger)((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : types_1.DiagLogLevel.INFO, logger);\n // There already is an logger registered. We'll let it know before overwriting it.\n if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {\n const stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : '<failed to generate stacktrace>';\n oldLogger.warn(`Current logger will be overwritten from ${stack}`);\n newLogger.warn(`Current logger will overwrite one already registered from ${stack}`);\n }\n return (0, global_utils_1.registerGlobal)('diag', newLogger, self, true);\n };\n self.setLogger = setLogger;\n self.disable = () => {\n (0, global_utils_1.unregisterGlobal)(API_NAME, self);\n };\n self.createComponentLogger = (options) => {\n return new ComponentLogger_1.DiagComponentLogger(options);\n };\n self.verbose = _logProxy('verbose');\n self.debug = _logProxy('debug');\n self.info = _logProxy('info');\n self.warn = _logProxy('warn');\n self.error = _logProxy('error');\n }\n /** Get the singleton instance of the DiagAPI API */\n static instance() {\n if (!this._instance) {\n this._instance = new DiagAPI();\n }\n return this._instance;\n }\n}\nexports.DiagAPI = DiagAPI;\n//# sourceMappingURL=diag.js.map",
|
|
94
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BaggageImpl = void 0;\nclass BaggageImpl {\n constructor(entries) {\n this._entries = entries ? new Map(entries) : new Map();\n }\n getEntry(key) {\n const entry = this._entries.get(key);\n if (!entry) {\n return undefined;\n }\n return Object.assign({}, entry);\n }\n getAllEntries() {\n return Array.from(this._entries.entries()).map(([k, v]) => [k, v]);\n }\n setEntry(key, entry) {\n const newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.set(key, entry);\n return newBaggage;\n }\n removeEntry(key) {\n const newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.delete(key);\n return newBaggage;\n }\n removeEntries(...keys) {\n const newBaggage = new BaggageImpl(this._entries);\n for (const key of keys) {\n newBaggage._entries.delete(key);\n }\n return newBaggage;\n }\n clear() {\n return new BaggageImpl();\n }\n}\nexports.BaggageImpl = BaggageImpl;\n//# sourceMappingURL=baggage-impl.js.map",
|
|
95
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.baggageEntryMetadataSymbol = void 0;\n/**\n * Symbol used to make BaggageEntryMetadata an opaque type\n */\nexports.baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata');\n//# sourceMappingURL=symbol.js.map",
|
|
96
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.baggageEntryMetadataFromString = exports.createBaggage = void 0;\nconst diag_1 = require(\"../api/diag\");\nconst baggage_impl_1 = require(\"./internal/baggage-impl\");\nconst symbol_1 = require(\"./internal/symbol\");\nconst diag = diag_1.DiagAPI.instance();\n/**\n * Create a new Baggage with optional entries\n *\n * @param entries An array of baggage entries the new baggage should contain\n */\nfunction createBaggage(entries = {}) {\n return new baggage_impl_1.BaggageImpl(new Map(Object.entries(entries)));\n}\nexports.createBaggage = createBaggage;\n/**\n * Create a serializable BaggageEntryMetadata object from a string.\n *\n * @param str string metadata. Format is currently not defined by the spec and has no special meaning.\n *\n */\nfunction baggageEntryMetadataFromString(str) {\n if (typeof str !== 'string') {\n diag.error(`Cannot create baggage metadata from unknown type: ${typeof str}`);\n str = '';\n }\n return {\n __TYPE__: symbol_1.baggageEntryMetadataSymbol,\n toString() {\n return str;\n },\n };\n}\nexports.baggageEntryMetadataFromString = baggageEntryMetadataFromString;\n//# sourceMappingURL=utils.js.map",
|
|
97
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ROOT_CONTEXT = exports.createContextKey = void 0;\n/** Get a key to uniquely identify a context value */\nfunction createContextKey(description) {\n // The specification states that for the same input, multiple calls should\n // return different keys. Due to the nature of the JS dependency management\n // system, this creates problems where multiple versions of some package\n // could hold different keys for the same property.\n //\n // Therefore, we use Symbol.for which returns the same key for the same input.\n return Symbol.for(description);\n}\nexports.createContextKey = createContextKey;\nclass BaseContext {\n /**\n * Construct a new context which inherits values from an optional parent context.\n *\n * @param parentContext a context from which to inherit values\n */\n constructor(parentContext) {\n // for minification\n const self = this;\n self._currentContext = parentContext ? new Map(parentContext) : new Map();\n self.getValue = (key) => self._currentContext.get(key);\n self.setValue = (key, value) => {\n const context = new BaseContext(self._currentContext);\n context._currentContext.set(key, value);\n return context;\n };\n self.deleteValue = (key) => {\n const context = new BaseContext(self._currentContext);\n context._currentContext.delete(key);\n return context;\n };\n }\n}\n/** The root context is used as the default parent context when there is no active context */\nexports.ROOT_CONTEXT = new BaseContext();\n//# sourceMappingURL=context.js.map",
|
|
98
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiagConsoleLogger = void 0;\nconst consoleMap = [\n { n: 'error', c: 'error' },\n { n: 'warn', c: 'warn' },\n { n: 'info', c: 'info' },\n { n: 'debug', c: 'debug' },\n { n: 'verbose', c: 'trace' },\n];\n/**\n * A simple Immutable Console based diagnostic logger which will output any messages to the Console.\n * If you want to limit the amount of logging to a specific level or lower use the\n * {@link createLogLevelDiagLogger}\n */\nclass DiagConsoleLogger {\n constructor() {\n function _consoleFunc(funcName) {\n return function (...args) {\n if (console) {\n // Some environments only expose the console when the F12 developer console is open\n // eslint-disable-next-line no-console\n let theFunc = console[funcName];\n if (typeof theFunc !== 'function') {\n // Not all environments support all functions\n // eslint-disable-next-line no-console\n theFunc = console.log;\n }\n // One last final check\n if (typeof theFunc === 'function') {\n return theFunc.apply(console, args);\n }\n }\n };\n }\n for (let i = 0; i < consoleMap.length; i++) {\n this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c);\n }\n }\n}\nexports.DiagConsoleLogger = DiagConsoleLogger;\n//# sourceMappingURL=consoleLogger.js.map",
|
|
99
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createNoopMeter = exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = exports.NOOP_OBSERVABLE_GAUGE_METRIC = exports.NOOP_OBSERVABLE_COUNTER_METRIC = exports.NOOP_UP_DOWN_COUNTER_METRIC = exports.NOOP_HISTOGRAM_METRIC = exports.NOOP_GAUGE_METRIC = exports.NOOP_COUNTER_METRIC = exports.NOOP_METER = exports.NoopObservableUpDownCounterMetric = exports.NoopObservableGaugeMetric = exports.NoopObservableCounterMetric = exports.NoopObservableMetric = exports.NoopHistogramMetric = exports.NoopGaugeMetric = exports.NoopUpDownCounterMetric = exports.NoopCounterMetric = exports.NoopMetric = exports.NoopMeter = void 0;\n/**\n * NoopMeter is a noop implementation of the {@link Meter} interface. It reuses\n * constant NoopMetrics for all of its methods.\n */\nclass NoopMeter {\n constructor() { }\n /**\n * @see {@link Meter.createGauge}\n */\n createGauge(_name, _options) {\n return exports.NOOP_GAUGE_METRIC;\n }\n /**\n * @see {@link Meter.createHistogram}\n */\n createHistogram(_name, _options) {\n return exports.NOOP_HISTOGRAM_METRIC;\n }\n /**\n * @see {@link Meter.createCounter}\n */\n createCounter(_name, _options) {\n return exports.NOOP_COUNTER_METRIC;\n }\n /**\n * @see {@link Meter.createUpDownCounter}\n */\n createUpDownCounter(_name, _options) {\n return exports.NOOP_UP_DOWN_COUNTER_METRIC;\n }\n /**\n * @see {@link Meter.createObservableGauge}\n */\n createObservableGauge(_name, _options) {\n return exports.NOOP_OBSERVABLE_GAUGE_METRIC;\n }\n /**\n * @see {@link Meter.createObservableCounter}\n */\n createObservableCounter(_name, _options) {\n return exports.NOOP_OBSERVABLE_COUNTER_METRIC;\n }\n /**\n * @see {@link Meter.createObservableUpDownCounter}\n */\n createObservableUpDownCounter(_name, _options) {\n return exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;\n }\n /**\n * @see {@link Meter.addBatchObservableCallback}\n */\n addBatchObservableCallback(_callback, _observables) { }\n /**\n * @see {@link Meter.removeBatchObservableCallback}\n */\n removeBatchObservableCallback(_callback) { }\n}\nexports.NoopMeter = NoopMeter;\nclass NoopMetric {\n}\nexports.NoopMetric = NoopMetric;\nclass NoopCounterMetric extends NoopMetric {\n add(_value, _attributes) { }\n}\nexports.NoopCounterMetric = NoopCounterMetric;\nclass NoopUpDownCounterMetric extends NoopMetric {\n add(_value, _attributes) { }\n}\nexports.NoopUpDownCounterMetric = NoopUpDownCounterMetric;\nclass NoopGaugeMetric extends NoopMetric {\n record(_value, _attributes) { }\n}\nexports.NoopGaugeMetric = NoopGaugeMetric;\nclass NoopHistogramMetric extends NoopMetric {\n record(_value, _attributes) { }\n}\nexports.NoopHistogramMetric = NoopHistogramMetric;\nclass NoopObservableMetric {\n addCallback(_callback) { }\n removeCallback(_callback) { }\n}\nexports.NoopObservableMetric = NoopObservableMetric;\nclass NoopObservableCounterMetric extends NoopObservableMetric {\n}\nexports.NoopObservableCounterMetric = NoopObservableCounterMetric;\nclass NoopObservableGaugeMetric extends NoopObservableMetric {\n}\nexports.NoopObservableGaugeMetric = NoopObservableGaugeMetric;\nclass NoopObservableUpDownCounterMetric extends NoopObservableMetric {\n}\nexports.NoopObservableUpDownCounterMetric = NoopObservableUpDownCounterMetric;\nexports.NOOP_METER = new NoopMeter();\n// Synchronous instruments\nexports.NOOP_COUNTER_METRIC = new NoopCounterMetric();\nexports.NOOP_GAUGE_METRIC = new NoopGaugeMetric();\nexports.NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric();\nexports.NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric();\n// Asynchronous instruments\nexports.NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric();\nexports.NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric();\nexports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric();\n/**\n * Create a no-op Meter\n */\nfunction createNoopMeter() {\n return exports.NOOP_METER;\n}\nexports.createNoopMeter = createNoopMeter;\n//# sourceMappingURL=NoopMeter.js.map",
|
|
100
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ValueType = void 0;\n/** The Type of value. It describes how the data is reported. */\nvar ValueType;\n(function (ValueType) {\n ValueType[ValueType[\"INT\"] = 0] = \"INT\";\n ValueType[ValueType[\"DOUBLE\"] = 1] = \"DOUBLE\";\n})(ValueType = exports.ValueType || (exports.ValueType = {}));\n//# sourceMappingURL=Metric.js.map",
|
|
101
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultTextMapSetter = exports.defaultTextMapGetter = void 0;\nexports.defaultTextMapGetter = {\n get(carrier, key) {\n if (carrier == null) {\n return undefined;\n }\n return carrier[key];\n },\n keys(carrier) {\n if (carrier == null) {\n return [];\n }\n return Object.keys(carrier);\n },\n};\nexports.defaultTextMapSetter = {\n set(carrier, key, value) {\n if (carrier == null) {\n return;\n }\n carrier[key] = value;\n },\n};\n//# sourceMappingURL=TextMapPropagator.js.map",
|
|
102
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NoopContextManager = void 0;\nconst context_1 = require(\"./context\");\nclass NoopContextManager {\n active() {\n return context_1.ROOT_CONTEXT;\n }\n with(_context, fn, thisArg, ...args) {\n return fn.call(thisArg, ...args);\n }\n bind(_context, target) {\n return target;\n }\n enable() {\n return this;\n }\n disable() {\n return this;\n }\n}\nexports.NoopContextManager = NoopContextManager;\n//# sourceMappingURL=NoopContextManager.js.map",
|
|
103
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ContextAPI = void 0;\nconst NoopContextManager_1 = require(\"../context/NoopContextManager\");\nconst global_utils_1 = require(\"../internal/global-utils\");\nconst diag_1 = require(\"./diag\");\nconst API_NAME = 'context';\nconst NOOP_CONTEXT_MANAGER = new NoopContextManager_1.NoopContextManager();\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Context API\n */\nclass ContextAPI {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n constructor() { }\n /** Get the singleton instance of the Context API */\n static getInstance() {\n if (!this._instance) {\n this._instance = new ContextAPI();\n }\n return this._instance;\n }\n /**\n * Set the current context manager.\n *\n * @returns true if the context manager was successfully registered, else false\n */\n setGlobalContextManager(contextManager) {\n return (0, global_utils_1.registerGlobal)(API_NAME, contextManager, diag_1.DiagAPI.instance());\n }\n /**\n * Get the currently active context\n */\n active() {\n return this._getContextManager().active();\n }\n /**\n * Execute a function with an active context\n *\n * @param context context to be active during function execution\n * @param fn function to execute in a context\n * @param thisArg optional receiver to be used for calling fn\n * @param args optional arguments forwarded to fn\n */\n with(context, fn, thisArg, ...args) {\n return this._getContextManager().with(context, fn, thisArg, ...args);\n }\n /**\n * Bind a context to a target function or event emitter\n *\n * @param context context to bind to the event emitter or function. Defaults to the currently active context\n * @param target function or event emitter to bind\n */\n bind(context, target) {\n return this._getContextManager().bind(context, target);\n }\n _getContextManager() {\n return (0, global_utils_1.getGlobal)(API_NAME) || NOOP_CONTEXT_MANAGER;\n }\n /** Disable and remove the global context manager */\n disable() {\n this._getContextManager().disable();\n (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance());\n }\n}\nexports.ContextAPI = ContextAPI;\n//# sourceMappingURL=context.js.map",
|
|
104
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TraceFlags = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar TraceFlags;\n(function (TraceFlags) {\n /** Represents no flag set. */\n TraceFlags[TraceFlags[\"NONE\"] = 0] = \"NONE\";\n /** Bit to represent whether trace is sampled in trace flags. */\n TraceFlags[TraceFlags[\"SAMPLED\"] = 1] = \"SAMPLED\";\n})(TraceFlags = exports.TraceFlags || (exports.TraceFlags = {}));\n//# sourceMappingURL=trace_flags.js.map",
|
|
105
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = void 0;\nconst trace_flags_1 = require(\"./trace_flags\");\nexports.INVALID_SPANID = '0000000000000000';\nexports.INVALID_TRACEID = '00000000000000000000000000000000';\nexports.INVALID_SPAN_CONTEXT = {\n traceId: exports.INVALID_TRACEID,\n spanId: exports.INVALID_SPANID,\n traceFlags: trace_flags_1.TraceFlags.NONE,\n};\n//# sourceMappingURL=invalid-span-constants.js.map",
|
|
106
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NonRecordingSpan = void 0;\nconst invalid_span_constants_1 = require(\"./invalid-span-constants\");\n/**\n * The NonRecordingSpan is the default {@link Span} that is used when no Span\n * implementation is available. All operations are no-op including context\n * propagation.\n */\nclass NonRecordingSpan {\n constructor(_spanContext = invalid_span_constants_1.INVALID_SPAN_CONTEXT) {\n this._spanContext = _spanContext;\n }\n // Returns a SpanContext.\n spanContext() {\n return this._spanContext;\n }\n // By default does nothing\n setAttribute(_key, _value) {\n return this;\n }\n // By default does nothing\n setAttributes(_attributes) {\n return this;\n }\n // By default does nothing\n addEvent(_name, _attributes) {\n return this;\n }\n addLink(_link) {\n return this;\n }\n addLinks(_links) {\n return this;\n }\n // By default does nothing\n setStatus(_status) {\n return this;\n }\n // By default does nothing\n updateName(_name) {\n return this;\n }\n // By default does nothing\n end(_endTime) { }\n // isRecording always returns false for NonRecordingSpan.\n isRecording() {\n return false;\n }\n // By default does nothing\n recordException(_exception, _time) { }\n}\nexports.NonRecordingSpan = NonRecordingSpan;\n//# sourceMappingURL=NonRecordingSpan.js.map",
|
|
107
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getSpanContext = exports.setSpanContext = exports.deleteSpan = exports.setSpan = exports.getActiveSpan = exports.getSpan = void 0;\nconst context_1 = require(\"../context/context\");\nconst NonRecordingSpan_1 = require(\"./NonRecordingSpan\");\nconst context_2 = require(\"../api/context\");\n/**\n * span key\n */\nconst SPAN_KEY = (0, context_1.createContextKey)('OpenTelemetry Context Key SPAN');\n/**\n * Return the span if one exists\n *\n * @param context context to get span from\n */\nfunction getSpan(context) {\n return context.getValue(SPAN_KEY) || undefined;\n}\nexports.getSpan = getSpan;\n/**\n * Gets the span from the current context, if one exists.\n */\nfunction getActiveSpan() {\n return getSpan(context_2.ContextAPI.getInstance().active());\n}\nexports.getActiveSpan = getActiveSpan;\n/**\n * Set the span on a context\n *\n * @param context context to use as parent\n * @param span span to set active\n */\nfunction setSpan(context, span) {\n return context.setValue(SPAN_KEY, span);\n}\nexports.setSpan = setSpan;\n/**\n * Remove current span stored in the context\n *\n * @param context context to delete span from\n */\nfunction deleteSpan(context) {\n return context.deleteValue(SPAN_KEY);\n}\nexports.deleteSpan = deleteSpan;\n/**\n * Wrap span context in a NoopSpan and set as span in a new\n * context\n *\n * @param context context to set active span on\n * @param spanContext span context to be wrapped\n */\nfunction setSpanContext(context, spanContext) {\n return setSpan(context, new NonRecordingSpan_1.NonRecordingSpan(spanContext));\n}\nexports.setSpanContext = setSpanContext;\n/**\n * Get the span context of the span if it exists.\n *\n * @param context context to get values from\n */\nfunction getSpanContext(context) {\n var _a;\n return (_a = getSpan(context)) === null || _a === void 0 ? void 0 : _a.spanContext();\n}\nexports.getSpanContext = getSpanContext;\n//# sourceMappingURL=context-utils.js.map",
|
|
108
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.wrapSpanContext = exports.isSpanContextValid = exports.isValidSpanId = exports.isValidTraceId = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst invalid_span_constants_1 = require(\"./invalid-span-constants\");\nconst NonRecordingSpan_1 = require(\"./NonRecordingSpan\");\nconst VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;\nconst VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;\nfunction isValidTraceId(traceId) {\n return VALID_TRACEID_REGEX.test(traceId) && traceId !== invalid_span_constants_1.INVALID_TRACEID;\n}\nexports.isValidTraceId = isValidTraceId;\nfunction isValidSpanId(spanId) {\n return VALID_SPANID_REGEX.test(spanId) && spanId !== invalid_span_constants_1.INVALID_SPANID;\n}\nexports.isValidSpanId = isValidSpanId;\n/**\n * Returns true if this {@link SpanContext} is valid.\n * @return true if this {@link SpanContext} is valid.\n */\nfunction isSpanContextValid(spanContext) {\n return (isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId));\n}\nexports.isSpanContextValid = isSpanContextValid;\n/**\n * Wrap the given {@link SpanContext} in a new non-recording {@link Span}\n *\n * @param spanContext span context to be wrapped\n * @returns a new non-recording {@link Span} with the provided context\n */\nfunction wrapSpanContext(spanContext) {\n return new NonRecordingSpan_1.NonRecordingSpan(spanContext);\n}\nexports.wrapSpanContext = wrapSpanContext;\n//# sourceMappingURL=spancontext-utils.js.map",
|
|
109
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NoopTracer = void 0;\nconst context_1 = require(\"../api/context\");\nconst context_utils_1 = require(\"../trace/context-utils\");\nconst NonRecordingSpan_1 = require(\"./NonRecordingSpan\");\nconst spancontext_utils_1 = require(\"./spancontext-utils\");\nconst contextApi = context_1.ContextAPI.getInstance();\n/**\n * No-op implementations of {@link Tracer}.\n */\nclass NoopTracer {\n // startSpan starts a noop span.\n startSpan(name, options, context = contextApi.active()) {\n const root = Boolean(options === null || options === void 0 ? void 0 : options.root);\n if (root) {\n return new NonRecordingSpan_1.NonRecordingSpan();\n }\n const parentFromContext = context && (0, context_utils_1.getSpanContext)(context);\n if (isSpanContext(parentFromContext) &&\n (0, spancontext_utils_1.isSpanContextValid)(parentFromContext)) {\n return new NonRecordingSpan_1.NonRecordingSpan(parentFromContext);\n }\n else {\n return new NonRecordingSpan_1.NonRecordingSpan();\n }\n }\n startActiveSpan(name, arg2, arg3, arg4) {\n let opts;\n let ctx;\n let fn;\n if (arguments.length < 2) {\n return;\n }\n else if (arguments.length === 2) {\n fn = arg2;\n }\n else if (arguments.length === 3) {\n opts = arg2;\n fn = arg3;\n }\n else {\n opts = arg2;\n ctx = arg3;\n fn = arg4;\n }\n const parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();\n const span = this.startSpan(name, opts, parentContext);\n const contextWithSpanSet = (0, context_utils_1.setSpan)(parentContext, span);\n return contextApi.with(contextWithSpanSet, fn, undefined, span);\n }\n}\nexports.NoopTracer = NoopTracer;\nfunction isSpanContext(spanContext) {\n return (typeof spanContext === 'object' &&\n typeof spanContext['spanId'] === 'string' &&\n typeof spanContext['traceId'] === 'string' &&\n typeof spanContext['traceFlags'] === 'number');\n}\n//# sourceMappingURL=NoopTracer.js.map",
|
|
110
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProxyTracer = void 0;\nconst NoopTracer_1 = require(\"./NoopTracer\");\nconst NOOP_TRACER = new NoopTracer_1.NoopTracer();\n/**\n * Proxy tracer provided by the proxy tracer provider\n */\nclass ProxyTracer {\n constructor(_provider, name, version, options) {\n this._provider = _provider;\n this.name = name;\n this.version = version;\n this.options = options;\n }\n startSpan(name, options, context) {\n return this._getTracer().startSpan(name, options, context);\n }\n startActiveSpan(_name, _options, _context, _fn) {\n const tracer = this._getTracer();\n return Reflect.apply(tracer.startActiveSpan, tracer, arguments);\n }\n /**\n * Try to get a tracer from the proxy tracer provider.\n * If the proxy tracer provider has no delegate, return a noop tracer.\n */\n _getTracer() {\n if (this._delegate) {\n return this._delegate;\n }\n const tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);\n if (!tracer) {\n return NOOP_TRACER;\n }\n this._delegate = tracer;\n return this._delegate;\n }\n}\nexports.ProxyTracer = ProxyTracer;\n//# sourceMappingURL=ProxyTracer.js.map",
|
|
111
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NoopTracerProvider = void 0;\nconst NoopTracer_1 = require(\"./NoopTracer\");\n/**\n * An implementation of the {@link TracerProvider} which returns an impotent\n * Tracer for all calls to `getTracer`.\n *\n * All operations are no-op.\n */\nclass NoopTracerProvider {\n getTracer(_name, _version, _options) {\n return new NoopTracer_1.NoopTracer();\n }\n}\nexports.NoopTracerProvider = NoopTracerProvider;\n//# sourceMappingURL=NoopTracerProvider.js.map",
|
|
112
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProxyTracerProvider = void 0;\nconst ProxyTracer_1 = require(\"./ProxyTracer\");\nconst NoopTracerProvider_1 = require(\"./NoopTracerProvider\");\nconst NOOP_TRACER_PROVIDER = new NoopTracerProvider_1.NoopTracerProvider();\n/**\n * Tracer provider which provides {@link ProxyTracer}s.\n *\n * Before a delegate is set, tracers provided are NoOp.\n * When a delegate is set, traces are provided from the delegate.\n * When a delegate is set after tracers have already been provided,\n * all tracers already provided will use the provided delegate implementation.\n */\nclass ProxyTracerProvider {\n /**\n * Get a {@link ProxyTracer}\n */\n getTracer(name, version, options) {\n var _a;\n return ((_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer_1.ProxyTracer(this, name, version, options));\n }\n getDelegate() {\n var _a;\n return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER;\n }\n /**\n * Set the delegate tracer provider\n */\n setDelegate(delegate) {\n this._delegate = delegate;\n }\n getDelegateTracer(name, version, options) {\n var _a;\n return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options);\n }\n}\nexports.ProxyTracerProvider = ProxyTracerProvider;\n//# sourceMappingURL=ProxyTracerProvider.js.map",
|
|
113
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SamplingDecision = void 0;\n/**\n * @deprecated use the one declared in @opentelemetry/sdk-trace-base instead.\n * A sampling decision that determines how a {@link Span} will be recorded\n * and collected.\n */\nvar SamplingDecision;\n(function (SamplingDecision) {\n /**\n * `Span.isRecording() === false`, span will not be recorded and all events\n * and attributes will be dropped.\n */\n SamplingDecision[SamplingDecision[\"NOT_RECORD\"] = 0] = \"NOT_RECORD\";\n /**\n * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags}\n * MUST NOT be set.\n */\n SamplingDecision[SamplingDecision[\"RECORD\"] = 1] = \"RECORD\";\n /**\n * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags}\n * MUST be set.\n */\n SamplingDecision[SamplingDecision[\"RECORD_AND_SAMPLED\"] = 2] = \"RECORD_AND_SAMPLED\";\n})(SamplingDecision = exports.SamplingDecision || (exports.SamplingDecision = {}));\n//# sourceMappingURL=SamplingResult.js.map",
|
|
114
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SpanKind = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar SpanKind;\n(function (SpanKind) {\n /** Default value. Indicates that the span is used internally. */\n SpanKind[SpanKind[\"INTERNAL\"] = 0] = \"INTERNAL\";\n /**\n * Indicates that the span covers server-side handling of an RPC or other\n * remote request.\n */\n SpanKind[SpanKind[\"SERVER\"] = 1] = \"SERVER\";\n /**\n * Indicates that the span covers the client-side wrapper around an RPC or\n * other remote request.\n */\n SpanKind[SpanKind[\"CLIENT\"] = 2] = \"CLIENT\";\n /**\n * Indicates that the span describes producer sending a message to a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n SpanKind[SpanKind[\"PRODUCER\"] = 3] = \"PRODUCER\";\n /**\n * Indicates that the span describes consumer receiving a message from a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n SpanKind[SpanKind[\"CONSUMER\"] = 4] = \"CONSUMER\";\n})(SpanKind = exports.SpanKind || (exports.SpanKind = {}));\n//# sourceMappingURL=span_kind.js.map",
|
|
115
|
-
"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SpanStatusCode = void 0;\n/**\n * An enumeration of status codes.\n */\nvar SpanStatusCode;\n(function (SpanStatusCode) {\n /**\n * The default status.\n */\n SpanStatusCode[SpanStatusCode[\"UNSET\"] = 0] = \"UNSET\";\n /**\n * The operation has been validated by an Application developer or\n * Operator to have completed successfully.\n */\n SpanStatusCode[SpanStatusCode[\"OK\"] = 1] = \"OK\";\n /**\n * The operation contains an error.\n */\n SpanStatusCode[SpanStatusCode[\"ERROR\"] = 2] = \"ERROR\";\n})(SpanStatusCode = exports.SpanStatusCode || (exports.SpanStatusCode = {}));\n//# sourceMappingURL=status.js.map",
|
|
116
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateValue = exports.validateKey = void 0;\nconst VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]';\nconst VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`;\nconst VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`;\nconst VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`);\nconst VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;\nconst INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;\n/**\n * Key is opaque string up to 256 characters printable. It MUST begin with a\n * lowercase letter, and can only contain lowercase letters a-z, digits 0-9,\n * underscores _, dashes -, asterisks *, and forward slashes /.\n * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the\n * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key.\n * see https://www.w3.org/TR/trace-context/#key\n */\nfunction validateKey(key) {\n return VALID_KEY_REGEX.test(key);\n}\nexports.validateKey = validateKey;\n/**\n * Value is opaque string up to 256 characters printable ASCII RFC0020\n * characters (i.e., the range 0x20 to 0x7E) except comma , and =.\n */\nfunction validateValue(value) {\n return (VALID_VALUE_BASE_REGEX.test(value) &&\n !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value));\n}\nexports.validateValue = validateValue;\n//# sourceMappingURL=tracestate-validators.js.map",
|
|
117
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TraceStateImpl = void 0;\nconst tracestate_validators_1 = require(\"./tracestate-validators\");\nconst MAX_TRACE_STATE_ITEMS = 32;\nconst MAX_TRACE_STATE_LEN = 512;\nconst LIST_MEMBERS_SEPARATOR = ',';\nconst LIST_MEMBER_KEY_VALUE_SPLITTER = '=';\n/**\n * TraceState must be a class and not a simple object type because of the spec\n * requirement (https://www.w3.org/TR/trace-context/#tracestate-field).\n *\n * Here is the list of allowed mutations:\n * - New key-value pair should be added into the beginning of the list\n * - The value of any key can be updated. Modified keys MUST be moved to the\n * beginning of the list.\n */\nclass TraceStateImpl {\n constructor(rawTraceState) {\n this._internalState = new Map();\n if (rawTraceState)\n this._parse(rawTraceState);\n }\n set(key, value) {\n // TODO: Benchmark the different approaches(map vs list) and\n // use the faster one.\n const traceState = this._clone();\n if (traceState._internalState.has(key)) {\n traceState._internalState.delete(key);\n }\n traceState._internalState.set(key, value);\n return traceState;\n }\n unset(key) {\n const traceState = this._clone();\n traceState._internalState.delete(key);\n return traceState;\n }\n get(key) {\n return this._internalState.get(key);\n }\n serialize() {\n return this._keys()\n .reduce((agg, key) => {\n agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key));\n return agg;\n }, [])\n .join(LIST_MEMBERS_SEPARATOR);\n }\n _parse(rawTraceState) {\n if (rawTraceState.length > MAX_TRACE_STATE_LEN)\n return;\n this._internalState = rawTraceState\n .split(LIST_MEMBERS_SEPARATOR)\n .reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning\n .reduce((agg, part) => {\n const listMember = part.trim(); // Optional Whitespace (OWS) handling\n const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);\n if (i !== -1) {\n const key = listMember.slice(0, i);\n const value = listMember.slice(i + 1, part.length);\n if ((0, tracestate_validators_1.validateKey)(key) && (0, tracestate_validators_1.validateValue)(value)) {\n agg.set(key, value);\n }\n else {\n // TODO: Consider to add warning log\n }\n }\n return agg;\n }, new Map());\n // Because of the reverse() requirement, trunc must be done after map is created\n if (this._internalState.size > MAX_TRACE_STATE_ITEMS) {\n this._internalState = new Map(Array.from(this._internalState.entries())\n .reverse() // Use reverse same as original tracestate parse chain\n .slice(0, MAX_TRACE_STATE_ITEMS));\n }\n }\n _keys() {\n return Array.from(this._internalState.keys()).reverse();\n }\n _clone() {\n const traceState = new TraceStateImpl();\n traceState._internalState = new Map(this._internalState);\n return traceState;\n }\n}\nexports.TraceStateImpl = TraceStateImpl;\n//# sourceMappingURL=tracestate-impl.js.map",
|
|
118
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createTraceState = void 0;\nconst tracestate_impl_1 = require(\"./tracestate-impl\");\nfunction createTraceState(rawTraceState) {\n return new tracestate_impl_1.TraceStateImpl(rawTraceState);\n}\nexports.createTraceState = createTraceState;\n//# sourceMappingURL=utils.js.map",
|
|
119
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.context = void 0;\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nconst context_1 = require(\"./api/context\");\n/** Entrypoint for context API */\nexports.context = context_1.ContextAPI.getInstance();\n//# sourceMappingURL=context-api.js.map",
|
|
120
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.diag = void 0;\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nconst diag_1 = require(\"./api/diag\");\n/**\n * Entrypoint for Diag API.\n * Defines Diagnostic handler used for internal diagnostic logging operations.\n * The default provides a Noop DiagLogger implementation which may be changed via the\n * diag.setLogger(logger: DiagLogger) function.\n */\nexports.diag = diag_1.DiagAPI.instance();\n//# sourceMappingURL=diag-api.js.map",
|
|
121
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NOOP_METER_PROVIDER = exports.NoopMeterProvider = void 0;\nconst NoopMeter_1 = require(\"./NoopMeter\");\n/**\n * An implementation of the {@link MeterProvider} which returns an impotent Meter\n * for all calls to `getMeter`\n */\nclass NoopMeterProvider {\n getMeter(_name, _version, _options) {\n return NoopMeter_1.NOOP_METER;\n }\n}\nexports.NoopMeterProvider = NoopMeterProvider;\nexports.NOOP_METER_PROVIDER = new NoopMeterProvider();\n//# sourceMappingURL=NoopMeterProvider.js.map",
|
|
122
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MetricsAPI = void 0;\nconst NoopMeterProvider_1 = require(\"../metrics/NoopMeterProvider\");\nconst global_utils_1 = require(\"../internal/global-utils\");\nconst diag_1 = require(\"./diag\");\nconst API_NAME = 'metrics';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Metrics API\n */\nclass MetricsAPI {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n constructor() { }\n /** Get the singleton instance of the Metrics API */\n static getInstance() {\n if (!this._instance) {\n this._instance = new MetricsAPI();\n }\n return this._instance;\n }\n /**\n * Set the current global meter provider.\n * Returns true if the meter provider was successfully registered, else false.\n */\n setGlobalMeterProvider(provider) {\n return (0, global_utils_1.registerGlobal)(API_NAME, provider, diag_1.DiagAPI.instance());\n }\n /**\n * Returns the global meter provider.\n */\n getMeterProvider() {\n return (0, global_utils_1.getGlobal)(API_NAME) || NoopMeterProvider_1.NOOP_METER_PROVIDER;\n }\n /**\n * Returns a meter from the global meter provider.\n */\n getMeter(name, version, options) {\n return this.getMeterProvider().getMeter(name, version, options);\n }\n /** Remove the global meter provider */\n disable() {\n (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance());\n }\n}\nexports.MetricsAPI = MetricsAPI;\n//# sourceMappingURL=metrics.js.map",
|
|
123
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.metrics = void 0;\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nconst metrics_1 = require(\"./api/metrics\");\n/** Entrypoint for metrics API */\nexports.metrics = metrics_1.MetricsAPI.getInstance();\n//# sourceMappingURL=metrics-api.js.map",
|
|
124
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NoopTextMapPropagator = void 0;\n/**\n * No-op implementations of {@link TextMapPropagator}.\n */\nclass NoopTextMapPropagator {\n /** Noop inject function does nothing */\n inject(_context, _carrier) { }\n /** Noop extract function does nothing and returns the input context */\n extract(context, _carrier) {\n return context;\n }\n fields() {\n return [];\n }\n}\nexports.NoopTextMapPropagator = NoopTextMapPropagator;\n//# sourceMappingURL=NoopTextMapPropagator.js.map",
|
|
125
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.deleteBaggage = exports.setBaggage = exports.getActiveBaggage = exports.getBaggage = void 0;\nconst context_1 = require(\"../api/context\");\nconst context_2 = require(\"../context/context\");\n/**\n * Baggage key\n */\nconst BAGGAGE_KEY = (0, context_2.createContextKey)('OpenTelemetry Baggage Key');\n/**\n * Retrieve the current baggage from the given context\n *\n * @param {Context} Context that manage all context values\n * @returns {Baggage} Extracted baggage from the context\n */\nfunction getBaggage(context) {\n return context.getValue(BAGGAGE_KEY) || undefined;\n}\nexports.getBaggage = getBaggage;\n/**\n * Retrieve the current baggage from the active/current context\n *\n * @returns {Baggage} Extracted baggage from the context\n */\nfunction getActiveBaggage() {\n return getBaggage(context_1.ContextAPI.getInstance().active());\n}\nexports.getActiveBaggage = getActiveBaggage;\n/**\n * Store a baggage in the given context\n *\n * @param {Context} Context that manage all context values\n * @param {Baggage} baggage that will be set in the actual context\n */\nfunction setBaggage(context, baggage) {\n return context.setValue(BAGGAGE_KEY, baggage);\n}\nexports.setBaggage = setBaggage;\n/**\n * Delete the baggage stored in the given context\n *\n * @param {Context} Context that manage all context values\n */\nfunction deleteBaggage(context) {\n return context.deleteValue(BAGGAGE_KEY);\n}\nexports.deleteBaggage = deleteBaggage;\n//# sourceMappingURL=context-helpers.js.map",
|
|
126
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PropagationAPI = void 0;\nconst global_utils_1 = require(\"../internal/global-utils\");\nconst NoopTextMapPropagator_1 = require(\"../propagation/NoopTextMapPropagator\");\nconst TextMapPropagator_1 = require(\"../propagation/TextMapPropagator\");\nconst context_helpers_1 = require(\"../baggage/context-helpers\");\nconst utils_1 = require(\"../baggage/utils\");\nconst diag_1 = require(\"./diag\");\nconst API_NAME = 'propagation';\nconst NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator_1.NoopTextMapPropagator();\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Propagation API\n */\nclass PropagationAPI {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n constructor() {\n this.createBaggage = utils_1.createBaggage;\n this.getBaggage = context_helpers_1.getBaggage;\n this.getActiveBaggage = context_helpers_1.getActiveBaggage;\n this.setBaggage = context_helpers_1.setBaggage;\n this.deleteBaggage = context_helpers_1.deleteBaggage;\n }\n /** Get the singleton instance of the Propagator API */\n static getInstance() {\n if (!this._instance) {\n this._instance = new PropagationAPI();\n }\n return this._instance;\n }\n /**\n * Set the current propagator.\n *\n * @returns true if the propagator was successfully registered, else false\n */\n setGlobalPropagator(propagator) {\n return (0, global_utils_1.registerGlobal)(API_NAME, propagator, diag_1.DiagAPI.instance());\n }\n /**\n * Inject context into a carrier to be propagated inter-process\n *\n * @param context Context carrying tracing data to inject\n * @param carrier carrier to inject context into\n * @param setter Function used to set values on the carrier\n */\n inject(context, carrier, setter = TextMapPropagator_1.defaultTextMapSetter) {\n return this._getGlobalPropagator().inject(context, carrier, setter);\n }\n /**\n * Extract context from a carrier\n *\n * @param context Context which the newly created context will inherit from\n * @param carrier Carrier to extract context from\n * @param getter Function used to extract keys from a carrier\n */\n extract(context, carrier, getter = TextMapPropagator_1.defaultTextMapGetter) {\n return this._getGlobalPropagator().extract(context, carrier, getter);\n }\n /**\n * Return a list of all fields which may be used by the propagator.\n */\n fields() {\n return this._getGlobalPropagator().fields();\n }\n /** Remove the global propagator */\n disable() {\n (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance());\n }\n _getGlobalPropagator() {\n return (0, global_utils_1.getGlobal)(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR;\n }\n}\nexports.PropagationAPI = PropagationAPI;\n//# sourceMappingURL=propagation.js.map",
|
|
127
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.propagation = void 0;\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nconst propagation_1 = require(\"./api/propagation\");\n/** Entrypoint for propagation API */\nexports.propagation = propagation_1.PropagationAPI.getInstance();\n//# sourceMappingURL=propagation-api.js.map",
|
|
128
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TraceAPI = void 0;\nconst global_utils_1 = require(\"../internal/global-utils\");\nconst ProxyTracerProvider_1 = require(\"../trace/ProxyTracerProvider\");\nconst spancontext_utils_1 = require(\"../trace/spancontext-utils\");\nconst context_utils_1 = require(\"../trace/context-utils\");\nconst diag_1 = require(\"./diag\");\nconst API_NAME = 'trace';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Tracing API\n */\nclass TraceAPI {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n constructor() {\n this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider();\n this.wrapSpanContext = spancontext_utils_1.wrapSpanContext;\n this.isSpanContextValid = spancontext_utils_1.isSpanContextValid;\n this.deleteSpan = context_utils_1.deleteSpan;\n this.getSpan = context_utils_1.getSpan;\n this.getActiveSpan = context_utils_1.getActiveSpan;\n this.getSpanContext = context_utils_1.getSpanContext;\n this.setSpan = context_utils_1.setSpan;\n this.setSpanContext = context_utils_1.setSpanContext;\n }\n /** Get the singleton instance of the Trace API */\n static getInstance() {\n if (!this._instance) {\n this._instance = new TraceAPI();\n }\n return this._instance;\n }\n /**\n * Set the current global tracer.\n *\n * @returns true if the tracer provider was successfully registered, else false\n */\n setGlobalTracerProvider(provider) {\n const success = (0, global_utils_1.registerGlobal)(API_NAME, this._proxyTracerProvider, diag_1.DiagAPI.instance());\n if (success) {\n this._proxyTracerProvider.setDelegate(provider);\n }\n return success;\n }\n /**\n * Returns the global tracer provider.\n */\n getTracerProvider() {\n return (0, global_utils_1.getGlobal)(API_NAME) || this._proxyTracerProvider;\n }\n /**\n * Returns a tracer from the global tracer provider.\n */\n getTracer(name, version) {\n return this.getTracerProvider().getTracer(name, version);\n }\n /** Remove the global tracer provider */\n disable() {\n (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance());\n this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider();\n }\n}\nexports.TraceAPI = TraceAPI;\n//# sourceMappingURL=trace.js.map",
|
|
129
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.trace = void 0;\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nconst trace_1 = require(\"./api/trace\");\n/** Entrypoint for trace API */\nexports.trace = trace_1.TraceAPI.getInstance();\n//# sourceMappingURL=trace-api.js.map",
|
|
130
|
-
"\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.trace = exports.propagation = exports.metrics = exports.diag = exports.context = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.createTraceState = exports.TraceFlags = exports.SpanStatusCode = exports.SpanKind = exports.SamplingDecision = exports.ProxyTracerProvider = exports.ProxyTracer = exports.defaultTextMapSetter = exports.defaultTextMapGetter = exports.ValueType = exports.createNoopMeter = exports.DiagLogLevel = exports.DiagConsoleLogger = exports.ROOT_CONTEXT = exports.createContextKey = exports.baggageEntryMetadataFromString = void 0;\nvar utils_1 = require(\"./baggage/utils\");\nObject.defineProperty(exports, \"baggageEntryMetadataFromString\", { enumerable: true, get: function () { return utils_1.baggageEntryMetadataFromString; } });\n// Context APIs\nvar context_1 = require(\"./context/context\");\nObject.defineProperty(exports, \"createContextKey\", { enumerable: true, get: function () { return context_1.createContextKey; } });\nObject.defineProperty(exports, \"ROOT_CONTEXT\", { enumerable: true, get: function () { return context_1.ROOT_CONTEXT; } });\n// Diag APIs\nvar consoleLogger_1 = require(\"./diag/consoleLogger\");\nObject.defineProperty(exports, \"DiagConsoleLogger\", { enumerable: true, get: function () { return consoleLogger_1.DiagConsoleLogger; } });\nvar types_1 = require(\"./diag/types\");\nObject.defineProperty(exports, \"DiagLogLevel\", { enumerable: true, get: function () { return types_1.DiagLogLevel; } });\n// Metrics APIs\nvar NoopMeter_1 = require(\"./metrics/NoopMeter\");\nObject.defineProperty(exports, \"createNoopMeter\", { enumerable: true, get: function () { return NoopMeter_1.createNoopMeter; } });\nvar Metric_1 = require(\"./metrics/Metric\");\nObject.defineProperty(exports, \"ValueType\", { enumerable: true, get: function () { return Metric_1.ValueType; } });\n// Propagation APIs\nvar TextMapPropagator_1 = require(\"./propagation/TextMapPropagator\");\nObject.defineProperty(exports, \"defaultTextMapGetter\", { enumerable: true, get: function () { return TextMapPropagator_1.defaultTextMapGetter; } });\nObject.defineProperty(exports, \"defaultTextMapSetter\", { enumerable: true, get: function () { return TextMapPropagator_1.defaultTextMapSetter; } });\nvar ProxyTracer_1 = require(\"./trace/ProxyTracer\");\nObject.defineProperty(exports, \"ProxyTracer\", { enumerable: true, get: function () { return ProxyTracer_1.ProxyTracer; } });\nvar ProxyTracerProvider_1 = require(\"./trace/ProxyTracerProvider\");\nObject.defineProperty(exports, \"ProxyTracerProvider\", { enumerable: true, get: function () { return ProxyTracerProvider_1.ProxyTracerProvider; } });\nvar SamplingResult_1 = require(\"./trace/SamplingResult\");\nObject.defineProperty(exports, \"SamplingDecision\", { enumerable: true, get: function () { return SamplingResult_1.SamplingDecision; } });\nvar span_kind_1 = require(\"./trace/span_kind\");\nObject.defineProperty(exports, \"SpanKind\", { enumerable: true, get: function () { return span_kind_1.SpanKind; } });\nvar status_1 = require(\"./trace/status\");\nObject.defineProperty(exports, \"SpanStatusCode\", { enumerable: true, get: function () { return status_1.SpanStatusCode; } });\nvar trace_flags_1 = require(\"./trace/trace_flags\");\nObject.defineProperty(exports, \"TraceFlags\", { enumerable: true, get: function () { return trace_flags_1.TraceFlags; } });\nvar utils_2 = require(\"./trace/internal/utils\");\nObject.defineProperty(exports, \"createTraceState\", { enumerable: true, get: function () { return utils_2.createTraceState; } });\nvar spancontext_utils_1 = require(\"./trace/spancontext-utils\");\nObject.defineProperty(exports, \"isSpanContextValid\", { enumerable: true, get: function () { return spancontext_utils_1.isSpanContextValid; } });\nObject.defineProperty(exports, \"isValidTraceId\", { enumerable: true, get: function () { return spancontext_utils_1.isValidTraceId; } });\nObject.defineProperty(exports, \"isValidSpanId\", { enumerable: true, get: function () { return spancontext_utils_1.isValidSpanId; } });\nvar invalid_span_constants_1 = require(\"./trace/invalid-span-constants\");\nObject.defineProperty(exports, \"INVALID_SPANID\", { enumerable: true, get: function () { return invalid_span_constants_1.INVALID_SPANID; } });\nObject.defineProperty(exports, \"INVALID_TRACEID\", { enumerable: true, get: function () { return invalid_span_constants_1.INVALID_TRACEID; } });\nObject.defineProperty(exports, \"INVALID_SPAN_CONTEXT\", { enumerable: true, get: function () { return invalid_span_constants_1.INVALID_SPAN_CONTEXT; } });\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nconst context_api_1 = require(\"./context-api\");\nObject.defineProperty(exports, \"context\", { enumerable: true, get: function () { return context_api_1.context; } });\nconst diag_api_1 = require(\"./diag-api\");\nObject.defineProperty(exports, \"diag\", { enumerable: true, get: function () { return diag_api_1.diag; } });\nconst metrics_api_1 = require(\"./metrics-api\");\nObject.defineProperty(exports, \"metrics\", { enumerable: true, get: function () { return metrics_api_1.metrics; } });\nconst propagation_api_1 = require(\"./propagation-api\");\nObject.defineProperty(exports, \"propagation\", { enumerable: true, get: function () { return propagation_api_1.propagation; } });\nconst trace_api_1 = require(\"./trace-api\");\nObject.defineProperty(exports, \"trace\", { enumerable: true, get: function () { return trace_api_1.trace; } });\n// Default export.\nexports.default = {\n context: context_api_1.context,\n diag: diag_api_1.diag,\n metrics: metrics_api_1.metrics,\n propagation: propagation_api_1.propagation,\n trace: trace_api_1.trace,\n};\n//# sourceMappingURL=index.js.map",
|
|
131
|
-
"import Ajv2020, {\n\ttype ErrorObject,\n\ttype ValidateFunction,\n} from \"ajv/dist/2020.js\";\nimport { z } from \"zod\";\nimport { sha256Canonical } from \"../market-data-archive/capture-contract\";\nimport { assertDocumentSha256, documentSha256, jcsSha256 } from \"./identity\";\nimport { CAPABILITY_POLICY, RESOURCE_POLICY } from \"./manifests\";\nimport archiveSelectionSchemaJson from \"./schemas/archive-selection.schema.json\" with {\n\ttype: \"json\",\n};\nimport promotionReceiptSchemaJson from \"./schemas/promotion-receipt.schema.json\" with {\n\ttype: \"json\",\n};\nimport requestSchemaJson from \"./schemas/request.schema.json\" with {\n\ttype: \"json\",\n};\nimport requiredClockSchemaJson from \"./schemas/required-clock.schema.json\" with {\n\ttype: \"json\",\n};\n\nexport const BACKFILL_REQUEST_SCHEMA_ID = requestSchemaJson.$id;\nexport const REQUIRED_CLOCK_SCHEMA_ID = requiredClockSchemaJson.$id;\nexport const ARCHIVE_SELECTION_SCHEMA_ID = archiveSelectionSchemaJson.$id;\nexport const PROMOTION_RECEIPT_SCHEMA_ID = promotionReceiptSchemaJson.$id;\n\nexport type FixedUtcTimestamp = string;\nexport type Sha256Hex = string;\nexport type LowercaseUuid = string;\n\nexport type CanonicalScopeWire = {\n\texchange: string;\n\ttrading_pair: string;\n\tmarket_type: \"spot\" | \"swap\" | \"future\";\n\tfeed: \"ORDERBOOK\";\n};\n\nexport type CoveragePolicyWire = {\n\tpolicy_id: \"prior-asof-strict/v1\";\n\tmax_asof_lag_ms: number;\n\tfuture_rows: \"reject\";\n\tmissing_required_event: \"fail\";\n};\n\nexport type RequiredClockWire = {\n\tschema_id: typeof REQUIRED_CLOCK_SCHEMA_ID;\n\tclock_id: LowercaseUuid;\n\tclock_sha256: Sha256Hex;\n\tcreated_at: FixedUtcTimestamp;\n\ttargets: Array<{ target_id: LowercaseUuid; target_at: FixedUtcTimestamp }>;\n};\n\nexport type ArchiveSelectionWire = {\n\tschema_id: typeof ARCHIVE_SELECTION_SCHEMA_ID;\n\tselection_sha256: Sha256Hex;\n\tscope: CanonicalScopeWire;\n\trequired_clock: {\n\t\tclock_id: LowercaseUuid;\n\t\tclock_sha256: Sha256Hex;\n\t\tevent_count: number;\n\t};\n\tcoverage_policy: CoveragePolicyWire;\n\tsource_policy: \"authoritative_window\" | \"fill_gaps\";\n\tcoverage_class: \"complete\" | \"partial\" | \"missing\";\n\trequested_intervals: Array<{\n\t\tstart_at: FixedUtcTimestamp;\n\t\tend_at: FixedUtcTimestamp;\n\t}>;\n\tselected_intervals: Array<{\n\t\tstart_at: FixedUtcTimestamp;\n\t\tend_at: FixedUtcTimestamp;\n\t\tcapture_bundle_id: Sha256Hex;\n\t\tcapture_origin: \"production_capture\" | \"vendor_historical_backfill\";\n\t}>;\n\tprecedence: Array<\"archive\" | \"vendor\">;\n\tbundles: Array<{\n\t\tcapture_bundle_id: Sha256Hex;\n\t\tcapture_origin: \"production_capture\" | \"vendor_historical_backfill\";\n\t\tinterval: { start_at: FixedUtcTimestamp; end_at: FixedUtcTimestamp };\n\t\tqualification: null | {\n\t\t\tqualification_event_id: LowercaseUuid;\n\t\t\tstate: \"qualified\";\n\t\t\treceipt_id: Sha256Hex;\n\t\t\tpromotion_identity_sha256: Sha256Hex;\n\t\t};\n\t}>;\n\tsupport_anchors: Array<{\n\t\tcapture_bundle_id: Sha256Hex;\n\t\traw_capture_id: Sha256Hex;\n\t\tsnapshot_id: Sha256Hex;\n\t\tsource_time: FixedUtcTimestamp;\n\t\tnormalized_summary_checksum: Sha256Hex;\n\t\tmetadata_ref: {\n\t\t\tcapture_origin: \"production_capture\" | \"vendor_historical_backfill\";\n\t\t\tqualification_event_id: LowercaseUuid | null;\n\t\t\treceipt_id: Sha256Hex | null;\n\t\t};\n\t}>;\n\treceipt_ids: Sha256Hex[];\n\tqualification_event_ids: LowercaseUuid[];\n\tresolved_at: FixedUtcTimestamp;\n};\n\nexport type BackfillRequestWire = {\n\tschema_id: typeof BACKFILL_REQUEST_SCHEMA_ID;\n\trequest_id: LowercaseUuid;\n\tattempt_id: LowercaseUuid;\n\tidempotency_key: Sha256Hex;\n\tscope: CanonicalScopeWire;\n\twindow: { start_at: FixedUtcTimestamp; end_at: FixedUtcTimestamp };\n\tdepth: number;\n\tconstruction_mode: \"sampled_top_n_snapshot\" | \"exact_l2_reconstruction\";\n\tsource_policy: \"authoritative_window\" | \"fill_gaps\";\n\ttarget: { environment: string; cluster: string };\n\tcoverage_policy: CoveragePolicyWire;\n\trequired_clock: {\n\t\tschema_id: typeof REQUIRED_CLOCK_SCHEMA_ID;\n\t\tclock_id: LowercaseUuid;\n\t\tfile_name: string;\n\t\tclock_sha256: Sha256Hex;\n\t\tevent_count: number;\n\t};\n\tinitial_selection: ArchiveSelectionWire;\n\texpected_canonical_schema: {\n\t\tschema_id: string;\n\t\tschema_sha256: Sha256Hex;\n\t};\n\tproduct_pins: {\n\t\tcapability_policy: { policy_id: string; policy_sha256: Sha256Hex };\n\t\tresource_policy: { policy_id: string; policy_sha256: Sha256Hex };\n\t};\n\tproduction_authorization_id: LowercaseUuid;\n};\n\nexport type PromotionReceiptWire = {\n\tschema_id: typeof PROMOTION_RECEIPT_SCHEMA_ID;\n\treceipt_id: Sha256Hex;\n\tpromotion_identity_sha256: Sha256Hex;\n\tverified_at: FixedUtcTimestamp;\n\trequest_id: LowercaseUuid;\n\tidempotency_key: Sha256Hex;\n\tsource: \"external_backfill\";\n\tcapture_origin: \"vendor_historical_backfill\";\n\tsource_mode: \"vendor_historical_backfill_v1\";\n\tprovider: string;\n\tadapter_version: string;\n\teffective_policies: {\n\t\tcapability_policy: { policy_id: string; policy_sha256: Sha256Hex };\n\t\tresource_policy: { policy_id: string; policy_sha256: Sha256Hex };\n\t\tadapter_policy: { policy_id: string; policy_sha256: Sha256Hex };\n\t\tacquisition_policy: { policy_id: string; policy_sha256: Sha256Hex };\n\t};\n\tcapture_bundle_id: Sha256Hex;\n\tscope: CanonicalScopeWire;\n\twindow: { start_at: FixedUtcTimestamp; end_at: FixedUtcTimestamp };\n\tdepth: number;\n\tconstruction_mode:\n\t\t| \"sampled_top_n_snapshot\"\n\t\t| \"exact_l2_reconstruction\"\n\t\t| \"policy_neutral_top_n_state_change_tape/v1\";\n\tcanonical_schema: { schema_id: string; schema_sha256: Sha256Hex };\n\tcoverage_policy: CoveragePolicyWire;\n\tselection_sha256: Sha256Hex;\n\tvendor_semantic_digest: Sha256Hex;\n\tcanonical_semantic_digest: Sha256Hex;\n\tprefix_digest: Sha256Hex;\n\tsuffix_digest: Sha256Hex;\n\tseam_verified: true;\n\tcoverage_verified: true;\n\tdataset_objects: Array<{\n\t\tidentity: string;\n\t\tchecksum: Sha256Hex;\n\t\tbytes: number;\n\t\trows: number;\n\t}>;\n};\n\nexport const FINAL_BACKFILL_STATUSES = [\n\t\"request_invalid\",\n\t\"archive_preflight_failed\",\n\t\"already_covered\",\n\t\"promoted\",\n\t\"capability_unsupported\",\n\t\"credentials_missing\",\n\t\"vendor_fetch_failed\",\n\t\"archive_ingest_failed\",\n\t\"promotion_verification_failed\",\n] as const;\n\nexport type FinalBackfillStatus = (typeof FINAL_BACKFILL_STATUSES)[number];\n\nexport type BackfillOutcomeWire = {\n\tstatus: FinalBackfillStatus;\n\treason_code: string;\n\treason_subcode: string | null;\n\trequest_id: LowercaseUuid | null;\n\tidempotency_key: Sha256Hex | null;\n\ttarget: { environment: string; cluster: string } | null;\n\tselection: ArchiveSelectionWire | null;\n\treceipt: PromotionReceiptWire | null;\n\tdiagnostics: Record<string, string | number | boolean>;\n};\n\ntype Codec<T> = {\n\tdecode(value: unknown): T;\n\tis(value: unknown): value is T;\n};\n\nexport class BackfillRequestValidationError extends Error {\n\tconstructor(\n\t\treadonly reasonSubcode: string,\n\t\tmessage: string,\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"BackfillRequestValidationError\";\n\t}\n}\n\nfunction describeAjvErrors(errors: ErrorObject[] | null | undefined): string {\n\treturn (errors ?? [])\n\t\t.map(\n\t\t\t(error) =>\n\t\t\t\t`${error.instancePath || \"/\"} ${error.message ?? \"is invalid\"}`,\n\t\t)\n\t\t.join(\"; \");\n}\n\nfunction codec<T>(\n\tvalidate: ValidateFunction,\n\tsemantic?: (document: T) => void,\n): Codec<T> {\n\treturn {\n\t\tdecode(value: unknown): T {\n\t\t\tif (!validate(value)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`JSON Schema validation failed: ${describeAjvErrors(validate.errors)}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tsemantic?.(value as T);\n\t\t\treturn value as T;\n\t\t},\n\t\tis(value: unknown): value is T {\n\t\t\tif (!validate(value)) return false;\n\t\t\ttry {\n\t\t\t\tsemantic?.(value as T);\n\t\t\t\treturn true;\n\t\t\t} catch {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t};\n}\n\nfunction fixedTimestampMs(value: string, field: string): number {\n\tconst parsed = Date.parse(value);\n\tif (\n\t\t!Number.isSafeInteger(parsed) ||\n\t\tnew Date(parsed).toISOString() !== value\n\t) {\n\t\tthrow new Error(`${field} is not a fixed UTC RFC3339 timestamp`);\n\t}\n\treturn parsed;\n}\n\nfunction assertIncreasingInterval(\n\tinterval: { start_at: string; end_at: string },\n\tfield: string,\n): void {\n\tif (\n\t\tfixedTimestampMs(interval.end_at, `${field}.end_at`) <=\n\t\tfixedTimestampMs(interval.start_at, `${field}.start_at`)\n\t) {\n\t\tthrow new Error(`${field} must be an increasing half-open interval`);\n\t}\n}\n\nconst ajv = new Ajv2020({ allErrors: true, strict: true });\najv.addSchema(archiveSelectionSchemaJson);\najv.addSchema(promotionReceiptSchemaJson);\nconst validateRequiredClock = ajv.compile(requiredClockSchemaJson);\nconst validateArchiveSelection = ajv.getSchema(ARCHIVE_SELECTION_SCHEMA_ID);\nconst validatePromotionReceipt = ajv.getSchema(PROMOTION_RECEIPT_SCHEMA_ID);\nconst validateBackfillRequest = ajv.compile(requestSchemaJson);\nif (!validateArchiveSelection || !validatePromotionReceipt) {\n\tthrow new Error(\"Backfill referenced schemas were not registered\");\n}\n\nexport const requiredClockCodec = codec<RequiredClockWire>(\n\tvalidateRequiredClock,\n\t(clock) => {\n\t\tassertDocumentSha256(clock, \"clock_sha256\");\n\t\tlet previous = -1;\n\t\tconst targetIds = new Set<string>();\n\t\tfor (const [index, target] of clock.targets.entries()) {\n\t\t\tconst at = fixedTimestampMs(\n\t\t\t\ttarget.target_at,\n\t\t\t\t`targets[${index}].target_at`,\n\t\t\t);\n\t\t\tif (at <= previous)\n\t\t\t\tthrow new Error(\"required clock targets must be strictly increasing\");\n\t\t\tif (targetIds.has(target.target_id))\n\t\t\t\tthrow new Error(\"required clock target IDs must be unique\");\n\t\t\ttargetIds.add(target.target_id);\n\t\t\tprevious = at;\n\t\t}\n\t},\n);\n\nexport const archiveSelectionCodec = codec<ArchiveSelectionWire>(\n\tvalidateArchiveSelection,\n\t(selection) => {\n\t\tassertDocumentSha256(selection, \"selection_sha256\");\n\t\tselection.requested_intervals.forEach((interval, index) => {\n\t\t\tassertIncreasingInterval(interval, `requested_intervals[${index}]`);\n\t\t});\n\t\tselection.selected_intervals.forEach((interval, index) => {\n\t\t\tassertIncreasingInterval(interval, `selected_intervals[${index}]`);\n\t\t});\n\t\tselection.bundles.forEach((bundle, index) => {\n\t\t\tassertIncreasingInterval(bundle.interval, `bundles[${index}].interval`);\n\t\t});\n\t\tif (\n\t\t\tselection.coverage_class === \"missing\" &&\n\t\t\tselection.selected_intervals.length !== 0\n\t\t) {\n\t\t\tthrow new Error(\"missing selection cannot contain selected intervals\");\n\t\t}\n\t},\n);\n\nfunction promotionSemanticFields(\n\treceipt: PromotionReceiptWire,\n): Record<string, unknown> {\n\treturn Object.fromEntries(\n\t\tObject.entries(receipt).filter(\n\t\t\t([key]) =>\n\t\t\t\tkey !== \"receipt_id\" &&\n\t\t\t\tkey !== \"promotion_identity_sha256\" &&\n\t\t\t\tkey !== \"verified_at\",\n\t\t),\n\t);\n}\n\nexport function promotionIdentitySha256(\n\treceipt: Omit<\n\t\tPromotionReceiptWire,\n\t\t\"receipt_id\" | \"promotion_identity_sha256\"\n\t> &\n\t\tPartial<\n\t\t\tPick<PromotionReceiptWire, \"receipt_id\" | \"promotion_identity_sha256\">\n\t\t>,\n): string {\n\treturn jcsSha256(promotionSemanticFields(receipt as PromotionReceiptWire));\n}\n\nexport const promotionReceiptCodec = codec<PromotionReceiptWire>(\n\tvalidatePromotionReceipt,\n\t(receipt) => {\n\t\tassertIncreasingInterval(receipt.window, \"window\");\n\t\tif (\n\t\t\tpromotionIdentitySha256(receipt) !== receipt.promotion_identity_sha256\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t\"promotion_identity_sha256 does not match semantic receipt content\",\n\t\t\t);\n\t\t}\n\t\tassertDocumentSha256(receipt, \"receipt_id\");\n\t},\n);\n\nfunction wireIdempotencyBusinessFields(\n\trequest: Omit<BackfillRequestWire, \"idempotency_key\"> & {\n\t\tidempotency_key?: string;\n\t},\n) {\n\treturn {\n\t\tscope: request.scope,\n\t\twindow: request.window,\n\t\tdepth: request.depth,\n\t\tconstruction_mode: request.construction_mode,\n\t\trequired_clock_sha256: request.required_clock.clock_sha256,\n\t\tcoverage_policy: request.coverage_policy,\n\t\tsource_policy: request.source_policy,\n\t\texpected_canonical_schema: request.expected_canonical_schema,\n\t\ttarget: request.target,\n\t};\n}\n\nexport const backfillRequestCodec = {\n\tdecode(value: unknown): { wire: BackfillRequestWire } {\n\t\tif (!validateBackfillRequest(value)) {\n\t\t\tthrow new Error(\n\t\t\t\t`JSON Schema validation failed: ${describeAjvErrors(validateBackfillRequest.errors)}`,\n\t\t\t);\n\t\t}\n\t\tconst request = value as BackfillRequestWire;\n\t\tarchiveSelectionCodec.decode(request.initial_selection);\n\t\tassertIncreasingInterval(request.window, \"window\");\n\t\tif (request.idempotency_key !== createBackfillIdempotencyKey(request)) {\n\t\t\tthrow new Error(\n\t\t\t\t\"idempotency_key does not match canonical business fields\",\n\t\t\t);\n\t\t}\n\t\tif (\n\t\t\trequest.product_pins.capability_policy.policy_id !==\n\t\t\t\tCAPABILITY_POLICY.policy_id ||\n\t\t\trequest.product_pins.capability_policy.policy_sha256 !==\n\t\t\t\tCAPABILITY_POLICY.policy_sha256 ||\n\t\t\trequest.product_pins.resource_policy.policy_id !==\n\t\t\t\tRESOURCE_POLICY.policy_id ||\n\t\t\trequest.product_pins.resource_policy.policy_sha256 !==\n\t\t\t\tRESOURCE_POLICY.policy_sha256\n\t\t) {\n\t\t\tthrow new BackfillRequestValidationError(\n\t\t\t\t\"current_policy_tuple_required\",\n\t\t\t\t\"request policy pins must match the exact capability-v3/resource-v2 tuple\",\n\t\t\t);\n\t\t}\n\t\tif (\n\t\t\trequest.required_clock.clock_id !==\n\t\t\t\trequest.initial_selection.required_clock.clock_id ||\n\t\t\trequest.required_clock.clock_sha256 !==\n\t\t\t\trequest.initial_selection.required_clock.clock_sha256 ||\n\t\t\trequest.required_clock.event_count !==\n\t\t\t\trequest.initial_selection.required_clock.event_count\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t\"initial selection required clock reference does not match request\",\n\t\t\t);\n\t\t}\n\t\tif (\n\t\t\tjcsSha256(request.scope) !== jcsSha256(request.initial_selection.scope)\n\t\t) {\n\t\t\tthrow new Error(\"initial selection scope does not match request\");\n\t\t}\n\t\tif (\n\t\t\tjcsSha256(request.coverage_policy) !==\n\t\t\tjcsSha256(request.initial_selection.coverage_policy)\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t\"initial selection coverage policy does not match request\",\n\t\t\t);\n\t\t}\n\t\tif (request.source_policy !== request.initial_selection.source_policy) {\n\t\t\tthrow new Error(\"initial selection source policy does not match request\");\n\t\t}\n\t\treturn { wire: request };\n\t},\n\tis(value: unknown): value is BackfillRequestWire {\n\t\ttry {\n\t\t\tthis.decode(value);\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t},\n};\n\nexport function finalizeRequiredClock(\n\tclock: Omit<RequiredClockWire, \"clock_sha256\">,\n): RequiredClockWire {\n\treturn requiredClockCodec.decode({\n\t\t...clock,\n\t\tclock_sha256: documentSha256(clock, \"clock_sha256\"),\n\t});\n}\n\nexport function finalizeArchiveSelection(\n\tselection: Omit<ArchiveSelectionWire, \"selection_sha256\">,\n): ArchiveSelectionWire {\n\treturn archiveSelectionCodec.decode({\n\t\t...selection,\n\t\tselection_sha256: documentSha256(selection, \"selection_sha256\"),\n\t});\n}\n\nexport const BACKFILL_REQUEST_SCHEMA_VERSION =\n\t\"market-data-vendor-backfill-request/v1\" as const;\nexport const BACKFILL_PROMOTION_SCHEMA_VERSION =\n\t\"market-data-vendor-backfill-promotion-receipt/v1\" as const;\nexport const EXTERNAL_BACKFILL_SOURCE = \"external_backfill\" as const;\nexport const HISTORICAL_VENDOR_SOURCE_MODE =\n\t\"vendor_historical_backfill_v1\" as const;\nexport const VENDOR_DATASET_RAW_CAPTURE_SCOPE =\n\t\"vendor_normalized_dataset_file\" as const;\n\nconst nonEmpty = z.string().trim().min(1);\nconst sha256 = z.string().regex(/^[a-f0-9]{64}$/);\nconst timestampMs = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);\n\nexport const backfillRequestSchema = z\n\t.object({\n\t\tschemaVersion: z.literal(BACKFILL_REQUEST_SCHEMA_VERSION),\n\t\trequestId: nonEmpty,\n\t\tidempotencyKey: sha256,\n\t\tproviderPolicy: z\n\t\t\t.object({\n\t\t\t\tprovider: z.literal(\"cryptohftdata\"),\n\t\t\t\tallowedAdapterVersions: z.array(nonEmpty).min(1).max(16),\n\t\t\t})\n\t\t\t.strict(),\n\t\tscope: z\n\t\t\t.object({\n\t\t\t\texchange: nonEmpty,\n\t\t\t\ttradingPair: nonEmpty,\n\t\t\t\tsourceSymbol: nonEmpty,\n\t\t\t\tmarketType: z.enum([\"spot\", \"swap\", \"future\"]),\n\t\t\t\tfeed: z.literal(\"ORDERBOOK\"),\n\t\t\t})\n\t\t\t.strict(),\n\t\twindow: z\n\t\t\t.object({ startTimeMs: timestampMs, endTimeMs: timestampMs })\n\t\t\t.strict()\n\t\t\t.refine(({ startTimeMs, endTimeMs }) => endTimeMs > startTimeMs, {\n\t\t\t\tmessage: \"endTimeMs must be greater than startTimeMs\",\n\t\t\t}),\n\t\tdepth: z.number().int().min(1).max(500),\n\t\tconstructionMode: z.enum([\n\t\t\t\"sampled_top_n_snapshot\",\n\t\t\t\"exact_l2_reconstruction\",\n\t\t]),\n\t\trequiredClockTargetsMs: z.array(timestampMs).min(1).max(100_000),\n\t\tmaxPriorAsOfLagMs: z.number().int().nonnegative().max(86_400_000),\n\t\tsourcePolicy: z.enum([\"authoritative_window\", \"fill_gaps\"]),\n\t\tbudgets: z\n\t\t\t.object({\n\t\t\t\tmaxFiles: z.number().int().min(1).max(10_000),\n\t\t\t\tmaxBytes: z\n\t\t\t\t\t.number()\n\t\t\t\t\t.int()\n\t\t\t\t\t.min(1)\n\t\t\t\t\t.max(100 * 1024 * 1024 * 1024),\n\t\t\t\tmaxRows: z.number().int().min(1).max(1_000_000_000),\n\t\t\t\tmaxDurationMs: z\n\t\t\t\t\t.number()\n\t\t\t\t\t.int()\n\t\t\t\t\t.min(1)\n\t\t\t\t\t.max(24 * 60 * 60 * 1_000),\n\t\t\t\tmaxBoundaryLookbackMs: z\n\t\t\t\t\t.number()\n\t\t\t\t\t.int()\n\t\t\t\t\t.nonnegative()\n\t\t\t\t\t.max(7 * 24 * 60 * 60 * 1_000),\n\t\t\t})\n\t\t\t.strict(),\n\t\texpectedProduct: z\n\t\t\t.object({\n\t\t\t\tpackageName: z.literal(\"@usherlabs/cex-broker\"),\n\t\t\t\tpackageVersion: nonEmpty.optional(),\n\t\t\t\tcanonicalSchemaVersion: nonEmpty,\n\t\t\t\tchecksumAlgorithm: z.literal(\"sha256-canonical-json-v1\"),\n\t\t\t})\n\t\t\t.strict(),\n\t})\n\t.strict()\n\t.superRefine((request, context) => {\n\t\tconst targets = request.requiredClockTargetsMs;\n\t\tfor (let index = 0; index < targets.length; index += 1) {\n\t\t\tconst target = targets[index] as number;\n\t\t\tif (\n\t\t\t\ttarget < request.window.startTimeMs ||\n\t\t\t\ttarget >= request.window.endTimeMs\n\t\t\t) {\n\t\t\t\tcontext.addIssue({\n\t\t\t\t\tcode: \"custom\",\n\t\t\t\t\tpath: [\"requiredClockTargetsMs\", index],\n\t\t\t\t\tmessage: \"clock target must be inside the half-open request window\",\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (index > 0 && target <= (targets[index - 1] as number)) {\n\t\t\t\tcontext.addIssue({\n\t\t\t\t\tcode: \"custom\",\n\t\t\t\t\tpath: [\"requiredClockTargetsMs\", index],\n\t\t\t\t\tmessage: \"clock targets must be strictly increasing\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\n\ntype ProvisionalBackfillDomainRequest = z.infer<typeof backfillRequestSchema>;\n\nexport type MarketDataVendorBackfillRequest = Omit<\n\tProvisionalBackfillDomainRequest,\n\t\"constructionMode\"\n> & {\n\tconstructionMode:\n\t\t| ProvisionalBackfillDomainRequest[\"constructionMode\"]\n\t\t| \"policy_neutral_top_n_state_change_tape/v1\";\n\tattemptId?: string;\n\ttarget?: { environment: string; cluster: string };\n\tcoveragePolicy?: CoveragePolicyWire;\n\trequiredClock?: RequiredClockWire;\n\tinitialSelection?: ArchiveSelectionWire;\n\texpectedCanonicalSchema?: BackfillRequestWire[\"expected_canonical_schema\"];\n\tproductPins?: BackfillRequestWire[\"product_pins\"];\n\tproductionAuthorizationId?: string;\n\twire?: BackfillRequestWire;\n};\n\nexport function decodeBackfillRunDocuments(input: {\n\trequest: unknown;\n\trequiredClock: unknown;\n}): MarketDataVendorBackfillRequest {\n\tconst { wire } = backfillRequestCodec.decode(input.request);\n\tconst requiredClock = requiredClockCodec.decode(input.requiredClock);\n\tif (\n\t\trequiredClock.clock_id !== wire.required_clock.clock_id ||\n\t\trequiredClock.clock_sha256 !== wire.required_clock.clock_sha256 ||\n\t\trequiredClock.targets.length !== wire.required_clock.event_count\n\t) {\n\t\tthrow new Error(\"required clock sidecar does not match request reference\");\n\t}\n\tconst startTimeMs = fixedTimestampMs(wire.window.start_at, \"window.start_at\");\n\tconst endTimeMs = fixedTimestampMs(wire.window.end_at, \"window.end_at\");\n\tconst requiredClockTargetsMs = requiredClock.targets.map((target, index) => {\n\t\tconst targetTimeMs = fixedTimestampMs(\n\t\t\ttarget.target_at,\n\t\t\t`required_clock.targets[${index}].target_at`,\n\t\t);\n\t\tif (targetTimeMs < startTimeMs || targetTimeMs >= endTimeMs) {\n\t\t\tthrow new Error(\"required clock target is outside request window\");\n\t\t}\n\t\treturn targetTimeMs;\n\t});\n\tconst capabilityProfile = CAPABILITY_POLICY.profiles.find(\n\t\t(profile) =>\n\t\t\tprofile.exchange === wire.scope.exchange &&\n\t\t\tprofile.market_type === wire.scope.market_type &&\n\t\t\tprofile.feed === wire.scope.feed &&\n\t\t\tprofile.canonical_trading_pair === wire.scope.trading_pair,\n\t);\n\treturn {\n\t\tschemaVersion: BACKFILL_REQUEST_SCHEMA_VERSION,\n\t\trequestId: wire.request_id,\n\t\tidempotencyKey: wire.idempotency_key,\n\t\tproviderPolicy: {\n\t\t\tprovider: \"cryptohftdata\",\n\t\t\tallowedAdapterVersions: [\n\t\t\t\tCAPABILITY_POLICY.adapter_policy.adapter_version,\n\t\t\t],\n\t\t},\n\t\tscope: {\n\t\t\texchange: wire.scope.exchange,\n\t\t\ttradingPair: wire.scope.trading_pair,\n\t\t\tsourceSymbol:\n\t\t\t\tcapabilityProfile?.resolved_symbol ?? wire.scope.trading_pair,\n\t\t\tmarketType: wire.scope.market_type,\n\t\t\tfeed: wire.scope.feed,\n\t\t},\n\t\twindow: { startTimeMs, endTimeMs },\n\t\tdepth: wire.depth,\n\t\tconstructionMode: wire.construction_mode,\n\t\trequiredClockTargetsMs,\n\t\tmaxPriorAsOfLagMs: wire.coverage_policy.max_asof_lag_ms,\n\t\tsourcePolicy: wire.source_policy,\n\t\tbudgets: {\n\t\t\tmaxFiles: RESOURCE_POLICY.limits.max_files,\n\t\t\tmaxBytes: RESOURCE_POLICY.limits.max_bytes,\n\t\t\tmaxRows: RESOURCE_POLICY.limits.max_rows,\n\t\t\tmaxDurationMs: RESOURCE_POLICY.limits.max_duration_ms,\n\t\t\tmaxBoundaryLookbackMs: Math.min(\n\t\t\t\tRESOURCE_POLICY.limits.max_boundary_lookback_ms,\n\t\t\t\tCAPABILITY_POLICY.acquisition_policy.initialization_lookback_ms,\n\t\t\t),\n\t\t},\n\t\texpectedProduct: {\n\t\t\tpackageName: \"@usherlabs/cex-broker\",\n\t\t\tcanonicalSchemaVersion: \"1.0.0\",\n\t\t\tchecksumAlgorithm: \"sha256-canonical-json-v1\",\n\t\t},\n\t\tattemptId: wire.attempt_id,\n\t\ttarget: wire.target,\n\t\tcoveragePolicy: wire.coverage_policy,\n\t\trequiredClock,\n\t\tinitialSelection: wire.initial_selection,\n\t\texpectedCanonicalSchema: wire.expected_canonical_schema,\n\t\tproductPins: wire.product_pins,\n\t\tproductionAuthorizationId: wire.production_authorization_id,\n\t\twire,\n\t};\n}\n\ntype IdempotencyBusinessFields = Omit<\n\tMarketDataVendorBackfillRequest,\n\t\"requestId\" | \"idempotencyKey\"\n>;\n\nexport function backfillBusinessFields(\n\trequest: Omit<MarketDataVendorBackfillRequest, \"idempotencyKey\"> & {\n\t\tidempotencyKey?: string;\n\t},\n): IdempotencyBusinessFields {\n\tconst {\n\t\trequestId: _requestId,\n\t\tidempotencyKey: _idempotencyKey,\n\t\t...business\n\t} = request;\n\treturn business;\n}\n\nexport function createBackfillIdempotencyKey(\n\trequest: Omit<MarketDataVendorBackfillRequest, \"idempotencyKey\"> & {\n\t\tidempotencyKey?: string;\n\t},\n): string;\nexport function createBackfillIdempotencyKey(\n\trequest: Omit<BackfillRequestWire, \"idempotency_key\"> & {\n\t\tidempotency_key?: string;\n\t},\n): string;\nexport function createBackfillIdempotencyKey(\n\trequest: Record<string, unknown>,\n): string;\nexport function createBackfillIdempotencyKey(request: unknown): string {\n\tif (!request || typeof request !== \"object\") {\n\t\tthrow new TypeError(\"backfill request must be an object\");\n\t}\n\tif (\"schema_id\" in request) {\n\t\treturn jcsSha256(\n\t\t\twireIdempotencyBusinessFields(\n\t\t\t\trequest as Omit<BackfillRequestWire, \"idempotency_key\"> & {\n\t\t\t\t\tidempotency_key?: string;\n\t\t\t\t},\n\t\t\t),\n\t\t);\n\t}\n\treturn sha256Canonical(\n\t\tbackfillBusinessFields(\n\t\t\trequest as Omit<MarketDataVendorBackfillRequest, \"idempotencyKey\"> & {\n\t\t\t\tidempotencyKey?: string;\n\t\t\t},\n\t\t),\n\t);\n}\n\nexport function parseBackfillRequest(\n\tvalue: unknown,\n): MarketDataVendorBackfillRequest {\n\tconst request = backfillRequestSchema.parse(value);\n\tif (createBackfillIdempotencyKey(request) !== request.idempotencyKey) {\n\t\tthrow new Error(\"idempotencyKey does not match canonical business fields\");\n\t}\n\treturn request;\n}\n\nexport const BACKFILL_STATUSES = [\n\t\"already_covered\",\n\t\"promoted\",\n\t\"capability_unsupported\",\n\t\"credentials_missing\",\n\t\"vendor_fetch_failed\",\n\t\"archive_ingest_failed\",\n\t\"promotion_verification_failed\",\n\t\"post_backfill_coverage_insufficient\",\n] as const;\n\nexport type BackfillStatus = (typeof BACKFILL_STATUSES)[number];\n\nexport type ProviderCapability = {\n\tprovider: \"cryptohftdata\";\n\tadapterVersion: string;\n\tproviderExchangeId: string;\n\tresolvedSymbol: string;\n};\n\nexport type ProviderObjectEvidence = {\n\tidentity: string;\n\tchecksum: string;\n\tbytes: number;\n\trows: number;\n};\n\nconst providerObjectEvidenceSchema = z\n\t.object({\n\t\tidentity: nonEmpty,\n\t\tchecksum: sha256,\n\t\tbytes: z.number().int().nonnegative(),\n\t\trows: z.number().int().nonnegative(),\n\t})\n\t.strict();\n\nexport type BackfillArchiveRow = {\n\ttable:\n\t\t| \"market_data.cex_order_book_levels\"\n\t\t| \"market_data.cex_order_book_depth_summary\"\n\t\t| \"market_data.cex_order_book_capture_promotions\"\n\t\t| \"market_data.cex_order_book_capture_qualifications\"\n\t\t| \"market_data.cex_order_book_archive_selections\";\n\trow: Record<string, unknown>;\n};\n\nexport type ForwarderBatch = {\n\tsource: typeof EXTERNAL_BACKFILL_SOURCE;\n\tdeployment_id: string;\n\tbatch_id: string;\n\trows: BackfillArchiveRow[];\n};\n\nexport type PromotionReceipt = {\n\tschemaVersion: typeof BACKFILL_PROMOTION_SCHEMA_VERSION;\n\treceiptId: string;\n\trequestId: string;\n\tidempotencyKey: string;\n\tstatus: \"passing\";\n\tsource: typeof EXTERNAL_BACKFILL_SOURCE;\n\tprovider: \"cryptohftdata\";\n\tadapterVersion: string;\n\tcaptureBundleId: string;\n\texchange: string;\n\ttradingPair: string;\n\tmarketType: \"spot\" | \"swap\" | \"future\";\n\tfeed: \"ORDERBOOK\";\n\tstartTimeMs: number;\n\tendTimeMs: number;\n\tdepth: number;\n\tconstructionMode:\n\t\t| \"sampled_top_n_snapshot\"\n\t\t| \"exact_l2_reconstruction\"\n\t\t| \"policy_neutral_top_n_state_change_tape/v1\";\n\tcanonicalSchemaVersion: string;\n\tchecksumAlgorithm: \"sha256-canonical-json-v1\";\n\tvendorSemanticDigest: string;\n\tcanonicalSemanticDigest: string;\n\tprefixDigest: string;\n\tsuffixDigest: string;\n\tseamVerified: true;\n\tcoverageVerified: true;\n\tdatasetObjects: ProviderObjectEvidence[];\n\tverificationTimeMs: number;\n};\n\nexport const promotionReceiptSchema: z.ZodType<PromotionReceipt> = z\n\t.object({\n\t\tschemaVersion: z.literal(BACKFILL_PROMOTION_SCHEMA_VERSION),\n\t\treceiptId: sha256,\n\t\trequestId: nonEmpty,\n\t\tidempotencyKey: sha256,\n\t\tstatus: z.literal(\"passing\"),\n\t\tsource: z.literal(EXTERNAL_BACKFILL_SOURCE),\n\t\tprovider: z.literal(\"cryptohftdata\"),\n\t\tadapterVersion: nonEmpty,\n\t\tcaptureBundleId: sha256,\n\t\texchange: nonEmpty,\n\t\ttradingPair: nonEmpty,\n\t\tmarketType: z.enum([\"spot\", \"swap\", \"future\"]),\n\t\tfeed: z.literal(\"ORDERBOOK\"),\n\t\tstartTimeMs: timestampMs,\n\t\tendTimeMs: timestampMs,\n\t\tdepth: z.number().int().min(1).max(500),\n\t\tconstructionMode: z.enum([\n\t\t\t\"sampled_top_n_snapshot\",\n\t\t\t\"exact_l2_reconstruction\",\n\t\t\t\"policy_neutral_top_n_state_change_tape/v1\",\n\t\t]),\n\t\tcanonicalSchemaVersion: nonEmpty,\n\t\tchecksumAlgorithm: z.literal(\"sha256-canonical-json-v1\"),\n\t\tvendorSemanticDigest: sha256,\n\t\tcanonicalSemanticDigest: sha256,\n\t\tprefixDigest: sha256,\n\t\tsuffixDigest: sha256,\n\t\tseamVerified: z.literal(true),\n\t\tcoverageVerified: z.literal(true),\n\t\tdatasetObjects: z.array(providerObjectEvidenceSchema).min(1).max(10_000),\n\t\tverificationTimeMs: timestampMs,\n\t})\n\t.strict()\n\t.refine(({ endTimeMs, startTimeMs }) => endTimeMs > startTimeMs, {\n\t\tmessage: \"promotion window must be increasing\",\n\t});\n",
|
|
132
|
-
"import { createHash } from \"node:crypto\";\nimport { redactStreamPayload } from \"../broker-execution-archive/redact\";\nimport type {\n\tMarketCaptureContext,\n\tRawCapture,\n\tRawCaptureScope,\n} from \"./types\";\n\nexport const MARKET_CAPTURE_SCHEMA_VERSION = \"1.0.0\" as const;\nexport const CHECKSUM_ALGORITHM = \"sha256-canonical-json-v1\" as const;\n\nexport const ARCHIVE_SOURCES = [\"broker_read\", \"broker_write\"] as const;\nexport const MARKET_ARCHIVE_SOURCES = [\n\t...ARCHIVE_SOURCES,\n\t\"external_backfill\",\n] as const;\nexport const CAPTURE_FEEDS = [\n\t\"ORDERBOOK\",\n\t\"TICKER\",\n\t\"TRADES\",\n\t\"OHLCV\",\n] as const;\nexport const SOURCE_MODES = [\n\t\"broker_live_stream_v1\",\n\t\"broker_live_sampling_v1\",\n\t\"broker_current_snapshot_v1\",\n\t\"broker_bootstrap_fetch_v1\",\n\t\"external_ccxt_fallback_v1\",\n\t\"external_hummingbot_fallback_v1\",\n\t\"legacy_migration_v1\",\n\t\"historical_vendor_orderbook_v1\",\n\t\"vendor_historical_backfill_v1\",\n] as const;\nexport const CONSTRUCTION_MODES = [\n\t\"sampled_top_n_snapshot\",\n\t\"exact_l2_reconstruction\",\n] as const;\nexport const GAP_POLICIES = [\n\t\"record_gap\",\n\t\"ohlcv_catch_up\",\n\t\"fail_fast\",\n] as const;\nexport const RAW_CAPTURE_SCOPES = [\n\t\"ccxt_normalized_object\",\n\t\"broker_visible_payload\",\n\t\"exchange_wire_frame\",\n\t\"vendor_normalized_dataset_file\",\n] as const;\n\nexport type CaptureFeed = (typeof CAPTURE_FEEDS)[number];\nexport type SourceMode = (typeof SOURCE_MODES)[number];\nexport type ConstructionMode = (typeof CONSTRUCTION_MODES)[number];\nexport type GapPolicy = (typeof GAP_POLICIES)[number];\n\nconst CHECKSUM_FIELDS = new Set([\n\t\"normalized_row_checksum\",\n\t\"raw_checksum\",\n\t\"checksum\",\n]);\n\n/**\n * Renders a finite JavaScript number as a plain decimal. Exponent expansion and\n * negative-zero normalization are part of checksum algorithm v1 and are mirrored\n * by the Python fixture verifier.\n */\nexport function canonicalDecimal(value: number): string {\n\tif (!Number.isFinite(value)) {\n\t\tthrow new Error(\"Canonical numbers must be finite\");\n\t}\n\tif (Object.is(value, -0)) {\n\t\treturn \"0\";\n\t}\n\tconst rendered = String(value).toLowerCase();\n\tif (!rendered.includes(\"e\")) {\n\t\treturn rendered;\n\t}\n\tconst [coefficient = \"0\", exponentText = \"0\"] = rendered.split(\"e\");\n\tconst exponent = Number.parseInt(exponentText, 10);\n\tconst negative = coefficient.startsWith(\"-\");\n\tconst unsigned = negative ? coefficient.slice(1) : coefficient;\n\tconst [integer = \"0\", fraction = \"\"] = unsigned.split(\".\");\n\tconst digits = `${integer}${fraction}`;\n\tconst decimalIndex = integer.length + exponent;\n\tlet result: string;\n\tif (decimalIndex <= 0) {\n\t\tresult = `0.${\"0\".repeat(-decimalIndex)}${digits}`;\n\t} else if (decimalIndex >= digits.length) {\n\t\tresult = `${digits}${\"0\".repeat(decimalIndex - digits.length)}`;\n\t} else {\n\t\tresult = `${digits.slice(0, decimalIndex)}.${digits.slice(decimalIndex)}`;\n\t}\n\treturn negative ? `-${result}` : result;\n}\n\ntype CanonicalSink = (chunk: string) => void;\n\nfunction writeCanonical(\n\tvalue: unknown,\n\tstack: Set<object>,\n\tsink: CanonicalSink,\n\tomitChecksums: boolean,\n): void {\n\tif (value === null) {\n\t\tsink(\"null\");\n\t\treturn;\n\t}\n\tif (typeof value === \"string\") {\n\t\tsink(JSON.stringify(value));\n\t\treturn;\n\t}\n\tif (typeof value === \"boolean\") {\n\t\tsink(value ? \"true\" : \"false\");\n\t\treturn;\n\t}\n\tif (typeof value === \"number\") {\n\t\tsink(canonicalDecimal(value));\n\t\treturn;\n\t}\n\tif (typeof value === \"bigint\") {\n\t\tsink(value.toString(10));\n\t\treturn;\n\t}\n\tif (value instanceof Date) {\n\t\tif (Number.isNaN(value.getTime())) {\n\t\t\tthrow new Error(\"Canonical timestamps must be valid\");\n\t\t}\n\t\tsink(value.getTime().toString(10));\n\t\treturn;\n\t}\n\tif (Array.isArray(value)) {\n\t\tif (stack.has(value)) throw new Error(\"Canonical values must be acyclic\");\n\t\tstack.add(value);\n\t\tsink(\"[\");\n\t\tfor (let index = 0; index < value.length; index += 1) {\n\t\t\tif (index > 0) sink(\",\");\n\t\t\tconst entry = value[index];\n\t\t\tif (entry === undefined) sink(\"null\");\n\t\t\telse writeCanonical(entry, stack, sink, omitChecksums);\n\t\t}\n\t\tsink(\"]\");\n\t\tstack.delete(value);\n\t\treturn;\n\t}\n\tif (typeof value === \"object\") {\n\t\tif (stack.has(value)) throw new Error(\"Canonical values must be acyclic\");\n\t\tstack.add(value);\n\t\tconst entries = Object.entries(value as Record<string, unknown>)\n\t\t\t.filter(\n\t\t\t\t([key, entry]) =>\n\t\t\t\t\tentry !== undefined && (!omitChecksums || !CHECKSUM_FIELDS.has(key)),\n\t\t\t)\n\t\t\t.sort(([left], [right]) => left.localeCompare(right));\n\t\tsink(\"{\");\n\t\tfor (let index = 0; index < entries.length; index += 1) {\n\t\t\tif (index > 0) sink(\",\");\n\t\t\tconst [key, entry] = entries[index] as [string, unknown];\n\t\t\tsink(JSON.stringify(key));\n\t\t\tsink(\":\");\n\t\t\twriteCanonical(entry, stack, sink, omitChecksums);\n\t\t}\n\t\tsink(\"}\");\n\t\tstack.delete(value);\n\t\treturn;\n\t}\n\tthrow new Error(`Unsupported canonical value type: ${typeof value}`);\n}\n\nexport function canonicalSerialize(value: unknown): string {\n\tconst chunks: string[] = [];\n\twriteCanonical(value, new Set(), (chunk) => chunks.push(chunk), false);\n\treturn chunks.join(\"\");\n}\n\nexport function sha256Canonical(value: unknown): string {\n\tconst hash = createHash(\"sha256\");\n\tlet pending = \"\";\n\twriteCanonical(\n\t\tvalue,\n\t\tnew Set(),\n\t\t(chunk) => {\n\t\t\tpending += chunk;\n\t\t\tif (pending.length >= 64 * 1024) {\n\t\t\t\thash.update(pending);\n\t\t\t\tpending = \"\";\n\t\t\t}\n\t\t},\n\t\ttrue,\n\t);\n\tif (pending) hash.update(pending);\n\treturn hash.digest(\"hex\");\n}\n\nexport function normalizeTimestampMs(value: unknown, field: string): number {\n\tlet timestamp: number;\n\tif (value instanceof Date) {\n\t\ttimestamp = value.getTime();\n\t} else if (typeof value === \"number\") {\n\t\ttimestamp = value;\n\t} else if (typeof value === \"string\" && /^\\d+$/.test(value.trim())) {\n\t\ttimestamp = Number(value.trim());\n\t} else if (typeof value === \"string\") {\n\t\ttimestamp = Date.parse(value);\n\t} else {\n\t\ttimestamp = Number.NaN;\n\t}\n\tif (!Number.isSafeInteger(timestamp) || timestamp < 0) {\n\t\tthrow new Error(`${field} must be a non-negative millisecond timestamp`);\n\t}\n\treturn timestamp;\n}\n\nfunction assertCaptureContext(context: MarketCaptureContext): void {\n\tif (!(MARKET_ARCHIVE_SOURCES as readonly string[]).includes(context.source)) {\n\t\tthrow new Error(`Unsupported archive source: ${context.source}`);\n\t}\n\tif (!(CAPTURE_FEEDS as readonly string[]).includes(context.feed)) {\n\t\tthrow new Error(`Unsupported capture feed: ${context.feed}`);\n\t}\n\tif (!(SOURCE_MODES as readonly string[]).includes(context.sourceMode)) {\n\t\tthrow new Error(`Unsupported source mode: ${context.sourceMode}`);\n\t}\n\tfor (const [field, value] of [\n\t\t[\"deployment_id\", context.deploymentId],\n\t\t[\"capture_bundle_id\", context.captureBundleId],\n\t\t[\"exchange\", context.exchange],\n\t\t[\"symbol\", context.symbol],\n\t\t[\"provider\", context.provider],\n\t] as const) {\n\t\tif (!value.trim()) throw new Error(`${field} must not be empty`);\n\t}\n}\n\nexport function createRawCapture(\n\tcontext: MarketCaptureContext,\n\tinput: {\n\t\tpayload: unknown;\n\t\teventTimeMs: unknown;\n\t\treceivedTimeMs: unknown;\n\t\tscope: RawCaptureScope;\n\t},\n): RawCapture {\n\tassertCaptureContext(context);\n\tif (!(RAW_CAPTURE_SCOPES as readonly string[]).includes(input.scope)) {\n\t\tthrow new Error(`Unsupported raw capture scope: ${input.scope}`);\n\t}\n\tconst eventTimeMs = normalizeTimestampMs(input.eventTimeMs, \"event_time_ms\");\n\tconst receivedTimeMs = normalizeTimestampMs(\n\t\tinput.receivedTimeMs,\n\t\t\"received_time_ms\",\n\t);\n\tconst redactedPayload = redactStreamPayload(input.payload);\n\tconst rawChecksum = sha256Canonical(redactedPayload);\n\tconst rawCaptureId = sha256Canonical({\n\t\tcapture_bundle_id: context.captureBundleId,\n\t\texchange: context.exchange.trim().toLowerCase(),\n\t\tfeed: context.feed,\n\t\traw_capture_scope: input.scope,\n\t\traw_payload_sha256: rawChecksum,\n\t\tschema_version: context.schemaVersion,\n\t\tsource_mode: context.sourceMode,\n\t\tsource_symbol: context.symbol.trim(),\n\t\tsource_time_ms: eventTimeMs,\n\t});\n\treturn {\n\t\trawCaptureId,\n\t\trawCaptureScope: input.scope,\n\t\trawChecksum,\n\t\tredactedPayload,\n\t\teventTimeMs,\n\t\treceivedTimeMs,\n\t\tchecksumAlgorithm: context.checksumAlgorithm,\n\t};\n}\n\nexport function captureCoreFields(\n\tcontext: MarketCaptureContext,\n\trawCapture: RawCapture,\n): Record<string, unknown> {\n\tassertCaptureContext(context);\n\treturn {\n\t\tsource: context.source,\n\t\tdeployment_id: context.deploymentId,\n\t\tcapture_bundle_id: context.captureBundleId,\n\t\texchange: context.exchange.trim().toLowerCase(),\n\t\tsymbol: context.symbol.trim(),\n\t\ttrading_pair:\n\t\t\tcontext.tradingPair?.trim() || context.symbol.trim().replace(\"/\", \"-\"),\n\t\tsource_symbol: context.sourceSymbol?.trim() || context.symbol.trim(),\n\t\tasset_type: context.assetType,\n\t\tfeed: context.feed,\n\t\tprovider: context.provider,\n\t\tsource_mode: context.sourceMode,\n\t\tsource_time_ms: rawCapture.eventTimeMs,\n\t\treceived_time_ms: rawCapture.receivedTimeMs,\n\t\traw_capture_id: rawCapture.rawCaptureId,\n\t\traw_capture_scope: rawCapture.rawCaptureScope,\n\t\tschema_version: context.schemaVersion,\n\t\tchecksum_algorithm: context.checksumAlgorithm,\n\t\traw_checksum: rawCapture.rawChecksum,\n\t\tprovenance_complete: context.provenanceComplete ? 1 : 0,\n\t};\n}\n",
|
|
133
|
-
"import { context, isSpanContextValid, trace } from \"@opentelemetry/api\";\n\n//#region src/index.ts\nfunction openTelemetryPlugin(config = {}) {\n\tconst traceIdField = config.traceIdFieldName || \"trace_id\";\n\tconst spanIdField = config.spanIdFieldName || \"span_id\";\n\tconst traceFlagsField = config.traceFlagsFieldName || \"trace_flags\";\n\tconst addTraceContext = (data) => {\n\t\tconst span = trace.getSpan(context.active());\n\t\tif (span) {\n\t\t\tconst spanContext = span.spanContext();\n\t\t\tif (isSpanContextValid(spanContext)) {\n\t\t\t\tconst fields = {\n\t\t\t\t\t[traceIdField]: spanContext.traceId,\n\t\t\t\t\t[spanIdField]: spanContext.spanId,\n\t\t\t\t\t[traceFlagsField]: `0${spanContext.traceFlags.toString(16)}`\n\t\t\t\t};\n\t\t\t\tif (config.traceFieldName) {\n\t\t\t\t\tconst traceData = { [config.traceFieldName]: fields };\n\t\t\t\t\tif (data) return {\n\t\t\t\t\t\t...data,\n\t\t\t\t\t\t...traceData\n\t\t\t\t\t};\n\t\t\t\t\treturn traceData;\n\t\t\t\t}\n\t\t\t\tif (data) return {\n\t\t\t\t\t...data,\n\t\t\t\t\t...fields\n\t\t\t\t};\n\t\t\t\treturn fields;\n\t\t\t}\n\t\t}\n\t\treturn data || {};\n\t};\n\treturn {\n\t\tid: config.id,\n\t\tdisabled: config.disabled,\n\t\tonBeforeDataOut: ({ data }) => addTraceContext(data)\n\t};\n}\n\n//#endregion\nexport { openTelemetryPlugin };\n//# sourceMappingURL=index.mjs.map",
|
|
134
|
-
"//#region src/common.types.ts\nlet LogLevel = /* @__PURE__ */ function(LogLevel) {\n\tLogLevel[\"info\"] = \"info\";\n\tLogLevel[\"warn\"] = \"warn\";\n\tLogLevel[\"error\"] = \"error\";\n\tLogLevel[\"debug\"] = \"debug\";\n\tLogLevel[\"trace\"] = \"trace\";\n\tLogLevel[\"fatal\"] = \"fatal\";\n\treturn LogLevel;\n}({});\n/**\n* Mapping of log levels to their numeric values.\n*/\nconst LogLevelPriority = {\n\t[LogLevel.trace]: 10,\n\t[LogLevel.debug]: 20,\n\t[LogLevel.info]: 30,\n\t[LogLevel.warn]: 40,\n\t[LogLevel.error]: 50,\n\t[LogLevel.fatal]: 60\n};\n/**\n* Mapping of numeric values to their log level names.\n*/\nconst LogLevelPriorityToNames = {\n\t10: LogLevel.trace,\n\t20: LogLevel.debug,\n\t30: LogLevel.info,\n\t40: LogLevel.warn,\n\t50: LogLevel.error,\n\t60: LogLevel.fatal\n};\n\n//#endregion\n//#region src/lazy.ts\n/**\n* Symbol used to identify lazy values in context and metadata.\n* Can be used to check if a value is a lazy wrapper: `LAZY_SYMBOL in value`.\n*\n* @see {@link https://loglayer.dev/logging-api/lazy-evaluation | Lazy Evaluation Docs}\n*/\nconst LAZY_SYMBOL = Symbol.for(\"loglayer.lazy\");\n/**\n* String constant used as a replacement value when a lazy callback fails during evaluation.\n* Exported so users can programmatically detect lazy evaluation failures in their log output.\n*\n* @see {@link https://loglayer.dev/logging-api/lazy-evaluation#error-handling | Lazy Evaluation Error Handling Docs}\n*/\nconst LAZY_EVAL_ERROR = \"[LazyEvalError]\";\n/**\n* Wraps a callback function to defer its evaluation until log time.\n*\n* The callback will only be invoked if the log level is enabled,\n* avoiding unnecessary computation for disabled log levels.\n*\n* Can be used in both `withContext()` and `withMetadata()` at the root level.\n*\n* When the callback returns a `Promise` (i.e., is an async function), the\n* log method will return `Promise<void>` so TypeScript can track that the\n* operation is asynchronous.\n*\n* Adapted from [LogTape's lazy evaluation](https://logtape.org/manual/lazy).\n*\n* @example\n* ```typescript\n* import { LogLayer, lazy } from \"loglayer\";\n*\n* const log = new LogLayer({ ... });\n*\n* // Dynamic context - evaluated on each log call\n* log.withContext({\n* memoryUsage: lazy(() => process.memoryUsage().heapUsed),\n* });\n*\n* // Dynamic metadata - evaluated only if debug is enabled\n* log.withMetadata({\n* data: lazy(() => JSON.stringify(largeObject)),\n* }).debug(\"Processing complete\");\n* ```\n*\n* @see {@link https://loglayer.dev/logging-api/lazy-evaluation | Lazy Evaluation Docs}\n*/\nfunction lazy(fn) {\n\treturn { [LAZY_SYMBOL]: fn };\n}\n/**\n* Checks if a value is a lazy value created by {@link lazy}.\n* @internal\n*/\nfunction isLazy(value) {\n\treturn value != null && typeof value === \"object\" && LAZY_SYMBOL in value;\n}\n/**\n* Counts the number of lazy values in a record.\n* @internal\n*/\nfunction countLazyValues(obj) {\n\tlet count = 0;\n\tfor (const key of Object.keys(obj)) if (isLazy(obj[key])) count++;\n\treturn count;\n}\n/**\n* Resolves any lazy values in a record at the root level.\n* Returns the original object if no lazy values are found (optimization).\n* If a lazy callback throws, the value is replaced with LAZY_EVAL_ERROR\n* and the error is collected in the result.\n* @internal\n*/\nfunction resolveLazyValues(obj) {\n\tlet hasLazy = false;\n\tfor (const key of Object.keys(obj)) if (isLazy(obj[key])) {\n\t\thasLazy = true;\n\t\tbreak;\n\t}\n\tif (!hasLazy) return {\n\t\tresolved: obj,\n\t\terrors: null\n\t};\n\tconst result = {};\n\tlet errors = null;\n\tfor (const key of Object.keys(obj)) {\n\t\tconst value = obj[key];\n\t\tif (isLazy(value)) try {\n\t\t\tresult[key] = value[LAZY_SYMBOL]();\n\t\t} catch (e) {\n\t\t\tresult[key] = LAZY_EVAL_ERROR;\n\t\t\tif (!errors) errors = [];\n\t\t\terrors.push({\n\t\t\t\tkey,\n\t\t\t\terror: e\n\t\t\t});\n\t\t}\n\t\telse result[key] = value;\n\t}\n\treturn {\n\t\tresolved: result,\n\t\terrors\n\t};\n}\n/**\n* Checks if any values in a record are Promises.\n* @internal\n*/\nfunction hasPromiseValues(obj) {\n\tfor (const key of Object.keys(obj)) if (obj[key] instanceof Promise) return true;\n\treturn false;\n}\n/**\n* Replaces any Promise values in a record with LAZY_EVAL_ERROR.\n* Used to strip async lazy values from context where only sync lazy is supported.\n* Returns the keys that were replaced.\n* @internal\n*/\nfunction replacePromiseValues(obj) {\n\tlet asyncKeys = null;\n\tconst result = {};\n\tfor (const key of Object.keys(obj)) if (obj[key] instanceof Promise) {\n\t\tresult[key] = LAZY_EVAL_ERROR;\n\t\tif (!asyncKeys) asyncKeys = [];\n\t\tasyncKeys.push(key);\n\t} else result[key] = obj[key];\n\tif (!asyncKeys) return {\n\t\tresolved: obj,\n\t\tasyncKeys: null\n\t};\n\treturn {\n\t\tresolved: result,\n\t\tasyncKeys\n\t};\n}\n/**\n* Resolves any Promise values in a record using Promise.allSettled.\n* If a Promise rejects, the value is replaced with LAZY_EVAL_ERROR\n* and the error is collected in the result.\n* @internal\n*/\nasync function resolvePromiseValues(obj) {\n\tconst keys = Object.keys(obj);\n\tconst settled = await Promise.allSettled(keys.map((key) => Promise.resolve(obj[key])));\n\tconst result = {};\n\tlet errors = null;\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tconst s = settled[i];\n\t\tif (s.status === \"fulfilled\") result[keys[i]] = s.value;\n\t\telse {\n\t\t\tresult[keys[i]] = LAZY_EVAL_ERROR;\n\t\t\tif (!errors) errors = [];\n\t\t\terrors.push({\n\t\t\t\tkey: keys[i],\n\t\t\t\terror: s.reason\n\t\t\t});\n\t\t}\n\t}\n\treturn {\n\t\tresolved: result,\n\t\terrors\n\t};\n}\n\n//#endregion\nexport { LAZY_EVAL_ERROR, LAZY_SYMBOL, LogLevel, LogLevelPriority, LogLevelPriorityToNames, countLazyValues, hasPromiseValues, isLazy, lazy, replacePromiseValues, resolveLazyValues, resolvePromiseValues };",
|
|
135
|
-
"import { LogLevel, LogLevel as LogLevel$1, LogLevelPriority } from \"@loglayer/shared\";\n\n//#region src/BaseTransport.ts\n/**\n* For implementing libraries that are logging libraries that generally have an interface of:\n* info(), warn(), error(), debug(), trace(), etc.\n*\n* @see {@link https://loglayer.dev/transports/creating-transports.html | Creating Transports}\n*/\nvar BaseTransport = class {\n\t/**\n\t* An identifier for the transport. If not defined, a random one will be generated.\n\t*/\n\tid;\n\t/**\n\t* Instance of the logger library\n\t*/\n\tlogger;\n\t/**\n\t* If false, the transport will not send logs to the logger.\n\t*/\n\tenabled;\n\t/**\n\t* If true, the transport will log to the console for debugging purposes\n\t*/\n\tconsoleDebug;\n\t/**\n\t* Minimum log level to process. Defaults to \"trace\".\n\t*/\n\tlevel;\n\tconstructor(config) {\n\t\tthis.id = config.id ?? Date.now().toString() + Math.random().toString();\n\t\tthis.logger = config.logger;\n\t\tthis.enabled = config.enabled ?? true;\n\t\tthis.consoleDebug = config.consoleDebug ?? false;\n\t\tthis.level = config.level ?? \"trace\";\n\t}\n\t/**\n\t* LogLayer calls this to send logs to the transport\n\t*/\n\t_sendToLogger(params) {\n\t\tif (!this.enabled) return;\n\t\tif (LogLevelPriority[params.logLevel] < LogLevelPriority[this.level]) return;\n\t\tconst messages = this.shipToLogger(params);\n\t\tif (this.consoleDebug) switch (params.logLevel) {\n\t\t\tcase LogLevel$1.info:\n\t\t\t\tconsole.info(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.warn:\n\t\t\t\tconsole.warn(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.error:\n\t\t\t\tconsole.error(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.trace:\n\t\t\t\tconsole.debug(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.debug:\n\t\t\t\tconsole.debug(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.fatal:\n\t\t\t\tconsole.debug(...messages);\n\t\t\t\tbreak;\n\t\t\tdefault: console.log(...messages);\n\t\t}\n\t}\n\t/**\n\t* Returns the logger instance attached to the transport\n\t*/\n\tgetLoggerInstance() {\n\t\treturn this.logger;\n\t}\n};\n\n//#endregion\n//#region src/LoggerlessTransport.ts\n/**\n* For implementing libraries that aren't logging libraries\n*\n* @see {@link https://loglayer.dev/transports/creating-transports.html | Creating Transports}\n*/\nvar LoggerlessTransport = class {\n\t/**\n\t* An identifier for the transport. If not defined, a random one will be generated.\n\t*/\n\tid;\n\t/**\n\t* If false, the transport will not send logs to the logger.\n\t*/\n\tenabled;\n\t/**\n\t* Minimum log level to process. Defaults to \"trace\".\n\t*/\n\tlevel;\n\t/**\n\t* If true, the transport will log to the console for debugging purposes\n\t*/\n\tconsoleDebug;\n\tconstructor(config) {\n\t\tthis.id = Date.now().toString() + Math.random().toString();\n\t\tthis.enabled = config.enabled ?? true;\n\t\tthis.consoleDebug = config.consoleDebug ?? false;\n\t\tthis.level = config.level ?? \"trace\";\n\t}\n\t/**\n\t* LogLayer calls this to send logs to the transport\n\t*/\n\t_sendToLogger(params) {\n\t\tif (!this.enabled) return;\n\t\tif (LogLevelPriority[params.logLevel] < LogLevelPriority[this.level]) return;\n\t\tconst messages = this.shipToLogger(params);\n\t\tif (this.consoleDebug) switch (params.logLevel) {\n\t\t\tcase LogLevel$1.info:\n\t\t\t\tconsole.info(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.warn:\n\t\t\t\tconsole.warn(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.error:\n\t\t\t\tconsole.error(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.trace:\n\t\t\t\tconsole.debug(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.debug:\n\t\t\t\tconsole.debug(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.fatal:\n\t\t\t\tconsole.debug(...messages);\n\t\t\t\tbreak;\n\t\t\tdefault: console.log(...messages);\n\t\t}\n\t}\n\t/**\n\t* Returns the logger instance attached to the transport\n\t*/\n\tgetLoggerInstance() {\n\t\tthrow new Error(\"This transport does not have a logger instance\");\n\t}\n};\n\n//#endregion\n//#region src/test-utils.ts\n/**\n* Shows what the logging library output looks like under a transport\n* @param label A name for the test\n* @param logLayerInstance The loglayer instance to use for logging\n*/\nfunction testTransportOutput(label, logLayerInstance) {\n\tconsole.log(`\\n===== Start Livetest for: ${label} =====`);\n\tconsole.log(\"\\n===== info() ====\");\n\tlogLayerInstance.info(\"info message\");\n\tconsole.log(\"\\n===== warn() ====\");\n\tlogLayerInstance.warn(\"warn message\");\n\tconsole.log(\"\\n===== error() ====\");\n\tlogLayerInstance.error(\"error message\");\n\tconsole.log(\"\\n===== debug() ====\");\n\tlogLayerInstance.debug(\"debug message\");\n\tconsole.log(\"\\n===== trace() ====\");\n\tlogLayerInstance.trace(\"trace message\");\n\tconsole.log(\"\\n===== fatal() ====\");\n\tlogLayerInstance.fatal(\"fatal message\");\n\tconsole.log(\"\\n===== multiple parameters ====\");\n\tlogLayerInstance.info(\"multiple info message\", \"with multiple\", \"parameters\");\n\tconsole.log(\"\\n===== multiple parameters with mixed data ====\");\n\tlogLayerInstance.info(\"mixed data\", 1234, void 0, null, true);\n\tconsole.log(\"\\n===== withMetadata() ====\");\n\tlogLayerInstance.withMetadata({\n\t\ttest: \"metadata\",\n\t\ttest2: \"metadata2\"\n\t}).trace(\"trace message with metadata\");\n\tconsole.log(\"\\n===== withError() ====\");\n\tlogLayerInstance.withError(/* @__PURE__ */ new Error(\"error object\")).trace(\"trace message with error\");\n\tconsole.log(\"\\n===== withError() + withMetadata() ====\");\n\tlogLayerInstance.withMetadata({\n\t\ttest: \"metadata\",\n\t\ttest2: \"metadata2\",\n\t\tnested: { data: \"nested data\" }\n\t}).withError(/* @__PURE__ */ new Error(\"error object\")).error(\"error message with metadata and error instance\");\n\tconsole.log(\"\\n===== onlyError() ====\");\n\tlogLayerInstance.errorOnly(/* @__PURE__ */ new Error(\"error message\"));\n\tconsole.log(\"\\n===== onlyMetadata() ====\");\n\tlogLayerInstance.metadataOnly({\n\t\tonly: \"metadata\",\n\t\tarrayData: [\n\t\t\t1,\n\t\t\t2,\n\t\t\t3\n\t\t]\n\t});\n\tconsole.log(\"\\n===== withContext() ====\");\n\tlogLayerInstance.withContext({ test: \"data\" });\n\tlogLayerInstance.info(\"context data\");\n\tconsole.log(`\\n===== End Livetest for: ${label} =====`);\n}\n\n//#endregion\nexport { BaseTransport, LogLevel, LogLevelPriority, LoggerlessTransport, testTransportOutput };",
|
|
136
|
-
"import { BaseTransport, LogLevel } from \"@loglayer/transport\";\n\n//#region src/TsLogTransport.ts\nvar TsLogTransport = class extends BaseTransport {\n\tconstructor(config) {\n\t\tsuper(config);\n\t\tif (config.stackDepthLevel !== void 0) this.logger[\"stackDepthLevel\"] = config.stackDepthLevel;\n\t\telse this.logger[\"stackDepthLevel\"] = 9;\n\t}\n\tshipToLogger({ logLevel, messages, data, hasData }) {\n\t\tif (data && hasData) messages.push(data);\n\t\tswitch (logLevel) {\n\t\t\tcase LogLevel.info:\n\t\t\t\tthis.logger.info(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel.warn:\n\t\t\t\tthis.logger.warn(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel.error:\n\t\t\t\tthis.logger.error(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel.trace:\n\t\t\t\tthis.logger.trace(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel.debug:\n\t\t\t\tthis.logger.debug(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel.fatal:\n\t\t\t\tthis.logger.fatal(...messages);\n\t\t\t\tbreak;\n\t\t}\n\t\treturn messages;\n\t}\n};\n\n//#endregion\nexport { TsLogTransport };",
|
|
137
|
-
"import { LogLevel } from \"@loglayer/shared\";\n\n//#region src/types.ts\n/**\n* List of plugin callbacks that can be called by the plugin manager.\n*\n* @see {@link https://loglayer.dev/plugins/creating-plugins.html#transformloglevel | transformLogLevel Docs}\n* @see {@link https://loglayer.dev/plugins/creating-plugins.html#onbeforedataout | onBeforeDataOut Docs}\n* @see {@link https://loglayer.dev/plugins/creating-plugins.html#shouldsendtologger | shouldSendToLogger Docs}\n* @see {@link https://loglayer.dev/plugins/creating-plugins.html#onmetadatacalled | onMetadataCalled Docs}\n* @see {@link https://loglayer.dev/plugins/creating-plugins.html#onbeforemessageout | onBeforeMessageOut Docs}\n* @see {@link https://loglayer.dev/plugins/creating-plugins.html#oncontextcalled | onContextCalled Docs}\n*/\nlet PluginCallbackType = /* @__PURE__ */ function(PluginCallbackType) {\n\tPluginCallbackType[\"transformLogLevel\"] = \"transformLogLevel\";\n\tPluginCallbackType[\"onBeforeDataOut\"] = \"onBeforeDataOut\";\n\tPluginCallbackType[\"shouldSendToLogger\"] = \"shouldSendToLogger\";\n\tPluginCallbackType[\"onMetadataCalled\"] = \"onMetadataCalled\";\n\tPluginCallbackType[\"onBeforeMessageOut\"] = \"onBeforeMessageOut\";\n\tPluginCallbackType[\"onContextCalled\"] = \"onContextCalled\";\n\treturn PluginCallbackType;\n}({});\n\n//#endregion\nexport { LogLevel, PluginCallbackType };",
|
|
138
|
-
"//#region src/DefaultContextManager.ts\n/**\n* The default context manager used by LogLayer. It is a simple k/v store for context data.\n*\n* @see {@link https://loglayer.dev/context-managers/default.html | Default Context Manager Docs}\n*/\nvar DefaultContextManager = class DefaultContextManager {\n\tcontext = {};\n\thasContext = false;\n\t/**\n\t* Sets the context data to be included with every log entry. Set to `undefined` to clear the context data.\n\t*/\n\tsetContext(context) {\n\t\tif (!context) {\n\t\t\tthis.context = {};\n\t\t\tthis.hasContext = false;\n\t\t\treturn;\n\t\t}\n\t\tthis.context = context;\n\t\tthis.hasContext = true;\n\t}\n\t/**\n\t* Appends context data to the existing context data.\n\t*/\n\tappendContext(context) {\n\t\tthis.context = {\n\t\t\t...this.context,\n\t\t\t...context\n\t\t};\n\t\tthis.hasContext = true;\n\t}\n\t/**\n\t* Returns the context data to be included with every log entry.\n\t*/\n\tgetContext() {\n\t\treturn this.context;\n\t}\n\t/**\n\t* Returns true if context data is present.\n\t*/\n\thasContextData() {\n\t\treturn this.hasContext;\n\t}\n\t/**\n\t* Clears the context data. If keys are provided, only those keys will be removed.\n\t* If no keys are provided, all context data will be cleared.\n\t*/\n\tclearContext(keys) {\n\t\tif (keys === void 0) {\n\t\t\tthis.context = {};\n\t\t\tthis.hasContext = false;\n\t\t\treturn;\n\t\t}\n\t\tconst keysToRemove = Array.isArray(keys) ? keys : [keys];\n\t\tfor (const key of keysToRemove) delete this.context[key];\n\t\tthis.hasContext = Object.keys(this.context).length > 0;\n\t}\n\t/**\n\t* Copies the parent context data to the child context data.\n\t*/\n\tonChildLoggerCreated({ parentContextManager, childContextManager }) {\n\t\tif (parentContextManager.hasContextData()) {\n\t\t\tconst parentContext = parentContextManager.getContext();\n\t\t\tchildContextManager.setContext({ ...parentContext });\n\t\t}\n\t}\n\t/**\n\t* Creates a new instance of the context manager with the same context data.\n\t*/\n\tclone() {\n\t\tconst clone = new DefaultContextManager();\n\t\tclone.setContext({ ...this.context });\n\t\tclone.hasContext = this.hasContext;\n\t\treturn clone;\n\t}\n};\n\n//#endregion\n//#region src/MockContextManager.ts\n/**\n* A mock context manager that does nothing. Useful for use with unit testing.\n*/\nvar MockContextManager = class MockContextManager {\n\tsetContext(_context) {}\n\tappendContext(_context) {}\n\tgetContext() {\n\t\treturn {};\n\t}\n\thasContextData() {\n\t\treturn false;\n\t}\n\tclearContext(_keys) {}\n\tonChildLoggerCreated(_params) {}\n\tclone() {\n\t\treturn new MockContextManager();\n\t}\n};\n\n//#endregion\nexport { DefaultContextManager, MockContextManager };",
|
|
139
|
-
"import { LogLevel, LogLevel as LogLevel$1, LogLevelPriority, LogLevelPriority as LogLevelPriority$1, LogLevelPriorityToNames } from \"@loglayer/shared\";\n\n//#region src/DefaultLogLevelManager.ts\n/**\n* The default log level manager used by LogLayer. Children inherit log level from parent,\n* but changes from parent do not propagate down to existing children.\n*\n* @see {@link https://loglayer.dev/log-level-managers/default.html | Default Log Level Manager Docs}\n*/\nvar DefaultLogLevelManager = class DefaultLogLevelManager {\n\tlogLevelEnabledStatus = {\n\t\tinfo: true,\n\t\twarn: true,\n\t\terror: true,\n\t\tdebug: true,\n\t\ttrace: true,\n\t\tfatal: true\n\t};\n\t/**\n\t* Sets the minimum log level to be used by the logger. Only messages with\n\t* this level or higher severity will be logged.\n\t*/\n\tsetLevel(logLevel) {\n\t\tconst minLogValue = LogLevelPriority$1[logLevel];\n\t\tfor (const level of Object.values(LogLevel$1)) {\n\t\t\tconst levelKey = level;\n\t\t\tconst levelValue = LogLevelPriority$1[level];\n\t\t\tthis.logLevelEnabledStatus[levelKey] = levelValue >= minLogValue;\n\t\t}\n\t}\n\t/**\n\t* Enables a specific log level\n\t*/\n\tenableIndividualLevel(logLevel) {\n\t\tconst level = logLevel;\n\t\tif (level in this.logLevelEnabledStatus) this.logLevelEnabledStatus[level] = true;\n\t}\n\t/**\n\t* Disables a specific log level\n\t*/\n\tdisableIndividualLevel(logLevel) {\n\t\tconst level = logLevel;\n\t\tif (level in this.logLevelEnabledStatus) this.logLevelEnabledStatus[level] = false;\n\t}\n\t/**\n\t* Checks if a specific log level is enabled\n\t*/\n\tisLevelEnabled(logLevel) {\n\t\tconst level = logLevel;\n\t\treturn this.logLevelEnabledStatus[level];\n\t}\n\t/**\n\t* Enable sending logs to the logging library.\n\t*/\n\tenableLogging() {\n\t\tfor (const level of Object.keys(this.logLevelEnabledStatus)) this.logLevelEnabledStatus[level] = true;\n\t}\n\t/**\n\t* All logging inputs are dropped and stops sending logs to the logging library.\n\t*/\n\tdisableLogging() {\n\t\tfor (const level of Object.keys(this.logLevelEnabledStatus)) this.logLevelEnabledStatus[level] = false;\n\t}\n\t/**\n\t* Copies the parent log level status to the child log level manager.\n\t* Children inherit log level from parent, but changes from parent do not propagate down.\n\t*/\n\tonChildLoggerCreated({ parentLogLevelManager, childLogLevelManager }) {\n\t\tconst parentStatus = parentLogLevelManager.logLevelEnabledStatus;\n\t\tif (childLogLevelManager instanceof DefaultLogLevelManager) childLogLevelManager.logLevelEnabledStatus = { ...parentStatus };\n\t}\n\t/**\n\t* Creates a new instance of the log level manager with the same log level settings.\n\t*/\n\tclone() {\n\t\tconst clone = new DefaultLogLevelManager();\n\t\tclone.logLevelEnabledStatus = { ...this.logLevelEnabledStatus };\n\t\treturn clone;\n\t}\n};\n\n//#endregion\n//#region src/MockLogLevelManager.ts\n/**\n* A mock log level manager for testing purposes.\n* All log levels are enabled by default.\n*/\nvar MockLogLevelManager = class MockLogLevelManager {\n\tsetLevel(_logLevel) {}\n\tenableIndividualLevel(_logLevel) {}\n\tdisableIndividualLevel(_logLevel) {}\n\tisLevelEnabled(_logLevel) {\n\t\treturn true;\n\t}\n\tenableLogging() {}\n\tdisableLogging() {}\n\tonChildLoggerCreated(_params) {}\n\tclone() {\n\t\treturn new MockLogLevelManager();\n\t}\n};\n\n//#endregion\nexport { DefaultLogLevelManager, LogLevel, LogLevelPriority, LogLevelPriorityToNames, MockLogLevelManager };",
|
|
140
|
-
"import { PluginCallbackType, PluginCallbackType as PluginCallbackType$1 } from \"@loglayer/plugin\";\nimport { LAZY_EVAL_ERROR, LAZY_SYMBOL, LogLevel, LogLevel as LogLevel$1, LogLevelPriority, countLazyValues, hasPromiseValues, isLazy, lazy, replacePromiseValues, resolveLazyValues, resolvePromiseValues } from \"@loglayer/shared\";\nimport { DefaultContextManager, MockContextManager } from \"@loglayer/context-manager\";\nimport { DefaultLogLevelManager, MockLogLevelManager } from \"@loglayer/log-level-manager\";\nimport { BaseTransport, LogLevelPriority as LogLevelPriority$1, LoggerlessTransport } from \"@loglayer/transport\";\n\n//#region src/PluginManager.ts\nconst CALLBACK_LIST = [\n\tPluginCallbackType$1.onBeforeDataOut,\n\tPluginCallbackType$1.onMetadataCalled,\n\tPluginCallbackType$1.onBeforeMessageOut,\n\tPluginCallbackType$1.transformLogLevel,\n\tPluginCallbackType$1.shouldSendToLogger,\n\tPluginCallbackType$1.onContextCalled\n];\n/**\n* A class that manages plugins and runs their callbacks.\n* Used by LogLayer to run plugins at various stages of the logging process.\n*/\nvar PluginManager = class {\n\tidToPlugin;\n\ttransformLogLevel = [];\n\tonBeforeDataOut = [];\n\tshouldSendToLogger = [];\n\tonMetadataCalled = [];\n\tonBeforeMessageOut = [];\n\tonContextCalled = [];\n\tconstructor(plugins) {\n\t\tthis.idToPlugin = {};\n\t\tthis.mapPlugins(plugins);\n\t\tthis.indexPlugins();\n\t}\n\tmapPlugins(plugins) {\n\t\tfor (const plugin of plugins) {\n\t\t\tif (!plugin.id) plugin.id = Date.now().toString() + Math.random().toString();\n\t\t\tif (this.idToPlugin[plugin.id]) throw new Error(`[LogLayer] Plugin with id ${plugin.id} already exists.`);\n\t\t\tplugin[\"registeredAt\"] = Date.now();\n\t\t\tthis.idToPlugin[plugin.id] = plugin;\n\t\t}\n\t}\n\tindexPlugins() {\n\t\tthis.transformLogLevel = [];\n\t\tthis.onBeforeDataOut = [];\n\t\tthis.shouldSendToLogger = [];\n\t\tthis.onMetadataCalled = [];\n\t\tthis.onBeforeMessageOut = [];\n\t\tthis.onContextCalled = [];\n\t\tconst pluginList = Object.values(this.idToPlugin).sort((a, b) => a.registeredAt - b.registeredAt);\n\t\tfor (const plugin of pluginList) {\n\t\t\tif (plugin.disabled) return;\n\t\t\tfor (const callback of CALLBACK_LIST) if (plugin[callback] && plugin.id) this[callback].push(plugin.id);\n\t\t}\n\t}\n\thasPlugins(callbackType) {\n\t\treturn this[callbackType].length > 0;\n\t}\n\tcountPlugins(callbackType) {\n\t\tif (callbackType) return this[callbackType].length;\n\t\treturn Object.keys(this.idToPlugin).length;\n\t}\n\taddPlugins(plugins) {\n\t\tthis.mapPlugins(plugins);\n\t\tthis.indexPlugins();\n\t}\n\tenablePlugin(id) {\n\t\tconst plugin = this.idToPlugin[id];\n\t\tif (plugin) plugin.disabled = false;\n\t\tthis.indexPlugins();\n\t}\n\tdisablePlugin(id) {\n\t\tconst plugin = this.idToPlugin[id];\n\t\tif (plugin) plugin.disabled = true;\n\t\tthis.indexPlugins();\n\t}\n\tremovePlugin(id) {\n\t\tdelete this.idToPlugin[id];\n\t\tthis.indexPlugins();\n\t}\n\t/**\n\t* Runs plugins that define transformLogLevel. Returns the transformed log level or the original if no transformation is applied.\n\t* If multiple plugins transform the log level, the last one wins.\n\t*/\n\trunTransformLogLevel(params, loglayer) {\n\t\tlet transformedLevel = null;\n\t\tfor (const pluginId of this.transformLogLevel) {\n\t\t\tconst plugin = this.idToPlugin[pluginId];\n\t\t\tif (plugin.transformLogLevel) {\n\t\t\t\tconst result = plugin.transformLogLevel({\n\t\t\t\t\tdata: params.data,\n\t\t\t\t\tlogLevel: params.logLevel,\n\t\t\t\t\tmessages: params.messages,\n\t\t\t\t\terror: params.error,\n\t\t\t\t\tmetadata: params.metadata,\n\t\t\t\t\tcontext: params.context\n\t\t\t\t}, loglayer);\n\t\t\t\tif (result !== null && result !== void 0 && result !== false) transformedLevel = result;\n\t\t\t}\n\t\t}\n\t\treturn transformedLevel !== null && transformedLevel !== void 0 && transformedLevel !== false ? transformedLevel : params.logLevel;\n\t}\n\t/**\n\t* Runs plugins that defines onBeforeDataOut.\n\t*/\n\trunOnBeforeDataOut(params, loglayer) {\n\t\tconst initialData = { ...params };\n\t\tfor (const pluginId of this.onBeforeDataOut) {\n\t\t\tconst plugin = this.idToPlugin[pluginId];\n\t\t\tif (plugin.onBeforeDataOut) {\n\t\t\t\tconst result = plugin.onBeforeDataOut({\n\t\t\t\t\tdata: initialData.data,\n\t\t\t\t\tlogLevel: initialData.logLevel,\n\t\t\t\t\terror: initialData.error,\n\t\t\t\t\tmetadata: initialData.metadata,\n\t\t\t\t\tcontext: initialData.context\n\t\t\t\t}, loglayer);\n\t\t\t\tif (result) {\n\t\t\t\t\tif (!initialData.data) initialData.data = {};\n\t\t\t\t\tObject.assign(initialData.data, result);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn initialData.data;\n\t}\n\t/**\n\t* Runs plugins that define shouldSendToLogger. Any plugin that returns false will prevent the message from being sent to the transport.\n\t*/\n\trunShouldSendToLogger(params, loglayer) {\n\t\treturn !this.shouldSendToLogger.some((pluginId) => {\n\t\t\treturn !this.idToPlugin[pluginId].shouldSendToLogger?.(params, loglayer);\n\t\t});\n\t}\n\t/**\n\t* Runs plugins that define onMetadataCalled.\n\t*/\n\trunOnMetadataCalled(metadata, loglayer) {\n\t\tlet data = { ...metadata };\n\t\tfor (const pluginId of this.onMetadataCalled) {\n\t\t\tconst result = this.idToPlugin[pluginId].onMetadataCalled?.(data, loglayer);\n\t\t\tif (result) data = result;\n\t\t\telse return null;\n\t\t}\n\t\treturn data;\n\t}\n\trunOnBeforeMessageOut(params, loglayer) {\n\t\tlet messages = [...params.messages];\n\t\tfor (const pluginId of this.onBeforeMessageOut) {\n\t\t\tconst result = this.idToPlugin[pluginId].onBeforeMessageOut?.({\n\t\t\t\tmessages,\n\t\t\t\tlogLevel: params.logLevel\n\t\t\t}, loglayer);\n\t\t\tif (result) messages = result;\n\t\t}\n\t\treturn messages;\n\t}\n\t/**\n\t* Runs plugins that define onContextCalled.\n\t*/\n\trunOnContextCalled(context, loglayer) {\n\t\tlet data = { ...context };\n\t\tfor (const pluginId of this.onContextCalled) {\n\t\t\tconst result = this.idToPlugin[pluginId].onContextCalled?.(data, loglayer);\n\t\t\tif (result) data = result;\n\t\t\telse return null;\n\t\t}\n\t\treturn data;\n\t}\n};\n\n//#endregion\n//#region src/LogLayer.ts\n/**\n* Wraps around a logging framework to provide convenience methods that allow\n* developers to programmatically specify their errors and metadata along with\n* a message in a consistent fashion.\n*/\nvar LogLayer = class LogLayer {\n\tpluginManager;\n\tidToTransport;\n\thasMultipleTransports;\n\tsingleTransport;\n\tcontextManager;\n\tlogLevelManager;\n\t_isLoggingLazyError = false;\n\t_lazyContextCount = 0;\n\t_assignedGroups = null;\n\t_groupsConfig = null;\n\t_activeGroups = null;\n\t_ungroupedBehavior = \"all\";\n\t/**\n\t* The configuration object used to initialize the logger.\n\t* This is for internal use only and should not be modified directly.\n\t*/\n\t_config;\n\tconstructor(config) {\n\t\tthis._config = {\n\t\t\t...config,\n\t\t\tenabled: config.enabled ?? true\n\t\t};\n\t\tthis.contextManager = new DefaultContextManager();\n\t\tthis.logLevelManager = new DefaultLogLevelManager();\n\t\tif (!this._config.enabled) this.disableLogging();\n\t\tthis.pluginManager = new PluginManager([...config.plugins || [], ...mixinRegistry.pluginsToInit]);\n\t\tif (!this._config.errorFieldName) this._config.errorFieldName = \"err\";\n\t\tif (!this._config.copyMsgOnOnlyError) this._config.copyMsgOnOnlyError = false;\n\t\tthis._initializeTransports(this._config.transport);\n\t\tthis._groupsConfig = config.groups ? { ...config.groups } : null;\n\t\tthis._ungroupedBehavior = config.ungroupedBehavior ?? \"all\";\n\t\tthis._activeGroups = config.activeGroups ? new Set(config.activeGroups) : null;\n\t\tthis._parseEnvGroups();\n\t\tif (mixinRegistry.logLayerHandlers.length > 0) mixinRegistry.logLayerHandlers.forEach((mixin) => {\n\t\t\tif (mixin.onConstruct) mixin.onConstruct(this, config);\n\t\t});\n\t}\n\t/**\n\t* Sets the context manager to use for managing context data.\n\t*/\n\twithContextManager(contextManager) {\n\t\tif (this.contextManager && typeof this.contextManager[Symbol.dispose] === \"function\") this.contextManager[Symbol.dispose]();\n\t\tthis.contextManager = contextManager;\n\t\tthis._lazyContextCount = contextManager.hasContextData() ? countLazyValues(contextManager.getContext()) : 0;\n\t\treturn this;\n\t}\n\t/**\n\t* Returns the context manager instance being used.\n\t*/\n\tgetContextManager() {\n\t\treturn this.contextManager;\n\t}\n\t/**\n\t* Sets the log level manager to use for managing log levels.\n\t*/\n\twithLogLevelManager(logLevelManager) {\n\t\tif (this.logLevelManager && typeof this.logLevelManager[Symbol.dispose] === \"function\") this.logLevelManager[Symbol.dispose]();\n\t\tthis.logLevelManager = logLevelManager;\n\t\treturn this;\n\t}\n\t/**\n\t* Returns the log level manager instance being used.\n\t*/\n\tgetLogLevelManager() {\n\t\treturn this.logLevelManager;\n\t}\n\t/**\n\t* Returns the configuration object used to initialize the logger.\n\t*/\n\tgetConfig() {\n\t\treturn this._config;\n\t}\n\t_initializeTransports(transports) {\n\t\tif (this.idToTransport) {\n\t\t\tfor (const id in this.idToTransport) if (this.idToTransport[id] && typeof this.idToTransport[id][Symbol.dispose] === \"function\") this.idToTransport[id][Symbol.dispose]();\n\t\t}\n\t\tthis.hasMultipleTransports = Array.isArray(transports) && transports.length > 1;\n\t\tthis.singleTransport = this.hasMultipleTransports ? null : Array.isArray(transports) ? transports[0] : transports;\n\t\tif (Array.isArray(transports)) this.idToTransport = transports.reduce((acc, transport) => {\n\t\t\tacc[transport.id] = transport;\n\t\t\treturn acc;\n\t\t}, {});\n\t\telse this.idToTransport = { [transports.id]: transports };\n\t}\n\t/**\n\t* Calls child() and sets the prefix to be included with every log message.\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/basic-logging.html#message-prefixing | Message Prefixing Docs}\n\t*/\n\twithPrefix(prefix) {\n\t\tconst logger = this.child();\n\t\tlogger._config.prefix = prefix;\n\t\treturn logger;\n\t}\n\t/**\n\t* Creates a child logger with the specified group(s) persistently assigned.\n\t* All logs from the child will be tagged with these groups.\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs}\n\t*/\n\twithGroup(group) {\n\t\tconst logger = this.child();\n\t\tconst newGroups = Array.isArray(group) ? group : [group];\n\t\tif (logger._assignedGroups) {\n\t\t\tconst combined = new Set([...logger._assignedGroups, ...newGroups]);\n\t\t\tlogger._assignedGroups = Array.from(combined);\n\t\t} else logger._assignedGroups = [...newGroups];\n\t\treturn logger;\n\t}\n\t/**\n\t* Adds a new group definition at runtime.\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs}\n\t*/\n\taddGroup(name, config) {\n\t\tif (!this._groupsConfig) this._groupsConfig = {};\n\t\tthis._groupsConfig[name] = { ...config };\n\t\treturn this;\n\t}\n\t/**\n\t* Removes a group definition at runtime.\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs}\n\t*/\n\tremoveGroup(name) {\n\t\tif (this._groupsConfig) {\n\t\t\tdelete this._groupsConfig[name];\n\t\t\tif (Object.keys(this._groupsConfig).length === 0) this._groupsConfig = null;\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t* Enables a group by name (sets enabled: true).\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs}\n\t*/\n\tenableGroup(name) {\n\t\tif (this._groupsConfig?.[name]) this._groupsConfig[name] = {\n\t\t\t...this._groupsConfig[name],\n\t\t\tenabled: true\n\t\t};\n\t\treturn this;\n\t}\n\t/**\n\t* Disables a group by name (sets enabled: false).\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs}\n\t*/\n\tdisableGroup(name) {\n\t\tif (this._groupsConfig?.[name]) this._groupsConfig[name] = {\n\t\t\t...this._groupsConfig[name],\n\t\t\tenabled: false\n\t\t};\n\t\treturn this;\n\t}\n\t/**\n\t* Sets the minimum log level for a group at runtime.\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs}\n\t*/\n\tsetGroupLevel(name, level) {\n\t\tif (this._groupsConfig?.[name]) this._groupsConfig[name] = {\n\t\t\t...this._groupsConfig[name],\n\t\t\tlevel\n\t\t};\n\t\treturn this;\n\t}\n\t/**\n\t* Sets which groups are active. Only active groups will route logs.\n\t* Pass null to clear the filter (all groups active).\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs}\n\t*/\n\tsetActiveGroups(groups) {\n\t\tthis._activeGroups = groups ? new Set(groups) : null;\n\t\treturn this;\n\t}\n\t/**\n\t* Returns a snapshot of all group configurations.\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs}\n\t*/\n\tgetGroups() {\n\t\treturn this._groupsConfig ? { ...this._groupsConfig } : {};\n\t}\n\t/**\n\t* Appends context data which will be included with\n\t* every log entry.\n\t*\n\t* Passing in an empty value / object will *not* clear the context.\n\t*\n\t* To clear the context, use {@link https://loglayer.dev/logging-api/context.html#clearing-context | clearContext()}.\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/context.html | Context Docs}\n\t*/\n\twithContext(context) {\n\t\tlet updatedContext = context;\n\t\tif (!context) {\n\t\t\tif (this._config.consoleDebug) console.debug(\"[LogLayer] withContext was called with no context; dropping.\");\n\t\t\treturn this;\n\t\t}\n\t\tif (this.pluginManager.hasPlugins(PluginCallbackType$1.onContextCalled)) {\n\t\t\tupdatedContext = this.pluginManager.runOnContextCalled(context, this);\n\t\t\tif (!updatedContext) {\n\t\t\t\tif (this._config.consoleDebug) console.debug(\"[LogLayer] Context was dropped due to plugin returning falsy value.\");\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\t\tconst currentContext = this.contextManager.getContext();\n\t\tfor (const key of Object.keys(updatedContext)) {\n\t\t\tconst wasLazy = key in currentContext && isLazy(currentContext[key]);\n\t\t\tconst nowLazy = isLazy(updatedContext[key]);\n\t\t\tif (!wasLazy && nowLazy) this._lazyContextCount++;\n\t\t\telse if (wasLazy && !nowLazy) this._lazyContextCount--;\n\t\t}\n\t\tthis.contextManager.appendContext(updatedContext);\n\t\treturn this;\n\t}\n\t/**\n\t* Clears the context data. If keys are provided, only those keys will be removed.\n\t* If no keys are provided, all context data will be cleared.\n\t*/\n\tclearContext(keys) {\n\t\tif (keys !== void 0 && this._lazyContextCount > 0) {\n\t\t\tconst context = this.contextManager.getContext();\n\t\t\tconst keysToRemove = Array.isArray(keys) ? keys : [keys];\n\t\t\tfor (const key of keysToRemove) if (key in context && isLazy(context[key])) this._lazyContextCount--;\n\t\t} else if (keys === void 0) this._lazyContextCount = 0;\n\t\tthis.contextManager.clearContext(keys);\n\t\treturn this;\n\t}\n\tgetContext(options) {\n\t\tconst context = this.contextManager.getContext();\n\t\tif (options?.raw || this._lazyContextCount === 0) return context;\n\t\tconst { resolved, errors } = resolveLazyValues(context);\n\t\tif (errors) this._logLazyEvalErrors(errors, \"context\");\n\t\tconst { resolved: finalResolved, asyncKeys } = replacePromiseValues(resolved);\n\t\tif (asyncKeys) this._logAsyncLazyContextErrors(asyncKeys);\n\t\treturn finalResolved;\n\t}\n\t/**\n\t* Add additional plugins.\n\t*\n\t* @see {@link https://loglayer.dev/plugins/ | Plugins Docs}\n\t*/\n\taddPlugins(plugins) {\n\t\tthis.pluginManager.addPlugins(plugins);\n\t}\n\t/**\n\t* Enables a plugin by id.\n\t*\n\t* @see {@link https://loglayer.dev/plugins/ | Plugins Docs}\n\t*/\n\tenablePlugin(id) {\n\t\tthis.pluginManager.enablePlugin(id);\n\t}\n\t/**\n\t* Disables a plugin by id.\n\t*\n\t* @see {@link https://loglayer.dev/plugins/ | Plugins Docs}\n\t*/\n\tdisablePlugin(id) {\n\t\tthis.pluginManager.disablePlugin(id);\n\t}\n\t/**\n\t* Removes a plugin by id.\n\t*\n\t* @see {@link https://loglayer.dev/plugins/ | Plugins Docs}\n\t*/\n\tremovePlugin(id) {\n\t\tthis.pluginManager.removePlugin(id);\n\t}\n\t/**\n\t* Specifies metadata to include with the log message\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/metadata.html | Metadata Docs}\n\t*/\n\twithMetadata(metadata) {\n\t\treturn new LogBuilder(this).withMetadata(metadata);\n\t}\n\t/**\n\t* Specifies an Error to include with the log message\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/error-handling.html | Error Handling Docs}\n\t*/\n\twithError(error) {\n\t\treturn new LogBuilder(this).withError(error);\n\t}\n\t/**\n\t* Creates a new instance of LogLayer but with the initialization\n\t* configuration and context copied over.\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/child-loggers.html | Child Logging Docs}\n\t*/\n\tchild() {\n\t\tconst childLogger = new LogLayer({\n\t\t\t...this._config,\n\t\t\ttransport: Array.isArray(this._config.transport) ? [...this._config.transport] : this._config.transport\n\t\t}).withPluginManager(this.pluginManager).withContextManager(this.contextManager.clone()).withLogLevelManager(this.logLevelManager.clone());\n\t\tthis.contextManager.onChildLoggerCreated({\n\t\t\tparentContextManager: this.contextManager,\n\t\t\tchildContextManager: childLogger.contextManager,\n\t\t\tparentLogger: this,\n\t\t\tchildLogger\n\t\t});\n\t\tthis.logLevelManager.onChildLoggerCreated({\n\t\t\tparentLogLevelManager: this.logLevelManager,\n\t\t\tchildLogLevelManager: childLogger.logLevelManager,\n\t\t\tparentLogger: this,\n\t\t\tchildLogger\n\t\t});\n\t\tchildLogger._lazyContextCount = childLogger.contextManager.hasContextData() ? countLazyValues(childLogger.contextManager.getContext()) : 0;\n\t\tchildLogger._groupsConfig = this._groupsConfig;\n\t\tchildLogger._activeGroups = this._activeGroups;\n\t\tchildLogger._ungroupedBehavior = this._ungroupedBehavior;\n\t\tchildLogger._assignedGroups = this._assignedGroups ? [...this._assignedGroups] : null;\n\t\treturn childLogger;\n\t}\n\t/**\n\t* Replaces all existing transports with new ones.\n\t*\n\t* Transport changes only affect the current logger instance. Child loggers\n\t* created before the change will retain their original transports, and\n\t* parent loggers are not affected when a child modifies its transports.\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/transport-management.html | Transport Management Docs}\n\t*/\n\twithFreshTransports(transports) {\n\t\tthis._config.transport = transports;\n\t\tthis._initializeTransports(transports);\n\t\treturn this;\n\t}\n\t/**\n\t* Adds one or more transports to the existing transports.\n\t* If a transport with the same ID already exists, it will be replaced.\n\t*\n\t* Transport changes only affect the current logger instance. Child loggers\n\t* created before the change will retain their original transports, and\n\t* parent loggers are not affected when a child modifies its transports.\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/transport-management.html | Transport Management Docs}\n\t*/\n\taddTransport(transports) {\n\t\tconst newTransports = Array.isArray(transports) ? transports : [transports];\n\t\tconst existingTransports = Array.isArray(this._config.transport) ? this._config.transport : [this._config.transport];\n\t\tconst newTransportIds = new Set(newTransports.map((t) => t.id));\n\t\tfor (const transport of newTransports) {\n\t\t\tconst existingTransport = this.idToTransport[transport.id];\n\t\t\tif (existingTransport && typeof existingTransport[Symbol.dispose] === \"function\") existingTransport[Symbol.dispose]();\n\t\t}\n\t\tconst allTransports = [...existingTransports.filter((t) => !newTransportIds.has(t.id)), ...newTransports];\n\t\tthis._config.transport = allTransports;\n\t\tfor (const transport of newTransports) this.idToTransport[transport.id] = transport;\n\t\tthis.hasMultipleTransports = allTransports.length > 1;\n\t\tthis.singleTransport = this.hasMultipleTransports ? null : allTransports[0];\n\t\treturn this;\n\t}\n\t/**\n\t* Removes a transport by its ID.\n\t*\n\t* Transport changes only affect the current logger instance. Child loggers\n\t* created before the change will retain their original transports, and\n\t* parent loggers are not affected when a child modifies its transports.\n\t*\n\t* @returns true if the transport was found and removed, false otherwise.\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/transport-management.html | Transport Management Docs}\n\t*/\n\tremoveTransport(id) {\n\t\tconst transport = this.idToTransport[id];\n\t\tif (!transport) return false;\n\t\tif (typeof transport[Symbol.dispose] === \"function\") transport[Symbol.dispose]();\n\t\tdelete this.idToTransport[id];\n\t\tconst remainingTransports = (Array.isArray(this._config.transport) ? this._config.transport : [this._config.transport]).filter((t) => t.id !== id);\n\t\tthis._config.transport = remainingTransports.length === 1 ? remainingTransports[0] : remainingTransports;\n\t\tthis.hasMultipleTransports = remainingTransports.length > 1;\n\t\tthis.singleTransport = this.hasMultipleTransports ? null : remainingTransports[0] || null;\n\t\treturn true;\n\t}\n\t/**\n\t* Replaces all existing plugins with new ones.\n\t*\n\t* When used with child loggers, it only affects the current logger instance\n\t* and does not modify the parent's plugins.\n\t*\n\t* @see {@link https://loglayer.dev/plugins/ | Plugins Docs}\n\t*/\n\twithFreshPlugins(plugins) {\n\t\tthis._config.plugins = plugins;\n\t\tthis.pluginManager = new PluginManager(plugins);\n\t\treturn this;\n\t}\n\twithPluginManager(pluginManager) {\n\t\tthis.pluginManager = pluginManager;\n\t\treturn this;\n\t}\n\t/**\n\t* Logs only the error object without a log message\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/error-handling.html | Error Handling Docs}\n\t*/\n\terrorOnly(error, opts) {\n\t\tconst logLevel = opts?.logLevel || LogLevel$1.error;\n\t\tif (!this.isLevelEnabled(logLevel)) return;\n\t\tconst { copyMsgOnOnlyError } = this._config;\n\t\tconst formatLogConf = {\n\t\t\tlogLevel,\n\t\t\terr: error\n\t\t};\n\t\tif ((copyMsgOnOnlyError && opts?.copyMsg !== false || opts?.copyMsg === true) && error?.message) formatLogConf.params = [error.message];\n\t\tthis._formatLog(formatLogConf);\n\t}\n\t/**\n\t* Logs only metadata without a log message\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/metadata.html | Metadata Docs}\n\t*/\n\tmetadataOnly(metadata, logLevel = LogLevel$1.info) {\n\t\tif (!this.isLevelEnabled(logLevel)) return void 0;\n\t\tconst { muteMetadata, consoleDebug } = this._config;\n\t\tif (muteMetadata) return;\n\t\tif (!metadata) {\n\t\t\tif (consoleDebug) console.debug(\"[LogLayer] metadataOnly was called with no metadata; dropping.\");\n\t\t\treturn;\n\t\t}\n\t\tlet data = metadata;\n\t\tif (this.pluginManager.hasPlugins(PluginCallbackType$1.onMetadataCalled)) {\n\t\t\tdata = this.pluginManager.runOnMetadataCalled(metadata, this);\n\t\t\tif (!data) {\n\t\t\t\tif (consoleDebug) console.debug(\"[LogLayer] Metadata was dropped due to plugin returning falsy value.\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tconst config = {\n\t\t\tlogLevel,\n\t\t\tmetadata: data\n\t\t};\n\t\treturn this._formatLog(config);\n\t}\n\t/**\n\t* Sends a log message to the logging library under an info log level.\n\t*\n\t* The logging library may or may not support multiple message parameters and only\n\t* the first parameter would be used.\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/basic-logging.html | Basic Logging Docs}\n\t*/\n\tinfo(...messages) {\n\t\tif (!this.isLevelEnabled(LogLevel$1.info)) return;\n\t\tthis._formatMessage(messages);\n\t\tthis._formatLog({\n\t\t\tlogLevel: LogLevel$1.info,\n\t\t\tparams: messages\n\t\t});\n\t}\n\t/**\n\t* Sends a log message to the logging library under the warn log level\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/basic-logging.html | Basic Logging Docs}\n\t*/\n\twarn(...messages) {\n\t\tif (!this.isLevelEnabled(LogLevel$1.warn)) return;\n\t\tthis._formatMessage(messages);\n\t\tthis._formatLog({\n\t\t\tlogLevel: LogLevel$1.warn,\n\t\t\tparams: messages\n\t\t});\n\t}\n\t/**\n\t* Sends a log message to the logging library under the error log level\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/basic-logging.html | Basic Logging Docs}\n\t*/\n\terror(...messages) {\n\t\tif (!this.isLevelEnabled(LogLevel$1.error)) return;\n\t\tthis._formatMessage(messages);\n\t\tthis._formatLog({\n\t\t\tlogLevel: LogLevel$1.error,\n\t\t\tparams: messages\n\t\t});\n\t}\n\t/**\n\t* Sends a log message to the logging library under the debug log level\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/basic-logging.html | Basic Logging Docs}\n\t*/\n\tdebug(...messages) {\n\t\tif (!this.isLevelEnabled(LogLevel$1.debug)) return;\n\t\tthis._formatMessage(messages);\n\t\tthis._formatLog({\n\t\t\tlogLevel: LogLevel$1.debug,\n\t\t\tparams: messages\n\t\t});\n\t}\n\t/**\n\t* Sends a log message to the logging library under the trace log level\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/basic-logging.html | Basic Logging Docs}\n\t*/\n\ttrace(...messages) {\n\t\tif (!this.isLevelEnabled(LogLevel$1.trace)) return;\n\t\tthis._formatMessage(messages);\n\t\tthis._formatLog({\n\t\t\tlogLevel: LogLevel$1.trace,\n\t\t\tparams: messages\n\t\t});\n\t}\n\t/**\n\t* Sends a log message to the logging library under the fatal log level\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/basic-logging.html | Basic Logging Docs}\n\t*/\n\tfatal(...messages) {\n\t\tif (!this.isLevelEnabled(LogLevel$1.fatal)) return;\n\t\tthis._formatMessage(messages);\n\t\tthis._formatLog({\n\t\t\tlogLevel: LogLevel$1.fatal,\n\t\t\tparams: messages\n\t\t});\n\t}\n\t/**\n\t* Logs a raw log entry with complete control over all log parameters.\n\t*\n\t* This method allows you to bypass the normal LogLayer API and directly specify\n\t* all aspects of a log entry including log level, messages, metadata, and error.\n\t* It's useful for scenarios where you need to log structured data that doesn't\n\t* fit the standard LogLayer patterns, or when integrating with external logging\n\t* systems that provide pre-formatted log entries.\n\t*\n\t* The raw entry will still go through all LogLayer processing.\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/basic-logging.html | Basic Logging Docs}\n\t*/\n\traw(logEntry) {\n\t\tif (!this.isLevelEnabled(logEntry.logLevel)) return void 0;\n\t\tconst formatLogConf = {\n\t\t\tlogLevel: logEntry.logLevel,\n\t\t\tparams: logEntry.messages,\n\t\t\tmetadata: logEntry.metadata,\n\t\t\terr: logEntry.error,\n\t\t\tcontext: logEntry.context\n\t\t};\n\t\tthis._formatMessage(logEntry.messages);\n\t\treturn this._formatLog(formatLogConf);\n\t}\n\t/**\n\t* All logging inputs are dropped and stops sending logs to the logging library.\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/basic-logging.html#enabling-disabling-logging | Enabling/Disabling Logging Docs}\n\t*/\n\tdisableLogging() {\n\t\tthis.logLevelManager.disableLogging();\n\t\treturn this;\n\t}\n\t/**\n\t* Enable sending logs to the logging library.\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/basic-logging.html#enabling-disabling-logging | Enabling/Disabling Logging Docs}\n\t*/\n\tenableLogging() {\n\t\tthis.logLevelManager.enableLogging();\n\t\treturn this;\n\t}\n\t/**\n\t* Disables inclusion of context data in the print\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/context.html#managing-context | Managing Context Docs}\n\t*/\n\tmuteContext() {\n\t\tthis._config.muteContext = true;\n\t\treturn this;\n\t}\n\t/**\n\t* Enables inclusion of context data in the print\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/context.html#managing-context | Managing Context Docs}\n\t*/\n\tunMuteContext() {\n\t\tthis._config.muteContext = false;\n\t\treturn this;\n\t}\n\t/**\n\t* Disables inclusion of metadata in the print\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/metadata.html#controlling-metadata-output | Controlling Metadata Output Docs}\n\t*/\n\tmuteMetadata() {\n\t\tthis._config.muteMetadata = true;\n\t\treturn this;\n\t}\n\t/**\n\t* Enables inclusion of metadata in the print\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/metadata.html#controlling-metadata-output | Controlling Metadata Output Docs}\n\t*/\n\tunMuteMetadata() {\n\t\tthis._config.muteMetadata = false;\n\t\treturn this;\n\t}\n\t/**\n\t* Enables a specific log level\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/basic-logging.html#enabling-disabling-logging | Enabling/Disabling Logging Docs}\n\t*/\n\tenableIndividualLevel(logLevel) {\n\t\tthis.logLevelManager.enableIndividualLevel(logLevel);\n\t\treturn this;\n\t}\n\t/**\n\t* Disables a specific log level\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/basic-logging.html#enabling-disabling-logging | Enabling/Disabling Logging Docs}\n\t*/\n\tdisableIndividualLevel(logLevel) {\n\t\tthis.logLevelManager.disableIndividualLevel(logLevel);\n\t\treturn this;\n\t}\n\t/**\n\t* Sets the minimum log level to be used by the logger. Only messages with\n\t* this level or higher severity will be logged.\n\t*\n\t* For example, if you setLevel(LogLevel.warn), this will:\n\t* Enable:\n\t* - warn\n\t* - error\n\t* - fatal\n\t* Disable:\n\t* - info\n\t* - debug\n\t* - trace\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/basic-logging.html#enabling-disabling-logging | Enabling/Disabling Logging Docs}\n\t*/\n\tsetLevel(logLevel) {\n\t\tthis.logLevelManager.setLevel(logLevel);\n\t\treturn this;\n\t}\n\t/**\n\t* Checks if a specific log level is enabled\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/basic-logging.html#checking-if-a-log-level-is-enabled | Checking if a Log Level is Enabled Docs}\n\t*/\n\tisLevelEnabled(logLevel) {\n\t\treturn this.logLevelManager.isLevelEnabled(logLevel);\n\t}\n\tformatContext(context) {\n\t\tconst { contextFieldName, muteContext } = this._config;\n\t\tif (context && Object.keys(context).length > 0 && !muteContext) {\n\t\t\tif (contextFieldName) return { [contextFieldName]: { ...context } };\n\t\t\treturn { ...context };\n\t\t}\n\t\treturn {};\n\t}\n\tformatMetadata(data = null) {\n\t\tconst { metadataFieldName, muteMetadata } = this._config;\n\t\tif (data && !muteMetadata) {\n\t\t\tif (metadataFieldName) return { [metadataFieldName]: { ...data } };\n\t\t\treturn { ...data };\n\t\t}\n\t\treturn {};\n\t}\n\t/**\n\t* Returns a logger instance for a specific transport\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/transport-management.html | Transport Management Docs}\n\t*/\n\tgetLoggerInstance(id) {\n\t\tconst transport = this.idToTransport[id];\n\t\tif (!transport) return;\n\t\treturn transport.getLoggerInstance();\n\t}\n\t/**\n\t* Parses the LOGLAYER_GROUPS environment variable and overrides\n\t* _activeGroups and group levels accordingly.\n\t* Format: \"name,name\" or \"name:level,name:level\"\n\t*/\n\t_parseEnvGroups() {\n\t\tconst envValue = typeof process !== \"undefined\" ? process.env?.LOGLAYER_GROUPS : void 0;\n\t\tif (!envValue) return;\n\t\tconst entries = envValue.split(\",\").map((s) => s.trim()).filter(Boolean);\n\t\tconst activeNames = [];\n\t\tfor (const entry of entries) {\n\t\t\tconst colonIdx = entry.indexOf(\":\");\n\t\t\tif (colonIdx > 0) {\n\t\t\t\tconst name = entry.slice(0, colonIdx);\n\t\t\t\tconst level = entry.slice(colonIdx + 1);\n\t\t\t\tactiveNames.push(name);\n\t\t\t\tif (this._groupsConfig?.[name]) this._groupsConfig[name] = {\n\t\t\t\t\t...this._groupsConfig[name],\n\t\t\t\t\tlevel\n\t\t\t\t};\n\t\t\t} else activeNames.push(entry);\n\t\t}\n\t\tthis._activeGroups = new Set(activeNames);\n\t}\n\t/**\n\t* Merges per-log groups (from LogBuilder) with logger-level assigned groups.\n\t*/\n\t_mergeGroups(perLogGroups) {\n\t\tif (this._assignedGroups && perLogGroups) {\n\t\t\tconst combined = new Set([...this._assignedGroups, ...perLogGroups]);\n\t\t\treturn Array.from(combined);\n\t\t}\n\t\treturn perLogGroups || this._assignedGroups;\n\t}\n\t/**\n\t* Applies ungrouped routing rules for a transport.\n\t*/\n\t_applyUngroupedRules(transportId) {\n\t\tif (this._ungroupedBehavior === \"all\") return true;\n\t\tif (this._ungroupedBehavior === \"none\") return false;\n\t\treturn this._ungroupedBehavior.includes(transportId);\n\t}\n\t/**\n\t* Determines whether a transport should receive a log entry based on group routing rules.\n\t*/\n\t_shouldTransportReceiveLog(transportId, logLevel, groups) {\n\t\tif (!this._groupsConfig) return true;\n\t\tconst effectiveGroups = this._mergeGroups(groups);\n\t\tif (!effectiveGroups || effectiveGroups.length === 0) return this._applyUngroupedRules(transportId);\n\t\tlet hasAnyDefinedGroup = false;\n\t\tfor (const groupName of effectiveGroups) {\n\t\t\tconst groupConfig = this._groupsConfig[groupName];\n\t\t\tif (!groupConfig) continue;\n\t\t\thasAnyDefinedGroup = true;\n\t\t\tif (groupConfig.enabled === false) continue;\n\t\t\tif (this._activeGroups && !this._activeGroups.has(groupName)) continue;\n\t\t\tif (groupConfig.level) {\n\t\t\t\tconst groupLevelPriority = LogLevelPriority[groupConfig.level];\n\t\t\t\tif (LogLevelPriority[logLevel] < groupLevelPriority) continue;\n\t\t\t}\n\t\t\tif (groupConfig.transports.includes(transportId)) return true;\n\t\t}\n\t\tif (!hasAnyDefinedGroup) return this._applyUngroupedRules(transportId);\n\t\treturn false;\n\t}\n\t_formatMessage(messages = []) {\n\t\tconst { prefix } = this._config;\n\t\tif (prefix && typeof messages[0] === \"string\") messages[0] = `${prefix} ${messages[0]}`;\n\t}\n\t_formatLog({ logLevel, params = [], metadata = null, err, context = null, groups = null }) {\n\t\tconst rawContext = context !== null ? context : this.contextManager.getContext();\n\t\tlet finalContextData;\n\t\tif (this._lazyContextCount > 0 || context !== null) {\n\t\t\tconst contextResult = resolveLazyValues(rawContext);\n\t\t\tif (contextResult.errors) this._logLazyEvalErrors(contextResult.errors, \"context\");\n\t\t\tconst { resolved, asyncKeys } = replacePromiseValues(contextResult.resolved);\n\t\t\tif (asyncKeys) this._logAsyncLazyContextErrors(asyncKeys);\n\t\t\tfinalContextData = resolved;\n\t\t} else finalContextData = rawContext;\n\t\tlet metadataErrors = null;\n\t\tif (metadata) {\n\t\t\tconst metadataResult = resolveLazyValues(metadata);\n\t\t\tmetadata = metadataResult.resolved;\n\t\t\tmetadataErrors = metadataResult.errors;\n\t\t}\n\t\tif (metadataErrors) this._logLazyEvalErrors(metadataErrors, \"metadata\");\n\t\tif (metadata ? hasPromiseValues(metadata) : false) return this._resolveAsyncAndProcess(logLevel, params, finalContextData, metadata, err, context, groups);\n\t\tthis._processLog(logLevel, params, finalContextData, metadata, err, context, groups);\n\t}\n\t/**\n\t* Resolves any Promise values in metadata (from async lazy callbacks)\n\t* and then processes the log entry. Context is already fully resolved.\n\t*/\n\tasync _resolveAsyncAndProcess(logLevel, params, contextData, metadata, err, context, groups) {\n\t\tlet resolvedMetadata = null;\n\t\tif (metadata) {\n\t\t\tconst metadataResult = await resolvePromiseValues(metadata);\n\t\t\tresolvedMetadata = metadataResult.resolved;\n\t\t\tif (metadataResult.errors) this._logLazyEvalErrors(metadataResult.errors, \"metadata\");\n\t\t}\n\t\tthis._processLog(logLevel, params, contextData, resolvedMetadata, err, context, groups);\n\t}\n\t/**\n\t* Logs error entries for lazy evaluation failures.\n\t* Calls _processLog directly to bypass lazy evaluation and prevent recursion.\n\t*/\n\t_logLazyEvalErrors(failures, source) {\n\t\tif (this._isLoggingLazyError) {\n\t\t\tfor (const f of failures) console.error(`[LogLayer] Lazy evaluation error in ${source} key \"${f.key}\":`, f.error);\n\t\t\treturn;\n\t\t}\n\t\tthis._isLoggingLazyError = true;\n\t\ttry {\n\t\t\tfor (const failure of failures) {\n\t\t\t\tconst errorMessage = failure.error instanceof Error ? failure.error.message : String(failure.error);\n\t\t\t\tthis._processLog(LogLevel$1.error, [`[LogLayer] Lazy evaluation failed for ${source} key \"${failure.key}\": ${errorMessage}`], {}, null, failure.error instanceof Error ? failure.error : void 0, {});\n\t\t\t}\n\t\t} finally {\n\t\t\tthis._isLoggingLazyError = false;\n\t\t}\n\t}\n\t/**\n\t* Logs error entries for async lazy values found in context.\n\t* Async lazy values are only supported in metadata, not context.\n\t*/\n\t_logAsyncLazyContextErrors(keys) {\n\t\tif (this._isLoggingLazyError) {\n\t\t\tfor (const key of keys) console.error(`[LogLayer] Async lazy values are not supported in context (key \"${key}\"). Use async lazy only in metadata.`);\n\t\t\treturn;\n\t\t}\n\t\tthis._isLoggingLazyError = true;\n\t\ttry {\n\t\t\tfor (const key of keys) this._processLog(LogLevel$1.error, [`[LogLayer] Async lazy values are not supported in context (key \"${key}\"). Use async lazy only in metadata.`], {}, null, void 0, {});\n\t\t} finally {\n\t\t\tthis._isLoggingLazyError = false;\n\t\t}\n\t}\n\t/**\n\t* Processes a log entry after lazy values have been fully resolved.\n\t* Handles data assembly, plugins, and transport dispatch.\n\t*/\n\t_processLog(logLevel, params, contextData, metadata, err, context, groups = null) {\n\t\tconst { errorSerializer, errorFieldInMetadata, muteContext, contextFieldName, metadataFieldName, errorFieldName } = this._config;\n\t\tlet hasObjData = !!metadata || (muteContext ? false : context !== null ? Object.keys(context).length > 0 : this.contextManager.hasContextData());\n\t\tlet d = {};\n\t\tif (hasObjData) if (contextFieldName && contextFieldName === metadataFieldName) {\n\t\t\tconst formattedContextData = this.formatContext(contextData)[contextFieldName];\n\t\t\tconst updatedMetadata = this.formatMetadata(metadata)[metadataFieldName];\n\t\t\td = { [contextFieldName]: {\n\t\t\t\t...formattedContextData,\n\t\t\t\t...updatedMetadata\n\t\t\t} };\n\t\t} else d = {\n\t\t\t...this.formatContext(contextData),\n\t\t\t...this.formatMetadata(metadata)\n\t\t};\n\t\tif (err) {\n\t\t\tconst serializedError = errorSerializer ? errorSerializer(err) : err;\n\t\t\tif (errorFieldInMetadata && metadata && metadataFieldName) if (d?.[metadataFieldName]) d[metadataFieldName][errorFieldName] = serializedError;\n\t\t\telse d = {\n\t\t\t\t...d,\n\t\t\t\t[metadataFieldName]: { [errorFieldName]: serializedError }\n\t\t\t};\n\t\t\telse if (errorFieldInMetadata && !metadata && metadataFieldName) d = {\n\t\t\t\t...d,\n\t\t\t\t[metadataFieldName]: { [errorFieldName]: serializedError }\n\t\t\t};\n\t\t\telse d = {\n\t\t\t\t...d,\n\t\t\t\t[errorFieldName]: serializedError\n\t\t\t};\n\t\t\thasObjData = true;\n\t\t}\n\t\tif (this.pluginManager.hasPlugins(PluginCallbackType$1.onBeforeDataOut)) {\n\t\t\td = this.pluginManager.runOnBeforeDataOut({\n\t\t\t\tdata: hasObjData ? d : void 0,\n\t\t\t\tlogLevel,\n\t\t\t\terror: err,\n\t\t\t\tmetadata,\n\t\t\t\tcontext: contextData\n\t\t\t}, this);\n\t\t\tif (d && !hasObjData) hasObjData = true;\n\t\t}\n\t\tif (this.pluginManager.hasPlugins(PluginCallbackType$1.onBeforeMessageOut)) params = this.pluginManager.runOnBeforeMessageOut({\n\t\t\tmessages: [...params],\n\t\t\tlogLevel\n\t\t}, this);\n\t\tif (this.pluginManager.hasPlugins(PluginCallbackType$1.transformLogLevel)) logLevel = this.pluginManager.runTransformLogLevel({\n\t\t\tdata: hasObjData ? d : void 0,\n\t\t\tlogLevel,\n\t\t\tmessages: [...params],\n\t\t\terror: err,\n\t\t\tmetadata,\n\t\t\tcontext: contextData\n\t\t}, this);\n\t\tconst effectiveGroups = this._mergeGroups(groups) ?? void 0;\n\t\tif (this.hasMultipleTransports) {\n\t\t\tconst transportPromises = this._config.transport.filter((transport) => {\n\t\t\t\tif (!transport.enabled) return false;\n\t\t\t\tif (!this._shouldTransportReceiveLog(transport.id, logLevel, groups)) return false;\n\t\t\t\treturn true;\n\t\t\t}).map(async (transport) => {\n\t\t\t\tconst currentLogLevel = logLevel;\n\t\t\t\tif (this.pluginManager.hasPlugins(PluginCallbackType$1.shouldSendToLogger)) {\n\t\t\t\t\tif (!this.pluginManager.runShouldSendToLogger({\n\t\t\t\t\t\tmessages: [...params],\n\t\t\t\t\t\tdata: hasObjData ? d : void 0,\n\t\t\t\t\t\tlogLevel: currentLogLevel,\n\t\t\t\t\t\ttransportId: transport.id,\n\t\t\t\t\t\terror: err,\n\t\t\t\t\t\tmetadata,\n\t\t\t\t\t\tcontext: contextData,\n\t\t\t\t\t\tgroups: effectiveGroups\n\t\t\t\t\t}, this)) return;\n\t\t\t\t}\n\t\t\t\treturn transport._sendToLogger({\n\t\t\t\t\tlogLevel: currentLogLevel,\n\t\t\t\t\tmessages: [...params],\n\t\t\t\t\tdata: hasObjData ? d : void 0,\n\t\t\t\t\thasData: hasObjData,\n\t\t\t\t\terror: err,\n\t\t\t\t\tmetadata,\n\t\t\t\t\tcontext: contextData,\n\t\t\t\t\tgroups: effectiveGroups\n\t\t\t\t});\n\t\t\t});\n\t\t\tPromise.all(transportPromises).catch((err) => {\n\t\t\t\tif (this._config.consoleDebug) console.error(\"[LogLayer] Error executing transports:\", err);\n\t\t\t});\n\t\t} else {\n\t\t\tif (!this.singleTransport?.enabled) return;\n\t\t\tif (!this._shouldTransportReceiveLog(this.singleTransport.id, logLevel, groups)) return;\n\t\t\tif (this.pluginManager.hasPlugins(PluginCallbackType$1.shouldSendToLogger)) {\n\t\t\t\tif (!this.pluginManager.runShouldSendToLogger({\n\t\t\t\t\tmessages: [...params],\n\t\t\t\t\tdata: hasObjData ? d : void 0,\n\t\t\t\t\tlogLevel,\n\t\t\t\t\ttransportId: this.singleTransport.id,\n\t\t\t\t\terror: err,\n\t\t\t\t\tmetadata,\n\t\t\t\t\tcontext: contextData,\n\t\t\t\t\tgroups: effectiveGroups\n\t\t\t\t}, this)) return;\n\t\t\t}\n\t\t\tthis.singleTransport._sendToLogger({\n\t\t\t\tlogLevel,\n\t\t\t\tmessages: [...params],\n\t\t\t\tdata: hasObjData ? d : void 0,\n\t\t\t\thasData: hasObjData,\n\t\t\t\terror: err,\n\t\t\t\tmetadata,\n\t\t\t\tcontext: contextData,\n\t\t\t\tgroups: effectiveGroups\n\t\t\t});\n\t\t}\n\t}\n};\n\n//#endregion\n//#region src/MockLogBuilder.ts\n/**\n* A mock implementation of the ILogBuilder interface that does nothing.\n* Useful for writing unit tests.\n*/\nvar MockLogBuilder = class {\n\tdebug(..._messages) {}\n\terror(..._messages) {}\n\tinfo(..._messages) {}\n\ttrace(..._messages) {}\n\twarn(..._messages) {}\n\tfatal(..._messages) {}\n\tenableLogging() {\n\t\treturn this;\n\t}\n\tdisableLogging() {\n\t\treturn this;\n\t}\n\twithMetadata(_metadata) {\n\t\treturn this;\n\t}\n\twithError(_error) {\n\t\treturn this;\n\t}\n\twithGroup(_group) {\n\t\treturn this;\n\t}\n};\n\n//#endregion\n//#region src/MockLogLayer.ts\n/* istanbul ignore file */\n/**\n* A mock implementation of the ILogLayer interface that does nothing.\n* Useful for writing unit tests.\n* MockLogLayer implements both ILogLayer and ILogBuilder for simplicity in testing.\n*/\nvar MockLogLayer = class {\n\tmockLogBuilder = new MockLogBuilder();\n\tmockContextManager = new MockContextManager();\n\tmockLogLevelManager = new MockLogLevelManager();\n\tinfo(..._messages) {}\n\twarn(..._messages) {}\n\terror(..._messages) {}\n\tdebug(..._messages) {}\n\ttrace(..._messages) {}\n\tfatal(..._messages) {}\n\traw(_rawEntry) {}\n\tgetLoggerInstance(_id) {}\n\terrorOnly(_error, _opts) {}\n\tmetadataOnly(_metadata, _logLevel) {}\n\taddPlugins(_plugins) {}\n\tremovePlugin(_id) {}\n\tenablePlugin(_id) {}\n\tdisablePlugin(_id) {}\n\twithPrefix(_prefix) {\n\t\treturn this;\n\t}\n\twithGroup(_group) {\n\t\treturn this;\n\t}\n\taddGroup(_name, _config) {\n\t\treturn this;\n\t}\n\tremoveGroup(_name) {\n\t\treturn this;\n\t}\n\tenableGroup(_name) {\n\t\treturn this;\n\t}\n\tdisableGroup(_name) {\n\t\treturn this;\n\t}\n\tsetGroupLevel(_name, _level) {\n\t\treturn this;\n\t}\n\tsetActiveGroups(_groups) {\n\t\treturn this;\n\t}\n\tgetGroups() {\n\t\treturn {};\n\t}\n\twithContext(_context) {\n\t\treturn this;\n\t}\n\twithError(_error) {\n\t\treturn this.mockLogBuilder.withError(_error);\n\t}\n\twithMetadata(_metadata) {\n\t\treturn this.mockLogBuilder.withMetadata(_metadata);\n\t}\n\tgetContext(_options) {\n\t\treturn {};\n\t}\n\tclearContext(_keys) {\n\t\treturn this;\n\t}\n\tenableLogging() {\n\t\treturn this;\n\t}\n\tdisableLogging() {\n\t\treturn this;\n\t}\n\tchild() {\n\t\treturn this;\n\t}\n\tmuteContext() {\n\t\treturn this;\n\t}\n\tunMuteContext() {\n\t\treturn this;\n\t}\n\tmuteMetadata() {\n\t\treturn this;\n\t}\n\tunMuteMetadata() {\n\t\treturn this;\n\t}\n\twithFreshTransports(_transports) {\n\t\treturn this;\n\t}\n\taddTransport(_transports) {\n\t\treturn this;\n\t}\n\tremoveTransport(_id) {\n\t\treturn true;\n\t}\n\twithFreshPlugins(_plugins) {\n\t\treturn this;\n\t}\n\twithContextManager(_contextManager) {\n\t\treturn this;\n\t}\n\tgetContextManager() {\n\t\treturn this.mockContextManager;\n\t}\n\twithLogLevelManager(_logLevelManager) {\n\t\treturn this;\n\t}\n\tgetLogLevelManager() {\n\t\treturn this.mockLogLevelManager;\n\t}\n\tgetConfig() {\n\t\treturn {};\n\t}\n\t/**\n\t* Sets the mock log builder to use for testing.\n\t*/\n\tsetMockLogBuilder(mockLogBuilder) {\n\t\tthis.mockLogBuilder = mockLogBuilder;\n\t}\n\tenableIndividualLevel(_logLevel) {\n\t\treturn this;\n\t}\n\tdisableIndividualLevel(_logLevel) {\n\t\treturn this;\n\t}\n\tsetLevel(_logLevel) {\n\t\treturn this;\n\t}\n\tisLevelEnabled(_logLevel) {\n\t\treturn true;\n\t}\n\t/**\n\t* Returns the mock log builder used for testing.\n\t*/\n\tgetMockLogBuilder() {\n\t\treturn this.mockLogBuilder;\n\t}\n\t/**\n\t* Resets the mock log builder to a new instance of MockLogBuilder.\n\t*/\n\tresetMockLogBuilder() {\n\t\tthis.mockLogBuilder = new MockLogBuilder();\n\t}\n};\n\n//#endregion\n//#region src/types/mixin.types.ts\n/**\n* The class that the mixin extends\n*/\nlet LogLayerMixinAugmentType = /* @__PURE__ */ function(LogLayerMixinAugmentType) {\n\t/**\n\t* Mixin extends the LogBuilder prototype\n\t*/\n\tLogLayerMixinAugmentType[\"LogBuilder\"] = \"LogBuilder\";\n\t/**\n\t* Mixin extends the LogLayer prototype\n\t*/\n\tLogLayerMixinAugmentType[\"LogLayer\"] = \"LogLayer\";\n\treturn LogLayerMixinAugmentType;\n}({});\n\n//#endregion\n//#region src/mixins.ts\nconst mixinRegistry = {\n\tlogLayerHandlers: [],\n\tpluginsToInit: [],\n\tlogBuilderHandlers: []\n};\n/**\n* Adds one or more mixins to LogLayer.\n* @param mixin - The mixin(s) to register. Can be a single mixin registration or an array of mixin registrations.\n*/\nfunction useLogLayerMixin(mixin) {\n\tconst mixins = Array.isArray(mixin) ? mixin : [mixin];\n\tfor (const mixinRegistration of mixins) {\n\t\tif (mixinRegistration.pluginsToAdd) for (const plugin of mixinRegistration.pluginsToAdd) mixinRegistry.pluginsToInit.push(plugin);\n\t\tfor (const mixinToAdd of mixinRegistration.mixinsToAdd) switch (mixinToAdd.augmentationType) {\n\t\t\tcase LogLayerMixinAugmentType.LogLayer:\n\t\t\t\tif (mixinToAdd.onConstruct) mixinRegistry.logLayerHandlers.push({ onConstruct: mixinToAdd.onConstruct });\n\t\t\t\tmixinToAdd.augment(LogLayer.prototype);\n\t\t\t\tmixinToAdd.augmentMock(MockLogLayer.prototype);\n\t\t\t\tbreak;\n\t\t\tcase LogLayerMixinAugmentType.LogBuilder:\n\t\t\t\tif (mixinToAdd.onConstruct) mixinRegistry.logBuilderHandlers.push({ onConstruct: mixinToAdd.onConstruct });\n\t\t\t\tmixinToAdd.augment(LogBuilder.prototype);\n\t\t\t\tmixinToAdd.augmentMock(MockLogBuilder.prototype);\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n\n//#endregion\n//#region src/LogBuilder.ts\n/**\n* A class that contains methods to specify log metadata and an error and assembles\n* it to form a data object that can be passed into the transport.\n*/\nvar LogBuilder = class {\n\terr;\n\tmetadata;\n\tstructuredLogger;\n\thasMetadata;\n\tpluginManager;\n\t_groups = null;\n\tconstructor(structuredLogger) {\n\t\tthis.err = null;\n\t\tthis.metadata = {};\n\t\tthis.structuredLogger = structuredLogger;\n\t\tthis.hasMetadata = false;\n\t\tthis.pluginManager = structuredLogger[\"pluginManager\"];\n\t\tif (mixinRegistry.logBuilderHandlers.length > 0) mixinRegistry.logBuilderHandlers.forEach((mixin) => {\n\t\t\tif (mixin.onConstruct) mixin.onConstruct(this, structuredLogger);\n\t\t});\n\t}\n\t/**\n\t* Specifies metadata to include with the log message\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/metadata.html | Metadata Docs}\n\t*/\n\twithMetadata(metadata) {\n\t\tconst { pluginManager, structuredLogger: { _config: { consoleDebug } } } = this;\n\t\tif (!metadata) {\n\t\t\tif (consoleDebug) console.debug(\"[LogLayer] withMetadata was called with no metadata; dropping.\");\n\t\t\treturn this;\n\t\t}\n\t\tlet data = metadata;\n\t\tif (pluginManager.hasPlugins(PluginCallbackType$1.onMetadataCalled)) {\n\t\t\tdata = pluginManager.runOnMetadataCalled(metadata, this.structuredLogger);\n\t\t\tif (!data) {\n\t\t\t\tif (consoleDebug) console.debug(\"[LogLayer] Metadata was dropped due to plugin returning falsy value.\");\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\t\tthis.metadata = {\n\t\t\t...this.metadata,\n\t\t\t...data\n\t\t};\n\t\tthis.hasMetadata = true;\n\t\treturn this;\n\t}\n\t/**\n\t* Specifies an Error to include with the log message\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/error-handling.html | Error Handling Docs}\n\t*/\n\twithError(error) {\n\t\tthis.err = error;\n\t\treturn this;\n\t}\n\t/**\n\t* Tags this log entry with one or more groups for routing.\n\t*\n\t* @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs}\n\t*/\n\twithGroup(group) {\n\t\tconst newGroups = Array.isArray(group) ? group : [group];\n\t\tif (this._groups) {\n\t\t\tconst combined = new Set([...this._groups, ...newGroups]);\n\t\t\tthis._groups = Array.from(combined);\n\t\t} else this._groups = [...newGroups];\n\t\treturn this;\n\t}\n\t/**\n\t* Sends a log message to the logging library under an info log level.\n\t*/\n\tinfo(...messages) {\n\t\tif (!this.structuredLogger.isLevelEnabled(LogLevel$1.info)) return;\n\t\tthis.structuredLogger._formatMessage(messages);\n\t\treturn this.formatLog(LogLevel$1.info, messages);\n\t}\n\t/**\n\t* Sends a log message to the logging library under the warn log level\n\t*/\n\twarn(...messages) {\n\t\tif (!this.structuredLogger.isLevelEnabled(LogLevel$1.warn)) return;\n\t\tthis.structuredLogger._formatMessage(messages);\n\t\treturn this.formatLog(LogLevel$1.warn, messages);\n\t}\n\t/**\n\t* Sends a log message to the logging library under the error log level\n\t*/\n\terror(...messages) {\n\t\tif (!this.structuredLogger.isLevelEnabled(LogLevel$1.error)) return;\n\t\tthis.structuredLogger._formatMessage(messages);\n\t\treturn this.formatLog(LogLevel$1.error, messages);\n\t}\n\t/**\n\t* Sends a log message to the logging library under the debug log level\n\t*\n\t* The logging library may or may not support multiple message parameters and only\n\t* the first parameter would be used.\n\t*/\n\tdebug(...messages) {\n\t\tif (!this.structuredLogger.isLevelEnabled(LogLevel$1.debug)) return;\n\t\tthis.structuredLogger._formatMessage(messages);\n\t\treturn this.formatLog(LogLevel$1.debug, messages);\n\t}\n\t/**\n\t* Sends a log message to the logging library under the trace log level\n\t*\n\t* The logging library may or may not support multiple message parameters and only\n\t* the first parameter would be used.\n\t*/\n\ttrace(...messages) {\n\t\tif (!this.structuredLogger.isLevelEnabled(LogLevel$1.trace)) return;\n\t\tthis.structuredLogger._formatMessage(messages);\n\t\treturn this.formatLog(LogLevel$1.trace, messages);\n\t}\n\t/**\n\t* Sends a log message to the logging library under the fatal log level\n\t*\n\t* The logging library may or may not support multiple message parameters and only\n\t* the first parameter would be used.\n\t*/\n\tfatal(...messages) {\n\t\tif (!this.structuredLogger.isLevelEnabled(LogLevel$1.fatal)) return;\n\t\tthis.structuredLogger._formatMessage(messages);\n\t\treturn this.formatLog(LogLevel$1.fatal, messages);\n\t}\n\t/**\n\t* All logging inputs are dropped and stops sending logs to the logging library.\n\t*/\n\tdisableLogging() {\n\t\tthis.structuredLogger.disableLogging();\n\t\treturn this;\n\t}\n\t/**\n\t* Enable sending logs to the logging library.\n\t*/\n\tenableLogging() {\n\t\tthis.structuredLogger.enableLogging();\n\t\treturn this;\n\t}\n\tformatLog(logLevel, params) {\n\t\tconst { muteMetadata } = this.structuredLogger._config;\n\t\tconst hasData = muteMetadata ? false : this.hasMetadata;\n\t\treturn this.structuredLogger._formatLog({\n\t\t\tlogLevel,\n\t\t\tparams,\n\t\t\tmetadata: hasData ? this.metadata : null,\n\t\t\terr: this.err,\n\t\t\tgroups: this._groups\n\t\t});\n\t}\n};\n\n//#endregion\n//#region src/TestLoggingLibrary.ts\n/**\n* A test logging library that can be used to test LogLayer plugins and transports.\n* It is meant to be used with the TestTransport.\n*/\nvar TestLoggingLibrary = class {\n\t/**\n\t* An array of log lines that have been logged.\n\t*/\n\tlines;\n\tconstructor() {\n\t\tthis.lines = [];\n\t}\n\tinfo(...params) {\n\t\tthis.addLine(LogLevel$1.info, params);\n\t}\n\twarn(...params) {\n\t\tthis.addLine(LogLevel$1.warn, params);\n\t}\n\terror(...params) {\n\t\tthis.addLine(LogLevel$1.error, params);\n\t}\n\tdebug(...params) {\n\t\tthis.addLine(LogLevel$1.debug, params);\n\t}\n\ttrace(...params) {\n\t\tthis.addLine(LogLevel$1.trace, params);\n\t}\n\tfatal(...params) {\n\t\tthis.addLine(LogLevel$1.fatal, params);\n\t}\n\taddLine(logLevel, params) {\n\t\tthis.lines.push({\n\t\t\tlevel: logLevel,\n\t\t\tdata: params\n\t\t});\n\t}\n\t/**\n\t* Get the last line that was logged. Returns null if no lines have been logged.\n\t*/\n\tgetLastLine() {\n\t\tif (!this.lines.length) return null;\n\t\treturn this.lines[this.lines.length - 1];\n\t}\n\t/**\n\t* Pops the last line that was logged. Returns null if no lines have been logged.\n\t*/\n\tpopLine() {\n\t\treturn this.lines.pop();\n\t}\n\t/**\n\t* Clears all lines that have been logged.\n\t*/\n\tclearLines() {\n\t\tthis.lines = [];\n\t}\n};\n\n//#endregion\n//#region src/transports/BlankTransport.ts\n/**\n* A transport that allows users to quickly create custom transports by providing their own `shipToLogger` function.\n*\n* This is useful for creating simple custom transports without having to create a completely new transport class from scratch.\n*\n* @example\n* ```typescript\n* import { LogLayer, BlankTransport } from 'loglayer';\n*\n* const log = new LogLayer({\n* transport: new BlankTransport({\n* shipToLogger: ({ logLevel, messages, data, hasData }) => {\n* // Your custom logging logic here\n* console.log(`[${logLevel}]`, ...messages, data && hasData ? data : '');\n* return messages;\n* }\n* })\n* });\n* ```\n*/\nvar BlankTransport = class extends LoggerlessTransport {\n\tshipToLoggerFn;\n\tconstructor(config) {\n\t\tsuper(config);\n\t\tthis.shipToLoggerFn = config.shipToLogger;\n\t}\n\tshipToLogger(params) {\n\t\treturn this.shipToLoggerFn(params);\n\t}\n};\n\n//#endregion\n//#region src/transports/ConsoleTransport.ts\n/**\n* Transport for use with a console logger.\n*/\nvar ConsoleTransport = class extends BaseTransport {\n\tappendObjectData;\n\tlogLevel;\n\tmessageField;\n\tdateField;\n\tlevelField;\n\tdateFn;\n\tlevelFn;\n\tstringify;\n\tmessageFn;\n\tconstructor(params) {\n\t\tsuper(params);\n\t\tthis.appendObjectData = params.appendObjectData || false;\n\t\tthis.logLevel = params.level ?? \"trace\";\n\t\tthis.messageField = params.messageField;\n\t\tthis.dateField = params.dateField;\n\t\tthis.levelField = params.levelField;\n\t\tthis.dateFn = params.dateFn;\n\t\tthis.levelFn = params.levelFn;\n\t\tthis.stringify = params.stringify || false;\n\t\tthis.messageFn = params.messageFn;\n\t}\n\tshipToLogger(params) {\n\t\tconst { logLevel, data, hasData } = params;\n\t\tlet { messages } = params;\n\t\tif (LogLevelPriority$1[logLevel] < LogLevelPriority$1[this.logLevel]) return;\n\t\tif (this.messageFn) messages = [this.messageFn(params)];\n\t\tif (this.messageField) {\n\t\t\tconst messageText = messages.join(\" \");\n\t\t\tconst logObject = {\n\t\t\t\t...data || {},\n\t\t\t\t[this.messageField]: messageText,\n\t\t\t\t...this.dateField && { [this.dateField]: this.dateFn ? this.dateFn() : (/* @__PURE__ */ new Date()).toISOString() },\n\t\t\t\t...this.levelField && { [this.levelField]: this.levelFn ? this.levelFn(logLevel) : logLevel }\n\t\t\t};\n\t\t\tmessages = [this.stringify ? JSON.stringify(logObject) : logObject];\n\t\t} else if (this.dateField || this.levelField) {\n\t\t\tconst logObject = {\n\t\t\t\t...data || {},\n\t\t\t\t...this.dateField && { [this.dateField]: this.dateFn ? this.dateFn() : (/* @__PURE__ */ new Date()).toISOString() },\n\t\t\t\t...this.levelField && { [this.levelField]: this.levelFn ? this.levelFn(logLevel) : logLevel }\n\t\t\t};\n\t\t\tif (this.stringify) messages.push(JSON.stringify(logObject));\n\t\t\telse messages.push(logObject);\n\t\t} else if (data && hasData) if (this.appendObjectData) messages.push(data);\n\t\telse messages.unshift(data);\n\t\tswitch (logLevel) {\n\t\t\tcase LogLevel$1.info:\n\t\t\t\tthis.logger.info(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.warn:\n\t\t\t\tthis.logger.warn(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.error:\n\t\t\t\tthis.logger.error(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.trace:\n\t\t\t\tthis.logger.trace(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.debug:\n\t\t\t\tthis.logger.debug(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.fatal:\n\t\t\t\tthis.logger.error(...messages);\n\t\t\t\tbreak;\n\t\t}\n\t\treturn messages;\n\t}\n};\n\n//#endregion\n//#region src/transports/StructuredTransport.ts\n/**\n* A console transport with structured logging enabled by default.\n* Outputs logs as objects with `msg`, `level`, and `time` fields.\n*/\nvar StructuredTransport = class extends BaseTransport {\n\tlogLevel;\n\tmessageField;\n\tdateField;\n\tlevelField;\n\tdateFn;\n\tlevelFn;\n\tstringify;\n\tmessageFn;\n\tconstructor(params) {\n\t\tsuper(params);\n\t\tthis.logLevel = params.level ?? \"trace\";\n\t\tthis.messageField = params.messageField ?? \"msg\";\n\t\tthis.dateField = params.dateField ?? \"time\";\n\t\tthis.levelField = params.levelField ?? \"level\";\n\t\tthis.dateFn = params.dateFn;\n\t\tthis.levelFn = params.levelFn;\n\t\tthis.stringify = params.stringify || false;\n\t\tthis.messageFn = params.messageFn;\n\t}\n\tshipToLogger(params) {\n\t\tconst { logLevel, data } = params;\n\t\tlet { messages } = params;\n\t\tif (LogLevelPriority$1[logLevel] < LogLevelPriority$1[this.logLevel]) return;\n\t\tif (this.messageFn) messages = [this.messageFn(params)];\n\t\tconst messageText = messages.join(\" \");\n\t\tconst logObject = {\n\t\t\t[this.levelField]: this.levelFn ? this.levelFn(logLevel) : logLevel,\n\t\t\t[this.dateField]: this.dateFn ? this.dateFn() : (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\t[this.messageField]: messageText,\n\t\t\t...data || {}\n\t\t};\n\t\tmessages = [this.stringify ? JSON.stringify(logObject) : logObject];\n\t\tswitch (logLevel) {\n\t\t\tcase LogLevel$1.info:\n\t\t\t\tthis.logger.info(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.warn:\n\t\t\t\tthis.logger.warn(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.error:\n\t\t\t\tthis.logger.error(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.trace:\n\t\t\t\tthis.logger.trace(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.debug:\n\t\t\t\tthis.logger.debug(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.fatal:\n\t\t\t\tthis.logger.error(...messages);\n\t\t\t\tbreak;\n\t\t}\n\t\treturn messages;\n\t}\n};\n\n//#endregion\n//#region src/transports/TestTransport.ts\n/**\n* Transport used for testing purposes.\n*/\nvar TestTransport = class extends BaseTransport {\n\tshipToLogger({ logLevel, messages, data, hasData }) {\n\t\tif (data && hasData) messages.unshift(data);\n\t\tswitch (logLevel) {\n\t\t\tcase LogLevel$1.info:\n\t\t\t\tthis.logger.info(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.warn:\n\t\t\t\tthis.logger.warn(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.error:\n\t\t\t\tthis.logger.error(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.trace:\n\t\t\t\tthis.logger.trace(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.debug:\n\t\t\t\tthis.logger.debug(...messages);\n\t\t\t\tbreak;\n\t\t\tcase LogLevel$1.fatal:\n\t\t\t\tthis.logger.fatal(...messages);\n\t\t\t\tbreak;\n\t\t}\n\t\treturn messages;\n\t}\n};\n\n//#endregion\nexport { BlankTransport, ConsoleTransport, LAZY_EVAL_ERROR, LAZY_SYMBOL, LogBuilder, LogLayer, LogLayerMixinAugmentType, LogLevel, MockLogBuilder, MockLogLayer, PluginCallbackType, StructuredTransport, TestLoggingLibrary, TestTransport, lazy, useLogLayerMixin };",
|
|
141
|
-
"const isNonErrorSymbol = Symbol('isNonError');\n\nfunction defineProperty(object, key, value) {\n\tObject.defineProperty(object, key, {\n\t\tvalue,\n\t\twritable: false,\n\t\tenumerable: false,\n\t\tconfigurable: false,\n\t});\n}\n\nfunction stringify(value) {\n\tif (value === undefined) {\n\t\treturn 'undefined';\n\t}\n\n\tif (value === null) {\n\t\treturn 'null';\n\t}\n\n\tif (typeof value === 'string') {\n\t\treturn value;\n\t}\n\n\tif (typeof value === 'number' || typeof value === 'boolean') {\n\t\treturn String(value);\n\t}\n\n\tif (typeof value === 'bigint') {\n\t\treturn `${value}n`;\n\t}\n\n\tif (typeof value === 'symbol') {\n\t\treturn value.toString();\n\t}\n\n\tif (typeof value === 'function') {\n\t\treturn `[Function${value.name ? ` ${value.name}` : ' (anonymous)'}]`;\n\t}\n\n\t// TODO: Use `Error.isError` when targeting Node.js 24\n\tif (value instanceof Error) {\n\t\ttry {\n\t\t\treturn String(value);\n\t\t} catch {\n\t\t\treturn '<Unserializable error>';\n\t\t}\n\t}\n\n\ttry {\n\t\treturn JSON.stringify(value);\n\t} catch {\n\t\ttry {\n\t\t\treturn String(value);\n\t\t} catch {\n\t\t\treturn '<Unserializable value>';\n\t\t}\n\t}\n}\n\nexport default class NonError extends Error {\n\tconstructor(value, {superclass: Superclass = Error} = {}) {\n\t\t// If already a NonError, return it as-is\n\t\tif (NonError.isNonError(value)) {\n\t\t\treturn value; // eslint-disable-line no-constructor-return\n\t\t}\n\n\t\tif (value instanceof Error) {\n\t\t\tthrow new TypeError('Do not pass Error instances to NonError. Throw the error directly instead.');\n\t\t}\n\n\t\tsuper(`Non-error value: ${stringify(value)}`);\n\n\t\tif (Superclass !== Error) {\n\t\t\t// Change this instance's prototype to Superclass.prototype\n\t\t\t// This makes instanceof Superclass work\n\t\t\tObject.setPrototypeOf(this, Superclass.prototype);\n\t\t}\n\n\t\tdefineProperty(this, 'name', 'NonError');\n\t\tdefineProperty(this, isNonErrorSymbol, true);\n\t\tdefineProperty(this, 'isNonError', true);\n\t\tdefineProperty(this, 'value', value);\n\t}\n\n\tstatic isNonError(value) {\n\t\treturn value?.[isNonErrorSymbol] === true;\n\t}\n\n\tstatic #handleCallback(callback, arguments_) {\n\t\ttry {\n\t\t\tconst result = callback(...arguments_);\n\n\t\t\t// If the result is thenable (Promise-like), handle async rejections\n\t\t\tif (result && typeof result.then === 'function') {\n\t\t\t\treturn (async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn await result;\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t// TODO: Use `Error.isError` when targeting Node.js 24\n\t\t\t\t\t\tif (error instanceof Error) {\n\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthrow new NonError(error);\n\t\t\t\t\t}\n\t\t\t\t})();\n\t\t\t}\n\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\t// TODO: Use `Error.isError` when targeting Node.js 24\n\t\t\t// If it's already an Error, re-throw as-is\n\t\t\tif (error instanceof Error) {\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\t// Otherwise, wrap it in NonError\n\t\t\tthrow new NonError(error);\n\t\t}\n\t}\n\n\tstatic try(callback) {\n\t\treturn NonError.#handleCallback(callback, []);\n\t}\n\n\tstatic wrap(callback) {\n\t\treturn (...arguments_) => NonError.#handleCallback(callback, arguments_);\n\t}\n\n\t// This makes instanceof work even when using the `superclass` option\n\tstatic [Symbol.hasInstance](instance) {\n\t\treturn NonError.isNonError(instance);\n\t}\n}\n",
|
|
142
|
-
"const list = [\n\t// Native ES errors https://262.ecma-international.org/12.0/#sec-well-known-intrinsic-objects\n\tError,\n\tEvalError,\n\tRangeError,\n\tReferenceError,\n\tSyntaxError,\n\tTypeError,\n\tURIError,\n\tAggregateError,\n\n\t// Built-in errors\n\tglobalThis.DOMException,\n\n\t// Node-specific errors\n\t// https://nodejs.org/api/errors.html\n\tglobalThis.AssertionError,\n\tglobalThis.SystemError,\n]\n\t// Non-native Errors are used with `globalThis` because they might be missing. This filter drops them when undefined.\n\t.filter(Boolean)\n\t.map(constructor => [constructor.name, constructor]);\n\nexport const errorConstructors = new Map(list);\nexport const errorFactories = new Map();\n\nexport function addKnownErrorConstructor(constructor, factory) {\n\tlet instance;\n\tlet resolvedName;\n\n\tif (factory) {\n\t\tif (typeof factory !== 'function') {\n\t\t\tthrow new TypeError('Factory must be a function');\n\t\t}\n\n\t\t// Verify factory can execute without throwing\n\t\ttry {\n\t\t\tinstance = factory();\n\t\t} catch (error) {\n\t\t\tthrow new Error('Factory is not compatible', {cause: error});\n\t\t}\n\n\t\tif (!(instance instanceof constructor)) {\n\t\t\tthrow new TypeError('Factory must return an instance of the constructor');\n\t\t}\n\n\t\tresolvedName = instance.name;\n\t} else {\n\t\ttry {\n\t\t\tinstance = new constructor();\n\t\t} catch (error) {\n\t\t\tthrow new Error(`Constructor \"${constructor.name}\" is not compatible`, {cause: error});\n\t\t}\n\n\t\tresolvedName = instance.name;\n\t}\n\n\tif (!resolvedName || typeof resolvedName !== 'string') {\n\t\tthrow new TypeError('Error instances must have a non-empty string \"name\" property');\n\t}\n\n\tif (errorConstructors.has(resolvedName)) {\n\t\tthrow new Error(`Error constructor \"${resolvedName}\" is already known`);\n\t}\n\n\terrorConstructors.set(resolvedName, constructor);\n\tif (factory) {\n\t\terrorFactories.set(resolvedName, factory);\n\t}\n}\n",
|
|
143
|
-
"import NonError from 'non-error';\nimport {errorConstructors, errorFactories} from './error-constructors.js';\n\nconst errorProperties = [\n\t{\n\t\tproperty: 'name',\n\t\tenumerable: false,\n\t},\n\t{\n\t\tproperty: 'message',\n\t\tenumerable: false,\n\t},\n\t{\n\t\tproperty: 'stack',\n\t\tenumerable: false,\n\t},\n\t{\n\t\tproperty: 'code',\n\t\tenumerable: true,\n\t},\n\t{\n\t\tproperty: 'cause',\n\t\tenumerable: false,\n\t},\n\t{\n\t\tproperty: 'errors',\n\t\tenumerable: false,\n\t},\n];\n\nconst toJsonWasCalled = new WeakSet();\n\nconst toJSON = from => {\n\ttoJsonWasCalled.add(from);\n\tconst json = from.toJSON();\n\ttoJsonWasCalled.delete(from);\n\treturn json;\n};\n\nconst newError = name => {\n\tif (name === 'NonError') {\n\t\treturn new NonError();\n\t}\n\n\tconst factory = errorFactories.get(name);\n\tif (factory) {\n\t\treturn factory();\n\t}\n\n\tconst ErrorConstructor = errorConstructors.get(name) ?? Error;\n\treturn ErrorConstructor === AggregateError\n\t\t? new ErrorConstructor([])\n\t\t: new ErrorConstructor();\n};\n\nconst destroyCircular = ({\n\tfrom,\n\tseen,\n\tto,\n\tforceEnumerable,\n\tmaxDepth,\n\tdepth,\n\tuseToJSON,\n\tserialize,\n}) => {\n\tif (!to) {\n\t\tif (Array.isArray(from)) {\n\t\t\tto = [];\n\t\t} else if (!serialize && isErrorLike(from)) {\n\t\t\tto = newError(from.name);\n\t\t} else {\n\t\t\tto = {};\n\t\t}\n\t}\n\n\tseen.add(from);\n\n\tif (depth >= maxDepth) {\n\t\tseen.delete(from);\n\t\treturn to;\n\t}\n\n\tif (useToJSON && typeof from.toJSON === 'function' && !toJsonWasCalled.has(from)) {\n\t\tseen.delete(from);\n\t\treturn toJSON(from);\n\t}\n\n\tconst continueDestroyCircular = value => destroyCircular({\n\t\tfrom: value,\n\t\tseen,\n\t\tforceEnumerable,\n\t\tmaxDepth,\n\t\tdepth: depth + 1,\n\t\tuseToJSON,\n\t\tserialize,\n\t});\n\n\tfor (const key of Object.keys(from)) {\n\t\tconst value = from[key];\n\n\t\tif (value && value instanceof Uint8Array && value.constructor.name === 'Buffer') {\n\t\t\tto[key] = serialize ? '[object Buffer]' : value;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (value !== null && typeof value === 'object' && typeof value.pipe === 'function') {\n\t\t\tto[key] = serialize ? '[object Stream]' : value;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (typeof value === 'function') {\n\t\t\tif (!serialize) {\n\t\t\t\tto[key] = value;\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (serialize && typeof value === 'bigint') {\n\t\t\tto[key] = `${value}n`;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!value || typeof value !== 'object') {\n\t\t\t// Gracefully handle non-configurable errors like `DOMException`.\n\t\t\ttry {\n\t\t\t\tto[key] = value;\n\t\t\t} catch {}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!seen.has(value)) {\n\t\t\tto[key] = continueDestroyCircular(value);\n\t\t\tcontinue;\n\t\t}\n\n\t\tto[key] = '[Circular]';\n\t}\n\n\tif (serialize || to instanceof Error) {\n\t\tfor (const {property, enumerable} of errorProperties) {\n\t\t\tconst value = from[property];\n\t\t\tif (value === undefined || value === null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(to, property);\n\t\t\tif (descriptor?.configurable === false) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet processedValue = value;\n\t\t\tif (typeof value === 'object') {\n\t\t\t\tprocessedValue = seen.has(value)\n\t\t\t\t\t? '[Circular]'\n\t\t\t\t\t: continueDestroyCircular(value);\n\t\t\t}\n\n\t\t\tObject.defineProperty(to, property, {\n\t\t\t\tvalue: processedValue,\n\t\t\t\tenumerable: forceEnumerable || enumerable,\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t});\n\t\t}\n\t}\n\n\tseen.delete(from);\n\treturn to;\n};\n\nexport function serializeError(value, options = {}) {\n\tconst {\n\t\tmaxDepth = Number.POSITIVE_INFINITY,\n\t\tuseToJSON = true,\n\t} = options;\n\n\tif (typeof value === 'object' && value !== null) {\n\t\treturn destroyCircular({\n\t\t\tfrom: value,\n\t\t\tseen: new Set(),\n\t\t\tforceEnumerable: true,\n\t\t\tmaxDepth,\n\t\t\tdepth: 0,\n\t\t\tuseToJSON,\n\t\t\tserialize: true,\n\t\t});\n\t}\n\n\t// People sometimes throw things besides Error objects…\n\tif (typeof value === 'function') {\n\t\tvalue = '<Function>';\n\t}\n\n\treturn destroyCircular({\n\t\tfrom: new NonError(value),\n\t\tseen: new Set(),\n\t\tforceEnumerable: true,\n\t\tmaxDepth,\n\t\tdepth: 0,\n\t\tuseToJSON,\n\t\tserialize: true,\n\t});\n}\n\nexport function deserializeError(value, options = {}) {\n\tconst {maxDepth = Number.POSITIVE_INFINITY} = options;\n\n\tif (value instanceof Error) {\n\t\treturn value;\n\t}\n\n\tif (isMinimumViableSerializedError(value)) {\n\t\treturn destroyCircular({\n\t\t\tfrom: value,\n\t\t\tseen: new Set(),\n\t\t\tto: newError(value.name),\n\t\t\tmaxDepth,\n\t\t\tdepth: 0,\n\t\t\tserialize: false,\n\t\t});\n\t}\n\n\treturn new NonError(value);\n}\n\nexport function isErrorLike(value) {\n\treturn Boolean(value)\n\t\t&& typeof value === 'object'\n\t\t&& typeof value.name === 'string'\n\t\t&& typeof value.message === 'string'\n\t\t&& typeof value.stack === 'string';\n}\n\n// Used as a weak check for immediately-passed objects, whereas `isErrorLike` is used for nested values to avoid bad detection\nfunction isMinimumViableSerializedError(value) {\n\treturn Boolean(value)\n\t\t&& typeof value === 'object'\n\t\t&& typeof value.message === 'string'\n\t\t&& !Array.isArray(value);\n}\n\nexport {addKnownErrorConstructor} from './error-constructors.js';\nexport {default as NonError} from 'non-error';\n",
|
|
144
|
-
"export const prettyLogStyles = {\n reset: [0, 0],\n bold: [1, 22],\n dim: [2, 22],\n italic: [3, 23],\n underline: [4, 24],\n overline: [53, 55],\n inverse: [7, 27],\n hidden: [8, 28],\n strikethrough: [9, 29],\n black: [30, 39],\n red: [31, 39],\n green: [32, 39],\n yellow: [33, 39],\n blue: [34, 39],\n magenta: [35, 39],\n cyan: [36, 39],\n white: [37, 39],\n blackBright: [90, 39],\n redBright: [91, 39],\n greenBright: [92, 39],\n yellowBright: [93, 39],\n blueBright: [94, 39],\n magentaBright: [95, 39],\n cyanBright: [96, 39],\n whiteBright: [97, 39],\n bgBlack: [40, 49],\n bgRed: [41, 49],\n bgGreen: [42, 49],\n bgYellow: [43, 49],\n bgBlue: [44, 49],\n bgMagenta: [45, 49],\n bgCyan: [46, 49],\n bgWhite: [47, 49],\n bgBlackBright: [100, 49],\n bgRedBright: [101, 49],\n bgGreenBright: [102, 49],\n bgYellowBright: [103, 49],\n bgBlueBright: [104, 49],\n bgMagentaBright: [105, 49],\n bgCyanBright: [106, 49],\n bgWhiteBright: [107, 49],\n};\n",
|
|
145
|
-
"import { prettyLogStyles } from \"./prettyLogStyles.js\";\nexport function formatTemplate(settings, template, values, hideUnsetPlaceholder = false) {\n const templateString = String(template);\n const ansiColorWrap = (placeholderValue, code) => `\\u001b[${code[0]}m${placeholderValue}\\u001b[${code[1]}m`;\n const styleWrap = (value, style) => {\n if (style != null && typeof style === \"string\") {\n return ansiColorWrap(value, prettyLogStyles[style]);\n }\n else if (style != null && Array.isArray(style)) {\n return style.reduce((prevValue, thisStyle) => styleWrap(prevValue, thisStyle), value);\n }\n else {\n if (style != null && style[value.trim()] != null) {\n return styleWrap(value, style[value.trim()]);\n }\n else if (style != null && style[\"*\"] != null) {\n return styleWrap(value, style[\"*\"]);\n }\n else {\n return value;\n }\n }\n };\n const defaultStyle = null;\n return templateString.replace(/{{(.+?)}}/g, (_, placeholder) => {\n const value = values[placeholder] != null ? String(values[placeholder]) : hideUnsetPlaceholder ? \"\" : _;\n return settings.stylePrettyLogs\n ? styleWrap(value, settings?.prettyLogStyles?.[placeholder] ?? defaultStyle) + ansiColorWrap(\"\", prettyLogStyles.reset)\n : value;\n });\n}\n",
|
|
146
|
-
"export function formatNumberAddZeros(value, digits = 2, addNumber = 0) {\n if (value != null && isNaN(value)) {\n return \"\";\n }\n value = value != null ? value + addNumber : value;\n return digits === 2\n ? value == null\n ? \"--\"\n : value < 10\n ? \"0\" + value\n : value.toString()\n : value == null\n ? \"---\"\n : value < 10\n ? \"00\" + value\n : value < 100\n ? \"0\" + value\n : value.toString();\n}\n",
|
|
147
|
-
"export function urlToObject(url) {\n return {\n href: url.href,\n protocol: url.protocol,\n username: url.username,\n password: url.password,\n host: url.host,\n hostname: url.hostname,\n port: url.port,\n pathname: url.pathname,\n search: url.search,\n searchParams: [...url.searchParams].map(([key, value]) => ({ key, value })),\n hash: url.hash,\n origin: url.origin,\n };\n}\n",
|
|
148
|
-
"import { hostname } from \"os\";\nimport { normalize as fileNormalize } from \"path\";\nimport { types, formatWithOptions } from \"util\";\nimport { formatTemplate } from \"../../formatTemplate.js\";\nexport default {\n getCallerStackFrame,\n getErrorTrace,\n getMeta,\n transportJSON,\n transportFormatted,\n isBuffer,\n isError,\n prettyFormatLogObj,\n prettyFormatErrorObj,\n};\nconst meta = {\n runtime: \"Nodejs\",\n runtimeVersion: process?.version,\n hostname: hostname ? hostname() : undefined,\n};\nexport function getMeta(logLevelId, logLevelName, stackDepthLevel, hideLogPositionForPerformance, name, parentNames) {\n return Object.assign({}, meta, {\n name,\n parentNames,\n date: new Date(),\n logLevelId,\n logLevelName,\n path: !hideLogPositionForPerformance ? getCallerStackFrame(stackDepthLevel) : undefined,\n });\n}\nexport function getCallerStackFrame(stackDepthLevel, error = Error()) {\n return stackLineToStackFrame(error?.stack?.split(\"\\n\")?.filter((thisLine) => thisLine.includes(\" at \"))?.[stackDepthLevel]);\n}\nexport function getErrorTrace(error) {\n return error?.stack?.split(\"\\n\")?.reduce((result, line) => {\n if (line.includes(\" at \")) {\n result.push(stackLineToStackFrame(line));\n }\n return result;\n }, []);\n}\nfunction stackLineToStackFrame(line) {\n const pathResult = {\n fullFilePath: undefined,\n fileName: undefined,\n fileNameWithLine: undefined,\n fileColumn: undefined,\n fileLine: undefined,\n filePath: undefined,\n filePathWithLine: undefined,\n method: undefined,\n };\n if (line != null && line.includes(\" at \")) {\n line = line.replace(/^\\s+at\\s+/gm, \"\");\n const errorStackLine = line.split(\" (\");\n const fullFilePath = line?.slice(-1) === \")\" ? line?.match(/\\(([^)]+)\\)/)?.[1] : line;\n const pathArray = fullFilePath?.includes(\":\") ? fullFilePath?.replace(\"file://\", \"\")?.replace(process.cwd(), \"\")?.split(\":\") : undefined;\n const fileColumn = pathArray?.pop();\n const fileLine = pathArray?.pop();\n const filePath = pathArray?.pop();\n const filePathWithLine = fileNormalize(`${filePath}:${fileLine}`);\n const fileName = filePath?.split(\"/\")?.pop();\n const fileNameWithLine = `${fileName}:${fileLine}`;\n if (filePath != null && filePath.length > 0) {\n pathResult.fullFilePath = fullFilePath;\n pathResult.fileName = fileName;\n pathResult.fileNameWithLine = fileNameWithLine;\n pathResult.fileColumn = fileColumn;\n pathResult.fileLine = fileLine;\n pathResult.filePath = filePath;\n pathResult.filePathWithLine = filePathWithLine;\n pathResult.method = errorStackLine?.[1] != null ? errorStackLine?.[0] : undefined;\n }\n }\n return pathResult;\n}\nexport function isError(e) {\n return types?.isNativeError != null ? types.isNativeError(e) : e instanceof Error;\n}\nexport function prettyFormatLogObj(maskedArgs, settings) {\n return maskedArgs.reduce((result, arg) => {\n isError(arg) ? result.errors.push(prettyFormatErrorObj(arg, settings)) : result.args.push(arg);\n return result;\n }, { args: [], errors: [] });\n}\nexport function prettyFormatErrorObj(error, settings) {\n const errorStackStr = getErrorTrace(error).map((stackFrame) => {\n return formatTemplate(settings, settings.prettyErrorStackTemplate, { ...stackFrame }, true);\n });\n const placeholderValuesError = {\n errorName: ` ${error.name} `,\n errorMessage: Object.getOwnPropertyNames(error)\n .reduce((result, key) => {\n if (key !== \"stack\") {\n result.push(error[key]);\n }\n return result;\n }, [])\n .join(\", \"),\n errorStack: errorStackStr.join(\"\\n\"),\n };\n return formatTemplate(settings, settings.prettyErrorTemplate, placeholderValuesError);\n}\nexport function transportFormatted(logMetaMarkup, logArgs, logErrors, settings) {\n const logErrorsStr = (logErrors.length > 0 && logArgs.length > 0 ? \"\\n\" : \"\") + logErrors.join(\"\\n\");\n settings.prettyInspectOptions.colors = settings.stylePrettyLogs;\n console.log(logMetaMarkup + formatWithOptions(settings.prettyInspectOptions, ...logArgs) + logErrorsStr);\n}\nexport function transportJSON(json) {\n console.log(jsonStringifyRecursive(json));\n function jsonStringifyRecursive(obj) {\n const cache = new Set();\n return JSON.stringify(obj, (key, value) => {\n if (typeof value === \"object\" && value !== null) {\n if (cache.has(value)) {\n return \"[Circular]\";\n }\n cache.add(value);\n }\n if (typeof value === \"bigint\") {\n return `${value}`;\n }\n if (typeof value === \"undefined\") {\n return \"[undefined]\";\n }\n return value;\n });\n }\n}\nexport function isBuffer(arg) {\n return Buffer.isBuffer(arg);\n}\n",
|
|
149
|
-
"import { formatTemplate } from \"./formatTemplate.js\";\nimport { formatNumberAddZeros } from \"./formatNumberAddZeros.js\";\nimport { urlToObject } from \"./urlToObj.js\";\nimport Runtime from \"./runtime/nodejs/index.js\";\nexport * from \"./interfaces.js\";\nexport { Runtime };\nexport class BaseLogger {\n constructor(settings, logObj, stackDepthLevel = 4) {\n this.logObj = logObj;\n this.stackDepthLevel = stackDepthLevel;\n this.runtime = Runtime;\n this.settings = {\n type: settings?.type ?? \"pretty\",\n name: settings?.name,\n parentNames: settings?.parentNames,\n minLevel: settings?.minLevel ?? 0,\n argumentsArrayName: settings?.argumentsArrayName,\n hideLogPositionForProduction: settings?.hideLogPositionForProduction ?? false,\n prettyLogTemplate: settings?.prettyLogTemplate ??\n \"{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}\\t{{logLevelName}}\\t{{filePathWithLine}}{{nameWithDelimiterPrefix}}\\t\",\n prettyErrorTemplate: settings?.prettyErrorTemplate ?? \"\\n{{errorName}} {{errorMessage}}\\nerror stack:\\n{{errorStack}}\",\n prettyErrorStackTemplate: settings?.prettyErrorStackTemplate ?? \" • {{fileName}}\\t{{method}}\\n\\t{{filePathWithLine}}\",\n prettyErrorParentNamesSeparator: settings?.prettyErrorParentNamesSeparator ?? \":\",\n prettyErrorLoggerNameDelimiter: settings?.prettyErrorLoggerNameDelimiter ?? \"\\t\",\n stylePrettyLogs: settings?.stylePrettyLogs ?? true,\n prettyLogTimeZone: settings?.prettyLogTimeZone ?? \"UTC\",\n prettyLogStyles: settings?.prettyLogStyles ?? {\n logLevelName: {\n \"*\": [\"bold\", \"black\", \"bgWhiteBright\", \"dim\"],\n SILLY: [\"bold\", \"white\"],\n TRACE: [\"bold\", \"whiteBright\"],\n DEBUG: [\"bold\", \"green\"],\n INFO: [\"bold\", \"blue\"],\n WARN: [\"bold\", \"yellow\"],\n ERROR: [\"bold\", \"red\"],\n FATAL: [\"bold\", \"redBright\"],\n },\n dateIsoStr: \"white\",\n filePathWithLine: \"white\",\n name: [\"white\", \"bold\"],\n nameWithDelimiterPrefix: [\"white\", \"bold\"],\n nameWithDelimiterSuffix: [\"white\", \"bold\"],\n errorName: [\"bold\", \"bgRedBright\", \"whiteBright\"],\n fileName: [\"yellow\"],\n fileNameWithLine: \"white\",\n },\n prettyInspectOptions: settings?.prettyInspectOptions ?? {\n colors: true,\n compact: false,\n depth: Infinity,\n },\n metaProperty: settings?.metaProperty ?? \"_meta\",\n maskPlaceholder: settings?.maskPlaceholder ?? \"[***]\",\n maskValuesOfKeys: settings?.maskValuesOfKeys ?? [\"password\"],\n maskValuesOfKeysCaseInsensitive: settings?.maskValuesOfKeysCaseInsensitive ?? false,\n maskValuesRegEx: settings?.maskValuesRegEx,\n prefix: [...(settings?.prefix ?? [])],\n attachedTransports: [...(settings?.attachedTransports ?? [])],\n overwrite: {\n mask: settings?.overwrite?.mask,\n toLogObj: settings?.overwrite?.toLogObj,\n addMeta: settings?.overwrite?.addMeta,\n addPlaceholders: settings?.overwrite?.addPlaceholders,\n formatMeta: settings?.overwrite?.formatMeta,\n formatLogObj: settings?.overwrite?.formatLogObj,\n transportFormatted: settings?.overwrite?.transportFormatted,\n transportJSON: settings?.overwrite?.transportJSON,\n },\n };\n }\n log(logLevelId, logLevelName, ...args) {\n if (logLevelId < this.settings.minLevel) {\n return;\n }\n const logArgs = [...this.settings.prefix, ...args];\n const maskedArgs = this.settings.overwrite?.mask != null\n ? this.settings.overwrite?.mask(logArgs)\n : this.settings.maskValuesOfKeys != null && this.settings.maskValuesOfKeys.length > 0\n ? this._mask(logArgs)\n : logArgs;\n const thisLogObj = this.logObj != null ? this._recursiveCloneAndExecuteFunctions(this.logObj) : undefined;\n const logObj = this.settings.overwrite?.toLogObj != null ? this.settings.overwrite?.toLogObj(maskedArgs, thisLogObj) : this._toLogObj(maskedArgs, thisLogObj);\n const logObjWithMeta = this.settings.overwrite?.addMeta != null\n ? this.settings.overwrite?.addMeta(logObj, logLevelId, logLevelName)\n : this._addMetaToLogObj(logObj, logLevelId, logLevelName);\n let logMetaMarkup;\n let logArgsAndErrorsMarkup = undefined;\n if (this.settings.overwrite?.formatMeta != null) {\n logMetaMarkup = this.settings.overwrite?.formatMeta(logObjWithMeta?.[this.settings.metaProperty]);\n }\n if (this.settings.overwrite?.formatLogObj != null) {\n logArgsAndErrorsMarkup = this.settings.overwrite?.formatLogObj(maskedArgs, this.settings);\n }\n if (this.settings.type === \"pretty\") {\n logMetaMarkup = logMetaMarkup ?? this._prettyFormatLogObjMeta(logObjWithMeta?.[this.settings.metaProperty]);\n logArgsAndErrorsMarkup = logArgsAndErrorsMarkup ?? this.runtime.prettyFormatLogObj(maskedArgs, this.settings);\n }\n if (logMetaMarkup != null && logArgsAndErrorsMarkup != null) {\n this.settings.overwrite?.transportFormatted != null\n ? this.settings.overwrite?.transportFormatted(logMetaMarkup, logArgsAndErrorsMarkup.args, logArgsAndErrorsMarkup.errors, this.settings)\n : this.runtime.transportFormatted(logMetaMarkup, logArgsAndErrorsMarkup.args, logArgsAndErrorsMarkup.errors, this.settings);\n }\n else {\n this.settings.overwrite?.transportJSON != null\n ? this.settings.overwrite?.transportJSON(logObjWithMeta)\n : this.settings.type !== \"hidden\"\n ? this.runtime.transportJSON(logObjWithMeta)\n : undefined;\n }\n if (this.settings.attachedTransports != null && this.settings.attachedTransports.length > 0) {\n this.settings.attachedTransports.forEach((transportLogger) => {\n transportLogger(logObjWithMeta);\n });\n }\n return logObjWithMeta;\n }\n attachTransport(transportLogger) {\n this.settings.attachedTransports.push(transportLogger);\n }\n getSubLogger(settings, logObj) {\n const subLoggerSettings = {\n ...this.settings,\n ...settings,\n parentNames: this.settings?.parentNames != null && this.settings?.name != null\n ? [...this.settings.parentNames, this.settings.name]\n : this.settings?.name != null\n ? [this.settings.name]\n : undefined,\n prefix: [...this.settings.prefix, ...(settings?.prefix ?? [])],\n };\n const subLogger = new this.constructor(subLoggerSettings, logObj ?? this.logObj, this.stackDepthLevel);\n return subLogger;\n }\n _mask(args) {\n const maskValuesOfKeys = this.settings.maskValuesOfKeysCaseInsensitive !== true ? this.settings.maskValuesOfKeys : this.settings.maskValuesOfKeys.map((key) => key.toLowerCase());\n return args?.map((arg) => {\n return this._recursiveCloneAndMaskValuesOfKeys(arg, maskValuesOfKeys);\n });\n }\n _recursiveCloneAndMaskValuesOfKeys(source, keys, seen = []) {\n if (seen.includes(source)) {\n return { ...source };\n }\n if (typeof source === \"object\" && source !== null) {\n seen.push(source);\n }\n if (this.runtime.isError(source) || this.runtime.isBuffer(source)) {\n return source;\n }\n else if (source instanceof Map) {\n return new Map(source);\n }\n else if (source instanceof Set) {\n return new Set(source);\n }\n else if (Array.isArray(source)) {\n return source.map((item) => this._recursiveCloneAndMaskValuesOfKeys(item, keys, seen));\n }\n else if (source instanceof Date) {\n return new Date(source.getTime());\n }\n else if (source instanceof URL) {\n return urlToObject(source);\n }\n else if (source !== null && typeof source === \"object\") {\n const baseObject = this.runtime.isError(source) ? this._cloneError(source) : Object.create(Object.getPrototypeOf(source));\n return Object.getOwnPropertyNames(source).reduce((o, prop) => {\n o[prop] = keys.includes(this.settings?.maskValuesOfKeysCaseInsensitive !== true ? prop : prop.toLowerCase())\n ? this.settings.maskPlaceholder\n : (() => {\n try {\n return this._recursiveCloneAndMaskValuesOfKeys(source[prop], keys, seen);\n }\n catch (e) {\n return null;\n }\n })();\n return o;\n }, baseObject);\n }\n else {\n if (typeof source === \"string\") {\n let modifiedSource = source;\n for (const regEx of this.settings?.maskValuesRegEx || []) {\n modifiedSource = modifiedSource.replace(regEx, this.settings?.maskPlaceholder || \"\");\n }\n return modifiedSource;\n }\n return source;\n }\n }\n _recursiveCloneAndExecuteFunctions(source, seen = []) {\n if (this.isObjectOrArray(source) && seen.includes(source)) {\n return this.shallowCopy(source);\n }\n if (this.isObjectOrArray(source)) {\n seen.push(source);\n }\n if (Array.isArray(source)) {\n return source.map((item) => this._recursiveCloneAndExecuteFunctions(item, seen));\n }\n else if (source instanceof Date) {\n return new Date(source.getTime());\n }\n else if (this.isObject(source)) {\n return Object.getOwnPropertyNames(source).reduce((o, prop) => {\n const descriptor = Object.getOwnPropertyDescriptor(source, prop);\n if (descriptor) {\n Object.defineProperty(o, prop, descriptor);\n const value = source[prop];\n o[prop] = typeof value === \"function\" ? value() : this._recursiveCloneAndExecuteFunctions(value, seen);\n }\n return o;\n }, Object.create(Object.getPrototypeOf(source)));\n }\n else {\n return source;\n }\n }\n isObjectOrArray(value) {\n return typeof value === \"object\" && value !== null;\n }\n isObject(value) {\n return typeof value === \"object\" && !Array.isArray(value) && value !== null;\n }\n shallowCopy(source) {\n if (Array.isArray(source)) {\n return [...source];\n }\n else {\n return { ...source };\n }\n }\n _toLogObj(args, clonedLogObj = {}) {\n args = args?.map((arg) => (this.runtime.isError(arg) ? this._toErrorObject(arg) : arg));\n if (this.settings.argumentsArrayName == null) {\n if (args.length === 1 && !Array.isArray(args[0]) && this.runtime.isBuffer(args[0]) !== true && !(args[0] instanceof Date)) {\n clonedLogObj = typeof args[0] === \"object\" && args[0] != null ? { ...args[0], ...clonedLogObj } : { 0: args[0], ...clonedLogObj };\n }\n else {\n clonedLogObj = { ...clonedLogObj, ...args };\n }\n }\n else {\n clonedLogObj = {\n ...clonedLogObj,\n [this.settings.argumentsArrayName]: args,\n };\n }\n return clonedLogObj;\n }\n _cloneError(error) {\n const cloned = new error.constructor();\n Object.getOwnPropertyNames(error).forEach((key) => {\n cloned[key] = error[key];\n });\n return cloned;\n }\n _toErrorObject(error) {\n return {\n nativeError: error,\n name: error.name ?? \"Error\",\n message: error.message,\n stack: this.runtime.getErrorTrace(error),\n };\n }\n _addMetaToLogObj(logObj, logLevelId, logLevelName) {\n return {\n ...logObj,\n [this.settings.metaProperty]: this.runtime.getMeta(logLevelId, logLevelName, this.stackDepthLevel, this.settings.hideLogPositionForProduction, this.settings.name, this.settings.parentNames),\n };\n }\n _prettyFormatLogObjMeta(logObjMeta) {\n if (logObjMeta == null) {\n return \"\";\n }\n let template = this.settings.prettyLogTemplate;\n const placeholderValues = {};\n if (template.includes(\"{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}\")) {\n template = template.replace(\"{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}\", \"{{dateIsoStr}}\");\n }\n else {\n if (this.settings.prettyLogTimeZone === \"UTC\") {\n placeholderValues[\"yyyy\"] = logObjMeta?.date?.getUTCFullYear() ?? \"----\";\n placeholderValues[\"mm\"] = formatNumberAddZeros(logObjMeta?.date?.getUTCMonth(), 2, 1);\n placeholderValues[\"dd\"] = formatNumberAddZeros(logObjMeta?.date?.getUTCDate(), 2);\n placeholderValues[\"hh\"] = formatNumberAddZeros(logObjMeta?.date?.getUTCHours(), 2);\n placeholderValues[\"MM\"] = formatNumberAddZeros(logObjMeta?.date?.getUTCMinutes(), 2);\n placeholderValues[\"ss\"] = formatNumberAddZeros(logObjMeta?.date?.getUTCSeconds(), 2);\n placeholderValues[\"ms\"] = formatNumberAddZeros(logObjMeta?.date?.getUTCMilliseconds(), 3);\n }\n else {\n placeholderValues[\"yyyy\"] = logObjMeta?.date?.getFullYear() ?? \"----\";\n placeholderValues[\"mm\"] = formatNumberAddZeros(logObjMeta?.date?.getMonth(), 2, 1);\n placeholderValues[\"dd\"] = formatNumberAddZeros(logObjMeta?.date?.getDate(), 2);\n placeholderValues[\"hh\"] = formatNumberAddZeros(logObjMeta?.date?.getHours(), 2);\n placeholderValues[\"MM\"] = formatNumberAddZeros(logObjMeta?.date?.getMinutes(), 2);\n placeholderValues[\"ss\"] = formatNumberAddZeros(logObjMeta?.date?.getSeconds(), 2);\n placeholderValues[\"ms\"] = formatNumberAddZeros(logObjMeta?.date?.getMilliseconds(), 3);\n }\n }\n const dateInSettingsTimeZone = this.settings.prettyLogTimeZone === \"UTC\" ? logObjMeta?.date : new Date(logObjMeta?.date?.getTime() - logObjMeta?.date?.getTimezoneOffset() * 60000);\n placeholderValues[\"rawIsoStr\"] = dateInSettingsTimeZone?.toISOString();\n placeholderValues[\"dateIsoStr\"] = dateInSettingsTimeZone?.toISOString().replace(\"T\", \" \").replace(\"Z\", \"\");\n placeholderValues[\"logLevelName\"] = logObjMeta?.logLevelName;\n placeholderValues[\"fileNameWithLine\"] = logObjMeta?.path?.fileNameWithLine ?? \"\";\n placeholderValues[\"filePathWithLine\"] = logObjMeta?.path?.filePathWithLine ?? \"\";\n placeholderValues[\"fullFilePath\"] = logObjMeta?.path?.fullFilePath ?? \"\";\n let parentNamesString = this.settings.parentNames?.join(this.settings.prettyErrorParentNamesSeparator);\n parentNamesString = parentNamesString != null && logObjMeta?.name != null ? parentNamesString + this.settings.prettyErrorParentNamesSeparator : undefined;\n placeholderValues[\"name\"] = logObjMeta?.name != null || parentNamesString != null ? (parentNamesString ?? \"\") + logObjMeta?.name ?? \"\" : \"\";\n placeholderValues[\"nameWithDelimiterPrefix\"] =\n placeholderValues[\"name\"].length > 0 ? this.settings.prettyErrorLoggerNameDelimiter + placeholderValues[\"name\"] : \"\";\n placeholderValues[\"nameWithDelimiterSuffix\"] =\n placeholderValues[\"name\"].length > 0 ? placeholderValues[\"name\"] + this.settings.prettyErrorLoggerNameDelimiter : \"\";\n if (this.settings.overwrite?.addPlaceholders != null) {\n this.settings.overwrite?.addPlaceholders(logObjMeta, placeholderValues);\n }\n return formatTemplate(this.settings, template, placeholderValues);\n }\n}\n",
|
|
150
|
-
"import { BaseLogger } from \"./BaseLogger.js\";\nexport * from \"./interfaces.js\";\nexport * from \"./BaseLogger.js\";\nexport class Logger extends BaseLogger {\n constructor(settings, logObj) {\n const isBrowser = typeof window !== \"undefined\" && typeof document !== \"undefined\";\n const isBrowserBlinkEngine = isBrowser ? window.chrome !== undefined && window.CSS !== undefined && window.CSS.supports(\"color\", \"green\") : false;\n const isSafari = isBrowser ? /^((?!chrome|android).)*safari/i.test(navigator.userAgent) : false;\n settings = settings || {};\n settings.stylePrettyLogs = settings.stylePrettyLogs && isBrowser && !isBrowserBlinkEngine ? false : settings.stylePrettyLogs;\n super(settings, logObj, isSafari ? 4 : 5);\n }\n log(logLevelId, logLevelName, ...args) {\n return super.log(logLevelId, logLevelName, ...args);\n }\n silly(...args) {\n return super.log(0, \"SILLY\", ...args);\n }\n trace(...args) {\n return super.log(1, \"TRACE\", ...args);\n }\n debug(...args) {\n return super.log(2, \"DEBUG\", ...args);\n }\n info(...args) {\n return super.log(3, \"INFO\", ...args);\n }\n warn(...args) {\n return super.log(4, \"WARN\", ...args);\n }\n error(...args) {\n return super.log(5, \"ERROR\", ...args);\n }\n fatal(...args) {\n return super.log(6, \"FATAL\", ...args);\n }\n getSubLogger(settings, logObj) {\n return super.getSubLogger(settings, logObj);\n }\n}\n",
|
|
151
|
-
"import { openTelemetryPlugin } from \"@loglayer/plugin-opentelemetry\";\nimport { OpenTelemetryTransport } from \"@loglayer/transport-opentelemetry\";\nimport { TsLogTransport } from \"@loglayer/transport-tslog\";\nimport { LogLayer } from \"loglayer\";\nimport { serializeError } from \"serialize-error\";\nimport { Logger } from \"tslog\";\n\nconst tslogLogger = new Logger({\n\ttype: process.env.NODE_ENV === \"production\" ? \"json\" : \"pretty\",\n\tstylePrettyLogs: process.env.NODE_ENV !== \"production\",\n\tminLevel: process.env.LOG_LEVEL === \"debug\" ? 0 : 3,\n});\n\nconst baseLogger = new LogLayer({\n\ttransport: [new TsLogTransport({ id: \"tslog\", logger: tslogLogger })],\n\tplugins: [openTelemetryPlugin()],\n\terrorSerializer: serializeError,\n});\n\nconst OTEL_TRANSPORT_ID = \"otel\";\n\nexport function attachOtelLogTransport(): void {\n\tbaseLogger.addTransport(\n\t\tnew OpenTelemetryTransport({\n\t\t\tid: OTEL_TRANSPORT_ID,\n\t\t\tenabled: process.env.NODE_ENV !== \"test\",\n\t\t}),\n\t);\n}\n\nexport function detachOtelLogTransport(): void {\n\tbaseLogger.removeTransport(OTEL_TRANSPORT_ID);\n}\n\nif (process.env.LOG_LEVEL !== \"debug\") {\n\tbaseLogger.setLevel(\"info\");\n}\n\n// Preserve broad call-site compatibility during migration from tslog to LogLayer.\nconst log = baseLogger as unknown as {\n\ttrace: (...args: unknown[]) => void;\n\tdebug: (...args: unknown[]) => void;\n\tinfo: (...args: unknown[]) => void;\n\twarn: (...args: unknown[]) => void;\n\terror: (...args: unknown[]) => void;\n\tfatal: (...args: unknown[]) => void;\n\twithMetadata: LogLayer[\"withMetadata\"];\n};\n\nexport { log };\n",
|
|
152
|
-
"import { createHash } from \"node:crypto\";\nimport canonicalize from \"canonicalize\";\n\nexport type JsonPrimitive = string | number | boolean | null;\nexport type JsonValue =\n\t| JsonPrimitive\n\t| JsonValue[]\n\t| { [key: string]: JsonValue };\n\nexport function jcsCanonicalize(value: unknown): string {\n\tconst rendered = canonicalize(value);\n\tif (rendered === undefined) {\n\t\tthrow new TypeError(\"Value is not representable as RFC 8785 JSON\");\n\t}\n\treturn rendered;\n}\n\nexport function jcsSha256(value: unknown): string {\n\treturn createHash(\"sha256\")\n\t\t.update(jcsCanonicalize(value), \"utf8\")\n\t\t.digest(\"hex\");\n}\n\nexport function withoutOwnDigest<T extends Record<string, unknown>>(\n\tdocument: T,\n\tdigestField: keyof T | string,\n): Omit<T, keyof T> & Record<string, unknown> {\n\treturn Object.fromEntries(\n\t\tObject.entries(document).filter(([key]) => key !== digestField),\n\t) as Omit<T, keyof T> & Record<string, unknown>;\n}\n\n/** Hashes a wire document while excluding only its own top-level digest field. */\nexport function documentSha256<T extends Record<string, unknown>>(\n\tdocument: T,\n\tdigestField: keyof T | string,\n): string {\n\treturn jcsSha256(withoutOwnDigest(document, digestField));\n}\n\nexport function assertDocumentSha256<T extends Record<string, unknown>>(\n\tdocument: T,\n\tdigestField: keyof T | string,\n): void {\n\tconst supplied = document[String(digestField)];\n\tif (\n\t\ttypeof supplied !== \"string\" ||\n\t\tsupplied !== documentSha256(document, digestField)\n\t) {\n\t\tthrow new Error(\n\t\t\t`${String(digestField)} does not match RFC 8785 document content`,\n\t\t);\n\t}\n}\n",
|
|
153
|
-
"function hasLoneSurrogate (value) {\n for (let i = 0; i < value.length; i++) {\n const code = value.charCodeAt(i);\n\n if (code >= 0xD800 && code <= 0xDBFF) {\n if (i === value.length - 1) {\n return true;\n }\n const next = value.charCodeAt(i + 1);\n if (!(next >= 0xDC00 && next <= 0xDFFF)) {\n return true;\n }\n i++;\n } else if (code >= 0xDC00 && code <= 0xDFFF) {\n return true;\n }\n }\n\n return false;\n}\n\nexport default function canonicalize (object, seen = new Set()) {\n if (typeof object === 'number' && isNaN(object)) {\n throw new Error('NaN is not allowed');\n }\n\n if (typeof object === 'number' && !isFinite(object)) {\n throw new Error('Infinity is not allowed');\n }\n\n if (typeof object === 'string' && hasLoneSurrogate(object)) {\n throw new Error('Lone surrogate is not allowed');\n }\n\n if (object === null || typeof object !== 'object') {\n return JSON.stringify(object);\n }\n\n if (typeof object.toJSON === 'function') {\n if (seen.has(object)) {\n throw new Error('Circular reference detected');\n }\n seen.add(object);\n const result = canonicalize(object.toJSON(), seen);\n seen.delete(object);\n return result;\n }\n\n if (seen.has(object)) {\n throw new Error('Circular reference detected');\n }\n seen.add(object);\n\n let result;\n if (Array.isArray(object)) {\n const values = object.map((cv) => {\n const value = cv === undefined || typeof cv === 'symbol' ? null : cv;\n return canonicalize(value, seen);\n });\n result = `[${values.join(',')}]`;\n } else {\n const parts = [];\n for (const key of Object.keys(object).sort()) {\n if (object[key] === undefined || typeof object[key] === 'symbol') {\n continue;\n }\n parts.push(`${canonicalize(key)}:${canonicalize(object[key], seen)}`);\n }\n result = `{${parts.join(',')}}`;\n }\n\n seen.delete(object);\n return result;\n}\n",
|
|
154
|
-
"import { documentSha256, jcsSha256 } from \"./identity\";\nimport capabilityPolicyDocument from \"./policies/capability-policy-v3.json\" with {\n\ttype: \"json\",\n};\nimport resourcePolicyDocument from \"./policies/resource-policy-v2.json\" with {\n\ttype: \"json\",\n};\n\nexport const CAPABILITY_POLICY_ID =\n\t\"market-data-vendor-backfill-capabilities/v3\" as const;\nexport const RESOURCE_POLICY_ID =\n\t\"market-data-vendor-backfill-resources/v2\" as const;\nexport const ADAPTER_POLICY_ID = \"cryptohftdata-orderbook-adapter/v1\" as const;\nexport const ACQUISITION_POLICY_ID =\n\t\"cryptohftdata-hourly-acquisition/v2\" as const;\n\nconst {\n\tpolicy_sha256: declaredCapabilityPolicySha256,\n\t...capabilityPolicyContent\n} = capabilityPolicyDocument;\nif (\n\tcapabilityPolicyContent.policy_id !== CAPABILITY_POLICY_ID ||\n\tjcsSha256(capabilityPolicyContent) !== declaredCapabilityPolicySha256\n) {\n\tthrow new Error(\"current capability policy asset identity is invalid\");\n}\n\nexport const CAPABILITY_POLICY = Object.freeze({\n\t...capabilityPolicyContent,\n\tpolicy_id: CAPABILITY_POLICY_ID,\n\tpolicy_sha256: declaredCapabilityPolicySha256,\n});\n\nconst {\n\tpolicy_sha256: declaredResourcePolicySha256,\n\t...resourcePolicyContent\n} = resourcePolicyDocument;\nif (\n\tresourcePolicyContent.policy_id !== RESOURCE_POLICY_ID ||\n\tjcsSha256(resourcePolicyContent) !== declaredResourcePolicySha256\n) {\n\tthrow new Error(\"current resource policy asset identity is invalid\");\n}\n\nexport const RESOURCE_POLICY = Object.freeze({\n\t...resourcePolicyContent,\n\tpolicy_id: RESOURCE_POLICY_ID,\n\tpolicy_sha256: declaredResourcePolicySha256,\n});\n\nexport const EFFECTIVE_ADAPTER_POLICY_PIN = Object.freeze({\n\tpolicy_id: ADAPTER_POLICY_ID,\n\tpolicy_sha256: jcsSha256(capabilityPolicyContent.adapter_policy),\n});\n\nexport const EFFECTIVE_ACQUISITION_POLICY_PIN = Object.freeze({\n\tpolicy_id: ACQUISITION_POLICY_ID,\n\tpolicy_sha256: jcsSha256(capabilityPolicyContent.acquisition_policy),\n});\n\nexport type PolicyPin = {\n\tpolicy_id: string;\n\tpolicy_sha256: string;\n};\n\nexport function assertPolicyDocumentIdentity(\n\tpolicy: Record<string, unknown> & { policy_sha256: string },\n): void {\n\tif (documentSha256(policy, \"policy_sha256\") !== policy.policy_sha256) {\n\t\tthrow new Error(\"policy_sha256 does not match RFC 8785 policy content\");\n\t}\n}\n",
|
|
155
|
-
"import type { BrokerArchiveRow } from \"../broker-execution-archive/types\";\nimport type {\n\tNormalizedOrderBookSnapshot,\n\tOrderBookConstructionMode,\n} from \"../order-book\";\nimport {\n\tcaptureCoreFields,\n\tnormalizeTimestampMs,\n\tsha256Canonical,\n} from \"./capture-contract\";\nimport type { MarketCaptureContext, RawCapture } from \"./types\";\n\nexport class OrderBookValidationError extends Error {\n\treadonly reason: string;\n\n\tconstructor(reason: string) {\n\t\tsuper(`Invalid order-book evidence: ${reason}`);\n\t\tthis.name = \"OrderBookValidationError\";\n\t\tthis.reason = reason;\n\t}\n}\n\ntype ValidLevel = { price: number; amount: number };\n\nexport type CanonicalOrderBookRows = {\n\tsnapshotId: string;\n\tlevels: BrokerArchiveRow[];\n\tsummary: BrokerArchiveRow;\n};\n\nfunction parseSequence(\n\tvalue: NormalizedOrderBookSnapshot[\"sequence\"],\n): number | string | undefined {\n\tif (value === undefined) return undefined;\n\tif (typeof value === \"number\") {\n\t\tif (Number.isSafeInteger(value) && value >= 0) return value;\n\t\tthrow new OrderBookValidationError(\n\t\t\t\"sequence must be a non-negative integer\",\n\t\t);\n\t}\n\tif (typeof value !== \"string\" || !/^\\d+$/.test(value)) {\n\t\tthrow new OrderBookValidationError(\n\t\t\t\"sequence must be a non-negative integer\",\n\t\t);\n\t}\n\tconst parsed = BigInt(value);\n\tif (parsed > 18_446_744_073_709_551_615n) {\n\t\tthrow new OrderBookValidationError(\"sequence exceeds UInt64\");\n\t}\n\treturn parsed.toString(10);\n}\n\nfunction validateSide(\n\tside: \"bid\" | \"ask\",\n\tlevels: number[][],\n\tdepthLimit: number,\n): ValidLevel[] {\n\tif (levels.length === 0) {\n\t\tthrow new OrderBookValidationError(`${side} side is missing`);\n\t}\n\tconst retained = levels.slice(0, depthLimit);\n\tfor (let index = 0; index < retained.length; index += 1) {\n\t\tconst entry = retained[index];\n\t\tconst price = entry?.[0];\n\t\tconst amount = entry?.[1];\n\t\tif (\n\t\t\t!Array.isArray(entry) ||\n\t\t\tentry.length < 2 ||\n\t\t\tprice === undefined ||\n\t\t\tamount === undefined ||\n\t\t\t!Number.isFinite(price) ||\n\t\t\t!Number.isFinite(amount) ||\n\t\t\tprice <= 0 ||\n\t\t\tamount <= 0\n\t\t) {\n\t\t\tthrow new OrderBookValidationError(\n\t\t\t\t`${side} level ${index} has a non-positive or non-finite price/amount`,\n\t\t\t);\n\t\t}\n\t\tif (index > 0) {\n\t\t\tconst previous = retained[index - 1]?.[0];\n\t\t\tif (\n\t\t\t\tprevious === undefined ||\n\t\t\t\t(side === \"bid\" ? price >= previous : price <= previous)\n\t\t\t) {\n\t\t\t\tthrow new OrderBookValidationError(\n\t\t\t\t\t`${side} levels are not strictly ${side === \"bid\" ? \"descending\" : \"ascending\"}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\treturn retained.map(([price, amount]) => ({\n\t\tprice: price as number,\n\t\tamount: amount as number,\n\t}));\n}\n\nfunction normalizedBands(input: readonly number[] | undefined): number[] {\n\tconst bands = input ?? [10, 25, 50, 100];\n\tfor (const band of bands) {\n\t\tif (!Number.isFinite(band) || band <= 0 || !Number.isInteger(band)) {\n\t\t\tthrow new OrderBookValidationError(\n\t\t\t\t\"measurement bands must be positive integer basis points\",\n\t\t\t);\n\t\t}\n\t}\n\treturn [...new Set(bands)].sort((left, right) => left - right);\n}\n\nfunction checksumRow(row: Record<string, unknown>): Record<string, unknown> {\n\treturn { ...row, normalized_row_checksum: sha256Canonical(row) };\n}\n\nfunction commonEvidenceFields(\n\tcontext: MarketCaptureContext,\n\trawCapture: RawCapture,\n\tinput: {\n\t\tsnapshotId: string;\n\t\tsequence?: number | string;\n\t\tdepthLimit: number;\n\t\teventTimeMs: number;\n\t\treceivedTimeMs: number;\n\t\tconstructionMode:\n\t\t\t| OrderBookConstructionMode\n\t\t\t| \"policy_neutral_top_n_state_change_tape/v1\";\n\t},\n): Record<string, unknown> {\n\treturn {\n\t\t...captureCoreFields(context, rawCapture),\n\t\tsource_time_ms: input.eventTimeMs,\n\t\treceived_time_ms: input.receivedTimeMs,\n\t\tsnapshot_id: input.snapshotId,\n\t\tconstruction_mode: input.constructionMode,\n\t\tgap_policy: \"record_gap\",\n\t\tdepth_limit: input.depthLimit,\n\t\tsequence: input.sequence,\n\t\texact_l2_reconstruction_complete: 0,\n\t};\n}\n\nexport function buildCanonicalOrderBookRows(input: {\n\tcontext: MarketCaptureContext;\n\tsnapshot: NormalizedOrderBookSnapshot;\n\trawCapture: RawCapture;\n\tdepthLimit: number;\n\tmeasurementBandsBps?: readonly number[];\n\tconstructionMode?:\n\t\t| OrderBookConstructionMode\n\t\t| \"policy_neutral_top_n_state_change_tape/v1\";\n}): CanonicalOrderBookRows {\n\tif (\n\t\t!Number.isSafeInteger(input.depthLimit) ||\n\t\tinput.depthLimit <= 0 ||\n\t\tinput.depthLimit > 500\n\t) {\n\t\tthrow new OrderBookValidationError(\n\t\t\t\"depth limit must be an integer between 1 and 500\",\n\t\t);\n\t}\n\tif (input.context.feed !== \"ORDERBOOK\") {\n\t\tthrow new OrderBookValidationError(\"capture context feed is not ORDERBOOK\");\n\t}\n\tif (input.constructionMode === \"exact_l2_reconstruction\") {\n\t\tthrow new OrderBookValidationError(\n\t\t\t\"exact L2 requires a complete continuity proof and is unsupported\",\n\t\t);\n\t}\n\n\tlet eventTimeMs: number;\n\tlet receivedTimeMs: number;\n\ttry {\n\t\teventTimeMs = normalizeTimestampMs(\n\t\t\tinput.snapshot.timestamp,\n\t\t\t\"source_time_ms\",\n\t\t);\n\t\treceivedTimeMs = normalizeTimestampMs(\n\t\t\tinput.snapshot.receivedTimestamp,\n\t\t\t\"received_time_ms\",\n\t\t);\n\t} catch (error) {\n\t\tthrow new OrderBookValidationError(\n\t\t\terror instanceof Error ? error.message : \"invalid timestamp\",\n\t\t);\n\t}\n\tif (receivedTimeMs < eventTimeMs) {\n\t\tthrow new OrderBookValidationError(\n\t\t\t\"received timestamp precedes source timestamp\",\n\t\t);\n\t}\n\n\tconst bids = validateSide(\"bid\", input.snapshot.bids, input.depthLimit);\n\tconst asks = validateSide(\"ask\", input.snapshot.asks, input.depthLimit);\n\tconst bestBid = bids[0] as ValidLevel;\n\tconst bestAsk = asks[0] as ValidLevel;\n\tif (bestBid.price >= bestAsk.price) {\n\t\tthrow new OrderBookValidationError(\"book is crossed or locked\");\n\t}\n\tconst sequence = parseSequence(input.snapshot.sequence);\n\tconst midPrice = (bestBid.price + bestAsk.price) / 2;\n\tconst spread = bestAsk.price - bestBid.price;\n\tconst spreadBps = (spread / midPrice) * 10_000;\n\tconst snapshotId = sha256Canonical({\n\t\texchange: input.context.exchange.trim().toLowerCase(),\n\t\ttrading_pair: input.context.symbol.trim().replace(\"/\", \"-\"),\n\t\tsource_time_ms: eventTimeMs,\n\t\tsequence,\n\t\tdepth_limit: input.depthLimit,\n\t\tbids,\n\t\tasks,\n\t\tschema_version: input.context.schemaVersion,\n\t});\n\tconst common = commonEvidenceFields(input.context, input.rawCapture, {\n\t\tsnapshotId,\n\t\tsequence,\n\t\tdepthLimit: input.depthLimit,\n\t\teventTimeMs,\n\t\treceivedTimeMs,\n\t\tconstructionMode: input.constructionMode ?? \"sampled_top_n_snapshot\",\n\t});\n\n\tconst levels: BrokerArchiveRow[] = (\n\t\t[\n\t\t\t[\"bid\", bids],\n\t\t\t[\"ask\", asks],\n\t\t] as const\n\t).flatMap(([side, sideLevels]) =>\n\t\tsideLevels.map(({ price, amount }, levelIndex) => {\n\t\t\tconst row = checksumRow({\n\t\t\t\t...common,\n\t\t\t\tside,\n\t\t\t\tlevel_index: levelIndex,\n\t\t\t\tprice,\n\t\t\t\tamount,\n\t\t\t\tnotional: price * amount,\n\t\t\t\tmid_price: midPrice,\n\t\t\t\tspread_from_mid_bps: Math.abs((price - midPrice) / midPrice) * 10_000,\n\t\t\t});\n\t\t\treturn { table: \"market_data.cex_order_book_levels\", row };\n\t\t}),\n\t);\n\n\tconst bands = normalizedBands(input.measurementBandsBps);\n\tconst bidDepth = bands.map((band) => {\n\t\tconst minimumPrice = bestBid.price * (1 - band / 10_000);\n\t\treturn bids\n\t\t\t.filter(({ price }) => price >= minimumPrice)\n\t\t\t.reduce((sum, { amount }) => sum + amount, 0);\n\t});\n\tconst askDepth = bands.map((band) => {\n\t\tconst maximumPrice = bestAsk.price * (1 + band / 10_000);\n\t\treturn asks\n\t\t\t.filter(({ price }) => price <= maximumPrice)\n\t\t\t.reduce((sum, { amount }) => sum + amount, 0);\n\t});\n\tconst summaryRow = checksumRow({\n\t\t...common,\n\t\tbest_bid: bestBid.price,\n\t\tbest_ask: bestAsk.price,\n\t\tbest_bid_amount: bestBid.amount,\n\t\tbest_ask_amount: bestAsk.amount,\n\t\tmid_price: midPrice,\n\t\tspread,\n\t\tspread_bps: spreadBps,\n\t\tstaleness_ms: receivedTimeMs - eventTimeMs,\n\t\tbid_level_count: bids.length,\n\t\task_level_count: asks.length,\n\t\tmeasurement_bands_bps: bands,\n\t\tbid_depth_by_band: bidDepth,\n\t\task_depth_by_band: askDepth,\n\t});\n\n\treturn {\n\t\tsnapshotId,\n\t\tlevels,\n\t\tsummary: {\n\t\t\ttable: \"market_data.cex_order_book_depth_summary\",\n\t\t\trow: summaryRow,\n\t\t},\n\t};\n}\n",
|
|
156
|
-
"import { sha256Canonical } from \"../market-data-archive/capture-contract\";\nimport {\n\ttype BackfillArchiveRow,\n\tEXTERNAL_BACKFILL_SOURCE,\n\ttype ForwarderBatch,\n} from \"./contracts\";\n\nexport const BACKFILL_MAX_BATCH_ROWS = 1_000;\nexport const BACKFILL_MAX_BATCH_BYTES = 5 * 1024 * 1024;\n\nfunction serializedBytes(value: unknown): number {\n\treturn new TextEncoder().encode(JSON.stringify(value)).byteLength;\n}\n\nexport function buildForwarderBatches(input: {\n\tcaptureBundleId: string;\n\tdeploymentId: string;\n\trows: readonly BackfillArchiveRow[];\n\tmaxRows?: number;\n\tmaxBytes?: number;\n}): ForwarderBatch[] {\n\tconst maxRows = input.maxRows ?? BACKFILL_MAX_BATCH_ROWS;\n\tconst maxBytes = input.maxBytes ?? BACKFILL_MAX_BATCH_BYTES;\n\tconst tables = new Map<string, BackfillArchiveRow[]>();\n\tfor (const row of input.rows) {\n\t\tconst group = tables.get(row.table) ?? [];\n\t\tgroup.push(row);\n\t\ttables.set(row.table, group);\n\t}\n\tconst batches: ForwarderBatch[] = [];\n\tfor (const table of [...tables.keys()].sort()) {\n\t\tconst rows = tables.get(table) as BackfillArchiveRow[];\n\t\tlet chunk: BackfillArchiveRow[] = [];\n\t\tlet chunkBytes = 0;\n\t\tlet ordinal = 0;\n\t\tconst flush = () => {\n\t\t\tif (chunk.length === 0) return;\n\t\t\tconst batchId = sha256Canonical({\n\t\t\t\tcapture_bundle_id: input.captureBundleId,\n\t\t\t\ttable,\n\t\t\t\tchunk_ordinal: ordinal,\n\t\t\t\trows: chunk,\n\t\t\t});\n\t\t\tbatches.push({\n\t\t\t\tsource: EXTERNAL_BACKFILL_SOURCE,\n\t\t\t\tdeployment_id: input.deploymentId,\n\t\t\t\tbatch_id: batchId,\n\t\t\t\trows: chunk,\n\t\t\t});\n\t\t\tordinal += 1;\n\t\t\tchunk = [];\n\t\t\tchunkBytes = 0;\n\t\t};\n\t\tfor (const row of rows) {\n\t\t\tconst bytes = serializedBytes(row);\n\t\t\tif (bytes > maxBytes) {\n\t\t\t\tthrow new Error(`archive_row_exceeds_byte_budget:${table}`);\n\t\t\t}\n\t\t\tif (chunk.length >= maxRows || chunkBytes + bytes > maxBytes) flush();\n\t\t\tchunk.push(row);\n\t\t\tchunkBytes += bytes;\n\t\t}\n\t\tflush();\n\t}\n\treturn batches;\n}\n",
|
|
157
|
-
"import { createHash } from \"node:crypto\";\nimport { decompress } from \"fzstd\";\nimport { parquetReadObjects } from \"hyparquet\";\nimport {\n\tbuildCanonicalOrderBookRows,\n\tOrderBookValidationError,\n} from \"../market-data-archive/canonical-orderbook\";\nimport {\n\tCHECKSUM_ALGORITHM,\n\tcanonicalSerialize,\n\tMARKET_CAPTURE_SCHEMA_VERSION,\n\tsha256Canonical,\n} from \"../market-data-archive/capture-contract\";\nimport type {\n\tMarketCaptureContext,\n\tRawCapture,\n} from \"../market-data-archive/types\";\nimport type {\n\tReconstructionObservation,\n\tReconstructionObservationSink,\n\tSourceObjectEvidence,\n} from \"../market-data-source-forensics\";\nimport {\n\ttype BackfillArchiveRow,\n\tEXTERNAL_BACKFILL_SOURCE,\n\tHISTORICAL_VENDOR_SOURCE_MODE,\n\ttype MarketDataVendorBackfillRequest,\n\ttype ProviderCapability,\n\ttype ProviderObjectEvidence,\n\tVENDOR_DATASET_RAW_CAPTURE_SCOPE,\n} from \"./contracts\";\nimport type { NormalizedBackfill, ProviderDataset } from \"./core\";\nimport { semanticDigest } from \"./semantic-verification\";\n\nexport const CRYPTOHFTDATA_ADAPTER_VERSION =\n\t\"cryptohftdata-orderbook/v2\" as const;\nexport const CRYPTOHFTDATA_API_URL = \"https://api.cryptohftdata.com\" as const;\nexport const DIAGNOSTIC_LAG_THRESHOLDS_MS = [\n\t1_000, 2_000, 5_000, 10_000, 30_000, 60_000,\n] as const;\nexport const SOURCE_TAPE_MAX_STATES_PER_YIELD = 4 as const;\nexport const SOURCE_TAPE_MAX_BATCH_BYTES = 5_242_880 as const;\nexport const SOURCE_TAPE_MAX_IN_FLIGHT = 1 as const;\nexport const BACKFILL_CLOCK_DIAGNOSTIC_KEYS = [\n\t\"target_time_ms\",\n\t\"source_time_ms\",\n\t\"asof_lag_ms\",\n\t\"max_prior_asof_lag_ms\",\n\t\"missing_target_count\",\n\t\"covered_target_count\",\n\t\"first_missing_target_time_ms\",\n\t\"last_missing_target_time_ms\",\n\t\"max_observed_asof_lag_ms\",\n\t\"missing_target_dates_utc\",\n\t\"total_target_count\",\n\t\"unanchored_target_count\",\n\t\"future_state_target_count\",\n\t...DIAGNOSTIC_LAG_THRESHOLDS_MS.map(\n\t\t(threshold) => `covered_target_count_lag_${threshold}_ms` as const,\n\t),\n] as const;\nexport const BACKFILL_SEQUENCE_DIAGNOSTIC_KEYS = [\n\t\"event_time_ms\",\n\t\"expected_previous_sequence\",\n\t\"observed_previous_sequence\",\n\t\"observed_final_sequence\",\n\t\"sequence_gap_count\",\n\t\"first_sequence_gap_event_time_ms\",\n\t\"last_sequence_gap_event_time_ms\",\n] as const;\nconst CRYPTOHFTDATA_HISTORY_START_MS = Date.UTC(2025, 5, 28);\nconst HOUR_MS = 60 * 60 * 1_000;\n\nexport type CryptoHftDataCapabilityProfile = Readonly<{\n\tprofileId: string;\n\texchange: string;\n\ttradingPair: string;\n\tsourceSymbol: string;\n\tmarketType: \"spot\" | \"swap\" | \"future\";\n\tproviderExchangeId: string;\n\thistoryStartMs: number;\n\tmaxDepth: number;\n\teventTimeUnit: \"milliseconds\";\n\treceivedTimeUnit: \"nanoseconds\";\n\tsnapshotGrouping:\n\t\t| \"event_time_last_update_id_object\"\n\t\t| \"event_time_final_update_id_object\";\n\tsequenceSemantics: \"binance_u_U_pu\" | \"okx_seq_id_prev_seq_id\";\n\tconstructionModes: readonly [\"sampled_top_n_snapshot\"];\n\tsourcePolicies: readonly (\"authoritative_window\" | \"fill_gaps\")[];\n}>;\n\n// This profile is exported for explicit enablement by a conformance-tested\n// consumer. The adapter's default registry is deliberately empty: possession\n// of a provider credential must never advertise an unverified data profile.\nexport const CRYPTOHFTDATA_BINANCE_SPOT_BTCUSDT_PROFILE: CryptoHftDataCapabilityProfile =\n\tObject.freeze({\n\t\tprofileId: \"cryptohftdata/binance_spot/BTCUSDT/v1\",\n\t\texchange: \"binance\",\n\t\ttradingPair: \"BTC-USDT\",\n\t\tsourceSymbol: \"BTCUSDT\",\n\t\tmarketType: \"spot\",\n\t\tproviderExchangeId: \"binance_spot\",\n\t\thistoryStartMs: CRYPTOHFTDATA_HISTORY_START_MS,\n\t\tmaxDepth: 500,\n\t\teventTimeUnit: \"milliseconds\",\n\t\treceivedTimeUnit: \"nanoseconds\",\n\t\tsnapshotGrouping: \"event_time_last_update_id_object\",\n\t\tsequenceSemantics: \"binance_u_U_pu\",\n\t\tconstructionModes: [\"sampled_top_n_snapshot\"] as const,\n\t\tsourcePolicies: [\"authoritative_window\"] as const,\n\t});\n\n// This profile is pinned to a live-proven object containing a complete OKX\n// snapshot followed by a contiguous seqId/prevSeqId update chain.\nexport const CRYPTOHFTDATA_OKX_SPOT_ARBUSDT_PROFILE: CryptoHftDataCapabilityProfile =\n\tObject.freeze({\n\t\tprofileId: \"cryptohftdata/okx_spot/ARB-USDT/v1\",\n\t\texchange: \"okx\",\n\t\ttradingPair: \"ARB-USDT\",\n\t\tsourceSymbol: \"ARB-USDT\",\n\t\tmarketType: \"spot\",\n\t\tproviderExchangeId: \"okx_spot\",\n\t\thistoryStartMs: CRYPTOHFTDATA_HISTORY_START_MS,\n\t\tmaxDepth: 400,\n\t\teventTimeUnit: \"milliseconds\",\n\t\treceivedTimeUnit: \"nanoseconds\",\n\t\tsnapshotGrouping: \"event_time_final_update_id_object\",\n\t\tsequenceSemantics: \"okx_seq_id_prev_seq_id\",\n\t\tconstructionModes: [\"sampled_top_n_snapshot\"] as const,\n\t\tsourcePolicies: [\"authoritative_window\", \"fill_gaps\"] as const,\n\t});\n\n// This profile uses the same live-proven OKX sequence and timestamp semantics\n// as ARB-USDT. Provider discovery and conformance evidence pin ARB-USDC as a\n// distinct source symbol; venue identity must never imply quote substitution.\nexport const CRYPTOHFTDATA_OKX_SPOT_ARBUSDC_PROFILE: CryptoHftDataCapabilityProfile =\n\tObject.freeze({\n\t\tprofileId: \"cryptohftdata/okx_spot/ARB-USDC/v1\",\n\t\texchange: \"okx\",\n\t\ttradingPair: \"ARB-USDC\",\n\t\tsourceSymbol: \"ARB-USDC\",\n\t\tmarketType: \"spot\",\n\t\tproviderExchangeId: \"okx_spot\",\n\t\thistoryStartMs: CRYPTOHFTDATA_HISTORY_START_MS,\n\t\tmaxDepth: 400,\n\t\teventTimeUnit: \"milliseconds\",\n\t\treceivedTimeUnit: \"nanoseconds\",\n\t\tsnapshotGrouping: \"event_time_final_update_id_object\",\n\t\tsequenceSemantics: \"okx_seq_id_prev_seq_id\",\n\t\tconstructionModes: [\"sampled_top_n_snapshot\"] as const,\n\t\tsourcePolicies: [\"authoritative_window\", \"fill_gaps\"] as const,\n\t});\n\nexport class CryptoHftDataError extends Error {\n\tconstructor(\n\t\treadonly reason: string,\n\t\treadonly diagnostics: Readonly<\n\t\t\tRecord<string, string | number | boolean>\n\t\t> = {},\n\t) {\n\t\tsuper(`CryptoHFTData backfill failed: ${reason}`);\n\t\tthis.name = \"CryptoHftDataError\";\n\t}\n}\n\nfunction providerObjectFailure(\n\terror: unknown,\n\treason: string,\n\tdatasetObjectIdentity: string,\n\tfailurePhase: string,\n): CryptoHftDataError {\n\treturn new CryptoHftDataError(\n\t\terror instanceof CryptoHftDataError ? error.reason : reason,\n\t\t{\n\t\t\t...(error instanceof CryptoHftDataError ? error.diagnostics : {}),\n\t\t\tdataset_object_identity: datasetObjectIdentity,\n\t\t\tfailure_phase: failurePhase,\n\t\t},\n\t);\n}\n\nconst PROVIDER_OBJECT_MAX_ATTEMPTS = 3;\nconst RETRYABLE_PROVIDER_OBJECT_FAILURES = new Set([\n\t\"provider_object_request_failed\",\n\t\"object_download_failed\",\n\t\"provider_object_read_failed\",\n\t\"provider_object_decode_failed\",\n\t\"provider_object_validation_failed\",\n]);\n\nfunction quarantinedProviderObjectFailure(\n\terror: CryptoHftDataError,\n\tattemptCount: number,\n\tchecksum?: string,\n): CryptoHftDataError {\n\treturn new CryptoHftDataError(error.reason, {\n\t\t...error.diagnostics,\n\t\t...(checksum ? { dataset_object_checksum: checksum } : {}),\n\t\tattempt_count: attemptCount,\n\t\tquarantined: true,\n\t});\n}\n\nexport type CryptoHftDataOrderBookRow = {\n\treceived_time: string | number | bigint;\n\tevent_time: string | number | bigint;\n\ttransaction_time?: string | number | bigint | null;\n\tsymbol: string;\n\tevent_type: \"snapshot\" | \"update\";\n\tfirst_update_id?: string | number | bigint | null;\n\tfinal_update_id?: string | number | bigint | null;\n\tprev_final_update_id?: string | number | bigint | null;\n\tlast_update_id?: string | number | bigint | null;\n\tside: \"bid\" | \"ask\";\n\tprice: string;\n\tquantity: string;\n\torder_count?: string | number | bigint | null;\n\tdataset_object_identity: string;\n\tdataset_object_checksum: string;\n};\n\nexport type ReconstructedCryptoHftBook = {\n\ttargetTimeMs: number;\n\tsourceTimeMs: number;\n\treceivedTimeMs: number;\n\tsequence: string;\n\tbids: number[][];\n\tasks: number[][];\n\tdatasetObjectIdentity: string;\n\tdatasetObjectChecksum: string;\n};\n\nexport type PolicyNeutralCryptoHftBookState = ReconstructedCryptoHftBook & {\n\ttapeState: \"initialization\" | \"change\";\n};\n\nexport type PolicyNeutralTapeSink = {\n\twriteBatch(states: readonly PolicyNeutralCryptoHftBookState[]): Promise<void>;\n\tcomplete(input: {\n\t\texpectedObjectIdentities: readonly string[];\n\t\tobservedObjects: readonly ProviderObjectEvidence[];\n\t\tstateCount: number;\n\t}): Promise<void>;\n\tabort(input: { reason: string; retainedStateCount: number }): Promise<void>;\n};\n\nfunction tapeStateBytes(state: PolicyNeutralCryptoHftBookState): number {\n\treturn new TextEncoder().encode(JSON.stringify(state)).byteLength;\n}\n\nasync function writePolicyNeutralTapeStates(\n\tsink: PolicyNeutralTapeSink,\n\tstates: readonly PolicyNeutralCryptoHftBookState[],\n): Promise<number> {\n\tlet written = 0;\n\tlet batch: PolicyNeutralCryptoHftBookState[] = [];\n\tlet batchBytes = 0;\n\tconst flush = async () => {\n\t\tif (batch.length === 0) return;\n\t\tawait sink.writeBatch(batch);\n\t\twritten += batch.length;\n\t\tbatch = [];\n\t\tbatchBytes = 0;\n\t};\n\tfor (const state of states) {\n\t\tconst bytes = tapeStateBytes(state);\n\t\tif (bytes > SOURCE_TAPE_MAX_BATCH_BYTES) {\n\t\t\tthrow new CryptoHftDataError(\"source_tape_state_too_large\");\n\t\t}\n\t\tif (\n\t\t\tbatch.length >= SOURCE_TAPE_MAX_STATES_PER_YIELD ||\n\t\t\tbatchBytes + bytes > SOURCE_TAPE_MAX_BATCH_BYTES\n\t\t) {\n\t\t\tawait flush();\n\t\t}\n\t\tbatch.push(state);\n\t\tbatchBytes += bytes;\n\t}\n\tawait flush();\n\treturn written;\n}\n\nexport function cryptoHftDataCapabilityFor(\n\trequest: MarketDataVendorBackfillRequest,\n\tprofiles: readonly CryptoHftDataCapabilityProfile[] = [],\n): ProviderCapability | undefined {\n\tif (\n\t\trequest.providerPolicy.provider !== \"cryptohftdata\" ||\n\t\trequest.scope.feed !== \"ORDERBOOK\" ||\n\t\trequest.scope.exchange.trim().toLowerCase() === \"mexc\"\n\t) {\n\t\treturn undefined;\n\t}\n\tconst profile = profiles.find(\n\t\t(candidate) =>\n\t\t\tcandidate.exchange === request.scope.exchange.trim().toLowerCase() &&\n\t\t\tcandidate.tradingPair === request.scope.tradingPair &&\n\t\t\tcandidate.sourceSymbol === request.scope.sourceSymbol &&\n\t\t\tcandidate.marketType === request.scope.marketType &&\n\t\t\tcandidate.constructionModes.includes(request.constructionMode as never) &&\n\t\t\tcandidate.sourcePolicies.includes(request.sourcePolicy as never) &&\n\t\t\trequest.window.startTimeMs >= candidate.historyStartMs &&\n\t\t\trequest.depth <= candidate.maxDepth,\n\t);\n\tif (!profile) return undefined;\n\treturn {\n\t\tprovider: \"cryptohftdata\",\n\t\tadapterVersion: CRYPTOHFTDATA_ADAPTER_VERSION,\n\t\tproviderExchangeId: profile.providerExchangeId,\n\t\tresolvedSymbol: profile.sourceSymbol,\n\t};\n}\n\nfunction utcHourPath(hourMs: number): { date: string; hour: string } {\n\tconst date = new Date(hourMs);\n\treturn {\n\t\tdate: `${date.getUTCFullYear()}-${String(date.getUTCMonth() + 1).padStart(2, \"0\")}-${String(date.getUTCDate()).padStart(2, \"0\")}`,\n\t\thour: String(date.getUTCHours()).padStart(2, \"0\"),\n\t};\n}\n\nexport function enumerateCryptoHftDataObjects(\n\trequest: MarketDataVendorBackfillRequest,\n\tproviderExchangeId: string,\n\tresolvedSymbol: string,\n): string[] {\n\tif (request.sourcePolicy === \"fill_gaps\") {\n\t\tconst hours = new Set<number>();\n\t\tfor (const targetTimeMs of request.requiredClockTargetsMs) {\n\t\t\tconst firstHour =\n\t\t\t\tMath.floor(\n\t\t\t\t\tMath.max(0, targetTimeMs - request.budgets.maxBoundaryLookbackMs) /\n\t\t\t\t\t\tHOUR_MS,\n\t\t\t\t) * HOUR_MS;\n\t\t\tconst lastHour = Math.floor(targetTimeMs / HOUR_MS) * HOUR_MS;\n\t\t\tfor (let hourMs = firstHour; hourMs <= lastHour; hourMs += HOUR_MS) {\n\t\t\t\thours.add(hourMs);\n\t\t\t}\n\t\t}\n\t\treturn [...hours]\n\t\t\t.sort((left, right) => left - right)\n\t\t\t.map((hourMs) => {\n\t\t\t\tconst utc = utcHourPath(hourMs);\n\t\t\t\treturn `${providerExchangeId}/${utc.date}/${utc.hour}/${resolvedSymbol}_orderbook.parquet.zst`;\n\t\t\t});\n\t}\n\treturn enumerateCryptoHftDataWindowObjects(\n\t\trequest,\n\t\tproviderExchangeId,\n\t\tresolvedSymbol,\n\t);\n}\n\nexport function enumerateCryptoHftDataWindowObjects(\n\trequest: MarketDataVendorBackfillRequest,\n\tproviderExchangeId: string,\n\tresolvedSymbol: string,\n): string[] {\n\tconst firstHour =\n\t\tMath.floor(\n\t\t\t(request.window.startTimeMs - request.budgets.maxBoundaryLookbackMs) /\n\t\t\t\tHOUR_MS,\n\t\t) * HOUR_MS;\n\tconst objects: string[] = [];\n\tfor (\n\t\tlet hourMs = Math.max(0, firstHour);\n\t\thourMs < request.window.endTimeMs;\n\t\thourMs += HOUR_MS\n\t) {\n\t\tconst utc = utcHourPath(hourMs);\n\t\tobjects.push(\n\t\t\t`${providerExchangeId}/${utc.date}/${utc.hour}/${resolvedSymbol}_orderbook.parquet.zst`,\n\t\t);\n\t}\n\treturn objects;\n}\n\nfunction initialArchiveCoversTarget(\n\trequest: MarketDataVendorBackfillRequest,\n\ttargetTimeMs: number,\n): boolean {\n\treturn (request.initialSelection?.support_anchors ?? []).some((anchor) => {\n\t\tconst sourceTimeMs = Date.parse(anchor.source_time);\n\t\treturn (\n\t\t\tNumber.isSafeInteger(sourceTimeMs) &&\n\t\t\tsourceTimeMs <= targetTimeMs &&\n\t\t\ttargetTimeMs - sourceTimeMs <= request.maxPriorAsOfLagMs\n\t\t);\n\t});\n}\n\nexport function providerAcquisitionRequest(\n\trequest: MarketDataVendorBackfillRequest,\n): MarketDataVendorBackfillRequest {\n\tif (request.sourcePolicy !== \"fill_gaps\") return request;\n\tconst requiredClockTargetsMs = request.requiredClockTargetsMs.filter(\n\t\t(targetTimeMs) => !initialArchiveCoversTarget(request, targetTimeMs),\n\t);\n\tif (requiredClockTargetsMs.length === 0) {\n\t\tthrow new CryptoHftDataError(\"fill_gaps_has_no_uncovered_clock_targets\");\n\t}\n\treturn { ...request, requiredClockTargetsMs };\n}\n\nfunction unsignedString(\n\tvalue: string | number | bigint | null | undefined,\n\tfield: string,\n\trequired = false,\n): string | undefined {\n\tif (value === null || value === undefined) {\n\t\tif (required) throw new CryptoHftDataError(`schema_${field}_missing`);\n\t\treturn undefined;\n\t}\n\tconst rendered = String(value);\n\tif (!/^\\d+$/.test(rendered)) {\n\t\tthrow new CryptoHftDataError(`schema_${field}_invalid`);\n\t}\n\tconst parsed = BigInt(rendered);\n\tif (parsed > 18_446_744_073_709_551_615n) {\n\t\tthrow new CryptoHftDataError(`schema_${field}_exceeds_uint64`);\n\t}\n\treturn parsed.toString(10);\n}\n\nfunction timestampMs(\n\tvalue: string | number | bigint,\n\tfield: \"received_time\" | \"event_time\",\n): number {\n\tconst rendered = String(value);\n\tif (!/^\\d+$/.test(rendered)) {\n\t\tthrow new CryptoHftDataError(`schema_${field}_invalid`);\n\t}\n\tconst raw = BigInt(rendered);\n\tconst milliseconds = field === \"received_time\" ? raw / 1_000_000n : raw;\n\tif (milliseconds > BigInt(Number.MAX_SAFE_INTEGER)) {\n\t\tthrow new CryptoHftDataError(`schema_${field}_unsafe`);\n\t}\n\treturn Number(milliseconds);\n}\n\nfunction decimal(value: string, field: string, allowZero: boolean): number {\n\tif (!/^(?:0|[1-9]\\d*)(?:\\.\\d+)?$/.test(value)) {\n\t\tthrow new CryptoHftDataError(`schema_${field}_invalid`);\n\t}\n\tconst parsed = Number(value);\n\tif (!Number.isFinite(parsed) || (allowZero ? parsed < 0 : parsed <= 0)) {\n\t\tthrow new CryptoHftDataError(`schema_${field}_invalid`);\n\t}\n\treturn parsed;\n}\n\nfunction validatedRow(\n\trequest: MarketDataVendorBackfillRequest,\n\trow: CryptoHftDataOrderBookRow,\n): CryptoHftDataOrderBookRow & {\n\teventTimeMs: number;\n\treceivedTimeMs: number;\n} {\n\tif (row.symbol !== request.scope.sourceSymbol) {\n\t\tthrow new CryptoHftDataError(\"schema_symbol_mismatch\");\n\t}\n\tif (row.event_type !== \"snapshot\" && row.event_type !== \"update\") {\n\t\tthrow new CryptoHftDataError(\"schema_event_type_invalid\");\n\t}\n\tif (row.side !== \"bid\" && row.side !== \"ask\") {\n\t\tthrow new CryptoHftDataError(\"schema_side_invalid\");\n\t}\n\tdecimal(row.price, \"price\", false);\n\tdecimal(row.quantity, \"quantity\", true);\n\tif (!/^[a-f0-9]{64}$/.test(row.dataset_object_checksum)) {\n\t\tthrow new CryptoHftDataError(\"schema_object_checksum_invalid\");\n\t}\n\tconst eventTimeMs = timestampMs(row.event_time, \"event_time\");\n\tconst receivedTimeMs = timestampMs(row.received_time, \"received_time\");\n\tif (receivedTimeMs < eventTimeMs) {\n\t\tthrow new CryptoHftDataError(\"received_time_precedes_event_time\");\n\t}\n\treturn { ...row, eventTimeMs, receivedTimeMs };\n}\n\nfunction groupKey(\n\trow: ReturnType<typeof validatedRow>,\n\tprofile: CryptoHftDataCapabilityProfile,\n): string {\n\tconst sequence =\n\t\trow.event_type === \"snapshot\"\n\t\t\t? profile.snapshotGrouping === \"event_time_final_update_id_object\"\n\t\t\t\t? unsignedString(row.final_update_id, \"final_update_id\", true)\n\t\t\t\t: unsignedString(row.last_update_id, \"last_update_id\", true)\n\t\t\t: unsignedString(row.final_update_id, \"final_update_id\", true);\n\treturn [\n\t\trow.event_type,\n\t\trow.eventTimeMs,\n\t\tsequence,\n\t\trow.dataset_object_identity,\n\t].join(\"\\u0000\");\n}\n\nfunction absent(value: string | number | bigint | null | undefined): boolean {\n\treturn value === null || value === undefined;\n}\n\nfunction snapshotSequence(\n\trow: ReturnType<typeof validatedRow>,\n\tprofile: CryptoHftDataCapabilityProfile,\n): string {\n\tif (profile.sequenceSemantics === \"okx_seq_id_prev_seq_id\") {\n\t\tif (String(row.last_update_id) !== \"-1\") {\n\t\t\tthrow new CryptoHftDataError(\"schema_last_update_id_snapshot_sentinel\");\n\t\t}\n\t\tif (!absent(row.first_update_id) || !absent(row.prev_final_update_id)) {\n\t\t\tthrow new CryptoHftDataError(\"ambiguous_snapshot_group\");\n\t\t}\n\t\treturn unsignedString(\n\t\t\trow.final_update_id,\n\t\t\t\"final_update_id\",\n\t\t\ttrue,\n\t\t) as string;\n\t}\n\treturn unsignedString(row.last_update_id, \"last_update_id\", true) as string;\n}\n\ntype BookState = {\n\tbids: Map<string, number>;\n\tasks: Map<string, number>;\n\tsequence: string;\n\tsourceTimeMs: number;\n\treceivedTimeMs: number;\n\tdatasetObjectIdentity: string;\n\tdatasetObjectChecksum: string;\n};\n\nfunction sortedSide(\n\tlevels: ReadonlyMap<string, number>,\n\tside: \"bid\" | \"ask\",\n): number[][] {\n\treturn [...levels.entries()]\n\t\t.map(([price, quantity]) => [Number(price), quantity])\n\t\t.sort((left, right) =>\n\t\t\tside === \"bid\"\n\t\t\t\t? (right[0] as number) - (left[0] as number)\n\t\t\t\t: (left[0] as number) - (right[0] as number),\n\t\t);\n}\n\nfunction applyRows(\n\tstate: BookState,\n\trows: ReturnType<typeof validatedRow>[],\n): void {\n\tfor (const row of rows) {\n\t\tconst levels = row.side === \"bid\" ? state.bids : state.asks;\n\t\tconst quantity = decimal(row.quantity, \"quantity\", true);\n\t\tif (quantity === 0) levels.delete(row.price);\n\t\telse levels.set(row.price, quantity);\n\t}\n}\n\nclass StreamingBookReconstructor {\n\tprivate readonly targets: readonly number[];\n\tprivate readonly samples: ReconstructedCryptoHftBook[] = [];\n\tprivate readonly clockObservations: Array<{\n\t\ttargetTimeMs: number;\n\t\tsourceTimeMs?: number;\n\t\tasofLagMs?: number;\n\t}> = [];\n\tprivate readonly missingSamples: Array<{\n\t\ttargetTimeMs: number;\n\t\tsourceTimeMs?: number;\n\t\tasofLagMs?: number;\n\t}> = [];\n\tprivate readonly sequenceGaps: Array<{\n\t\teventTimeMs: number;\n\t\texpectedPreviousSequence: string;\n\t\tobservedPreviousSequence: string;\n\t\tobservedFinalSequence: string;\n\t}> = [];\n\tprivate readonly policyNeutralTape: PolicyNeutralCryptoHftBookState[] = [];\n\tprivate tapeInitializationEmitted = false;\n\tprivate targetIndex = 0;\n\tprivate state: BookState | undefined;\n\tprivate previousFinalUpdateId: bigint | undefined;\n\n\tconstructor(\n\t\tprivate readonly request: MarketDataVendorBackfillRequest,\n\t\tprivate readonly profile: CryptoHftDataCapabilityProfile,\n\t\tprivate readonly observer?: ReconstructionObservationSink,\n\t\tprivate readonly options: { collectPolicyNeutralTape?: boolean } = {},\n\t) {\n\t\tthis.targets = [...request.requiredClockTargetsMs];\n\t}\n\n\tpush(inputRows: readonly CryptoHftDataOrderBookRow[]): void {\n\t\tfor (const group of this.inputGroups(inputRows)) {\n\t\t\tif (!this.processGroup(group)) return;\n\t\t}\n\t}\n\n\tasync pushPolicyNeutralTape(\n\t\tinputRows: readonly CryptoHftDataOrderBookRow[],\n\t\tsink: PolicyNeutralTapeSink,\n\t\tonStatesWritten: (count: number) => void,\n\t): Promise<void> {\n\t\tfor (const group of this.inputGroups(inputRows)) {\n\t\t\tif (!this.processGroup(group)) break;\n\t\t\tif (this.policyNeutralTape.length >= SOURCE_TAPE_MAX_STATES_PER_YIELD) {\n\t\t\t\tconst states = this.drainPolicyNeutralTape();\n\t\t\t\tconst written = await writePolicyNeutralTapeStates(sink, states);\n\t\t\t\tonStatesWritten(written);\n\t\t\t}\n\t\t}\n\t\tconst states = this.drainPolicyNeutralTape();\n\t\tif (states.length > 0) {\n\t\t\tconst written = await writePolicyNeutralTapeStates(sink, states);\n\t\t\tonStatesWritten(written);\n\t\t}\n\t}\n\n\tprivate inputGroups(\n\t\tinputRows: readonly CryptoHftDataOrderBookRow[],\n\t): Array<ReturnType<typeof validatedRow>[]> {\n\t\tconst observedObjects = new Map<string, SourceObjectEvidence>();\n\t\tfor (const row of inputRows) {\n\t\t\tconst existing = observedObjects.get(row.dataset_object_identity);\n\t\t\tobservedObjects.set(row.dataset_object_identity, {\n\t\t\t\tidentity: row.dataset_object_identity,\n\t\t\t\tchecksums: [\n\t\t\t\t\t...new Set([\n\t\t\t\t\t\t...(existing?.checksums ?? []),\n\t\t\t\t\t\trow.dataset_object_checksum,\n\t\t\t\t\t]),\n\t\t\t\t].sort(),\n\t\t\t\tattempt_count: 1,\n\t\t\t\tquarantined: false,\n\t\t\t});\n\t\t}\n\t\tfor (const object of observedObjects.values()) {\n\t\t\tthis.observe({ type: \"provider_object_boundary\", object });\n\t\t\tif (object.checksums.length > 1) {\n\t\t\t\tthis.observe({\n\t\t\t\t\ttype: \"provider_object_checksum_conflict\",\n\t\t\t\t\tobject: { ...object, quarantined: true },\n\t\t\t\t\taffected_target_times_ms: this.targets.slice(this.targetIndex),\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst rows = inputRows\n\t\t\t.map((row, index) => ({\n\t\t\t\t...validatedRow(this.request, row),\n\t\t\t\toriginalIndex: index,\n\t\t\t}))\n\t\t\t.sort(\n\t\t\t\t(left, right) =>\n\t\t\t\t\tleft.eventTimeMs - right.eventTimeMs ||\n\t\t\t\t\tleft.originalIndex - right.originalIndex,\n\t\t\t);\n\t\tconst groups: Array<ReturnType<typeof validatedRow>[]> = [];\n\t\tfor (const row of rows) {\n\t\t\tconst current = groups.at(-1);\n\t\t\tif (\n\t\t\t\t!current ||\n\t\t\t\tgroupKey(\n\t\t\t\t\tcurrent[0] as ReturnType<typeof validatedRow>,\n\t\t\t\t\tthis.profile,\n\t\t\t\t) !== groupKey(row, this.profile)\n\t\t\t) {\n\t\t\t\tgroups.push([row]);\n\t\t\t} else {\n\t\t\t\tcurrent.push(row);\n\t\t\t}\n\t\t}\n\t\treturn groups;\n\t}\n\n\tprivate processGroup(group: ReturnType<typeof validatedRow>[]): boolean {\n\t\tconst first = group[0] as ReturnType<typeof validatedRow>;\n\t\tthis.sampleBefore(first.eventTimeMs);\n\t\tif (\n\t\t\tthis.options.collectPolicyNeutralTape &&\n\t\t\tfirst.eventTimeMs >= this.request.window.endTimeMs\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t\tif (\n\t\t\tthis.options.collectPolicyNeutralTape &&\n\t\t\t!this.tapeInitializationEmitted &&\n\t\t\tfirst.eventTimeMs >= this.request.window.startTimeMs &&\n\t\t\tthis.state\n\t\t) {\n\t\t\tthis.capturePolicyNeutralState(\"initialization\");\n\t\t}\n\t\tif (\n\t\t\tthis.targetIndex >= this.targets.length &&\n\t\t\t!this.options.collectPolicyNeutralTape\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t\tif (first.event_type === \"snapshot\") this.applySnapshot(group);\n\t\telse if (this.state) this.applyUpdate(group);\n\t\tif (\n\t\t\tthis.options.collectPolicyNeutralTape &&\n\t\t\tthis.state &&\n\t\t\tfirst.eventTimeMs >= this.request.window.startTimeMs &&\n\t\t\tfirst.eventTimeMs < this.request.window.endTimeMs\n\t\t) {\n\t\t\tthis.capturePolicyNeutralState(\n\t\t\t\tthis.tapeInitializationEmitted ? \"change\" : \"initialization\",\n\t\t\t);\n\t\t}\n\t\treturn true;\n\t}\n\n\tdrainPolicyNeutralTape(): PolicyNeutralCryptoHftBookState[] {\n\t\treturn this.policyNeutralTape.splice(0, this.policyNeutralTape.length);\n\t}\n\n\tprivate capturePolicyNeutralState(\n\t\ttapeState: PolicyNeutralCryptoHftBookState[\"tapeState\"],\n\t): void {\n\t\tconst state = this.state;\n\t\tif (!state) return;\n\t\tconst bids = sortedSide(state.bids, \"bid\").slice(0, this.request.depth);\n\t\tconst asks = sortedSide(state.asks, \"ask\").slice(0, this.request.depth);\n\t\tif (bids.length === 0 || asks.length === 0) {\n\t\t\tthrow new CryptoHftDataError(\"book_side_missing\");\n\t\t}\n\t\tif ((bids[0]?.[0] as number) >= (asks[0]?.[0] as number)) {\n\t\t\tthrow new CryptoHftDataError(\"book_crossed_or_locked\");\n\t\t}\n\t\tthis.policyNeutralTape.push({\n\t\t\ttapeState,\n\t\t\ttargetTimeMs: state.sourceTimeMs,\n\t\t\tsourceTimeMs: state.sourceTimeMs,\n\t\t\treceivedTimeMs: state.receivedTimeMs,\n\t\t\tsequence: state.sequence,\n\t\t\tbids,\n\t\t\tasks,\n\t\t\tdatasetObjectIdentity: state.datasetObjectIdentity,\n\t\t\tdatasetObjectChecksum: state.datasetObjectChecksum,\n\t\t});\n\t\tthis.tapeInitializationEmitted = true;\n\t}\n\n\tprivate observe(observation: ReconstructionObservation): void {\n\t\ttry {\n\t\t\tthis.observer?.observe(observation);\n\t\t} catch {\n\t\t\t// Qualification evidence must never affect production reconstruction.\n\t\t}\n\t}\n\n\tprivate objectEvidence(state: BookState): SourceObjectEvidence {\n\t\treturn {\n\t\t\tidentity: state.datasetObjectIdentity,\n\t\t\tchecksums: [state.datasetObjectChecksum],\n\t\t\tattempt_count: 1,\n\t\t\tquarantined: false,\n\t\t};\n\t}\n\n\tfinish(): ReconstructedCryptoHftBook[] {\n\t\tthis.sampleBefore(Number.POSITIVE_INFINITY);\n\t\tif (this.missingSamples.length > 0) {\n\t\t\tthrow new CryptoHftDataError(\n\t\t\t\tthis.sequenceGaps.length > 0\n\t\t\t\t\t? \"update_chain_gap\"\n\t\t\t\t\t: this.missingSamples.some((sample) => sample.asofLagMs !== undefined)\n\t\t\t\t\t\t? \"required_clock_coverage_insufficient\"\n\t\t\t\t\t\t: \"update_before_snapshot\",\n\t\t\t\t{\n\t\t\t\t\t...this.sequenceGapDiagnostics(),\n\t\t\t\t\t...this.missingClockDiagnostics(),\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t\treturn this.samples;\n\t}\n\n\tfinishPolicyNeutralTape(): PolicyNeutralCryptoHftBookState[] {\n\t\tthis.finish();\n\t\tif (this.sequenceGaps.length > 0) {\n\t\t\tthrow new CryptoHftDataError(\"update_chain_gap\", {\n\t\t\t\t...this.sequenceGapDiagnostics(),\n\t\t\t});\n\t\t}\n\t\tif (!this.tapeInitializationEmitted && this.state) {\n\t\t\tthis.capturePolicyNeutralState(\"initialization\");\n\t\t}\n\t\tif (!this.tapeInitializationEmitted) {\n\t\t\tthrow new CryptoHftDataError(\"update_before_snapshot\");\n\t\t}\n\t\treturn this.policyNeutralTape;\n\t}\n\n\tasync finishPolicyNeutralTapeToSink(\n\t\tsink: PolicyNeutralTapeSink,\n\t\tonStatesWritten: (count: number) => void,\n\t): Promise<void> {\n\t\tthis.finishPolicyNeutralTape();\n\t\tconst states = this.drainPolicyNeutralTape();\n\t\tif (states.length > 0) {\n\t\t\tconst written = await writePolicyNeutralTapeStates(sink, states);\n\t\t\tonStatesWritten(written);\n\t\t}\n\t}\n\n\tprivate missingClockDiagnostics(): Record<string, string | number | boolean> {\n\t\tif (this.missingSamples.length === 0) return {};\n\t\tconst first = this\n\t\t\t.missingSamples[0] as (typeof this.missingSamples)[number];\n\t\tconst last = this.missingSamples.at(\n\t\t\t-1,\n\t\t) as (typeof this.missingSamples)[number];\n\t\tconst observedLags = this.missingSamples.flatMap((sample) =>\n\t\t\tsample.asofLagMs === undefined ? [] : [sample.asofLagMs],\n\t\t);\n\t\tconst missingDates = [\n\t\t\t...new Set(\n\t\t\t\tthis.missingSamples.map((sample) =>\n\t\t\t\t\tnew Date(sample.targetTimeMs).toISOString().slice(0, 10),\n\t\t\t\t),\n\t\t\t),\n\t\t].join(\",\");\n\t\tconst coverageByLag = Object.fromEntries(\n\t\t\tDIAGNOSTIC_LAG_THRESHOLDS_MS.map((threshold) => [\n\t\t\t\t`covered_target_count_lag_${threshold}_ms`,\n\t\t\t\tthis.clockObservations.filter(\n\t\t\t\t\t(observation) =>\n\t\t\t\t\t\tobservation.sourceTimeMs !== undefined &&\n\t\t\t\t\t\tobservation.sourceTimeMs <= observation.targetTimeMs &&\n\t\t\t\t\t\t(observation.asofLagMs as number) <= threshold,\n\t\t\t\t).length,\n\t\t\t]),\n\t\t);\n\t\treturn {\n\t\t\ttarget_time_ms: first.targetTimeMs,\n\t\t\t...(first.sourceTimeMs === undefined\n\t\t\t\t? {}\n\t\t\t\t: { source_time_ms: first.sourceTimeMs }),\n\t\t\t...(first.asofLagMs === undefined\n\t\t\t\t? {}\n\t\t\t\t: { asof_lag_ms: first.asofLagMs }),\n\t\t\tmax_prior_asof_lag_ms: this.request.maxPriorAsOfLagMs,\n\t\t\tmissing_target_count: this.missingSamples.length,\n\t\t\tcovered_target_count: this.samples.length,\n\t\t\tfirst_missing_target_time_ms: first.targetTimeMs,\n\t\t\tlast_missing_target_time_ms: last.targetTimeMs,\n\t\t\t...(observedLags.length === 0\n\t\t\t\t? {}\n\t\t\t\t: { max_observed_asof_lag_ms: Math.max(...observedLags) }),\n\t\t\tmissing_target_dates_utc: missingDates,\n\t\t\ttotal_target_count: this.clockObservations.length,\n\t\t\tunanchored_target_count: this.clockObservations.filter(\n\t\t\t\t(observation) => observation.sourceTimeMs === undefined,\n\t\t\t).length,\n\t\t\tfuture_state_target_count: this.clockObservations.filter(\n\t\t\t\t(observation) =>\n\t\t\t\t\tobservation.sourceTimeMs !== undefined &&\n\t\t\t\t\tobservation.sourceTimeMs > observation.targetTimeMs,\n\t\t\t).length,\n\t\t\t...coverageByLag,\n\t\t};\n\t}\n\n\tprivate sequenceGapDiagnostics(): Record<string, string | number | boolean> {\n\t\tif (this.sequenceGaps.length === 0) return {};\n\t\tconst first = this.sequenceGaps[0] as (typeof this.sequenceGaps)[number];\n\t\tconst last = this.sequenceGaps.at(-1) as (typeof this.sequenceGaps)[number];\n\t\treturn {\n\t\t\tevent_time_ms: first.eventTimeMs,\n\t\t\texpected_previous_sequence: first.expectedPreviousSequence,\n\t\t\tobserved_previous_sequence: first.observedPreviousSequence,\n\t\t\tobserved_final_sequence: first.observedFinalSequence,\n\t\t\tsequence_gap_count: this.sequenceGaps.length,\n\t\t\tfirst_sequence_gap_event_time_ms: first.eventTimeMs,\n\t\t\tlast_sequence_gap_event_time_ms: last.eventTimeMs,\n\t\t};\n\t}\n\n\tprivate sampleBefore(nextEventTimeMs: number): void {\n\t\twhile (\n\t\t\tthis.targetIndex < this.targets.length &&\n\t\t\t(this.targets[this.targetIndex] as number) < nextEventTimeMs\n\t\t) {\n\t\t\tthis.sample(this.targets[this.targetIndex] as number);\n\t\t\tthis.targetIndex += 1;\n\t\t}\n\t}\n\n\tprivate sample(targetTimeMs: number): void {\n\t\tconst state = this.state;\n\t\tthis.clockObservations.push({\n\t\t\ttargetTimeMs,\n\t\t\t...(state\n\t\t\t\t? {\n\t\t\t\t\t\tsourceTimeMs: state.sourceTimeMs,\n\t\t\t\t\t\tasofLagMs: Math.abs(targetTimeMs - state.sourceTimeMs),\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t});\n\t\tif (\n\t\t\t!state ||\n\t\t\tstate.sourceTimeMs > targetTimeMs ||\n\t\t\ttargetTimeMs - state.sourceTimeMs > this.request.maxPriorAsOfLagMs\n\t\t) {\n\t\t\tthis.observe({\n\t\t\t\ttype: \"required_clock_sample\",\n\t\t\t\ttarget_time_ms: targetTimeMs,\n\t\t\t\tsource_time_ms: state?.sourceTimeMs ?? null,\n\t\t\t\tlag_ms: state ? Math.abs(targetTimeMs - state.sourceTimeMs) : null,\n\t\t\t\tstatus: !state\n\t\t\t\t\t? \"unanchored\"\n\t\t\t\t\t: state.sourceTimeMs > targetTimeMs\n\t\t\t\t\t\t? \"future\"\n\t\t\t\t\t\t: \"stale\",\n\t\t\t\tobject: state ? this.objectEvidence(state) : null,\n\t\t\t});\n\t\t\tthis.missingSamples.push({\n\t\t\t\ttargetTimeMs,\n\t\t\t\t...(state\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tsourceTimeMs: state.sourceTimeMs,\n\t\t\t\t\t\t\tasofLagMs: Math.abs(targetTimeMs - state.sourceTimeMs),\n\t\t\t\t\t\t}\n\t\t\t\t\t: {}),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tthis.observe({\n\t\t\ttype: \"required_clock_sample\",\n\t\t\ttarget_time_ms: targetTimeMs,\n\t\t\tsource_time_ms: state.sourceTimeMs,\n\t\t\tlag_ms: targetTimeMs - state.sourceTimeMs,\n\t\t\tstatus: \"covered\",\n\t\t\tobject: this.objectEvidence(state),\n\t\t});\n\t\tconst bids = sortedSide(state.bids, \"bid\").slice(0, this.request.depth);\n\t\tconst asks = sortedSide(state.asks, \"ask\").slice(0, this.request.depth);\n\t\tif (bids.length === 0 || asks.length === 0) {\n\t\t\tthrow new CryptoHftDataError(\"book_side_missing\");\n\t\t}\n\t\tif ((bids[0]?.[0] as number) >= (asks[0]?.[0] as number)) {\n\t\t\tthrow new CryptoHftDataError(\"book_crossed_or_locked\");\n\t\t}\n\t\tthis.samples.push({\n\t\t\ttargetTimeMs,\n\t\t\tsourceTimeMs: state.sourceTimeMs,\n\t\t\treceivedTimeMs: state.receivedTimeMs,\n\t\t\tsequence: state.sequence,\n\t\t\tbids,\n\t\t\tasks,\n\t\t\tdatasetObjectIdentity: state.datasetObjectIdentity,\n\t\t\tdatasetObjectChecksum: state.datasetObjectChecksum,\n\t\t});\n\t}\n\n\tprivate applySnapshot(group: ReturnType<typeof validatedRow>[]): void {\n\t\tconst first = group[0] as ReturnType<typeof validatedRow>;\n\t\tconst reanchored = this.state === undefined && this.sequenceGaps.length > 0;\n\t\tconst sequence = snapshotSequence(first, this.profile);\n\t\tif (group.some((row) => snapshotSequence(row, this.profile) !== sequence)) {\n\t\t\tthrow new CryptoHftDataError(\"ambiguous_snapshot_group\");\n\t\t}\n\t\tif (\n\t\t\tthis.profile.sequenceSemantics === \"binance_u_U_pu\" &&\n\t\t\tthis.previousFinalUpdateId !== undefined &&\n\t\t\tBigInt(sequence) < this.previousFinalUpdateId\n\t\t) {\n\t\t\tthrow new CryptoHftDataError(\"snapshot_sequence_regression\");\n\t\t}\n\t\tthis.state = {\n\t\t\tbids: new Map(),\n\t\t\tasks: new Map(),\n\t\t\tsequence,\n\t\t\tsourceTimeMs: first.eventTimeMs,\n\t\t\treceivedTimeMs: Math.max(...group.map((row) => row.receivedTimeMs)),\n\t\t\tdatasetObjectIdentity: first.dataset_object_identity,\n\t\t\tdatasetObjectChecksum: first.dataset_object_checksum,\n\t\t};\n\t\tapplyRows(this.state, group);\n\t\tthis.previousFinalUpdateId = BigInt(sequence);\n\t\tthis.observe({\n\t\t\ttype: reanchored ? \"reanchor\" : \"snapshot_anchor\",\n\t\t\tanchor: {\n\t\t\t\tevent_time_ms: first.eventTimeMs,\n\t\t\t\tsequence,\n\t\t\t\tobject_identity: first.dataset_object_identity,\n\t\t\t\tobject_checksum: first.dataset_object_checksum,\n\t\t\t},\n\t\t});\n\t}\n\n\tprivate applyUpdate(group: ReturnType<typeof validatedRow>[]): void {\n\t\tconst first = group[0] as ReturnType<typeof validatedRow>;\n\t\tconst state = this.state as BookState;\n\t\tconst previousFinalUpdateId = this.previousFinalUpdateId as bigint;\n\t\tconst finalUpdate = BigInt(\n\t\t\tunsignedString(first.final_update_id, \"final_update_id\", true) as string,\n\t\t);\n\t\tif (this.profile.sequenceSemantics === \"okx_seq_id_prev_seq_id\") {\n\t\t\tif (\n\t\t\t\t!absent(first.first_update_id) ||\n\t\t\t\t!absent(first.prev_final_update_id)\n\t\t\t) {\n\t\t\t\tthrow new CryptoHftDataError(\"ambiguous_update_group\");\n\t\t\t}\n\t\t\tconst previous = unsignedString(\n\t\t\t\tfirst.last_update_id,\n\t\t\t\t\"last_update_id\",\n\t\t\t\ttrue,\n\t\t\t) as string;\n\t\t\tif (\n\t\t\t\tgroup.some(\n\t\t\t\t\t(row) =>\n\t\t\t\t\t\t!absent(row.first_update_id) ||\n\t\t\t\t\t\t!absent(row.prev_final_update_id) ||\n\t\t\t\t\t\tunsignedString(row.final_update_id, \"final_update_id\", true) !==\n\t\t\t\t\t\t\tfinalUpdate.toString() ||\n\t\t\t\t\t\tunsignedString(row.last_update_id, \"last_update_id\", true) !==\n\t\t\t\t\t\t\tprevious,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tthrow new CryptoHftDataError(\"ambiguous_update_group\");\n\t\t\t}\n\t\t\tif (BigInt(previous) !== previousFinalUpdateId) {\n\t\t\t\tthis.observe({\n\t\t\t\t\ttype: \"sequence_discontinuity\",\n\t\t\t\t\tsequence: {\n\t\t\t\t\t\texpected_previous: previousFinalUpdateId.toString(),\n\t\t\t\t\t\tobserved_previous: previous,\n\t\t\t\t\t\tobserved_final: finalUpdate.toString(),\n\t\t\t\t\t\tevent_time_ms: first.eventTimeMs,\n\t\t\t\t\t},\n\t\t\t\t\tobject: {\n\t\t\t\t\t\tidentity: first.dataset_object_identity,\n\t\t\t\t\t\tchecksums: [first.dataset_object_checksum],\n\t\t\t\t\t\tattempt_count: 1,\n\t\t\t\t\t\tquarantined: false,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\tthis.observe({\n\t\t\t\t\ttype: \"invalidation\",\n\t\t\t\t\tevent_time_ms: first.eventTimeMs,\n\t\t\t\t\treason: \"update_chain_gap\",\n\t\t\t\t});\n\t\t\t\tthis.sequenceGaps.push({\n\t\t\t\t\teventTimeMs: first.eventTimeMs,\n\t\t\t\t\texpectedPreviousSequence: previousFinalUpdateId.toString(),\n\t\t\t\t\tobservedPreviousSequence: previous,\n\t\t\t\t\tobservedFinalSequence: finalUpdate.toString(),\n\t\t\t\t});\n\t\t\t\tthis.state = undefined;\n\t\t\t\tthis.previousFinalUpdateId = undefined;\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tconst firstUpdate = BigInt(\n\t\t\t\tunsignedString(\n\t\t\t\t\tfirst.first_update_id,\n\t\t\t\t\t\"first_update_id\",\n\t\t\t\t\ttrue,\n\t\t\t\t) as string,\n\t\t\t);\n\t\t\tconst previous = unsignedString(\n\t\t\t\tfirst.prev_final_update_id,\n\t\t\t\t\"prev_final_update_id\",\n\t\t\t);\n\t\t\tif (\n\t\t\t\tgroup.some(\n\t\t\t\t\t(row) =>\n\t\t\t\t\t\tunsignedString(row.first_update_id, \"first_update_id\", true) !==\n\t\t\t\t\t\t\tfirstUpdate.toString() ||\n\t\t\t\t\t\tunsignedString(row.final_update_id, \"final_update_id\", true) !==\n\t\t\t\t\t\t\tfinalUpdate.toString() ||\n\t\t\t\t\t\tunsignedString(row.prev_final_update_id, \"prev_final_update_id\") !==\n\t\t\t\t\t\t\tprevious,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tthrow new CryptoHftDataError(\"ambiguous_update_group\");\n\t\t\t}\n\t\t\tconst expected = previousFinalUpdateId + 1n;\n\t\t\tif (\n\t\t\t\tfirstUpdate > expected ||\n\t\t\t\tfinalUpdate < expected ||\n\t\t\t\t(previous !== undefined && BigInt(previous) !== previousFinalUpdateId)\n\t\t\t) {\n\t\t\t\tthrow new CryptoHftDataError(\"update_chain_gap\");\n\t\t\t}\n\t\t}\n\t\tapplyRows(state, group);\n\t\tstate.sequence = finalUpdate.toString();\n\t\tstate.sourceTimeMs = first.eventTimeMs;\n\t\tstate.receivedTimeMs = Math.max(...group.map((row) => row.receivedTimeMs));\n\t\tstate.datasetObjectIdentity = first.dataset_object_identity;\n\t\tstate.datasetObjectChecksum = first.dataset_object_checksum;\n\t\tthis.previousFinalUpdateId = finalUpdate;\n\t}\n}\n\nexport function reconstructCryptoHftDataOrderBooks(\n\trequest: MarketDataVendorBackfillRequest,\n\tinputRows: readonly CryptoHftDataOrderBookRow[],\n\tprofile: CryptoHftDataCapabilityProfile = CRYPTOHFTDATA_BINANCE_SPOT_BTCUSDT_PROFILE,\n\tobserver?: ReconstructionObservationSink,\n): ReconstructedCryptoHftBook[] {\n\tconst reconstructor = new StreamingBookReconstructor(\n\t\trequest,\n\t\tprofile,\n\t\tobserver,\n\t);\n\treconstructor.push(inputRows);\n\treturn reconstructor.finish();\n}\n\n/**\n * Qualification-only full-window policy-neutral source projection.\n * It uses the production OKX grouping, validation, sequence and mutation path,\n * but continues after the submitted clock is exhausted and emits no Maker\n * policy decisions.\n */\nexport function reconstructCryptoHftDataPolicyNeutralTape(\n\trequest: MarketDataVendorBackfillRequest,\n\tinputRows: readonly CryptoHftDataOrderBookRow[],\n\tprofile: CryptoHftDataCapabilityProfile,\n\tobserver?: ReconstructionObservationSink,\n): PolicyNeutralCryptoHftBookState[] {\n\tif (\n\t\tprofile.sequenceSemantics !== \"okx_seq_id_prev_seq_id\" ||\n\t\trequest.depth !== 100\n\t) {\n\t\tthrow new CryptoHftDataError(\"source_tape_scope_unsupported\");\n\t}\n\tconst reconstructor = new StreamingBookReconstructor(\n\t\trequest,\n\t\tprofile,\n\t\tobserver,\n\t\t{ collectPolicyNeutralTape: true },\n\t);\n\treconstructor.push(inputRows);\n\treturn reconstructor.finishPolicyNeutralTape();\n}\n\nfunction sha256Bytes(bytes: Uint8Array): string {\n\treturn createHash(\"sha256\").update(bytes).digest(\"hex\");\n}\n\nexport async function decodeCryptoHftParquetZstd(\n\tbytes: Uint8Array,\n): Promise<Record<string, unknown>[]> {\n\tconst parquet = decompress(bytes);\n\tconst buffer = parquet.buffer.slice(\n\t\tparquet.byteOffset,\n\t\tparquet.byteOffset + parquet.byteLength,\n\t) as ArrayBuffer;\n\treturn parquetReadObjects({ file: buffer });\n}\n\nexport type CryptoHftDataAdapterOptions = {\n\tbaseUrl?: string;\n\tfetch?: typeof fetch;\n\tnowMs?: () => number;\n\tdecode?: (bytes: Uint8Array) => Promise<Record<string, unknown>[]>;\n\tprofiles?: readonly CryptoHftDataCapabilityProfile[];\n\tobserver?: ReconstructionObservationSink;\n\tpolicyNeutralTapeSink?: PolicyNeutralTapeSink;\n};\n\nfunction parsedDatasetRow(\n\tvalue: Record<string, unknown>,\n\tobject: ProviderObjectEvidence,\n): CryptoHftDataOrderBookRow {\n\treturn {\n\t\treceived_time: value.received_time as string | number | bigint,\n\t\tevent_time: value.event_time as string | number | bigint,\n\t\ttransaction_time: value.transaction_time as\n\t\t\t| string\n\t\t\t| number\n\t\t\t| bigint\n\t\t\t| null\n\t\t\t| undefined,\n\t\tsymbol: value.symbol as string,\n\t\tevent_type: value.event_type as \"snapshot\" | \"update\",\n\t\tfirst_update_id: value.first_update_id as\n\t\t\t| string\n\t\t\t| number\n\t\t\t| bigint\n\t\t\t| null\n\t\t\t| undefined,\n\t\tfinal_update_id: value.final_update_id as\n\t\t\t| string\n\t\t\t| number\n\t\t\t| bigint\n\t\t\t| null\n\t\t\t| undefined,\n\t\tprev_final_update_id: value.prev_final_update_id as\n\t\t\t| string\n\t\t\t| number\n\t\t\t| bigint\n\t\t\t| null\n\t\t\t| undefined,\n\t\tlast_update_id: value.last_update_id as\n\t\t\t| string\n\t\t\t| number\n\t\t\t| bigint\n\t\t\t| null\n\t\t\t| undefined,\n\t\tside: value.side as \"bid\" | \"ask\",\n\t\tprice: value.price as string,\n\t\tquantity: value.quantity as string,\n\t\torder_count: value.order_count as\n\t\t\t| string\n\t\t\t| number\n\t\t\t| bigint\n\t\t\t| null\n\t\t\t| undefined,\n\t\tdataset_object_identity: object.identity,\n\t\tdataset_object_checksum: object.checksum,\n\t};\n}\n\nasync function readBoundedObject(\n\tresponse: Response,\n\tremainingBytes: number,\n): Promise<Uint8Array> {\n\tif (!response.body) return new Uint8Array();\n\tconst reader = response.body.getReader();\n\tconst chunks: Uint8Array[] = [];\n\tlet total = 0;\n\twhile (true) {\n\t\tconst { done, value } = await reader.read();\n\t\tif (done) break;\n\t\ttotal += value.byteLength;\n\t\tif (total > remainingBytes) {\n\t\t\tawait reader.cancel();\n\t\t\tthrow new CryptoHftDataError(\"budget_max_bytes_exceeded\");\n\t\t}\n\t\tchunks.push(value);\n\t}\n\tconst bytes = new Uint8Array(total);\n\tlet offset = 0;\n\tfor (const chunk of chunks) {\n\t\tbytes.set(chunk, offset);\n\t\toffset += chunk.byteLength;\n\t}\n\treturn bytes;\n}\n\nexport class CryptoHftDataAdapter {\n\tprivate readonly baseUrl: string;\n\tprivate readonly request: typeof fetch;\n\tprivate readonly nowMs: () => number;\n\tprivate readonly decode: (\n\t\tbytes: Uint8Array,\n\t) => Promise<Record<string, unknown>[]>;\n\tprivate readonly profiles: readonly CryptoHftDataCapabilityProfile[];\n\tprivate readonly observer?: ReconstructionObservationSink;\n\tprivate readonly collectPolicyNeutralTape: boolean;\n\tprivate readonly policyNeutralTapeSink?: PolicyNeutralTapeSink;\n\n\tconstructor(options: CryptoHftDataAdapterOptions = {}) {\n\t\tthis.baseUrl = options.baseUrl ?? CRYPTOHFTDATA_API_URL;\n\t\tthis.request = options.fetch ?? fetch;\n\t\tthis.nowMs = options.nowMs ?? Date.now;\n\t\tthis.decode = options.decode ?? decodeCryptoHftParquetZstd;\n\t\tthis.profiles = options.profiles ?? [];\n\t\tthis.observer = options.observer;\n\t\tthis.policyNeutralTapeSink = options.policyNeutralTapeSink;\n\t\tthis.collectPolicyNeutralTape = options.policyNeutralTapeSink !== undefined;\n\t}\n\n\tprivate observe(observation: ReconstructionObservation): void {\n\t\ttry {\n\t\t\tthis.observer?.observe(observation);\n\t\t} catch {\n\t\t\t// Evidence collection cannot alter acquisition or reconstruction.\n\t\t}\n\t}\n\n\tcapabilityFor(\n\t\trequest: MarketDataVendorBackfillRequest,\n\t): ProviderCapability | undefined {\n\t\treturn cryptoHftDataCapabilityFor(request, this.profiles);\n\t}\n\n\tprivate findProfile(\n\t\trequest: MarketDataVendorBackfillRequest,\n\t\tcapability: ProviderCapability,\n\t): CryptoHftDataCapabilityProfile | undefined {\n\t\treturn this.profiles.find(\n\t\t\t(candidate) =>\n\t\t\t\tcandidate.exchange === request.scope.exchange.trim().toLowerCase() &&\n\t\t\t\tcandidate.tradingPair === request.scope.tradingPair &&\n\t\t\t\tcandidate.sourceSymbol === request.scope.sourceSymbol &&\n\t\t\t\tcandidate.marketType === request.scope.marketType &&\n\t\t\t\tcandidate.providerExchangeId === capability.providerExchangeId,\n\t\t);\n\t}\n\n\tprivate profileFor(\n\t\trequest: MarketDataVendorBackfillRequest,\n\t\tcapability: ProviderCapability,\n\t): CryptoHftDataCapabilityProfile {\n\t\tconst profile = this.findProfile(request, capability);\n\t\tif (!profile) {\n\t\t\tthrow new CryptoHftDataError(\"profile_semantics_unavailable\");\n\t\t}\n\t\treturn profile;\n\t}\n\n\tasync discoverSymbols(providerExchangeId: string): Promise<string[]> {\n\t\tif (!/^[a-z0-9_]+$/.test(providerExchangeId)) {\n\t\t\tthrow new CryptoHftDataError(\"symbol_discovery_exchange_invalid\");\n\t\t}\n\t\tconst endpoint = new URL(\"/symbols\", this.baseUrl);\n\t\tendpoint.searchParams.set(\"exchange\", providerExchangeId);\n\t\tendpoint.searchParams.set(\"data_type\", \"orderbook\");\n\t\tlet response: Response;\n\t\ttry {\n\t\t\tresponse = await this.request(endpoint);\n\t\t} catch {\n\t\t\tthrow new CryptoHftDataError(\"symbol_discovery_failed\");\n\t\t}\n\t\tif (!response.ok) {\n\t\t\tthrow new CryptoHftDataError(\"symbol_discovery_failed\");\n\t\t}\n\t\tlet body: unknown;\n\t\ttry {\n\t\t\tbody = await response.json();\n\t\t} catch {\n\t\t\tthrow new CryptoHftDataError(\"symbol_discovery_response_invalid\");\n\t\t}\n\t\tconst record = body as Record<string, unknown>;\n\t\tif (\n\t\t\t!body ||\n\t\t\ttypeof body !== \"object\" ||\n\t\t\tArray.isArray(body) ||\n\t\t\tString(record.exchange).toLowerCase() !== providerExchangeId ||\n\t\t\tString(record.data_type).toLowerCase() !== \"orderbook\" ||\n\t\t\t!Array.isArray(record.symbols) ||\n\t\t\t!record.symbols.every(\n\t\t\t\t(symbol) => typeof symbol === \"string\" && /^[A-Z0-9_-]+$/.test(symbol),\n\t\t\t)\n\t\t) {\n\t\t\tthrow new CryptoHftDataError(\"symbol_discovery_response_invalid\");\n\t\t}\n\t\treturn [...new Set(record.symbols as string[])].sort();\n\t}\n\n\tasync acquire(\n\t\trequest: MarketDataVendorBackfillRequest,\n\t\tcapability: ProviderCapability,\n\t\tcredential: unknown,\n\t): Promise<ProviderDataset<CryptoHftDataOrderBookRow>> {\n\t\tlet retainedStateCount = 0;\n\t\ttry {\n\t\t\tconst result = await this.acquireInternal(\n\t\t\t\trequest,\n\t\t\t\tcapability,\n\t\t\t\tcredential,\n\t\t\t\t(count) => {\n\t\t\t\t\tretainedStateCount += count;\n\t\t\t\t},\n\t\t\t);\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tif (this.policyNeutralTapeSink) {\n\t\t\t\tconst reason =\n\t\t\t\t\terror instanceof CryptoHftDataError\n\t\t\t\t\t\t? error.reason\n\t\t\t\t\t\t: \"source_tape_acquisition_failed\";\n\t\t\t\tawait this.policyNeutralTapeSink\n\t\t\t\t\t.abort({ reason, retainedStateCount })\n\t\t\t\t\t.catch(() => {});\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tprivate async acquireInternal(\n\t\trequest: MarketDataVendorBackfillRequest,\n\t\tcapability: ProviderCapability,\n\t\tcredential: unknown,\n\t\tonTapeStatesWritten: (count: number) => void,\n\t): Promise<ProviderDataset<CryptoHftDataOrderBookRow>> {\n\t\tconst profile = this.findProfile(request, capability);\n\t\tconst apiKey =\n\t\t\tcredential && typeof credential === \"object\"\n\t\t\t\t? (credential as { apiKey?: unknown }).apiKey\n\t\t\t\t: undefined;\n\t\tif (typeof apiKey !== \"string\" || apiKey.length === 0) {\n\t\t\tthrow new CryptoHftDataError(\"credentials_invalid\");\n\t\t}\n\t\tif (\n\t\t\tthis.collectPolicyNeutralTape &&\n\t\t\t(profile?.sequenceSemantics !== \"okx_seq_id_prev_seq_id\" ||\n\t\t\t\trequest.depth !== 100)\n\t\t) {\n\t\t\tthrow new CryptoHftDataError(\"source_tape_scope_unsupported\");\n\t\t}\n\t\tconst paths = this.policyNeutralTapeSink\n\t\t\t? enumerateCryptoHftDataWindowObjects(\n\t\t\t\t\trequest,\n\t\t\t\t\tcapability.providerExchangeId,\n\t\t\t\t\tcapability.resolvedSymbol,\n\t\t\t\t)\n\t\t\t: enumerateCryptoHftDataObjects(\n\t\t\t\t\trequest,\n\t\t\t\t\tcapability.providerExchangeId,\n\t\t\t\t\tcapability.resolvedSymbol,\n\t\t\t\t);\n\t\tif (paths.length > request.budgets.maxFiles) {\n\t\t\tthrow new CryptoHftDataError(\"budget_max_files_exceeded\");\n\t\t}\n\t\tconst started = this.nowMs();\n\t\tconst tokenResponse = await this.request(`${this.baseUrl}/jwt-token`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\", \"X-API-Key\": apiKey },\n\t\t});\n\t\tif (!tokenResponse.ok) throw new CryptoHftDataError(\"jwt_issuance_failed\");\n\t\tconst tokenBody = (await tokenResponse.json()) as { jwt_token?: unknown };\n\t\tif (typeof tokenBody.jwt_token !== \"string\" || !tokenBody.jwt_token) {\n\t\t\tthrow new CryptoHftDataError(\"jwt_response_invalid\");\n\t\t}\n\n\t\tlet totalBytes = 0;\n\t\tlet totalRows = 0;\n\t\tlet emittedTapeStateCount = 0;\n\t\tconst objects: ProviderObjectEvidence[] = [];\n\t\tconst rows: CryptoHftDataOrderBookRow[] = [];\n\t\tconst reconstructor =\n\t\t\tprofile?.sequenceSemantics === \"okx_seq_id_prev_seq_id\"\n\t\t\t\t? new StreamingBookReconstructor(request, profile, this.observer, {\n\t\t\t\t\t\tcollectPolicyNeutralTape: this.collectPolicyNeutralTape,\n\t\t\t\t\t})\n\t\t\t\t: undefined;\n\t\tconst semanticHash = createHash(\"sha256\");\n\t\tlet firstSemanticRow = true;\n\t\tsemanticHash.update(\"[\");\n\t\tfor (const path of paths) {\n\t\t\tconst endpoint = new URL(\"/download\", this.baseUrl);\n\t\t\tendpoint.searchParams.set(\"file\", path);\n\t\t\tlet accepted:\n\t\t\t\t| {\n\t\t\t\t\t\tobject: ProviderObjectEvidence;\n\t\t\t\t\t\tparsedRows: CryptoHftDataOrderBookRow[];\n\t\t\t\t }\n\t\t\t\t| undefined;\n\t\t\tlet observedChecksum: string | undefined;\n\t\t\tfor (\n\t\t\t\tlet attempt = 1;\n\t\t\t\tattempt <= PROVIDER_OBJECT_MAX_ATTEMPTS;\n\t\t\t\tattempt += 1\n\t\t\t) {\n\t\t\t\tif (this.nowMs() - started > request.budgets.maxDurationMs) {\n\t\t\t\t\tthrow new CryptoHftDataError(\"budget_max_duration_exceeded\");\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tlet response: Response;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tresponse = await this.request(endpoint, {\n\t\t\t\t\t\t\theaders: { Authorization: `Bearer ${tokenBody.jwt_token}` },\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthrow providerObjectFailure(\n\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\t\"provider_object_request_failed\",\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t\"request\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tif (!response.ok) {\n\t\t\t\t\t\tthrow providerObjectFailure(\n\t\t\t\t\t\t\tnew CryptoHftDataError(\"object_download_failed\"),\n\t\t\t\t\t\t\t\"object_download_failed\",\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t\"request\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tconst declaredBytes = Number(response.headers.get(\"content-length\"));\n\t\t\t\t\tif (\n\t\t\t\t\t\tNumber.isFinite(declaredBytes) &&\n\t\t\t\t\t\ttotalBytes + declaredBytes > request.budgets.maxBytes\n\t\t\t\t\t) {\n\t\t\t\t\t\tthrow new CryptoHftDataError(\"budget_max_bytes_exceeded\");\n\t\t\t\t\t}\n\t\t\t\t\tlet bytes: Uint8Array;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tbytes = await readBoundedObject(\n\t\t\t\t\t\t\tresponse,\n\t\t\t\t\t\t\trequest.budgets.maxBytes - totalBytes,\n\t\t\t\t\t\t);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthrow providerObjectFailure(\n\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\t\"provider_object_read_failed\",\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t\"read\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\ttotalBytes += bytes.byteLength;\n\t\t\t\t\tif (totalBytes > request.budgets.maxBytes) {\n\t\t\t\t\t\tthrow new CryptoHftDataError(\"budget_max_bytes_exceeded\");\n\t\t\t\t\t}\n\t\t\t\t\tconst checksum = sha256Bytes(bytes);\n\t\t\t\t\tif (observedChecksum && observedChecksum !== checksum) {\n\t\t\t\t\t\tthis.observe({\n\t\t\t\t\t\t\ttype: \"provider_object_checksum_conflict\",\n\t\t\t\t\t\t\tobject: {\n\t\t\t\t\t\t\t\tidentity: path,\n\t\t\t\t\t\t\t\tchecksums: [observedChecksum, checksum].sort(),\n\t\t\t\t\t\t\t\tattempt_count: attempt,\n\t\t\t\t\t\t\t\tquarantined: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\taffected_target_times_ms: request.requiredClockTargetsMs,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tthrow new CryptoHftDataError(\"provider_object_checksum_conflict\", {\n\t\t\t\t\t\t\tdataset_object_identity: path,\n\t\t\t\t\t\t\tfailure_phase: \"checksum\",\n\t\t\t\t\t\t\tattempt_count: attempt,\n\t\t\t\t\t\t\tquarantined: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tobservedChecksum = checksum;\n\t\t\t\t\tlet decoded: Record<string, unknown>[];\n\t\t\t\t\ttry {\n\t\t\t\t\t\tdecoded = await this.decode(bytes);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthrow providerObjectFailure(\n\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\t\"provider_object_decode_failed\",\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t\"decode\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tif (totalRows + decoded.length > request.budgets.maxRows) {\n\t\t\t\t\t\tthrow new CryptoHftDataError(\"budget_max_rows_exceeded\");\n\t\t\t\t\t}\n\t\t\t\t\tconst object = {\n\t\t\t\t\t\tidentity: path,\n\t\t\t\t\t\tchecksum,\n\t\t\t\t\t\tbytes: bytes.byteLength,\n\t\t\t\t\t\trows: decoded.length,\n\t\t\t\t\t};\n\t\t\t\t\tconst parsedRows: CryptoHftDataOrderBookRow[] = [];\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfor (const decodedRow of decoded) {\n\t\t\t\t\t\t\tconst parsed = parsedDatasetRow(decodedRow, object);\n\t\t\t\t\t\t\tvalidatedRow(request, parsed);\n\t\t\t\t\t\t\tparsedRows.push(parsed);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthrow providerObjectFailure(\n\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\t\"provider_object_validation_failed\",\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t\"validate\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\taccepted = { object, parsedRows };\n\t\t\t\t\tbreak;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst failure =\n\t\t\t\t\t\terror instanceof CryptoHftDataError\n\t\t\t\t\t\t\t? error\n\t\t\t\t\t\t\t: providerObjectFailure(\n\t\t\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\t\t\t\"provider_object_request_failed\",\n\t\t\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t\t\t\"request\",\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\tif (\n\t\t\t\t\t\t!RETRYABLE_PROVIDER_OBJECT_FAILURES.has(failure.reason) ||\n\t\t\t\t\t\tattempt === PROVIDER_OBJECT_MAX_ATTEMPTS\n\t\t\t\t\t) {\n\t\t\t\t\t\tthrow attempt === PROVIDER_OBJECT_MAX_ATTEMPTS &&\n\t\t\t\t\t\t\tRETRYABLE_PROVIDER_OBJECT_FAILURES.has(failure.reason)\n\t\t\t\t\t\t\t? quarantinedProviderObjectFailure(\n\t\t\t\t\t\t\t\t\tfailure,\n\t\t\t\t\t\t\t\t\tattempt,\n\t\t\t\t\t\t\t\t\tobservedChecksum,\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t: failure;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!accepted) {\n\t\t\t\tthrow new CryptoHftDataError(\"provider_object_acquisition_incomplete\");\n\t\t\t}\n\t\t\ttotalRows += accepted.object.rows;\n\t\t\tobjects.push(accepted.object);\n\t\t\tfor (const parsed of accepted.parsedRows) {\n\t\t\t\tsemanticHash.update(firstSemanticRow ? \"\" : \",\");\n\t\t\t\tsemanticHash.update(canonicalSerialize(parsed));\n\t\t\t\tfirstSemanticRow = false;\n\t\t\t}\n\t\t\tif (reconstructor && this.policyNeutralTapeSink) {\n\t\t\t\tawait reconstructor.pushPolicyNeutralTape(\n\t\t\t\t\taccepted.parsedRows,\n\t\t\t\t\tthis.policyNeutralTapeSink,\n\t\t\t\t\t(written) => {\n\t\t\t\t\t\temittedTapeStateCount += written;\n\t\t\t\t\t\tonTapeStatesWritten(written);\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t} else if (reconstructor) {\n\t\t\t\treconstructor.push(accepted.parsedRows);\n\t\t\t} else {\n\t\t\t\trows.push(...accepted.parsedRows);\n\t\t\t}\n\t\t}\n\t\tif (this.nowMs() - started > request.budgets.maxDurationMs) {\n\t\t\tthrow new CryptoHftDataError(\"budget_max_duration_exceeded\");\n\t\t}\n\t\tsemanticHash.update(\"]\");\n\t\tconst reconstructedBooks = reconstructor?.finish();\n\t\tlet policyNeutralTape: PolicyNeutralCryptoHftBookState[] | undefined;\n\t\tif (this.policyNeutralTapeSink && reconstructor) {\n\t\t\tawait reconstructor.finishPolicyNeutralTapeToSink(\n\t\t\t\tthis.policyNeutralTapeSink,\n\t\t\t\t(written) => {\n\t\t\t\t\temittedTapeStateCount += written;\n\t\t\t\t\tonTapeStatesWritten(written);\n\t\t\t\t},\n\t\t\t);\n\t\t} else if (this.collectPolicyNeutralTape) {\n\t\t\tpolicyNeutralTape = reconstructor?.finishPolicyNeutralTape();\n\t\t}\n\t\tif (this.policyNeutralTapeSink) {\n\t\t\tawait this.policyNeutralTapeSink.complete({\n\t\t\t\texpectedObjectIdentities: paths,\n\t\t\t\tobservedObjects: objects,\n\t\t\t\tstateCount: emittedTapeStateCount,\n\t\t\t});\n\t\t}\n\t\treturn {\n\t\t\tobjects,\n\t\t\trows,\n\t\t\treconstructedBooks,\n\t\t\t...(policyNeutralTape && !this.policyNeutralTapeSink\n\t\t\t\t? { policyNeutralTape }\n\t\t\t\t: {}),\n\t\t\tvendorSemanticDigest: semanticHash.digest(\"hex\"),\n\t\t};\n\t}\n\n\tasync normalize(\n\t\trequest: MarketDataVendorBackfillRequest,\n\t\tcapability: ProviderCapability,\n\t\tdataset: ProviderDataset,\n\t\tcaptureBundleId: string,\n\t): Promise<NormalizedBackfill> {\n\t\tconst profile = this.profileFor(request, capability);\n\t\tconst samples = dataset.reconstructedBooks\n\t\t\t? (dataset.reconstructedBooks as ReconstructedCryptoHftBook[])\n\t\t\t: reconstructCryptoHftDataOrderBooks(\n\t\t\t\t\trequest,\n\t\t\t\t\tdataset.rows as CryptoHftDataOrderBookRow[],\n\t\t\t\t\tprofile,\n\t\t\t\t);\n\t\tconst context: MarketCaptureContext = {\n\t\t\tsource: EXTERNAL_BACKFILL_SOURCE,\n\t\t\tdeploymentId: \"market-data-vendor-backfill\",\n\t\t\tcaptureBundleId,\n\t\t\texchange: request.scope.exchange,\n\t\t\tsymbol: request.scope.tradingPair,\n\t\t\ttradingPair: request.scope.tradingPair,\n\t\t\tsourceSymbol: request.scope.sourceSymbol,\n\t\t\tassetType: request.scope.marketType,\n\t\t\tfeed: \"ORDERBOOK\",\n\t\t\tprovider: \"cryptohftdata\",\n\t\t\tsourceMode: HISTORICAL_VENDOR_SOURCE_MODE,\n\t\t\tschemaVersion: MARKET_CAPTURE_SCHEMA_VERSION,\n\t\t\tchecksumAlgorithm: CHECKSUM_ALGORITHM,\n\t\t\tprovenanceComplete: true,\n\t\t};\n\t\tconst rows = samples.flatMap((sample) => {\n\t\t\tconst rawCapture: RawCapture = {\n\t\t\t\trawCaptureId: sha256Canonical({\n\t\t\t\t\tcapture_bundle_id: captureBundleId,\n\t\t\t\t\tdataset_object_identity: sample.datasetObjectIdentity,\n\t\t\t\t\tdataset_object_checksum: sample.datasetObjectChecksum,\n\t\t\t\t\tsource_time_ms: sample.sourceTimeMs,\n\t\t\t\t\ttarget_time_ms: sample.targetTimeMs,\n\t\t\t\t}),\n\t\t\t\trawCaptureScope: VENDOR_DATASET_RAW_CAPTURE_SCOPE,\n\t\t\t\trawChecksum: sample.datasetObjectChecksum,\n\t\t\t\tredactedPayload: {\n\t\t\t\t\tdataset_object_identity: sample.datasetObjectIdentity,\n\t\t\t\t\tdataset_object_checksum: sample.datasetObjectChecksum,\n\t\t\t\t},\n\t\t\t\teventTimeMs: sample.sourceTimeMs,\n\t\t\t\treceivedTimeMs: sample.receivedTimeMs,\n\t\t\t\tchecksumAlgorithm: CHECKSUM_ALGORITHM,\n\t\t\t};\n\t\t\tlet canonical: ReturnType<typeof buildCanonicalOrderBookRows>;\n\t\t\ttry {\n\t\t\t\tcanonical = buildCanonicalOrderBookRows({\n\t\t\t\t\tcontext,\n\t\t\t\t\trawCapture,\n\t\t\t\t\tdepthLimit: request.depth,\n\t\t\t\t\tconstructionMode: request.constructionMode,\n\t\t\t\t\tsnapshot: {\n\t\t\t\t\t\tbids: sample.bids,\n\t\t\t\t\t\tasks: sample.asks,\n\t\t\t\t\t\ttimestamp: sample.sourceTimeMs,\n\t\t\t\t\t\treceivedTimestamp: sample.receivedTimeMs,\n\t\t\t\t\t\texchange: request.scope.exchange,\n\t\t\t\t\t\tsymbol: request.scope.tradingPair,\n\t\t\t\t\t\tdepthLimit: request.depth,\n\t\t\t\t\t\tsequence: sample.sequence,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tconst diagnostics = {\n\t\t\t\t\ttarget_time_ms: sample.targetTimeMs,\n\t\t\t\t\tsource_time_ms: sample.sourceTimeMs,\n\t\t\t\t\tdataset_object_identity: sample.datasetObjectIdentity,\n\t\t\t\t\tfailure_phase: \"normalize\",\n\t\t\t\t};\n\t\t\t\tif (error instanceof OrderBookValidationError) {\n\t\t\t\t\tthrow new CryptoHftDataError(\"canonical_orderbook_invalid\", {\n\t\t\t\t\t\t...diagnostics,\n\t\t\t\t\t\tvalidation_reason: error.reason,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tthrow new CryptoHftDataError(\n\t\t\t\t\t\"canonical_normalization_failed\",\n\t\t\t\t\tdiagnostics,\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn [...canonical.levels, canonical.summary];\n\t\t}) as BackfillArchiveRow[];\n\t\treturn {\n\t\t\tcaptureBundleId,\n\t\t\tobjects: dataset.objects,\n\t\t\trows,\n\t\t\tvendorSemanticDigest: dataset.vendorSemanticDigest,\n\t\t\tcanonicalSemanticDigest: semanticDigest(rows),\n\t\t};\n\t}\n}\n",
|
|
158
|
-
"// Some numerical data is initialized as -1 even when it doesn't need initialization to help the JIT infer types\n// aliases for shorter compressed code (most minifers don't do this)\nvar ab = ArrayBuffer, u8 = Uint8Array, u16 = Uint16Array, i16 = Int16Array, u32 = Uint32Array, i32 = Int32Array;\nvar slc = function (v, s, e) {\n if (u8.prototype.slice)\n return u8.prototype.slice.call(v, s, e);\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n var n = new u8(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\nvar fill = function (v, n, s, e) {\n if (u8.prototype.fill)\n return u8.prototype.fill.call(v, n, s, e);\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n for (; s < e; ++s)\n v[s] = n;\n return v;\n};\nvar cpw = function (v, t, s, e) {\n if (u8.prototype.copyWithin)\n return u8.prototype.copyWithin.call(v, t, s, e);\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n while (s < e) {\n v[t++] = v[s++];\n }\n};\n/**\n * Codes for errors generated within this library\n */\nexport var ZstdErrorCode = {\n InvalidData: 0,\n WindowSizeTooLarge: 1,\n InvalidBlockType: 2,\n FSEAccuracyTooHigh: 3,\n DistanceTooFarBack: 4,\n UnexpectedEOF: 5\n};\n// error codes\nvar ec = [\n 'invalid zstd data',\n 'window size too large (>2046MB)',\n 'invalid block type',\n 'FSE accuracy too high',\n 'match distance too far back',\n 'unexpected EOF'\n];\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\nvar rb = function (d, b, n) {\n var i = 0, o = 0;\n for (; i < n; ++i)\n o |= d[b++] << (i << 3);\n return o;\n};\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\n// read Zstandard frame header\nvar rzfh = function (dat, w) {\n var n3 = dat[0] | (dat[1] << 8) | (dat[2] << 16);\n if (n3 == 0x2FB528 && dat[3] == 253) {\n // Zstandard\n var flg = dat[4];\n // single segment checksum dict flag frame content flag\n var ss = (flg >> 5) & 1, cc = (flg >> 2) & 1, df = flg & 3, fcf = flg >> 6;\n if (flg & 8)\n err(0);\n // byte\n var bt = 6 - ss;\n // dict bytes\n var db = df == 3 ? 4 : df;\n // dictionary id\n var di = rb(dat, bt, db);\n bt += db;\n // frame size bytes\n var fsb = fcf ? (1 << fcf) : ss;\n // frame source size\n var fss = rb(dat, bt, fsb) + ((fcf == 1) && 256);\n // window size\n var ws = fss;\n if (!ss) {\n // window descriptor\n var wb = 1 << (10 + (dat[5] >> 3));\n ws = wb + (wb >> 3) * (dat[5] & 7);\n }\n if (ws > 2145386496)\n err(1);\n var buf = new u8((w == 1 ? (fss || ws) : w ? 0 : ws) + 12);\n buf[0] = 1, buf[4] = 4, buf[8] = 8;\n return {\n b: bt + fsb,\n y: 0,\n l: 0,\n d: di,\n w: (w && w != 1) ? w : buf.subarray(12),\n e: ws,\n o: new i32(buf.buffer, 0, 3),\n u: fss,\n c: cc,\n m: Math.min(131072, ws)\n };\n }\n else if (((n3 >> 4) | (dat[3] << 20)) == 0x184D2A5) {\n // skippable\n return b4(dat, 4) + 8;\n }\n err(0);\n};\n// most significant bit for nonzero\nvar msb = function (val) {\n var bits = 0;\n for (; (1 << bits) <= val; ++bits)\n ;\n return bits - 1;\n};\n// read finite state entropy\nvar rfse = function (dat, bt, mal) {\n // table pos\n var tpos = (bt << 3) + 4;\n // accuracy log\n var al = (dat[bt] & 15) + 5;\n if (al > mal)\n err(3);\n // size\n var sz = 1 << al;\n // probabilities symbols repeat index high threshold\n var probs = sz, sym = -1, re = -1, i = -1, ht = sz;\n // optimization: single allocation is much faster\n var buf = new ab(512 + (sz << 2));\n var freq = new i16(buf, 0, 256);\n // same view as freq\n var dstate = new u16(buf, 0, 256);\n var nstate = new u16(buf, 512, sz);\n var bb1 = 512 + (sz << 1);\n var syms = new u8(buf, bb1, sz);\n var nbits = new u8(buf, bb1 + sz);\n while (sym < 255 && probs > 0) {\n var bits = msb(probs + 1);\n var cbt = tpos >> 3;\n // mask\n var msk = (1 << (bits + 1)) - 1;\n var val = ((dat[cbt] | (dat[cbt + 1] << 8) | (dat[cbt + 2] << 16)) >> (tpos & 7)) & msk;\n // mask (1 fewer bit)\n var msk1fb = (1 << bits) - 1;\n // max small value\n var msv = msk - probs - 1;\n // small value\n var sval = val & msk1fb;\n if (sval < msv)\n tpos += bits, val = sval;\n else {\n tpos += bits + 1;\n if (val > msk1fb)\n val -= msv;\n }\n freq[++sym] = --val;\n if (val == -1) {\n probs += val;\n syms[--ht] = sym;\n }\n else\n probs -= val;\n if (!val) {\n do {\n // repeat byte\n var rbt = tpos >> 3;\n re = ((dat[rbt] | (dat[rbt + 1] << 8)) >> (tpos & 7)) & 3;\n tpos += 2;\n sym += re;\n } while (re == 3);\n }\n }\n if (sym > 255 || probs)\n err(0);\n var sympos = 0;\n // sym step (coprime with sz - formula from zstd source)\n var sstep = (sz >> 1) + (sz >> 3) + 3;\n // sym mask\n var smask = sz - 1;\n for (var s = 0; s <= sym; ++s) {\n var sf = freq[s];\n if (sf < 1) {\n dstate[s] = -sf;\n continue;\n }\n // This is split into two loops in zstd to avoid branching, but as JS is higher-level that is unnecessary\n for (i = 0; i < sf; ++i) {\n syms[sympos] = s;\n do {\n sympos = (sympos + sstep) & smask;\n } while (sympos >= ht);\n }\n }\n // After spreading symbols, should be zero again\n if (sympos)\n err(0);\n for (i = 0; i < sz; ++i) {\n // next state\n var ns = dstate[syms[i]]++;\n // num bits\n var nb = nbits[i] = al - msb(ns);\n nstate[i] = (ns << nb) - sz;\n }\n return [(tpos + 7) >> 3, {\n b: al,\n s: syms,\n n: nbits,\n t: nstate\n }];\n};\n// read huffman\nvar rhu = function (dat, bt) {\n // index weight count\n var i = 0, wc = -1;\n // buffer header byte\n var buf = new u8(292), hb = dat[bt];\n // huffman weights\n var hw = buf.subarray(0, 256);\n // rank count\n var rc = buf.subarray(256, 268);\n // rank index\n var ri = new u16(buf.buffer, 268);\n // NOTE: at this point bt is 1 less than expected\n if (hb < 128) {\n // end byte, fse decode table\n var _a = rfse(dat, bt + 1, 6), ebt = _a[0], fdt = _a[1];\n bt += hb;\n var epos = ebt << 3;\n // last byte\n var lb = dat[bt];\n if (!lb)\n err(0);\n // state1 state2 state1 bits state2 bits\n var st1 = 0, st2 = 0, btr1 = fdt.b, btr2 = btr1;\n // fse pos\n // pre-increment to account for original deficit of 1\n var fpos = (++bt << 3) - 8 + msb(lb);\n for (;;) {\n fpos -= btr1;\n if (fpos < epos)\n break;\n var cbt = fpos >> 3;\n st1 += ((dat[cbt] | (dat[cbt + 1] << 8)) >> (fpos & 7)) & ((1 << btr1) - 1);\n hw[++wc] = fdt.s[st1];\n fpos -= btr2;\n if (fpos < epos)\n break;\n cbt = fpos >> 3;\n st2 += ((dat[cbt] | (dat[cbt + 1] << 8)) >> (fpos & 7)) & ((1 << btr2) - 1);\n hw[++wc] = fdt.s[st2];\n btr1 = fdt.n[st1];\n st1 = fdt.t[st1];\n btr2 = fdt.n[st2];\n st2 = fdt.t[st2];\n }\n if (++wc > 255)\n err(0);\n }\n else {\n wc = hb - 127;\n for (; i < wc; i += 2) {\n var byte = dat[++bt];\n hw[i] = byte >> 4;\n hw[i + 1] = byte & 15;\n }\n ++bt;\n }\n // weight exponential sum\n var wes = 0;\n for (i = 0; i < wc; ++i) {\n var wt = hw[i];\n // bits must be at most 11, same as weight\n if (wt > 11)\n err(0);\n wes += wt && (1 << (wt - 1));\n }\n // max bits\n var mb = msb(wes) + 1;\n // table size\n var ts = 1 << mb;\n // remaining sum\n var rem = ts - wes;\n // must be power of 2\n if (rem & (rem - 1))\n err(0);\n hw[wc++] = msb(rem) + 1;\n for (i = 0; i < wc; ++i) {\n var wt = hw[i];\n ++rc[hw[i] = wt && (mb + 1 - wt)];\n }\n // huf buf\n var hbuf = new u8(ts << 1);\n // symbols num bits\n var syms = hbuf.subarray(0, ts), nb = hbuf.subarray(ts);\n ri[mb] = 0;\n for (i = mb; i > 0; --i) {\n var pv = ri[i];\n fill(nb, i, pv, ri[i - 1] = pv + rc[i] * (1 << (mb - i)));\n }\n if (ri[0] != ts)\n err(0);\n for (i = 0; i < wc; ++i) {\n var bits = hw[i];\n if (bits) {\n var code = ri[bits];\n fill(syms, i, code, ri[bits] = code + (1 << (mb - bits)));\n }\n }\n return [bt, {\n n: nb,\n b: mb,\n s: syms\n }];\n};\n// Tables generated using this:\n// https://gist.github.com/101arrowz/a979452d4355992cbf8f257cbffc9edd\n// default literal length table\nvar dllt = /*#__PURE__*/ rfse(/*#__PURE__*/ new u8([\n 81, 16, 99, 140, 49, 198, 24, 99, 12, 33, 196, 24, 99, 102, 102, 134, 70, 146, 4\n]), 0, 6)[1];\n// default match length table\nvar dmlt = /*#__PURE__*/ rfse(/*#__PURE__*/ new u8([\n 33, 20, 196, 24, 99, 140, 33, 132, 16, 66, 8, 33, 132, 16, 66, 8, 33, 68, 68, 68, 68, 68, 68, 68, 68, 36, 9\n]), 0, 6)[1];\n// default offset code table\nvar doct = /*#__PURE__ */ rfse(/*#__PURE__*/ new u8([\n 32, 132, 16, 66, 102, 70, 68, 68, 68, 68, 36, 73, 2\n]), 0, 5)[1];\n// bits to baseline\nvar b2bl = function (b, s) {\n var len = b.length, bl = new i32(len);\n for (var i = 0; i < len; ++i) {\n bl[i] = s;\n s += 1 << b[i];\n }\n return bl;\n};\n// literal length bits\nvar llb = /*#__PURE__ */ new u8(( /*#__PURE__ */new i32([\n 0, 0, 0, 0, 16843009, 50528770, 134678020, 202050057, 269422093\n])).buffer, 0, 36);\n// literal length baseline\nvar llbl = /*#__PURE__ */ b2bl(llb, 0);\n// match length bits\nvar mlb = /*#__PURE__ */ new u8(( /*#__PURE__ */new i32([\n 0, 0, 0, 0, 0, 0, 0, 0, 16843009, 50528770, 117769220, 185207048, 252579084, 16\n])).buffer, 0, 53);\n// match length baseline\nvar mlbl = /*#__PURE__ */ b2bl(mlb, 3);\n// decode huffman stream\nvar dhu = function (dat, out, hu) {\n var len = dat.length, ss = out.length, lb = dat[len - 1], msk = (1 << hu.b) - 1, eb = -hu.b;\n if (!lb)\n err(0);\n var st = 0, btr = hu.b, pos = (len << 3) - 8 + msb(lb) - btr, i = -1;\n for (; pos > eb && i < ss;) {\n var cbt = pos >> 3;\n var val = (dat[cbt] | (dat[cbt + 1] << 8) | (dat[cbt + 2] << 16)) >> (pos & 7);\n st = ((st << btr) | val) & msk;\n out[++i] = hu.s[st];\n pos -= (btr = hu.n[st]);\n }\n if (pos != eb || i + 1 != ss)\n err(0);\n};\n// decode huffman stream 4x\n// TODO: use workers to parallelize\nvar dhu4 = function (dat, out, hu) {\n var bt = 6;\n var ss = out.length, sz1 = (ss + 3) >> 2, sz2 = sz1 << 1, sz3 = sz1 + sz2;\n dhu(dat.subarray(bt, bt += dat[0] | (dat[1] << 8)), out.subarray(0, sz1), hu);\n dhu(dat.subarray(bt, bt += dat[2] | (dat[3] << 8)), out.subarray(sz1, sz2), hu);\n dhu(dat.subarray(bt, bt += dat[4] | (dat[5] << 8)), out.subarray(sz2, sz3), hu);\n dhu(dat.subarray(bt), out.subarray(sz3), hu);\n};\n// read Zstandard block\nvar rzb = function (dat, st, out) {\n var _a;\n var bt = st.b;\n // byte 0 block type\n var b0 = dat[bt], btype = (b0 >> 1) & 3;\n st.l = b0 & 1;\n var sz = (b0 >> 3) | (dat[bt + 1] << 5) | (dat[bt + 2] << 13);\n // end byte for block\n var ebt = (bt += 3) + sz;\n if (btype == 1) {\n if (bt >= dat.length)\n return;\n st.b = bt + 1;\n if (out) {\n fill(out, dat[bt], st.y, st.y += sz);\n return out;\n }\n return fill(new u8(sz), dat[bt]);\n }\n if (ebt > dat.length)\n return;\n if (btype == 0) {\n st.b = ebt;\n if (out) {\n out.set(dat.subarray(bt, ebt), st.y);\n st.y += sz;\n return out;\n }\n return slc(dat, bt, ebt);\n }\n if (btype == 2) {\n // byte 3 lit btype size format\n var b3 = dat[bt], lbt = b3 & 3, sf = (b3 >> 2) & 3;\n // lit src size lit cmp sz 4 streams\n var lss = b3 >> 4, lcs = 0, s4 = 0;\n if (lbt < 2) {\n if (sf & 1)\n lss |= (dat[++bt] << 4) | ((sf & 2) && (dat[++bt] << 12));\n else\n lss = b3 >> 3;\n }\n else {\n s4 = sf;\n if (sf < 2)\n lss |= ((dat[++bt] & 63) << 4), lcs = (dat[bt] >> 6) | (dat[++bt] << 2);\n else if (sf == 2)\n lss |= (dat[++bt] << 4) | ((dat[++bt] & 3) << 12), lcs = (dat[bt] >> 2) | (dat[++bt] << 6);\n else\n lss |= (dat[++bt] << 4) | ((dat[++bt] & 63) << 12), lcs = (dat[bt] >> 6) | (dat[++bt] << 2) | (dat[++bt] << 10);\n }\n ++bt;\n // add literals to end - can never overlap with backreferences because unused literals always appended\n var buf = out ? out.subarray(st.y, st.y + st.m) : new u8(st.m);\n // starting point for literals\n var spl = buf.length - lss;\n if (lbt == 0)\n buf.set(dat.subarray(bt, bt += lss), spl);\n else if (lbt == 1)\n fill(buf, dat[bt++], spl);\n else {\n // huffman table\n var hu = st.h;\n if (lbt == 2) {\n var hud = rhu(dat, bt);\n // subtract description length\n lcs += bt - (bt = hud[0]);\n st.h = hu = hud[1];\n }\n else if (!hu)\n err(0);\n (s4 ? dhu4 : dhu)(dat.subarray(bt, bt += lcs), buf.subarray(spl), hu);\n }\n // num sequences\n var ns = dat[bt++];\n if (ns) {\n if (ns == 255)\n ns = (dat[bt++] | (dat[bt++] << 8)) + 0x7F00;\n else if (ns > 127)\n ns = ((ns - 128) << 8) | dat[bt++];\n // symbol compression modes\n var scm = dat[bt++];\n if (scm & 3)\n err(0);\n var dts = [dmlt, doct, dllt];\n for (var i = 2; i > -1; --i) {\n var md = (scm >> ((i << 1) + 2)) & 3;\n if (md == 1) {\n // rle buf\n var rbuf = new u8([0, 0, dat[bt++]]);\n dts[i] = {\n s: rbuf.subarray(2, 3),\n n: rbuf.subarray(0, 1),\n t: new u16(rbuf.buffer, 0, 1),\n b: 0\n };\n }\n else if (md == 2) {\n // accuracy log 8 for offsets, 9 for others\n _a = rfse(dat, bt, 9 - (i & 1)), bt = _a[0], dts[i] = _a[1];\n }\n else if (md == 3) {\n if (!st.t)\n err(0);\n dts[i] = st.t[i];\n }\n }\n var _b = st.t = dts, mlt = _b[0], oct = _b[1], llt = _b[2];\n var lb = dat[ebt - 1];\n if (!lb)\n err(0);\n var spos = (ebt << 3) - 8 + msb(lb) - llt.b, cbt = spos >> 3, oubt = 0;\n var lst = ((dat[cbt] | (dat[cbt + 1] << 8)) >> (spos & 7)) & ((1 << llt.b) - 1);\n cbt = (spos -= oct.b) >> 3;\n var ost = ((dat[cbt] | (dat[cbt + 1] << 8)) >> (spos & 7)) & ((1 << oct.b) - 1);\n cbt = (spos -= mlt.b) >> 3;\n var mst = ((dat[cbt] | (dat[cbt + 1] << 8)) >> (spos & 7)) & ((1 << mlt.b) - 1);\n for (++ns; --ns;) {\n var llc = llt.s[lst];\n var lbtr = llt.n[lst];\n var mlc = mlt.s[mst];\n var mbtr = mlt.n[mst];\n var ofc = oct.s[ost];\n var obtr = oct.n[ost];\n cbt = (spos -= ofc) >> 3;\n var ofp = 1 << ofc;\n var off = ofp + (((dat[cbt] | (dat[cbt + 1] << 8) | (dat[cbt + 2] << 16) | (dat[cbt + 3] << 24)) >>> (spos & 7)) & (ofp - 1));\n cbt = (spos -= mlb[mlc]) >> 3;\n var ml = mlbl[mlc] + (((dat[cbt] | (dat[cbt + 1] << 8) | (dat[cbt + 2] << 16)) >> (spos & 7)) & ((1 << mlb[mlc]) - 1));\n cbt = (spos -= llb[llc]) >> 3;\n var ll = llbl[llc] + (((dat[cbt] | (dat[cbt + 1] << 8) | (dat[cbt + 2] << 16)) >> (spos & 7)) & ((1 << llb[llc]) - 1));\n cbt = (spos -= lbtr) >> 3;\n lst = llt.t[lst] + (((dat[cbt] | (dat[cbt + 1] << 8)) >> (spos & 7)) & ((1 << lbtr) - 1));\n cbt = (spos -= mbtr) >> 3;\n mst = mlt.t[mst] + (((dat[cbt] | (dat[cbt + 1] << 8)) >> (spos & 7)) & ((1 << mbtr) - 1));\n cbt = (spos -= obtr) >> 3;\n ost = oct.t[ost] + (((dat[cbt] | (dat[cbt + 1] << 8)) >> (spos & 7)) & ((1 << obtr) - 1));\n if (off > 3) {\n st.o[2] = st.o[1];\n st.o[1] = st.o[0];\n st.o[0] = off -= 3;\n }\n else {\n var idx = off - (ll != 0);\n if (idx) {\n off = idx == 3 ? st.o[0] - 1 : st.o[idx];\n if (idx > 1)\n st.o[2] = st.o[1];\n st.o[1] = st.o[0];\n st.o[0] = off;\n }\n else\n off = st.o[0];\n }\n for (var i = 0; i < ll; ++i) {\n buf[oubt + i] = buf[spl + i];\n }\n oubt += ll, spl += ll;\n var stin = oubt - off;\n if (stin < 0) {\n var len = -stin;\n var bs = st.e + stin;\n if (len > ml)\n len = ml;\n for (var i = 0; i < len; ++i) {\n buf[oubt + i] = st.w[bs + i];\n }\n oubt += len, ml -= len, stin = 0;\n }\n for (var i = 0; i < ml; ++i) {\n buf[oubt + i] = buf[stin + i];\n }\n oubt += ml;\n }\n if (oubt != spl) {\n while (spl < buf.length) {\n buf[oubt++] = buf[spl++];\n }\n }\n else\n oubt = buf.length;\n if (out)\n st.y += oubt;\n else\n buf = slc(buf, 0, oubt);\n }\n else if (out) {\n st.y += lss;\n if (spl) {\n for (var i = 0; i < lss; ++i) {\n buf[i] = buf[spl + i];\n }\n }\n }\n else if (spl)\n buf = slc(buf, spl);\n st.b = ebt;\n return buf;\n }\n err(2);\n};\n// concat\nvar cct = function (bufs, ol) {\n if (bufs.length == 1)\n return bufs[0];\n var buf = new u8(ol);\n for (var i = 0, b = 0; i < bufs.length; ++i) {\n var chk = bufs[i];\n buf.set(chk, b);\n b += chk.length;\n }\n return buf;\n};\n/**\n * Decompresses Zstandard data\n * @param dat The input data\n * @param buf The output buffer. If unspecified, the function will allocate\n * exactly enough memory to fit the decompressed data. If your\n * data has multiple frames and you know the output size, specifying\n * it will yield better performance.\n * @returns The decompressed data\n */\nexport function decompress(dat, buf) {\n var bufs = [], nb = +!buf;\n var bt = 0, ol = 0;\n for (; dat.length;) {\n var st = rzfh(dat, nb || buf);\n if (typeof st == 'object') {\n if (nb) {\n buf = null;\n if (st.w.length == st.u) {\n bufs.push(buf = st.w);\n ol += st.u;\n }\n }\n else {\n bufs.push(buf);\n st.e = 0;\n }\n for (; !st.l;) {\n var blk = rzb(dat, st, buf);\n if (!blk)\n err(5);\n if (buf)\n st.e = st.y;\n else {\n bufs.push(blk);\n ol += blk.length;\n cpw(st.w, 0, blk.length);\n st.w.set(blk, st.w.length - blk.length);\n }\n }\n bt = st.b + (st.c * 4);\n }\n else\n bt = st;\n dat = dat.subarray(bt);\n }\n return cct(bufs, ol);\n}\n/**\n * Decompressor for Zstandard streamed data\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a Zstandard decompressor\n * @param ondata The handler for stream data\n */\n function Decompress(ondata) {\n this.ondata = ondata;\n this.c = [];\n this.l = 0;\n this.z = 0;\n }\n /**\n * Pushes data to be decompressed\n * @param chunk The chunk of data to push\n * @param final Whether or not this is the last chunk in the stream\n */\n Decompress.prototype.push = function (chunk, final) {\n if (typeof this.s == 'number') {\n var sub = Math.min(chunk.length, this.s);\n chunk = chunk.subarray(sub);\n this.s -= sub;\n }\n var sl = chunk.length;\n var ncs = sl + this.l;\n if (!this.s) {\n if (final) {\n if (!ncs) {\n this.ondata(new u8(0), true);\n return;\n }\n // min for frame + one block\n if (ncs < 5)\n err(5);\n }\n else if (ncs < 18) {\n this.c.push(chunk);\n this.l = ncs;\n return;\n }\n if (this.l) {\n this.c.push(chunk);\n chunk = cct(this.c, ncs);\n this.c = [];\n this.l = 0;\n }\n if (typeof (this.s = rzfh(chunk)) == 'number')\n return this.push(chunk, final);\n }\n if (typeof this.s != 'number') {\n if (ncs < (this.z || 3)) {\n if (final)\n err(5);\n this.c.push(chunk);\n this.l = ncs;\n return;\n }\n if (this.l) {\n this.c.push(chunk);\n chunk = cct(this.c, ncs);\n this.c = [];\n this.l = 0;\n }\n if (!this.z && ncs < (this.z = (chunk[this.s.b] & 2) ? 4 : 3 + ((chunk[this.s.b] >> 3) | (chunk[this.s.b + 1] << 5) | (chunk[this.s.b + 2] << 13)))) {\n if (final)\n err(5);\n this.c.push(chunk);\n this.l = ncs;\n return;\n }\n else\n this.z = 0;\n for (;;) {\n var blk = rzb(chunk, this.s);\n if (!blk) {\n if (final)\n err(5);\n var adc = chunk.subarray(this.s.b);\n this.s.b = 0;\n this.c.push(adc), this.l += adc.length;\n return;\n }\n else {\n this.ondata(blk, false);\n cpw(this.s.w, 0, blk.length);\n this.s.w.set(blk, this.s.w.length - blk.length);\n }\n if (this.s.l) {\n var rest = chunk.subarray(this.s.b);\n this.s = this.s.c * 4;\n this.push(rest, final);\n return;\n }\n }\n }\n else if (final)\n err(5);\n };\n return Decompress;\n}());\nexport { Decompress };\n",
|
|
159
|
-
"\n/** @type {import('../src/types.d.ts').ParquetType[]} */\nexport const ParquetTypes = [\n 'BOOLEAN',\n 'INT32',\n 'INT64',\n 'INT96', // deprecated\n 'FLOAT',\n 'DOUBLE',\n 'BYTE_ARRAY',\n 'FIXED_LEN_BYTE_ARRAY',\n]\n\n/** @type {import('../src/types.d.ts').Encoding[]} */\nexport const Encodings = [\n 'PLAIN',\n 'GROUP_VAR_INT', // deprecated\n 'PLAIN_DICTIONARY',\n 'RLE',\n 'BIT_PACKED', // deprecated\n 'DELTA_BINARY_PACKED',\n 'DELTA_LENGTH_BYTE_ARRAY',\n 'DELTA_BYTE_ARRAY',\n 'RLE_DICTIONARY',\n 'BYTE_STREAM_SPLIT',\n]\n\n/** @type {import('../src/types.d.ts').FieldRepetitionType[]} */\nexport const FieldRepetitionTypes = [\n 'REQUIRED',\n 'OPTIONAL',\n 'REPEATED',\n]\n\n/** @type {import('../src/types.d.ts').ConvertedType[]} */\nexport const ConvertedTypes = [\n 'UTF8',\n 'MAP',\n 'MAP_KEY_VALUE',\n 'LIST',\n 'ENUM',\n 'DECIMAL',\n 'DATE',\n 'TIME_MILLIS',\n 'TIME_MICROS',\n 'TIMESTAMP_MILLIS',\n 'TIMESTAMP_MICROS',\n 'UINT_8',\n 'UINT_16',\n 'UINT_32',\n 'UINT_64',\n 'INT_8',\n 'INT_16',\n 'INT_32',\n 'INT_64',\n 'JSON',\n 'BSON',\n 'INTERVAL',\n]\n\n/** @type {import('../src/types.d.ts').CompressionCodec[]} */\nexport const CompressionCodecs = [\n 'UNCOMPRESSED',\n 'SNAPPY',\n 'GZIP',\n 'LZO',\n 'BROTLI',\n 'LZ4',\n 'ZSTD',\n 'LZ4_RAW',\n]\n\n/** @type {import('../src/types.d.ts').PageType[]} */\nexport const PageTypes = [\n 'DATA_PAGE',\n 'INDEX_PAGE',\n 'DICTIONARY_PAGE',\n 'DATA_PAGE_V2',\n]\n\n/** @type {import('../src/types.d.ts').BoundaryOrder[]} */\nexport const BoundaryOrders = [\n 'UNORDERED',\n 'ASCENDING',\n 'DESCENDING',\n]\n\n/** @type {import('../src/types.d.ts').EdgeInterpolationAlgorithm[]} */\nexport const EdgeInterpolationAlgorithms = [\n 'SPHERICAL',\n 'VINCENTY',\n 'THOMAS',\n 'ANDOYER',\n 'KARNEY',\n]\n",
|
|
160
|
-
"/**\n * WKB (Well-Known Binary) decoder for geometry objects.\n *\n * @param {DataReader} reader\n * @returns {Geometry} geometry object\n */\nexport function wkbToGeojson(reader) {\n const flags = getFlags(reader)\n\n if (flags.type === 1) { // Point\n return { type: 'Point', coordinates: readPosition(reader, flags) }\n } else if (flags.type === 2) { // LineString\n return { type: 'LineString', coordinates: readLine(reader, flags) }\n } else if (flags.type === 3) { // Polygon\n return { type: 'Polygon', coordinates: readPolygon(reader, flags) }\n } else if (flags.type === 4) { // MultiPoint\n const points = []\n for (let i = 0; i < flags.count; i++) {\n points.push(readPosition(reader, getFlags(reader)))\n }\n return { type: 'MultiPoint', coordinates: points }\n } else if (flags.type === 5) { // MultiLineString\n const lines = []\n for (let i = 0; i < flags.count; i++) {\n lines.push(readLine(reader, getFlags(reader)))\n }\n return { type: 'MultiLineString', coordinates: lines }\n } else if (flags.type === 6) { // MultiPolygon\n const polygons = []\n for (let i = 0; i < flags.count; i++) {\n polygons.push(readPolygon(reader, getFlags(reader)))\n }\n return { type: 'MultiPolygon', coordinates: polygons }\n } else if (flags.type === 7) { // GeometryCollection\n const geometries = []\n for (let i = 0; i < flags.count; i++) {\n geometries.push(wkbToGeojson(reader))\n }\n return { type: 'GeometryCollection', geometries }\n } else {\n throw new Error(`Unsupported geometry type: ${flags.type}`)\n }\n}\n\n/**\n * Extract ISO WKB flags and base geometry type.\n *\n * @param {DataReader} reader\n * @returns {WkbFlags}\n */\nfunction getFlags(reader) {\n const { view } = reader\n const littleEndian = view.getUint8(reader.offset++) === 1\n const rawType = view.getUint32(reader.offset, littleEndian)\n reader.offset += 4\n\n const type = rawType % 1000\n const flags = Math.floor(rawType / 1000)\n\n let count = 0\n if (type > 1 && type <= 7) {\n count = view.getUint32(reader.offset, littleEndian)\n reader.offset += 4\n }\n\n // XY, XYZ, XYM, XYZM\n let dim = 2\n if (flags) dim++\n if (flags === 3) dim++\n\n return { littleEndian, type, dim, count }\n}\n\n/**\n * @param {DataReader} reader\n * @param {WkbFlags} flags\n * @returns {number[]}\n */\nfunction readPosition(reader, flags) {\n const points = []\n for (let i = 0; i < flags.dim; i++) {\n const coord = reader.view.getFloat64(reader.offset, flags.littleEndian)\n reader.offset += 8\n points.push(coord)\n }\n return points\n}\n\n/**\n * @param {DataReader} reader\n * @param {WkbFlags} flags\n * @returns {number[][]}\n */\nfunction readLine(reader, flags) {\n const points = []\n for (let i = 0; i < flags.count; i++) {\n points.push(readPosition(reader, flags))\n }\n return points\n}\n\n/**\n * @param {DataReader} reader\n * @param {WkbFlags} flags\n * @returns {number[][][]}\n */\nfunction readPolygon(reader, flags) {\n const { view } = reader\n const rings = []\n for (let r = 0; r < flags.count; r++) {\n const count = view.getUint32(reader.offset, flags.littleEndian)\n reader.offset += 4\n rings.push(readLine(reader, { ...flags, count }))\n }\n return rings\n}\n\n/**\n * @typedef {object} WkbFlags\n * @property {boolean} littleEndian\n * @property {number} type\n * @property {number} dim\n * @property {number} count\n */\n\n/**\n * @import {DataReader, Geometry} from '../src/types.js'\n */\n",
|
|
161
|
-
"import { wkbToGeojson } from './wkb.js'\n\n/**\n * @import {ColumnDecoder, DecodedArray, Encoding, ParquetParsers} from '../src/types.js'\n */\n\nconst decoder = new TextDecoder()\n\n/**\n * Default type parsers when no custom ones are given\n * @type ParquetParsers\n */\nexport const DEFAULT_PARSERS = {\n timestampFromMilliseconds(millis) {\n return new Date(Number(millis))\n },\n timestampFromMicroseconds(micros) {\n return new Date(Number(micros / 1000n))\n },\n timestampFromNanoseconds(nanos) {\n return new Date(Number(nanos / 1000000n))\n },\n dateFromDays(days) {\n return new Date(days * 86400000)\n },\n stringFromBytes(bytes) {\n return bytes && decoder.decode(bytes)\n },\n jsonFromBytes(bytes) {\n return bytes && JSON.parse(decoder.decode(bytes))\n },\n geometryFromBytes(bytes) {\n return bytes && wkbToGeojson({ view: new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength), offset: 0 })\n },\n geographyFromBytes(bytes) {\n return bytes && wkbToGeojson({ view: new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength), offset: 0 })\n },\n uuidFromBytes(bytes) {\n if (!bytes) return undefined\n const hex = Array.from(bytes, b => b.toString(16).padStart(2, '0')).join('')\n return hex.slice(0, 8) + '-' + hex.slice(8, 12) + '-' + hex.slice(12, 16) + '-' + hex.slice(16, 20) + '-' + hex.slice(20, 32)\n },\n}\n\n/**\n * Convert known types from primitive to rich, and dereference dictionary.\n *\n * @param {DecodedArray} data series of primitive types\n * @param {DecodedArray | undefined} dictionary\n * @param {Encoding} encoding\n * @param {ColumnDecoder} columnDecoder\n * @returns {DecodedArray} series of rich types\n */\nexport function convertWithDictionary(data, dictionary, encoding, columnDecoder) {\n if (dictionary && encoding.endsWith('_DICTIONARY')) {\n let output = data\n if (data instanceof Uint8Array && !(dictionary instanceof Uint8Array)) {\n // @ts-expect-error upgrade data to match dictionary type with fancy constructor\n output = new dictionary.constructor(data.length)\n }\n for (let i = 0; i < data.length; i++) {\n output[i] = dictionary[data[i]]\n }\n return output\n } else {\n return convert(data, columnDecoder)\n }\n}\n\n/**\n * Convert known types from primitive to rich.\n *\n * @param {DecodedArray} data series of primitive types\n * @param {ColumnDecoder} columnDecoder\n * @returns {DecodedArray} series of rich types\n */\nexport function convert(data, columnDecoder) {\n const { element, parsers, utf8 = true, schemaPath } = columnDecoder\n const { type, converted_type: ctype, logical_type: ltype } = element\n const nullable = element.repetition_type !== 'REQUIRED'\n\n // Skip utf8 conversion for plain BYTE_ARRAY inside VARIANT\n const isVariant = schemaPath?.some(s => s.element.logical_type?.type === 'VARIANT')\n if (isVariant && type === 'BYTE_ARRAY' && ctype !== 'UTF8' && ltype?.type !== 'STRING') {\n return data\n }\n if (ctype === 'DECIMAL') {\n const scale = element.scale || 0\n const factor = 10 ** -scale\n const arr = new Array(data.length)\n for (let i = 0; i < arr.length; i++) {\n if (data[i] instanceof Uint8Array) {\n arr[i] = parseDecimal(data[i]) * factor\n } else {\n arr[i] = Number(data[i]) * factor\n }\n }\n return arr\n }\n if (!ctype && type === 'INT96') {\n return Array.from(data).map(v => parsers.timestampFromNanoseconds(parseInt96Nanos(v)))\n }\n if (ctype === 'DATE') {\n return Array.from(data).map(v => parsers.dateFromDays(v))\n }\n if (ctype === 'TIMESTAMP_MILLIS') {\n return Array.from(data).map(v => parsers.timestampFromMilliseconds(v))\n }\n if (ctype === 'TIMESTAMP_MICROS') {\n return Array.from(data).map(v => parsers.timestampFromMicroseconds(v))\n }\n if (ctype === 'JSON') {\n return data.map(v => parsers.jsonFromBytes(v))\n }\n if (ctype === 'BSON') {\n throw new Error('parquet bson not supported')\n }\n if (ctype === 'INTERVAL') {\n throw new Error('parquet interval not supported')\n }\n if (ltype?.type === 'GEOMETRY') {\n return data.map(v => parsers.geometryFromBytes(v))\n }\n if (ltype?.type === 'GEOGRAPHY') {\n return data.map(v => parsers.geographyFromBytes(v))\n }\n if (ltype?.type === 'UUID') {\n return data.map(v => parsers.uuidFromBytes(v))\n }\n if (ctype === 'UTF8' || ltype?.type === 'STRING' || utf8 && type === 'BYTE_ARRAY') {\n return data.map(v => parsers.stringFromBytes(v))\n }\n if (ctype === 'UINT_64' || ltype?.type === 'INTEGER' && ltype.bitWidth === 64 && !ltype.isSigned) {\n if (data instanceof BigInt64Array) return new BigUint64Array(data.buffer, data.byteOffset, data.length)\n const arr = nullable ? new Array(data.length) : new BigUint64Array(data.length)\n for (let i = 0; i < arr.length; i++) arr[i] = data[i]\n return arr\n }\n if (ctype === 'UINT_32' || ltype?.type === 'INTEGER' && ltype.bitWidth === 32 && !ltype.isSigned) {\n if (data instanceof Int32Array) return new Uint32Array(data.buffer, data.byteOffset, data.length)\n const arr = nullable ? new Array(data.length) : new Uint32Array(data.length)\n for (let i = 0; i < arr.length; i++) {\n arr[i] = data[i] < 0 ? 4294967296 + data[i] : data[i]\n }\n return arr\n }\n if (ltype?.type === 'FLOAT16') {\n return Array.from(data).map(parseFloat16)\n }\n if (ltype?.type === 'TIMESTAMP') {\n const { unit } = ltype\n /** @type {ParquetParsers[keyof ParquetParsers]} */\n let parser = parsers.timestampFromMilliseconds\n if (unit === 'MICROS') parser = parsers.timestampFromMicroseconds\n if (unit === 'NANOS') parser = parsers.timestampFromNanoseconds\n const arr = new Array(data.length)\n for (let i = 0; i < arr.length; i++) {\n arr[i] = parser(data[i])\n }\n return arr\n }\n return data\n}\n\n/**\n * @param {Uint8Array} bytes\n * @returns {number}\n */\nexport function parseDecimal(bytes) {\n if (!bytes.length) return 0\n\n let value = 0n\n for (const byte of bytes) {\n value = value * 256n + BigInt(byte)\n }\n\n // handle signed\n const bits = bytes.length * 8\n if (value >= 2n ** BigInt(bits - 1)) {\n value -= 2n ** BigInt(bits)\n }\n\n return Number(value)\n}\n\n/**\n * Converts INT96 date format (hi 32bit days, lo 64bit nanos) to nanos since epoch\n * @param {bigint} value\n * @returns {bigint}\n */\nfunction parseInt96Nanos(value) {\n const days = (value >> 64n) - 2440588n\n const nano = value & 0xffffffffffffffffn\n return days * 86400000000000n + nano\n}\n\n/**\n * @param {Uint8Array | undefined} bytes\n * @returns {number | undefined}\n */\nexport function parseFloat16(bytes) {\n if (!bytes) return undefined\n const int16 = bytes[1] << 8 | bytes[0]\n const sign = int16 >> 15 ? -1 : 1\n const exp = int16 >> 10 & 0x1f\n const frac = int16 & 0x3ff\n if (exp === 0) return sign * 2 ** -14 * (frac / 1024) // subnormals\n if (exp === 0x1f) return frac ? NaN : sign * Infinity\n return sign * 2 ** (exp - 15) * (1 + frac / 1024)\n}\n",
|
|
162
|
-
"/**\n * Build a tree from the schema elements.\n *\n * @param {SchemaElement[]} schema\n * @param {number} rootIndex index of the root element\n * @param {string[]} path path to the element\n * @returns {SchemaTree} tree of schema elements\n */\nfunction schemaTree(schema, rootIndex, path) {\n const element = schema[rootIndex]\n const children = []\n let count = 1\n\n // Read the specified number of children\n if (element.num_children) {\n while (children.length < element.num_children) {\n const childElement = schema[rootIndex + count]\n const child = schemaTree(schema, rootIndex + count, [...path, childElement.name])\n count += child.count\n children.push(child)\n }\n }\n\n return { count, element, children, path }\n}\n\n/**\n * Get schema elements from the root to the given element name.\n *\n * @param {SchemaElement[]} schema\n * @param {string[]} name path to the element\n * @returns {SchemaTree[]} list of schema elements\n */\nexport function getSchemaPath(schema, name) {\n let tree = schemaTree(schema, 0, [])\n const path = [tree]\n for (const part of name) {\n const child = tree.children.find(child => child.element.name === part)\n if (!child) throw new Error(`parquet schema element not found: ${name}`)\n path.push(child)\n tree = child\n }\n return path\n}\n\n/**\n * Get all physical (leaf) column names.\n *\n * @param {SchemaTree} schemaTree\n * @returns {string[]} list of physical column names\n */\nexport function getPhysicalColumns(schemaTree) {\n /** @type {string[]} */\n const columns = []\n /** @param {SchemaTree} node */\n function traverse(node) {\n if (node.children.length) {\n for (const child of node.children) {\n traverse(child)\n }\n } else {\n columns.push(node.path.join('.'))\n }\n }\n traverse(schemaTree)\n return columns\n}\n\n/**\n * Get the max repetition level for a given schema path.\n *\n * @param {SchemaTree[]} schemaPath\n * @returns {number} max repetition level\n */\nexport function getMaxRepetitionLevel(schemaPath) {\n let maxLevel = 0\n for (const { element } of schemaPath) {\n if (element.repetition_type === 'REPEATED') {\n maxLevel++\n }\n }\n return maxLevel\n}\n\n/**\n * Get the max definition level for a given schema path.\n *\n * @param {SchemaTree[]} schemaPath\n * @returns {number} max definition level\n */\nexport function getMaxDefinitionLevel(schemaPath) {\n let maxLevel = 0\n for (const { element } of schemaPath.slice(1)) {\n if (element.repetition_type !== 'REQUIRED') {\n maxLevel++\n }\n }\n return maxLevel\n}\n\n/**\n * Check if a column is list-like.\n *\n * @param {SchemaTree} schema\n * @returns {boolean} true if list-like\n */\nexport function isListLike(schema) {\n if (!schema) return false\n if (schema.element.converted_type !== 'LIST') return false\n if (schema.children.length > 1) return false\n\n const firstChild = schema.children[0]\n if (firstChild.children.length > 1) return false\n if (firstChild.element.repetition_type !== 'REPEATED') return false\n\n return true\n}\n\n/**\n * Check if a column is map-like.\n *\n * @param {SchemaTree} schema\n * @returns {boolean} true if map-like\n */\nexport function isMapLike(schema) {\n if (!schema) return false\n if (schema.element.converted_type !== 'MAP') return false\n if (schema.children.length > 1) return false\n\n const firstChild = schema.children[0]\n if (firstChild.children.length !== 2) return false\n if (firstChild.element.repetition_type !== 'REPEATED') return false\n\n const keyChild = firstChild.children.find(child => child.element.name === 'key')\n if (keyChild?.element.repetition_type === 'REPEATED') return false\n\n const valueChild = firstChild.children.find(child => child.element.name === 'value')\n if (valueChild?.element.repetition_type === 'REPEATED') return false\n\n return true\n}\n\n/**\n * Returns true if a column is non-nested.\n *\n * @param {SchemaTree[]} schemaPath\n * @returns {boolean}\n */\nexport function isFlatColumn(schemaPath) {\n if (schemaPath.length !== 2) return false\n const [, column] = schemaPath\n if (column.element.repetition_type === 'REPEATED') return false\n if (column.children.length) return false\n return true\n}\n\n/**\n * @import {SchemaElement, SchemaTree} from '../src/types.js'\n */\n",
|
|
163
|
-
"/**\n * @import {DataReader, ThriftObject, ThriftType} from '../src/types.js'\n */\n\n// TCompactProtocol types\nconst STOP = 0\nconst TRUE = 1\nconst FALSE = 2\nconst BYTE = 3\nconst I16 = 4\nconst I32 = 5\nconst I64 = 6\nconst DOUBLE = 7\nconst BINARY = 8\nconst LIST = 9\nconst STRUCT = 12\n\n/**\n * Parse TCompactProtocol\n *\n * @param {DataReader} reader\n * @returns {{ [key: `field_${number}`]: any }}\n */\nexport function deserializeTCompactProtocol(reader) {\n /** @type {ThriftObject} */\n const value = {}\n let fid = 0\n\n while (reader.offset < reader.view.byteLength) {\n // Parse each field based on its type and add to the result object\n const byte = reader.view.getUint8(reader.offset++)\n const type = byte & 0x0f\n if (type === STOP) break\n const delta = byte >> 4\n fid = delta ? fid + delta : readZigZag(reader)\n value[`field_${fid}`] = readElement(reader, type)\n }\n\n return value\n}\n\n/**\n * Read a single element based on its type\n *\n * @param {DataReader} reader\n * @param {number} type\n * @returns {ThriftType}\n */\nfunction readElement(reader, type) {\n switch (type) {\n case TRUE:\n return true\n case FALSE:\n return false\n case BYTE:\n return reader.view.getInt8(reader.offset++)\n case I16:\n case I32:\n return readZigZag(reader)\n case I64:\n return readZigZagBigInt(reader)\n case DOUBLE: {\n const value = reader.view.getFloat64(reader.offset, true)\n reader.offset += 8\n return value\n }\n case BINARY: {\n const stringLength = readVarInt(reader)\n const strBytes = new Uint8Array(reader.view.buffer, reader.view.byteOffset + reader.offset, stringLength)\n reader.offset += stringLength\n return strBytes\n }\n case LIST: {\n const byte = reader.view.getUint8(reader.offset++)\n const elemType = byte & 0x0f\n let listSize = byte >> 4\n if (listSize === 15) {\n listSize = readVarInt(reader)\n }\n const boolType = elemType === TRUE || elemType === FALSE\n const values = new Array(listSize)\n for (let i = 0; i < listSize; i++) {\n values[i] = boolType ? readElement(reader, BYTE) === 1 : readElement(reader, elemType)\n }\n return values\n }\n case STRUCT:\n // main function handles struct parsing\n return deserializeTCompactProtocol(reader)\n default:\n // MAP, SET, UUID not used by parquet\n throw new Error(`thrift unhandled type: ${type}`)\n }\n}\n\n/**\n * Read varint aka Unsigned LEB128.\n *\n * @param {DataReader} reader\n * @returns {number}\n */\nexport function readVarInt(reader) {\n let result = 0\n let shift = 0\n while (true) {\n // Read groups of 7 low bits until high bit is 0\n const byte = reader.view.getUint8(reader.offset++)\n result |= (byte & 0x7f) << shift\n if (!(byte & 0x80)) {\n return result\n }\n shift += 7\n }\n}\n\n/**\n * Read a varint as a bigint.\n *\n * @param {DataReader} reader\n * @returns {bigint}\n */\nfunction readVarBigInt(reader) {\n let result = 0n\n let shift = 0n\n while (true) {\n const byte = reader.view.getUint8(reader.offset++)\n result |= BigInt(byte & 0x7f) << shift\n if (!(byte & 0x80)) {\n return result\n }\n shift += 7n\n }\n}\n\n/**\n * Read a zigzag number.\n * Zigzag folds positive and negative numbers into the positive number space.\n *\n * @param {DataReader} reader\n * @returns {number}\n */\nexport function readZigZag(reader) {\n const zigzag = readVarInt(reader)\n return zigzag >>> 1 ^ -(zigzag & 1)\n}\n\n/**\n * Read a zigzag bigint.\n *\n * @param {DataReader} reader\n * @returns {bigint}\n */\nexport function readZigZagBigInt(reader) {\n const zigzag = readVarBigInt(reader)\n return zigzag >> 1n ^ -(zigzag & 1n)\n}\n",
|
|
164
|
-
"/**\n * @param {SchemaElement[]} schema\n * @param {KeyValue[] | undefined} key_value_metadata\n * @returns {void}\n */\nexport function markGeoColumns(schema, key_value_metadata) {\n // Prepare the list of GeoParquet columns\n /** @type {Map<string, LogicalType>} */\n const columns = new Map()\n const geo = key_value_metadata?.find(({ key }) => key === 'geo')?.value\n const decodedColumns = (geo && JSON.parse(geo)?.columns) ?? {}\n for (const [name, column] of Object.entries(decodedColumns)) {\n if (column.encoding !== 'WKB') continue\n\n const type = column.edges === 'spherical' ? 'GEOGRAPHY' : 'GEOMETRY'\n const id = column.crs?.id ?? column.crs?.ids?.[0]\n const crs = id ? `${id.authority}:${id.code.toString()}` : undefined\n // Note: we can't infer GEOGRAPHY's algorithm from GeoParquet\n columns.set(name, { type, crs })\n }\n\n // Mark schema elements with logical type\n // Only look at root-level columns of type BYTE_ARRAY without existing logical_type\n for (let i = 1; i < schema.length; i++) { // skip root\n const { logical_type, name, num_children, type } = schema[i]\n if (num_children) {\n i += num_children\n continue // skip the element and its children\n }\n if (type === 'BYTE_ARRAY' && !logical_type) {\n schema[i].logical_type = columns.get(name)\n }\n }\n}\n\n/**\n * @import {KeyValue, LogicalType, SchemaElement} from '../src/types.js'\n */\n",
|
|
165
|
-
"import { CompressionCodecs, ConvertedTypes, EdgeInterpolationAlgorithms, Encodings, FieldRepetitionTypes, PageTypes, ParquetTypes } from './constants.js'\nimport { DEFAULT_PARSERS, parseDecimal, parseFloat16 } from './convert.js'\nimport { getSchemaPath } from './schema.js'\nimport { deserializeTCompactProtocol } from './thrift.js'\nimport { markGeoColumns } from './geoparquet.js'\n\n/**\n * @import {AsyncBuffer, FileMetaData, KeyValue, LogicalType, MetadataOptions, MinMaxType, ParquetParsers, SchemaElement, SchemaTree, Statistics, TimeUnit} from '../src/types.js'\n */\n\nexport const defaultInitialFetchSize = 1 << 19 // 512kb\n\nconst decoder = new TextDecoder()\nfunction decode(/** @type {Uint8Array} */ value) {\n return value && decoder.decode(value)\n}\n\n/**\n * Read parquet metadata from an async buffer.\n *\n * An AsyncBuffer is like an ArrayBuffer, but the slices are loaded\n * asynchronously, possibly over the network.\n *\n * You must provide the byteLength of the buffer, typically from a HEAD request.\n *\n * In theory, you could use suffix-range requests to fetch the end of the file,\n * and save a round trip. But in practice, this doesn't work because chrome\n * deems suffix-range requests as a not-safe-listed header, and will require\n * a pre-flight. So the byteLength is required.\n *\n * To make this efficient, we initially request the last 512kb of the file,\n * which is likely to contain the metadata. If the metadata length exceeds the\n * initial fetch, 512kb, we request the rest of the metadata from the AsyncBuffer.\n *\n * This ensures that we either make one 512kb initial request for the metadata,\n * or a second request for up to the metadata size.\n *\n * @param {AsyncBuffer} asyncBuffer parquet file contents\n * @param {MetadataOptions & { initialFetchSize?: number }} options initial fetch size in bytes (default 512kb)\n * @returns {Promise<FileMetaData>} parquet metadata object\n */\nexport async function parquetMetadataAsync(asyncBuffer, { parsers, initialFetchSize = defaultInitialFetchSize, geoparquet = true } = {}) {\n if (!asyncBuffer || !(asyncBuffer.byteLength >= 0)) throw new Error('parquet expected AsyncBuffer')\n\n // fetch last bytes (footer) of the file\n const footerOffset = Math.max(0, asyncBuffer.byteLength - initialFetchSize)\n const footerBuffer = await asyncBuffer.slice(footerOffset, asyncBuffer.byteLength)\n\n // Check for parquet magic number \"PAR1\"\n const footerView = new DataView(footerBuffer)\n if (footerView.getUint32(footerBuffer.byteLength - 4, true) !== 0x31524150) {\n throw new Error('parquet file invalid (footer != PAR1)')\n }\n\n // Parquet files store metadata at the end of the file\n // Metadata length is 4 bytes before the last PAR1\n const metadataLength = footerView.getUint32(footerBuffer.byteLength - 8, true)\n if (metadataLength > asyncBuffer.byteLength - 8) {\n throw new Error(`parquet metadata length ${metadataLength} exceeds available buffer ${asyncBuffer.byteLength - 8}`)\n }\n\n // check if metadata size fits inside the initial fetch\n if (metadataLength + 8 > initialFetchSize) {\n // fetch the rest of the metadata\n const metadataOffset = asyncBuffer.byteLength - metadataLength - 8\n const metadataBuffer = await asyncBuffer.slice(metadataOffset, footerOffset)\n // combine initial fetch with the new slice\n const combinedBuffer = new ArrayBuffer(metadataLength + 8)\n const combinedView = new Uint8Array(combinedBuffer)\n combinedView.set(new Uint8Array(metadataBuffer))\n combinedView.set(new Uint8Array(footerBuffer), footerOffset - metadataOffset)\n return parquetMetadata(combinedBuffer, { parsers, geoparquet })\n } else {\n // parse metadata from the footer\n return parquetMetadata(footerBuffer, { parsers, geoparquet })\n }\n}\n\n/**\n * Read parquet metadata from a buffer synchronously.\n *\n * @param {ArrayBuffer} arrayBuffer parquet file footer\n * @param {MetadataOptions} options metadata parsing options\n * @returns {FileMetaData} parquet metadata object\n */\nexport function parquetMetadata(arrayBuffer, { parsers, geoparquet = true } = {}) {\n if (!(arrayBuffer instanceof ArrayBuffer)) throw new Error('parquet expected ArrayBuffer')\n const view = new DataView(arrayBuffer)\n\n // Use default parsers if not given\n parsers = { ...DEFAULT_PARSERS, ...parsers }\n\n // Validate footer magic number \"PAR1\"\n if (view.byteLength < 8) {\n throw new Error('parquet file is too short')\n }\n if (view.getUint32(view.byteLength - 4, true) !== 0x31524150) {\n throw new Error('parquet file invalid (footer != PAR1)')\n }\n\n // Parquet files store metadata at the end of the file\n // Metadata length is 4 bytes before the last PAR1\n const metadataLengthOffset = view.byteLength - 8\n const metadataLength = view.getUint32(metadataLengthOffset, true)\n if (metadataLength > view.byteLength - 8) {\n // {metadata}, metadata_length, PAR1\n throw new Error(`parquet metadata length ${metadataLength} exceeds available buffer ${view.byteLength - 8}`)\n }\n\n const metadataOffset = metadataLengthOffset - metadataLength\n const reader = { view, offset: metadataOffset }\n const metadata = deserializeTCompactProtocol(reader)\n\n // Parse metadata from thrift data\n const version = metadata.field_1\n /** @type {SchemaElement[]} */\n const schema = metadata.field_2.map((/** @type {any} */ field) => ({\n type: ParquetTypes[field.field_1],\n type_length: field.field_2,\n repetition_type: FieldRepetitionTypes[field.field_3],\n name: decode(field.field_4),\n num_children: field.field_5,\n converted_type: ConvertedTypes[field.field_6],\n scale: field.field_7,\n precision: field.field_8,\n field_id: field.field_9,\n logical_type: logicalType(field.field_10),\n }))\n // schema element per column index\n const columnSchema = schema.filter(e => e.type)\n const num_rows = metadata.field_3\n const row_groups = metadata.field_4.map((/** @type {any} */ rowGroup) => ({\n columns: rowGroup.field_1.map((/** @type {any} */ column, /** @type {number} */ columnIndex) => ({\n file_path: decode(column.field_1),\n file_offset: column.field_2,\n meta_data: column.field_3 && {\n type: ParquetTypes[column.field_3.field_1],\n encodings: column.field_3.field_2?.map((/** @type {number} */ e) => Encodings[e]),\n path_in_schema: column.field_3.field_3.map(decode),\n codec: CompressionCodecs[column.field_3.field_4],\n num_values: column.field_3.field_5,\n total_uncompressed_size: column.field_3.field_6,\n total_compressed_size: column.field_3.field_7,\n key_value_metadata: column.field_3.field_8?.map((/** @type {any} */ kv) => ({\n key: decode(kv.field_1),\n value: decode(kv.field_2),\n })),\n data_page_offset: column.field_3.field_9,\n index_page_offset: column.field_3.field_10,\n dictionary_page_offset: column.field_3.field_11,\n statistics: convertStats(column.field_3.field_12, columnSchema[columnIndex], parsers),\n encoding_stats: column.field_3.field_13?.map((/** @type {any} */ encodingStat) => ({\n page_type: PageTypes[encodingStat.field_1],\n encoding: Encodings[encodingStat.field_2],\n count: encodingStat.field_3,\n })),\n bloom_filter_offset: column.field_3.field_14,\n bloom_filter_length: column.field_3.field_15,\n size_statistics: column.field_3.field_16 && {\n unencoded_byte_array_data_bytes: column.field_3.field_16.field_1,\n repetition_level_histogram: column.field_3.field_16.field_2,\n definition_level_histogram: column.field_3.field_16.field_3,\n },\n geospatial_statistics: column.field_3.field_17 && {\n bbox: column.field_3.field_17.field_1 && {\n xmin: column.field_3.field_17.field_1.field_1,\n xmax: column.field_3.field_17.field_1.field_2,\n ymin: column.field_3.field_17.field_1.field_3,\n ymax: column.field_3.field_17.field_1.field_4,\n zmin: column.field_3.field_17.field_1.field_5,\n zmax: column.field_3.field_17.field_1.field_6,\n mmin: column.field_3.field_17.field_1.field_7,\n mmax: column.field_3.field_17.field_1.field_8,\n },\n geospatial_types: column.field_3.field_17.field_2,\n },\n },\n offset_index_offset: column.field_4,\n offset_index_length: column.field_5,\n column_index_offset: column.field_6,\n column_index_length: column.field_7,\n crypto_metadata: column.field_8,\n encrypted_column_metadata: column.field_9,\n })),\n total_byte_size: rowGroup.field_2,\n num_rows: rowGroup.field_3,\n sorting_columns: rowGroup.field_4?.map((/** @type {any} */ sortingColumn) => ({\n column_idx: sortingColumn.field_1,\n descending: sortingColumn.field_2,\n nulls_first: sortingColumn.field_3,\n })),\n file_offset: rowGroup.field_5,\n total_compressed_size: rowGroup.field_6,\n ordinal: rowGroup.field_7,\n }))\n /** @type {KeyValue[] | undefined} */\n const key_value_metadata = metadata.field_5?.map((/** @type {any} */ kv) => ({\n key: decode(kv.field_1),\n value: decode(kv.field_2),\n }))\n const created_by = decode(metadata.field_6)\n\n if (geoparquet) {\n markGeoColumns(schema, key_value_metadata)\n }\n\n return {\n version,\n schema,\n num_rows,\n row_groups,\n key_value_metadata,\n created_by,\n metadata_length: metadataLength,\n }\n}\n\n/**\n * Return a tree of schema elements from parquet metadata.\n *\n * @param {{schema: SchemaElement[]}} metadata parquet metadata object\n * @returns {SchemaTree} tree of schema elements\n */\nexport function parquetSchema({ schema }) {\n return getSchemaPath(schema, [])[0]\n}\n\n/**\n * @param {any} logicalType\n * @returns {LogicalType | undefined}\n */\nfunction logicalType(logicalType) {\n if (logicalType?.field_1) return { type: 'STRING' }\n if (logicalType?.field_2) return { type: 'MAP' }\n if (logicalType?.field_3) return { type: 'LIST' }\n if (logicalType?.field_4) return { type: 'ENUM' }\n if (logicalType?.field_5) return {\n type: 'DECIMAL',\n scale: logicalType.field_5.field_1,\n precision: logicalType.field_5.field_2,\n }\n if (logicalType?.field_6) return { type: 'DATE' }\n if (logicalType?.field_7) return {\n type: 'TIME',\n isAdjustedToUTC: logicalType.field_7.field_1,\n unit: timeUnit(logicalType.field_7.field_2),\n }\n if (logicalType?.field_8) return {\n type: 'TIMESTAMP',\n isAdjustedToUTC: logicalType.field_8.field_1,\n unit: timeUnit(logicalType.field_8.field_2),\n }\n if (logicalType?.field_10) return {\n type: 'INTEGER',\n bitWidth: logicalType.field_10.field_1,\n isSigned: logicalType.field_10.field_2,\n }\n if (logicalType?.field_11) return { type: 'NULL' }\n if (logicalType?.field_12) return { type: 'JSON' }\n if (logicalType?.field_13) return { type: 'BSON' }\n if (logicalType?.field_14) return { type: 'UUID' }\n if (logicalType?.field_15) return { type: 'FLOAT16' }\n if (logicalType?.field_16) return {\n type: 'VARIANT',\n specification_version: logicalType.field_16.field_1,\n }\n if (logicalType?.field_17) return {\n type: 'GEOMETRY',\n crs: decode(logicalType.field_17.field_1),\n }\n if (logicalType?.field_18) return {\n type: 'GEOGRAPHY',\n crs: decode(logicalType.field_18.field_1),\n algorithm: EdgeInterpolationAlgorithms[logicalType.field_18.field_2],\n }\n return logicalType\n}\n\n/**\n * @param {any} unit\n * @returns {TimeUnit}\n */\nfunction timeUnit(unit) {\n if (unit.field_1) return 'MILLIS'\n if (unit.field_2) return 'MICROS'\n if (unit.field_3) return 'NANOS'\n throw new Error('parquet time unit required')\n}\n\n/**\n * Convert column statistics based on column type.\n *\n * @param {any} stats\n * @param {SchemaElement} schema\n * @param {ParquetParsers} parsers\n * @returns {Statistics}\n */\nfunction convertStats(stats, schema, parsers) {\n return stats && {\n max: convertMetadata(stats.field_1, schema, parsers),\n min: convertMetadata(stats.field_2, schema, parsers),\n null_count: stats.field_3,\n distinct_count: stats.field_4,\n max_value: convertMetadata(stats.field_5, schema, parsers),\n min_value: convertMetadata(stats.field_6, schema, parsers),\n is_max_value_exact: stats.field_7,\n is_min_value_exact: stats.field_8,\n }\n}\n\n/**\n * @param {Uint8Array | undefined} value\n * @param {SchemaElement} schema\n * @param {ParquetParsers} parsers\n * @returns {MinMaxType | undefined}\n */\nexport function convertMetadata(value, schema, parsers) {\n const { type, converted_type, logical_type } = schema\n if (value === undefined) return value\n if (type === 'BOOLEAN') return value[0] === 1\n if (type === 'BYTE_ARRAY') return parsers.stringFromBytes(value)\n const view = new DataView(value.buffer, value.byteOffset, value.byteLength)\n if (type === 'FLOAT' && view.byteLength === 4) return view.getFloat32(0, true)\n if (type === 'DOUBLE' && view.byteLength === 8) return view.getFloat64(0, true)\n if (type === 'INT32' && converted_type === 'DECIMAL' && view.byteLength === 4) {\n return view.getInt32(0, true) * 10 ** -(schema.scale || 0)\n }\n if (type === 'INT64' && converted_type === 'DECIMAL' && view.byteLength === 8) {\n return Number(view.getBigInt64(0, true)) * 10 ** -(schema.scale || 0)\n }\n if (type === 'INT32' && converted_type === 'DATE') return parsers.dateFromDays(view.getInt32(0, true))\n if (type === 'INT64' && converted_type === 'TIMESTAMP_MILLIS') return parsers.timestampFromMilliseconds(view.getBigInt64(0, true))\n if (type === 'INT64' && converted_type === 'TIMESTAMP_MICROS') return parsers.timestampFromMicroseconds(view.getBigInt64(0, true))\n if (type === 'INT64' && logical_type?.type === 'TIMESTAMP' && logical_type?.unit === 'NANOS') return parsers.timestampFromNanoseconds(view.getBigInt64(0, true))\n if (type === 'INT64' && logical_type?.type === 'TIMESTAMP' && logical_type?.unit === 'MICROS') return parsers.timestampFromMicroseconds(view.getBigInt64(0, true))\n if (type === 'INT64' && logical_type?.type === 'TIMESTAMP') return parsers.timestampFromMilliseconds(view.getBigInt64(0, true))\n const unsigned = converted_type?.startsWith('UINT_') ||\n logical_type?.type === 'INTEGER' && !logical_type.isSigned\n if (type === 'INT32' && unsigned && view.byteLength === 4) return view.getUint32(0, true)\n if (type === 'INT64' && unsigned && view.byteLength === 8) return view.getBigUint64(0, true)\n if (type === 'INT32' && view.byteLength === 4) return view.getInt32(0, true)\n if (type === 'INT64' && view.byteLength === 8) return view.getBigInt64(0, true)\n if (converted_type === 'DECIMAL') return parseDecimal(value) * 10 ** -(schema.scale || 0)\n if (logical_type?.type === 'FLOAT16') return parseFloat16(value)\n if (logical_type?.type === 'UUID') return parsers.uuidFromBytes(value)\n if (type === 'FIXED_LEN_BYTE_ARRAY') return value\n // assert(false)\n return value\n}\n",
|
|
166
|
-
"/**\n * @import {ColumnIndex, DataReader, OffsetIndex, PageLocation, ParquetParsers, SchemaElement} from '../src/types.js'\n */\n\nimport { BoundaryOrders } from './constants.js'\nimport { DEFAULT_PARSERS } from './convert.js'\nimport { convertMetadata } from './metadata.js'\nimport { deserializeTCompactProtocol } from './thrift.js'\n\n/**\n * @param {DataReader} reader\n * @param {SchemaElement} schema\n * @param {ParquetParsers | undefined} parsers\n * @returns {ColumnIndex}\n */\nexport function readColumnIndex(reader, schema, parsers = undefined) {\n parsers = { ...DEFAULT_PARSERS, ...parsers }\n\n const thrift = deserializeTCompactProtocol(reader)\n return {\n null_pages: thrift.field_1,\n min_values: thrift.field_2.map((/** @type {any} */ m) => convertMetadata(m, schema, parsers)),\n max_values: thrift.field_3.map((/** @type {any} */ m) => convertMetadata(m, schema, parsers)),\n boundary_order: BoundaryOrders[thrift.field_4],\n null_counts: thrift.field_5,\n repetition_level_histograms: thrift.field_6,\n definition_level_histograms: thrift.field_7,\n }\n}\n\n/**\n * @param {DataReader} reader\n * @returns {OffsetIndex}\n */\nexport function readOffsetIndex(reader) {\n const thrift = deserializeTCompactProtocol(reader)\n return {\n // @ts-ignore\n page_locations: thrift.field_1.map(loc => ({\n offset: loc.field_1,\n compressed_page_size: loc.field_2,\n first_row_index: loc.field_3,\n })),\n unencoded_byte_array_data_bytes: thrift.field_2,\n }\n}\n",
|
|
167
|
-
"// XxHash64 (https://github.com/Cyan4973/xxHash/blob/dev/doc/xxhash_spec.md)\n// Used by parquet bloom filters: hashes the PLAIN encoding of column values with seed 0.\n\nconst MASK = 0xffffffffffffffffn\nconst PRIME1 = 0x9e3779b185ebca87n\nconst PRIME2 = 0xc2b2ae3d27d4eb4fn\nconst PRIME3 = 0x165667b19e3779f9n\nconst PRIME4 = 0x85ebca77c2b2ae63n\nconst PRIME5 = 0x27d4eb2f165667c5n\n\n/**\n * @param {bigint} x\n * @param {bigint} r rotation amount in bits (1..63)\n * @returns {bigint}\n */\nfunction rotl64(x, r) {\n return (x << r | x >> 64n - r) & MASK\n}\n\n/**\n * @param {bigint} acc\n * @param {bigint} val\n * @returns {bigint}\n */\nfunction round(acc, val) {\n acc = acc + val * PRIME2 & MASK\n acc = rotl64(acc, 31n)\n return acc * PRIME1 & MASK\n}\n\n/**\n * @param {bigint} acc\n * @param {bigint} val\n * @returns {bigint}\n */\nfunction mergeRound(acc, val) {\n acc ^= round(0n, val)\n return acc * PRIME1 + PRIME4 & MASK\n}\n\n/**\n * Compute the 64-bit xxHash of a byte buffer.\n *\n * @param {Uint8Array} input\n * @param {bigint} [seed]\n * @returns {bigint} 64-bit hash\n */\nexport function xxhash64(input, seed = 0n) {\n const view = new DataView(input.buffer, input.byteOffset, input.byteLength)\n const len = input.byteLength\n let offset = 0\n let h64\n\n if (len >= 32) {\n let v1 = seed + PRIME1 + PRIME2 & MASK\n let v2 = seed + PRIME2 & MASK\n let v3 = seed\n let v4 = seed - PRIME1 & MASK\n\n while (offset + 32 <= len) {\n v1 = round(v1, view.getBigUint64(offset, true)); offset += 8\n v2 = round(v2, view.getBigUint64(offset, true)); offset += 8\n v3 = round(v3, view.getBigUint64(offset, true)); offset += 8\n v4 = round(v4, view.getBigUint64(offset, true)); offset += 8\n }\n\n h64 = rotl64(v1, 1n) + rotl64(v2, 7n) + rotl64(v3, 12n) + rotl64(v4, 18n) & MASK\n h64 = mergeRound(h64, v1)\n h64 = mergeRound(h64, v2)\n h64 = mergeRound(h64, v3)\n h64 = mergeRound(h64, v4)\n } else {\n h64 = seed + PRIME5 & MASK\n }\n\n h64 = h64 + BigInt(len) & MASK\n\n while (offset + 8 <= len) {\n h64 ^= round(0n, view.getBigUint64(offset, true))\n h64 = rotl64(h64, 27n) * PRIME1 + PRIME4 & MASK\n offset += 8\n }\n\n if (offset + 4 <= len) {\n h64 ^= BigInt(view.getUint32(offset, true)) * PRIME1 & MASK\n h64 = rotl64(h64, 23n) * PRIME2 + PRIME3 & MASK\n offset += 4\n }\n\n while (offset < len) {\n h64 ^= BigInt(view.getUint8(offset)) * PRIME5 & MASK\n h64 = rotl64(h64, 11n) * PRIME1 & MASK\n offset += 1\n }\n\n h64 ^= h64 >> 33n\n h64 = h64 * PRIME2 & MASK\n h64 ^= h64 >> 29n\n h64 = h64 * PRIME3 & MASK\n h64 ^= h64 >> 32n\n return h64\n}\n",
|
|
168
|
-
"// Split Block Bloom Filter (https://github.com/apache/parquet-format/blob/master/BloomFilter.md)\n// A bloom filter is a sequence of 32-byte blocks. Each block holds 8 little-endian uint32 words.\n// Insertion sets one bit per word, chosen by salting the low 32 bits of an xxhash64.\n// Membership requires all 8 bits to be set; misses are exact, hits are probabilistic.\n\nimport { deserializeTCompactProtocol } from './thrift.js'\nimport { xxhash64 } from './xxhash.js'\n\n/**\n * @import {BloomFilter, DataReader, ParquetQueryFilter, SchemaElement} from '../src/types.js'\n */\n\nconst textEncoder = new TextEncoder()\n\nconst SALT = new Uint32Array([\n 0x47b6137b, 0x44974d91, 0x8824ad5b, 0xa2b7289d,\n 0x705495c7, 0x2df1424b, 0x9efc4947, 0x5c6bfb31,\n])\n\n/**\n * Map the high 32 bits of a hash to a block index in [0, numBlocks).\n *\n * @param {bigint} hash\n * @param {number} numBlocks\n * @returns {number}\n */\nfunction blockIndex(hash, numBlocks) {\n return Number((hash >> 32n) * BigInt(numBlocks) >> 32n)\n}\n\n/**\n * Per-block mask: 8 uint32 words, each with a single bit set at position `(low32 * SALT[i]) >> 27`.\n *\n * @param {bigint} hash\n * @returns {Uint32Array}\n */\nfunction blockMask(hash) {\n const m = new Uint32Array(8)\n const low = Number(hash & 0xffffffffn) | 0\n for (let i = 0; i < 8; i++) {\n m[i] = 1 << (Math.imul(low, SALT[i]) >>> 27)\n }\n return m\n}\n\n/**\n * Insert a hash into a Split Block Bloom Filter.\n *\n * @param {Uint32Array} blocks bloom filter words (8 * numBlocks long)\n * @param {bigint} hash 64-bit xxhash of the parquet-plain-encoded value\n */\nexport function sbbfInsert(blocks, hash) {\n const offset = blockIndex(hash, blocks.length >> 3) << 3\n const m = blockMask(hash)\n for (let i = 0; i < 8; i++) {\n blocks[offset + i] |= m[i]\n }\n}\n\n/**\n * Test whether a hash might be present in a Split Block Bloom Filter.\n * False positives are possible; false negatives are not.\n *\n * @param {Uint32Array} blocks bloom filter words (8 * numBlocks long)\n * @param {bigint} hash 64-bit xxhash of the parquet-plain-encoded value\n * @returns {boolean}\n */\nexport function sbbfContains(blocks, hash) {\n const offset = blockIndex(hash, blocks.length >> 3) << 3\n const m = blockMask(hash)\n for (let i = 0; i < 8; i++) {\n if ((blocks[offset + i] & m[i]) === 0) return false\n }\n return true\n}\n\n/**\n * Parse a Split Block Bloom Filter from a reader positioned at the BloomFilterHeader.\n * Returns undefined when the header advertises an unsupported algorithm, hash, or\n * compression — callers should treat that as \"cannot use this bloom filter.\"\n *\n * @param {DataReader} reader\n * @returns {BloomFilter | undefined}\n */\nexport function readBloomFilter(reader) {\n const header = deserializeTCompactProtocol(reader)\n const numBytes = header.field_1\n if (typeof numBytes !== 'number' || numBytes <= 0 || numBytes % 32 !== 0) return undefined\n // BloomFilterAlgorithm / Hash / Compression are unions with a single supported variant each.\n if (!header.field_2?.field_1) return undefined // algorithm must be BLOCK\n if (!header.field_3?.field_1) return undefined // hash must be XXHASH\n if (!header.field_4?.field_1) return undefined // compression must be UNCOMPRESSED\n\n const { view, offset } = reader\n if (offset + numBytes > view.byteLength) {\n throw new Error(`parquet bloom filter truncated: need ${numBytes} bytes, have ${view.byteLength - offset}`)\n }\n // Reader offset is not 4-aligned in general, and we want endian-portable reads.\n const blocks = new Uint32Array(numBytes >> 2)\n for (let i = 0; i < blocks.length; i++) {\n blocks[i] = view.getUint32(offset + i * 4, true)\n }\n reader.offset = offset + numBytes\n return { numBytes, blocks }\n}\n\n/**\n * Hash a JS filter value as its parquet PLAIN-encoded bytes, suitable for a\n * bloom filter lookup. Returns undefined when the column's parser is lossy or\n * ambiguous (DATE, TIMESTAMP_*, DECIMAL, JSON, BSON, INT96, FLOAT16, UUID,\n * GEOMETRY, GEOGRAPHY, INTERVAL) or when the JS value type doesn't match the\n * column. Callers must treat undefined as \"bloom filter cannot help.\"\n *\n * @param {any} value\n * @param {SchemaElement} element\n * @returns {bigint | undefined}\n */\nexport function hashParquetValue(value, element) {\n if (value === null || value === undefined) return undefined\n const { type, converted_type, logical_type } = element\n\n if (type === 'BOOLEAN') {\n if (typeof value !== 'boolean') return undefined\n return xxhash64(new Uint8Array([value ? 1 : 0]))\n }\n\n if (type === 'FLOAT') {\n if (typeof value !== 'number') return undefined\n const buf = new ArrayBuffer(4)\n new DataView(buf).setFloat32(0, value, true)\n return xxhash64(new Uint8Array(buf))\n }\n\n if (type === 'DOUBLE') {\n if (typeof value !== 'number') return undefined\n const buf = new ArrayBuffer(8)\n new DataView(buf).setFloat64(0, value, true)\n return xxhash64(new Uint8Array(buf))\n }\n\n if (type === 'INT32') {\n if (converted_type === 'DATE' || converted_type === 'DECIMAL' || converted_type === 'TIME_MILLIS') return undefined\n if (logical_type?.type === 'DATE' || logical_type?.type === 'TIME' || logical_type?.type === 'DECIMAL') return undefined\n if (typeof value !== 'number' || !Number.isInteger(value)) return undefined\n const buf = new ArrayBuffer(4)\n new DataView(buf).setInt32(0, value | 0, true)\n return xxhash64(new Uint8Array(buf))\n }\n\n if (type === 'INT64') {\n if (converted_type === 'TIMESTAMP_MILLIS' || converted_type === 'TIMESTAMP_MICROS') return undefined\n if (converted_type === 'TIME_MICROS' || converted_type === 'DECIMAL') return undefined\n if (logical_type?.type === 'TIMESTAMP' || logical_type?.type === 'TIME' || logical_type?.type === 'DECIMAL') return undefined\n let bigValue\n if (typeof value === 'bigint') bigValue = value\n else if (typeof value === 'number' && Number.isSafeInteger(value)) bigValue = BigInt(value)\n else return undefined\n const buf = new ArrayBuffer(8)\n new DataView(buf).setBigUint64(0, BigInt.asUintN(64, bigValue), true)\n return xxhash64(new Uint8Array(buf))\n }\n\n if (type === 'BYTE_ARRAY') {\n if (converted_type === 'JSON' || converted_type === 'BSON' || converted_type === 'DECIMAL') return undefined\n if (logical_type?.type === 'JSON' || logical_type?.type === 'BSON' || logical_type?.type === 'VARIANT') return undefined\n if (logical_type?.type === 'GEOMETRY' || logical_type?.type === 'GEOGRAPHY') return undefined\n if (typeof value === 'string') return xxhash64(textEncoder.encode(value))\n if (value instanceof Uint8Array) return xxhash64(value)\n return undefined\n }\n\n if (type === 'FIXED_LEN_BYTE_ARRAY') {\n if (converted_type === 'DECIMAL' || converted_type === 'INTERVAL') return undefined\n if (logical_type?.type === 'DECIMAL' || logical_type?.type === 'UUID' || logical_type?.type === 'FLOAT16') return undefined\n if (logical_type?.type === 'GEOMETRY' || logical_type?.type === 'GEOGRAPHY') return undefined\n if (value instanceof Uint8Array) return xxhash64(value)\n return undefined\n }\n\n // INT96 deprecated, or type missing on group columns\n return undefined\n}\n\n/**\n * Top-level column names that appear in $eq or $in predicates within a filter.\n * These are the only columns where a bloom filter can prove a value's absence\n * and let us skip a row group; any other operator can't be helped by a bloom.\n *\n * @param {ParquetQueryFilter | undefined} filter\n * @returns {Set<string>}\n */\nexport function bloomEligibleColumns(filter) {\n /** @type {Set<string>} */\n const out = new Set()\n walkBloomEligible(filter, out)\n return out\n}\n\n/**\n * @param {ParquetQueryFilter | undefined} filter\n * @param {Set<string>} out\n */\nfunction walkBloomEligible(filter, out) {\n if (!filter) return\n if ('$and' in filter && Array.isArray(filter.$and)) {\n for (const sub of filter.$and) walkBloomEligible(sub, out)\n return\n }\n if ('$or' in filter && Array.isArray(filter.$or)) {\n for (const sub of filter.$or) walkBloomEligible(sub, out)\n return\n }\n // $nor would need to prove presence, not absence — bloom can't help.\n if ('$nor' in filter) return\n for (const [field, condition] of Object.entries(filter)) {\n if (field.startsWith('$')) continue\n if (typeof condition === 'object' && condition !== null && !Array.isArray(condition)) {\n if ('$eq' in condition || '$in' in condition) out.add(field)\n } else {\n // primitive / null / array condition is an implicit $eq\n out.add(field)\n }\n }\n}\n",
|
|
169
|
-
"/**\n * @import {AsyncBuffer, Awaitable, DecodedArray} from '../src/types.js'\n */\n\nimport { defaultInitialFetchSize } from './metadata.js'\n\n/**\n * Replace bigint, date, etc with legal JSON types.\n *\n * @param {any} obj object to convert\n * @returns {unknown} converted object\n */\nexport function toJson(obj) {\n if (obj === undefined) return null\n if (typeof obj === 'bigint') return Number(obj)\n if (Object.is(obj, -0)) return 0\n if (Array.isArray(obj)) return obj.map(toJson)\n if (obj instanceof Uint8Array) return Array.from(obj)\n if (obj instanceof Date) return obj.toISOString()\n if (obj instanceof Object) {\n /** @type {Record<string, unknown>} */\n const newObj = {}\n for (const key of Object.keys(obj)) {\n if (obj[key] === undefined) continue\n newObj[key] = toJson(obj[key])\n }\n return newObj\n }\n return obj\n}\n\n/**\n * Concatenate two arrays fast.\n *\n * @param {any[]} aaa\n * @param {DecodedArray} bbb\n */\nexport function concat(aaa, bbb) {\n const chunk = 10000\n for (let i = 0; i < bbb.length; i += chunk) {\n aaa.push(...bbb.slice(i, i + chunk))\n }\n}\n\n/**\n * Deep equality.\n *\n * @param {any} a\n * @param {any} b\n * @param {boolean} [strict]\n * @returns {boolean}\n */\nexport function equals(a, b, strict = true) {\n // eslint-disable-next-line eqeqeq\n if (strict ? a === b : a == b) return true\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') return false\n\n if (a instanceof Uint8Array && b instanceof Uint8Array) {\n if (a.length !== b.length) return false\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false\n }\n return true\n }\n if (a instanceof Date || b instanceof Date) {\n return a instanceof Date && b instanceof Date && a.getTime() === b.getTime()\n }\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) return false\n for (let i = 0; i < a.length; i++) {\n if (!equals(a[i], b[i], strict)) return false\n }\n return true\n }\n\n const aKeys = Object.keys(a)\n if (aKeys.length !== Object.keys(b).length) return false\n for (const k of aKeys) {\n if (!equals(a[k], b[k], strict)) return false\n }\n return true\n}\n\n/**\n * Get the byte length using fetch with a ranged GET request.\n * Aborts the request if server returns 200 instead of 206.\n *\n * @param {string} url\n * @param {RequestInit} [requestInit] fetch options\n * @param {typeof globalThis.fetch} [fetchFn] fetch function to use\n * @returns {Promise<number>}\n */\nasync function byteLengthFromUrlUsingGet(url, requestInit = {}, fetchFn = globalThis.fetch) {\n const controller = new AbortController()\n const headers = new Headers(requestInit.headers)\n headers.set('Range', 'bytes=0-0')\n\n const res = await fetchFn(url, {\n ...requestInit,\n headers,\n signal: controller.signal,\n })\n\n if (!res.ok) throw new Error(`fetch with range failed ${res.status}`)\n\n // Server supports Range requests (206 Partial Content)\n if (res.status === 206) {\n const contentRange = res.headers.get('Content-Range')\n if (!contentRange) throw new Error('missing content-range header')\n\n // Parse \"bytes 0-0/9446073\" to get total length\n const match = contentRange.match(/bytes \\d+-\\d+\\/(\\d+)/)\n if (!match) throw new Error(`invalid content-range header: ${contentRange}`)\n\n return parseInt(match[1])\n }\n\n // Server ignored Range and returned 200 - get Content-Length and abort request\n if (res.status === 200) {\n const contentLength = res.headers.get('Content-Length')\n\n // Abort the request to stop any ongoing download\n controller.abort()\n\n if (contentLength) return parseInt(contentLength)\n }\n\n throw new Error('server does not support range requests and missing content-length')\n}\n\n/**\n * Get the byte length of a URL using a HEAD request.\n * If HEAD fails with 403 (e.g., with signed S3 URLs), falls back to a ranged GET request.\n * If HEAD succeeds but Content-Length is missing, falls back to GET with range.\n * If requestInit is provided, it will be passed to fetch.\n *\n * @param {string} url\n * @param {RequestInit} [requestInit] fetch options\n * @param {typeof globalThis.fetch} [customFetch] fetch function to use\n * @returns {Promise<number>}\n */\nexport async function byteLengthFromUrl(url, requestInit, customFetch) {\n const fetch = customFetch ?? globalThis.fetch\n const res = await fetch(url, { ...requestInit, method: 'HEAD' })\n\n // If HEAD request is forbidden (common with signed S3 URLs), try GET with range\n if (res.status === 403) {\n return byteLengthFromUrlUsingGet(url, requestInit, fetch)\n }\n\n if (!res.ok) throw new Error(`fetch head failed ${res.status}`)\n const length = res.headers.get('Content-Length')\n // If Content-Length is missing from HEAD, fallback to GET with range\n if (!length) {\n return byteLengthFromUrlUsingGet(url, requestInit, fetch)\n }\n return parseInt(length)\n}\n\n/**\n * Construct an AsyncBuffer for a URL.\n * If byteLength is not provided, will make a HEAD request to get the file size.\n * If fetch is provided, it will be used instead of the global fetch.\n * If requestInit is provided, it will be passed to fetch.\n *\n * @param {object} options\n * @param {string} options.url\n * @param {number} [options.byteLength]\n * @param {typeof globalThis.fetch} [options.fetch] fetch function to use\n * @param {RequestInit} [options.requestInit]\n * @returns {Promise<AsyncBuffer>}\n */\nexport async function asyncBufferFromUrl({ url, byteLength, requestInit, fetch: customFetch }) {\n if (!url) throw new Error('missing url')\n const fetch = customFetch ?? globalThis.fetch\n // byte length from HEAD request\n byteLength ??= await byteLengthFromUrl(url, requestInit, fetch)\n\n /**\n * A promise for the whole buffer, if range requests are not supported.\n * @type {Promise<ArrayBuffer>|undefined}\n */\n let buffer = undefined\n const init = requestInit || {}\n\n return {\n byteLength,\n async slice(start, end) {\n if (buffer) {\n return buffer.then(buffer => buffer.slice(start, end))\n }\n\n const headers = new Headers(init.headers)\n const endStr = end === undefined ? '' : end - 1\n headers.set('Range', `bytes=${start}-${endStr}`)\n\n const res = await fetch(url, { ...init, headers })\n if (!res.ok || !res.body) throw new Error(`fetch failed ${res.status}`)\n\n if (res.status === 200) {\n // Endpoint does not support range requests and returned the whole object\n buffer = res.arrayBuffer()\n return buffer.then(buffer => buffer.slice(start, end))\n } else if (res.status === 206) {\n // The endpoint supports range requests and sent us the requested range\n return res.arrayBuffer()\n } else {\n throw new Error(`fetch received unexpected status code ${res.status}`)\n }\n },\n }\n}\n\n/**\n * Returns a cached layer on top of an AsyncBuffer. For caching slices of a file\n * that are read multiple times, possibly over a network.\n *\n * @param {AsyncBuffer} file file-like object to cache\n * @param {{ minSize?: number }} [options]\n * @returns {AsyncBuffer} cached file-like object\n */\nexport function cachedAsyncBuffer({ byteLength, slice }, { minSize = defaultInitialFetchSize } = {}) {\n if (byteLength < minSize) {\n // Cache whole file if it's small\n const buffer = slice(0, byteLength)\n return {\n byteLength,\n async slice(start, end) {\n return (await buffer).slice(start, end)\n },\n }\n }\n const cache = new Map()\n return {\n byteLength,\n /**\n * @param {number} start\n * @param {number} [end]\n * @returns {Awaitable<ArrayBuffer>}\n */\n slice(start, end) {\n const key = cacheKey(start, end, byteLength)\n const cached = cache.get(key)\n if (cached) return cached\n // cache miss, read from file\n const promise = slice(start, end)\n cache.set(key, promise)\n return promise\n },\n }\n}\n\n\n/**\n * Returns canonical cache key for a byte range 'start,end'.\n * Normalize int-range and suffix-range requests to the same key.\n *\n * @param {number} start start byte of range\n * @param {number} [end] end byte of range, or undefined for suffix range\n * @param {number} [size] size of file, or undefined for suffix range\n * @returns {string}\n */\nfunction cacheKey(start, end, size) {\n if (start < 0) {\n if (end !== undefined) throw new Error(`invalid suffix range [${start}, ${end}]`)\n if (size === undefined) return `${start},`\n return `${size + start},${size}`\n } else if (end !== undefined) {\n if (start > end) throw new Error(`invalid empty range [${start}, ${end}]`)\n return `${start},${end}`\n } else if (size === undefined) {\n return `${start},`\n } else {\n return `${start},${size}`\n }\n}\n\n/**\n * Flatten a list of lists into a single list.\n *\n * @param {DecodedArray[]} [chunks]\n * @returns {DecodedArray}\n */\nexport function flatten(chunks) {\n if (!chunks) return []\n if (chunks.length === 1) return chunks[0]\n /** @type {any[]} */\n const output = []\n for (const chunk of chunks) {\n concat(output, chunk)\n }\n return output\n}\n",
|
|
170
|
-
"/**\n * @import {BloomFilter, ColumnPageStats, PageRanges, ParquetQueryFilter, RowGroup, SchemaElement} from '../src/types.js'\n */\n\nimport { hashParquetValue, sbbfContains } from './bloom.js'\nimport { equals } from './utils.js'\n\nconst encoder = new TextEncoder()\n\n/**\n * Returns the physical leaf paths referenced by a filter.\n *\n * @param {ParquetQueryFilter} [filter]\n * @returns {string[]}\n */\nexport function pathsNeededForFilter(filter) {\n if (!filter) return []\n /** @type {string[]} */\n const paths = []\n if ('$and' in filter && Array.isArray(filter.$and)) {\n paths.push(...filter.$and.flatMap(pathsNeededForFilter))\n } else if ('$or' in filter && Array.isArray(filter.$or)) {\n paths.push(...filter.$or.flatMap(pathsNeededForFilter))\n } else if ('$nor' in filter && Array.isArray(filter.$nor)) {\n paths.push(...filter.$nor.flatMap(pathsNeededForFilter))\n } else {\n paths.push(...Object.keys(filter))\n }\n return [...new Set(paths)]\n}\n\n/**\n * Returns an array of top-level column names needed to evaluate the filter.\n *\n * @param {ParquetQueryFilter} [filter]\n * @returns {string[]}\n */\nexport function columnsNeededForFilter(filter) {\n return [...new Set(pathsNeededForFilter(filter).map(path => path.split('.')[0]))]\n}\n\n/**\n * Match a record against a query filter\n *\n * @param {Record<string, any>} record\n * @param {ParquetQueryFilter} filter\n * @param {boolean} [strict]\n * @returns {boolean}\n */\nexport function matchFilter(record, filter, strict = true) {\n if ('$and' in filter && Array.isArray(filter.$and)) {\n return filter.$and.every(subQuery => matchFilter(record, subQuery, strict))\n }\n if ('$or' in filter && Array.isArray(filter.$or)) {\n return filter.$or.some(subQuery => matchFilter(record, subQuery, strict))\n }\n if ('$nor' in filter && Array.isArray(filter.$nor)) {\n return !filter.$nor.some(subQuery => matchFilter(record, subQuery, strict))\n }\n\n return Object.entries(filter).every(([field, condition]) => {\n const value = resolve(record, field)\n\n // implicit $eq for non-object conditions\n if (typeof condition !== 'object' || condition === null || Array.isArray(condition)) {\n return equals(value, condition, strict)\n }\n\n return Object.entries(condition || {}).every(([operator, target]) => {\n if (operator === '$gt') return value !== null && value !== undefined && value > target\n if (operator === '$gte') return value !== null && value !== undefined && value >= target\n if (operator === '$lt') return value !== null && value !== undefined && value < target\n if (operator === '$lte') return value !== null && value !== undefined && value <= target\n if (operator === '$eq') return equals(value, target, strict)\n if (operator === '$ne') return !equals(value, target, strict)\n if (operator === '$in') return Array.isArray(target) && matchesIn(value, target, strict)\n if (operator === '$nin') return Array.isArray(target) && !matchesIn(value, target, strict)\n if (operator === '$not') return !matchFilter({ [field]: value }, { [field]: target }, strict)\n return true\n })\n })\n}\n\n/**\n * Match a value or one of its immediate array elements against a list.\n *\n * @param {any} value\n * @param {any[]} targets\n * @param {boolean} strict\n * @returns {boolean}\n */\nfunction matchesIn(value, targets, strict) {\n return targets.some(target =>\n equals(value, target, strict) ||\n Array.isArray(value) && value.some(element => equals(element, target, strict)))\n}\n\n/**\n * Check if a row group can be skipped based on filter and column statistics,\n * optionally consulting per-column bloom filters for equality predicates that\n * statistics can't decide.\n *\n * @param {object} options\n * @param {RowGroup} options.rowGroup\n * @param {string[]} options.physicalColumns\n * @param {ParquetQueryFilter | undefined} options.filter\n * @param {boolean} [options.strict]\n * @param {Record<string, BloomFilter>} [options.bloomFilters] keyed by filter path\n * @param {Record<string, SchemaElement>} [options.schemaElements] keyed by physical leaf path\n * @returns {boolean} true if the row group can be skipped\n */\nexport function canSkipRowGroup({ rowGroup, physicalColumns, filter, strict = true, bloomFilters, schemaElements }) {\n if (!filter) return false\n\n // Handle logical operators\n if ('$and' in filter && Array.isArray(filter.$and)) {\n // For AND, we can skip if ANY condition allows skipping\n return filter.$and.some(subFilter => canSkipRowGroup({ rowGroup, physicalColumns, filter: subFilter, strict, bloomFilters, schemaElements }))\n }\n if ('$or' in filter && Array.isArray(filter.$or)) {\n // For OR, we can skip only if ALL conditions allow skipping\n return filter.$or.every(subFilter => canSkipRowGroup({ rowGroup, physicalColumns, filter: subFilter, strict, bloomFilters, schemaElements }))\n }\n if ('$nor' in filter && Array.isArray(filter.$nor)) {\n // For NOR, we can skip if none of the conditions allow skipping\n // This is complex, so we'll be conservative and not skip\n return false\n }\n\n // Check column filters\n for (const [field, condition] of Object.entries(filter)) {\n // Find the column chunk for this field\n const columnIndex = physicalColumns.indexOf(field)\n if (columnIndex === -1) continue\n\n const stats = rowGroup.columns[columnIndex].meta_data?.statistics\n const { min, max, min_value, max_value, null_count: nullCount } = stats || {}\n const minVal = min_value !== undefined ? min_value : min\n const maxVal = max_value !== undefined ? max_value : max\n const haveStats = minVal !== undefined && maxVal !== undefined\n\n const bloom = bloomFilters?.[field]\n const element = schemaElements?.[field]\n const matchingNulls = matchFilter({ value: null }, { value: condition }, strict) &&\n (nullCount === undefined || nullCount > 0)\n\n if (haveStats && !matchingNulls && canSkipStats(condition, minVal, maxVal, strict, element)) {\n return true\n }\n\n // Handle operators\n for (const [operator, target] of Object.entries(condition || {})) {\n // Bloom-filter skipping for equality predicates (proves absence, never presence)\n if (bloom && element) {\n if (operator === '$eq') {\n const hash = hashParquetValue(target, element)\n if (hash !== undefined && !sbbfContains(bloom.blocks, hash)) return true\n }\n if (operator === '$in' && Array.isArray(target) && target.length > 0) {\n let allAbsent = true\n for (const v of target) {\n const h = hashParquetValue(v, element)\n if (h === undefined || sbbfContains(bloom.blocks, h)) {\n allAbsent = false\n break\n }\n }\n if (allAbsent) return true\n }\n }\n }\n }\n\n return false\n}\n\n/**\n * Check if a page value range [minVal, maxVal] provably contains no value\n * matching the operator conditions.\n *\n * @param {any} condition operator object like { $gt: 5 }\n * @param {any} minVal lower bound (may be truncated, still a valid bound)\n * @param {any} maxVal upper bound (may be truncated, still a valid bound)\n * @param {boolean} strict\n * @param {SchemaElement} [element] physical schema element for the bounds\n * @returns {boolean} true if no value in the range can match\n */\nfunction canSkipStats(condition, minVal, maxVal, strict, element) {\n if (minVal === undefined || maxVal === undefined) return false\n const mayContainNaN = element?.type === 'FLOAT' || element?.type === 'DOUBLE' || element?.logical_type?.type === 'FLOAT16'\n for (const [operator, target] of Object.entries(condition || {})) {\n const minComparison = compareParquetValues(minVal, target, strict, element)\n const maxComparison = compareParquetValues(maxVal, target, strict, element)\n // Row filtering uses JavaScript relational operators. For non-ASCII\n // strings their UTF-16 order can differ from Parquet's UTF-8 index order,\n // and binary values are string-coerced rather than byte-compared, so those\n // min/max bounds cannot safely prove a relational predicate impossible.\n const binaryBounds = minVal instanceof Uint8Array || maxVal instanceof Uint8Array\n const relationalBoundsAreSafe = !binaryBounds && (element?.type !== 'BYTE_ARRAY' ||\n typeof target === 'string' && [...target].every(character => character.charCodeAt(0) <= 0x7f))\n if (operator === '$gt' && relationalBoundsAreSafe && maxComparison !== undefined && maxComparison <= 0) return true\n if (operator === '$gte' && relationalBoundsAreSafe && maxComparison !== undefined && maxComparison < 0) return true\n if (operator === '$lt' && relationalBoundsAreSafe && minComparison !== undefined && minComparison >= 0) return true\n if (operator === '$lte' && relationalBoundsAreSafe && minComparison !== undefined && minComparison > 0) return true\n if (operator === '$eq') {\n const targetMinComparison = compareParquetValues(target, minVal, strict, element)\n const targetMaxComparison = compareParquetValues(target, maxVal, strict, element)\n if (targetMinComparison !== undefined && targetMinComparison < 0 ||\n targetMaxComparison !== undefined && targetMaxComparison > 0) return true\n }\n if (operator === '$ne' && !mayContainNaN && equals(minVal, maxVal, strict) && equals(minVal, target, strict)) return true\n if (operator === '$in' && Array.isArray(target) && target.every(value => {\n const valueMinComparison = compareParquetValues(value, minVal, strict, element)\n const valueMaxComparison = compareParquetValues(value, maxVal, strict, element)\n return valueMinComparison !== undefined && valueMinComparison < 0 ||\n valueMaxComparison !== undefined && valueMaxComparison > 0\n })) return true\n if (operator === '$nin' && !mayContainNaN && Array.isArray(target) && equals(minVal, maxVal, strict) && target.some(value => equals(minVal, value, strict))) return true\n }\n return false\n}\n\n/**\n * Compare values using Parquet's unsigned lexicographic ordering for binary\n * values. Returns undefined when values do not have a safely comparable order.\n *\n * @param {any} a\n * @param {any} b\n * @param {boolean} strict\n * @param {SchemaElement} [element]\n * @returns {-1 | 0 | 1 | undefined}\n */\nfunction compareParquetValues(a, b, strict, element) {\n // BYTE_ARRAY values are decoded as UTF-8 strings by the default parser even\n // without an explicit UTF8/STRING annotation.\n if (element?.type === 'BYTE_ARRAY') {\n if (typeof a !== 'string' || typeof b !== 'string') return undefined\n return compareBytes(encoder.encode(a), encoder.encode(b))\n }\n if (a instanceof Uint8Array || b instanceof Uint8Array) {\n if (!(a instanceof Uint8Array) || !(b instanceof Uint8Array)) return undefined\n return compareBytes(a, b)\n }\n if (a < b) return -1\n if (a > b) return 1\n if (equals(a, b, strict)) return 0\n return undefined\n}\n\n/**\n * @param {Uint8Array} a\n * @param {Uint8Array} b\n * @returns {-1 | 0 | 1}\n */\nfunction compareBytes(a, b) {\n const length = Math.min(a.length, b.length)\n for (let i = 0; i < length; i++) {\n if (a[i] < b[i]) return -1\n if (a[i] > b[i]) return 1\n }\n if (a.length < b.length) return -1\n if (a.length > b.length) return 1\n return 0\n}\n\n/**\n * Check whether the filter condition accepts a null value.\n *\n * @param {any} condition\n * @param {boolean} strict\n * @returns {boolean}\n */\nfunction matchesNull(condition, strict) {\n return matchFilter({ value: null }, { value: condition }, strict)\n}\n\n/**\n * Compute candidate row ranges within a row group that could match the filter,\n * based on per-page column index statistics.\n *\n * Returns sorted disjoint [start, end) row ranges relative to the group.\n * An empty array means the filter provably matches no rows in the group.\n * Returns undefined when the page statistics give no pruning information\n * (the caller must read the whole selection).\n *\n * @param {ParquetQueryFilter | undefined} filter\n * @param {Record<string, ColumnPageStats>} columnPages keyed by physical leaf path\n * @param {number} groupRows number of rows in the row group\n * @param {boolean} [strict]\n * @returns {PageRanges | undefined}\n */\nexport function filterPageRanges(filter, columnPages, groupRows, strict = true) {\n if (!filter) return undefined\n if ('$and' in filter && Array.isArray(filter.$and)) {\n /** @type {PageRanges | undefined} */\n let ranges\n for (const subFilter of filter.$and) {\n ranges = intersectRanges(ranges, filterPageRanges(subFilter, columnPages, groupRows, strict))\n }\n return ranges\n }\n if ('$or' in filter && Array.isArray(filter.$or)) {\n /** @type {PageRanges} */\n let ranges = []\n for (const subFilter of filter.$or) {\n const subRanges = filterPageRanges(subFilter, columnPages, groupRows, strict)\n // any un-prunable branch could match anywhere\n if (!subRanges) return undefined\n ranges = unionRanges(ranges, subRanges)\n }\n return ranges\n }\n if ('$nor' in filter && Array.isArray(filter.$nor)) {\n // Conservative: negations cannot be pruned by min/max bounds\n return undefined\n }\n\n // Column conditions: all fields must match, so intersect their ranges\n /** @type {PageRanges | undefined} */\n let result\n for (const [field, condition] of Object.entries(filter)) {\n const pages = columnPages[field]\n if (!pages) continue\n const nullCanMatch = matchesNull(condition, strict)\n /** @type {PageRanges} */\n const keep = []\n for (let i = 0; i < pages.pageStarts.length; i++) {\n const start = pages.pageStarts[i]\n const end = i + 1 < pages.pageStarts.length ? pages.pageStarts[i + 1] : groupRows\n const nullCount = pages.nullCounts?.[i]\n // Keep pages with matching nulls, including pages whose null presence is\n // unknown because the optional null_counts index field was omitted.\n const matchingNulls = nullCanMatch && (nullCount === undefined || nullCount > 0)\n const skip = !pages.nullPages[i] && !matchingNulls &&\n canSkipStats(condition, pages.minValues[i], pages.maxValues[i], strict, pages.element)\n if (!skip) {\n const last = keep[keep.length - 1]\n if (last && last[1] === start) last[1] = end\n else keep.push([start, end])\n }\n }\n result = intersectRanges(result, keep)\n }\n return result\n}\n\n/**\n * Intersect two sets of sorted disjoint ranges. Undefined means \"everything\".\n *\n * @param {PageRanges | undefined} a\n * @param {PageRanges | undefined} b\n * @returns {PageRanges | undefined}\n */\nexport function intersectRanges(a, b) {\n if (!a) return b\n if (!b) return a\n /** @type {PageRanges} */\n const out = []\n let i = 0\n let j = 0\n while (i < a.length && j < b.length) {\n const start = Math.max(a[i][0], b[j][0])\n const end = Math.min(a[i][1], b[j][1])\n if (start < end) out.push([start, end])\n if (a[i][1] < b[j][1]) i++\n else j++\n }\n return out\n}\n\n/**\n * Union two sets of sorted disjoint ranges.\n *\n * @param {PageRanges} a\n * @param {PageRanges} b\n * @returns {PageRanges}\n */\nexport function unionRanges(a, b) {\n /** @type {PageRanges} */\n const out = []\n let i = 0\n let j = 0\n while (i < a.length || j < b.length) {\n const next = j >= b.length || i < a.length && a[i][0] <= b[j][0] ? a[i++] : b[j++]\n const last = out[out.length - 1]\n if (last && next[0] <= last[1]) last[1] = Math.max(last[1], next[1])\n else out.push([next[0], next[1]])\n }\n return out\n}\n\n/**\n * Resolve a dot-notation path to a value in a nested object.\n *\n * @param {Record<string, any>} record\n * @param {string} path\n * @returns {any}\n */\nfunction resolve(record, path) {\n let value = record\n for (const part of path.split('.')) {\n value = value?.[part]\n }\n return value\n}\n",
|
|
171
|
-
"import { bloomEligibleColumns, readBloomFilter } from './bloom.js'\nimport { canSkipRowGroup, filterPageRanges, pathsNeededForFilter } from './filter.js'\nimport { readColumnIndex, readOffsetIndex } from './indexes.js'\nimport { parquetSchema } from './metadata.js'\nimport { getPhysicalColumns } from './schema.js'\n\n/**\n * @import {AsyncBuffer, BloomFilter, ByteRange, ChunkPlan, ColumnPageStats, FileMetaData, GroupPlan, PageLocation, PageRanges, ParquetParsers, ParquetQueryFilter, ParquetReadOptions, QueryPlan, RowGroup, SchemaElement, SchemaTree} from '../src/types.js'\n */\n\n// Combine column chunks if less than 2mb\nconst runLimit = 1 << 21 // 2mb\n\n/**\n * Plan which byte ranges to read to satisfy a read request.\n * Metadata must be non-null.\n *\n * @param {ParquetReadOptions & { bloomFiltersByGroup?: Record<string, BloomFilter>[], schemaElements?: Record<string, SchemaElement>, pageRangesByGroup?: (PageRanges | undefined)[], pageLocationsByGroup?: Record<string, PageLocation[]>[] }} options\n * @returns {QueryPlan}\n */\nexport function parquetPlan({ metadata, rowStart = 0, rowEnd = Infinity, columns, filter, filterStrict = true, useOffsetIndex = false, bloomFiltersByGroup, schemaElements, pageRangesByGroup, pageLocationsByGroup }) {\n if (!metadata) throw new Error('parquetPlan requires metadata')\n /** @type {GroupPlan[]} */\n const groups = []\n /** @type {ByteRange[]} */\n const fetches = []\n /** @type {ByteRange[]} */\n const indexes = []\n const schemaTree = parquetSchema(metadata)\n const physicalColumns = getPhysicalColumns(schemaTree)\n const elementsByPath = filter ? {\n ...physicalSchemaElements(schemaTree),\n ...schemaElements,\n } : schemaElements\n\n // find which row groups to read\n let groupStart = 0 // first row index of the current group\n let rgIdx = 0\n for (const rowGroup of metadata.row_groups) {\n const groupRows = Number(rowGroup.num_rows)\n const groupEnd = groupStart + groupRows\n const bloomFilters = bloomFiltersByGroup?.[rgIdx]\n // if row group overlaps with row range, add it to the plan\n if (groupRows > 0 && groupEnd > rowStart && groupStart < rowEnd && !canSkipRowGroup({ rowGroup, physicalColumns, filter, strict: filterStrict, bloomFilters, schemaElements: elementsByPath })) {\n const selectStart = Math.max(rowStart - groupStart, 0)\n const selectEnd = Math.min(rowEnd - groupStart, groupRows)\n\n // page-level pruning: split the group selection into candidate sub-ranges.\n // an empty list of sub-ranges skips the group entirely.\n const pageRanges = pageRangesByGroup?.[rgIdx]\n const pageLocations = pageLocationsByGroup?.[rgIdx]\n /** @type {PageRanges} */\n let subranges = pageRanges\n ? pageRanges\n .map(([start, end]) => {\n /** @type {[number, number]} */\n const range = [Math.max(start, selectStart), Math.min(end, selectEnd)]\n return range\n })\n .filter(([start, end]) => start < end)\n : [[selectStart, selectEnd]]\n\n // splitting requires page reads for every included chunk, or full chunks\n // would be fetched once per sub-range; collapse to one covering range otherwise\n if (subranges.length > 1) {\n const canSplit = rowGroup.columns.every(chunk => {\n const columnName = chunk.meta_data?.path_in_schema[0]\n const columnPath = chunk.meta_data?.path_in_schema.join('.')\n if (columns && columnName && !columns.includes(columnName)) return true\n return !!(chunk.offset_index_offset && chunk.offset_index_length) || !!(columnPath && pageLocations?.[columnPath])\n })\n if (!canSplit) {\n subranges = [[subranges[0][0], subranges[subranges.length - 1][1]]]\n } else {\n subranges = coalesceOverlappingPageRanges(subranges, rowGroup, columns, pageLocations)\n }\n }\n\n if (subranges.length) {\n /** @type {ChunkPlan[]} */\n const chunks = []\n // Multiple sub-ranges are necessarily narrower than the whole group.\n const narrowed = subranges.length > 1 ||\n subranges[0][0] > 0 || subranges[0][1] < groupRows\n // loop through each column chunk\n for (const chunk of rowGroup.columns) {\n const meta = chunk.meta_data\n if (chunk.file_path) throw new Error('parquet file_path not supported')\n if (!meta) throw new Error('parquet column metadata is undefined')\n // add included column chunks to the plan\n if (!columns || columns.includes(meta.path_in_schema[0])) {\n // full column chunk\n const columnOffset = meta.dictionary_page_offset || meta.data_page_offset\n const startByte = Number(columnOffset)\n const endByte = Number(columnOffset + meta.total_compressed_size)\n const chunkPageLocations = pageLocations?.[meta.path_in_schema.join('.')]\n\n if (chunkPageLocations && narrowed) {\n // page locations already parsed during page index prefetch\n chunks.push({\n columnMetadata: meta,\n pageLocations: chunkPageLocations,\n range: { startByte, endByte },\n })\n } else if ((useOffsetIndex || pageRanges) && chunk.offset_index_offset && chunk.offset_index_length && narrowed) {\n const offsetIndexStart = Number(chunk.offset_index_offset)\n chunks.push({\n columnMetadata: meta,\n offsetIndex: {\n startByte: offsetIndexStart,\n endByte: offsetIndexStart + chunk.offset_index_length,\n },\n range: { startByte, endByte },\n })\n } else {\n chunks.push({\n columnMetadata: meta,\n range: { startByte, endByte },\n })\n }\n\n }\n }\n\n for (const [subStart, subEnd] of subranges) {\n groups.push({ chunks, rowGroup, groupStart, groupRows, selectStart: subStart, selectEnd: subEnd })\n }\n\n // combine runs of column chunks\n /** @type {ByteRange | undefined} */\n let run\n for (const chunk of chunks) {\n if ('pageLocations' in chunk) {\n // pages are fetched on demand in readRowGroup\n } else if ('offsetIndex' in chunk) {\n indexes.push(chunk.offsetIndex)\n } else {\n const { range } = chunk\n if (columns) {\n fetches.push(range)\n } else if (run && range.endByte - run.startByte <= runLimit) {\n // extend range\n run.endByte = range.endByte\n } else {\n // new range\n if (run) fetches.push(run)\n run = { ...range }\n }\n }\n }\n if (run) fetches.push(run)\n }\n }\n\n groupStart = groupEnd\n rgIdx++\n }\n if (!isFinite(rowEnd)) rowEnd = groupStart\n fetches.push(...indexes)\n\n return { metadata, rowStart, rowEnd, columns, fetches, groups }\n}\n\n/**\n * Merge candidate ranges when any selected column would read an overlapping\n * data page for both ranges. Unknown page layouts are merged conservatively.\n *\n * @param {PageRanges} ranges\n * @param {RowGroup} rowGroup\n * @param {string[] | undefined} columns\n * @param {Record<string, PageLocation[]> | undefined} pageLocations\n * @returns {PageRanges}\n */\nfunction coalesceOverlappingPageRanges(ranges, rowGroup, columns, pageLocations) {\n const selectedPageLayouts = rowGroup.columns\n .filter(chunk => !columns || columns.includes(chunk.meta_data?.path_in_schema[0] || ''))\n .map(chunk => pageLocations?.[chunk.meta_data?.path_in_schema.join('.') || ''])\n\n /** @type {PageRanges} */\n const merged = []\n for (const range of ranges) {\n const last = merged[merged.length - 1]\n const overlapsPage = last && selectedPageLayouts.some(pages => {\n if (!pages) return true\n const lastPages = pagesForRange(last, pages, Number(rowGroup.num_rows))\n const rangePages = pagesForRange(range, pages, Number(rowGroup.num_rows))\n return lastPages[0] <= rangePages[1] && rangePages[0] <= lastPages[1]\n })\n if (last && overlapsPage) last[1] = range[1]\n else merged.push([...range])\n }\n return merged\n}\n\n/**\n * Return the inclusive indexes of the first and last pages overlapping a row\n * range. Offset indexes cover every row, so a valid range always finds a page.\n *\n * @param {[number, number]} range\n * @param {PageLocation[]} pages\n * @param {number} groupRows\n * @returns {[number, number]}\n */\nfunction pagesForRange([rangeStart, rangeEnd], pages, groupRows) {\n let first = Infinity\n let last = -Infinity\n for (let i = 0; i < pages.length; i++) {\n const pageStart = Number(pages[i].first_row_index)\n const pageEnd = i + 1 < pages.length ? Number(pages[i + 1].first_row_index) : groupRows\n if (pageEnd > rangeStart && pageStart < rangeEnd) {\n first = Math.min(first, i)\n last = i\n }\n }\n return [first, last]\n}\n\n/**\n * Fetch bloom filters for $eq / $in columns of row groups not already provably\n * skippable by statistics alone. Returns an array indexed by row-group ordinal;\n * each entry maps top-level column name → BloomFilter for any chunk whose\n * bloom filter we were able to parse. Adds one round-trip when at least one\n * bloom filter is fetched; otherwise returns synchronously.\n *\n * @param {object} options\n * @param {AsyncBuffer} options.file\n * @param {FileMetaData} options.metadata\n * @param {ParquetQueryFilter} options.filter\n * @param {boolean} [options.filterStrict]\n * @returns {Promise<Record<string, BloomFilter>[]>}\n */\nexport async function prefetchBloomFilters({ file, metadata, filter, filterStrict = true }) {\n const result = metadata.row_groups.map(() => /** @type {Record<string, BloomFilter>} */ ({}))\n const eligibleCols = bloomEligibleColumns(filter)\n if (eligibleCols.size === 0) return result\n const physicalColumns = getPhysicalColumns(parquetSchema(metadata))\n\n /** @type {Promise<void>[]} */\n const tasks = []\n metadata.row_groups.forEach((rowGroup, rgIdx) => {\n if (canSkipRowGroup({ rowGroup, physicalColumns, filter, strict: filterStrict })) return\n for (const colName of eligibleCols) {\n const columnIdx = physicalColumns.indexOf(colName)\n if (columnIdx === -1) continue\n const meta = rowGroup.columns[columnIdx]?.meta_data\n if (!meta?.bloom_filter_offset || !meta.bloom_filter_length) continue\n const start = Number(meta.bloom_filter_offset)\n const end = start + meta.bloom_filter_length\n tasks.push((async () => {\n const buffer = await file.slice(start, end)\n const bloom = readBloomFilter({ view: new DataView(buffer), offset: 0 })\n if (bloom) result[rgIdx][colName] = bloom\n })())\n }\n })\n\n if (tasks.length) await Promise.all(tasks)\n return result\n}\n\n/**\n * Fetch page indexes (column index + offset index) for filter columns of row\n * groups that survive row-group-level pruning, and compute candidate row\n * ranges per group from the per-page min/max statistics.\n *\n * Returns pageRangesByGroup indexed by row-group ordinal: sorted disjoint\n * [start, end) row ranges (relative to the group) that could match the filter.\n * An empty array means the group provably contains no matching rows; undefined\n * means no page-level information was available for that group.\n * Also returns pageLocationsByGroup, mapping row-group ordinals and physical\n * leaf paths to page locations, so the read path can reuse the parsed offset\n * indexes without refetching them.\n *\n * @param {object} options\n * @param {AsyncBuffer} options.file\n * @param {FileMetaData} options.metadata\n * @param {ParquetQueryFilter} [options.filter]\n * @param {boolean} [options.filterStrict]\n * @param {number} [options.rowStart]\n * @param {number} [options.rowEnd]\n * @param {string[]} [options.columns]\n * @param {Record<string, BloomFilter>[]} [options.bloomFiltersByGroup]\n * @param {Record<string, SchemaElement>} [options.schemaElements]\n * @param {ParquetParsers} [options.parsers]\n * @returns {Promise<{pageRangesByGroup: (PageRanges | undefined)[], pageLocationsByGroup: Record<string, PageLocation[]>[]}>}\n */\nexport async function prefetchPageIndexes({ file, metadata, filter, filterStrict = true, rowStart = 0, rowEnd = Infinity, columns, bloomFiltersByGroup, schemaElements, parsers }) {\n /** @type {(PageRanges | undefined)[]} */\n const pageRangesByGroup = metadata.row_groups.map(() => undefined)\n const pageLocationsByGroup = metadata.row_groups.map(() => /** @type {Record<string, PageLocation[]>} */ ({}))\n if (filter && '$nor' in filter && Array.isArray(filter.$nor)) {\n return { pageRangesByGroup, pageLocationsByGroup }\n }\n const filterColumns = pathsNeededForFilter(filter)\n if (!filterColumns.length) return { pageRangesByGroup, pageLocationsByGroup }\n const schemaTree = parquetSchema(metadata)\n const physicalColumns = getPhysicalColumns(schemaTree)\n const elementsByPath = {\n ...physicalSchemaElements(schemaTree),\n ...schemaElements,\n }\n\n /** @type {ByteRange[]} */\n const indexRanges = []\n /** @type {((file: AsyncBuffer) => Promise<void>)[]} */\n const indexTasks = []\n /** @type {{rgIdx: number, groupRows: number, columnPages: Record<string, ColumnPageStats>}[]} */\n const candidateGroups = []\n let groupStart = 0\n metadata.row_groups.forEach((rowGroup, rgIdx) => {\n const groupRows = Number(rowGroup.num_rows)\n const groupEnd = groupStart + groupRows\n const overlaps = groupRows > 0 && groupEnd > rowStart && groupStart < rowEnd\n groupStart = groupEnd\n if (!overlaps) return\n if (canSkipRowGroup({ rowGroup, physicalColumns, filter, strict: filterStrict, bloomFilters: bloomFiltersByGroup?.[rgIdx], schemaElements: elementsByPath })) return\n\n /** @type {Record<string, ColumnPageStats>} */\n const columnPages = {}\n let columnTaskCount = 0\n const scheduledOffsetPaths = new Set()\n let hasFilterIndex = false\n for (const columnName of filterColumns) {\n const columnIdx = physicalColumns.indexOf(columnName)\n if (columnIdx === -1) continue\n const chunk = rowGroup.columns[columnIdx]\n const meta = chunk?.meta_data\n if (!meta) continue\n if (!chunk.column_index_offset || !chunk.column_index_length) continue\n if (!chunk.offset_index_offset || !chunk.offset_index_length) continue\n const element = elementsByPath[columnName]\n if (!element) continue\n hasFilterIndex = true\n scheduledOffsetPaths.add(columnName)\n const columnIndexStart = Number(chunk.column_index_offset)\n const offsetIndexStart = Number(chunk.offset_index_offset)\n const columnIndexEnd = columnIndexStart + chunk.column_index_length\n const offsetIndexEnd = offsetIndexStart + chunk.offset_index_length\n indexRanges.push(\n { startByte: columnIndexStart, endByte: columnIndexEnd },\n { startByte: offsetIndexStart, endByte: offsetIndexEnd }\n )\n columnTaskCount++\n indexTasks.push(async prefetchedFile => {\n const [columnIndexBuffer, offsetIndexBuffer] = await Promise.all([\n prefetchedFile.slice(columnIndexStart, columnIndexEnd),\n prefetchedFile.slice(offsetIndexStart, offsetIndexEnd),\n ])\n const columnIndex = readColumnIndex({ view: new DataView(columnIndexBuffer), offset: 0 }, element, parsers)\n const offsetIndex = readOffsetIndex({ view: new DataView(offsetIndexBuffer), offset: 0 })\n pageLocationsByGroup[rgIdx][columnName] = offsetIndex.page_locations\n columnPages[columnName] = {\n minValues: columnIndex.min_values,\n maxValues: columnIndex.max_values,\n nullPages: columnIndex.null_pages,\n nullCounts: columnIndex.null_counts,\n pageStarts: offsetIndex.page_locations.map(page => Number(page.first_row_index)),\n element,\n }\n })\n }\n // Candidate ranges are shared by every selected column. Load their offset\n // indexes too so the planner can merge ranges that map to the same coarse\n // page instead of fetching and decoding that page more than once.\n if (hasFilterIndex) {\n for (const chunk of rowGroup.columns) {\n const meta = chunk.meta_data\n if (!meta) continue\n const columnName = meta.path_in_schema[0]\n const columnPath = meta.path_in_schema.join('.')\n if (columns && !columns.includes(columnName)) continue\n if (scheduledOffsetPaths.has(columnPath)) continue\n if (!chunk.offset_index_offset || !chunk.offset_index_length) continue\n scheduledOffsetPaths.add(columnPath)\n const offsetIndexStart = Number(chunk.offset_index_offset)\n const offsetIndexEnd = offsetIndexStart + chunk.offset_index_length\n indexRanges.push({ startByte: offsetIndexStart, endByte: offsetIndexEnd })\n columnTaskCount++\n indexTasks.push(async prefetchedFile => {\n const offsetIndexBuffer = await prefetchedFile.slice(offsetIndexStart, offsetIndexEnd)\n const offsetIndex = readOffsetIndex({ view: new DataView(offsetIndexBuffer), offset: 0 })\n pageLocationsByGroup[rgIdx][columnPath] = offsetIndex.page_locations\n })\n }\n }\n if (columnTaskCount) {\n candidateGroups.push({ rgIdx, groupRows, columnPages })\n }\n })\n\n if (indexTasks.length) {\n const prefetchedFile = prefetchAsyncBuffer(file, { fetches: coalesceByteRanges(indexRanges) })\n await Promise.all(indexTasks.map(task => task(prefetchedFile)))\n for (const { rgIdx, groupRows, columnPages } of candidateGroups) {\n pageRangesByGroup[rgIdx] = filterPageRanges(filter, columnPages, groupRows, filterStrict)\n }\n }\n return { pageRangesByGroup, pageLocationsByGroup }\n}\n\n/**\n * Merge overlapping or exactly touching byte ranges without adding bytes.\n *\n * @param {ByteRange[]} ranges\n * @returns {ByteRange[]}\n */\nfunction coalesceByteRanges(ranges) {\n const sorted = ranges\n .map(range => ({ ...range }))\n .sort((a, b) => a.startByte - b.startByte || a.endByte - b.endByte)\n /** @type {ByteRange[]} */\n const merged = []\n for (const range of sorted) {\n const last = merged[merged.length - 1]\n if (last && range.startByte <= last.endByte) {\n last.endByte = Math.max(last.endByte, range.endByte)\n } else {\n merged.push(range)\n }\n }\n return merged\n}\n\n/**\n * Build a lookup from physical paths to leaf schema elements.\n *\n * @param {SchemaTree} schemaTree\n * @returns {Record<string, SchemaElement>}\n */\nfunction physicalSchemaElements(schemaTree) {\n /** @type {Record<string, SchemaElement>} */\n const elements = {}\n /** @param {SchemaTree} node */\n function traverse(node) {\n if (node.children.length) {\n for (const child of node.children) traverse(child)\n } else {\n elements[node.path.join('.')] = node.element\n }\n }\n traverse(schemaTree)\n return elements\n}\n\n/**\n * Prefetch byte ranges from an AsyncBuffer.\n *\n * @param {AsyncBuffer} file\n * @param {{fetches: ByteRange[]}} options\n * @returns {AsyncBuffer}\n */\nexport function prefetchAsyncBuffer(file, { fetches }) {\n // fetch byte ranges from the file\n const promises = fetches.map(({ startByte, endByte }) => file.slice(startByte, endByte))\n return {\n byteLength: file.byteLength,\n slice(start, end = file.byteLength) {\n // find matching slice\n const index = fetches.findIndex(({ startByte, endByte }) => startByte <= start && end <= endByte)\n if (index < 0) {\n // fallback to direct read\n return file.slice(start, end)\n }\n if (fetches[index].startByte !== start || fetches[index].endByte !== end) {\n // slice a subrange of the prefetch\n const startOffset = start - fetches[index].startByte\n const endOffset = end - fetches[index].startByte\n if (promises[index] instanceof Promise) {\n return promises[index].then(buffer => buffer.slice(startOffset, endOffset))\n } else {\n return promises[index].slice(startOffset, endOffset)\n }\n } else {\n return promises[index]\n }\n },\n }\n}\n",
|
|
172
|
-
"import { DEFAULT_PARSERS } from './convert.js'\n\n/**\n * @import {DataReader, ParquetParsers, VariantMetadata} from '../src/types.js'\n */\n\nconst decoder = new TextDecoder()\n/** @type {WeakMap<object, Map<string, VariantMetadata>>} */\nconst metadataCache = new WeakMap()\n\n/**\n * Recursively decode variant structs into native values.\n *\n * @param {any} value\n * @param {ParquetParsers} [parsers]\n * @returns {any}\n */\nexport function decodeVariantColumn(value, parsers = DEFAULT_PARSERS) {\n if (Array.isArray(value)) {\n return value.map(entry => decodeVariantColumn(entry, parsers))\n }\n if (typeof value !== 'object') return value\n\n if ('metadata' in value) {\n const metadata = parseVariantMetadata(value.metadata)\n\n // Decode shredded fields from typed_value\n const shreddedFields = value.typed_value && decodeTypedValue(value.typed_value, metadata, parsers)\n\n // Decode binary value (may contain additional fields for partially shredded objects)\n const binaryValue = value.value && readVariant(makeReader(value.value), metadata, parsers)\n\n // Merge shredded and binary values for partially shredded objects\n if (shreddedFields && binaryValue) {\n return { ...binaryValue, ...shreddedFields }\n }\n return shreddedFields ?? binaryValue\n }\n\n return value\n}\n\n/**\n * Decode a shredded variant typed_value field.\n *\n * @param {any} typedValue\n * @param {VariantMetadata} metadata\n * @param {ParquetParsers} parsers\n * @returns {any}\n */\nfunction decodeTypedValue(typedValue, metadata, parsers) {\n if (typedValue instanceof Date) return typedValue\n\n // Handle {typed_value, value} wrapper - unwrap and recurse\n if (typedValue && typeof typedValue === 'object' && !Array.isArray(typedValue) && !(typedValue instanceof Uint8Array)) {\n if ('typed_value' in typedValue && typedValue.typed_value !== null && typedValue.typed_value !== undefined) {\n return decodeTypedValue(typedValue.typed_value, metadata, parsers)\n }\n if ('value' in typedValue && typedValue.value instanceof Uint8Array) {\n return readVariant(makeReader(typedValue.value), metadata, parsers)\n }\n if ('typed_value' in typedValue || 'value' in typedValue) {\n // both null/missing → field is null\n return null\n }\n // Shredded object: each field value gets decoded\n /** @type {Record<string, any>} */\n const result = {}\n for (const [key, field] of Object.entries(typedValue)) {\n if (!metadata.dictionary.includes(key)) continue\n result[key] = decodeTypedValue(field, metadata, parsers)\n }\n return result\n }\n\n // Uint8Array: decode as binary variant\n if (typedValue instanceof Uint8Array) {\n return readVariant(makeReader(typedValue), metadata, parsers)\n }\n\n // Arrays\n if (Array.isArray(typedValue)) {\n return typedValue.map(element => decodeTypedValue(element, metadata, parsers))\n }\n\n return typedValue\n}\n\n/**\n * @param {Uint8Array} bytes\n * @returns {DataReader}\n */\nfunction makeReader(bytes) {\n return { view: new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength), offset: 0 }\n}\n\n/**\n * Parse and cache variant metadata dictionary.\n *\n * @param {Uint8Array} bytes\n * @returns {VariantMetadata}\n */\nfunction parseVariantMetadata(bytes) {\n let bufferCache = metadataCache.get(bytes.buffer)\n if (!bufferCache) {\n bufferCache = new Map()\n metadataCache.set(bytes.buffer, bufferCache)\n }\n const key = `${bytes.byteOffset}:${bytes.byteLength}`\n const cached = bufferCache.get(key)\n if (cached) return cached\n\n const reader = makeReader(bytes)\n const header = reader.view.getUint8(reader.offset++)\n const version = header & 0x0f\n if (version !== 1) throw new Error(`parquet unsupported variant metadata version: ${version}`)\n const sorted = (header >> 4 & 0x1) === 1\n const offsetSize = (header >> 6 & 0x3) + 1\n\n const dictionarySize = readUnsigned(reader, offsetSize)\n\n const offsets = new Array(dictionarySize + 1)\n for (let i = 0; i < offsets.length; i++) {\n offsets[i] = readUnsigned(reader, offsetSize)\n }\n\n const base = reader.offset\n const dictionary = new Array(dictionarySize)\n for (let i = 0; i < dictionarySize; i++) {\n const start = offsets[i]\n const end = offsets[i + 1]\n const strBytes = new Uint8Array(bytes.buffer, bytes.byteOffset + base + start, end - start)\n dictionary[i] = decoder.decode(strBytes)\n }\n\n const metadata = { dictionary, sorted }\n bufferCache.set(key, metadata)\n return metadata\n}\n\n/**\n * @param {DataReader} reader\n * @param {number} byteWidth\n * @returns {number}\n */\nfunction readUnsigned(reader, byteWidth) {\n let value = 0\n for (let i = 0; i < byteWidth; i++) {\n value |= reader.view.getUint8(reader.offset + i) << i * 8\n }\n reader.offset += byteWidth\n return value\n}\n\n/**\n * @param {DataReader} reader\n * @param {VariantMetadata} metadata\n * @param {ParquetParsers} parsers\n * @returns {any}\n */\nfunction readVariant(reader, metadata, parsers) {\n const typeByte = reader.view.getUint8(reader.offset++)\n const basicType = typeByte & 0x3\n const header = typeByte >> 2\n if (basicType === 0) return readVariantPrimitive(reader, header, parsers)\n if (basicType === 2) return readVariantObject(reader, header, metadata, parsers)\n if (basicType === 3) return readVariantArray(reader, header, metadata, parsers)\n // else short string\n const bytes = new Uint8Array(reader.view.buffer, reader.view.byteOffset + reader.offset, header)\n reader.offset += header\n return decoder.decode(bytes)\n}\n\n/**\n * @param {DataReader} reader\n * @param {number} typeId\n * @param {ParquetParsers} parsers\n * @returns {any}\n */\nfunction readVariantPrimitive(reader, typeId, parsers) {\n switch (typeId) {\n case 0: return null\n case 1: return true\n case 2: return false\n case 3: {\n const value = reader.view.getInt8(reader.offset)\n reader.offset += 1\n return value\n }\n case 4: {\n const value = reader.view.getInt16(reader.offset, true)\n reader.offset += 2\n return value\n }\n case 5: {\n const value = reader.view.getInt32(reader.offset, true)\n reader.offset += 4\n return value\n }\n case 6: {\n const value = reader.view.getBigInt64(reader.offset, true)\n reader.offset += 8\n return value\n }\n case 7: {\n const value = reader.view.getFloat64(reader.offset, true)\n reader.offset += 8\n return value\n }\n case 8:\n return readVariantDecimal(reader, 4)\n case 9:\n return readVariantDecimal(reader, 8)\n case 10:\n return readVariantDecimal(reader, 16)\n case 11: {\n const value = reader.view.getInt32(reader.offset, true)\n reader.offset += 4\n return parsers.dateFromDays(value)\n }\n case 12: // timestamp_micros (utc)\n case 13: { // timestamp_micros_ntz (no timezone)\n const value = reader.view.getBigInt64(reader.offset, true)\n reader.offset += 8\n return parsers.timestampFromMicroseconds(value)\n }\n case 14: {\n const value = reader.view.getFloat32(reader.offset, true)\n reader.offset += 4\n return value\n }\n case 15:\n return readVariantBinary(reader)\n case 16: {\n const bytes = readVariantBinary(reader)\n return decoder.decode(bytes)\n }\n case 17: {\n // time: microseconds since midnight\n const value = reader.view.getBigInt64(reader.offset, true)\n reader.offset += 8\n return value\n }\n case 18: // timestamp_nanos (utc)\n case 19: { // timestamp_nanos_ntz (no timezone)\n const value = reader.view.getBigInt64(reader.offset, true)\n reader.offset += 8\n return parsers.timestampFromNanoseconds(value)\n }\n case 20: {\n const bytes = new Uint8Array(reader.view.buffer, reader.view.byteOffset + reader.offset, 16)\n reader.offset += 16\n const hex = Array.from(bytes, b => b.toString(16).padStart(2, '0')).join('')\n return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`\n }\n default:\n throw new Error(`parquet unsupported variant primitive type: ${typeId}`)\n }\n}\n\n/**\n * @param {DataReader} reader\n * @param {number} header\n * @param {VariantMetadata} metadata\n * @param {ParquetParsers} parsers\n * @returns {Record<string, any>}\n */\nfunction readVariantObject(reader, header, metadata, parsers) {\n const offsetWidth = (header & 0x3) + 1\n const idWidth = (header >> 2 & 0x3) + 1\n const isLarge = header >> 4 & 0x1\n const numElements = isLarge ? readUnsigned(reader, 4) : reader.view.getUint8(reader.offset++)\n\n /** @type {number[]} */\n const fieldIds = new Array(numElements)\n for (let i = 0; i < numElements; i++) {\n fieldIds[i] = readUnsigned(reader, idWidth)\n }\n\n const offsets = new Array(numElements + 1)\n for (let i = 0; i < offsets.length; i++) {\n offsets[i] = readUnsigned(reader, offsetWidth)\n }\n\n /** @type {Record<string, any>} */\n const out = {}\n for (let i = 0; i < numElements; i++) {\n const key = metadata.dictionary[fieldIds[i]]\n // Read value at the given offset\n const valueReader = {\n view: reader.view,\n offset: reader.offset + offsets[i],\n }\n out[key] = readVariant(valueReader, metadata, parsers)\n }\n reader.offset += offsets[offsets.length - 1]\n return out\n}\n\n/**\n * @param {DataReader} reader\n * @param {number} header\n * @param {VariantMetadata} metadata\n * @param {ParquetParsers} parsers\n * @returns {any[]}\n */\nfunction readVariantArray(reader, header, metadata, parsers) {\n const fieldOffsetSize = header & 0x3\n const isLarge = header >> 2 & 0x1\n const offsetWidth = fieldOffsetSize + 1\n const numElements = readUnsigned(reader, isLarge ? 4 : 1)\n\n const offsets = new Array(numElements + 1)\n for (let i = 0; i < offsets.length; i++) {\n offsets[i] = readUnsigned(reader, offsetWidth)\n }\n\n const valuesStart = reader.offset\n const result = new Array(numElements)\n for (let i = 0; i < numElements; i++) {\n const valueReader = {\n view: reader.view,\n offset: valuesStart + offsets[i],\n }\n result[i] = readVariant(valueReader, metadata, parsers)\n }\n reader.offset = valuesStart + offsets[offsets.length - 1]\n return result\n}\n\n/**\n * @param {DataReader} reader\n * @param {number} width\n * @returns {number}\n */\nfunction readVariantDecimal(reader, width) {\n const scale = reader.view.getUint8(reader.offset)\n reader.offset += 1\n let unscaled\n if (width === 4) {\n unscaled = BigInt(reader.view.getInt32(reader.offset, true))\n reader.offset += 4\n } else if (width === 8) {\n unscaled = reader.view.getBigInt64(reader.offset, true)\n reader.offset += 8\n } else {\n const low = reader.view.getBigUint64(reader.offset, true)\n const high = reader.view.getBigInt64(reader.offset + 8, true)\n unscaled = high << 64n | low\n reader.offset += 16\n }\n\n return Number(unscaled) * 10 ** -scale\n}\n\n/**\n * @param {DataReader} reader\n * @returns {Uint8Array}\n */\nfunction readVariantBinary(reader) {\n const length = reader.view.getUint32(reader.offset, true)\n reader.offset += 4\n const bytes = new Uint8Array(reader.view.buffer, reader.view.byteOffset + reader.offset, length)\n reader.offset += length\n return bytes\n}\n",
|
|
173
|
-
"import { getMaxDefinitionLevel, isListLike, isMapLike } from './schema.js'\nimport { decodeVariantColumn } from './variant.js'\n\n/**\n * Reconstructs a complex nested structure from flat arrays of values and\n * definition and repetition levels, according to Dremel encoding.\n *\n * @param {any[]} output\n * @param {number[] | undefined} definitionLevels\n * @param {number[]} repetitionLevels\n * @param {DecodedArray} values\n * @param {SchemaTree[]} schemaPath\n * @returns {DecodedArray}\n */\nexport function assembleLists(output, definitionLevels, repetitionLevels, values, schemaPath) {\n const maxDefinitionLevel = getMaxDefinitionLevel(schemaPath)\n // If no def/rep levels, synthesize def levels at max\n if (!definitionLevels?.length && !repetitionLevels.length) {\n if (!maxDefinitionLevel || !values.length) return values\n definitionLevels = new Array(values.length).fill(maxDefinitionLevel)\n }\n const n = definitionLevels?.length || repetitionLevels.length\n const repetitionPath = schemaPath.map(({ element }) => element.repetition_type)\n let valueIndex = 0\n\n // Track state of nested structures\n const containerStack = [output]\n let currentContainer = output\n let currentDepth = 0 // schema depth\n let currentDefLevel = 0 // list depth\n let currentRepLevel = 0\n\n if (repetitionLevels[0]) {\n // continue previous row\n while (currentDepth < repetitionPath.length - 2 && currentRepLevel < repetitionLevels[0]) {\n currentDepth++\n if (repetitionPath[currentDepth] !== 'REQUIRED') {\n // go into last list\n currentContainer = currentContainer.at(-1)\n containerStack.push(currentContainer)\n currentDefLevel++\n }\n if (repetitionPath[currentDepth] === 'REPEATED') currentRepLevel++\n }\n }\n\n for (let i = 0; i < n; i++) {\n // assert(currentDefLevel === containerStack.length - 1)\n const def = definitionLevels?.length ? definitionLevels[i] : maxDefinitionLevel\n const rep = repetitionLevels[i]\n\n // Pop up to start of rep level\n while (currentDepth && (rep < currentRepLevel || repetitionPath[currentDepth] !== 'REPEATED')) {\n if (repetitionPath[currentDepth] !== 'REQUIRED') {\n containerStack.pop()\n currentDefLevel--\n }\n if (repetitionPath[currentDepth] === 'REPEATED') currentRepLevel--\n currentDepth--\n }\n // @ts-expect-error won't be empty\n currentContainer = containerStack.at(-1)\n\n // Go deeper to end of definition level\n while (\n (currentDepth < repetitionPath.length - 2 || repetitionPath[currentDepth + 1] === 'REPEATED') &&\n (currentDefLevel < def || repetitionPath[currentDepth + 1] === 'REQUIRED')\n ) {\n currentDepth++\n if (repetitionPath[currentDepth] !== 'REQUIRED') {\n /** @type {any[]} */\n const newList = []\n currentContainer.push(newList)\n currentContainer = newList\n containerStack.push(newList)\n currentDefLevel++\n }\n if (repetitionPath[currentDepth] === 'REPEATED') currentRepLevel++\n }\n\n // Add value or null based on definition level\n if (def === maxDefinitionLevel) {\n // assert(currentDepth === maxDefinitionLevel || currentDepth === repetitionPath.length - 2)\n currentContainer.push(values[valueIndex++])\n } else if (currentDepth === repetitionPath.length - 2) {\n currentContainer.push(null)\n } else {\n currentContainer.push([])\n }\n }\n\n // Handle edge cases for empty inputs or single-level data\n if (!output.length) {\n // return max definition level of nested lists\n for (let i = 0; i < maxDefinitionLevel; i++) {\n /** @type {any[]} */\n const newList = []\n currentContainer.push(newList)\n currentContainer = newList\n }\n }\n\n return output\n}\n\n/**\n * Assemble a nested structure from subcolumn data.\n *\n * @param {Map<string, DecodedArray>} subcolumnData\n * @param {SchemaTree} schema top-level schema element\n * @param {ParquetParsers} parsers\n * @param {number} [depth] depth of nested structure\n */\nexport function assembleNested(subcolumnData, schema, parsers, depth = 0) {\n const path = schema.path.join('.')\n const optional = schema.element.repetition_type === 'OPTIONAL'\n const nextDepth = optional ? depth + 1 : depth\n\n if (isListLike(schema)) {\n let sublist = schema.children[0]\n let subDepth = nextDepth\n if (sublist.children.length === 1) {\n sublist = sublist.children[0]\n subDepth++\n }\n assembleNested(subcolumnData, sublist, parsers, subDepth)\n\n const subcolumn = sublist.path.join('.')\n const values = subcolumnData.get(subcolumn)\n if (!values) throw new Error('parquet list column missing values')\n if (optional) flattenAtDepth(values, depth)\n subcolumnData.set(path, values)\n subcolumnData.delete(subcolumn)\n return\n }\n\n if (isMapLike(schema)) {\n const mapName = schema.children[0].element.name\n\n // Assemble keys and values\n assembleNested(subcolumnData, schema.children[0].children[0], parsers, nextDepth + 1)\n assembleNested(subcolumnData, schema.children[0].children[1], parsers, nextDepth + 1)\n\n const keys = subcolumnData.get(`${path}.${mapName}.key`)\n const values = subcolumnData.get(`${path}.${mapName}.value`)\n\n if (!keys) throw new Error('parquet map column missing keys')\n if (!values) throw new Error('parquet map column missing values')\n if (keys.length !== values.length) {\n throw new Error('parquet map column key/value length mismatch')\n }\n\n const out = assembleMaps(keys, values, nextDepth)\n if (optional) flattenAtDepth(out, depth)\n\n subcolumnData.delete(`${path}.${mapName}.key`)\n subcolumnData.delete(`${path}.${mapName}.value`)\n subcolumnData.set(path, out)\n return\n }\n\n // Struct-like column\n if (schema.children.length) {\n // construct a meta struct and then invert\n const invertDepth = schema.element.repetition_type === 'REQUIRED' ? depth : depth + 1\n /** @type {Record<string, any>} */\n const struct = {}\n for (const child of schema.children) {\n assembleNested(subcolumnData, child, parsers, invertDepth)\n const childData = subcolumnData.get(child.path.join('.'))\n if (!childData) throw new Error('parquet struct missing child data')\n struct[child.element.name] = childData\n }\n // remove children\n for (const child of schema.children) {\n subcolumnData.delete(child.path.join('.'))\n }\n\n // invert struct by depth\n let inverted = invertStruct(struct, invertDepth)\n if (schema.element.logical_type?.type === 'VARIANT') {\n inverted = decodeVariantColumn(inverted, parsers)\n }\n if (optional) flattenAtDepth(inverted, depth)\n subcolumnData.set(path, inverted)\n }\n}\n\n/**\n * @import {DecodedArray, ParquetParsers, SchemaTree} from '../src/types.js'\n * @param {DecodedArray} arr\n * @param {number} depth\n */\nfunction flattenAtDepth(arr, depth) {\n for (let i = 0; i < arr.length; i++) {\n if (depth) {\n flattenAtDepth(arr[i], depth - 1)\n } else {\n arr[i] = arr[i][0]\n }\n }\n}\n\n/**\n * @param {DecodedArray} keys\n * @param {DecodedArray} values\n * @param {number} depth\n * @returns {any[]}\n */\nfunction assembleMaps(keys, values, depth) {\n const out = []\n for (let i = 0; i < keys.length; i++) {\n if (depth) {\n out.push(assembleMaps(keys[i], values[i], depth - 1)) // go deeper\n } else {\n if (keys[i]) {\n /** @type {Record<string, any>} */\n const obj = {}\n for (let j = 0; j < keys[i].length; j++) {\n const value = values[i][j]\n obj[keys[i][j]] = value === undefined ? null : value\n }\n out.push(obj)\n } else {\n out.push(undefined)\n }\n }\n }\n return out\n}\n\n/**\n * Invert a struct-like object by depth.\n *\n * @param {Record<string, any[]>} struct\n * @param {number} depth\n * @returns {any[]}\n */\nfunction invertStruct(struct, depth) {\n const keys = Object.keys(struct)\n const length = struct[keys[0]]?.length\n const out = []\n for (let i = 0; i < length; i++) {\n /** @type {Record<string, any>} */\n const obj = {}\n for (const key of keys) {\n if (struct[key].length !== length) throw new Error('parquet struct parsing error')\n obj[key] = struct[key][i]\n }\n if (depth) {\n out.push(invertStruct(obj, depth - 1)) // deeper\n } else {\n out.push(obj)\n }\n }\n return out\n}\n",
|
|
174
|
-
"/**\n * @import {DataReader} from '../src/types.js'\n */\n\nimport { readVarInt, readZigZagBigInt } from './thrift.js'\n\n/**\n * @param {DataReader} reader\n * @param {number} count number of values to read\n * @param {Int32Array | BigInt64Array} output\n */\nexport function deltaBinaryUnpack(reader, count, output) {\n const int32 = output instanceof Int32Array\n const blockSize = readVarInt(reader)\n const miniblockPerBlock = readVarInt(reader)\n readVarInt(reader) // assert(=== count)\n let value = readZigZagBigInt(reader) // first value\n let outputIndex = 0\n output[outputIndex++] = int32 ? Number(value) : value\n\n const valuesPerMiniblock = blockSize / miniblockPerBlock\n\n while (outputIndex < count) {\n // new block\n const minDelta = readZigZagBigInt(reader)\n const bitWidths = new Uint8Array(miniblockPerBlock)\n for (let i = 0; i < miniblockPerBlock; i++) {\n bitWidths[i] = reader.view.getUint8(reader.offset++)\n }\n\n for (let i = 0; i < miniblockPerBlock && outputIndex < count; i++) {\n // new miniblock\n const bitWidth = BigInt(bitWidths[i])\n if (bitWidth) {\n let bitpackPos = 0n\n let miniblockCount = valuesPerMiniblock\n const mask = (1n << bitWidth) - 1n\n while (miniblockCount && outputIndex < count) {\n let bits = BigInt(reader.view.getUint8(reader.offset)) >> bitpackPos & mask // TODO: don't re-read value every time\n bitpackPos += bitWidth\n while (bitpackPos >= 8) {\n bitpackPos -= 8n\n reader.offset++\n if (bitpackPos) {\n bits |= BigInt(reader.view.getUint8(reader.offset)) << bitWidth - bitpackPos & mask\n }\n }\n const delta = minDelta + bits\n value += delta\n output[outputIndex++] = int32 ? Number(value) : value\n miniblockCount--\n }\n if (miniblockCount) {\n // consume leftover miniblock\n reader.offset += Math.ceil((miniblockCount * Number(bitWidth) + Number(bitpackPos)) / 8)\n }\n } else {\n for (let j = 0; j < valuesPerMiniblock && outputIndex < count; j++) {\n value += minDelta\n output[outputIndex++] = int32 ? Number(value) : value\n }\n }\n }\n }\n}\n\n/**\n * @param {DataReader} reader\n * @param {number} count\n * @param {Uint8Array[]} output\n */\nexport function deltaLengthByteArray(reader, count, output) {\n const lengths = new Int32Array(count)\n deltaBinaryUnpack(reader, count, lengths)\n for (let i = 0; i < count; i++) {\n output[i] = new Uint8Array(reader.view.buffer, reader.view.byteOffset + reader.offset, lengths[i])\n reader.offset += lengths[i]\n }\n}\n\n/**\n * @param {DataReader} reader\n * @param {number} count\n * @param {Uint8Array[]} output\n */\nexport function deltaByteArray(reader, count, output) {\n const prefixData = new Int32Array(count)\n deltaBinaryUnpack(reader, count, prefixData)\n const suffixData = new Int32Array(count)\n deltaBinaryUnpack(reader, count, suffixData)\n\n for (let i = 0; i < count; i++) {\n const suffix = new Uint8Array(reader.view.buffer, reader.view.byteOffset + reader.offset, suffixData[i])\n if (prefixData[i]) {\n // copy from previous value\n output[i] = new Uint8Array(prefixData[i] + suffixData[i])\n output[i].set(output[i - 1].subarray(0, prefixData[i]))\n output[i].set(suffix, prefixData[i])\n } else {\n output[i] = suffix\n }\n reader.offset += suffixData[i]\n }\n}\n",
|
|
175
|
-
"/**\n * @import {DataReader, DecodedArray, ParquetType} from '../src/types.js'\n */\n\nimport { readVarInt } from './thrift.js'\n\n/**\n * Read values from a run-length encoded/bit-packed hybrid encoding.\n *\n * If length is zero, then read int32 length at the start.\n *\n * @param {DataReader} reader\n * @param {number} width - bitwidth\n * @param {DecodedArray} output\n * @param {number} [length] - length of the encoded data\n */\nexport function readRleBitPackedHybrid(reader, width, output, length) {\n if (length === undefined) {\n length = reader.view.getUint32(reader.offset, true)\n reader.offset += 4\n }\n const startOffset = reader.offset\n let seen = 0\n while (seen < output.length) {\n const header = readVarInt(reader)\n if (header & 1) {\n // bit-packed\n seen = readBitPacked(reader, header, width, output, seen)\n } else {\n // rle\n const count = header >>> 1\n readRle(reader, count, width, output, seen)\n seen += count\n }\n }\n reader.offset = startOffset + length // duckdb writes an empty block\n}\n\n/**\n * Run-length encoding: read value with bitWidth and repeat it count times.\n *\n * @param {DataReader} reader\n * @param {number} count\n * @param {number} bitWidth\n * @param {DecodedArray} output\n * @param {number} seen\n */\nfunction readRle(reader, count, bitWidth, output, seen) {\n const width = bitWidth + 7 >> 3\n let value = 0\n for (let i = 0; i < width; i++) {\n value |= reader.view.getUint8(reader.offset++) << (i << 3)\n }\n // assert(value < 1 << bitWidth)\n\n // repeat value count times\n for (let i = 0; i < count; i++) {\n output[seen + i] = value\n }\n}\n\n/**\n * Read a bit-packed run of the rle/bitpack hybrid.\n * Supports width > 8 (crossing bytes).\n *\n * @param {DataReader} reader\n * @param {number} header - bit-pack header\n * @param {number} bitWidth\n * @param {DecodedArray} output\n * @param {number} seen\n * @returns {number} total output values so far\n */\nfunction readBitPacked(reader, header, bitWidth, output, seen) {\n let count = header >> 1 << 3 // values to read\n const mask = (1 << bitWidth) - 1\n\n let data = 0\n if (reader.offset < reader.view.byteLength) {\n data = reader.view.getUint8(reader.offset++)\n } else if (mask) {\n // sometimes out-of-bounds reads are masked out\n throw new Error(`parquet bitpack offset ${reader.offset} out of range`)\n }\n let left = 8\n let right = 0\n\n // read values\n while (count) {\n // if we have crossed a byte boundary, shift the data\n if (right > 8) {\n right -= 8\n left -= 8\n data >>>= 8\n } else if (left - right < bitWidth) {\n // if we don't have bitWidth number of bits to read, read next byte\n data |= reader.view.getUint8(reader.offset) << left\n reader.offset++\n left += 8\n } else {\n if (seen < output.length) {\n // emit value\n output[seen++] = data >> right & mask\n }\n count--\n right += bitWidth\n }\n }\n\n return seen\n}\n\n/**\n * @param {DataReader} reader\n * @param {number} count\n * @param {ParquetType} type\n * @param {number | undefined} typeLength\n * @returns {DecodedArray}\n */\nexport function byteStreamSplit(reader, count, type, typeLength) {\n const width = byteWidth(type, typeLength)\n const bytes = new Uint8Array(count * width)\n for (let b = 0; b < width; b++) {\n for (let i = 0; i < count; i++) {\n bytes[i * width + b] = reader.view.getUint8(reader.offset++)\n }\n }\n // interpret bytes as typed array\n if (type === 'FLOAT') return new Float32Array(bytes.buffer)\n else if (type === 'DOUBLE') return new Float64Array(bytes.buffer)\n else if (type === 'INT32') return new Int32Array(bytes.buffer)\n else if (type === 'INT64') return new BigInt64Array(bytes.buffer)\n else if (type === 'FIXED_LEN_BYTE_ARRAY') {\n // split into arrays of typeLength\n const split = new Array(count)\n for (let i = 0; i < count; i++) {\n split[i] = bytes.subarray(i * width, (i + 1) * width)\n }\n return split\n }\n throw new Error(`parquet byte_stream_split unsupported type: ${type}`)\n}\n\n/**\n * @param {ParquetType} type\n * @param {number | undefined} typeLength\n * @returns {number}\n */\nfunction byteWidth(type, typeLength) {\n switch (type) {\n case 'INT32':\n case 'FLOAT':\n return 4\n case 'INT64':\n case 'DOUBLE':\n return 8\n case 'FIXED_LEN_BYTE_ARRAY':\n if (!typeLength) throw new Error('parquet byteWidth missing type_length')\n return typeLength\n default:\n throw new Error(`parquet unsupported type: ${type}`)\n }\n}\n",
|
|
176
|
-
"/**\n * Read `count` values of the given type from the reader.view.\n *\n * @param {DataReader} reader - buffer to read data from\n * @param {ParquetType} type - parquet type of the data\n * @param {number} count - number of values to read\n * @param {number | undefined} fixedLength - length of each fixed length byte array\n * @returns {DecodedArray} array of values\n */\nexport function readPlain(reader, type, count, fixedLength) {\n if (count === 0) return []\n if (type === 'BOOLEAN') {\n return readPlainBoolean(reader, count)\n } else if (type === 'INT32') {\n return readPlainInt32(reader, count)\n } else if (type === 'INT64') {\n return readPlainInt64(reader, count)\n } else if (type === 'INT96') {\n return readPlainInt96(reader, count)\n } else if (type === 'FLOAT') {\n return readPlainFloat(reader, count)\n } else if (type === 'DOUBLE') {\n return readPlainDouble(reader, count)\n } else if (type === 'BYTE_ARRAY') {\n return readPlainByteArray(reader, count)\n } else if (type === 'FIXED_LEN_BYTE_ARRAY') {\n if (!fixedLength) throw new Error('parquet missing fixed length')\n return readPlainByteArrayFixed(reader, count, fixedLength)\n } else {\n throw new Error(`parquet unhandled type: ${type}`)\n }\n}\n\n/**\n * Read `count` boolean values.\n *\n * @param {DataReader} reader\n * @param {number} count\n * @returns {boolean[]}\n */\nfunction readPlainBoolean(reader, count) {\n const values = new Array(count)\n for (let i = 0; i < count; i++) {\n const byteOffset = reader.offset + (i / 8 | 0)\n const bitOffset = i % 8\n const byte = reader.view.getUint8(byteOffset)\n values[i] = (byte & 1 << bitOffset) !== 0\n }\n reader.offset += Math.ceil(count / 8)\n return values\n}\n\n/**\n * Read `count` int32 values.\n *\n * @param {DataReader} reader\n * @param {number} count\n * @returns {Int32Array}\n */\nfunction readPlainInt32(reader, count) {\n const values = (reader.view.byteOffset + reader.offset) % 4\n ? new Int32Array(align(reader.view.buffer, reader.view.byteOffset + reader.offset, count * 4))\n : new Int32Array(reader.view.buffer, reader.view.byteOffset + reader.offset, count)\n reader.offset += count * 4\n return values\n}\n\n/**\n * Read `count` int64 values.\n *\n * @param {DataReader} reader\n * @param {number} count\n * @returns {BigInt64Array}\n */\nfunction readPlainInt64(reader, count) {\n const values = (reader.view.byteOffset + reader.offset) % 8\n ? new BigInt64Array(align(reader.view.buffer, reader.view.byteOffset + reader.offset, count * 8))\n : new BigInt64Array(reader.view.buffer, reader.view.byteOffset + reader.offset, count)\n reader.offset += count * 8\n return values\n}\n\n/**\n * Read `count` int96 values.\n *\n * @param {DataReader} reader\n * @param {number} count\n * @returns {bigint[]}\n */\nfunction readPlainInt96(reader, count) {\n const values = new Array(count)\n for (let i = 0; i < count; i++) {\n const low = reader.view.getBigInt64(reader.offset + i * 12, true)\n const high = reader.view.getInt32(reader.offset + i * 12 + 8, true)\n values[i] = BigInt(high) << 64n | low\n }\n reader.offset += count * 12\n return values\n}\n\n/**\n * Read `count` float values.\n *\n * @param {DataReader} reader\n * @param {number} count\n * @returns {Float32Array}\n */\nfunction readPlainFloat(reader, count) {\n const values = (reader.view.byteOffset + reader.offset) % 4\n ? new Float32Array(align(reader.view.buffer, reader.view.byteOffset + reader.offset, count * 4))\n : new Float32Array(reader.view.buffer, reader.view.byteOffset + reader.offset, count)\n reader.offset += count * 4\n return values\n}\n\n/**\n * Read `count` double values.\n *\n * @param {DataReader} reader\n * @param {number} count\n * @returns {Float64Array}\n */\nfunction readPlainDouble(reader, count) {\n const values = (reader.view.byteOffset + reader.offset) % 8\n ? new Float64Array(align(reader.view.buffer, reader.view.byteOffset + reader.offset, count * 8))\n : new Float64Array(reader.view.buffer, reader.view.byteOffset + reader.offset, count)\n reader.offset += count * 8\n return values\n}\n\n/**\n * Read `count` byte array values.\n *\n * @param {DataReader} reader\n * @param {number} count\n * @returns {Uint8Array[]}\n */\nfunction readPlainByteArray(reader, count) {\n const values = new Array(count)\n for (let i = 0; i < count; i++) {\n const length = reader.view.getUint32(reader.offset, true)\n reader.offset += 4\n values[i] = new Uint8Array(reader.view.buffer, reader.view.byteOffset + reader.offset, length)\n reader.offset += length\n }\n return values\n}\n\n/**\n * Read a fixed length byte array.\n *\n * @param {DataReader} reader\n * @param {number} count\n * @param {number} fixedLength\n * @returns {Uint8Array[]}\n */\nfunction readPlainByteArrayFixed(reader, count, fixedLength) {\n // assert(reader.view.byteLength - reader.offset >= count * fixedLength)\n const values = new Array(count)\n for (let i = 0; i < count; i++) {\n values[i] = new Uint8Array(reader.view.buffer, reader.view.byteOffset + reader.offset, fixedLength)\n reader.offset += fixedLength\n }\n return values\n}\n\n/**\n * Create a new buffer with the offset and size.\n *\n * @import {DataReader, DecodedArray, ParquetType} from '../src/types.js'\n * @param {ArrayBufferLike} buffer\n * @param {number} offset\n * @param {number} size\n * @returns {ArrayBuffer}\n */\nfunction align(buffer, offset, size) {\n const aligned = new ArrayBuffer(size)\n new Uint8Array(aligned).set(new Uint8Array(buffer, offset, size))\n return aligned\n}\n",
|
|
177
|
-
"/**\n * The MIT License (MIT)\n * Copyright (c) 2016 Zhipeng Jia\n * https://github.com/zhipeng-jia/snappyjs\n */\n\nconst WORD_MASK = [0, 0xff, 0xffff, 0xffffff, 0xffffffff]\n\n/**\n * Copy bytes from one array to another\n *\n * @param {Uint8Array} fromArray source array\n * @param {number} fromPos source position\n * @param {Uint8Array} toArray destination array\n * @param {number} toPos destination position\n * @param {number} length number of bytes to copy\n */\nfunction copyBytes(fromArray, fromPos, toArray, toPos, length) {\n for (let i = 0; i < length; i++) {\n toArray[toPos + i] = fromArray[fromPos + i]\n }\n}\n\n/**\n * Decompress snappy data.\n * Accepts an output buffer to avoid allocating a new buffer for each call.\n *\n * @param {Uint8Array} input compressed data\n * @param {Uint8Array} output output buffer\n */\nexport function snappyUncompress(input, output) {\n const inputLength = input.byteLength\n const outputLength = output.byteLength\n let pos = 0\n let outPos = 0\n\n // skip preamble (contains uncompressed length as varint)\n while (pos < inputLength) {\n const c = input[pos]\n pos++\n if (c < 128) {\n break\n }\n }\n if (outputLength && pos >= inputLength) {\n throw new Error('invalid snappy length header')\n }\n\n while (pos < inputLength) {\n const c = input[pos]\n let len = 0\n pos++\n\n if (pos >= inputLength) {\n throw new Error('missing eof marker')\n }\n\n // There are two types of elements, literals and copies (back references)\n if ((c & 0x3) === 0) {\n // Literals are uncompressed data stored directly in the byte stream\n let len = (c >>> 2) + 1\n // Longer literal length is encoded in multiple bytes\n if (len > 60) {\n if (pos + 3 >= inputLength) {\n throw new Error('snappy error literal pos + 3 >= inputLength')\n }\n const lengthSize = len - 60 // length bytes - 1\n len = input[pos]\n + (input[pos + 1] << 8)\n + (input[pos + 2] << 16)\n + (input[pos + 3] << 24)\n len = (len & WORD_MASK[lengthSize]) + 1\n pos += lengthSize\n }\n if (pos + len > inputLength) {\n throw new Error('snappy error literal exceeds input length')\n }\n copyBytes(input, pos, output, outPos, len)\n pos += len\n outPos += len\n } else {\n // Copy elements\n let offset = 0 // offset back from current position to read\n switch (c & 0x3) {\n case 1:\n // Copy with 1-byte offset\n len = (c >>> 2 & 0x7) + 4\n offset = input[pos] + (c >>> 5 << 8)\n pos++\n break\n case 2:\n // Copy with 2-byte offset\n if (inputLength <= pos + 1) {\n throw new Error('snappy error end of input')\n }\n len = (c >>> 2) + 1\n offset = input[pos] + (input[pos + 1] << 8)\n pos += 2\n break\n case 3:\n // Copy with 4-byte offset\n if (inputLength <= pos + 3) {\n throw new Error('snappy error end of input')\n }\n len = (c >>> 2) + 1\n offset = input[pos]\n + (input[pos + 1] << 8)\n + (input[pos + 2] << 16)\n + (input[pos + 3] << 24)\n pos += 4\n break\n default:\n break\n }\n if (offset === 0 || isNaN(offset)) {\n throw new Error(`invalid offset ${offset} pos ${pos} inputLength ${inputLength}`)\n }\n if (offset > outPos) {\n throw new Error('cannot copy from before start of buffer')\n }\n copyBytes(output, outPos - offset, output, outPos, len)\n outPos += len\n }\n }\n\n if (outPos !== outputLength) throw new Error('premature end of input')\n}\n",
|
|
178
|
-
"/**\n * @import {ColumnDecoder, CompressionCodec, Compressors, DataPage, DataPageHeader, DataPageHeaderV2, DataReader, DecodedArray, PageHeader, SchemaTree} from '../src/types.js'\n */\n\nimport { deltaBinaryUnpack, deltaByteArray, deltaLengthByteArray } from './delta.js'\nimport { byteStreamSplit, readRleBitPackedHybrid } from './encoding.js'\nimport { readPlain } from './plain.js'\nimport { getMaxDefinitionLevel, getMaxRepetitionLevel } from './schema.js'\nimport { snappyUncompress } from './snappy.js'\n\n/**\n * Read a data page from uncompressed reader.\n *\n * @param {Uint8Array} bytes raw page data (should already be decompressed)\n * @param {DataPageHeader} daph data page header\n * @param {ColumnDecoder} columnDecoder\n * @returns {DataPage} definition levels, repetition levels, and array of values\n */\nexport function readDataPage(bytes, daph, { type, element, schemaPath }) {\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength)\n const reader = { view, offset: 0 }\n /** @type {DecodedArray} */\n let dataPage\n\n // repetition and definition levels\n const repetitionLevels = readRepetitionLevels(reader, daph, schemaPath)\n // assert(!repetitionLevels.length || repetitionLevels.length === daph.num_values)\n const { definitionLevels, numNulls } = readDefinitionLevels(reader, daph, schemaPath)\n // assert(!definitionLevels.length || definitionLevels.length === daph.num_values)\n\n // read values based on encoding\n const nValues = daph.num_values - numNulls\n if (daph.encoding === 'PLAIN') {\n dataPage = readPlain(reader, type, nValues, element.type_length)\n } else if (\n daph.encoding === 'PLAIN_DICTIONARY' ||\n daph.encoding === 'RLE_DICTIONARY' ||\n daph.encoding === 'RLE'\n ) {\n const bitWidth = type === 'BOOLEAN' ? 1 : view.getUint8(reader.offset++)\n if (bitWidth) {\n dataPage = new Array(nValues)\n if (type === 'BOOLEAN') {\n readRleBitPackedHybrid(reader, bitWidth, dataPage)\n dataPage = dataPage.map(x => !!x) // convert to boolean\n } else {\n // assert(daph.encoding.endsWith('_DICTIONARY'))\n readRleBitPackedHybrid(reader, bitWidth, dataPage, view.byteLength - reader.offset)\n }\n } else {\n dataPage = new Uint8Array(nValues) // nValue zeroes\n }\n } else if (daph.encoding === 'BYTE_STREAM_SPLIT') {\n dataPage = byteStreamSplit(reader, nValues, type, element.type_length)\n } else if (daph.encoding === 'DELTA_BINARY_PACKED') {\n const int32 = type === 'INT32'\n dataPage = int32 ? new Int32Array(nValues) : new BigInt64Array(nValues)\n deltaBinaryUnpack(reader, nValues, dataPage)\n } else if (daph.encoding === 'DELTA_LENGTH_BYTE_ARRAY') {\n dataPage = new Array(nValues)\n deltaLengthByteArray(reader, nValues, dataPage)\n } else {\n throw new Error(`parquet unsupported encoding: ${daph.encoding}`)\n }\n\n return { definitionLevels, repetitionLevels, dataPage }\n}\n\n/**\n * @param {DataReader} reader data view for the page\n * @param {DataPageHeader} daph data page header\n * @param {SchemaTree[]} schemaPath\n * @returns {any[]} repetition levels and number of bytes read\n */\nfunction readRepetitionLevels(reader, daph, schemaPath) {\n if (schemaPath.length > 1) {\n const maxRepetitionLevel = getMaxRepetitionLevel(schemaPath)\n if (maxRepetitionLevel) {\n const values = new Array(daph.num_values)\n readRleBitPackedHybrid(reader, bitWidth(maxRepetitionLevel), values)\n return values\n }\n }\n return []\n}\n\n/**\n * @param {DataReader} reader data view for the page\n * @param {DataPageHeader} daph data page header\n * @param {SchemaTree[]} schemaPath\n * @returns {{ definitionLevels: number[], numNulls: number }} definition levels\n */\nfunction readDefinitionLevels(reader, daph, schemaPath) {\n const maxDefinitionLevel = getMaxDefinitionLevel(schemaPath)\n if (!maxDefinitionLevel) return { definitionLevels: [], numNulls: 0 }\n\n const definitionLevels = new Array(daph.num_values)\n readRleBitPackedHybrid(reader, bitWidth(maxDefinitionLevel), definitionLevels)\n\n // count nulls\n let numNulls = daph.num_values\n for (const def of definitionLevels) {\n if (def === maxDefinitionLevel) numNulls--\n }\n if (numNulls === 0) definitionLevels.length = 0\n\n return { definitionLevels, numNulls }\n}\n\n/**\n * @param {Uint8Array} compressedBytes\n * @param {number} uncompressed_page_size\n * @param {CompressionCodec} codec\n * @param {Compressors | undefined} compressors\n * @returns {Uint8Array}\n */\nexport function decompressPage(compressedBytes, uncompressed_page_size, codec, compressors) {\n /** @type {Uint8Array} */\n let page\n const customDecompressor = compressors?.[codec]\n if (codec === 'UNCOMPRESSED') {\n page = compressedBytes\n } else if (customDecompressor) {\n page = customDecompressor(compressedBytes, uncompressed_page_size)\n } else if (codec === 'SNAPPY') {\n page = new Uint8Array(uncompressed_page_size)\n snappyUncompress(compressedBytes, page)\n } else {\n throw new Error(`parquet unsupported compression codec: ${codec}`)\n }\n if (page?.length !== uncompressed_page_size) {\n throw new Error(`parquet decompressed page length ${page?.length} does not match header ${uncompressed_page_size}`)\n }\n return page\n}\n\n\n/**\n * Read a data page from the given Uint8Array.\n *\n * @param {Uint8Array} compressedBytes raw page data\n * @param {PageHeader} ph page header\n * @param {ColumnDecoder} columnDecoder\n * @returns {DataPage} definition levels, repetition levels, and array of values\n */\nexport function readDataPageV2(compressedBytes, ph, columnDecoder) {\n const view = new DataView(compressedBytes.buffer, compressedBytes.byteOffset, compressedBytes.byteLength)\n const reader = { view, offset: 0 }\n const { type, element, schemaPath, codec, compressors } = columnDecoder\n const daph2 = ph.data_page_header_v2\n if (!daph2) throw new Error('parquet data page header v2 is undefined')\n\n // repetition levels\n const repetitionLevels = readRepetitionLevelsV2(reader, daph2, schemaPath)\n reader.offset = daph2.repetition_levels_byte_length // readVarInt() => len for boolean v2?\n\n // definition levels\n const definitionLevels = readDefinitionLevelsV2(reader, daph2, schemaPath)\n // assert(reader.offset === daph2.repetition_levels_byte_length + daph2.definition_levels_byte_length)\n\n const uncompressedPageSize = ph.uncompressed_page_size - daph2.definition_levels_byte_length - daph2.repetition_levels_byte_length\n\n let page = compressedBytes.subarray(reader.offset)\n if (daph2.is_compressed !== false) {\n page = decompressPage(page, uncompressedPageSize, codec, compressors)\n }\n const pageView = new DataView(page.buffer, page.byteOffset, page.byteLength)\n const pageReader = { view: pageView, offset: 0 }\n\n // read values based on encoding\n /** @type {DecodedArray} */\n let dataPage\n const nValues = daph2.num_values - daph2.num_nulls\n if (daph2.encoding === 'PLAIN') {\n dataPage = readPlain(pageReader, type, nValues, element.type_length)\n } else if (daph2.encoding === 'RLE') {\n // assert(type === 'BOOLEAN')\n dataPage = new Array(nValues)\n readRleBitPackedHybrid(pageReader, 1, dataPage)\n dataPage = dataPage.map(x => !!x)\n } else if (\n daph2.encoding === 'PLAIN_DICTIONARY' ||\n daph2.encoding === 'RLE_DICTIONARY'\n ) {\n const bitWidth = pageView.getUint8(pageReader.offset++)\n dataPage = new Array(nValues)\n readRleBitPackedHybrid(pageReader, bitWidth, dataPage, uncompressedPageSize - 1)\n } else if (daph2.encoding === 'DELTA_BINARY_PACKED') {\n const int32 = type === 'INT32'\n dataPage = int32 ? new Int32Array(nValues) : new BigInt64Array(nValues)\n deltaBinaryUnpack(pageReader, nValues, dataPage)\n } else if (daph2.encoding === 'DELTA_LENGTH_BYTE_ARRAY') {\n dataPage = new Array(nValues)\n deltaLengthByteArray(pageReader, nValues, dataPage)\n } else if (daph2.encoding === 'DELTA_BYTE_ARRAY') {\n dataPage = new Array(nValues)\n deltaByteArray(pageReader, nValues, dataPage)\n } else if (daph2.encoding === 'BYTE_STREAM_SPLIT') {\n dataPage = byteStreamSplit(pageReader, nValues, type, element.type_length)\n } else {\n throw new Error(`parquet unsupported encoding: ${daph2.encoding}`)\n }\n\n return { definitionLevels, repetitionLevels, dataPage }\n}\n\n/**\n * @param {DataReader} reader\n * @param {DataPageHeaderV2} daph2 data page header v2\n * @param {SchemaTree[]} schemaPath\n * @returns {any[]} repetition levels\n */\nfunction readRepetitionLevelsV2(reader, daph2, schemaPath) {\n const maxRepetitionLevel = getMaxRepetitionLevel(schemaPath)\n if (!maxRepetitionLevel) return []\n\n const values = new Array(daph2.num_values)\n readRleBitPackedHybrid(reader, bitWidth(maxRepetitionLevel), values, daph2.repetition_levels_byte_length)\n return values\n}\n\n/**\n * @param {DataReader} reader\n * @param {DataPageHeaderV2} daph2 data page header v2\n * @param {SchemaTree[]} schemaPath\n * @returns {number[] | undefined} definition levels\n */\nfunction readDefinitionLevelsV2(reader, daph2, schemaPath) {\n const maxDefinitionLevel = getMaxDefinitionLevel(schemaPath)\n if (maxDefinitionLevel) {\n // V2 we know the length\n const values = new Array(daph2.num_values)\n readRleBitPackedHybrid(reader, bitWidth(maxDefinitionLevel), values, daph2.definition_levels_byte_length)\n return values\n }\n}\n\n/**\n * Minimum bits needed to store value.\n *\n * @param {number} value\n * @returns {number}\n */\nfunction bitWidth(value) {\n return 32 - Math.clz32(value)\n}\n",
|
|
179
|
-
"/**\n * @import {ColumnDecoder, DataReader, DecodedArray, PageHeader, PageResult, RowGroupSelect, SubColumnData} from '../src/types.js'\n */\n\nimport { assembleLists } from './assemble.js'\nimport { Encodings, PageTypes } from './constants.js'\nimport { convert, convertWithDictionary } from './convert.js'\nimport { decompressPage, readDataPage, readDataPageV2 } from './datapage.js'\nimport { readPlain } from './plain.js'\nimport { isFlatColumn } from './schema.js'\nimport { deserializeTCompactProtocol } from './thrift.js'\n\n/**\n * Parse column data from a buffer.\n *\n * @param {DataReader} reader\n * @param {RowGroupSelect} rowGroupSelect row group selection\n * @param {ColumnDecoder} columnDecoder column decoder params\n * @param {(chunk: SubColumnData) => void} [onPage] callback for each page\n * @returns {{ data: DecodedArray[], skipped: number }}\n */\nexport function readColumn(reader, { groupStart, selectStart, selectEnd }, columnDecoder, onPage) {\n const { pathInSchema, schemaPath } = columnDecoder\n const isFlat = isFlatColumn(schemaPath)\n /** @type {DecodedArray[]} */\n const chunks = []\n /** @type {DecodedArray | undefined} */\n let dictionary = undefined\n /** @type {DecodedArray | undefined} */\n let lastChunk = undefined\n let rowCount = 0\n let skipped = 0\n\n const emitLastChunk = onPage && (() => {\n lastChunk && onPage({\n pathInSchema,\n columnData: lastChunk,\n rowStart: groupStart + rowCount - lastChunk.length,\n rowEnd: groupStart + rowCount,\n })\n })\n\n while (isFlat ? rowCount < selectEnd : reader.offset < reader.view.byteLength - 1) {\n if (reader.offset >= reader.view.byteLength - 1) break // end of reader\n\n // read page header\n const header = parquetHeader(reader)\n if (header.type === 'DICTIONARY_PAGE') {\n const { data } = readPage(reader, header, columnDecoder, dictionary, undefined, 0)\n if (data) dictionary = convert(data, columnDecoder)\n } else {\n const lastChunkLength = lastChunk?.length || 0\n const result = readPage(reader, header, columnDecoder, dictionary, lastChunk, selectStart - rowCount)\n if (result.skipped) {\n // skipped page - just advance row count, don't add to chunks\n if (!chunks.length) {\n skipped += result.skipped\n }\n rowCount += result.skipped\n } else if (result.data && lastChunk === result.data) {\n // continued from previous page\n rowCount += result.data.length - lastChunkLength\n } else if (result.data && result.data.length) {\n emitLastChunk?.()\n chunks.push(result.data)\n rowCount += result.data.length\n lastChunk = result.data\n }\n }\n }\n emitLastChunk?.()\n\n return { data: chunks, skipped }\n}\n\n/**\n * Read a page (data or dictionary) from a buffer.\n *\n * @param {DataReader} reader\n * @param {PageHeader} header\n * @param {ColumnDecoder} columnDecoder\n * @param {DecodedArray | undefined} dictionary\n * @param {DecodedArray | undefined} previousChunk\n * @param {number} pageStart skip this many rows in the page\n * @returns {PageResult}\n */\nexport function readPage(reader, header, columnDecoder, dictionary, previousChunk, pageStart) {\n const { type, element, schemaPath, codec, compressors } = columnDecoder\n // read compressed_page_size bytes\n const compressedBytes = new Uint8Array(\n reader.view.buffer, reader.view.byteOffset + reader.offset, header.compressed_page_size\n )\n reader.offset += header.compressed_page_size\n\n // parse page data by type\n if (header.type === 'DATA_PAGE') {\n const daph = header.data_page_header\n if (!daph) throw new Error('parquet data page header is undefined')\n\n // skip unnecessary non-nested pages\n if (pageStart > daph.num_values && isFlatColumn(schemaPath)) {\n return { skipped: daph.num_values }\n }\n\n const page = decompressPage(compressedBytes, Number(header.uncompressed_page_size), codec, compressors)\n const { definitionLevels, repetitionLevels, dataPage } = readDataPage(page, daph, columnDecoder)\n // assert(!daph.statistics?.null_count || daph.statistics.null_count === BigInt(daph.num_values - dataPage.length))\n\n // convert types, dereference dictionary, and assemble lists\n const values = convertWithDictionary(dataPage, dictionary, daph.encoding, columnDecoder)\n const output = Array.isArray(previousChunk) ? previousChunk : []\n const assembled = assembleLists(output, definitionLevels, repetitionLevels, values, schemaPath)\n return { skipped: 0, data: assembled }\n } else if (header.type === 'DATA_PAGE_V2') {\n const daph2 = header.data_page_header_v2\n if (!daph2) throw new Error('parquet data page header v2 is undefined')\n\n // skip unnecessary pages\n if (pageStart > daph2.num_rows) {\n return { skipped: daph2.num_values }\n }\n\n const { definitionLevels, repetitionLevels, dataPage } =\n readDataPageV2(compressedBytes, header, columnDecoder)\n\n // convert types, dereference dictionary, and assemble lists\n const values = convertWithDictionary(dataPage, dictionary, daph2.encoding, columnDecoder)\n const output = Array.isArray(previousChunk) ? previousChunk : []\n const assembled = assembleLists(output, definitionLevels, repetitionLevels, values, schemaPath)\n return { skipped: 0, data: assembled }\n } else if (header.type === 'DICTIONARY_PAGE') {\n const diph = header.dictionary_page_header\n if (!diph) throw new Error('parquet dictionary page header is undefined')\n\n const page = decompressPage(\n compressedBytes, Number(header.uncompressed_page_size), codec, compressors\n )\n\n const reader = { view: new DataView(page.buffer, page.byteOffset, page.byteLength), offset: 0 }\n const dictArray = readPlain(reader, type, diph.num_values, element.type_length)\n return { skipped: 0, data: dictArray }\n } else {\n throw new Error(`parquet unsupported page type: ${header.type}`)\n }\n}\n\n/**\n * Read parquet header from a buffer.\n *\n * @param {DataReader} reader\n * @returns {PageHeader}\n */\nfunction parquetHeader(reader) {\n const header = deserializeTCompactProtocol(reader)\n\n // Parse parquet header from thrift data\n const type = PageTypes[header.field_1]\n const uncompressed_page_size = header.field_2\n const compressed_page_size = header.field_3\n const crc = header.field_4\n const data_page_header = header.field_5 && {\n num_values: header.field_5.field_1,\n encoding: Encodings[header.field_5.field_2],\n definition_level_encoding: Encodings[header.field_5.field_3],\n repetition_level_encoding: Encodings[header.field_5.field_4],\n statistics: header.field_5.field_5 && {\n max: header.field_5.field_5.field_1,\n min: header.field_5.field_5.field_2,\n null_count: header.field_5.field_5.field_3,\n distinct_count: header.field_5.field_5.field_4,\n max_value: header.field_5.field_5.field_5,\n min_value: header.field_5.field_5.field_6,\n },\n }\n const index_page_header = header.field_6\n const dictionary_page_header = header.field_7 && {\n num_values: header.field_7.field_1,\n encoding: Encodings[header.field_7.field_2],\n is_sorted: header.field_7.field_3,\n }\n const data_page_header_v2 = header.field_8 && {\n num_values: header.field_8.field_1,\n num_nulls: header.field_8.field_2,\n num_rows: header.field_8.field_3,\n encoding: Encodings[header.field_8.field_4],\n definition_levels_byte_length: header.field_8.field_5,\n repetition_levels_byte_length: header.field_8.field_6,\n is_compressed: header.field_8.field_7 === undefined ? true : header.field_8.field_7, // default true\n statistics: header.field_8.field_8,\n }\n\n return {\n type,\n uncompressed_page_size,\n compressed_page_size,\n crc,\n data_page_header,\n index_page_header,\n dictionary_page_header,\n data_page_header_v2,\n }\n}\n",
|
|
180
|
-
"/**\n * @import {AsyncColumn, AsyncRowGroup, ChunkPlan, ColumnDecoder, DecodedArray, GroupPlan, PageLocation, ParquetParsers, ParquetReadOptions, QueryPlan, SchemaTree} from '../src/types.js'\n */\n\nimport { assembleNested } from './assemble.js'\nimport { readColumn } from './column.js'\nimport { DEFAULT_PARSERS } from './convert.js'\nimport { readOffsetIndex } from './indexes.js'\nimport { getSchemaPath } from './schema.js'\nimport { flatten } from './utils.js'\n\n/**\n * Read a row group from a file-like object.\n *\n * @param {ParquetReadOptions} options\n * @param {QueryPlan} plan\n * @param {GroupPlan} groupPlan\n * @returns {AsyncRowGroup} resolves to column data\n */\nexport function readRowGroup(options, { metadata }, groupPlan) {\n /** @type {AsyncColumn[]} */\n const asyncColumns = []\n\n // read column data\n for (const chunk of groupPlan.chunks) {\n const { path_in_schema: pathInSchema } = chunk.columnMetadata\n const schemaPath = getSchemaPath(metadata.schema, pathInSchema)\n const columnDecoder = {\n pathInSchema,\n element: schemaPath[schemaPath.length - 1].element,\n schemaPath,\n parsers: { ...DEFAULT_PARSERS, ...options.parsers },\n ...options,\n ...chunk.columnMetadata,\n }\n const { startByte, endByte } = chunk.range\n\n if ('pageLocations' in chunk) {\n // page locations already parsed from the offset index\n asyncColumns.push({\n pathInSchema,\n data: readSelectedPages(options, groupPlan, chunk, chunk.pageLocations, columnDecoder),\n })\n } else if ('offsetIndex' in chunk) {\n asyncColumns.push({\n pathInSchema,\n // fetch offset index\n data: Promise.resolve(options.file.slice(chunk.offsetIndex.startByte, chunk.offsetIndex.endByte))\n .then(arrayBuffer => {\n const pages = readOffsetIndex({ view: new DataView(arrayBuffer), offset: 0 }).page_locations\n return readSelectedPages(options, groupPlan, chunk, pages, columnDecoder)\n }),\n })\n } else {\n // full column chunk\n asyncColumns.push({\n pathInSchema,\n data: Promise.resolve(options.file.slice(startByte, endByte))\n .then(buffer => {\n const reader = { view: new DataView(buffer), offset: 0 }\n return readColumn(reader, groupPlan, columnDecoder, options.onPage)\n }),\n })\n }\n }\n\n return {\n groupStart: groupPlan.groupStart,\n groupRows: groupPlan.groupRows,\n selectStart: groupPlan.selectStart,\n selectEnd: groupPlan.selectEnd,\n asyncColumns,\n }\n}\n\n/**\n * Read only the pages of a column chunk that overlap the group plan's select\n * range [selectStart, selectEnd), using page locations from the offset index.\n *\n * @param {ParquetReadOptions} options\n * @param {GroupPlan} groupPlan\n * @param {ChunkPlan} chunk\n * @param {PageLocation[]} pages\n * @param {ColumnDecoder} columnDecoder\n * @returns {Promise<{data: DecodedArray[], skipped: number}>}\n */\nasync function readSelectedPages(options, groupPlan, chunk, pages, columnDecoder) {\n const { data_page_offset, dictionary_page_offset } = chunk.columnMetadata\n const { selectStart, selectEnd } = groupPlan\n let { startByte, endByte } = chunk.range\n let skipped = -1\n // include dictionary if present, handle polars missing dictionary_page_offset\n const hasDict = dictionary_page_offset || data_page_offset < pages[0].offset\n for (let i = 0; i < pages.length; i++) {\n const page = pages[i]\n const pageStart = Number(page.first_row_index)\n const pageEnd = i + 1 < pages.length\n ? Number(pages[i + 1].first_row_index)\n : groupPlan.groupRows // last page extends to end of row group\n // check if page overlaps with [selectStart, selectEnd)\n if (skipped < 0 && pageEnd > selectStart) {\n startByte = Number(page.offset)\n skipped = pageStart\n }\n if (pageStart < selectEnd) {\n endByte = Number(page.offset) + page.compressed_page_size\n }\n }\n if (skipped < 0) skipped = 0\n /** @type {DataView} */\n let view\n if (hasDict && skipped) {\n // fetch the dictionary page separately from the selected data pages so\n // the skipped leading pages are not transferred\n const dictLength = Number(pages[0].offset) - chunk.range.startByte\n const [dictBuffer, dataBuffer] = await Promise.all([\n options.file.slice(chunk.range.startByte, Number(pages[0].offset)),\n options.file.slice(startByte, endByte),\n ])\n // clamp in case the AsyncBuffer returned more bytes than requested\n const combined = new Uint8Array(dictLength + dataBuffer.byteLength)\n combined.set(new Uint8Array(dictBuffer, 0, dictLength))\n combined.set(new Uint8Array(dataBuffer), dictLength)\n view = new DataView(combined.buffer)\n } else if (hasDict) {\n // dictionary page is contiguous with the first selected page\n view = new DataView(await options.file.slice(chunk.range.startByte, endByte))\n } else {\n view = new DataView(await options.file.slice(startByte, endByte))\n }\n const reader = { view, offset: 0 }\n // adjust row selection for skipped pages\n const adjustedGroupPlan = skipped ? {\n ...groupPlan,\n groupStart: groupPlan.groupStart + skipped,\n selectStart: groupPlan.selectStart - skipped,\n selectEnd: groupPlan.selectEnd - skipped,\n } : groupPlan\n const { data, skipped: columnSkipped } = readColumn(reader, adjustedGroupPlan, columnDecoder, options.onPage)\n return {\n data,\n skipped: skipped + columnSkipped,\n }\n}\n\n/**\n * @overload\n * @param {AsyncRowGroup} asyncGroup\n * @param {number} selectStart\n * @param {number} selectEnd\n * @param {string[] | undefined} columns\n * @param {'object'} rowFormat\n * @returns {Promise<Record<string, any>[]>} resolves to row data\n */\n/**\n * @overload\n * @param {AsyncRowGroup} asyncGroup\n * @param {number} selectStart\n * @param {number} selectEnd\n * @param {string[] | undefined} columns\n * @param {'array'} [rowFormat]\n * @returns {Promise<any[][]>} resolves to row data\n */\n/**\n * @param {AsyncRowGroup} asyncGroup\n * @param {number} selectStart\n * @param {number} selectEnd\n * @param {string[] | undefined} columns\n * @param {'object' | 'array'} [rowFormat]\n * @returns {Promise<Record<string, any>[] | any[][]>} resolves to row data\n */\nexport async function asyncGroupToRows({ asyncColumns }, selectStart, selectEnd, columns, rowFormat) {\n // TODO: do it without flatten\n const asyncPages = await Promise.all(asyncColumns.map(column =>\n column.data.then(({ skipped, data }) => ({ skipped, data: flatten(data) }))\n ))\n\n // transpose columns into rows\n const selectCount = selectEnd - selectStart\n if (rowFormat === 'object') {\n /** @type {Record<string, any>[]} */\n const groupData = Array(selectCount)\n for (let selectRow = 0; selectRow < selectCount; selectRow++) {\n // return each row as an object\n /** @type {Record<string, any>} */\n const rowData = {}\n for (let i = 0; i < asyncColumns.length; i++) {\n const { data, skipped } = asyncPages[i]\n rowData[asyncColumns[i].pathInSchema[0]] = data[selectStart + selectRow - skipped]\n }\n groupData[selectRow] = rowData\n }\n return groupData\n }\n\n // careful mapping of column order for rowFormat: array\n const includedColumnNames = asyncColumns\n .map(child => child.pathInSchema[0])\n .filter(name => !columns || columns.includes(name))\n const columnOrder = columns ?? includedColumnNames\n const columnIndexes = columnOrder.map(name => asyncColumns.findIndex(column => column.pathInSchema[0] === name))\n\n /** @type {any[][]} */\n const groupData = Array(selectCount)\n for (let selectRow = 0; selectRow < selectCount; selectRow++) {\n // return each row as an array\n const rowData = Array(asyncColumns.length)\n for (let i = 0; i < columnOrder.length; i++) {\n const colIdx = columnIndexes[i]\n if (colIdx < 0) throw new Error(`parquet column not found: ${columnOrder[i]}`)\n const { data, skipped } = asyncPages[colIdx]\n rowData[i] = data[selectStart + selectRow - skipped]\n }\n groupData[selectRow] = rowData\n }\n return groupData\n}\n\n/**\n * Assemble physical columns into top-level columns asynchronously.\n *\n * @param {AsyncRowGroup} asyncRowGroup\n * @param {SchemaTree} schemaTree\n * @param {ParquetParsers} [parsers]\n * @returns {AsyncRowGroup}\n */\nexport function assembleAsync(asyncRowGroup, schemaTree, parsers) {\n const { asyncColumns } = asyncRowGroup\n parsers = { ...DEFAULT_PARSERS, ...parsers }\n /** @type {AsyncColumn[]} */\n const assembled = []\n for (const child of schemaTree.children) {\n if (child.children.length) {\n const childColumns = asyncColumns.filter(column => column.pathInSchema[0] === child.element.name)\n if (!childColumns.length) continue\n\n assembled.push({\n pathInSchema: child.path,\n data: (async () => {\n // collect subcolumn data — Promise.all observes every rejection so\n // a sibling failure cannot leak as an unhandledRejection\n const resolved = await Promise.all(childColumns.map(c => c.data))\n /** @type {Map<string, DecodedArray>} */\n const subcolumnData = new Map()\n const flattened = resolved.map(({ data }) => flatten(data))\n const skipped = Math.max(...resolved.map(result => result.skipped))\n const end = Math.min(...resolved.map((result, i) => result.skipped + flattened[i].length))\n for (let i = 0; i < childColumns.length; i++) {\n // Offset-index reads may start each physical child at a different\n // page boundary. Align them to their common absolute row range.\n const start = skipped - resolved[i].skipped\n const length = Math.max(0, end - skipped)\n subcolumnData.set(\n childColumns[i].pathInSchema.join('.'),\n flattened[i].slice(start, start + length)\n )\n }\n // assemble the column\n assembleNested(subcolumnData, child, parsers)\n const assembled = subcolumnData.get(child.element.name)\n if (!assembled) throw new Error('parquet column data not assembled')\n return { data: [assembled], skipped }\n })(),\n })\n } else {\n // leaf node, return the column\n const asyncColumn = asyncColumns.find(column => column.pathInSchema[0] === child.element.name)\n if (asyncColumn) assembled.push(asyncColumn)\n }\n }\n return { ...asyncRowGroup, asyncColumns: assembled }\n}\n",
|
|
181
|
-
"/**\n * @import {AsyncRowGroup, BaseParquetReadOptions, DecodedArray, ParquetReadOptions, SchemaElement} from '../src/types.js'\n */\n\nimport { columnsNeededForFilter, matchFilter } from './filter.js'\nimport { parquetMetadataAsync, parquetSchema } from './metadata.js'\nimport { parquetPlan, prefetchAsyncBuffer, prefetchBloomFilters, prefetchPageIndexes } from './plan.js'\nimport { assembleAsync, asyncGroupToRows, readRowGroup } from './rowgroup.js'\nimport { concat } from './utils.js'\n\n/**\n * Read parquet data rows from a file-like object.\n * Reads the minimal number of row groups and columns to satisfy the request.\n *\n * Returns a void promise when complete.\n * Errors are thrown on the returned promise.\n * Data is returned in callbacks onComplete, onChunk, onPage, NOT the return promise.\n * See parquetReadObjects for a more convenient API.\n *\n * @param {ParquetReadOptions} options read options\n * @returns {Promise<void>} resolves when all requested rows and columns are parsed, all errors are thrown here\n */\nexport async function parquetRead(options) {\n // load metadata if not provided\n options.metadata ??= await parquetMetadataAsync(options.file, options)\n\n const { rowStart = 0, rowEnd, columns, onChunk, onComplete, rowFormat, filter, filterStrict = true } = options\n\n // Filter requires object format to match column names\n if (filter && rowFormat !== 'object') {\n throw new Error('parquet filter requires rowFormat: \"object\"')\n }\n\n // Include filter columns in the read plan\n const filterColumns = columnsNeededForFilter(filter)\n if (filterColumns.length) {\n const schemaColumns = parquetSchema(options.metadata).children.map(c => c.element.name)\n const missingColumns = filterColumns.filter(c => !schemaColumns.includes(c))\n if (missingColumns.length) {\n throw new Error(`parquet filter columns not found: ${missingColumns.join(', ')}`)\n }\n }\n let readColumns = columns\n let requiresProjection = false\n if (columns && filter) {\n const missingFilterColumns = filterColumns.filter(c => !columns.includes(c))\n if (missingFilterColumns.length) {\n readColumns = [...columns, ...missingFilterColumns]\n requiresProjection = true\n }\n }\n\n // read row groups with expanded columns\n let readOptions = readColumns !== columns ? { ...options, columns: readColumns } : options\n readOptions = await withBloomFilters(readOptions)\n readOptions = await withPageIndexes(readOptions)\n const asyncGroups = parquetReadAsync(readOptions)\n\n // skip assembly if no onComplete or onChunk, but wait for reading to finish\n if (!onComplete && !onChunk) {\n await awaitAllColumns(asyncGroups)\n return\n }\n\n // assemble struct columns\n const schemaTree = parquetSchema(options.metadata)\n const assembled = asyncGroups.map(arg => assembleAsync(arg, schemaTree, options.parsers))\n\n // onChunk emit all chunks (don't await). Rejection is surfaced by awaitAllColumns below.\n if (onChunk) {\n for (const asyncGroup of assembled) {\n for (const asyncColumn of asyncGroup.asyncColumns) {\n asyncColumn.data.then(({ data, skipped }) => {\n let rowStart = asyncGroup.groupStart + skipped\n for (const columnData of data) {\n onChunk({\n columnName: asyncColumn.pathInSchema[0],\n columnData,\n rowStart,\n rowEnd: rowStart + columnData.length,\n })\n rowStart += columnData.length\n }\n }, () => {})\n }\n }\n }\n\n // onComplete transpose column chunks to rows\n if (onComplete) {\n // wait for all reads to settle so a sibling rejection cannot leak\n await awaitAllColumns(assembled)\n // loosen the types to avoid duplicate code\n /** @type {any[]} */\n const rows = []\n for (const asyncGroup of assembled) {\n // filter to rows in range (the plan may have narrowed the selection to\n // a sub-range of the group via page index pushdown)\n const selectStart = asyncGroup.selectStart ?? Math.max(rowStart - asyncGroup.groupStart, 0)\n const selectEnd = asyncGroup.selectEnd ?? Math.min((rowEnd ?? Infinity) - asyncGroup.groupStart, asyncGroup.groupRows)\n // transpose column chunks to rows in output\n const groupData = rowFormat === 'object' ?\n await asyncGroupToRows(asyncGroup, selectStart, selectEnd, readColumns, 'object') :\n await asyncGroupToRows(asyncGroup, selectStart, selectEnd, columns, 'array')\n\n // Apply filter and projection\n if (filter) {\n // eslint-disable-next-line no-extra-parens\n for (const row of /** @type {Record<string, any>[]} */ (groupData)) {\n if (matchFilter(row, filter, filterStrict)) {\n if (requiresProjection && columns) {\n for (const col of filterColumns) {\n if (!columns.includes(col)) delete row[col]\n }\n }\n rows.push(row)\n }\n }\n } else {\n concat(rows, groupData)\n }\n }\n onComplete(rows)\n } else {\n // wait for all async groups to finish (complete takes care of this)\n await awaitAllColumns(assembled)\n }\n}\n\n/**\n * Await every column promise across the given row groups via Promise.allSettled\n * so no rejection escapes as an unhandledRejection. Throws the first rejection.\n *\n * @param {AsyncRowGroup[]} asyncGroups\n * @returns {Promise<void>}\n */\nasync function awaitAllColumns(asyncGroups) {\n const all = asyncGroups.flatMap(g => g.asyncColumns.map(c => c.data))\n const results = await Promise.allSettled(all)\n const failed = results.find(r => r.status === 'rejected')\n if (failed) throw failed.reason\n}\n\n/**\n * @param {ParquetReadOptions} options read options\n * @returns {AsyncRowGroup[]}\n */\nexport function parquetReadAsync(options) {\n if (!options.metadata) throw new Error('parquet requires metadata')\n // TODO: validate options (start, end, columns, etc)\n\n // prefetch byte ranges\n const plan = parquetPlan(options)\n options.file = prefetchAsyncBuffer(options.file, plan)\n\n // read row groups\n return plan.groups.map(groupPlan => readRowGroup(options, plan, groupPlan))\n}\n\n/**\n * Reads a single column from a parquet file.\n *\n * @param {BaseParquetReadOptions} options\n * @returns {Promise<DecodedArray>}\n */\nexport async function parquetReadColumn(options) {\n if (options.columns?.length !== 1) {\n throw new Error('parquetReadColumn expected columns: [columnName]')\n }\n options.metadata ??= await parquetMetadataAsync(options.file, options)\n const asyncGroups = parquetReadAsync(await withBloomFilters(options))\n\n // assemble struct columns\n const schemaTree = parquetSchema(options.metadata)\n const assembled = asyncGroups.map(arg => assembleAsync(arg, schemaTree, options.parsers))\n\n // wait for all reads to settle so a sibling rejection cannot leak\n await awaitAllColumns(assembled)\n\n /** @type {DecodedArray} */\n const columnData = []\n for (const rg of assembled) {\n const { data } = await rg.asyncColumns[0].data\n for (const chunk of data) {\n concat(columnData, chunk)\n }\n }\n return columnData\n}\n\n/**\n * Conditionally fetch bloom filters and attach them (and the per-column schema\n * elements they require) to options so parquetPlan can use them for row-group\n * pruning. Returns options unchanged when there's no filter or the user has\n * disabled bloom pushdown.\n *\n * @param {BaseParquetReadOptions} options\n * @returns {Promise<BaseParquetReadOptions>}\n */\nasync function withBloomFilters(options) {\n if (!options.useBloomFilters) return options\n if (!options.filter || !options.metadata) return options\n const schemaTree = parquetSchema(options.metadata)\n /** @type {Record<string, SchemaElement>} */\n const schemaElements = {}\n for (const child of schemaTree.children) schemaElements[child.element.name] = child.element\n const bloomFiltersByGroup = await prefetchBloomFilters({\n file: options.file,\n metadata: options.metadata,\n filter: options.filter,\n filterStrict: options.filterStrict,\n })\n // eslint-disable-next-line no-extra-parens\n return /** @type {BaseParquetReadOptions} */ ({ ...options, bloomFiltersByGroup, schemaElements })\n}\n\n/**\n * Conditionally fetch page indexes (column index + offset index) for filter\n * columns and attach per-group candidate row ranges and page locations to\n * options so parquetPlan can skip pages that cannot match the filter.\n * Returns options unchanged when there's no filter or the user has not\n * enabled page index pushdown.\n *\n * @param {BaseParquetReadOptions} options\n * @returns {Promise<BaseParquetReadOptions>}\n */\nasync function withPageIndexes(options) {\n if (!options.usePageIndex) return options\n if (!options.filter || !options.metadata) return options\n const { pageRangesByGroup, pageLocationsByGroup } = await prefetchPageIndexes({\n file: options.file,\n metadata: options.metadata,\n filter: options.filter,\n filterStrict: options.filterStrict,\n rowStart: options.rowStart,\n rowEnd: options.rowEnd,\n columns: options.columns,\n // @ts-expect-error bloomFiltersByGroup/schemaElements are attached by withBloomFilters\n bloomFiltersByGroup: options.bloomFiltersByGroup,\n // @ts-expect-error bloomFiltersByGroup/schemaElements are attached by withBloomFilters\n schemaElements: options.schemaElements,\n parsers: options.parsers,\n })\n const readOptions = { ...options, pageRangesByGroup, pageLocationsByGroup }\n return readOptions\n}\n\n/**\n * This is a helper function to read parquet row data as a promise.\n * It is a wrapper around the more configurable parquetRead function.\n *\n * @param {Omit<ParquetReadOptions, 'onComplete'>} options\n * @returns {Promise<Record<string, any>[]>} resolves when all requested rows and columns are parsed\n */\nexport function parquetReadObjects(options) {\n return new Promise((onComplete, reject) => {\n parquetRead({\n ...options,\n rowFormat: 'object', // force object output\n onComplete,\n }).catch(reject)\n })\n}\n",
|
|
182
|
-
"import { sha256Canonical } from \"../market-data-archive/capture-contract\";\nimport type {\n\tBackfillArchiveRow,\n\tMarketDataVendorBackfillRequest,\n} from \"./contracts\";\n\nconst LOGICAL_KEYS = {\n\t\"market_data.cex_order_book_levels\": [\n\t\t\"capture_bundle_id\",\n\t\t\"exchange\",\n\t\t\"trading_pair\",\n\t\t\"raw_capture_id\",\n\t\t\"snapshot_id\",\n\t\t\"schema_version\",\n\t\t\"side\",\n\t\t\"level_index\",\n\t],\n\t\"market_data.cex_order_book_depth_summary\": [\n\t\t\"capture_bundle_id\",\n\t\t\"exchange\",\n\t\t\"trading_pair\",\n\t\t\"raw_capture_id\",\n\t\t\"snapshot_id\",\n\t\t\"schema_version\",\n\t],\n} as const;\n\nfunction logicalIdentity(row: BackfillArchiveRow): {\n\tkey: string;\n\tchecksum: string;\n} {\n\tif (\n\t\trow.table !== \"market_data.cex_order_book_levels\" &&\n\t\trow.table !== \"market_data.cex_order_book_depth_summary\"\n\t) {\n\t\tthrow new Error(\n\t\t\t\"archive evidence rows are not candidate semantic evidence\",\n\t\t);\n\t}\n\tconst keys = LOGICAL_KEYS[row.table];\n\tconst checksum = row.row.normalized_row_checksum;\n\tif (typeof checksum !== \"string\" || !/^[a-f0-9]{64}$/.test(checksum)) {\n\t\tthrow new Error(\"candidate normalized checksum is invalid\");\n\t}\n\tconst values = keys.map((key) => row.row[key]);\n\tif (\n\t\tvalues.some(\n\t\t\t(value) =>\n\t\t\t\ttypeof value !== \"string\" &&\n\t\t\t\ttypeof value !== \"number\" &&\n\t\t\t\tvalue !== null,\n\t\t)\n\t) {\n\t\tthrow new Error(\"candidate logical identity is incomplete\");\n\t}\n\treturn {\n\t\tkey: `${row.table}\\u0000${JSON.stringify(values)}`,\n\t\tchecksum,\n\t};\n}\n\nexport function semanticDigest(rows: readonly BackfillArchiveRow[]): string {\n\tconst identities = rows\n\t\t.map(logicalIdentity)\n\t\t.sort((left, right) =>\n\t\t\tleft.key === right.key\n\t\t\t\t? left.checksum.localeCompare(right.checksum)\n\t\t\t\t: left.key.localeCompare(right.key),\n\t\t);\n\treturn sha256Canonical(identities);\n}\n\nfunction exactCandidateMatch(\n\texpected: readonly BackfillArchiveRow[],\n\tactual: readonly BackfillArchiveRow[],\n): boolean {\n\tif (expected.length !== actual.length) return false;\n\tconst expectedIdentities = expected\n\t\t.map(logicalIdentity)\n\t\t.map(({ key, checksum }) => `${key}\\u0000${checksum}`)\n\t\t.sort();\n\tconst actualIdentities = actual\n\t\t.map(logicalIdentity)\n\t\t.map(({ key, checksum }) => `${key}\\u0000${checksum}`)\n\t\t.sort();\n\treturn expectedIdentities.every(\n\t\t(identity, index) => identity === actualIdentities[index],\n\t);\n}\n\nfunction requestedShapeMatches(\n\trequest: MarketDataVendorBackfillRequest,\n\trows: readonly BackfillArchiveRow[],\n): boolean {\n\treturn rows.every(\n\t\t({ row }) =>\n\t\t\trow.depth_limit === request.depth &&\n\t\t\trow.construction_mode === request.constructionMode &&\n\t\t\trow.schema_version === request.expectedProduct.canonicalSchemaVersion,\n\t);\n}\n\nfunction requiredClockCoverage(\n\trequest: MarketDataVendorBackfillRequest,\n\trows: readonly BackfillArchiveRow[],\n\tcoverageSourceTimesMs?: readonly number[],\n): boolean {\n\tconst summaryTimes = (\n\t\tcoverageSourceTimesMs ??\n\t\trows\n\t\t\t.filter(\n\t\t\t\t({ table }) => table === \"market_data.cex_order_book_depth_summary\",\n\t\t\t)\n\t\t\t.map(({ row }) => row.source_time_ms)\n\t)\n\t\t.map((value) => {\n\t\t\tif (\n\t\t\t\ttypeof value !== \"number\" &&\n\t\t\t\t(typeof value !== \"string\" || !/^\\d+$/.test(value))\n\t\t\t) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst parsed = Number(value);\n\t\t\treturn Number.isSafeInteger(parsed) && parsed >= 0 ? parsed : undefined;\n\t\t})\n\t\t.filter((value): value is number => value !== undefined)\n\t\t.sort((left, right) => left - right);\n\treturn request.requiredClockTargetsMs.every((target) => {\n\t\tlet prior: number | undefined;\n\t\tfor (const sourceTime of summaryTimes) {\n\t\t\tif (sourceTime > target) break;\n\t\t\tprior = sourceTime;\n\t\t}\n\t\treturn (\n\t\t\tprior !== undefined &&\n\t\t\ttarget - prior >= 0 &&\n\t\t\ttarget - prior <= request.maxPriorAsOfLagMs\n\t\t);\n\t});\n}\n\nexport type SemanticPromotionEvidence = {\n\trequest: MarketDataVendorBackfillRequest;\n\tnormalizedRows: readonly BackfillArchiveRow[];\n\tcandidateRows: readonly BackfillArchiveRow[];\n\tconflictCount: number;\n\tprefixDigestBefore: string;\n\tprefixDigestAfter: string;\n\tsuffixDigestBefore: string;\n\tsuffixDigestAfter: string;\n\tseamVerified: boolean;\n\texporterCompatible: boolean;\n\tcoverageSourceTimesMs?: readonly number[];\n};\n\nexport type SemanticPromotionResult = {\n\tpassed: boolean;\n\treasonCode: string;\n\tcanonicalSemanticDigest: string;\n\tprefixDigest: string;\n\tsuffixDigest: string;\n\tseamVerified: boolean;\n\tcoverageVerified: boolean;\n};\n\nexport function verifySemanticPromotion(\n\tevidence: SemanticPromotionEvidence,\n): SemanticPromotionResult {\n\tconst canonicalSemanticDigest = semanticDigest(evidence.candidateRows);\n\tconst base = {\n\t\tcanonicalSemanticDigest,\n\t\tprefixDigest: evidence.prefixDigestAfter,\n\t\tsuffixDigest: evidence.suffixDigestAfter,\n\t\tseamVerified: evidence.seamVerified,\n\t};\n\tif (!exactCandidateMatch(evidence.normalizedRows, evidence.candidateRows)) {\n\t\treturn {\n\t\t\t...base,\n\t\t\tpassed: false,\n\t\t\treasonCode: \"candidate_semantic_mismatch\",\n\t\t\tcoverageVerified: false,\n\t\t};\n\t}\n\tif (evidence.conflictCount !== 0) {\n\t\treturn {\n\t\t\t...base,\n\t\t\tpassed: false,\n\t\t\treasonCode: \"candidate_checksum_conflict\",\n\t\t\tcoverageVerified: false,\n\t\t};\n\t}\n\tif (\n\t\tevidence.prefixDigestBefore !== evidence.prefixDigestAfter ||\n\t\tevidence.suffixDigestBefore !== evidence.suffixDigestAfter\n\t) {\n\t\treturn {\n\t\t\t...base,\n\t\t\tpassed: false,\n\t\t\treasonCode: \"qualified_timeline_changed\",\n\t\t\tcoverageVerified: false,\n\t\t};\n\t}\n\tif (!evidence.seamVerified) {\n\t\treturn {\n\t\t\t...base,\n\t\t\tpassed: false,\n\t\t\treasonCode: \"timeline_seam_invalid\",\n\t\t\tcoverageVerified: false,\n\t\t};\n\t}\n\tif (!requestedShapeMatches(evidence.request, evidence.candidateRows)) {\n\t\treturn {\n\t\t\t...base,\n\t\t\tpassed: false,\n\t\t\treasonCode: \"candidate_shape_mismatch\",\n\t\t\tcoverageVerified: false,\n\t\t};\n\t}\n\tif (!evidence.exporterCompatible) {\n\t\treturn {\n\t\t\t...base,\n\t\t\tpassed: false,\n\t\t\treasonCode: \"canonical_export_incompatible\",\n\t\t\tcoverageVerified: false,\n\t\t};\n\t}\n\tconst coverageVerified = requiredClockCoverage(\n\t\tevidence.request,\n\t\tevidence.candidateRows,\n\t\tevidence.coverageSourceTimesMs,\n\t);\n\tif (!coverageVerified) {\n\t\treturn {\n\t\t\t...base,\n\t\t\tpassed: false,\n\t\t\treasonCode: \"required_clock_coverage_insufficient\",\n\t\t\tcoverageVerified: false,\n\t\t};\n\t}\n\treturn {\n\t\t...base,\n\t\tpassed: true,\n\t\treasonCode: \"semantic_promotion_verified\",\n\t\tcoverageVerified: true,\n\t};\n}\n",
|
|
183
|
-
"import { buildCanonicalOrderBookRows } from \"./market-data-archive/canonical-orderbook\";\nimport {\n\tCHECKSUM_ALGORITHM,\n\tMARKET_CAPTURE_SCHEMA_VERSION,\n\tsha256Canonical,\n} from \"./market-data-archive/capture-contract\";\nimport sourceTapeCapability from \"./market-data-preparation/policies/source-tape-capability-v1.json\" with {\n\ttype: \"json\",\n};\nimport depthSummaryProjection from \"./market-data-preparation/schemas/order-book-depth-summary-parquet-projection.schema.json\" with {\n\ttype: \"json\",\n};\nimport levelsProjection from \"./market-data-preparation/schemas/order-book-levels-parquet-projection.schema.json\" with {\n\ttype: \"json\",\n};\nimport {\n\tBACKFILL_MAX_BATCH_BYTES,\n\tBACKFILL_MAX_BATCH_ROWS,\n\tbuildForwarderBatches,\n} from \"./market-data-vendor-backfill/batching\";\nimport type {\n\tBackfillArchiveRow,\n\tForwarderBatch,\n\tProviderObjectEvidence,\n} from \"./market-data-vendor-backfill/contracts\";\nimport {\n\ttype PolicyNeutralCryptoHftBookState,\n\ttype PolicyNeutralTapeSink,\n\tSOURCE_TAPE_MAX_BATCH_BYTES as RECONSTRUCTOR_SOURCE_TAPE_MAX_BATCH_BYTES,\n\tSOURCE_TAPE_MAX_IN_FLIGHT as RECONSTRUCTOR_SOURCE_TAPE_MAX_IN_FLIGHT,\n\tSOURCE_TAPE_MAX_STATES_PER_YIELD as RECONSTRUCTOR_SOURCE_TAPE_MAX_STATES_PER_YIELD,\n} from \"./market-data-vendor-backfill/cryptohftdata\";\nimport {\n\tassertDocumentSha256,\n\tjcsCanonicalize,\n\tjcsSha256,\n} from \"./market-data-vendor-backfill/identity\";\nimport { semanticDigest } from \"./market-data-vendor-backfill/semantic-verification\";\n\nassertDocumentSha256(sourceTapeCapability, \"policy_sha256\");\n\nexport const SOURCE_TAPE_CAPABILITY = Object.freeze(sourceTapeCapability);\nexport const SOURCE_TAPE_CAPABILITY_ID = SOURCE_TAPE_CAPABILITY.policy_id;\nexport const SOURCE_TAPE_CONSTRUCTION_MODE =\n\t\"policy_neutral_top_n_state_change_tape/v1\" as const;\nexport const SOURCE_TAPE_DEPTH = 100 as const;\nexport const SOURCE_TAPE_MAX_STATES_PER_YIELD =\n\tRECONSTRUCTOR_SOURCE_TAPE_MAX_STATES_PER_YIELD;\nexport const SOURCE_TAPE_MAX_BATCH_ROWS = BACKFILL_MAX_BATCH_ROWS;\nexport const SOURCE_TAPE_MAX_BATCH_BYTES = BACKFILL_MAX_BATCH_BYTES;\nexport const SOURCE_TAPE_MAX_IN_FLIGHT =\n\tRECONSTRUCTOR_SOURCE_TAPE_MAX_IN_FLIGHT;\nif (RECONSTRUCTOR_SOURCE_TAPE_MAX_BATCH_BYTES !== BACKFILL_MAX_BATCH_BYTES) {\n\tthrow new Error(\"source tape and forwarder byte bounds differ\");\n}\nexport const SOURCE_TAPE_SANDBOX_TARGET = Object.freeze({\n\tenvironment: \"sandbox\",\n\tcluster: \"cex-archive-local\",\n});\nexport const SOURCE_TAPE_PROJECTION_PINS = Object.freeze([\n\tObject.freeze({\n\t\tschema_id: levelsProjection.$id,\n\t\tschema_sha256: jcsSha256(levelsProjection),\n\t}),\n\tObject.freeze({\n\t\tschema_id: depthSummaryProjection.$id,\n\t\tschema_sha256: jcsSha256(depthSummaryProjection),\n\t}),\n]);\n\nexport type SourceTapeProviderObjectInventory = {\n\texpected_identities: string[];\n\tobserved_identities: string[];\n\tcomplete: boolean;\n};\n\nexport function sourceTapeCaptureBundleId(input: {\n\tidempotencyKey: string;\n\ttradingPair: \"ARB-USDC\" | \"ARB-USDT\";\n\twindow: { startTimeMs: number; endTimeMs: number };\n\texpectedObjectIdentities: readonly string[];\n}): string {\n\tif (!/^[a-f0-9]{64}$/u.test(input.idempotencyKey)) {\n\t\tthrow new Error(\"source_tape_idempotency_key_invalid\");\n\t}\n\tconst identities = [...input.expectedObjectIdentities];\n\tif (\n\t\tidentities.length === 0 ||\n\t\tnew Set(identities).size !== identities.length ||\n\t\tJSON.stringify(identities) !== JSON.stringify([...identities].sort())\n\t) {\n\t\tthrow new Error(\"source_tape_expected_inventory_invalid\");\n\t}\n\treturn sha256Canonical({\n\t\tidentity: \"market-data-source-tape-capture-bundle/v1\",\n\t\tcapability_policy_sha256: SOURCE_TAPE_CAPABILITY.policy_sha256,\n\t\tidempotency_key: input.idempotencyKey,\n\t\ttrading_pair: input.tradingPair,\n\t\twindow: input.window,\n\t\texpected_object_identities: identities,\n\t\tconstruction_mode: SOURCE_TAPE_CONSTRUCTION_MODE,\n\t\tdepth: SOURCE_TAPE_DEPTH,\n\t});\n}\n\n/**\n * `production` is the stable forwarder mutation-authorization class. It is not\n * an environment assertion: source-tape qualification remains sandbox-local.\n */\nexport function assertSourceTapeSandboxAuthorization(input: {\n\trequestAuthorizationId: string;\n\trequestTarget: { environment: string; cluster: string };\n\tpreflight: {\n\t\tauthorizationId: string;\n\t\tscope: \"production\";\n\t\tenvironment: string;\n\t\tcluster: string;\n\t\tcredentialValidated: boolean;\n\t};\n}): void {\n\tif (\n\t\tinput.requestTarget.environment !==\n\t\t\tSOURCE_TAPE_SANDBOX_TARGET.environment ||\n\t\tinput.requestTarget.cluster !== SOURCE_TAPE_SANDBOX_TARGET.cluster\n\t) {\n\t\tthrow new Error(\"source_tape_sandbox_target_mismatch\");\n\t}\n\tif (\n\t\tinput.preflight.authorizationId !== input.requestAuthorizationId ||\n\t\tinput.preflight.scope !== \"production\" ||\n\t\tinput.preflight.environment !== input.requestTarget.environment ||\n\t\tinput.preflight.cluster !== input.requestTarget.cluster ||\n\t\tinput.preflight.credentialValidated !== true\n\t) {\n\t\tthrow new Error(\"source_tape_authorization_mismatch\");\n\t}\n}\n\nexport type SourceTapeArchiveSinkResult = {\n\tcapture_bundle_id: string;\n\tstate_count: number;\n\tlevel_row_count: number;\n\tsummary_row_count: number;\n\tforwarder_batch_count: number;\n\tforwarder_batch_identity_sha256: string;\n\tinitializer: {\n\t\tcanonical_snapshot_id: string;\n\t\tsource_time_ms: number;\n\t\tsequence: string;\n\t\tsemantic_stream_position: 0;\n\t};\n\texpected_semantic_digest: string;\n\tfirst_state_descriptor_sha256: string;\n\tlast_state_descriptor_sha256: string;\n\tprovider_object_inventory_complete: true;\n\tmax_states_per_yield: typeof SOURCE_TAPE_MAX_STATES_PER_YIELD;\n\tmax_batch_rows: typeof SOURCE_TAPE_MAX_BATCH_ROWS;\n\tmax_batch_bytes: typeof SOURCE_TAPE_MAX_BATCH_BYTES;\n\tmax_in_flight_submissions: typeof SOURCE_TAPE_MAX_IN_FLIGHT;\n};\n\nexport type SourceTapeSemanticStateDescriptor = {\n\tstate_kind: \"initialization\" | \"change\";\n\tsemantic_stream_position: number;\n\tcanonical_snapshot_id: string;\n\tsource_time_ms: number;\n\tsequence: string;\n\tcanonical_rows_sha256: string;\n};\n\nconst SOURCE_TAPE_SEMANTIC_DIGEST_DOMAIN =\n\t\"market-data-source-tape-semantic-stream/v1\";\n\nexport class SourceTapeSemanticDigestAccumulator {\n\tprivate readonly hash: Hash;\n\tprivate count = 0;\n\n\tconstructor() {\n\t\tthis.hash = createHash(\"sha256\");\n\t\tthis.hash.update(`${SOURCE_TAPE_SEMANTIC_DIGEST_DOMAIN}\\n`);\n\t}\n\n\tappend(descriptor: SourceTapeSemanticStateDescriptor): void {\n\t\tif (descriptor.semantic_stream_position !== this.count) {\n\t\t\tthrow new Error(\"source_tape_semantic_position_invalid\");\n\t\t}\n\t\tthis.hash.update(`${jcsCanonicalize(descriptor)}\\n`);\n\t\tthis.count += 1;\n\t}\n\n\tdigest(): string {\n\t\treturn this.hash.digest(\"hex\");\n\t}\n}\n\nexport function sourceTapeSemanticStateDescriptor(input: {\n\tstateKind: \"initialization\" | \"change\";\n\tsemanticStreamPosition: number;\n\trows: readonly BackfillArchiveRow[];\n}): SourceTapeSemanticStateDescriptor {\n\tconst summary = input.rows.filter(\n\t\t({ table }) => table === \"market_data.cex_order_book_depth_summary\",\n\t);\n\tif (summary.length !== 1) {\n\t\tthrow new Error(\"source_tape_semantic_summary_invalid\");\n\t}\n\tconst row = summary[0]?.row;\n\tconst snapshotId = row?.snapshot_id;\n\tconst sourceTimeMs = Number(row?.source_time_ms);\n\tconst sequence = String(row?.sequence ?? \"\");\n\tif (\n\t\ttypeof snapshotId !== \"string\" ||\n\t\t!/^[a-f0-9]{64}$/u.test(snapshotId) ||\n\t\t!Number.isSafeInteger(sourceTimeMs) ||\n\t\tsourceTimeMs < 0 ||\n\t\t!/^\\d+$/u.test(sequence)\n\t) {\n\t\tthrow new Error(\"source_tape_semantic_summary_invalid\");\n\t}\n\treturn {\n\t\tstate_kind: input.stateKind,\n\t\tsemantic_stream_position: input.semanticStreamPosition,\n\t\tcanonical_snapshot_id: snapshotId,\n\t\tsource_time_ms: sourceTimeMs,\n\t\tsequence,\n\t\tcanonical_rows_sha256: semanticDigest(input.rows),\n\t};\n}\n\nexport type SourceTapeArchiveSink = PolicyNeutralTapeSink & {\n\tresult(): SourceTapeArchiveSinkResult;\n};\n\n/**\n * Streams canonical tape rows to the existing archive-forwarder admission\n * tables. Promotion, selection and exporter-v2 finalization remain later\n * gates; this sink never creates a receipt or a success manifest by itself.\n */\nexport function createSourceTapeArchiveSink(input: {\n\tcaptureBundleId: string;\n\ttradingPair: \"ARB-USDC\" | \"ARB-USDT\";\n\twindow: { startTimeMs: number; endTimeMs: number };\n\tforwarder: {\n\t\tsubmit(batch: ForwarderBatch): Promise<{ ok: boolean; inserted: number }>;\n\t};\n}): SourceTapeArchiveSink {\n\tif (!/^[a-f0-9]{64}$/u.test(input.captureBundleId)) {\n\t\tthrow new Error(\"source_tape_capture_bundle_invalid\");\n\t}\n\tif (\n\t\t!Number.isSafeInteger(input.window.startTimeMs) ||\n\t\t!Number.isSafeInteger(input.window.endTimeMs) ||\n\t\tinput.window.endTimeMs <= input.window.startTimeMs\n\t) {\n\t\tthrow new Error(\"source_tape_window_invalid\");\n\t}\n\tlet stateCount = 0;\n\tlet initializationCount = 0;\n\tlet levelRowCount = 0;\n\tlet summaryRowCount = 0;\n\tlet lastSourceTimeMs = Number.NEGATIVE_INFINITY;\n\tlet completed = false;\n\tlet aborted = false;\n\tlet initializer: SourceTapeArchiveSinkResult[\"initializer\"] | undefined;\n\tconst batchIds: string[] = [];\n\tconst semanticDigestAccumulator = new SourceTapeSemanticDigestAccumulator();\n\tlet firstStateDescriptorSha256: string | undefined;\n\tlet lastStateDescriptorSha256: string | undefined;\n\tlet resultValue: SourceTapeArchiveSinkResult | undefined;\n\n\treturn {\n\t\tasync writeBatch(states) {\n\t\t\tif (completed || aborted) {\n\t\t\t\tthrow new Error(\"source_tape_sink_closed\");\n\t\t\t}\n\t\t\tif (\n\t\t\t\tstates.length === 0 ||\n\t\t\t\tstates.length > SOURCE_TAPE_MAX_STATES_PER_YIELD\n\t\t\t) {\n\t\t\t\tthrow new Error(\"source_tape_state_batch_invalid\");\n\t\t\t}\n\t\t\tfor (const state of states) {\n\t\t\t\tif (state.sourceTimeMs < lastSourceTimeMs) {\n\t\t\t\t\tthrow new Error(\"source_tape_state_order_invalid\");\n\t\t\t\t}\n\t\t\t\tif (state.sourceTimeMs >= input.window.endTimeMs) {\n\t\t\t\t\tthrow new Error(\"source_tape_end_boundary_invalid\");\n\t\t\t\t}\n\t\t\t\tif (state.tapeState === \"initialization\") {\n\t\t\t\t\tinitializationCount += 1;\n\t\t\t\t\tif (stateCount !== 0 || initializationCount !== 1) {\n\t\t\t\t\t\tthrow new Error(\"source_tape_initialization_invalid\");\n\t\t\t\t\t}\n\t\t\t\t} else if (\n\t\t\t\t\tinitializationCount !== 1 ||\n\t\t\t\t\tstate.sourceTimeMs < input.window.startTimeMs\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(\"source_tape_change_boundary_invalid\");\n\t\t\t\t}\n\t\t\t\tlastSourceTimeMs = state.sourceTimeMs;\n\t\t\t\tstateCount += 1;\n\t\t\t}\n\t\t\tconst rows = normalizeSourceTapeStates({\n\t\t\t\ttape: states,\n\t\t\t\tcapture_bundle_id: input.captureBundleId,\n\t\t\t\ttrading_pair: input.tradingPair,\n\t\t\t});\n\t\t\tfor (const state of states) {\n\t\t\t\tconst stateRows = rows.filter(\n\t\t\t\t\t({ row }) =>\n\t\t\t\t\t\tNumber(row.source_time_ms) === state.sourceTimeMs &&\n\t\t\t\t\t\tString(row.sequence) === state.sequence,\n\t\t\t\t);\n\t\t\t\tconst descriptor = sourceTapeSemanticStateDescriptor({\n\t\t\t\t\tstateKind: state.tapeState,\n\t\t\t\t\tsemanticStreamPosition:\n\t\t\t\t\t\tstateCount - states.length + states.indexOf(state),\n\t\t\t\t\trows: stateRows,\n\t\t\t\t});\n\t\t\t\tsemanticDigestAccumulator.append(descriptor);\n\t\t\t\tconst descriptorSha256 = jcsSha256(descriptor);\n\t\t\t\tfirstStateDescriptorSha256 ??= descriptorSha256;\n\t\t\t\tlastStateDescriptorSha256 = descriptorSha256;\n\t\t\t\tif (state.tapeState === \"initialization\") {\n\t\t\t\t\tinitializer = {\n\t\t\t\t\t\tcanonical_snapshot_id: descriptor.canonical_snapshot_id,\n\t\t\t\t\t\tsource_time_ms: descriptor.source_time_ms,\n\t\t\t\t\t\tsequence: descriptor.sequence,\n\t\t\t\t\t\tsemantic_stream_position: 0,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const row of rows) {\n\t\t\t\tif (row.table === \"market_data.cex_order_book_levels\") {\n\t\t\t\t\tlevelRowCount += 1;\n\t\t\t\t} else if (row.table === \"market_data.cex_order_book_depth_summary\") {\n\t\t\t\t\tsummaryRowCount += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst batches = buildForwarderBatches({\n\t\t\t\tcaptureBundleId: input.captureBundleId,\n\t\t\t\tdeploymentId: \"cex-okx-source-tape\",\n\t\t\t\trows,\n\t\t\t\tmaxRows: SOURCE_TAPE_MAX_BATCH_ROWS,\n\t\t\t\tmaxBytes: SOURCE_TAPE_MAX_BATCH_BYTES,\n\t\t\t});\n\t\t\tfor (const batch of batches) {\n\t\t\t\tconst response = await input.forwarder.submit(batch);\n\t\t\t\tif (!response.ok || response.inserted !== batch.rows.length) {\n\t\t\t\t\tthrow new Error(\"source_tape_forwarder_rejected\");\n\t\t\t\t}\n\t\t\t\tbatchIds.push(batch.batch_id);\n\t\t\t}\n\t\t},\n\t\tasync complete(completion) {\n\t\t\tif (\n\t\t\t\tcompleted ||\n\t\t\t\taborted ||\n\t\t\t\tinitializationCount !== 1 ||\n\t\t\t\t!initializer ||\n\t\t\t\t!firstStateDescriptorSha256 ||\n\t\t\t\t!lastStateDescriptorSha256\n\t\t\t) {\n\t\t\t\tthrow new Error(\"source_tape_completion_invalid\");\n\t\t\t}\n\t\t\tif (completion.stateCount !== stateCount) {\n\t\t\t\tthrow new Error(\"source_tape_state_count_mismatch\");\n\t\t\t}\n\t\t\tconst inventory = {\n\t\t\t\texpected_identities: [...completion.expectedObjectIdentities],\n\t\t\t\tobserved_identities: completion.observedObjects.map(\n\t\t\t\t\t({ identity }: ProviderObjectEvidence) => identity,\n\t\t\t\t),\n\t\t\t\tcomplete: true,\n\t\t\t};\n\t\t\tif (!providerObjectInventoryIsComplete(inventory)) {\n\t\t\t\tthrow new Error(\"source_tape_inventory_incomplete\");\n\t\t\t}\n\t\t\tcompleted = true;\n\t\t\tresultValue = {\n\t\t\t\tcapture_bundle_id: input.captureBundleId,\n\t\t\t\tstate_count: stateCount,\n\t\t\t\tlevel_row_count: levelRowCount,\n\t\t\t\tsummary_row_count: summaryRowCount,\n\t\t\t\tforwarder_batch_count: batchIds.length,\n\t\t\t\tforwarder_batch_identity_sha256: sha256Canonical(batchIds),\n\t\t\t\tinitializer,\n\t\t\t\texpected_semantic_digest: semanticDigestAccumulator.digest(),\n\t\t\t\tfirst_state_descriptor_sha256: firstStateDescriptorSha256,\n\t\t\t\tlast_state_descriptor_sha256: lastStateDescriptorSha256,\n\t\t\t\tprovider_object_inventory_complete: true,\n\t\t\t\tmax_states_per_yield: SOURCE_TAPE_MAX_STATES_PER_YIELD,\n\t\t\t\tmax_batch_rows: SOURCE_TAPE_MAX_BATCH_ROWS,\n\t\t\t\tmax_batch_bytes: SOURCE_TAPE_MAX_BATCH_BYTES,\n\t\t\t\tmax_in_flight_submissions: SOURCE_TAPE_MAX_IN_FLIGHT,\n\t\t\t};\n\t\t},\n\t\tasync abort() {\n\t\t\taborted = true;\n\t\t\tresultValue = undefined;\n\t\t},\n\t\tresult() {\n\t\t\tif (!completed || !resultValue || aborted) {\n\t\t\t\tthrow new Error(\"source_tape_result_unavailable\");\n\t\t\t}\n\t\t\treturn resultValue;\n\t\t},\n\t};\n}\n\nexport function providerObjectInventoryIsComplete(\n\tinventory: SourceTapeProviderObjectInventory,\n): boolean {\n\tconst expected = [...inventory.expected_identities].sort();\n\tconst observed = [...inventory.observed_identities].sort();\n\treturn (\n\t\tinventory.complete &&\n\t\tnew Set(expected).size === expected.length &&\n\t\tnew Set(observed).size === observed.length &&\n\t\tJSON.stringify(expected) === JSON.stringify(observed)\n\t);\n}\n\nexport function evaluateSourceTapeEligibility(input: {\n\tsource_enumeration_eligible: boolean;\n\tprovider_object_inventory: SourceTapeProviderObjectInventory;\n\ttape_complete: boolean;\n\tcapability_id: string;\n\tcapability_sha256: string;\n\tconstruction_mode: string;\n\tprojection_schema_pins: readonly {\n\t\tschema_id: string;\n\t\tschema_sha256: string;\n\t}[];\n\tartifact_sha256s: readonly string[];\n\ttape_manifest_sha256: string;\n}): boolean {\n\tconst expectedProjectionPins = [...SOURCE_TAPE_PROJECTION_PINS]\n\t\t.map(({ schema_id, schema_sha256 }) => `${schema_id}:${schema_sha256}`)\n\t\t.sort();\n\tconst actualProjectionPins = input.projection_schema_pins\n\t\t.map(({ schema_id, schema_sha256 }) => `${schema_id}:${schema_sha256}`)\n\t\t.sort();\n\treturn (\n\t\tinput.source_enumeration_eligible &&\n\t\tproviderObjectInventoryIsComplete(input.provider_object_inventory) &&\n\t\tinput.tape_complete &&\n\t\tinput.capability_id === SOURCE_TAPE_CAPABILITY_ID &&\n\t\tinput.capability_sha256 === SOURCE_TAPE_CAPABILITY.policy_sha256 &&\n\t\tinput.construction_mode === SOURCE_TAPE_CONSTRUCTION_MODE &&\n\t\tJSON.stringify(actualProjectionPins) ===\n\t\t\tJSON.stringify(expectedProjectionPins) &&\n\t\tinput.artifact_sha256s.length === 2 &&\n\t\tnew Set(input.artifact_sha256s).size === 2 &&\n\t\tinput.artifact_sha256s.every((sha) => /^[a-f0-9]{64}$/u.test(sha)) &&\n\t\t/^[a-f0-9]{64}$/u.test(input.tape_manifest_sha256)\n\t);\n}\n\nexport function normalizeSourceTapeStates(input: {\n\ttape: readonly PolicyNeutralCryptoHftBookState[];\n\tcapture_bundle_id: string;\n\ttrading_pair: \"ARB-USDC\" | \"ARB-USDT\";\n}): BackfillArchiveRow[] {\n\tif (!/^[a-f0-9]{64}$/u.test(input.capture_bundle_id)) {\n\t\tthrow new Error(\"source tape capture bundle identity is invalid\");\n\t}\n\treturn input.tape.flatMap((state) => {\n\t\tconst rawCaptureId = sha256Canonical({\n\t\t\tcapability_policy_sha256: SOURCE_TAPE_CAPABILITY.policy_sha256,\n\t\t\tcapture_bundle_id: input.capture_bundle_id,\n\t\t\tdataset_object_identity: state.datasetObjectIdentity,\n\t\t\tdataset_object_checksum: state.datasetObjectChecksum,\n\t\t\tsource_time_ms: state.sourceTimeMs,\n\t\t\tsequence: state.sequence,\n\t\t\ttape_state: state.tapeState,\n\t\t});\n\t\tconst canonical = buildCanonicalOrderBookRows({\n\t\t\tcontext: {\n\t\t\t\tsource: \"external_backfill\",\n\t\t\t\tdeploymentId: \"cex-okx-source-tape\",\n\t\t\t\tcaptureBundleId: input.capture_bundle_id,\n\t\t\t\texchange: \"okx\",\n\t\t\t\tsymbol: input.trading_pair,\n\t\t\t\ttradingPair: input.trading_pair,\n\t\t\t\tsourceSymbol: input.trading_pair,\n\t\t\t\tassetType: \"spot\",\n\t\t\t\tfeed: \"ORDERBOOK\",\n\t\t\t\tprovider: \"cryptohftdata\",\n\t\t\t\tsourceMode: \"vendor_historical_backfill_v1\",\n\t\t\t\tschemaVersion: MARKET_CAPTURE_SCHEMA_VERSION,\n\t\t\t\tchecksumAlgorithm: CHECKSUM_ALGORITHM,\n\t\t\t\tprovenanceComplete: true,\n\t\t\t},\n\t\t\trawCapture: {\n\t\t\t\trawCaptureId,\n\t\t\t\trawCaptureScope: \"vendor_normalized_dataset_file\",\n\t\t\t\trawChecksum: state.datasetObjectChecksum,\n\t\t\t\tredactedPayload: {\n\t\t\t\t\tdataset_object_identity: state.datasetObjectIdentity,\n\t\t\t\t\tdataset_object_checksum: state.datasetObjectChecksum,\n\t\t\t\t},\n\t\t\t\teventTimeMs: state.sourceTimeMs,\n\t\t\t\treceivedTimeMs: state.receivedTimeMs,\n\t\t\t\tchecksumAlgorithm: CHECKSUM_ALGORITHM,\n\t\t\t},\n\t\t\tdepthLimit: SOURCE_TAPE_DEPTH,\n\t\t\tconstructionMode: SOURCE_TAPE_CONSTRUCTION_MODE,\n\t\t\tsnapshot: {\n\t\t\t\tbids: state.bids,\n\t\t\t\tasks: state.asks,\n\t\t\t\ttimestamp: state.sourceTimeMs,\n\t\t\t\treceivedTimestamp: state.receivedTimeMs,\n\t\t\t\texchange: \"okx\",\n\t\t\t\tsymbol: input.trading_pair,\n\t\t\t\tdepthLimit: SOURCE_TAPE_DEPTH,\n\t\t\t\tsequence: state.sequence,\n\t\t\t},\n\t\t});\n\t\treturn [...canonical.levels, canonical.summary].map((entry) => {\n\t\t\tif (\n\t\t\t\tentry.table !== \"market_data.cex_order_book_levels\" &&\n\t\t\t\tentry.table !== \"market_data.cex_order_book_depth_summary\"\n\t\t\t) {\n\t\t\t\tthrow new Error(\"source tape archive table is invalid\");\n\t\t\t}\n\t\t\treturn { table: entry.table, row: entry.row };\n\t\t});\n\t});\n}\n\nimport { createHash, type Hash } from \"node:crypto\";\n",
|
|
184
|
-
"import { sha256Canonical } from \"../market-data-archive/capture-contract\";\nimport {\n\tSOURCE_TAPE_CAPABILITY,\n\tSOURCE_TAPE_CONSTRUCTION_MODE,\n} from \"../source-tape\";\nimport {\n\ttype BackfillArchiveRow,\n\ttype PromotionReceipt,\n\ttype PromotionReceiptWire,\n\tpromotionIdentitySha256,\n\tpromotionReceiptCodec,\n\tpromotionReceiptSchema,\n} from \"./contracts\";\nimport { documentSha256, jcsCanonicalize } from \"./identity\";\nimport {\n\tCAPABILITY_POLICY,\n\tEFFECTIVE_ACQUISITION_POLICY_PIN,\n\tEFFECTIVE_ADAPTER_POLICY_PIN,\n\tRESOURCE_POLICY,\n} from \"./manifests\";\n\nexport type StablePromotionReceipt = Omit<\n\tPromotionReceipt,\n\t\"receiptId\" | \"verificationTimeMs\"\n>;\n\nfunction samePolicyPin(\n\tleft: { policy_id: string; policy_sha256: string },\n\tright: { policy_id: string; policy_sha256: string },\n): boolean {\n\treturn (\n\t\tleft.policy_id === right.policy_id &&\n\t\tleft.policy_sha256 === right.policy_sha256\n\t);\n}\n\nexport function promotionReceiptMatchesCurrentPolicies(\n\treceipt: PromotionReceiptWire,\n): boolean {\n\tconst expectedCapability =\n\t\treceipt.construction_mode === SOURCE_TAPE_CONSTRUCTION_MODE\n\t\t\t? SOURCE_TAPE_CAPABILITY\n\t\t\t: CAPABILITY_POLICY;\n\treturn (\n\t\tsamePolicyPin(\n\t\t\treceipt.effective_policies.capability_policy,\n\t\t\texpectedCapability,\n\t\t) &&\n\t\tsamePolicyPin(\n\t\t\treceipt.effective_policies.resource_policy,\n\t\t\tRESOURCE_POLICY,\n\t\t) &&\n\t\tsamePolicyPin(\n\t\t\treceipt.effective_policies.adapter_policy,\n\t\t\tEFFECTIVE_ADAPTER_POLICY_PIN,\n\t\t) &&\n\t\tsamePolicyPin(\n\t\t\treceipt.effective_policies.acquisition_policy,\n\t\t\tEFFECTIVE_ACQUISITION_POLICY_PIN,\n\t\t)\n\t);\n}\n\nexport function promotionReceiptId(receipt: StablePromotionReceipt): string {\n\treturn sha256Canonical(receipt);\n}\n\nfunction finalizeLegacyPromotionReceipt(\n\tstable: StablePromotionReceipt,\n\tverificationTimeMs: number,\n): PromotionReceipt {\n\treturn promotionReceiptSchema.parse({\n\t\t...stable,\n\t\treceiptId: promotionReceiptId(stable),\n\t\tverificationTimeMs,\n\t});\n}\n\ntype UnfinalizedPromotionReceiptWire = Omit<\n\tPromotionReceiptWire,\n\t\"receipt_id\" | \"promotion_identity_sha256\"\n> &\n\tPartial<\n\t\tPick<PromotionReceiptWire, \"receipt_id\" | \"promotion_identity_sha256\">\n\t>;\n\nexport function finalizePromotionReceipt(\n\treceipt: UnfinalizedPromotionReceiptWire,\n): PromotionReceiptWire;\nexport function finalizePromotionReceipt(\n\treceipt: StablePromotionReceipt,\n\tverificationTimeMs: number,\n): PromotionReceipt;\nexport function finalizePromotionReceipt(\n\treceipt: UnfinalizedPromotionReceiptWire | StablePromotionReceipt,\n\tverificationTimeMs?: number,\n): PromotionReceiptWire | PromotionReceipt {\n\tif (\"schema_id\" in receipt) {\n\t\tconst {\n\t\t\treceipt_id: _receiptId,\n\t\t\tpromotion_identity_sha256: _promotionIdentity,\n\t\t\t...semanticAndTimestamp\n\t\t} = receipt;\n\t\tconst promotion_identity_sha256 =\n\t\t\tpromotionIdentitySha256(semanticAndTimestamp);\n\t\tconst content = { ...semanticAndTimestamp, promotion_identity_sha256 };\n\t\treturn promotionReceiptCodec.decode({\n\t\t\t...content,\n\t\t\treceipt_id: documentSha256(content, \"receipt_id\"),\n\t\t});\n\t}\n\tif (verificationTimeMs === undefined) {\n\t\tthrow new TypeError(\"legacy promotion receipt requires verificationTimeMs\");\n\t}\n\treturn finalizeLegacyPromotionReceipt(receipt, verificationTimeMs);\n}\n\nexport function promotionReceiptToArchiveRow(\n\treceiptInput: PromotionReceipt | PromotionReceiptWire,\n): BackfillArchiveRow {\n\tif (\"schema_id\" in receiptInput) {\n\t\tconst receipt = promotionReceiptCodec.decode(receiptInput);\n\t\treturn {\n\t\t\ttable: \"market_data.cex_order_book_capture_promotions\",\n\t\t\trow: {\n\t\t\t\tsource: receipt.source,\n\t\t\t\tcapture_origin: receipt.capture_origin,\n\t\t\t\tsource_mode: receipt.source_mode,\n\t\t\t\tdeployment_id: \"market-data-vendor-backfill\",\n\t\t\t\treceipt_schema_version: receipt.schema_id,\n\t\t\t\treceipt_id: receipt.receipt_id,\n\t\t\t\tpromotion_identity_sha256: receipt.promotion_identity_sha256,\n\t\t\t\trequest_id: receipt.request_id,\n\t\t\t\tidempotency_key: receipt.idempotency_key,\n\t\t\t\tstatus: \"passing\",\n\t\t\t\tcapture_bundle_id: receipt.capture_bundle_id,\n\t\t\t\tprovider: receipt.provider,\n\t\t\t\tadapter_version: receipt.adapter_version,\n\t\t\t\texchange: receipt.scope.exchange,\n\t\t\t\ttrading_pair: receipt.scope.trading_pair,\n\t\t\t\tasset_type: receipt.scope.market_type,\n\t\t\t\tfeed: receipt.scope.feed,\n\t\t\t\twindow_start_ms: Date.parse(receipt.window.start_at),\n\t\t\t\twindow_end_ms: Date.parse(receipt.window.end_at),\n\t\t\t\tdepth_limit: receipt.depth,\n\t\t\t\tconstruction_mode: receipt.construction_mode,\n\t\t\t\tschema_version: \"1.0.0\",\n\t\t\t\tcanonical_schema_sha256: receipt.canonical_schema.schema_sha256,\n\t\t\t\tchecksum_algorithm: \"sha256-canonical-json-v1\",\n\t\t\t\tcoverage_policy_json: jcsCanonicalize(receipt.coverage_policy),\n\t\t\t\tselection_sha256: receipt.selection_sha256,\n\t\t\t\tcapability_policy_id:\n\t\t\t\t\treceipt.effective_policies.capability_policy.policy_id,\n\t\t\t\tcapability_policy_sha256:\n\t\t\t\t\treceipt.effective_policies.capability_policy.policy_sha256,\n\t\t\t\tresource_policy_id:\n\t\t\t\t\treceipt.effective_policies.resource_policy.policy_id,\n\t\t\t\tresource_policy_sha256:\n\t\t\t\t\treceipt.effective_policies.resource_policy.policy_sha256,\n\t\t\t\tadapter_policy_id: receipt.effective_policies.adapter_policy.policy_id,\n\t\t\t\tadapter_policy_sha256:\n\t\t\t\t\treceipt.effective_policies.adapter_policy.policy_sha256,\n\t\t\t\tacquisition_policy_id:\n\t\t\t\t\treceipt.effective_policies.acquisition_policy.policy_id,\n\t\t\t\tacquisition_policy_sha256:\n\t\t\t\t\treceipt.effective_policies.acquisition_policy.policy_sha256,\n\t\t\t\tvendor_semantic_digest: receipt.vendor_semantic_digest,\n\t\t\t\tcanonical_semantic_digest: receipt.canonical_semantic_digest,\n\t\t\t\tprefix_digest: receipt.prefix_digest,\n\t\t\t\tsuffix_digest: receipt.suffix_digest,\n\t\t\t\tseam_verified: 1,\n\t\t\t\tcoverage_verified: 1,\n\t\t\t\tdataset_objects_json: jcsCanonicalize(receipt.dataset_objects),\n\t\t\t\treceipt_json: jcsCanonicalize(receipt),\n\t\t\t\tverification_time_ms: Date.parse(receipt.verified_at),\n\t\t\t},\n\t\t};\n\t}\n\tconst receipt = promotionReceiptSchema.parse(receiptInput);\n\tif (\n\t\tpromotionReceiptId(\n\t\t\tObject.fromEntries(\n\t\t\t\tObject.entries(receipt).filter(\n\t\t\t\t\t([key]) => key !== \"receiptId\" && key !== \"verificationTimeMs\",\n\t\t\t\t),\n\t\t\t) as StablePromotionReceipt,\n\t\t) !== receipt.receiptId\n\t) {\n\t\tthrow new Error(\"promotion receipt identity mismatch\");\n\t}\n\treturn {\n\t\ttable: \"market_data.cex_order_book_capture_promotions\",\n\t\trow: {\n\t\t\tsource: receipt.source,\n\t\t\tdeployment_id: \"market-data-vendor-backfill\",\n\t\t\treceipt_schema_version: receipt.schemaVersion,\n\t\t\treceipt_id: receipt.receiptId,\n\t\t\trequest_id: receipt.requestId,\n\t\t\tidempotency_key: receipt.idempotencyKey,\n\t\t\tstatus: receipt.status,\n\t\t\tcapture_bundle_id: receipt.captureBundleId,\n\t\t\tprovider: receipt.provider,\n\t\t\tadapter_version: receipt.adapterVersion,\n\t\t\texchange: receipt.exchange,\n\t\t\ttrading_pair: receipt.tradingPair,\n\t\t\tasset_type: receipt.marketType,\n\t\t\tfeed: receipt.feed,\n\t\t\twindow_start_ms: receipt.startTimeMs,\n\t\t\twindow_end_ms: receipt.endTimeMs,\n\t\t\tdepth_limit: receipt.depth,\n\t\t\tconstruction_mode: receipt.constructionMode,\n\t\t\tschema_version: receipt.canonicalSchemaVersion,\n\t\t\tchecksum_algorithm: receipt.checksumAlgorithm,\n\t\t\tvendor_semantic_digest: receipt.vendorSemanticDigest,\n\t\t\tcanonical_semantic_digest: receipt.canonicalSemanticDigest,\n\t\t\tprefix_digest: receipt.prefixDigest,\n\t\t\tsuffix_digest: receipt.suffixDigest,\n\t\t\tseam_verified: 1,\n\t\t\tcoverage_verified: 1,\n\t\t\tdataset_objects_json: JSON.stringify(receipt.datasetObjects),\n\t\t\tverification_time_ms: receipt.verificationTimeMs,\n\t\t},\n\t};\n}\n\nexport function promotionReceiptFromArchiveRow(\n\trow: Record<string, unknown>,\n): PromotionReceipt | PromotionReceiptWire {\n\tif (typeof row.receipt_json === \"string\" && row.receipt_json.length > 0) {\n\t\tlet parsed: unknown;\n\t\ttry {\n\t\t\tparsed = JSON.parse(row.receipt_json);\n\t\t} catch {\n\t\t\tthrow new Error(\"promotion receipt_json is invalid\");\n\t\t}\n\t\tconst receipt = promotionReceiptCodec.decode(parsed);\n\t\tif (\n\t\t\treceipt.receipt_id !== row.receipt_id ||\n\t\t\treceipt.promotion_identity_sha256 !== row.promotion_identity_sha256\n\t\t) {\n\t\t\tthrow new Error(\"promotion receipt archive identity mismatch\");\n\t\t}\n\t\treturn receipt;\n\t}\n\tlet datasetObjects: unknown;\n\ttry {\n\t\tdatasetObjects = JSON.parse(String(row.dataset_objects_json));\n\t} catch {\n\t\tthrow new Error(\"promotion dataset_objects_json is invalid\");\n\t}\n\tconst receipt = promotionReceiptSchema.parse({\n\t\tschemaVersion: row.receipt_schema_version,\n\t\treceiptId: row.receipt_id,\n\t\trequestId: row.request_id,\n\t\tidempotencyKey: row.idempotency_key,\n\t\tstatus: row.status,\n\t\tsource: row.source,\n\t\tprovider: row.provider,\n\t\tadapterVersion: row.adapter_version,\n\t\tcaptureBundleId: row.capture_bundle_id,\n\t\texchange: row.exchange,\n\t\ttradingPair: row.trading_pair,\n\t\tmarketType: row.asset_type,\n\t\tfeed: row.feed,\n\t\tstartTimeMs: row.window_start_ms,\n\t\tendTimeMs: row.window_end_ms,\n\t\tdepth: row.depth_limit,\n\t\tconstructionMode: row.construction_mode,\n\t\tcanonicalSchemaVersion: row.schema_version,\n\t\tchecksumAlgorithm: row.checksum_algorithm,\n\t\tvendorSemanticDigest: row.vendor_semantic_digest,\n\t\tcanonicalSemanticDigest: row.canonical_semantic_digest,\n\t\tprefixDigest: row.prefix_digest,\n\t\tsuffixDigest: row.suffix_digest,\n\t\tseamVerified: row.seam_verified === 1,\n\t\tcoverageVerified: row.coverage_verified === 1,\n\t\tdatasetObjects,\n\t\tverificationTimeMs: row.verification_time_ms,\n\t});\n\tconst {\n\t\treceiptId,\n\t\tverificationTimeMs: _verificationTimeMs,\n\t\t...stable\n\t} = receipt;\n\tif (promotionReceiptId(stable) !== receiptId) {\n\t\tthrow new Error(\"promotion receipt identity mismatch\");\n\t}\n\treturn receipt;\n}\n",
|
|
185
|
-
"import {\n\tARCHIVE_SELECTION_SCHEMA_ID,\n\tBACKFILL_REQUEST_SCHEMA_ID,\n\tcreateBackfillIdempotencyKey,\n\tfinalizeArchiveSelection,\n\tfinalizeRequiredClock,\n\tPROMOTION_RECEIPT_SCHEMA_ID,\n\tREQUIRED_CLOCK_SCHEMA_ID,\n} from \"./contracts\";\nimport { jcsSha256 } from \"./identity\";\nimport {\n\tCAPABILITY_POLICY,\n\tEFFECTIVE_ACQUISITION_POLICY_PIN,\n\tEFFECTIVE_ADAPTER_POLICY_PIN,\n\tRESOURCE_POLICY,\n} from \"./manifests\";\nimport { finalizePromotionReceipt } from \"./promotion\";\n\nconst requestId = \"018f0f4d-7b32-7a30-8f4d-1d2a6e40f100\";\nconst attemptId = \"018f0f4d-7b32-7a30-8f4d-1d2a6e40f101\";\nconst clockId = \"018f0f4d-7b32-7a30-8f4d-1d2a6e40f102\";\nconst authorizationId = \"018f0f4d-7b32-7a30-8f4d-1d2a6e40f103\";\nconst qualificationEventId = \"018f0f4d-7b32-7a30-8f4d-1d2a6e40f104\";\nconst targetId = \"018f0f4d-7b32-7a30-8f4d-1d2a6e40f105\";\nconst captureBundleId = \"d\".repeat(64);\nconst scope = {\n\texchange: \"okx\",\n\ttrading_pair: \"ARB-USDT\",\n\tmarket_type: \"spot\" as const,\n\tfeed: \"ORDERBOOK\" as const,\n};\nconst window = {\n\tstart_at: \"2026-08-18T09:27:15.000Z\",\n\tend_at: \"2026-08-18T09:27:17.000Z\",\n};\nconst coveragePolicy = {\n\tpolicy_id: \"prior-asof-strict/v1\" as const,\n\tmax_asof_lag_ms: 5_000,\n\tfuture_rows: \"reject\" as const,\n\tmissing_required_event: \"fail\" as const,\n};\n\nconst requiredClock = finalizeRequiredClock({\n\tschema_id: REQUIRED_CLOCK_SCHEMA_ID,\n\tclock_id: clockId,\n\tcreated_at: \"2026-08-20T12:00:00.000Z\",\n\ttargets: [{ target_id: targetId, target_at: \"2026-08-18T09:27:16.000Z\" }],\n});\n\nconst initialSelection = finalizeArchiveSelection({\n\tschema_id: ARCHIVE_SELECTION_SCHEMA_ID,\n\tscope,\n\trequired_clock: {\n\t\tclock_id: requiredClock.clock_id,\n\t\tclock_sha256: requiredClock.clock_sha256,\n\t\tevent_count: requiredClock.targets.length,\n\t},\n\tcoverage_policy: coveragePolicy,\n\tsource_policy: \"authoritative_window\",\n\tcoverage_class: \"missing\",\n\trequested_intervals: [window],\n\tselected_intervals: [],\n\tprecedence: [\"vendor\"],\n\tbundles: [],\n\tsupport_anchors: [],\n\treceipt_ids: [],\n\tqualification_event_ids: [],\n\tresolved_at: \"2026-08-20T12:00:00.000Z\",\n});\n\nconst requestContent = {\n\tschema_id: BACKFILL_REQUEST_SCHEMA_ID,\n\trequest_id: requestId,\n\tattempt_id: attemptId,\n\tscope,\n\twindow,\n\tdepth: 20,\n\tconstruction_mode: \"sampled_top_n_snapshot\" as const,\n\tsource_policy: \"authoritative_window\" as const,\n\ttarget: { environment: \"production\", cluster: \"cex-archive-primary\" },\n\tcoverage_policy: coveragePolicy,\n\trequired_clock: {\n\t\tschema_id: REQUIRED_CLOCK_SCHEMA_ID,\n\t\tclock_id: requiredClock.clock_id,\n\t\tfile_name: \"required-clock.json\",\n\t\tclock_sha256: requiredClock.clock_sha256,\n\t\tevent_count: requiredClock.targets.length,\n\t},\n\tinitial_selection: initialSelection,\n\texpected_canonical_schema: {\n\t\tschema_id: \"cex-order-book-canonical/v1\",\n\t\tschema_sha256: \"a\".repeat(64),\n\t},\n\tproduct_pins: {\n\t\tcapability_policy: {\n\t\t\tpolicy_id: CAPABILITY_POLICY.policy_id,\n\t\t\tpolicy_sha256: CAPABILITY_POLICY.policy_sha256,\n\t\t},\n\t\tresource_policy: {\n\t\t\tpolicy_id: RESOURCE_POLICY.policy_id,\n\t\t\tpolicy_sha256: RESOURCE_POLICY.policy_sha256,\n\t\t},\n\t},\n\tproduction_authorization_id: authorizationId,\n};\n\nconst request = {\n\t...requestContent,\n\tidempotency_key: createBackfillIdempotencyKey(requestContent),\n};\n\nconst promotionReceipt = finalizePromotionReceipt({\n\tschema_id: PROMOTION_RECEIPT_SCHEMA_ID,\n\tverified_at: \"2026-08-20T12:00:02.000Z\",\n\trequest_id: request.request_id,\n\tidempotency_key: request.idempotency_key,\n\tsource: \"external_backfill\",\n\tcapture_origin: \"vendor_historical_backfill\",\n\tsource_mode: \"vendor_historical_backfill_v1\",\n\tprovider: \"cryptohftdata\",\n\tadapter_version: \"cryptohftdata-orderbook/v2\",\n\teffective_policies: {\n\t\tcapability_policy: request.product_pins.capability_policy,\n\t\tresource_policy: request.product_pins.resource_policy,\n\t\tadapter_policy: EFFECTIVE_ADAPTER_POLICY_PIN,\n\t\tacquisition_policy: EFFECTIVE_ACQUISITION_POLICY_PIN,\n\t},\n\tcapture_bundle_id: captureBundleId,\n\tscope,\n\twindow,\n\tdepth: request.depth,\n\tconstruction_mode: request.construction_mode,\n\tcanonical_schema: request.expected_canonical_schema,\n\tcoverage_policy: coveragePolicy,\n\tselection_sha256: initialSelection.selection_sha256,\n\tvendor_semantic_digest: \"e\".repeat(64),\n\tcanonical_semantic_digest: \"f\".repeat(64),\n\tprefix_digest: \"1\".repeat(64),\n\tsuffix_digest: \"2\".repeat(64),\n\tseam_verified: true,\n\tcoverage_verified: true,\n\tdataset_objects: [\n\t\t{\n\t\t\tidentity: \"okx/spot/orderbook/hour/arb-usdt/2026-08-18t09\",\n\t\t\tchecksum: \"3\".repeat(64),\n\t\t\tbytes: 1_000,\n\t\t\trows: 50,\n\t\t},\n\t],\n});\n\nconst resolvedSelection = finalizeArchiveSelection({\n\tschema_id: ARCHIVE_SELECTION_SCHEMA_ID,\n\tscope,\n\trequired_clock: initialSelection.required_clock,\n\tcoverage_policy: coveragePolicy,\n\tsource_policy: \"authoritative_window\",\n\tcoverage_class: \"complete\",\n\trequested_intervals: [window],\n\tselected_intervals: [\n\t\t{\n\t\t\t...window,\n\t\t\tcapture_bundle_id: captureBundleId,\n\t\t\tcapture_origin: \"vendor_historical_backfill\",\n\t\t},\n\t],\n\tprecedence: [\"vendor\"],\n\tbundles: [\n\t\t{\n\t\t\tcapture_bundle_id: captureBundleId,\n\t\t\tcapture_origin: \"vendor_historical_backfill\",\n\t\t\tinterval: window,\n\t\t\tqualification: {\n\t\t\t\tqualification_event_id: qualificationEventId,\n\t\t\t\tstate: \"qualified\",\n\t\t\t\treceipt_id: promotionReceipt.receipt_id,\n\t\t\t\tpromotion_identity_sha256: promotionReceipt.promotion_identity_sha256,\n\t\t\t},\n\t\t},\n\t],\n\tsupport_anchors: [\n\t\t{\n\t\t\tcapture_bundle_id: captureBundleId,\n\t\t\traw_capture_id: \"4\".repeat(64),\n\t\t\tsnapshot_id: \"5\".repeat(64),\n\t\t\tsource_time: \"2026-08-18T09:27:15.308Z\",\n\t\t\tnormalized_summary_checksum: \"6\".repeat(64),\n\t\t\tmetadata_ref: {\n\t\t\t\tcapture_origin: \"vendor_historical_backfill\",\n\t\t\t\tqualification_event_id: qualificationEventId,\n\t\t\t\treceipt_id: promotionReceipt.receipt_id,\n\t\t\t},\n\t\t},\n\t],\n\treceipt_ids: [promotionReceipt.receipt_id],\n\tqualification_event_ids: [qualificationEventId],\n\tresolved_at: \"2026-08-20T12:00:02.000Z\",\n});\n\nconst jcsEdgeVector = {\n\tliterals: [null, true, false],\n\tnumbers: [Number(\"333333333.33333329\"), 1e30, 4.5, 0.002],\n\tstring: '€$\\u000f\\nA\\'B\"\\\\\"/',\n};\n\nexport const CONFORMANCE_FIXTURES = Object.freeze({\n\tfixture_id: \"market-data-vendor-backfill-conformance/v2\",\n\tdocuments: {\n\t\trequired_clock: requiredClock,\n\t\tarchive_selection: resolvedSelection,\n\t\trequest,\n\t\tpromotion_receipt: promotionReceipt,\n\t},\n\tidentities: {\n\t\tidempotency_key: request.idempotency_key,\n\t\tclock_sha256: requiredClock.clock_sha256,\n\t\tinitial_selection_sha256: initialSelection.selection_sha256,\n\t\tselection_sha256: resolvedSelection.selection_sha256,\n\t\tpromotion_identity_sha256: promotionReceipt.promotion_identity_sha256,\n\t\treceipt_id: promotionReceipt.receipt_id,\n\t\tcapability_policy_sha256: CAPABILITY_POLICY.policy_sha256,\n\t\tresource_policy_sha256: RESOURCE_POLICY.policy_sha256,\n\t},\n\tjcs_edge_vector: jcsEdgeVector,\n\thashes: { jcs_edge_vector_sha256: jcsSha256(jcsEdgeVector) },\n});\n",
|
|
186
|
-
"import Ajv2020, {\n\ttype ErrorObject,\n\ttype ValidateFunction,\n} from \"ajv/dist/2020.js\";\nimport type {\n\tArchiveSelectionWire,\n\tBackfillOutcomeWire,\n\tFixedUtcTimestamp,\n\tLowercaseUuid,\n\tSha256Hex,\n} from \"../market-data-vendor-backfill/contracts\";\nimport {\n\tarchiveSelectionCodec,\n\tpromotionReceiptCodec,\n} from \"../market-data-vendor-backfill/contracts\";\nimport {\n\tassertDocumentSha256,\n\tdocumentSha256,\n\tjcsSha256,\n} from \"../market-data-vendor-backfill/identity\";\nimport {\n\tCAPABILITY_POLICY,\n\tRESOURCE_POLICY,\n} from \"../market-data-vendor-backfill/manifests\";\nimport { promotionReceiptMatchesCurrentPolicies } from \"../market-data-vendor-backfill/promotion\";\nimport archiveSelectionSchema from \"../market-data-vendor-backfill/schemas/archive-selection.schema.json\" with {\n\ttype: \"json\",\n};\nimport promotionReceiptSchema from \"../market-data-vendor-backfill/schemas/promotion-receipt.schema.json\" with {\n\ttype: \"json\",\n};\nimport requestSchema from \"../market-data-vendor-backfill/schemas/request.schema.json\" with {\n\ttype: \"json\",\n};\nimport requiredClockSchema from \"../market-data-vendor-backfill/schemas/required-clock.schema.json\" with {\n\ttype: \"json\",\n};\nimport { SOURCE_TAPE_CAPABILITY } from \"../source-tape\";\nimport backfillResultV2Schema from \"./schemas/backfill-result-v2.schema.json\" with {\n\ttype: \"json\",\n};\nimport exportRequestSchema from \"./schemas/canonical-orderbook-export-request.schema.json\" with {\n\ttype: \"json\",\n};\nimport exportResultSchema from \"./schemas/canonical-orderbook-export-result.schema.json\" with {\n\ttype: \"json\",\n};\nimport depthSummaryProjectionSchema from \"./schemas/order-book-depth-summary-parquet-projection.schema.json\" with {\n\ttype: \"json\",\n};\nimport levelsProjectionSchema from \"./schemas/order-book-levels-parquet-projection.schema.json\" with {\n\ttype: \"json\",\n};\nimport productPinSchema from \"./schemas/preparation-product-pin.schema.json\" with {\n\ttype: \"json\",\n};\nimport sourceForensicsLedgerSchema from \"./schemas/source-forensics-ledger.schema.json\" with {\n\ttype: \"json\",\n};\nimport sourceQualificationRecordSchema from \"./schemas/source-qualification-record.schema.json\" with {\n\ttype: \"json\",\n};\n\nexport const BACKFILL_RESULT_V2_SCHEMA_ID = backfillResultV2Schema.$id;\nexport const CANONICAL_ORDERBOOK_EXPORT_REQUEST_SCHEMA_ID =\n\texportRequestSchema.$id;\nexport const CANONICAL_ORDERBOOK_EXPORT_RESULT_SCHEMA_ID =\n\texportResultSchema.$id;\nexport const PREPARATION_PRODUCT_PIN_SCHEMA_ID = productPinSchema.$id;\nexport const ORDER_BOOK_LEVELS_PARQUET_PROJECTION_SCHEMA_ID =\n\tlevelsProjectionSchema.$id;\nexport const ORDER_BOOK_DEPTH_SUMMARY_PARQUET_PROJECTION_SCHEMA_ID =\n\tdepthSummaryProjectionSchema.$id;\nexport const SOURCE_FORENSICS_LEDGER_SCHEMA_ID =\n\tsourceForensicsLedgerSchema.$id;\nexport const SOURCE_QUALIFICATION_RECORD_SCHEMA_ID =\n\tsourceQualificationRecordSchema.$id;\nexport const PREPARATION_SCHEMA_MANIFEST_V3_ID =\n\t\"https://schemas.usher.so/market-data-vendor-backfill-schema-manifest/v3\" as const;\n\nexport type PreparationTarget = { environment: string; cluster: string };\n\nexport type PreparationProducerIdentity = {\n\tproduct_id: \"market-data-vendor-backfill\" | \"cex-canonical-orderbook-export\";\n\tproduct_version:\n\t\t| \"market-data-vendor-backfill/v1\"\n\t\t| \"cex-canonical-orderbook-export/v2\";\n\tpackage: {\n\t\tname: \"@usherlabs/cex-broker\";\n\t\tversion: string;\n\t\tgit_head: string;\n\t};\n\texecutable_sha256: Sha256Hex;\n\truntime: { name: \"node\"; version: string };\n};\n\nexport type BackfillJobResultV2Wire = {\n\tschema_id: typeof BACKFILL_RESULT_V2_SCHEMA_ID;\n\tresult_sha256: Sha256Hex;\n\tjob_id: LowercaseUuid;\n\trequest_file_sha256: Sha256Hex | null;\n\tschema_manifest_sha256: Sha256Hex;\n\tproducer: PreparationProducerIdentity & {\n\t\tproduct_id: \"market-data-vendor-backfill\";\n\t\tproduct_version: \"market-data-vendor-backfill/v1\";\n\t};\n\tcapability_policy: { policy_id: string; policy_sha256: Sha256Hex };\n\tresource_policy: { policy_id: string; policy_sha256: Sha256Hex };\n\tstarted_at: FixedUtcTimestamp;\n\tcompleted_at: FixedUtcTimestamp;\n\toutcome: BackfillOutcomeWire;\n};\n\nexport type CanonicalOrderBookExportRequestWire = {\n\tschema_id: typeof CANONICAL_ORDERBOOK_EXPORT_REQUEST_SCHEMA_ID;\n\trequest_id: LowercaseUuid;\n\ttarget: PreparationTarget;\n\tselection: ArchiveSelectionWire;\n\tdepth: number;\n\tconstruction_mode:\n\t\t| \"sampled_top_n_snapshot\"\n\t\t| \"exact_l2_reconstruction\"\n\t\t| \"policy_neutral_top_n_state_change_tape/v1\";\n\tcanonical_schema_version: string;\n\tchecksum_algorithm: \"sha256-canonical-json-v1\";\n};\n\nexport type CanonicalOrderBookExportQuerySegment =\n\tArchiveSelectionWire[\"selected_intervals\"][number];\n\nexport const CANONICAL_ORDERBOOK_EXPORT_STATUSES = [\n\t\"exported\",\n\t\"request_invalid\",\n\t\"archive_query_failed\",\n\t\"archive_data_invalid\",\n\t\"artifact_write_failed\",\n] as const;\n\nexport type CanonicalOrderBookExportStatus =\n\t(typeof CANONICAL_ORDERBOOK_EXPORT_STATUSES)[number];\n\nexport type CanonicalOrderBookExportArtifact = {\n\tfile_name: string;\n\trows: number;\n\tbytes: number;\n\tsha256: Sha256Hex;\n\tprojection_schema_id:\n\t\t| typeof ORDER_BOOK_LEVELS_PARQUET_PROJECTION_SCHEMA_ID\n\t\t| typeof ORDER_BOOK_DEPTH_SUMMARY_PARQUET_PROJECTION_SCHEMA_ID;\n\tprojection_schema_sha256: Sha256Hex;\n};\n\nexport type CanonicalOrderBookExportResultWire = {\n\tschema_id: typeof CANONICAL_ORDERBOOK_EXPORT_RESULT_SCHEMA_ID;\n\tresult_sha256: Sha256Hex;\n\tjob_id: LowercaseUuid;\n\trequest_file_sha256: Sha256Hex | null;\n\tproducer: PreparationProducerIdentity & {\n\t\tproduct_id: \"cex-canonical-orderbook-export\";\n\t\tproduct_version: \"cex-canonical-orderbook-export/v2\";\n\t};\n\tstarted_at: FixedUtcTimestamp;\n\tcompleted_at: FixedUtcTimestamp;\n\toutcome: {\n\t\tstatus: CanonicalOrderBookExportStatus;\n\t\treason_code: string;\n\t\treason_subcode: string | null;\n\t\trequest_id: LowercaseUuid | null;\n\t\ttarget: PreparationTarget | null;\n\t\tselection_sha256: Sha256Hex | null;\n\t\tquery_sha256: Sha256Hex | null;\n\t\tquery_segments: CanonicalOrderBookExportQuerySegment[];\n\t\tpromotion_receipt_ids: Sha256Hex[];\n\t\tartifacts: null | {\n\t\t\tlevels: CanonicalOrderBookExportArtifact;\n\t\t\tsummary: CanonicalOrderBookExportArtifact;\n\t\t};\n\t\tdiagnostics: Record<string, string | number | boolean>;\n\t};\n};\n\nexport type PreparationProductPinWire = {\n\tschema_id: typeof PREPARATION_PRODUCT_PIN_SCHEMA_ID;\n\tpackage: {\n\t\tname: \"@usherlabs/cex-broker\";\n\t\tversion: string;\n\t\tregistry_tarball_url: string;\n\t\tintegrity: string;\n\t\ttarball_sha256: Sha256Hex;\n\t\tnpm_git_head: string;\n\t};\n\texecutables: Array<{\n\t\tproduct_id: PreparationProducerIdentity[\"product_id\"];\n\t\tproduct_version: PreparationProducerIdentity[\"product_version\"];\n\t\trelative_path: string;\n\t\texecutable_sha256: Sha256Hex;\n\t}>;\n\tschema_manifest: {\n\t\tschema_id: typeof PREPARATION_SCHEMA_MANIFEST_V3_ID;\n\t\tmanifest_sha256: Sha256Hex;\n\t\trelative_path: \"dist/market-data-preparation/schema-manifest.json\";\n\t};\n\tschema_pins: Array<{ schema_id: string; schema_sha256: Sha256Hex }>;\n\tcapability_policy: { policy_id: string; policy_sha256: Sha256Hex };\n\tsource_tape_capability: {\n\t\tpolicy_id: string;\n\t\tpolicy_sha256: Sha256Hex;\n\t};\n\tresource_policy: { policy_id: string; policy_sha256: Sha256Hex };\n\tpreparation_library: {\n\t\texported_subpath: \"@usherlabs/cex-broker/market-data-preparation\";\n\t\truntime_entry_sha256: Sha256Hex;\n\t\tdeclaration_sha256: Sha256Hex;\n\t\toperations: [\n\t\t\t{\n\t\t\t\tsymbol: \"runMarketDataSourceTape\";\n\t\t\t\toperation_id: \"market-data-source-tape/v1\";\n\t\t\t},\n\t\t\t{\n\t\t\t\tsymbol: \"runMarketDataRequiredClockQualification\";\n\t\t\t\toperation_id: \"market-data-required-clock-qualification/v1\";\n\t\t\t},\n\t\t];\n\t};\n};\n\ntype Codec<T> = {\n\tdecode(value: unknown): T;\n\tis(value: unknown): value is T;\n};\n\nfunction describeAjvErrors(errors: ErrorObject[] | null | undefined): string {\n\treturn (errors ?? [])\n\t\t.map(\n\t\t\t(error) =>\n\t\t\t\t`${error.instancePath || \"/\"} ${error.message ?? \"is invalid\"}`,\n\t\t)\n\t\t.join(\"; \");\n}\n\nfunction codec<T>(\n\tvalidate: ValidateFunction,\n\tsemantic?: (document: T) => void,\n): Codec<T> {\n\treturn {\n\t\tdecode(value: unknown): T {\n\t\t\tif (!validate(value)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`JSON Schema validation failed: ${describeAjvErrors(validate.errors)}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tsemantic?.(value as T);\n\t\t\treturn value as T;\n\t\t},\n\t\tis(value: unknown): value is T {\n\t\t\tif (!validate(value)) return false;\n\t\t\ttry {\n\t\t\t\tsemantic?.(value as T);\n\t\t\t\treturn true;\n\t\t\t} catch {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t};\n}\n\nfunction fixedTimestampMs(value: string, field: string): number {\n\tconst parsed = Date.parse(value);\n\tif (\n\t\t!Number.isSafeInteger(parsed) ||\n\t\tnew Date(parsed).toISOString() !== value\n\t) {\n\t\tthrow new Error(`${field} is not a fixed UTC RFC3339 timestamp`);\n\t}\n\treturn parsed;\n}\n\nfunction assertResultTiming(input: {\n\tstarted_at: string;\n\tcompleted_at: string;\n}): void {\n\tif (\n\t\tfixedTimestampMs(input.completed_at, \"completed_at\") <\n\t\tfixedTimestampMs(input.started_at, \"started_at\")\n\t) {\n\t\tthrow new Error(\"completed_at precedes started_at\");\n\t}\n}\n\nconst ajv = new Ajv2020({ allErrors: true, strict: true });\najv.addSchema(archiveSelectionSchema);\najv.addSchema(promotionReceiptSchema);\n\nconst validateBackfillResultV2 = ajv.compile(backfillResultV2Schema);\nconst validateExportRequest = ajv.compile(exportRequestSchema);\nconst validateExportResult = ajv.compile(exportResultSchema);\nconst validateProductPin = ajv.compile(productPinSchema);\n\nexport const backfillResultV2Codec = codec<BackfillJobResultV2Wire>(\n\tvalidateBackfillResultV2,\n\t(result) => {\n\t\tassertDocumentSha256(result, \"result_sha256\");\n\t\tassertResultTiming(result);\n\t\tif (\n\t\t\tresult.capability_policy.policy_id !== CAPABILITY_POLICY.policy_id ||\n\t\t\tresult.capability_policy.policy_sha256 !==\n\t\t\t\tCAPABILITY_POLICY.policy_sha256 ||\n\t\t\tresult.resource_policy.policy_id !== RESOURCE_POLICY.policy_id ||\n\t\t\tresult.resource_policy.policy_sha256 !== RESOURCE_POLICY.policy_sha256\n\t\t) {\n\t\t\tthrow new Error(\"backfill result requires the current policy tuple\");\n\t\t}\n\t\tif (\n\t\t\tresult.schema_manifest_sha256 !==\n\t\t\tPREPARATION_SCHEMA_MANIFEST_V3.manifest_sha256\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t\"backfill result schema manifest identity is not current\",\n\t\t\t);\n\t\t}\n\t\tif (result.outcome.selection) {\n\t\t\tarchiveSelectionCodec.decode(result.outcome.selection);\n\t\t}\n\t\tif (result.outcome.receipt) {\n\t\t\tconst receipt = promotionReceiptCodec.decode(result.outcome.receipt);\n\t\t\tif (!promotionReceiptMatchesCurrentPolicies(receipt)) {\n\t\t\t\tthrow new Error(\"backfill result receipt is not current-qualified\");\n\t\t\t}\n\t\t\tif (\n\t\t\t\treceipt.effective_policies.capability_policy.policy_id !==\n\t\t\t\t\tresult.capability_policy.policy_id ||\n\t\t\t\treceipt.effective_policies.capability_policy.policy_sha256 !==\n\t\t\t\t\tresult.capability_policy.policy_sha256 ||\n\t\t\t\treceipt.effective_policies.resource_policy.policy_id !==\n\t\t\t\t\tresult.resource_policy.policy_id ||\n\t\t\t\treceipt.effective_policies.resource_policy.policy_sha256 !==\n\t\t\t\t\tresult.resource_policy.policy_sha256\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"backfill result and receipt policy identities disagree\",\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (\n\t\t\tresult.outcome.status === \"promoted\" &&\n\t\t\t(!result.outcome.selection || !result.outcome.receipt)\n\t\t) {\n\t\t\tthrow new Error(\"promoted outcome requires selection and receipt\");\n\t\t}\n\t\tif (\n\t\t\tresult.outcome.status === \"already_covered\" &&\n\t\t\t!result.outcome.selection\n\t\t) {\n\t\t\tthrow new Error(\"already_covered outcome requires selection\");\n\t\t}\n\t\tif (\n\t\t\t(result.outcome.status === \"already_covered\" ||\n\t\t\t\tresult.outcome.status === \"promoted\") &&\n\t\t\tresult.outcome.selection?.bundles.some(\n\t\t\t\t(bundle) => bundle.capture_origin === \"vendor_historical_backfill\",\n\t\t\t) &&\n\t\t\t!result.outcome.receipt\n\t\t) {\n\t\t\tthrow new Error(\"successful vendor evidence requires a current receipt\");\n\t\t}\n\t\tif (\n\t\t\t(result.outcome.status === \"already_covered\" ||\n\t\t\t\tresult.outcome.status === \"promoted\") &&\n\t\t\tresult.outcome.selection &&\n\t\t\tresult.outcome.receipt\n\t\t) {\n\t\t\tconst selectedVendorReceiptIds = new Set(\n\t\t\t\tresult.outcome.selection.bundles\n\t\t\t\t\t.filter(\n\t\t\t\t\t\t(bundle) => bundle.capture_origin === \"vendor_historical_backfill\",\n\t\t\t\t\t)\n\t\t\t\t\t.map((bundle) => bundle.qualification?.receipt_id),\n\t\t\t);\n\t\t\tif (\n\t\t\t\tselectedVendorReceiptIds.size !== 1 ||\n\t\t\t\t!selectedVendorReceiptIds.has(result.outcome.receipt.receipt_id) ||\n\t\t\t\tresult.outcome.selection.receipt_ids.length !== 1 ||\n\t\t\t\tresult.outcome.selection.receipt_ids[0] !==\n\t\t\t\t\tresult.outcome.receipt.receipt_id\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"successful vendor selection and current receipt lineage disagree\",\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t},\n);\n\nexport const canonicalOrderBookExportRequestCodec =\n\tcodec<CanonicalOrderBookExportRequestWire>(\n\t\tvalidateExportRequest,\n\t\t(request) => {\n\t\t\tconst selection = archiveSelectionCodec.decode(request.selection);\n\t\t\tif (\n\t\t\t\tselection.coverage_class !== \"complete\" ||\n\t\t\t\tselection.selected_intervals.length === 0\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"export requires a complete non-empty archive selection\",\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t);\n\nexport const canonicalOrderBookExportResultCodec =\n\tcodec<CanonicalOrderBookExportResultWire>(validateExportResult, (result) => {\n\t\tassertDocumentSha256(result, \"result_sha256\");\n\t\tassertResultTiming(result);\n\t\tconst artifacts = result.outcome.artifacts;\n\t\tif (\n\t\t\tartifacts &&\n\t\t\t(artifacts.levels.projection_schema_id !==\n\t\t\t\tORDER_BOOK_LEVELS_PARQUET_PROJECTION_SCHEMA_ID ||\n\t\t\t\tartifacts.levels.projection_schema_sha256 !==\n\t\t\t\t\tORDER_BOOK_LEVELS_PARQUET_PROJECTION_SCHEMA_SHA256 ||\n\t\t\t\tartifacts.summary.projection_schema_id !==\n\t\t\t\t\tORDER_BOOK_DEPTH_SUMMARY_PARQUET_PROJECTION_SCHEMA_ID ||\n\t\t\t\tartifacts.summary.projection_schema_sha256 !==\n\t\t\t\t\tORDER_BOOK_DEPTH_SUMMARY_PARQUET_PROJECTION_SCHEMA_SHA256)\n\t\t) {\n\t\t\tthrow new Error(\"export artifact projection identity is inconsistent\");\n\t\t}\n\t});\n\nexport const preparationProductPinCodec = codec<PreparationProductPinWire>(\n\tvalidateProductPin,\n\t(pin) => {\n\t\tconst expectedExecutables = new Map([\n\t\t\t[\n\t\t\t\t\"market-data-vendor-backfill\",\n\t\t\t\t{\n\t\t\t\t\tproductVersion: \"market-data-vendor-backfill/v1\",\n\t\t\t\t\trelativePath: \"dist/commands/market-data-vendor-backfill.js\",\n\t\t\t\t},\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"cex-canonical-orderbook-export\",\n\t\t\t\t{\n\t\t\t\t\tproductVersion: \"cex-canonical-orderbook-export/v2\",\n\t\t\t\t\trelativePath: \"dist/commands/cex-canonical-orderbook-export.js\",\n\t\t\t\t},\n\t\t\t],\n\t\t] as const);\n\t\tif (pin.executables.length !== expectedExecutables.size) {\n\t\t\tthrow new Error(\"product pin must identify both preparation executables\");\n\t\t}\n\t\tfor (const executable of pin.executables) {\n\t\t\tconst expected = expectedExecutables.get(executable.product_id);\n\t\t\tif (\n\t\t\t\t!expected ||\n\t\t\t\texecutable.product_version !== expected.productVersion ||\n\t\t\t\texecutable.relative_path !== expected.relativePath\n\t\t\t) {\n\t\t\t\tthrow new Error(\"product pin executable identity is inconsistent\");\n\t\t\t}\n\t\t\tif (\n\t\t\t\texecutable.relative_path.split(/[\\\\/]+/u).includes(\"..\") ||\n\t\t\t\texecutable.relative_path.startsWith(\"/\")\n\t\t\t) {\n\t\t\t\tthrow new Error(\"product pin executable path is unsafe\");\n\t\t\t}\n\t\t}\n\t\tif (\n\t\t\tpin.schema_manifest.schema_id !==\n\t\t\t\tPREPARATION_SCHEMA_MANIFEST_V3.schema_id ||\n\t\t\tpin.schema_manifest.manifest_sha256 !==\n\t\t\t\tPREPARATION_SCHEMA_MANIFEST_V3.manifest_sha256\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t\"product pin schema manifest identity does not match the preparation manifest\",\n\t\t\t);\n\t\t}\n\t\tconst actualSchemas = pin.schema_pins\n\t\t\t.map(({ schema_id, schema_sha256 }) => `${schema_id}:${schema_sha256}`)\n\t\t\t.sort();\n\t\tconst expectedSchemas = PREPARATION_SCHEMA_ARTIFACTS.map(\n\t\t\t({ schema_id, schema_sha256 }) => `${schema_id}:${schema_sha256}`,\n\t\t).sort();\n\t\tif (JSON.stringify(actualSchemas) !== JSON.stringify(expectedSchemas)) {\n\t\t\tthrow new Error(\n\t\t\t\t\"product pin schema identities do not match the preparation manifest\",\n\t\t\t);\n\t\t}\n\t\tif (\n\t\t\tpin.capability_policy.policy_id !== CAPABILITY_POLICY.policy_id ||\n\t\t\tpin.capability_policy.policy_sha256 !== CAPABILITY_POLICY.policy_sha256 ||\n\t\t\tpin.source_tape_capability.policy_id !==\n\t\t\t\tSOURCE_TAPE_CAPABILITY.policy_id ||\n\t\t\tpin.source_tape_capability.policy_sha256 !==\n\t\t\t\tSOURCE_TAPE_CAPABILITY.policy_sha256 ||\n\t\t\tpin.resource_policy.policy_id !== RESOURCE_POLICY.policy_id ||\n\t\t\tpin.resource_policy.policy_sha256 !== RESOURCE_POLICY.policy_sha256\n\t\t) {\n\t\t\tthrow new Error(\"product pin policy identities are inconsistent\");\n\t\t}\n\t\tconst expectedOperations = [\n\t\t\t{\n\t\t\t\tsymbol: \"runMarketDataSourceTape\",\n\t\t\t\toperation_id: \"market-data-source-tape/v1\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tsymbol: \"runMarketDataRequiredClockQualification\",\n\t\t\t\toperation_id: \"market-data-required-clock-qualification/v1\",\n\t\t\t},\n\t\t];\n\t\tif (\n\t\t\tpin.preparation_library.exported_subpath !==\n\t\t\t\t\"@usherlabs/cex-broker/market-data-preparation\" ||\n\t\t\tJSON.stringify(pin.preparation_library.operations) !==\n\t\t\t\tJSON.stringify(expectedOperations)\n\t\t) {\n\t\t\tthrow new Error(\"product pin preparation-library ABI is inconsistent\");\n\t\t}\n\t},\n);\n\nexport function finalizeBackfillResultV2(\n\tcontent: Omit<BackfillJobResultV2Wire, \"result_sha256\">,\n): BackfillJobResultV2Wire {\n\treturn backfillResultV2Codec.decode({\n\t\t...content,\n\t\tresult_sha256: documentSha256(content, \"result_sha256\"),\n\t});\n}\n\nexport function finalizeCanonicalOrderBookExportResult(\n\tcontent: Omit<CanonicalOrderBookExportResultWire, \"result_sha256\">,\n): CanonicalOrderBookExportResultWire {\n\treturn canonicalOrderBookExportResultCodec.decode({\n\t\t...content,\n\t\tresult_sha256: documentSha256(content, \"result_sha256\"),\n\t});\n}\n\nconst preparationSchemaArtifacts = [\n\t[\"schemas/backfill-request-v1.schema.json\", requestSchema],\n\t[\"schemas/backfill-result-v2.schema.json\", backfillResultV2Schema],\n\t[\"schemas/required-clock-v1.schema.json\", requiredClockSchema],\n\t[\"schemas/archive-selection-v1.schema.json\", archiveSelectionSchema],\n\t[\"schemas/promotion-receipt-v1.schema.json\", promotionReceiptSchema],\n\t[\n\t\t\"schemas/canonical-orderbook-export-request-v1.schema.json\",\n\t\texportRequestSchema,\n\t],\n\t[\n\t\t\"schemas/canonical-orderbook-export-result-v2.schema.json\",\n\t\texportResultSchema,\n\t],\n\t[\"schemas/preparation-product-pin-v2.schema.json\", productPinSchema],\n\t[\n\t\t\"schemas/order-book-levels-parquet-projection-v1.schema.json\",\n\t\tlevelsProjectionSchema,\n\t],\n\t[\n\t\t\"schemas/order-book-depth-summary-parquet-projection-v1.schema.json\",\n\t\tdepthSummaryProjectionSchema,\n\t],\n\t[\n\t\t\"schemas/source-forensics-ledger-v1.schema.json\",\n\t\tsourceForensicsLedgerSchema,\n\t],\n\t[\n\t\t\"schemas/source-qualification-record-v1.schema.json\",\n\t\tsourceQualificationRecordSchema,\n\t],\n] as const;\n\nexport const PREPARATION_SCHEMA_ARTIFACTS = Object.freeze(\n\tpreparationSchemaArtifacts.map(([path, schema]) =>\n\t\tObject.freeze({\n\t\t\tschema_id: schema.$id,\n\t\t\tpath,\n\t\t\tschema_sha256: jcsSha256(schema),\n\t\t\tschema,\n\t\t}),\n\t),\n);\n\nconst preparationSchemaManifestContent = {\n\tschema_id: PREPARATION_SCHEMA_MANIFEST_V3_ID,\n\tartifacts: PREPARATION_SCHEMA_ARTIFACTS.map(\n\t\t({ schema_id, path, schema_sha256 }) => ({\n\t\t\tschema_id,\n\t\t\tpath,\n\t\t\tschema_sha256,\n\t\t}),\n\t),\n};\n\nexport const PREPARATION_SCHEMA_MANIFEST_V3 = Object.freeze({\n\t...preparationSchemaManifestContent,\n\tmanifest_sha256: jcsSha256(preparationSchemaManifestContent),\n});\n\nexport const ORDER_BOOK_LEVELS_PARQUET_PROJECTION = Object.freeze(\n\tlevelsProjectionSchema,\n);\nexport const ORDER_BOOK_DEPTH_SUMMARY_PARQUET_PROJECTION = Object.freeze(\n\tdepthSummaryProjectionSchema,\n);\nexport const ORDER_BOOK_LEVELS_PARQUET_PROJECTION_SCHEMA_SHA256 = jcsSha256(\n\tlevelsProjectionSchema,\n);\nexport const ORDER_BOOK_DEPTH_SUMMARY_PARQUET_PROJECTION_SCHEMA_SHA256 =\n\tjcsSha256(depthSummaryProjectionSchema);\n",
|
|
187
|
-
"import { CONFORMANCE_FIXTURES as V1_CONFORMANCE_FIXTURES } from \"../market-data-vendor-backfill/conformance-fixtures\";\nimport { jcsSha256 } from \"../market-data-vendor-backfill/identity\";\nimport {\n\tCAPABILITY_POLICY,\n\tEFFECTIVE_ACQUISITION_POLICY_PIN,\n\tEFFECTIVE_ADAPTER_POLICY_PIN,\n\tRESOURCE_POLICY,\n} from \"../market-data-vendor-backfill/manifests\";\nimport { SOURCE_TAPE_CAPABILITY } from \"../source-tape\";\nimport {\n\tBACKFILL_RESULT_V2_SCHEMA_ID,\n\tCANONICAL_ORDERBOOK_EXPORT_REQUEST_SCHEMA_ID,\n\tCANONICAL_ORDERBOOK_EXPORT_RESULT_SCHEMA_ID,\n\tcanonicalOrderBookExportRequestCodec,\n\tfinalizeBackfillResultV2,\n\tfinalizeCanonicalOrderBookExportResult,\n\tORDER_BOOK_DEPTH_SUMMARY_PARQUET_PROJECTION_SCHEMA_ID,\n\tORDER_BOOK_DEPTH_SUMMARY_PARQUET_PROJECTION_SCHEMA_SHA256,\n\tORDER_BOOK_LEVELS_PARQUET_PROJECTION_SCHEMA_ID,\n\tORDER_BOOK_LEVELS_PARQUET_PROJECTION_SCHEMA_SHA256,\n\tPREPARATION_PRODUCT_PIN_SCHEMA_ID,\n\tPREPARATION_SCHEMA_ARTIFACTS,\n\tPREPARATION_SCHEMA_MANIFEST_V3,\n\tpreparationProductPinCodec,\n} from \"./contracts\";\n\nconst backfillProducer = {\n\tproduct_id: \"market-data-vendor-backfill\" as const,\n\tproduct_version: \"market-data-vendor-backfill/v1\" as const,\n\tpackage: {\n\t\tname: \"@usherlabs/cex-broker\" as const,\n\t\tversion: \"0.2.50\",\n\t\tgit_head: \"a\".repeat(40),\n\t},\n\texecutable_sha256: \"b\".repeat(64),\n\truntime: { name: \"node\" as const, version: \"22.22.2\" },\n};\n\nconst exportProducer = {\n\t...backfillProducer,\n\tproduct_id: \"cex-canonical-orderbook-export\" as const,\n\tproduct_version: \"cex-canonical-orderbook-export/v2\" as const,\n\texecutable_sha256: \"c\".repeat(64),\n};\n\nconst canonicalOrderBookExportRequest =\n\tcanonicalOrderBookExportRequestCodec.decode({\n\t\tschema_id: CANONICAL_ORDERBOOK_EXPORT_REQUEST_SCHEMA_ID,\n\t\trequest_id: \"018f0f4d-7b32-7a30-8f4d-1d2a6e40f121\",\n\t\ttarget: { environment: \"production\", cluster: \"cex-archive-primary\" },\n\t\tselection: V1_CONFORMANCE_FIXTURES.documents.archive_selection,\n\t\tdepth: 20,\n\t\tconstruction_mode: \"sampled_top_n_snapshot\",\n\t\tcanonical_schema_version: \"1.0.0\",\n\t\tchecksum_algorithm: \"sha256-canonical-json-v1\",\n\t});\n\nconst canonicalOrderBookExportResult = finalizeCanonicalOrderBookExportResult({\n\tschema_id: CANONICAL_ORDERBOOK_EXPORT_RESULT_SCHEMA_ID,\n\tjob_id: \"018f0f4d-7b32-7a30-8f4d-1d2a6e40f122\",\n\trequest_file_sha256: \"d\".repeat(64),\n\tproducer: exportProducer,\n\tstarted_at: \"2026-08-20T12:00:01.000Z\",\n\tcompleted_at: \"2026-08-20T12:00:03.000Z\",\n\toutcome: {\n\t\tstatus: \"exported\",\n\t\treason_code: \"qualified_selection_exported\",\n\t\treason_subcode: null,\n\t\trequest_id: canonicalOrderBookExportRequest.request_id,\n\t\ttarget: canonicalOrderBookExportRequest.target,\n\t\tselection_sha256:\n\t\t\tcanonicalOrderBookExportRequest.selection.selection_sha256,\n\t\tquery_sha256: \"e\".repeat(64),\n\t\tquery_segments:\n\t\t\tcanonicalOrderBookExportRequest.selection.selected_intervals,\n\t\tpromotion_receipt_ids:\n\t\t\tcanonicalOrderBookExportRequest.selection.receipt_ids,\n\t\tartifacts: {\n\t\t\tlevels: {\n\t\t\t\tfile_name: \"order_book_levels.parquet\",\n\t\t\t\trows: 40,\n\t\t\t\tbytes: 4_096,\n\t\t\t\tsha256: \"f\".repeat(64),\n\t\t\t\tprojection_schema_id: ORDER_BOOK_LEVELS_PARQUET_PROJECTION_SCHEMA_ID,\n\t\t\t\tprojection_schema_sha256:\n\t\t\t\t\tORDER_BOOK_LEVELS_PARQUET_PROJECTION_SCHEMA_SHA256,\n\t\t\t},\n\t\t\tsummary: {\n\t\t\t\tfile_name: \"order_book_depth_summary.parquet\",\n\t\t\t\trows: 1,\n\t\t\t\tbytes: 2_048,\n\t\t\t\tsha256: \"1\".repeat(64),\n\t\t\t\tprojection_schema_id:\n\t\t\t\t\tORDER_BOOK_DEPTH_SUMMARY_PARQUET_PROJECTION_SCHEMA_ID,\n\t\t\t\tprojection_schema_sha256:\n\t\t\t\t\tORDER_BOOK_DEPTH_SUMMARY_PARQUET_PROJECTION_SCHEMA_SHA256,\n\t\t\t},\n\t\t},\n\t\tdiagnostics: {},\n\t},\n});\n\nconst backfillResult = finalizeBackfillResultV2({\n\tschema_id: BACKFILL_RESULT_V2_SCHEMA_ID,\n\tjob_id: \"018f0f4d-7b32-7a30-8f4d-1d2a6e40f120\",\n\trequest_file_sha256: \"7\".repeat(64),\n\tschema_manifest_sha256: PREPARATION_SCHEMA_MANIFEST_V3.manifest_sha256,\n\tproducer: backfillProducer,\n\tcapability_policy: {\n\t\tpolicy_id: CAPABILITY_POLICY.policy_id,\n\t\tpolicy_sha256: CAPABILITY_POLICY.policy_sha256,\n\t},\n\tresource_policy: {\n\t\tpolicy_id: RESOURCE_POLICY.policy_id,\n\t\tpolicy_sha256: RESOURCE_POLICY.policy_sha256,\n\t},\n\tstarted_at: \"2026-08-20T12:00:01.000Z\",\n\tcompleted_at: \"2026-08-20T12:00:03.000Z\",\n\toutcome: {\n\t\tstatus: \"already_covered\",\n\t\treason_code: \"qualified_coverage_complete\",\n\t\treason_subcode: null,\n\t\trequest_id: V1_CONFORMANCE_FIXTURES.documents.request.request_id,\n\t\tidempotency_key: V1_CONFORMANCE_FIXTURES.documents.request.idempotency_key,\n\t\ttarget: V1_CONFORMANCE_FIXTURES.documents.request.target,\n\t\tselection: V1_CONFORMANCE_FIXTURES.documents.archive_selection,\n\t\treceipt: V1_CONFORMANCE_FIXTURES.documents.promotion_receipt,\n\t\tdiagnostics: {},\n\t},\n});\n\nconst productPin = preparationProductPinCodec.decode({\n\tschema_id: PREPARATION_PRODUCT_PIN_SCHEMA_ID,\n\tpackage: {\n\t\tname: \"@usherlabs/cex-broker\",\n\t\tversion: \"0.2.50\",\n\t\tregistry_tarball_url:\n\t\t\t\"https://registry.npmjs.org/@usherlabs/cex-broker/-/cex-broker-0.2.50.tgz\",\n\t\tintegrity: \"sha512-YQ==\",\n\t\ttarball_sha256: \"2\".repeat(64),\n\t\tnpm_git_head: \"a\".repeat(40),\n\t},\n\texecutables: [\n\t\t{\n\t\t\tproduct_id: \"market-data-vendor-backfill\",\n\t\t\tproduct_version: \"market-data-vendor-backfill/v1\",\n\t\t\trelative_path: \"dist/commands/market-data-vendor-backfill.js\",\n\t\t\texecutable_sha256: backfillProducer.executable_sha256,\n\t\t},\n\t\t{\n\t\t\tproduct_id: \"cex-canonical-orderbook-export\",\n\t\t\tproduct_version: \"cex-canonical-orderbook-export/v2\",\n\t\t\trelative_path: \"dist/commands/cex-canonical-orderbook-export.js\",\n\t\t\texecutable_sha256: exportProducer.executable_sha256,\n\t\t},\n\t],\n\tschema_manifest: {\n\t\tschema_id: PREPARATION_SCHEMA_MANIFEST_V3.schema_id,\n\t\tmanifest_sha256: PREPARATION_SCHEMA_MANIFEST_V3.manifest_sha256,\n\t\trelative_path: \"dist/market-data-preparation/schema-manifest.json\",\n\t},\n\tschema_pins: PREPARATION_SCHEMA_ARTIFACTS.map(\n\t\t({ schema_id, schema_sha256 }) => ({ schema_id, schema_sha256 }),\n\t),\n\tcapability_policy: {\n\t\tpolicy_id: CAPABILITY_POLICY.policy_id,\n\t\tpolicy_sha256: CAPABILITY_POLICY.policy_sha256,\n\t},\n\tsource_tape_capability: {\n\t\tpolicy_id: SOURCE_TAPE_CAPABILITY.policy_id,\n\t\tpolicy_sha256: SOURCE_TAPE_CAPABILITY.policy_sha256,\n\t},\n\tresource_policy: {\n\t\tpolicy_id: RESOURCE_POLICY.policy_id,\n\t\tpolicy_sha256: RESOURCE_POLICY.policy_sha256,\n\t},\n\tpreparation_library: {\n\t\texported_subpath: \"@usherlabs/cex-broker/market-data-preparation\",\n\t\truntime_entry_sha256: \"3\".repeat(64),\n\t\tdeclaration_sha256: \"4\".repeat(64),\n\t\toperations: [\n\t\t\t{\n\t\t\t\tsymbol: \"runMarketDataSourceTape\",\n\t\t\t\toperation_id: \"market-data-source-tape/v1\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tsymbol: \"runMarketDataRequiredClockQualification\",\n\t\t\t\toperation_id: \"market-data-required-clock-qualification/v1\",\n\t\t\t},\n\t\t],\n\t},\n});\n\nconst libraryOperations = Object.freeze({\n\trequired_clock_qualification: Object.freeze({\n\t\toperation_id: \"market-data-required-clock-qualification/v1\" as const,\n\t\tattempt_id: \"arb-usdt-required-clock-conformance\",\n\t\trequest: V1_CONFORMANCE_FIXTURES.documents.request,\n\t\trequired_clock: V1_CONFORMANCE_FIXTURES.documents.required_clock,\n\t\tartifacts: Object.freeze({\n\t\t\tledger_file_name: \"required-clock-ledger.json\",\n\t\t\tqualification_record_file_name: \"required-clock-qualification.json\",\n\t\t}),\n\t}),\n\tsource_tape: Object.freeze({\n\t\toperation_id: \"market-data-source-tape/v1\" as const,\n\t\tattempt_id: \"arb-usdt-source-tape-conformance\",\n\t\trequest_id: V1_CONFORMANCE_FIXTURES.documents.request.request_id,\n\t\tscope: V1_CONFORMANCE_FIXTURES.documents.request.scope,\n\t\twindow: V1_CONFORMANCE_FIXTURES.documents.request.window,\n\t\tdepth: 100 as const,\n\t\ttarget: Object.freeze({\n\t\t\tenvironment: \"sandbox\" as const,\n\t\t\tcluster: \"cex-archive-local\" as const,\n\t\t}),\n\t\tproduction_authorization_id:\n\t\t\tV1_CONFORMANCE_FIXTURES.documents.request.production_authorization_id,\n\t\texpected_canonical_schema:\n\t\t\tV1_CONFORMANCE_FIXTURES.documents.request.expected_canonical_schema,\n\t\tproduct_pins: Object.freeze({\n\t\t\tsource_tape_capability: Object.freeze({\n\t\t\t\tpolicy_id: SOURCE_TAPE_CAPABILITY.policy_id,\n\t\t\t\tpolicy_sha256: SOURCE_TAPE_CAPABILITY.policy_sha256,\n\t\t\t}),\n\t\t\tresource_policy: Object.freeze({\n\t\t\t\tpolicy_id: RESOURCE_POLICY.policy_id,\n\t\t\t\tpolicy_sha256: RESOURCE_POLICY.policy_sha256,\n\t\t\t}),\n\t\t\tadapter_policy: EFFECTIVE_ADAPTER_POLICY_PIN,\n\t\t\tacquisition_policy: EFFECTIVE_ACQUISITION_POLICY_PIN,\n\t\t}),\n\t\tartifacts: Object.freeze({\n\t\t\tledger_file_name: \"source-tape-ledger.json\",\n\t\t\tqualification_record_file_name: \"source-tape-qualification.json\",\n\t\t\texporter_result_file_name: \"source-tape-export-result.json\",\n\t\t}),\n\t}),\n});\n\nexport const PREPARATION_CONFORMANCE_FIXTURES = Object.freeze({\n\tfixture_id: \"cex-market-data-preparation-conformance/v3\",\n\tdocuments: Object.freeze({\n\t\tbackfill_result: backfillResult,\n\t\tcanonical_orderbook_export_request: canonicalOrderBookExportRequest,\n\t\tcanonical_orderbook_export_result: canonicalOrderBookExportResult,\n\t\tpreparation_product_pin: productPin,\n\t\tlibrary_operations: libraryOperations,\n\t}),\n\tidentities: Object.freeze({\n\t\tmanifest_sha256: PREPARATION_SCHEMA_MANIFEST_V3.manifest_sha256,\n\t\tbackfill_result_sha256: backfillResult.result_sha256,\n\t\tselection_sha256:\n\t\t\tcanonicalOrderBookExportRequest.selection.selection_sha256,\n\t\texport_result_sha256: canonicalOrderBookExportResult.result_sha256,\n\t\tproduct_pin_sha256: jcsSha256(productPin),\n\t\tlibrary_operations_sha256: jcsSha256(libraryOperations),\n\t}),\n});\n",
|
|
188
|
-
"import { createHash } from \"node:crypto\";\nimport path from \"node:path\";\nimport Ajv2020, { type ErrorObject } from \"ajv/dist/2020.js\";\nimport {\n\tSOURCE_FORENSICS_LEDGER_SCHEMA_ID,\n\tSOURCE_QUALIFICATION_RECORD_SCHEMA_ID,\n} from \"./market-data-preparation/contracts\";\nimport {\n\tassertSidecarBasename,\n\tatomicWriteJsonResult,\n\twriteExclusiveDurableFile,\n} from \"./market-data-preparation/file-job\";\nimport sourceForensicsLedgerSchema from \"./market-data-preparation/schemas/source-forensics-ledger.schema.json\" with {\n\ttype: \"json\",\n};\nimport sourceQualificationRecordSchema from \"./market-data-preparation/schemas/source-qualification-record.schema.json\" with {\n\ttype: \"json\",\n};\nimport type {\n\tCanonicalScopeWire,\n\tLowercaseUuid,\n\tRequiredClockWire,\n\tSha256Hex,\n} from \"./market-data-vendor-backfill/contracts\";\nimport { requiredClockCodec } from \"./market-data-vendor-backfill/contracts\";\nimport {\n\tassertDocumentSha256,\n\tdocumentSha256,\n\tjcsCanonicalize,\n} from \"./market-data-vendor-backfill/identity\";\nimport type { PolicyPin } from \"./market-data-vendor-backfill/manifests\";\n\nexport const SOURCE_FORENSICS_MAX_RECORDS = 100_000;\nexport const SOURCE_FORENSICS_MAX_CANONICAL_JSON_BYTES = 67_108_864;\nexport const SOURCE_FORENSICS_RECORD_KINDS = [\n\t\"sequence_discontinuity\",\n\t\"unanchored_target_interval\",\n\t\"stale_target_interval\",\n\t\"future_state_interval\",\n\t\"provider_object_checksum_conflict\",\n] as const;\nexport const SOURCE_FORENSICS_CLASSIFICATIONS = [\n\t\"stable_object_corruption\",\n\t\"mutable_provider_bytes\",\n\t\"provider_row_loss\",\n\t\"object_boundary_order_defect\",\n\t\"valid_inactive_market_state\",\n\t\"unresolved\",\n] as const;\nexport const SOURCE_FORENSICS_OPERATION_KINDS = [\n\t\"required_clock_qualification\",\n\t\"source_tape\",\n] as const;\n\nexport type SourceForensicsRecordKind =\n\t(typeof SOURCE_FORENSICS_RECORD_KINDS)[number];\nexport type SourceForensicsClassification =\n\t(typeof SOURCE_FORENSICS_CLASSIFICATIONS)[number];\nexport type SourceObjectEvidence = {\n\tidentity: string;\n\tchecksums: Sha256Hex[];\n\tattempt_count: number;\n\tquarantined: boolean;\n};\nexport type SourceAnchorEvidence = {\n\tevent_time_ms: number;\n\tsequence: string;\n\tobject_identity: string;\n\tobject_checksum: Sha256Hex;\n};\nexport type SourceTargetInterval = {\n\tstart_target_time_ms: number;\n\tend_target_time_ms_exclusive: number;\n\ttarget_count: number;\n};\nexport type SourceLagDistribution = {\n\tlag_1000_ms: number;\n\tlag_2000_ms: number;\n\tlag_5000_ms: number;\n\tlag_10000_ms: number;\n\tlag_30000_ms: number;\n\tlag_60000_ms: number;\n};\nexport type SourceForensicsRecordWire = {\n\trecord_sha256: Sha256Hex;\n\tkind: SourceForensicsRecordKind;\n\tscope: CanonicalScopeWire;\n\tprovider_objects: SourceObjectEvidence[];\n\tprevious_anchor: SourceAnchorEvidence | null;\n\tnext_anchor: SourceAnchorEvidence | null;\n\ttarget_interval: SourceTargetInterval | null;\n\tlag_distribution: SourceLagDistribution | null;\n\tsequence: null | {\n\t\texpected_previous: string;\n\t\tobserved_previous: string;\n\t\tobserved_final: string;\n\t\tevent_time_ms: number;\n\t};\n\tclassification: SourceForensicsClassification | null;\n\tadapter_version: string;\n};\n\nexport const SOURCE_TARGET_DISPOSITIONS = [\n\t\"fresh_within_bound\",\n\t\"valid_inactive_market_state\",\n\t\"disqualifying\",\n] as const;\nexport type SourceTargetDisposition =\n\t(typeof SOURCE_TARGET_DISPOSITIONS)[number];\nexport type SourceTargetDispositionWire = {\n\ttarget_id: LowercaseUuid;\n\ttarget_time_ms: number;\n\tdisposition: SourceTargetDisposition;\n\tsource_time_ms: number | null;\n\tasof_age_ms: number | null;\n\trecord_sha256s: Sha256Hex[];\n};\n\nexport type SourceInventoryInterval = {\n\tstart_time_ms: number;\n\tend_time_ms_exclusive: number;\n};\n\ntype SourceForensicsSummary = {\n\tretained_record_count: number;\n\ttotal_record_count: number;\n\tomitted_record_count: number;\n\taffected_target_count: number;\n\tunresolved_record_count: number;\n};\n\ntype SourceForensicsLedgerBase = {\n\tschema_id: typeof SOURCE_FORENSICS_LEDGER_SCHEMA_ID;\n\tledger_sha256: Sha256Hex;\n\toperation_kind: (typeof SOURCE_FORENSICS_OPERATION_KINDS)[number];\n\tnormalized_invocation_sha256: Sha256Hex;\n\trequest_id: LowercaseUuid;\n\tscope: CanonicalScopeWire;\n\twindow: SourceInventoryInterval;\n\teffective_policies: {\n\t\tcapability_policy: PolicyPin;\n\t\tresource_policy: PolicyPin;\n\t\tadapter_policy: PolicyPin;\n\t\tacquisition_policy: PolicyPin;\n\t};\n\tprovider_object_inventory: {\n\t\texpected_identities: string[];\n\t\tobserved_identities: string[];\n\t\texpected_selected_intervals: SourceInventoryInterval[];\n\t\tobserved_selected_intervals: SourceInventoryInterval[];\n\t\tcomplete: boolean;\n\t};\n\tprovider_objects: SourceObjectEvidence[];\n\trecords: SourceForensicsRecordWire[];\n\tsummary: SourceForensicsSummary;\n\tlimits: {\n\t\tmax_records: typeof SOURCE_FORENSICS_MAX_RECORDS;\n\t\tmax_canonical_json_bytes: typeof SOURCE_FORENSICS_MAX_CANONICAL_JSON_BYTES;\n\t};\n\tcomplete: boolean;\n\tincomplete_reason: \"forensics_evidence_bound_exceeded\" | null;\n};\n\nexport type RequiredClockSourceForensicsLedgerWire =\n\tSourceForensicsLedgerBase & {\n\t\toperation_kind: \"required_clock_qualification\";\n\t\trequired_clock: {\n\t\t\tclock_id: LowercaseUuid;\n\t\t\tclock_sha256: Sha256Hex;\n\t\t\tevent_count: number;\n\t\t};\n\t\ttarget_dispositions: SourceTargetDispositionWire[];\n\t\tsummary: SourceForensicsSummary & {\n\t\t\tdisposition_complete: boolean;\n\t\t\tfresh_target_count: number;\n\t\t\tinactive_target_count: number;\n\t\t\tdisqualifying_target_count: number;\n\t\t\tomitted_target_disposition_count: number;\n\t\t};\n\t};\n\nexport type SourceTapeForensicsLedgerWire = SourceForensicsLedgerBase & {\n\toperation_kind: \"source_tape\";\n\tsource_tape: {\n\t\tproduct_id: \"market-data-source-tape\";\n\t\tproduct_version: \"market-data-source-tape/v1\";\n\t\tstate_count: number;\n\t};\n};\n\nexport type SourceForensicsLedgerWire =\n\t| RequiredClockSourceForensicsLedgerWire\n\t| SourceTapeForensicsLedgerWire;\n\ntype SourceQualificationLedgerDescriptor = {\n\tschema_id: typeof SOURCE_FORENSICS_LEDGER_SCHEMA_ID;\n\tfile_name: string;\n\tsha256: Sha256Hex;\n\tbytes: number;\n\tretained_record_count: number;\n\ttotal_record_count: number;\n\tomitted_record_count: number;\n\tcomplete: boolean;\n};\n\ntype SourceQualificationRecordBase = {\n\tschema_id: typeof SOURCE_QUALIFICATION_RECORD_SCHEMA_ID;\n\trecord_sha256: Sha256Hex;\n\tcreated_at: string;\n\toperation_kind: (typeof SOURCE_FORENSICS_OPERATION_KINDS)[number];\n\tnormalized_invocation_sha256: Sha256Hex;\n\trequest_id: LowercaseUuid;\n\tscope: CanonicalScopeWire;\n\tledger: SourceQualificationLedgerDescriptor;\n\tsource_reconstruction_accepted: boolean;\n\tsource_event_enumeration_eligible: boolean;\n};\n\nexport type RequiredClockSourceQualificationRecordWire =\n\tSourceQualificationRecordBase & {\n\t\toperation_kind: \"required_clock_qualification\";\n\t\tledger: SourceQualificationLedgerDescriptor & {\n\t\t\tdisposition_complete: boolean;\n\t\t\tfresh_target_count: number;\n\t\t\tinactive_target_count: number;\n\t\t\tdisqualifying_target_count: number;\n\t\t\tomitted_target_disposition_count: number;\n\t\t};\n\t\tqualified: boolean;\n\t\tsource_partition_complete: boolean;\n\t\toutcome:\n\t\t\t| {\n\t\t\t\t\tstatus: \"success\";\n\t\t\t\t\treason: \"required_clock_qualification_completed\";\n\t\t\t\t\tpartial_evidence: SourceEvidenceDescriptor[];\n\t\t\t\t\texporter_result: null;\n\t\t\t }\n\t\t\t| {\n\t\t\t\t\tstatus: \"failure\";\n\t\t\t\t\treason: (typeof REQUIRED_CLOCK_QUALIFICATION_FAILURE_REASONS)[number];\n\t\t\t\t\tpartial_evidence: SourceEvidenceDescriptor[];\n\t\t\t\t\texporter_result: null;\n\t\t\t };\n\t};\n\nexport const REQUIRED_CLOCK_QUALIFICATION_FAILURE_REASONS = [\n\t\"required_clock_input_invalid\",\n\t\"required_clock_capability_unsupported\",\n\t\"required_clock_credentials_missing\",\n\t\"required_clock_acquisition_failed\",\n\t\"required_clock_reconstruction_failed\",\n\t\"required_clock_classification_failed\",\n\t\"required_clock_evidence_incomplete\",\n\t\"required_clock_internal_failure\",\n] as const;\n\nexport const SOURCE_TAPE_FAILURE_REASONS = [\n\t\"source_tape_input_invalid\",\n\t\"source_tape_capability_unsupported\",\n\t\"source_tape_credentials_missing\",\n\t\"source_tape_acquisition_failed\",\n\t\"source_tape_reconstruction_failed\",\n\t\"source_tape_inventory_incomplete\",\n\t\"source_tape_archive_failed\",\n\t\"source_tape_promotion_failed\",\n\t\"source_tape_selection_failed\",\n\t\"source_tape_export_failed\",\n\t\"source_tape_internal_failure\",\n] as const;\n\ntype SourceTapeQualificationSuccessOutcome = {\n\tstatus: \"success\";\n\treason: \"source_tape_prepared\";\n\tpartial_evidence: SourceEvidenceDescriptor[];\n\texporter_result: SourceTapeExporterResultDescriptor;\n};\n\ntype SourceTapeQualificationFailureOutcome = {\n\tstatus: \"failure\";\n\treason: (typeof SOURCE_TAPE_FAILURE_REASONS)[number];\n\tpartial_evidence: SourceEvidenceDescriptor[];\n\texporter_result: null;\n};\n\nexport type SourceTapeQualificationRecordWire =\n\tSourceQualificationRecordBase & {\n\t\toperation_kind: \"source_tape\";\n\t\tledger: SourceQualificationLedgerDescriptor & { state_count: number };\n\t\tsource_tape_eligible: boolean;\n\t} & (\n\t\t\t| {\n\t\t\t\t\tinitializer: SourceTapeInitializerDescriptor;\n\t\t\t\t\toutcome: SourceTapeQualificationSuccessOutcome;\n\t\t\t }\n\t\t\t| {\n\t\t\t\t\tinitializer: SourceTapeInitializerDescriptor | null;\n\t\t\t\t\toutcome: SourceTapeQualificationFailureOutcome;\n\t\t\t }\n\t\t);\n\nexport type SourceTapeInitializerDescriptor = {\n\tcanonical_snapshot_id: Sha256Hex;\n\tsource_time_ms: number;\n\tsequence: string;\n\tsemantic_stream_position: 0;\n};\n\nexport type SourceEvidenceDescriptor = {\n\tkind:\n\t\t| \"ledger\"\n\t\t| \"provider_inventory\"\n\t\t| \"selection\"\n\t\t| \"promotion_receipt\"\n\t\t| \"export_result\";\n\tfile_name: string;\n\tsha256: Sha256Hex;\n\tbytes: number;\n};\n\nexport type SourceTapeExporterResultDescriptor = {\n\tschema_id: \"https://schemas.usher.so/cex-canonical-orderbook-export-result/v2\";\n\tfile_name: string;\n\tsha256: Sha256Hex;\n\tbytes: number;\n\tresult_sha256: Sha256Hex;\n};\n\nexport type SourceQualificationRecordWire =\n\t| RequiredClockSourceQualificationRecordWire\n\t| SourceTapeQualificationRecordWire;\n\nfunction describeAjvErrors(errors: ErrorObject[] | null | undefined): string {\n\treturn (errors ?? [])\n\t\t.map((error) => `${error.instancePath || \"/\"} ${error.message}`)\n\t\t.join(\"; \");\n}\n\nconst ajv = new Ajv2020({ allErrors: true, strict: true });\nconst validateLedger = ajv.compile(sourceForensicsLedgerSchema);\nconst validateQualification = ajv.compile(sourceQualificationRecordSchema);\n\nfunction assertSecretFree(value: unknown): void {\n\tconst serialized = JSON.stringify(value).toLowerCase();\n\tfor (const forbidden of [\n\t\t\"api_key\",\n\t\t\"apikey\",\n\t\t\"authorization\",\n\t\t\"bearer \",\n\t\t\"response_body\",\n\t\t\"provider_rows\",\n\t\t\"clickhouse_password\",\n\t\t\"archive_forwarder_token\",\n\t]) {\n\t\tif (serialized.includes(forbidden)) {\n\t\t\tthrow new Error(\"source-forensics evidence contains forbidden material\");\n\t\t}\n\t}\n}\n\nfunction assertAuthoritativeRequiredClock(\n\tledger: RequiredClockSourceForensicsLedgerWire,\n\tclockInput: RequiredClockWire,\n): void {\n\tconst clock = requiredClockCodec.decode(clockInput);\n\tif (\n\t\tledger.required_clock.clock_id !== clock.clock_id ||\n\t\tledger.required_clock.clock_sha256 !== clock.clock_sha256 ||\n\t\tledger.required_clock.event_count !== clock.targets.length\n\t) {\n\t\tthrow new Error(\n\t\t\t\"source-forensics ledger does not match the authoritative required clock\",\n\t\t);\n\t}\n\tif (\n\t\tledger.summary.disposition_complete &&\n\t\tledger.target_dispositions.length !== clock.targets.length\n\t) {\n\t\tthrow new Error(\n\t\t\t\"source-forensics ledger omits an authoritative required clock target\",\n\t\t);\n\t}\n\tconst recordBySha = new Map(\n\t\tledger.records.map((record) => [record.record_sha256, record]),\n\t);\n\tfor (const [index, disposition] of ledger.target_dispositions.entries()) {\n\t\tconst target = clock.targets[index];\n\t\tif (\n\t\t\t!target ||\n\t\t\tdisposition.target_id !== target.target_id ||\n\t\t\tdisposition.target_time_ms !== Date.parse(target.target_at)\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t\"source-forensics disposition differs from the authoritative required clock\",\n\t\t\t);\n\t\t}\n\t\tfor (const recordSha256 of disposition.record_sha256s) {\n\t\t\tconst interval = recordBySha.get(recordSha256)?.target_interval;\n\t\t\tif (\n\t\t\t\t!interval ||\n\t\t\t\tdisposition.target_time_ms < interval.start_target_time_ms ||\n\t\t\t\tdisposition.target_time_ms >= interval.end_target_time_ms_exclusive\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"source-forensics disposition record interval does not contain its authoritative target\",\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\tfor (const record of ledger.records) {\n\t\tconst interval = record.target_interval;\n\t\tif (!interval) continue;\n\t\tconst containedTargets = clock.targets.filter(({ target_at }) => {\n\t\t\tconst targetTimeMs = Date.parse(target_at);\n\t\t\treturn (\n\t\t\t\ttargetTimeMs >= interval.start_target_time_ms &&\n\t\t\t\ttargetTimeMs < interval.end_target_time_ms_exclusive\n\t\t\t);\n\t\t});\n\t\tif (containedTargets.length !== interval.target_count) {\n\t\t\tthrow new Error(\n\t\t\t\t\"source-forensics record interval target count is inconsistent with the authoritative required clock\",\n\t\t\t);\n\t\t}\n\t}\n}\n\nconst sourceForensicsLedgerCodecInternal = {\n\tdecode(\n\t\tvalue: unknown,\n\t\tcontext?: { requiredClock: RequiredClockWire },\n\t): SourceForensicsLedgerWire {\n\t\tif (!validateLedger(value)) {\n\t\t\tthrow new Error(\n\t\t\t\t`source-forensics ledger validation failed: ${describeAjvErrors(validateLedger.errors)}`,\n\t\t\t);\n\t\t}\n\t\tconst ledger = value as SourceForensicsLedgerWire;\n\t\tassertDocumentSha256(ledger, \"ledger_sha256\");\n\t\tfor (const record of ledger.records) {\n\t\t\tassertDocumentSha256(record, \"record_sha256\");\n\t\t}\n\t\tconst ordered = [...ledger.records].sort((left, right) =>\n\t\t\tjcsCanonicalize(left).localeCompare(jcsCanonicalize(right)),\n\t\t);\n\t\tif (JSON.stringify(ordered) !== JSON.stringify(ledger.records)) {\n\t\t\tthrow new Error(\"source-forensics records are not deterministic\");\n\t\t}\n\t\tif (\n\t\t\tledger.summary.retained_record_count !== ledger.records.length ||\n\t\t\tledger.summary.total_record_count !==\n\t\t\t\tledger.summary.retained_record_count +\n\t\t\t\t\tledger.summary.omitted_record_count ||\n\t\t\tledger.complete === (ledger.incomplete_reason !== null) ||\n\t\t\tledger.window.end_time_ms_exclusive <= ledger.window.start_time_ms\n\t\t) {\n\t\t\tthrow new Error(\"source-forensics summary is inconsistent\");\n\t\t}\n\t\tif (context && ledger.operation_kind === \"required_clock_qualification\") {\n\t\t\tassertAuthoritativeRequiredClock(ledger, context.requiredClock);\n\t\t}\n\t\tif (ledger.operation_kind === \"required_clock_qualification\") {\n\t\t\tconst orderedDispositions = [...ledger.target_dispositions].sort(\n\t\t\t\t(left, right) =>\n\t\t\t\t\tleft.target_time_ms - right.target_time_ms ||\n\t\t\t\t\tleft.target_id.localeCompare(right.target_id),\n\t\t\t);\n\t\t\tif (\n\t\t\t\tJSON.stringify(orderedDispositions) !==\n\t\t\t\tJSON.stringify(ledger.target_dispositions)\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"source-forensics target dispositions are not deterministic\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (\n\t\t\t\tledger.required_clock.event_count !==\n\t\t\t\t\tledger.target_dispositions.length +\n\t\t\t\t\t\tledger.summary.omitted_target_disposition_count ||\n\t\t\t\tledger.summary.fresh_target_count +\n\t\t\t\t\tledger.summary.inactive_target_count +\n\t\t\t\t\tledger.summary.disqualifying_target_count !==\n\t\t\t\t\tledger.target_dispositions.length ||\n\t\t\t\tledger.summary.disposition_complete !==\n\t\t\t\t\t(ledger.summary.omitted_target_disposition_count === 0)\n\t\t\t) {\n\t\t\t\tthrow new Error(\"source-forensics disposition summary is inconsistent\");\n\t\t\t}\n\t\t\tconst recordBySha = new Map(\n\t\t\t\tledger.records.map((record) => [record.record_sha256, record]),\n\t\t\t);\n\t\t\tconst targetIds = new Set<string>();\n\t\t\tfor (const disposition of ledger.target_dispositions) {\n\t\t\t\tif (targetIds.has(disposition.target_id)) {\n\t\t\t\t\tthrow new Error(\"source-forensics target disposition is duplicated\");\n\t\t\t\t}\n\t\t\t\ttargetIds.add(disposition.target_id);\n\t\t\t\tif (\n\t\t\t\t\tJSON.stringify([...disposition.record_sha256s].sort()) !==\n\t\t\t\t\t\tJSON.stringify(disposition.record_sha256s) ||\n\t\t\t\t\tdisposition.record_sha256s.some((sha) => !recordBySha.has(sha))\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\"source-forensics disposition record binding is invalid\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst overlappingRecords = ledger.records.filter((record) => {\n\t\t\t\t\tconst interval = record.target_interval;\n\t\t\t\t\treturn (\n\t\t\t\t\t\tinterval !== null &&\n\t\t\t\t\t\tdisposition.target_time_ms >= interval.start_target_time_ms &&\n\t\t\t\t\t\tdisposition.target_time_ms < interval.end_target_time_ms_exclusive\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t\tif (disposition.disposition === \"fresh_within_bound\") {\n\t\t\t\t\tif (\n\t\t\t\t\t\tdisposition.source_time_ms === null ||\n\t\t\t\t\t\tdisposition.asof_age_ms === null ||\n\t\t\t\t\t\tdisposition.asof_age_ms < 0 ||\n\t\t\t\t\t\tdisposition.asof_age_ms > 5_000 ||\n\t\t\t\t\t\tdisposition.source_time_ms + disposition.asof_age_ms !==\n\t\t\t\t\t\t\tdisposition.target_time_ms ||\n\t\t\t\t\t\tdisposition.record_sha256s.length !== 0 ||\n\t\t\t\t\t\toverlappingRecords.length !== 0\n\t\t\t\t\t) {\n\t\t\t\t\t\tthrow new Error(\"fresh source disposition is invalid\");\n\t\t\t\t\t}\n\t\t\t\t} else if (disposition.disposition === \"valid_inactive_market_state\") {\n\t\t\t\t\tconst evidence = disposition.record_sha256s.map(\n\t\t\t\t\t\t(sha) => recordBySha.get(sha) as SourceForensicsRecordWire,\n\t\t\t\t\t);\n\t\t\t\t\tif (\n\t\t\t\t\t\tdisposition.source_time_ms === null ||\n\t\t\t\t\t\tdisposition.asof_age_ms === null ||\n\t\t\t\t\t\tdisposition.asof_age_ms <= 5_000 ||\n\t\t\t\t\t\tdisposition.source_time_ms + disposition.asof_age_ms !==\n\t\t\t\t\t\t\tdisposition.target_time_ms ||\n\t\t\t\t\t\tevidence.length === 0 ||\n\t\t\t\t\t\tevidence.length !== overlappingRecords.length ||\n\t\t\t\t\t\t!evidence.every(\n\t\t\t\t\t\t\t(record) =>\n\t\t\t\t\t\t\t\trecord.kind === \"stale_target_interval\" &&\n\t\t\t\t\t\t\t\trecord.classification === \"valid_inactive_market_state\",\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tthrow new Error(\"inactive source disposition is invalid\");\n\t\t\t\t\t}\n\t\t\t\t} else if (\n\t\t\t\t\tdisposition.record_sha256s.length === 0 ||\n\t\t\t\t\toverlappingRecords.length === 0\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(\"disqualifying source disposition lacks evidence\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst expectedInventory = [\n\t\t\t...ledger.provider_object_inventory.expected_identities,\n\t\t].sort();\n\t\tconst observedInventory = [\n\t\t\t...ledger.provider_object_inventory.observed_identities,\n\t\t].sort();\n\t\tconst expectedIntervals = [\n\t\t\t...ledger.provider_object_inventory.expected_selected_intervals,\n\t\t].sort((left, right) =>\n\t\t\tjcsCanonicalize(left).localeCompare(jcsCanonicalize(right)),\n\t\t);\n\t\tconst observedIntervals = [\n\t\t\t...ledger.provider_object_inventory.observed_selected_intervals,\n\t\t].sort((left, right) =>\n\t\t\tjcsCanonicalize(left).localeCompare(jcsCanonicalize(right)),\n\t\t);\n\t\tconst providerObjects = [...ledger.provider_objects].sort((left, right) =>\n\t\t\tleft.identity.localeCompare(right.identity),\n\t\t);\n\t\tconst providerObjectIdentities = providerObjects.map(\n\t\t\t({ identity }) => identity,\n\t\t);\n\t\tconst inventoryIsCanonical =\n\t\t\tJSON.stringify(expectedInventory) ===\n\t\t\t\tJSON.stringify(ledger.provider_object_inventory.expected_identities) &&\n\t\t\tJSON.stringify(observedInventory) ===\n\t\t\t\tJSON.stringify(ledger.provider_object_inventory.observed_identities) &&\n\t\t\tJSON.stringify(expectedIntervals) ===\n\t\t\t\tJSON.stringify(\n\t\t\t\t\tledger.provider_object_inventory.expected_selected_intervals,\n\t\t\t\t) &&\n\t\t\tJSON.stringify(observedIntervals) ===\n\t\t\t\tJSON.stringify(\n\t\t\t\t\tledger.provider_object_inventory.observed_selected_intervals,\n\t\t\t\t) &&\n\t\t\tJSON.stringify(providerObjects) ===\n\t\t\t\tJSON.stringify(ledger.provider_objects);\n\t\tconst inventoryIsPositivelyBound =\n\t\t\tJSON.stringify(expectedInventory) === JSON.stringify(observedInventory) &&\n\t\t\tJSON.stringify(expectedIntervals) === JSON.stringify(observedIntervals) &&\n\t\t\tJSON.stringify(providerObjectIdentities) ===\n\t\t\t\tJSON.stringify(observedInventory) &&\n\t\t\tproviderObjects.every(\n\t\t\t\t(object) =>\n\t\t\t\t\tobject.checksums.length === 1 &&\n\t\t\t\t\t!object.quarantined &&\n\t\t\t\t\tJSON.stringify([...object.checksums].sort()) ===\n\t\t\t\t\t\tJSON.stringify(object.checksums),\n\t\t\t);\n\t\tif (\n\t\t\t!inventoryIsCanonical ||\n\t\t\tledger.provider_object_inventory.complete !== inventoryIsPositivelyBound\n\t\t) {\n\t\t\tthrow new Error(\"source-forensics provider inventory is inconsistent\");\n\t\t}\n\t\tif (\n\t\t\tnew TextEncoder().encode(jcsCanonicalize(ledger)).byteLength >\n\t\t\tSOURCE_FORENSICS_MAX_CANONICAL_JSON_BYTES\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t\"source-forensics ledger exceeds its canonical byte limit\",\n\t\t\t);\n\t\t}\n\t\tassertSecretFree(ledger);\n\t\treturn ledger;\n\t},\n};\n\nexport const sourceForensicsLedgerCodec = {\n\tdecode(\n\t\tvalue: unknown,\n\t\tcontext?: { requiredClock: RequiredClockWire },\n\t): SourceForensicsLedgerWire {\n\t\tconst ledger = sourceForensicsLedgerCodecInternal.decode(value, context);\n\t\tif (ledger.operation_kind === \"required_clock_qualification\" && !context) {\n\t\t\tthrow new Error(\n\t\t\t\t\"source-forensics ledger validation requires the authoritative required clock\",\n\t\t\t);\n\t\t}\n\t\treturn ledger;\n\t},\n};\n\nexport const sourceQualificationRecordCodec = {\n\tdecode(value: unknown): SourceQualificationRecordWire {\n\t\tif (!validateQualification(value)) {\n\t\t\tthrow new Error(\n\t\t\t\t`source qualification validation failed: ${describeAjvErrors(validateQualification.errors)}`,\n\t\t\t);\n\t\t}\n\t\tconst record = value as SourceQualificationRecordWire;\n\t\tassertDocumentSha256(record, \"record_sha256\");\n\t\tassertSidecarBasename(record.ledger.file_name);\n\t\tif (record.operation_kind === \"required_clock_qualification\") {\n\t\t\tif (\n\t\t\t\t(record.outcome.status === \"success\") !==\n\t\t\t\t\trecord.source_reconstruction_accepted ||\n\t\t\t\trecord.outcome.exporter_result !== null ||\n\t\t\t\t(record.qualified &&\n\t\t\t\t\t(!record.source_reconstruction_accepted ||\n\t\t\t\t\t\t!record.ledger.complete ||\n\t\t\t\t\t\t!record.ledger.disposition_complete ||\n\t\t\t\t\t\trecord.ledger.inactive_target_count !== 0 ||\n\t\t\t\t\t\trecord.ledger.disqualifying_target_count !== 0))\n\t\t\t) {\n\t\t\t\tthrow new Error(\"required-clock terminal outcome is inconsistent\");\n\t\t\t}\n\t\t} else if (\n\t\t\t(record.outcome.status === \"success\") !== record.source_tape_eligible ||\n\t\t\t(record.outcome.status === \"success\" &&\n\t\t\t\t(!record.source_reconstruction_accepted ||\n\t\t\t\t\t!record.source_event_enumeration_eligible ||\n\t\t\t\t\t!record.ledger.complete ||\n\t\t\t\t\trecord.initializer === null)) ||\n\t\t\t(record.outcome.status === \"failure\" &&\n\t\t\t\trecord.initializer !== null &&\n\t\t\t\trecord.initializer.semantic_stream_position !== 0)\n\t\t) {\n\t\t\tthrow new Error(\"source-tape terminal outcome is inconsistent\");\n\t\t}\n\t\tassertSecretFree(record);\n\t\treturn record;\n\t},\n};\n\nfunction finalizeRecord(\n\tcontent: Omit<SourceForensicsRecordWire, \"record_sha256\">,\n): SourceForensicsRecordWire {\n\treturn {\n\t\t...content,\n\t\trecord_sha256: documentSha256(content, \"record_sha256\"),\n\t};\n}\n\nexport function finalizeSourceForensicsLedger(\n\tcontent:\n\t\t| Omit<RequiredClockSourceForensicsLedgerWire, \"ledger_sha256\">\n\t\t| Omit<SourceTapeForensicsLedgerWire, \"ledger_sha256\">,\n): SourceForensicsLedgerWire {\n\treturn sourceForensicsLedgerCodec.decode({\n\t\t...content,\n\t\tledger_sha256: documentSha256(content, \"ledger_sha256\"),\n\t});\n}\n\nexport function finalizeSourceQualificationRecord(\n\tcontent:\n\t\t| Omit<RequiredClockSourceQualificationRecordWire, \"record_sha256\">\n\t\t| Omit<SourceTapeQualificationRecordWire, \"record_sha256\">,\n): SourceQualificationRecordWire {\n\treturn sourceQualificationRecordCodec.decode({\n\t\t...content,\n\t\trecord_sha256: documentSha256(content, \"record_sha256\"),\n\t});\n}\n\nexport type ReconstructionObservation =\n\t| { type: \"provider_object_boundary\"; object: SourceObjectEvidence }\n\t| { type: \"snapshot_anchor\" | \"reanchor\"; anchor: SourceAnchorEvidence }\n\t| {\n\t\t\ttype: \"sequence_discontinuity\";\n\t\t\tsequence: NonNullable<SourceForensicsRecordWire[\"sequence\"]>;\n\t\t\tobject: SourceObjectEvidence;\n\t }\n\t| {\n\t\t\ttype: \"required_clock_sample\";\n\t\t\ttarget_time_ms: number;\n\t\t\tsource_time_ms: number | null;\n\t\t\tlag_ms: number | null;\n\t\t\tstatus: \"covered\" | \"unanchored\" | \"stale\" | \"future\";\n\t\t\tobject: SourceObjectEvidence | null;\n\t }\n\t| { type: \"invalidation\"; event_time_ms: number; reason: string }\n\t| {\n\t\t\ttype: \"provider_object_checksum_conflict\";\n\t\t\tobject: SourceObjectEvidence;\n\t\t\taffected_target_times_ms: readonly number[];\n\t };\n\nexport interface ReconstructionObservationSink {\n\tobserve(observation: ReconstructionObservation): void;\n}\n\nexport const NOOP_RECONSTRUCTION_OBSERVER: ReconstructionObservationSink =\n\tObject.freeze({ observe() {} });\n\ntype LedgerContext = {\n\tschema_id: typeof SOURCE_FORENSICS_LEDGER_SCHEMA_ID;\n\toperation_kind?: \"required_clock_qualification\" | \"source_tape\";\n\tnormalized_invocation_sha256?: Sha256Hex;\n\tidempotency_key?: Sha256Hex;\n\trequest_id: LowercaseUuid;\n\tscope: CanonicalScopeWire;\n\twindow?: SourceInventoryInterval;\n\trequired_clock?: RequiredClockSourceForensicsLedgerWire[\"required_clock\"];\n\tsource_tape?: SourceTapeForensicsLedgerWire[\"source_tape\"];\n\teffective_policies: SourceForensicsLedgerBase[\"effective_policies\"];\n\tadapter_version: string;\n\trequired_clock_targets?: readonly {\n\t\ttarget_id: LowercaseUuid;\n\t\ttarget_time_ms: number;\n\t}[];\n\texpected_provider_object_identities: readonly string[];\n\texpected_selected_intervals?: readonly SourceInventoryInterval[];\n\tredact_values?: ReadonlySet<string>;\n};\n\nfunction lagDistribution(lagMs: number | null): SourceLagDistribution {\n\treturn {\n\t\tlag_1000_ms: lagMs !== null && lagMs <= 1_000 ? 1 : 0,\n\t\tlag_2000_ms: lagMs !== null && lagMs <= 2_000 ? 1 : 0,\n\t\tlag_5000_ms: lagMs !== null && lagMs <= 5_000 ? 1 : 0,\n\t\tlag_10000_ms: lagMs !== null && lagMs <= 10_000 ? 1 : 0,\n\t\tlag_30000_ms: lagMs !== null && lagMs <= 30_000 ? 1 : 0,\n\t\tlag_60000_ms: lagMs !== null && lagMs <= 60_000 ? 1 : 0,\n\t};\n}\n\nfunction mergeObjects(objects: SourceObjectEvidence[]): SourceObjectEvidence[] {\n\tconst byIdentity = new Map<string, SourceObjectEvidence>();\n\tfor (const object of objects) {\n\t\tconst existing = byIdentity.get(object.identity);\n\t\tbyIdentity.set(object.identity, {\n\t\t\tidentity: object.identity,\n\t\t\tchecksums: [\n\t\t\t\t...new Set([...(existing?.checksums ?? []), ...object.checksums]),\n\t\t\t].sort(),\n\t\t\tattempt_count: Math.max(\n\t\t\t\texisting?.attempt_count ?? 0,\n\t\t\t\tobject.attempt_count,\n\t\t\t),\n\t\t\tquarantined: Boolean(existing?.quarantined || object.quarantined),\n\t\t});\n\t}\n\treturn [...byIdentity.values()].sort((left, right) =>\n\t\tleft.identity.localeCompare(right.identity),\n\t);\n}\n\nfunction providerObjectInterval(\n\tidentity: string,\n): SourceInventoryInterval | null {\n\tconst match = /\\/(\\d{4})-(\\d{2})-(\\d{2})\\/(\\d{2})\\//u.exec(identity);\n\tif (!match) return null;\n\tconst start = Date.UTC(\n\t\tNumber(match[1]),\n\t\tNumber(match[2]) - 1,\n\t\tNumber(match[3]),\n\t\tNumber(match[4]),\n\t);\n\tif (!Number.isSafeInteger(start)) return null;\n\treturn { start_time_ms: start, end_time_ms_exclusive: start + 3_600_000 };\n}\n\nfunction orderedIntervals(\n\tintervals: readonly SourceInventoryInterval[],\n): SourceInventoryInterval[] {\n\treturn [...intervals]\n\t\t.map((interval) => ({ ...interval }))\n\t\t.sort(\n\t\t\t(left, right) =>\n\t\t\t\tleft.start_time_ms - right.start_time_ms ||\n\t\t\t\tleft.end_time_ms_exclusive - right.end_time_ms_exclusive,\n\t\t);\n}\n\ntype PendingSourceForensicsRecord = Omit<\n\tSourceForensicsRecordWire,\n\t\"record_sha256\"\n>;\n\n/**\n * Streaming qualification sink. It coalesces target intervals as observations\n * arrive and never retains more derived records than the configured cap.\n */\nexport class BoundedSourceForensicsSink\n\timplements ReconstructionObservationSink\n{\n\tprivate readonly records: PendingSourceForensicsRecord[] = [];\n\tprivate readonly providerObjects = new Map<string, SourceObjectEvidence>();\n\tprivate readonly affectedTargets = new Set<number>();\n\tprivate readonly targetObservations = new Map<\n\t\tnumber,\n\t\tExtract<ReconstructionObservation, { type: \"required_clock_sample\" }>\n\t>();\n\tprivate previousAnchor: SourceAnchorEvidence | null = null;\n\tprivate pendingGapRecord: PendingSourceForensicsRecord | null = null;\n\tprivate lastOmittedRecord: PendingSourceForensicsRecord | null = null;\n\tprivate totalRecordCount = 0;\n\tprivate omittedRecordCount = 0;\n\tprivate sourceTapeStateCount: number;\n\n\tconstructor(\n\t\tprivate readonly context: LedgerContext,\n\t\tprivate readonly testingLimits: {\n\t\t\tmaxRetainedRecords?: number;\n\t\t\tmaxCanonicalJsonBytes?: number;\n\t\t} = {},\n\t) {\n\t\tthis.sourceTapeStateCount = context.source_tape?.state_count ?? 0;\n\t}\n\n\tsetSourceTapeStateCount(stateCount: number): void {\n\t\tif (\n\t\t\tthis.context.operation_kind !== \"source_tape\" ||\n\t\t\t!Number.isSafeInteger(stateCount) ||\n\t\t\tstateCount < 0\n\t\t) {\n\t\t\tthrow new Error(\"source-tape state count is invalid\");\n\t\t}\n\t\tthis.sourceTapeStateCount = stateCount;\n\t}\n\n\tobserve(observation: ReconstructionObservation): void {\n\t\ttry {\n\t\t\tthis.accept(observation);\n\t\t} catch {\n\t\t\t// Observer faults must never affect production reconstruction.\n\t\t\tthis.totalRecordCount += 1;\n\t\t\tthis.omittedRecordCount += 1;\n\t\t}\n\t}\n\n\tclassifyRecord(\n\t\tselector: {\n\t\t\tkind: SourceForensicsRecordKind;\n\t\t\ttarget_time_ms: number;\n\t\t\tobject_identity: string;\n\t\t},\n\t\tclassification: SourceForensicsClassification,\n\t): void {\n\t\tif (!SOURCE_FORENSICS_CLASSIFICATIONS.includes(classification)) return;\n\t\tconst identity = this.sanitize(selector.object_identity);\n\t\tfor (const record of this.records) {\n\t\t\tif (\n\t\t\t\trecord.kind === selector.kind &&\n\t\t\t\trecord.provider_objects.some(\n\t\t\t\t\t(object) => object.identity === identity,\n\t\t\t\t) &&\n\t\t\t\trecord.target_interval &&\n\t\t\t\tselector.target_time_ms >=\n\t\t\t\t\trecord.target_interval.start_target_time_ms &&\n\t\t\t\tselector.target_time_ms <\n\t\t\t\t\trecord.target_interval.end_target_time_ms_exclusive\n\t\t\t) {\n\t\t\t\trecord.classification = classification;\n\t\t\t}\n\t\t}\n\t}\n\n\tpendingClassificationRequests(): Array<{\n\t\trecord_key: string;\n\t\tobject_identities: string[];\n\t}> {\n\t\tconst expected = this.context.expected_provider_object_identities.map(\n\t\t\t(identity) => this.sanitize(identity),\n\t\t);\n\t\treturn this.records.flatMap((record, index) => {\n\t\t\tconst original = record.provider_objects[0]?.identity;\n\t\t\tif (!original || record.classification !== \"unresolved\") return [];\n\t\t\tconst expectedIndex = expected.indexOf(original);\n\t\t\tconst identities = [\n\t\t\t\texpectedIndex > 0 ? expected[expectedIndex - 1] : undefined,\n\t\t\t\toriginal,\n\t\t\t\texpectedIndex >= 0 ? expected[expectedIndex + 1] : undefined,\n\t\t\t].filter((value): value is string => value !== undefined);\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\trecord_key: `pending-record-${index}`,\n\t\t\t\t\tobject_identities: [...new Set(identities)],\n\t\t\t\t},\n\t\t\t];\n\t\t});\n\t}\n\n\tapplyRecordClassification(input: {\n\t\trecord_key: string;\n\t\tclassification: SourceForensicsClassification;\n\t\tobjects: SourceObjectEvidence[];\n\t}): void {\n\t\tconst match = /^pending-record-(\\d+)$/u.exec(input.record_key);\n\t\tconst index = match ? Number(match[1]) : Number.NaN;\n\t\tconst record = this.records[index];\n\t\tif (\n\t\t\t!record ||\n\t\t\t!SOURCE_FORENSICS_CLASSIFICATIONS.includes(input.classification)\n\t\t) {\n\t\t\tthrow new Error(\"source record classification reference is invalid\");\n\t\t}\n\t\trecord.classification = input.classification;\n\t\trecord.provider_objects = mergeObjects([\n\t\t\t...record.provider_objects,\n\t\t\t...input.objects.map((object) => this.retainObject(object)),\n\t\t]);\n\t}\n\n\tprivate get retainedLimit(): number {\n\t\treturn Math.min(\n\t\t\tSOURCE_FORENSICS_MAX_RECORDS,\n\t\t\tthis.testingLimits.maxRetainedRecords ?? SOURCE_FORENSICS_MAX_RECORDS,\n\t\t);\n\t}\n\n\tprivate sanitize(value: string): string {\n\t\tlet result = value;\n\t\tfor (const secret of this.context.redact_values ?? []) {\n\t\t\tif (secret) result = result.replaceAll(secret, \"[REDACTED]\");\n\t\t}\n\t\treturn result.slice(0, 1024);\n\t}\n\n\tprivate retainObject(input: SourceObjectEvidence): SourceObjectEvidence {\n\t\tconst object = {\n\t\t\t...input,\n\t\t\tidentity: this.sanitize(input.identity),\n\t\t\tchecksums: [...new Set(input.checksums)].sort(),\n\t\t};\n\t\tconst existing = this.providerObjects.get(object.identity);\n\t\tconst merged = mergeObjects(existing ? [existing, object] : [object]);\n\t\tthis.providerObjects.set(\n\t\t\tobject.identity,\n\t\t\tmerged[0] as SourceObjectEvidence,\n\t\t);\n\t\treturn object;\n\t}\n\n\tprivate sanitizeAnchor(input: SourceAnchorEvidence): SourceAnchorEvidence {\n\t\treturn {\n\t\t\t...input,\n\t\t\tobject_identity: this.sanitize(input.object_identity),\n\t\t};\n\t}\n\n\tprivate interval(\n\t\ttargetTimes: readonly number[],\n\t): SourceTargetInterval | null {\n\t\tconst requiredTargetTimes = (this.context.required_clock_targets ?? []).map(\n\t\t\t({ target_time_ms }) => target_time_ms,\n\t\t);\n\t\tconst targets = [...new Set(targetTimes)]\n\t\t\t.filter((target) => requiredTargetTimes.includes(target))\n\t\t\t.sort((left, right) => left - right);\n\t\tconst first = targets[0];\n\t\tconst last = targets.at(-1);\n\t\tif (first === undefined || last === undefined) return null;\n\t\tconst lastIndex = requiredTargetTimes.indexOf(last);\n\t\treturn {\n\t\t\tstart_target_time_ms: first,\n\t\t\tend_target_time_ms_exclusive:\n\t\t\t\trequiredTargetTimes[lastIndex + 1] ?? last + 1,\n\t\t\ttarget_count: targets.length,\n\t\t};\n\t}\n\n\tprivate markAffected(interval: SourceTargetInterval | null): void {\n\t\tif (!interval) return;\n\t\tfor (const { target_time_ms: target } of this.context\n\t\t\t.required_clock_targets ?? []) {\n\t\t\tif (\n\t\t\t\ttarget >= interval.start_target_time_ms &&\n\t\t\t\ttarget < interval.end_target_time_ms_exclusive\n\t\t\t) {\n\t\t\t\tthis.affectedTargets.add(target);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate mergeAdjacent(\n\t\tprevious: PendingSourceForensicsRecord,\n\t\trecord: PendingSourceForensicsRecord,\n\t): boolean {\n\t\tconst interval = record.target_interval;\n\t\tif (\n\t\t\t!interval ||\n\t\t\t!previous.target_interval ||\n\t\t\tprevious.kind !== record.kind ||\n\t\t\tprevious.target_interval.end_target_time_ms_exclusive !==\n\t\t\t\tinterval.start_target_time_ms\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t\tprevious.target_interval = {\n\t\t\t...previous.target_interval,\n\t\t\tend_target_time_ms_exclusive: interval.end_target_time_ms_exclusive,\n\t\t\ttarget_count:\n\t\t\t\tprevious.target_interval.target_count + interval.target_count,\n\t\t};\n\t\tprevious.provider_objects = mergeObjects([\n\t\t\t...previous.provider_objects,\n\t\t\t...record.provider_objects,\n\t\t]);\n\t\tif (previous.lag_distribution && record.lag_distribution) {\n\t\t\tfor (const key of Object.keys(previous.lag_distribution) as Array<\n\t\t\t\tkeyof SourceLagDistribution\n\t\t\t>) {\n\t\t\t\tprevious.lag_distribution[key] += record.lag_distribution[key];\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tprivate append(\n\t\trecord: PendingSourceForensicsRecord,\n\t): PendingSourceForensicsRecord {\n\t\tconst previous = this.lastOmittedRecord ?? this.records.at(-1);\n\t\tif (previous && this.mergeAdjacent(previous, record)) return previous;\n\t\tthis.totalRecordCount += 1;\n\t\tif (this.records.length < this.retainedLimit) {\n\t\t\tthis.records.push(record);\n\t\t\treturn record;\n\t\t}\n\t\tthis.omittedRecordCount += 1;\n\t\tthis.lastOmittedRecord = record;\n\t\treturn record;\n\t}\n\n\tprivate accept(observation: ReconstructionObservation): void {\n\t\tif (observation.type === \"provider_object_boundary\") {\n\t\t\tthis.retainObject(observation.object);\n\t\t\treturn;\n\t\t}\n\t\tif (\n\t\t\tobservation.type === \"snapshot_anchor\" ||\n\t\t\tobservation.type === \"reanchor\"\n\t\t) {\n\t\t\tconst anchor = this.sanitizeAnchor(observation.anchor);\n\t\t\tif (this.pendingGapRecord) this.pendingGapRecord.next_anchor = anchor;\n\t\t\tthis.pendingGapRecord = null;\n\t\t\tthis.previousAnchor = anchor;\n\t\t\treturn;\n\t\t}\n\t\tif (observation.type === \"sequence_discontinuity\") {\n\t\t\tthis.pendingGapRecord = this.append({\n\t\t\t\tkind: \"sequence_discontinuity\",\n\t\t\t\tscope: this.context.scope,\n\t\t\t\tprovider_objects: [this.retainObject(observation.object)],\n\t\t\t\tprevious_anchor: this.previousAnchor,\n\t\t\t\tnext_anchor: null,\n\t\t\t\ttarget_interval: null,\n\t\t\t\tlag_distribution: null,\n\t\t\t\tsequence: observation.sequence,\n\t\t\t\tclassification: \"unresolved\",\n\t\t\t\tadapter_version: this.context.adapter_version,\n\t\t\t});\n\t\t\tthis.previousAnchor = null;\n\t\t\treturn;\n\t\t}\n\t\tif (observation.type === \"provider_object_checksum_conflict\") {\n\t\t\tconst object = this.retainObject(observation.object);\n\t\t\tconst interval = this.interval(observation.affected_target_times_ms);\n\t\t\tthis.markAffected(interval);\n\t\t\tthis.append({\n\t\t\t\tkind: \"provider_object_checksum_conflict\",\n\t\t\t\tscope: this.context.scope,\n\t\t\t\tprovider_objects: [object],\n\t\t\t\tprevious_anchor: this.previousAnchor,\n\t\t\t\tnext_anchor: null,\n\t\t\t\ttarget_interval: interval,\n\t\t\t\tlag_distribution: null,\n\t\t\t\tsequence: null,\n\t\t\t\tclassification:\n\t\t\t\t\tobject.checksums.length > 1 ? \"mutable_provider_bytes\" : \"unresolved\",\n\t\t\t\tadapter_version: this.context.adapter_version,\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tif (observation.type !== \"required_clock_sample\") {\n\t\t\treturn;\n\t\t}\n\t\tthis.targetObservations.set(observation.target_time_ms, observation);\n\t\tif (observation.status === \"covered\") return;\n\n\t\tconst interval = this.interval([observation.target_time_ms]);\n\t\tif (!interval) throw new Error(\"observed target is outside required clock\");\n\t\tthis.markAffected(interval);\n\t\tconst kind =\n\t\t\tobservation.status === \"unanchored\"\n\t\t\t\t? \"unanchored_target_interval\"\n\t\t\t\t: observation.status === \"stale\"\n\t\t\t\t\t? \"stale_target_interval\"\n\t\t\t\t\t: \"future_state_interval\";\n\t\tthis.append({\n\t\t\tkind,\n\t\t\tscope: this.context.scope,\n\t\t\tprovider_objects: observation.object\n\t\t\t\t? [this.retainObject(observation.object)]\n\t\t\t\t: [],\n\t\t\tprevious_anchor: this.previousAnchor,\n\t\t\tnext_anchor: null,\n\t\t\ttarget_interval: interval,\n\t\t\tlag_distribution: lagDistribution(observation.lag_ms),\n\t\t\tsequence: null,\n\t\t\tclassification: \"unresolved\",\n\t\t\tadapter_version: this.context.adapter_version,\n\t\t});\n\t\tif (this.pendingGapRecord) {\n\t\t\tthis.pendingGapRecord.target_interval = this.pendingGapRecord\n\t\t\t\t.target_interval\n\t\t\t\t? {\n\t\t\t\t\t\t...this.pendingGapRecord.target_interval,\n\t\t\t\t\t\tend_target_time_ms_exclusive: interval.end_target_time_ms_exclusive,\n\t\t\t\t\t\ttarget_count:\n\t\t\t\t\t\t\tthis.pendingGapRecord.target_interval.target_count + 1,\n\t\t\t\t\t}\n\t\t\t\t: interval;\n\t\t}\n\t}\n\n\tfinish(): SourceForensicsLedgerWire {\n\t\tconst pendingRecords = structuredClone(this.records);\n\t\tconst finalized = pendingRecords\n\t\t\t.map(finalizeRecord)\n\t\t\t.sort((left, right) =>\n\t\t\t\tjcsCanonicalize(left).localeCompare(jcsCanonicalize(right)),\n\t\t\t);\n\t\tlet retained = finalized;\n\t\tlet retainedProviderObjects = mergeObjects([\n\t\t\t...this.providerObjects.values(),\n\t\t]);\n\t\tlet total = this.totalRecordCount;\n\t\tlet omitted = this.omittedRecordCount;\n\t\tlet unresolved =\n\t\t\tfinalized.filter((record) => record.classification === \"unresolved\")\n\t\t\t\t.length + this.omittedRecordCount;\n\t\tconst byteLimit = Math.min(\n\t\t\tSOURCE_FORENSICS_MAX_CANONICAL_JSON_BYTES,\n\t\t\tthis.testingLimits.maxCanonicalJsonBytes ??\n\t\t\t\tSOURCE_FORENSICS_MAX_CANONICAL_JSON_BYTES,\n\t\t);\n\t\tconst expectedIdentities = [\n\t\t\t...new Set(\n\t\t\t\tthis.context.expected_provider_object_identities.map((identity) =>\n\t\t\t\t\tthis.sanitize(identity),\n\t\t\t\t),\n\t\t\t),\n\t\t].sort();\n\t\tconst observedIdentities = [...this.providerObjects.keys()].sort();\n\t\tconst expectedSelectedIntervals = orderedIntervals(\n\t\t\tthis.context.expected_selected_intervals ??\n\t\t\t\texpectedIdentities.flatMap((identity) => {\n\t\t\t\t\tconst interval = providerObjectInterval(identity);\n\t\t\t\t\treturn interval ? [interval] : [];\n\t\t\t\t}),\n\t\t);\n\t\tconst observedSelectedIntervals = orderedIntervals(\n\t\t\tobservedIdentities.flatMap((identity) => {\n\t\t\t\tconst interval = providerObjectInterval(identity);\n\t\t\t\treturn interval ? [interval] : [];\n\t\t\t}),\n\t\t);\n\t\tconst inventoryCoordinatesComplete =\n\t\t\tnew Set(expectedIdentities).size === expectedIdentities.length &&\n\t\t\tnew Set(observedIdentities).size === observedIdentities.length &&\n\t\t\tJSON.stringify(expectedIdentities) ===\n\t\t\t\tJSON.stringify(observedIdentities) &&\n\t\t\tJSON.stringify(expectedSelectedIntervals) ===\n\t\t\t\tJSON.stringify(observedSelectedIntervals);\n\t\tconst inventoryComplete = (): boolean =>\n\t\t\tinventoryCoordinatesComplete &&\n\t\t\tJSON.stringify(\n\t\t\t\tretainedProviderObjects.map(({ identity }) => identity),\n\t\t\t) === JSON.stringify(observedIdentities) &&\n\t\t\tretainedProviderObjects.every(\n\t\t\t\t(object) => object.checksums.length === 1 && !object.quarantined,\n\t\t\t);\n\t\tconst targetTimes = (this.context.required_clock_targets ?? []).map(\n\t\t\t({ target_time_ms }) => target_time_ms,\n\t\t);\n\t\tconst inferredWindow = {\n\t\t\tstart_time_ms:\n\t\t\t\tMath.min(\n\t\t\t\t\t...targetTimes,\n\t\t\t\t\t...expectedSelectedIntervals.map(\n\t\t\t\t\t\t({ start_time_ms }) => start_time_ms,\n\t\t\t\t\t),\n\t\t\t\t) || 0,\n\t\t\tend_time_ms_exclusive:\n\t\t\t\tMath.max(\n\t\t\t\t\t...targetTimes.map((target) => target + 1),\n\t\t\t\t\t...expectedSelectedIntervals.map(\n\t\t\t\t\t\t({ end_time_ms_exclusive }) => end_time_ms_exclusive,\n\t\t\t\t\t),\n\t\t\t\t) || 1,\n\t\t};\n\t\tconst operationKind =\n\t\t\tthis.context.operation_kind ?? \"required_clock_qualification\";\n\t\tconst normalizedInvocationSha256 =\n\t\t\tthis.context.normalized_invocation_sha256 ?? this.context.idempotency_key;\n\t\tif (!normalizedInvocationSha256) {\n\t\t\tthrow new Error(\"source-forensics normalized invocation is missing\");\n\t\t}\n\n\t\tconst targetDispositions = (): SourceTargetDispositionWire[] =>\n\t\t\t(this.context.required_clock_targets ?? []).flatMap((target) => {\n\t\t\t\tconst observation = this.targetObservations.get(target.target_time_ms);\n\t\t\t\tif (!observation) return [];\n\t\t\t\tconst relevantRecords = retained.filter((record) => {\n\t\t\t\t\tconst interval = record.target_interval;\n\t\t\t\t\treturn (\n\t\t\t\t\t\tinterval !== null &&\n\t\t\t\t\t\ttarget.target_time_ms >= interval.start_target_time_ms &&\n\t\t\t\t\t\ttarget.target_time_ms < interval.end_target_time_ms_exclusive\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t\tconst recordSha256s = relevantRecords\n\t\t\t\t\t.map(({ record_sha256 }) => record_sha256)\n\t\t\t\t\t.sort();\n\t\t\t\tlet disposition: SourceTargetDisposition;\n\t\t\t\tif (observation.status === \"covered\" && relevantRecords.length === 0) {\n\t\t\t\t\tdisposition = \"fresh_within_bound\";\n\t\t\t\t} else if (\n\t\t\t\t\tobservation.status === \"stale\" &&\n\t\t\t\t\trelevantRecords.length > 0 &&\n\t\t\t\t\trelevantRecords.every(\n\t\t\t\t\t\t(record) =>\n\t\t\t\t\t\t\trecord.kind === \"stale_target_interval\" &&\n\t\t\t\t\t\t\trecord.classification === \"valid_inactive_market_state\",\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tdisposition = \"valid_inactive_market_state\";\n\t\t\t\t} else if (recordSha256s.length > 0) {\n\t\t\t\t\tdisposition = \"disqualifying\";\n\t\t\t\t} else {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\treturn [\n\t\t\t\t\t{\n\t\t\t\t\t\ttarget_id: target.target_id,\n\t\t\t\t\t\ttarget_time_ms: target.target_time_ms,\n\t\t\t\t\t\tdisposition,\n\t\t\t\t\t\tsource_time_ms: observation.source_time_ms,\n\t\t\t\t\t\tasof_age_ms: observation.lag_ms,\n\t\t\t\t\t\trecord_sha256s: recordSha256s,\n\t\t\t\t\t},\n\t\t\t\t];\n\t\t\t});\n\n\t\tconst build = (): SourceForensicsLedgerWire => {\n\t\t\tconst incomplete = omitted > 0;\n\t\t\tconst dispositions = targetDispositions();\n\t\t\tconst common = {\n\t\t\t\tschema_id: SOURCE_FORENSICS_LEDGER_SCHEMA_ID,\n\t\t\t\toperation_kind: operationKind,\n\t\t\t\tnormalized_invocation_sha256: normalizedInvocationSha256,\n\t\t\t\trequest_id: this.context.request_id,\n\t\t\t\tscope: this.context.scope,\n\t\t\t\twindow: this.context.window ?? inferredWindow,\n\t\t\t\teffective_policies: this.context.effective_policies,\n\t\t\t\tprovider_object_inventory: {\n\t\t\t\t\texpected_identities: expectedIdentities,\n\t\t\t\t\tobserved_identities: observedIdentities,\n\t\t\t\t\texpected_selected_intervals: expectedSelectedIntervals,\n\t\t\t\t\tobserved_selected_intervals: observedSelectedIntervals,\n\t\t\t\t\tcomplete: inventoryComplete(),\n\t\t\t\t},\n\t\t\t\tprovider_objects: retainedProviderObjects,\n\t\t\t\trecords: retained,\n\t\t\t\tlimits: {\n\t\t\t\t\tmax_records: 100_000 as const,\n\t\t\t\t\tmax_canonical_json_bytes: 67_108_864 as const,\n\t\t\t\t},\n\t\t\t\tcomplete: !incomplete,\n\t\t\t\tincomplete_reason: incomplete\n\t\t\t\t\t? (\"forensics_evidence_bound_exceeded\" as const)\n\t\t\t\t\t: null,\n\t\t\t};\n\t\t\tconst recordSummary = {\n\t\t\t\tretained_record_count: retained.length,\n\t\t\t\ttotal_record_count: total,\n\t\t\t\tomitted_record_count: omitted,\n\t\t\t\taffected_target_count: this.affectedTargets.size,\n\t\t\t\tunresolved_record_count: unresolved,\n\t\t\t};\n\t\t\tif (operationKind === \"source_tape\") {\n\t\t\t\tconst content: Omit<SourceTapeForensicsLedgerWire, \"ledger_sha256\"> = {\n\t\t\t\t\t...common,\n\t\t\t\t\toperation_kind: \"source_tape\",\n\t\t\t\t\tsource_tape: {\n\t\t\t\t\t\tproduct_id: \"market-data-source-tape\",\n\t\t\t\t\t\tproduct_version: \"market-data-source-tape/v1\",\n\t\t\t\t\t\tstate_count: this.sourceTapeStateCount,\n\t\t\t\t\t},\n\t\t\t\t\tsummary: recordSummary,\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\t...content,\n\t\t\t\t\tledger_sha256: documentSha256(content, \"ledger_sha256\"),\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (!this.context.required_clock) {\n\t\t\t\tthrow new Error(\"required-clock forensics context is incomplete\");\n\t\t\t}\n\t\t\tconst omittedDispositions =\n\t\t\t\tthis.context.required_clock.event_count - dispositions.length;\n\t\t\tconst content: Omit<\n\t\t\t\tRequiredClockSourceForensicsLedgerWire,\n\t\t\t\t\"ledger_sha256\"\n\t\t\t> = {\n\t\t\t\t...common,\n\t\t\t\toperation_kind: \"required_clock_qualification\",\n\t\t\t\trequired_clock: this.context.required_clock,\n\t\t\t\ttarget_dispositions: dispositions,\n\t\t\t\tsummary: {\n\t\t\t\t\t...recordSummary,\n\t\t\t\t\tdisposition_complete: omittedDispositions === 0,\n\t\t\t\t\tfresh_target_count: dispositions.filter(\n\t\t\t\t\t\t({ disposition }) => disposition === \"fresh_within_bound\",\n\t\t\t\t\t).length,\n\t\t\t\t\tinactive_target_count: dispositions.filter(\n\t\t\t\t\t\t({ disposition }) => disposition === \"valid_inactive_market_state\",\n\t\t\t\t\t).length,\n\t\t\t\t\tdisqualifying_target_count: dispositions.filter(\n\t\t\t\t\t\t({ disposition }) => disposition === \"disqualifying\",\n\t\t\t\t\t).length,\n\t\t\t\t\tomitted_target_disposition_count: omittedDispositions,\n\t\t\t\t},\n\t\t\t};\n\t\t\treturn {\n\t\t\t\t...content,\n\t\t\t\tledger_sha256: documentSha256(content, \"ledger_sha256\"),\n\t\t\t};\n\t\t};\n\n\t\tlet ledger = build();\n\t\tconst size = () =>\n\t\t\tnew TextEncoder().encode(jcsCanonicalize(ledger)).byteLength;\n\t\twhile (size() > byteLimit && retained.length > 0) {\n\t\t\tretained = retained.slice(0, -1);\n\t\t\tomitted += 1;\n\t\t\tledger = build();\n\t\t}\n\t\tlet providerEvidenceOmitted = false;\n\t\twhile (size() > byteLimit && retainedProviderObjects.length > 0) {\n\t\t\tretainedProviderObjects = retainedProviderObjects.slice(0, -1);\n\t\t\tproviderEvidenceOmitted = true;\n\t\t\tledger = build();\n\t\t}\n\t\tif (providerEvidenceOmitted || size() > byteLimit) {\n\t\t\ttotal += 1;\n\t\t\tomitted += 1;\n\t\t\tunresolved += 1;\n\t\t\tledger = build();\n\t\t}\n\t\treturn sourceForensicsLedgerCodecInternal.decode(ledger);\n\t}\n}\n\nexport function classifySourceObjectEvidence(input: {\n\tchecksums: readonly string[];\n\tschemaValid: boolean;\n\tsequenceValid: boolean;\n\tmissingRows: boolean;\n\tcompleteSnapshotDefect: boolean;\n\talternateOrderingClosesGap: boolean;\n\tstaleWithValidPriorState: boolean;\n}): SourceForensicsClassification {\n\tif (new Set(input.checksums).size > 1) return \"mutable_provider_bytes\";\n\tif (!input.schemaValid || input.completeSnapshotDefect) {\n\t\treturn \"stable_object_corruption\";\n\t}\n\tif (input.missingRows) return \"provider_row_loss\";\n\tif (input.alternateOrderingClosesGap) return \"object_boundary_order_defect\";\n\tif (input.sequenceValid && input.staleWithValidPriorState) {\n\t\treturn \"valid_inactive_market_state\";\n\t}\n\treturn \"unresolved\";\n}\n\nexport type SourceObjectInspection = {\n\tchecksum: Sha256Hex;\n\tschemaValid: boolean;\n\tsequenceValid: boolean;\n\tmissingRows: boolean;\n\tcompleteSnapshotDefect: boolean;\n\talternateOrderingClosesGap: boolean;\n\tstaleWithValidPriorState: boolean;\n};\n\n/**\n * Runs the qualification-only, bounded source inspection. The callback may\n * inspect licensed bytes, but this return value deliberately retains only safe\n * identities, checksums and closed predicates. It cannot repair reconstruction\n * or make an interval acceptance-eligible.\n */\nexport async function classifyImplicatedSourceObjects(input: {\n\toriginalIdentity: string;\n\tadjacentIdentities: readonly string[];\n\tmaxAttempts: number;\n\tinspect(\n\t\tidentity: string,\n\t\tattempt: number,\n\t): SourceObjectInspection | Promise<SourceObjectInspection>;\n}): Promise<{\n\tclassification: SourceForensicsClassification;\n\tobjects: SourceObjectEvidence[];\n\tacceptanceEligible: false;\n}> {\n\tif (\n\t\t!input.originalIdentity ||\n\t\tinput.adjacentIdentities.length > 2 ||\n\t\t!Number.isSafeInteger(input.maxAttempts) ||\n\t\tinput.maxAttempts < 1 ||\n\t\tinput.maxAttempts > 3\n\t) {\n\t\tthrow new Error(\"implicated source inspection bounds are invalid\");\n\t}\n\tconst identities = [input.originalIdentity, ...input.adjacentIdentities];\n\tif (new Set(identities).size !== identities.length) {\n\t\tthrow new Error(\"implicated source inspection identities must be unique\");\n\t}\n\n\tconst inspections = new Map<string, SourceObjectInspection[]>();\n\tfor (const identity of identities) {\n\t\tconst attempts: SourceObjectInspection[] = [];\n\t\tfor (let attempt = 1; attempt <= input.maxAttempts; attempt += 1) {\n\t\t\tconst inspected = await input.inspect(identity, attempt);\n\t\t\tif (!/^[a-f0-9]{64}$/u.test(inspected.checksum)) {\n\t\t\t\tthrow new Error(\"source inspection checksum is invalid\");\n\t\t\t}\n\t\t\tattempts.push(inspected);\n\t\t}\n\t\tinspections.set(identity, attempts);\n\t}\n\n\tconst mutable = [...inspections.values()].some(\n\t\t(attempts) => new Set(attempts.map(({ checksum }) => checksum)).size > 1,\n\t);\n\tconst all = [...inspections.values()].flat();\n\tconst classification = mutable\n\t\t? \"mutable_provider_bytes\"\n\t\t: classifySourceObjectEvidence({\n\t\t\t\tchecksums: all.length > 0 ? [all[0]?.checksum as string] : [],\n\t\t\t\tschemaValid: all.every(({ schemaValid }) => schemaValid),\n\t\t\t\tsequenceValid: all.every(({ sequenceValid }) => sequenceValid),\n\t\t\t\tmissingRows: all.some(({ missingRows }) => missingRows),\n\t\t\t\tcompleteSnapshotDefect: all.some(\n\t\t\t\t\t({ completeSnapshotDefect }) => completeSnapshotDefect,\n\t\t\t\t),\n\t\t\t\talternateOrderingClosesGap: all.some(\n\t\t\t\t\t({ alternateOrderingClosesGap }) => alternateOrderingClosesGap,\n\t\t\t\t),\n\t\t\t\tstaleWithValidPriorState: all.some(\n\t\t\t\t\t({ staleWithValidPriorState }) => staleWithValidPriorState,\n\t\t\t\t),\n\t\t\t});\n\n\treturn {\n\t\tclassification,\n\t\tobjects: identities.map((identity) => {\n\t\t\tconst attempts = inspections.get(identity) as SourceObjectInspection[];\n\t\t\treturn {\n\t\t\t\tidentity,\n\t\t\t\tchecksums: [\n\t\t\t\t\t...new Set(attempts.map(({ checksum }) => checksum)),\n\t\t\t\t].sort(),\n\t\t\t\tattempt_count: attempts.length,\n\t\t\t\tquarantined:\n\t\t\t\t\tclassification === \"mutable_provider_bytes\" ||\n\t\t\t\t\tclassification === \"stable_object_corruption\",\n\t\t\t};\n\t\t}),\n\t\tacceptanceEligible: false,\n\t};\n}\n\nexport async function classifySourceForensicsRecordsDeduplicated(input: {\n\trequests: readonly {\n\t\trecord_key: string;\n\t\tobject_identities: readonly string[];\n\t}[];\n\tmaxAttempts: number;\n\tinspect(\n\t\tidentity: string,\n\t\tattempt: number,\n\t): SourceObjectInspection | Promise<SourceObjectInspection>;\n}): Promise<\n\tArray<{\n\t\trecord_key: string;\n\t\tclassification: SourceForensicsClassification;\n\t\tobjects: SourceObjectEvidence[];\n\t}>\n> {\n\tif (\n\t\t!Number.isSafeInteger(input.maxAttempts) ||\n\t\tinput.maxAttempts < 1 ||\n\t\tinput.maxAttempts > 3\n\t) {\n\t\tthrow new Error(\"source record inspection retry bound is invalid\");\n\t}\n\tconst inspections = new Map<string, SourceObjectInspection[]>();\n\tfor (const request of input.requests) {\n\t\tif (\n\t\t\t!request.record_key ||\n\t\t\trequest.object_identities.length === 0 ||\n\t\t\trequest.object_identities.length > 3 ||\n\t\t\tnew Set(request.object_identities).size !==\n\t\t\t\trequest.object_identities.length\n\t\t) {\n\t\t\tthrow new Error(\"source record inspection scope is invalid\");\n\t\t}\n\t\tfor (const identity of request.object_identities) {\n\t\t\tif (inspections.has(identity)) continue;\n\t\t\tconst attempts: SourceObjectInspection[] = [];\n\t\t\tfor (let attempt = 1; attempt <= input.maxAttempts; attempt += 1) {\n\t\t\t\tconst inspected = await input.inspect(identity, attempt);\n\t\t\t\tif (!/^[a-f0-9]{64}$/u.test(inspected.checksum)) {\n\t\t\t\t\tthrow new Error(\"source inspection checksum is invalid\");\n\t\t\t\t}\n\t\t\t\tattempts.push(inspected);\n\t\t\t}\n\t\t\tinspections.set(identity, attempts);\n\t\t}\n\t}\n\treturn input.requests.map((request) => {\n\t\tconst selected = request.object_identities.flatMap(\n\t\t\t(identity) => inspections.get(identity) as SourceObjectInspection[],\n\t\t);\n\t\tconst mutable = request.object_identities.some((identity) => {\n\t\t\tconst attempts = inspections.get(identity) as SourceObjectInspection[];\n\t\t\treturn new Set(attempts.map(({ checksum }) => checksum)).size > 1;\n\t\t});\n\t\tconst classification = mutable\n\t\t\t? \"mutable_provider_bytes\"\n\t\t\t: classifySourceObjectEvidence({\n\t\t\t\t\tchecksums:\n\t\t\t\t\t\tselected.length > 0 ? [selected[0]?.checksum as string] : [],\n\t\t\t\t\tschemaValid: selected.every(({ schemaValid }) => schemaValid),\n\t\t\t\t\tsequenceValid: selected.every(({ sequenceValid }) => sequenceValid),\n\t\t\t\t\tmissingRows: selected.some(({ missingRows }) => missingRows),\n\t\t\t\t\tcompleteSnapshotDefect: selected.some(\n\t\t\t\t\t\t({ completeSnapshotDefect }) => completeSnapshotDefect,\n\t\t\t\t\t),\n\t\t\t\t\talternateOrderingClosesGap: selected.some(\n\t\t\t\t\t\t({ alternateOrderingClosesGap }) => alternateOrderingClosesGap,\n\t\t\t\t\t),\n\t\t\t\t\tstaleWithValidPriorState: selected.some(\n\t\t\t\t\t\t({ staleWithValidPriorState }) => staleWithValidPriorState,\n\t\t\t\t\t),\n\t\t\t\t});\n\t\treturn {\n\t\t\trecord_key: request.record_key,\n\t\t\tclassification,\n\t\t\tobjects: request.object_identities.map((identity) => {\n\t\t\t\tconst attempts = inspections.get(identity) as SourceObjectInspection[];\n\t\t\t\tconst checksums = [\n\t\t\t\t\t...new Set(attempts.map(({ checksum }) => checksum)),\n\t\t\t\t].sort() as Sha256Hex[];\n\t\t\t\treturn {\n\t\t\t\t\tidentity,\n\t\t\t\t\tchecksums,\n\t\t\t\t\tattempt_count: attempts.length,\n\t\t\t\t\tquarantined:\n\t\t\t\t\t\tclassification === \"mutable_provider_bytes\" ||\n\t\t\t\t\t\tclassification === \"stable_object_corruption\",\n\t\t\t\t};\n\t\t\t}),\n\t\t};\n\t});\n}\n\nexport function evaluateSourceQualificationGates(\n\tledgerInput: SourceForensicsLedgerWire,\n\tsourceReconstructionAccepted: boolean,\n):\n\t| {\n\t\t\toperation_kind: \"required_clock_qualification\";\n\t\t\tqualified: boolean;\n\t\t\tsource_partition_complete: boolean;\n\t\t\tsource_event_enumeration_eligible: boolean;\n\t }\n\t| {\n\t\t\toperation_kind: \"source_tape\";\n\t\t\tsource_event_enumeration_eligible: boolean;\n\t\t\tsource_tape_eligible: boolean;\n\t } {\n\tconst ledger = sourceForensicsLedgerCodecInternal.decode(ledgerInput);\n\tconst enumerationEvidenceAccepted = ledger.records.every(\n\t\t(record) =>\n\t\t\trecord.kind === \"stale_target_interval\" &&\n\t\t\trecord.classification === \"valid_inactive_market_state\",\n\t);\n\tconst sourceEventEnumerationEligible =\n\t\tledger.complete &&\n\t\tledger.provider_object_inventory.complete &&\n\t\tenumerationEvidenceAccepted;\n\tif (ledger.operation_kind === \"source_tape\") {\n\t\treturn {\n\t\t\toperation_kind: \"source_tape\",\n\t\t\tsource_event_enumeration_eligible: sourceEventEnumerationEligible,\n\t\t\tsource_tape_eligible:\n\t\t\t\tsourceReconstructionAccepted &&\n\t\t\t\tsourceEventEnumerationEligible &&\n\t\t\t\tledger.source_tape.state_count > 0,\n\t\t};\n\t}\n\tconst sourcePartitionComplete =\n\t\tledger.complete &&\n\t\tledger.summary.disposition_complete &&\n\t\tledger.summary.disqualifying_target_count === 0 &&\n\t\tledger.target_dispositions.every(({ record_sha256s }) =>\n\t\t\trecord_sha256s.every((sha) =>\n\t\t\t\tledger.records.some(({ record_sha256 }) => record_sha256 === sha),\n\t\t\t),\n\t\t);\n\treturn {\n\t\toperation_kind: \"required_clock_qualification\",\n\t\tqualified:\n\t\t\tsourceReconstructionAccepted &&\n\t\t\tledger.complete &&\n\t\t\tledger.summary.disposition_complete &&\n\t\t\tledger.summary.fresh_target_count === ledger.required_clock.event_count &&\n\t\t\tledger.summary.inactive_target_count === 0 &&\n\t\t\tledger.summary.disqualifying_target_count === 0,\n\t\tsource_partition_complete: sourcePartitionComplete,\n\t\tsource_event_enumeration_eligible:\n\t\t\tsourcePartitionComplete && sourceEventEnumerationEligible,\n\t};\n}\n\nexport async function commitSourceQualificationEvidence(input: {\n\toutputDirectory: string;\n\tledgerFileName: string;\n\tqualificationFileName: string;\n\tledger: SourceForensicsLedgerWire;\n\tcreatedAt: string;\n\tsourceAccepted: boolean;\n\trequiredClock?: RequiredClockWire;\n\trequiredClockFailureReason?: (typeof REQUIRED_CLOCK_QUALIFICATION_FAILURE_REASONS)[number];\n\tsourceTapeInitializer?: SourceTapeInitializerDescriptor;\n\tsourceTapeOutcome?: SourceTapeQualificationRecordWire[\"outcome\"];\n\tcleanupLicensedPayloads?: () => void | Promise<void>;\n}): Promise<SourceQualificationRecordWire> {\n\tassertSidecarBasename(input.ledgerFileName);\n\tassertSidecarBasename(input.qualificationFileName);\n\tif (\n\t\tinput.ledger.operation_kind === \"required_clock_qualification\" &&\n\t\t!input.requiredClock\n\t) {\n\t\tthrow new Error(\n\t\t\t\"source qualification requires the authoritative required clock\",\n\t\t);\n\t}\n\tconst ledger = sourceForensicsLedgerCodec.decode(\n\t\tinput.ledger,\n\t\tinput.requiredClock ? { requiredClock: input.requiredClock } : undefined,\n\t);\n\tconst ledgerBytes = new TextEncoder().encode(jcsCanonicalize(ledger));\n\tconst ledgerPath = path.join(input.outputDirectory, input.ledgerFileName);\n\tconst qualificationPath = path.join(\n\t\tinput.outputDirectory,\n\t\tinput.qualificationFileName,\n\t);\n\ttry {\n\t\tawait writeExclusiveDurableFile(ledgerPath, ledgerBytes);\n\t\tconst gates = evaluateSourceQualificationGates(\n\t\t\tledger,\n\t\t\tinput.sourceAccepted,\n\t\t);\n\t\tconst ledgerDescriptor = {\n\t\t\tschema_id: SOURCE_FORENSICS_LEDGER_SCHEMA_ID,\n\t\t\tfile_name: input.ledgerFileName,\n\t\t\tsha256: createHash(\"sha256\").update(ledgerBytes).digest(\"hex\"),\n\t\t\tbytes: ledgerBytes.byteLength,\n\t\t\tretained_record_count: ledger.summary.retained_record_count,\n\t\t\ttotal_record_count: ledger.summary.total_record_count,\n\t\t\tomitted_record_count: ledger.summary.omitted_record_count,\n\t\t\tcomplete: ledger.complete,\n\t\t};\n\t\tconst ledgerEvidenceDescriptor: SourceEvidenceDescriptor = {\n\t\t\tkind: \"ledger\",\n\t\t\tfile_name: input.ledgerFileName,\n\t\t\tsha256: ledgerDescriptor.sha256 as Sha256Hex,\n\t\t\tbytes: ledgerDescriptor.bytes,\n\t\t};\n\t\tconst sourceTapeOutcome = input.sourceTapeOutcome\n\t\t\t? {\n\t\t\t\t\t...input.sourceTapeOutcome,\n\t\t\t\t\tpartial_evidence: [\n\t\t\t\t\t\tledgerEvidenceDescriptor,\n\t\t\t\t\t\t...input.sourceTapeOutcome.partial_evidence.filter(\n\t\t\t\t\t\t\t(descriptor) =>\n\t\t\t\t\t\t\t\tdescriptor.kind !== \"ledger\" &&\n\t\t\t\t\t\t\t\tdescriptor.file_name !== input.ledgerFileName,\n\t\t\t\t\t\t),\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t: undefined;\n\t\tconst qualification =\n\t\t\tledger.operation_kind === \"required_clock_qualification\" &&\n\t\t\tgates.operation_kind === \"required_clock_qualification\"\n\t\t\t\t? finalizeSourceQualificationRecord({\n\t\t\t\t\t\tschema_id: SOURCE_QUALIFICATION_RECORD_SCHEMA_ID,\n\t\t\t\t\t\tcreated_at: input.createdAt,\n\t\t\t\t\t\toperation_kind: \"required_clock_qualification\",\n\t\t\t\t\t\tnormalized_invocation_sha256: ledger.normalized_invocation_sha256,\n\t\t\t\t\t\trequest_id: ledger.request_id,\n\t\t\t\t\t\tscope: ledger.scope,\n\t\t\t\t\t\tledger: {\n\t\t\t\t\t\t\t...ledgerDescriptor,\n\t\t\t\t\t\t\tdisposition_complete: ledger.summary.disposition_complete,\n\t\t\t\t\t\t\tfresh_target_count: ledger.summary.fresh_target_count,\n\t\t\t\t\t\t\tinactive_target_count: ledger.summary.inactive_target_count,\n\t\t\t\t\t\t\tdisqualifying_target_count:\n\t\t\t\t\t\t\t\tledger.summary.disqualifying_target_count,\n\t\t\t\t\t\t\tomitted_target_disposition_count:\n\t\t\t\t\t\t\t\tledger.summary.omitted_target_disposition_count,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsource_reconstruction_accepted: input.sourceAccepted,\n\t\t\t\t\t\tqualified: gates.qualified,\n\t\t\t\t\t\tsource_partition_complete: gates.source_partition_complete,\n\t\t\t\t\t\tsource_event_enumeration_eligible:\n\t\t\t\t\t\t\tgates.source_event_enumeration_eligible,\n\t\t\t\t\t\toutcome: input.sourceAccepted\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\t\t\t\t\treason: \"required_clock_qualification_completed\",\n\t\t\t\t\t\t\t\t\tpartial_evidence: [ledgerEvidenceDescriptor],\n\t\t\t\t\t\t\t\t\texporter_result: null,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\tstatus: \"failure\",\n\t\t\t\t\t\t\t\t\treason:\n\t\t\t\t\t\t\t\t\t\tinput.requiredClockFailureReason ??\n\t\t\t\t\t\t\t\t\t\t\"required_clock_reconstruction_failed\",\n\t\t\t\t\t\t\t\t\tpartial_evidence: [ledgerEvidenceDescriptor],\n\t\t\t\t\t\t\t\t\texporter_result: null,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t})\n\t\t\t\t: ledger.operation_kind === \"source_tape\" &&\n\t\t\t\t\t\tgates.operation_kind === \"source_tape\" &&\n\t\t\t\t\t\tsourceTapeOutcome &&\n\t\t\t\t\t\t(sourceTapeOutcome.status === \"failure\" ||\n\t\t\t\t\t\t\tinput.sourceTapeInitializer)\n\t\t\t\t\t? finalizeSourceQualificationRecord({\n\t\t\t\t\t\t\tschema_id: SOURCE_QUALIFICATION_RECORD_SCHEMA_ID,\n\t\t\t\t\t\t\tcreated_at: input.createdAt,\n\t\t\t\t\t\t\toperation_kind: \"source_tape\",\n\t\t\t\t\t\t\tnormalized_invocation_sha256: ledger.normalized_invocation_sha256,\n\t\t\t\t\t\t\trequest_id: ledger.request_id,\n\t\t\t\t\t\t\tscope: ledger.scope,\n\t\t\t\t\t\t\tledger: {\n\t\t\t\t\t\t\t\t...ledgerDescriptor,\n\t\t\t\t\t\t\t\tstate_count: ledger.source_tape.state_count,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tinitializer: input.sourceTapeInitializer ?? null,\n\t\t\t\t\t\t\tsource_reconstruction_accepted: input.sourceAccepted,\n\t\t\t\t\t\t\tsource_event_enumeration_eligible:\n\t\t\t\t\t\t\t\tgates.source_event_enumeration_eligible,\n\t\t\t\t\t\t\tsource_tape_eligible:\n\t\t\t\t\t\t\t\tgates.source_tape_eligible &&\n\t\t\t\t\t\t\t\tsourceTapeOutcome.status === \"success\",\n\t\t\t\t\t\t\toutcome: sourceTapeOutcome,\n\t\t\t\t\t\t})\n\t\t\t\t\t: (() => {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t\"source qualification operation outcome is incomplete\",\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})();\n\t\tawait atomicWriteJsonResult(qualificationPath, qualification, {\n\t\t\tvalidate: (value) => sourceQualificationRecordCodec.decode(value),\n\t\t});\n\t\treturn qualification;\n\t} finally {\n\t\tawait input.cleanupLicensedPayloads?.();\n\t}\n}\n",
|
|
189
|
-
"import { createHash, randomUUID } from \"node:crypto\";\nimport { constants as fsConstants, type Stats } from \"node:fs\";\nimport { type FileHandle, lstat, open, rename, unlink } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nexport const FILE_JOB_REQUEST_MAX_BYTES = 1_048_576;\nexport const FILE_JOB_CLOCK_MAX_BYTES = 16_777_216;\nexport const FILE_JOB_EXECUTABLE_MAX_BYTES = 536_870_912;\n\nexport type FileJobPaths = {\n\tattemptRoot: string;\n\trequestPath: string;\n\tresultPath: string;\n};\n\nexport type AtomicWriteHooks = {\n\tbeforeTempOpen?(tempPath: string): void | Promise<void>;\n\tbeforeFileFsync?(): void | Promise<void>;\n\tbeforeRename?(): void | Promise<void>;\n\tbeforeDirectoryFsync?(): void | Promise<void>;\n};\n\nexport type AtomicWriteJsonOptions<T> = {\n\tvalidate?: (value: T) => void;\n\thooks?: AtomicWriteHooks;\n};\n\nexport type DurableArtifactHooks = {\n\tbeforeOpen?(filePath: string): void | Promise<void>;\n\tbeforeFileFsync?(): void | Promise<void>;\n};\n\nexport class FileJobUnreadableError extends Error {\n\tconstructor(message: string) {\n\t\tsuper(message);\n\t\tthis.name = \"FileJobUnreadableError\";\n\t}\n}\n\nfunction errorCode(error: unknown): string | undefined {\n\treturn error && typeof error === \"object\" && \"code\" in error\n\t\t? String((error as { code?: unknown }).code)\n\t\t: undefined;\n}\n\nexport function containsParentTraversal(input: string): boolean {\n\treturn input.split(/[\\\\/]+/u).includes(\"..\");\n}\n\nexport function assertSupportedNode22(\n\tversion = process.versions.node,\n\tproductName = \"market-data preparation executable\",\n): void {\n\tconst major = Number.parseInt(version.split(\".\", 1)[0] ?? \"\", 10);\n\tif (!Number.isInteger(major) || major < 22) {\n\t\tthrow new Error(`${productName} requires Node 22 or newer; got ${version}`);\n\t}\n}\n\nexport function parseFileJobArgv(argv: readonly string[]): {\n\trequestPath: string;\n\tresultPath: string;\n} {\n\tif (\n\t\targv.length !== 5 ||\n\t\targv[0] !== \"run\" ||\n\t\targv[1] !== \"--request\" ||\n\t\targv[3] !== \"--result\" ||\n\t\t!argv[2] ||\n\t\t!argv[4]\n\t) {\n\t\tthrow new Error(\"expected exactly: run --request <path> --result <path>\");\n\t}\n\treturn { requestPath: argv[2], resultPath: argv[4] };\n}\n\nasync function assertAttemptRoot(attemptRoot: string): Promise<void> {\n\tconst stats = await lstat(attemptRoot);\n\tif (stats.isSymbolicLink() || !stats.isDirectory()) {\n\t\tthrow new Error(\"attempt root must be a non-symlink directory\");\n\t}\n}\n\nasync function assertSafeResultTarget(resultPath: string): Promise<void> {\n\tlet stats: Stats;\n\ttry {\n\t\tstats = await lstat(resultPath);\n\t} catch (error) {\n\t\tif (errorCode(error) === \"ENOENT\") return;\n\t\tthrow error;\n\t}\n\tif (stats.isSymbolicLink() || !stats.isFile()) {\n\t\tthrow new Error(\n\t\t\t\"result target must be absent or a non-symlink regular file\",\n\t\t);\n\t}\n\n\tconst handle = await open(\n\t\tresultPath,\n\t\tfsConstants.O_RDONLY | fsConstants.O_NOFOLLOW,\n\t);\n\ttry {\n\t\tif (!(await handle.stat()).isFile()) {\n\t\t\tthrow new Error(\"opened result target is not a regular file\");\n\t\t}\n\t} finally {\n\t\tawait handle.close();\n\t}\n}\n\nexport async function assertSafeFileJobPaths(\n\trequestInput: string,\n\tresultInput: string,\n): Promise<FileJobPaths> {\n\tif (\n\t\tcontainsParentTraversal(requestInput) ||\n\t\tcontainsParentTraversal(resultInput)\n\t) {\n\t\tthrow new FileJobUnreadableError(\"parent traversal is not allowed\");\n\t}\n\tconst requestPath = path.resolve(requestInput);\n\tconst resultPath = path.resolve(resultInput);\n\tconst attemptRoot = path.dirname(requestPath);\n\tif (path.dirname(resultPath) !== attemptRoot) {\n\t\tthrow new Error(\"result parent must be identical to the request parent\");\n\t}\n\tawait assertAttemptRoot(attemptRoot);\n\tawait assertSafeResultTarget(resultPath);\n\treturn { attemptRoot, requestPath, resultPath };\n}\n\nexport function assertSidecarBasename(fileName: string): void {\n\tif (\n\t\tpath.basename(fileName) !== fileName ||\n\t\tcontainsParentTraversal(fileName) ||\n\t\tfileName.includes(\"/\") ||\n\t\tfileName.includes(\"\\\\\")\n\t) {\n\t\tthrow new Error(\"sidecar file name must be a basename\");\n\t}\n}\n\nexport async function readBoundedRegularFile(\n\tfilePath: string,\n\tmaximumBytes: number,\n): Promise<Buffer> {\n\tif (!Number.isSafeInteger(maximumBytes) || maximumBytes < 0) {\n\t\tthrow new Error(\"maximumBytes must be a non-negative safe integer\");\n\t}\n\tlet pathStats: Stats;\n\ttry {\n\t\tpathStats = await lstat(filePath);\n\t} catch (error) {\n\t\tthrow new FileJobUnreadableError(\n\t\t\t`cannot lstat input: ${errorCode(error) ?? \"unknown\"}`,\n\t\t);\n\t}\n\tif (\n\t\tpathStats.isSymbolicLink() ||\n\t\t!pathStats.isFile() ||\n\t\tpathStats.size > maximumBytes\n\t) {\n\t\tthrow new FileJobUnreadableError(\n\t\t\t\"input must be a bounded non-symlink regular file\",\n\t\t);\n\t}\n\n\tlet handle: FileHandle;\n\ttry {\n\t\thandle = await open(\n\t\t\tfilePath,\n\t\t\tfsConstants.O_RDONLY | fsConstants.O_NOFOLLOW,\n\t\t);\n\t} catch (error) {\n\t\tthrow new FileJobUnreadableError(\n\t\t\t`cannot open input: ${errorCode(error) ?? \"unknown\"}`,\n\t\t);\n\t}\n\n\tlet result: Buffer | undefined;\n\tlet readError: FileJobUnreadableError | undefined;\n\ttry {\n\t\tconst openedStats = await handle.stat();\n\t\tif (!openedStats.isFile() || openedStats.size > maximumBytes) {\n\t\t\tthrow new FileJobUnreadableError(\n\t\t\t\t\"opened input must be a bounded regular file\",\n\t\t\t);\n\t\t}\n\t\tconst bytes = Buffer.alloc(openedStats.size);\n\t\tlet offset = 0;\n\t\twhile (offset < bytes.length) {\n\t\t\tconst { bytesRead } = await handle.read(\n\t\t\t\tbytes,\n\t\t\t\toffset,\n\t\t\t\tbytes.length - offset,\n\t\t\t\toffset,\n\t\t\t);\n\t\t\tif (bytesRead === 0) break;\n\t\t\toffset += bytesRead;\n\t\t}\n\t\tconst finalStats = await handle.stat();\n\t\tif (\n\t\t\toffset !== bytes.length ||\n\t\t\tfinalStats.size !== openedStats.size ||\n\t\t\tfinalStats.size > maximumBytes\n\t\t) {\n\t\t\tthrow new FileJobUnreadableError(\"input changed while it was being read\");\n\t\t}\n\t\tresult = bytes;\n\t} catch (error) {\n\t\treadError =\n\t\t\terror instanceof FileJobUnreadableError\n\t\t\t\t? error\n\t\t\t\t: new FileJobUnreadableError(\n\t\t\t\t\t\t`cannot read input: ${errorCode(error) ?? \"unknown\"}`,\n\t\t\t\t\t);\n\t}\n\ttry {\n\t\tawait handle.close();\n\t} catch (error) {\n\t\tif (!readError) {\n\t\t\treadError = new FileJobUnreadableError(\n\t\t\t\t`cannot close input: ${errorCode(error) ?? \"unknown\"}`,\n\t\t\t);\n\t\t}\n\t}\n\tif (readError) throw readError;\n\tif (!result) {\n\t\tthrow new FileJobUnreadableError(\"input read produced no result\");\n\t}\n\treturn result;\n}\n\nexport async function sha256RegularFile(filePath: string): Promise<string> {\n\tconst bytes = await readBoundedRegularFile(\n\t\tfilePath,\n\t\tFILE_JOB_EXECUTABLE_MAX_BYTES,\n\t);\n\treturn createHash(\"sha256\").update(bytes).digest(\"hex\");\n}\n\nexport async function writeExclusiveDurableFile(\n\tfilePath: string,\n\tbytes: Uint8Array,\n\thooks: DurableArtifactHooks = {},\n): Promise<void> {\n\tawait hooks.beforeOpen?.(filePath);\n\tconst handle = await open(\n\t\tfilePath,\n\t\tfsConstants.O_WRONLY |\n\t\t\tfsConstants.O_CREAT |\n\t\t\tfsConstants.O_EXCL |\n\t\t\tfsConstants.O_NOFOLLOW,\n\t\t0o600,\n\t);\n\ttry {\n\t\tif (!(await handle.stat()).isFile()) {\n\t\t\tthrow new Error(\"artifact target is not a regular file\");\n\t\t}\n\t\tawait handle.writeFile(bytes);\n\t\tawait hooks.beforeFileFsync?.();\n\t\tawait handle.sync();\n\t} finally {\n\t\tawait handle.close();\n\t}\n}\n\nfunction redactString(\n\tvalue: string,\n\tsensitiveValues: ReadonlySet<string>,\n): string {\n\tlet redacted = value;\n\tfor (const secret of sensitiveValues) {\n\t\tif (secret) redacted = redacted.replaceAll(secret, \"[REDACTED]\");\n\t}\n\treturn redacted;\n}\n\nexport function redactDiagnostics(\n\tdiagnostics: Readonly<Record<string, string | number | boolean>>,\n\tsensitiveValues: ReadonlySet<string>,\n): Record<string, string | number | boolean> {\n\treturn Object.fromEntries(\n\t\tObject.entries(diagnostics).map(([key, value]) => [\n\t\t\tredactString(key, sensitiveValues),\n\t\t\ttypeof value === \"string\" ? redactString(value, sensitiveValues) : value,\n\t\t]),\n\t);\n}\n\nasync function closeIgnoringErrors(handle: FileHandle | null): Promise<void> {\n\tif (!handle) return;\n\ttry {\n\t\tawait handle.close();\n\t} catch {\n\t\t// Preserve the original durable-write failure.\n\t}\n}\n\nexport async function atomicWriteJsonResult<T>(\n\tresultPath: string,\n\tresult: T,\n\toptions: AtomicWriteJsonOptions<T> = {},\n): Promise<void> {\n\toptions.validate?.(result);\n\tconst serialized = `${JSON.stringify(result)}\\n`;\n\tconst attemptRoot = path.dirname(resultPath);\n\tconst tempPath = path.join(\n\t\tattemptRoot,\n\t\t`.${path.basename(resultPath)}.${randomUUID()}.tmp`,\n\t);\n\tlet tempHandle: FileHandle | null = null;\n\tlet renamed = false;\n\n\ttry {\n\t\ttry {\n\t\t\tawait lstat(tempPath);\n\t\t\tthrow new Error(\"exclusive temporary result path already exists\");\n\t\t} catch (error) {\n\t\t\tif (errorCode(error) !== \"ENOENT\") throw error;\n\t\t}\n\n\t\tawait options.hooks?.beforeTempOpen?.(tempPath);\n\t\ttempHandle = await open(\n\t\t\ttempPath,\n\t\t\tfsConstants.O_WRONLY |\n\t\t\t\tfsConstants.O_CREAT |\n\t\t\t\tfsConstants.O_EXCL |\n\t\t\t\tfsConstants.O_NOFOLLOW,\n\t\t\t0o600,\n\t\t);\n\t\tif (!(await tempHandle.stat()).isFile()) {\n\t\t\tthrow new Error(\"temporary result is not a regular file\");\n\t\t}\n\t\tawait tempHandle.writeFile(serialized, \"utf8\");\n\t\tawait options.hooks?.beforeFileFsync?.();\n\t\tawait tempHandle.sync();\n\t\tawait tempHandle.close();\n\t\ttempHandle = null;\n\n\t\tawait options.hooks?.beforeRename?.();\n\t\tawait rename(tempPath, resultPath);\n\t\trenamed = true;\n\n\t\tconst directoryHandle = await open(\n\t\t\tattemptRoot,\n\t\t\tfsConstants.O_RDONLY | fsConstants.O_DIRECTORY | fsConstants.O_NOFOLLOW,\n\t\t);\n\t\ttry {\n\t\t\tif (!(await directoryHandle.stat()).isDirectory()) {\n\t\t\t\tthrow new Error(\"opened attempt root is not a directory\");\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait options.hooks?.beforeDirectoryFsync?.();\n\t\t\t\tawait directoryHandle.sync();\n\t\t\t} catch (error) {\n\t\t\t\tif (![\"ENOTSUP\", \"EINVAL\"].includes(errorCode(error) ?? \"\")) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tawait directoryHandle.close();\n\t\t}\n\t} catch (error) {\n\t\tawait closeIgnoringErrors(tempHandle);\n\t\tif (!renamed) {\n\t\t\ttry {\n\t\t\t\tawait unlink(tempPath);\n\t\t\t} catch (cleanupError) {\n\t\t\t\tif (errorCode(cleanupError) !== \"ENOENT\") {\n\t\t\t\t\t// The original failure remains authoritative.\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthrow error;\n\t}\n}\n",
|
|
190
|
-
"import {\n\tARCHIVE_SELECTION_SCHEMA_ID,\n\ttype ArchiveSelectionWire,\n\tarchiveSelectionCodec,\n\ttype BackfillArchiveRow,\n\ttype BackfillRequestWire,\n\tbackfillRequestCodec,\n\tfinalizeArchiveSelection,\n\ttype MarketDataVendorBackfillRequest,\n} from \"./contracts\";\nimport { jcsCanonicalize, jcsSha256 } from \"./identity\";\n\nexport type ArchiveQualificationEvidence = {\n\tqualificationEventId: string;\n\tstate: \"qualified\" | \"quarantined\" | \"revoked\";\n\treceiptId: string;\n\tpromotionIdentitySha256: string;\n};\n\nexport type ArchiveSupportAnchorEvidence = {\n\tcaptureBundleId: string;\n\trawCaptureId: string;\n\tsnapshotId: string;\n\tsourceTimeMs: number;\n\tnormalizedSummaryChecksum: string;\n};\n\nexport type ArchiveBundleEvidence = {\n\tcaptureBundleId: string;\n\tcaptureOrigin: \"production_capture\" | \"vendor_historical_backfill\";\n\tstartTimeMs: number;\n\tendTimeMs: number;\n\tqualification: ArchiveQualificationEvidence | null;\n\tsupportAnchors: ArchiveSupportAnchorEvidence[];\n};\n\nfunction fixedTimestamp(timestampMs: number, field: string): string {\n\tif (!Number.isSafeInteger(timestampMs) || timestampMs < 0) {\n\t\tthrow new Error(`${field} must be a non-negative safe integer`);\n\t}\n\treturn new Date(timestampMs).toISOString();\n}\n\nfunction assertStoredSelectionMatchesRequest(\n\trequest: MarketDataVendorBackfillRequest,\n\tselection: ArchiveSelectionWire,\n): void {\n\tif (!request.requiredClock || !request.coveragePolicy) {\n\t\tthrow new Error(\"decoded request is missing final-v1 selection context\");\n\t}\n\tconst expectedScope = {\n\t\texchange: request.scope.exchange,\n\t\ttrading_pair: request.scope.tradingPair,\n\t\tmarket_type: request.scope.marketType,\n\t\tfeed: request.scope.feed,\n\t};\n\tif (\n\t\tjcsSha256(selection.scope) !== jcsSha256(expectedScope) ||\n\t\tselection.required_clock.clock_id !== request.requiredClock.clock_id ||\n\t\tselection.required_clock.clock_sha256 !==\n\t\t\trequest.requiredClock.clock_sha256 ||\n\t\tselection.required_clock.event_count !==\n\t\t\trequest.requiredClock.targets.length ||\n\t\tjcsSha256(selection.coverage_policy) !==\n\t\t\tjcsSha256(request.coveragePolicy) ||\n\t\tselection.source_policy !== request.sourcePolicy\n\t) {\n\t\tthrow new Error(\"stored archive selection conflicts with request content\");\n\t}\n}\n\nfunction eligibleBundles(\n\trequest: MarketDataVendorBackfillRequest,\n\tbundles: readonly ArchiveBundleEvidence[],\n): ArchiveBundleEvidence[] {\n\tconst qualifiedVendorBundles = bundles.filter(\n\t\t(bundle) =>\n\t\t\tbundle.captureOrigin === \"vendor_historical_backfill\" &&\n\t\t\tbundle.qualification?.state === \"qualified\",\n\t);\n\tconst productionBundles = bundles.filter(\n\t\t(bundle) => bundle.captureOrigin === \"production_capture\",\n\t);\n\tif (request.sourcePolicy === \"authoritative_window\") {\n\t\tconst vendorSupport = chooseSupport(request, qualifiedVendorBundles);\n\t\treturn vendorSupport.length === request.requiredClockTargetsMs.length\n\t\t\t? qualifiedVendorBundles\n\t\t\t: productionBundles;\n\t}\n\treturn [...productionBundles, ...qualifiedVendorBundles];\n}\n\nfunction originPriority(\n\trequest: MarketDataVendorBackfillRequest,\n\torigin: ArchiveBundleEvidence[\"captureOrigin\"],\n): number {\n\tif (request.sourcePolicy === \"fill_gaps\") {\n\t\treturn origin === \"production_capture\" ? 0 : 1;\n\t}\n\treturn 0;\n}\n\nfunction chooseSupport(\n\trequest: MarketDataVendorBackfillRequest,\n\tbundles: readonly ArchiveBundleEvidence[],\n): Array<{\n\tbundle: ArchiveBundleEvidence;\n\tanchor: ArchiveSupportAnchorEvidence;\n}> {\n\treturn request.requiredClockTargetsMs.flatMap((targetTimeMs) => {\n\t\tconst candidates = bundles.flatMap((bundle) =>\n\t\t\tbundle.supportAnchors\n\t\t\t\t.filter(\n\t\t\t\t\t(anchor) =>\n\t\t\t\t\t\tanchor.captureBundleId === bundle.captureBundleId &&\n\t\t\t\t\t\tanchor.sourceTimeMs <= targetTimeMs &&\n\t\t\t\t\t\ttargetTimeMs - anchor.sourceTimeMs <= request.maxPriorAsOfLagMs,\n\t\t\t\t)\n\t\t\t\t.map((anchor) => ({ bundle, anchor })),\n\t\t);\n\t\tcandidates.sort((left, right) => {\n\t\t\tconst origin =\n\t\t\t\toriginPriority(request, left.bundle.captureOrigin) -\n\t\t\t\toriginPriority(request, right.bundle.captureOrigin);\n\t\t\tif (origin !== 0) return origin;\n\t\t\tif (left.anchor.sourceTimeMs !== right.anchor.sourceTimeMs) {\n\t\t\t\treturn right.anchor.sourceTimeMs - left.anchor.sourceTimeMs;\n\t\t\t}\n\t\t\treturn left.bundle.captureBundleId.localeCompare(\n\t\t\t\tright.bundle.captureBundleId,\n\t\t\t);\n\t\t});\n\t\treturn candidates[0] ? [candidates[0]] : [];\n\t});\n}\n\nexport function resolveArchiveSelection(input: {\n\trequest: MarketDataVendorBackfillRequest;\n\tbundles: readonly ArchiveBundleEvidence[];\n\tresolvedAtMs: number;\n\tstoredSelection?: unknown;\n}): ArchiveSelectionWire {\n\tif (input.storedSelection !== undefined) {\n\t\tconst stored = archiveSelectionCodec.decode(input.storedSelection);\n\t\tassertStoredSelectionMatchesRequest(input.request, stored);\n\t\treturn stored;\n\t}\n\tconst { request } = input;\n\tif (!request.requiredClock || !request.coveragePolicy) {\n\t\tthrow new Error(\"decoded request is missing final-v1 selection context\");\n\t}\n\tconst eligible = eligibleBundles(request, input.bundles);\n\tconst chosenSupport = chooseSupport(request, eligible);\n\tconst selectedBundleIds = new Set(\n\t\tchosenSupport.map(({ bundle }) => bundle.captureBundleId),\n\t);\n\tconst selectedBundles = eligible\n\t\t.filter((bundle) => selectedBundleIds.has(bundle.captureBundleId))\n\t\t.sort((left, right) => {\n\t\t\tconst origin =\n\t\t\t\toriginPriority(request, left.captureOrigin) -\n\t\t\t\toriginPriority(request, right.captureOrigin);\n\t\t\treturn (\n\t\t\t\torigin || left.captureBundleId.localeCompare(right.captureBundleId)\n\t\t\t);\n\t\t});\n\tconst supportByIdentity = new Map<string, (typeof chosenSupport)[number]>();\n\tfor (const support of chosenSupport) {\n\t\tconst identity = `${support.bundle.captureBundleId}:${support.anchor.rawCaptureId}:${support.anchor.snapshotId}:${support.anchor.sourceTimeMs}`;\n\t\tsupportByIdentity.set(identity, support);\n\t}\n\tconst supportAnchors = [...supportByIdentity.values()]\n\t\t.sort(\n\t\t\t(left, right) =>\n\t\t\t\tleft.anchor.sourceTimeMs - right.anchor.sourceTimeMs ||\n\t\t\t\tleft.bundle.captureBundleId.localeCompare(right.bundle.captureBundleId),\n\t\t)\n\t\t.map(({ bundle, anchor }) => ({\n\t\t\tcapture_bundle_id: bundle.captureBundleId,\n\t\t\traw_capture_id: anchor.rawCaptureId,\n\t\t\tsnapshot_id: anchor.snapshotId,\n\t\t\tsource_time: fixedTimestamp(anchor.sourceTimeMs, \"support anchor time\"),\n\t\t\tnormalized_summary_checksum: anchor.normalizedSummaryChecksum,\n\t\t\tmetadata_ref: {\n\t\t\t\tcapture_origin: bundle.captureOrigin,\n\t\t\t\tqualification_event_id:\n\t\t\t\t\tbundle.qualification?.qualificationEventId ?? null,\n\t\t\t\treceipt_id: bundle.qualification?.receiptId ?? null,\n\t\t\t},\n\t\t}));\n\tconst coverageClass =\n\t\tchosenSupport.length === request.requiredClockTargetsMs.length\n\t\t\t? \"complete\"\n\t\t\t: eligible.length === 0\n\t\t\t\t? \"missing\"\n\t\t\t\t: \"partial\";\n\tconst requestStart = request.window.startTimeMs;\n\tconst requestEnd = request.window.endTimeMs;\n\treturn finalizeArchiveSelection({\n\t\tschema_id: ARCHIVE_SELECTION_SCHEMA_ID,\n\t\tscope: {\n\t\t\texchange: request.scope.exchange,\n\t\t\ttrading_pair: request.scope.tradingPair,\n\t\t\tmarket_type: request.scope.marketType,\n\t\t\tfeed: request.scope.feed,\n\t\t},\n\t\trequired_clock: {\n\t\t\tclock_id: request.requiredClock.clock_id,\n\t\t\tclock_sha256: request.requiredClock.clock_sha256,\n\t\t\tevent_count: request.requiredClock.targets.length,\n\t\t},\n\t\tcoverage_policy: request.coveragePolicy,\n\t\tsource_policy: request.sourcePolicy,\n\t\tcoverage_class: coverageClass,\n\t\trequested_intervals: [\n\t\t\t{\n\t\t\t\tstart_at: fixedTimestamp(requestStart, \"window start\"),\n\t\t\t\tend_at: fixedTimestamp(requestEnd, \"window end\"),\n\t\t\t},\n\t\t],\n\t\tselected_intervals: selectedBundles.map((bundle) => ({\n\t\t\tstart_at: fixedTimestamp(\n\t\t\t\tMath.max(requestStart, bundle.startTimeMs),\n\t\t\t\t\"selected interval start\",\n\t\t\t),\n\t\t\tend_at: fixedTimestamp(\n\t\t\t\tMath.min(requestEnd, bundle.endTimeMs),\n\t\t\t\t\"selected interval end\",\n\t\t\t),\n\t\t\tcapture_bundle_id: bundle.captureBundleId,\n\t\t\tcapture_origin: bundle.captureOrigin,\n\t\t})),\n\t\tprecedence:\n\t\t\trequest.sourcePolicy === \"fill_gaps\" ? [\"archive\", \"vendor\"] : [\"vendor\"],\n\t\tbundles: selectedBundles.map((bundle) => ({\n\t\t\tcapture_bundle_id: bundle.captureBundleId,\n\t\t\tcapture_origin: bundle.captureOrigin,\n\t\t\tinterval: {\n\t\t\t\tstart_at: fixedTimestamp(bundle.startTimeMs, \"bundle interval start\"),\n\t\t\t\tend_at: fixedTimestamp(bundle.endTimeMs, \"bundle interval end\"),\n\t\t\t},\n\t\t\tqualification: bundle.qualification\n\t\t\t\t? {\n\t\t\t\t\t\tqualification_event_id: bundle.qualification.qualificationEventId,\n\t\t\t\t\t\tstate: \"qualified\" as const,\n\t\t\t\t\t\treceipt_id: bundle.qualification.receiptId,\n\t\t\t\t\t\tpromotion_identity_sha256:\n\t\t\t\t\t\t\tbundle.qualification.promotionIdentitySha256,\n\t\t\t\t\t}\n\t\t\t\t: null,\n\t\t})),\n\t\tsupport_anchors: supportAnchors,\n\t\treceipt_ids: [\n\t\t\t...new Set(\n\t\t\t\tselectedBundles.flatMap((bundle) =>\n\t\t\t\t\tbundle.qualification ? [bundle.qualification.receiptId] : [],\n\t\t\t\t),\n\t\t\t),\n\t\t].sort(),\n\t\tqualification_event_ids: [\n\t\t\t...new Set(\n\t\t\t\tselectedBundles.flatMap((bundle) =>\n\t\t\t\t\tbundle.qualification\n\t\t\t\t\t\t? [bundle.qualification.qualificationEventId]\n\t\t\t\t\t\t: [],\n\t\t\t\t),\n\t\t\t),\n\t\t].sort(),\n\t\tresolved_at: fixedTimestamp(input.resolvedAtMs, \"resolved_at\"),\n\t});\n}\n\nexport function archiveSelectionToArchiveRow(\n\trequest: BackfillRequestWire,\n\tselectionInput: ArchiveSelectionWire,\n): BackfillArchiveRow {\n\tconst selection = archiveSelectionCodec.decode(selectionInput);\n\tif (\n\t\tselection.required_clock.clock_sha256 !==\n\t\t\trequest.required_clock.clock_sha256 ||\n\t\tselection.source_policy !== request.source_policy ||\n\t\tjcsSha256(selection.scope) !== jcsSha256(request.scope) ||\n\t\tjcsSha256(selection.coverage_policy) !== jcsSha256(request.coverage_policy)\n\t) {\n\t\tthrow new Error(\"archive selection does not match request\");\n\t}\n\treturn {\n\t\ttable: \"market_data.cex_order_book_archive_selections\",\n\t\trow: {\n\t\t\tsource: \"external_backfill\",\n\t\t\tdeployment_id: \"market-data-vendor-backfill\",\n\t\t\trequest_id: request.request_id,\n\t\t\tidempotency_key: request.idempotency_key,\n\t\t\tselection_sha256: selection.selection_sha256,\n\t\t\tcoverage_class: selection.coverage_class,\n\t\t\treceipt_ids: selection.receipt_ids,\n\t\t\trequest_json: jcsCanonicalize(request),\n\t\t\tselection_json: jcsCanonicalize(selection),\n\t\t\tresolved_at_ms: Date.parse(selection.resolved_at),\n\t\t},\n\t};\n}\n\nexport function archiveSelectionFromArchiveRow(\n\trow: Record<string, unknown>,\n): ArchiveSelectionWire {\n\tlet parsed: unknown;\n\tlet parsedRequest: unknown;\n\ttry {\n\t\tparsed = JSON.parse(String(row.selection_json));\n\t\tparsedRequest = JSON.parse(String(row.request_json));\n\t} catch {\n\t\tthrow new Error(\"archive selection or request JSON is invalid\");\n\t}\n\tconst selection = archiveSelectionCodec.decode(parsed);\n\tconst request = backfillRequestCodec.decode(parsedRequest).wire;\n\tarchiveSelectionToArchiveRow(request, selection);\n\tif (\n\t\trow.source !== \"external_backfill\" ||\n\t\trow.deployment_id !== \"market-data-vendor-backfill\" ||\n\t\trow.request_id !== request.request_id ||\n\t\trow.idempotency_key !== request.idempotency_key ||\n\t\trow.selection_sha256 !== selection.selection_sha256 ||\n\t\trow.coverage_class !== selection.coverage_class ||\n\t\tjcsCanonicalize(row.receipt_ids) !==\n\t\t\tjcsCanonicalize(selection.receipt_ids) ||\n\t\trow.resolved_at_ms !== Date.parse(selection.resolved_at)\n\t) {\n\t\tthrow new Error(\"archive selection row does not match selection JSON\");\n\t}\n\treturn selection;\n}\n",
|
|
191
|
-
"import { sha256Canonical } from \"../market-data-archive/capture-contract\";\nimport type {\n\tBackfillArchiveRow,\n\tMarketDataVendorBackfillRequest,\n\tPromotionReceiptWire,\n} from \"./contracts\";\nimport { archiveSelectionCodec } from \"./contracts\";\nimport type {\n\tArchivePreflightResolution,\n\tCandidateVerification,\n\tNormalizedBackfill,\n\tQualifiedCoverage,\n} from \"./core\";\nimport { jcsCanonicalize } from \"./identity\";\nimport {\n\tpromotionReceiptFromArchiveRow,\n\tpromotionReceiptMatchesCurrentPolicies,\n} from \"./promotion\";\nimport {\n\ttype ArchiveBundleEvidence,\n\tresolveArchiveSelection,\n} from \"./selection\";\nimport { verifySemanticPromotion } from \"./semantic-verification\";\n\nexport type ArchiveQueryValue = string | number | readonly string[];\nexport type ArchiveQueryClient = {\n\tquery(\n\t\tsql: string,\n\t\tparameters?: Readonly<Record<string, ArchiveQueryValue>>,\n\t): Promise<Record<string, unknown>[]>;\n};\n\nexport type QualifiedArchiveReaderOptions = { nowMs?: () => number };\n\nconst QUALIFIED_SUMMARY =\n\t\"market_data.cex_order_book_depth_summary_replay_qualified\";\nconst QUALIFIED_LEVELS = \"market_data.cex_order_book_levels_replay_qualified\";\nconst CANDIDATE_SUMMARY = \"market_data.cex_order_book_depth_summary_canonical\";\nconst CANDIDATE_LEVELS = \"market_data.cex_order_book_levels_canonical\";\n\nclass ArchiveReaderError extends Error {\n\tconstructor(readonly reason: string) {\n\t\tsuper(reason);\n\t\tthis.name = \"ArchiveReaderError\";\n\t}\n}\n\nasync function archiveQuery(\n\tclient: ArchiveQueryClient,\n\treason: string,\n\tsql: string,\n\tparameters?: Readonly<Record<string, ArchiveQueryValue>>,\n): Promise<Record<string, unknown>[]> {\n\ttry {\n\t\treturn await client.query(sql, parameters);\n\t} catch {\n\t\tthrow new ArchiveReaderError(reason);\n\t}\n}\n\nfunction queryParameters(request: MarketDataVendorBackfillRequest) {\n\treturn {\n\t\texchange: request.scope.exchange,\n\t\ttrading_pair: request.scope.tradingPair,\n\t\tstart_time_ms: request.window.startTimeMs,\n\t\tend_time_ms: request.window.endTimeMs,\n\t\tdepth_limit: request.depth,\n\t\tconstruction_mode: request.constructionMode,\n\t\tschema_version: request.expectedProduct.canonicalSchemaVersion,\n\t};\n}\n\nfunction scopeFilter(alias = \"\") {\n\tconst prefix = alias ? `${alias}.` : \"\";\n\treturn `\n${prefix}exchange = {exchange:String}\nAND ${prefix}trading_pair = {trading_pair:String}\nAND ${prefix}depth_limit = {depth_limit:UInt16}\nAND ${prefix}construction_mode = {construction_mode:String}\nAND ${prefix}schema_version = {schema_version:String}`;\n}\n\nfunction numberField(row: Record<string, unknown>, field: string): number {\n\tconst value = row[field];\n\tconst parsed = typeof value === \"number\" ? value : Number(value);\n\tif (!Number.isSafeInteger(parsed) || parsed < 0) {\n\t\tthrow new Error(`Archive field ${field} is not a safe unsigned integer`);\n\t}\n\treturn parsed;\n}\n\nfunction uint64Field(\n\trow: Record<string, unknown>,\n\tfield: string,\n): bigint | undefined {\n\tconst value = row[field];\n\tif (value === null || value === undefined) return undefined;\n\tif (typeof value === \"number\") {\n\t\treturn Number.isSafeInteger(value) && value >= 0\n\t\t\t? BigInt(value)\n\t\t\t: undefined;\n\t}\n\tif (typeof value !== \"string\" || !/^\\d+$/.test(value)) return undefined;\n\tconst parsed = BigInt(value);\n\treturn parsed <= 18_446_744_073_709_551_615n ? parsed : undefined;\n}\n\nfunction timelineDigest(rows: readonly Record<string, unknown>[]): string {\n\treturn sha256Canonical(\n\t\trows\n\t\t\t.map((row) => ({\n\t\t\t\ttable: String(row.table ?? \"summary\"),\n\t\t\t\tsnapshot_id: String(row.snapshot_id ?? \"\"),\n\t\t\t\tsource_time_ms: numberField(row, \"source_time_ms\"),\n\t\t\t\tnormalized_row_checksum: String(row.normalized_row_checksum ?? \"\"),\n\t\t\t}))\n\t\t\t.sort((left, right) =>\n\t\t\t\tleft.source_time_ms === right.source_time_ms\n\t\t\t\t\t? left.normalized_row_checksum.localeCompare(\n\t\t\t\t\t\t\tright.normalized_row_checksum,\n\t\t\t\t\t\t)\n\t\t\t\t\t: left.source_time_ms - right.source_time_ms,\n\t\t\t),\n\t);\n}\n\nfunction clocksCovered(\n\trequest: MarketDataVendorBackfillRequest,\n\trows: readonly Record<string, unknown>[],\n): boolean {\n\tconst times = rows\n\t\t.map((row) => numberField(row, \"source_time_ms\"))\n\t\t.sort((left, right) => left - right);\n\treturn request.requiredClockTargetsMs.every((target) => {\n\t\tlet prior: number | undefined;\n\t\tfor (const sourceTime of times) {\n\t\t\tif (sourceTime > target) break;\n\t\t\tprior = sourceTime;\n\t\t}\n\t\treturn prior !== undefined && target - prior <= request.maxPriorAsOfLagMs;\n\t});\n}\n\nfunction candidateRows(\n\ttable:\n\t\t| \"market_data.cex_order_book_levels\"\n\t\t| \"market_data.cex_order_book_depth_summary\",\n\trows: Record<string, unknown>[],\n): BackfillArchiveRow[] {\n\treturn rows.map((row) => ({ table, row }));\n}\n\nexport class QualifiedOrderBookArchiveReader {\n\tconstructor(\n\t\tprivate readonly client: ArchiveQueryClient,\n\t\tprivate readonly options?: QualifiedArchiveReaderOptions,\n\t) {}\n\n\tasync resolveSelection(\n\t\trequest: MarketDataVendorBackfillRequest,\n\t): Promise<ArchivePreflightResolution> {\n\t\tconst identityRows = await archiveQuery(\n\t\t\tthis.client,\n\t\t\t\"archive_cluster_identity_query_failed\",\n\t\t\t`SELECT environment, cluster\n\t\t\t FROM market_data.cex_archive_cluster_identity FINAL\n\t\t\t WHERE singleton_key = 'archive'\n\t\t\t LIMIT 2`,\n\t\t);\n\t\tif (identityRows.length !== 1) {\n\t\t\tthrow new Error(\n\t\t\t\t\"archive cluster identity singleton is missing or conflicting\",\n\t\t\t);\n\t\t}\n\t\tconst readerIdentity = {\n\t\t\tenvironment: String(identityRows[0]?.environment ?? \"\"),\n\t\t\tcluster: String(identityRows[0]?.cluster ?? \"\"),\n\t\t};\n\t\tconst conflictRows = await archiveQuery(\n\t\t\tthis.client,\n\t\t\t\"archive_selection_conflict_query_failed\",\n\t\t\t`SELECT count() AS conflicts\n\t\t\t FROM\n\t\t\t (\n\t\t\t SELECT conflict.capture_bundle_id, conflict.snapshot_id\n\t\t\t FROM market_data.cex_order_book_levels_conflicts AS conflict\n\t\t\t INNER JOIN\n\t\t\t (\n\t\t\t SELECT DISTINCT capture_bundle_id, snapshot_id\n\t\t\t FROM market_data.cex_order_book_depth_summary\n\t\t\t WHERE ${scopeFilter()}\n\t\t\t AND source_time_ms >= {start_time_ms:UInt64}\n\t\t\t AND source_time_ms < {end_time_ms:UInt64}\n\t\t\t ) AS selected USING (capture_bundle_id, snapshot_id)\n\t\t\t UNION ALL\n\t\t\t SELECT conflict.capture_bundle_id, conflict.snapshot_id\n\t\t\t FROM market_data.cex_order_book_depth_summary_conflicts AS conflict\n\t\t\t INNER JOIN\n\t\t\t (\n\t\t\t SELECT DISTINCT capture_bundle_id, snapshot_id\n\t\t\t FROM market_data.cex_order_book_depth_summary\n\t\t\t WHERE ${scopeFilter()}\n\t\t\t AND source_time_ms >= {start_time_ms:UInt64}\n\t\t\t AND source_time_ms < {end_time_ms:UInt64}\n\t\t\t ) AS selected USING (capture_bundle_id, snapshot_id)\n\t\t\t )`,\n\t\t\tqueryParameters(request),\n\t\t);\n\t\tif (\n\t\t\tconflictRows.length !== 1 ||\n\t\t\t!Number.isSafeInteger(Number(conflictRows[0]?.conflicts)) ||\n\t\t\tNumber(conflictRows[0]?.conflicts) < 0\n\t\t) {\n\t\t\tthrow new ArchiveReaderError(\"archive_selection_conflict_query_invalid\");\n\t\t}\n\t\tif (Number(conflictRows[0]?.conflicts) > 0) {\n\t\t\tthrow new ArchiveReaderError(\"archive_selection_checksum_conflict\");\n\t\t}\n\t\tconst storedRows = await archiveQuery(\n\t\t\tthis.client,\n\t\t\t\"archive_stored_selection_query_failed\",\n\t\t\t`SELECT selection_sha256, selection_json\n\t\t\t FROM market_data.cex_order_book_archive_selections\n\t\t\t WHERE idempotency_key = {idempotency_key:String}\n\t\t\t ORDER BY resolved_at_ms, selection_sha256`,\n\t\t\t{ idempotency_key: request.idempotencyKey },\n\t\t);\n\t\tif (storedRows.length > 0) {\n\t\t\tconst selections = storedRows.map((row) => {\n\t\t\t\tlet parsed: unknown;\n\t\t\t\ttry {\n\t\t\t\t\tparsed = JSON.parse(String(row.selection_json));\n\t\t\t\t} catch {\n\t\t\t\t\tthrow new Error(\"stored archive selection JSON is invalid\");\n\t\t\t\t}\n\t\t\t\tconst selection = archiveSelectionCodec.decode(parsed);\n\t\t\t\tif (selection.selection_sha256 !== row.selection_sha256) {\n\t\t\t\t\tthrow new Error(\"stored archive selection row identity mismatch\");\n\t\t\t\t}\n\t\t\t\treturn selection;\n\t\t\t});\n\t\t\tconst canonical = new Set(selections.map(jcsCanonicalize));\n\t\t\tif (canonical.size !== 1) {\n\t\t\t\tthrow new Error(\"stored archive selection content conflicts\");\n\t\t\t}\n\t\t\tconst selection = resolveArchiveSelection({\n\t\t\t\trequest,\n\t\t\t\tbundles: [],\n\t\t\t\tresolvedAtMs: this.options?.nowMs?.() ?? Date.now(),\n\t\t\t\tstoredSelection: selections[0],\n\t\t\t});\n\t\t\tconst receipts = await this.readReceipts(selection.receipt_ids);\n\t\t\tconst currentReceiptIds = new Set(\n\t\t\t\treceipts\n\t\t\t\t\t.filter(promotionReceiptMatchesCurrentPolicies)\n\t\t\t\t\t.map((receipt) => receipt.receipt_id),\n\t\t\t);\n\t\t\tconst storedSelectionIsCurrent = selection.bundles.every(\n\t\t\t\t(bundle) =>\n\t\t\t\t\tbundle.capture_origin === \"production_capture\" ||\n\t\t\t\t\t(bundle.qualification !== null &&\n\t\t\t\t\t\tcurrentReceiptIds.has(bundle.qualification.receipt_id)),\n\t\t\t);\n\t\t\tif (storedSelectionIsCurrent) {\n\t\t\t\treturn {\n\t\t\t\t\tselection,\n\t\t\t\t\treceipts: receipts.filter(promotionReceiptMatchesCurrentPolicies),\n\t\t\t\t\treaderIdentity,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tconst parameters = {\n\t\t\t...queryParameters(request),\n\t\t\tcoverage_start_ms: Math.max(\n\t\t\t\t0,\n\t\t\t\trequest.window.startTimeMs - request.maxPriorAsOfLagMs,\n\t\t\t),\n\t\t};\n\t\tconst summaries = await archiveQuery(\n\t\t\tthis.client,\n\t\t\t\"archive_qualified_summary_query_failed\",\n\t\t\t`SELECT capture_bundle_id, raw_capture_id, snapshot_id,\n\t\t\t source_time_ms, normalized_row_checksum, source\n\t\t\t FROM ${QUALIFIED_SUMMARY}\n\t\t\t WHERE ${scopeFilter()}\n\t\t\t AND source_time_ms >= {coverage_start_ms:UInt64}\n\t\t\t AND source_time_ms < {end_time_ms:UInt64}\n\t\t\t ORDER BY source_time_ms, capture_bundle_id, snapshot_id`,\n\t\t\tparameters,\n\t\t);\n\t\tconst bundleIds = [\n\t\t\t...new Set(summaries.map((row) => String(row.capture_bundle_id))),\n\t\t].filter(Boolean);\n\t\tconst qualificationRows = await archiveQuery(\n\t\t\tthis.client,\n\t\t\t\"archive_qualification_query_failed\",\n\t\t\t`SELECT capture_bundle_id, qualification_event_id, state, receipt_id,\n\t\t\t promotion_identity_sha256, window_start_ms, window_end_ms\n\t\t\t FROM market_data.cex_order_book_capture_qualifications\n\t\t\t WHERE capture_bundle_id IN {capture_bundle_ids:Array(String)}\n\t\t\t ORDER BY event_at_ms DESC\n\t\t\t LIMIT 1 BY capture_bundle_id`,\n\t\t\t{ capture_bundle_ids: bundleIds },\n\t\t);\n\t\tconst qualificationByBundle = new Map(\n\t\t\tqualificationRows.map((row) => [String(row.capture_bundle_id), row]),\n\t\t);\n\t\tconst receiptIds = qualificationRows\n\t\t\t.map((row) => String(row.receipt_id ?? \"\"))\n\t\t\t.filter(Boolean);\n\t\tconst receipts = await this.readReceipts(receiptIds);\n\t\tconst currentReceipts = receipts.filter(\n\t\t\tpromotionReceiptMatchesCurrentPolicies,\n\t\t);\n\t\tconst receiptIdsSet = new Set(\n\t\t\tcurrentReceipts.map((receipt) => receipt.receipt_id),\n\t\t);\n\t\tconst grouped = new Map<string, ArchiveBundleEvidence>();\n\t\tfor (const row of summaries) {\n\t\t\tconst captureBundleId = String(row.capture_bundle_id);\n\t\t\tconst captureOrigin =\n\t\t\t\tString(row.source) === \"external_backfill\"\n\t\t\t\t\t? \"vendor_historical_backfill\"\n\t\t\t\t\t: \"production_capture\";\n\t\t\tconst qualificationRow = qualificationByBundle.get(captureBundleId);\n\t\t\tconst receiptId = String(qualificationRow?.receipt_id ?? \"\");\n\t\t\tconst qualification =\n\t\t\t\tcaptureOrigin === \"vendor_historical_backfill\" && qualificationRow\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tqualificationEventId: String(\n\t\t\t\t\t\t\t\tqualificationRow.qualification_event_id,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tstate: String(qualificationRow.state) as\n\t\t\t\t\t\t\t\t| \"qualified\"\n\t\t\t\t\t\t\t\t| \"quarantined\"\n\t\t\t\t\t\t\t\t| \"revoked\",\n\t\t\t\t\t\t\treceiptId,\n\t\t\t\t\t\t\tpromotionIdentitySha256: String(\n\t\t\t\t\t\t\t\tqualificationRow.promotion_identity_sha256,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}\n\t\t\t\t\t: null;\n\t\t\tif (\n\t\t\t\tcaptureOrigin === \"vendor_historical_backfill\" &&\n\t\t\t\t(!qualification || !receiptIdsSet.has(receiptId))\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst sourceTimeMs = numberField(row, \"source_time_ms\");\n\t\t\tconst startTimeMs = qualificationRow\n\t\t\t\t? numberField(qualificationRow, \"window_start_ms\")\n\t\t\t\t: sourceTimeMs;\n\t\t\tconst endTimeMs = qualificationRow\n\t\t\t\t? numberField(qualificationRow, \"window_end_ms\")\n\t\t\t\t: sourceTimeMs + 1;\n\t\t\tconst existing = grouped.get(captureBundleId) ?? {\n\t\t\t\tcaptureBundleId,\n\t\t\t\tcaptureOrigin,\n\t\t\t\tstartTimeMs,\n\t\t\t\tendTimeMs,\n\t\t\t\tqualification,\n\t\t\t\tsupportAnchors: [],\n\t\t\t};\n\t\t\texisting.startTimeMs = Math.min(existing.startTimeMs, startTimeMs);\n\t\t\texisting.endTimeMs = Math.max(existing.endTimeMs, endTimeMs);\n\t\t\texisting.supportAnchors.push({\n\t\t\t\tcaptureBundleId,\n\t\t\t\trawCaptureId: String(row.raw_capture_id),\n\t\t\t\tsnapshotId: String(row.snapshot_id),\n\t\t\t\tsourceTimeMs,\n\t\t\t\tnormalizedSummaryChecksum: String(row.normalized_row_checksum),\n\t\t\t});\n\t\t\tgrouped.set(captureBundleId, existing);\n\t\t}\n\t\tconst [prefix, suffix] = await Promise.all([\n\t\t\tthis.boundaryRows(request, \"prefix\"),\n\t\t\tthis.boundaryRows(request, \"suffix\"),\n\t\t]);\n\t\tconst selection = resolveArchiveSelection({\n\t\t\trequest,\n\t\t\tbundles: [...grouped.values()],\n\t\t\tresolvedAtMs: this.options?.nowMs?.() ?? Date.now(),\n\t\t});\n\t\treturn {\n\t\t\tselection,\n\t\t\treceipts: currentReceipts,\n\t\t\treaderIdentity,\n\t\t\tverificationBaseline: {\n\t\t\t\tprefixDigest: timelineDigest(prefix),\n\t\t\t\tsuffixDigest: timelineDigest(suffix),\n\t\t\t},\n\t\t};\n\t}\n\n\tprivate async readReceipts(\n\t\treceiptIds: readonly string[],\n\t): Promise<PromotionReceiptWire[]> {\n\t\tif (receiptIds.length === 0) return [];\n\t\tconst rows = await archiveQuery(\n\t\t\tthis.client,\n\t\t\t\"archive_receipt_query_failed\",\n\t\t\t`SELECT receipt_id, promotion_identity_sha256, receipt_json\n\t\t\t FROM market_data.cex_order_book_capture_promotions\n\t\t\t WHERE receipt_id IN {receipt_ids:Array(String)}\n\t\t\t ORDER BY receipt_id`,\n\t\t\t{ receipt_ids: [...new Set(receiptIds)].sort() },\n\t\t);\n\t\tlet receipts: Array<PromotionReceiptWire | object>;\n\t\ttry {\n\t\t\treceipts = rows.map((row) => promotionReceiptFromArchiveRow(row));\n\t\t} catch {\n\t\t\tthrow new ArchiveReaderError(\"archive_receipt_invalid\");\n\t\t}\n\t\tif (receipts.some((receipt) => !(\"schema_id\" in receipt))) {\n\t\t\tthrow new Error(\n\t\t\t\t\"provisional promotion receipt cannot qualify final-v1 data\",\n\t\t\t);\n\t\t}\n\t\treturn receipts as PromotionReceiptWire[];\n\t}\n\n\tasync coverage(\n\t\trequest: MarketDataVendorBackfillRequest,\n\t): Promise<QualifiedCoverage> {\n\t\tconst parameters = queryParameters(request);\n\t\tconst summaries = await this.client.query(\n\t\t\t`SELECT snapshot_id, source_time_ms, normalized_row_checksum\n\t\t\t FROM ${QUALIFIED_SUMMARY}\n\t\t\t WHERE ${scopeFilter()}\n\t\t\t AND source_time_ms >= {coverage_start_ms:UInt64}\n\t\t\t AND source_time_ms < {end_time_ms:UInt64}\n\t\t\t ORDER BY source_time_ms, snapshot_id`,\n\t\t\t{\n\t\t\t\t...parameters,\n\t\t\t\tcoverage_start_ms: Math.max(\n\t\t\t\t\t0,\n\t\t\t\t\trequest.window.startTimeMs - request.maxPriorAsOfLagMs,\n\t\t\t\t),\n\t\t\t},\n\t\t);\n\t\tconst [prefix, suffix] = await Promise.all([\n\t\t\tthis.boundaryRows(request, \"prefix\"),\n\t\t\tthis.boundaryRows(request, \"suffix\"),\n\t\t]);\n\t\treturn {\n\t\t\tcomplete: clocksCovered(request, summaries),\n\t\t\tcoverageDigest: timelineDigest(summaries),\n\t\t\tprefixDigest: timelineDigest(prefix),\n\t\t\tsuffixDigest: timelineDigest(suffix),\n\t\t};\n\t}\n\n\tprivate boundaryRows(\n\t\trequest: MarketDataVendorBackfillRequest,\n\t\tside: \"prefix\" | \"suffix\",\n\t): Promise<Record<string, unknown>[]> {\n\t\tconst boundary =\n\t\t\tside === \"prefix\" ? request.window.startTimeMs : request.window.endTimeMs;\n\t\tconst span = Math.max(\n\t\t\trequest.maxPriorAsOfLagMs,\n\t\t\trequest.budgets.maxBoundaryLookbackMs,\n\t\t);\n\t\tconst boundaryStart =\n\t\t\tside === \"prefix\" ? Math.max(0, boundary - span) : boundary;\n\t\tconst boundaryEnd =\n\t\t\tside === \"prefix\"\n\t\t\t\t? boundary\n\t\t\t\t: Math.min(Number.MAX_SAFE_INTEGER, boundary + span);\n\t\treturn archiveQuery(\n\t\t\tthis.client,\n\t\t\t\"archive_boundary_query_failed\",\n\t\t\t`SELECT 'level' AS table, snapshot_id, source_time_ms, sequence,\n\t\t\t normalized_row_checksum\n\t\t\t FROM ${QUALIFIED_LEVELS}\n\t\t\t WHERE ${scopeFilter()}\n\t\t\t AND source_time_ms >= {boundary_start_ms:UInt64}\n\t\t\t AND source_time_ms < {boundary_end_ms:UInt64}\n\t\t\t UNION ALL\n\t\t\t SELECT 'summary' AS table, snapshot_id, source_time_ms, sequence,\n\t\t\t normalized_row_checksum\n\t\t\t FROM ${QUALIFIED_SUMMARY}\n\t\t\t WHERE ${scopeFilter()}\n\t\t\t AND source_time_ms >= {boundary_start_ms:UInt64}\n\t\t\t AND source_time_ms < {boundary_end_ms:UInt64}\n\t\t\t ORDER BY source_time_ms, table, snapshot_id, normalized_row_checksum`,\n\t\t\t{\n\t\t\t\t...queryParameters(request),\n\t\t\t\tboundary_start_ms: boundaryStart,\n\t\t\t\tboundary_end_ms: boundaryEnd,\n\t\t\t},\n\t\t);\n\t}\n\n\tasync verifyCandidate(\n\t\trequest: MarketDataVendorBackfillRequest,\n\t\tnormalized: NormalizedBackfill,\n\t\tcaptureBundleId: string,\n\t\tbaseline: ArchivePreflightResolution,\n\t): Promise<CandidateVerification> {\n\t\tif (!baseline.verificationBaseline) {\n\t\t\tthrow new Error(\"qualified verification baseline is missing\");\n\t\t}\n\t\tconst parameters = {\n\t\t\t...queryParameters(request),\n\t\t\tcapture_bundle_id: captureBundleId,\n\t\t};\n\t\tconst [levels, summaries, conflicts, prefix, suffix] = await Promise.all([\n\t\t\tthis.client.query(\n\t\t\t\t`SELECT * FROM ${CANDIDATE_LEVELS}\n\t\t\t\t WHERE capture_bundle_id = {capture_bundle_id:String}\n\t\t\t\t AND ${scopeFilter()}\n\t\t\t\t AND source_time_ms >= {start_time_ms:UInt64}\n\t\t\t\t AND source_time_ms < {end_time_ms:UInt64}`,\n\t\t\t\tparameters,\n\t\t\t),\n\t\t\tthis.client.query(\n\t\t\t\t`SELECT * FROM ${CANDIDATE_SUMMARY}\n\t\t\t\t WHERE capture_bundle_id = {capture_bundle_id:String}\n\t\t\t\t AND ${scopeFilter()}\n\t\t\t\t AND source_time_ms >= {start_time_ms:UInt64}\n\t\t\t\t AND source_time_ms < {end_time_ms:UInt64}`,\n\t\t\t\tparameters,\n\t\t\t),\n\t\t\tthis.client.query(\n\t\t\t\t`SELECT count() AS conflicts FROM\n\t\t\t\t (\n\t\t\t\t SELECT snapshot_id FROM market_data.cex_order_book_levels_conflicts\n\t\t\t\t WHERE capture_bundle_id = {capture_bundle_id:String}\n\t\t\t\t UNION ALL\n\t\t\t\t SELECT snapshot_id FROM market_data.cex_order_book_depth_summary_conflicts\n\t\t\t\t WHERE capture_bundle_id = {capture_bundle_id:String}\n\t\t\t\t )`,\n\t\t\t\tparameters,\n\t\t\t),\n\t\t\tthis.boundaryRows(request, \"prefix\"),\n\t\t\tthis.boundaryRows(request, \"suffix\"),\n\t\t]);\n\t\tconst queriedRows = [\n\t\t\t...candidateRows(\"market_data.cex_order_book_levels\", levels),\n\t\t\t...candidateRows(\"market_data.cex_order_book_depth_summary\", summaries),\n\t\t];\n\t\tconst semantic = verifySemanticPromotion({\n\t\t\trequest,\n\t\t\tnormalizedRows: normalized.rows,\n\t\t\tcandidateRows: queriedRows,\n\t\t\tconflictCount: Number(conflicts[0]?.conflicts ?? 0),\n\t\t\tprefixDigestBefore: baseline.verificationBaseline.prefixDigest,\n\t\t\tprefixDigestAfter: timelineDigest(prefix),\n\t\t\tsuffixDigestBefore: baseline.verificationBaseline.suffixDigest,\n\t\t\tsuffixDigestAfter: timelineDigest(suffix),\n\t\t\tseamVerified: this.seamIsOrdered(queriedRows),\n\t\t\texporterCompatible: queriedRows.every(\n\t\t\t\t({ row }) =>\n\t\t\t\t\ttypeof row.capture_bundle_id === \"string\" &&\n\t\t\t\t\ttypeof row.normalized_row_checksum === \"string\",\n\t\t\t),\n\t\t\t...(request.sourcePolicy === \"fill_gaps\"\n\t\t\t\t? {\n\t\t\t\t\t\tcoverageSourceTimesMs: [\n\t\t\t\t\t\t\t...baseline.selection.support_anchors.map((anchor) =>\n\t\t\t\t\t\t\t\tDate.parse(anchor.source_time),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t...summaries.map((row) => numberField(row, \"source_time_ms\")),\n\t\t\t\t\t\t],\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t});\n\t\treturn { ...semantic, captureBundleId };\n\t}\n\n\tprivate seamIsOrdered(rows: readonly BackfillArchiveRow[]): boolean {\n\t\tconst summaries = rows\n\t\t\t.filter(({ table }) => table.endsWith(\"depth_summary\"))\n\t\t\t.map(({ row }) => ({\n\t\t\t\ttime: numberField(row, \"source_time_ms\"),\n\t\t\t\tsequence: uint64Field(row, \"sequence\"),\n\t\t\t}))\n\t\t\t.sort((left, right) => left.time - right.time);\n\t\tfor (let index = 1; index < summaries.length; index += 1) {\n\t\t\tconst previous = summaries[index - 1];\n\t\t\tconst current = summaries[index];\n\t\t\tif (!previous || !current || current.time < previous.time) return false;\n\t\t\tif (\n\t\t\t\tprevious.sequence !== undefined &&\n\t\t\t\tcurrent.sequence !== undefined &&\n\t\t\t\tcurrent.sequence < previous.sequence\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn summaries.length > 0;\n\t}\n}\n\nexport function createClickHouseArchiveQueryClient(input: {\n\turl: string;\n\tusername?: string;\n\tpassword?: string;\n\tfetch?: typeof fetch;\n}): ArchiveQueryClient {\n\tconst request = input.fetch ?? fetch;\n\tconst parameterValue = (value: ArchiveQueryValue): string => {\n\t\tif (!Array.isArray(value)) return String(value);\n\t\treturn `[${value\n\t\t\t.map((entry) => {\n\t\t\t\tconst jsonString = JSON.stringify(entry);\n\t\t\t\treturn `'${jsonString.slice(1, -1).replaceAll(\"'\", \"\\\\'\")}'`;\n\t\t\t})\n\t\t\t.join(\",\")}]`;\n\t};\n\treturn {\n\t\tasync query(sql, parameters = {}) {\n\t\t\tconst endpoint = new URL(input.url);\n\t\t\tconst embeddedUsername = decodeURIComponent(endpoint.username);\n\t\t\tconst embeddedPassword = decodeURIComponent(endpoint.password);\n\t\t\tendpoint.username = \"\";\n\t\t\tendpoint.password = \"\";\n\t\t\tendpoint.searchParams.set(\"database\", \"market_data\");\n\t\t\tfor (const [key, value] of Object.entries(parameters)) {\n\t\t\t\tendpoint.searchParams.set(`param_${key}`, parameterValue(value));\n\t\t\t}\n\t\t\tconst response = await request(endpoint, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: {\n\t\t\t\t\t\"X-ClickHouse-User\": input.username || embeddedUsername || \"default\",\n\t\t\t\t\t\"X-ClickHouse-Key\": input.password ?? embeddedPassword,\n\t\t\t\t},\n\t\t\t\tbody: `${sql.trim()}\\nFORMAT JSONEachRow`,\n\t\t\t});\n\t\t\tif (!response.ok) {\n\t\t\t\tthrow new Error(`qualified_archive_query_failed:${response.status}`);\n\t\t\t}\n\t\t\tconst text = (await response.text()).trim();\n\t\t\treturn text\n\t\t\t\t? text\n\t\t\t\t\t\t.split(\"\\n\")\n\t\t\t\t\t\t.map((line) => JSON.parse(line) as Record<string, unknown>)\n\t\t\t\t: [];\n\t\t},\n\t};\n}\n",
|
|
192
|
-
"import type {\n\tBackfillArchiveRow,\n\tFixedUtcTimestamp,\n\tSha256Hex,\n} from \"./contracts\";\nimport { jcsCanonicalize, jcsSha256 } from \"./identity\";\n\nexport type QualificationEvent = {\n\tqualification_event_id: string;\n\tcapture_bundle_id: Sha256Hex;\n\tstate: \"qualified\" | \"quarantined\" | \"revoked\";\n\treceipt_id: Sha256Hex;\n\tpromotion_identity_sha256: Sha256Hex;\n\twindow: { start_at: FixedUtcTimestamp; end_at: FixedUtcTimestamp };\n\tevent_at: FixedUtcTimestamp;\n\treason_code: string;\n};\n\ntype UnfinalizedQualificationEvent = Omit<\n\tQualificationEvent,\n\t\"qualification_event_id\"\n> &\n\tPartial<Pick<QualificationEvent, \"qualification_event_id\">>;\n\nconst UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;\nconst SHA256 = /^[0-9a-f]{64}$/;\nconst REASON = /^[a-z][a-z0-9_]{0,127}$/;\nconst EVENT_FIELDS = new Set([\n\t\"qualification_event_id\",\n\t\"capture_bundle_id\",\n\t\"state\",\n\t\"receipt_id\",\n\t\"promotion_identity_sha256\",\n\t\"window\",\n\t\"event_at\",\n\t\"reason_code\",\n]);\n\nfunction deterministicUuid(value: unknown): string {\n\tconst digest = jcsSha256(value).slice(0, 32).split(\"\");\n\tdigest[12] = \"5\";\n\tdigest[16] = \"8\";\n\tconst hex = digest.join(\"\");\n\treturn `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;\n}\n\nfunction semanticEvent(\n\tevent: UnfinalizedQualificationEvent,\n): Omit<QualificationEvent, \"qualification_event_id\"> {\n\tconst { qualification_event_id: _eventId, ...semantic } = event;\n\treturn semantic;\n}\n\nfunction assertTimestamp(value: string, field: string): number {\n\tconst parsed = Date.parse(value);\n\tif (\n\t\t!Number.isSafeInteger(parsed) ||\n\t\tnew Date(parsed).toISOString() !== value\n\t) {\n\t\tthrow new Error(`${field} must be a fixed UTC RFC3339 timestamp`);\n\t}\n\treturn parsed;\n}\n\nexport function parseQualificationEvent(value: unknown): QualificationEvent {\n\tif (!value || typeof value !== \"object\" || Array.isArray(value)) {\n\t\tthrow new Error(\"qualification event must be an object\");\n\t}\n\tconst event = value as QualificationEvent;\n\tif (\n\t\tObject.keys(event).length !== EVENT_FIELDS.size ||\n\t\t!Object.keys(event).every((field) => EVENT_FIELDS.has(field)) ||\n\t\t!UUID.test(event.qualification_event_id) ||\n\t\t!SHA256.test(event.capture_bundle_id) ||\n\t\t![\"qualified\", \"quarantined\", \"revoked\"].includes(event.state) ||\n\t\t!SHA256.test(event.receipt_id) ||\n\t\t!SHA256.test(event.promotion_identity_sha256) ||\n\t\t!event.window ||\n\t\ttypeof event.window !== \"object\" ||\n\t\tObject.keys(event.window).length !== 2 ||\n\t\t!REASON.test(event.reason_code)\n\t) {\n\t\tthrow new Error(\"qualification event fields are invalid\");\n\t}\n\tif (\n\t\tassertTimestamp(event.window.end_at, \"window.end_at\") <=\n\t\tassertTimestamp(event.window.start_at, \"window.start_at\")\n\t) {\n\t\tthrow new Error(\"qualification window must be increasing\");\n\t}\n\tassertTimestamp(event.event_at, \"event_at\");\n\tif (\n\t\tdeterministicUuid(semanticEvent(event)) !== event.qualification_event_id\n\t) {\n\t\tthrow new Error(\"qualification_event_id does not match event content\");\n\t}\n\treturn event;\n}\n\nexport function finalizeQualificationEvent(\n\tevent: UnfinalizedQualificationEvent,\n): QualificationEvent {\n\tconst semantic = semanticEvent(event);\n\treturn parseQualificationEvent({\n\t\t...semantic,\n\t\tqualification_event_id: deterministicUuid(semantic),\n\t});\n}\n\nexport function qualificationEventToArchiveRow(\n\teventInput: QualificationEvent,\n): BackfillArchiveRow {\n\tconst event = parseQualificationEvent(eventInput);\n\treturn {\n\t\ttable: \"market_data.cex_order_book_capture_qualifications\",\n\t\trow: {\n\t\t\tsource: \"external_backfill\",\n\t\t\tcapture_origin: \"vendor_historical_backfill\",\n\t\t\tsource_mode: \"vendor_historical_backfill_v1\",\n\t\t\tdeployment_id: \"market-data-vendor-backfill\",\n\t\t\tqualification_event_id: event.qualification_event_id,\n\t\t\tcapture_bundle_id: event.capture_bundle_id,\n\t\t\tstate: event.state,\n\t\t\treceipt_id: event.receipt_id,\n\t\t\tpromotion_identity_sha256: event.promotion_identity_sha256,\n\t\t\twindow_start_ms: Date.parse(event.window.start_at),\n\t\t\twindow_end_ms: Date.parse(event.window.end_at),\n\t\t\tevent_at_ms: Date.parse(event.event_at),\n\t\t\treason_code: event.reason_code,\n\t\t\tevent_json: jcsCanonicalize(event),\n\t\t},\n\t};\n}\n\nexport function qualificationEventFromArchiveRow(\n\trow: Record<string, unknown>,\n): QualificationEvent {\n\tlet parsed: unknown;\n\ttry {\n\t\tparsed = JSON.parse(String(row.event_json));\n\t} catch {\n\t\tthrow new Error(\"qualification event_json is invalid\");\n\t}\n\tconst event = parseQualificationEvent(parsed);\n\tif (\n\t\trow.source !== \"external_backfill\" ||\n\t\trow.capture_origin !== \"vendor_historical_backfill\" ||\n\t\trow.source_mode !== \"vendor_historical_backfill_v1\" ||\n\t\trow.deployment_id !== \"market-data-vendor-backfill\" ||\n\t\trow.qualification_event_id !== event.qualification_event_id ||\n\t\trow.capture_bundle_id !== event.capture_bundle_id ||\n\t\trow.state !== event.state ||\n\t\trow.receipt_id !== event.receipt_id ||\n\t\trow.promotion_identity_sha256 !== event.promotion_identity_sha256 ||\n\t\trow.window_start_ms !== Date.parse(event.window.start_at) ||\n\t\trow.window_end_ms !== Date.parse(event.window.end_at) ||\n\t\trow.event_at_ms !== Date.parse(event.event_at) ||\n\t\trow.reason_code !== event.reason_code\n\t) {\n\t\tthrow new Error(\"qualification archive row does not match event JSON\");\n\t}\n\treturn event;\n}\n",
|
|
193
|
-
"import { sha256Canonical } from \"../market-data-archive/capture-contract\";\nimport { buildForwarderBatches } from \"./batching\";\nimport {\n\ttype ArchiveSelectionWire,\n\tarchiveSelectionCodec,\n\ttype BackfillArchiveRow,\n\tBackfillRequestValidationError,\n\tdecodeBackfillRunDocuments,\n\tEXTERNAL_BACKFILL_SOURCE,\n\ttype FinalBackfillStatus,\n\ttype ForwarderBatch,\n\ttype MarketDataVendorBackfillRequest,\n\tPROMOTION_RECEIPT_SCHEMA_ID,\n\ttype PromotionReceiptWire,\n\ttype ProviderCapability,\n\ttype ProviderObjectEvidence,\n\tpromotionReceiptCodec,\n} from \"./contracts\";\nimport {\n\tCryptoHftDataError,\n\tproviderAcquisitionRequest,\n} from \"./cryptohftdata\";\nimport { jcsCanonicalize } from \"./identity\";\nimport {\n\tCAPABILITY_POLICY,\n\tEFFECTIVE_ACQUISITION_POLICY_PIN,\n\tEFFECTIVE_ADAPTER_POLICY_PIN,\n\tRESOURCE_POLICY,\n} from \"./manifests\";\nimport {\n\tfinalizePromotionReceipt,\n\tpromotionReceiptMatchesCurrentPolicies,\n\tpromotionReceiptToArchiveRow,\n} from \"./promotion\";\nimport {\n\tfinalizeQualificationEvent,\n\tqualificationEventToArchiveRow,\n} from \"./qualification\";\nimport { archiveSelectionToArchiveRow } from \"./selection\";\n\nexport type ProviderDataset<Row = unknown> = {\n\tobjects: ProviderObjectEvidence[];\n\tvendorSemanticDigest: string;\n\trows: Row[];\n\treconstructedBooks?: unknown[];\n};\n\nexport type NormalizedBackfill = {\n\tcaptureBundleId: string;\n\tobjects: ProviderObjectEvidence[];\n\trows: BackfillArchiveRow[];\n\tvendorSemanticDigest: string;\n\tcanonicalSemanticDigest: string;\n};\n\nexport type CandidateVerification = {\n\tpassed: boolean;\n\tcaptureBundleId: string;\n\tcanonicalSemanticDigest: string;\n\tprefixDigest: string;\n\tsuffixDigest: string;\n\tseamVerified: boolean;\n\tcoverageVerified: boolean;\n\treasonCode?: string;\n};\n\nexport type ArchiveClusterIdentity = {\n\tenvironment: string;\n\tcluster: string;\n};\n\nexport type ProductionForwarderAuthorization = {\n\tauthorizationId: string;\n\tscope: \"production\";\n\tenvironment: string;\n\tcluster: string;\n\texpiresAt: string;\n\tcredentialValidated: true;\n};\n\nexport type ArchivePreflightResolution = {\n\tselection: ArchiveSelectionWire;\n\treceipts: PromotionReceiptWire[];\n\treaderIdentity: ArchiveClusterIdentity;\n\tverificationBaseline?: {\n\t\tprefixDigest: string;\n\t\tsuffixDigest: string;\n\t};\n};\n\nexport type ForwarderPreflightResolution = {\n\tforwarderIdentity: ArchiveClusterIdentity;\n\tauthorization: ProductionForwarderAuthorization;\n};\n\n/** @deprecated Use ArchivePreflightResolution and its exact selection. */\nexport type QualifiedCoverage = {\n\tcomplete: boolean;\n\tcoverageDigest: string;\n\tprefixDigest?: string;\n\tsuffixDigest?: string;\n};\n\nexport type BackfillDomainOutcome = {\n\tstatus: FinalBackfillStatus;\n\treasonCode: string;\n\treasonSubcode?: string;\n\trequestId?: string;\n\tidempotencyKey?: string;\n\ttarget?: ArchiveClusterIdentity;\n\tselection?: ArchiveSelectionWire;\n\treceipt?: PromotionReceiptWire;\n\tdiagnostics?: Record<string, string | number | boolean>;\n};\n\nexport type BackfillDependencies = {\n\tarchive: {\n\t\tresolveSelection(\n\t\t\trequest: MarketDataVendorBackfillRequest,\n\t\t): Promise<ArchivePreflightResolution>;\n\t\tverifyCandidate(\n\t\t\trequest: MarketDataVendorBackfillRequest,\n\t\t\tnormalized: NormalizedBackfill,\n\t\t\tcaptureBundleId: string,\n\t\t\tbaseline: ArchivePreflightResolution,\n\t\t): Promise<CandidateVerification>;\n\t};\n\tproviders: {\n\t\tcapabilityFor(\n\t\t\trequest: MarketDataVendorBackfillRequest,\n\t\t): ProviderCapability | undefined;\n\t\tacquire(\n\t\t\trequest: MarketDataVendorBackfillRequest,\n\t\t\tcapability: ProviderCapability,\n\t\t\tcredential: unknown,\n\t\t): Promise<ProviderDataset>;\n\t\tnormalize(\n\t\t\trequest: MarketDataVendorBackfillRequest,\n\t\t\tcapability: ProviderCapability,\n\t\t\tdataset: ProviderDataset,\n\t\t\tcaptureBundleId: string,\n\t\t): Promise<NormalizedBackfill>;\n\t};\n\tcredentials: {\n\t\tresolve(provider: \"cryptohftdata\"): Promise<unknown | undefined>;\n\t};\n\tforwarder: {\n\t\tpreflight(input: {\n\t\t\tauthorizationId: string;\n\t\t\ttarget: ArchiveClusterIdentity;\n\t\t}): Promise<ForwarderPreflightResolution>;\n\t\tsubmit(batch: ForwarderBatch): Promise<{ ok: boolean; inserted: number }>;\n\t};\n\tclock: { nowMs(): number };\n\tretry?: {\n\t\tmaxAttempts: number;\n\t\twait?: (completedAttempt: number) => Promise<void>;\n\t};\n\tlog?: (event: string, fields: Record<string, unknown>) => void;\n};\n\nexport function createMarketDataVendorBackfillDependencies(\n\tdependencies: BackfillDependencies,\n): BackfillDependencies {\n\tfor (const [name, value] of Object.entries({\n\t\tarchive: dependencies.archive,\n\t\tproviders: dependencies.providers,\n\t\tcredentials: dependencies.credentials,\n\t\tforwarder: dependencies.forwarder,\n\t\tclock: dependencies.clock,\n\t})) {\n\t\tif (!value || typeof value !== \"object\") {\n\t\t\tthrow new TypeError(`Backfill dependency ${name} is required`);\n\t\t}\n\t}\n\tfor (const [name, method] of Object.entries({\n\t\t\"archive.resolveSelection\": dependencies.archive.resolveSelection,\n\t\t\"archive.verifyCandidate\": dependencies.archive.verifyCandidate,\n\t\t\"providers.capabilityFor\": dependencies.providers.capabilityFor,\n\t\t\"providers.acquire\": dependencies.providers.acquire,\n\t\t\"providers.normalize\": dependencies.providers.normalize,\n\t\t\"credentials.resolve\": dependencies.credentials.resolve,\n\t\t\"forwarder.preflight\": dependencies.forwarder.preflight,\n\t\t\"forwarder.submit\": dependencies.forwarder.submit,\n\t\t\"clock.nowMs\": dependencies.clock.nowMs,\n\t})) {\n\t\tif (typeof method !== \"function\") {\n\t\t\tthrow new TypeError(`Backfill dependency ${name} is required`);\n\t\t}\n\t}\n\treturn dependencies;\n}\n\nfunction outcome(\n\trequest: MarketDataVendorBackfillRequest | undefined,\n\tstatus: FinalBackfillStatus,\n\treasonCode: string,\n\textra: Pick<\n\t\tBackfillDomainOutcome,\n\t\t\"reasonSubcode\" | \"selection\" | \"receipt\" | \"diagnostics\"\n\t> = {},\n): BackfillDomainOutcome {\n\treturn {\n\t\tstatus,\n\t\treasonCode,\n\t\t...(request\n\t\t\t? {\n\t\t\t\t\trequestId: request.requestId,\n\t\t\t\t\tidempotencyKey: request.idempotencyKey,\n\t\t\t\t\t...(request.target ? { target: request.target } : {}),\n\t\t\t\t}\n\t\t\t: {}),\n\t\t...extra,\n\t};\n}\n\nfunction captureBundleId(\n\trequest: MarketDataVendorBackfillRequest,\n\tcapability: ProviderCapability,\n\tdataset: ProviderDataset,\n): string {\n\t// Capture-bundle identity intentionally retains the existing capture checksum\n\t// algorithm. RFC 8785 applies only to final-v1 wire documents.\n\treturn sha256Canonical({\n\t\trequest_business_identity: request.idempotencyKey,\n\t\tprovider: capability.provider,\n\t\tprovider_exchange_id: capability.providerExchangeId,\n\t\tresolved_symbol: capability.resolvedSymbol,\n\t\tadapter_version: capability.adapterVersion,\n\t\tobjects: dataset.objects.map(({ identity, checksum, bytes, rows }) => ({\n\t\t\tidentity,\n\t\t\tchecksum,\n\t\t\tbytes,\n\t\t\trows,\n\t\t})),\n\t\tcanonical_schema_version: request.expectedProduct.canonicalSchemaVersion,\n\t\tchecksum_algorithm: request.expectedProduct.checksumAlgorithm,\n\t});\n}\n\nfunction buildPromotionReceipt(\n\trequest: MarketDataVendorBackfillRequest,\n\tcapability: ProviderCapability,\n\tnormalized: NormalizedBackfill,\n\tverification: CandidateVerification,\n\tverificationTimeMs: number,\n): PromotionReceiptWire {\n\tif (\n\t\t!request.wire ||\n\t\t!request.initialSelection ||\n\t\t!request.expectedCanonicalSchema ||\n\t\t!request.coveragePolicy ||\n\t\t!request.productPins\n\t) {\n\t\tthrow new Error(\"decoded final-v1 request context is missing\");\n\t}\n\tif (\n\t\trequest.productPins.capability_policy.policy_id !==\n\t\t\tCAPABILITY_POLICY.policy_id ||\n\t\trequest.productPins.capability_policy.policy_sha256 !==\n\t\t\tCAPABILITY_POLICY.policy_sha256 ||\n\t\trequest.productPins.resource_policy.policy_id !==\n\t\t\tRESOURCE_POLICY.policy_id ||\n\t\trequest.productPins.resource_policy.policy_sha256 !==\n\t\t\tRESOURCE_POLICY.policy_sha256\n\t) {\n\t\tthrow new Error(\"promotion receipt requires the current policy tuple\");\n\t}\n\treturn finalizePromotionReceipt({\n\t\tschema_id: PROMOTION_RECEIPT_SCHEMA_ID,\n\t\tverified_at: new Date(verificationTimeMs).toISOString(),\n\t\trequest_id: request.requestId,\n\t\tidempotency_key: request.idempotencyKey,\n\t\tsource: EXTERNAL_BACKFILL_SOURCE,\n\t\tcapture_origin: \"vendor_historical_backfill\",\n\t\tsource_mode: \"vendor_historical_backfill_v1\",\n\t\tprovider: capability.provider,\n\t\tadapter_version: capability.adapterVersion,\n\t\teffective_policies: {\n\t\t\tcapability_policy: request.productPins.capability_policy,\n\t\t\tresource_policy: request.productPins.resource_policy,\n\t\t\tadapter_policy: EFFECTIVE_ADAPTER_POLICY_PIN,\n\t\t\tacquisition_policy: EFFECTIVE_ACQUISITION_POLICY_PIN,\n\t\t},\n\t\tcapture_bundle_id: normalized.captureBundleId,\n\t\tscope: request.wire.scope,\n\t\twindow: request.wire.window,\n\t\tdepth: request.depth,\n\t\tconstruction_mode: request.constructionMode,\n\t\tcanonical_schema: request.expectedCanonicalSchema,\n\t\tcoverage_policy: request.coveragePolicy,\n\t\tselection_sha256: request.initialSelection.selection_sha256,\n\t\tvendor_semantic_digest: normalized.vendorSemanticDigest,\n\t\tcanonical_semantic_digest: verification.canonicalSemanticDigest,\n\t\tprefix_digest: verification.prefixDigest,\n\t\tsuffix_digest: verification.suffixDigest,\n\t\tseam_verified: true,\n\t\tcoverage_verified: true,\n\t\tdataset_objects: normalized.objects,\n\t});\n}\n\nasync function submitAll(\n\tdependencies: BackfillDependencies,\n\tbatches: readonly ForwarderBatch[],\n): Promise<boolean> {\n\tconst maxAttempts = Math.max(\n\t\t1,\n\t\tMath.min(10, dependencies.retry?.maxAttempts ?? 3),\n\t);\n\tfor (const batch of batches) {\n\t\tlet accepted = false;\n\t\tfor (let attempt = 1; attempt <= maxAttempts; attempt += 1) {\n\t\t\ttry {\n\t\t\t\tconst response = await dependencies.forwarder.submit(batch);\n\t\t\t\taccepted = response.ok && response.inserted === batch.rows.length;\n\t\t\t} catch {\n\t\t\t\taccepted = false;\n\t\t\t}\n\t\t\tif (accepted) break;\n\t\t\tif (attempt < maxAttempts) await dependencies.retry?.wait?.(attempt);\n\t\t}\n\t\tif (!accepted) return false;\n\t}\n\treturn true;\n}\n\nfunction stableFailureReason(error: unknown, fallback: string): string {\n\tif (error && typeof error === \"object\") {\n\t\tconst reason = (error as { reason?: unknown }).reason;\n\t\tif (typeof reason === \"string\" && /^[a-z][a-z0-9_]{0,127}$/.test(reason)) {\n\t\t\treturn reason;\n\t\t}\n\t}\n\treturn fallback;\n}\n\nfunction safeErrorClass(error: unknown): string {\n\tif (error instanceof RangeError) return \"RangeError\";\n\tif (error instanceof TypeError) return \"TypeError\";\n\tif (error instanceof SyntaxError) return \"SyntaxError\";\n\treturn \"Error\";\n}\n\nfunction safeCryptoHftDiagnostics(\n\terror: CryptoHftDataError,\n\tfailurePhase: string,\n): Record<string, string | number | boolean> {\n\tconst diagnostics = error.diagnostics;\n\tif (\n\t\t\"dataset_object_identity\" in diagnostics ||\n\t\t\"dataset_object_checksum\" in diagnostics\n\t) {\n\t\tconst safe: Record<string, string | number | boolean> = {};\n\t\tfor (const key of [\n\t\t\t\"dataset_object_identity\",\n\t\t\t\"dataset_object_checksum\",\n\t\t\t\"failure_phase\",\n\t\t\t\"attempt_count\",\n\t\t\t\"quarantined\",\n\t\t] as const) {\n\t\t\tconst value = diagnostics[key];\n\t\t\tif (\n\t\t\t\ttypeof value === \"string\" ||\n\t\t\t\ttypeof value === \"number\" ||\n\t\t\t\ttypeof value === \"boolean\"\n\t\t\t) {\n\t\t\t\tsafe[key] = value;\n\t\t\t}\n\t\t}\n\t\tif (!(\"failure_phase\" in safe)) safe.failure_phase = failurePhase;\n\t\treturn safe;\n\t}\n\treturn {\n\t\t...diagnostics,\n\t\tfailure_phase: diagnostics.failure_phase ?? failurePhase,\n\t};\n}\n\nfunction assertArchivePreflight(\n\trequest: MarketDataVendorBackfillRequest,\n\tresolution: ArchivePreflightResolution,\n): void {\n\tif (!request.target || !request.productionAuthorizationId) {\n\t\tthrow new Error(\"request target or production authorization ID is missing\");\n\t}\n\tconst selection = archiveSelectionCodec.decode(resolution.selection);\n\tconst receipts = resolution.receipts.map((receipt) =>\n\t\tpromotionReceiptCodec.decode(receipt),\n\t);\n\tconst receiptById = new Map<string, PromotionReceiptWire>();\n\tfor (const receipt of receipts) {\n\t\tconst existing = receiptById.get(receipt.receipt_id);\n\t\tif (existing && jcsCanonicalize(existing) !== jcsCanonicalize(receipt)) {\n\t\t\tthrow new Error(\"stored receipt identity has conflicting content\");\n\t\t}\n\t\treceiptById.set(receipt.receipt_id, receipt);\n\t}\n\tfor (const bundle of selection.bundles) {\n\t\tif (bundle.capture_origin === \"vendor_historical_backfill\") {\n\t\t\tconst receipt = bundle.qualification\n\t\t\t\t? receiptById.get(bundle.qualification.receipt_id)\n\t\t\t\t: undefined;\n\t\t\tif (!receipt) {\n\t\t\t\tthrow new Error(\"vendor selection lacks its validated stored receipt\");\n\t\t\t}\n\t\t\tif (!promotionReceiptMatchesCurrentPolicies(receipt)) {\n\t\t\t\tthrow new Error(\"vendor selection receipt is not current-qualified\");\n\t\t\t}\n\t\t}\n\t}\n\tif (\n\t\tresolution.readerIdentity.environment !== request.target.environment ||\n\t\tresolution.readerIdentity.cluster !== request.target.cluster\n\t) {\n\t\tthrow new Error(\"archive reader cluster identity mismatch\");\n\t}\n}\n\nfunction assertForwarderPreflight(\n\trequest: MarketDataVendorBackfillRequest,\n\tresolution: ForwarderPreflightResolution,\n\tnowMs: number,\n): void {\n\tif (!request.target || !request.productionAuthorizationId) {\n\t\tthrow new Error(\"request target or production authorization ID is missing\");\n\t}\n\tif (\n\t\tresolution.forwarderIdentity.environment !== request.target.environment ||\n\t\tresolution.forwarderIdentity.cluster !== request.target.cluster\n\t) {\n\t\tthrow new Error(\"archive forwarder cluster identity mismatch\");\n\t}\n\tconst authorization = resolution.authorization;\n\tconst expiresAtMs = Date.parse(authorization.expiresAt);\n\tif (\n\t\tauthorization.authorizationId !== request.productionAuthorizationId ||\n\t\tauthorization.scope !== \"production\" ||\n\t\tauthorization.environment !== request.target.environment ||\n\t\tauthorization.cluster !== request.target.cluster ||\n\t\tauthorization.credentialValidated !== true ||\n\t\t!Number.isSafeInteger(expiresAtMs) ||\n\t\tnew Date(expiresAtMs).toISOString() !== authorization.expiresAt ||\n\t\texpiresAtMs <= nowMs\n\t) {\n\t\tthrow new Error(\"production forwarder authorization is invalid\");\n\t}\n}\n\nfunction resourcePolicyScopeExceeded(\n\trequest: MarketDataVendorBackfillRequest,\n): boolean {\n\treturn (\n\t\trequest.depth > RESOURCE_POLICY.request_bounds.max_depth ||\n\t\trequest.window.endTimeMs - request.window.startTimeMs >\n\t\t\tRESOURCE_POLICY.request_bounds.max_window_ms ||\n\t\trequest.requiredClockTargetsMs.length >\n\t\t\tRESOURCE_POLICY.request_bounds.max_required_events\n\t);\n}\n\nfunction storedReceiptForSelection(\n\tresolution: ArchivePreflightResolution,\n): PromotionReceiptWire | undefined {\n\tconst receiptId = resolution.selection.receipt_ids[0];\n\treturn receiptId\n\t\t? resolution.receipts.find((receipt) => receipt.receipt_id === receiptId)\n\t\t: undefined;\n}\n\nexport async function runMarketDataVendorBackfill(\n\tinput: unknown,\n\tdependencies: BackfillDependencies,\n): Promise<BackfillDomainOutcome> {\n\tlet request: MarketDataVendorBackfillRequest;\n\ttry {\n\t\tconst documents = input as { request?: unknown; requiredClock?: unknown };\n\t\trequest = decodeBackfillRunDocuments({\n\t\t\trequest: documents.request,\n\t\t\trequiredClock: documents.requiredClock,\n\t\t});\n\t} catch (error) {\n\t\treturn outcome(undefined, \"request_invalid\", \"request_invalid\", {\n\t\t\t...(error instanceof BackfillRequestValidationError\n\t\t\t\t? { reasonSubcode: error.reasonSubcode }\n\t\t\t\t: {}),\n\t\t});\n\t}\n\n\tlet initialResolution: ArchivePreflightResolution;\n\ttry {\n\t\tinitialResolution = await dependencies.archive.resolveSelection(request);\n\t\tassertArchivePreflight(request, initialResolution);\n\t\tconst forwarderPreflight = await dependencies.forwarder.preflight({\n\t\t\tauthorizationId: request.productionAuthorizationId as string,\n\t\t\ttarget: request.target as ArchiveClusterIdentity,\n\t\t});\n\t\tassertForwarderPreflight(\n\t\t\trequest,\n\t\t\tforwarderPreflight,\n\t\t\tdependencies.clock.nowMs(),\n\t\t);\n\t} catch {\n\t\treturn outcome(\n\t\t\trequest,\n\t\t\t\"archive_preflight_failed\",\n\t\t\t\"archive_preflight_failed\",\n\t\t);\n\t}\n\tif (initialResolution.selection.coverage_class === \"complete\") {\n\t\tconst receipt = storedReceiptForSelection(initialResolution);\n\t\treturn outcome(request, \"already_covered\", \"qualified_coverage_complete\", {\n\t\t\tselection: initialResolution.selection,\n\t\t\t...(receipt ? { receipt } : {}),\n\t\t});\n\t}\n\n\tif (resourcePolicyScopeExceeded(request)) {\n\t\treturn outcome(\n\t\t\trequest,\n\t\t\t\"capability_unsupported\",\n\t\t\t\"capability_unsupported\",\n\t\t\t{ reasonSubcode: \"resource_policy_scope_exceeded\" },\n\t\t);\n\t}\n\tif (\n\t\trequest.sourcePolicy === \"fill_gaps\" &&\n\t\t(request.productPins?.capability_policy.policy_id !==\n\t\t\tCAPABILITY_POLICY.policy_id ||\n\t\t\trequest.productPins.capability_policy.policy_sha256 !==\n\t\t\t\tCAPABILITY_POLICY.policy_sha256)\n\t) {\n\t\treturn outcome(request, \"capability_unsupported\", \"scope_unsupported\", {\n\t\t\treasonSubcode: \"fill_gaps_requires_capability_policy_v3\",\n\t\t});\n\t}\n\n\tlet capability: ProviderCapability | undefined;\n\ttry {\n\t\tcapability = dependencies.providers.capabilityFor(request);\n\t} catch {\n\t\treturn outcome(\n\t\t\trequest,\n\t\t\t\"capability_unsupported\",\n\t\t\t\"capability_probe_failed\",\n\t\t);\n\t}\n\tif (!capability) {\n\t\treturn outcome(request, \"capability_unsupported\", \"scope_unsupported\");\n\t}\n\tif (\n\t\t!request.providerPolicy.allowedAdapterVersions.includes(\n\t\t\tcapability.adapterVersion,\n\t\t)\n\t) {\n\t\treturn outcome(\n\t\t\trequest,\n\t\t\t\"capability_unsupported\",\n\t\t\t\"adapter_version_unpinned\",\n\t\t);\n\t}\n\n\tlet credential: unknown;\n\ttry {\n\t\tcredential = await dependencies.credentials.resolve(capability.provider);\n\t} catch {\n\t\treturn outcome(\n\t\t\trequest,\n\t\t\t\"credentials_missing\",\n\t\t\t\"credential_resolution_failed\",\n\t\t);\n\t}\n\tif (credential === undefined || credential === null) {\n\t\treturn outcome(\n\t\t\trequest,\n\t\t\t\"credentials_missing\",\n\t\t\t\"provider_credentials_missing\",\n\t\t);\n\t}\n\n\tlet dataset: ProviderDataset;\n\tlet normalized: NormalizedBackfill;\n\tlet failurePhase = \"acquire\";\n\ttry {\n\t\tconst acquisitionRequest = providerAcquisitionRequest(request);\n\t\tdataset = await dependencies.providers.acquire(\n\t\t\tacquisitionRequest,\n\t\t\tcapability,\n\t\t\tcredential,\n\t\t);\n\t\tconst bundleId = captureBundleId(request, capability, dataset);\n\t\tfailurePhase = \"normalize\";\n\t\tnormalized = await dependencies.providers.normalize(\n\t\t\tacquisitionRequest,\n\t\t\tcapability,\n\t\t\tdataset,\n\t\t\tbundleId,\n\t\t);\n\t\tif (normalized.captureBundleId !== bundleId) {\n\t\t\treturn outcome(request, \"vendor_fetch_failed\", \"vendor_fetch_failed\", {\n\t\t\t\treasonSubcode: \"capture_identity_mismatch\",\n\t\t\t});\n\t\t}\n\t} catch (error) {\n\t\tconst reason = stableFailureReason(error, \"provider_dataset_invalid\");\n\t\treturn outcome(request, \"vendor_fetch_failed\", \"vendor_fetch_failed\", {\n\t\t\treasonSubcode: reason.startsWith(\"budget_\")\n\t\t\t\t? \"resource_limit_exceeded\"\n\t\t\t\t: reason,\n\t\t\t...(error instanceof CryptoHftDataError\n\t\t\t\t? {\n\t\t\t\t\t\tdiagnostics: safeCryptoHftDiagnostics(error, failurePhase),\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tdiagnostics: {\n\t\t\t\t\t\t\terror_class: safeErrorClass(error),\n\t\t\t\t\t\t\tfailure_phase: failurePhase,\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t});\n\t}\n\n\ttry {\n\t\tconst candidateBatches = buildForwarderBatches({\n\t\t\tcaptureBundleId: normalized.captureBundleId,\n\t\t\tdeploymentId: \"market-data-vendor-backfill\",\n\t\t\trows: normalized.rows,\n\t\t});\n\t\tif (!(await submitAll(dependencies, candidateBatches))) {\n\t\t\treturn outcome(\n\t\t\t\trequest,\n\t\t\t\t\"archive_ingest_failed\",\n\t\t\t\t\"candidate_batch_rejected\",\n\t\t\t);\n\t\t}\n\t} catch {\n\t\treturn outcome(\n\t\t\trequest,\n\t\t\t\"archive_ingest_failed\",\n\t\t\t\"candidate_submission_failed\",\n\t\t);\n\t}\n\n\tlet verification: CandidateVerification;\n\ttry {\n\t\tverification = await dependencies.archive.verifyCandidate(\n\t\t\trequest,\n\t\t\tnormalized,\n\t\t\tnormalized.captureBundleId,\n\t\t\tinitialResolution,\n\t\t);\n\t} catch {\n\t\treturn outcome(\n\t\t\trequest,\n\t\t\t\"promotion_verification_failed\",\n\t\t\t\"candidate_query_failed\",\n\t\t);\n\t}\n\tif (\n\t\t!verification.passed ||\n\t\tverification.captureBundleId !== normalized.captureBundleId ||\n\t\tverification.canonicalSemanticDigest !==\n\t\t\tnormalized.canonicalSemanticDigest ||\n\t\t!verification.seamVerified ||\n\t\t!verification.coverageVerified\n\t) {\n\t\treturn outcome(\n\t\t\trequest,\n\t\t\t\"promotion_verification_failed\",\n\t\t\tverification.reasonCode ?? \"semantic_verification_failed\",\n\t\t);\n\t}\n\n\tlet receipt: PromotionReceiptWire;\n\ttry {\n\t\treceipt = buildPromotionReceipt(\n\t\t\trequest,\n\t\t\tcapability,\n\t\t\tnormalized,\n\t\t\tverification,\n\t\t\tdependencies.clock.nowMs(),\n\t\t);\n\t\tconst [batch] = buildForwarderBatches({\n\t\t\tcaptureBundleId: normalized.captureBundleId,\n\t\t\tdeploymentId: \"market-data-vendor-backfill\",\n\t\t\trows: [promotionReceiptToArchiveRow(receipt)],\n\t\t});\n\t\tif (!batch || !(await submitAll(dependencies, [batch]))) {\n\t\t\treturn outcome(\n\t\t\t\trequest,\n\t\t\t\t\"archive_ingest_failed\",\n\t\t\t\t\"promotion_commit_failed\",\n\t\t\t);\n\t\t}\n\t\tconst qualification = finalizeQualificationEvent({\n\t\t\tcapture_bundle_id: receipt.capture_bundle_id,\n\t\t\tstate: \"qualified\",\n\t\t\treceipt_id: receipt.receipt_id,\n\t\t\tpromotion_identity_sha256: receipt.promotion_identity_sha256,\n\t\t\twindow: receipt.window,\n\t\t\tevent_at: receipt.verified_at,\n\t\t\treason_code: \"promotion_verified\",\n\t\t});\n\t\tconst [qualificationBatch] = buildForwarderBatches({\n\t\t\tcaptureBundleId: normalized.captureBundleId,\n\t\t\tdeploymentId: \"market-data-vendor-backfill\",\n\t\t\trows: [qualificationEventToArchiveRow(qualification)],\n\t\t});\n\t\tif (\n\t\t\t!qualificationBatch ||\n\t\t\t!(await submitAll(dependencies, [qualificationBatch]))\n\t\t) {\n\t\t\treturn outcome(\n\t\t\t\trequest,\n\t\t\t\t\"archive_ingest_failed\",\n\t\t\t\t\"qualification_commit_failed\",\n\t\t\t\t{ receipt },\n\t\t\t);\n\t\t}\n\t} catch {\n\t\treturn outcome(request, \"archive_ingest_failed\", \"promotion_commit_failed\");\n\t}\n\n\tlet finalResolution: ArchivePreflightResolution;\n\ttry {\n\t\tfinalResolution = await dependencies.archive.resolveSelection(request);\n\t\tassertArchivePreflight(request, finalResolution);\n\t} catch (error) {\n\t\treturn outcome(\n\t\t\trequest,\n\t\t\t\"promotion_verification_failed\",\n\t\t\t\"post_promotion_selection_failed\",\n\t\t\t{\n\t\t\t\treceipt,\n\t\t\t\treasonSubcode: stableFailureReason(\n\t\t\t\t\terror,\n\t\t\t\t\t\"archive_selection_resolution_failed\",\n\t\t\t\t),\n\t\t\t},\n\t\t);\n\t}\n\tif (finalResolution.selection.coverage_class !== \"complete\") {\n\t\treturn outcome(\n\t\t\trequest,\n\t\t\t\"promotion_verification_failed\",\n\t\t\t\"qualified_coverage_incomplete\",\n\t\t\t{ receipt, selection: finalResolution.selection },\n\t\t);\n\t}\n\tif (\n\t\tfinalResolution.selection.bundles.some(\n\t\t\t(bundle) =>\n\t\t\t\tbundle.capture_bundle_id === receipt.capture_bundle_id &&\n\t\t\t\tbundle.capture_origin === \"vendor_historical_backfill\" &&\n\t\t\t\tbundle.qualification?.receipt_id === receipt.receipt_id,\n\t\t) === false\n\t) {\n\t\treturn outcome(\n\t\t\trequest,\n\t\t\t\"promotion_verification_failed\",\n\t\t\t\"promoted_receipt_not_selected\",\n\t\t\t{ receipt, selection: finalResolution.selection },\n\t\t);\n\t}\n\ttry {\n\t\tif (!request.wire) throw new Error(\"decoded request wire is missing\");\n\t\tconst [selectionBatch] = buildForwarderBatches({\n\t\t\tcaptureBundleId: receipt.capture_bundle_id,\n\t\t\tdeploymentId: \"market-data-vendor-backfill\",\n\t\t\trows: [\n\t\t\t\tarchiveSelectionToArchiveRow(request.wire, finalResolution.selection),\n\t\t\t],\n\t\t});\n\t\tif (!selectionBatch || !(await submitAll(dependencies, [selectionBatch]))) {\n\t\t\treturn outcome(\n\t\t\t\trequest,\n\t\t\t\t\"archive_ingest_failed\",\n\t\t\t\t\"selection_persistence_failed\",\n\t\t\t\t{ receipt, selection: finalResolution.selection },\n\t\t\t);\n\t\t}\n\t} catch {\n\t\treturn outcome(\n\t\t\trequest,\n\t\t\t\"archive_ingest_failed\",\n\t\t\t\"selection_persistence_failed\",\n\t\t\t{ receipt, selection: finalResolution.selection },\n\t\t);\n\t}\n\treturn outcome(request, \"promoted\", \"promotion_qualified\", {\n\t\treceipt,\n\t\tselection: finalResolution.selection,\n\t});\n}\n",
|
|
194
|
-
"import type { ForwarderBatch } from \"./contracts\";\nimport type {\n\tArchiveClusterIdentity,\n\tProductionForwarderAuthorization,\n} from \"./core\";\n\nexport type ArchiveForwarderClient = {\n\tpreflight(input: {\n\t\tauthorizationId: string;\n\t\ttarget: ArchiveClusterIdentity;\n\t}): Promise<{\n\t\tforwarderIdentity: ArchiveClusterIdentity;\n\t\tauthorization: ProductionForwarderAuthorization;\n\t}>;\n\tsubmit(batch: ForwarderBatch): Promise<{ ok: boolean; inserted: number }>;\n};\n\nexport type ArchiveForwarderClientOptions = {\n\turl: string;\n\tauthToken?: string;\n\tfetch?: typeof globalThis.fetch;\n};\n\nexport class ArchiveForwarderSubmissionError extends Error {\n\treadonly reason: string;\n\n\tconstructor(reason: string, status?: number) {\n\t\tsuper(status === undefined ? reason : `${reason}:${status}`);\n\t\tthis.name = \"ArchiveForwarderSubmissionError\";\n\t\tthis.reason = reason;\n\t}\n}\n\nfunction parseAdmissionResult(\n\tvalue: unknown,\n): { ok: boolean; inserted: number } | undefined {\n\tif (!value || typeof value !== \"object\" || Array.isArray(value)) return;\n\tconst record = value as Record<string, unknown>;\n\tif (\n\t\trecord.ok !== true ||\n\t\ttypeof record.inserted !== \"number\" ||\n\t\t!Number.isSafeInteger(record.inserted) ||\n\t\trecord.inserted < 0\n\t) {\n\t\treturn;\n\t}\n\treturn { ok: true, inserted: record.inserted };\n}\n\nexport function createArchiveForwarderClient(\n\toptions: ArchiveForwarderClientOptions,\n): ArchiveForwarderClient {\n\tconst url = options.url.trim();\n\tif (!url) throw new Error(\"archive_forwarder_url_required\");\n\tconst request = options.fetch ?? globalThis.fetch;\n\tconst authorizationHeaders: Record<string, string> = {};\n\tif (options.authToken?.trim()) {\n\t\tauthorizationHeaders.authorization = `Bearer ${options.authToken.trim()}`;\n\t}\n\n\treturn {\n\t\tasync preflight(input) {\n\t\t\tconst endpoint = new URL(url);\n\t\t\tendpoint.pathname = \"/health/market-data-vendor-backfill\";\n\t\t\tendpoint.search = \"\";\n\t\t\tendpoint.hash = \"\";\n\t\t\tlet response: Response;\n\t\t\ttry {\n\t\t\t\tresponse = await request(endpoint, {\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t...authorizationHeaders,\n\t\t\t\t\t\t\"x-archive-authorization-id\": input.authorizationId,\n\t\t\t\t\t\t\"x-archive-environment\": input.target.environment,\n\t\t\t\t\t\t\"x-archive-cluster\": input.target.cluster,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t} catch {\n\t\t\t\tthrow new ArchiveForwarderSubmissionError(\n\t\t\t\t\t\"archive_forwarder_preflight_unreachable\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (!response.ok) {\n\t\t\t\tthrow new ArchiveForwarderSubmissionError(\n\t\t\t\t\t\"archive_forwarder_preflight_http_error\",\n\t\t\t\t\tresponse.status,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst value = await response.json().catch(() => undefined);\n\t\t\tif (!value || typeof value !== \"object\" || Array.isArray(value)) {\n\t\t\t\tthrow new ArchiveForwarderSubmissionError(\n\t\t\t\t\t\"archive_forwarder_invalid_preflight\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst record = value as Record<string, unknown>;\n\t\t\tconst identity = record.forwarder_identity as\n\t\t\t\t| Record<string, unknown>\n\t\t\t\t| undefined;\n\t\t\tconst authorization = record.authorization as\n\t\t\t\t| Record<string, unknown>\n\t\t\t\t| undefined;\n\t\t\tconst expiresAtMs =\n\t\t\t\ttypeof authorization?.expires_at === \"string\"\n\t\t\t\t\t? Date.parse(authorization.expires_at)\n\t\t\t\t\t: Number.NaN;\n\t\t\tif (\n\t\t\t\trecord.ok !== true ||\n\t\t\t\t!identity ||\n\t\t\t\tidentity.environment !== input.target.environment ||\n\t\t\t\tidentity.cluster !== input.target.cluster ||\n\t\t\t\t!authorization ||\n\t\t\t\tauthorization.authorization_id !== input.authorizationId ||\n\t\t\t\tauthorization.scope !== \"production\" ||\n\t\t\t\tauthorization.environment !== input.target.environment ||\n\t\t\t\tauthorization.cluster !== input.target.cluster ||\n\t\t\t\ttypeof authorization.expires_at !== \"string\" ||\n\t\t\t\t!Number.isSafeInteger(expiresAtMs) ||\n\t\t\t\tnew Date(expiresAtMs).toISOString() !== authorization.expires_at ||\n\t\t\t\tauthorization.credential_validated !== true\n\t\t\t) {\n\t\t\t\tthrow new ArchiveForwarderSubmissionError(\n\t\t\t\t\t\"archive_forwarder_invalid_preflight\",\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tforwarderIdentity: {\n\t\t\t\t\tenvironment: identity.environment as string,\n\t\t\t\t\tcluster: identity.cluster as string,\n\t\t\t\t},\n\t\t\t\tauthorization: {\n\t\t\t\t\tauthorizationId: authorization.authorization_id as string,\n\t\t\t\t\tscope: \"production\",\n\t\t\t\t\tenvironment: authorization.environment as string,\n\t\t\t\t\tcluster: authorization.cluster as string,\n\t\t\t\t\texpiresAt: authorization.expires_at,\n\t\t\t\t\tcredentialValidated: true,\n\t\t\t\t},\n\t\t\t};\n\t\t},\n\t\tasync submit(batch) {\n\t\t\tlet response: Response;\n\t\t\ttry {\n\t\t\t\tresponse = await request(url, {\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t\"content-type\": \"application/json\",\n\t\t\t\t\t\t...authorizationHeaders,\n\t\t\t\t\t},\n\t\t\t\t\tbody: JSON.stringify(batch),\n\t\t\t\t});\n\t\t\t} catch {\n\t\t\t\tthrow new ArchiveForwarderSubmissionError(\n\t\t\t\t\t\"archive_forwarder_unreachable\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (!response.ok) {\n\t\t\t\tthrow new ArchiveForwarderSubmissionError(\n\t\t\t\t\t\"archive_forwarder_http_error\",\n\t\t\t\t\tresponse.status,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst admission = parseAdmissionResult(\n\t\t\t\tawait response.json().catch(() => undefined),\n\t\t\t);\n\t\t\tif (!admission) {\n\t\t\t\tthrow new ArchiveForwarderSubmissionError(\n\t\t\t\t\t\"archive_forwarder_invalid_response\",\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn admission;\n\t\t},\n\t};\n}\n"
|
|
195
|
-
],
|
|
196
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EACA,OAAO,eAAe,SAAS,cAAc,EAAE,OAAO,KAAK,CAAC;AAAA,EACpD,qBAAqB,2BAA2B,sBAAsB,wBAAwB,oBAAoB,oBAAoB,qBAAqB,cAAc,YAAY,cAAc,gBAAgB,eAAe,qBAAqB,sBAAmB;AAAA;AAAA,EAElR,MAAM,YAAY;AAAA,EAClB;AAAA,EACQ,sBAAc;AAAA,EACd,qBAAa;AAAA;AAAA,EACrB,MAAM,aAAa,YAAY;AAAA,IAC3B,WAAW,CAAC,GAAG;AAAA,MACX,MAAM;AAAA,MACN,IAAI,CAAS,mBAAW,KAAK,CAAC;AAAA,QAC1B,MAAM,IAAI,MAAM,0CAA0C;AAAA,MAC9D,KAAK,MAAM;AAAA;AAAA,IAEf,QAAQ,GAAG;AAAA,MACP,OAAO,KAAK;AAAA;AAAA,IAEhB,QAAQ,GAAG;AAAA,MACP,OAAO;AAAA;AAAA,QAEP,KAAK,GAAG;AAAA,MACR,OAAO,GAAG,KAAK,MAAM,EAAE;AAAA;AAAA,EAE/B;AAAA,EACQ,eAAO;AAAA;AAAA,EACf,MAAM,cAAc,YAAY;AAAA,IAC5B,WAAW,CAAC,MAAM;AAAA,MACd,MAAM;AAAA,MACN,KAAK,SAAS,OAAO,SAAS,WAAW,CAAC,IAAI,IAAI;AAAA;AAAA,IAEtD,QAAQ,GAAG;AAAA,MACP,OAAO,KAAK;AAAA;AAAA,IAEhB,QAAQ,GAAG;AAAA,MACP,IAAI,KAAK,OAAO,SAAS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