@prisma/orm-target-mongo 8.0.0-rc.16-dev.6 → 8.0.0-rc.16-dev.7
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/{control-CRID2UtN.mjs → control-C1SKcSfh.mjs} +46 -5
- package/dist/control-C1SKcSfh.mjs.map +1 -0
- package/dist/{control-B4_aOJ9c.d.mts → control-Dl6mTJWt.d.mts} +7 -7
- package/dist/control-Dl6mTJWt.d.mts.map +1 -0
- package/dist/driver.mjs +1 -1
- package/dist/driver__control.mjs +1 -1
- package/dist/driver__control.mjs.map +1 -1
- package/dist/{migration-DKlTqb10.d.mts → migration-4ewD_thE.d.mts} +5 -1
- package/dist/migration-4ewD_thE.d.mts.map +1 -0
- package/dist/{migration-factories-D9gdxskt-B01b9zbg.mjs → migration-factories-Dc-BLfBy-CTMAJSsM.mjs} +6 -2
- package/dist/migration-factories-Dc-BLfBy-CTMAJSsM.mjs.map +1 -0
- package/dist/{mongo-driver-C3IQepd5-yTU71Su4.mjs → mongo-driver-BdLE9T5y-DnFdRRwA.mjs} +3 -3
- package/dist/{mongo-driver-C3IQepd5-yTU71Su4.mjs.map → mongo-driver-BdLE9T5y-DnFdRRwA.mjs.map} +1 -1
- package/dist/target.d.mts +2 -2
- package/dist/target.mjs +2 -2
- package/dist/target__control.d.mts +1 -1
- package/dist/target__control.mjs +1 -1
- package/dist/target__migration.d.mts +1 -1
- package/dist/target__migration.mjs +1 -1
- package/package.json +9 -9
- package/dist/control-B4_aOJ9c.d.mts.map +0 -1
- package/dist/control-CRID2UtN.mjs.map +0 -1
- package/dist/migration-DKlTqb10.d.mts.map +0 -1
- package/dist/migration-factories-D9gdxskt-B01b9zbg.mjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { a as mongoTargetError } from "./codecs-I_SlLNTn-BsshuqIx.mjs";
|
|
2
2
|
import { t as mongoTargetDescriptorMeta } from "./descriptor-meta-BtMd3yW0--oRvmHvL.mjs";
|
|
3
|
-
import { a as dropCollection, n as createCollection, o as dropIndex, r as createIndex, t as collMod } from "./migration-factories-
|
|
3
|
+
import { a as dropCollection, n as createCollection, o as dropIndex, r as createIndex, t as collMod } from "./migration-factories-Dc-BLfBy-CTMAJSsM.mjs";
|
|
4
4
|
import { type } from "arktype";
|
|
5
5
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
6
6
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
7
7
|
import { NamespaceBase, UNBOUND_NAMESPACE_ID, elementCoordinates, freezeNode, hydrateNamespaceEntities } from "@prisma/orm-framework/components/ir";
|
|
8
|
-
import { APP_SPACE_ID, VERIFY_CODE_SCHEMA_FAILURE, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, issueOutcome } from "@prisma/orm-framework/components/control";
|
|
8
|
+
import { APP_SPACE_ID, VERIFY_CODE_SCHEMA_FAILURE, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, describeMigrationStatement, issueOutcome } from "@prisma/orm-framework/components/control";
|
|
9
9
|
import { CollModCommand, CreateCollectionCommand, CreateIndexCommand, DropCollectionCommand, DropIndexCommand, ListCollectionsCommand, ListIndexesCommand, MongoAndExpr, MongoExistsExpr, MongoFieldFilter, MongoNotExpr, MongoOrExpr } from "@prisma/orm-family-mongo/query-ast/control";
|
|
10
10
|
import { canonicalizeSchemasForVerification, contractToMongoSchemaIR, diffMongoSchemas } from "@prisma/orm-family-mongo/family/control";
|
|
11
11
|
import { notOk, ok } from "@prisma/orm-framework/utils/result";
|
|
@@ -573,6 +573,41 @@ function hasImmutableOptionChange(origin, dest) {
|
|
|
573
573
|
function collectionHasOptions(coll) {
|
|
574
574
|
return !!(coll.options || coll.validator);
|
|
575
575
|
}
|
|
576
|
+
/** The collection a model stores its documents in; a model without `@@map` names it verbatim. */
|
|
577
|
+
function collectionOf(contract, coordinate) {
|
|
578
|
+
const collection = contract?.domain.namespaces[coordinate.namespaceId]?.models[coordinate.model]?.storage["collection"];
|
|
579
|
+
return typeof collection === "string" ? collection : coordinate.model;
|
|
580
|
+
}
|
|
581
|
+
const NOT_IN_THIS_RELEASE = "MongoDB cannot carry out rename statements in this release.";
|
|
582
|
+
function shellString(name) {
|
|
583
|
+
return JSON.stringify(name);
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* What a plan made without the statement does to the data, and how to keep it. Right for both
|
|
587
|
+
* `db update` and `migration plan`, since the planner does not know which command it serves.
|
|
588
|
+
* Mongo contracts key a model's fields by their stored names, so the statement's field names are
|
|
589
|
+
* the names a `$rename` needs.
|
|
590
|
+
*/
|
|
591
|
+
function keepTheData(statement, fromContract, contract) {
|
|
592
|
+
const from = collectionOf(fromContract, statement.from);
|
|
593
|
+
if (statement.entity === "field") {
|
|
594
|
+
const { field } = statement.from;
|
|
595
|
+
const newField = statement.to.field;
|
|
596
|
+
const collection = `db.getCollection(${shellString(from)})`;
|
|
597
|
+
return `${NOT_IN_THIS_RELEASE} Without the statement, the documents in collection "${from}" keep their values under "${field}", and nothing moves them to "${newField}". To move them, run these in mongosh on each database before a plan made without the statement is applied there, using the field names as they are stored. First turn off the collection's validator, which still requires "${field}": db.runCommand({ collMod: ${shellString(from)}, validationLevel: "off" }). Then drop each unique index that includes "${field}", or the move fails once two documents have lost it, for example ${collection}.dropIndex(${shellString(`${field}_1`)}). Then move the values: ${collection}.updateMany({}, { $rename: { ${shellString(field)}: ${shellString(newField)} } }). Applying the plan then creates the indexes on "${newField}" and turns the validator back on.`;
|
|
598
|
+
}
|
|
599
|
+
const to = collectionOf(contract, statement.to);
|
|
600
|
+
if (from === to) return `${NOT_IN_THIS_RELEASE} Both models store their documents in collection "${from}", so a plan made without the statement keeps them.`;
|
|
601
|
+
return `${NOT_IN_THIS_RELEASE} Without the statement, a plan drops collection "${from}" with its documents and creates collection "${to}". To keep the documents, rename the collection by hand on each database before a plan made without the statement is applied there, for example with db.getCollection(${shellString(from)}).renameCollection(${shellString(to)}) in mongosh. A migration written by migration plan without the statement still drops "${from}" wherever it is applied, so check its operations first.`;
|
|
602
|
+
}
|
|
603
|
+
function statementNotApplied(statement, fromContract, contract) {
|
|
604
|
+
return {
|
|
605
|
+
kind: "statementRefused",
|
|
606
|
+
summary: `MongoDB does not apply rename statements in this release, so nothing was planned: ${describeMigrationStatement(statement, fromContract ?? contract, contract)}`,
|
|
607
|
+
why: keepTheData(statement, fromContract, contract),
|
|
608
|
+
refusedStatement: statement
|
|
609
|
+
};
|
|
610
|
+
}
|
|
576
611
|
var MongoMigrationPlanner = class {
|
|
577
612
|
planCalls(options) {
|
|
578
613
|
const contract = blindCast(options.contract);
|
|
@@ -643,14 +678,20 @@ var MongoMigrationPlanner = class {
|
|
|
643
678
|
}
|
|
644
679
|
plan(options) {
|
|
645
680
|
const contract = blindCast(options.contract);
|
|
681
|
+
const [statement] = options.statements;
|
|
682
|
+
if (statement !== void 0) return {
|
|
683
|
+
kind: "failure",
|
|
684
|
+
conflicts: [statementNotApplied(statement, options.fromContract, contract)]
|
|
685
|
+
};
|
|
646
686
|
const result = this.planCalls(options);
|
|
647
687
|
if (result.kind === "failure") return result;
|
|
648
688
|
return {
|
|
649
689
|
kind: "success",
|
|
650
690
|
plan: new PlannerProducedMongoMigration(result.calls, {
|
|
651
|
-
from: options.
|
|
691
|
+
from: options.origin?.storageHash ?? null,
|
|
652
692
|
to: contract.storage.storageHash
|
|
653
|
-
}, options.snapshotsImportPath)
|
|
693
|
+
}, options.snapshotsImportPath),
|
|
694
|
+
appliedStatements: []
|
|
654
695
|
};
|
|
655
696
|
}
|
|
656
697
|
/**
|
|
@@ -1651,4 +1692,4 @@ const mongoTargetDescriptor = {
|
|
|
1651
1692
|
//#endregion
|
|
1652
1693
|
export { renderCallsToTypeScript as _, DropIndexCall as a, schemaIndexToCreateIndexOptions as b, MongoMigrationRunner as c, MongoTargetSchemaVerifier as d, MongoTargetUnboundDatabase as f, mongoTargetDescriptor as g, deserializeMongoOps as h, DropCollectionCall as i, MongoTargetContractSerializer as l, deserializeMongoOp as m, CreateCollectionCall as n, FilterEvaluator as o, PlannerProducedMongoMigration as p, CreateIndexCall as r, MongoMigrationPlanner as s, CollModCall as t, MongoTargetDatabase as u, renderOps as v, serializeMongoOps as x, schemaCollectionToCreateCollectionOptions as y };
|
|
1653
1694
|
|
|
1654
|
-
//# sourceMappingURL=control-
|
|
1695
|
+
//# sourceMappingURL=control-C1SKcSfh.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-C1SKcSfh.mjs","names":[],"sources":["../../../../3-mongo-target/1-mongo-target/dist/control.mjs"],"sourcesContent":["import { t as mongoTargetDescriptorMeta } from \"./descriptor-meta-BtMd3yW0.mjs\";\nimport { a as mongoTargetError } from \"./codecs-I_SlLNTn.mjs\";\nimport { a as dropCollection, n as createCollection, o as dropIndex, r as createIndex, t as collMod } from \"./migration-factories-Dc-BLfBy.mjs\";\nimport { APP_SPACE_ID, VERIFY_CODE_SCHEMA_FAILURE, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, describeMigrationStatement, issueOutcome } from \"@internal/framework-components/control\";\nimport { NamespaceBase, UNBOUND_NAMESPACE_ID, elementCoordinates, freezeNode, hydrateNamespaceEntities } from \"@internal/framework-components/ir\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { type } from \"arktype\";\nimport { canonicalizeSchemasForVerification, contractToMongoSchemaIR, diffMongoSchemas } from \"@internal/family-mongo/control\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { MongoContractSerializerBase, MongoSchemaVerifierBase } from \"@internal/family-mongo/ir\";\nimport { MongoStorage } from \"@internal/mongo-contract\";\nimport { composeMongoEntityKinds } from \"@internal/mongo-contract/entity-kinds\";\nimport { canonicalize, deepEqual } from \"@internal/mongo-schema-ir\";\nimport { TsExpression, jsonToTsSource, renderImports } from \"@internal/ts-render\";\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 { 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 { AggregateCommand, MongoAddFieldsStage, MongoLimitStage, MongoLookupStage, MongoMatchStage, MongoMergeStage, MongoProjectStage, MongoSortStage, RawAggregateCommand, RawDeleteManyCommand, RawDeleteOneCommand, RawFindOneAndDeleteCommand, RawFindOneAndUpdateCommand, RawInsertManyCommand, RawInsertOneCommand, RawUpdateManyCommand, RawUpdateOneCommand } from \"@internal/mongo-query-ast/execution\";\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/migrations/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/migrations/render-ops.ts\nfunction renderOps(calls) {\n\treturn calls.map((call) => call.toOp());\n}\n//#endregion\n//#region src/core/migrations/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/migrations/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/migrations/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 (!admitsEverything(destProps[field], originProps[field])) return false;\n\t}\n\treturn true;\n}\nfunction bsonTypeList(value) {\n\tif (value === void 0) return void 0;\n\treturn Array.isArray(value) ? value : [value];\n}\n/**\n* Whether every value `origin` admits, `dest` admits too, for the property schemas Prisma derives: `{}` admits every value, a `bsonType` list may gain types, and an array's `items` may admit more. Any other difference is treated as narrowing.\n*/\nfunction admitsEverything(dest, origin) {\n\tif (canonicalize(dest) === canonicalize(origin)) return true;\n\tif (!isPlainObject(dest) || !isPlainObject(origin)) return false;\n\tif (Object.keys(dest).length === 0) return true;\n\tfor (const key of /* @__PURE__ */ new Set([...Object.keys(origin), ...Object.keys(dest)])) {\n\t\tif (key === \"bsonType\") {\n\t\t\tconst destTypes = bsonTypeList(dest[\"bsonType\"]);\n\t\t\tconst originTypes = bsonTypeList(origin[\"bsonType\"]);\n\t\t\tif (destTypes === void 0) continue;\n\t\t\tif (originTypes === void 0 || !originTypes.every((type) => destTypes.includes(type))) return false;\n\t\t\tcontinue;\n\t\t}\n\t\tif (key === \"items\") {\n\t\t\tif (!admitsEverything(dest[\"items\"] ?? {}, origin[\"items\"] ?? {})) return false;\n\t\t\tcontinue;\n\t\t}\n\t\tif (canonicalize(origin[key]) !== canonicalize(dest[key])) return false;\n\t}\n\treturn true;\n}\nfunction propertiesOf(schema) {\n\treturn isPlainObject(schema[\"properties\"]) ? schema[\"properties\"] : {};\n}\n/**\n* A label naming the properties whose schema changed, so a dry run shows what a validator update does: `Update validator on items (changed: meta; added: note)`.\n*/\nfunction validatorUpdateLabel(collName, origin, dest) {\n\tconst originProps = propertiesOf(origin.jsonSchema);\n\tconst destProps = propertiesOf(dest.jsonSchema);\n\tconst changed = Object.keys(destProps).filter((field) => Object.hasOwn(originProps, field) && canonicalize(originProps[field]) !== canonicalize(destProps[field]));\n\tconst added = Object.keys(destProps).filter((field) => !Object.hasOwn(originProps, field));\n\tconst removed = Object.keys(originProps).filter((field) => !Object.hasOwn(destProps, field));\n\tconst parts = [\n\t\t...changed.length > 0 ? [`changed: ${changed.join(\", \")}`] : [],\n\t\t...added.length > 0 ? [`added: ${added.join(\", \")}`] : [],\n\t\t...removed.length > 0 ? [`removed: ${removed.join(\", \")}`] : []\n\t];\n\treturn parts.length === 0 ? `Update validator on ${collName}` : `Update validator on ${collName} (${parts.join(\"; \")})`;\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}\n/** The collection a model stores its documents in; a model without `@@map` names it verbatim. */\nfunction collectionOf(contract, coordinate) {\n\tconst collection = contract?.domain.namespaces[coordinate.namespaceId]?.models[coordinate.model]?.storage[\"collection\"];\n\treturn typeof collection === \"string\" ? collection : coordinate.model;\n}\nconst NOT_IN_THIS_RELEASE = \"MongoDB cannot carry out rename statements in this release.\";\nfunction shellString(name) {\n\treturn JSON.stringify(name);\n}\n/**\n* What a plan made without the statement does to the data, and how to keep it. Right for both\n* `db update` and `migration plan`, since the planner does not know which command it serves.\n* Mongo contracts key a model's fields by their stored names, so the statement's field names are\n* the names a `$rename` needs.\n*/\nfunction keepTheData(statement, fromContract, contract) {\n\tconst from = collectionOf(fromContract, statement.from);\n\tif (statement.entity === \"field\") {\n\t\tconst { field } = statement.from;\n\t\tconst newField = statement.to.field;\n\t\tconst collection = `db.getCollection(${shellString(from)})`;\n\t\treturn `${NOT_IN_THIS_RELEASE} Without the statement, the documents in collection \"${from}\" keep their values under \"${field}\", and nothing moves them to \"${newField}\". To move them, run these in mongosh on each database before a plan made without the statement is applied there, using the field names as they are stored. First turn off the collection's validator, which still requires \"${field}\": db.runCommand({ collMod: ${shellString(from)}, validationLevel: \"off\" }). Then drop each unique index that includes \"${field}\", or the move fails once two documents have lost it, for example ${collection}.dropIndex(${shellString(`${field}_1`)}). Then move the values: ${collection}.updateMany({}, { $rename: { ${shellString(field)}: ${shellString(newField)} } }). Applying the plan then creates the indexes on \"${newField}\" and turns the validator back on.`;\n\t}\n\tconst to = collectionOf(contract, statement.to);\n\tif (from === to) return `${NOT_IN_THIS_RELEASE} Both models store their documents in collection \"${from}\", so a plan made without the statement keeps them.`;\n\treturn `${NOT_IN_THIS_RELEASE} Without the statement, a plan drops collection \"${from}\" with its documents and creates collection \"${to}\". To keep the documents, rename the collection by hand on each database before a plan made without the statement is applied there, for example with db.getCollection(${shellString(from)}).renameCollection(${shellString(to)}) in mongosh. A migration written by migration plan without the statement still drops \"${from}\" wherever it is applied, so check its operations first.`;\n}\nfunction statementNotApplied(statement, fromContract, contract) {\n\treturn {\n\t\tkind: \"statementRefused\",\n\t\tsummary: `MongoDB does not apply rename statements in this release, so nothing was planned: ${describeMigrationStatement(statement, fromContract ?? contract, contract)}`,\n\t\twhy: keepTheData(statement, fromContract, contract),\n\t\trefusedStatement: statement\n\t};\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\trefusedOperationClass: call.operationClass\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 [statement] = options.statements;\n\t\tif (statement !== void 0) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts: [statementNotApplied(statement, options.fromContract, contract)]\n\t\t};\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.origin?.storageHash ?? null,\n\t\t\t\tto: contract.storage.storageHash\n\t\t\t}, options.snapshotsImportPath),\n\t\t\tappliedStatements: []\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 ? validatorUpdateLabel(collName, originValidator, destValidator) : `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/migrations/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/migrations/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/migrations/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})) {\n\t\t\t\t\tconst found = await markerOps.readMarker(space);\n\t\t\t\t\treturn runnerFailure(\"MIGRATION.MARKER_CAS_FAILURE\", \"Marker was modified by another process during migration execution.\", { meta: {\n\t\t\t\t\t\tspace,\n\t\t\t\t\t\texpectedStorageHash: existingMarker.storageHash,\n\t\t\t\t\t\tfoundStorageHash: found?.storageHash ?? null,\n\t\t\t\t\t\tdestinationStorageHash: destination.storageHash\n\t\t\t\t\t} });\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/migrations/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/migrations/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 ?? VERIFY_CODE_SCHEMA_FAILURE },\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/migrations/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 ??= family.createRunnerDependencies({ driver });\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,IAAI,sBAAsB,cAAc,cAAc;CACrD;CACA;CACA,YAAY,OAAO;EAClB,MAAM;EACN,KAAK,KAAK,MAAM;EAChB,MAAM,aAAa;GAClB,YAAY,CAAC;GACb,GAAG,MAAM;EACV;EACA,KAAK,UAAU,OAAO,OAAO,UAAU,yBAAy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O,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,6 +1,6 @@
|
|
|
1
1
|
import { s as OpFactoryCall$1 } from "./op-factory-call-bbkNqNr4-GITke_FQ.mjs";
|
|
2
2
|
import { Namespace, NamespaceBase } from "@prisma/orm-framework/components/ir";
|
|
3
|
-
import { MigrationOperationPolicy, MigrationPlan, MigrationPlanOperation, MigrationPlanWithAuthoringSurface, MigrationPlanner, MigrationPlannerConflict, MigrationPlannerResult, MigrationRunnerExecutionChecks, MigrationRunnerFailure, MigrationRunnerPerSpaceSuccessValue, MigrationScaffoldContext, OperationContext, SchemaDiffIssue, SchemaVerifyOptions, VerifyDatabaseSchemaResult } from "@prisma/orm-framework/components/control";
|
|
3
|
+
import { MigrationOperationPolicy, MigrationPlan, MigrationPlanOperation, MigrationPlanWithAuthoringSurface, MigrationPlanner, MigrationPlannerConflict, MigrationPlannerResult, MigrationRunnerExecutionChecks, MigrationRunnerFailure, MigrationRunnerPerSpaceSuccessValue, MigrationScaffoldContext, OperationContext, PlanOrigin, ResolvedMigrationStatement, SchemaDiffIssue, SchemaVerifyOptions, VerifyDatabaseSchemaResult } from "@prisma/orm-framework/components/control";
|
|
4
4
|
import { AnyMongoMigrationOperation, MongoAndExpr, MongoExistsExpr, MongoExprFilter, MongoFieldFilter, MongoFilterExpr, MongoFilterVisitor, MongoMigrationPlanOperation, MongoNotExpr, MongoOrExpr } from "@prisma/orm-family-mongo/query-ast/control";
|
|
5
5
|
import { MongoControlTargetDescriptor } from "@prisma/orm-family-mongo/family/control";
|
|
6
6
|
import { Result } from "@prisma/orm-framework/utils/result";
|
|
@@ -79,12 +79,12 @@ declare class MongoMigrationPlanner implements MigrationPlanner<'mongo', 'mongo'
|
|
|
79
79
|
readonly contract: unknown;
|
|
80
80
|
readonly schema: unknown;
|
|
81
81
|
readonly policy: MigrationOperationPolicy;
|
|
82
|
-
/**
|
|
83
|
-
* The "from" contract (state the planner assumes the database starts at),
|
|
84
|
-
* or `null` for reconciliation flows. Used to populate `describe().from`
|
|
85
|
-
* on the produced plan as `fromContract?.storage.storageHash ?? null`.
|
|
86
|
-
*/
|
|
82
|
+
/** The contract the planner reads as the starting state, or `null` when it has none. */
|
|
87
83
|
readonly fromContract: Contract | null;
|
|
84
|
+
/** The origin the produced plan asserts: its `describe().from` and `origin`. */
|
|
85
|
+
readonly origin: PlanOrigin | null;
|
|
86
|
+
/** The `--rename` statements, resolved; MongoDB refuses any statement in this release. */
|
|
87
|
+
readonly statements: readonly ResolvedMigrationStatement[];
|
|
88
88
|
readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<'mongo', 'mongo'>>;
|
|
89
89
|
/**
|
|
90
90
|
* POSIX-relative path from the migration package dir to
|
|
@@ -309,4 +309,4 @@ declare class MongoTargetUnboundDatabase extends MongoTargetDatabase {
|
|
|
309
309
|
}
|
|
310
310
|
//#endregion
|
|
311
311
|
export { renderOps as _, MongoTargetContract as a, MongoTargetSchemaVerifier as c, PlannerProducedMongoMigration as d, RenderMigrationMeta as f, renderCallsToTypeScript as g, mongoTargetDescriptor as h, MongoMigrationRunnerExecuteOptions as i, MongoTargetUnboundDatabase as l, deserializeMongoOps as m, MongoMigrationPlanner as n, MongoTargetContractSerializer as o, deserializeMongoOp as p, MongoMigrationRunner as r, MongoTargetDatabase as s, FilterEvaluator as t, PlanCallsResult as u, serializeMongoOps as v };
|
|
312
|
-
//# sourceMappingURL=control-
|
|
312
|
+
//# sourceMappingURL=control-Dl6mTJWt.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-Dl6mTJWt.d.mts","names":[],"sources":["../../../../3-mongo-target/1-mongo-target/dist/control.d.mts"],"mappings":";;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,uBAAuB;EAC3B,YAAY;EACZ,iBAAiB,wBAAwB;;;;iBAI1B,UAAU,OAAO,cAAc,mBAAiB;;;UAGvD;WACC;WACA;;WAEA;;;;;;;WAOA,yBAAyB;;;;;;;;;;;;;;;;;;;iBAmBnB,wBAAwB,OAAO,cAAc,kBAAgB,MAAM;;;cAGtE,sCAAsC,4BAA4B;YACpE,wBAAwB,WAAW,gBAAgB;EAC7D,kBAAkB,UAAU,sBAAsB;;;;UAI1C;WACC;WACA,UAAU,SAAS,eAAe,SAAS;aACzC,aAAa,SAAS,eAAe;aACrC,WAAW,SAAS,eAAe;;;;;;;;;;;;;;;;;cAiBlC,4BAA4B;WAC/B;WACA;WACA,SAAS;EAClB,YAAY,OAAO;MACf,cAAc,SAAS,eAAe;;;;;EAK1C;;;;;;;EAOA,kBAAkB;;;;;;;;;;;;;;;cAeN,mCAAmC;kBAC/B,UAAU;UAClB;EACR;EACA,kBAAkB"}
|
package/dist/driver.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as MongoDriverImpl, r as createMongoDriver } from "./mongo-driver-
|
|
1
|
+
import { n as MongoDriverImpl, r as createMongoDriver } from "./mongo-driver-BdLE9T5y-DnFdRRwA.mjs";
|
|
2
2
|
export { MongoDriverImpl, createMongoDriver };
|
package/dist/driver__control.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as MongoDriverImpl, t as DRIVER_INFO } from "./mongo-driver-
|
|
1
|
+
import { n as MongoDriverImpl, t as DRIVER_INFO } from "./mongo-driver-BdLE9T5y-DnFdRRwA.mjs";
|
|
2
2
|
import { errorRuntime } from "@prisma/orm-framework/errors/execution";
|
|
3
3
|
import { MongoClient } from "mongodb";
|
|
4
4
|
import { redactDatabaseUrl } from "@prisma/orm-framework/utils/redact-db-url";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver__control.mjs","names":[],"sources":["../../../../3-mongo-target/3-mongo-driver/dist/control.mjs"],"sourcesContent":["import { r as DRIVER_INFO, t as MongoDriverImpl } from \"./mongo-driver-
|
|
1
|
+
{"version":3,"file":"driver__control.mjs","names":[],"sources":["../../../../3-mongo-target/3-mongo-driver/dist/control.mjs"],"sourcesContent":["import { r as DRIVER_INFO, t as MongoDriverImpl } from \"./mongo-driver-BdLE9T5y.mjs\";\nimport { MongoClient } from \"mongodb\";\nimport { errorRuntime } from \"@internal/errors/execution\";\nimport { redactDatabaseUrl } from \"@internal/utils/redact-db-url\";\n//#region src/exports/control.ts\nvar MongoControlDriver = class extends MongoDriverImpl {\n\tfamilyId = \"mongo\";\n\ttargetId = \"mongo\";\n\tdb;\n\tconstructor(db, mongoClient) {\n\t\tsuper(db, mongoClient);\n\t\tthis.db = db;\n\t}\n\tasync databaseName() {\n\t\treturn this.db.databaseName;\n\t}\n};\nconst mongoControlDriverDescriptor = {\n\tkind: \"driver\",\n\tfamilyId: \"mongo\",\n\ttargetId: \"mongo\",\n\tid: \"mongo\",\n\tversion: DRIVER_INFO.version,\n\tcapabilities: {},\n\tasync create(url) {\n\t\tconst client = new MongoClient(url, {\n\t\t\tserverSelectionTimeoutMS: 5e3,\n\t\t\tconnectTimeoutMS: 5e3,\n\t\t\tdriverInfo: DRIVER_INFO\n\t\t});\n\t\ttry {\n\t\t\tawait client.connect();\n\t\t\treturn new MongoControlDriver(client.db(), client);\n\t\t} catch (error) {\n\t\t\ttry {\n\t\t\t\tawait client.close();\n\t\t\t} catch {}\n\t\t\tthrow errorRuntime(\"DRIVER.CONNECTION_FAILED\", \"Database connection failed\", {\n\t\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\t\tfix: \"Verify the MongoDB URL, ensure the database is reachable, and confirm credentials/permissions\",\n\t\t\t\tmeta: { ...redactDatabaseUrl(url) },\n\t\t\t\tcause: error\n\t\t\t});\n\t\t}\n\t}\n};\n//#endregion\nexport { MongoControlDriver, mongoControlDriverDescriptor as default };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;AAKA,IAAI,qBAAqB,cAAc,gBAAgB;CACtD,WAAW;CACX,WAAW;CACX;CACA,YAAY,IAAI,aAAa;EAC5B,MAAM,IAAI,WAAW;EACrB,KAAK,KAAK;CACX;CACA,MAAM,eAAe;EACpB,OAAO,KAAK,GAAG;CAChB;AACD;AACA,MAAM,+BAA+B;CACpC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS,YAAY;CACrB,cAAc,CAAC;CACf,MAAM,OAAO,KAAK;EACjB,MAAM,SAAS,IAAI,YAAY,KAAK;GACnC,0BAA0B;GAC1B,kBAAkB;GAClB,YAAY;EACb,CAAC;EACD,IAAI;GACH,MAAM,OAAO,QAAQ;GACrB,OAAO,IAAI,mBAAmB,OAAO,GAAG,GAAG,MAAM;EAClD,SAAS,OAAO;GACf,IAAI;IACH,MAAM,OAAO,MAAM;GACpB,QAAQ,CAAC;GACT,MAAM,aAAa,4BAA4B,8BAA8B;IAC5E,KAAK,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;IAC1D,KAAK;IACL,MAAM,EAAE,GAAG,kBAAkB,GAAG,EAAE;IAClC,OAAO;GACR,CAAC;EACF;CACD;AACD"}
|
|
@@ -25,6 +25,10 @@ declare function dataTransform(name: string, options: {
|
|
|
25
25
|
run: () => MongoQueryPlan | Buildable;
|
|
26
26
|
}): MongoDataTransformOperation;
|
|
27
27
|
declare function createIndex(collectionName: string, keys: ReadonlyArray<MongoIndexKey>, options?: CreateIndexOptions): MongoMigrationPlanOperation;
|
|
28
|
+
/**
|
|
29
|
+
* Dropping an index loses no documents, but this stays 'destructive' on MongoDB until it moves to
|
|
30
|
+
* 'widening' as it has on the SQL targets.
|
|
31
|
+
*/
|
|
28
32
|
declare function dropIndex(collectionName: string, keys: ReadonlyArray<MongoIndexKey>): MongoMigrationPlanOperation;
|
|
29
33
|
declare function createCollection(collectionName: string, options?: CreateCollectionOptions): MongoMigrationPlanOperation;
|
|
30
34
|
declare function dropCollection(collectionName: string): MongoMigrationPlanOperation;
|
|
@@ -39,4 +43,4 @@ declare function validatedCollection(name: string, schema: Record<string, unknow
|
|
|
39
43
|
}>): MongoMigrationPlanOperation[];
|
|
40
44
|
//#endregion
|
|
41
45
|
export { createIndex as a, dropIndex as c, validatedCollection as d, createCollection as i, placeholder as l, MigrationCLI as n, dataTransform as o, collMod as r, dropCollection as s, Migration as t, setValidation as u };
|
|
42
|
-
//# sourceMappingURL=migration-
|
|
46
|
+
//# sourceMappingURL=migration-4ewD_thE.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-4ewD_thE.d.mts","names":[],"sources":["../../../../3-mongo-target/1-mongo-target/dist/migration.d.mts"],"mappings":";;;;;;;;UAOU;EACR,SAAS;;iBAEM,cAAc,cAAc;;;;;;EAM3C;EACA;IACE,cAAc,iBAAiB;IAC/B,SAAS;IACT;IACA;;EAEF,WAAW,iBAAiB;IAC1B;iBACa,YAAY,wBAAwB,MAAM,cAAc,gBAAgB,UAAU,qBAAqB;;;;;iBAKvG,UAAU,wBAAwB,MAAM,cAAc,iBAAiB;iBACvE,iBAAiB,wBAAwB,UAAU,0BAA0B;iBAC7E,eAAe,yBAAyB;iBACxC,cAAc,wBAAwB,QAAQ,yBAAyB;EACtF;EACA;IACE;iBACa,QAAQ,wBAAwB,SAAS,gBAAgB,OAAO,cAAc;iBAC9E,oBAAoB,cAAc,QAAQ,yBAAyB,SAAS;EAC3F,MAAM;EACN;KACG"}
|
package/dist/{migration-factories-D9gdxskt-B01b9zbg.mjs → migration-factories-Dc-BLfBy-CTMAJSsM.mjs}
RENAMED
|
@@ -3,7 +3,7 @@ import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
|
3
3
|
import { CollModCommand, DropCollectionCommand, DropIndexCommand, ListCollectionsCommand, ListIndexesCommand, MongoAndExpr, MongoExistsExpr, MongoFieldFilter, buildIndexOpId, defaultMongoIndexName, keysToKeySpec } from "@prisma/orm-family-mongo/query-ast/control";
|
|
4
4
|
import { createFieldAccessor } from "@prisma/orm-family-mongo/query-builder";
|
|
5
5
|
import { collection } from "@prisma/orm-family-mongo/query-builder/contract-free";
|
|
6
|
-
//#region ../../../3-mongo-target/1-mongo-target/dist/migration-factories-
|
|
6
|
+
//#region ../../../3-mongo-target/1-mongo-target/dist/migration-factories-Dc-BLfBy.mjs
|
|
7
7
|
function isBuildable(value) {
|
|
8
8
|
if (typeof value !== "object" || value === null || !("build" in value)) return false;
|
|
9
9
|
return typeof Reflect.get(value, "build") === "function";
|
|
@@ -86,6 +86,10 @@ function createIndex(collectionName, keys, options) {
|
|
|
86
86
|
}]
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Dropping an index loses no documents, but this stays 'destructive' on MongoDB until it moves to
|
|
91
|
+
* 'widening' as it has on the SQL targets.
|
|
92
|
+
*/
|
|
89
93
|
function dropIndex(collectionName, keys) {
|
|
90
94
|
const indexName = defaultMongoIndexName(keys);
|
|
91
95
|
const filter = keyFilter(keys);
|
|
@@ -199,4 +203,4 @@ function validatedCollection(name, schema, indexes) {
|
|
|
199
203
|
//#endregion
|
|
200
204
|
export { dropCollection as a, validatedCollection as c, dataTransform as i, createCollection as n, dropIndex as o, createIndex as r, setValidation as s, collMod as t };
|
|
201
205
|
|
|
202
|
-
//# sourceMappingURL=migration-factories-
|
|
206
|
+
//# sourceMappingURL=migration-factories-Dc-BLfBy-CTMAJSsM.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-factories-Dc-BLfBy-CTMAJSsM.mjs","names":[],"sources":["../../../../3-mongo-target/1-mongo-target/dist/migration-factories-Dc-BLfBy.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/migrations/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}\n/**\n* Dropping an index loses no documents, but this stays 'destructive' on MongoDB until it moves to\n* 'widening' as it has on the SQL targets.\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-Dc-BLfBy.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,gBAAg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,wBAAwB;GACrC,QAAQ,IAAI,uBAAuB;GACnC,QAAQ,aAAa,GAAG;IACvB,iBAAiB,GAAG,QAAQ,cAAc;IAC1C,GAAG,QAAQ,kBAAkB,CAAC,iBAAiB,GAAG,2BAA2B,QAAQ,eAAe,CAAC,IAAI,CAAC;IAC1G,GAAG,QAAQ,mBAAmB,CAAC,iBAAiB,GAAG,4BAA4B,QAAQ,gBAAgB,CAAC,IAAI,CAAC;IAC7G,GAAG,QAAQ,YAAY,mBAAmB,KAAK,IAAI,CAAC,iBAAiB,GAAG,iCAAiC,UAAU,QAAQ,YAAY,cAAc,CAAC,CAAC,IAAI,CAAC;GAC7J,CAAC;GACD,QAAQ;EACT,CAAC,IAAI,CAAC;CACP;AACD;AACA,SAAS,oBAAoB,MAAM,QAAQ,SAAS;CACnD,OAAO,CAAC,iBAAiB,MAAM;EAC9B,WAAW,EAAE,aAAa,OAAO;EACjC,iBAAiB;EACjB,kBAAkB;CACnB,CAAC,GAAG,GAAG,QAAQ,KAAK,QAAQ,YAAY,MAAM,IAAI,MAAM,IAAI,WAAW,KAAK,IAAI,EAAE,QAAQ,IAAI,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC;AAClH"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { assertNever } from "@prisma/orm-framework/utils/internal-error";
|
|
2
2
|
import { BSON, MongoClient } from "mongodb";
|
|
3
|
-
//#region ../../../3-mongo-target/3-mongo-driver/dist/mongo-driver-
|
|
3
|
+
//#region ../../../3-mongo-target/3-mongo-driver/dist/mongo-driver-BdLE9T5y.mjs
|
|
4
4
|
const DRIVER_INFO = {
|
|
5
5
|
name: "Prisma",
|
|
6
|
-
version: "8.0.0-rc.16-dev.
|
|
6
|
+
version: "8.0.0-rc.16-dev.7"
|
|
7
7
|
};
|
|
8
8
|
/* v8 ignore start */
|
|
9
9
|
function unreachableKind(value) {
|
|
@@ -177,4 +177,4 @@ async function createMongoDriver(uri, dbName) {
|
|
|
177
177
|
//#endregion
|
|
178
178
|
export { MongoDriverImpl as n, createMongoDriver as r, DRIVER_INFO as t };
|
|
179
179
|
|
|
180
|
-
//# sourceMappingURL=mongo-driver-
|
|
180
|
+
//# sourceMappingURL=mongo-driver-BdLE9T5y-DnFdRRwA.mjs.map
|
package/dist/{mongo-driver-C3IQepd5-yTU71Su4.mjs.map → mongo-driver-BdLE9T5y-DnFdRRwA.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mongo-driver-C3IQepd5-yTU71Su4.mjs","names":[],"sources":["../../../../3-mongo-target/3-mongo-driver/dist/mongo-driver-C3IQepd5.mjs"],"sourcesContent":["import { assertNever } from \"@internal/utils/internal-error\";\nimport { BSON, MongoClient } from \"mongodb\";\n//#endregion\n//#region src/core/driver-info.ts\nconst DRIVER_INFO = {\n\tname: \"Prisma\",\n\tversion: \"8.0.0-rc.16-dev.6\"\n};\n//#endregion\n//#region src/mongo-driver.ts\n/* v8 ignore start */\nfunction unreachableKind(value) {\n\tconst candidate = value;\n\tif (typeof candidate === \"object\" && candidate !== null && \"kind\" in candidate && typeof candidate.kind === \"string\") return candidate.kind;\n\treturn \"unknown\";\n}\n/* v8 ignore stop */\nvar MongoDriverImpl = class MongoDriverImpl {\n\tdb;\n\tclient;\n\tconstructor(db, client) {\n\t\tthis.db = db;\n\t\tthis.client = client;\n\t}\n\tstatic async fromConnection(uri, dbName) {\n\t\tconst client = new MongoClient(uri, { driverInfo: DRIVER_INFO });\n\t\tawait client.connect();\n\t\treturn new MongoDriverImpl(client.db(dbName), client);\n\t}\n\tstatic fromDb(db) {\n\t\treturn new MongoDriverImpl(db, void 0);\n\t}\n\texecute(wireCommand) {\n\t\tswitch (wireCommand.kind) {\n\t\t\tcase \"insertOne\": return this.executeInsertOneCommand(wireCommand);\n\t\t\tcase \"updateOne\": return this.executeUpdateOneCommand(wireCommand);\n\t\t\tcase \"insertMany\": return this.executeInsertManyCommand(wireCommand);\n\t\t\tcase \"updateMany\": return this.executeUpdateManyCommand(wireCommand);\n\t\t\tcase \"deleteOne\": return this.executeDeleteOneCommand(wireCommand);\n\t\t\tcase \"deleteMany\": return this.executeDeleteManyCommand(wireCommand);\n\t\t\tcase \"findOneAndUpdate\": return this.executeFindOneAndUpdateCommand(wireCommand);\n\t\t\tcase \"findOneAndDelete\": return this.executeFindOneAndDeleteCommand(wireCommand);\n\t\t\tcase \"aggregate\": return this.executeAggregateCommand(wireCommand);\n\t\t\t// v8 ignore next 4\n\t\t\tdefault: return assertNever(wireCommand, `Unknown wire command kind: ${unreachableKind(wireCommand)}`);\n\t\t}\n\t}\n\tasync run(wireCommand) {\n\t\tswitch (wireCommand.kind) {\n\t\t\tcase \"createCollection\": return this.executeCreateCollectionCommand(wireCommand);\n\t\t\tcase \"createIndex\": return this.executeCreateIndexCommand(wireCommand);\n\t\t\tcase \"dropCollection\": return this.executeDropCollectionCommand(wireCommand);\n\t\t\tcase \"dropIndex\": return this.executeDropIndexCommand(wireCommand);\n\t\t\tcase \"collMod\": return this.executeCollModCommand(wireCommand);\n\t\t\t// v8 ignore next 4\n\t\t\tdefault: return assertNever(wireCommand, `Unknown DDL wire command kind: ${unreachableKind(wireCommand)}`);\n\t\t}\n\t}\n\tasync close() {\n\t\tawait this.client?.close();\n\t}\n\tasync *executeInsertOneCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).insertOne(cmd.document);\n\t\tyield {\n\t\t\tinsertedId: result.insertedId,\n\t\t\tdocument: this.asRead({\n\t\t\t\t_id: result.insertedId,\n\t\t\t\t...cmd.document\n\t\t\t})\n\t\t};\n\t}\n\t/**\n\t* The server stores an inserted document as the driver wrote it, apart from moving `_id` first, so writing it to BSON and reading it back with the client's options gives what a read returns, without a query.\n\t*/\n\tasRead(document) {\n\t\tconst { raw: _raw, ...options } = this.db.bsonOptions;\n\t\treturn BSON.deserialize(BSON.serialize(document, options), options);\n\t}\n\tasync *executeUpdateOneCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).updateOne(cmd.filter, cmd.update, { upsert: cmd.upsert });\n\t\tyield {\n\t\t\tmatchedCount: result.matchedCount,\n\t\t\tmodifiedCount: result.modifiedCount,\n\t\t\tupsertedCount: result.upsertedCount,\n\t\t\tupsertedId: result.upsertedId ?? void 0\n\t\t};\n\t}\n\tasync *executeInsertManyCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).insertMany(cmd.documents);\n\t\tconst insertedIds = Object.values(result.insertedIds);\n\t\tyield {\n\t\t\tinsertedIds,\n\t\t\tinsertedCount: result.insertedCount,\n\t\t\tdocuments: cmd.documents.map((document, index) => this.asRead({\n\t\t\t\t_id: insertedIds[index],\n\t\t\t\t...document\n\t\t\t}))\n\t\t};\n\t}\n\tasync *executeUpdateManyCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).updateMany(cmd.filter, cmd.update, { upsert: cmd.upsert });\n\t\tyield {\n\t\t\tmatchedCount: result.matchedCount,\n\t\t\tmodifiedCount: result.modifiedCount,\n\t\t\tupsertedCount: result.upsertedCount,\n\t\t\tupsertedId: result.upsertedId ?? void 0\n\t\t};\n\t}\n\tasync *executeDeleteOneCommand(cmd) {\n\t\tyield { deletedCount: (await this.db.collection(cmd.collection).deleteOne(cmd.filter)).deletedCount };\n\t}\n\tasync *executeDeleteManyCommand(cmd) {\n\t\tyield { deletedCount: (await this.db.collection(cmd.collection).deleteMany(cmd.filter)).deletedCount };\n\t}\n\tasync *executeFindOneAndUpdateCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).findOneAndUpdate(cmd.filter, cmd.update, {\n\t\t\tupsert: cmd.upsert,\n\t\t\t...cmd.returnDocument != null ? { returnDocument: cmd.returnDocument } : {},\n\t\t\t...cmd.sort != null ? { sort: cmd.sort } : {}\n\t\t});\n\t\tif (result) yield result;\n\t}\n\tasync *executeFindOneAndDeleteCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).findOneAndDelete(cmd.filter, { ...cmd.sort != null ? { sort: cmd.sort } : {} });\n\t\tif (result) yield result;\n\t}\n\tasync *executeAggregateCommand(cmd) {\n\t\tyield* this.db.collection(cmd.collection).aggregate(cmd.pipeline);\n\t}\n\tasync executeCreateCollectionCommand(cmd) {\n\t\tconst { validator, validationLevel, validationAction, capped, size, max, timeseries, collation, changeStreamPreAndPostImages, clusteredIndex } = cmd;\n\t\tawait this.db.createCollection(cmd.collection, {\n\t\t\t...validator !== void 0 ? { validator } : {},\n\t\t\t...validationLevel !== void 0 ? { validationLevel } : {},\n\t\t\t...validationAction !== void 0 ? { validationAction } : {},\n\t\t\t...capped !== void 0 ? { capped } : {},\n\t\t\t...size !== void 0 ? { size } : {},\n\t\t\t...max !== void 0 ? { max } : {},\n\t\t\t...timeseries !== void 0 ? { timeseries } : {},\n\t\t\t...collation !== void 0 ? { collation } : {},\n\t\t\t...changeStreamPreAndPostImages !== void 0 ? { changeStreamPreAndPostImages } : {},\n\t\t\t...clusteredIndex !== void 0 ? { clusteredIndex } : {}\n\t\t});\n\t}\n\tasync executeCreateIndexCommand(cmd) {\n\t\tconst { unique, sparse, expireAfterSeconds, partialFilterExpression, name, wildcardProjection, collation, weights, default_language, language_override } = cmd;\n\t\tawait this.db.collection(cmd.collection).createIndex(cmd.key, {\n\t\t\t...unique !== void 0 ? { unique } : {},\n\t\t\t...sparse !== void 0 ? { sparse } : {},\n\t\t\t...expireAfterSeconds !== void 0 ? { expireAfterSeconds } : {},\n\t\t\t...partialFilterExpression !== void 0 ? { partialFilterExpression } : {},\n\t\t\t...name !== void 0 ? { name } : {},\n\t\t\t...wildcardProjection !== void 0 ? { wildcardProjection } : {},\n\t\t\t...collation !== void 0 ? { collation } : {},\n\t\t\t...weights !== void 0 ? { weights } : {},\n\t\t\t...default_language !== void 0 ? { default_language } : {},\n\t\t\t...language_override !== void 0 ? { language_override } : {}\n\t\t});\n\t}\n\tasync executeDropCollectionCommand(cmd) {\n\t\tawait this.db.collection(cmd.collection).drop();\n\t}\n\tasync executeDropIndexCommand(cmd) {\n\t\tawait this.db.collection(cmd.collection).dropIndex(cmd.name);\n\t}\n\tasync executeCollModCommand(cmd) {\n\t\tconst { validator, validationLevel, validationAction, changeStreamPreAndPostImages } = cmd;\n\t\tawait this.db.command({\n\t\t\tcollMod: cmd.collection,\n\t\t\t...validator !== void 0 ? { validator } : {},\n\t\t\t...validationLevel !== void 0 ? { validationLevel } : {},\n\t\t\t...validationAction !== void 0 ? { validationAction } : {},\n\t\t\t...changeStreamPreAndPostImages !== void 0 ? { changeStreamPreAndPostImages } : {}\n\t\t});\n\t}\n};\nasync function createMongoDriver(uri, dbName) {\n\treturn MongoDriverImpl.fromConnection(uri, dbName);\n}\n//#endregion\nexport { createMongoDriver as n, DRIVER_INFO as r, MongoDriverImpl as t };\n\n//# sourceMappingURL=mongo-driver-C3IQepd5.mjs.map"],"mappings":";;;AAIA,MAAM,cAAc;CACnB,MAAM;CACN,SAAS;AACV;;AAIA,SAAS,gBAAgB,OAAO;CAC/B,MAAM,YAAY;CAClB,IAAI,OAAO,cAAc,YAAY,cAAc,QAAQ,UAAU,aAAa,OAAO,UAAU,SAAS,UAAU,OAAO,UAAU;CACvI,OAAO;AACR;;AAEA,IAAI,kBAAkB,MAAM,gBAAgB;CAC3C;CACA;CACA,YAAY,IAAI,QAAQ;EACvB,KAAK,KAAK;EACV,KAAK,SAAS;CACf;CACA,aAAa,eAAe,KAAK,QAAQ;EACxC,MAAM,SAAS,IAAI,YAAY,KAAK,EAAE,YAAY,YAAY,CAAC;EAC/D,MAAM,OAAO,QAAQ;EACrB,OAAO,IAAI,gBAAgB,OAAO,GAAG,MAAM,GAAG,MAAM;CACrD;CACA,OAAO,OAAO,IAAI;EACjB,OAAO,IAAI,gBAAgB,IAAI,KAAK,CAAC;CACtC;CACA,QAAQ,aAAa;EACpB,QAAQ,YAAY,MAApB;GACC,KAAK,aAAa,OAAO,KAAK,wBAAwB,WAAW;GACjE,KAAK,aAAa,OAAO,KAAK,wBAAwB,WAAW;GACjE,KAAK,cAAc,O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,iCAAiC,KAAK,IAAI,EAAE,6BAA6B,IAAI,CAAC;EAClF,CAAC;CACF;AACD;AACA,eAAe,kBAAkB,KAAK,QAAQ;CAC7C,OAAO,gBAAgB,eAAe,KAAK,MAAM;AAClD"}
|
|
1
|
+
{"version":3,"file":"mongo-driver-BdLE9T5y-DnFdRRwA.mjs","names":[],"sources":["../../../../3-mongo-target/3-mongo-driver/dist/mongo-driver-BdLE9T5y.mjs"],"sourcesContent":["import { assertNever } from \"@internal/utils/internal-error\";\nimport { BSON, MongoClient } from \"mongodb\";\n//#endregion\n//#region src/core/driver-info.ts\nconst DRIVER_INFO = {\n\tname: \"Prisma\",\n\tversion: \"8.0.0-rc.16-dev.7\"\n};\n//#endregion\n//#region src/mongo-driver.ts\n/* v8 ignore start */\nfunction unreachableKind(value) {\n\tconst candidate = value;\n\tif (typeof candidate === \"object\" && candidate !== null && \"kind\" in candidate && typeof candidate.kind === \"string\") return candidate.kind;\n\treturn \"unknown\";\n}\n/* v8 ignore stop */\nvar MongoDriverImpl = class MongoDriverImpl {\n\tdb;\n\tclient;\n\tconstructor(db, client) {\n\t\tthis.db = db;\n\t\tthis.client = client;\n\t}\n\tstatic async fromConnection(uri, dbName) {\n\t\tconst client = new MongoClient(uri, { driverInfo: DRIVER_INFO });\n\t\tawait client.connect();\n\t\treturn new MongoDriverImpl(client.db(dbName), client);\n\t}\n\tstatic fromDb(db) {\n\t\treturn new MongoDriverImpl(db, void 0);\n\t}\n\texecute(wireCommand) {\n\t\tswitch (wireCommand.kind) {\n\t\t\tcase \"insertOne\": return this.executeInsertOneCommand(wireCommand);\n\t\t\tcase \"updateOne\": return this.executeUpdateOneCommand(wireCommand);\n\t\t\tcase \"insertMany\": return this.executeInsertManyCommand(wireCommand);\n\t\t\tcase \"updateMany\": return this.executeUpdateManyCommand(wireCommand);\n\t\t\tcase \"deleteOne\": return this.executeDeleteOneCommand(wireCommand);\n\t\t\tcase \"deleteMany\": return this.executeDeleteManyCommand(wireCommand);\n\t\t\tcase \"findOneAndUpdate\": return this.executeFindOneAndUpdateCommand(wireCommand);\n\t\t\tcase \"findOneAndDelete\": return this.executeFindOneAndDeleteCommand(wireCommand);\n\t\t\tcase \"aggregate\": return this.executeAggregateCommand(wireCommand);\n\t\t\t// v8 ignore next 4\n\t\t\tdefault: return assertNever(wireCommand, `Unknown wire command kind: ${unreachableKind(wireCommand)}`);\n\t\t}\n\t}\n\tasync run(wireCommand) {\n\t\tswitch (wireCommand.kind) {\n\t\t\tcase \"createCollection\": return this.executeCreateCollectionCommand(wireCommand);\n\t\t\tcase \"createIndex\": return this.executeCreateIndexCommand(wireCommand);\n\t\t\tcase \"dropCollection\": return this.executeDropCollectionCommand(wireCommand);\n\t\t\tcase \"dropIndex\": return this.executeDropIndexCommand(wireCommand);\n\t\t\tcase \"collMod\": return this.executeCollModCommand(wireCommand);\n\t\t\t// v8 ignore next 4\n\t\t\tdefault: return assertNever(wireCommand, `Unknown DDL wire command kind: ${unreachableKind(wireCommand)}`);\n\t\t}\n\t}\n\tasync close() {\n\t\tawait this.client?.close();\n\t}\n\tasync *executeInsertOneCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).insertOne(cmd.document);\n\t\tyield {\n\t\t\tinsertedId: result.insertedId,\n\t\t\tdocument: this.asRead({\n\t\t\t\t_id: result.insertedId,\n\t\t\t\t...cmd.document\n\t\t\t})\n\t\t};\n\t}\n\t/**\n\t* The server stores an inserted document as the driver wrote it, apart from moving `_id` first, so writing it to BSON and reading it back with the client's options gives what a read returns, without a query.\n\t*/\n\tasRead(document) {\n\t\tconst { raw: _raw, ...options } = this.db.bsonOptions;\n\t\treturn BSON.deserialize(BSON.serialize(document, options), options);\n\t}\n\tasync *executeUpdateOneCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).updateOne(cmd.filter, cmd.update, { upsert: cmd.upsert });\n\t\tyield {\n\t\t\tmatchedCount: result.matchedCount,\n\t\t\tmodifiedCount: result.modifiedCount,\n\t\t\tupsertedCount: result.upsertedCount,\n\t\t\tupsertedId: result.upsertedId ?? void 0\n\t\t};\n\t}\n\tasync *executeInsertManyCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).insertMany(cmd.documents);\n\t\tconst insertedIds = Object.values(result.insertedIds);\n\t\tyield {\n\t\t\tinsertedIds,\n\t\t\tinsertedCount: result.insertedCount,\n\t\t\tdocuments: cmd.documents.map((document, index) => this.asRead({\n\t\t\t\t_id: insertedIds[index],\n\t\t\t\t...document\n\t\t\t}))\n\t\t};\n\t}\n\tasync *executeUpdateManyCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).updateMany(cmd.filter, cmd.update, { upsert: cmd.upsert });\n\t\tyield {\n\t\t\tmatchedCount: result.matchedCount,\n\t\t\tmodifiedCount: result.modifiedCount,\n\t\t\tupsertedCount: result.upsertedCount,\n\t\t\tupsertedId: result.upsertedId ?? void 0\n\t\t};\n\t}\n\tasync *executeDeleteOneCommand(cmd) {\n\t\tyield { deletedCount: (await this.db.collection(cmd.collection).deleteOne(cmd.filter)).deletedCount };\n\t}\n\tasync *executeDeleteManyCommand(cmd) {\n\t\tyield { deletedCount: (await this.db.collection(cmd.collection).deleteMany(cmd.filter)).deletedCount };\n\t}\n\tasync *executeFindOneAndUpdateCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).findOneAndUpdate(cmd.filter, cmd.update, {\n\t\t\tupsert: cmd.upsert,\n\t\t\t...cmd.returnDocument != null ? { returnDocument: cmd.returnDocument } : {},\n\t\t\t...cmd.sort != null ? { sort: cmd.sort } : {}\n\t\t});\n\t\tif (result) yield result;\n\t}\n\tasync *executeFindOneAndDeleteCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).findOneAndDelete(cmd.filter, { ...cmd.sort != null ? { sort: cmd.sort } : {} });\n\t\tif (result) yield result;\n\t}\n\tasync *executeAggregateCommand(cmd) {\n\t\tyield* this.db.collection(cmd.collection).aggregate(cmd.pipeline);\n\t}\n\tasync executeCreateCollectionCommand(cmd) {\n\t\tconst { validator, validationLevel, validationAction, capped, size, max, timeseries, collation, changeStreamPreAndPostImages, clusteredIndex } = cmd;\n\t\tawait this.db.createCollection(cmd.collection, {\n\t\t\t...validator !== void 0 ? { validator } : {},\n\t\t\t...validationLevel !== void 0 ? { validationLevel } : {},\n\t\t\t...validationAction !== void 0 ? { validationAction } : {},\n\t\t\t...capped !== void 0 ? { capped } : {},\n\t\t\t...size !== void 0 ? { size } : {},\n\t\t\t...max !== void 0 ? { max } : {},\n\t\t\t...timeseries !== void 0 ? { timeseries } : {},\n\t\t\t...collation !== void 0 ? { collation } : {},\n\t\t\t...changeStreamPreAndPostImages !== void 0 ? { changeStreamPreAndPostImages } : {},\n\t\t\t...clusteredIndex !== void 0 ? { clusteredIndex } : {}\n\t\t});\n\t}\n\tasync executeCreateIndexCommand(cmd) {\n\t\tconst { unique, sparse, expireAfterSeconds, partialFilterExpression, name, wildcardProjection, collation, weights, default_language, language_override } = cmd;\n\t\tawait this.db.collection(cmd.collection).createIndex(cmd.key, {\n\t\t\t...unique !== void 0 ? { unique } : {},\n\t\t\t...sparse !== void 0 ? { sparse } : {},\n\t\t\t...expireAfterSeconds !== void 0 ? { expireAfterSeconds } : {},\n\t\t\t...partialFilterExpression !== void 0 ? { partialFilterExpression } : {},\n\t\t\t...name !== void 0 ? { name } : {},\n\t\t\t...wildcardProjection !== void 0 ? { wildcardProjection } : {},\n\t\t\t...collation !== void 0 ? { collation } : {},\n\t\t\t...weights !== void 0 ? { weights } : {},\n\t\t\t...default_language !== void 0 ? { default_language } : {},\n\t\t\t...language_override !== void 0 ? { language_override } : {}\n\t\t});\n\t}\n\tasync executeDropCollectionCommand(cmd) {\n\t\tawait this.db.collection(cmd.collection).drop();\n\t}\n\tasync executeDropIndexCommand(cmd) {\n\t\tawait this.db.collection(cmd.collection).dropIndex(cmd.name);\n\t}\n\tasync executeCollModCommand(cmd) {\n\t\tconst { validator, validationLevel, validationAction, changeStreamPreAndPostImages } = cmd;\n\t\tawait this.db.command({\n\t\t\tcollMod: cmd.collection,\n\t\t\t...validator !== void 0 ? { validator } : {},\n\t\t\t...validationLevel !== void 0 ? { validationLevel } : {},\n\t\t\t...validationAction !== void 0 ? { validationAction } : {},\n\t\t\t...changeStreamPreAndPostImages !== void 0 ? { changeStreamPreAndPostImages } : {}\n\t\t});\n\t}\n};\nasync function createMongoDriver(uri, dbName) {\n\treturn MongoDriverImpl.fromConnection(uri, dbName);\n}\n//#endregion\nexport { createMongoDriver as n, DRIVER_INFO as r, MongoDriverImpl as t };\n\n//# sourceMappingURL=mongo-driver-BdLE9T5y.mjs.map"],"mappings":";;;AAIA,MAAM,cAAc;CACnB,MAAM;CACN,SAAS;AACV;;AAIA,SAAS,gBAAgB,OAAO;CAC/B,MAAM,YAAY;CAClB,IAAI,OAAO,cAAc,YAAY,cAAc,QAAQ,UAAU,aAAa,OAAO,UAAU,SAAS,UAAU,OAAO,UAAU;CACvI,OAAO;AACR;;AAEA,IAAI,kBAAkB,MAAM,gBAAgB;CAC3C;CACA;CACA,YAAY,IAAI,QAAQ;EACvB,KAAK,KAAK;EACV,KAAK,SAAS;CACf;CACA,aAAa,eAAe,KAAK,QAAQ;EACxC,MAAM,SAAS,IAAI,YAAY,KAAK,EAAE,YAAY,YAAY,CAAC;EAC/D,MAAM,OAAO,QAAQ;EACrB,OAAO,IAAI,gBAAgB,OAAO,GAAG,MAAM,GAAG,MAAM;CACrD;CACA,OAAO,OAAO,IAAI;EACjB,OAAO,IAAI,gBAAgB,IAAI,KAAK,CAAC;CACtC;CACA,QAAQ,aAAa;EACpB,QAAQ,YAAY,MAApB;GACC,KAAK,aAAa,OAAO,KAAK,wBAAwB,WAAW;GACjE,KAAK,aAAa,OAAO,KAAK,wBAAwB,WAAW;GACjE,KAAK,cAAc,OAAO,KAAK,yBAAyB,WAAW;GACnE,KAAK,cAAc,OAAO,KAAK,yBAAyB,WAAW;GACnE,KAAK,aAAa,OAAO,KAAK,wBAAwB,WAAW;GACjE,KA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,eAAe,KAAK,MAAM;AAClD"}
|
package/dist/target.d.mts
CHANGED
|
@@ -2,9 +2,9 @@ import { a as MONGO_DECIMAL128_CODEC_ID, c as MONGO_INT64_CODEC_ID, d as MONGO_O
|
|
|
2
2
|
import { a as Vector, i as CodecTypes, n as BsonScalar, r as BsonValue, t as BsonInputValue } from "./codec-types-wuAXIXjV.mjs";
|
|
3
3
|
import { i as mongoStandardCodecs, n as mongoCodecDescriptors, r as mongoDescriptorById, t as buildStandardCodecRegistry } from "./codecs-ZeuEqozq.mjs";
|
|
4
4
|
import { a as DropCollectionCall, c as schemaCollectionToCreateCollectionOptions, i as CreateIndexCall, l as schemaIndexToCreateIndexOptions, n as CollModMeta, o as DropIndexCall, r as CreateCollectionCall, s as OpFactoryCall$1, t as CollModCall } from "./op-factory-call-bbkNqNr4-GITke_FQ.mjs";
|
|
5
|
-
import { _ as renderOps, a as MongoTargetContract, c as MongoTargetSchemaVerifier, d as PlannerProducedMongoMigration, f as RenderMigrationMeta, g as renderCallsToTypeScript, h as mongoTargetDescriptor, i as MongoMigrationRunnerExecuteOptions, l as MongoTargetUnboundDatabase, m as deserializeMongoOps, n as MongoMigrationPlanner, o as MongoTargetContractSerializer, p as deserializeMongoOp, r as MongoMigrationRunner, s as MongoTargetDatabase, t as FilterEvaluator, u as PlanCallsResult, v as serializeMongoOps } from "./control-
|
|
5
|
+
import { _ as renderOps, a as MongoTargetContract, c as MongoTargetSchemaVerifier, d as PlannerProducedMongoMigration, f as RenderMigrationMeta, g as renderCallsToTypeScript, h as mongoTargetDescriptor, i as MongoMigrationRunnerExecuteOptions, l as MongoTargetUnboundDatabase, m as deserializeMongoOps, n as MongoMigrationPlanner, o as MongoTargetContractSerializer, p as deserializeMongoOp, r as MongoMigrationRunner, s as MongoTargetDatabase, t as FilterEvaluator, u as PlanCallsResult, v as serializeMongoOps } from "./control-Dl6mTJWt.mjs";
|
|
6
6
|
import { a as mongoDate, c as mongoInt32, d as mongoObjectId, f as mongoString, i as mongoDataTypes, l as mongoInt64, m as mongoVectorParams, n as mongoBool, o as mongoDecimal128, p as mongoVector, r as mongoBson, s as mongoDouble, t as mongoBinary, u as mongoJson } from "./data-types-CcyIYfyC.mjs";
|
|
7
|
-
import { a as createIndex, c as dropIndex, d as validatedCollection, i as createCollection, l as placeholder, n as MigrationCLI, o as dataTransform, r as collMod, s as dropCollection, t as Migration, u as setValidation } from "./migration-
|
|
7
|
+
import { a as createIndex, c as dropIndex, d as validatedCollection, i as createCollection, l as placeholder, n as MigrationCLI, o as dataTransform, r as collMod, s as dropCollection, t as Migration, u as setValidation } from "./migration-4ewD_thE.mjs";
|
|
8
8
|
import "./pack-4m3yVTQB.mjs";
|
|
9
9
|
import { t as prisma6MongoBinding } from "./prisma6-binding-DppqC9Jo.mjs";
|
|
10
10
|
import { t as MongoRuntimeTargetInstance } from "./runtime-B9_-kjBX.mjs";
|
package/dist/target.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as MONGO_DECIMAL128_CODEC_ID, c as MONGO_INT64_CODEC_ID, d as MONGO_OBJECTID_CODEC_ID, f as MONGO_STRING_CODEC_ID, i as MONGO_DATE_CODEC_ID, l as MONGO_INT64_NUMBER_CODEC_ID, n as MONGO_BOOLEAN_CODEC_ID, o as MONGO_DOUBLE_CODEC_ID, p as MONGO_VECTOR_CODEC_ID, r as MONGO_BSON_CODEC_ID, s as MONGO_INT32_CODEC_ID, t as MONGO_BINARY_CODEC_ID, u as MONGO_JSON_CODEC_ID } from "./codec-ids-WdrumsYA-BkQfspmL.mjs";
|
|
2
2
|
import { a as mongoDate, c as mongoInt32, d as mongoObjectId, f as mongoString, i as mongoDataTypes, l as mongoInt64, m as mongoVectorParams, n as mongoBool, o as mongoDecimal128, p as mongoVector, r as mongoBson, s as mongoDouble, t as mongoBinary, u as mongoJson } from "./data-types-D7u1m_Jl-C5XUZspA.mjs";
|
|
3
3
|
import { i as mongoStandardCodecs, n as mongoCodecDescriptors, r as mongoDescriptorById, t as buildStandardCodecRegistry } from "./codecs-I_SlLNTn-BsshuqIx.mjs";
|
|
4
|
-
import { a as dropCollection, c as validatedCollection, i as dataTransform, n as createCollection, o as dropIndex, r as createIndex, s as setValidation, t as collMod } from "./migration-factories-
|
|
5
|
-
import { _ as renderCallsToTypeScript, a as DropIndexCall, b as schemaIndexToCreateIndexOptions, c as MongoMigrationRunner, d as MongoTargetSchemaVerifier, f as MongoTargetUnboundDatabase, g as mongoTargetDescriptor, h as deserializeMongoOps, i as DropCollectionCall, l as MongoTargetContractSerializer, m as deserializeMongoOp, n as CreateCollectionCall, o as FilterEvaluator, p as PlannerProducedMongoMigration, r as CreateIndexCall, s as MongoMigrationPlanner, t as CollModCall, u as MongoTargetDatabase, v as renderOps, x as serializeMongoOps, y as schemaCollectionToCreateCollectionOptions } from "./control-
|
|
4
|
+
import { a as dropCollection, c as validatedCollection, i as dataTransform, n as createCollection, o as dropIndex, r as createIndex, s as setValidation, t as collMod } from "./migration-factories-Dc-BLfBy-CTMAJSsM.mjs";
|
|
5
|
+
import { _ as renderCallsToTypeScript, a as DropIndexCall, b as schemaIndexToCreateIndexOptions, c as MongoMigrationRunner, d as MongoTargetSchemaVerifier, f as MongoTargetUnboundDatabase, g as mongoTargetDescriptor, h as deserializeMongoOps, i as DropCollectionCall, l as MongoTargetContractSerializer, m as deserializeMongoOp, n as CreateCollectionCall, o as FilterEvaluator, p as PlannerProducedMongoMigration, r as CreateIndexCall, s as MongoMigrationPlanner, t as CollModCall, u as MongoTargetDatabase, v as renderOps, x as serializeMongoOps, y as schemaCollectionToCreateCollectionOptions } from "./control-C1SKcSfh.mjs";
|
|
6
6
|
import { n as MigrationCLI, r as placeholder, t as Migration } from "./migration-C-jfTsGU.mjs";
|
|
7
7
|
import { t as prisma6MongoBinding } from "./prisma6-binding-DoapgPvm.mjs";
|
|
8
8
|
export { CollModCall, CreateCollectionCall, CreateIndexCall, DropCollectionCall, DropIndexCall, FilterEvaluator, MONGO_BINARY_CODEC_ID, MONGO_BOOLEAN_CODEC_ID, MONGO_BSON_CODEC_ID, MONGO_DATE_CODEC_ID, MONGO_DECIMAL128_CODEC_ID, MONGO_DOUBLE_CODEC_ID, MONGO_INT32_CODEC_ID, MONGO_INT64_CODEC_ID, MONGO_INT64_NUMBER_CODEC_ID, MONGO_JSON_CODEC_ID, MONGO_OBJECTID_CODEC_ID, MONGO_STRING_CODEC_ID, MONGO_VECTOR_CODEC_ID, Migration, MigrationCLI, MongoMigrationPlanner, MongoMigrationRunner, MongoTargetContractSerializer, MongoTargetDatabase, MongoTargetSchemaVerifier, MongoTargetUnboundDatabase, PlannerProducedMongoMigration, buildStandardCodecRegistry, collMod, createCollection, createIndex, dataTransform, deserializeMongoOp, deserializeMongoOps, dropCollection, dropIndex, mongoBinary, mongoBool, mongoBson, mongoCodecDescriptors, mongoDataTypes, mongoDate, mongoDecimal128, mongoDescriptorById, mongoDouble, mongoInt32, mongoInt64, mongoJson, mongoObjectId, mongoStandardCodecs, mongoString, mongoTargetDescriptor, mongoVector, mongoVectorParams, placeholder, prisma6MongoBinding, renderCallsToTypeScript, renderOps, schemaCollectionToCreateCollectionOptions, schemaIndexToCreateIndexOptions, serializeMongoOps, setValidation, validatedCollection };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as DropCollectionCall, c as schemaCollectionToCreateCollectionOptions, i as CreateIndexCall, l as schemaIndexToCreateIndexOptions, n as CollModMeta, o as DropIndexCall, r as CreateCollectionCall, s as OpFactoryCall$1, t as CollModCall } from "./op-factory-call-bbkNqNr4-GITke_FQ.mjs";
|
|
2
|
-
import { _ as renderOps, a as MongoTargetContract, c as MongoTargetSchemaVerifier, d as PlannerProducedMongoMigration, f as RenderMigrationMeta, g as renderCallsToTypeScript, h as mongoTargetDescriptor, i as MongoMigrationRunnerExecuteOptions, l as MongoTargetUnboundDatabase, m as deserializeMongoOps, n as MongoMigrationPlanner, o as MongoTargetContractSerializer, p as deserializeMongoOp, r as MongoMigrationRunner, s as MongoTargetDatabase, t as FilterEvaluator, u as PlanCallsResult, v as serializeMongoOps } from "./control-
|
|
2
|
+
import { _ as renderOps, a as MongoTargetContract, c as MongoTargetSchemaVerifier, d as PlannerProducedMongoMigration, f as RenderMigrationMeta, g as renderCallsToTypeScript, h as mongoTargetDescriptor, i as MongoMigrationRunnerExecuteOptions, l as MongoTargetUnboundDatabase, m as deserializeMongoOps, n as MongoMigrationPlanner, o as MongoTargetContractSerializer, p as deserializeMongoOp, r as MongoMigrationRunner, s as MongoTargetDatabase, t as FilterEvaluator, u as PlanCallsResult, v as serializeMongoOps } from "./control-Dl6mTJWt.mjs";
|
|
3
3
|
export { CollModCall, type CollModMeta, CreateCollectionCall, CreateIndexCall, DropCollectionCall, DropIndexCall, FilterEvaluator, MongoMigrationPlanner, MongoMigrationRunner, type MongoMigrationRunnerExecuteOptions, type MongoTargetContract, MongoTargetContractSerializer, MongoTargetDatabase, MongoTargetSchemaVerifier, MongoTargetUnboundDatabase, type OpFactoryCall$1 as OpFactoryCall, type PlanCallsResult, PlannerProducedMongoMigration, type RenderMigrationMeta, deserializeMongoOp, deserializeMongoOps, mongoTargetDescriptor, renderCallsToTypeScript, renderOps, schemaCollectionToCreateCollectionOptions, schemaIndexToCreateIndexOptions, serializeMongoOps };
|
package/dist/target__control.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as renderCallsToTypeScript, a as DropIndexCall, b as schemaIndexToCreateIndexOptions, c as MongoMigrationRunner, d as MongoTargetSchemaVerifier, f as MongoTargetUnboundDatabase, g as mongoTargetDescriptor, h as deserializeMongoOps, i as DropCollectionCall, l as MongoTargetContractSerializer, m as deserializeMongoOp, n as CreateCollectionCall, o as FilterEvaluator, p as PlannerProducedMongoMigration, r as CreateIndexCall, s as MongoMigrationPlanner, t as CollModCall, u as MongoTargetDatabase, v as renderOps, x as serializeMongoOps, y as schemaCollectionToCreateCollectionOptions } from "./control-
|
|
1
|
+
import { _ as renderCallsToTypeScript, a as DropIndexCall, b as schemaIndexToCreateIndexOptions, c as MongoMigrationRunner, d as MongoTargetSchemaVerifier, f as MongoTargetUnboundDatabase, g as mongoTargetDescriptor, h as deserializeMongoOps, i as DropCollectionCall, l as MongoTargetContractSerializer, m as deserializeMongoOp, n as CreateCollectionCall, o as FilterEvaluator, p as PlannerProducedMongoMigration, r as CreateIndexCall, s as MongoMigrationPlanner, t as CollModCall, u as MongoTargetDatabase, v as renderOps, x as serializeMongoOps, y as schemaCollectionToCreateCollectionOptions } from "./control-C1SKcSfh.mjs";
|
|
2
2
|
export { CollModCall, CreateCollectionCall, CreateIndexCall, DropCollectionCall, DropIndexCall, FilterEvaluator, MongoMigrationPlanner, MongoMigrationRunner, MongoTargetContractSerializer, MongoTargetDatabase, MongoTargetSchemaVerifier, MongoTargetUnboundDatabase, PlannerProducedMongoMigration, deserializeMongoOp, deserializeMongoOps, mongoTargetDescriptor, renderCallsToTypeScript, renderOps, schemaCollectionToCreateCollectionOptions, schemaIndexToCreateIndexOptions, serializeMongoOps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createIndex, c as dropIndex, d as validatedCollection, i as createCollection, l as placeholder, n as MigrationCLI, o as dataTransform, r as collMod, s as dropCollection, t as Migration, u as setValidation } from "./migration-
|
|
1
|
+
import { a as createIndex, c as dropIndex, d as validatedCollection, i as createCollection, l as placeholder, n as MigrationCLI, o as dataTransform, r as collMod, s as dropCollection, t as Migration, u as setValidation } from "./migration-4ewD_thE.mjs";
|
|
2
2
|
export { Migration, MigrationCLI, collMod, createCollection, createIndex, dataTransform, dropCollection, dropIndex, placeholder, setValidation, validatedCollection };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as dropCollection, c as validatedCollection, i as dataTransform, n as createCollection, o as dropIndex, r as createIndex, s as setValidation, t as collMod } from "./migration-factories-
|
|
1
|
+
import { a as dropCollection, c as validatedCollection, i as dataTransform, n as createCollection, o as dropIndex, r as createIndex, s as setValidation, t as collMod } from "./migration-factories-Dc-BLfBy-CTMAJSsM.mjs";
|
|
2
2
|
import { n as MigrationCLI, r as placeholder, t as Migration } from "./migration-C-jfTsGU.mjs";
|
|
3
3
|
export { Migration, MigrationCLI, collMod, createCollection, createIndex, dataTransform, dropCollection, dropIndex, placeholder, setValidation, validatedCollection };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-target-mongo",
|
|
3
|
-
"version": "8.0.0-rc.16-dev.
|
|
3
|
+
"version": "8.0.0-rc.16-dev.7",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -9,18 +9,18 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@prisma/orm-family-mongo": "8.0.0-rc.16-dev.
|
|
13
|
-
"@prisma/orm-framework": "8.0.0-rc.16-dev.
|
|
14
|
-
"@prisma/orm-toolchain": "8.0.0-rc.16-dev.
|
|
12
|
+
"@prisma/orm-family-mongo": "8.0.0-rc.16-dev.7",
|
|
13
|
+
"@prisma/orm-framework": "8.0.0-rc.16-dev.7",
|
|
14
|
+
"@prisma/orm-toolchain": "8.0.0-rc.16-dev.7",
|
|
15
15
|
"arktype": "^2.2.2",
|
|
16
16
|
"bson": "^7.2.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@internal/adapter-mongo": "8.0.0-rc.16-dev.
|
|
20
|
-
"@internal/driver-mongo": "8.0.0-rc.16-dev.
|
|
21
|
-
"@internal/target-mongo": "8.0.0-rc.16-dev.
|
|
22
|
-
"@repo/tsconfig": "8.0.0-rc.16-dev.
|
|
23
|
-
"@repo/tsdown": "8.0.0-rc.16-dev.
|
|
19
|
+
"@internal/adapter-mongo": "8.0.0-rc.16-dev.7",
|
|
20
|
+
"@internal/driver-mongo": "8.0.0-rc.16-dev.7",
|
|
21
|
+
"@internal/target-mongo": "8.0.0-rc.16-dev.7",
|
|
22
|
+
"@repo/tsconfig": "8.0.0-rc.16-dev.7",
|
|
23
|
+
"@repo/tsdown": "8.0.0-rc.16-dev.7",
|
|
24
24
|
"tsdown": "0.22.14",
|
|
25
25
|
"typescript": "5.9.3"
|
|
26
26
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-B4_aOJ9c.d.mts","names":[],"sources":["../../../../3-mongo-target/1-mongo-target/dist/control.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4BK,sBAAsB,KAAK;WACrB,SAAS;;;;;;;;;;;;;;cAcN,uBAAuB,6BAA6B;;;cAGpD,2BAA2B;UAC/B;EACR,SAAS,QAAQ,iBAAiB,KAAK;EACvC,MAAM,MAAM;EACZ,IAAI,MAAM;EACV,GAAG,MAAM;EACT,IAAI,MAAM;EACV,OAAO,MAAM;EACb,KAAK,OAAO;;;;iBAIG,mBAAmB,gBAAgB;iBACnC,oBAAoB,2BAA2B;iBAC/C,kBAAkB,cAAc;;;KAG5C;WACM;WACA,OAAO;;WAEP;WACA,WAAW;;cAER,iCAAiC;EAC7C,UAAU;aACC;aACA;aACA,QAAQ;aACR,qBAAqB,cAAc;MAC1C;EACJ,KAAK;aACM;aACA;aACA,QAAQ;;;;;;aAMR,cAAc;aACd,qBAAqB,cAAc;;;;;;aAMnC;MACP;;;;;;;;;;EAUJ,eAAe,SAAS,2BAA2B;;;;UAI3C;WACC,MAAM;WACN,qBAAqB;WACrB,QAAQ;WACR;IACP,kBAAkB,IAAI;IACtB,qBAAqB,IAAI;;WAElB,kBAAkB;WAClB,qBAAqB,cAAc;WACnC;WACA,UAAU;;;;;;;;;;;WAWV,qBAAqB,QAAQ,+BAA+B;;WAE5D,yBAAyB;;KAE/B,6BAA6B,OAAO,qCAAqC;cAChE;mBACK;EACjB,YAAY,MAAM;EAClB,QAAQ,SAAS,qCAAqC,QAAQ;UACtD;UACA;UACA;UACA;UACA;UACA;UACA;;;;;;;;;;;;;;;;;;;;;;;;;cAyBI,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;;;cAGtE,sCAAsC,4BAA4B;YACpE,wBAAwB,WAAW,gBAAgB;EAC7D,kBAAkB,UAAU,sBAAsB;;;;UAI1C;WACC;WACA,UAAU,SAAS,eAAe,SAAS;aACzC,aAAa,SAAS,eAAe;aACrC,WAAW,SAAS,eAAe;;;;;;;;;;;;;;;;;cAiBlC,4BAA4B;WAC/B;WACA;WACA,SAAS;EAClB,YAAY,OAAO;MACf,cAAc,SAAS,eAAe;;;;;EAK1C;;;;;;;EAOA,kBAAkB;;;;;;;;;;;;;;;cAeN,mCAAmC;kBAC/B,UAAU;UAClB;EACR;EACA,kBAAkB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-CRID2UtN.mjs","names":[],"sources":["../../../../3-mongo-target/1-mongo-target/dist/control.mjs"],"sourcesContent":["import { t as mongoTargetDescriptorMeta } from \"./descriptor-meta-BtMd3yW0.mjs\";\nimport { a as mongoTargetError } from \"./codecs-I_SlLNTn.mjs\";\nimport { a as dropCollection, n as createCollection, o as dropIndex, r as createIndex, t as collMod } from \"./migration-factories-D9gdxskt.mjs\";\nimport { APP_SPACE_ID, VERIFY_CODE_SCHEMA_FAILURE, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, issueOutcome } from \"@internal/framework-components/control\";\nimport { NamespaceBase, UNBOUND_NAMESPACE_ID, elementCoordinates, freezeNode, hydrateNamespaceEntities } from \"@internal/framework-components/ir\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { type } from \"arktype\";\nimport { canonicalizeSchemasForVerification, contractToMongoSchemaIR, diffMongoSchemas } from \"@internal/family-mongo/control\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { MongoContractSerializerBase, MongoSchemaVerifierBase } from \"@internal/family-mongo/ir\";\nimport { MongoStorage } from \"@internal/mongo-contract\";\nimport { composeMongoEntityKinds } from \"@internal/mongo-contract/entity-kinds\";\nimport { canonicalize, deepEqual } from \"@internal/mongo-schema-ir\";\nimport { TsExpression, jsonToTsSource, renderImports } from \"@internal/ts-render\";\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 { 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 { AggregateCommand, MongoAddFieldsStage, MongoLimitStage, MongoLookupStage, MongoMatchStage, MongoMergeStage, MongoProjectStage, MongoSortStage, RawAggregateCommand, RawDeleteManyCommand, RawDeleteOneCommand, RawFindOneAndDeleteCommand, RawFindOneAndUpdateCommand, RawInsertManyCommand, RawInsertOneCommand, RawUpdateManyCommand, RawUpdateOneCommand } from \"@internal/mongo-query-ast/execution\";\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/migrations/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/migrations/render-ops.ts\nfunction renderOps(calls) {\n\treturn calls.map((call) => call.toOp());\n}\n//#endregion\n//#region src/core/migrations/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/migrations/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/migrations/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 (!admitsEverything(destProps[field], originProps[field])) return false;\n\t}\n\treturn true;\n}\nfunction bsonTypeList(value) {\n\tif (value === void 0) return void 0;\n\treturn Array.isArray(value) ? value : [value];\n}\n/**\n* Whether every value `origin` admits, `dest` admits too, for the property schemas Prisma derives: `{}` admits every value, a `bsonType` list may gain types, and an array's `items` may admit more. Any other difference is treated as narrowing.\n*/\nfunction admitsEverything(dest, origin) {\n\tif (canonicalize(dest) === canonicalize(origin)) return true;\n\tif (!isPlainObject(dest) || !isPlainObject(origin)) return false;\n\tif (Object.keys(dest).length === 0) return true;\n\tfor (const key of /* @__PURE__ */ new Set([...Object.keys(origin), ...Object.keys(dest)])) {\n\t\tif (key === \"bsonType\") {\n\t\t\tconst destTypes = bsonTypeList(dest[\"bsonType\"]);\n\t\t\tconst originTypes = bsonTypeList(origin[\"bsonType\"]);\n\t\t\tif (destTypes === void 0) continue;\n\t\t\tif (originTypes === void 0 || !originTypes.every((type) => destTypes.includes(type))) return false;\n\t\t\tcontinue;\n\t\t}\n\t\tif (key === \"items\") {\n\t\t\tif (!admitsEverything(dest[\"items\"] ?? {}, origin[\"items\"] ?? {})) return false;\n\t\t\tcontinue;\n\t\t}\n\t\tif (canonicalize(origin[key]) !== canonicalize(dest[key])) return false;\n\t}\n\treturn true;\n}\nfunction propertiesOf(schema) {\n\treturn isPlainObject(schema[\"properties\"]) ? schema[\"properties\"] : {};\n}\n/**\n* A label naming the properties whose schema changed, so a dry run shows what a validator update does: `Update validator on items (changed: meta; added: note)`.\n*/\nfunction validatorUpdateLabel(collName, origin, dest) {\n\tconst originProps = propertiesOf(origin.jsonSchema);\n\tconst destProps = propertiesOf(dest.jsonSchema);\n\tconst changed = Object.keys(destProps).filter((field) => Object.hasOwn(originProps, field) && canonicalize(originProps[field]) !== canonicalize(destProps[field]));\n\tconst added = Object.keys(destProps).filter((field) => !Object.hasOwn(originProps, field));\n\tconst removed = Object.keys(originProps).filter((field) => !Object.hasOwn(destProps, field));\n\tconst parts = [\n\t\t...changed.length > 0 ? [`changed: ${changed.join(\", \")}`] : [],\n\t\t...added.length > 0 ? [`added: ${added.join(\", \")}`] : [],\n\t\t...removed.length > 0 ? [`removed: ${removed.join(\", \")}`] : []\n\t];\n\treturn parts.length === 0 ? `Update validator on ${collName}` : `Update validator on ${collName} (${parts.join(\"; \")})`;\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\trefusedOperationClass: call.operationClass\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 ? validatorUpdateLabel(collName, originValidator, destValidator) : `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/migrations/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/migrations/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/migrations/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})) {\n\t\t\t\t\tconst found = await markerOps.readMarker(space);\n\t\t\t\t\treturn runnerFailure(\"MIGRATION.MARKER_CAS_FAILURE\", \"Marker was modified by another process during migration execution.\", { meta: {\n\t\t\t\t\t\tspace,\n\t\t\t\t\t\texpectedStorageHash: existingMarker.storageHash,\n\t\t\t\t\t\tfoundStorageHash: found?.storageHash ?? null,\n\t\t\t\t\t\tdestinationStorageHash: destination.storageHash\n\t\t\t\t\t} });\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/migrations/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/migrations/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 ?? VERIFY_CODE_SCHEMA_FAILURE },\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/migrations/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 ??= family.createRunnerDependencies({ driver });\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"],"m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AM,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":"migration-DKlTqb10.d.mts","names":[],"sources":["../../../../3-mongo-target/1-mongo-target/dist/migration.d.mts"],"mappings":";;;;;;;;UAOU;EACR,SAAS;;iBAEM,cAAc,cAAc;;;;;;EAM3C;EACA;IACE,cAAc,iBAAiB;IAC/B,SAAS;IACT;IACA;;EAEF,WAAW,iBAAiB;IAC1B;iBACa,YAAY,wBAAwB,MAAM,cAAc,gBAAgB,UAAU,qBAAqB;iBACvG,UAAU,wBAAwB,MAAM,cAAc,iBAAiB;iBACvE,iBAAiB,wBAAwB,UAAU,0BAA0B;iBAC7E,eAAe,yBAAyB;iBACxC,cAAc,wBAAwB,QAAQ,yBAAyB;EACtF;EACA;IACE;iBACa,QAAQ,wBAAwB,SAAS,gBAAgB,OAAO,cAAc;iBAC9E,oBAAoB,cAAc,QAAQ,yBAAyB,SAAS;EAC3F,MAAM;EACN;KACG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migration-factories-D9gdxskt-B01b9zbg.mjs","names":[],"sources":["../../../../3-mongo-target/1-mongo-target/dist/migration-factories-D9gdxskt.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/migrations/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-D9gdxskt.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,KA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