@prisma/orm-target-mongo 8.0.0-rc.1-dev.40 → 8.0.0-rc.1-dev.42
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 +2 -2
- package/dist/adapter__runtime.mjs +1 -1
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/{control-BsswSyWD.mjs → control-DEQAnZTa.mjs} +3 -3
- package/dist/{control-BsswSyWD.mjs.map → control-DEQAnZTa.mjs.map} +1 -1
- package/dist/{control-BOc5lrQg.mjs → control-DQD76x-1.mjs} +2 -2
- package/dist/{control-BOc5lrQg.mjs.map → control-DQD76x-1.mjs.map} +1 -1
- package/dist/driver.mjs +1 -1
- package/dist/driver__control.mjs +1 -1
- package/dist/driver__control.mjs.map +1 -1
- package/dist/{mongo-adapter-BkVYI6jn-ChXldtpg.mjs → mongo-adapter-B2HEyX0b-CQt2HH_o.mjs} +3 -3
- package/dist/mongo-adapter-B2HEyX0b-CQt2HH_o.mjs.map +1 -0
- package/dist/{mongo-driver-C6c16kOh-CXVK5hwV.mjs → mongo-driver-Hpw9TL41-BG1C2ntD.mjs} +3 -3
- package/dist/{mongo-driver-C6c16kOh-CXVK5hwV.mjs.map → mongo-driver-Hpw9TL41-BG1C2ntD.mjs.map} +1 -1
- package/dist/target.mjs +1 -1
- package/dist/target__control.mjs +1 -1
- package/package.json +9 -9
- package/dist/mongo-adapter-BkVYI6jn-ChXldtpg.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-BOc5lrQg.mjs","names":["#execute","#adapter","#markerLedgerCollection","#invariantMergeExpr"],"sources":["../../../../3-mongo-target/2-mongo-adapter/dist/control.mjs"],"sourcesContent":["import { t as createMongoAdapter } from \"./mongo-adapter-BkVYI6jn.mjs\";\nimport { a as mongoAdapterError, i as describeReceivedValue } from \"./codecs-DLWO-Cjc.mjs\";\nimport { MongoAggFieldRef, MongoAggLiteral, MongoAggOperator } from \"@internal/mongo-query-ast/execution\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { MongoServerError } from \"mongodb\";\nimport { MongoSchemaCollection, MongoSchemaCollectionOptions, MongoSchemaIR, MongoSchemaIndex, MongoSchemaValidator } from \"@internal/mongo-schema-ir\";\nimport { parseMarkerRowSafely, withMarkerReadErrorHandling } from \"@internal/errors/execution\";\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/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/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\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);\n}\n//#endregion\n//#region src/core/marker-ledger.ts\nconst COLLECTION = \"_prisma_migrations\";\nconst MONGO_MARKER_COLLECTION = `_prisma_migrations marker documents in ${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/mongo-control-driver.ts\nfunction isMongoControlDriver(driver) {\n\treturn driver.familyId === \"mongo\" && driver.targetId === \"mongo\" && \"execute\" in driver && typeof driver.execute === \"function\";\n}\n//#endregion\n//#region src/core/runner-deps.ts\nfunction extractDb(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.db;\n}\n/**\n* Build the runner-dependencies envelope. `controlAdapter` is the\n* dispatch surface for wire-level Mongo CAS operations (marker reads,\n* marker advances, ledger appends, introspection); the envelope's\n* `markerOps` shim simply forwards each call through it. When the\n* caller already has a `MongoControlAdapter` on the control stack it\n* can pass it in; otherwise a default `MongoControlAdapterImpl` is\n* constructed locally.\n*/\nfunction createMongoRunnerDeps(controlDriver, driver, _family, controlAdapter = new MongoControlAdapterImpl()) {\n\tconst adapter = createMongoAdapter();\n\treturn {\n\t\tinspectionExecutor: new MongoInspectionExecutor(extractDb(controlDriver)),\n\t\tadapter,\n\t\tdriver,\n\t\texecuteDdl: (command) => adapter.lower({ command }, {}).then((wire) => driver.run(wire)),\n\t\tmarkerOps: {\n\t\t\treadMarker: (space) => controlAdapter.readMarker(controlDriver, space),\n\t\t\tinitMarker: (space, dest) => controlAdapter.initMarker(controlDriver, space, dest),\n\t\t\tupdateMarker: (space, expectedFrom, dest) => controlAdapter.updateMarker(controlDriver, space, expectedFrom, dest),\n\t\t\twriteLedgerEntry: (space, entry) => controlAdapter.writeLedgerEntry(controlDriver, space, entry)\n\t\t},\n\t\tintrospectSchema: () => controlAdapter.introspectSchema(controlDriver)\n\t};\n}\n//#endregion\n//#region src/core/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\t#adapter = createMongoAdapter();\n\t#markerLedgerCollection = collection(MARKER_LEDGER_COLLECTION);\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\",\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};\n//#endregion\n//#region src/exports/control.ts\n/**\n* The base PSL scalars as zero-arg type constructors in the unified authoring\n* channel, with explicit `nativeType` values pinned to the codec manifests\n* (`codecLookup.targetTypesFor(codecId)[0]`).\n*/\nconst mongoScalarAuthoringTypes = {\n\tString: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"mongo/string@1\",\n\t\t\tnativeType: \"string\"\n\t\t}\n\t},\n\tInt: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"mongo/int32@1\",\n\t\t\tnativeType: \"int\"\n\t\t}\n\t},\n\tBoolean: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"mongo/bool@1\",\n\t\t\tnativeType: \"bool\"\n\t\t}\n\t},\n\tDateTime: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"mongo/date@1\",\n\t\t\tnativeType: \"date\"\n\t\t}\n\t},\n\tObjectId: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"mongo/objectId@1\",\n\t\t\tnativeType: \"objectId\"\n\t\t}\n\t},\n\tFloat: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"mongo/double@1\",\n\t\t\tnativeType: \"double\"\n\t\t}\n\t}\n};\nconst mongoAdapterDescriptor = {\n\tkind: \"adapter\",\n\tid: \"mongo\",\n\tfamilyId: \"mongo\",\n\ttargetId: \"mongo\",\n\tversion: \"0.0.1\",\n\tauthoring: { type: mongoScalarAuthoringTypes },\n\ttypes: { codecTypes: {\n\t\timport: {\n\t\t\tpackage: \"@internal/adapter-mongo/codec-types\",\n\t\t\tnamed: \"CodecTypes\",\n\t\t\talias: \"MongoCodecTypes\"\n\t\t},\n\t\ttypeImports: [{\n\t\t\tpackage: \"@internal/adapter-mongo/codec-types\",\n\t\t\tnamed: \"Vector\",\n\t\t\talias: \"Vector\"\n\t\t}]\n\t} },\n\tcreate(_stack) {\n\t\treturn new MongoControlAdapterImpl();\n\t}\n};\n//#endregion\nexport { MongoControlAdapterImpl, MongoInspectionExecutor, createMongoAdapter, createMongoRunnerDeps, mongoAdapterDescriptor as default, mongoAdapterDescriptor, extractDb, introspectSchema, isMongoControlDriver, mongoScalarAuthoringTypes };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,IAAI,0BAA0B,MAAM;CACnC;CACA,YAAY,IAAI;EACf,KAAK,KAAK;CACX;CACA,MAAM,YAAY,KAAK;EACtB,IAAI;GACH,OAAO,MAAM,KAAK,GAAG,WAAW,IAAI,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ;EACvE,SAAS,OAAO;GACf,IAAI,iBAAiB,oBAAoB,MAAM,SAAS,IAAI,OAAO,CAAC;GACpE,MAAM;EACP;CACD;CACA,MAAM,gBAAgB,MAAM;EAC3B,OAAO,KAAK,GAAG,gBAAgB,CAAC,CAAC,QAAQ;CAC1C;AACD;AAGA,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,eAAe,OAAO;EAC5B,QAAQ,IAAI;EACZ,QAAQ,IAAI;EAC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b;CACD;AACD;AACA,MAAM,yBAAyB;CAC9B,MAAM;CACN,IAAI;CACJ,UAAU;CACV,UAAU;CACV,SAAS;CACT,WAAW,EAAE,MAAM,0BAA0B;CAC7C,OAAO,EAAE,YAAY;EACpB,QAAQ;GACP,SAAS;GACT,OAAO;GACP,OAAO;EACR;EACA,aAAa,CAAC;GACb,SAAS;GACT,OAAO;GACP,OAAO;EACR,CAAC;CACF,EAAE;CACF,OAAO,QAAQ;EACd,OAAO,IAAI,wBAAwB;CACpC;AACD"}
|
|
1
|
+
{"version":3,"file":"control-DQD76x-1.mjs","names":["#execute","#adapter","#markerLedgerCollection","#invariantMergeExpr"],"sources":["../../../../3-mongo-target/2-mongo-adapter/dist/control.mjs"],"sourcesContent":["import { t as createMongoAdapter } from \"./mongo-adapter-B2HEyX0b.mjs\";\nimport { a as mongoAdapterError, i as describeReceivedValue } from \"./codecs-DLWO-Cjc.mjs\";\nimport { MongoAggFieldRef, MongoAggLiteral, MongoAggOperator } from \"@internal/mongo-query-ast/execution\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { MongoServerError } from \"mongodb\";\nimport { MongoSchemaCollection, MongoSchemaCollectionOptions, MongoSchemaIR, MongoSchemaIndex, MongoSchemaValidator } from \"@internal/mongo-schema-ir\";\nimport { parseMarkerRowSafely, withMarkerReadErrorHandling } from \"@internal/errors/execution\";\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/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/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\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);\n}\n//#endregion\n//#region src/core/marker-ledger.ts\nconst COLLECTION = \"_prisma_migrations\";\nconst MONGO_MARKER_COLLECTION = `_prisma_migrations marker documents in ${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/mongo-control-driver.ts\nfunction isMongoControlDriver(driver) {\n\treturn driver.familyId === \"mongo\" && driver.targetId === \"mongo\" && \"execute\" in driver && typeof driver.execute === \"function\";\n}\n//#endregion\n//#region src/core/runner-deps.ts\nfunction extractDb(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.db;\n}\n/**\n* Build the runner-dependencies envelope. `controlAdapter` is the\n* dispatch surface for wire-level Mongo CAS operations (marker reads,\n* marker advances, ledger appends, introspection); the envelope's\n* `markerOps` shim simply forwards each call through it. When the\n* caller already has a `MongoControlAdapter` on the control stack it\n* can pass it in; otherwise a default `MongoControlAdapterImpl` is\n* constructed locally.\n*/\nfunction createMongoRunnerDeps(controlDriver, driver, _family, controlAdapter = new MongoControlAdapterImpl()) {\n\tconst adapter = createMongoAdapter();\n\treturn {\n\t\tinspectionExecutor: new MongoInspectionExecutor(extractDb(controlDriver)),\n\t\tadapter,\n\t\tdriver,\n\t\texecuteDdl: (command) => adapter.lower({ command }, {}).then((wire) => driver.run(wire)),\n\t\tmarkerOps: {\n\t\t\treadMarker: (space) => controlAdapter.readMarker(controlDriver, space),\n\t\t\tinitMarker: (space, dest) => controlAdapter.initMarker(controlDriver, space, dest),\n\t\t\tupdateMarker: (space, expectedFrom, dest) => controlAdapter.updateMarker(controlDriver, space, expectedFrom, dest),\n\t\t\twriteLedgerEntry: (space, entry) => controlAdapter.writeLedgerEntry(controlDriver, space, entry)\n\t\t},\n\t\tintrospectSchema: () => controlAdapter.introspectSchema(controlDriver)\n\t};\n}\n//#endregion\n//#region src/core/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\t#adapter = createMongoAdapter();\n\t#markerLedgerCollection = collection(MARKER_LEDGER_COLLECTION);\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\",\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};\n//#endregion\n//#region src/exports/control.ts\n/**\n* The base PSL scalars as zero-arg type constructors in the unified authoring\n* channel, with explicit `nativeType` values pinned to the codec manifests\n* (`codecLookup.targetTypesFor(codecId)[0]`).\n*/\nconst mongoScalarAuthoringTypes = {\n\tString: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"mongo/string@1\",\n\t\t\tnativeType: \"string\"\n\t\t}\n\t},\n\tInt: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"mongo/int32@1\",\n\t\t\tnativeType: \"int\"\n\t\t}\n\t},\n\tBoolean: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"mongo/bool@1\",\n\t\t\tnativeType: \"bool\"\n\t\t}\n\t},\n\tDateTime: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"mongo/date@1\",\n\t\t\tnativeType: \"date\"\n\t\t}\n\t},\n\tObjectId: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"mongo/objectId@1\",\n\t\t\tnativeType: \"objectId\"\n\t\t}\n\t},\n\tFloat: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"mongo/double@1\",\n\t\t\tnativeType: \"double\"\n\t\t}\n\t}\n};\nconst mongoAdapterDescriptor = {\n\tkind: \"adapter\",\n\tid: \"mongo\",\n\tfamilyId: \"mongo\",\n\ttargetId: \"mongo\",\n\tversion: \"0.0.1\",\n\tauthoring: { type: mongoScalarAuthoringTypes },\n\ttypes: { codecTypes: {\n\t\timport: {\n\t\t\tpackage: \"@internal/adapter-mongo/codec-types\",\n\t\t\tnamed: \"CodecTypes\",\n\t\t\talias: \"MongoCodecTypes\"\n\t\t},\n\t\ttypeImports: [{\n\t\t\tpackage: \"@internal/adapter-mongo/codec-types\",\n\t\t\tnamed: \"Vector\",\n\t\t\talias: \"Vector\"\n\t\t}]\n\t} },\n\tcreate(_stack) {\n\t\treturn new MongoControlAdapterImpl();\n\t}\n};\n//#endregion\nexport { MongoControlAdapterImpl, MongoInspectionExecutor, createMongoAdapter, createMongoRunnerDeps, mongoAdapterDescriptor as default, mongoAdapterDescriptor, extractDb, introspectSchema, isMongoControlDriver, mongoScalarAuthoringTypes };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,IAAI,0BAA0B,MAAM;CACnC;CACA,YAAY,IAAI;EACf,KAAK,KAAK;CACX;CACA,MAAM,YAAY,KAAK;EACtB,IAAI;GACH,OAAO,MAAM,KAAK,GAAG,WAAW,IAAI,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ;EACvE,SAAS,OAAO;GACf,IAAI,iBAAiB,oBAAoB,MAAM,SAAS,IAAI,OAAO,CAAC;GACpE,MAAM;EACP;CACD;CACA,MAAM,gBAAgB,MAAM;EAC3B,OAAO,KAAK,GAAG,gBAAgB,CAAC,CAA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IACjC;IACA,WAAW;IACX,gBAAgB,OAAO;GACxB,CAAC;EACF;EACA,OAAO;CACR;CACA,MAAM,iBAAiB,QAAQ;EAC9B,OAAO,iBAAiB,UAAU,MAAM,CAAC;CAC1C;AACD;;;;;;AAQA,MAAM,4BAA4B;CACjC,QAAQ;EACP,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,KAAK;EACJ,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,SAAS;EACR,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,UAAU;EACT,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,UAAU;EACT,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,OAAO;EACN,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;AACD;AACA,MAAM,yBAAyB;CAC9B,MAAM;CACN,IAAI;CACJ,UAAU;CACV,UAAU;CACV,SAAS;CACT,WAAW,EAAE,MAAM,0BAA0B;CAC7C,OAAO,EAAE,YAAY;EACpB,QAAQ;GACP,SAAS;GACT,OAAO;GACP,OAAO;EACR;EACA,aAAa,CAAC;GACb,SAAS;GACT,OAAO;GACP,OAAO;EACR,CAAC;CACF,EAAE;CACF,OAAO,QAAQ;EACd,OAAO,IAAI,wBAAwB;CACpC;AACD"}
|
package/dist/driver.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as MongoDriverImpl, r as createMongoDriver } from "./mongo-driver-
|
|
1
|
+
import { n as MongoDriverImpl, r as createMongoDriver } from "./mongo-driver-Hpw9TL41-BG1C2ntD.mjs";
|
|
2
2
|
export { MongoDriverImpl, createMongoDriver };
|
package/dist/driver__control.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as MongoDriverImpl, t as DRIVER_INFO } from "./mongo-driver-
|
|
1
|
+
import { n as MongoDriverImpl, t as DRIVER_INFO } from "./mongo-driver-Hpw9TL41-BG1C2ntD.mjs";
|
|
2
2
|
import { MongoClient } from "mongodb";
|
|
3
3
|
import { errorRuntime } from "@prisma/orm-framework/errors/execution";
|
|
4
4
|
import { redactDatabaseUrl } from "@prisma/orm-framework/utils/redact-db-url";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver__control.mjs","names":[],"sources":["../../../../3-mongo-target/3-mongo-driver/dist/control.mjs"],"sourcesContent":["import { r as DRIVER_INFO, t as MongoDriverImpl } from \"./mongo-driver-
|
|
1
|
+
{"version":3,"file":"driver__control.mjs","names":[],"sources":["../../../../3-mongo-target/3-mongo-driver/dist/control.mjs"],"sourcesContent":["import { r as DRIVER_INFO, t as MongoDriverImpl } from \"./mongo-driver-Hpw9TL41.mjs\";\nimport { MongoClient } from \"mongodb\";\nimport { errorRuntime } from \"@internal/errors/execution\";\nimport { redactDatabaseUrl } from \"@internal/utils/redact-db-url\";\n//#region src/exports/control.ts\nvar MongoControlDriver = class extends MongoDriverImpl {\n\tfamilyId = \"mongo\";\n\ttargetId = \"mongo\";\n\tdb;\n\tconstructor(db, mongoClient) {\n\t\tsuper(db, mongoClient);\n\t\tthis.db = db;\n\t}\n};\nconst mongoControlDriverDescriptor = {\n\tkind: \"driver\",\n\tfamilyId: \"mongo\",\n\ttargetId: \"mongo\",\n\tid: \"mongo\",\n\tversion: DRIVER_INFO.version,\n\tcapabilities: {},\n\tasync create(url) {\n\t\tconst client = new MongoClient(url, {\n\t\t\tserverSelectionTimeoutMS: 5e3,\n\t\t\tconnectTimeoutMS: 5e3,\n\t\t\tdriverInfo: DRIVER_INFO\n\t\t});\n\t\ttry {\n\t\t\tawait client.connect();\n\t\t\treturn new MongoControlDriver(client.db(), client);\n\t\t} catch (error) {\n\t\t\ttry {\n\t\t\t\tawait client.close();\n\t\t\t} catch {}\n\t\t\tthrow errorRuntime(\"DRIVER.CONNECTION_FAILED\", \"Database connection failed\", {\n\t\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\t\tfix: \"Verify the MongoDB URL, ensure the database is reachable, and confirm credentials/permissions\",\n\t\t\t\tmeta: { ...redactDatabaseUrl(url) },\n\t\t\t\tcause: error\n\t\t\t});\n\t\t}\n\t}\n};\n//#endregion\nexport { MongoControlDriver, mongoControlDriverDescriptor as default };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;AAKA,IAAI,qBAAqB,cAAc,gBAAgB;CACtD,WAAW;CACX,WAAW;CACX;CACA,YAAY,IAAI,aAAa;EAC5B,MAAM,IAAI,WAAW;EACrB,KAAK,KAAK;CACX;AACD;AACA,MAAM,+BAA+B;CACpC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS,YAAY;CACrB,cAAc,CAAC;CACf,MAAM,OAAO,KAAK;EACjB,MAAM,SAAS,IAAI,YAAY,KAAK;GACnC,0BAA0B;GAC1B,kBAAkB;GAClB,YAAY;EACb,CAAC;EACD,IAAI;GACH,MAAM,OAAO,QAAQ;GACrB,OAAO,IAAI,mBAAmB,OAAO,GAAG,GAAG,MAAM;EAClD,SAAS,OAAO;GACf,IAAI;IACH,MAAM,OAAO,MAAM;GACpB,QAAQ,CAAC;GACT,MAAM,aAAa,4BAA4B,8BAA8B;IAC5E,KAAK,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;IAC1D,KAAK;IACL,MAAM,EAAE,GAAG,kBAAkB,GAAG,EAAE;IAClC,OAAO;GACR,CAAC;EACF;CACD;AACD"}
|
|
@@ -7,7 +7,7 @@ import { InternalError, assertNever } from "@prisma/orm-framework/utils/internal
|
|
|
7
7
|
import { checkAborted, raceAgainstAbort, runtimeError } from "@prisma/orm-framework/components/runtime";
|
|
8
8
|
import { MongoParamRef } from "@prisma/orm-family-mongo/value";
|
|
9
9
|
import { AggregateWireCommand, CollModWireCommand, CreateCollectionWireCommand, CreateIndexWireCommand, DeleteManyWireCommand, DeleteOneWireCommand, DropCollectionWireCommand, DropIndexWireCommand, FindOneAndDeleteWireCommand, FindOneAndUpdateWireCommand, InsertManyWireCommand, InsertOneWireCommand, UpdateManyWireCommand, UpdateOneWireCommand } from "@prisma/orm-family-mongo/wire";
|
|
10
|
-
//#region ../../../3-mongo-target/2-mongo-adapter/dist/mongo-adapter-
|
|
10
|
+
//#region ../../../3-mongo-target/2-mongo-adapter/dist/mongo-adapter-B2HEyX0b.mjs
|
|
11
11
|
/**
|
|
12
12
|
* Resolves a `MongoValue` (which may contain `MongoParamRef` leaves) into the
|
|
13
13
|
* driver-ready wire shape. When a leaf has a `codecId` and the registry has a
|
|
@@ -26,7 +26,7 @@ import { AggregateWireCommand, CollModWireCommand, CreateCollectionWireCommand,
|
|
|
26
26
|
* `ctx: CodecCallContext` is forwarded verbatim to every
|
|
27
27
|
* `codec.encode(value, ctx)` call. The same `ctx` reference is also passed
|
|
28
28
|
* to nested `resolveValue` invocations so codec authors observe **signal
|
|
29
|
-
* identity** across the entire recursive walk for one `runtime.
|
|
29
|
+
* identity** across the entire recursive walk for one `runtime.query()`.
|
|
30
30
|
*
|
|
31
31
|
* Abort observation (only when `ctx.signal` is provided):
|
|
32
32
|
*
|
|
@@ -804,4 +804,4 @@ function createMongoAdapter() {
|
|
|
804
804
|
//#endregion
|
|
805
805
|
export { lowerStage as a, lowerPipeline as i, lowerAggExpr as n, lowerFilter as r, createMongoAdapter as t };
|
|
806
806
|
|
|
807
|
-
//# sourceMappingURL=mongo-adapter-
|
|
807
|
+
//# sourceMappingURL=mongo-adapter-B2HEyX0b-CQt2HH_o.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongo-adapter-B2HEyX0b-CQt2HH_o.mjs","names":["#codecs"],"sources":["../../../../3-mongo-target/2-mongo-adapter/dist/mongo-adapter-B2HEyX0b.mjs"],"sourcesContent":["import { t as buildStandardCodecRegistry } from \"./codecs-DLWO-Cjc.mjs\";\nimport { isExprArray, isRecordArgs } from \"@internal/mongo-query-ast/execution\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError, assertNever } from \"@internal/utils/internal-error\";\nimport { checkAborted, raceAgainstAbort, runtimeError } from \"@internal/framework-components/runtime\";\nimport { MongoParamRef } from \"@internal/mongo-value\";\nimport { isStructuredError } from \"@internal/utils/structured-error\";\nimport { keysToKeySpec } from \"@internal/mongo-query-ast/control\";\nimport { AggregateWireCommand, CollModWireCommand, CreateCollectionWireCommand, CreateIndexWireCommand, DeleteManyWireCommand, DeleteOneWireCommand, DropCollectionWireCommand, DropIndexWireCommand, FindOneAndDeleteWireCommand, FindOneAndUpdateWireCommand, InsertManyWireCommand, InsertOneWireCommand, UpdateManyWireCommand, UpdateOneWireCommand } from \"@internal/mongo-wire\";\n//#region src/resolve-value.ts\n/**\n* Resolves a `MongoValue` (which may contain `MongoParamRef` leaves) into the\n* driver-ready wire shape. When a leaf has a `codecId` and the registry has a\n* codec for it, the codec's async `encode` is awaited so codecs may perform\n* asynchronous work (e.g. lookups, key derivations).\n*\n* Object/array nodes dispatch their child resolutions concurrently via\n* `Promise.all` so independent leaves encode in parallel.\n*\n* Codec encode failures are wrapped in a `RUNTIME.ENCODE_FAILED` envelope\n* (mirroring SQL's `wrapEncodeFailure` shape) with `{ label, codec }` details\n* and the original error attached on `cause`. A structured envelope (any error\n* with a dotted `code`, per `isStructuredError`) is re-thrown verbatim so\n* codec-raised envelopes and nested resolvers don't get double-wrapped.\n*\n* `ctx: CodecCallContext` is forwarded verbatim to every\n* `codec.encode(value, ctx)` call. The same `ctx` reference is also passed\n* to nested `resolveValue` invocations so codec authors observe **signal\n* identity** across the entire recursive walk for one `runtime.query()`.\n*\n* Abort observation (only when `ctx.signal` is provided):\n*\n* - **Already-aborted at entry** — every recursive call pre-checks\n* `ctx.signal.aborted` and short-circuits with\n* `RUNTIME.ABORTED { phase: 'encode' }` before any codec is invoked.\n* - **Mid-flight abort** — each per-level `Promise.all` races against the\n* signal via `raceAgainstAbort`. The runtime returns\n* `RUNTIME.ABORTED { phase: 'encode' }` promptly even if codec bodies\n* ignore the signal; in-flight bodies run to completion in the background\n* (cooperative cancellation, see ADR 204).\n* - `RUNTIME.ENCODE_FAILED` envelopes thrown by a codec body before the\n* runtime sees the abort pass through unchanged (AC-ERR4).\n*/\nasync function resolveValue(value, codecs, ctx) {\n\tcheckAborted(ctx, \"encode\");\n\tconst signal = ctx.signal;\n\tif (value instanceof MongoParamRef) {\n\t\tif (value.codecId) {\n\t\t\tconst codec = codecs.get(value.codecId);\n\t\t\tif (codec?.encode) try {\n\t\t\t\treturn await raceAgainstAbort(codec.encode(value.value, ctx), signal, \"encode\");\n\t\t\t} catch (error) {\n\t\t\t\twrapEncodeFailure(error, value, codec.id);\n\t\t\t}\n\t\t}\n\t\treturn value.value;\n\t}\n\tif (value === null || typeof value !== \"object\") return value;\n\tif (value instanceof Date) return value;\n\tif (Array.isArray(value)) return raceAgainstAbort(Promise.all(value.map((v) => resolveValue(v, codecs, ctx))), signal, \"encode\");\n\tconst entries = Object.entries(value);\n\tconst resolved = await raceAgainstAbort(Promise.all(entries.map(([, val]) => resolveValue(val, codecs, ctx))), signal, \"encode\");\n\tconst result = {};\n\tfor (let i = 0; i < entries.length; i++) {\n\t\tconst entry = entries[i];\n\t\tif (entry) result[entry[0]] = resolved[i];\n\t}\n\treturn result;\n}\n/**\n* Resolves a draft slot value — which may be `MongoParamRef`, a primitive, a\n* nested plain-object, or an array — into the corresponding wire value.\n* Mirrors `resolveValue`'s traversal strategy but accepts `unknown` so it can\n* handle pipeline stage documents whose field types cannot be narrowed to\n* `MongoValue` statically (e.g. `$geoNear.near: unknown`).\n*/\nasync function resolveDraftSlot(value, codecs, ctx) {\n\tif (value instanceof MongoParamRef) return resolveValue(value, codecs, ctx);\n\tif (value === null || typeof value !== \"object\") return value;\n\tif (value instanceof Date) return value;\n\tif (Array.isArray(value)) return raceAgainstAbort(Promise.all(value.map((v) => resolveDraftSlot(v, codecs, ctx))), ctx.signal, \"encode\");\n\treturn resolveDraftDoc(blindCast(value), codecs, ctx);\n}\n/**\n* Resolves a pipeline stage draft document by walking every entry and\n* forwarding to {@link resolveDraftSlot}. Used by `MongoAdapterImpl.resolveParams`\n* for aggregate pipeline stages, which carry `unknown`-typed fields (e.g.\n* `$geoNear.near`) alongside filter sub-documents that may contain\n* `MongoParamRef` leaves.\n*/\nasync function resolveDraftDoc(doc, codecs, ctx) {\n\tcheckAborted(ctx, \"encode\");\n\tconst entries = Object.entries(doc);\n\tconst resolved = await raceAgainstAbort(Promise.all(entries.map(([, val]) => resolveDraftSlot(val, codecs, ctx))), ctx.signal, \"encode\");\n\tconst result = {};\n\tfor (let i = 0; i < entries.length; i++) {\n\t\tconst entry = entries[i];\n\t\tif (entry) result[entry[0]] = resolved[i];\n\t}\n\treturn result;\n}\nfunction paramRefLabel(ref, codecId) {\n\treturn ref.name ?? codecId;\n}\nfunction wrapEncodeFailure(error, ref, codecId) {\n\tif (isStructuredError(error)) throw error;\n\tconst label = paramRefLabel(ref, codecId);\n\tconst wrapped = runtimeError(\"RUNTIME.ENCODE_FAILED\", `Failed to encode parameter ${label} with codec '${codecId}': ${error instanceof Error ? error.message : String(error)}`, {\n\t\tlabel,\n\t\tcodec: codecId\n\t});\n\twrapped.cause = error;\n\tthrow wrapped;\n}\n//#endregion\n//#region src/lowering.ts\nconst THEN_KEY = \"then\";\nfunction condBranch(caseOrIf, thenExpr, elseExpr) {\n\tconst entries = [[elseExpr ? \"if\" : \"case\", lowerAggExpr(caseOrIf)], [THEN_KEY, lowerAggExpr(thenExpr)]];\n\tif (elseExpr) entries.push([\"else\", lowerAggExpr(elseExpr)]);\n\treturn Object.fromEntries(entries);\n}\nconst aggExprLoweringVisitor = {\n\tfieldRef(expr) {\n\t\treturn `$${expr.path}`;\n\t},\n\tliteral(expr) {\n\t\treturn needsLiteralWrap(expr.value) ? { $literal: expr.value } : expr.value;\n\t},\n\toperator(expr) {\n\t\tconst { args } = expr;\n\t\tlet loweredArgs;\n\t\tif (isExprArray(args)) loweredArgs = args.map((a) => lowerAggExpr(a));\n\t\telse if (isRecordArgs(args)) loweredArgs = lowerExprRecord(args);\n\t\telse loweredArgs = lowerAggExpr(args);\n\t\treturn { [expr.op]: loweredArgs };\n\t},\n\taccumulator(expr) {\n\t\tif (expr.arg === null) return { [expr.op]: {} };\n\t\tif (isRecordArgs(expr.arg)) return { [expr.op]: lowerExprRecord(expr.arg) };\n\t\treturn { [expr.op]: lowerAggExpr(expr.arg) };\n\t},\n\tcond(expr) {\n\t\treturn { $cond: condBranch(expr.condition, expr.then_, expr.else_) };\n\t},\n\tswitch_(expr) {\n\t\treturn { $switch: {\n\t\t\tbranches: expr.branches.map((b) => condBranch(b.case_, b.then_)),\n\t\t\tdefault: lowerAggExpr(expr.default_)\n\t\t} };\n\t},\n\tfilter(expr) {\n\t\treturn { $filter: {\n\t\t\tinput: lowerAggExpr(expr.input),\n\t\t\tcond: lowerAggExpr(expr.cond),\n\t\t\tas: expr.as\n\t\t} };\n\t},\n\tmap(expr) {\n\t\treturn { $map: {\n\t\t\tinput: lowerAggExpr(expr.input),\n\t\t\tin: lowerAggExpr(expr.in_),\n\t\t\tas: expr.as\n\t\t} };\n\t},\n\treduce(expr) {\n\t\treturn { $reduce: {\n\t\t\tinput: lowerAggExpr(expr.input),\n\t\t\tinitialValue: lowerAggExpr(expr.initialValue),\n\t\t\tin: lowerAggExpr(expr.in_)\n\t\t} };\n\t},\n\tlet_(expr) {\n\t\tconst vars = {};\n\t\tfor (const [key, val] of Object.entries(expr.vars)) vars[key] = lowerAggExpr(val);\n\t\treturn { $let: {\n\t\t\tvars,\n\t\t\tin: lowerAggExpr(expr.in_)\n\t\t} };\n\t},\n\tmergeObjects(expr) {\n\t\treturn { $mergeObjects: expr.exprs.map((e) => lowerAggExpr(e)) };\n\t}\n};\nfunction needsLiteralWrap(value) {\n\tif (typeof value === \"string\" && value.startsWith(\"$\")) return true;\n\tif (Array.isArray(value)) return value.some((v) => needsLiteralWrap(v));\n\tif (value !== null && typeof value === \"object\") return Object.entries(value).some(([k, v]) => k.startsWith(\"$\") || needsLiteralWrap(v));\n\treturn false;\n}\nfunction lowerAggExpr(expr) {\n\treturn expr.accept(aggExprLoweringVisitor);\n}\n/**\n* Structural phase of filter lowering: transforms the filter AST into a\n* plain object without resolving any `MongoParamRef` leaves. Field filter\n* values remain as `MongoValue` (which includes `MongoParamRef`), so the\n* returned document can be passed to `resolveDraftDoc` in the resolve phase.\n* Synchronous — no codec calls.\n*/\nfunction structuralLowerFilter(filter) {\n\tswitch (filter.kind) {\n\t\tcase \"field\": return { [filter.field]: { [filter.op]: filter.value } };\n\t\tcase \"and\": return { $and: filter.exprs.map((e) => structuralLowerFilter(e)) };\n\t\tcase \"or\": return { $or: filter.exprs.map((e) => structuralLowerFilter(e)) };\n\t\tcase \"not\": return { $nor: [structuralLowerFilter(filter.expr)] };\n\t\tcase \"exists\": return { [filter.field]: { $exists: filter.exists } };\n\t\tcase \"expr\": return { $expr: lowerAggExpr(filter.aggExpr) };\n\t\tdefault: {\n\t\t\tconst _exhaustive = filter;\n\t\t\treturn assertNever(_exhaustive, `Unhandled filter kind: ${blindCast(_exhaustive).kind}`);\n\t\t}\n\t}\n}\nasync function lowerFilter(filter, codecs, ctx) {\n\tswitch (filter.kind) {\n\t\tcase \"field\": return { [filter.field]: { [filter.op]: await resolveValue(filter.value, codecs, ctx) } };\n\t\tcase \"and\": return { $and: await Promise.all(filter.exprs.map((e) => lowerFilter(e, codecs, ctx))) };\n\t\tcase \"or\": return { $or: await Promise.all(filter.exprs.map((e) => lowerFilter(e, codecs, ctx))) };\n\t\tcase \"not\": return { $nor: [await lowerFilter(filter.expr, codecs, ctx)] };\n\t\tcase \"exists\": return { [filter.field]: { $exists: filter.exists } };\n\t\tcase \"expr\": return { $expr: lowerAggExpr(filter.aggExpr) };\n\t\tdefault: {\n\t\t\tconst _exhaustive = filter;\n\t\t\treturn assertNever(_exhaustive, `Unhandled filter kind: ${blindCast(_exhaustive).kind}`);\n\t\t}\n\t}\n}\nfunction isAggExprNode(value) {\n\treturn \"accept\" in value && typeof value.accept === \"function\";\n}\nfunction isAggExprArray(val) {\n\treturn Array.isArray(val);\n}\nfunction lowerGroupId(groupId) {\n\tif (groupId === null) return null;\n\tif (isAggExprNode(groupId)) return lowerAggExpr(groupId);\n\treturn lowerExprRecord(groupId);\n}\nfunction lowerExprRecord(fields) {\n\tconst result = {};\n\tfor (const [key, val] of Object.entries(fields)) if (isAggExprArray(val)) result[key] = val.map((v) => lowerAggExpr(v));\n\telse result[key] = lowerAggExpr(val);\n\treturn result;\n}\nfunction lowerProjectionValue(value) {\n\tif (typeof value === \"number\") return value;\n\treturn lowerAggExpr(value);\n}\nfunction lowerWindowField(wf) {\n\tconst lowered = lowerAggExpr(wf.operator);\n\tif (typeof lowered !== \"object\" || lowered === null) throw new InternalError(\"Window field operator must lower to an object\");\n\tconst result = { ...lowered };\n\tif (wf.window) result[\"window\"] = { ...wf.window };\n\treturn result;\n}\nasync function lowerStage(stage, codecs, ctx) {\n\tswitch (stage.kind) {\n\t\tcase \"match\": return { $match: await lowerFilter(stage.filter, codecs, ctx) };\n\t\tcase \"project\": {\n\t\t\tconst projection = {};\n\t\t\tfor (const [key, val] of Object.entries(stage.projection)) projection[key] = lowerProjectionValue(val);\n\t\t\treturn { $project: projection };\n\t\t}\n\t\tcase \"sort\": return { $sort: { ...stage.sort } };\n\t\tcase \"limit\": return { $limit: stage.limit };\n\t\tcase \"skip\": return { $skip: stage.skip };\n\t\tcase \"lookup\": {\n\t\t\tconst lookup = {\n\t\t\t\tfrom: stage.from,\n\t\t\t\tas: stage.as\n\t\t\t};\n\t\t\tif (stage.localField !== void 0) lookup[\"localField\"] = stage.localField;\n\t\t\tif (stage.foreignField !== void 0) lookup[\"foreignField\"] = stage.foreignField;\n\t\t\tif (stage.pipeline) lookup[\"pipeline\"] = await Promise.all(stage.pipeline.map((s) => lowerStage(s, codecs, ctx)));\n\t\t\tif (stage.let_) lookup[\"let\"] = lowerExprRecord(stage.let_);\n\t\t\treturn { $lookup: lookup };\n\t\t}\n\t\tcase \"unwind\": {\n\t\t\tconst unwind = {\n\t\t\t\tpath: stage.path,\n\t\t\t\tpreserveNullAndEmptyArrays: stage.preserveNullAndEmptyArrays\n\t\t\t};\n\t\t\tif (stage.includeArrayIndex !== void 0) unwind[\"includeArrayIndex\"] = stage.includeArrayIndex;\n\t\t\treturn { $unwind: unwind };\n\t\t}\n\t\tcase \"group\": {\n\t\t\tconst group = { _id: lowerGroupId(stage.groupId) };\n\t\t\tfor (const [key, acc] of Object.entries(stage.accumulators)) group[key] = lowerAggExpr(acc);\n\t\t\treturn { $group: group };\n\t\t}\n\t\tcase \"addFields\": return { $addFields: lowerExprRecord(stage.fields) };\n\t\tcase \"replaceRoot\": return { $replaceRoot: { newRoot: lowerAggExpr(stage.newRoot) } };\n\t\tcase \"count\": return { $count: stage.field };\n\t\tcase \"sortByCount\": return { $sortByCount: lowerAggExpr(stage.expr) };\n\t\tcase \"sample\": return { $sample: { size: stage.size } };\n\t\tcase \"redact\": return { $redact: lowerAggExpr(stage.expr) };\n\t\tcase \"out\": return { $out: stage.db ? {\n\t\t\tdb: stage.db,\n\t\t\tcoll: stage.collection\n\t\t} : stage.collection };\n\t\tcase \"unionWith\": {\n\t\t\tconst unionWith = { coll: stage.collection };\n\t\t\tif (stage.pipeline) unionWith[\"pipeline\"] = await Promise.all(stage.pipeline.map((s) => lowerStage(s, codecs, ctx)));\n\t\t\treturn { $unionWith: unionWith };\n\t\t}\n\t\tcase \"bucket\": {\n\t\t\tconst bucket = {\n\t\t\t\tgroupBy: lowerAggExpr(stage.groupBy),\n\t\t\t\tboundaries: [...stage.boundaries]\n\t\t\t};\n\t\t\tif (stage.default_ !== void 0) bucket[\"default\"] = stage.default_;\n\t\t\tif (stage.output) bucket[\"output\"] = lowerExprRecord(stage.output);\n\t\t\treturn { $bucket: bucket };\n\t\t}\n\t\tcase \"bucketAuto\": {\n\t\t\tconst bucketAuto = {\n\t\t\t\tgroupBy: lowerAggExpr(stage.groupBy),\n\t\t\t\tbuckets: stage.buckets\n\t\t\t};\n\t\t\tif (stage.output) bucketAuto[\"output\"] = lowerExprRecord(stage.output);\n\t\t\tif (stage.granularity !== void 0) bucketAuto[\"granularity\"] = stage.granularity;\n\t\t\treturn { $bucketAuto: bucketAuto };\n\t\t}\n\t\tcase \"geoNear\": {\n\t\t\tconst geoNear = {\n\t\t\t\tnear: stage.near,\n\t\t\t\tdistanceField: stage.distanceField\n\t\t\t};\n\t\t\tif (stage.spherical !== void 0) geoNear[\"spherical\"] = stage.spherical;\n\t\t\tif (stage.maxDistance !== void 0) geoNear[\"maxDistance\"] = stage.maxDistance;\n\t\t\tif (stage.minDistance !== void 0) geoNear[\"minDistance\"] = stage.minDistance;\n\t\t\tif (stage.query) geoNear[\"query\"] = await lowerFilter(stage.query, codecs, ctx);\n\t\t\tif (stage.key !== void 0) geoNear[\"key\"] = stage.key;\n\t\t\tif (stage.distanceMultiplier !== void 0) geoNear[\"distanceMultiplier\"] = stage.distanceMultiplier;\n\t\t\tif (stage.includeLocs !== void 0) geoNear[\"includeLocs\"] = stage.includeLocs;\n\t\t\treturn { $geoNear: geoNear };\n\t\t}\n\t\tcase \"facet\": {\n\t\t\tconst facetEntries = Object.entries(stage.facets);\n\t\t\tconst facetPipelines = await Promise.all(facetEntries.map(([, pipeline]) => Promise.all(pipeline.map((s) => lowerStage(s, codecs, ctx)))));\n\t\t\tconst facet = {};\n\t\t\tfor (let i = 0; i < facetEntries.length; i++) {\n\t\t\t\tconst entry = facetEntries[i];\n\t\t\t\tif (entry) facet[entry[0]] = facetPipelines[i];\n\t\t\t}\n\t\t\treturn { $facet: facet };\n\t\t}\n\t\tcase \"graphLookup\": {\n\t\t\tconst graphLookup = {\n\t\t\t\tfrom: stage.from,\n\t\t\t\tstartWith: lowerAggExpr(stage.startWith),\n\t\t\t\tconnectFromField: stage.connectFromField,\n\t\t\t\tconnectToField: stage.connectToField,\n\t\t\t\tas: stage.as\n\t\t\t};\n\t\t\tif (stage.maxDepth !== void 0) graphLookup[\"maxDepth\"] = stage.maxDepth;\n\t\t\tif (stage.depthField !== void 0) graphLookup[\"depthField\"] = stage.depthField;\n\t\t\tif (stage.restrictSearchWithMatch) graphLookup[\"restrictSearchWithMatch\"] = await lowerFilter(stage.restrictSearchWithMatch, codecs, ctx);\n\t\t\treturn { $graphLookup: graphLookup };\n\t\t}\n\t\tcase \"merge\": {\n\t\t\tconst merge = { into: stage.into };\n\t\t\tif (stage.on !== void 0) merge[\"on\"] = stage.on;\n\t\t\tif (stage.whenMatched !== void 0) merge[\"whenMatched\"] = Array.isArray(stage.whenMatched) ? await Promise.all(stage.whenMatched.map((s) => lowerStage(s, codecs, ctx))) : stage.whenMatched;\n\t\t\tif (stage.whenNotMatched !== void 0) merge[\"whenNotMatched\"] = stage.whenNotMatched;\n\t\t\treturn { $merge: merge };\n\t\t}\n\t\tcase \"setWindowFields\": {\n\t\t\tconst swf = {};\n\t\t\tif (stage.partitionBy) swf[\"partitionBy\"] = lowerAggExpr(stage.partitionBy);\n\t\t\tif (stage.sortBy) swf[\"sortBy\"] = { ...stage.sortBy };\n\t\t\tconst output = {};\n\t\t\tfor (const [key, wf] of Object.entries(stage.output)) output[key] = lowerWindowField(wf);\n\t\t\tswf[\"output\"] = output;\n\t\t\treturn { $setWindowFields: swf };\n\t\t}\n\t\tcase \"densify\": {\n\t\t\tconst densify = {\n\t\t\t\tfield: stage.field,\n\t\t\t\trange: { ...stage.range }\n\t\t\t};\n\t\t\tif (stage.partitionByFields) densify[\"partitionByFields\"] = [...stage.partitionByFields];\n\t\t\treturn { $densify: densify };\n\t\t}\n\t\tcase \"fill\": {\n\t\t\tconst fill = {};\n\t\t\tif (stage.partitionBy) fill[\"partitionBy\"] = lowerAggExpr(stage.partitionBy);\n\t\t\tif (stage.partitionByFields) fill[\"partitionByFields\"] = [...stage.partitionByFields];\n\t\t\tif (stage.sortBy) fill[\"sortBy\"] = { ...stage.sortBy };\n\t\t\tconst output = {};\n\t\t\tfor (const [key, fo] of Object.entries(stage.output)) {\n\t\t\t\tconst entry = {};\n\t\t\t\tif (fo.method !== void 0) entry[\"method\"] = fo.method;\n\t\t\t\tif (fo.value !== void 0) entry[\"value\"] = lowerAggExpr(fo.value);\n\t\t\t\toutput[key] = entry;\n\t\t\t}\n\t\t\tfill[\"output\"] = output;\n\t\t\treturn { $fill: fill };\n\t\t}\n\t\tcase \"search\": {\n\t\t\tconst search = { ...stage.config };\n\t\t\tif (stage.index !== void 0) search[\"index\"] = stage.index;\n\t\t\treturn { $search: search };\n\t\t}\n\t\tcase \"searchMeta\": {\n\t\t\tconst searchMeta = { ...stage.config };\n\t\t\tif (stage.index !== void 0) searchMeta[\"index\"] = stage.index;\n\t\t\treturn { $searchMeta: searchMeta };\n\t\t}\n\t\tcase \"vectorSearch\": {\n\t\t\tconst vs = {\n\t\t\t\tindex: stage.index,\n\t\t\t\tpath: stage.path,\n\t\t\t\tqueryVector: [...stage.queryVector],\n\t\t\t\tnumCandidates: stage.numCandidates,\n\t\t\t\tlimit: stage.limit\n\t\t\t};\n\t\t\tif (stage.filter) vs[\"filter\"] = { ...stage.filter };\n\t\t\treturn { $vectorSearch: vs };\n\t\t}\n\t\tdefault: {\n\t\t\tconst _exhaustive = stage;\n\t\t\treturn assertNever(_exhaustive, `Unhandled stage kind: ${blindCast(_exhaustive).kind}`);\n\t\t}\n\t}\n}\nasync function lowerPipeline(stages, codecs, ctx) {\n\treturn Promise.all(stages.map((s) => lowerStage(s, codecs, ctx)));\n}\n/**\n* Structural phase of stage lowering: mirrors `lowerStage` but defers all\n* `MongoParamRef` resolution. Filter sub-documents within stages (e.g.\n* `$match`, `$geoNear.query`, `$graphLookup.restrictSearchWithMatch`) are\n* produced by `structuralLowerFilter` and therefore retain `MongoParamRef`\n* leaves. Sub-pipelines (e.g. `$lookup.pipeline`, `$facet.*`) recurse via\n* `structuralLowerPipeline`. Synchronous — no codec calls.\n*/\nfunction structuralLowerStage(stage) {\n\tswitch (stage.kind) {\n\t\tcase \"match\": return { $match: structuralLowerFilter(stage.filter) };\n\t\tcase \"project\": {\n\t\t\tconst projection = {};\n\t\t\tfor (const [key, val] of Object.entries(stage.projection)) projection[key] = lowerProjectionValue(val);\n\t\t\treturn { $project: projection };\n\t\t}\n\t\tcase \"sort\": return { $sort: { ...stage.sort } };\n\t\tcase \"limit\": return { $limit: stage.limit };\n\t\tcase \"skip\": return { $skip: stage.skip };\n\t\tcase \"lookup\": {\n\t\t\tconst lookup = {\n\t\t\t\tfrom: stage.from,\n\t\t\t\tas: stage.as\n\t\t\t};\n\t\t\tif (stage.localField !== void 0) lookup[\"localField\"] = stage.localField;\n\t\t\tif (stage.foreignField !== void 0) lookup[\"foreignField\"] = stage.foreignField;\n\t\t\tif (stage.pipeline) lookup[\"pipeline\"] = structuralLowerPipeline(stage.pipeline);\n\t\t\tif (stage.let_) lookup[\"let\"] = lowerExprRecord(stage.let_);\n\t\t\treturn { $lookup: lookup };\n\t\t}\n\t\tcase \"unwind\": {\n\t\t\tconst unwind = {\n\t\t\t\tpath: stage.path,\n\t\t\t\tpreserveNullAndEmptyArrays: stage.preserveNullAndEmptyArrays\n\t\t\t};\n\t\t\tif (stage.includeArrayIndex !== void 0) unwind[\"includeArrayIndex\"] = stage.includeArrayIndex;\n\t\t\treturn { $unwind: unwind };\n\t\t}\n\t\tcase \"group\": {\n\t\t\tconst group = { _id: lowerGroupId(stage.groupId) };\n\t\t\tfor (const [key, acc] of Object.entries(stage.accumulators)) group[key] = lowerAggExpr(acc);\n\t\t\treturn { $group: group };\n\t\t}\n\t\tcase \"addFields\": return { $addFields: lowerExprRecord(stage.fields) };\n\t\tcase \"replaceRoot\": return { $replaceRoot: { newRoot: lowerAggExpr(stage.newRoot) } };\n\t\tcase \"count\": return { $count: stage.field };\n\t\tcase \"sortByCount\": return { $sortByCount: lowerAggExpr(stage.expr) };\n\t\tcase \"sample\": return { $sample: { size: stage.size } };\n\t\tcase \"redact\": return { $redact: lowerAggExpr(stage.expr) };\n\t\tcase \"out\": return { $out: stage.db ? {\n\t\t\tdb: stage.db,\n\t\t\tcoll: stage.collection\n\t\t} : stage.collection };\n\t\tcase \"unionWith\": {\n\t\t\tconst unionWith = { coll: stage.collection };\n\t\t\tif (stage.pipeline) unionWith[\"pipeline\"] = structuralLowerPipeline(stage.pipeline);\n\t\t\treturn { $unionWith: unionWith };\n\t\t}\n\t\tcase \"bucket\": {\n\t\t\tconst bucket = {\n\t\t\t\tgroupBy: lowerAggExpr(stage.groupBy),\n\t\t\t\tboundaries: [...stage.boundaries]\n\t\t\t};\n\t\t\tif (stage.default_ !== void 0) bucket[\"default\"] = stage.default_;\n\t\t\tif (stage.output) bucket[\"output\"] = lowerExprRecord(stage.output);\n\t\t\treturn { $bucket: bucket };\n\t\t}\n\t\tcase \"bucketAuto\": {\n\t\t\tconst bucketAuto = {\n\t\t\t\tgroupBy: lowerAggExpr(stage.groupBy),\n\t\t\t\tbuckets: stage.buckets\n\t\t\t};\n\t\t\tif (stage.output) bucketAuto[\"output\"] = lowerExprRecord(stage.output);\n\t\t\tif (stage.granularity !== void 0) bucketAuto[\"granularity\"] = stage.granularity;\n\t\t\treturn { $bucketAuto: bucketAuto };\n\t\t}\n\t\tcase \"geoNear\": {\n\t\t\tconst geoNear = {\n\t\t\t\tnear: stage.near,\n\t\t\t\tdistanceField: stage.distanceField\n\t\t\t};\n\t\t\tif (stage.spherical !== void 0) geoNear[\"spherical\"] = stage.spherical;\n\t\t\tif (stage.maxDistance !== void 0) geoNear[\"maxDistance\"] = stage.maxDistance;\n\t\t\tif (stage.minDistance !== void 0) geoNear[\"minDistance\"] = stage.minDistance;\n\t\t\tif (stage.query) geoNear[\"query\"] = structuralLowerFilter(stage.query);\n\t\t\tif (stage.key !== void 0) geoNear[\"key\"] = stage.key;\n\t\t\tif (stage.distanceMultiplier !== void 0) geoNear[\"distanceMultiplier\"] = stage.distanceMultiplier;\n\t\t\tif (stage.includeLocs !== void 0) geoNear[\"includeLocs\"] = stage.includeLocs;\n\t\t\treturn { $geoNear: geoNear };\n\t\t}\n\t\tcase \"facet\": {\n\t\t\tconst facet = {};\n\t\t\tfor (const [key, pipeline] of Object.entries(stage.facets)) facet[key] = structuralLowerPipeline(pipeline);\n\t\t\treturn { $facet: facet };\n\t\t}\n\t\tcase \"graphLookup\": {\n\t\t\tconst graphLookup = {\n\t\t\t\tfrom: stage.from,\n\t\t\t\tstartWith: lowerAggExpr(stage.startWith),\n\t\t\t\tconnectFromField: stage.connectFromField,\n\t\t\t\tconnectToField: stage.connectToField,\n\t\t\t\tas: stage.as\n\t\t\t};\n\t\t\tif (stage.maxDepth !== void 0) graphLookup[\"maxDepth\"] = stage.maxDepth;\n\t\t\tif (stage.depthField !== void 0) graphLookup[\"depthField\"] = stage.depthField;\n\t\t\tif (stage.restrictSearchWithMatch) graphLookup[\"restrictSearchWithMatch\"] = structuralLowerFilter(stage.restrictSearchWithMatch);\n\t\t\treturn { $graphLookup: graphLookup };\n\t\t}\n\t\tcase \"merge\": {\n\t\t\tconst merge = { into: stage.into };\n\t\t\tif (stage.on !== void 0) merge[\"on\"] = stage.on;\n\t\t\tif (stage.whenMatched !== void 0) merge[\"whenMatched\"] = Array.isArray(stage.whenMatched) ? structuralLowerPipeline(stage.whenMatched) : stage.whenMatched;\n\t\t\tif (stage.whenNotMatched !== void 0) merge[\"whenNotMatched\"] = stage.whenNotMatched;\n\t\t\treturn { $merge: merge };\n\t\t}\n\t\tcase \"setWindowFields\": {\n\t\t\tconst swf = {};\n\t\t\tif (stage.partitionBy) swf[\"partitionBy\"] = lowerAggExpr(stage.partitionBy);\n\t\t\tif (stage.sortBy) swf[\"sortBy\"] = { ...stage.sortBy };\n\t\t\tconst output = {};\n\t\t\tfor (const [key, wf] of Object.entries(stage.output)) output[key] = lowerWindowField(wf);\n\t\t\tswf[\"output\"] = output;\n\t\t\treturn { $setWindowFields: swf };\n\t\t}\n\t\tcase \"densify\": {\n\t\t\tconst densify = {\n\t\t\t\tfield: stage.field,\n\t\t\t\trange: { ...stage.range }\n\t\t\t};\n\t\t\tif (stage.partitionByFields) densify[\"partitionByFields\"] = [...stage.partitionByFields];\n\t\t\treturn { $densify: densify };\n\t\t}\n\t\tcase \"fill\": {\n\t\t\tconst fill = {};\n\t\t\tif (stage.partitionBy) fill[\"partitionBy\"] = lowerAggExpr(stage.partitionBy);\n\t\t\tif (stage.partitionByFields) fill[\"partitionByFields\"] = [...stage.partitionByFields];\n\t\t\tif (stage.sortBy) fill[\"sortBy\"] = { ...stage.sortBy };\n\t\t\tconst output = {};\n\t\t\tfor (const [key, fo] of Object.entries(stage.output)) {\n\t\t\t\tconst entry = {};\n\t\t\t\tif (fo.method !== void 0) entry[\"method\"] = fo.method;\n\t\t\t\tif (fo.value !== void 0) entry[\"value\"] = lowerAggExpr(fo.value);\n\t\t\t\toutput[key] = entry;\n\t\t\t}\n\t\t\tfill[\"output\"] = output;\n\t\t\treturn { $fill: fill };\n\t\t}\n\t\tcase \"search\": {\n\t\t\tconst search = { ...stage.config };\n\t\t\tif (stage.index !== void 0) search[\"index\"] = stage.index;\n\t\t\treturn { $search: search };\n\t\t}\n\t\tcase \"searchMeta\": {\n\t\t\tconst searchMeta = { ...stage.config };\n\t\t\tif (stage.index !== void 0) searchMeta[\"index\"] = stage.index;\n\t\t\treturn { $searchMeta: searchMeta };\n\t\t}\n\t\tcase \"vectorSearch\": {\n\t\t\tconst vs = {\n\t\t\t\tindex: stage.index,\n\t\t\t\tpath: stage.path,\n\t\t\t\tqueryVector: [...stage.queryVector],\n\t\t\t\tnumCandidates: stage.numCandidates,\n\t\t\t\tlimit: stage.limit\n\t\t\t};\n\t\t\tif (stage.filter) vs[\"filter\"] = { ...stage.filter };\n\t\t\treturn { $vectorSearch: vs };\n\t\t}\n\t\tdefault: {\n\t\t\tconst _exhaustive = stage;\n\t\t\treturn assertNever(_exhaustive, `Unhandled stage kind: ${blindCast(_exhaustive).kind}`);\n\t\t}\n\t}\n}\nfunction structuralLowerPipeline(stages) {\n\treturn stages.map((s) => structuralLowerStage(s));\n}\n//#endregion\n//#region src/mongo-adapter.ts\nfunction isUpdatePipeline(update) {\n\treturn Array.isArray(update);\n}\nfunction isDraftUpdatePipeline(update) {\n\treturn Array.isArray(update);\n}\nasync function resolveUpdate(update, codecs, ctx) {\n\tif (isDraftUpdatePipeline(update)) return Promise.all(update.map((stage) => resolveDraftDoc(stage, codecs, ctx)));\n\treturn resolveDraftDoc(update, codecs, ctx);\n}\nfunction lowerDdlCommand(command) {\n\tswitch (command.kind) {\n\t\tcase \"createCollection\": return new CreateCollectionWireCommand(command.collection, command);\n\t\tcase \"createIndex\": return new CreateIndexWireCommand(command.collection, keysToKeySpec(command.keys), command);\n\t\tcase \"dropCollection\": return new DropCollectionWireCommand(command.collection);\n\t\tcase \"dropIndex\": return new DropIndexWireCommand(command.collection, command.name);\n\t\tcase \"collMod\": return new CollModWireCommand(command.collection, command);\n\t\t// v8 ignore next 4\n\t\tdefault: {\n\t\t\tconst _exhaustive = command;\n\t\t\treturn assertNever(_exhaustive, `Unknown DDL command kind: ${blindCast(_exhaustive).kind}`);\n\t\t}\n\t}\n}\nvar MongoAdapterImpl = class {\n\t#codecs;\n\tconstructor(codecs) {\n\t\tthis.#codecs = codecs;\n\t}\n\tstructuralLower(plan) {\n\t\tconst { command } = plan;\n\t\tswitch (command.kind) {\n\t\t\tcase \"insertOne\": return {\n\t\t\t\tkind: \"insertOne\",\n\t\t\t\tcollection: command.collection,\n\t\t\t\tdocument: command.document\n\t\t\t};\n\t\t\tcase \"insertMany\": return {\n\t\t\t\tkind: \"insertMany\",\n\t\t\t\tcollection: command.collection,\n\t\t\t\tdocuments: command.documents\n\t\t\t};\n\t\t\tcase \"updateOne\": return {\n\t\t\t\tkind: \"updateOne\",\n\t\t\t\tcollection: command.collection,\n\t\t\t\tfilter: structuralLowerFilter(command.filter),\n\t\t\t\tupdate: isUpdatePipeline(command.update) ? structuralLowerPipeline(command.update) : command.update,\n\t\t\t\tupsert: command.upsert\n\t\t\t};\n\t\t\tcase \"updateMany\": return {\n\t\t\t\tkind: \"updateMany\",\n\t\t\t\tcollection: command.collection,\n\t\t\t\tfilter: structuralLowerFilter(command.filter),\n\t\t\t\tupdate: isUpdatePipeline(command.update) ? structuralLowerPipeline(command.update) : command.update,\n\t\t\t\tupsert: command.upsert\n\t\t\t};\n\t\t\tcase \"deleteOne\": return {\n\t\t\t\tkind: \"deleteOne\",\n\t\t\t\tcollection: command.collection,\n\t\t\t\tfilter: structuralLowerFilter(command.filter)\n\t\t\t};\n\t\t\tcase \"deleteMany\": return {\n\t\t\t\tkind: \"deleteMany\",\n\t\t\t\tcollection: command.collection,\n\t\t\t\tfilter: structuralLowerFilter(command.filter)\n\t\t\t};\n\t\t\tcase \"findOneAndUpdate\": return {\n\t\t\t\tkind: \"findOneAndUpdate\",\n\t\t\t\tcollection: command.collection,\n\t\t\t\tfilter: structuralLowerFilter(command.filter),\n\t\t\t\tupdate: isUpdatePipeline(command.update) ? structuralLowerPipeline(command.update) : command.update,\n\t\t\t\tupsert: command.upsert,\n\t\t\t\tsort: command.sort,\n\t\t\t\treturnDocument: command.returnDocument\n\t\t\t};\n\t\t\tcase \"findOneAndDelete\": return {\n\t\t\t\tkind: \"findOneAndDelete\",\n\t\t\t\tcollection: command.collection,\n\t\t\t\tfilter: structuralLowerFilter(command.filter),\n\t\t\t\tsort: command.sort\n\t\t\t};\n\t\t\tcase \"aggregate\": return {\n\t\t\t\tkind: \"aggregate\",\n\t\t\t\tcollection: command.collection,\n\t\t\t\tpipeline: structuralLowerPipeline(command.pipeline)\n\t\t\t};\n\t\t\tcase \"rawAggregate\": return {\n\t\t\t\tkind: \"rawAggregate\",\n\t\t\t\tcollection: command.collection,\n\t\t\t\tpipeline: command.pipeline\n\t\t\t};\n\t\t\tcase \"rawInsertOne\": return {\n\t\t\t\tkind: \"rawInsertOne\",\n\t\t\t\tcollection: command.collection,\n\t\t\t\tdocument: command.document\n\t\t\t};\n\t\t\tcase \"rawInsertMany\": return {\n\t\t\t\tkind: \"rawInsertMany\",\n\t\t\t\tcollection: command.collection,\n\t\t\t\tdocuments: command.documents\n\t\t\t};\n\t\t\tcase \"rawUpdateOne\": return {\n\t\t\t\tkind: \"rawUpdateOne\",\n\t\t\t\tcollection: command.collection,\n\t\t\t\tfilter: command.filter,\n\t\t\t\tupdate: command.update\n\t\t\t};\n\t\t\tcase \"rawUpdateMany\": return {\n\t\t\t\tkind: \"rawUpdateMany\",\n\t\t\t\tcollection: command.collection,\n\t\t\t\tfilter: command.filter,\n\t\t\t\tupdate: command.update\n\t\t\t};\n\t\t\tcase \"rawDeleteOne\": return {\n\t\t\t\tkind: \"rawDeleteOne\",\n\t\t\t\tcollection: command.collection,\n\t\t\t\tfilter: command.filter\n\t\t\t};\n\t\t\tcase \"rawDeleteMany\": return {\n\t\t\t\tkind: \"rawDeleteMany\",\n\t\t\t\tcollection: command.collection,\n\t\t\t\tfilter: command.filter\n\t\t\t};\n\t\t\tcase \"rawFindOneAndUpdate\": return {\n\t\t\t\tkind: \"rawFindOneAndUpdate\",\n\t\t\t\tcollection: command.collection,\n\t\t\t\tfilter: command.filter,\n\t\t\t\tupdate: command.update,\n\t\t\t\tupsert: command.upsert,\n\t\t\t\tsort: command.sort,\n\t\t\t\treturnDocument: command.returnDocument\n\t\t\t};\n\t\t\tcase \"rawFindOneAndDelete\": return {\n\t\t\t\tkind: \"rawFindOneAndDelete\",\n\t\t\t\tcollection: command.collection,\n\t\t\t\tfilter: command.filter,\n\t\t\t\tsort: command.sort\n\t\t\t};\n\t\t\t// v8 ignore next 4\n\t\t\tdefault: {\n\t\t\t\tconst _exhaustive = command;\n\t\t\t\treturn assertNever(_exhaustive, `Unknown command kind: ${blindCast(_exhaustive).kind}`);\n\t\t\t}\n\t\t}\n\t}\n\tasync resolveParams(draft, ctx) {\n\t\tswitch (draft.kind) {\n\t\t\tcase \"insertOne\": return new InsertOneWireCommand(draft.collection, await resolveDraftDoc(draft.document, this.#codecs, ctx));\n\t\t\tcase \"insertMany\": return new InsertManyWireCommand(draft.collection, await Promise.all(draft.documents.map((doc) => resolveDraftDoc(doc, this.#codecs, ctx))));\n\t\t\tcase \"updateOne\": {\n\t\t\t\tconst [filter, update] = await Promise.all([resolveDraftDoc(draft.filter, this.#codecs, ctx), resolveUpdate(draft.update, this.#codecs, ctx)]);\n\t\t\t\treturn new UpdateOneWireCommand(draft.collection, filter, update, draft.upsert);\n\t\t\t}\n\t\t\tcase \"updateMany\": {\n\t\t\t\tconst [filter, update] = await Promise.all([resolveDraftDoc(draft.filter, this.#codecs, ctx), resolveUpdate(draft.update, this.#codecs, ctx)]);\n\t\t\t\treturn new UpdateManyWireCommand(draft.collection, filter, update, draft.upsert);\n\t\t\t}\n\t\t\tcase \"deleteOne\": return new DeleteOneWireCommand(draft.collection, await resolveDraftDoc(draft.filter, this.#codecs, ctx));\n\t\t\tcase \"deleteMany\": return new DeleteManyWireCommand(draft.collection, await resolveDraftDoc(draft.filter, this.#codecs, ctx));\n\t\t\tcase \"findOneAndUpdate\": {\n\t\t\t\tconst [filter, update] = await Promise.all([resolveDraftDoc(draft.filter, this.#codecs, ctx), resolveUpdate(draft.update, this.#codecs, ctx)]);\n\t\t\t\treturn new FindOneAndUpdateWireCommand(draft.collection, filter, update, draft.upsert, draft.sort, draft.returnDocument);\n\t\t\t}\n\t\t\tcase \"findOneAndDelete\": return new FindOneAndDeleteWireCommand(draft.collection, await resolveDraftDoc(draft.filter, this.#codecs, ctx), draft.sort);\n\t\t\tcase \"aggregate\": return new AggregateWireCommand(draft.collection, await Promise.all(draft.pipeline.map((stage) => resolveDraftDoc(stage, this.#codecs, ctx))));\n\t\t\tcase \"rawAggregate\": return new AggregateWireCommand(draft.collection, draft.pipeline);\n\t\t\tcase \"rawInsertOne\": return new InsertOneWireCommand(draft.collection, draft.document);\n\t\t\tcase \"rawInsertMany\": return new InsertManyWireCommand(draft.collection, draft.documents);\n\t\t\tcase \"rawUpdateOne\": return new UpdateOneWireCommand(draft.collection, draft.filter, draft.update);\n\t\t\tcase \"rawUpdateMany\": return new UpdateManyWireCommand(draft.collection, draft.filter, draft.update);\n\t\t\tcase \"rawDeleteOne\": return new DeleteOneWireCommand(draft.collection, draft.filter);\n\t\t\tcase \"rawDeleteMany\": return new DeleteManyWireCommand(draft.collection, draft.filter);\n\t\t\tcase \"rawFindOneAndUpdate\": return new FindOneAndUpdateWireCommand(draft.collection, draft.filter, draft.update, draft.upsert, draft.sort, draft.returnDocument);\n\t\t\tcase \"rawFindOneAndDelete\": return new FindOneAndDeleteWireCommand(draft.collection, draft.filter, draft.sort);\n\t\t\t// v8 ignore next 4\n\t\t\tdefault: {\n\t\t\t\tconst _exhaustive = draft;\n\t\t\t\treturn assertNever(_exhaustive, `Unknown draft kind: ${blindCast(_exhaustive).kind}`);\n\t\t\t}\n\t\t}\n\t}\n\tlower(plan, ctx) {\n\t\tif (\"collection\" in plan) return this.resolveParams(this.structuralLower(plan), ctx);\n\t\treturn Promise.resolve(lowerDdlCommand(plan.command));\n\t}\n};\n/**\n* Construct a Mongo adapter with the standard wire-type codecs registered\n* for encode-side dispatch (`MongoParamRef.codecId` lookups).\n*\n* The runtime-side codec registry the runtime decodes against is composed\n* separately by `createMongoExecutionContext`. This factory exists for\n* direct adapter use (the runtime descriptor's `create(stack)` calls\n* through it). User code should compose a stack/context instead.\n*/\nfunction createMongoAdapter() {\n\treturn new MongoAdapterImpl(buildStandardCodecRegistry());\n}\n//#endregion\nexport { lowerStage as a, lowerPipeline as i, lowerAggExpr as n, lowerFilter as r, createMongoAdapter as t };\n\n//# sourceMappingURL=mongo-adapter-B2HEyX0b.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,eAAe,aAAa,OAAO,QAAQ,KAAK;CAC/C,aAAa,KAAK,QAAQ;CAC1B,MAAM,SAAS,IAAI;CACnB,IAAI,iBAAiB,eAAe;EACnC,IAAI,MAAM,SAAS;GAClB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uB,UAAU,WAAW,CAAC,CAAC,MAAM;GACrF;EACD;CACD;CACA,MAAM,MAAM,KAAK;EAChB,IAAI,gBAAgB,MAAM,OAAO,KAAK,cAAc,KAAK,gBAAgB,IAAI,GAAG,GAAG;EACnF,OAAO,QAAQ,QAAQ,gBAAgB,KAAK,OAAO,CAAC;CACrD;AACD;;;;;;;;;;AAUA,SAAS,qBAAqB;CAC7B,OAAO,IAAI,iBAAiB,2BAA2B,CAAC;AACzD"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { assertNever } from "@prisma/orm-framework/utils/internal-error";
|
|
2
2
|
import { MongoClient } from "mongodb";
|
|
3
|
-
//#region ../../../3-mongo-target/3-mongo-driver/dist/mongo-driver-
|
|
3
|
+
//#region ../../../3-mongo-target/3-mongo-driver/dist/mongo-driver-Hpw9TL41.mjs
|
|
4
4
|
const DRIVER_INFO = {
|
|
5
5
|
name: "Prisma",
|
|
6
|
-
version: "8.0.0-rc.1-dev.
|
|
6
|
+
version: "8.0.0-rc.1-dev.42"
|
|
7
7
|
};
|
|
8
8
|
/* v8 ignore start */
|
|
9
9
|
function unreachableKind(value) {
|
|
@@ -158,4 +158,4 @@ async function createMongoDriver(uri, dbName) {
|
|
|
158
158
|
//#endregion
|
|
159
159
|
export { MongoDriverImpl as n, createMongoDriver as r, DRIVER_INFO as t };
|
|
160
160
|
|
|
161
|
-
//# sourceMappingURL=mongo-driver-
|
|
161
|
+
//# sourceMappingURL=mongo-driver-Hpw9TL41-BG1C2ntD.mjs.map
|
package/dist/{mongo-driver-C6c16kOh-CXVK5hwV.mjs.map → mongo-driver-Hpw9TL41-BG1C2ntD.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mongo-driver-C6c16kOh-CXVK5hwV.mjs","names":[],"sources":["../../../../3-mongo-target/3-mongo-driver/dist/mongo-driver-C6c16kOh.mjs"],"sourcesContent":["import { assertNever } from \"@internal/utils/internal-error\";\nimport { MongoClient } from \"mongodb\";\n//#endregion\n//#region src/core/driver-info.ts\nconst DRIVER_INFO = {\n\tname: \"Prisma\",\n\tversion: \"8.0.0-rc.1-dev.40\"\n};\n//#endregion\n//#region src/mongo-driver.ts\n/* v8 ignore start */\nfunction unreachableKind(value) {\n\tconst candidate = value;\n\tif (typeof candidate === \"object\" && candidate !== null && \"kind\" in candidate && typeof candidate.kind === \"string\") return candidate.kind;\n\treturn \"unknown\";\n}\n/* v8 ignore stop */\nvar MongoDriverImpl = class MongoDriverImpl {\n\tdb;\n\tclient;\n\tconstructor(db, client) {\n\t\tthis.db = db;\n\t\tthis.client = client;\n\t}\n\tstatic async fromConnection(uri, dbName) {\n\t\tconst client = new MongoClient(uri, { driverInfo: DRIVER_INFO });\n\t\tawait client.connect();\n\t\treturn new MongoDriverImpl(client.db(dbName), client);\n\t}\n\tstatic fromDb(db) {\n\t\treturn new MongoDriverImpl(db, void 0);\n\t}\n\texecute(wireCommand) {\n\t\tswitch (wireCommand.kind) {\n\t\t\tcase \"insertOne\": return this.executeInsertOneCommand(wireCommand);\n\t\t\tcase \"updateOne\": return this.executeUpdateOneCommand(wireCommand);\n\t\t\tcase \"insertMany\": return this.executeInsertManyCommand(wireCommand);\n\t\t\tcase \"updateMany\": return this.executeUpdateManyCommand(wireCommand);\n\t\t\tcase \"deleteOne\": return this.executeDeleteOneCommand(wireCommand);\n\t\t\tcase \"deleteMany\": return this.executeDeleteManyCommand(wireCommand);\n\t\t\tcase \"findOneAndUpdate\": return this.executeFindOneAndUpdateCommand(wireCommand);\n\t\t\tcase \"findOneAndDelete\": return this.executeFindOneAndDeleteCommand(wireCommand);\n\t\t\tcase \"aggregate\": return this.executeAggregateCommand(wireCommand);\n\t\t\t// v8 ignore next 4\n\t\t\tdefault: return assertNever(wireCommand, `Unknown wire command kind: ${unreachableKind(wireCommand)}`);\n\t\t}\n\t}\n\tasync run(wireCommand) {\n\t\tswitch (wireCommand.kind) {\n\t\t\tcase \"createCollection\": return this.executeCreateCollectionCommand(wireCommand);\n\t\t\tcase \"createIndex\": return this.executeCreateIndexCommand(wireCommand);\n\t\t\tcase \"dropCollection\": return this.executeDropCollectionCommand(wireCommand);\n\t\t\tcase \"dropIndex\": return this.executeDropIndexCommand(wireCommand);\n\t\t\tcase \"collMod\": return this.executeCollModCommand(wireCommand);\n\t\t\t// v8 ignore next 4\n\t\t\tdefault: return assertNever(wireCommand, `Unknown DDL wire command kind: ${unreachableKind(wireCommand)}`);\n\t\t}\n\t}\n\tasync close() {\n\t\tawait this.client?.close();\n\t}\n\tasync *executeInsertOneCommand(cmd) {\n\t\tyield { insertedId: (await this.db.collection(cmd.collection).insertOne(cmd.document)).insertedId };\n\t}\n\tasync *executeUpdateOneCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).updateOne(cmd.filter, cmd.update, { upsert: cmd.upsert });\n\t\tyield {\n\t\t\tmatchedCount: result.matchedCount,\n\t\t\tmodifiedCount: result.modifiedCount,\n\t\t\tupsertedCount: result.upsertedCount,\n\t\t\tupsertedId: result.upsertedId ?? void 0\n\t\t};\n\t}\n\tasync *executeInsertManyCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).insertMany(cmd.documents);\n\t\tyield {\n\t\t\tinsertedIds: Object.values(result.insertedIds),\n\t\t\tinsertedCount: result.insertedCount\n\t\t};\n\t}\n\tasync *executeUpdateManyCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).updateMany(cmd.filter, cmd.update, { upsert: cmd.upsert });\n\t\tyield {\n\t\t\tmatchedCount: result.matchedCount,\n\t\t\tmodifiedCount: result.modifiedCount,\n\t\t\tupsertedCount: result.upsertedCount,\n\t\t\tupsertedId: result.upsertedId ?? void 0\n\t\t};\n\t}\n\tasync *executeDeleteOneCommand(cmd) {\n\t\tyield { deletedCount: (await this.db.collection(cmd.collection).deleteOne(cmd.filter)).deletedCount };\n\t}\n\tasync *executeDeleteManyCommand(cmd) {\n\t\tyield { deletedCount: (await this.db.collection(cmd.collection).deleteMany(cmd.filter)).deletedCount };\n\t}\n\tasync *executeFindOneAndUpdateCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).findOneAndUpdate(cmd.filter, cmd.update, {\n\t\t\tupsert: cmd.upsert,\n\t\t\t...cmd.returnDocument != null ? { returnDocument: cmd.returnDocument } : {},\n\t\t\t...cmd.sort != null ? { sort: cmd.sort } : {}\n\t\t});\n\t\tif (result) yield result;\n\t}\n\tasync *executeFindOneAndDeleteCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).findOneAndDelete(cmd.filter, { ...cmd.sort != null ? { sort: cmd.sort } : {} });\n\t\tif (result) yield result;\n\t}\n\tasync *executeAggregateCommand(cmd) {\n\t\tyield* this.db.collection(cmd.collection).aggregate(cmd.pipeline);\n\t}\n\tasync executeCreateCollectionCommand(cmd) {\n\t\tconst { validator, validationLevel, validationAction, capped, size, max, timeseries, collation, changeStreamPreAndPostImages, clusteredIndex } = cmd;\n\t\tawait this.db.createCollection(cmd.collection, {\n\t\t\t...validator !== void 0 ? { validator } : {},\n\t\t\t...validationLevel !== void 0 ? { validationLevel } : {},\n\t\t\t...validationAction !== void 0 ? { validationAction } : {},\n\t\t\t...capped !== void 0 ? { capped } : {},\n\t\t\t...size !== void 0 ? { size } : {},\n\t\t\t...max !== void 0 ? { max } : {},\n\t\t\t...timeseries !== void 0 ? { timeseries } : {},\n\t\t\t...collation !== void 0 ? { collation } : {},\n\t\t\t...changeStreamPreAndPostImages !== void 0 ? { changeStreamPreAndPostImages } : {},\n\t\t\t...clusteredIndex !== void 0 ? { clusteredIndex } : {}\n\t\t});\n\t}\n\tasync executeCreateIndexCommand(cmd) {\n\t\tconst { unique, sparse, expireAfterSeconds, partialFilterExpression, name, wildcardProjection, collation, weights, default_language, language_override } = cmd;\n\t\tawait this.db.collection(cmd.collection).createIndex(cmd.key, {\n\t\t\t...unique !== void 0 ? { unique } : {},\n\t\t\t...sparse !== void 0 ? { sparse } : {},\n\t\t\t...expireAfterSeconds !== void 0 ? { expireAfterSeconds } : {},\n\t\t\t...partialFilterExpression !== void 0 ? { partialFilterExpression } : {},\n\t\t\t...name !== void 0 ? { name } : {},\n\t\t\t...wildcardProjection !== void 0 ? { wildcardProjection } : {},\n\t\t\t...collation !== void 0 ? { collation } : {},\n\t\t\t...weights !== void 0 ? { weights } : {},\n\t\t\t...default_language !== void 0 ? { default_language } : {},\n\t\t\t...language_override !== void 0 ? { language_override } : {}\n\t\t});\n\t}\n\tasync executeDropCollectionCommand(cmd) {\n\t\tawait this.db.collection(cmd.collection).drop();\n\t}\n\tasync executeDropIndexCommand(cmd) {\n\t\tawait this.db.collection(cmd.collection).dropIndex(cmd.name);\n\t}\n\tasync executeCollModCommand(cmd) {\n\t\tconst { validator, validationLevel, validationAction, changeStreamPreAndPostImages } = cmd;\n\t\tawait this.db.command({\n\t\t\tcollMod: cmd.collection,\n\t\t\t...validator !== void 0 ? { validator } : {},\n\t\t\t...validationLevel !== void 0 ? { validationLevel } : {},\n\t\t\t...validationAction !== void 0 ? { validationAction } : {},\n\t\t\t...changeStreamPreAndPostImages !== void 0 ? { changeStreamPreAndPostImages } : {}\n\t\t});\n\t}\n};\nasync function createMongoDriver(uri, dbName) {\n\treturn MongoDriverImpl.fromConnection(uri, dbName);\n}\n//#endregion\nexport { createMongoDriver as n, DRIVER_INFO as r, MongoDriverImpl as t };\n\n//# sourceMappingURL=mongo-driver-C6c16kOh.mjs.map"],"mappings":";;;AAIA,MAAM,cAAc;CACnB,MAAM;CACN,SAAS;AACV;;AAIA,SAAS,gBAAgB,OAAO;CAC/B,MAAM,YAAY;CAClB,IAAI,OAAO,cAAc,YAAY,cAAc,QAAQ,UAAU,aAAa,OAAO,UAAU,SAAS,UAAU,OAAO,UAAU;CACvI,OAAO;AACR;;AAEA,IAAI,kBAAkB,MAAM,gBAAgB;CAC3C;CACA;CACA,YAAY,IAAI,QAAQ;EACvB,KAAK,KAAK;EACV,KAAK,SAAS;CACf;CACA,aAAa,eAAe,KAAK,QAAQ;EACx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E,iBAAiB,IAAI,CAAC;GACzD,GAAG,iCAAiC,KAAK,IAAI,EAAE,6BAA6B,IAAI,CAAC;EAClF,CAAC;CACF;AACD;AACA,eAAe,kBAAkB,KAAK,QAAQ;CAC7C,OAAO,gBAAgB,eAAe,KAAK,MAAM;AAClD"}
|
|
1
|
+
{"version":3,"file":"mongo-driver-Hpw9TL41-BG1C2ntD.mjs","names":[],"sources":["../../../../3-mongo-target/3-mongo-driver/dist/mongo-driver-Hpw9TL41.mjs"],"sourcesContent":["import { assertNever } from \"@internal/utils/internal-error\";\nimport { MongoClient } from \"mongodb\";\n//#endregion\n//#region src/core/driver-info.ts\nconst DRIVER_INFO = {\n\tname: \"Prisma\",\n\tversion: \"8.0.0-rc.1-dev.42\"\n};\n//#endregion\n//#region src/mongo-driver.ts\n/* v8 ignore start */\nfunction unreachableKind(value) {\n\tconst candidate = value;\n\tif (typeof candidate === \"object\" && candidate !== null && \"kind\" in candidate && typeof candidate.kind === \"string\") return candidate.kind;\n\treturn \"unknown\";\n}\n/* v8 ignore stop */\nvar MongoDriverImpl = class MongoDriverImpl {\n\tdb;\n\tclient;\n\tconstructor(db, client) {\n\t\tthis.db = db;\n\t\tthis.client = client;\n\t}\n\tstatic async fromConnection(uri, dbName) {\n\t\tconst client = new MongoClient(uri, { driverInfo: DRIVER_INFO });\n\t\tawait client.connect();\n\t\treturn new MongoDriverImpl(client.db(dbName), client);\n\t}\n\tstatic fromDb(db) {\n\t\treturn new MongoDriverImpl(db, void 0);\n\t}\n\texecute(wireCommand) {\n\t\tswitch (wireCommand.kind) {\n\t\t\tcase \"insertOne\": return this.executeInsertOneCommand(wireCommand);\n\t\t\tcase \"updateOne\": return this.executeUpdateOneCommand(wireCommand);\n\t\t\tcase \"insertMany\": return this.executeInsertManyCommand(wireCommand);\n\t\t\tcase \"updateMany\": return this.executeUpdateManyCommand(wireCommand);\n\t\t\tcase \"deleteOne\": return this.executeDeleteOneCommand(wireCommand);\n\t\t\tcase \"deleteMany\": return this.executeDeleteManyCommand(wireCommand);\n\t\t\tcase \"findOneAndUpdate\": return this.executeFindOneAndUpdateCommand(wireCommand);\n\t\t\tcase \"findOneAndDelete\": return this.executeFindOneAndDeleteCommand(wireCommand);\n\t\t\tcase \"aggregate\": return this.executeAggregateCommand(wireCommand);\n\t\t\t// v8 ignore next 4\n\t\t\tdefault: return assertNever(wireCommand, `Unknown wire command kind: ${unreachableKind(wireCommand)}`);\n\t\t}\n\t}\n\tasync run(wireCommand) {\n\t\tswitch (wireCommand.kind) {\n\t\t\tcase \"createCollection\": return this.executeCreateCollectionCommand(wireCommand);\n\t\t\tcase \"createIndex\": return this.executeCreateIndexCommand(wireCommand);\n\t\t\tcase \"dropCollection\": return this.executeDropCollectionCommand(wireCommand);\n\t\t\tcase \"dropIndex\": return this.executeDropIndexCommand(wireCommand);\n\t\t\tcase \"collMod\": return this.executeCollModCommand(wireCommand);\n\t\t\t// v8 ignore next 4\n\t\t\tdefault: return assertNever(wireCommand, `Unknown DDL wire command kind: ${unreachableKind(wireCommand)}`);\n\t\t}\n\t}\n\tasync close() {\n\t\tawait this.client?.close();\n\t}\n\tasync *executeInsertOneCommand(cmd) {\n\t\tyield { insertedId: (await this.db.collection(cmd.collection).insertOne(cmd.document)).insertedId };\n\t}\n\tasync *executeUpdateOneCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).updateOne(cmd.filter, cmd.update, { upsert: cmd.upsert });\n\t\tyield {\n\t\t\tmatchedCount: result.matchedCount,\n\t\t\tmodifiedCount: result.modifiedCount,\n\t\t\tupsertedCount: result.upsertedCount,\n\t\t\tupsertedId: result.upsertedId ?? void 0\n\t\t};\n\t}\n\tasync *executeInsertManyCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).insertMany(cmd.documents);\n\t\tyield {\n\t\t\tinsertedIds: Object.values(result.insertedIds),\n\t\t\tinsertedCount: result.insertedCount\n\t\t};\n\t}\n\tasync *executeUpdateManyCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).updateMany(cmd.filter, cmd.update, { upsert: cmd.upsert });\n\t\tyield {\n\t\t\tmatchedCount: result.matchedCount,\n\t\t\tmodifiedCount: result.modifiedCount,\n\t\t\tupsertedCount: result.upsertedCount,\n\t\t\tupsertedId: result.upsertedId ?? void 0\n\t\t};\n\t}\n\tasync *executeDeleteOneCommand(cmd) {\n\t\tyield { deletedCount: (await this.db.collection(cmd.collection).deleteOne(cmd.filter)).deletedCount };\n\t}\n\tasync *executeDeleteManyCommand(cmd) {\n\t\tyield { deletedCount: (await this.db.collection(cmd.collection).deleteMany(cmd.filter)).deletedCount };\n\t}\n\tasync *executeFindOneAndUpdateCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).findOneAndUpdate(cmd.filter, cmd.update, {\n\t\t\tupsert: cmd.upsert,\n\t\t\t...cmd.returnDocument != null ? { returnDocument: cmd.returnDocument } : {},\n\t\t\t...cmd.sort != null ? { sort: cmd.sort } : {}\n\t\t});\n\t\tif (result) yield result;\n\t}\n\tasync *executeFindOneAndDeleteCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).findOneAndDelete(cmd.filter, { ...cmd.sort != null ? { sort: cmd.sort } : {} });\n\t\tif (result) yield result;\n\t}\n\tasync *executeAggregateCommand(cmd) {\n\t\tyield* this.db.collection(cmd.collection).aggregate(cmd.pipeline);\n\t}\n\tasync executeCreateCollectionCommand(cmd) {\n\t\tconst { validator, validationLevel, validationAction, capped, size, max, timeseries, collation, changeStreamPreAndPostImages, clusteredIndex } = cmd;\n\t\tawait this.db.createCollection(cmd.collection, {\n\t\t\t...validator !== void 0 ? { validator } : {},\n\t\t\t...validationLevel !== void 0 ? { validationLevel } : {},\n\t\t\t...validationAction !== void 0 ? { validationAction } : {},\n\t\t\t...capped !== void 0 ? { capped } : {},\n\t\t\t...size !== void 0 ? { size } : {},\n\t\t\t...max !== void 0 ? { max } : {},\n\t\t\t...timeseries !== void 0 ? { timeseries } : {},\n\t\t\t...collation !== void 0 ? { collation } : {},\n\t\t\t...changeStreamPreAndPostImages !== void 0 ? { changeStreamPreAndPostImages } : {},\n\t\t\t...clusteredIndex !== void 0 ? { clusteredIndex } : {}\n\t\t});\n\t}\n\tasync executeCreateIndexCommand(cmd) {\n\t\tconst { unique, sparse, expireAfterSeconds, partialFilterExpression, name, wildcardProjection, collation, weights, default_language, language_override } = cmd;\n\t\tawait this.db.collection(cmd.collection).createIndex(cmd.key, {\n\t\t\t...unique !== void 0 ? { unique } : {},\n\t\t\t...sparse !== void 0 ? { sparse } : {},\n\t\t\t...expireAfterSeconds !== void 0 ? { expireAfterSeconds } : {},\n\t\t\t...partialFilterExpression !== void 0 ? { partialFilterExpression } : {},\n\t\t\t...name !== void 0 ? { name } : {},\n\t\t\t...wildcardProjection !== void 0 ? { wildcardProjection } : {},\n\t\t\t...collation !== void 0 ? { collation } : {},\n\t\t\t...weights !== void 0 ? { weights } : {},\n\t\t\t...default_language !== void 0 ? { default_language } : {},\n\t\t\t...language_override !== void 0 ? { language_override } : {}\n\t\t});\n\t}\n\tasync executeDropCollectionCommand(cmd) {\n\t\tawait this.db.collection(cmd.collection).drop();\n\t}\n\tasync executeDropIndexCommand(cmd) {\n\t\tawait this.db.collection(cmd.collection).dropIndex(cmd.name);\n\t}\n\tasync executeCollModCommand(cmd) {\n\t\tconst { validator, validationLevel, validationAction, changeStreamPreAndPostImages } = cmd;\n\t\tawait this.db.command({\n\t\t\tcollMod: cmd.collection,\n\t\t\t...validator !== void 0 ? { validator } : {},\n\t\t\t...validationLevel !== void 0 ? { validationLevel } : {},\n\t\t\t...validationAction !== void 0 ? { validationAction } : {},\n\t\t\t...changeStreamPreAndPostImages !== void 0 ? { changeStreamPreAndPostImages } : {}\n\t\t});\n\t}\n};\nasync function createMongoDriver(uri, dbName) {\n\treturn MongoDriverImpl.fromConnection(uri, dbName);\n}\n//#endregion\nexport { createMongoDriver as n, DRIVER_INFO as r, MongoDriverImpl as t };\n\n//# sourceMappingURL=mongo-driver-Hpw9TL41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BAAwB,KAAK;EAClC,MAAM,KAAK,GAAG,WAAW,IAAI,UAAU,CAAC,CAAC,UAAU,IAAI,IAAI;CAC5D;CACA,MAAM,sBAAsB,KAAK;EAChC,MAAM,EAAE,WAAW,iBAAiB,kBAAkB,iCAAiC;EACvF,MAAM,KAAK,GAAG,QAAQ;GACrB,SAAS,IAAI;GACb,GAAG,cAAc,KAAK,IAAI,EAAE,UAAU,IAAI,CAAC;GAC3C,GAAG,oBAAoB,KAAK,IAAI,EAAE,gBAAgB,IAAI,CAAC;GACvD,GAAG,qBAAqB,KAAK,IAAI,EAAE,iBAAiB,IAAI,CAAC;GACzD,GAAG,iCAAiC,KAAK,IAAI,EAAE,6BAA6B,IAAI,CAAC;EAClF,CAAC;CACF;AACD;AACA,eAAe,kBAAkB,KAAK,QAAQ;CAC7C,OAAO,gBAAgB,eAAe,KAAK,MAAM;AAClD"}
|
package/dist/target.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { a as dropCollection, c as validatedCollection, i as dataTransform, n as createCollection, o as dropIndex, r as createIndex, s as setValidation, t as collMod } from "./migration-factories-CCJFG_3e-75oJ8xn2.mjs";
|
|
2
|
-
import { _ as renderCallsToTypeScript, a as DropIndexCall, b as schemaIndexToCreateIndexOptions, c as MongoMigrationRunner, d as MongoTargetSchemaVerifier, f as MongoTargetUnboundDatabase, g as mongoTargetDescriptor, h as deserializeMongoOps, i as DropCollectionCall, l as MongoTargetContractSerializer, m as deserializeMongoOp, n as CreateCollectionCall, o as FilterEvaluator, p as PlannerProducedMongoMigration, r as CreateIndexCall, s as MongoMigrationPlanner, t as CollModCall, u as MongoTargetDatabase, v as renderOps, x as serializeMongoOps, y as schemaCollectionToCreateCollectionOptions } from "./control-
|
|
2
|
+
import { _ as renderCallsToTypeScript, a as DropIndexCall, b as schemaIndexToCreateIndexOptions, c as MongoMigrationRunner, d as MongoTargetSchemaVerifier, f as MongoTargetUnboundDatabase, g as mongoTargetDescriptor, h as deserializeMongoOps, i as DropCollectionCall, l as MongoTargetContractSerializer, m as deserializeMongoOp, n as CreateCollectionCall, o as FilterEvaluator, p as PlannerProducedMongoMigration, r as CreateIndexCall, s as MongoMigrationPlanner, t as CollModCall, u as MongoTargetDatabase, v as renderOps, x as serializeMongoOps, y as schemaCollectionToCreateCollectionOptions } from "./control-DEQAnZTa.mjs";
|
|
3
3
|
import { n as MigrationCLI, r as placeholder, t as Migration } from "./migration-C-jfTsGU.mjs";
|
|
4
4
|
export { CollModCall, CreateCollectionCall, CreateIndexCall, DropCollectionCall, DropIndexCall, FilterEvaluator, Migration, MigrationCLI, MongoMigrationPlanner, MongoMigrationRunner, MongoTargetContractSerializer, MongoTargetDatabase, MongoTargetSchemaVerifier, MongoTargetUnboundDatabase, PlannerProducedMongoMigration, collMod, createCollection, createIndex, dataTransform, deserializeMongoOp, deserializeMongoOps, dropCollection, dropIndex, mongoTargetDescriptor, placeholder, renderCallsToTypeScript, renderOps, schemaCollectionToCreateCollectionOptions, schemaIndexToCreateIndexOptions, serializeMongoOps, setValidation, validatedCollection };
|
package/dist/target__control.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as renderCallsToTypeScript, a as DropIndexCall, b as schemaIndexToCreateIndexOptions, c as MongoMigrationRunner, d as MongoTargetSchemaVerifier, f as MongoTargetUnboundDatabase, g as mongoTargetDescriptor, h as deserializeMongoOps, i as DropCollectionCall, l as MongoTargetContractSerializer, m as deserializeMongoOp, n as CreateCollectionCall, o as FilterEvaluator, p as PlannerProducedMongoMigration, r as CreateIndexCall, s as MongoMigrationPlanner, t as CollModCall, u as MongoTargetDatabase, v as renderOps, x as serializeMongoOps, y as schemaCollectionToCreateCollectionOptions } from "./control-
|
|
1
|
+
import { _ as renderCallsToTypeScript, a as DropIndexCall, b as schemaIndexToCreateIndexOptions, c as MongoMigrationRunner, d as MongoTargetSchemaVerifier, f as MongoTargetUnboundDatabase, g as mongoTargetDescriptor, h as deserializeMongoOps, i as DropCollectionCall, l as MongoTargetContractSerializer, m as deserializeMongoOp, n as CreateCollectionCall, o as FilterEvaluator, p as PlannerProducedMongoMigration, r as CreateIndexCall, s as MongoMigrationPlanner, t as CollModCall, u as MongoTargetDatabase, v as renderOps, x as serializeMongoOps, y as schemaCollectionToCreateCollectionOptions } from "./control-DEQAnZTa.mjs";
|
|
2
2
|
export { CollModCall, CreateCollectionCall, CreateIndexCall, DropCollectionCall, DropIndexCall, FilterEvaluator, MongoMigrationPlanner, MongoMigrationRunner, MongoTargetContractSerializer, MongoTargetDatabase, MongoTargetSchemaVerifier, MongoTargetUnboundDatabase, PlannerProducedMongoMigration, deserializeMongoOp, deserializeMongoOps, mongoTargetDescriptor, renderCallsToTypeScript, renderOps, schemaCollectionToCreateCollectionOptions, schemaIndexToCreateIndexOptions, serializeMongoOps };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-target-mongo",
|
|
3
|
-
"version": "8.0.0-rc.1-dev.
|
|
3
|
+
"version": "8.0.0-rc.1-dev.42",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -9,18 +9,18 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@prisma/orm-family-mongo": "8.0.0-rc.1-dev.
|
|
13
|
-
"@prisma/orm-framework": "8.0.0-rc.1-dev.
|
|
14
|
-
"@prisma/orm-toolchain": "8.0.0-rc.1-dev.
|
|
12
|
+
"@prisma/orm-family-mongo": "8.0.0-rc.1-dev.42",
|
|
13
|
+
"@prisma/orm-framework": "8.0.0-rc.1-dev.42",
|
|
14
|
+
"@prisma/orm-toolchain": "8.0.0-rc.1-dev.42",
|
|
15
15
|
"arktype": "^2.2.2",
|
|
16
16
|
"bson": "^7.3.1"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@internal/adapter-mongo": "8.0.0-rc.1-dev.
|
|
20
|
-
"@internal/driver-mongo": "8.0.0-rc.1-dev.
|
|
21
|
-
"@internal/target-mongo": "8.0.0-rc.1-dev.
|
|
22
|
-
"@repo/tsconfig": "8.0.0-rc.1-dev.
|
|
23
|
-
"@repo/tsdown": "8.0.0-rc.1-dev.
|
|
19
|
+
"@internal/adapter-mongo": "8.0.0-rc.1-dev.42",
|
|
20
|
+
"@internal/driver-mongo": "8.0.0-rc.1-dev.42",
|
|
21
|
+
"@internal/target-mongo": "8.0.0-rc.1-dev.42",
|
|
22
|
+
"@repo/tsconfig": "8.0.0-rc.1-dev.42",
|
|
23
|
+
"@repo/tsdown": "8.0.0-rc.1-dev.42",
|
|
24
24
|
"tsdown": "0.22.14",
|
|
25
25
|
"typescript": "5.9.3"
|
|
26
26
|
},
|