@prisma/orm-target-mongo 8.0.0-rc.24-dev.10 → 8.0.0-rc.24-dev.12
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/adapter.mjs +1 -1
- package/dist/adapter.mjs.map +1 -1
- package/dist/adapter__control.mjs +1 -1
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.mjs +2 -2
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/{codecs-Bl21z49D-Bj5erX9r.mjs → codecs-DB6ji3ee-BzMiSM6G.mjs} +3 -3
- package/dist/{codecs-Bl21z49D-Bj5erX9r.mjs.map → codecs-DB6ji3ee-BzMiSM6G.mjs.map} +1 -1
- package/dist/{control-BxslS3_F.mjs → control-BlMckWwK.mjs} +2 -2
- package/dist/{control-BxslS3_F.mjs.map → control-BlMckWwK.mjs.map} +1 -1
- package/dist/{control-BeycNjYq.mjs → control-D4YmyZYa.mjs} +2 -2
- package/dist/{control-BeycNjYq.mjs.map → control-D4YmyZYa.mjs.map} +1 -1
- package/dist/{data-types-B3SLjbqa-C1LmrfzH.mjs → data-types-BR7vssy0-CuNYIJHI.mjs} +8 -8
- package/dist/data-types-BR7vssy0-CuNYIJHI.mjs.map +1 -0
- package/dist/{date-time-now-generators-Dhq1b2V8-TgMEfnbI.mjs → date-time-now-generators-CMBWOjGk-Dux-x9uO.mjs} +3 -3
- package/dist/{date-time-now-generators-Dhq1b2V8-TgMEfnbI.mjs.map → date-time-now-generators-CMBWOjGk-Dux-x9uO.mjs.map} +1 -1
- package/dist/{descriptor-meta-BXMz_uZd-B8WB2m7v.mjs → descriptor-meta-QyKsSxUQ-Cl1ZCbq3.mjs} +5 -5
- package/dist/{descriptor-meta-BXMz_uZd-B8WB2m7v.mjs.map → descriptor-meta-QyKsSxUQ-Cl1ZCbq3.mjs.map} +1 -1
- package/dist/{descriptor-meta-runtime-J4eVdBtZ-D1yRng4t.mjs → descriptor-meta-runtime-D1jWMDgB-Cazw1WYy.mjs} +4 -4
- package/dist/{descriptor-meta-runtime-J4eVdBtZ-D1yRng4t.mjs.map → descriptor-meta-runtime-D1jWMDgB-Cazw1WYy.mjs.map} +1 -1
- package/dist/driver.mjs +1 -1
- package/dist/driver__control.mjs +1 -1
- package/dist/driver__runtime.mjs +1 -1
- package/dist/driver__runtime.mjs.map +1 -1
- package/dist/{mongo-adapter-RJ_YOxiK-CCHpxwqy.mjs → mongo-adapter-DemWVyNv-B3xRFRas.mjs} +8 -5
- package/dist/mongo-adapter-DemWVyNv-B3xRFRas.mjs.map +1 -0
- package/dist/{mongo-driver-Bbn2RC5Z-jV3_Ah3Z.mjs → mongo-driver-DM78qXUr-CLd1ZmY6.mjs} +3 -3
- package/dist/{mongo-driver-Bbn2RC5Z-jV3_Ah3Z.mjs.map → mongo-driver-DM78qXUr-CLd1ZmY6.mjs.map} +1 -1
- package/dist/{prisma6-binding-BXi_1e8c.mjs → prisma6-binding-BwMMxDjX.mjs} +2 -2
- package/dist/{prisma6-binding-BXi_1e8c.mjs.map → prisma6-binding-BwMMxDjX.mjs.map} +1 -1
- package/dist/{runtime-CkX-HAf5.mjs → runtime-CK8zbCMW.mjs} +2 -2
- package/dist/{runtime-CkX-HAf5.mjs.map → runtime-CK8zbCMW.mjs.map} +1 -1
- package/dist/target.mjs +5 -5
- package/dist/target__codecs.mjs +1 -1
- package/dist/target__control.mjs +1 -1
- package/dist/target__data-types.mjs +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__pack.mjs.map +1 -1
- package/dist/target__prisma6-binding.mjs +1 -1
- package/dist/target__runtime.mjs +2 -2
- package/package.json +10 -10
- package/dist/data-types-B3SLjbqa-C1LmrfzH.mjs.map +0 -1
- package/dist/mongo-adapter-RJ_YOxiK-CCHpxwqy.mjs.map +0 -1
package/dist/adapter.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { b as MONGO_VECTOR_CODEC_ID } from "./codec-ids-DZQsuh80-ywDzfnAg.mjs";
|
|
2
|
-
import { a as lowerStage, i as lowerPipeline, n as lowerAggExpr, r as lowerFilter, t as createMongoAdapter } from "./mongo-adapter-
|
|
2
|
+
import { a as lowerStage, i as lowerPipeline, n as lowerAggExpr, r as lowerFilter, t as createMongoAdapter } from "./mongo-adapter-DemWVyNv-B3xRFRas.mjs";
|
|
3
3
|
//#region ../../../3-targets/mongo/2-adapter/dist/index.mjs
|
|
4
4
|
const mongoVectorNearOperation = Object.freeze({
|
|
5
5
|
self: { codecId: MONGO_VECTOR_CODEC_ID },
|
package/dist/adapter.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.mjs","names":[],"sources":["../../../../3-targets/mongo/2-adapter/dist/index.mjs"],"sourcesContent":["import { a as lowerStage, i as lowerPipeline, n as lowerAggExpr, r as lowerFilter, t as createMongoAdapter } from \"./mongo-adapter-
|
|
1
|
+
{"version":3,"file":"adapter.mjs","names":[],"sources":["../../../../3-targets/mongo/2-adapter/dist/index.mjs"],"sourcesContent":["import { a as lowerStage, i as lowerPipeline, n as lowerAggExpr, r as lowerFilter, t as createMongoAdapter } from \"./mongo-adapter-DemWVyNv.mjs\";\nimport { MONGO_VECTOR_CODEC_ID } from \"@internal/target-mongo/codec-ids\";\n//#region src/core/operations.ts\nconst mongoVectorNearOperation = Object.freeze({\n\tself: { codecId: MONGO_VECTOR_CODEC_ID },\n\timpl: () => void 0\n});\nconst mongoVectorOperationDescriptors = { near: mongoVectorNearOperation };\n//#endregion\nexport { createMongoAdapter, lowerAggExpr, lowerFilter, lowerPipeline, lowerStage, mongoVectorNearOperation, mongoVectorOperationDescriptors };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;AAGA,MAAM,2BAA2B,OAAO,OAAO;CAC9C,MAAM,EAAE,SAAS,sBAAsB;CACvC,YAAY,KAAK;AAClB,CAAC;AACD,MAAM,kCAAkC,EAAE,MAAM,yBAAyB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createMongoAdapter } from "./mongo-adapter-
|
|
1
|
+
import { t as createMongoAdapter } from "./mongo-adapter-DemWVyNv-B3xRFRas.mjs";
|
|
2
2
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
3
3
|
import { type } from "arktype";
|
|
4
4
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter__control.mjs","names":["#adapter","#execute","#markerLedgerCollection","#invariantMergeExpr"],"sources":["../../../../3-targets/mongo/2-adapter/dist/control.mjs"],"sourcesContent":["import { t as createMongoAdapter } from \"./mongo-adapter-RJ_YOxiK.mjs\";\nimport { MongoAggFieldRef, MongoAggLiteral, MongoAggOperator } from \"@internal/mongo-query-ast/execution\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { assembleMongoCodecRegistry } from \"@internal/mongo-codec\";\nimport { MongoSchemaCollection, MongoSchemaCollectionOptions, MongoSchemaIR, MongoSchemaIndex, MongoSchemaValidator } from \"@internal/mongo-schema-ir\";\nimport { MongoServerError } from \"mongodb\";\nimport { parseMarkerRowSafely, withMarkerReadErrorHandling } from \"@internal/errors/execution\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { ledgerOriginFromStored } from \"@internal/migration-tools/ledger-origin\";\nimport { expr, fn } from \"@internal/mongo-query-builder\";\nimport { collection } from \"@internal/mongo-query-builder/contract-free\";\nimport { type } from \"arktype\";\n//#region src/core/introspect-schema.ts\nconst PRISMA_MIGRATIONS_COLLECTION = \"_prisma_migrations\";\nfunction parseIndexKeys(keySpec) {\n\tconst keys = [];\n\tfor (const [field, direction] of Object.entries(keySpec)) keys.push({\n\t\tfield,\n\t\tdirection\n\t});\n\treturn keys;\n}\n/**\n* Exported for unit tests to exercise the defensive `!key` guard; not part of\n* the public API. Callers in this package use it via the `introspectSchema`\n* pipeline only.\n*/\nfunction isDefaultIdIndex(doc) {\n\tconst key = doc[\"key\"];\n\tif (!key) return false;\n\tconst entries = Object.entries(key);\n\treturn entries.length === 1 && entries[0]?.[0] === \"_id\" && entries[0]?.[1] === 1;\n}\nfunction parseIndex(doc) {\n\tconst keySpec = doc[\"key\"];\n\treturn new MongoSchemaIndex({\n\t\tname: String(doc[\"name\"]),\n\t\tkeys: parseIndexKeys(keySpec),\n\t\tunique: doc[\"unique\"],\n\t\tsparse: doc[\"sparse\"],\n\t\texpireAfterSeconds: doc[\"expireAfterSeconds\"],\n\t\tpartialFilterExpression: doc[\"partialFilterExpression\"],\n\t\twildcardProjection: doc[\"wildcardProjection\"],\n\t\tcollation: doc[\"collation\"] ? blindCast(doc[\"collation\"]) : void 0,\n\t\tweights: doc[\"weights\"],\n\t\tdefault_language: doc[\"default_language\"],\n\t\tlanguage_override: doc[\"language_override\"]\n\t});\n}\nfunction parseValidator(options) {\n\tconst validator = options[\"validator\"];\n\tif (!validator) return void 0;\n\tconst jsonSchema = validator[\"$jsonSchema\"];\n\tif (!jsonSchema) return void 0;\n\treturn new MongoSchemaValidator({\n\t\tjsonSchema,\n\t\tvalidationLevel: options[\"validationLevel\"] ?? \"strict\",\n\t\tvalidationAction: options[\"validationAction\"] ?? \"error\"\n\t});\n}\nfunction parseCollectionOptions(info) {\n\tconst options = info[\"options\"];\n\tif (!options) return void 0;\n\tconst capped = options[\"capped\"];\n\tconst size = options[\"size\"];\n\tconst max = options[\"max\"];\n\tconst timeseries = options[\"timeseries\"];\n\tconst collation = options[\"collation\"] ? blindCast(options[\"collation\"]) : void 0;\n\tconst changeStreamPreAndPostImages = options[\"changeStreamPreAndPostImages\"];\n\tconst clusteredIndex = options[\"clusteredIndex\"];\n\tif (!(capped || timeseries || collation || changeStreamPreAndPostImages || clusteredIndex)) return void 0;\n\treturn new MongoSchemaCollectionOptions({\n\t\t...capped ? { capped: {\n\t\t\tsize: size ?? 0,\n\t\t\t...max != null ? { max } : {}\n\t\t} } : {},\n\t\t...timeseries ? { timeseries } : {},\n\t\t...collation ? { collation } : {},\n\t\t...changeStreamPreAndPostImages ? { changeStreamPreAndPostImages } : {},\n\t\t...clusteredIndex ? { clusteredIndex } : {}\n\t});\n}\nasync function introspectSchema(db) {\n\tconst collectionInfos = await db.listCollections().toArray();\n\tconst collections = [];\n\tfor (const info of collectionInfos) {\n\t\tconst name = info[\"name\"];\n\t\tconst type = info[\"type\"];\n\t\tif (name === PRISMA_MIGRATIONS_COLLECTION) continue;\n\t\tif (name.startsWith(\"system.\")) continue;\n\t\tif (type === \"view\") continue;\n\t\tconst indexes = (await db.collection(name).listIndexes().toArray()).filter((doc) => !isDefaultIdIndex(doc)).map(parseIndex);\n\t\tconst validator = parseValidator(\"options\" in info ? info[\"options\"] : {});\n\t\tconst options = parseCollectionOptions(info);\n\t\tcollections.push(new MongoSchemaCollection({\n\t\t\tname,\n\t\t\tindexes,\n\t\t\t...validator ? { validator } : {},\n\t\t\t...options ? { options } : {}\n\t\t}));\n\t}\n\treturn new MongoSchemaIR(collections, { fromDatabase: true });\n}\n//#endregion\n//#region src/core/migrations/inspection-executor.ts\n/**\n* Executes the read-only catalog inspections (`listCollections` / `listIndexes`)\n* that migration prechecks/postchecks and operation preview evaluate, directly\n* against `db`. Routing these checks through the adapter's lowering seam is\n* deferred to the `typed-migration-verification-queries` slice.\n*/\nvar MongoInspectionExecutor = class {\n\tdb;\n\tconstructor(db) {\n\t\tthis.db = db;\n\t}\n\tasync listIndexes(cmd) {\n\t\ttry {\n\t\t\treturn await this.db.collection(cmd.collection).listIndexes().toArray();\n\t\t} catch (error) {\n\t\t\tif (error instanceof MongoServerError && error.code === 26) return [];\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync listCollections(_cmd) {\n\t\treturn this.db.listCollections().toArray();\n\t}\n};\n//#endregion\n//#region src/core/errors.ts\nfunction mongoAdapterError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\nfunction describeReceivedValue(value) {\n\tif (value === null) return \"null\";\n\tif (typeof value !== \"object\") return typeof value;\n\treturn `object with keys [${Object.keys(value).join(\", \")}]`;\n}\n//#endregion\n//#region src/core/marker-ledger.ts\nconst COLLECTION = \"_prisma_migrations\";\nconst MONGO_MARKER_COLLECTION = COLLECTION;\nconst MONGO_LEDGER_COLLECTION = `_prisma_migrations ledger documents in ${COLLECTION}`;\nconst MongoMarkerDocSchema = type({\n\tspace: \"string\",\n\tstorageHash: \"string\",\n\tprofileHash: \"string\",\n\t\"contractJson?\": \"unknown | null\",\n\t\"canonicalVersion?\": \"number | null\",\n\t\"updatedAt?\": \"Date\",\n\t\"appTag?\": \"string | null\",\n\t\"meta?\": type({ \"[string]\": \"unknown\" }).or(\"null\"),\n\t\"invariants?\": type(\"string\").array(),\n\t\"+\": \"delete\"\n});\nfunction parseMongoMarkerDoc(doc) {\n\tconst result = MongoMarkerDocSchema(doc);\n\tif (result instanceof type.errors) throw mongoAdapterError(\"CONTRACT.MARKER_ROW_CORRUPT\", `Invalid marker doc on ${COLLECTION}: ${result.summary}`, { meta: {\n\t\tcollection: COLLECTION,\n\t\tdetail: result.summary\n\t} });\n\treturn {\n\t\tstorageHash: result.storageHash,\n\t\tprofileHash: result.profileHash,\n\t\tcontractJson: result.contractJson ?? null,\n\t\tcanonicalVersion: result.canonicalVersion ?? null,\n\t\tupdatedAt: result.updatedAt ?? /* @__PURE__ */ new Date(),\n\t\tappTag: result.appTag ?? null,\n\t\tmeta: result.meta ?? {},\n\t\tinvariants: result.invariants ?? []\n\t};\n}\nfunction parseMongoMarkerDocSafely(doc, space) {\n\treturn parseMarkerRowSafely(doc, parseMongoMarkerDoc, {\n\t\tspace,\n\t\tmarkerLocation: MONGO_MARKER_COLLECTION\n\t});\n}\n//#endregion\n//#region src/core/marker-ledger-collection.ts\nconst MARKER_LEDGER_COLLECTION = \"_prisma_migrations\";\n//#endregion\n//#region src/core/migrations/mongo-control-driver.ts\nfunction isMongoControlDriver(driver) {\n\treturn driver.familyId === \"mongo\" && driver.targetId === \"mongo\" && \"execute\" in driver && typeof driver.execute === \"function\";\n}\nfunction requireMongoControlDriver(driver) {\n\tif (!isMongoControlDriver(driver)) throw mongoAdapterError(\"CONFIG.VALIDATION_FAILED\", \"Expected a Mongo control driver created by mongoControlDriver.create() from `@internal/driver-mongo/control`.\", { meta: { received: describeReceivedValue(driver) } });\n\treturn driver;\n}\nfunction extractDb(driver) {\n\treturn requireMongoControlDriver(driver).db;\n}\n//#endregion\n//#region src/core/migrations/mongo-control-adapter.ts\n/**\n* Mongo control adapter for control-plane operations like introspection\n* and marker-ledger CAS. Implements the family-level `MongoControlAdapter`\n* SPI. Every marker/ledger operation builds a canonical command inline via\n* the contract-free fluent builder and dispatches it through the family\n* adapter's lowering path (`createMongoAdapter().lower(plan, {})`) onto the\n* Mongo wire transport (`driver.execute(wireCommand)`) — the same route SQL\n* marker/ledger ops take through `adapter.lower()` → `driver.query()`.\n*/\nvar MongoControlAdapterImpl = class {\n\tfamilyId = \"mongo\";\n\ttargetId = \"mongo\";\n\tmarkerLocation = MONGO_MARKER_COLLECTION;\n\t#adapter;\n\t#markerLedgerCollection = collection(MARKER_LEDGER_COLLECTION);\n\tconstructor(codecs) {\n\t\tthis.#adapter = createMongoAdapter(codecs);\n\t}\n\tasync #execute(driver, command) {\n\t\tconst plan = {\n\t\t\tcollection: MARKER_LEDGER_COLLECTION,\n\t\t\tcommand,\n\t\t\tmeta: {\n\t\t\t\ttarget: \"mongo\",\n\t\t\t\ttargetFamily: \"mongo\",\n\t\t\t\tstorageHash: \"\",\n\t\t\t\tlane: \"control\"\n\t\t\t}\n\t\t};\n\t\tconst wireCommand = await this.#adapter.lower(plan, {});\n\t\tif (!isMongoControlDriver(driver)) throw mongoAdapterError(\"CONFIG.VALIDATION_FAILED\", \"Mongo control adapter requires a Mongo control driver with an execute() transport. Provide a MongoControlDriver from `@internal/driver-mongo/control`.\", { meta: { received: describeReceivedValue(driver) } });\n\t\tconst rows = [];\n\t\tfor await (const row of driver.execute(wireCommand)) rows.push(row);\n\t\treturn rows;\n\t}\n\tasync executeDdl(driver, command) {\n\t\tconst wire = await this.#adapter.lower({ command }, {});\n\t\tawait driver.run(wire);\n\t}\n\t/**\n\t* Server-side invariant-merge aggregation expression:\n\t* `$sortArray({ input: $setUnion([$ifNull('$invariants', []), incoming]), sortBy: 1 })`.\n\t*\n\t* Built through the typed agg-expr layer — `fn.setUnion` plus the generic\n\t* `MongoAggOperator` for `$ifNull` / `$sortArray` (neither has a named `fn`\n\t* helper). Returns a `MongoAggOperator` that is passed directly to\n\t* `f.stage.set({ invariants: ... })` in the update pipeline.\n\t*/\n\t#invariantMergeExpr(incoming) {\n\t\tconst existingOrEmpty = MongoAggOperator.of(\"$ifNull\", [MongoAggFieldRef.of(\"invariants\"), MongoAggLiteral.of([])]);\n\t\tconst merged = fn.setUnion({\n\t\t\t_field: {\n\t\t\t\tcodecId: \"mongo/array@1\",\n\t\t\t\tnullable: false\n\t\t\t},\n\t\t\tnode: existingOrEmpty\n\t\t}, {\n\t\t\t_field: {\n\t\t\t\tcodecId: \"mongo/array@1\",\n\t\t\t\tnullable: false\n\t\t\t},\n\t\t\tnode: MongoAggLiteral.of([...incoming])\n\t\t});\n\t\treturn MongoAggOperator.of(\"$sortArray\", {\n\t\t\tinput: merged.node,\n\t\t\tsortBy: MongoAggLiteral.of(1)\n\t\t});\n\t}\n\tasync readMarker(driver, space) {\n\t\tconst doc = (await withMarkerReadErrorHandling(() => this.#execute(driver, this.#markerLedgerCollection.aggregate().match((f) => f._id.eq(space)).match((f) => f.space.eq(space)).limit(1).build()), {\n\t\t\tspace,\n\t\t\tmarkerLocation: MONGO_MARKER_COLLECTION\n\t\t}))[0];\n\t\tif (!doc) return null;\n\t\treturn parseMongoMarkerDocSafely(doc, space);\n\t}\n\tasync readAllMarkers(driver) {\n\t\tconst docs = await withMarkerReadErrorHandling(() => this.#execute(driver, this.#markerLedgerCollection.aggregate().match((f) => f._id.type(\"string\")).match((f) => f.space.type(\"string\")).match((f) => expr(fn.eq(f._id, f.space))).build()), {\n\t\t\tspace: APP_SPACE_ID,\n\t\t\tmarkerLocation: MONGO_MARKER_COLLECTION\n\t\t});\n\t\tconst out = /* @__PURE__ */ new Map();\n\t\tfor (const doc of docs) {\n\t\t\tconst space = doc[\"space\"];\n\t\t\t/* v8 ignore next -- @preserve type-narrowing guard: the $match stage above filters on `space: { $type: 'string' }`, so this branch is unreachable at runtime. The check exists so the `out.set(space, ...)` call below can accept `string`. */\n\t\t\tif (typeof space !== \"string\") continue;\n\t\t\tout.set(space, parseMongoMarkerDocSafely(doc, space));\n\t\t}\n\t\treturn out;\n\t}\n\tasync initMarker(driver, space, destination) {\n\t\tconst document = {\n\t\t\t_id: space,\n\t\t\tspace,\n\t\t\tstorageHash: destination.storageHash,\n\t\t\tprofileHash: destination.profileHash,\n\t\t\tcontractJson: null,\n\t\t\tcanonicalVersion: null,\n\t\t\tupdatedAt: /* @__PURE__ */ new Date(),\n\t\t\tappTag: null,\n\t\t\tmeta: {},\n\t\t\tinvariants: [...destination.invariants ?? []]\n\t\t};\n\t\tawait this.#execute(driver, this.#markerLedgerCollection.insertOne(document));\n\t}\n\tasync updateMarker(driver, space, expectedFrom, destination) {\n\t\tconst { invariants } = destination;\n\t\treturn (await this.#execute(driver, this.#markerLedgerCollection.match((f) => f._id.eq(space)).match((f) => f.space.eq(space)).match((f) => f.storageHash.eq(expectedFrom)).findOneAndUpdate((f) => [f.stage.set(invariants === void 0 ? {\n\t\t\tstorageHash: MongoAggLiteral.of(destination.storageHash),\n\t\t\tprofileHash: MongoAggLiteral.of(destination.profileHash),\n\t\t\tupdatedAt: MongoAggLiteral.of(/* @__PURE__ */ new Date())\n\t\t} : {\n\t\t\tstorageHash: MongoAggLiteral.of(destination.storageHash),\n\t\t\tprofileHash: MongoAggLiteral.of(destination.profileHash),\n\t\t\tupdatedAt: MongoAggLiteral.of(/* @__PURE__ */ new Date()),\n\t\t\tinvariants: this.#invariantMergeExpr(invariants)\n\t\t})], { upsert: false }))).length > 0;\n\t}\n\tasync writeLedgerEntry(driver, space, entry) {\n\t\tconst document = {\n\t\t\ttype: \"ledger\",\n\t\t\tspace,\n\t\t\tedgeId: entry.edgeId,\n\t\t\tfrom: entry.from,\n\t\t\tto: entry.to,\n\t\t\tmigrationName: entry.migrationName,\n\t\t\tmigrationHash: entry.migrationHash,\n\t\t\toperations: blindCast(entry.operations),\n\t\t\tappliedAt: /* @__PURE__ */ new Date()\n\t\t};\n\t\tawait this.#execute(driver, this.#markerLedgerCollection.insertOne(document));\n\t}\n\tasync readLedger(driver, space) {\n\t\tconst ledgerContext = {\n\t\t\tspace: space ?? \"*\",\n\t\t\tmarkerLocation: MONGO_LEDGER_COLLECTION\n\t\t};\n\t\tconst chain = this.#markerLedgerCollection.aggregate().match((f) => f.type.eq(\"ledger\"));\n\t\tconst command = space === void 0 ? chain.sort({ _id: 1 }).build() : chain.match((f) => f.space.eq(space)).sort({ _id: 1 }).build();\n\t\tconst docs = await withMarkerReadErrorHandling(() => this.#execute(driver, command), ledgerContext);\n\t\tconst entries = [];\n\t\tfor (const doc of docs) {\n\t\t\tconst migrationName = doc[\"migrationName\"];\n\t\t\tconst migrationHash = doc[\"migrationHash\"];\n\t\t\tconst from = doc[\"from\"];\n\t\t\tconst to = doc[\"to\"];\n\t\t\tconst docSpace = doc[\"space\"];\n\t\t\tif (typeof migrationName !== \"string\" || typeof migrationHash !== \"string\") continue;\n\t\t\tif (typeof from !== \"string\" || typeof to !== \"string\") continue;\n\t\t\tif (typeof docSpace !== \"string\") continue;\n\t\t\tconst appliedAt = doc[\"appliedAt\"];\n\t\t\tconst appliedAtDate = appliedAt instanceof Date ? appliedAt : appliedAt !== void 0 ? new Date(String(appliedAt)) : /* @__PURE__ */ new Date();\n\t\t\tconst operations = doc[\"operations\"];\n\t\t\tconst opList = Array.isArray(operations) ? operations : [];\n\t\t\tentries.push({\n\t\t\t\tspace: docSpace,\n\t\t\t\tmigrationName,\n\t\t\t\tmigrationHash,\n\t\t\t\tfrom: ledgerOriginFromStored(from),\n\t\t\t\tto,\n\t\t\t\tappliedAt: appliedAtDate,\n\t\t\t\toperationCount: opList.length\n\t\t\t});\n\t\t}\n\t\treturn entries;\n\t}\n\tasync introspectSchema(driver) {\n\t\treturn introspectSchema(extractDb(driver));\n\t}\n\tcreateRunnerDependencies(driver) {\n\t\tconst controlDriver = requireMongoControlDriver(driver);\n\t\treturn {\n\t\t\tinspectionExecutor: new MongoInspectionExecutor(controlDriver.db),\n\t\t\tadapter: this.#adapter,\n\t\t\tdriver: controlDriver,\n\t\t\texecuteDdl: (command) => this.executeDdl(controlDriver, command),\n\t\t\tmarkerOps: {\n\t\t\t\treadMarker: (space) => this.readMarker(controlDriver, space),\n\t\t\t\tinitMarker: (space, destination) => this.initMarker(controlDriver, space, destination),\n\t\t\t\tupdateMarker: (space, expectedFrom, destination) => this.updateMarker(controlDriver, space, expectedFrom, destination),\n\t\t\t\twriteLedgerEntry: (space, entry) => this.writeLedgerEntry(controlDriver, space, entry)\n\t\t\t},\n\t\t\tintrospectSchema: () => this.introspectSchema(controlDriver)\n\t\t};\n\t}\n};\n//#endregion\n//#region src/exports/control.ts\nconst mongoAdapterDescriptor = {\n\tkind: \"adapter\",\n\tid: \"mongo\",\n\tfamilyId: \"mongo\",\n\ttargetId: \"mongo\",\n\tversion: \"0.0.1\",\n\ttypes: { codecTypes: {\n\t\timport: {\n\t\t\tpackage: \"@internal/target-mongo/codec-types\",\n\t\t\tnamed: \"CodecTypes\",\n\t\t\talias: \"MongoCodecTypes\"\n\t\t},\n\t\tparameterizedOutputTypes: {\n\t\t\tpackage: \"@internal/target-mongo/codec-types\",\n\t\t\tnamed: \"ParameterizedOutputTypesForTypeParams\",\n\t\t\talias: \"MongoParameterizedOutputTypes\"\n\t\t}\n\t} },\n\tcreate(stack) {\n\t\treturn new MongoControlAdapterImpl(assembleMongoCodecRegistry([\n\t\t\tstack.target,\n\t\t\t...stack.adapter === void 0 ? [] : [stack.adapter],\n\t\t\t...stack.extensions\n\t\t]));\n\t}\n};\n//#endregion\nexport { MongoControlAdapterImpl, MongoInspectionExecutor, createMongoAdapter, mongoAdapterDescriptor as default, mongoAdapterDescriptor, extractDb, introspectSchema, isMongoControlDriver };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,MAAM,+BAA+B;AACrC,SAAS,eAAe,SAAS;CAChC,MAAM,OAAO,CAAC;CACd,KAAK,MAAM,CAAC,OAAO,cAAc,OAAO,QAAQ,OAAO,GAAG,KAAK,KAAK;EACnE;EACA;CACD,CAAC;CACD,OAAO;AACR;;;;;;AAMA,SAAS,iBAAiB,KAAK;CAC9B,MAAM,MAAM,IAAI;CAChB,IAAI,CAAC,KAAK,OAAO;CACjB,MAAM,UAAU,OAAO,QAAQ,GAAG;CAClC,OAAO,QAAQ,WAAW,KAAK,QAAQ,EAAE,GAAG,OAAO,SAAS,QAAQ,EAAE,GAAG,OAAO;AACjF;AACA,SAAS,WAAW,KAAK;CACxB,MAAM,UAAU,IAAI;CACpB,OAAO,IAAI,iBAAiB;EAC3B,MAAM,OAAO,IAAI,OAAO;EACxB,MAAM,eAAe,OAAO;EAC5B,QAAQ,IAAI;EACZ,QAAQ,IAAI;EACZ,oBAAoB,IAAI;EACxB,yBAAyB,IAAI;EAC7B,oBAAoB,IAAI;EACxB,WAAW,IAAI,eAAe,UAAU,IAAI,YAAY,IAAI,KAAK;EACjE,SAAS,IAAI;EACb,kBAAkB,IAAI;EACtB,mBAAmB,IAAI;CACxB,CAAC;AACF;AACA,SAAS,eAAe,SAAS;CAChC,MAAM,YAAY,QAAQ;CAC1B,IAAI,CAAC,WAAW,OAAO,KAAK;CAC5B,MAAM,aAAa,UAAU;CAC7B,IAAI,CAAC,YAAY,OAAO,KAAK;CAC7B,OAAO,IAAI,qBAAqB;EAC/B;EACA,iBAAiB,QAAQ,sBAAsB;EAC/C,kBAAkB,QAAQ,uBAAuB;CAClD,CAAC;AACF;AACA,SAAS,uBAAuB,MAAM;CACrC,MAAM,UAA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,OAAO,OAAO;EACb,OAAO,IAAI,wBAAwB,2BAA2B;GAC7D,MAAM;GACN,GAAG,MAAM,YAAY,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,OAAO;GACjD,GAAG,MAAM;EACV,CAAC,CAAC;CACH;AACD"}
|
|
1
|
+
{"version":3,"file":"adapter__control.mjs","names":["#adapter","#execute","#markerLedgerCollection","#invariantMergeExpr"],"sources":["../../../../3-targets/mongo/2-adapter/dist/control.mjs"],"sourcesContent":["import { t as createMongoAdapter } from \"./mongo-adapter-DemWVyNv.mjs\";\nimport { MongoAggFieldRef, MongoAggLiteral, MongoAggOperator } from \"@internal/mongo-query-ast/execution\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { assembleMongoCodecRegistry } from \"@internal/mongo-codec\";\nimport { MongoSchemaCollection, MongoSchemaCollectionOptions, MongoSchemaIR, MongoSchemaIndex, MongoSchemaValidator } from \"@internal/mongo-schema-ir\";\nimport { MongoServerError } from \"mongodb\";\nimport { parseMarkerRowSafely, withMarkerReadErrorHandling } from \"@internal/errors/execution\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { ledgerOriginFromStored } from \"@internal/migration-tools/ledger-origin\";\nimport { expr, fn } from \"@internal/mongo-query-builder\";\nimport { collection } from \"@internal/mongo-query-builder/contract-free\";\nimport { type } from \"arktype\";\n//#region src/core/introspect-schema.ts\nconst PRISMA_MIGRATIONS_COLLECTION = \"_prisma_migrations\";\nfunction parseIndexKeys(keySpec) {\n\tconst keys = [];\n\tfor (const [field, direction] of Object.entries(keySpec)) keys.push({\n\t\tfield,\n\t\tdirection\n\t});\n\treturn keys;\n}\n/**\n* Exported for unit tests to exercise the defensive `!key` guard; not part of\n* the public API. Callers in this package use it via the `introspectSchema`\n* pipeline only.\n*/\nfunction isDefaultIdIndex(doc) {\n\tconst key = doc[\"key\"];\n\tif (!key) return false;\n\tconst entries = Object.entries(key);\n\treturn entries.length === 1 && entries[0]?.[0] === \"_id\" && entries[0]?.[1] === 1;\n}\nfunction parseIndex(doc) {\n\tconst keySpec = doc[\"key\"];\n\treturn new MongoSchemaIndex({\n\t\tname: String(doc[\"name\"]),\n\t\tkeys: parseIndexKeys(keySpec),\n\t\tunique: doc[\"unique\"],\n\t\tsparse: doc[\"sparse\"],\n\t\texpireAfterSeconds: doc[\"expireAfterSeconds\"],\n\t\tpartialFilterExpression: doc[\"partialFilterExpression\"],\n\t\twildcardProjection: doc[\"wildcardProjection\"],\n\t\tcollation: doc[\"collation\"] ? blindCast(doc[\"collation\"]) : void 0,\n\t\tweights: doc[\"weights\"],\n\t\tdefault_language: doc[\"default_language\"],\n\t\tlanguage_override: doc[\"language_override\"]\n\t});\n}\nfunction parseValidator(options) {\n\tconst validator = options[\"validator\"];\n\tif (!validator) return void 0;\n\tconst jsonSchema = validator[\"$jsonSchema\"];\n\tif (!jsonSchema) return void 0;\n\treturn new MongoSchemaValidator({\n\t\tjsonSchema,\n\t\tvalidationLevel: options[\"validationLevel\"] ?? \"strict\",\n\t\tvalidationAction: options[\"validationAction\"] ?? \"error\"\n\t});\n}\nfunction parseCollectionOptions(info) {\n\tconst options = info[\"options\"];\n\tif (!options) return void 0;\n\tconst capped = options[\"capped\"];\n\tconst size = options[\"size\"];\n\tconst max = options[\"max\"];\n\tconst timeseries = options[\"timeseries\"];\n\tconst collation = options[\"collation\"] ? blindCast(options[\"collation\"]) : void 0;\n\tconst changeStreamPreAndPostImages = options[\"changeStreamPreAndPostImages\"];\n\tconst clusteredIndex = options[\"clusteredIndex\"];\n\tif (!(capped || timeseries || collation || changeStreamPreAndPostImages || clusteredIndex)) return void 0;\n\treturn new MongoSchemaCollectionOptions({\n\t\t...capped ? { capped: {\n\t\t\tsize: size ?? 0,\n\t\t\t...max != null ? { max } : {}\n\t\t} } : {},\n\t\t...timeseries ? { timeseries } : {},\n\t\t...collation ? { collation } : {},\n\t\t...changeStreamPreAndPostImages ? { changeStreamPreAndPostImages } : {},\n\t\t...clusteredIndex ? { clusteredIndex } : {}\n\t});\n}\nasync function introspectSchema(db) {\n\tconst collectionInfos = await db.listCollections().toArray();\n\tconst collections = [];\n\tfor (const info of collectionInfos) {\n\t\tconst name = info[\"name\"];\n\t\tconst type = info[\"type\"];\n\t\tif (name === PRISMA_MIGRATIONS_COLLECTION) continue;\n\t\tif (name.startsWith(\"system.\")) continue;\n\t\tif (type === \"view\") continue;\n\t\tconst indexes = (await db.collection(name).listIndexes().toArray()).filter((doc) => !isDefaultIdIndex(doc)).map(parseIndex);\n\t\tconst validator = parseValidator(\"options\" in info ? info[\"options\"] : {});\n\t\tconst options = parseCollectionOptions(info);\n\t\tcollections.push(new MongoSchemaCollection({\n\t\t\tname,\n\t\t\tindexes,\n\t\t\t...validator ? { validator } : {},\n\t\t\t...options ? { options } : {}\n\t\t}));\n\t}\n\treturn new MongoSchemaIR(collections, { fromDatabase: true });\n}\n//#endregion\n//#region src/core/migrations/inspection-executor.ts\n/**\n* Executes the read-only catalog inspections (`listCollections` / `listIndexes`)\n* that migration prechecks/postchecks and operation preview evaluate, directly\n* against `db`. Routing these checks through the adapter's lowering seam is\n* deferred to the `typed-migration-verification-queries` slice.\n*/\nvar MongoInspectionExecutor = class {\n\tdb;\n\tconstructor(db) {\n\t\tthis.db = db;\n\t}\n\tasync listIndexes(cmd) {\n\t\ttry {\n\t\t\treturn await this.db.collection(cmd.collection).listIndexes().toArray();\n\t\t} catch (error) {\n\t\t\tif (error instanceof MongoServerError && error.code === 26) return [];\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync listCollections(_cmd) {\n\t\treturn this.db.listCollections().toArray();\n\t}\n};\n//#endregion\n//#region src/core/errors.ts\nfunction mongoAdapterError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\nfunction describeReceivedValue(value) {\n\tif (value === null) return \"null\";\n\tif (typeof value !== \"object\") return typeof value;\n\treturn `object with keys [${Object.keys(value).join(\", \")}]`;\n}\n//#endregion\n//#region src/core/marker-ledger.ts\nconst COLLECTION = \"_prisma_migrations\";\nconst MONGO_MARKER_COLLECTION = COLLECTION;\nconst MONGO_LEDGER_COLLECTION = `_prisma_migrations ledger documents in ${COLLECTION}`;\nconst MongoMarkerDocSchema = type({\n\tspace: \"string\",\n\tstorageHash: \"string\",\n\tprofileHash: \"string\",\n\t\"contractJson?\": \"unknown | null\",\n\t\"canonicalVersion?\": \"number | null\",\n\t\"updatedAt?\": \"Date\",\n\t\"appTag?\": \"string | null\",\n\t\"meta?\": type({ \"[string]\": \"unknown\" }).or(\"null\"),\n\t\"invariants?\": type(\"string\").array(),\n\t\"+\": \"delete\"\n});\nfunction parseMongoMarkerDoc(doc) {\n\tconst result = MongoMarkerDocSchema(doc);\n\tif (result instanceof type.errors) throw mongoAdapterError(\"CONTRACT.MARKER_ROW_CORRUPT\", `Invalid marker doc on ${COLLECTION}: ${result.summary}`, { meta: {\n\t\tcollection: COLLECTION,\n\t\tdetail: result.summary\n\t} });\n\treturn {\n\t\tstorageHash: result.storageHash,\n\t\tprofileHash: result.profileHash,\n\t\tcontractJson: result.contractJson ?? null,\n\t\tcanonicalVersion: result.canonicalVersion ?? null,\n\t\tupdatedAt: result.updatedAt ?? /* @__PURE__ */ new Date(),\n\t\tappTag: result.appTag ?? null,\n\t\tmeta: result.meta ?? {},\n\t\tinvariants: result.invariants ?? []\n\t};\n}\nfunction parseMongoMarkerDocSafely(doc, space) {\n\treturn parseMarkerRowSafely(doc, parseMongoMarkerDoc, {\n\t\tspace,\n\t\tmarkerLocation: MONGO_MARKER_COLLECTION\n\t});\n}\n//#endregion\n//#region src/core/marker-ledger-collection.ts\nconst MARKER_LEDGER_COLLECTION = \"_prisma_migrations\";\n//#endregion\n//#region src/core/migrations/mongo-control-driver.ts\nfunction isMongoControlDriver(driver) {\n\treturn driver.familyId === \"mongo\" && driver.targetId === \"mongo\" && \"execute\" in driver && typeof driver.execute === \"function\";\n}\nfunction requireMongoControlDriver(driver) {\n\tif (!isMongoControlDriver(driver)) throw mongoAdapterError(\"CONFIG.VALIDATION_FAILED\", \"Expected a Mongo control driver created by mongoControlDriver.create() from `@internal/driver-mongo/control`.\", { meta: { received: describeReceivedValue(driver) } });\n\treturn driver;\n}\nfunction extractDb(driver) {\n\treturn requireMongoControlDriver(driver).db;\n}\n//#endregion\n//#region src/core/migrations/mongo-control-adapter.ts\n/**\n* Mongo control adapter for control-plane operations like introspection\n* and marker-ledger CAS. Implements the family-level `MongoControlAdapter`\n* SPI. Every marker/ledger operation builds a canonical command inline via\n* the contract-free fluent builder and dispatches it through the family\n* adapter's lowering path (`createMongoAdapter().lower(plan, {})`) onto the\n* Mongo wire transport (`driver.execute(wireCommand)`) — the same route SQL\n* marker/ledger ops take through `adapter.lower()` → `driver.query()`.\n*/\nvar MongoControlAdapterImpl = class {\n\tfamilyId = \"mongo\";\n\ttargetId = \"mongo\";\n\tmarkerLocation = MONGO_MARKER_COLLECTION;\n\t#adapter;\n\t#markerLedgerCollection = collection(MARKER_LEDGER_COLLECTION);\n\tconstructor(codecs) {\n\t\tthis.#adapter = createMongoAdapter(codecs);\n\t}\n\tasync #execute(driver, command) {\n\t\tconst plan = {\n\t\t\tcollection: MARKER_LEDGER_COLLECTION,\n\t\t\tcommand,\n\t\t\tmeta: {\n\t\t\t\ttarget: \"mongo\",\n\t\t\t\ttargetFamily: \"mongo\",\n\t\t\t\tstorageHash: \"\",\n\t\t\t\tlane: \"control\"\n\t\t\t}\n\t\t};\n\t\tconst wireCommand = await this.#adapter.lower(plan, {});\n\t\tif (!isMongoControlDriver(driver)) throw mongoAdapterError(\"CONFIG.VALIDATION_FAILED\", \"Mongo control adapter requires a Mongo control driver with an execute() transport. Provide a MongoControlDriver from `@internal/driver-mongo/control`.\", { meta: { received: describeReceivedValue(driver) } });\n\t\tconst rows = [];\n\t\tfor await (const row of driver.execute(wireCommand)) rows.push(row);\n\t\treturn rows;\n\t}\n\tasync executeDdl(driver, command) {\n\t\tconst wire = await this.#adapter.lower({ command }, {});\n\t\tawait driver.run(wire);\n\t}\n\t/**\n\t* Server-side invariant-merge aggregation expression:\n\t* `$sortArray({ input: $setUnion([$ifNull('$invariants', []), incoming]), sortBy: 1 })`.\n\t*\n\t* Built through the typed agg-expr layer — `fn.setUnion` plus the generic\n\t* `MongoAggOperator` for `$ifNull` / `$sortArray` (neither has a named `fn`\n\t* helper). Returns a `MongoAggOperator` that is passed directly to\n\t* `f.stage.set({ invariants: ... })` in the update pipeline.\n\t*/\n\t#invariantMergeExpr(incoming) {\n\t\tconst existingOrEmpty = MongoAggOperator.of(\"$ifNull\", [MongoAggFieldRef.of(\"invariants\"), MongoAggLiteral.of([])]);\n\t\tconst merged = fn.setUnion({\n\t\t\t_field: {\n\t\t\t\tcodecId: \"mongo/array@1\",\n\t\t\t\tnullable: false\n\t\t\t},\n\t\t\tnode: existingOrEmpty\n\t\t}, {\n\t\t\t_field: {\n\t\t\t\tcodecId: \"mongo/array@1\",\n\t\t\t\tnullable: false\n\t\t\t},\n\t\t\tnode: MongoAggLiteral.of([...incoming])\n\t\t});\n\t\treturn MongoAggOperator.of(\"$sortArray\", {\n\t\t\tinput: merged.node,\n\t\t\tsortBy: MongoAggLiteral.of(1)\n\t\t});\n\t}\n\tasync readMarker(driver, space) {\n\t\tconst doc = (await withMarkerReadErrorHandling(() => this.#execute(driver, this.#markerLedgerCollection.aggregate().match((f) => f._id.eq(space)).match((f) => f.space.eq(space)).limit(1).build()), {\n\t\t\tspace,\n\t\t\tmarkerLocation: MONGO_MARKER_COLLECTION\n\t\t}))[0];\n\t\tif (!doc) return null;\n\t\treturn parseMongoMarkerDocSafely(doc, space);\n\t}\n\tasync readAllMarkers(driver) {\n\t\tconst docs = await withMarkerReadErrorHandling(() => this.#execute(driver, this.#markerLedgerCollection.aggregate().match((f) => f._id.type(\"string\")).match((f) => f.space.type(\"string\")).match((f) => expr(fn.eq(f._id, f.space))).build()), {\n\t\t\tspace: APP_SPACE_ID,\n\t\t\tmarkerLocation: MONGO_MARKER_COLLECTION\n\t\t});\n\t\tconst out = /* @__PURE__ */ new Map();\n\t\tfor (const doc of docs) {\n\t\t\tconst space = doc[\"space\"];\n\t\t\t/* v8 ignore next -- @preserve type-narrowing guard: the $match stage above filters on `space: { $type: 'string' }`, so this branch is unreachable at runtime. The check exists so the `out.set(space, ...)` call below can accept `string`. */\n\t\t\tif (typeof space !== \"string\") continue;\n\t\t\tout.set(space, parseMongoMarkerDocSafely(doc, space));\n\t\t}\n\t\treturn out;\n\t}\n\tasync initMarker(driver, space, destination) {\n\t\tconst document = {\n\t\t\t_id: space,\n\t\t\tspace,\n\t\t\tstorageHash: destination.storageHash,\n\t\t\tprofileHash: destination.profileHash,\n\t\t\tcontractJson: null,\n\t\t\tcanonicalVersion: null,\n\t\t\tupdatedAt: /* @__PURE__ */ new Date(),\n\t\t\tappTag: null,\n\t\t\tmeta: {},\n\t\t\tinvariants: [...destination.invariants ?? []]\n\t\t};\n\t\tawait this.#execute(driver, this.#markerLedgerCollection.insertOne(document));\n\t}\n\tasync updateMarker(driver, space, expectedFrom, destination) {\n\t\tconst { invariants } = destination;\n\t\treturn (await this.#execute(driver, this.#markerLedgerCollection.match((f) => f._id.eq(space)).match((f) => f.space.eq(space)).match((f) => f.storageHash.eq(expectedFrom)).findOneAndUpdate((f) => [f.stage.set(invariants === void 0 ? {\n\t\t\tstorageHash: MongoAggLiteral.of(destination.storageHash),\n\t\t\tprofileHash: MongoAggLiteral.of(destination.profileHash),\n\t\t\tupdatedAt: MongoAggLiteral.of(/* @__PURE__ */ new Date())\n\t\t} : {\n\t\t\tstorageHash: MongoAggLiteral.of(destination.storageHash),\n\t\t\tprofileHash: MongoAggLiteral.of(destination.profileHash),\n\t\t\tupdatedAt: MongoAggLiteral.of(/* @__PURE__ */ new Date()),\n\t\t\tinvariants: this.#invariantMergeExpr(invariants)\n\t\t})], { upsert: false }))).length > 0;\n\t}\n\tasync writeLedgerEntry(driver, space, entry) {\n\t\tconst document = {\n\t\t\ttype: \"ledger\",\n\t\t\tspace,\n\t\t\tedgeId: entry.edgeId,\n\t\t\tfrom: entry.from,\n\t\t\tto: entry.to,\n\t\t\tmigrationName: entry.migrationName,\n\t\t\tmigrationHash: entry.migrationHash,\n\t\t\toperations: blindCast(entry.operations),\n\t\t\tappliedAt: /* @__PURE__ */ new Date()\n\t\t};\n\t\tawait this.#execute(driver, this.#markerLedgerCollection.insertOne(document));\n\t}\n\tasync readLedger(driver, space) {\n\t\tconst ledgerContext = {\n\t\t\tspace: space ?? \"*\",\n\t\t\tmarkerLocation: MONGO_LEDGER_COLLECTION\n\t\t};\n\t\tconst chain = this.#markerLedgerCollection.aggregate().match((f) => f.type.eq(\"ledger\"));\n\t\tconst command = space === void 0 ? chain.sort({ _id: 1 }).build() : chain.match((f) => f.space.eq(space)).sort({ _id: 1 }).build();\n\t\tconst docs = await withMarkerReadErrorHandling(() => this.#execute(driver, command), ledgerContext);\n\t\tconst entries = [];\n\t\tfor (const doc of docs) {\n\t\t\tconst migrationName = doc[\"migrationName\"];\n\t\t\tconst migrationHash = doc[\"migrationHash\"];\n\t\t\tconst from = doc[\"from\"];\n\t\t\tconst to = doc[\"to\"];\n\t\t\tconst docSpace = doc[\"space\"];\n\t\t\tif (typeof migrationName !== \"string\" || typeof migrationHash !== \"string\") continue;\n\t\t\tif (typeof from !== \"string\" || typeof to !== \"string\") continue;\n\t\t\tif (typeof docSpace !== \"string\") continue;\n\t\t\tconst appliedAt = doc[\"appliedAt\"];\n\t\t\tconst appliedAtDate = appliedAt instanceof Date ? appliedAt : appliedAt !== void 0 ? new Date(String(appliedAt)) : /* @__PURE__ */ new Date();\n\t\t\tconst operations = doc[\"operations\"];\n\t\t\tconst opList = Array.isArray(operations) ? operations : [];\n\t\t\tentries.push({\n\t\t\t\tspace: docSpace,\n\t\t\t\tmigrationName,\n\t\t\t\tmigrationHash,\n\t\t\t\tfrom: ledgerOriginFromStored(from),\n\t\t\t\tto,\n\t\t\t\tappliedAt: appliedAtDate,\n\t\t\t\toperationCount: opList.length\n\t\t\t});\n\t\t}\n\t\treturn entries;\n\t}\n\tasync introspectSchema(driver) {\n\t\treturn introspectSchema(extractDb(driver));\n\t}\n\tcreateRunnerDependencies(driver) {\n\t\tconst controlDriver = requireMongoControlDriver(driver);\n\t\treturn {\n\t\t\tinspectionExecutor: new MongoInspectionExecutor(controlDriver.db),\n\t\t\tadapter: this.#adapter,\n\t\t\tdriver: controlDriver,\n\t\t\texecuteDdl: (command) => this.executeDdl(controlDriver, command),\n\t\t\tmarkerOps: {\n\t\t\t\treadMarker: (space) => this.readMarker(controlDriver, space),\n\t\t\t\tinitMarker: (space, destination) => this.initMarker(controlDriver, space, destination),\n\t\t\t\tupdateMarker: (space, expectedFrom, destination) => this.updateMarker(controlDriver, space, expectedFrom, destination),\n\t\t\t\twriteLedgerEntry: (space, entry) => this.writeLedgerEntry(controlDriver, space, entry)\n\t\t\t},\n\t\t\tintrospectSchema: () => this.introspectSchema(controlDriver)\n\t\t};\n\t}\n};\n//#endregion\n//#region src/exports/control.ts\nconst mongoAdapterDescriptor = {\n\tkind: \"adapter\",\n\tid: \"mongo\",\n\tfamilyId: \"mongo\",\n\ttargetId: \"mongo\",\n\tversion: \"0.0.1\",\n\ttypes: { codecTypes: {\n\t\timport: {\n\t\t\tpackage: \"@internal/target-mongo/codec-types\",\n\t\t\tnamed: \"CodecTypes\",\n\t\t\talias: \"MongoCodecTypes\"\n\t\t},\n\t\tparameterizedOutputTypes: {\n\t\t\tpackage: \"@internal/target-mongo/codec-types\",\n\t\t\tnamed: \"ParameterizedOutputTypesForTypeParams\",\n\t\t\talias: \"MongoParameterizedOutputTypes\"\n\t\t}\n\t} },\n\tcreate(stack) {\n\t\treturn new MongoControlAdapterImpl(assembleMongoCodecRegistry([\n\t\t\tstack.target,\n\t\t\t...stack.adapter === void 0 ? [] : [stack.adapter],\n\t\t\t...stack.extensions\n\t\t]));\n\t}\n};\n//#endregion\nexport { MongoControlAdapterImpl, MongoInspectionExecutor, createMongoAdapter, mongoAdapterDescriptor as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AAY,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,OAAO;GACjD,GAAG,MAAM;EACV,CAAC,CAAC;CACH;AACD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as mongoNowGenerators } from "./date-time-now-generators-
|
|
2
|
-
import { t as createMongoAdapter } from "./mongo-adapter-
|
|
1
|
+
import { n as mongoNowGenerators } from "./date-time-now-generators-CMBWOjGk-Dux-x9uO.mjs";
|
|
2
|
+
import { t as createMongoAdapter } from "./mongo-adapter-DemWVyNv-B3xRFRas.mjs";
|
|
3
3
|
import { assembleMongoCodecRegistry } from "@prisma/orm-family-mongo/codec";
|
|
4
4
|
import { timestampNowRuntimeGenerator } from "@prisma/orm-family-mongo/family/runtime";
|
|
5
5
|
//#region ../../../3-targets/mongo/2-adapter/dist/runtime.mjs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter__runtime.mjs","names":[],"sources":["../../../../3-targets/mongo/2-adapter/dist/runtime.mjs"],"sourcesContent":["import { t as createMongoAdapter } from \"./mongo-adapter-
|
|
1
|
+
{"version":3,"file":"adapter__runtime.mjs","names":[],"sources":["../../../../3-targets/mongo/2-adapter/dist/runtime.mjs"],"sourcesContent":["import { t as createMongoAdapter } from \"./mongo-adapter-DemWVyNv.mjs\";\nimport { assembleMongoCodecRegistry } from \"@internal/mongo-codec\";\nimport { mongoNowGenerators } from \"@internal/target-mongo/runtime\";\nimport { timestampNowRuntimeGenerator } from \"@internal/family-mongo/runtime\";\n//#region src/exports/runtime.ts\nconst mongoRuntimeAdapterDescriptor = {\n\tkind: \"adapter\",\n\tid: \"mongo\",\n\tfamilyId: \"mongo\",\n\ttargetId: \"mongo\",\n\tversion: \"0.0.1\",\n\tmutationDefaultGenerators: () => [timestampNowRuntimeGenerator(), ...mongoNowGenerators.map(({ id, generate }) => ({\n\t\tid,\n\t\tgenerate,\n\t\tstability: \"query\"\n\t}))],\n\tcreate(stack) {\n\t\tconst adapter = createMongoAdapter(assembleMongoCodecRegistry([\n\t\t\tstack.target,\n\t\t\tstack.adapter,\n\t\t\t...stack.extensions\n\t\t]));\n\t\treturn {\n\t\t\tfamilyId: \"mongo\",\n\t\t\ttargetId: \"mongo\",\n\t\t\tlower: adapter.lower.bind(adapter),\n\t\t\tstructuralLower: adapter.structuralLower.bind(adapter),\n\t\t\tresolveParams: adapter.resolveParams.bind(adapter)\n\t\t};\n\t}\n};\n//#endregion\nexport { mongoRuntimeAdapterDescriptor as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;AAKA,MAAM,gCAAgC;CACrC,MAAM;CACN,IAAI;CACJ,UAAU;CACV,UAAU;CACV,SAAS;CACT,iCAAiC,CAAC,6BAA6B,GAAG,GAAG,mBAAmB,KAAK,EAAE,IAAI,gBAAgB;EAClH;EACA;EACA,WAAW;CACZ,EAAE,CAAC;CACH,OAAO,OAAO;EACb,MAAM,UAAU,mBAAmB,2BAA2B;GAC7D,MAAM;GACN,MAAM;GACN,GAAG,MAAM;EACV,CAAC,CAAC;EACF,OAAO;GACN,UAAU;GACV,UAAU;GACV,OAAO,QAAQ,MAAM,KAAK,OAAO;GACjC,iBAAiB,QAAQ,gBAAgB,KAAK,OAAO;GACrD,eAAe,QAAQ,cAAc,KAAK,OAAO;EAClD;CACD;AACD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as MONGO_STRING_CODEC_ID, a as MONGO_DATE_INSTANT_CODEC_ID, b as MONGO_VECTOR_CODEC_ID, c as MONGO_DATE_TEMPORAL_CODEC_ID, d as MONGO_DURATION_STRING_CODEC_ID, f as MONGO_INT32_CODEC_ID, g as MONGO_OBJECTID_CODEC_ID, h as MONGO_JSON_CODEC_ID, i as MONGO_DATE_CODEC_ID, l as MONGO_DECIMAL128_CODEC_ID, m as MONGO_INT64_NUMBER_CODEC_ID, n as MONGO_BOOLEAN_CODEC_ID, o as MONGO_DATE_INSTANT_STRING_CODEC_ID, p as MONGO_INT64_CODEC_ID, r as MONGO_BSON_CODEC_ID, s as MONGO_DATE_STRING_CODEC_ID, t as MONGO_BINARY_CODEC_ID, u as MONGO_DOUBLE_CODEC_ID, v as MONGO_TIME_STRING_CODEC_ID, y as MONGO_TIME_TEMPORAL_CODEC_ID } from "./codec-ids-DZQsuh80-ywDzfnAg.mjs";
|
|
2
2
|
import { t as mongoTargetError } from "./mongo-target-errors-Btf3ML1w-QOtEG7EX.mjs";
|
|
3
|
-
import { $ as mongoVector, B as mongoDecimal128, C as int64Decode, D as int64NumberFromDigits, E as int64NumberEncode, F as mongoBson, G as mongoInt32, H as mongoDuration, I as mongoCalendarDate, J as mongoObjectId, K as mongoInt64, L as mongoCalendarDateText, M as isPlainObject, N as mongoBinary, O as int64NumberToJson, P as mongoBool, Q as mongoTimeText, S as int32ToJson, T as int64NumberDecode, U as mongoDurationText, V as mongoDouble, W as mongoInstantText, Y as mongoString, Z as mongoTime, _ as decimal128ToJson, a as booleanEncode, at as vectorEncode, b as encodeBsonValue, c as bsonTypeTag, d as dateEncode, f as dateToJson, h as decimal128Encode, i as binaryToBase64, it as stringEncode, j as isPlainArray, k as int64ToJson, l as child, m as decimal128Decode, n as binaryEncode, nt as objectIdToJson, o as bsonClassTag, ot as where, p as dbRefEntries, q as mongoJson, r as binaryFromBase64, rt as readBsonJson, s as bsonToJson, t as binaryDecode, tt as objectIdEncode, u as constructorName, v as decodeBsonValue, w as int64Encode, x as int32Encode, y as doubleEncode, z as mongoDate } from "./data-types-
|
|
3
|
+
import { $ as mongoVector, B as mongoDecimal128, C as int64Decode, D as int64NumberFromDigits, E as int64NumberEncode, F as mongoBson, G as mongoInt32, H as mongoDuration, I as mongoCalendarDate, J as mongoObjectId, K as mongoInt64, L as mongoCalendarDateText, M as isPlainObject, N as mongoBinary, O as int64NumberToJson, P as mongoBool, Q as mongoTimeText, S as int32ToJson, T as int64NumberDecode, U as mongoDurationText, V as mongoDouble, W as mongoInstantText, Y as mongoString, Z as mongoTime, _ as decimal128ToJson, a as booleanEncode, at as vectorEncode, b as encodeBsonValue, c as bsonTypeTag, d as dateEncode, f as dateToJson, h as decimal128Encode, i as binaryToBase64, it as stringEncode, j as isPlainArray, k as int64ToJson, l as child, m as decimal128Decode, n as binaryEncode, nt as objectIdToJson, o as bsonClassTag, ot as where, p as dbRefEntries, q as mongoJson, r as binaryFromBase64, rt as readBsonJson, s as bsonToJson, t as binaryDecode, tt as objectIdEncode, u as constructorName, v as decodeBsonValue, w as int64Encode, x as int32Encode, y as doubleEncode, z as mongoDate } from "./data-types-BR7vssy0-CuNYIJHI.mjs";
|
|
4
4
|
import { decimalTextBigintLiteral, decimalTextNumberLiteral, floatNumberLiteral, floatToJson, readJsonFloat, renderTsLiteral } from "@prisma/orm-framework/components/codec";
|
|
5
5
|
import { hasDigitsBelowAMillisecond, isValidDate } from "@prisma/orm-framework/type-implementations/date";
|
|
6
6
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
@@ -8,7 +8,7 @@ import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
|
8
8
|
import { findTemporal } from "@prisma/orm-framework/type-implementations/temporal";
|
|
9
9
|
import { mongoCodec, mongoCodecDescriptor } from "@prisma/orm-family-mongo/codec";
|
|
10
10
|
import { describeValue, temporalFromText, temporalToText } from "@prisma/orm-framework/type-implementations/temporal-text";
|
|
11
|
-
//#region ../../../3-targets/mongo/1-target/dist/codecs-
|
|
11
|
+
//#region ../../../3-targets/mongo/1-target/dist/codecs-DB6ji3ee.mjs
|
|
12
12
|
const TEMPORAL_UNAVAILABLE_FIX = "Run on a runtime with Temporal available, install a Temporal polyfill before creating the client, or write the field as a convenience type at its default, which needs no Temporal: `DateTime` reads a JavaScript `Date`, and `Date`, `Time` and `Duration` read ISO 8601 strings.";
|
|
13
13
|
function errorTemporalUnavailable(codecId, operation) {
|
|
14
14
|
return mongoTargetError("RUNTIME.TEMPORAL_UNAVAILABLE", `Codec '${codecId}' cannot ${operation} a value because this runtime has no global Temporal implementation.`, {
|
|
@@ -617,4 +617,4 @@ function mongoDescriptorById(codecId) {
|
|
|
617
617
|
//#endregion
|
|
618
618
|
export { mongoDescriptorById as n, requireTemporal as r, mongoCodecDescriptors as t };
|
|
619
619
|
|
|
620
|
-
//# sourceMappingURL=codecs-
|
|
620
|
+
//# sourceMappingURL=codecs-DB6ji3ee-BzMiSM6G.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codecs-Bl21z49D-Bj5erX9r.mjs","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/codecs-Bl21z49D.mjs"],"sourcesContent":["import { _ as MONGO_STRING_CODEC_ID, a as MONGO_DATE_INSTANT_CODEC_ID, b as MONGO_VECTOR_CODEC_ID, c as MONGO_DATE_TEMPORAL_CODEC_ID, d as MONGO_DURATION_STRING_CODEC_ID, f as MONGO_INT32_CODEC_ID, g as MONGO_OBJECTID_CODEC_ID, h as MONGO_JSON_CODEC_ID, i as MONGO_DATE_CODEC_ID, l as MONGO_DECIMAL128_CODEC_ID, m as MONGO_INT64_NUMBER_CODEC_ID, n as MONGO_BOOLEAN_CODEC_ID, o as MONGO_DATE_INSTANT_STRING_CODEC_ID, p as MONGO_INT64_CODEC_ID, r as MONGO_BSON_CODEC_ID, s as MONGO_DATE_STRING_CODEC_ID, t as MONGO_BINARY_CODEC_ID, u as MONGO_DOUBLE_CODEC_ID, v as MONGO_TIME_STRING_CODEC_ID, y as MONGO_TIME_TEMPORAL_CODEC_ID } from \"./codec-ids-DZQsuh80.mjs\";\nimport { t as mongoTargetError } from \"./mongo-target-errors-Btf3ML1w.mjs\";\nimport { $ as int64NumberFromDigits, A as constructorName, B as dateEncode, C as bsonToJson, D as bsonClassTag, E as readBsonJson, F as binaryDecode, G as decimal128ToJson, H as decimal128Decode, I as binaryEncode, J as int32ToJson, K as doubleEncode, L as binaryFromBase64, M as isPlainArray, N as isPlainObject, O as bsonTypeTag, P as where, Q as int64NumberEncode, R as binaryToBase64, T as encodeBsonValue, U as decimal128Encode, V as dateToJson, X as int64Encode, Y as int64Decode, Z as int64NumberDecode, _ as mongoString, a as mongoCalendarDateText, at as stringEncode, b as mongoTimeText, c as mongoDecimal128, d as mongoDurationText, et as int64NumberToJson, f as mongoInstantText, g as mongoObjectId, h as mongoJson, i as mongoCalendarDate, it as objectIdToJson, j as dbRefEntries, k as child, l as mongoDouble, m as mongoInt64, n as mongoBool, ot as vectorEncode, p as mongoInt32, q as int32Encode, r as mongoBson, rt as objectIdEncode, s as mongoDate, t as mongoBinary, tt as int64ToJson, u as mongoDuration, w as decodeBsonValue, x as mongoVector, y as mongoTime, z as booleanEncode } from \"./data-types-B3SLjbqa.mjs\";\nimport { decimalTextBigintLiteral, decimalTextNumberLiteral, floatNumberLiteral, floatToJson, readJsonFloat, renderTsLiteral } from \"@internal/framework-components/codec\";\nimport { hasDigitsBelowAMillisecond, isValidDate } from \"@internal/type-implementations/date\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { findTemporal } from \"@internal/type-implementations/temporal\";\nimport { mongoCodec, mongoCodecDescriptor } from \"@internal/mongo-codec\";\nimport { describeValue, temporalFromText, temporalToText } from \"@internal/type-implementations/temporal-text\";\n//#region src/core/date-time-errors.ts\nconst TEMPORAL_UNAVAILABLE_FIX = \"Run on a runtime with Temporal available, install a Temporal polyfill before creating the client, or write the field as a convenience type at its default, which needs no Temporal: `DateTime` reads a JavaScript `Date`, and `Date`, `Time` and `Duration` read ISO 8601 strings.\";\nfunction errorTemporalUnavailable(codecId, operation) {\n\treturn mongoTargetError(\"RUNTIME.TEMPORAL_UNAVAILABLE\", `Codec '${codecId}' cannot ${operation} a value because this runtime has no global Temporal implementation.`, {\n\t\twhy: \"Temporal-backed codecs read and write their values through the global Temporal API, which this runtime does not provide.\",\n\t\tfix: TEMPORAL_UNAVAILABLE_FIX,\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\toperation\n\t\t}\n\t});\n}\nfunction errorTemporalUnavailableForDefault(generatorId) {\n\treturn mongoTargetError(\"RUNTIME.TEMPORAL_UNAVAILABLE\", `Mutation default generator '${generatorId}' cannot produce a value because this runtime has no global Temporal implementation.`, {\n\t\twhy: \"The generator answers a Temporal-backed field, so the value it produces is a Temporal value, which this runtime cannot construct.\",\n\t\tfix: TEMPORAL_UNAVAILABLE_FIX,\n\t\tmeta: { generatorId }\n\t});\n}\nfunction errorTemporalWrongType(codecId, temporalTag, stringType, received) {\n\treturn mongoTargetError(\"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' encodes a ${temporalTag}, but received ${received}.`, {\n\t\twhy: \"The codec writes the value a Temporal value names. A value of another type names none the field holds.\",\n\t\tfix: `Pass a ${temporalTag}, or author the field with its ${stringType} type to write ISO 8601 text.`,\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\ttemporalTag,\n\t\t\tstringType,\n\t\t\treceived\n\t\t}\n\t});\n}\nfunction errorTemporalNonIsoCalendar(codecId, calendarId) {\n\treturn mongoTargetError(\"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' accepts only the iso8601 calendar, but the value carries '${calendarId}'.`, {\n\t\twhy: \"MongoDB stores no calendar alongside a date, so a non-ISO calendar would be discarded on write and the value would read back as a different date than the one authored.\",\n\t\tfix: \"Convert the value with .withCalendar(\\\"iso8601\\\") before writing if the ISO projection is what you mean to store.\",\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\tcalendarId\n\t\t}\n\t});\n}\n/** A date or time codec read a value from MongoDB that is not a value of its type, or that `Temporal` cannot hold. */\nfunction errorDateTimeUnreadable(options) {\n\tconst { codecId, value, detail } = options;\n\treturn mongoTargetError(\"RUNTIME.DECODE_FAILED\", `Codec '${codecId}' cannot read ${value}: ${detail}`, {\n\t\twhy: \"MongoDB checks no form for a BSON date or string beyond its BSON type, so a document written outside Prisma can hold a value that is not a value of the field’s type.\",\n\t\tfix: \"Rewrite the document in the form the field stores, or read the field with a type that holds what it stores, such as DateTime for a BSON date or String for a BSON string.\",\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\tvalue: value.slice(0, 100)\n\t\t},\n\t\t...ifDefined(\"cause\", options.cause)\n\t});\n}\n/** A date or time codec was given a value that names no value its type stores, such as text with a digit below a millisecond. */\nfunction errorDateTimeUnwritable(options) {\n\tconst { codecId, received, detail } = options;\n\treturn mongoTargetError(\"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' cannot write ${received}. ${detail}`, {\n\t\twhy: \"A BSON date holds milliseconds, a calendar date is stored at midnight UTC, and a time of day as a string with three fraction digits. A value that form cannot hold is refused rather than changed.\",\n\t\tfix: \"Write a value the field holds, as the message shows.\",\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\treceived: received.slice(0, 100)\n\t\t},\n\t\t...ifDefined(\"cause\", options.cause)\n\t});\n}\n//#endregion\n//#region src/core/require-temporal.ts\n/**\n* The `Temporal` to use: the runtime's own when it has one, else the fallback. Throws\n* `RUNTIME.TEMPORAL_UNAVAILABLE` when there is neither.\n*/\nfunction requireTemporal(meta) {\n\tconst temporal = findTemporal();\n\tif (temporal !== void 0) return temporal;\n\tthrow \"generatorId\" in meta ? errorTemporalUnavailableForDefault(meta.generatorId) : errorTemporalUnavailable(meta.codecId, meta.operation);\n}\n//#endregion\n//#region src/core/date-time-values.ts\nconst MILLISECONDS_PER_DAY = 864e5;\nfunction messageOf(cause) {\n\treturn cause instanceof Error ? cause.message : String(cause);\n}\n/** The text a write stores for `value`, in the form `stored` writes; a value `stored` refuses is refused as `RUNTIME.ENCODE_FAILED`. */\nfunction storedTextForWrite(codecId, value, stored) {\n\tif (typeof value !== \"string\") throw errorDateTimeUnwritable({\n\t\tcodecId,\n\t\treceived: describeValue(value),\n\t\tdetail: \"It writes ISO 8601 text.\"\n\t});\n\ttry {\n\t\treturn stored(value);\n\t} catch (cause) {\n\t\tthrow errorDateTimeUnwritable({\n\t\t\tcodecId,\n\t\t\treceived: JSON.stringify(value),\n\t\t\tdetail: messageOf(cause),\n\t\t\tcause\n\t\t});\n\t}\n}\n/** The stored form of a BSON string MongoDB returned, as `stored` reads it; text `stored` refuses is refused as `RUNTIME.DECODE_FAILED`. */\nfunction storedTextFromWire(codecId, wire, stored) {\n\tif (typeof wire !== \"string\") throw errorDateTimeUnreadable({\n\t\tcodecId,\n\t\tvalue: String(wire),\n\t\tdetail: `MongoDB returned ${describeValue(wire)}, not a string.`\n\t});\n\ttry {\n\t\treturn stored(wire);\n\t} catch (cause) {\n\t\tthrow errorDateTimeUnreadable({\n\t\t\tcodecId,\n\t\t\tvalue: JSON.stringify(wire),\n\t\t\tdetail: messageOf(cause),\n\t\t\tcause\n\t\t});\n\t}\n}\n/** The BSON date MongoDB returned, as the `Date` the driver reads it as. */\nfunction dateFromWire(codecId, wire) {\n\tif (isValidDate(wire)) return wire;\n\tthrow errorDateTimeUnreadable({\n\t\tcodecId,\n\t\tvalue: String(wire),\n\t\tdetail: `MongoDB returned ${describeValue(wire)}, not a BSON date.`\n\t});\n}\n/** Whether `date` is at midnight UTC, the form a calendar date is stored in. */\nfunction isAtMidnightUtc(date) {\n\treturn date.getTime() % MILLISECONDS_PER_DAY === 0;\n}\n/** The date part of `date` in UTC, as in `2024-02-29`, for a `Date` at midnight UTC. */\nfunction calendarDateTextOf(date) {\n\tconst iso = date.toISOString();\n\treturn iso.slice(0, iso.indexOf(\"T\"));\n}\n/** The calendar date a BSON date at midnight UTC holds, as in `2024-02-29`. A BSON date at another time is refused, so a field written as an instant is never read as a date. */\nfunction calendarDateFromWire(codecId, wire) {\n\tconst date = dateFromWire(codecId, wire);\n\tif (isAtMidnightUtc(date)) return calendarDateTextOf(date);\n\tthrow errorDateTimeUnreadable({\n\t\tcodecId,\n\t\tvalue: date.toISOString(),\n\t\tdetail: \"a calendar date is stored as a BSON date at midnight UTC. A field that holds a time of day is a DateTime.\"\n\t});\n}\n/** The BSON date at midnight UTC that stores the calendar date `text`, as in `2024-02-29`. */\nfunction midnightUtcOf(text) {\n\treturn /* @__PURE__ */ new Date(`${text}T00:00:00.000Z`);\n}\n/** The Temporal value that stored text names, read with `parse`. */\nfunction temporalFromStoredText(identity, text, parse) {\n\tconst read = temporalFromText(requireTemporal({\n\t\tcodecId: identity.codecId,\n\t\toperation: \"decode\"\n\t}), text, parse);\n\tif (read.kind === \"unreadable\") throw errorDateTimeUnreadable({\n\t\tcodecId: identity.codecId,\n\t\tvalue: JSON.stringify(text),\n\t\tdetail: `${identity.temporalTag} cannot hold it: ${read.detail}. Use ${identity.stringType} to read the field as text.`,\n\t\tcause: read.cause\n\t});\n\treturn read.value;\n}\n/** The text a write stores for a Temporal value, in the form `stored` writes. A value of another kind, in a calendar other than ISO 8601, or with digits below a millisecond is refused. */\nfunction storedTextOfTemporal(identity, value, stored) {\n\tconst encoded = temporalToText(value, identity.temporalTag);\n\tswitch (encoded.kind) {\n\t\tcase \"wrong-type\": throw errorTemporalWrongType(identity.codecId, identity.temporalTag, identity.stringType, encoded.received);\n\t\tcase \"non-iso-calendar\": throw errorTemporalNonIsoCalendar(identity.codecId, encoded.calendarId);\n\t\tcase \"text\":\n\t\t\tif (hasDigitsBelowAMillisecond(encoded.text)) throw errorDateTimeUnwritable({\n\t\t\t\tcodecId: identity.codecId,\n\t\t\t\treceived: `the ${identity.temporalTag} ${encoded.text}`,\n\t\t\t\tdetail: \"It has digits below a millisecond, and the field holds milliseconds. Round it first, as in value.round({ smallestUnit: 'millisecond', roundingMode: 'trunc' }).\"\n\t\t\t});\n\t\t\treturn storedTextForWrite(identity.codecId, encoded.text, stored);\n\t}\n}\n//#endregion\n//#region src/core/date-time-codecs.ts\nconst INSTANT = {\n\tcodecId: MONGO_DATE_INSTANT_CODEC_ID,\n\ttemporalTag: \"Temporal.Instant\",\n\tstringType: \"DateInstantString\"\n};\nconst PLAIN_DATE = {\n\tcodecId: MONGO_DATE_TEMPORAL_CODEC_ID,\n\ttemporalTag: \"Temporal.PlainDate\",\n\tstringType: \"DateString\"\n};\nconst PLAIN_TIME = {\n\tcodecId: MONGO_TIME_TEMPORAL_CODEC_ID,\n\ttemporalTag: \"Temporal.PlainTime\",\n\tstringType: \"TimeString\"\n};\nconst instantText = (value) => storedTextOfTemporal(INSTANT, value, mongoInstantText);\nconst plainDateText = (value) => storedTextOfTemporal(PLAIN_DATE, value, mongoCalendarDateText);\nconst plainTimeText = (value) => storedTextOfTemporal(PLAIN_TIME, value, mongoTimeText);\n/** An instant, stored as a BSON date and read as `Temporal.Instant`. */\nconst mongoDateInstantCodec = mongoCodec({\n\ttypeId: MONGO_DATE_INSTANT_CODEC_ID,\n\tdataType: mongoDate,\n\tfromWire: (wire) => temporalFromStoredText(INSTANT, dateFromWire(MONGO_DATE_INSTANT_CODEC_ID, wire).toISOString(), (temporal, text) => temporal.Instant.from(text)),\n\ttoWire: (value) => new Date(instantText(value)),\n\ttoDataTypeValue: (value) => mongoDate.valueFrom(instantText(value), {}),\n\tfromDataTypeValue: (value) => temporalFromStoredText(INSTANT, value.value, (temporal, text) => temporal.Instant.from(text))\n});\n/** An instant, stored as a BSON date and read as the text `Date.toISOString()` writes, `2024-01-01T00:00:00.000Z`. A write takes ISO 8601 text with any UTC offset. */\nconst mongoDateInstantStringCodec = mongoCodec({\n\ttypeId: MONGO_DATE_INSTANT_STRING_CODEC_ID,\n\tdataType: mongoDate,\n\tfromWire: (wire) => dateFromWire(MONGO_DATE_INSTANT_STRING_CODEC_ID, wire).toISOString(),\n\ttoWire: (value) => new Date(storedTextForWrite(MONGO_DATE_INSTANT_STRING_CODEC_ID, value, mongoInstantText)),\n\ttoDataTypeValue: (value) => mongoDate.valueFrom(storedTextForWrite(MONGO_DATE_INSTANT_STRING_CODEC_ID, value, mongoInstantText), {}),\n\tfromDataTypeValue: (value) => value.value\n});\n/** A calendar date, stored as a BSON date at midnight UTC and read as `2024-02-29`. */\nconst mongoDateStringCodec = mongoCodec({\n\ttypeId: MONGO_DATE_STRING_CODEC_ID,\n\tdataType: mongoCalendarDate,\n\tfromWire: (wire) => calendarDateFromWire(MONGO_DATE_STRING_CODEC_ID, wire),\n\ttoWire: (value) => midnightUtcOf(storedTextForWrite(MONGO_DATE_STRING_CODEC_ID, value, mongoCalendarDateText)),\n\ttoDataTypeValue: (value) => mongoCalendarDate.valueFrom(storedTextForWrite(MONGO_DATE_STRING_CODEC_ID, value, mongoCalendarDateText), {}),\n\tfromDataTypeValue: (value) => value.value\n});\n/** A calendar date, stored as a BSON date at midnight UTC and read as `Temporal.PlainDate`. */\nconst mongoDateTemporalCodec = mongoCodec({\n\ttypeId: MONGO_DATE_TEMPORAL_CODEC_ID,\n\tdataType: mongoCalendarDate,\n\tfromWire: (wire) => temporalFromStoredText(PLAIN_DATE, calendarDateFromWire(MONGO_DATE_TEMPORAL_CODEC_ID, wire), (temporal, text) => temporal.PlainDate.from(text)),\n\ttoWire: (value) => midnightUtcOf(plainDateText(value)),\n\ttoDataTypeValue: (value) => mongoCalendarDate.valueFrom(plainDateText(value), {}),\n\tfromDataTypeValue: (value) => temporalFromStoredText(PLAIN_DATE, value.value, (temporal, text) => temporal.PlainDate.from(text))\n});\n/** A time of day, stored as a BSON string and read as that string, `09:30:00.000`. A write pads a string with fewer fraction digits to three. */\nconst mongoTimeStringCodec = mongoCodec({\n\ttypeId: MONGO_TIME_STRING_CODEC_ID,\n\tdataType: mongoTime,\n\tfromWire: (wire) => storedTextFromWire(MONGO_TIME_STRING_CODEC_ID, wire, mongoTimeText),\n\ttoWire: (value) => storedTextForWrite(MONGO_TIME_STRING_CODEC_ID, value, mongoTimeText),\n\ttoDataTypeValue: (value) => mongoTime.valueFrom(storedTextForWrite(MONGO_TIME_STRING_CODEC_ID, value, mongoTimeText), {}),\n\tfromDataTypeValue: (value) => value.value\n});\n/** A time of day, stored as a BSON string, `09:30:00.000`, and read as `Temporal.PlainTime`. */\nconst mongoTimeTemporalCodec = mongoCodec({\n\ttypeId: MONGO_TIME_TEMPORAL_CODEC_ID,\n\tdataType: mongoTime,\n\tfromWire: (wire) => temporalFromStoredText(PLAIN_TIME, storedTextFromWire(MONGO_TIME_TEMPORAL_CODEC_ID, wire, mongoTimeText), (temporal, text) => temporal.PlainTime.from(text)),\n\ttoWire: (value) => plainTimeText(value),\n\ttoDataTypeValue: (value) => mongoTime.valueFrom(plainTimeText(value), {}),\n\tfromDataTypeValue: (value) => temporalFromStoredText(PLAIN_TIME, value.value, (temporal, text) => temporal.PlainTime.from(text))\n});\n/** A length of time, stored as a BSON string and read as the ISO 8601 duration it was written as, `PT1H30M`. */\nconst mongoDurationStringCodec = mongoCodec({\n\ttypeId: MONGO_DURATION_STRING_CODEC_ID,\n\tdataType: mongoDuration,\n\tfromWire: (wire) => storedTextFromWire(MONGO_DURATION_STRING_CODEC_ID, wire, mongoDurationText),\n\ttoWire: (value) => storedTextForWrite(MONGO_DURATION_STRING_CODEC_ID, value, mongoDurationText),\n\tfromDataTypeValue: (value) => value.value\n});\n//#endregion\n//#region src/core/json-codec-helpers.ts\nconst BSON_TYPE_BY_TAG = {\n\tObjectId: \"objectId\",\n\tDecimal128: \"decimal\",\n\tBinary: \"binData\",\n\tBSONRegExp: \"regex\",\n\tTimestamp: \"timestamp\",\n\tBSONSymbol: \"symbol\",\n\tCode: \"javascript\",\n\tMinKey: \"minKey\",\n\tMaxKey: \"maxKey\"\n};\nconst NOT_FINITE_FIX = \"JSON has no NaN or Infinity; store null or a string, or declare the field Bson.\";\nconst BSON_FIX = \"Declare the field Bson to store BSON values.\";\nconst PLAIN_VALUE_FIX = \"Convert it to a plain object or array.\";\nconst ENCODE_FIX_BY_RECEIVED = {\n\tDate: \"Store the date as an ISO 8601 string, or declare the field Bson.\",\n\tbigint: \"Store it as a number in the safe-integer range or as decimal text, or declare the field Int64 or Bson.\",\n\tNaN: NOT_FINITE_FIX,\n\tInfinity: NOT_FINITE_FIX,\n\t\"-Infinity\": NOT_FINITE_FIX,\n\tundefined: \"Leave the key out, or store null.\",\n\tUint8Array: \"Store the bytes as a base64 string, or declare the field Binary or Bson.\",\n\tBuffer: \"Store the bytes as a base64 string, or declare the field Binary or Bson.\",\n\tBinary: \"Store the bytes as a base64 string, or declare the field Binary or Bson.\",\n\tObjectId: \"Store its hex string, or declare the field ObjectId or Bson.\",\n\tLong: \"Store a number in the safe-integer range or decimal text, or declare the field Int64 or Bson.\",\n\tDecimal128: \"Store the decimal text, or declare the field Decimal128 or Bson.\",\n\tInt32: \"Pass a plain number.\",\n\tDouble: \"Pass a plain number.\",\n\tRegExp: \"Store the pattern as a string, or declare the field Bson.\",\n\tBSONRegExp: \"Store the pattern as a string, or declare the field Bson.\",\n\tsymbol: \"Store a string instead.\",\n\tfunction: \"Store data, not a function.\",\n\t\"circular reference\": \"Remove the cycle; a JSON value is a tree.\",\n\t\"sparse array hole\": \"Fill the hole with null.\",\n\tDBRef: \"Write it as a { $ref, $id } document instead.\"\n};\nfunction encodeFix(received) {\n\treturn ENCODE_FIX_BY_RECEIVED[received] ?? (Object.hasOwn(BSON_TYPE_BY_TAG, received) ? BSON_FIX : PLAIN_VALUE_FIX);\n}\nfunction encodeRefused(received, path) {\n\tthrow mongoTargetError(\"RUNTIME.ENCODE_FAILED\", `${MONGO_JSON_CODEC_ID} value must be a JSON value; received ${received} at ${where(path)}. ${encodeFix(received)}`, { meta: {\n\t\tcodecId: MONGO_JSON_CODEC_ID,\n\t\treceived,\n\t\tvaluePath: path\n\t} });\n}\nfunction describeNonJson(value) {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return void 0;\n\tif (typeof value === \"number\") return Number.isFinite(value) ? void 0 : String(value);\n\tif (typeof value !== \"object\") return typeof value;\n\tconst tag = bsonTypeTag(value);\n\tif (tag !== void 0) return tag;\n\tif (value instanceof Date) return \"Date\";\n\tif (isPlainArray(value)) return void 0;\n\treturn isPlainObject(value) ? void 0 : constructorName(value);\n}\nfunction assertJsonValue(value, path, ancestors) {\n\tconst received = describeNonJson(value);\n\tif (received !== void 0) encodeRefused(received, path);\n\tif (typeof value !== \"object\" || value === null) return;\n\tif (ancestors.has(value)) encodeRefused(\"circular reference\", path);\n\tancestors.add(value);\n\tif (Array.isArray(value)) for (let index = 0; index < value.length; index++) {\n\t\tif (!(index in value)) encodeRefused(\"sparse array hole\", child(path, index));\n\t\tassertJsonValue(value[index], child(path, index), ancestors);\n\t}\n\telse for (const [key, entry] of Object.entries(value)) assertJsonValue(entry, child(path, key), ancestors);\n\tancestors.delete(value);\n}\n/**\n* Returns `value` unchanged when it is a plain JSON value at every depth, and throws `RUNTIME.ENCODE_FAILED` naming the first value that is not, with its path.\n*/\nfunction encodeJsonValue(value) {\n\tassertJsonValue(value, \"\", /* @__PURE__ */ new Set());\n\treturn value;\n}\nfunction decodeRefused(bsonType, path) {\n\tthrow mongoTargetError(\"RUNTIME.DECODE_FAILED\", `${MONGO_JSON_CODEC_ID} wire value contains a non-JSON BSON ${bsonType} at ${where(path)}`, { meta: {\n\t\tcodecId: MONGO_JSON_CODEC_ID,\n\t\treceived: bsonType,\n\t\tvaluePath: path\n\t} });\n}\nfunction safeLong(value, path) {\n\tconst number = Number(value);\n\treturn Number.isSafeInteger(number) && BigInt(number) === value ? number : decodeRefused(\"long\", path);\n}\nfunction finiteDouble(value, path) {\n\tif (Number.isFinite(value)) return value;\n\tconst received = String(value);\n\tthrow mongoTargetError(\"RUNTIME.DECODE_FAILED\", `${MONGO_JSON_CODEC_ID} wire value contains ${received} at ${where(path)}; a JSON number cannot be NaN or Infinity`, { meta: {\n\t\tcodecId: MONGO_JSON_CODEC_ID,\n\t\treceived,\n\t\tvaluePath: path\n\t} });\n}\nfunction decodeEntries(entries, path) {\n\treturn Object.fromEntries(entries.map(([key, entry]) => [key, decodeValue(entry, child(path, key))]));\n}\nfunction decodeTagged(value, tag, path) {\n\tswitch (tag) {\n\t\tcase \"DBRef\": return decodeEntries(dbRefEntries(value), path);\n\t\tcase \"Long\": return safeLong(blindCast(value).toBigInt(), path);\n\t\tcase \"Int32\":\n\t\tcase \"Double\": return finiteDouble(Number(value.valueOf()), path);\n\t}\n\treturn decodeRefused(BSON_TYPE_BY_TAG[tag] ?? tag, path);\n}\nfunction decodeValue(value, path) {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return value;\n\tif (typeof value === \"number\") return finiteDouble(value, path);\n\tif (typeof value === \"bigint\") return safeLong(value, path);\n\tif (typeof value === \"undefined\") return decodeRefused(\"undefined\", path);\n\tif (typeof value === \"symbol\") return decodeRefused(\"symbol\", path);\n\tif (typeof value === \"function\") return decodeRefused(\"javascript\", path);\n\tconst tag = bsonClassTag(value);\n\tif (tag !== void 0) return decodeTagged(value, tag, path);\n\tif (value instanceof Date) return decodeRefused(\"date\", path);\n\tif (value instanceof RegExp) return decodeRefused(\"regex\", path);\n\tif (value instanceof Uint8Array) return decodeRefused(\"binData\", path);\n\tif (Array.isArray(value)) {\n\t\tconst decoded = value.map((entry, index) => decodeValue(entry, child(path, index)));\n\t\treturn decoded.some((entry, index) => entry !== value[index]) ? decoded : value;\n\t}\n\tif (!isPlainObject(value)) return decodeRefused(constructorName(value), path);\n\tconst entries = Object.entries(value);\n\tconst decoded = decodeEntries(entries, path);\n\treturn entries.some(([key, entry]) => decoded[key] !== entry) ? decoded : blindCast(value);\n}\n/**\n* Decodes a wire value to the JSON value it holds: a `long` in the safe-integer range and the driver's `Int32` and `Double` wrappers become numbers. Only the objects and arrays around a converted value are copied; a wire value that is already JSON is returned as the same object. Throws `RUNTIME.DECODE_FAILED` naming the BSON type and path of the first value that is not JSON.\n*/\nfunction decodeJsonValue(wire) {\n\treturn decodeValue(wire, \"\");\n}\n//#endregion\n//#region src/core/codecs.ts\nconst mongoObjectIdCodec = mongoCodec({\n\ttypeId: MONGO_OBJECTID_CODEC_ID,\n\tdataType: mongoObjectId,\n\tfromWire: (wire) => wire.toHexString(),\n\ttoWire: (value) => objectIdEncode(MONGO_OBJECTID_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoObjectId.valueFrom(objectIdToJson(MONGO_OBJECTID_CODEC_ID, value), {}),\n\tfromDataTypeValue: (value) => value.value\n});\nconst mongoStringCodec = mongoCodec({\n\ttypeId: MONGO_STRING_CODEC_ID,\n\tdataType: mongoString,\n\tfromWire: (wire) => wire,\n\ttoWire: (value) => stringEncode(MONGO_STRING_CODEC_ID, value),\n\tfromDataTypeValue: (value) => value.value\n});\nconst mongoDoubleCodec = mongoCodec({\n\ttypeId: MONGO_DOUBLE_CODEC_ID,\n\tdataType: mongoDouble,\n\tfromWire: (wire) => Number(wire),\n\ttoWire: (value) => doubleEncode(MONGO_DOUBLE_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoDouble.valueFrom(floatToJson(value), {}),\n\tfromDataTypeValue: (value) => readJsonFloat(MONGO_DOUBLE_CODEC_ID, value.value)\n});\nconst mongoInt32Codec = mongoCodec({\n\ttypeId: MONGO_INT32_CODEC_ID,\n\tdataType: mongoInt32,\n\tfromWire: (wire) => wire,\n\ttoWire: (value) => int32Encode(MONGO_INT32_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoInt32.valueFrom(int32ToJson(MONGO_INT32_CODEC_ID, value), {}),\n\tfromDataTypeValue: (value) => value.value\n});\nconst mongoBooleanCodec = mongoCodec({\n\ttypeId: MONGO_BOOLEAN_CODEC_ID,\n\tdataType: mongoBool,\n\tfromWire: (wire) => wire,\n\ttoWire: (value) => booleanEncode(MONGO_BOOLEAN_CODEC_ID, value),\n\tfromDataTypeValue: (value) => value.value\n});\nconst mongoDateCodec = mongoCodec({\n\ttypeId: MONGO_DATE_CODEC_ID,\n\tdataType: mongoDate,\n\tfromWire: (wire) => wire,\n\ttoWire: (value) => dateEncode(MONGO_DATE_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoDate.valueFrom(dateToJson(MONGO_DATE_CODEC_ID, value), {}),\n\tfromDataTypeValue: (value) => new Date(value.value)\n});\n/** The vector codec for a column of `mongo/vector` with `params`. The dimension reaches only the TypeScript type `Vector<n>`. */\nfunction vectorCodec(params) {\n\treturn mongoCodec({\n\t\ttypeId: MONGO_VECTOR_CODEC_ID,\n\t\tdataType: mongoVector,\n\t\t...ifDefined(\"params\", params),\n\t\tfromWire: (wire) => wire,\n\t\ttoWire: (value) => vectorEncode(MONGO_VECTOR_CODEC_ID, value),\n\t\tfromDataTypeValue: (value) => value.value\n\t});\n}\nconst mongoVectorCodec = vectorCodec();\n/**\n* A BSON `long`. The application value is a `bigint`, because a `number` cannot hold the full 64-bit range; its stored form is decimal text.\n*/\nconst mongoInt64Codec = mongoCodec({\n\ttypeId: MONGO_INT64_CODEC_ID,\n\tdataType: mongoInt64,\n\tfromWire: (wire) => int64Decode(MONGO_INT64_CODEC_ID, wire),\n\ttoWire: (value) => int64Encode(MONGO_INT64_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoInt64.valueFrom(int64ToJson(MONGO_INT64_CODEC_ID, value), {}),\n\tfromDataTypeValue: (value) => BigInt(value.value)\n});\n/**\n* A BSON `long` read and written as a `number` from -(2^53 - 1) to 2^53 - 1, the value a Prisma 6 `Int` presents. A value outside that range, or with a fraction, is refused rather than rounded.\n*/\nconst mongoInt64NumberCodec = mongoCodec({\n\ttypeId: MONGO_INT64_NUMBER_CODEC_ID,\n\tdataType: mongoInt64,\n\tfromWire: (wire) => int64NumberDecode(MONGO_INT64_NUMBER_CODEC_ID, wire),\n\ttoWire: (value) => int64NumberEncode(MONGO_INT64_NUMBER_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoInt64.valueFrom(int64NumberToJson(MONGO_INT64_NUMBER_CODEC_ID, value), {}),\n\tfromDataTypeValue: (value) => int64NumberFromDigits(MONGO_INT64_NUMBER_CODEC_ID, value.value)\n});\n/**\n* A BSON `decimal`. The application value and its stored form are the same decimal text, written without an exponent.\n*/\nconst mongoDecimal128Codec = mongoCodec({\n\ttypeId: MONGO_DECIMAL128_CODEC_ID,\n\tdataType: mongoDecimal128,\n\tfromWire: (wire) => decimal128Decode(MONGO_DECIMAL128_CODEC_ID, wire),\n\ttoWire: (value) => decimal128Encode(MONGO_DECIMAL128_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoDecimal128.valueFrom(decimal128ToJson(MONGO_DECIMAL128_CODEC_ID, value), {}),\n\tfromDataTypeValue: (value) => value.value\n});\n/**\n* BSON `binData`. The application value is a `Uint8Array`; its stored form is unwrapped base64.\n*/\nconst mongoBinaryCodec = mongoCodec({\n\ttypeId: MONGO_BINARY_CODEC_ID,\n\tdataType: mongoBinary,\n\tfromWire: (wire) => binaryDecode(MONGO_BINARY_CODEC_ID, wire),\n\ttoWire: (value) => binaryEncode(MONGO_BINARY_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoBinary.valueFrom(binaryToBase64(value), {}),\n\tfromDataTypeValue: (value) => binaryFromBase64(value.value)\n});\n/**\n* A JSON value, stored as the BSON object, array, string, number, boolean or null it maps to. Encode and decode refuse any other value at any depth, naming its path.\n*/\nconst mongoJsonCodec = mongoCodec({\n\ttypeId: MONGO_JSON_CODEC_ID,\n\tdataType: mongoJson,\n\tfromWire: (wire) => decodeJsonValue(wire),\n\ttoWire: (value) => encodeJsonValue(value)\n});\n/**\n* Any BSON value, passed through unchanged except that decode turns a `DBRef` back into the `{ $ref, $id }` document it was stored as. Encode takes a `BsonInputValue` and decode returns a `BsonValue`. Its stored form is canonical MongoDB Extended JSON v2, written with each number and `Uint8Array` as the BSON type the driver stores, so a round trip keeps the BSON bytes but may return wrapper classes such as `Int32` and `Double`.\n*/\nconst mongoBsonCodec = mongoCodec({\n\ttypeId: MONGO_BSON_CODEC_ID,\n\tdataType: mongoBson,\n\tfromWire: (wire) => decodeBsonValue(wire),\n\ttoWire: (value) => encodeBsonValue(value),\n\ttoDataTypeValue: (value) => mongoBson.valueFrom(bsonToJson(value), {}),\n\tfromDataTypeValue: (value) => readBsonJson(MONGO_BSON_CODEC_ID, value.value)\n});\n/**\n* Mongo wire-type codec descriptors. Static metadata such as `traits` lives here (the descriptor shape) — `MongoCodec` itself carries its data type and the four conversion methods (TML-2357).\n*/\nconst mongoCodecDescriptors = [\n\tmongoCodecDescriptor(mongoObjectIdCodec, { traits: [\"equality\"] }),\n\tmongoCodecDescriptor(mongoStringCodec, {\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"textual\"\n\t\t],\n\t\trenderValueLiteral: renderTsLiteral\n\t}),\n\tmongoCodecDescriptor(mongoDoubleCodec, {\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"numeric\"\n\t\t],\n\t\trenderValueLiteral: floatNumberLiteral\n\t}),\n\tmongoCodecDescriptor(mongoInt32Codec, {\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"numeric\"\n\t\t],\n\t\trenderValueLiteral: renderTsLiteral\n\t}),\n\tmongoCodecDescriptor(mongoBooleanCodec, {\n\t\ttraits: [\"equality\", \"boolean\"],\n\t\trenderValueLiteral: renderTsLiteral\n\t}),\n\tmongoCodecDescriptor(mongoDateCodec, { traits: [\"equality\", \"order\"] }),\n\tmongoCodecDescriptor(mongoVectorCodec, {\n\t\ttraits: [\"equality\"],\n\t\twithParams: vectorCodec\n\t}),\n\tmongoCodecDescriptor(mongoInt64Codec, {\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"numeric\"\n\t\t],\n\t\trenderValueLiteral: decimalTextBigintLiteral\n\t}),\n\tmongoCodecDescriptor(mongoInt64NumberCodec, {\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"numeric\"\n\t\t],\n\t\trenderValueLiteral: decimalTextNumberLiteral\n\t}),\n\tmongoCodecDescriptor(mongoDecimal128Codec, {\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"numeric\"\n\t\t],\n\t\tkeepsWrittenForm: true\n\t}),\n\tmongoCodecDescriptor(mongoBinaryCodec, { traits: [\"equality\"] }),\n\tmongoCodecDescriptor(mongoJsonCodec, { traits: [] }),\n\tmongoCodecDescriptor(mongoBsonCodec, { traits: [] }),\n\tmongoCodecDescriptor(mongoDateInstantCodec, { traits: [\"equality\", \"order\"] }),\n\tmongoCodecDescriptor(mongoDateInstantStringCodec, {\n\t\ttraits: [\"equality\", \"order\"],\n\t\trenderValueLiteral: renderTsLiteral\n\t}),\n\tmongoCodecDescriptor(mongoDateStringCodec, {\n\t\ttraits: [\"equality\", \"order\"],\n\t\trenderValueLiteral: renderTsLiteral\n\t}),\n\tmongoCodecDescriptor(mongoDateTemporalCodec, { traits: [\"equality\", \"order\"] }),\n\tmongoCodecDescriptor(mongoTimeStringCodec, {\n\t\ttraits: [\"equality\", \"order\"],\n\t\trenderValueLiteral: renderTsLiteral\n\t}),\n\tmongoCodecDescriptor(mongoTimeTemporalCodec, { traits: [\"equality\", \"order\"] }),\n\tmongoCodecDescriptor(mongoDurationStringCodec, {\n\t\ttraits: [\"equality\"],\n\t\trenderValueLiteral: renderTsLiteral\n\t})\n];\n/**\n* Lookup descriptor metadata by codec id — used by tests and for descriptor-side reads of static metadata.\n*/\nfunction mongoDescriptorById(codecId) {\n\treturn mongoCodecDescriptors.find((d) => d.codecId === codecId);\n}\n//#endregion\nexport { mongoDescriptorById as n, requireTemporal as r, mongoCodecDescriptors as t };\n\n//# sourceMappingURL=codecs-Bl21z49D.mjs.map"],"mappings":";;;;;;;;;;;AAWA,MAAM,2BAA2B;AACjC,SAAS,yBAAyB,SAAS,WAAW;CACrD,OAAO,iBAAiB,gCAAgC,UAAU,QAAQ,WAAW,UAAU,uEAAuE;EACrK,KAAK;EACL,KAAK;EACL,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF;AACA,SAAS,mCAAmC,aAAa;CACxD,OAAO,iBAAiB,gCAAgC,+BAA+B,YAAY,uFAAuF;EACzL,KAAK;EACL,KAAK;EACL,MAAM,EAAE,YAAY;CACrB,CAAC;AACF;AACA,SAAS,uBAAuB,SAAS,aAAa,YAAY,UAAU;CAC3E,OAAO,iBAAiB,yBAAyB,UAAU,QAAQ,cAAc,YAAY,iBAAiB,SAAS,IAAI;EAC1H,KAA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CAAC;CAC7E,qBAAqB,6BAA6B;EACjD,QAAQ,CAAC,YAAY,OAAO;EAC5B,oBAAoB;CACrB,CAAC;CACD,qBAAqB,sBAAsB;EAC1C,QAAQ,CAAC,YAAY,OAAO;EAC5B,oBAAoB;CACrB,CAAC;CACD,qBAAqB,wBAAwB,EAAE,QAAQ,CAAC,YAAY,OAAO,EAAE,CAAC;CAC9E,qBAAqB,sBAAsB;EAC1C,QAAQ,CAAC,YAAY,OAAO;EAC5B,oBAAoB;CACrB,CAAC;CACD,qBAAqB,wBAAwB,EAAE,QAAQ,CAAC,YAAY,OAAO,EAAE,CAAC;CAC9E,qBAAqB,0BAA0B;EAC9C,QAAQ,CAAC,UAAU;EACnB,oBAAoB;CACrB,CAAC;AACF;;;;AAIA,SAAS,oBAAoB,SAAS;CACrC,OAAO,sBAAsB,MAAM,MAAM,EAAE,YAAY,OAAO;AAC/D"}
|
|
1
|
+
{"version":3,"file":"codecs-DB6ji3ee-BzMiSM6G.mjs","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/codecs-DB6ji3ee.mjs"],"sourcesContent":["import { _ as MONGO_STRING_CODEC_ID, a as MONGO_DATE_INSTANT_CODEC_ID, b as MONGO_VECTOR_CODEC_ID, c as MONGO_DATE_TEMPORAL_CODEC_ID, d as MONGO_DURATION_STRING_CODEC_ID, f as MONGO_INT32_CODEC_ID, g as MONGO_OBJECTID_CODEC_ID, h as MONGO_JSON_CODEC_ID, i as MONGO_DATE_CODEC_ID, l as MONGO_DECIMAL128_CODEC_ID, m as MONGO_INT64_NUMBER_CODEC_ID, n as MONGO_BOOLEAN_CODEC_ID, o as MONGO_DATE_INSTANT_STRING_CODEC_ID, p as MONGO_INT64_CODEC_ID, r as MONGO_BSON_CODEC_ID, s as MONGO_DATE_STRING_CODEC_ID, t as MONGO_BINARY_CODEC_ID, u as MONGO_DOUBLE_CODEC_ID, v as MONGO_TIME_STRING_CODEC_ID, y as MONGO_TIME_TEMPORAL_CODEC_ID } from \"./codec-ids-DZQsuh80.mjs\";\nimport { t as mongoTargetError } from \"./mongo-target-errors-Btf3ML1w.mjs\";\nimport { $ as int64NumberFromDigits, A as constructorName, B as dateEncode, C as bsonToJson, D as bsonClassTag, E as readBsonJson, F as binaryDecode, G as decimal128ToJson, H as decimal128Decode, I as binaryEncode, J as int32ToJson, K as doubleEncode, L as binaryFromBase64, M as isPlainArray, N as isPlainObject, O as bsonTypeTag, P as where, Q as int64NumberEncode, R as binaryToBase64, T as encodeBsonValue, U as decimal128Encode, V as dateToJson, X as int64Encode, Y as int64Decode, Z as int64NumberDecode, _ as mongoString, a as mongoCalendarDateText, at as stringEncode, b as mongoTimeText, c as mongoDecimal128, d as mongoDurationText, et as int64NumberToJson, f as mongoInstantText, g as mongoObjectId, h as mongoJson, i as mongoCalendarDate, it as objectIdToJson, j as dbRefEntries, k as child, l as mongoDouble, m as mongoInt64, n as mongoBool, ot as vectorEncode, p as mongoInt32, q as int32Encode, r as mongoBson, rt as objectIdEncode, s as mongoDate, t as mongoBinary, tt as int64ToJson, u as mongoDuration, w as decodeBsonValue, x as mongoVector, y as mongoTime, z as booleanEncode } from \"./data-types-BR7vssy0.mjs\";\nimport { decimalTextBigintLiteral, decimalTextNumberLiteral, floatNumberLiteral, floatToJson, readJsonFloat, renderTsLiteral } from \"@internal/framework-components/codec\";\nimport { hasDigitsBelowAMillisecond, isValidDate } from \"@internal/type-implementations/date\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { findTemporal } from \"@internal/type-implementations/temporal\";\nimport { mongoCodec, mongoCodecDescriptor } from \"@internal/mongo-codec\";\nimport { describeValue, temporalFromText, temporalToText } from \"@internal/type-implementations/temporal-text\";\n//#region src/core/date-time-errors.ts\nconst TEMPORAL_UNAVAILABLE_FIX = \"Run on a runtime with Temporal available, install a Temporal polyfill before creating the client, or write the field as a convenience type at its default, which needs no Temporal: `DateTime` reads a JavaScript `Date`, and `Date`, `Time` and `Duration` read ISO 8601 strings.\";\nfunction errorTemporalUnavailable(codecId, operation) {\n\treturn mongoTargetError(\"RUNTIME.TEMPORAL_UNAVAILABLE\", `Codec '${codecId}' cannot ${operation} a value because this runtime has no global Temporal implementation.`, {\n\t\twhy: \"Temporal-backed codecs read and write their values through the global Temporal API, which this runtime does not provide.\",\n\t\tfix: TEMPORAL_UNAVAILABLE_FIX,\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\toperation\n\t\t}\n\t});\n}\nfunction errorTemporalUnavailableForDefault(generatorId) {\n\treturn mongoTargetError(\"RUNTIME.TEMPORAL_UNAVAILABLE\", `Mutation default generator '${generatorId}' cannot produce a value because this runtime has no global Temporal implementation.`, {\n\t\twhy: \"The generator answers a Temporal-backed field, so the value it produces is a Temporal value, which this runtime cannot construct.\",\n\t\tfix: TEMPORAL_UNAVAILABLE_FIX,\n\t\tmeta: { generatorId }\n\t});\n}\nfunction errorTemporalWrongType(codecId, temporalTag, stringType, received) {\n\treturn mongoTargetError(\"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' encodes a ${temporalTag}, but received ${received}.`, {\n\t\twhy: \"The codec writes the value a Temporal value names. A value of another type names none the field holds.\",\n\t\tfix: `Pass a ${temporalTag}, or author the field with its ${stringType} type to write ISO 8601 text.`,\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\ttemporalTag,\n\t\t\tstringType,\n\t\t\treceived\n\t\t}\n\t});\n}\nfunction errorTemporalNonIsoCalendar(codecId, calendarId) {\n\treturn mongoTargetError(\"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' accepts only the iso8601 calendar, but the value carries '${calendarId}'.`, {\n\t\twhy: \"MongoDB stores no calendar alongside a date, so a non-ISO calendar would be discarded on write and the value would read back as a different date than the one authored.\",\n\t\tfix: \"Convert the value with .withCalendar(\\\"iso8601\\\") before writing if the ISO projection is what you mean to store.\",\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\tcalendarId\n\t\t}\n\t});\n}\n/** A date or time codec read a value from MongoDB that is not a value of its type, or that `Temporal` cannot hold. */\nfunction errorDateTimeUnreadable(options) {\n\tconst { codecId, value, detail } = options;\n\treturn mongoTargetError(\"RUNTIME.DECODE_FAILED\", `Codec '${codecId}' cannot read ${value}: ${detail}`, {\n\t\twhy: \"MongoDB checks no form for a BSON date or string beyond its BSON type, so a document written outside Prisma can hold a value that is not a value of the field’s type.\",\n\t\tfix: \"Rewrite the document in the form the field stores, or read the field with a type that holds what it stores, such as DateTime for a BSON date or String for a BSON string.\",\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\tvalue: value.slice(0, 100)\n\t\t},\n\t\t...ifDefined(\"cause\", options.cause)\n\t});\n}\n/** A date or time codec was given a value that names no value its type stores, such as text with a digit below a millisecond. */\nfunction errorDateTimeUnwritable(options) {\n\tconst { codecId, received, detail } = options;\n\treturn mongoTargetError(\"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' cannot write ${received}. ${detail}`, {\n\t\twhy: \"A BSON date holds milliseconds, a calendar date is stored at midnight UTC, and a time of day as a string with three fraction digits. A value that form cannot hold is refused rather than changed.\",\n\t\tfix: \"Write a value the field holds, as the message shows.\",\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\treceived: received.slice(0, 100)\n\t\t},\n\t\t...ifDefined(\"cause\", options.cause)\n\t});\n}\n//#endregion\n//#region src/core/require-temporal.ts\n/**\n* The `Temporal` to use: the runtime's own when it has one, else the fallback. Throws\n* `RUNTIME.TEMPORAL_UNAVAILABLE` when there is neither.\n*/\nfunction requireTemporal(meta) {\n\tconst temporal = findTemporal();\n\tif (temporal !== void 0) return temporal;\n\tthrow \"generatorId\" in meta ? errorTemporalUnavailableForDefault(meta.generatorId) : errorTemporalUnavailable(meta.codecId, meta.operation);\n}\n//#endregion\n//#region src/core/date-time-values.ts\nconst MILLISECONDS_PER_DAY = 864e5;\nfunction messageOf(cause) {\n\treturn cause instanceof Error ? cause.message : String(cause);\n}\n/** The text a write stores for `value`, in the form `stored` writes; a value `stored` refuses is refused as `RUNTIME.ENCODE_FAILED`. */\nfunction storedTextForWrite(codecId, value, stored) {\n\tif (typeof value !== \"string\") throw errorDateTimeUnwritable({\n\t\tcodecId,\n\t\treceived: describeValue(value),\n\t\tdetail: \"It writes ISO 8601 text.\"\n\t});\n\ttry {\n\t\treturn stored(value);\n\t} catch (cause) {\n\t\tthrow errorDateTimeUnwritable({\n\t\t\tcodecId,\n\t\t\treceived: JSON.stringify(value),\n\t\t\tdetail: messageOf(cause),\n\t\t\tcause\n\t\t});\n\t}\n}\n/** The stored form of a BSON string MongoDB returned, as `stored` reads it; text `stored` refuses is refused as `RUNTIME.DECODE_FAILED`. */\nfunction storedTextFromWire(codecId, wire, stored) {\n\tif (typeof wire !== \"string\") throw errorDateTimeUnreadable({\n\t\tcodecId,\n\t\tvalue: String(wire),\n\t\tdetail: `MongoDB returned ${describeValue(wire)}, not a string.`\n\t});\n\ttry {\n\t\treturn stored(wire);\n\t} catch (cause) {\n\t\tthrow errorDateTimeUnreadable({\n\t\t\tcodecId,\n\t\t\tvalue: JSON.stringify(wire),\n\t\t\tdetail: messageOf(cause),\n\t\t\tcause\n\t\t});\n\t}\n}\n/** The BSON date MongoDB returned, as the `Date` the driver reads it as. */\nfunction dateFromWire(codecId, wire) {\n\tif (isValidDate(wire)) return wire;\n\tthrow errorDateTimeUnreadable({\n\t\tcodecId,\n\t\tvalue: String(wire),\n\t\tdetail: `MongoDB returned ${describeValue(wire)}, not a BSON date.`\n\t});\n}\n/** Whether `date` is at midnight UTC, the form a calendar date is stored in. */\nfunction isAtMidnightUtc(date) {\n\treturn date.getTime() % MILLISECONDS_PER_DAY === 0;\n}\n/** The date part of `date` in UTC, as in `2024-02-29`, for a `Date` at midnight UTC. */\nfunction calendarDateTextOf(date) {\n\tconst iso = date.toISOString();\n\treturn iso.slice(0, iso.indexOf(\"T\"));\n}\n/** The calendar date a BSON date at midnight UTC holds, as in `2024-02-29`. A BSON date at another time is refused, so a field written as an instant is never read as a date. */\nfunction calendarDateFromWire(codecId, wire) {\n\tconst date = dateFromWire(codecId, wire);\n\tif (isAtMidnightUtc(date)) return calendarDateTextOf(date);\n\tthrow errorDateTimeUnreadable({\n\t\tcodecId,\n\t\tvalue: date.toISOString(),\n\t\tdetail: \"a calendar date is stored as a BSON date at midnight UTC. A field that holds a time of day is a DateTime.\"\n\t});\n}\n/** The BSON date at midnight UTC that stores the calendar date `text`, as in `2024-02-29`. */\nfunction midnightUtcOf(text) {\n\treturn /* @__PURE__ */ new Date(`${text}T00:00:00.000Z`);\n}\n/** The Temporal value that stored text names, read with `parse`. */\nfunction temporalFromStoredText(identity, text, parse) {\n\tconst read = temporalFromText(requireTemporal({\n\t\tcodecId: identity.codecId,\n\t\toperation: \"decode\"\n\t}), text, parse);\n\tif (read.kind === \"unreadable\") throw errorDateTimeUnreadable({\n\t\tcodecId: identity.codecId,\n\t\tvalue: JSON.stringify(text),\n\t\tdetail: `${identity.temporalTag} cannot hold it: ${read.detail}. Use ${identity.stringType} to read the field as text.`,\n\t\tcause: read.cause\n\t});\n\treturn read.value;\n}\n/** The text a write stores for a Temporal value, in the form `stored` writes. A value of another kind, in a calendar other than ISO 8601, or with digits below a millisecond is refused. */\nfunction storedTextOfTemporal(identity, value, stored) {\n\tconst encoded = temporalToText(value, identity.temporalTag);\n\tswitch (encoded.kind) {\n\t\tcase \"wrong-type\": throw errorTemporalWrongType(identity.codecId, identity.temporalTag, identity.stringType, encoded.received);\n\t\tcase \"non-iso-calendar\": throw errorTemporalNonIsoCalendar(identity.codecId, encoded.calendarId);\n\t\tcase \"text\":\n\t\t\tif (hasDigitsBelowAMillisecond(encoded.text)) throw errorDateTimeUnwritable({\n\t\t\t\tcodecId: identity.codecId,\n\t\t\t\treceived: `the ${identity.temporalTag} ${encoded.text}`,\n\t\t\t\tdetail: \"It has digits below a millisecond, and the field holds milliseconds. Round it first, as in value.round({ smallestUnit: 'millisecond', roundingMode: 'trunc' }).\"\n\t\t\t});\n\t\t\treturn storedTextForWrite(identity.codecId, encoded.text, stored);\n\t}\n}\n//#endregion\n//#region src/core/date-time-codecs.ts\nconst INSTANT = {\n\tcodecId: MONGO_DATE_INSTANT_CODEC_ID,\n\ttemporalTag: \"Temporal.Instant\",\n\tstringType: \"DateInstantString\"\n};\nconst PLAIN_DATE = {\n\tcodecId: MONGO_DATE_TEMPORAL_CODEC_ID,\n\ttemporalTag: \"Temporal.PlainDate\",\n\tstringType: \"DateString\"\n};\nconst PLAIN_TIME = {\n\tcodecId: MONGO_TIME_TEMPORAL_CODEC_ID,\n\ttemporalTag: \"Temporal.PlainTime\",\n\tstringType: \"TimeString\"\n};\nconst instantText = (value) => storedTextOfTemporal(INSTANT, value, mongoInstantText);\nconst plainDateText = (value) => storedTextOfTemporal(PLAIN_DATE, value, mongoCalendarDateText);\nconst plainTimeText = (value) => storedTextOfTemporal(PLAIN_TIME, value, mongoTimeText);\n/** An instant, stored as a BSON date and read as `Temporal.Instant`. */\nconst mongoDateInstantCodec = mongoCodec({\n\ttypeId: MONGO_DATE_INSTANT_CODEC_ID,\n\tdataType: mongoDate,\n\tfromWire: (wire) => temporalFromStoredText(INSTANT, dateFromWire(MONGO_DATE_INSTANT_CODEC_ID, wire).toISOString(), (temporal, text) => temporal.Instant.from(text)),\n\ttoWire: (value) => new Date(instantText(value)),\n\ttoDataTypeValue: (value) => mongoDate.valueFrom(instantText(value), {}),\n\tfromDataTypeValue: (value) => temporalFromStoredText(INSTANT, value.value, (temporal, text) => temporal.Instant.from(text))\n});\n/** An instant, stored as a BSON date and read as the text `Date.toISOString()` writes, `2024-01-01T00:00:00.000Z`. A write takes ISO 8601 text with any UTC offset. */\nconst mongoDateInstantStringCodec = mongoCodec({\n\ttypeId: MONGO_DATE_INSTANT_STRING_CODEC_ID,\n\tdataType: mongoDate,\n\tfromWire: (wire) => dateFromWire(MONGO_DATE_INSTANT_STRING_CODEC_ID, wire).toISOString(),\n\ttoWire: (value) => new Date(storedTextForWrite(MONGO_DATE_INSTANT_STRING_CODEC_ID, value, mongoInstantText)),\n\ttoDataTypeValue: (value) => mongoDate.valueFrom(storedTextForWrite(MONGO_DATE_INSTANT_STRING_CODEC_ID, value, mongoInstantText), {}),\n\tfromDataTypeValue: (value) => value.value\n});\n/** A calendar date, stored as a BSON date at midnight UTC and read as `2024-02-29`. */\nconst mongoDateStringCodec = mongoCodec({\n\ttypeId: MONGO_DATE_STRING_CODEC_ID,\n\tdataType: mongoCalendarDate,\n\tfromWire: (wire) => calendarDateFromWire(MONGO_DATE_STRING_CODEC_ID, wire),\n\ttoWire: (value) => midnightUtcOf(storedTextForWrite(MONGO_DATE_STRING_CODEC_ID, value, mongoCalendarDateText)),\n\ttoDataTypeValue: (value) => mongoCalendarDate.valueFrom(storedTextForWrite(MONGO_DATE_STRING_CODEC_ID, value, mongoCalendarDateText), {}),\n\tfromDataTypeValue: (value) => value.value\n});\n/** A calendar date, stored as a BSON date at midnight UTC and read as `Temporal.PlainDate`. */\nconst mongoDateTemporalCodec = mongoCodec({\n\ttypeId: MONGO_DATE_TEMPORAL_CODEC_ID,\n\tdataType: mongoCalendarDate,\n\tfromWire: (wire) => temporalFromStoredText(PLAIN_DATE, calendarDateFromWire(MONGO_DATE_TEMPORAL_CODEC_ID, wire), (temporal, text) => temporal.PlainDate.from(text)),\n\ttoWire: (value) => midnightUtcOf(plainDateText(value)),\n\ttoDataTypeValue: (value) => mongoCalendarDate.valueFrom(plainDateText(value), {}),\n\tfromDataTypeValue: (value) => temporalFromStoredText(PLAIN_DATE, value.value, (temporal, text) => temporal.PlainDate.from(text))\n});\n/** A time of day, stored as a BSON string and read as that string, `09:30:00.000`. A write pads a string with fewer fraction digits to three. */\nconst mongoTimeStringCodec = mongoCodec({\n\ttypeId: MONGO_TIME_STRING_CODEC_ID,\n\tdataType: mongoTime,\n\tfromWire: (wire) => storedTextFromWire(MONGO_TIME_STRING_CODEC_ID, wire, mongoTimeText),\n\ttoWire: (value) => storedTextForWrite(MONGO_TIME_STRING_CODEC_ID, value, mongoTimeText),\n\ttoDataTypeValue: (value) => mongoTime.valueFrom(storedTextForWrite(MONGO_TIME_STRING_CODEC_ID, value, mongoTimeText), {}),\n\tfromDataTypeValue: (value) => value.value\n});\n/** A time of day, stored as a BSON string, `09:30:00.000`, and read as `Temporal.PlainTime`. */\nconst mongoTimeTemporalCodec = mongoCodec({\n\ttypeId: MONGO_TIME_TEMPORAL_CODEC_ID,\n\tdataType: mongoTime,\n\tfromWire: (wire) => temporalFromStoredText(PLAIN_TIME, storedTextFromWire(MONGO_TIME_TEMPORAL_CODEC_ID, wire, mongoTimeText), (temporal, text) => temporal.PlainTime.from(text)),\n\ttoWire: (value) => plainTimeText(value),\n\ttoDataTypeValue: (value) => mongoTime.valueFrom(plainTimeText(value), {}),\n\tfromDataTypeValue: (value) => temporalFromStoredText(PLAIN_TIME, value.value, (temporal, text) => temporal.PlainTime.from(text))\n});\n/** A length of time, stored as a BSON string and read as the ISO 8601 duration it was written as, `PT1H30M`. */\nconst mongoDurationStringCodec = mongoCodec({\n\ttypeId: MONGO_DURATION_STRING_CODEC_ID,\n\tdataType: mongoDuration,\n\tfromWire: (wire) => storedTextFromWire(MONGO_DURATION_STRING_CODEC_ID, wire, mongoDurationText),\n\ttoWire: (value) => storedTextForWrite(MONGO_DURATION_STRING_CODEC_ID, value, mongoDurationText),\n\tfromDataTypeValue: (value) => value.value\n});\n//#endregion\n//#region src/core/json-codec-helpers.ts\nconst BSON_TYPE_BY_TAG = {\n\tObjectId: \"objectId\",\n\tDecimal128: \"decimal\",\n\tBinary: \"binData\",\n\tBSONRegExp: \"regex\",\n\tTimestamp: \"timestamp\",\n\tBSONSymbol: \"symbol\",\n\tCode: \"javascript\",\n\tMinKey: \"minKey\",\n\tMaxKey: \"maxKey\"\n};\nconst NOT_FINITE_FIX = \"JSON has no NaN or Infinity; store null or a string, or declare the field Bson.\";\nconst BSON_FIX = \"Declare the field Bson to store BSON values.\";\nconst PLAIN_VALUE_FIX = \"Convert it to a plain object or array.\";\nconst ENCODE_FIX_BY_RECEIVED = {\n\tDate: \"Store the date as an ISO 8601 string, or declare the field Bson.\",\n\tbigint: \"Store it as a number in the safe-integer range or as decimal text, or declare the field Int64 or Bson.\",\n\tNaN: NOT_FINITE_FIX,\n\tInfinity: NOT_FINITE_FIX,\n\t\"-Infinity\": NOT_FINITE_FIX,\n\tundefined: \"Leave the key out, or store null.\",\n\tUint8Array: \"Store the bytes as a base64 string, or declare the field Binary or Bson.\",\n\tBuffer: \"Store the bytes as a base64 string, or declare the field Binary or Bson.\",\n\tBinary: \"Store the bytes as a base64 string, or declare the field Binary or Bson.\",\n\tObjectId: \"Store its hex string, or declare the field ObjectId or Bson.\",\n\tLong: \"Store a number in the safe-integer range or decimal text, or declare the field Int64 or Bson.\",\n\tDecimal128: \"Store the decimal text, or declare the field Decimal128 or Bson.\",\n\tInt32: \"Pass a plain number.\",\n\tDouble: \"Pass a plain number.\",\n\tRegExp: \"Store the pattern as a string, or declare the field Bson.\",\n\tBSONRegExp: \"Store the pattern as a string, or declare the field Bson.\",\n\tsymbol: \"Store a string instead.\",\n\tfunction: \"Store data, not a function.\",\n\t\"circular reference\": \"Remove the cycle; a JSON value is a tree.\",\n\t\"sparse array hole\": \"Fill the hole with null.\",\n\tDBRef: \"Write it as a { $ref, $id } document instead.\"\n};\nfunction encodeFix(received) {\n\treturn ENCODE_FIX_BY_RECEIVED[received] ?? (Object.hasOwn(BSON_TYPE_BY_TAG, received) ? BSON_FIX : PLAIN_VALUE_FIX);\n}\nfunction encodeRefused(received, path) {\n\tthrow mongoTargetError(\"RUNTIME.ENCODE_FAILED\", `${MONGO_JSON_CODEC_ID} value must be a JSON value; received ${received} at ${where(path)}. ${encodeFix(received)}`, { meta: {\n\t\tcodecId: MONGO_JSON_CODEC_ID,\n\t\treceived,\n\t\tvaluePath: path\n\t} });\n}\nfunction describeNonJson(value) {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return void 0;\n\tif (typeof value === \"number\") return Number.isFinite(value) ? void 0 : String(value);\n\tif (typeof value !== \"object\") return typeof value;\n\tconst tag = bsonTypeTag(value);\n\tif (tag !== void 0) return tag;\n\tif (value instanceof Date) return \"Date\";\n\tif (isPlainArray(value)) return void 0;\n\treturn isPlainObject(value) ? void 0 : constructorName(value);\n}\nfunction assertJsonValue(value, path, ancestors) {\n\tconst received = describeNonJson(value);\n\tif (received !== void 0) encodeRefused(received, path);\n\tif (typeof value !== \"object\" || value === null) return;\n\tif (ancestors.has(value)) encodeRefused(\"circular reference\", path);\n\tancestors.add(value);\n\tif (Array.isArray(value)) for (let index = 0; index < value.length; index++) {\n\t\tif (!(index in value)) encodeRefused(\"sparse array hole\", child(path, index));\n\t\tassertJsonValue(value[index], child(path, index), ancestors);\n\t}\n\telse for (const [key, entry] of Object.entries(value)) assertJsonValue(entry, child(path, key), ancestors);\n\tancestors.delete(value);\n}\n/**\n* Returns `value` unchanged when it is a plain JSON value at every depth, and throws `RUNTIME.ENCODE_FAILED` naming the first value that is not, with its path.\n*/\nfunction encodeJsonValue(value) {\n\tassertJsonValue(value, \"\", /* @__PURE__ */ new Set());\n\treturn value;\n}\nfunction decodeRefused(bsonType, path) {\n\tthrow mongoTargetError(\"RUNTIME.DECODE_FAILED\", `${MONGO_JSON_CODEC_ID} wire value contains a non-JSON BSON ${bsonType} at ${where(path)}`, { meta: {\n\t\tcodecId: MONGO_JSON_CODEC_ID,\n\t\treceived: bsonType,\n\t\tvaluePath: path\n\t} });\n}\nfunction safeLong(value, path) {\n\tconst number = Number(value);\n\treturn Number.isSafeInteger(number) && BigInt(number) === value ? number : decodeRefused(\"long\", path);\n}\nfunction finiteDouble(value, path) {\n\tif (Number.isFinite(value)) return value;\n\tconst received = String(value);\n\tthrow mongoTargetError(\"RUNTIME.DECODE_FAILED\", `${MONGO_JSON_CODEC_ID} wire value contains ${received} at ${where(path)}; a JSON number cannot be NaN or Infinity`, { meta: {\n\t\tcodecId: MONGO_JSON_CODEC_ID,\n\t\treceived,\n\t\tvaluePath: path\n\t} });\n}\nfunction decodeEntries(entries, path) {\n\treturn Object.fromEntries(entries.map(([key, entry]) => [key, decodeValue(entry, child(path, key))]));\n}\nfunction decodeTagged(value, tag, path) {\n\tswitch (tag) {\n\t\tcase \"DBRef\": return decodeEntries(dbRefEntries(value), path);\n\t\tcase \"Long\": return safeLong(blindCast(value).toBigInt(), path);\n\t\tcase \"Int32\":\n\t\tcase \"Double\": return finiteDouble(Number(value.valueOf()), path);\n\t}\n\treturn decodeRefused(BSON_TYPE_BY_TAG[tag] ?? tag, path);\n}\nfunction decodeValue(value, path) {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return value;\n\tif (typeof value === \"number\") return finiteDouble(value, path);\n\tif (typeof value === \"bigint\") return safeLong(value, path);\n\tif (typeof value === \"undefined\") return decodeRefused(\"undefined\", path);\n\tif (typeof value === \"symbol\") return decodeRefused(\"symbol\", path);\n\tif (typeof value === \"function\") return decodeRefused(\"javascript\", path);\n\tconst tag = bsonClassTag(value);\n\tif (tag !== void 0) return decodeTagged(value, tag, path);\n\tif (value instanceof Date) return decodeRefused(\"date\", path);\n\tif (value instanceof RegExp) return decodeRefused(\"regex\", path);\n\tif (value instanceof Uint8Array) return decodeRefused(\"binData\", path);\n\tif (Array.isArray(value)) {\n\t\tconst decoded = value.map((entry, index) => decodeValue(entry, child(path, index)));\n\t\treturn decoded.some((entry, index) => entry !== value[index]) ? decoded : value;\n\t}\n\tif (!isPlainObject(value)) return decodeRefused(constructorName(value), path);\n\tconst entries = Object.entries(value);\n\tconst decoded = decodeEntries(entries, path);\n\treturn entries.some(([key, entry]) => decoded[key] !== entry) ? decoded : blindCast(value);\n}\n/**\n* Decodes a wire value to the JSON value it holds: a `long` in the safe-integer range and the driver's `Int32` and `Double` wrappers become numbers. Only the objects and arrays around a converted value are copied; a wire value that is already JSON is returned as the same object. Throws `RUNTIME.DECODE_FAILED` naming the BSON type and path of the first value that is not JSON.\n*/\nfunction decodeJsonValue(wire) {\n\treturn decodeValue(wire, \"\");\n}\n//#endregion\n//#region src/core/codecs.ts\nconst mongoObjectIdCodec = mongoCodec({\n\ttypeId: MONGO_OBJECTID_CODEC_ID,\n\tdataType: mongoObjectId,\n\tfromWire: (wire) => wire.toHexString(),\n\ttoWire: (value) => objectIdEncode(MONGO_OBJECTID_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoObjectId.valueFrom(objectIdToJson(MONGO_OBJECTID_CODEC_ID, value), {}),\n\tfromDataTypeValue: (value) => value.value\n});\nconst mongoStringCodec = mongoCodec({\n\ttypeId: MONGO_STRING_CODEC_ID,\n\tdataType: mongoString,\n\tfromWire: (wire) => wire,\n\ttoWire: (value) => stringEncode(MONGO_STRING_CODEC_ID, value),\n\tfromDataTypeValue: (value) => value.value\n});\nconst mongoDoubleCodec = mongoCodec({\n\ttypeId: MONGO_DOUBLE_CODEC_ID,\n\tdataType: mongoDouble,\n\tfromWire: (wire) => Number(wire),\n\ttoWire: (value) => doubleEncode(MONGO_DOUBLE_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoDouble.valueFrom(floatToJson(value), {}),\n\tfromDataTypeValue: (value) => readJsonFloat(MONGO_DOUBLE_CODEC_ID, value.value)\n});\nconst mongoInt32Codec = mongoCodec({\n\ttypeId: MONGO_INT32_CODEC_ID,\n\tdataType: mongoInt32,\n\tfromWire: (wire) => wire,\n\ttoWire: (value) => int32Encode(MONGO_INT32_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoInt32.valueFrom(int32ToJson(MONGO_INT32_CODEC_ID, value), {}),\n\tfromDataTypeValue: (value) => value.value\n});\nconst mongoBooleanCodec = mongoCodec({\n\ttypeId: MONGO_BOOLEAN_CODEC_ID,\n\tdataType: mongoBool,\n\tfromWire: (wire) => wire,\n\ttoWire: (value) => booleanEncode(MONGO_BOOLEAN_CODEC_ID, value),\n\tfromDataTypeValue: (value) => value.value\n});\nconst mongoDateCodec = mongoCodec({\n\ttypeId: MONGO_DATE_CODEC_ID,\n\tdataType: mongoDate,\n\tfromWire: (wire) => wire,\n\ttoWire: (value) => dateEncode(MONGO_DATE_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoDate.valueFrom(dateToJson(MONGO_DATE_CODEC_ID, value), {}),\n\tfromDataTypeValue: (value) => new Date(value.value)\n});\n/** The vector codec for a column of `mongo/vector` with `params`. The dimension reaches only the TypeScript type `Vector<n>`. */\nfunction vectorCodec(params) {\n\treturn mongoCodec({\n\t\ttypeId: MONGO_VECTOR_CODEC_ID,\n\t\tdataType: mongoVector,\n\t\t...ifDefined(\"params\", params),\n\t\tfromWire: (wire) => wire,\n\t\ttoWire: (value) => vectorEncode(MONGO_VECTOR_CODEC_ID, value),\n\t\tfromDataTypeValue: (value) => value.value\n\t});\n}\nconst mongoVectorCodec = vectorCodec();\n/**\n* A BSON `long`. The application value is a `bigint`, because a `number` cannot hold the full 64-bit range; its stored form is decimal text.\n*/\nconst mongoInt64Codec = mongoCodec({\n\ttypeId: MONGO_INT64_CODEC_ID,\n\tdataType: mongoInt64,\n\tfromWire: (wire) => int64Decode(MONGO_INT64_CODEC_ID, wire),\n\ttoWire: (value) => int64Encode(MONGO_INT64_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoInt64.valueFrom(int64ToJson(MONGO_INT64_CODEC_ID, value), {}),\n\tfromDataTypeValue: (value) => BigInt(value.value)\n});\n/**\n* A BSON `long` read and written as a `number` from -(2^53 - 1) to 2^53 - 1, the value a Prisma 6 `Int` presents. A value outside that range, or with a fraction, is refused rather than rounded.\n*/\nconst mongoInt64NumberCodec = mongoCodec({\n\ttypeId: MONGO_INT64_NUMBER_CODEC_ID,\n\tdataType: mongoInt64,\n\tfromWire: (wire) => int64NumberDecode(MONGO_INT64_NUMBER_CODEC_ID, wire),\n\ttoWire: (value) => int64NumberEncode(MONGO_INT64_NUMBER_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoInt64.valueFrom(int64NumberToJson(MONGO_INT64_NUMBER_CODEC_ID, value), {}),\n\tfromDataTypeValue: (value) => int64NumberFromDigits(MONGO_INT64_NUMBER_CODEC_ID, value.value)\n});\n/**\n* A BSON `decimal`. The application value and its stored form are the same decimal text, written without an exponent.\n*/\nconst mongoDecimal128Codec = mongoCodec({\n\ttypeId: MONGO_DECIMAL128_CODEC_ID,\n\tdataType: mongoDecimal128,\n\tfromWire: (wire) => decimal128Decode(MONGO_DECIMAL128_CODEC_ID, wire),\n\ttoWire: (value) => decimal128Encode(MONGO_DECIMAL128_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoDecimal128.valueFrom(decimal128ToJson(MONGO_DECIMAL128_CODEC_ID, value), {}),\n\tfromDataTypeValue: (value) => value.value\n});\n/**\n* BSON `binData`. The application value is a `Uint8Array`; its stored form is unwrapped base64.\n*/\nconst mongoBinaryCodec = mongoCodec({\n\ttypeId: MONGO_BINARY_CODEC_ID,\n\tdataType: mongoBinary,\n\tfromWire: (wire) => binaryDecode(MONGO_BINARY_CODEC_ID, wire),\n\ttoWire: (value) => binaryEncode(MONGO_BINARY_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoBinary.valueFrom(binaryToBase64(value), {}),\n\tfromDataTypeValue: (value) => binaryFromBase64(value.value)\n});\n/**\n* A JSON value, stored as the BSON object, array, string, number, boolean or null it maps to. Encode and decode refuse any other value at any depth, naming its path.\n*/\nconst mongoJsonCodec = mongoCodec({\n\ttypeId: MONGO_JSON_CODEC_ID,\n\tdataType: mongoJson,\n\tfromWire: (wire) => decodeJsonValue(wire),\n\ttoWire: (value) => encodeJsonValue(value)\n});\n/**\n* Any BSON value, passed through unchanged except that decode turns a `DBRef` back into the `{ $ref, $id }` document it was stored as. Encode takes a `BsonInputValue` and decode returns a `BsonValue`. Its stored form is canonical MongoDB Extended JSON v2, written with each number and `Uint8Array` as the BSON type the driver stores, so a round trip keeps the BSON bytes but may return wrapper classes such as `Int32` and `Double`.\n*/\nconst mongoBsonCodec = mongoCodec({\n\ttypeId: MONGO_BSON_CODEC_ID,\n\tdataType: mongoBson,\n\tfromWire: (wire) => decodeBsonValue(wire),\n\ttoWire: (value) => encodeBsonValue(value),\n\ttoDataTypeValue: (value) => mongoBson.valueFrom(bsonToJson(value), {}),\n\tfromDataTypeValue: (value) => readBsonJson(MONGO_BSON_CODEC_ID, value.value)\n});\n/**\n* Mongo wire-type codec descriptors. Static metadata such as `traits` lives here (the descriptor shape) — `MongoCodec` itself carries its data type and the four conversion methods (TML-2357).\n*/\nconst mongoCodecDescriptors = [\n\tmongoCodecDescriptor(mongoObjectIdCodec, { traits: [\"equality\"] }),\n\tmongoCodecDescriptor(mongoStringCodec, {\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"textual\"\n\t\t],\n\t\trenderValueLiteral: renderTsLiteral\n\t}),\n\tmongoCodecDescriptor(mongoDoubleCodec, {\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"numeric\"\n\t\t],\n\t\trenderValueLiteral: floatNumberLiteral\n\t}),\n\tmongoCodecDescriptor(mongoInt32Codec, {\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"numeric\"\n\t\t],\n\t\trenderValueLiteral: renderTsLiteral\n\t}),\n\tmongoCodecDescriptor(mongoBooleanCodec, {\n\t\ttraits: [\"equality\", \"boolean\"],\n\t\trenderValueLiteral: renderTsLiteral\n\t}),\n\tmongoCodecDescriptor(mongoDateCodec, { traits: [\"equality\", \"order\"] }),\n\tmongoCodecDescriptor(mongoVectorCodec, {\n\t\ttraits: [\"equality\"],\n\t\twithParams: vectorCodec\n\t}),\n\tmongoCodecDescriptor(mongoInt64Codec, {\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"numeric\"\n\t\t],\n\t\trenderValueLiteral: decimalTextBigintLiteral\n\t}),\n\tmongoCodecDescriptor(mongoInt64NumberCodec, {\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"numeric\"\n\t\t],\n\t\trenderValueLiteral: decimalTextNumberLiteral\n\t}),\n\tmongoCodecDescriptor(mongoDecimal128Codec, {\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"numeric\"\n\t\t],\n\t\tkeepsWrittenForm: true\n\t}),\n\tmongoCodecDescriptor(mongoBinaryCodec, { traits: [\"equality\"] }),\n\tmongoCodecDescriptor(mongoJsonCodec, { traits: [] }),\n\tmongoCodecDescriptor(mongoBsonCodec, { traits: [] }),\n\tmongoCodecDescriptor(mongoDateInstantCodec, { traits: [\"equality\", \"order\"] }),\n\tmongoCodecDescriptor(mongoDateInstantStringCodec, {\n\t\ttraits: [\"equality\", \"order\"],\n\t\trenderValueLiteral: renderTsLiteral\n\t}),\n\tmongoCodecDescriptor(mongoDateStringCodec, {\n\t\ttraits: [\"equality\", \"order\"],\n\t\trenderValueLiteral: renderTsLiteral\n\t}),\n\tmongoCodecDescriptor(mongoDateTemporalCodec, { traits: [\"equality\", \"order\"] }),\n\tmongoCodecDescriptor(mongoTimeStringCodec, {\n\t\ttraits: [\"equality\", \"order\"],\n\t\trenderValueLiteral: renderTsLiteral\n\t}),\n\tmongoCodecDescriptor(mongoTimeTemporalCodec, { traits: [\"equality\", \"order\"] }),\n\tmongoCodecDescriptor(mongoDurationStringCodec, {\n\t\ttraits: [\"equality\"],\n\t\trenderValueLiteral: renderTsLiteral\n\t})\n];\n/**\n* Lookup descriptor metadata by codec id — used by tests and for descriptor-side reads of static metadata.\n*/\nfunction mongoDescriptorById(codecId) {\n\treturn mongoCodecDescriptors.find((d) => d.codecId === codecId);\n}\n//#endregion\nexport { mongoDescriptorById as n, requireTemporal as r, mongoCodecDescriptors as t };\n\n//# sourceMappingURL=codecs-DB6ji3ee.mjs.map"],"mappings":";;;;;;;;;;;AAWA,MAAM,2BAA2B;AACjC,SAAS,yBAAyB,SAAS,WAAW;CACrD,OAAO,iBAAiB,gCAAgC,UAAU,QAAQ,WAAW,UAAU,uEAAuE;EACrK,KA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oB;CACrB,CAAC;CACD,qBAAqB,sBAAsB;EAC1C,QAAQ;GACP;GACA;GACA;EACD;EACA,kBAAkB;CACnB,CAAC;CACD,qBAAqB,kBAAkB,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC;CAC/D,qBAAqB,gBAAgB,EAAE,QAAQ,CAAC,EAAE,CAAC;CACnD,qBAAqB,gBAAgB,EAAE,QAAQ,CAAC,EAAE,CAAC;CACnD,qBAAqB,uBAAuB,EAAE,QAAQ,CAAC,YAAY,OAAO,EAAE,CAAC;CAC7E,qBAAqB,6BAA6B;EACjD,QAAQ,CAAC,YAAY,OAAO;EAC5B,oBAAoB;CACrB,CAAC;CACD,qBAAqB,sBAAsB;EAC1C,QAAQ,CAAC,YAAY,OAAO;EAC5B,oBAAoB;CACrB,CAAC;CACD,qBAAqB,wBAAwB,EAAE,QAAQ,CAAC,YAAY,OAAO,EAAE,CAAC;CAC9E,qBAAqB,sBAAsB;EAC1C,QAAQ,CAAC,YAAY,OAAO;EAC5B,oBAAoB;CACrB,CAAC;CACD,qBAAqB,wBAAwB,EAAE,QAAQ,CAAC,YAAY,OAAO,EAAE,CAAC;CAC9E,qBAAqB,0BAA0B;EAC9C,QAAQ,CAAC,UAAU;EACnB,oBAAoB;CACrB,CAAC;AACF;;;;AAIA,SAAS,oBAAoB,SAAS;CACrC,OAAO,sBAAsB,MAAM,MAAM,EAAE,YAAY,OAAO;AAC/D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as mongoTargetError } from "./mongo-target-errors-Btf3ML1w-QOtEG7EX.mjs";
|
|
2
|
-
import { t as mongoTargetDescriptorMeta } from "./descriptor-meta-
|
|
2
|
+
import { t as mongoTargetDescriptorMeta } from "./descriptor-meta-QyKsSxUQ-Cl1ZCbq3.mjs";
|
|
3
3
|
import { a as createIndex, c as documentsNotOfType, d as fillField, f as isConvertTarget, g as renameField, h as renameCollection, i as createCollection, l as dropCollection, n as castsFrom, r as collMod, s as documentsMissingOrNull, t as castField, u as dropIndex, v as unrewritableFieldNameReason, y as unsetField } from "./migration-factories-C5ktmt8c-BP8k9SnZ.mjs";
|
|
4
4
|
import { assembleDataTypes } from "@prisma/orm-framework/components/codec";
|
|
5
5
|
import { bsonTypesOfCodec, temporaryValueOfCodec } from "@prisma/orm-family-mongo/contract/data-type";
|
|
@@ -3755,4 +3755,4 @@ const mongoTargetDescriptor = {
|
|
|
3755
3755
|
//#endregion
|
|
3756
3756
|
export { schemaIndexToCreateIndexOptions as C, schemaCollectionToCreateCollectionOptions as S, deserializeMongoOp as _, DropIndexCall as a, renderCallsToTypeScript as b, MongoMigrationRunner as c, MongoTargetSchemaVerifier as d, MongoTargetUnboundDatabase as f, UnsetFieldCall as g, RenameFieldCall as h, DropCollectionCall as i, MongoTargetContractSerializer as l, RenameCollectionCall as m, CreateCollectionCall as n, FilterEvaluator as o, PlannerProducedMongoMigration as p, CreateIndexCall as r, MongoMigrationPlanner as s, CollModCall as t, MongoTargetDatabase as u, deserializeMongoOps as v, serializeMongoOps as w, renderOps as x, mongoTargetDescriptor as y };
|
|
3757
3757
|
|
|
3758
|
-
//# sourceMappingURL=control-
|
|
3758
|
+
//# sourceMappingURL=control-BlMckWwK.mjs.map
|