@prisma/orm-target-mongo 8.0.0-rc.12-dev.8 → 8.0.0-rc.12-dev.10
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.d.mts +1 -1
- package/dist/adapter.mjs +2 -2
- package/dist/adapter.mjs.map +1 -1
- package/dist/adapter__control.d.mts +208 -3
- package/dist/adapter__control.d.mts.map +1 -0
- package/dist/adapter__control.mjs +516 -3
- package/dist/adapter__control.mjs.map +1 -0
- package/dist/adapter__runtime.mjs +2 -2
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/codec-ids-Bz230VLx-Dbi_KV7J.mjs +16 -0
- package/dist/codec-ids-Bz230VLx-Dbi_KV7J.mjs.map +1 -0
- package/dist/codec-ids-Ck-Z63jY.d.mts +16 -0
- package/dist/codec-ids-Ck-Z63jY.d.mts.map +1 -0
- package/dist/{adapter__codec-types.d.mts → codec-types-KM2ikqd7.d.mts} +20 -3
- package/dist/codec-types-KM2ikqd7.d.mts.map +1 -0
- package/dist/codecs-ChbLv6Rd-BmoC4ktF.mjs +393 -0
- package/dist/codecs-ChbLv6Rd-BmoC4ktF.mjs.map +1 -0
- package/dist/codecs-DsyGq31F.d.mts +33 -0
- package/dist/codecs-DsyGq31F.d.mts.map +1 -0
- package/dist/{control-CDO-vU3z.d.mts → control-Cfov50jX.d.mts} +82 -82
- package/dist/control-Cfov50jX.d.mts.map +1 -0
- package/dist/{control-CB0AAVw_.mjs → control-DESRWr7S.mjs} +140 -145
- package/dist/control-DESRWr7S.mjs.map +1 -0
- package/dist/{data-types-CxW7xs7P-Dxj3sc0T.mjs → data-types-B2WnpO9e-D97kwz96.mjs} +12 -4
- package/dist/data-types-B2WnpO9e-D97kwz96.mjs.map +1 -0
- package/dist/data-types-Kd9NIobH.d.mts +18 -0
- package/dist/data-types-Kd9NIobH.d.mts.map +1 -0
- package/dist/{descriptor-meta-BQRniVcn-8meGwEZr.mjs → descriptor-meta-CSm-03KE-DDeX4NIT.mjs} +4 -4
- package/dist/descriptor-meta-CSm-03KE-DDeX4NIT.mjs.map +1 -0
- package/dist/driver.mjs +1 -1
- package/dist/driver__control.d.mts +1 -1
- package/dist/driver__control.mjs +2 -2
- package/dist/driver__control.mjs.map +1 -1
- package/dist/{migration-BkqcE2Uv.d.mts → migration-DeZyk0tl.d.mts} +3 -3
- package/dist/{migration-BkqcE2Uv.d.mts.map → migration-DeZyk0tl.d.mts.map} +1 -1
- package/dist/{migration-factories-CqjDpXHw-fxXh_wY1.mjs → migration-factories-BwvR6Mvk-Ba1ywTUZ.mjs} +2 -2
- package/dist/migration-factories-BwvR6Mvk-Ba1ywTUZ.mjs.map +1 -0
- package/dist/{mongo-adapter-NKwUwPku-Bqm1kySe.mjs → mongo-adapter-Dx9Gs2Lj-CA6H_zbI.mjs} +10 -5
- package/dist/mongo-adapter-Dx9Gs2Lj-CA6H_zbI.mjs.map +1 -0
- package/dist/{mongo-adapter-CjJU3S9o-BIJruFYW.d.mts → mongo-adapter-wvK2fQOZ-BXo5NxEB.d.mts} +2 -2
- package/dist/mongo-adapter-wvK2fQOZ-BXo5NxEB.d.mts.map +1 -0
- package/dist/{mongo-driver-BGXMvnQ8-B_flHHzS.mjs → mongo-driver-CZDo4GWY-CDmclLXI.mjs} +3 -3
- package/dist/mongo-driver-CZDo4GWY-CDmclLXI.mjs.map +1 -0
- package/dist/{op-factory-call-B7EKa4Ri-B2Lb6W68.d.mts → op-factory-call-DV0hKDUc-DHt1CB5L.d.mts} +3 -3
- package/dist/{op-factory-call-B7EKa4Ri-B2Lb6W68.d.mts.map → op-factory-call-DV0hKDUc-DHt1CB5L.d.mts.map} +1 -1
- package/dist/{pack-MK8ZQfrL.d.mts → pack-CPxA9byH.d.mts} +2 -2
- package/dist/{pack-MK8ZQfrL.d.mts.map → pack-CPxA9byH.d.mts.map} +1 -1
- package/dist/target.d.mts +9 -7
- package/dist/target.mjs +6 -3
- package/dist/target__codec-ids.d.mts +2 -0
- package/dist/target__codec-ids.mjs +2 -0
- package/dist/target__codec-types.d.mts +2 -2
- package/dist/target__codecs.d.mts +2 -0
- package/dist/target__codecs.mjs +2 -0
- package/dist/target__control.d.mts +3 -4
- package/dist/target__control.mjs +1 -1
- package/dist/target__data-types.d.mts +2 -0
- package/dist/target__data-types.mjs +2 -0
- package/dist/target__migration.d.mts +1 -1
- package/dist/target__migration.mjs +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__pack.mjs.map +1 -1
- package/dist/target__runtime.mjs +1 -1
- package/dist/target__runtime.mjs.map +1 -1
- package/package.json +13 -14
- package/dist/adapter__codec-ids.d.mts +0 -12
- package/dist/adapter__codec-ids.d.mts.map +0 -1
- package/dist/adapter__codec-ids.mjs +0 -2
- package/dist/adapter__codec-types.d.mts.map +0 -1
- package/dist/adapter__codec-types.mjs +0 -1
- package/dist/adapter__codecs.d.mts +0 -14
- package/dist/adapter__codecs.d.mts.map +0 -1
- package/dist/adapter__codecs.mjs +0 -2
- package/dist/adapter__data-types.d.mts +0 -14
- package/dist/adapter__data-types.d.mts.map +0 -1
- package/dist/adapter__data-types.mjs +0 -2
- package/dist/codec-ids-BennPcpQ-Btzz3ILV.mjs +0 -12
- package/dist/codec-ids-BennPcpQ-Btzz3ILV.mjs.map +0 -1
- package/dist/codec-types-Bx2fHyq_.d.mts +0 -35
- package/dist/codec-types-Bx2fHyq_.d.mts.map +0 -1
- package/dist/codecs-0ilNxnkk-P6rdFjk0.mjs +0 -179
- package/dist/codecs-0ilNxnkk-P6rdFjk0.mjs.map +0 -1
- package/dist/control-BDevch6o.mjs +0 -443
- package/dist/control-BDevch6o.mjs.map +0 -1
- package/dist/control-CB0AAVw_.mjs.map +0 -1
- package/dist/control-CDO-vU3z.d.mts.map +0 -1
- package/dist/control-CbxqWOJS.d.mts +0 -176
- package/dist/control-CbxqWOJS.d.mts.map +0 -1
- package/dist/data-types-CxW7xs7P-Dxj3sc0T.mjs.map +0 -1
- package/dist/descriptor-meta-BQRniVcn-8meGwEZr.mjs.map +0 -1
- package/dist/migration-factories-CqjDpXHw-fxXh_wY1.mjs.map +0 -1
- package/dist/mongo-adapter-CjJU3S9o-BIJruFYW.d.mts.map +0 -1
- package/dist/mongo-adapter-NKwUwPku-Bqm1kySe.mjs.map +0 -1
- package/dist/mongo-driver-BGXMvnQ8-B_flHHzS.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-BDevch6o.mjs","names":["#execute","#adapter","#markerLedgerCollection","#invariantMergeExpr"],"sources":["../../../../3-mongo-target/2-mongo-adapter/dist/control.mjs"],"sourcesContent":["import { t as createMongoAdapter } from \"./mongo-adapter-NKwUwPku.mjs\";\nimport { a as mongoAdapterError, i as describeReceivedValue } from \"./codecs-0ilNxnkk.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\tdocumentation: \"Text stored as a BSON string.\",\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\tdocumentation: \"A signed 32-bit integer stored as BSON int.\",\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\tdocumentation: \"A true or false value stored as BSON bool.\",\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\tdocumentation: \"A date and time stored as BSON date with millisecond precision.\",\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\tdocumentation: \"A 12-byte MongoDB identifier stored as BSON ObjectId.\",\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\tdocumentation: \"A double-precision floating-point number stored as BSON double.\",\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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,KAAK,OAAO,SAAS,CAAC,oBAAoB,IAAI,KAAK;GAC5I,MAAM,aAAa,IAAI;GACvB,MAAM,SAAS,MAAM,QAAQ,UAAU,IAAI,aAAa,CAAC;GACzD,QAAQ,KAAK;IACZ,OAAO;IACP;IACA;IACA,MAAM,uBAAuB,IAAI;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,eAAe;EACf,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,KAAK;EACJ,MAAM;EACN,eAAe;EACf,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,SAAS;EACR,MAAM;EACN,eAAe;EACf,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,UAAU;EACT,MAAM;EACN,eAAe;EACf,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,UAAU;EACT,MAAM;EACN,eAAe;EACf,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,OAAO;EACN,MAAM;EACN,eAAe;EACf,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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-CB0AAVw_.mjs","names":[],"sources":["../../../../3-mongo-target/1-mongo-target/dist/control.mjs"],"sourcesContent":["import { t as mongoTargetDescriptorMeta } from \"./descriptor-meta-BQRniVcn.mjs\";\nimport { a as dropCollection, n as createCollection, o as dropIndex, r as createIndex, t as collMod } from \"./migration-factories-CqjDpXHw.mjs\";\nimport { NamespaceBase, UNBOUND_NAMESPACE_ID, elementCoordinates, freezeNode, hydrateNamespaceEntities } from \"@internal/framework-components/ir\";\nimport { createMongoRunnerDeps, extractDb } from \"@internal/adapter-mongo/control\";\nimport { MongoDriverImpl } from \"@internal/driver-mongo\";\nimport { canonicalizeSchemasForVerification, contractToMongoSchemaIR, diffMongoSchemas } from \"@internal/family-mongo/control\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { canonicalize, deepEqual } from \"@internal/mongo-schema-ir\";\nimport { TsExpression, jsonToTsSource, renderImports } from \"@internal/ts-render\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { CollModCommand, CreateCollectionCommand, CreateIndexCommand, DropCollectionCommand, DropIndexCommand, ListCollectionsCommand, ListIndexesCommand, MongoAndExpr, MongoExistsExpr, MongoFieldFilter, MongoNotExpr, MongoOrExpr } from \"@internal/mongo-query-ast/control\";\nimport { Migration } from \"@internal/migration-tools/migration\";\nimport { APP_SPACE_ID, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, issueOutcome } from \"@internal/framework-components/control\";\nimport { resolveRequirementSpecifiers } from \"@internal/framework-components/emission\";\nimport { detectScaffoldRuntime, shebangLineFor } from \"@internal/migration-tools/migration-ts\";\nimport { errorRunnerFailed } from \"@internal/errors/execution\";\nimport { verifyMongoSchema } from \"@internal/family-mongo/schema-verify\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { AggregateCommand, MongoAddFieldsStage, MongoLimitStage, MongoLookupStage, MongoMatchStage, MongoMergeStage, MongoProjectStage, MongoSortStage, RawAggregateCommand, RawDeleteManyCommand, RawDeleteOneCommand, RawFindOneAndDeleteCommand, RawFindOneAndUpdateCommand, RawInsertManyCommand, RawInsertOneCommand, RawUpdateManyCommand, RawUpdateOneCommand } from \"@internal/mongo-query-ast/execution\";\nimport { type } from \"arktype\";\nimport { MongoContractSerializerBase, MongoSchemaVerifierBase } from \"@internal/family-mongo/ir\";\nimport { MongoStorage } from \"@internal/mongo-contract\";\nimport { composeMongoEntityKinds } from \"@internal/mongo-contract/entity-kinds\";\n//#region src/core/op-factory-call.ts\n/**\n* The single module a scaffolded Mongo `migration.ts` imports from: the\n* operation factories below, plus the `Migration` base and `MigrationCLI`\n* that `render-typescript.ts` adds. The authored name; `render-typescript.ts`\n* maps it to whatever the consuming application's import root calls it,\n* once over the whole assembled import list.\n*/\nconst TARGET_MIGRATION_MODULE = \"@internal/target-mongo/migration\";\nvar OpFactoryCallNode = class extends TsExpression {\n\timportRequirements() {\n\t\treturn [{\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol: this.factoryName\n\t\t}];\n\t}\n\tfreeze() {\n\t\tObject.freeze(this);\n\t}\n};\nfunction formatKeys(keys) {\n\treturn keys.map((k) => `${k.field}:${k.direction}`).join(\", \");\n}\nvar CreateIndexCall = class extends OpFactoryCallNode {\n\tfactoryName = \"createIndex\";\n\toperationClass = \"additive\";\n\tcollection;\n\tkeys;\n\toptions;\n\tlabel;\n\tconstructor(collection, keys, options) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.keys = keys;\n\t\tthis.options = options;\n\t\tthis.label = `Create index on ${collection} (${formatKeys(keys)})`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn createIndex(this.collection, this.keys, this.options);\n\t}\n\trenderTypeScript() {\n\t\treturn this.options ? `createIndex(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.keys)}, ${jsonToTsSource(this.options)})` : `createIndex(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.keys)})`;\n\t}\n};\nvar DropIndexCall = class extends OpFactoryCallNode {\n\tfactoryName = \"dropIndex\";\n\toperationClass = \"destructive\";\n\tcollection;\n\tkeys;\n\tlabel;\n\tconstructor(collection, keys) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.keys = keys;\n\t\tthis.label = `Drop index on ${collection} (${formatKeys(keys)})`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn dropIndex(this.collection, this.keys);\n\t}\n\trenderTypeScript() {\n\t\treturn `dropIndex(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.keys)})`;\n\t}\n};\nvar CreateCollectionCall = class extends OpFactoryCallNode {\n\tfactoryName = \"createCollection\";\n\toperationClass = \"additive\";\n\tcollection;\n\toptions;\n\tlabel;\n\tconstructor(collection, options) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.options = options;\n\t\tthis.label = `Create collection ${collection}`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn createCollection(this.collection, this.options);\n\t}\n\trenderTypeScript() {\n\t\treturn this.options ? `createCollection(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.options)})` : `createCollection(${jsonToTsSource(this.collection)})`;\n\t}\n};\nvar DropCollectionCall = class extends OpFactoryCallNode {\n\tfactoryName = \"dropCollection\";\n\toperationClass = \"destructive\";\n\tcollection;\n\tlabel;\n\tconstructor(collection) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.label = `Drop collection ${collection}`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn dropCollection(this.collection);\n\t}\n\trenderTypeScript() {\n\t\treturn `dropCollection(${jsonToTsSource(this.collection)})`;\n\t}\n};\nvar CollModCall = class extends OpFactoryCallNode {\n\tfactoryName = \"collMod\";\n\tcollection;\n\toptions;\n\tmeta;\n\toperationClass;\n\tlabel;\n\tconstructor(collection, options, meta) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.options = options;\n\t\tthis.meta = meta;\n\t\tthis.operationClass = meta?.operationClass ?? \"destructive\";\n\t\tthis.label = meta?.label ?? `Modify collection ${collection}`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn collMod(this.collection, this.options, this.meta);\n\t}\n\trenderTypeScript() {\n\t\treturn this.meta ? `collMod(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.options)}, ${jsonToTsSource(this.meta)})` : `collMod(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.options)})`;\n\t}\n};\nfunction schemaIndexToCreateIndexOptions(index) {\n\treturn {\n\t\t...index.unique ? { unique: true } : {},\n\t\t...ifDefined(\"sparse\", index.sparse),\n\t\t...ifDefined(\"expireAfterSeconds\", index.expireAfterSeconds),\n\t\t...ifDefined(\"partialFilterExpression\", index.partialFilterExpression),\n\t\t...ifDefined(\"wildcardProjection\", index.wildcardProjection),\n\t\t...ifDefined(\"collation\", index.collation),\n\t\t...ifDefined(\"weights\", index.weights),\n\t\t...ifDefined(\"default_language\", index.default_language),\n\t\t...ifDefined(\"language_override\", index.language_override)\n\t};\n}\nfunction schemaCollectionToCreateCollectionOptions(coll) {\n\tconst opts = coll.options;\n\tconst validator = coll.validator;\n\tif (!opts && !validator) return void 0;\n\treturn {\n\t\t...opts?.capped ? { capped: true } : {},\n\t\t...ifDefined(\"size\", opts?.capped?.size),\n\t\t...ifDefined(\"max\", opts?.capped?.max),\n\t\t...ifDefined(\"timeseries\", opts?.timeseries),\n\t\t...ifDefined(\"collation\", opts?.collation),\n\t\t...opts?.clusteredIndex ? { clusteredIndex: {\n\t\t\tkey: { _id: 1 },\n\t\t\tunique: true,\n\t\t\t...opts.clusteredIndex.name != null ? { name: opts.clusteredIndex.name } : {}\n\t\t} } : {},\n\t\t...validator ? { validator: { $jsonSchema: validator.jsonSchema } } : {},\n\t\t...ifDefined(\"validationLevel\", validator?.validationLevel),\n\t\t...ifDefined(\"validationAction\", validator?.validationAction),\n\t\t...ifDefined(\"changeStreamPreAndPostImages\", opts?.changeStreamPreAndPostImages)\n\t};\n}\n//#endregion\n//#region src/core/render-ops.ts\nfunction renderOps(calls) {\n\treturn calls.map((call) => call.toOp());\n}\n//#endregion\n//#region src/core/render-typescript.ts\n/**\n* Always-present base imports for the rendered scaffold, both from the\n* target's own `migration` entry:\n*\n* - `Migration` — the user-facing Mongo `Migration` base, forwarded from\n* `@internal/family-mongo`; subclasses don't need to redeclare\n* `targetId` or thread family/target generics.\n* - `MigrationCLI` — the migration-file CLI entrypoint that loads\n* `prisma.config.ts`, assembles a `ControlStack`, and instantiates\n* the migration class. The migration file owns this dependency directly:\n* pulling CLI machinery in at script run time is acceptable because the\n* script's whole purpose is to be invoked from the project that owns the\n* config.\n*\n* Naming one package rather than three is what lets an application that\n* installed only `@prisma/orm-mongo` run a scaffolded migration: emitted\n* code may name only a direct dependency (ADR 242), and the facade carries\n* the target's `migration` entry but neither the family base nor the CLI.\n*/\nconst BASE_IMPORTS = [{\n\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\tsymbol: \"Migration\"\n}, {\n\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\tsymbol: \"MigrationCLI\"\n}];\n/**\n* Render a list of Mongo `OpFactoryCall`s as a `migration.ts` source string.\n* The result is shebanged, imports the contract JSON from the shared\n* snapshot store (the destination contract, plus the source contract for a\n* non-baseline migration), extends `Migration<Start, End>` (or\n* `Migration<never, End>` for a baseline) from\n* `@internal/target-mongo/migration`,\n* assigns the JSON to `endContractJson` / `startContractJson`, and implements\n* `operations`. The `Migration` base derives `describe()` from those fields.\n*\n* The walk is polymorphic: each call node contributes its own\n* `renderTypeScript()` expression and declares its own `importRequirements()`.\n* The top-level renderer aggregates imports across all nodes and emits one\n* `import { … } from \"…\"` line per module. The `Migration` / `MigrationCLI`\n* base imports and the contract-JSON imports are always emitted, independent\n* of the call nodes.\n*/\nfunction renderCallsToTypeScript(calls, meta) {\n\tconst imports = buildImports(calls, meta);\n\tconst operationsBody = calls.map((c) => c.renderTypeScript()).join(\",\\n\");\n\tconst hasStart = meta.from !== null;\n\tconst startField = hasStart ? [\" override readonly startContractJson = startContract;\"] : [];\n\treturn [\n\t\tshebangLineFor(detectScaffoldRuntime()),\n\t\timports,\n\t\t\"\",\n\t\t`class M extends Migration<${hasStart ? \"Start\" : \"never\"}, End> {`,\n\t\t...startField,\n\t\t\" override readonly endContractJson = endContract;\",\n\t\t\"\",\n\t\t\" override get operations() {\",\n\t\t\" return [\",\n\t\tindent(operationsBody, 6),\n\t\t\" ];\",\n\t\t\" }\",\n\t\t\"}\",\n\t\t\"\",\n\t\t\"export default M;\",\n\t\t\"MigrationCLI.run(import.meta.url, M);\",\n\t\t\"\"\n\t].join(\"\\n\");\n}\nfunction buildImports(calls, meta) {\n\tconst requirements = [...BASE_IMPORTS, ...contractImports(meta)];\n\tfor (const call of calls) for (const req of call.importRequirements()) requirements.push(req);\n\treturn renderImports(resolveRequirementSpecifiers(requirements, meta.resolveImportSpecifier));\n}\n/**\n* The committed contract-JSON imports the scaffold reads its from/to identity\n* from, resolved to the deduplicated snapshot store under\n* `meta.snapshotsImportPath`. The end snapshot is always present; the start\n* snapshot is added only for a non-baseline migration (`meta.from !== null`).\n* The matching `Contract` type imports (aliased `Start`/`End`) feed the\n* `Migration<Start, End>` generics. Baseline emits `Migration<never, End>` with\n* no start imports — `never` is the honest \"no prior contract\" Start.\n*/\nfunction contractImports(meta) {\n\tconst reqs = [{\n\t\tmoduleSpecifier: contractSnapshotJsonSpecifier(meta.snapshotsImportPath, meta.to),\n\t\tsymbol: \"endContract\",\n\t\tkind: \"default\",\n\t\tattributes: { type: \"json\" }\n\t}, {\n\t\tmoduleSpecifier: contractSnapshotTypesSpecifier(meta.snapshotsImportPath, meta.to),\n\t\tsymbol: \"Contract\",\n\t\talias: \"End\",\n\t\ttypeOnly: true\n\t}];\n\tif (meta.from !== null) {\n\t\treqs.push({\n\t\t\tmoduleSpecifier: contractSnapshotJsonSpecifier(meta.snapshotsImportPath, meta.from),\n\t\t\tsymbol: \"startContract\",\n\t\t\tkind: \"default\",\n\t\t\tattributes: { type: \"json\" }\n\t\t});\n\t\treqs.push({\n\t\t\tmoduleSpecifier: contractSnapshotTypesSpecifier(meta.snapshotsImportPath, meta.from),\n\t\t\tsymbol: \"Contract\",\n\t\t\talias: \"Start\",\n\t\t\ttypeOnly: true\n\t\t});\n\t}\n\treturn reqs;\n}\nfunction indent(text, spaces) {\n\tconst pad = \" \".repeat(spaces);\n\treturn text.split(\"\\n\").map((line) => line.trim() ? `${pad}${line}` : line).join(\"\\n\");\n}\n//#endregion\n//#region src/core/planner-produced-migration.ts\n/**\n* Planner-produced Mongo migration, returned by `MongoMigrationPlanner.plan(...)`\n* and `MongoMigrationPlanner.emptyMigration(...)`.\n*\n* Unlike user-authored migrations (which extend `MongoMigration` from\n* `@internal/family-mongo`), this class lives inside the target and holds\n* the richer authoring IR (`OpFactoryCall[]`) needed to render itself back to\n* TypeScript source. It implements `MigrationPlanWithAuthoringSurface` so\n* that the CLI can uniformly ask any planner result to serialize itself to a\n* `migration.ts`.\n*\n* It extends the framework `Migration` base directly and declares its own\n* `targetId` rather than inheriting `MongoMigration`, whose added value is\n* the lazily-built contract views a planner result never reads.\n*/\nvar PlannerProducedMongoMigration = class extends Migration {\n\tcalls;\n\tmeta;\n\tsnapshotsImportPath;\n\ttargetId = \"mongo\";\n\tconstructor(calls, meta, snapshotsImportPath) {\n\t\tsuper();\n\t\tthis.calls = calls;\n\t\tthis.meta = meta;\n\t\tthis.snapshotsImportPath = snapshotsImportPath;\n\t}\n\tget operations() {\n\t\treturn renderOps(this.calls);\n\t}\n\tdescribe() {\n\t\treturn this.meta;\n\t}\n\trenderTypeScript(resolveImportSpecifier) {\n\t\treturn renderCallsToTypeScript(this.calls, {\n\t\t\tfrom: this.meta.from,\n\t\t\tto: this.meta.to,\n\t\t\tsnapshotsImportPath: this.snapshotsImportPath,\n\t\t\tresolveImportSpecifier\n\t\t});\n\t}\n};\n//#endregion\n//#region src/core/mongo-planner.ts\nfunction buildIndexLookupKey(index) {\n\tconst keys = index.keys.map((k) => `${k.field}:${k.direction}`).join(\",\");\n\tconst opts = [\n\t\tindex.unique ? \"unique\" : \"\",\n\t\tindex.sparse ? \"sparse\" : \"\",\n\t\tindex.expireAfterSeconds != null ? `ttl:${index.expireAfterSeconds}` : \"\",\n\t\tindex.partialFilterExpression ? `pfe:${canonicalize(index.partialFilterExpression)}` : \"\",\n\t\tindex.wildcardProjection ? `wp:${canonicalize(index.wildcardProjection)}` : \"\",\n\t\tindex.collation ? `col:${canonicalize(index.collation)}` : \"\",\n\t\tindex.weights ? `wt:${canonicalize(index.weights)}` : \"\",\n\t\tindex.default_language ? `dl:${index.default_language}` : \"\",\n\t\tindex.language_override ? `lo:${index.language_override}` : \"\"\n\t].filter(Boolean).join(\";\");\n\treturn opts ? `${keys}|${opts}` : keys;\n}\nfunction validatorsEqual(a, b) {\n\tif (!a && !b) return true;\n\tif (!a || !b) return false;\n\treturn a.validationLevel === b.validationLevel && a.validationAction === b.validationAction && canonicalize(a.jsonSchema) === canonicalize(b.jsonSchema);\n}\nfunction classifyValidatorUpdate(origin, dest) {\n\tif (origin.validationAction !== dest.validationAction && dest.validationAction === \"error\") return \"destructive\";\n\tif (origin.validationLevel !== dest.validationLevel && dest.validationLevel === \"strict\") return \"destructive\";\n\tif (canonicalize(origin.jsonSchema) === canonicalize(dest.jsonSchema)) return \"widening\";\n\treturn isWideningSchemaChange(origin.jsonSchema, dest.jsonSchema) ? \"widening\" : \"destructive\";\n}\nfunction isPlainObject(v) {\n\treturn typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\n/**\n* Returns true when `dest` is a structural superset of `origin` for the common\n* additive case: adding non-required properties to a top-level object schema.\n* Anything uncertain falls through to the safe `destructive` default.\n*/\nfunction isWideningSchemaChange(origin, dest) {\n\tif (origin[\"bsonType\"] !== \"object\" || dest[\"bsonType\"] !== \"object\") return false;\n\tconst allKeys = /* @__PURE__ */ new Set([...Object.keys(origin), ...Object.keys(dest)]);\n\tfor (const key of allKeys) {\n\t\tif (key === \"required\" || key === \"properties\") continue;\n\t\tif (canonicalize(origin[key]) !== canonicalize(dest[key])) return false;\n\t}\n\tconst originRequired = new Set(Array.isArray(origin[\"required\"]) ? origin[\"required\"] : []);\n\tconst destRequired = Array.isArray(dest[\"required\"]) ? dest[\"required\"] : [];\n\tfor (const field of destRequired) if (!originRequired.has(field)) return false;\n\tconst originProps = isPlainObject(origin[\"properties\"]) ? origin[\"properties\"] : {};\n\tconst destProps = isPlainObject(dest[\"properties\"]) ? dest[\"properties\"] : {};\n\tfor (const field of Object.keys(originProps)) {\n\t\tif (!Object.hasOwn(destProps, field)) return false;\n\t\tif (canonicalize(originProps[field]) !== canonicalize(destProps[field])) return false;\n\t}\n\treturn true;\n}\nfunction hasImmutableOptionChange(origin, dest) {\n\tif (canonicalize(origin?.capped) !== canonicalize(dest?.capped)) return \"capped\";\n\tif (canonicalize(origin?.timeseries) !== canonicalize(dest?.timeseries)) return \"timeseries\";\n\tif (canonicalize(origin?.collation) !== canonicalize(dest?.collation)) return \"collation\";\n\tif (canonicalize(origin?.clusteredIndex) !== canonicalize(dest?.clusteredIndex)) return \"clusteredIndex\";\n}\nfunction collectionHasOptions(coll) {\n\treturn !!(coll.options || coll.validator);\n}\nvar MongoMigrationPlanner = class {\n\tplanCalls(options) {\n\t\tconst contract = blindCast(options.contract);\n\t\tconst originIR = blindCast(options.schema);\n\t\tconst destinationIR = contractToMongoSchemaIR(contract);\n\t\tconst collCreates = [];\n\t\tconst drops = [];\n\t\tconst creates = [];\n\t\tconst validatorOps = [];\n\t\tconst mutableOptionOps = [];\n\t\tconst collDrops = [];\n\t\tconst conflicts = [];\n\t\tconst allCollectionNames = /* @__PURE__ */ new Set([...originIR.collectionNames, ...destinationIR.collectionNames]);\n\t\tfor (const collName of [...allCollectionNames].sort()) {\n\t\t\tconst originColl = originIR.collection(collName);\n\t\t\tconst destColl = destinationIR.collection(collName);\n\t\t\tif (!originColl) {\n\t\t\t\tif (destColl && (collectionHasOptions(destColl) || destColl.indexes.length === 0)) {\n\t\t\t\t\tconst opts = collectionHasOptions(destColl) ? schemaCollectionToCreateCollectionOptions(destColl) : void 0;\n\t\t\t\t\tcollCreates.push(new CreateCollectionCall(collName, opts));\n\t\t\t\t}\n\t\t\t} else if (!destColl) collDrops.push(new DropCollectionCall(collName));\n\t\t\telse {\n\t\t\t\tconst immutableChange = hasImmutableOptionChange(originColl.options, destColl.options);\n\t\t\t\tif (immutableChange) conflicts.push({\n\t\t\t\t\tkind: \"policy-violation\",\n\t\t\t\t\tsummary: `Cannot change immutable collection option '${immutableChange}' on ${collName}`,\n\t\t\t\t\twhy: `MongoDB does not support modifying the '${immutableChange}' option after collection creation`\n\t\t\t\t});\n\t\t\t\tconst mutableCall = planMutableOptionsDiffCall(collName, originColl.options, destColl.options);\n\t\t\t\tif (mutableCall) mutableOptionOps.push(mutableCall);\n\t\t\t\tconst validatorCall = planValidatorDiffCall(collName, originColl.validator, destColl.validator);\n\t\t\t\tif (validatorCall) validatorOps.push(validatorCall);\n\t\t\t}\n\t\t\tconst originLookup = /* @__PURE__ */ new Map();\n\t\t\tif (originColl) for (const idx of originColl.indexes) originLookup.set(buildIndexLookupKey(idx), idx);\n\t\t\tconst destLookup = /* @__PURE__ */ new Map();\n\t\t\tif (destColl) for (const idx of destColl.indexes) destLookup.set(buildIndexLookupKey(idx), idx);\n\t\t\tfor (const [lookupKey, idx] of originLookup) if (!destLookup.has(lookupKey)) drops.push(new DropIndexCall(collName, idx.keys));\n\t\t\tfor (const [lookupKey, idx] of destLookup) if (!originLookup.has(lookupKey)) creates.push(new CreateIndexCall(collName, idx.keys, schemaIndexToCreateIndexOptions(idx)));\n\t\t}\n\t\tif (conflicts.length > 0) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts\n\t\t};\n\t\tconst allCalls = [\n\t\t\t...collCreates,\n\t\t\t...drops,\n\t\t\t...creates,\n\t\t\t...validatorOps,\n\t\t\t...mutableOptionOps,\n\t\t\t...collDrops\n\t\t];\n\t\tfor (const call of allCalls) if (!options.policy.allowedOperationClasses.includes(call.operationClass)) conflicts.push({\n\t\t\tkind: \"policy-violation\",\n\t\t\tsummary: `${call.operationClass} operation disallowed: ${call.label}`,\n\t\t\twhy: `Policy does not allow '${call.operationClass}' operations`\n\t\t});\n\t\tif (conflicts.length > 0) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts\n\t\t};\n\t\treturn {\n\t\t\tkind: \"success\",\n\t\t\tcalls: allCalls\n\t\t};\n\t}\n\tplan(options) {\n\t\tconst contract = blindCast(options.contract);\n\t\tconst result = this.planCalls(options);\n\t\tif (result.kind === \"failure\") return result;\n\t\treturn {\n\t\t\tkind: \"success\",\n\t\t\tplan: new PlannerProducedMongoMigration(result.calls, {\n\t\t\t\tfrom: options.fromContract?.storage.storageHash ?? null,\n\t\t\t\tto: contract.storage.storageHash\n\t\t\t}, options.snapshotsImportPath)\n\t\t};\n\t}\n\t/**\n\t* Produce an empty `migration.ts` authoring surface for `migration new`.\n\t*\n\t* The \"empty migration\" is a `PlannerProducedMongoMigration` with no\n\t* operations; `renderTypeScript()` emits a stub class with the correct\n\t* `from`/`to` metadata that the user then fills in with operations. The\n\t* contract path on the context is unused — Mongo's emitted source does\n\t* not import from the generated contract `.d.ts`.\n\t*/\n\temptyMigration(context) {\n\t\treturn new PlannerProducedMongoMigration([], {\n\t\t\tfrom: context.fromHash,\n\t\t\tto: context.toHash\n\t\t}, context.snapshotsImportPath);\n\t}\n};\nfunction planValidatorDiffCall(collName, originValidator, destValidator) {\n\tif (validatorsEqual(originValidator, destValidator)) return void 0;\n\tif (destValidator) {\n\t\tconst operationClass = originValidator ? classifyValidatorUpdate(originValidator, destValidator) : \"destructive\";\n\t\treturn new CollModCall(collName, {\n\t\t\tvalidator: { $jsonSchema: destValidator.jsonSchema },\n\t\t\tvalidationLevel: destValidator.validationLevel,\n\t\t\tvalidationAction: destValidator.validationAction\n\t\t}, {\n\t\t\tid: `validator.${collName}.${originValidator ? \"update\" : \"add\"}`,\n\t\t\tlabel: `${originValidator ? \"Update\" : \"Add\"} validator on ${collName}`,\n\t\t\toperationClass\n\t\t});\n\t}\n\treturn new CollModCall(collName, {\n\t\tvalidator: {},\n\t\tvalidationLevel: \"strict\",\n\t\tvalidationAction: \"error\"\n\t}, {\n\t\tid: `validator.${collName}.remove`,\n\t\tlabel: `Remove validator on ${collName}`,\n\t\toperationClass: \"widening\"\n\t});\n}\nfunction planMutableOptionsDiffCall(collName, origin, dest) {\n\tconst originCSPPI = origin?.changeStreamPreAndPostImages;\n\tconst destCSPPI = dest?.changeStreamPreAndPostImages;\n\tif (deepEqual(originCSPPI, destCSPPI)) return void 0;\n\tconst desiredCSPPI = destCSPPI ?? { enabled: false };\n\treturn new CollModCall(collName, { changeStreamPreAndPostImages: desiredCSPPI }, {\n\t\tid: `options.${collName}.update`,\n\t\tlabel: `Update mutable options on ${collName}`,\n\t\toperationClass: desiredCSPPI.enabled ? \"widening\" : \"destructive\"\n\t});\n}\n//#endregion\n//#region src/core/mongo-target-errors.ts\nfunction mongoTargetError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/core/filter-evaluator.ts\nfunction isRecord(value) {\n\treturn value !== null && typeof value === \"object\";\n}\nfunction getNestedField(doc, path) {\n\tconst parts = path.split(\".\");\n\tlet current = doc;\n\tfor (const part of parts) {\n\t\tif (!isRecord(current)) return;\n\t\tconst record = current;\n\t\tif (!Object.hasOwn(record, part)) return;\n\t\tcurrent = record[part];\n\t}\n\treturn blindCast(current);\n}\nfunction evaluateFieldOp(op, actual, expected) {\n\tswitch (op) {\n\t\tcase \"$eq\": return deepEqual(actual, expected);\n\t\tcase \"$ne\": return !deepEqual(actual, expected);\n\t\tcase \"$gt\": return typeof actual === typeof expected && blindCast(actual) > blindCast(expected);\n\t\tcase \"$gte\": return typeof actual === typeof expected && blindCast(actual) >= blindCast(expected);\n\t\tcase \"$lt\": return typeof actual === typeof expected && blindCast(actual) < blindCast(expected);\n\t\tcase \"$lte\": return typeof actual === typeof expected && blindCast(actual) <= blindCast(expected);\n\t\tcase \"$in\": return Array.isArray(expected) && expected.some((v) => deepEqual(actual, v));\n\t\tdefault: throw mongoTargetError(\"MIGRATION.OPERATION_UNSUPPORTED\", `Unsupported filter operator in migration check: ${op}`, { meta: { operator: op } });\n\t}\n}\nvar FilterEvaluator = class {\n\tdoc = {};\n\tevaluate(filter, doc) {\n\t\tthis.doc = doc;\n\t\treturn filter.accept(this);\n\t}\n\tfield(expr) {\n\t\tconst value = getNestedField(this.doc, expr.field);\n\t\treturn evaluateFieldOp(expr.op, value, expr.value);\n\t}\n\tand(expr) {\n\t\treturn expr.exprs.every((child) => child.accept(this));\n\t}\n\tor(expr) {\n\t\treturn expr.exprs.some((child) => child.accept(this));\n\t}\n\tnot(expr) {\n\t\treturn !expr.expr.accept(this);\n\t}\n\texists(expr) {\n\t\tconst has = getNestedField(this.doc, expr.field) !== void 0;\n\t\treturn expr.exists ? has : !has;\n\t}\n\texpr(_expr) {\n\t\tthrow mongoTargetError(\"MIGRATION.OPERATION_UNSUPPORTED\", \"Aggregation expression filters are not supported in migration checks\", { meta: { operator: \"$expr\" } });\n\t}\n};\n//#endregion\n//#region src/core/mongo-ops-serializer.ts\nconst IndexKeyJson = type({\n\tfield: \"string\",\n\tdirection: type(\"1 | -1 | \\\"text\\\" | \\\"2dsphere\\\" | \\\"2d\\\" | \\\"hashed\\\"\")\n});\nconst CollationJson = type({\n\tlocale: \"string\",\n\t\"caseLevel?\": \"boolean\",\n\t\"caseFirst?\": \"string\",\n\t\"strength?\": \"number\",\n\t\"numericOrdering?\": \"boolean\",\n\t\"alternate?\": \"string\",\n\t\"maxVariable?\": \"string\",\n\t\"backwards?\": \"boolean\",\n\t\"normalization?\": \"boolean\"\n});\nconst CreateIndexJson = type({\n\tkind: \"\\\"createIndex\\\"\",\n\tcollection: \"string\",\n\tkeys: IndexKeyJson.array().atLeastLength(1),\n\t\"unique?\": \"boolean\",\n\t\"sparse?\": \"boolean\",\n\t\"expireAfterSeconds?\": \"number\",\n\t\"partialFilterExpression?\": \"Record<string, unknown>\",\n\t\"name?\": \"string\",\n\t\"wildcardProjection?\": \"Record<string, 0 | 1>\",\n\t\"collation?\": CollationJson,\n\t\"weights?\": \"Record<string, number>\",\n\t\"default_language?\": \"string\",\n\t\"language_override?\": \"string\"\n});\nconst DropIndexJson = type({\n\tkind: \"\\\"dropIndex\\\"\",\n\tcollection: \"string\",\n\tname: \"string\"\n});\nconst CreateCollectionJson = type({\n\tkind: \"\\\"createCollection\\\"\",\n\tcollection: \"string\",\n\t\"validator?\": \"Record<string, unknown>\",\n\t\"validationLevel?\": \"\\\"strict\\\" | \\\"moderate\\\"\",\n\t\"validationAction?\": \"\\\"error\\\" | \\\"warn\\\"\",\n\t\"capped?\": \"boolean\",\n\t\"size?\": \"number\",\n\t\"max?\": \"number\",\n\t\"timeseries?\": {\n\t\ttimeField: \"string\",\n\t\t\"metaField?\": \"string\",\n\t\t\"granularity?\": \"\\\"seconds\\\" | \\\"minutes\\\" | \\\"hours\\\"\"\n\t},\n\t\"collation?\": CollationJson,\n\t\"changeStreamPreAndPostImages?\": { enabled: \"boolean\" },\n\t\"clusteredIndex?\": {\n\t\tkey: \"Record<string, number>\",\n\t\tunique: \"boolean\",\n\t\t\"name?\": \"string\"\n\t}\n});\nconst DropCollectionJson = type({\n\tkind: \"\\\"dropCollection\\\"\",\n\tcollection: \"string\"\n});\nconst CollModJson = type({\n\tkind: \"\\\"collMod\\\"\",\n\tcollection: \"string\",\n\t\"validator?\": \"Record<string, unknown>\",\n\t\"validationLevel?\": \"\\\"strict\\\" | \\\"moderate\\\"\",\n\t\"validationAction?\": \"\\\"error\\\" | \\\"warn\\\"\",\n\t\"changeStreamPreAndPostImages?\": { enabled: \"boolean\" }\n});\nconst ListIndexesJson = type({\n\tkind: \"\\\"listIndexes\\\"\",\n\tcollection: \"string\"\n});\nconst ListCollectionsJson = type({ kind: \"\\\"listCollections\\\"\" });\nconst FieldFilterJson = type({\n\tkind: \"\\\"field\\\"\",\n\tfield: \"string\",\n\top: \"string\",\n\tvalue: \"unknown\"\n});\nconst AndFilterJson = type({\n\tkind: \"\\\"and\\\"\",\n\texprs: \"Record<string, unknown>[]\"\n});\nconst OrFilterJson = type({\n\tkind: \"\\\"or\\\"\",\n\texprs: \"Record<string, unknown>[]\"\n});\nconst NotFilterJson = type({\n\tkind: \"\\\"not\\\"\",\n\texpr: \"Record<string, unknown>\"\n});\nconst ExistsFilterJson = type({\n\tkind: \"\\\"exists\\\"\",\n\tfield: \"string\",\n\texists: \"boolean\"\n});\nconst RawInsertOneJson = type({\n\tkind: \"\\\"rawInsertOne\\\"\",\n\tcollection: \"string\",\n\tdocument: \"Record<string, unknown>\"\n});\nconst RawInsertManyJson = type({\n\tkind: \"\\\"rawInsertMany\\\"\",\n\tcollection: \"string\",\n\tdocuments: \"Record<string, unknown>[]\"\n});\nconst RawUpdateOneJson = type({\n\tkind: \"\\\"rawUpdateOne\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\",\n\tupdate: \"Record<string, unknown> | Record<string, unknown>[]\"\n});\nconst RawUpdateManyJson = type({\n\tkind: \"\\\"rawUpdateMany\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\",\n\tupdate: \"Record<string, unknown> | Record<string, unknown>[]\"\n});\nconst RawDeleteOneJson = type({\n\tkind: \"\\\"rawDeleteOne\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\"\n});\nconst RawDeleteManyJson = type({\n\tkind: \"\\\"rawDeleteMany\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\"\n});\nconst RawAggregateJson = type({\n\tkind: \"\\\"rawAggregate\\\"\",\n\tcollection: \"string\",\n\tpipeline: \"Record<string, unknown>[]\"\n});\nconst RawFindOneAndUpdateJson = type({\n\tkind: \"\\\"rawFindOneAndUpdate\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\",\n\tupdate: \"Record<string, unknown> | Record<string, unknown>[]\",\n\tupsert: \"boolean\"\n});\nconst RawFindOneAndDeleteJson = type({\n\tkind: \"\\\"rawFindOneAndDelete\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\"\n});\nconst TypedAggregateJson = type({\n\tkind: \"\\\"aggregate\\\"\",\n\tcollection: \"string\",\n\tpipeline: \"Record<string, unknown>[]\"\n});\nconst QueryPlanJson = type({\n\tcollection: \"string\",\n\tcommand: \"Record<string, unknown>\",\n\tmeta: type({\n\t\ttarget: \"string\",\n\t\tstorageHash: \"string\",\n\t\tlane: \"string\",\n\t\t\"targetFamily?\": \"string\",\n\t\t\"profileHash?\": \"string\",\n\t\t\"annotations?\": \"Record<string, unknown>\"\n\t})\n});\nconst MatchStageJson = type({\n\tkind: \"\\\"match\\\"\",\n\tfilter: \"Record<string, unknown>\"\n});\nconst LimitStageJson = type({\n\tkind: \"\\\"limit\\\"\",\n\tlimit: \"number\"\n});\nconst SortStageJson = type({\n\tkind: \"\\\"sort\\\"\",\n\tsort: \"Record<string, 1 | -1>\"\n});\nconst ProjectStageJson = type({\n\tkind: \"\\\"project\\\"\",\n\tprojection: \"Record<string, 0 | 1>\"\n});\nconst AddFieldsStageJson = type({\n\tkind: \"\\\"addFields\\\"\",\n\tfields: \"Record<string, unknown>\"\n});\nconst LookupStageJson = type({\n\tkind: \"\\\"lookup\\\"\",\n\tfrom: \"string\",\n\tas: \"string\",\n\t\"localField?\": \"string\",\n\t\"foreignField?\": \"string\",\n\t\"pipeline?\": \"Record<string, unknown>[]\",\n\t\"let_?\": \"Record<string, unknown>\"\n});\nconst CheckJson = type({\n\tdescription: \"string\",\n\tsource: \"Record<string, unknown>\",\n\tfilter: \"Record<string, unknown>\",\n\texpect: \"\\\"exists\\\" | \\\"notExists\\\"\"\n});\nconst StepJson = type({\n\tdescription: \"string\",\n\tcommand: \"Record<string, unknown>\"\n});\nconst DdlOperationJson = type({\n\tid: \"string\",\n\tlabel: \"string\",\n\toperationClass: \"\\\"additive\\\" | \\\"widening\\\" | \\\"destructive\\\"\",\n\tprecheck: \"Record<string, unknown>[]\",\n\texecute: \"Record<string, unknown>[]\",\n\tpostcheck: \"Record<string, unknown>[]\"\n});\nconst DataTransformCheckJson = type({\n\tdescription: \"string\",\n\tsource: \"Record<string, unknown>\",\n\tfilter: \"Record<string, unknown>\",\n\texpect: \"\\\"exists\\\" | \\\"notExists\\\"\"\n});\nconst DataTransformOperationJson = type({\n\tid: \"string\",\n\tlabel: \"string\",\n\toperationClass: \"\\\"data\\\"\",\n\tname: \"string\",\n\tprecheck: \"Record<string, unknown>[]\",\n\trun: \"Record<string, unknown>[]\",\n\tpostcheck: \"Record<string, unknown>[]\"\n});\nfunction recordValue(json, key, context) {\n\tif (json === null || typeof json !== \"object\") throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Invalid ${context}: expected object`, { meta: { context } });\n\treturn blindCast(Reflect.get(json, key));\n}\nfunction recordKind(json, context) {\n\tconst kind = recordValue(json, \"kind\", context);\n\treturn typeof kind === \"string\" ? kind : \"\";\n}\nfunction validate(schema, data, context) {\n\ttry {\n\t\treturn schema.assert(stripUndefinedDeep(data));\n\t} catch (error) {\n\t\t/* v8 ignore stop */\n\t\tthrow mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Invalid ${context}: ${error instanceof Error ? error.message : String(error)}`, {\n\t\t\tmeta: { context },\n\t\t\tcause: error\n\t\t});\n\t}\n}\n/**\n* Strip `undefined`-valued properties before they reach arktype's optional-key\n* assertions.\n*\n* Op IRs (e.g. `CreateCollectionCommand`) assign every optional field on\n* every instance — fields the caller did not provide land as\n* `undefined`-valued properties. arktype treats `{ foo?: 'boolean' }` as\n* \"key may be absent, but if present must be boolean\", so the bare instance\n* fails validation when it crosses the deserialize boundary in-process\n* (no JSON round-trip happens between planner → runner). This helper\n* recovers the JSON-round-tripped shape (undefined keys absent) without\n* forcing every caller to round-trip.\n*\n* Returns the original value reference whenever no change is needed.\n* That preserves prototype-bound payload values such as BSON wrappers\n* (`ObjectId`, `Decimal128`, `Binary`, …) which embed no `undefined`\n* own-enumerable properties and therefore never trigger a rebuild.\n* Top-level op IRs (class instances with `undefined` optional fields)\n* still get flattened to plain records as required by arktype.\n*/\nfunction stripUndefinedDeep(value) {\n\tif (Array.isArray(value)) {\n\t\tlet changed = false;\n\t\tconst next = value.map((item) => {\n\t\t\tconst stripped = stripUndefinedDeep(item);\n\t\t\tif (stripped !== item) changed = true;\n\t\t\treturn stripped;\n\t\t});\n\t\treturn changed ? next : value;\n\t}\n\tif (value === null || typeof value !== \"object\") return blindCast(value);\n\tconst entries = Object.entries(value);\n\tconst out = {};\n\tlet changed = false;\n\tfor (const [key, val] of entries) {\n\t\tif (val === void 0) {\n\t\t\tchanged = true;\n\t\t\tcontinue;\n\t\t}\n\t\tconst stripped = stripUndefinedDeep(val);\n\t\tif (stripped !== val) changed = true;\n\t\tout[key] = stripped;\n\t}\n\treturn changed ? out : blindCast(value);\n}\nfunction deserializeFilterExpr(json) {\n\tconst kind = recordKind(json, \"filter expression\");\n\tswitch (kind) {\n\t\tcase \"field\": {\n\t\t\tconst data = validate(FieldFilterJson, json, \"field filter\");\n\t\t\treturn MongoFieldFilter.of(data.field, data.op, blindCast(data.value));\n\t\t}\n\t\tcase \"and\": {\n\t\t\tconst data = validate(AndFilterJson, json, \"and filter\");\n\t\t\treturn MongoAndExpr.of(data.exprs.map(deserializeFilterExpr));\n\t\t}\n\t\tcase \"or\": {\n\t\t\tconst data = validate(OrFilterJson, json, \"or filter\");\n\t\t\treturn MongoOrExpr.of(data.exprs.map(deserializeFilterExpr));\n\t\t}\n\t\tcase \"not\": return new MongoNotExpr(deserializeFilterExpr(validate(NotFilterJson, json, \"not filter\").expr));\n\t\tcase \"exists\": {\n\t\t\tconst data = validate(ExistsFilterJson, json, \"exists filter\");\n\t\t\treturn new MongoExistsExpr(data.field, data.exists);\n\t\t}\n\t\tdefault: throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Unknown filter expression kind: ${kind}`, { meta: {\n\t\t\tcontext: \"filter expression\",\n\t\t\tkind\n\t\t} });\n\t}\n}\nfunction deserializePipelineStage(json) {\n\tconst kind = recordKind(json, \"pipeline stage\");\n\tswitch (kind) {\n\t\tcase \"match\": return new MongoMatchStage(deserializeFilterExpr(validate(MatchStageJson, json, \"match stage\").filter));\n\t\tcase \"limit\": return new MongoLimitStage(validate(LimitStageJson, json, \"limit stage\").limit);\n\t\tcase \"sort\": return new MongoSortStage(validate(SortStageJson, json, \"sort stage\").sort);\n\t\tcase \"project\": return new MongoProjectStage(validate(ProjectStageJson, json, \"project stage\").projection);\n\t\tcase \"addFields\": return new MongoAddFieldsStage(blindCast(validate(AddFieldsStageJson, json, \"addFields stage\").fields));\n\t\tcase \"lookup\": {\n\t\t\tconst data = validate(LookupStageJson, json, \"lookup stage\");\n\t\t\tconst opts = {\n\t\t\t\tfrom: data.from,\n\t\t\t\tas: data.as\n\t\t\t};\n\t\t\tif (data.localField !== void 0) opts.localField = data.localField;\n\t\t\tif (data.foreignField !== void 0) opts.foreignField = data.foreignField;\n\t\t\tif (data.pipeline !== void 0) opts.pipeline = data.pipeline.map(deserializePipelineStage);\n\t\t\tif (data.let_ !== void 0) opts.let_ = blindCast(data.let_);\n\t\t\treturn new MongoLookupStage(opts);\n\t\t}\n\t\tcase \"merge\": {\n\t\t\tconst whenMatched = recordValue(json, \"whenMatched\", \"merge stage\");\n\t\t\tconst opts = { into: blindCast(recordValue(json, \"into\", \"merge stage\")) };\n\t\t\tconst on = recordValue(json, \"on\", \"merge stage\");\n\t\t\tif (on !== void 0) opts.on = blindCast(on);\n\t\t\tif (whenMatched !== void 0) opts.whenMatched = typeof whenMatched === \"string\" ? whenMatched : blindCast(blindCast(whenMatched).map(deserializePipelineStage));\n\t\t\tconst whenNotMatched = recordValue(json, \"whenNotMatched\", \"merge stage\");\n\t\t\tif (whenNotMatched !== void 0) opts.whenNotMatched = blindCast(whenNotMatched);\n\t\t\treturn new MongoMergeStage(opts);\n\t\t}\n\t\tdefault: throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Unknown pipeline stage kind: ${kind}`, { meta: {\n\t\t\tcontext: \"pipeline stage\",\n\t\t\tkind\n\t\t} });\n\t}\n}\nfunction deserializeDmlCommand(json) {\n\tconst kind = recordKind(json, \"DML command\");\n\tswitch (kind) {\n\t\tcase \"rawInsertOne\": {\n\t\t\tconst data = validate(RawInsertOneJson, json, \"rawInsertOne command\");\n\t\t\treturn new RawInsertOneCommand(data.collection, data.document);\n\t\t}\n\t\tcase \"rawInsertMany\": {\n\t\t\tconst data = validate(RawInsertManyJson, json, \"rawInsertMany command\");\n\t\t\treturn new RawInsertManyCommand(data.collection, data.documents);\n\t\t}\n\t\tcase \"rawUpdateOne\": {\n\t\t\tconst data = validate(RawUpdateOneJson, json, \"rawUpdateOne command\");\n\t\t\treturn new RawUpdateOneCommand(data.collection, data.filter, data.update);\n\t\t}\n\t\tcase \"rawUpdateMany\": {\n\t\t\tconst data = validate(RawUpdateManyJson, json, \"rawUpdateMany command\");\n\t\t\treturn new RawUpdateManyCommand(data.collection, data.filter, data.update);\n\t\t}\n\t\tcase \"rawDeleteOne\": {\n\t\t\tconst data = validate(RawDeleteOneJson, json, \"rawDeleteOne command\");\n\t\t\treturn new RawDeleteOneCommand(data.collection, data.filter);\n\t\t}\n\t\tcase \"rawDeleteMany\": {\n\t\t\tconst data = validate(RawDeleteManyJson, json, \"rawDeleteMany command\");\n\t\t\treturn new RawDeleteManyCommand(data.collection, data.filter);\n\t\t}\n\t\tcase \"rawAggregate\": {\n\t\t\tconst data = validate(RawAggregateJson, json, \"rawAggregate command\");\n\t\t\treturn new RawAggregateCommand(data.collection, data.pipeline);\n\t\t}\n\t\tcase \"rawFindOneAndUpdate\": {\n\t\t\tconst data = validate(RawFindOneAndUpdateJson, json, \"rawFindOneAndUpdate command\");\n\t\t\treturn new RawFindOneAndUpdateCommand(data.collection, data.filter, data.update, data.upsert);\n\t\t}\n\t\tcase \"rawFindOneAndDelete\": {\n\t\t\tconst data = validate(RawFindOneAndDeleteJson, json, \"rawFindOneAndDelete command\");\n\t\t\treturn new RawFindOneAndDeleteCommand(data.collection, data.filter);\n\t\t}\n\t\tcase \"aggregate\": {\n\t\t\tconst data = validate(TypedAggregateJson, json, \"aggregate command\");\n\t\t\tconst pipeline = data.pipeline.map(deserializePipelineStage);\n\t\t\treturn new AggregateCommand(data.collection, pipeline);\n\t\t}\n\t\tdefault: throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Unknown DML command kind: ${kind}`, { meta: {\n\t\t\tcontext: \"DML command\",\n\t\t\tkind\n\t\t} });\n\t}\n}\nfunction deserializeMongoQueryPlan(json) {\n\tconst data = validate(QueryPlanJson, json, \"Mongo query plan\");\n\tconst command = deserializeDmlCommand(data.command);\n\tconst m = data.meta;\n\tconst meta = {\n\t\ttarget: m.target,\n\t\tstorageHash: m.storageHash,\n\t\tlane: m.lane,\n\t\t...ifDefined(\"targetFamily\", m.targetFamily),\n\t\t...ifDefined(\"profileHash\", m.profileHash),\n\t\t...ifDefined(\"annotations\", m.annotations)\n\t};\n\treturn {\n\t\tcollection: data.collection,\n\t\tcommand,\n\t\tmeta\n\t};\n}\nfunction deserializeDdlCommand(json) {\n\tconst kind = recordKind(json, \"DDL command\");\n\tswitch (kind) {\n\t\tcase \"createIndex\": {\n\t\t\tconst data = validate(CreateIndexJson, json, \"createIndex command\");\n\t\t\treturn new CreateIndexCommand(data.collection, data.keys, {\n\t\t\t\t...ifDefined(\"unique\", data.unique),\n\t\t\t\t...ifDefined(\"sparse\", data.sparse),\n\t\t\t\t...ifDefined(\"expireAfterSeconds\", data.expireAfterSeconds),\n\t\t\t\t...ifDefined(\"partialFilterExpression\", data.partialFilterExpression),\n\t\t\t\t...ifDefined(\"name\", data.name),\n\t\t\t\t...ifDefined(\"wildcardProjection\", data.wildcardProjection),\n\t\t\t\t...ifDefined(\"collation\", data.collation),\n\t\t\t\t...ifDefined(\"weights\", data.weights),\n\t\t\t\t...ifDefined(\"default_language\", data.default_language),\n\t\t\t\t...ifDefined(\"language_override\", data.language_override)\n\t\t\t});\n\t\t}\n\t\tcase \"dropIndex\": {\n\t\t\tconst data = validate(DropIndexJson, json, \"dropIndex command\");\n\t\t\treturn new DropIndexCommand(data.collection, data.name);\n\t\t}\n\t\tcase \"createCollection\": {\n\t\t\tconst data = validate(CreateCollectionJson, json, \"createCollection command\");\n\t\t\treturn new CreateCollectionCommand(data.collection, {\n\t\t\t\t...ifDefined(\"validator\", data.validator),\n\t\t\t\t...ifDefined(\"validationLevel\", data.validationLevel),\n\t\t\t\t...ifDefined(\"validationAction\", data.validationAction),\n\t\t\t\t...ifDefined(\"capped\", data.capped),\n\t\t\t\t...ifDefined(\"size\", data.size),\n\t\t\t\t...ifDefined(\"max\", data.max),\n\t\t\t\t...ifDefined(\"timeseries\", data.timeseries),\n\t\t\t\t...ifDefined(\"collation\", data.collation),\n\t\t\t\t...ifDefined(\"changeStreamPreAndPostImages\", data.changeStreamPreAndPostImages),\n\t\t\t\t...ifDefined(\"clusteredIndex\", data.clusteredIndex)\n\t\t\t});\n\t\t}\n\t\tcase \"dropCollection\": return new DropCollectionCommand(validate(DropCollectionJson, json, \"dropCollection command\").collection);\n\t\tcase \"collMod\": {\n\t\t\tconst data = validate(CollModJson, json, \"collMod command\");\n\t\t\treturn new CollModCommand(data.collection, {\n\t\t\t\t...ifDefined(\"validator\", data.validator),\n\t\t\t\t...ifDefined(\"validationLevel\", data.validationLevel),\n\t\t\t\t...ifDefined(\"validationAction\", data.validationAction),\n\t\t\t\t...ifDefined(\"changeStreamPreAndPostImages\", data.changeStreamPreAndPostImages)\n\t\t\t});\n\t\t}\n\t\tdefault: throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Unknown DDL command kind: ${kind}`, { meta: {\n\t\t\tcontext: \"DDL command\",\n\t\t\tkind\n\t\t} });\n\t}\n}\nfunction deserializeInspectionCommand(json) {\n\tconst kind = recordKind(json, \"inspection command\");\n\tswitch (kind) {\n\t\tcase \"listIndexes\": return new ListIndexesCommand(validate(ListIndexesJson, json, \"listIndexes command\").collection);\n\t\tcase \"listCollections\":\n\t\t\tvalidate(ListCollectionsJson, json, \"listCollections command\");\n\t\t\treturn new ListCollectionsCommand();\n\t\tdefault: throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Unknown inspection command kind: ${kind}`, { meta: {\n\t\t\tcontext: \"inspection command\",\n\t\t\tkind\n\t\t} });\n\t}\n}\nfunction deserializeCheck(json) {\n\tconst data = validate(CheckJson, json, \"migration check\");\n\treturn {\n\t\tdescription: data.description,\n\t\tsource: deserializeInspectionCommand(data.source),\n\t\tfilter: deserializeFilterExpr(data.filter),\n\t\texpect: data.expect\n\t};\n}\nfunction deserializeStep(json) {\n\tconst data = validate(StepJson, json, \"migration step\");\n\treturn {\n\t\tdescription: data.description,\n\t\tcommand: deserializeDdlCommand(data.command)\n\t};\n}\nfunction isDataTransformJson(json) {\n\treturn recordValue(json, \"operationClass\", \"migration operation\") === \"data\";\n}\nfunction deserializeDdlOp(json) {\n\tconst data = validate(DdlOperationJson, json, \"migration operation\");\n\treturn {\n\t\tid: data.id,\n\t\tlabel: data.label,\n\t\toperationClass: data.operationClass,\n\t\tprecheck: data.precheck.map(deserializeCheck),\n\t\texecute: data.execute.map(deserializeStep),\n\t\tpostcheck: data.postcheck.map(deserializeCheck)\n\t};\n}\nfunction deserializeDataTransformCheck(json) {\n\tconst data = validate(DataTransformCheckJson, json, \"data transform check\");\n\treturn {\n\t\tdescription: data.description,\n\t\tsource: deserializeMongoQueryPlan(data.source),\n\t\tfilter: deserializeFilterExpr(data.filter),\n\t\texpect: data.expect\n\t};\n}\nfunction deserializeDataTransformOp(json) {\n\tconst data = validate(DataTransformOperationJson, json, \"data transform operation\");\n\treturn {\n\t\tid: data.id,\n\t\tlabel: data.label,\n\t\toperationClass: \"data\",\n\t\tname: data.name,\n\t\tprecheck: data.precheck.map(deserializeDataTransformCheck),\n\t\trun: data.run.map(deserializeMongoQueryPlan),\n\t\tpostcheck: data.postcheck.map(deserializeDataTransformCheck)\n\t};\n}\nfunction deserializeMongoOp(json) {\n\tif (isDataTransformJson(json)) return deserializeDataTransformOp(json);\n\treturn deserializeDdlOp(json);\n}\nfunction deserializeMongoOps(json) {\n\treturn json.map(deserializeMongoOp);\n}\nfunction serializeMongoOps(ops) {\n\treturn JSON.stringify(ops, null, 2);\n}\n//#endregion\n//#region src/core/mongo-runner.ts\nconst READ_ONLY_CHECK_COMMAND_KINDS = /* @__PURE__ */ new Set([\"aggregate\", \"rawAggregate\"]);\nfunction runnerFailure(code, summary, opts) {\n\treturn notOk({\n\t\tcode,\n\t\tsummary,\n\t\t...opts\n\t});\n}\nvar MongoMigrationRunner = class {\n\tdeps;\n\tconstructor(deps) {\n\t\tthis.deps = deps;\n\t}\n\tasync execute(options) {\n\t\tconst { inspectionExecutor, adapter, driver, executeDdl, markerOps } = this.deps;\n\t\tconst operations = deserializeMongoOps(blindCast(options.plan.operations));\n\t\tconst space = options.plan.spaceId ?? APP_SPACE_ID;\n\t\tconst policyCheck = this.enforcePolicyCompatibility(options.policy, operations);\n\t\tif (policyCheck) return policyCheck;\n\t\tconst existingMarker = await markerOps.readMarker(space);\n\t\tconst markerCheck = this.ensureMarkerCompatibility(existingMarker, options.plan);\n\t\tif (markerCheck) return markerCheck;\n\t\tconst checks = options.executionChecks;\n\t\tconst runPrechecks = checks?.prechecks !== false;\n\t\tconst runPostchecks = checks?.postchecks !== false;\n\t\tconst runIdempotency = checks?.idempotencyChecks !== false;\n\t\tconst filterEvaluator = new FilterEvaluator();\n\t\tlet operationsExecuted = 0;\n\t\tfor (const operation of operations) {\n\t\t\toptions.callbacks?.onOperationStart?.(operation);\n\t\t\ttry {\n\t\t\t\tif (operation.operationClass === \"data\") {\n\t\t\t\t\tconst result = await this.executeDataTransform(blindCast(operation), adapter, driver, filterEvaluator, runIdempotency, runPrechecks, runPostchecks);\n\t\t\t\t\tif (result.failure) return result.failure;\n\t\t\t\t\tif (result.executed) operationsExecuted += 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst ddlOp = blindCast(operation);\n\t\t\t\tif (runPostchecks && runIdempotency) {\n\t\t\t\t\tif (await this.allChecksSatisfied(ddlOp.postcheck, inspectionExecutor, filterEvaluator)) continue;\n\t\t\t\t}\n\t\t\t\tif (runPrechecks) {\n\t\t\t\t\tif (!await this.evaluateChecks(ddlOp.precheck, inspectionExecutor, filterEvaluator)) return runnerFailure(\"MIGRATION.PRECHECK_FAILED\", `Operation ${operation.id} failed during precheck`, { meta: { operationId: operation.id } });\n\t\t\t\t}\n\t\t\t\tfor (const step of ddlOp.execute) await executeDdl(step.command);\n\t\t\t\tif (runPostchecks) {\n\t\t\t\t\tif (!await this.evaluateChecks(ddlOp.postcheck, inspectionExecutor, filterEvaluator)) return runnerFailure(\"MIGRATION.POSTCHECK_FAILED\", `Operation ${operation.id} failed during postcheck`, { meta: { operationId: operation.id } });\n\t\t\t\t}\n\t\t\t\toperationsExecuted += 1;\n\t\t\t} finally {\n\t\t\t\toptions.callbacks?.onOperationComplete?.(operation);\n\t\t\t}\n\t\t}\n\t\tconst destination = options.plan.destination;\n\t\tconst profileHash = options.destinationContract.profileHash ?? destination.storageHash;\n\t\tconst incomingInvariants = options.plan.providedInvariants ?? [];\n\t\tconst existingInvariantSet = new Set(existingMarker?.invariants ?? []);\n\t\tconst incomingIsSubsetOfExisting = incomingInvariants.every((id) => existingInvariantSet.has(id));\n\t\tconst markerAlreadyAtDestination = existingMarker !== null && existingMarker.storageHash === destination.storageHash && existingMarker.profileHash === profileHash;\n\t\tif (!(operationsExecuted === 0 && markerAlreadyAtDestination && incomingIsSubsetOfExisting)) {\n\t\t\tconst liveSchema = await this.deps.introspectSchema();\n\t\t\tconst rawVerifyResult = verifyMongoSchema({\n\t\t\t\tcontract: options.destinationContract,\n\t\t\t\tschema: liveSchema,\n\t\t\t\tstrict: options.strictVerification ?? true,\n\t\t\t\tframeworkComponents: options.frameworkComponents,\n\t\t\t\t...options.context ? { context: options.context } : {}\n\t\t\t});\n\t\t\tconst verifyResult = options.scopeVerifyResult ? options.scopeVerifyResult(rawVerifyResult) : rawVerifyResult;\n\t\t\tif (!verifyResult.ok) return runnerFailure(\"MIGRATION.SCHEMA_VERIFY_FAILED\", verifyResult.summary, {\n\t\t\t\twhy: \"The resulting database schema does not satisfy the destination contract.\",\n\t\t\t\tmeta: { issues: verifyResult.schema.issues }\n\t\t\t});\n\t\t\tif (existingMarker) {\n\t\t\t\tif (!await markerOps.updateMarker(space, existingMarker.storageHash, {\n\t\t\t\t\tstorageHash: destination.storageHash,\n\t\t\t\t\tprofileHash,\n\t\t\t\t\tinvariants: incomingInvariants\n\t\t\t\t})) return runnerFailure(\"MIGRATION.MARKER_CAS_FAILURE\", \"Marker was modified by another process during migration execution.\", { meta: {\n\t\t\t\t\tspace,\n\t\t\t\t\texpectedStorageHash: existingMarker.storageHash,\n\t\t\t\t\tdestinationStorageHash: destination.storageHash\n\t\t\t\t} });\n\t\t\t} else await markerOps.initMarker(space, {\n\t\t\t\tstorageHash: destination.storageHash,\n\t\t\t\tprofileHash,\n\t\t\t\tinvariants: incomingInvariants\n\t\t\t});\n\t\t\tawait this.recordLedgerEntries(markerOps, space, options);\n\t\t}\n\t\treturn ok({\n\t\t\toperationsPlanned: operations.length,\n\t\t\toperationsExecuted\n\t\t});\n\t}\n\tasync recordLedgerEntries(markerOps, space, options) {\n\t\tconst plan = options.plan;\n\t\tconst edges = options.migrationEdges;\n\t\tconst totalEdgeOps = edges.reduce((sum, edge) => sum + edge.operationCount, 0);\n\t\tif (totalEdgeOps !== plan.operations.length) throw new InternalError(`Ledger write: plan.operations length (${plan.operations.length}) does not match sum of migrationEdges operationCount (${totalEdgeOps})`);\n\t\tlet offset = 0;\n\t\tfor (const edge of edges) {\n\t\t\tconst edgeOps = plan.operations.slice(offset, offset + edge.operationCount);\n\t\t\toffset += edge.operationCount;\n\t\t\tawait markerOps.writeLedgerEntry(space, {\n\t\t\t\tedgeId: `${edge.from}->${edge.to}`,\n\t\t\t\tfrom: edge.from,\n\t\t\t\tto: edge.to,\n\t\t\t\tmigrationName: edge.dirName,\n\t\t\t\tmigrationHash: edge.migrationHash,\n\t\t\t\toperations: edgeOps\n\t\t\t});\n\t\t}\n\t}\n\tasync executeDataTransform(op, adapter, driver, filterEvaluator, runIdempotency, runPrechecks, runPostchecks) {\n\t\tif (runPostchecks && runIdempotency && op.postcheck.length > 0) {\n\t\t\tif (await this.evaluateDataTransformChecks(op.postcheck, adapter, driver, filterEvaluator)) return { executed: false };\n\t\t}\n\t\tif (runPrechecks && op.precheck.length > 0) {\n\t\t\tif (!await this.evaluateDataTransformChecks(op.precheck, adapter, driver, filterEvaluator)) return {\n\t\t\t\texecuted: false,\n\t\t\t\tfailure: runnerFailure(\"MIGRATION.PRECHECK_FAILED\", `Operation ${op.id} failed during precheck`, { meta: {\n\t\t\t\t\toperationId: op.id,\n\t\t\t\t\tname: op.name\n\t\t\t\t} })\n\t\t\t};\n\t\t}\n\t\tfor (const plan of op.run) {\n\t\t\tconst wireCommand = await adapter.lower(plan, {});\n\t\t\tfor await (const _ of driver.execute(wireCommand));\n\t\t}\n\t\tif (runPostchecks && op.postcheck.length > 0) {\n\t\t\tif (!await this.evaluateDataTransformChecks(op.postcheck, adapter, driver, filterEvaluator)) return {\n\t\t\t\texecuted: false,\n\t\t\t\tfailure: runnerFailure(\"MIGRATION.POSTCHECK_FAILED\", `Operation ${op.id} failed during postcheck`, { meta: {\n\t\t\t\t\toperationId: op.id,\n\t\t\t\t\tname: op.name\n\t\t\t\t} })\n\t\t\t};\n\t\t}\n\t\treturn { executed: true };\n\t}\n\tasync evaluateDataTransformChecks(checks, adapter, driver, filterEvaluator) {\n\t\tfor (const check of checks) {\n\t\t\tconst commandKind = check.source.command.kind;\n\t\t\tif (!READ_ONLY_CHECK_COMMAND_KINDS.has(commandKind)) throw errorRunnerFailed(`Data-transform check rejected: command kind \"${commandKind}\" is not read-only`, {\n\t\t\t\twhy: \"Data-transform checks must use aggregate or rawAggregate commands so the pre/postcheck path cannot mutate the database.\",\n\t\t\t\tfix: \"Author the check.source as an aggregate pipeline (or rawAggregate) rather than a DML write command.\",\n\t\t\t\tmeta: {\n\t\t\t\t\tcheckDescription: check.description,\n\t\t\t\t\tcommandKind,\n\t\t\t\t\tcollection: check.source.collection\n\t\t\t\t}\n\t\t\t});\n\t\t\tconst wireCommand = await adapter.lower(check.source, {});\n\t\t\tlet matchFound = false;\n\t\t\tfor await (const row of driver.execute(wireCommand)) if (filterEvaluator.evaluate(check.filter, row)) {\n\t\t\t\tmatchFound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!(check.expect === \"exists\" ? matchFound : !matchFound)) return false;\n\t\t}\n\t\treturn true;\n\t}\n\tasync evaluateChecks(checks, inspectionExecutor, filterEvaluator) {\n\t\tfor (const check of checks) {\n\t\t\tconst matchFound = (await check.source.accept(inspectionExecutor)).some((doc) => filterEvaluator.evaluate(check.filter, doc));\n\t\t\tif (!(check.expect === \"exists\" ? matchFound : !matchFound)) return false;\n\t\t}\n\t\treturn true;\n\t}\n\tasync allChecksSatisfied(checks, inspectionExecutor, filterEvaluator) {\n\t\tif (checks.length === 0) return false;\n\t\treturn this.evaluateChecks(checks, inspectionExecutor, filterEvaluator);\n\t}\n\tenforcePolicyCompatibility(policy, operations) {\n\t\tconst allowedClasses = new Set(policy.allowedOperationClasses);\n\t\tfor (const operation of operations) if (!allowedClasses.has(operation.operationClass)) return runnerFailure(\"MIGRATION.POLICY_VIOLATION\", `Operation ${operation.id} has class \"${operation.operationClass}\" which is not allowed by policy.`, {\n\t\t\twhy: `Policy only allows: ${[...allowedClasses].join(\", \")}.`,\n\t\t\tmeta: {\n\t\t\t\toperationId: operation.id,\n\t\t\t\toperationClass: operation.operationClass\n\t\t\t}\n\t\t});\n\t}\n\tensureMarkerCompatibility(marker, plan) {\n\t\tconst origin = plan.origin ?? null;\n\t\tif (!origin) return;\n\t\tif (!marker) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Missing contract marker: expected origin storage hash ${origin.storageHash}.`, { meta: { expectedOriginStorageHash: origin.storageHash } });\n\t\tif (marker.storageHash !== origin.storageHash) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing contract marker (${marker.storageHash}) does not match plan origin (${origin.storageHash}).`, { meta: {\n\t\t\tmarkerStorageHash: marker.storageHash,\n\t\t\texpectedOriginStorageHash: origin.storageHash\n\t\t} });\n\t}\n};\n//#endregion\n//#region src/core/mongo-target-database.ts\n/**\n* Mongo target `Namespace` concretion. In Mongo the \"namespace\" concept\n* binds to the connection's `db` field — a `MongoTargetDatabase` instance\n* names the database the collections live under. `entries['collection']`\n* holds collection IR. The unbound singleton (below) is the late-bound\n* namespace whose binding the connection's `db` resolves at runtime rather\n* than at authoring time.\n*\n* Qualifier emission is the rendering seam: query / DDL emission asks the\n* namespace for its qualifier (e.g. `\"<db>.<collection>\"`) and consumes\n* the result polymorphically. The unbound singleton overrides these\n* methods to elide the prefix entirely — call sites stay polymorphic and\n* never branch on `id === UNBOUND_NAMESPACE_ID`.\n*/\nvar MongoTargetDatabase = class extends NamespaceBase {\n\tid;\n\tentries;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.id = input.id;\n\t\tconst rawEntries = {\n\t\t\tcollection: {},\n\t\t\t...input.entries\n\t\t};\n\t\tthis.entries = Object.freeze(blindCast(hydrateNamespaceEntities(rawEntries, composeMongoEntityKinds(), \"carry\")));\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"database\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true\n\t\t});\n\t\tfreezeNode(this);\n\t}\n\tget collection() {\n\t\treturn this.entries.collection ?? Object.freeze({});\n\t}\n\t/**\n\t* The bare qualifier as it would appear in a rendered string. The\n\t* unbound-database singleton overrides this to return `''`.\n\t*/\n\tqualifier() {\n\t\treturn this.id;\n\t}\n\t/**\n\t* Qualify a collection name with the database prefix. The\n\t* unbound-database singleton overrides this to emit just the\n\t* collection name. Used by emission/introspection paths that need a\n\t* fully-qualified reference.\n\t*/\n\tqualifyCollection(collectionName) {\n\t\treturn `${this.id}.${collectionName}`;\n\t}\n};\n/**\n* Singleton subclass for the reserved sentinel namespace id\n* (`UNBOUND_NAMESPACE_ID`) — the late-bound namespace whose binding the\n* connection's `db` resolves at runtime. Overrides qualifier emission\n* to elide the database prefix; call sites that consume `qualifier()`\n* / `qualifyCollection()` get unqualified output without branching on\n* the namespace id.\n*\n* This is the target-side materialization of \"the framework provides\n* affordances; targets implement specifics\": the framework names the\n* sentinel; Mongo decides what late-bound means here (the collection\n* name, naked — the database is supplied by the live connection).\n*/\nvar MongoTargetUnboundDatabase = class MongoTargetUnboundDatabase extends MongoTargetDatabase {\n\tstatic instance = new MongoTargetUnboundDatabase();\n\tconstructor() {\n\t\tsuper({ id: UNBOUND_NAMESPACE_ID });\n\t}\n\tqualifier() {\n\t\treturn \"\";\n\t}\n\tqualifyCollection(collectionName) {\n\t\treturn collectionName;\n\t}\n};\n//#endregion\n//#region src/core/mongo-target-contract-serializer.ts\nvar MongoTargetContractSerializer = class extends MongoContractSerializerBase {\n\tconstructTargetContract(validated) {\n\t\tconst { storage, ...rest } = validated;\n\t\tconst namespaces = Object.fromEntries(Object.entries(storage.namespaces).map(([nsId, nsData]) => {\n\t\t\tconst collectionCount = Object.keys(nsData.entries.collection ?? {}).length;\n\t\t\tconst valueSetCount = Object.keys(nsData.entries[\"valueSet\"] ?? {}).length;\n\t\t\tif (nsId === UNBOUND_NAMESPACE_ID && collectionCount === 0 && valueSetCount === 0) return [nsId, MongoTargetUnboundDatabase.instance];\n\t\t\tconst dbInput = { id: nsData.id };\n\t\t\tif (nsData.entries[\"collection\"] !== void 0 || nsData.entries[\"valueSet\"] !== void 0) dbInput.entries = {\n\t\t\t\tcollection: blindCast(nsData.entries[\"collection\"] ?? {}),\n\t\t\t\t...ifDefined(\"valueSet\", blindCast(nsData.entries[\"valueSet\"]))\n\t\t\t};\n\t\t\treturn [nsId, new MongoTargetDatabase(dbInput)];\n\t\t}));\n\t\tconst targetStorage = new MongoStorage({\n\t\t\tstorageHash: storage.storageHash,\n\t\t\tnamespaces\n\t\t});\n\t\treturn {\n\t\t\t...rest,\n\t\t\tstorage: targetStorage\n\t\t};\n\t}\n\tserializeContract(contract) {\n\t\tconst { storage, ...rest } = contract;\n\t\tconst namespacesJson = {};\n\t\tfor (const [nsId, ns] of Object.entries(storage.namespaces)) {\n\t\t\tconst collectionsOut = {};\n\t\t\tfor (const [collName, coll] of Object.entries(ns.entries.collection ?? {})) collectionsOut[collName] = blindCast(JSON.parse(JSON.stringify(coll)));\n\t\t\tconst valueSetOut = {};\n\t\t\tfor (const [vsName, vs] of Object.entries(ns.entries.valueSet ?? {})) valueSetOut[vsName] = blindCast(JSON.parse(JSON.stringify(vs)));\n\t\t\tnamespacesJson[nsId] = {\n\t\t\t\tid: ns.id,\n\t\t\t\tkind: \"mongo-database\",\n\t\t\t\tentries: {\n\t\t\t\t\tcollection: collectionsOut,\n\t\t\t\t\t...ifDefined(\"valueSet\", Object.keys(valueSetOut).length > 0 ? valueSetOut : void 0)\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\treturn blindCast({\n\t\t\t...rest,\n\t\t\tstorage: {\n\t\t\t\tstorageHash: String(storage.storageHash),\n\t\t\t\tnamespaces: namespacesJson\n\t\t\t}\n\t\t});\n\t}\n};\n//#endregion\n//#region src/core/mongo-target-schema-verifier.ts\n/**\n* Mongo target `SchemaVerifier` concretion. Extends the family base's\n* namespace-walk scaffolding and contributes the per-namespace diff via\n* `verifyNamespace`; the diff body reuses the existing target-side\n* helpers (`contractToMongoSchemaIR`, `canonicalizeSchemasForVerification`,\n* `diffMongoSchemas`) so production verification behaviour is unchanged.\n*\n* Today's invariant: every Mongo contract carries exactly one\n* namespace (the unbound singleton, materialised as\n* `MongoTargetUnboundDatabase`), so the family-base namespace walk\n* dispatches exactly once and the per-namespace body runs the existing\n* whole-schema diff. Future per-collection namespace assignment will\n* have this hook project the diff to the namespace's owned collections.\n*\n* `verifyTargetExtensions` returns the empty list — Mongo has no\n* target-only kinds today.\n*\n* Strict diff mode is `false` for SPI-routed calls; production\n* verification today still goes through `verifyMongoSchema` which\n* receives strict from the CLI.\n*/\nvar MongoTargetSchemaVerifier = class extends MongoSchemaVerifierBase {\n\tverifyNamespace(options) {\n\t\tconst expectedIR = contractToMongoSchemaIR(options.contract);\n\t\tconst { live, expected } = canonicalizeSchemasForVerification(options.schema, expectedIR);\n\t\tconst collectionControlPolicy = (name) => this.collectionControlPolicyForName(options.contract, name);\n\t\tconst { failures, warnings } = diffMongoSchemas(live, expected, false, collectionControlPolicy);\n\t\treturn [...failures, ...warnings];\n\t}\n\tverifyTargetExtensions(_options) {\n\t\treturn [];\n\t}\n};\n//#endregion\n//#region src/core/scope-verify-result.ts\n/**\n* The bare entity names the given contracts declare, unioned. The Mongo runner\n* asks this of every OTHER contract space in a multi-space apply, so each\n* space's post-apply verify can drop the extras those siblings claim.\n*/\nfunction entityNamesDeclaredBy(contracts) {\n\tconst owned = /* @__PURE__ */ new Set();\n\tfor (const contract of contracts) for (const { entityName } of elementCoordinates(contract.storage)) owned.add(entityName);\n\treturn owned;\n}\n/**\n* True when an issue reports a whole collection present in the database but\n* declared by no contract (an extra) — its path is exactly the collection\n* name, never a deeper index/validator/options auxiliary.\n*/\nfunction extraCollectionName(issue) {\n\tif (issueOutcome(issue) !== \"not-expected\" || issue.path.length !== 1) return void 0;\n\treturn issue.path[0];\n}\n/**\n* Scope a per-space post-apply verify result to the contract space's own\n* elements: drop the `extra` findings for collections another contract space\n* claims. The runner verifies the destination contract against the full live\n* database, which holds sibling spaces' collections — without the scoping a\n* multi-space apply could never pass strict verify. Extras claimed by NO space\n* survive, so genuine drift still fails the runner's verdict.\n*\n* The result is issue-based, so the verdict recomputes directly from the\n* surviving list: `ok` holds exactly when it is empty.\n*/\nfunction scopeVerifyResultToSpace(result, ownedByOtherSpaces) {\n\tif (ownedByOtherSpaces.size === 0) return result;\n\tconst issues = result.schema.issues.filter((issue) => {\n\t\tconst name = extraCollectionName(issue);\n\t\treturn name === void 0 || !ownedByOtherSpaces.has(name);\n\t});\n\tif (issues.length === result.schema.issues.length) return result;\n\tconst ok = issues.length === 0;\n\tconst { code: staleCode, ...envelope } = result;\n\treturn {\n\t\t...envelope,\n\t\tok,\n\t\t...ok ? {} : { code: result.code ?? \"CONTRACT.MARKER_REQUIRED\" },\n\t\tsummary: ok ? \"Database schema satisfies contract\" : result.summary,\n\t\tschema: {\n\t\t\t...result.schema,\n\t\t\tissues\n\t\t}\n\t};\n}\n//#endregion\n//#region src/core/control-target.ts\n/**\n* `migration.ts` default-exports a `Migration` subclass whose `operations`\n* getter returns the ordered list of operations and whose `describe()`\n* returns the manifest identity metadata. `MongoMigrationPlanner.plan()`\n* returns a `MigrationPlanWithAuthoringSurface` that knows how to render\n* itself back to such a file; `MongoMigrationPlanner.emptyMigration()`\n* returns the same shape for `migration new`. Users run the scaffolded\n* `migration.ts` directly (via `node migration.ts`) to self-emit\n* `ops.json` and attest the `migrationHash`.\n*/\nconst mongoTargetDescriptor = {\n\t...mongoTargetDescriptorMeta,\n\tcontractSerializer: new MongoTargetContractSerializer(),\n\tschemaVerifier: new MongoTargetSchemaVerifier(),\n\tmigrations: {\n\t\tcreatePlanner(_adapter) {\n\t\t\treturn new MongoMigrationPlanner();\n\t\t},\n\t\tcreateRunner(family) {\n\t\t\tlet cachedDeps;\n\t\t\tconst runMongo = async (driver, runnerOptions) => {\n\t\t\t\tcachedDeps ??= createMongoRunnerDeps(driver, MongoDriverImpl.fromDb(extractDb(driver)), family);\n\t\t\t\treturn new MongoMigrationRunner(cachedDeps).execute({\n\t\t\t\t\t...runnerOptions,\n\t\t\t\t\tdestinationContract: blindCast(runnerOptions.destinationContract)\n\t\t\t\t});\n\t\t\t};\n\t\t\treturn { async execute({ driver, perSpaceOptions }) {\n\t\t\t\tconst contracts = perSpaceOptions.map((opts) => blindCast(opts.destinationContract));\n\t\t\t\tconst perSpaceResults = [];\n\t\t\t\tfor (let i = 0; i < perSpaceOptions.length; i++) {\n\t\t\t\t\tconst spaceOptions = perSpaceOptions[i];\n\t\t\t\t\tif (!spaceOptions) continue;\n\t\t\t\t\tconst ownedByOtherSpaces = entityNamesDeclaredBy(contracts.filter((_, j) => j !== i));\n\t\t\t\t\tconst scopeVerifyResult = (result) => scopeVerifyResultToSpace(result, ownedByOtherSpaces);\n\t\t\t\t\tconst { space, ...runnerOptions } = spaceOptions;\n\t\t\t\t\tconst result = await runMongo(driver, {\n\t\t\t\t\t\t...runnerOptions,\n\t\t\t\t\t\tscopeVerifyResult\n\t\t\t\t\t});\n\t\t\t\t\tif (!result.ok) return notOk({\n\t\t\t\t\t\t...result.failure,\n\t\t\t\t\t\tfailingSpace: space\n\t\t\t\t\t});\n\t\t\t\t\tperSpaceResults.push({\n\t\t\t\t\t\tspace,\n\t\t\t\t\t\tvalue: result.value\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn ok({ perSpaceResults });\n\t\t\t} };\n\t\t},\n\t\tcontractToSchema(contract) {\n\t\t\treturn contractToMongoSchemaIR(blindCast(contract));\n\t\t}\n\t},\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"mongo\",\n\t\t\ttargetId: \"mongo\"\n\t\t};\n\t}\n};\n//#endregion\nexport { CollModCall, CreateCollectionCall, CreateIndexCall, DropCollectionCall, DropIndexCall, FilterEvaluator, MongoMigrationPlanner, MongoMigrationRunner, MongoTargetContractSerializer, MongoTargetDatabase, MongoTargetSchemaVerifier, MongoTargetUnboundDatabase, PlannerProducedMongoMigration, deserializeMongoOp, deserializeMongoOps, mongoTargetDescriptor, renderCallsToTypeScript, renderOps, schemaCollectionToCreateCollectionOptions, schemaIndexToCreateIndexOptions, serializeMongoOps };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAM,0BAA0B;AAChC,IAAI,oBAAoB,cAAc,aAAa;CAClD,qBAAqB;EACpB,OAAO,CAAC;GACP,iBAAiB;GACjB,QAAQ,KAAK;EACd,CAAC;CACF;CACA,SAAS;EACR,OAAO,OAAO,IAAI;CACnB;AACD;AACA,SAAS,WAAW,MAAM;CACzB,OAAO,KAAK,KAAK,MAAM,GAAG,EAAE,MAAM,GAAG,EAAE,WAAW,CAAC,CAAC,KAAK,IAAI;AAC9D;AACA,IAAI,kBAAkB,cAAc,kBAAkB;CACrD,cAAc;CACd,iBAAiB;CACjB;CACA;CACA;CACA;CACA,YAAY,YAAY,MAAM,SAAS;EACtC,MAAM;EACN,KAAK,aAAa;EAClB,KAAK,OAAO;EACZ,KAAK,UAAU;EACf,KAAK,QAAQ,mBAAmB,WAAW,IAAI,WAAW,IAAI,EAAE;EAChE,KAAK,OAAO;CACb;CACA,OAAO;EACN,OAAO,YAAY,KAAK,YAAY,KAAK,MAAM,KAAK,OAAO;CAC5D;CACA,mBAAmB;EAClB,OAAO,KAAK,UAAU,eAAe,eAAe,KAAK,UAAU,EAAE,IAAI,eAAe,KAAK,IAAI,EAAE,IAAI,eAAe,KAAK,OAAO,EAAE,KAAK,eAAe,eAAe,KAAK,UAAU,EAAE,IAAI,eAAe,KAAK,IAAI,EAAE;CACvN;AACD;AACA,IAAI,gBAAgB,cAAc,kBAAkB;CACnD,cAAc;CACd,iBAAiB;CACjB;CACA;CACA;CACA,YAAY,YAAY,MAAM;EAC7B,MAAM;EACN,KAAK,aAAa;EAClB,KAAK,OAAO;EACZ,KAAK,QAAQ,iBAAiB,WAAW,IAAI,WAAW,IAAI,EAAE;EAC9D,KAAK,OAAO;CACb;CACA,OAAO;EACN,OAAO,UAAU,KAAK,YAAY,KAAK,IAAI;CAC5C;CACA,m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,cAAc,UAAU;GACvB,OAAO,IAAI,sBAAsB;EAClC;EACA,aAAa,QAAQ;GACpB,IAAI;GACJ,MAAM,WAAW,OAAO,QAAQ,kBAAkB;IACjD,eAAe,sBAAsB,QAAQ,gBAAgB,OAAO,UAAU,MAAM,CAAC,GAAG,MAAM;IAC9F,OAAO,IAAI,qBAAqB,UAAU,CAAC,CAAC,QAAQ;KACnD,GAAG;KACH,qBAAqB,UAAU,cAAc,mBAAmB;IACjE,CAAC;GACF;GACA,OAAO,EAAE,MAAM,QAAQ,EAAE,QAAQ,mBAAmB;IACnD,MAAM,YAAY,gBAAgB,KAAK,SAAS,UAAU,KAAK,mBAAmB,CAAC;IACnF,MAAM,kBAAkB,CAAC;IACzB,KAAK,IAAI,IAAI,GAAG,IAAI,gBAAgB,QAAQ,KAAK;KAChD,MAAM,eAAe,gBAAgB;KACrC,IAAI,CAAC,cAAc;KACnB,MAAM,qBAAqB,sBAAsB,UAAU,QAAQ,GAAG,MAAM,MAAM,CAAC,CAAC;KACpF,MAAM,qBAAqB,WAAW,yBAAyB,QAAQ,kBAAkB;KACzF,MAAM,EAAE,OAAO,GAAG,kBAAkB;KACpC,MAAM,SAAS,MAAM,SAAS,QAAQ;MACrC,GAAG;MACH;KACD,CAAC;KACD,IAAI,CAAC,OAAO,IAAI,OAAO,MAAM;MAC5B,GAAG,OAAO;MACV,cAAc;KACf,CAAC;KACD,gBAAgB,KAAK;MACpB;MACA,OAAO,OAAO;KACf,CAAC;IACF;IACA,OAAO,GAAG,EAAE,gBAAgB,CAAC;GAC9B,EAAE;EACH;EACA,iBAAiB,UAAU;GAC1B,OAAO,wBAAwB,UAAU,QAAQ,CAAC;EACnD;CACD;CACA,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-CDO-vU3z.d.mts","names":[],"sources":["../../../../3-mongo-target/1-mongo-target/dist/control.d.mts"],"mappings":";;;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;;;;;;;;;;;;;cAeN,mCAAmC;kBAC/B,UAAU;UAClB;EACR;EACA,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;cAyBN,kCAAkC,wBAAwB,qBAAqB;YACjF,gBAAgB;aACf,UAAU;aACV,QAAQ;aACR;aACA,WAAW;eACT;YACH,uBAAuB,UAAU,oBAAoB,qBAAqB,0BAA0B;;;;;;;;;;;;;;;;;;;cAmBlG,sCAAsC,UAAU,uCAAuC;mBAClF;mBACA;mBACA;WACR;EACT,YAAY,gBAAgB,mBAAiB,MAAM,eAAe;MAC9D,uBAAuB;EAC3B,YAAY;EACZ,iBAAiB,wBAAwB;;;;iBAI1B,UAAU,OAAO,cAAc,mBAAiB;;;UAGvD;WACC;WACA;;WAEA;;;;;;;WAOA,yBAAyB;;;;;;;;;;;;;;;;;;;iBAmBnB,wBAAwB,OAAO,cAAc,kBAAgB,MAAM"}
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import "./mongo-adapter-CjJU3S9o-BIJruFYW.mjs";
|
|
2
|
-
import { AnyMongoDdlCommand, ListCollectionsCommand, ListIndexesCommand, MongoInspectionCommandVisitor } from "@prisma/orm-family-mongo/query-ast/control";
|
|
3
|
-
import { Db, Document } from "mongodb";
|
|
4
|
-
import { MongoSchemaIR } from "@prisma/orm-family-mongo/schema-ir";
|
|
5
|
-
import { ControlDriverInstance, ControlFamilyInstance } from "@prisma/orm-framework/components/control";
|
|
6
|
-
import { MongoAdapter, MongoControlDriverInstance, MongoControlDriverInstance as MongoControlDriverInstance$1, MongoDriver } from "@prisma/orm-family-mongo/lowering";
|
|
7
|
-
import { MongoControlAdapter, MongoControlAdapterDescriptor } from "@prisma/orm-family-mongo/family/control-adapter";
|
|
8
|
-
import { ContractMarkerRecord, LedgerEntryRecord } from "@prisma/orm-framework/contract/types";
|
|
9
|
-
//#region ../../../3-mongo-target/2-mongo-adapter/dist/control.d.mts
|
|
10
|
-
//#region src/core/inspection-executor.d.ts
|
|
11
|
-
/**
|
|
12
|
-
* Executes the read-only catalog inspections (`listCollections` / `listIndexes`)
|
|
13
|
-
* that migration prechecks/postchecks and operation preview evaluate, directly
|
|
14
|
-
* against `db`. Routing these checks through the adapter's lowering seam is
|
|
15
|
-
* deferred to the `typed-migration-verification-queries` slice.
|
|
16
|
-
*/
|
|
17
|
-
declare class MongoInspectionExecutor implements MongoInspectionCommandVisitor<Promise<Document[]>> {
|
|
18
|
-
private readonly db;
|
|
19
|
-
constructor(db: Db);
|
|
20
|
-
listIndexes(cmd: ListIndexesCommand): Promise<Document[]>;
|
|
21
|
-
listCollections(_cmd: ListCollectionsCommand): Promise<Document[]>;
|
|
22
|
-
}
|
|
23
|
-
//#endregion
|
|
24
|
-
//#region src/core/introspect-schema.d.ts
|
|
25
|
-
declare function introspectSchema(db: Db): Promise<MongoSchemaIR>;
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region src/core/mongo-control-adapter.d.ts
|
|
28
|
-
/**
|
|
29
|
-
* Mongo control adapter for control-plane operations like introspection
|
|
30
|
-
* and marker-ledger CAS. Implements the family-level `MongoControlAdapter`
|
|
31
|
-
* SPI. Every marker/ledger operation builds a canonical command inline via
|
|
32
|
-
* the contract-free fluent builder and dispatches it through the family
|
|
33
|
-
* adapter's lowering path (`createMongoAdapter().lower(plan, {})`) onto the
|
|
34
|
-
* Mongo wire transport (`driver.execute(wireCommand)`) — the same route SQL
|
|
35
|
-
* marker/ledger ops take through `adapter.lower()` → `driver.query()`.
|
|
36
|
-
*/
|
|
37
|
-
declare class MongoControlAdapterImpl implements MongoControlAdapter<'mongo'> {
|
|
38
|
-
#private;
|
|
39
|
-
readonly familyId: "mongo";
|
|
40
|
-
readonly targetId: "mongo";
|
|
41
|
-
executeDdl(driver: MongoDriver, command: AnyMongoDdlCommand): Promise<void>;
|
|
42
|
-
readMarker(driver: ControlDriverInstance<'mongo', 'mongo'>, space: string): Promise<ContractMarkerRecord | null>;
|
|
43
|
-
readAllMarkers(driver: ControlDriverInstance<'mongo', 'mongo'>): Promise<ReadonlyMap<string, ContractMarkerRecord>>;
|
|
44
|
-
initMarker(driver: ControlDriverInstance<'mongo', 'mongo'>, space: string, destination: {
|
|
45
|
-
readonly storageHash: string;
|
|
46
|
-
readonly profileHash: string;
|
|
47
|
-
readonly invariants?: readonly string[];
|
|
48
|
-
}): Promise<void>;
|
|
49
|
-
updateMarker(driver: ControlDriverInstance<'mongo', 'mongo'>, space: string, expectedFrom: string, destination: {
|
|
50
|
-
readonly storageHash: string;
|
|
51
|
-
readonly profileHash: string;
|
|
52
|
-
readonly invariants?: readonly string[];
|
|
53
|
-
}): Promise<boolean>;
|
|
54
|
-
writeLedgerEntry(driver: ControlDriverInstance<'mongo', 'mongo'>, space: string, entry: {
|
|
55
|
-
readonly edgeId: string;
|
|
56
|
-
readonly from: string;
|
|
57
|
-
readonly to: string;
|
|
58
|
-
readonly migrationName: string;
|
|
59
|
-
readonly migrationHash: string;
|
|
60
|
-
readonly operations: readonly unknown[];
|
|
61
|
-
}): Promise<void>;
|
|
62
|
-
readLedger(driver: ControlDriverInstance<'mongo', 'mongo'>, space?: string): Promise<readonly LedgerEntryRecord[]>;
|
|
63
|
-
introspectSchema(driver: ControlDriverInstance<'mongo', 'mongo'>): Promise<MongoSchemaIR>;
|
|
64
|
-
}
|
|
65
|
-
//#endregion
|
|
66
|
-
//#region src/core/mongo-control-driver.d.ts
|
|
67
|
-
declare function isMongoControlDriver(driver: ControlDriverInstance<'mongo', string>): driver is MongoControlDriverInstance;
|
|
68
|
-
//#endregion
|
|
69
|
-
//#region src/core/runner-deps.d.ts
|
|
70
|
-
declare function extractDb(driver: ControlDriverInstance<'mongo', 'mongo'>): Db;
|
|
71
|
-
/**
|
|
72
|
-
* Marker / ledger operations the Mongo runner depends on. Every method
|
|
73
|
-
* takes a `space` parameter so each loaded contract space addresses its
|
|
74
|
-
* own marker row independently — see ADR 212 for the per-space
|
|
75
|
-
* mechanism.
|
|
76
|
-
*/
|
|
77
|
-
interface MarkerOperations {
|
|
78
|
-
readMarker(space: string): Promise<ContractMarkerRecord | null>;
|
|
79
|
-
initMarker(space: string, destination: {
|
|
80
|
-
readonly storageHash: string;
|
|
81
|
-
readonly profileHash: string;
|
|
82
|
-
readonly invariants?: readonly string[];
|
|
83
|
-
}): Promise<void>;
|
|
84
|
-
updateMarker(space: string, expectedFrom: string, destination: {
|
|
85
|
-
readonly storageHash: string;
|
|
86
|
-
readonly profileHash: string;
|
|
87
|
-
readonly invariants?: readonly string[];
|
|
88
|
-
}): Promise<boolean>;
|
|
89
|
-
writeLedgerEntry(space: string, entry: {
|
|
90
|
-
readonly edgeId: string;
|
|
91
|
-
readonly from: string;
|
|
92
|
-
readonly to: string;
|
|
93
|
-
readonly migrationName: string;
|
|
94
|
-
readonly migrationHash: string;
|
|
95
|
-
readonly operations: readonly unknown[];
|
|
96
|
-
}): Promise<void>;
|
|
97
|
-
}
|
|
98
|
-
interface MongoRunnerDependencies {
|
|
99
|
-
readonly inspectionExecutor: MongoInspectionCommandVisitor<Promise<Record<string, unknown>[]>>;
|
|
100
|
-
readonly adapter: MongoAdapter;
|
|
101
|
-
readonly driver: MongoDriver;
|
|
102
|
-
readonly executeDdl: (command: AnyMongoDdlCommand) => Promise<void>;
|
|
103
|
-
readonly markerOps: MarkerOperations;
|
|
104
|
-
readonly introspectSchema: () => Promise<MongoSchemaIR>;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Build the runner-dependencies envelope. `controlAdapter` is the
|
|
108
|
-
* dispatch surface for wire-level Mongo CAS operations (marker reads,
|
|
109
|
-
* marker advances, ledger appends, introspection); the envelope's
|
|
110
|
-
* `markerOps` shim simply forwards each call through it. When the
|
|
111
|
-
* caller already has a `MongoControlAdapter` on the control stack it
|
|
112
|
-
* can pass it in; otherwise a default `MongoControlAdapterImpl` is
|
|
113
|
-
* constructed locally.
|
|
114
|
-
*/
|
|
115
|
-
declare function createMongoRunnerDeps(controlDriver: ControlDriverInstance<'mongo', 'mongo'>, driver: MongoDriver, _family: ControlFamilyInstance<'mongo', MongoSchemaIR>, controlAdapter?: MongoControlAdapter<'mongo'>): MongoRunnerDependencies;
|
|
116
|
-
//#endregion
|
|
117
|
-
//#region src/exports/control.d.ts
|
|
118
|
-
/**
|
|
119
|
-
* The base PSL scalars as zero-arg type constructors in the unified authoring
|
|
120
|
-
* channel, with explicit `nativeType` values pinned to the codec manifests
|
|
121
|
-
* (`codecLookup.targetTypesFor(codecId)[0]`).
|
|
122
|
-
*/
|
|
123
|
-
declare const mongoScalarAuthoringTypes: {
|
|
124
|
-
readonly String: {
|
|
125
|
-
readonly kind: "typeConstructor";
|
|
126
|
-
readonly documentation: "Text stored as a BSON string.";
|
|
127
|
-
readonly output: {
|
|
128
|
-
readonly codecId: "mongo/string@1";
|
|
129
|
-
readonly nativeType: "string";
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
readonly Int: {
|
|
133
|
-
readonly kind: "typeConstructor";
|
|
134
|
-
readonly documentation: "A signed 32-bit integer stored as BSON int.";
|
|
135
|
-
readonly output: {
|
|
136
|
-
readonly codecId: "mongo/int32@1";
|
|
137
|
-
readonly nativeType: "int";
|
|
138
|
-
};
|
|
139
|
-
};
|
|
140
|
-
readonly Boolean: {
|
|
141
|
-
readonly kind: "typeConstructor";
|
|
142
|
-
readonly documentation: "A true or false value stored as BSON bool.";
|
|
143
|
-
readonly output: {
|
|
144
|
-
readonly codecId: "mongo/bool@1";
|
|
145
|
-
readonly nativeType: "bool";
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
readonly DateTime: {
|
|
149
|
-
readonly kind: "typeConstructor";
|
|
150
|
-
readonly documentation: "A date and time stored as BSON date with millisecond precision.";
|
|
151
|
-
readonly output: {
|
|
152
|
-
readonly codecId: "mongo/date@1";
|
|
153
|
-
readonly nativeType: "date";
|
|
154
|
-
};
|
|
155
|
-
};
|
|
156
|
-
readonly ObjectId: {
|
|
157
|
-
readonly kind: "typeConstructor";
|
|
158
|
-
readonly documentation: "A 12-byte MongoDB identifier stored as BSON ObjectId.";
|
|
159
|
-
readonly output: {
|
|
160
|
-
readonly codecId: "mongo/objectId@1";
|
|
161
|
-
readonly nativeType: "objectId";
|
|
162
|
-
};
|
|
163
|
-
};
|
|
164
|
-
readonly Float: {
|
|
165
|
-
readonly kind: "typeConstructor";
|
|
166
|
-
readonly documentation: "A double-precision floating-point number stored as BSON double.";
|
|
167
|
-
readonly output: {
|
|
168
|
-
readonly codecId: "mongo/double@1";
|
|
169
|
-
readonly nativeType: "double";
|
|
170
|
-
};
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
declare const mongoAdapterDescriptor: MongoControlAdapterDescriptor<'mongo'>;
|
|
174
|
-
//#endregion
|
|
175
|
-
export { MongoRunnerDependencies as a, introspectSchema as c, mongoScalarAuthoringTypes as d, MongoInspectionExecutor as i, isMongoControlDriver as l, MongoControlAdapterImpl as n, createMongoRunnerDeps as o, MongoControlDriverInstance$1 as r, extractDb as s, MarkerOperations as t, mongoAdapterDescriptor as u };
|
|
176
|
-
//# sourceMappingURL=control-CbxqWOJS.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-CbxqWOJS.d.mts","names":[],"sources":["../../../../3-mongo-target/2-mongo-adapter/dist/control.d.mts"],"mappings":";;;;;;;;;;;;;;;;cAec,mCAAmC,8BAA8B,QAAQ;mBACpE;EACjB,YAAY,IAAI;EAChB,YAAY,KAAK,qBAAqB,QAAQ;EAC9C,gBAAgB,MAAM,yBAAyB,QAAQ;;;;iBAIxC,iBAAiB,IAAI,KAAK,QAAQ;;;;;;;;;;;;cAYrC,mCAAmC;;WAEtC;WACA;EACT,WAAW,QAAQ,aAAa,SAAS,qBAAqB;EAC9D,WAAW,QAAQ,yCAAyC,gBAAgB,QAAQ;EACpF,eAAe,QAAQ,0CAA0C,QAAQ,oBAAoB;EAC7F,WAAW,QAAQ,yCAAyC,eAAe;aAChE;aACA;aACA;MACP;EACJ,aAAa,QAAQ,yCAAyC,eAAe,sBAAsB;aACxF;aACA;aACA;MACP;EACJ,iBAAiB,QAAQ,yCAAyC,eAAe;aACtE;aACA;aACA;aACA;aACA;aACA;MACP;EACJ,WAAW,QAAQ,yCAAyC,iBAAiB,iBAAiB;EAC9F,iBAAiB,QAAQ,0CAA0C,QAAQ;;;;iBAI5D,qBAAqB,QAAQ,yCAAyC,UAAU;;;iBAGhF,UAAU,QAAQ,0CAA0C;;;;;;;UAOnE;EACR,WAAW,gBAAgB,QAAQ;EACnC,WAAW,eAAe;aACf;aACA;aACA;MACP;EACJ,aAAa,eAAe,sBAAsB;aACvC;aACA;aACA;MACP;EACJ,iBAAiB,eAAe;aACrB;aACA;aACA;aACA;aACA;aACA;MACP;;UAEI;WACC,oBAAoB,8BAA8B,QAAQ;WAC1D,SAAS;WACT,QAAQ;WACR,aAAa,SAAS,uBAAuB;WAC7C,WAAW;WACX,wBAAwB,QAAQ;;;;;;;;;;;iBAW1B,sBAAsB,eAAe,yCAAyC,QAAQ,aAAa,SAAS,+BAA+B,gBAAgB,iBAAiB,+BAA+B;;;;;;;;cAQ9M;WACH;aACE;aACA;aACA;eACE;eACA;;;WAGJ;aACE;aACA;aACA;eACE;eACA;;;WAGJ;aACE;aACA;aACA;eACE;eACA;;;WAGJ;aACE;aACA;aACA;eACE;eACA;;;WAGJ;aACE;aACA;aACA;eACE;eACA;;;WAGJ;aACE;aACA;aACA;eACE;eACA;;;;cAID,wBAAwB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-types-CxW7xs7P-Dxj3sc0T.mjs","names":[],"sources":["../../../../3-mongo-target/2-mongo-adapter/dist/data-types-CxW7xs7P.mjs"],"sourcesContent":["import { dataType } from \"@internal/framework-components/codec\";\n//#region src/core/data-types.ts\n/**\n* The data types this target owns, one per BSON type its codecs represent. None of them casts from\n* another and none is written in a contract source yet: this target's own types are the subject of\n* a later piece of work. ADR 254.\n*/\nconst mongoObjectId = dataType(\"mongo/objectid\", {});\nconst mongoString = dataType(\"mongo/string\", {});\nconst mongoDouble = dataType(\"mongo/double\", {});\nconst mongoInt32 = dataType(\"mongo/int32\", {});\nconst mongoBool = dataType(\"mongo/bool\", {});\nconst mongoDate = dataType(\"mongo/date\", {});\nconst mongoVector = dataType(\"mongo/vector\", {});\nconst mongoDataTypes = [\n\tmongoObjectId,\n\tmongoString,\n\tmongoDouble,\n\tmongoInt32,\n\tmongoBool,\n\tmongoDate,\n\tmongoVector\n];\n//#endregion\nexport { mongoInt32 as a, mongoVector as c, mongoDouble as i, mongoDataTypes as n, mongoObjectId as o, mongoDate as r, mongoString as s, mongoBool as t };\n\n//# sourceMappingURL=data-types-CxW7xs7P.mjs.map"],"mappings":";;;;;;;AAOA,MAAM,gBAAgB,SAAS,kBAAkB,CAAC,CAAC;AACnD,MAAM,cAAc,SAAS,gBAAgB,CAAC,CAAC;AAC/C,MAAM,cAAc,SAAS,gBAAgB,CAAC,CAAC;AAC/C,MAAM,aAAa,SAAS,eAAe,CAAC,CAAC;AAC7C,MAAM,YAAY,SAAS,cAAc,CAAC,CAAC;AAC3C,MAAM,YAAY,SAAS,cAAc,CAAC,CAAC;AAC3C,MAAM,cAAc,SAAS,gBAAgB,CAAC,CAAC;AAC/C,MAAM,iBAAiB;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor-meta-BQRniVcn-8meGwEZr.mjs","names":[],"sources":["../../../../3-mongo-target/1-mongo-target/dist/descriptor-meta-BQRniVcn.mjs"],"sourcesContent":["import { mongoCodecDescriptors } from \"@internal/adapter-mongo/codecs\";\nimport { mongoDataTypes } from \"@internal/adapter-mongo/data-types\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nconst mongoTargetDescriptorMeta = {\n\tkind: \"target\",\n\tfamilyId: \"mongo\",\n\ttargetId: \"mongo\",\n\tid: \"mongo\",\n\tversion: \"0.0.1\",\n\tcapabilities: {},\n\tdefaultNamespaceId: UNBOUND_NAMESPACE_ID,\n\tsupportsNamespaces: true,\n\tdataTypes: mongoDataTypes,\n\ttypes: { codecTypes: { codecDescriptors: mongoCodecDescriptors } }\n};\n//#endregion\nexport { mongoTargetDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-BQRniVcn.mjs.map"],"mappings":";;;;AAGA,MAAM,4BAA4B;CACjC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc,CAAC;CACf,oBAAoB;CACpB,oBAAoB;CACpB,WAAW;CACX,OAAO,EAAE,YAAY,EAAE,kBAAkB,sBAAsB,EAAE;AAClE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migration-factories-CqjDpXHw-fxXh_wY1.mjs","names":[],"sources":["../../../../3-mongo-target/1-mongo-target/dist/migration-factories-CqjDpXHw.mjs"],"sourcesContent":["import { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { CollModCommand, DropCollectionCommand, DropIndexCommand, ListCollectionsCommand, ListIndexesCommand, MongoAndExpr, MongoExistsExpr, MongoFieldFilter, buildIndexOpId, defaultMongoIndexName, keysToKeySpec } from \"@internal/mongo-query-ast/control\";\nimport { createFieldAccessor } from \"@internal/mongo-query-builder\";\nimport { collection } from \"@internal/mongo-query-builder/contract-free\";\n//#region src/core/migration-factories.ts\nfunction isBuildable(value) {\n\tif (typeof value !== \"object\" || value === null || !(\"build\" in value)) return false;\n\treturn typeof Reflect.get(value, \"build\") === \"function\";\n}\nfunction resolveQuery(value) {\n\treturn isBuildable(value) ? value.build() : value;\n}\nconst MATCH_ALL_FILTER = MongoExistsExpr.exists(\"_id\");\nfunction dataTransform(name, options) {\n\tlet precheck = [];\n\tlet postcheck = [];\n\tif (options.check) {\n\t\tconst source = resolveQuery(options.check.source());\n\t\tconst filter = options.check.filter ?? MATCH_ALL_FILTER;\n\t\tconst description = options.check.description ?? `Check for data transform: ${name}`;\n\t\tconst precheckExpect = options.check.expect ?? \"exists\";\n\t\tconst postcheckExpect = precheckExpect === \"exists\" ? \"notExists\" : \"exists\";\n\t\tprecheck = [{\n\t\t\tdescription,\n\t\t\tsource,\n\t\t\tfilter,\n\t\t\texpect: precheckExpect\n\t\t}];\n\t\tpostcheck = [{\n\t\t\tdescription,\n\t\t\tsource,\n\t\t\tfilter,\n\t\t\texpect: postcheckExpect\n\t\t}];\n\t}\n\tconst run = [resolveQuery(options.run())];\n\treturn {\n\t\tid: `data_transform.${name}`,\n\t\tlabel: `Data transform: ${name}`,\n\t\toperationClass: \"data\",\n\t\tname,\n\t\t...ifDefined(\"invariantId\", options.invariantId),\n\t\tprecheck,\n\t\trun,\n\t\tpostcheck\n\t};\n}\nfunction formatKeys(keys) {\n\treturn keys.map((k) => `${k.field}:${k.direction}`).join(\", \");\n}\nfunction isTextIndex(keys) {\n\treturn keys.some((k) => k.direction === \"text\");\n}\nfunction keyFilter(keys) {\n\tconst f = createFieldAccessor();\n\treturn isTextIndex(keys) ? f.rawPath(\"key._fts\").eq(\"text\") : f.key.eq(blindCast(keysToKeySpec(keys)));\n}\nfunction createIndex(collectionName, keys, options) {\n\tconst name = defaultMongoIndexName(keys);\n\tconst f = createFieldAccessor();\n\tconst filter = keyFilter(keys);\n\tconst fullFilter = options?.unique ? filter.and(f.unique.eq(true)) : filter;\n\treturn {\n\t\tid: buildIndexOpId(\"create\", collectionName, keys),\n\t\tlabel: `Create index on ${collectionName} (${formatKeys(keys)})`,\n\t\toperationClass: \"additive\",\n\t\tprecheck: [{\n\t\t\tdescription: `index does not already exist on ${collectionName}`,\n\t\t\tsource: new ListIndexesCommand(collectionName),\n\t\t\tfilter,\n\t\t\texpect: \"notExists\"\n\t\t}],\n\t\texecute: [{\n\t\t\tdescription: `create index on ${collectionName}`,\n\t\t\tcommand: collection(collectionName).createIndex(keys, {\n\t\t\t\t...options,\n\t\t\t\tname\n\t\t\t})\n\t\t}],\n\t\tpostcheck: [{\n\t\t\tdescription: `index exists on ${collectionName}`,\n\t\t\tsource: new ListIndexesCommand(collectionName),\n\t\t\tfilter: fullFilter,\n\t\t\texpect: \"exists\"\n\t\t}]\n\t};\n}\nfunction dropIndex(collectionName, keys) {\n\tconst indexName = defaultMongoIndexName(keys);\n\tconst filter = keyFilter(keys);\n\treturn {\n\t\tid: buildIndexOpId(\"drop\", collectionName, keys),\n\t\tlabel: `Drop index on ${collectionName} (${formatKeys(keys)})`,\n\t\toperationClass: \"destructive\",\n\t\tprecheck: [{\n\t\t\tdescription: `index exists on ${collectionName}`,\n\t\t\tsource: new ListIndexesCommand(collectionName),\n\t\t\tfilter,\n\t\t\texpect: \"exists\"\n\t\t}],\n\t\texecute: [{\n\t\t\tdescription: `drop index on ${collectionName}`,\n\t\t\tcommand: new DropIndexCommand(collectionName, indexName)\n\t\t}],\n\t\tpostcheck: [{\n\t\t\tdescription: `index no longer exists on ${collectionName}`,\n\t\t\tsource: new ListIndexesCommand(collectionName),\n\t\t\tfilter,\n\t\t\texpect: \"notExists\"\n\t\t}]\n\t};\n}\nfunction createCollection(collectionName, options) {\n\tconst f = createFieldAccessor();\n\treturn {\n\t\tid: `collection.${collectionName}.create`,\n\t\tlabel: `Create collection ${collectionName}`,\n\t\toperationClass: \"additive\",\n\t\tprecheck: [{\n\t\t\tdescription: `collection ${collectionName} does not exist`,\n\t\t\tsource: new ListCollectionsCommand(),\n\t\t\tfilter: f.name.eq(collectionName),\n\t\t\texpect: \"notExists\"\n\t\t}],\n\t\texecute: [{\n\t\t\tdescription: `create collection ${collectionName}`,\n\t\t\tcommand: collection(collectionName).createCollection(options)\n\t\t}],\n\t\tpostcheck: []\n\t};\n}\nfunction dropCollection(collectionName) {\n\treturn {\n\t\tid: `collection.${collectionName}.drop`,\n\t\tlabel: `Drop collection ${collectionName}`,\n\t\toperationClass: \"destructive\",\n\t\tprecheck: [],\n\t\texecute: [{\n\t\t\tdescription: `drop collection ${collectionName}`,\n\t\t\tcommand: new DropCollectionCommand(collectionName)\n\t\t}],\n\t\tpostcheck: []\n\t};\n}\nfunction setValidation(collectionName, schema, options) {\n\treturn {\n\t\tid: `collection.${collectionName}.setValidation`,\n\t\tlabel: `Set validation on ${collectionName}`,\n\t\toperationClass: \"destructive\",\n\t\tprecheck: [],\n\t\texecute: [{\n\t\t\tdescription: `set validation on ${collectionName}`,\n\t\t\tcommand: new CollModCommand(collectionName, {\n\t\t\t\tvalidator: { $jsonSchema: schema },\n\t\t\t\t...ifDefined(\"validationLevel\", options?.validationLevel),\n\t\t\t\t...ifDefined(\"validationAction\", options?.validationAction)\n\t\t\t})\n\t\t}],\n\t\tpostcheck: []\n\t};\n}\nfunction collMod(collectionName, options, meta) {\n\tconst hasValidator = options.validator != null && Object.keys(options.validator).length > 0;\n\treturn {\n\t\tid: meta?.id ?? `collection.${collectionName}.collMod`,\n\t\tlabel: meta?.label ?? `Modify collection ${collectionName}`,\n\t\toperationClass: meta?.operationClass ?? \"destructive\",\n\t\tprecheck: options.validator != null ? [{\n\t\t\tdescription: `collection ${collectionName} exists`,\n\t\t\tsource: new ListCollectionsCommand(),\n\t\t\tfilter: MongoFieldFilter.eq(\"name\", collectionName),\n\t\t\texpect: \"exists\"\n\t\t}] : [],\n\t\texecute: [{\n\t\t\tdescription: `modify ${collectionName}`,\n\t\t\tcommand: new CollModCommand(collectionName, options)\n\t\t}],\n\t\tpostcheck: hasValidator ? [{\n\t\t\tdescription: `validator applied on ${collectionName}`,\n\t\t\tsource: new ListCollectionsCommand(),\n\t\t\tfilter: MongoAndExpr.of([\n\t\t\t\tMongoFieldFilter.eq(\"name\", collectionName),\n\t\t\t\t...options.validationLevel ? [MongoFieldFilter.eq(\"options.validationLevel\", options.validationLevel)] : [],\n\t\t\t\t...options.validationAction ? [MongoFieldFilter.eq(\"options.validationAction\", options.validationAction)] : [],\n\t\t\t\t...options.validator?.[\"$jsonSchema\"] !== void 0 ? [MongoFieldFilter.eq(\"options.validator.$jsonSchema\", blindCast(options.validator?.[\"$jsonSchema\"]))] : []\n\t\t\t]),\n\t\t\texpect: \"exists\"\n\t\t}] : []\n\t};\n}\nfunction validatedCollection(name, schema, indexes) {\n\treturn [createCollection(name, {\n\t\tvalidator: { $jsonSchema: schema },\n\t\tvalidationLevel: \"strict\",\n\t\tvalidationAction: \"error\"\n\t}), ...indexes.map((idx) => createIndex(name, idx.keys, idx.unique !== void 0 ? { unique: idx.unique } : void 0))];\n}\n//#endregion\nexport { dropCollection as a, validatedCollection as c, dataTransform as i, createCollection as n, dropIndex as o, createIndex as r, setValidation as s, collMod as t };\n\n//# sourceMappingURL=migration-factories-CqjDpXHw.mjs.map"],"mappings":";;;;;;AAMA,SAAS,YAAY,OAAO;CAC3B,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,EAAE,WAAW,QAAQ,OAAO;CAC/E,OAAO,OAAO,QAAQ,IAAI,OAAO,OAAO,MAAM;AAC/C;AACA,SAAS,aAAa,OAAO;CAC5B,OAAO,YAAY,KAAK,IAAI,MAAM,MAAM,IAAI;AAC7C;AACA,MAAM,mBAAmB,gBAAgB,OAAO,KAAK;AACrD,SAAS,cAAc,MAAM,SAAS;CACrC,IAAI,WAAW,CAAC;CAChB,IAAI,YAAY,CAAC;CACjB,IAAI,QAAQ,OAAO;EAClB,MAAM,SAAS,aAAa,QAAQ,MAAM,OAAO,CAAC;EAClD,MAAM,SAAS,QAAQ,MAAM,UAAU;EACvC,MAAM,cAAc,QAAQ,MAAM,eAAe,6BAA6B;EAC9E,MAAM,iBAAiB,QAAQ,MAAM,UAAU;EAC/C,MAAM,kBAAkB,mBAAmB,WAAW,cAAc;EACpE,WAAW,CAAC;GACX;GACA;GACA;GACA,QAAQ;EACT,CAAC;EACD,YAAY,CAAC;GACZ;GACA;GACA;GACA,QAAQ;EACT,CAAC;CACF;CACA,MAAM,MAAM,CAAC,aAAa,QAAQ,IAAI,CAAC,CAAC;CACxC,OAAO;EACN,IAAI,kBAAkB;EACtB,OAAO,mBAAmB;EAC1B,g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