@prisma/orm-target-mongo 8.0.0-rc.23-dev.12 → 8.0.0-rc.23-dev.14

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.
Files changed (57) hide show
  1. package/dist/adapter.mjs +1 -1
  2. package/dist/adapter__control.mjs +1 -1
  3. package/dist/adapter__runtime.mjs +2 -2
  4. package/dist/{codecs-BbX2VMzN-Dm9db3Jz.mjs → codecs-Bl21z49D-Bj5erX9r.mjs} +3 -3
  5. package/dist/{codecs-BbX2VMzN-Dm9db3Jz.mjs.map → codecs-Bl21z49D-Bj5erX9r.mjs.map} +1 -1
  6. package/dist/{control-B77seMDK.mjs → control-BxslS3_F.mjs} +1452 -154
  7. package/dist/control-BxslS3_F.mjs.map +1 -0
  8. package/dist/{control-BsAxKPch.mjs → control-DPih_MpI.mjs} +2 -2
  9. package/dist/{control-BsAxKPch.mjs.map → control-DPih_MpI.mjs.map} +1 -1
  10. package/dist/{control-1-RnMe4V.d.mts → control-OiC131Dv.d.mts} +35 -5
  11. package/dist/control-OiC131Dv.d.mts.map +1 -0
  12. package/dist/{data-types-Cq1kg82y-Vk7z6rnW.mjs → data-types-B3SLjbqa-C1LmrfzH.mjs} +29 -5
  13. package/dist/{data-types-Cq1kg82y-Vk7z6rnW.mjs.map → data-types-B3SLjbqa-C1LmrfzH.mjs.map} +1 -1
  14. package/dist/{date-time-now-generators-fWUk_--7-BnCnC0d8.mjs → date-time-now-generators-Dhq1b2V8-TgMEfnbI.mjs} +3 -3
  15. package/dist/{date-time-now-generators-fWUk_--7-BnCnC0d8.mjs.map → date-time-now-generators-Dhq1b2V8-TgMEfnbI.mjs.map} +1 -1
  16. package/dist/{descriptor-meta-CFsOxO6g-Ca8valmZ.mjs → descriptor-meta-BXMz_uZd-B8WB2m7v.mjs} +5 -5
  17. package/dist/{descriptor-meta-CFsOxO6g-Ca8valmZ.mjs.map → descriptor-meta-BXMz_uZd-B8WB2m7v.mjs.map} +1 -1
  18. package/dist/{descriptor-meta-runtime-CBJIjp5R-DMQ9-3Hd.mjs → descriptor-meta-runtime-J4eVdBtZ-D1yRng4t.mjs} +4 -4
  19. package/dist/{descriptor-meta-runtime-CBJIjp5R-DMQ9-3Hd.mjs.map → descriptor-meta-runtime-J4eVdBtZ-D1yRng4t.mjs.map} +1 -1
  20. package/dist/driver.mjs +1 -1
  21. package/dist/driver__control.mjs +1 -1
  22. package/dist/driver__runtime.mjs +1 -1
  23. package/dist/driver__runtime.mjs.map +1 -1
  24. package/dist/migration-DASk9QNA.d.mts +5 -0
  25. package/dist/{migration-factories-oLRWgLGz-B9fWm8Wc.mjs → migration-factories-C5ktmt8c-BP8k9SnZ.mjs} +245 -17
  26. package/dist/migration-factories-C5ktmt8c-BP8k9SnZ.mjs.map +1 -0
  27. package/dist/{mongo-adapter-RJ_YOxiK-jlyFS6Wr.mjs → mongo-adapter-RJ_YOxiK-CCHpxwqy.mjs} +2 -2
  28. package/dist/{mongo-adapter-RJ_YOxiK-jlyFS6Wr.mjs.map → mongo-adapter-RJ_YOxiK-CCHpxwqy.mjs.map} +1 -1
  29. package/dist/{mongo-driver-7Zd_QRhP-BSfEX_kV.mjs → mongo-driver-igrhXX_3-CWKp1Lw4.mjs} +3 -3
  30. package/dist/{mongo-driver-7Zd_QRhP-BSfEX_kV.mjs.map → mongo-driver-igrhXX_3-CWKp1Lw4.mjs.map} +1 -1
  31. package/dist/op-factory-call-BCgwbVJe-DhcJRxAb.d.mts +248 -0
  32. package/dist/op-factory-call-BCgwbVJe-DhcJRxAb.d.mts.map +1 -0
  33. package/dist/{prisma6-binding-BjKPGVql.mjs → prisma6-binding-BXi_1e8c.mjs} +2 -2
  34. package/dist/{prisma6-binding-BjKPGVql.mjs.map → prisma6-binding-BXi_1e8c.mjs.map} +1 -1
  35. package/dist/{runtime-DyWNR1FZ.mjs → runtime-CkX-HAf5.mjs} +2 -2
  36. package/dist/{runtime-DyWNR1FZ.mjs.map → runtime-CkX-HAf5.mjs.map} +1 -1
  37. package/dist/target.d.mts +4 -4
  38. package/dist/target.mjs +8 -8
  39. package/dist/target__codecs.mjs +1 -1
  40. package/dist/target__control.d.mts +2 -2
  41. package/dist/target__control.mjs +1 -1
  42. package/dist/target__data-types.mjs +1 -1
  43. package/dist/target__migration.d.mts +3 -2
  44. package/dist/target__migration.mjs +3 -3
  45. package/dist/target__pack.mjs +1 -1
  46. package/dist/target__pack.mjs.map +1 -1
  47. package/dist/target__prisma6-binding.mjs +1 -1
  48. package/dist/target__runtime.mjs +2 -2
  49. package/package.json +10 -10
  50. package/dist/control-1-RnMe4V.d.mts.map +0 -1
  51. package/dist/control-B77seMDK.mjs.map +0 -1
  52. package/dist/migration-BMUh33vn.d.mts +0 -56
  53. package/dist/migration-BMUh33vn.d.mts.map +0 -1
  54. package/dist/migration-factories-oLRWgLGz-B9fWm8Wc.mjs.map +0 -1
  55. package/dist/op-factory-call-DzQ_ZxeZ-CukKyuhZ.d.mts +0 -115
  56. package/dist/op-factory-call-DzQ_ZxeZ-CukKyuhZ.d.mts.map +0 -1
  57. package/dist/{migration-C-jfTsGU.mjs → migration-psmPNv10.mjs} +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-BxslS3_F.mjs","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/control.mjs"],"sourcesContent":["import { t as mongoTargetDescriptorMeta } from \"./descriptor-meta-BXMz_uZd.mjs\";\nimport { t as mongoTargetError } from \"./mongo-target-errors-Btf3ML1w.mjs\";\nimport { _ as unsetField, b as isConvertTarget, c as dropCollection, g as unrewritableFieldNameReason, i as createIndex, l as dropIndex, m as renameField, n as collMod, o as documentsMissingOrNull, p as renameCollection, r as createCollection, s as documentsNotOfType, t as castField, u as fillField, y as castsFrom } from \"./migration-factories-C5ktmt8c.mjs\";\nimport { assembleDataTypes } from \"@internal/framework-components/codec\";\nimport { bsonTypesOfCodec, temporaryValueOfCodec } from \"@internal/mongo-contract/data-type\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { type } from \"arktype\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { setFallbackTemporal } from \"@internal/type-implementations/temporal\";\nimport { NamespaceBase, UNBOUND_NAMESPACE_ID, elementCoordinates, freezeNode, hydrateNamespaceEntities } from \"@internal/framework-components/ir\";\nimport { canonicalizeSchemasForVerification, contractToMongoSchemaIR, diffMongoSchemas, fieldRewriteOf } from \"@internal/family-mongo/control\";\nimport { APP_SPACE_ID, VERIFY_CODE_SCHEMA_FAILURE, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, describeMigrationStatement, expectAbsent, expectPresent, extractCodecLookup, failedPostcheckWhy, failedPrecheckWhy, fieldStatementText, issueOutcome, migrationRunnerFailure, modelDisplayName, schemaCheckWhy, withDatabaseUnchanged, withFailingSpace } from \"@internal/framework-components/control\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { Temporal } from \"temporal-polyfill/full/implementation\";\nimport { MongoContractSerializerBase, MongoSchemaVerifierBase } from \"@internal/family-mongo/ir\";\nimport { MongoCollection, MongoStorage, canonicalize, collectionControlPoliciesOf, collectionControlPolicyOf, collectionOfModel, defaultMongoIndexName, embeddingModelOf, hasOwnFieldStoredAs, indexLookupKey, modelAndBasesOf, modelFieldStoredAs, mongoModelsOf, otherModelsReached, ownEmbedStoredNamesOf, ownStoredNameOf, ownStoredNamesOf, propertyBsonTypesOf, validatorDocumentShapesOf, validatorFieldNamesOf, validatorRootShapesOf, variantFilterOf } from \"@internal/mongo-contract\";\nimport { composeMongoEntityKinds } from \"@internal/mongo-contract/entity-kinds\";\nimport { asNamespaceId, governingControlPolicy, valueObjectAt, valueObjectsWithCoordinates } from \"@internal/contract/types\";\nimport { MongoSchemaCollection, MongoSchemaIR, deepEqual } from \"@internal/mongo-schema-ir\";\nimport { CollModCommand, CreateCollectionCommand, CreateIndexCommand, DropCollectionCommand, DropIndexCommand, ListCollectionsCommand, ListIndexesCommand, MongoAndExpr, MongoExistsExpr, MongoFieldFilter, MongoNotExpr, MongoOrExpr, RenameCollectionCommand, isInspectionCheckSource, isMongoDmlOperation } from \"@internal/mongo-query-ast/control\";\nimport { AggregateCommand, MongoAddFieldsStage, MongoLimitStage, MongoLookupStage, MongoMatchStage, MongoMergeStage, MongoProjectStage, MongoSortStage, RawAggregateCommand, RawDeleteManyCommand, RawDeleteOneCommand, RawFindOneAndDeleteCommand, RawFindOneAndUpdateCommand, RawInsertManyCommand, RawInsertOneCommand, RawUpdateManyCommand, RawUpdateOneCommand } from \"@internal/mongo-query-ast/execution\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { CliStructuredError } from \"@internal/errors/control\";\nimport { errorUnfilledPlaceholder } from \"@internal/errors/migration\";\nimport { TsExpression, jsonToTsSource, renderImports } from \"@internal/ts-render\";\nimport { Migration } from \"@internal/migration-tools/migration\";\nimport { resolveRequirementSpecifiers } from \"@internal/framework-components/emission\";\nimport { detectScaffoldRuntime, shebangLineFor } from \"@internal/migration-tools/migration-ts\";\nimport { verifyMongoSchema } from \"@internal/family-mongo/schema-verify\";\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 hasEntities = Object.values(nsData.entries).some((slot) => Object.keys(slot).length > 0);\n\t\t\tif (nsId === UNBOUND_NAMESPACE_ID && !hasEntities) return [nsId, MongoTargetUnboundDatabase.instance];\n\t\t\treturn [nsId, new MongoTargetDatabase({\n\t\t\t\tid: nsData.id,\n\t\t\t\tentries: {\n\t\t\t\t\t...nsData.entries,\n\t\t\t\t\tcollection: blindCast(nsData.entries[\"collection\"] ?? {})\n\t\t\t\t}\n\t\t\t})];\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 entries = { collection: blindCast(JSON.parse(JSON.stringify(ns.entries.collection ?? {}))) };\n\t\t\tfor (const [kind, slot] of Object.entries(ns.entries)) {\n\t\t\t\tif (kind === \"collection\" || Object.keys(slot).length === 0) continue;\n\t\t\t\tentries[kind] = blindCast(JSON.parse(JSON.stringify(slot)));\n\t\t\t}\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};\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/mongo-rewrite-refusals.ts\nconst SEPARATE_THE_MODELS = \"move the models to separate collections, or carry out the change in a dataTransform operation of a migration.ts, with a filter that selects only their documents\";\nfunction sharedCollectionWhy(collection, others, change) {\n\tconst names = others.map((name) => JSON.stringify(name)).join(\", \");\n\treturn `Collection ${JSON.stringify(collection)} stores several models and no discriminator tells their documents apart, so ${change} of ${names} too.`;\n}\nconst TIME_SERIES_UPDATES = \"MongoDB updates the documents of a time-series collection only through its metaField\";\nconst WORDS = {\n\tremoval: {\n\t\tconflictKind: \"fieldRemovalRefused\",\n\t\tverb: \"remove\",\n\t\tpreposition: \"from\",\n\t\treaches: \"holding\",\n\t\ttimeSeries: \"so the field cannot be removed from the documents that hold it. Keep the field in the contract, as an optional field if new documents leave it out, then run this command again.\",\n\t\tsharedChange: \"removing the field would remove it from the documents\",\n\t\tsharedGoal: (_model, others) => `To keep it in ${others} documents only`\n\t},\n\tcast: {\n\t\tconflictKind: \"typeChangeRefused\",\n\t\tverb: \"cast\",\n\t\tpreposition: \"in\",\n\t\treaches: \"holding\",\n\t\ttimeSeries: \"so the values of the field cannot be cast. Keep the field's type in the contract, then run this command again.\",\n\t\tsharedChange: \"casting the field would cast it in the documents\",\n\t\tsharedGoal: (model) => `To change it in ${model} documents only`\n\t},\n\tconversion: {\n\t\tconflictKind: \"typeChangeRefused\",\n\t\tverb: \"convert\",\n\t\tpreposition: \"in\",\n\t\treaches: \"holding\",\n\t\ttimeSeries: \"so a data transform cannot convert the values of the field. Keep the field's type in the contract, then run this command again.\",\n\t\tsharedChange: \"the data transform would convert it in the documents\",\n\t\tsharedGoal: (model) => `To change it in ${model} documents only`\n\t},\n\tfill: {\n\t\tconflictKind: \"fieldFillRefused\",\n\t\tverb: \"fill\",\n\t\tpreposition: \"in\",\n\t\treaches: \"selected\",\n\t\ttimeSeries: \"so the field cannot be filled in the documents. Make the field optional in the contract, then run this command again.\",\n\t\tsharedChange: \"filling the field would add it to the documents\",\n\t\tsharedGoal: (model) => `To fill it in ${model} documents only`\n\t},\n\tbackfill: {\n\t\tconflictKind: \"fieldFillRefused\",\n\t\tverb: \"backfill\",\n\t\tpreposition: \"in\",\n\t\treaches: \"selected\",\n\t\ttimeSeries: \"so a data transform cannot fill the field. Make the field optional in the contract, then run this command again.\",\n\t\tsharedChange: \"the data transform would fill it in the documents\",\n\t\tsharedGoal: (model) => `To fill it in ${model} documents only`\n\t}\n};\nfunction quoted(names) {\n\treturn names.map((name) => JSON.stringify(name)).join(\", \");\n}\nfunction timeSeriesRefusal(rewrite) {\n\tconst words = WORDS[rewrite.kind];\n\treturn {\n\t\tkind: words.conflictKind,\n\t\tsummary: `Cannot ${words.verb} field ${JSON.stringify(rewrite.field)} ${words.preposition} collection ${JSON.stringify(rewrite.collection)}: it is a time-series collection`,\n\t\twhy: `${TIME_SERIES_UPDATES}, ${words.timeSeries}`\n\t};\n}\n/**\n* The refusal of a rewrite whose documents another model stored in the same collection shares:\n* another root model when no discriminator value selects the rewrite's documents, or another root\n* model's variant with the same discriminator field and value. A removal, cast or conversion reaches\n* the models that hold the field; a fill or backfill reaches every model its filter selects. Without\n* an origin contract, a cast in a collection whose validator describes several root models is\n* refused, since nothing tells their documents apart.\n*/\nfunction sharedCollectionRefusal(rewrite, contract, validator) {\n\tconst words = WORDS[rewrite.kind];\n\tconst { collection, field, model } = rewrite;\n\tif (model === void 0) {\n\t\tif (rewrite.kind === \"removal\" || validatorRootShapesOf(validator).length <= 1) return;\n\t\treturn {\n\t\t\tkind: words.conflictKind,\n\t\t\tsummary: `Cannot ${words.verb} field ${JSON.stringify(field)} ${words.preposition} collection ${JSON.stringify(collection)}: the collection stores several root models`,\n\t\t\twhy: \"No discriminator tells their documents apart, and without the origin contract the plan cannot tell which documents belong to the model that changed. Plan the change with migration plan --from <hash of the migration the database is at>.\"\n\t\t};\n\t}\n\tconst others = otherModelsReached(contract.domain, model, collection, rewrite.filter, words.reaches === \"holding\" ? field : void 0);\n\tif (others.length === 0) return void 0;\n\tconst named = quoted(others);\n\tconst modelName = JSON.stringify(model.model);\n\treturn {\n\t\tkind: words.conflictKind,\n\t\tsummary: `Cannot ${words.verb} field ${JSON.stringify(field)} of model ${modelName} ${words.preposition} collection ${JSON.stringify(collection)}: model ${named} ${words.reaches === \"holding\" ? \"stores it\" : \"is stored\"} in the same collection`,\n\t\twhy: `${sharedCollectionWhy(collection, others, words.sharedChange)} ${words.sharedGoal(modelName, named)}, ${SEPARATE_THE_MODELS}.`\n\t};\n}\n/**\n* Why the plan refuses a rewrite of its collection's documents: MongoDB does not let an update change\n* a time-series collection's documents except through the metaField, and a rewrite must not change\n* the documents of another model stored in the same collection. The planner refuses every rewrite it\n* plans with these; the runner asks them before it names a statement that would plan one.\n*/\nfunction rewriteRefusals(rewrite, contract, collection) {\n\tconst shared = sharedCollectionRefusal(rewrite, contract, collection.validator);\n\treturn [...collection.timeSeries ? [timeSeriesRefusal(rewrite)] : [], ...shared === void 0 ? [] : [shared]];\n}\n//#endregion\n//#region src/core/migrations/op-factory-call.ts\n/**\n* Mongo migration IR: one concrete `*Call` class per pure factory under\n* `migration-factories.ts`, plus a shared `OpFactoryCallNode` abstract\n* base. Every call class carries the literal arguments its backing\n* factory would receive, computes a human-readable `label` in its\n* constructor, and implements two polymorphic hooks:\n*\n* - `toOp()` — converts the IR node to a runtime\n* `MongoMigrationPlanOperation` by delegating to the matching pure\n* factory in `migration-factories.ts`.\n* - `renderTypeScript()` / `importRequirements()` — inherited from\n* `TsExpression`. Used by `renderCallsToTypeScript` to emit the call\n* as a TypeScript expression inside the scaffolded `migration.ts`.\n*\n* The abstract base and all concrete classes are package-private.\n* External consumers see only the framework-level `OpFactoryCall`\n* interface and the `OpFactoryCall` union.\n*/\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 ${options.name} 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 `createIndex(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.keys)}, ${jsonToTsSource(this.options)})`;\n\t}\n};\nvar DropIndexCall = class extends OpFactoryCallNode {\n\tfactoryName = \"dropIndex\";\n\toperationClass = \"widening\";\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 = `Drop index ${options.name} on ${collection} (${formatKeys(keys)})`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn dropIndex(this.collection, this.keys, this.options);\n\t}\n\trenderTypeScript() {\n\t\treturn `dropIndex(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.keys)}, ${jsonToTsSource(this.options)})`;\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 RenameCollectionCall = class extends OpFactoryCallNode {\n\tfactoryName = \"renameCollection\";\n\toperationClass = \"widening\";\n\tfrom;\n\tto;\n\tlabel;\n\tconstructor(from, to) {\n\t\tsuper();\n\t\tthis.from = from;\n\t\tthis.to = to;\n\t\tthis.label = `Rename collection ${from} to ${to}`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn renameCollection(this.from, this.to);\n\t}\n\trenderTypeScript() {\n\t\treturn `renameCollection(${jsonToTsSource(this.from)}, ${jsonToTsSource(this.to)})`;\n\t}\n};\nfunction renderFilterOption(filter) {\n\treturn filter === void 0 ? \"\" : `, ${jsonToTsSource({ filter })}`;\n}\nvar RenameFieldCall = class extends OpFactoryCallNode {\n\tfactoryName = \"renameField\";\n\toperationClass = \"widening\";\n\tcollection;\n\tfrom;\n\tto;\n\tfilter;\n\tlabel;\n\tconstructor(collection, from, to, filter) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.from = from;\n\t\tthis.to = to;\n\t\tthis.filter = filter;\n\t\tthis.label = this.toOp().label;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn renameField(this.collection, this.from, this.to, ifDefined(\"filter\", this.filter));\n\t}\n\trenderTypeScript() {\n\t\treturn `renameField(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.from)}, ${jsonToTsSource(this.to)}${renderFilterOption(this.filter)})`;\n\t}\n};\nvar UnsetFieldCall = class extends OpFactoryCallNode {\n\tfactoryName = \"unsetField\";\n\toperationClass = \"destructive\";\n\tcollection;\n\tfield;\n\tfilter;\n\tlabel;\n\tconstructor(collection, field, filter) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.field = field;\n\t\tthis.filter = filter;\n\t\tthis.label = this.toOp().label;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn unsetField(this.collection, this.field, ifDefined(\"filter\", this.filter));\n\t}\n\trenderTypeScript() {\n\t\treturn `unsetField(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.field)}${renderFilterOption(this.filter)})`;\n\t}\n};\nvar CastFieldCall = class extends OpFactoryCallNode {\n\tfactoryName = \"castField\";\n\tcollection;\n\tfield;\n\toptions;\n\toperationClass;\n\tlabel;\n\tconstructor(options) {\n\t\tsuper();\n\t\tthis.collection = options.collection;\n\t\tthis.field = options.field;\n\t\tthis.options = options;\n\t\tconst op = this.toOp();\n\t\tthis.operationClass = op.operationClass;\n\t\tthis.label = op.label;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn castField(this.options);\n\t}\n\trenderTypeScript() {\n\t\treturn `castField(${jsonToTsSource(this.options)})`;\n\t}\n};\n/**\n* A data transform the planner scaffolds for a field: its check and its run's filter select the\n* documents still to change, and its update is a placeholder the user fills in `migration.ts`.\n* Until then `toOp()` rejects with `MIGRATION.UNFILLED_PLACEHOLDER`, naming the operation it stands\n* for, so the plan's other operations still list.\n*/\nvar DataTransformCall = class extends OpFactoryCallNode {\n\tfactoryName = \"dataTransform\";\n\toperationClass = \"data\";\n\tname;\n\tcollection;\n\tfilter;\n\tlabel;\n\tconstructor(name, collection, filter) {\n\t\tsuper();\n\t\tthis.name = name;\n\t\tthis.collection = collection;\n\t\tthis.filter = filter;\n\t\tthis.label = `Data transform: ${name}`;\n\t\tthis.freeze();\n\t}\n\tget slot() {\n\t\treturn `${this.name}:update`;\n\t}\n\ttoOp() {\n\t\tconst unfilled = errorUnfilledPlaceholder(this.slot);\n\t\tconst operation = Promise.reject(new CliStructuredError(unfilled.code, unfilled.message, {\n\t\t\t...ifDefined(\"why\", unfilled.why),\n\t\t\t...ifDefined(\"fix\", unfilled.fix),\n\t\t\tmeta: {\n\t\t\t\tslot: this.slot,\n\t\t\t\toperation: {\n\t\t\t\t\tid: `data_transform.${this.name}`,\n\t\t\t\t\tlabel: this.label,\n\t\t\t\t\toperationClass: this.operationClass\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\toperation.catch(() => void 0);\n\t\treturn operation;\n\t}\n\trenderTypeScript() {\n\t\tconst collection = jsonToTsSource(this.collection);\n\t\tconst filter = jsonToTsSource(this.filter);\n\t\treturn [\n\t\t\t`dataTransform(${jsonToTsSource(this.name)}, {`,\n\t\t\t` check: { source: () => rawAggregate(${collection}, [{ $match: ${filter} }, { $limit: 1 }]) },`,\n\t\t\t` run: () => rawUpdateMany(${collection}, ${filter}, placeholder(${jsonToTsSource(this.slot)}), { bypassDocumentValidation: true }),`,\n\t\t\t\"})\"\n\t\t].join(\"\\n\");\n\t}\n\timportRequirements() {\n\t\treturn [\n\t\t\t\"dataTransform\",\n\t\t\t\"rawAggregate\",\n\t\t\t\"rawUpdateMany\",\n\t\t\t\"placeholder\"\n\t\t].map((symbol) => ({\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol\n\t\t}));\n\t}\n};\nvar FillFieldCall = class extends OpFactoryCallNode {\n\tfactoryName = \"fillField\";\n\toperationClass = \"widening\";\n\tcollection;\n\tfield;\n\toptions;\n\tlabel;\n\tconstructor(options) {\n\t\tsuper();\n\t\tthis.collection = options.collection;\n\t\tthis.field = options.field;\n\t\tthis.options = options;\n\t\tthis.label = this.toOp().label;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn fillField(this.options);\n\t}\n\trenderTypeScript() {\n\t\treturn `fillField(${jsonToTsSource(this.options)})`;\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 ?? \"widening\";\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\tname: index.name,\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/mongo-statement-planning.ts\n/** Why the plan does not rewrite the fields of the model at `coordinate`: its documents are embedded in another model's, if they are. */\nfunction embeddedModelReason(contract, coordinate) {\n\tconst owner = embeddingModelOf(contract.domain, coordinate);\n\treturn owner === void 0 ? void 0 : `model \"${modelDisplayName(coordinate)}\" is embedded in the documents of model \"${owner}\"`;\n}\nconst EMBEDDED_MODEL_WHY = \"Fields of an embedded model are not rewritten in this release. Leave out this statement.\";\n/** Why a statement on `model` cannot be planned when no collection holds its documents. */\nfunction noCollectionReason(model) {\n\treturn `model \"${modelDisplayName(model)}\" names no collection, and neither does a base or an owner`;\n}\nfunction modelAt(contract, coordinate) {\n\tconst models = mongoModelsOf(contract.domain, coordinate.namespaceId);\n\treturn Object.hasOwn(models, coordinate.model) ? models[coordinate.model] : void 0;\n}\n/** The stored name of `field` of the model at `coordinate`, or undefined when the model does not declare it. */\nfunction storedFieldNameAt(contract, coordinate) {\n\tconst model = modelAt(contract, coordinate);\n\treturn model === void 0 || !Object.hasOwn(model.fields, coordinate.field) ? void 0 : ownStoredNameOf(model, coordinate.field);\n}\n/** The stored name of a field the statement's resolution found on the model at `coordinate`. */\nfunction resolvedStoredNameAt(contract, coordinate) {\n\tconst storedName = storedFieldNameAt(contract, coordinate);\n\tif (storedName === void 0) throw new InternalError(`Field \"${coordinate.model}.${coordinate.field}\" a statement names has no stored name`);\n\treturn storedName;\n}\nfunction declaredCollection(contract, collection) {\n\treturn Object.values(contract.storage.namespaces).map((namespace) => namespace.entries[\"collection\"]?.[collection]).find((entry) => entry instanceof MongoCollection);\n}\n/**\n* The control policy of `collection`. A collection the contract leaves out keeps the policy `fromContract` gave it, when that was not `managed`, so leaving an `external` collection out of the contract does not drop it.\n*/\nfunction collectionControlOf(contract, fromContract, collection) {\n\tconst declared = declaredCollection(contract, collection);\n\tconst original = declared === void 0 && fromContract !== null ? declaredCollection(fromContract, collection) : void 0;\n\tconst policy = collectionControlPolicyOf(collection, collectionControlPoliciesOf(contract));\n\tif (original === void 0 || fromContract === null) return {\n\t\tpolicy,\n\t\tdeclared: declared?.control\n\t};\n\tconst originalPolicy = governingControlPolicy({ explicitNodeControlPolicy: original.control }, fromContract.defaultControlPolicy);\n\treturn {\n\t\tpolicy: originalPolicy === \"managed\" ? policy : originalPolicy,\n\t\tdeclared: original.control\n\t};\n}\nfunction collectionControlPolicy(contract, collection) {\n\treturn collectionControlOf(contract, null, collection).policy;\n}\n/** Why MongoDB would refuse a collection name, if it would. */\nfunction invalidCollectionNameReason(name) {\n\tif (name === \"\") return \"it is empty\";\n\tif (name.includes(\"$\")) return \"it contains \\\"$\\\"\";\n\tif (name.includes(\"\\0\")) return \"it contains a null character\";\n\tif (name.startsWith(\"system.\")) return \"it starts with \\\"system.\\\", which MongoDB reserves\";\n}\nfunction isEmbedRelation(relation) {\n\treturn !(\"on\" in relation) && !(\"through\" in relation);\n}\nfunction storedField(model, field) {\n\tif (model === void 0) return { kind: \"absent\" };\n\tif (Object.hasOwn(model.fields, field)) return { kind: \"field\" };\n\tconst relation = Object.hasOwn(model.relations, field) ? model.relations[field] : void 0;\n\tif (relation === void 0) return { kind: \"absent\" };\n\treturn isEmbedRelation(relation) ? { kind: \"embed\" } : { kind: \"reference\" };\n}\nfunction refused(statement, label, reason, why) {\n\treturn {\n\t\tkind: \"statementRefused\",\n\t\tsummary: `${label}: ${reason}`,\n\t\twhy,\n\t\trefusedStatement: statement\n\t};\n}\nconst LEAVE_OUT = \"Leave out this statement.\";\n/**\n* Plans the rename each statement states, in order: a model statement whose collection changes renames the\n* collection in the schema the diff then starts from, and a field statement whose stored name\n* changes renames the field in the documents that hold it.\n*/\nfunction planStatements(input) {\n\tlet schema = input.schema;\n\tconst collectionRenames = [];\n\tconst fieldRenames = [];\n\tconst callOfStatement = [];\n\tconst conflicts = [];\n\tconst renamedCollections = /* @__PURE__ */ new Map();\n\tfor (const statement of input.statements) {\n\t\tconst label = `Cannot ${describeMigrationStatement(statement, input.fromContract, input.contract)}`;\n\t\tconst outcome = statement.entity === \"namespace\" ? {\n\t\t\tkind: \"refused\",\n\t\t\tconflict: refused(statement, label, \"MongoDB does not rename namespaces in this release\", LEAVE_OUT)\n\t\t} : statement.entity === \"enumValue\" ? {\n\t\t\tkind: \"refused\",\n\t\t\tconflict: refused(statement, label, \"MongoDB does not rename enum values in this release\", LEAVE_OUT)\n\t\t} : statement.entity === \"valueObjectField\" ? {\n\t\t\tkind: \"refused\",\n\t\t\tconflict: refused(statement, label, \"MongoDB does not rename value object fields in this release\", LEAVE_OUT)\n\t\t} : statement.entity === \"model\" ? planModelStatement(statement, label, schema, input) : planFieldStatement(statement, label, renamedCollections, schema, input);\n\t\tif (outcome.kind === \"refused\") {\n\t\t\tconflicts.push(outcome.conflict);\n\t\t\tcallOfStatement.push(void 0);\n\t\t\tcontinue;\n\t\t}\n\t\tif (outcome.kind === \"renameCollection\") {\n\t\t\tschema = renameInSchema(schema, outcome.call.from, outcome.call.to);\n\t\t\trenamedCollections.set(outcome.call.from, outcome.call.to);\n\t\t\tcollectionRenames.push(outcome.call);\n\t\t}\n\t\tif (outcome.kind === \"renameField\") {\n\t\t\tconst same = fieldRenames.find((call) => sameFieldRename(call, outcome.call));\n\t\t\tif (same !== void 0) {\n\t\t\t\tcallOfStatement.push(same);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfieldRenames.push(outcome.call);\n\t\t}\n\t\tcallOfStatement.push(outcome.kind === \"unchanged\" ? void 0 : outcome.call);\n\t}\n\treturn conflicts.length > 0 ? notOk(conflicts) : ok({\n\t\tschema,\n\t\tcollectionRenames,\n\t\tfieldRenames,\n\t\tcallOfStatement\n\t});\n}\n/** Whether two field renames rewrite the same documents the same way, as when every root model of a shared collection renames a field together. */\nfunction sameFieldRename(a, b) {\n\treturn a.collection === b.collection && a.from === b.from && a.to === b.to && JSON.stringify(a.filter) === JSON.stringify(b.filter);\n}\nfunction renameInSchema(schema, from, to) {\n\treturn new MongoSchemaIR(schema.collections.map((collection) => collection.name === from ? new MongoSchemaCollection({\n\t\tname: to,\n\t\tindexes: collection.indexes,\n\t\t...collection.validator === void 0 ? {} : { validator: collection.validator },\n\t\t...collection.options === void 0 ? {} : { options: collection.options }\n\t}) : collection), { fromDatabase: schema.fromDatabase });\n}\nfunction controlPolicyRefusal(statement, label, contract, collection) {\n\tconst policy = collectionControlPolicy(contract, collection);\n\tif (policy === \"managed\") return void 0;\n\treturn {\n\t\tkind: \"refused\",\n\t\tconflict: refused(statement, label, `collection \"${collection}\" has control policy \"${policy}\"`, `Statements rename only collections, and fields of collections, whose control policy is \"managed\". Make the change in the database yourself and leave out this statement.`)\n\t};\n}\n/**\n* The reason and advice when a statement renames a variant whose discriminator value changes: its\n* documents keep the old value, which the new validator does not accept.\n*/\nfunction discriminatorValueChange(statement, input) {\n\tconst before = variantFilterOf(input.fromContract.domain, statement.from);\n\tconst after = variantFilterOf(input.contract.domain, statement.to);\n\tconst base = modelAt(input.contract, statement.to)?.base;\n\tif (before === void 0 || after === void 0 || base === void 0) return void 0;\n\tconst [field, oldValue] = Object.entries(before)[0] ?? [];\n\tconst newValue = Object.values(after)[0];\n\tif (field === void 0 || oldValue === newValue) return void 0;\n\tconst fromName = modelDisplayName(statement.from);\n\tconst toName = modelDisplayName(statement.to);\n\treturn [`its discriminator value changes from ${JSON.stringify(oldValue)} to ${JSON.stringify(newValue)}`, `The documents of \"${fromName}\" hold ${field} ${JSON.stringify(oldValue)}, and this release does not rewrite a discriminator value, so they would no longer match \"${toName}\" and would fail validation. Keep the value: declare \"${toName}\" with @@base(${base.model}, ${JSON.stringify(oldValue)}). A later release changes a stored value with --convert.`];\n}\nfunction planModelStatement(statement, label, schema, input) {\n\tconst embedded = embeddedModelReason(input.fromContract, statement.from) ?? embeddedModelReason(input.contract, statement.to);\n\tif (embedded !== void 0) return {\n\t\tkind: \"refused\",\n\t\tconflict: refused(statement, label, embedded, `Embedded models are not renamed in this release. ${LEAVE_OUT}`)\n\t};\n\tconst discriminatorChange = discriminatorValueChange(statement, input);\n\tif (discriminatorChange !== void 0) return {\n\t\tkind: \"refused\",\n\t\tconflict: refused(statement, label, ...discriminatorChange)\n\t};\n\tconst from = collectionOfModel(input.fromContract.domain, statement.from);\n\tconst to = collectionOfModel(input.contract.domain, statement.to);\n\tif (from === void 0 || to === void 0) return {\n\t\tkind: \"refused\",\n\t\tconflict: refused(statement, label, noCollectionReason(from === void 0 ? statement.from : statement.to), `A statement renames the documents of a model in its collection. Give the model a collection, then run this command again, or ${LEAVE_OUT.toLowerCase()}`)\n\t};\n\tif (from === to) return { kind: \"unchanged\" };\n\tconst policyRefusal = controlPolicyRefusal(statement, label, input.contract, to);\n\tif (policyRefusal !== void 0) return policyRefusal;\n\tconst refuse = (reason, why) => ({\n\t\tkind: \"refused\",\n\t\tconflict: refused(statement, label, reason, why)\n\t});\n\tconst source = schema.collection(from);\n\tif (source === void 0) return refuse(`the schema being planned from has no collection \"${from}\"`, `The database has no collection \"${from}\", or \"${from}\" is a view, which MongoDB cannot rename. Inspect it with prisma db schema, or ${LEAVE_OUT.toLowerCase()}`);\n\tif (source.options?.timeseries !== void 0) return refuse(`collection \"${from}\" is a time-series collection`, `MongoDB cannot rename a time-series collection. Leave out this statement. To keep the documents, first create collection \"${to}\" yourself with the same time-series options and copy them into it; the plan then drops \"${from}\" once --delete names the model.`);\n\tconst invalid = invalidCollectionNameReason(to);\n\tif (invalid !== void 0) return refuse(`MongoDB does not accept the collection name \"${to}\": ${invalid}`, \"Give the model a collection name MongoDB accepts with @@map, then run this command again.\");\n\tif (schema.collection(to) !== void 0) return refuse(`the schema being planned from already has a collection \"${to}\"`, `A rename cannot replace a collection that already exists. Rename or drop collection \"${to}\" first, or ${LEAVE_OUT.toLowerCase()}`);\n\treturn {\n\t\tkind: \"renameCollection\",\n\t\tcall: new RenameCollectionCall(from, to)\n\t};\n}\nfunction planFieldStatement(statement, label, renamedCollections, schema, input) {\n\tconst refuse = (reason, why) => ({\n\t\tkind: \"refused\",\n\t\tconflict: refused(statement, label, reason, why)\n\t});\n\tconst embedded = embeddedModelReason(input.fromContract, statement.from) ?? embeddedModelReason(input.contract, statement.to);\n\tif (embedded !== void 0) return refuse(embedded, EMBEDDED_MODEL_WHY);\n\tconst fromField = storedField(modelAt(input.fromContract, statement.from), statement.from.field);\n\tconst toField = storedField(modelAt(input.contract, statement.to), statement.to.field);\n\tif (fromField.kind === \"embed\" || toField.kind === \"embed\") return refuse(\"the field is an embedded relation\", `Renaming an embedded relation is not supported in this release. ${LEAVE_OUT}`);\n\tif (fromField.kind !== \"field\" && toField.kind !== \"field\") return { kind: \"unchanged\" };\n\tif (fromField.kind !== \"field\" || toField.kind !== \"field\") return refuse(\"the field is stored in documents on one side of the statement only\", `A relation is not stored in documents, so a statement cannot rename a field to or from one. ${LEAVE_OUT}`);\n\tconst fromStored = resolvedStoredNameAt(input.fromContract, statement.from);\n\tconst toStored = resolvedStoredNameAt(input.contract, statement.to);\n\tconst originCollection = collectionOfModel(input.fromContract.domain, statement.from);\n\tconst destinationCollection = collectionOfModel(input.contract.domain, statement.to);\n\tif (originCollection === void 0 || destinationCollection === void 0) return refuse(noCollectionReason(originCollection === void 0 ? statement.from : statement.to), `A statement renames a field in the documents of its model's collection. ${LEAVE_OUT}`);\n\tconst collection = renamedCollections.get(originCollection) ?? originCollection;\n\tif (fromStored === toStored && collection === destinationCollection) return { kind: \"unchanged\" };\n\tif (fromStored === \"_id\" || toStored === \"_id\") return refuse(\"it renames _id\", `MongoDB does not let a document change its _id. ${LEAVE_OUT}`);\n\tconst unsafeFrom = unrewritableFieldNameReason(fromStored);\n\tif (unsafeFrom !== void 0) return refuse(`the stored name \"${fromStored}\" cannot be rewritten`, `${unsafeFrom}, so a statement cannot move its values. Rename it in the database yourself, or ${LEAVE_OUT.toLowerCase()}`);\n\tconst unsafeTo = unrewritableFieldNameReason(toStored);\n\tif (unsafeTo !== void 0) return refuse(`the stored name \"${toStored}\" cannot be written`, `${unsafeTo}. Give the field a stored name without \".\" that does not start with \"$\" (with @map), or ${LEAVE_OUT.toLowerCase()}`);\n\tif (collection !== destinationCollection) return refuse(`the model's collection changes from \"${originCollection}\" to \"${destinationCollection}\", and no statement renames it`, collectionChangeAdvice(statement, originCollection, destinationCollection));\n\tif (schema.collection(collection)?.options?.timeseries !== void 0) return refuse(`collection \"${collection}\" is a time-series collection`, `${TIME_SERIES_UPDATES}, so a statement cannot move the values of a field in them. Keep the stored name: store the field as ${JSON.stringify(fromStored)} (with @map(${JSON.stringify(fromStored)}) in PSL), then run this command again without this statement.`);\n\tconst policyRefusal = controlPolicyRefusal(statement, label, input.contract, collection);\n\tif (policyRefusal !== void 0) return policyRefusal;\n\tconst variant = variantFilterOf(input.fromContract.domain, statement.from);\n\tconst renamedTogether = new Set(input.statements.flatMap((other) => other.entity === \"field\" && other.from.namespaceId === statement.from.namespaceId && storedFieldNameAt(input.fromContract, other.from) === fromStored && storedFieldNameAt(input.contract, other.to) === toStored ? [other.from.model] : []));\n\tconst others = otherModelsReached(input.fromContract.domain, statement.from, originCollection, variant, fromStored).filter((name) => !renamedTogether.has(name));\n\tif (others.length > 0) return refuse(`model ${others.map((name) => JSON.stringify(name)).join(\", \")} stores field ${JSON.stringify(fromStored)} in the same collection, ${JSON.stringify(collection)}`, `${sharedCollectionWhy(collection, others, \"renaming the field would rename it in the documents\")} To change it, ${SEPARATE_THE_MODELS}.`);\n\treturn {\n\t\tkind: \"renameField\",\n\t\tcall: new RenameFieldCall(collection, fromStored, toStored, variant ?? rootDocumentsLosing(input.contract, statement.to, fromStored)?.filter)\n\t};\n}\nfunction collectionChangeAdvice(statement, from, to) {\n\tif (!sameModel(statement.from, statement.to)) return `Add --rename ${modelDisplayName(statement.from)}:${modelDisplayName(statement.to)} before this statement, so the collection is renamed with its documents.`;\n\treturn `A statement cannot rename the collection of a model that keeps its name. Rename the collection in a step of its own first: change only @@map and emit the contract. ${renameCollectionByHandSteps(statement.from, from, to)} Then change the field and run this statement again.`;\n}\nfunction renameCollectionByHandSteps(model, from, to) {\n\treturn `With db update, rename the collection in the database yourself, for example db.getCollection(${JSON.stringify(from)}).renameCollection(${JSON.stringify(to)}) in mongosh, then run db update. With migration plan, plan it, passing --delete ${modelDisplayName(model)} to answer its question; in its migration.ts make renameCollection(${JSON.stringify(from)}, ${JSON.stringify(to)}) the first operation, imported with the other operations, delete the drop of \"${from}\", and delete the create of \"${to}\" if there is one; run node on that migration.ts so it writes ops.json again; then apply it with prisma db migrate.`;\n}\n/**\n* How to keep the documents of a model that keeps its name while its collection changes from\n* `from` to `to`: no statement can rename that collection, so the user renames it by hand.\n*/\nfunction keepCollectionByHandAdvice(model, from, to) {\n\treturn `To keep its documents, rename collection \"${from}\" to \"${to}\" instead; a statement cannot rename the collection of a model that keeps its name. ${renameCollectionByHandSteps(model, from, to)}`;\n}\nfunction modelCoordinates(contract) {\n\treturn Object.entries(contract.domain?.namespaces ?? {}).flatMap(([namespaceId, namespace]) => Object.keys(namespace.models).map((model) => ({\n\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\tmodel\n\t})));\n}\nfunction sameModel(a, b) {\n\treturn a.namespaceId === b.namespaceId && a.model === b.model;\n}\n/**\n* The destination model an origin model became: the one a statement renamed it to, else the one of\n* the same name, else the only one stored the same way (same collection, same variant value).\n*/\nfunction destinationModelOf(origin, input) {\n\tconst renamed = input.statements.find((statement) => statement.entity === \"model\" && sameModel(statement.from, origin));\n\tif (renamed !== void 0) return renamed.to;\n\tif (modelAt(input.contract, origin) !== void 0) return origin;\n\tif (embeddingModelOf(input.fromContract.domain, origin) !== void 0) return void 0;\n\tconst originCollection = collectionOfModel(input.fromContract.domain, origin);\n\tif (originCollection === void 0) return void 0;\n\tconst collection = input.collectionAfterRenames(originCollection);\n\tconst filter = JSON.stringify(variantFilterOf(input.fromContract.domain, origin) ?? null);\n\tconst stored = modelCoordinates(input.contract).filter((candidate) => embeddingModelOf(input.contract.domain, candidate) === void 0 && collectionOfModel(input.contract.domain, candidate) === collection && JSON.stringify(variantFilterOf(input.contract.domain, candidate) ?? null) === filter);\n\tconst [only] = stored;\n\treturn stored.length === 1 ? only : void 0;\n}\n/** The origin model a destination model was, by the rules of `destinationModelOf`, read the other way. */\nfunction originModelOf(destination, input) {\n\treturn modelCoordinates(input.fromContract).find((origin) => {\n\t\tconst matched = destinationModelOf(origin, input);\n\t\treturn matched !== void 0 && sameModel(matched, destination);\n\t});\n}\nfunction sameField$1(a, b) {\n\treturn sameModel(a, b) && a.field === b.field;\n}\n/** The name a field of the origin has in the destination: its rename statement's new name, else its own. */\nfunction destinationFieldOf(origin, statements) {\n\treturn statements.find((statement) => statement.entity === \"field\" && sameField$1(statement.from, origin))?.to.field ?? origin.field;\n}\n/** The name a field of the destination had in the origin: its rename statement's old name, else its own. */\nfunction originFieldOf(destination, statements) {\n\treturn statements.find((statement) => statement.entity === \"field\" && sameField$1(statement.to, destination))?.from.field ?? destination.field;\n}\nfunction renamedByStatement(input, field) {\n\treturn input.statements.some((statement) => statement.entity === \"field\" && sameModel(statement.from, field) && statement.from.field === field.field);\n}\n/** Whether one of `model`'s own fields or embed relations is stored under `storedName`. */\nfunction ownStores(model, storedName) {\n\treturn hasOwnFieldStoredAs(model, storedName) || Object.values(ownEmbedStoredNamesOf(model)).includes(storedName);\n}\n/** The stored names of the documents of the model at `coordinate`: its fields and embed relations, its own and those it inherits. */\nfunction storedFieldsOf(contract, coordinate) {\n\tconst models = mongoModelsOf(contract.domain, coordinate.namespaceId);\n\treturn new Set(modelAndBasesOf(models, coordinate.model).flatMap((model) => [...Object.values(ownStoredNamesOf(model)), ...Object.values(ownEmbedStoredNamesOf(model))]));\n}\n/**\n* The documents of a root model that lose `field`: all of them, or, when some of its destination\n* variants now store the field themselves, those whose discriminator value is none of theirs.\n* `undefined` when the root model itself still stores it.\n*/\nfunction rootDocumentsLosing(contract, root, storedName) {\n\tconst model = modelAt(contract, root);\n\tif (model === void 0 || ownStores(model, storedName)) return void 0;\n\tconst discriminator = model.discriminator?.field;\n\tconst keeping = Object.entries(model.variants ?? {}).filter(([, variant]) => {\n\t\tconst variantModel = modelAt(contract, {\n\t\t\tnamespaceId: variant.namespace,\n\t\t\tmodel: variant.model\n\t\t});\n\t\treturn variantModel !== void 0 && ownStores(variantModel, storedName);\n\t}).map(([value]) => value).sort();\n\tif (discriminator === void 0 || keeping.length === 0) return { filter: void 0 };\n\treturn { filter: { [ownStoredNameOf(model, discriminator)]: { $nin: keeping } } };\n}\n/**\n* Each field an origin model stores that its destination model no longer stores, in a collection\n* the plan keeps: removing it is data loss, carried out by unsetting it from the documents that\n* hold it, in a collection whose control policy is `managed`. A variant's field is unset only from that variant's documents, unless its destination\n* base now stores it. A base field is unset from the documents of every variant that does not now\n* store it itself.\n*/\nfunction planFieldRemovals(input) {\n\treturn modelCoordinates(input.fromContract).flatMap((origin) => {\n\t\tif (embeddingModelOf(input.fromContract.domain, origin) !== void 0) return [];\n\t\tconst originCollection = collectionOfModel(input.fromContract.domain, origin);\n\t\tif (originCollection === void 0) return [];\n\t\tconst collection = input.collectionAfterRenames(originCollection);\n\t\tif (!input.keptCollections.has(collection)) return [];\n\t\tif (collectionControlPolicy(input.contract, collection) !== \"managed\") return [];\n\t\tconst destination = destinationModelOf(origin, input);\n\t\tif (destination === void 0) return [];\n\t\tconst model = modelAt(input.fromContract, origin);\n\t\tif (model === void 0) return [];\n\t\tconst variant = variantFilterOf(input.fromContract.domain, origin);\n\t\tconst losing = (storedName) => {\n\t\t\tif (variant !== void 0) return storedFieldsOf(input.contract, destination).has(storedName) ? void 0 : { filter: variant };\n\t\t\treturn rootDocumentsLosing(input.contract, destination, storedName);\n\t\t};\n\t\treturn Object.entries(ownStoredNamesOf(model)).filter(([field, storedName]) => unrewritableFieldNameReason(storedName) === void 0 && !renamedByStatement(input, {\n\t\t\t...origin,\n\t\t\tfield\n\t\t})).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).flatMap(([field, storedName]) => {\n\t\t\tconst lost = losing(storedName);\n\t\t\treturn lost === void 0 ? [] : [{\n\t\t\t\tcall: new UnsetFieldCall(collection, storedName, lost.filter),\n\t\t\t\tsubject: {\n\t\t\t\t\tkind: \"field\",\n\t\t\t\t\t...origin,\n\t\t\t\t\tfield\n\t\t\t\t}\n\t\t\t}];\n\t\t});\n\t});\n}\n/**\n* Without an origin contract, a field is known removed when the origin validator declares it for a\n* root model and the destination validator declares it nowhere. It is named by its storage name.\n*/\nfunction planValidatorFieldRemovals(input) {\n\treturn input.origin.collections.flatMap((originCollection) => {\n\t\tif (collectionControlPolicy(input.contract, originCollection.name) !== \"managed\") return [];\n\t\tconst destination = input.destination.collection(originCollection.name);\n\t\tif (destination?.validator === void 0 || originCollection.validator === void 0) return [];\n\t\tconst kept = validatorFieldNamesOf(destination.validator.jsonSchema);\n\t\treturn [...new Set(validatorRootShapesOf(originCollection.validator.jsonSchema).flatMap((root) => Object.keys(root.properties)))].filter((field) => unrewritableFieldNameReason(field) === void 0 && !kept.has(field)).sort().map((field) => ({\n\t\t\tcall: new UnsetFieldCall(originCollection.name, field),\n\t\t\tsubject: {\n\t\t\t\tkind: \"storage\",\n\t\t\t\tname: `${originCollection.name}.${field}`\n\t\t\t}\n\t\t}));\n\t});\n}\n//#endregion\n//#region src/core/migrations/mongo-data-transforms.ts\nfunction refuse(statement, reason, why, contracts) {\n\treturn {\n\t\tkind: \"refused\",\n\t\tconflict: {\n\t\t\tkind: \"statementRefused\",\n\t\t\tsummary: `Cannot ${describeMigrationStatement(statement, contracts.fromContract, contracts.contract)}: ${reason}`,\n\t\t\twhy,\n\t\t\trefusedStatement: statement\n\t\t}\n\t};\n}\nfunction withFilter(filter, condition) {\n\treturn filter === void 0 ? condition : { $and: [filter, condition] };\n}\n/** Why the plan cannot rewrite a field of the destination contract, if it cannot. */\nfunction unrewritableReason(contract, field) {\n\tconst model = modelAt(contract, field);\n\tif (model === void 0 || !Object.hasOwn(model.fields, field.field)) return void 0;\n\tconst collection = collectionOfModel(contract.domain, field);\n\tif (collection === void 0) return noCollectionReason(field);\n\tconst storedName = ownStoredNameOf(model, field.field);\n\tconst nameReason = unrewritableFieldNameReason(storedName);\n\tif (nameReason !== void 0) return `its stored name ${JSON.stringify(storedName)} cannot be rewritten: ${nameReason}`;\n\tconst policy = collectionControlPolicy(contract, collection);\n\treturn policy === \"managed\" ? void 0 : `collection ${JSON.stringify(collection)} has control policy ${JSON.stringify(policy)}`;\n}\n/**\n* The data transform of `--convert`: its check and its run select the documents whose field holds\n* a type the new field does not allow, and the user writes the update.\n*/\nfunction convertTransform(statement, change, contracts) {\n\tconst embedded = embeddedModelReason(contracts.contract, statement.field);\n\tif (embedded !== void 0) return refuse(statement, embedded, EMBEDDED_MODEL_WHY, contracts);\n\tconst unrewritable = unrewritableReason(contracts.contract, statement.field);\n\tif (unrewritable !== void 0) return refuse(statement, unrewritable, \"Leave out this statement.\", contracts);\n\tif (change === void 0) return refuse(statement, \"its type does not change\", \"Leave out this statement.\", contracts);\n\tconst notOfType = documentsNotOfType(change.field, {\n\t\ttypes: change.to.list && !change.from.list ? [\"array\"] : change.to.types,\n\t\tlist: change.to.list && change.from.list\n\t});\n\treturn {\n\t\tkind: \"transform\",\n\t\tcall: new DataTransformCall(fieldStatementText(contracts.contract, statement.field), change.collection, withFilter(change.filter, notOfType)),\n\t\trewrite: {\n\t\t\tkind: \"conversion\",\n\t\t\tcollection: change.collection,\n\t\t\tfield: change.field,\n\t\t\tfilter: change.filter,\n\t\t\tmodel: change.destination\n\t\t}\n\t};\n}\n/** Whether the origin already had the field and made it required. */\nfunction requiredInOrigin(input, collection, field, storedName) {\n\tif (input.match === void 0) {\n\t\tconst declaring = validatorDocumentShapesOf(input.schema.collection(collection)?.validator?.jsonSchema).filter((shape) => Object.hasOwn(shape.properties, storedName));\n\t\treturn declaring.length > 0 && declaring.every((shape) => shape.required.includes(storedName));\n\t}\n\tconst origin = originModelOf(field, input.match);\n\tconst model = origin === void 0 ? void 0 : modelAt(input.match.fromContract, origin);\n\tconst originField = originFieldOf(field, input.match.statements);\n\treturn model !== void 0 && Object.hasOwn(model.fields, originField) ? model.fields[originField]?.nullable === false : false;\n}\n/**\n* The data transform of `--backfill`: a required field that is new on an existing collection, or\n* was optional. Its check and its run select the documents where the field is missing or `null`,\n* and the user writes the update.\n*/\nfunction backfillTransform(statement, input) {\n\tconst contracts = {\n\t\tfromContract: input.match?.fromContract ?? input.contract,\n\t\tcontract: input.contract\n\t};\n\tconst model = modelAt(input.contract, statement.field);\n\tconst definition = model?.fields[statement.field.field];\n\tif (model === void 0 || definition === void 0) return refuse(statement, \"the destination has no such field\", \"Leave out this statement.\", contracts);\n\tif (definition.nullable) return refuse(statement, \"it is optional\", \"Only a required field needs a value in every document. Leave out this statement.\", contracts);\n\tconst embedded = embeddedModelReason(input.contract, statement.field);\n\tif (embedded !== void 0) return refuse(statement, embedded, EMBEDDED_MODEL_WHY, contracts);\n\tconst unrewritable = unrewritableReason(input.contract, statement.field);\n\tif (unrewritable !== void 0) return refuse(statement, unrewritable, \"Leave out this statement.\", contracts);\n\tconst collection = collectionOfModel(input.contract.domain, statement.field);\n\tif (collection === void 0) return refuse(statement, noCollectionReason(statement.field), \"Leave out this statement.\", contracts);\n\tif (input.schema.collection(collection) === void 0) return refuse(statement, `collection \"${collection}\" is new, so it has no documents to fill`, \"Leave out this statement.\", contracts);\n\tconst storedName = ownStoredNameOf(model, statement.field.field);\n\tif (requiredInOrigin(input, collection, statement.field, storedName)) return refuse(statement, \"it was already required\", \"Every document already has a value for it. Leave out this statement.\", contracts);\n\tconst variant = variantFilterOf(input.contract.domain, statement.field);\n\treturn {\n\t\tkind: \"transform\",\n\t\tcall: new DataTransformCall(fieldStatementText(input.contract, statement.field), collection, withFilter(variant, documentsMissingOrNull(storedName))),\n\t\trewrite: {\n\t\t\tkind: \"backfill\",\n\t\t\tcollection,\n\t\t\tfield: storedName,\n\t\t\tfilter: variant,\n\t\t\tmodel: statement.field\n\t\t}\n\t};\n}\n//#endregion\n//#region src/core/migrations/mongo-documents-not-rewritten.ts\nconst NOT_A_STATEMENT = \"No statement (--rename, --delete, --convert, --backfill) covers this change, so the plan does not rewrite the documents. Write a dataTransform in migration.ts, before the validator change, that rewrites them to fit; until they fit, the validator change checks the documents and fails the apply. With db update, plan the change with migration plan instead.\";\nfunction warning(summary) {\n\treturn {\n\t\tkind: \"documentsNotRewritten\",\n\t\tsummary,\n\t\twhy: NOT_A_STATEMENT\n\t};\n}\nfunction typeKey(field) {\n\tconst { type } = field;\n\tconst many = field.many !== void 0 && field.many !== false;\n\tif (type.kind === \"scalar\") return JSON.stringify([\n\t\t\"scalar\",\n\t\ttype.codecId,\n\t\tmany\n\t]);\n\tif (type.kind === \"valueObject\") return JSON.stringify([\n\t\t\"valueObject\",\n\t\ttype.namespaceId,\n\t\ttype.entityName,\n\t\tmany\n\t]);\n\treturn JSON.stringify([\"union\", many]);\n}\nfunction valueSetName(field) {\n\treturn field.valueSet?.entityName;\n}\nfunction valueObjectName(field) {\n\treturn field.type.kind === \"valueObject\" ? field.type.entityName : void 0;\n}\n/** What changes for a field kept by both contracts that the plan does not rewrite, in words. */\nfunction untouchedChange(name, before, after) {\n\tconst enumBefore = valueSetName(before);\n\tconst enumAfter = valueSetName(after);\n\tif (enumAfter !== void 0 && enumBefore === void 0) return `Field \"${name}\" gains enum \"${enumAfter}\"`;\n\tif (enumAfter !== void 0 && enumBefore !== void 0 && enumAfter !== enumBefore) return `Field \"${name}\" changes from enum \"${enumBefore}\" to enum \"${enumAfter}\"`;\n\tconst objectBefore = valueObjectName(before);\n\tconst objectAfter = valueObjectName(after);\n\tif (objectBefore !== void 0 && objectAfter !== void 0 && objectBefore !== objectAfter) return `Field \"${name}\" moves from value object \"${objectBefore}\" to value object \"${objectAfter}\"`;\n\tif (objectBefore === void 0 && objectAfter !== void 0 && before.type.kind === \"scalar\") return `Field \"${name}\" changes from a scalar to value object \"${objectAfter}\"`;\n\tif (objectBefore !== void 0 && objectAfter === void 0 && after.type.kind === \"scalar\") return `Field \"${name}\" changes from value object \"${objectBefore}\" to a scalar`;\n}\n/**\n* What changes for each field of an embedded model, whose documents the plan does not rewrite: a\n* field removed, a field whose type changes, and a required field that is new or was optional.\n*/\nfunction embeddedModelChanges(fieldName, model, before, after) {\n\tconst named = (field) => `Field \"${fieldName(field)}\" of embedded model \"${model}\"`;\n\tconst kept = Object.entries(after.fields).flatMap(([field, definition]) => {\n\t\tconst previous = Object.hasOwn(before.fields, field) ? before.fields[field] : void 0;\n\t\tif (previous === void 0) return definition.nullable ? [] : [`${named(field)} is new and required`];\n\t\tif (typeKey(previous) !== typeKey(definition)) return [`${named(field)} changes type`];\n\t\treturn previous.nullable && !definition.nullable ? [`${named(field)} becomes required`] : [];\n\t});\n\tconst removed = Object.keys(before.fields).filter((field) => !Object.hasOwn(after.fields, field)).map((field) => `${named(field)} is removed`);\n\treturn [...kept, ...removed];\n}\n/**\n* The changes the plan does not rewrite the documents for, and that are not statements: a change to\n* a field of an embedded model, a field of a value object whose type changes, a field that moves to\n* another value object or between a scalar and a value object, and a field that gains an enum or\n* changes enum. Each is a warning that names the field; the validator change's document check then\n* fails the apply until the documents fit.\n*/\nfunction documentsNotRewrittenWarnings(input) {\n\tconst modelFields = modelCoordinates(input.contract).flatMap((model) => {\n\t\tconst after = modelAt(input.contract, model);\n\t\tconst origin = originModelOf(model, input);\n\t\tconst before = origin === void 0 ? void 0 : modelAt(input.fromContract, origin);\n\t\tif (after === void 0 || before === void 0) return [];\n\t\tif (embeddedModelReason(input.contract, model) !== void 0) {\n\t\t\tconst fieldName = (field) => fieldStatementText(input.contract, {\n\t\t\t\t...model,\n\t\t\t\tfield\n\t\t\t});\n\t\t\treturn embeddedModelChanges(fieldName, model.model, before, after).map(warning);\n\t\t}\n\t\treturn Object.entries(after.fields).flatMap(([field, definition]) => {\n\t\t\tconst originField = originFieldOf({\n\t\t\t\t...model,\n\t\t\t\tfield\n\t\t\t}, input.statements);\n\t\t\tif (!Object.hasOwn(before.fields, originField)) return [];\n\t\t\tconst previous = before.fields[originField];\n\t\t\tconst change = previous === void 0 ? void 0 : untouchedChange(fieldStatementText(input.contract, {\n\t\t\t\t...model,\n\t\t\t\tfield\n\t\t\t}), previous, definition);\n\t\t\treturn change === void 0 ? [] : [warning(change)];\n\t\t});\n\t});\n\tconst valueObjectFields = valueObjectsWithCoordinates(input.contract.storage).flatMap(({ coordinate, valueObject }) => {\n\t\tconst before = valueObjectAt(input.fromContract.storage, coordinate);\n\t\tif (before === void 0) return [];\n\t\treturn Object.entries(valueObject.fields).flatMap(([field, definition]) => {\n\t\t\tconst previous = Object.hasOwn(before.fields, field) ? before.fields[field] : void 0;\n\t\t\tif (previous === void 0) return [];\n\t\t\tconst name = `${coordinate.entityName}.${field}`;\n\t\t\tconst change = untouchedChange(name, previous, definition) ?? (typeKey(previous) === typeKey(definition) ? void 0 : `Field \"${name}\" of a value object changes type`);\n\t\t\treturn change === void 0 ? [] : [warning(change)];\n\t\t});\n\t});\n\treturn [...modelFields, ...valueObjectFields];\n}\n//#endregion\n//#region src/core/migrations/mongo-field-fills.ts\nconst EMPTY_LIST = {\n\texpression: [],\n\ttext: \"[]\"\n};\nfunction temporaryValueOf(field, lookups) {\n\tif (field.many !== void 0 && field.many !== false) return EMPTY_LIST;\n\tif (field.type.kind !== \"scalar\" || field.valueSet !== void 0 || field.dict === true) return;\n\treturn temporaryValueOfCodec(field.type.codecId, lookups);\n}\nfunction backfilled(statements, field) {\n\treturn statements.some((statement) => statement.kind === \"backfill\" && statement.entity === \"field\" && statement.field.namespaceId === field.namespaceId && statement.field.model === field.model && statement.field.field === field.field);\n}\n/** Whether the origin stored the field: in the origin model, or, without an origin contract, in the origin validator. */\nfunction inOrigin(input, field, collection, storedName) {\n\tif (input.match === void 0) {\n\t\tconst validator = input.schema.collection(collection)?.validator;\n\t\treturn validator === void 0 || validatorFieldNamesOf(validator.jsonSchema).has(storedName);\n\t}\n\tconst origin = originModelOf(field, input.match);\n\tconst model = origin === void 0 ? void 0 : modelAt(input.match.fromContract, origin);\n\treturn origin === void 0 || model === void 0 || Object.hasOwn(model.fields, originFieldOf(field, input.match.statements)) || storedFieldsOf(input.match.fromContract, origin).has(storedName);\n}\n/** Whether a unique index covers the field, so that one value in every document would break it. */\nfunction underUniqueIndex(destination, collection, storedName) {\n\treturn (destination.collection(collection)?.indexes ?? []).some((index) => index.unique && index.keys.some((key) => key.field === storedName));\n}\n/**\n* Each required field of the destination that is new on a collection the plan keeps, with the\n* temporary value its type declares, unless a `--backfill` statement names it. A field whose type\n* declares none, or that a unique index covers, is left to the validator change's document check.\n*/\nfunction planFieldFills(input) {\n\treturn modelCoordinates(input.contract).flatMap((model) => {\n\t\tconst definition = modelAt(input.contract, model);\n\t\tconst collection = collectionOfModel(input.contract.domain, model);\n\t\tif (definition === void 0 || collection === void 0 || embeddedModelReason(input.contract, model) !== void 0) return [];\n\t\tif (input.schema.collection(collection) === void 0) return [];\n\t\tif (collectionControlPolicy(input.contract, collection) !== \"managed\") return [];\n\t\treturn Object.entries(definition.fields).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).flatMap(([field, contractField]) => {\n\t\t\tconst coordinate = {\n\t\t\t\t...model,\n\t\t\t\tfield\n\t\t\t};\n\t\t\tconst storedName = ownStoredNameOf(definition, field);\n\t\t\tif (contractField.nullable || unrewritableFieldNameReason(storedName) !== void 0) return [];\n\t\t\tif (backfilled(input.statements, coordinate)) return [];\n\t\t\tif (inOrigin(input, coordinate, collection, storedName)) return [];\n\t\t\tif (underUniqueIndex(input.destination, collection, storedName)) return [];\n\t\t\tconst value = temporaryValueOf(contractField, input.lookups);\n\t\t\tif (value === void 0) return [];\n\t\t\tconst filter = variantFilterOf(input.contract.domain, model);\n\t\t\treturn [{\n\t\t\t\tcall: new FillFieldCall({\n\t\t\t\t\tcollection,\n\t\t\t\t\tfield: storedName,\n\t\t\t\t\tvalue: value.expression,\n\t\t\t\t\t...filter === void 0 ? {} : { filter }\n\t\t\t\t}),\n\t\t\t\tsubject: {\n\t\t\t\t\tkind: \"field\",\n\t\t\t\t\t...coordinate\n\t\t\t\t},\n\t\t\t\ttext: value.text\n\t\t\t}];\n\t\t});\n\t});\n}\n//#endregion\n//#region src/core/migrations/mongo-type-changes.ts\nfunction withoutNull(types) {\n\treturn types.filter((type) => type !== \"null\");\n}\nfunction fieldShapeOf(field, lookups) {\n\tif (field?.type.kind !== \"scalar\" || field.dict === true) return void 0;\n\tconst types = bsonTypesOfCodec(field.type.codecId, lookups);\n\treturn types === void 0 ? void 0 : {\n\t\ttypes: withoutNull(types),\n\t\tlist: field.many !== void 0 && field.many !== false\n\t};\n}\nfunction isRecord$1(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction bsonTypesOf(schema) {\n\treturn withoutNull(propertyBsonTypesOf(schema));\n}\nfunction isObjectSchema(schema) {\n\treturn [\n\t\t\"properties\",\n\t\t\"oneOf\",\n\t\t\"anyOf\"\n\t].some((keyword) => Object.hasOwn(schema, keyword));\n}\n/** The shape a validator's property schema gives a field; `undefined` for an object, whose fields are not compared here. */\nfunction propertyShapeOf(schema) {\n\tif (!isRecord$1(schema) || isObjectSchema(schema)) return void 0;\n\tconst types = bsonTypesOf(schema);\n\tconst items = schema[\"items\"];\n\tif (types.length === 1 && types[0] === \"array\" && isRecord$1(items)) return isObjectSchema(items) ? void 0 : {\n\t\ttypes: bsonTypesOf(items),\n\t\tlist: true\n\t};\n\treturn {\n\t\ttypes,\n\t\tlist: false\n\t};\n}\n/** Whether a field of shape `to` takes every value a field of shape `from` holds. */\nfunction takesEveryValue(from, to) {\n\tif (to.types.length === 0 && !to.list) return true;\n\tif (from.list !== to.list) return false;\n\tif (to.types.length === 0) return true;\n\treturn from.types.length > 0 && from.types.every((type) => to.types.includes(type));\n}\nfunction castOptions(from, to) {\n\tconst [target, ...others] = to.types;\n\tif (from.types.length === 0) return void 0;\n\tif (from.list !== to.list || target === void 0 || others.length > 0) return void 0;\n\tif (!isConvertTarget(target) || !from.types.every((type) => castsFrom(type, target))) return;\n\treturn {\n\t\tfrom: from.types,\n\t\tto: target,\n\t\t...to.list ? { list: true } : {}\n\t};\n}\nfunction typeChange(input) {\n\treturn {\n\t\t...input,\n\t\tcast: castOptions(input.from, input.to)\n\t};\n}\n/** The `castField` call that carries out a type change, when it has a cast. */\nfunction castFieldCallOf(change) {\n\treturn change.cast === void 0 ? void 0 : new CastFieldCall({\n\t\tcollection: change.collection,\n\t\tfield: change.field,\n\t\t...change.cast,\n\t\t...change.filter === void 0 ? {} : { filter: change.filter }\n\t});\n}\n/**\n* Each top-level field of a model or variant, in a collection the plan keeps, whose destination\n* type does not take every value its origin type holds, read from the BSON types of the two codecs.\n*/\nfunction planFieldTypeChanges(input, lookups) {\n\treturn modelCoordinates(input.fromContract).flatMap((origin) => {\n\t\tconst model = modelAt(input.fromContract, origin);\n\t\tif (model === void 0 || embeddedModelReason(input.fromContract, origin) !== void 0) return [];\n\t\tconst destination = destinationModelOf(origin, input);\n\t\tconst destinationModel = destination === void 0 ? void 0 : modelAt(input.contract, destination);\n\t\tif (destination === void 0 || destinationModel === void 0) return [];\n\t\tconst collection = collectionOfModel(input.contract.domain, destination);\n\t\tif (collection === void 0 || !input.keptCollections.has(collection)) return [];\n\t\tif (collectionControlPolicy(input.contract, collection) !== \"managed\") return [];\n\t\treturn Object.keys(model.fields).sort().flatMap((field) => {\n\t\t\tconst destinationField = destinationFieldOf({\n\t\t\t\t...origin,\n\t\t\t\tfield\n\t\t\t}, input.statements);\n\t\t\tif (!Object.hasOwn(destinationModel.fields, destinationField)) return [];\n\t\t\tconst from = fieldShapeOf(model.fields[field], lookups);\n\t\t\tconst to = fieldShapeOf(destinationModel.fields[destinationField], lookups);\n\t\t\tconst storedName = ownStoredNameOf(destinationModel, destinationField);\n\t\t\tif (from === void 0 || to === void 0 || takesEveryValue(from, to)) return [];\n\t\t\tif (storedName === \"_id\") return [];\n\t\t\treturn [typeChange({\n\t\t\t\tsubject: {\n\t\t\t\t\tkind: \"field\",\n\t\t\t\t\t...origin,\n\t\t\t\t\tfield\n\t\t\t\t},\n\t\t\t\tdestination: {\n\t\t\t\t\t...destination,\n\t\t\t\t\tfield: destinationField\n\t\t\t\t},\n\t\t\t\tcollection,\n\t\t\t\tfield: storedName,\n\t\t\t\tfrom,\n\t\t\t\tto,\n\t\t\t\tfilter: variantFilterOf(input.contract.domain, destination)\n\t\t\t})];\n\t\t});\n\t});\n}\n/**\n* Without an origin contract, each field a root model of both validators declares whose new\n* property schema does not take every value the old one does, named by its storage name.\n*/\nfunction planValidatorTypeChanges(input) {\n\treturn input.origin.collections.flatMap((originCollection) => {\n\t\tconst collection = originCollection.name;\n\t\tif (collectionControlPolicy(input.contract, collection) !== \"managed\") return [];\n\t\tconst destination = input.destination.collection(collection);\n\t\tif (destination?.validator === void 0 || originCollection.validator === void 0) return [];\n\t\tconst before = validatorDocumentShapesOf(originCollection.validator.jsonSchema);\n\t\tconst changes = validatorDocumentShapesOf(destination.validator.jsonSchema).flatMap((after) => {\n\t\t\tconst matched = before.find(({ key }) => key === after.key);\n\t\t\tif (matched === void 0) return [];\n\t\t\treturn Object.keys(after.properties).filter((field) => field !== \"_id\" && Object.hasOwn(matched.properties, field)).flatMap((field) => {\n\t\t\t\tconst from = propertyShapeOf(matched.properties[field]);\n\t\t\t\tconst to = propertyShapeOf(after.properties[field]);\n\t\t\t\tif (from === void 0 || to === void 0 || takesEveryValue(from, to)) return [];\n\t\t\t\treturn [{\n\t\t\t\t\tshape: after,\n\t\t\t\t\tfield,\n\t\t\t\t\tfrom,\n\t\t\t\t\tto\n\t\t\t\t}];\n\t\t\t});\n\t\t});\n\t\tconst sameEverywhere = (field, rootIndex) => {\n\t\t\tconst shapes = validatorDocumentShapesOf(destination.validator?.jsonSchema).filter((shape) => shape.rootIndex === rootIndex);\n\t\t\tconst found = changes.filter((change) => change.field === field && change.shape.rootIndex === rootIndex);\n\t\t\treturn found.length === shapes.length && found.every((change) => JSON.stringify([change.from, change.to]) === JSON.stringify([found[0]?.from, found[0]?.to]));\n\t\t};\n\t\tconst planned = /* @__PURE__ */ new Map();\n\t\tfor (const { shape, field, from, to } of changes) {\n\t\t\tconst filter = shape.discriminator === void 0 || sameEverywhere(field, shape.rootIndex) || shape.discriminator === void 0 ? void 0 : { [shape.discriminator.field]: shape.discriminator.value };\n\t\t\tconst key = JSON.stringify([\n\t\t\t\tshape.rootIndex,\n\t\t\t\tfield,\n\t\t\t\tfilter ?? null\n\t\t\t]);\n\t\t\tif (planned.has(key)) continue;\n\t\t\tplanned.set(key, typeChange({\n\t\t\t\tsubject: {\n\t\t\t\t\tkind: \"storage\",\n\t\t\t\t\tname: `${collection}.${field}`\n\t\t\t\t},\n\t\t\t\tdestination: void 0,\n\t\t\t\tcollection,\n\t\t\t\tfield,\n\t\t\t\tfrom,\n\t\t\t\tto,\n\t\t\t\tfilter\n\t\t\t}));\n\t\t}\n\t\treturn [...planned.values()].sort((a, b) => a.field < b.field ? -1 : a.field > b.field ? 1 : 0);\n\t});\n}\nfunction shapeText(shape) {\n\tconst types = shape.types.length === 0 ? \"any value\" : shape.types.join(\", \");\n\treturn shape.list ? `list of ${types}` : types;\n}\nfunction fieldText(change, contract) {\n\treturn change.destination === void 0 ? change.subject.kind === \"storage\" ? change.subject.name : change.field : fieldStatementText(contract, change.destination);\n}\n/** A type change of a field whose stored name MongoDB reads as a path or an operator: neither a cast nor a conversion can rewrite it. */\nfunction unrewritableTypeChangeRefusals(changes, contract) {\n\treturn changes.flatMap((change) => {\n\t\tconst reason = unrewritableFieldNameReason(change.field);\n\t\tif (reason === void 0) return [];\n\t\treturn [{\n\t\t\tkind: \"typeChangeRefused\",\n\t\t\tsummary: `Cannot change the type of field \"${fieldText(change, contract)}\" in collection \"${change.collection}\": its stored name ${JSON.stringify(change.field)} cannot be rewritten: ${reason}`,\n\t\t\twhy: \"A cast or a conversion would have to rewrite the field. Keep its type, or store it under a name without \\\".\\\" that does not start with \\\"$\\\", then run this command again.\"\n\t\t}];\n\t});\n}\n/** A type change with no cast that keeps what the values mean: only a conversion the user writes keeps the field. */\nfunction noCastRefusals(changes, contract) {\n\treturn changes.filter((change) => change.cast === void 0).map((change) => {\n\t\tconst field = fieldText(change, contract);\n\t\treturn {\n\t\t\tkind: \"typeChangeRefused\",\n\t\t\tsummary: `Cannot change the type of field \"${field}\" in collection \"${change.collection}\" from ${shapeText(change.from)} to ${shapeText(change.to)}: MongoDB has no cast from ${shapeText(change.from)} to ${shapeText(change.to)} that keeps what the values mean`,\n\t\t\twhy: change.destination === void 0 ? \"Its values cannot be cast, so --delete cannot keep the field. Plan the change with migration plan --from <hash of the migration the database is at> and --convert, and write the conversion in migration.ts.\" : `Its values cannot be cast, so --delete cannot keep the field. Plan the change with migration plan and --convert ${field}, and write the conversion in migration.ts.`\n\t\t};\n\t});\n}\nfunction sameField(a, b) {\n\treturn a.namespaceId === b.namespaceId && a.model === b.model && a.field === b.field;\n}\n/** The type change a convert statement names, if it names one. */\nfunction typeChangeConverted(statement, changes) {\n\treturn changes.find((change) => change.destination !== void 0 && sameField(change.destination, statement.field));\n}\n//#endregion\n//#region src/core/migrations/mongo-type-lookups.ts\n/** The codecs and data types the composed components register, an extension's among them. */\nfunction mongoTypeLookupsOf(frameworkComponents) {\n\treturn {\n\t\tcodecLookup: extractCodecLookup(frameworkComponents),\n\t\tdataTypeLookup: assembleDataTypes(frameworkComponents).lookup\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 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 isPlainObject(v) {\n\treturn typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\n/** Each field a root model or variant of the validator declares, with the distinct schemas they give it, in canonical form. */\nfunction propertiesOf(schema) {\n\tconst schemas = /* @__PURE__ */ new Map();\n\tfor (const shape of validatorDocumentShapesOf(schema)) for (const [field, fieldSchema] of Object.entries(shape.properties)) schemas.set(field, (schemas.get(field) ?? /* @__PURE__ */ new Set()).add(canonicalize(fieldSchema)));\n\treturn Object.fromEntries([...schemas].map(([field, distinct]) => [field, [...distinct].sort().join(\"|\")]));\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) && originProps[field] !== 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}\n/**\n* The keys of an option MongoDB fills in when a collection is created without them, each with a\n* test for the value it fills in. `listCollections` reports a time-series collection's granularity\n* as \"seconds\" and its bucketMaxSpanSeconds when they were not given, and bucketRoundingSeconds only\n* for custom bucketing, which a contract cannot state; and a clustered index's v, key and unique, and\n* its name as \"_id_\".\n*/\nconst SERVER_FILLED = {\n\ttimeseries: {\n\t\tgranularity: (value) => value === \"seconds\",\n\t\tbucketMaxSpanSeconds: () => true,\n\t\tbucketRoundingSeconds: () => true\n\t},\n\tclusteredIndex: {\n\t\tv: () => true,\n\t\tkey: () => true,\n\t\tunique: () => true,\n\t\tname: (value) => value === \"_id_\"\n\t}\n};\n/** The origin's value of an option without the keys the server filled in and the destination leaves out. */\nfunction withoutServerFilled(option, origin, dest) {\n\tif (!isPlainObject(origin)) return origin;\n\tconst filled = SERVER_FILLED[option];\n\treturn Object.fromEntries(Object.entries(origin).filter(([key, value]) => isPlainObject(dest) && Object.hasOwn(dest, key) || !filled[key]?.(value)));\n}\nfunction hasImmutableOptionChange(origin, dest) {\n\tif (canonicalize(origin?.capped) !== canonicalize(dest?.capped)) return \"capped\";\n\tif (canonicalize(withoutServerFilled(\"timeseries\", origin?.timeseries, dest?.timeseries)) !== canonicalize(dest?.timeseries)) return \"timeseries\";\n\tif (canonicalize(origin?.collation) !== canonicalize(dest?.collation)) return \"collation\";\n\tif (canonicalize(withoutServerFilled(\"clusteredIndex\", origin?.clusteredIndex, dest?.clusteredIndex)) !== canonicalize(dest?.clusteredIndex)) return \"clusteredIndex\";\n}\nfunction collectionHasOptions(coll) {\n\treturn !!(coll.options || coll.validator);\n}\n/**\n* The model of `fromContract` that stores its documents in `collection`, if any: the root model\n* when variants share the collection with it.\n*/\nfunction modelStoredIn(fromContract, collection) {\n\tconst storing = Object.entries(fromContract.domain.namespaces).flatMap(([namespaceId, namespace]) => Object.entries(namespace.models).flatMap(([model, definition]) => {\n\t\tconst coordinate = {\n\t\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\t\tmodel\n\t\t};\n\t\treturn collectionOfModel(fromContract.domain, coordinate) === collection ? [{\n\t\t\tcoordinate,\n\t\t\tisRoot: definition.base === void 0\n\t\t}] : [];\n\t}));\n\treturn (storing.find(({ isRoot }) => isRoot) ?? storing[0])?.coordinate;\n}\n/** A convert or backfill statement this release cannot carry out on MongoDB. */\nfunction unsupportedStatementConflict(statement, fromContract, contract) {\n\treturn {\n\t\tkind: \"statementRefused\",\n\t\tsummary: `MongoDB does not apply ${statement.kind} statements in this release, so nothing was planned: ${describeMigrationStatement(statement, fromContract, contract)}`,\n\t\twhy: `MongoDB cannot carry out ${statement.kind} statements in this release. Leave out the statement.`,\n\t\trefusedStatement: statement\n\t};\n}\n/**\n* Each collection drop of the plan, with the model whose documents it loses. When that model keeps\n* its name and the plan brings its new collection into existence, the drop says how to rename the\n* collection by hand instead.\n*/\nfunction collectionDrops(calls, fromContract, contract, collections) {\n\tconst created = (collection) => collections.origin.collection(collection) === void 0 && collections.destination.collection(collection) !== void 0;\n\treturn calls.flatMap((call, operationIndex) => {\n\t\tif (!(call instanceof DropCollectionCall)) return [];\n\t\tconst model = fromContract === null ? void 0 : modelStoredIn(fromContract, call.collection);\n\t\tconst lost = {\n\t\t\toperationIndex,\n\t\t\tloss: \"drop\",\n\t\t\tlabel: call.label\n\t\t};\n\t\tif (model === void 0) return [{\n\t\t\t...lost,\n\t\t\tsubject: {\n\t\t\t\tkind: \"storage\",\n\t\t\t\tname: call.collection\n\t\t\t}\n\t\t}];\n\t\tconst subject = {\n\t\t\tkind: \"model\",\n\t\t\t...model\n\t\t};\n\t\tconst destinationCollection = modelStoredInDestination(contract, model);\n\t\treturn [destinationCollection !== void 0 && created(destinationCollection) ? {\n\t\t\t...lost,\n\t\t\tsubject,\n\t\t\tkeepDataAdvice: keepCollectionByHandAdvice(model, call.collection, destinationCollection)\n\t\t} : {\n\t\t\t...lost,\n\t\t\tsubject\n\t\t}];\n\t});\n}\n/** The collection the destination stores `model` in, when the destination still has that model. */\nfunction modelStoredInDestination(contract, model) {\n\tconst namespace = contract.domain.namespaces[model.namespaceId];\n\treturn namespace !== void 0 && Object.hasOwn(namespace.models, model.model) ? collectionOfModel(contract.domain, model) : void 0;\n}\nfunction callsOf(diff) {\n\treturn [\n\t\t...diff.collCreates,\n\t\t...diff.drops,\n\t\t...diff.creates,\n\t\t...diff.validatorOps,\n\t\t...diff.mutableOptionOps,\n\t\t...diff.collDrops\n\t];\n}\n/**\n* The calls for one collection. Indexes are paired in `originColl` and `destColl`, which may hold indexes in the form the verifier compares; each create is built from the contract's index as written, in `writtenDestColl`.\n*/\nfunction planCollectionDiff(collName, originColl, destColl, writtenDestColl) {\n\tconst collCreates = [];\n\tconst drops = [];\n\tconst creates = [];\n\tconst validatorOps = [];\n\tconst mutableOptionOps = [];\n\tconst collDrops = [];\n\tconst conflicts = [];\n\tif (!originColl) {\n\t\tif (destColl && (collectionHasOptions(destColl) || destColl.indexes.length === 0)) {\n\t\t\tconst opts = collectionHasOptions(destColl) ? schemaCollectionToCreateCollectionOptions(destColl) : void 0;\n\t\t\tcollCreates.push(new CreateCollectionCall(collName, opts));\n\t\t}\n\t} else if (!destColl) collDrops.push(new DropCollectionCall(collName));\n\telse {\n\t\tconst immutableChange = hasImmutableOptionChange(originColl.options, destColl.options);\n\t\tif (immutableChange) conflicts.push({\n\t\t\tkind: \"policy-violation\",\n\t\t\tsummary: `Cannot change immutable collection option '${immutableChange}' on ${collName}`,\n\t\t\twhy: `MongoDB does not support modifying the '${immutableChange}' option after collection creation`\n\t\t});\n\t\tconst mutableCall = planMutableOptionsDiffCall(collName, originColl.options, destColl.options);\n\t\tif (mutableCall) mutableOptionOps.push(mutableCall);\n\t\tconst validatorCall = planValidatorDiffCall(collName, originColl.validator, destColl.validator);\n\t\tif (validatorCall) validatorOps.push(validatorCall);\n\t}\n\tconst originLookup = /* @__PURE__ */ new Map();\n\tif (originColl) for (const idx of originColl.indexes) originLookup.set(indexLookupKey(idx), idx);\n\tconst destLookup = /* @__PURE__ */ new Map();\n\tif (destColl) for (const idx of destColl.indexes) destLookup.set(indexLookupKey(idx), idx);\n\tfor (const [lookupKey, idx] of originLookup) if (destLookup.get(lookupKey)?.name !== idx.name) drops.push(new DropIndexCall(collName, idx.keys, schemaIndexToCreateIndexOptions(idx)));\n\tfor (const [lookupKey, idx] of destLookup) if (originLookup.get(lookupKey)?.name !== idx.name) {\n\t\tconst asWritten = writtenDestColl?.indexes.find((written) => written.name === idx.name) ?? idx;\n\t\tcreates.push(new CreateIndexCall(collName, asWritten.keys, schemaIndexToCreateIndexOptions(asWritten)));\n\t}\n\treturn {\n\t\tcollCreates,\n\t\tdrops,\n\t\tcreates,\n\t\tvalidatorOps,\n\t\tmutableOptionOps,\n\t\tcollDrops,\n\t\tconflicts\n\t};\n}\n/**\n* The warning for a change a collection's control policy left out of the plan, worded as the Postgres planner words a suppressed call.\n*/\nfunction suppressedCallWarning(call, collection, control) {\n\tconst declared = control.declared !== void 0 && control.declared !== control.policy ? ` but declared '${control.declared}'` : \"\";\n\treturn {\n\t\tkind: \"controlPolicySuppressedCall\",\n\t\tsummary: `control policy suppressed: ${call.label} — collection \"${collection}\" has effective control '${control.policy}'${declared}`,\n\t\tmeta: {\n\t\t\tcontrolPolicy: control.policy,\n\t\t\t...ifDefined(\"declaredControlPolicy\", control.declared)\n\t\t}\n\t};\n}\nfunction withIndexesOf(schema, indexesFrom) {\n\treturn new MongoSchemaIR(schema.collections.map((collection) => new MongoSchemaCollection({\n\t\tname: collection.name,\n\t\tindexes: indexesFrom.collection(collection.name)?.indexes ?? collection.indexes,\n\t\t...ifDefined(\"validator\", collection.validator),\n\t\t...ifDefined(\"options\", collection.options)\n\t})), { fromDatabase: schema.fromDatabase });\n}\n/**\n* The origin and destination with indexes the planner can pair by content. A database reports a text index's keys as `_fts` and `_ftsx` and fills in its weights and languages and a collation's unwritten fields, so the indexes of a database origin are compared as the verifier compares them. A contract origin is compared exactly.\n*/\nfunction comparableIndexes(origin, destination, fromDatabase) {\n\tif (!fromDatabase) return {\n\t\torigin,\n\t\tdestination\n\t};\n\tconst canonical = canonicalizeSchemasForVerification(origin, destination);\n\treturn {\n\t\torigin: withIndexesOf(origin, canonical.live),\n\t\tdestination: withIndexesOf(destination, canonical.expected)\n\t};\n}\nvar MongoMigrationPlanner = class {\n\tplanCalls(options) {\n\t\tconst contract = blindCast(options.contract);\n\t\tconst schema = blindCast(options.schema);\n\t\tconst writtenDestinationIR = contractToMongoSchemaIR(contract);\n\t\tconst { origin: originIR, destination: destinationIR } = comparableIndexes(options.statementCalls?.schema ?? schema, writtenDestinationIR, schema.fromDatabase);\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 warnings = [];\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 planned = planCollectionDiff(collName, originColl, destinationIR.collection(collName), writtenDestinationIR.collection(collName));\n\t\t\tconst control = collectionControlOf(contract, options.fromContract, collName);\n\t\t\tif (!plansChangesTo(control.policy, originColl !== void 0)) {\n\t\t\t\twarnings.push(...callsOf(planned).map((call) => suppressedCallWarning(call, collName, control)));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tcollCreates.push(...planned.collCreates);\n\t\t\tdrops.push(...planned.drops);\n\t\t\tcreates.push(...planned.creates);\n\t\t\tvalidatorOps.push(...planned.validatorOps);\n\t\t\tmutableOptionOps.push(...planned.mutableOptionOps);\n\t\t\tcollDrops.push(...planned.collDrops);\n\t\t\tconflicts.push(...planned.conflicts);\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...options.statementCalls?.collectionRenames ?? [],\n\t\t\t...collCreates,\n\t\t\t...drops,\n\t\t\t...options.statementCalls?.rewrites ?? [],\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\twarnings\n\t\t};\n\t}\n\tplan(options) {\n\t\tconst contract = blindCast(options.contract);\n\t\tconst originIR = blindCast(options.schema);\n\t\tconst fromContract = options.fromContract;\n\t\tconst unsupported = options.statements.find((statement) => statement.kind !== \"rename\" && !((statement.kind === \"convert\" || statement.kind === \"backfill\") && statement.entity === \"field\"));\n\t\tif (unsupported !== void 0) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts: [unsupportedStatementConflict(unsupported, fromContract ?? contract, contract)]\n\t\t};\n\t\tconst renames = options.statements.filter((statement) => statement.kind === \"rename\");\n\t\tconst statementPlan = planStatements({\n\t\t\tstatements: renames,\n\t\t\tfromContract: fromContract ?? contract,\n\t\t\tcontract,\n\t\t\tschema: originIR\n\t\t});\n\t\tif (!statementPlan.ok) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts: statementPlan.failure\n\t\t};\n\t\tconst { schema, collectionRenames, fieldRenames, callOfStatement } = statementPlan.value;\n\t\tconst destinationIR = contractToMongoSchemaIR(contract);\n\t\tconst renamedTo = new Map(collectionRenames.map((call) => [call.from, call.to]));\n\t\tconst removals = fromContract === null ? planValidatorFieldRemovals({\n\t\t\torigin: schema,\n\t\t\tdestination: destinationIR,\n\t\t\tcontract\n\t\t}) : planFieldRemovals({\n\t\t\tstatements: renames,\n\t\t\tfromContract,\n\t\t\tcontract,\n\t\t\tcollectionAfterRenames: (collection) => renamedTo.get(collection) ?? collection,\n\t\t\tkeptCollections: new Set(schema.collectionNames.filter((name) => destinationIR.collection(name) !== void 0))\n\t\t});\n\t\tconst match = fromContract === null ? void 0 : {\n\t\t\tstatements: renames,\n\t\t\tfromContract,\n\t\t\tcontract,\n\t\t\tcollectionAfterRenames: (collection) => renamedTo.get(collection) ?? collection\n\t\t};\n\t\tconst lookups = mongoTypeLookupsOf(options.frameworkComponents);\n\t\tconst typeChanges = fromContract === null ? planValidatorTypeChanges({\n\t\t\torigin: schema,\n\t\t\tdestination: destinationIR,\n\t\t\tcontract\n\t\t}) : planFieldTypeChanges({\n\t\t\tstatements: renames,\n\t\t\tfromContract,\n\t\t\tcontract,\n\t\t\tcollectionAfterRenames: (collection) => renamedTo.get(collection) ?? collection,\n\t\t\tkeptCollections: new Set(schema.collectionNames.filter((name) => destinationIR.collection(name) !== void 0))\n\t\t}, lookups);\n\t\tconst contracts = {\n\t\t\tfromContract: fromContract ?? contract,\n\t\t\tcontract\n\t\t};\n\t\tconst converted = [];\n\t\tconst transforms = options.statements.flatMap((statement) => {\n\t\t\tif (statement.kind === \"convert\" && statement.entity === \"field\") {\n\t\t\t\tconst change = typeChangeConverted(statement, typeChanges);\n\t\t\t\tif (change !== void 0) converted.push(change);\n\t\t\t\treturn [{\n\t\t\t\t\tstatement,\n\t\t\t\t\toutcome: convertTransform(statement, change, contracts)\n\t\t\t\t}];\n\t\t\t}\n\t\t\tif (statement.kind === \"backfill\" && statement.entity === \"field\") return [{\n\t\t\t\tstatement,\n\t\t\t\toutcome: backfillTransform(statement, {\n\t\t\t\t\tcontract,\n\t\t\t\t\tschema,\n\t\t\t\t\tmatch\n\t\t\t\t})\n\t\t\t}];\n\t\t\treturn [];\n\t\t});\n\t\tconst unconverted = typeChanges.filter((change) => !converted.includes(change));\n\t\tconst rewritable = unconverted.filter((change) => unrewritableFieldNameReason(change.field) === void 0);\n\t\tconst casts = rewritable.flatMap((change) => {\n\t\t\tconst call = castFieldCallOf(change);\n\t\t\treturn call === void 0 ? [] : [{\n\t\t\t\t...change,\n\t\t\t\tcall\n\t\t\t}];\n\t\t});\n\t\tconst fills = planFieldFills({\n\t\t\tmatch,\n\t\t\tcontract,\n\t\t\tlookups,\n\t\t\tschema,\n\t\t\tdestination: destinationIR,\n\t\t\tstatements: options.statements\n\t\t});\n\t\tconst rewrites = [\n\t\t\t...removals.map(({ call, subject }) => ({\n\t\t\t\tkind: \"removal\",\n\t\t\t\tcollection: call.collection,\n\t\t\t\tfield: call.field,\n\t\t\t\tfilter: call.filter,\n\t\t\t\tmodel: subject.kind === \"field\" ? subject : void 0\n\t\t\t})),\n\t\t\t...casts.map((change) => ({\n\t\t\t\tkind: \"cast\",\n\t\t\t\tcollection: change.collection,\n\t\t\t\tfield: change.field,\n\t\t\t\tfilter: change.filter,\n\t\t\t\tmodel: change.destination\n\t\t\t})),\n\t\t\t...transforms.flatMap(({ outcome }) => outcome.kind === \"transform\" ? [outcome.rewrite] : []),\n\t\t\t...fills.map(({ call, subject }) => ({\n\t\t\t\tkind: \"fill\",\n\t\t\t\tcollection: call.options.collection,\n\t\t\t\tfield: call.options.field,\n\t\t\t\tfilter: call.options.filter,\n\t\t\t\tmodel: subject.kind === \"field\" ? subject : void 0\n\t\t\t}))\n\t\t];\n\t\tconst refusals = [\n\t\t\t...transforms.flatMap(({ outcome }) => outcome.kind === \"refused\" ? [outcome.conflict] : []),\n\t\t\t...unrewritableTypeChangeRefusals(unconverted, contract),\n\t\t\t...noCastRefusals(rewritable, contract),\n\t\t\t...rewrites.flatMap((rewrite) => rewriteRefusals(rewrite, contract, {\n\t\t\t\ttimeSeries: schema.collection(rewrite.collection)?.options?.timeseries !== void 0,\n\t\t\t\tvalidator: schema.collection(rewrite.collection)?.validator?.jsonSchema\n\t\t\t}))\n\t\t];\n\t\tif (refusals.length > 0) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts: refusals\n\t\t};\n\t\tconst castCalls = casts.map(({ call }) => call);\n\t\tconst callOf = new Map([...renames.map((statement, index) => [statement, callOfStatement[index]]), ...transforms.map(({ statement, outcome }) => outcome.kind === \"transform\" ? [statement, outcome.call] : [statement, void 0])]);\n\t\tconst transformCalls = (kind) => transforms.flatMap(({ statement, outcome }) => statement.kind === kind && outcome.kind === \"transform\" ? [outcome.call] : []);\n\t\tconst result = this.planCalls({\n\t\t\t...options,\n\t\t\tstatementCalls: {\n\t\t\t\tschema,\n\t\t\t\tcollectionRenames,\n\t\t\t\trewrites: [\n\t\t\t\t\t...fieldRenames,\n\t\t\t\t\t...castCalls,\n\t\t\t\t\t...transformCalls(\"convert\"),\n\t\t\t\t\t...fills.map((fill) => fill.call),\n\t\t\t\t\t...transformCalls(\"backfill\"),\n\t\t\t\t\t...removals.map((removal) => removal.call)\n\t\t\t\t]\n\t\t\t}\n\t\t});\n\t\tif (result.kind === \"failure\") return result;\n\t\tconst { calls, warnings } = result;\n\t\tconst allWarnings = [...warnings, ...match === void 0 ? [] : documentsNotRewrittenWarnings(match)];\n\t\tconst fieldLoss = [...removals.map((removal) => ({\n\t\t\toperationIndex: calls.indexOf(removal.call),\n\t\t\tsubject: removal.subject,\n\t\t\tloss: \"drop\",\n\t\t\tlabel: removal.call.label\n\t\t})), ...casts.flatMap(({ call, subject }) => call.operationClass !== \"destructive\" ? [] : [{\n\t\t\toperationIndex: calls.indexOf(call),\n\t\t\tsubject,\n\t\t\tloss: \"typeChange\",\n\t\t\tlabel: call.label\n\t\t}])];\n\t\treturn {\n\t\t\tkind: \"success\",\n\t\t\tplan: new PlannerProducedMongoMigration(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: options.statements.map((statement) => {\n\t\t\t\tconst call = callOf.get(statement);\n\t\t\t\treturn {\n\t\t\t\t\tstatement,\n\t\t\t\t\toperationIndexes: call === void 0 ? [] : [calls.indexOf(call)]\n\t\t\t\t};\n\t\t\t}),\n\t\t\tdataLoss: [...collectionDrops(calls, fromContract, contract, {\n\t\t\t\torigin: schema,\n\t\t\t\tdestination: destinationIR\n\t\t\t}), ...fieldLoss].sort((a, b) => a.operationIndex - b.operationIndex),\n\t\t\taccessChanges: [],\n\t\t\ttemporaryValues: fills.map((fill) => ({\n\t\t\t\toperationIndex: calls.indexOf(fill.call),\n\t\t\t\tsubject: fill.subject,\n\t\t\t\tvalue: fill.text\n\t\t\t})),\n\t\t\t...allWarnings.length > 0 ? { warnings: allWarnings } : {}\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 plansChangesTo(policy, collectionExists) {\n\tswitch (policy) {\n\t\tcase \"managed\": return true;\n\t\tcase \"tolerated\": return !collectionExists;\n\t\tcase \"external\":\n\t\tcase \"observed\": return false;\n\t}\n}\nfunction planValidatorDiffCall(collName, originValidator, destValidator) {\n\tif (validatorsEqual(originValidator, destValidator)) return void 0;\n\tif (destValidator) return new CollModCall(collName, {\n\t\tvalidator: { $jsonSchema: destValidator.jsonSchema },\n\t\tvalidationLevel: destValidator.validationLevel,\n\t\tvalidationAction: destValidator.validationAction\n\t}, {\n\t\tid: `validator.${collName}.${originValidator ? \"update\" : \"add\"}`,\n\t\tlabel: originValidator ? validatorUpdateLabel(collName, originValidator, destValidator) : `Add validator on ${collName}`,\n\t\toperationClass: \"widening\",\n\t\tcheckDocuments: true\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\treturn new CollModCall(collName, { changeStreamPreAndPostImages: destCSPPI ?? { enabled: false } }, {\n\t\tid: `options.${collName}.update`,\n\t\tlabel: `Update mutable options on ${collName}`,\n\t\toperationClass: \"widening\"\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 RenameCollectionJson = type({\n\tkind: \"\\\"renameCollection\\\"\",\n\tcollection: \"string\",\n\tto: \"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\t\"bypassDocumentValidation?\": \"boolean\"\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\t\"object?\": \"string > 0\"\n});\nconst StepJson = type({\n\tdescription: \"string\",\n\tcommand: \"Record<string, unknown>\"\n});\nconst OperationMetaJson = type({ \"rewrite?\": type({\n\tkind: \"\\\"cast\\\"\",\n\tcollection: \"string\",\n\tfield: \"string\",\n\tto: \"string\"\n}).or({\n\tkind: \"\\\"fill\\\"\",\n\tcollection: \"string\",\n\tfield: \"string\"\n}) });\nconst DdlOperationJson = type({\n\tid: \"string\",\n\tlabel: \"string\",\n\toperationClass: \"\\\"additive\\\" | \\\"widening\\\" | \\\"destructive\\\"\",\n\t\"meta?\": OperationMetaJson,\n\tprecheck: \"Record<string, unknown>[]\",\n\texecute: \"Record<string, unknown>[]\",\n\tpostcheck: \"Record<string, unknown>[]\"\n});\nconst DmlCheckJson = type({\n\tdescription: \"string\",\n\tsource: \"Record<string, unknown>\",\n\tfilter: \"Record<string, unknown>\",\n\texpect: \"\\\"exists\\\" | \\\"notExists\\\"\"\n});\nconst DmlOperationJson = type({\n\tid: \"string\",\n\tlabel: \"string\",\n\toperationClass: \"\\\"additive\\\" | \\\"widening\\\" | \\\"destructive\\\" | \\\"data\\\"\",\n\tname: \"string\",\n\t\"meta?\": OperationMetaJson,\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, ifDefined(\"bypassDocumentValidation\", data.bypassDocumentValidation));\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 \"renameCollection\": {\n\t\t\tconst data = validate(RenameCollectionJson, json, \"renameCollection command\");\n\t\t\treturn new RenameCollectionCommand(data.collection, data.to);\n\t\t}\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}\n/** An inspection command has a `kind`, which its deserializer checks; a query plan has none. */\nfunction deserializeCheckSource(json) {\n\treturn \"kind\" in json ? deserializeInspectionCommand(json) : deserializeMongoQueryPlan(json);\n}\nfunction deserializeCheck(json) {\n\tconst data = validate(CheckJson, json, \"migration check\");\n\treturn {\n\t\tdescription: data.description,\n\t\tsource: deserializeCheckSource(data.source),\n\t\tfilter: deserializeFilterExpr(data.filter),\n\t\texpect: data.expect,\n\t\t...ifDefined(\"object\", data.object)\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 isDmlOperationJson(json) {\n\treturn Array.isArray(recordValue(json, \"run\", \"migration operation\"));\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\t...ifDefined(\"meta\", data.meta),\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 deserializeDmlCheck(json) {\n\tconst data = validate(DmlCheckJson, json, \"DML operation 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 deserializeDmlOp(json) {\n\tconst data = validate(DmlOperationJson, json, \"DML operation\");\n\treturn {\n\t\tid: data.id,\n\t\tlabel: data.label,\n\t\toperationClass: data.operationClass,\n\t\tname: data.name,\n\t\t...ifDefined(\"meta\", data.meta),\n\t\tprecheck: data.precheck.map(deserializeDmlCheck),\n\t\trun: data.run.map(deserializeMongoQueryPlan),\n\t\tpostcheck: data.postcheck.map(deserializeDmlCheck)\n\t};\n}\nfunction deserializeMongoOp(json) {\n\tif (isDmlOperationJson(json)) return deserializeDmlOp(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\"]);\nconst WRITING_STAGES = [\"$out\", \"$merge\"];\n/** The stage of an aggregate's pipeline that writes, `$out` or `$merge`, if it has one. */\nfunction writingStageOf(command) {\n\tif (command instanceof RawAggregateCommand) return command.pipeline.flatMap((stage) => WRITING_STAGES.filter((name) => Object.hasOwn(stage, name))).at(0);\n\tif (command instanceof AggregateCommand) return command.pipeline.map((stage) => `$${stage.kind}`).find((name) => WRITING_STAGES.includes(name));\n}\nconst CHANGED_DOCUMENT_COUNTS = [\n\t\"insertedCount\",\n\t\"modifiedCount\",\n\t\"upsertedCount\",\n\t\"deletedCount\"\n];\n/** Whether a write command's result row says it changed no document: every count it carries is zero. */\nfunction reportsNoChangedDocuments(row) {\n\tif (typeof row !== \"object\" || row === null) return false;\n\tconst counts = CHANGED_DOCUMENT_COUNTS.map((field) => Reflect.get(row, field)).filter((count) => count !== void 0);\n\treturn counts.length > 0 && counts.every((count) => count === 0);\n}\nfunction failedCheckOf(operationId, phase, check) {\n\treturn {\n\t\toperationId,\n\t\tphase,\n\t\tdescription: check.description,\n\t\t...ifDefined(\"expectation\", check.object === void 0 ? void 0 : check.expect === \"exists\" ? expectPresent(check.object) : expectAbsent(check.object))\n\t};\n}\nfunction runnerFailure(code, summary, options) {\n\treturn notOk(migrationRunnerFailure(code, summary, options));\n}\n/**\n* The failure when a field rename's before-check finds documents that already hold the new name,\n* which `$rename` would overwrite: what to look for and fix, and that the plan resumes.\n*/\nfunction renameOverwriteRefusal(op) {\n\tconst rewrite = fieldRewriteOf(op);\n\tif (rewrite === void 0) return void 0;\n\tconst renames = Reflect.get(rewrite.command.update, \"$rename\");\n\tconst to = typeof renames === \"object\" && renames !== null ? Reflect.get(renames, rewrite.field) : void 0;\n\tif (typeof to !== \"string\") return void 0;\n\tconst [check] = op.precheck;\n\tconst source = check?.source.command;\n\tconst match = source instanceof RawAggregateCommand ? Reflect.get(source.pipeline[0] ?? {}, \"$match\") : void 0;\n\tconst find = `db.getCollection(${JSON.stringify(rewrite.collection)}).find(${JSON.stringify(match ?? {})})`;\n\treturn runnerFailure(\"MIGRATION.PRECHECK_FAILED\", `Operation ${op.id} stopped: some documents in collection ${rewrite.collection} already hold ${to} as well as ${rewrite.field}`, {\n\t\twhy: `Renaming ${rewrite.field} to ${to} would overwrite their ${to}. Find them with ${find} in mongosh, and move or remove one of the two values in each. Nothing was renamed. Once the documents are fixed, run the command again; operations that already ran are skipped.`,\n\t\tmeta: {\n\t\t\toperationId: op.id,\n\t\t\tname: op.name\n\t\t}\n\t});\n}\n/**\n* The failure when a collection rename's before-check finds that the new collection already exists.\n*/\nfunction renameTargetExistsRefusal(op, failed) {\n\tconst rename = op.execute.find((step) => step.command instanceof RenameCollectionCommand)?.command;\n\tif (!(rename instanceof RenameCollectionCommand) || failed.expect !== \"notExists\") return;\n\tconst { collection: from, to } = rename;\n\treturn runnerFailure(\"MIGRATION.PRECHECK_FAILED\", `Operation ${op.id} stopped: collection ${to} already exists, so collection ${from} cannot be renamed to it`, {\n\t\twhy: `Nothing was renamed. If ${to} holds nothing you need, drop it, then run the command again; operations that already ran are skipped. If an earlier operation of the same migration created ${to}, as a createIndex on ${to} does, make renameCollection(${JSON.stringify(from)}, ${JSON.stringify(to)}) the first operation of its migration.ts, run node on that migration.ts, and then drop ${to} and run the command again.`,\n\t\tmeta: { operationId: op.id }\n\t});\n}\nfunction validatorSetBy(op) {\n\tconst step = op.execute.find(({ command }) => command instanceof CollModCommand)?.command;\n\treturn step instanceof CollModCommand && step.validator !== void 0 ? step : void 0;\n}\n/** The BSON types a property schema's `bsonType` allows, or `undefined` when it names none. */\nfunction allowedBsonTypes(schema) {\n\tconst types = propertyBsonTypesOf(schema);\n\treturn types.length === 0 ? void 0 : new Set(types);\n}\n/** The shape of a property schema that describes an embedded document, such as a value object. */\nfunction nestedShapeOf(schema) {\n\tif (typeof schema !== \"object\" || schema === null) return void 0;\n\tconst properties = Reflect.get(schema, \"properties\");\n\tconst required = Reflect.get(schema, \"required\");\n\tif (typeof properties !== \"object\" || properties === null || Array.isArray(properties)) return;\n\treturn {\n\t\tproperties: { ...properties },\n\t\trequired: Array.isArray(required) ? required.filter((name) => typeof name === \"string\") : [],\n\t\tclosed: Reflect.get(schema, \"additionalProperties\") === false\n\t};\n}\nfunction problemsAgainst(fields, shape, path) {\n\tconst named = (field) => JSON.stringify(`${path}${field}`);\n\tconst unreadable = (field) => field === \"_id\" ? void 0 : unrewritableFieldNameReason(field);\n\tconst unchecked = [...fields.keys()].flatMap((field) => {\n\t\tconst reason = unreadable(field);\n\t\treturn reason === void 0 ? [] : [`has ${named(field)}, which the new validator cannot check: ${reason}`];\n\t});\n\tconst missing = shape.required.filter((field) => !fields.has(field)).map((field) => `has no ${named(field)}`);\n\tconst retyped = [...fields].flatMap(([field, { type }]) => {\n\t\tif (unreadable(field) !== void 0) return [];\n\t\tconst allowed = allowedBsonTypes(shape.properties[field]);\n\t\treturn allowed === void 0 || allowed.has(type) ? [] : [`holds a value of type ${type} in ${named(field)}, which the new validator does not allow there`];\n\t});\n\tconst outsideEnum = [...fields].flatMap(([field, { value }]) => {\n\t\tconst allowed = Reflect.get(Object(shape.properties[field]), \"enum\");\n\t\treturn !Array.isArray(allowed) || allowed.some((member) => canonicalize(member) === canonicalize(value)) ? [] : [`holds ${mongoshValue(value)} in ${named(field)}, a value the new validator does not allow there`];\n\t});\n\tconst undeclared = shape.closed ? [...fields.keys()].filter((field) => !Object.hasOwn(shape.properties, field) && unreadable(field) === void 0).map((field) => `has ${named(field)}, a field the new validator does not name`) : [];\n\treturn [...unchecked.map((text) => ({\n\t\ttext,\n\t\tuncheckable: true\n\t})), ...[\n\t\t...missing,\n\t\t...retyped,\n\t\t...outsideEnum,\n\t\t...undeclared\n\t].map((text) => ({\n\t\ttext,\n\t\tuncheckable: false\n\t}))];\n}\n/**\n* The root model or variant of a validator a document is read against: the variant whose\n* discriminator value the document holds, or else the one it fits best.\n*/\nfunction shapeOfDocument(fields, shapes) {\n\tconst selected = shapes.filter(({ discriminator }) => discriminator !== void 0 && canonicalize(fields.get(discriminator.field)?.value) === canonicalize(discriminator.value));\n\treturn (selected.length > 0 ? selected : shapes).reduce((best, shape) => best === void 0 || problemsAgainst(fields, shape, \"\").length < problemsAgainst(fields, best, \"\").length ? shape : best, void 0);\n}\nfunction joinedList(items) {\n\tif (items.length <= 2) return items.join(\" and \");\n\treturn `${items.slice(0, -1).join(\", \")}, and ${items.at(-1)}`;\n}\n/**\n* The `--backfill` statements that let the user choose values for the fields a change makes\n* required: one for each field the planner would accept the statement for, as its rewrite refusals\n* and stored name rules say.\n*/\nfunction backfillAdvice(contract, collection, requires, rewriteCollection) {\n\tconst accepted = backfillStatements(contract, collection, requires, rewriteCollection);\n\tif (accepted.length === 0) return [];\n\treturn [`To give ${quotedList(accepted.map(({ stored }) => stored))} values you choose, plan the change with migration plan ${accepted.map(({ statement }) => `--backfill ${statement}`).join(\" \")}.`];\n}\n/** The `--backfill` statement of each of `fields` the planner would accept it for, with the field's stored name. */\nfunction backfillStatements(contract, collection, fields, rewriteCollection) {\n\treturn fields.flatMap((stored) => {\n\t\tif (unrewritableFieldNameReason(stored) !== void 0) return [];\n\t\tconst field = fieldStoredAt(contract, collection, stored);\n\t\tif (field.kind !== \"field\") return [];\n\t\tconst model = {\n\t\t\tnamespaceId: field.namespaceId,\n\t\t\tmodel: field.model\n\t\t};\n\t\treturn rewriteRefusals({\n\t\t\tkind: \"backfill\",\n\t\t\tcollection,\n\t\t\tfield: stored,\n\t\t\tfilter: variantFilterOf(contract.domain, model),\n\t\t\tmodel\n\t\t}, contract, rewriteCollection).length === 0 ? [{\n\t\t\tstored,\n\t\t\tstatement: fieldStatementText(contract, field)\n\t\t}] : [];\n\t});\n}\n/** How to change documents by hand while the old validator, which may reject their new shape, is in place. */\nfunction byHandAdvice(collection) {\n\treturn `The old validator may reject a document changed to the new shape, so the update that fixes one can skip document validation: change them with a dataTransform in migration.ts, or in mongosh with an update command that sets bypassDocumentValidation: true, such as db.runCommand({ update: ${JSON.stringify(collection)}, updates: [{ q: { _id: <id> }, u: { $set: { <field>: <value> } } }], bypassDocumentValidation: true }).`;\n}\nfunction bsonTypeOf(value) {\n\treturn Reflect.get(value, \"_bsontype\");\n}\nfunction uuidText(bytes) {\n\tconst hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, \"0\")).join(\"\");\n\treturn [\n\t\thex.slice(0, 8),\n\t\thex.slice(8, 12),\n\t\thex.slice(12, 16),\n\t\thex.slice(16, 20),\n\t\thex.slice(20)\n\t].join(\"-\");\n}\n/** A value as `mongosh` writes it: `ObjectId(\"…\")`, `ISODate(\"…\")`, `UUID(\"…\")`, anything else as JSON. */\nfunction mongoshValue(value) {\n\tif (value instanceof Date) return `ISODate(${JSON.stringify(value.toISOString())})`;\n\tif (typeof value === \"object\" && value !== null) {\n\t\tif (bsonTypeOf(value) === \"ObjectId\") return `ObjectId(${JSON.stringify(String(value))})`;\n\t\tconst bytes = Reflect.get(value, \"buffer\");\n\t\tif (bsonTypeOf(value) === \"Binary\" && Reflect.get(value, \"sub_type\") === 4 && bytes instanceof Uint8Array && bytes.length === 16) return `UUID(${JSON.stringify(uuidText(bytes))})`;\n\t}\n\treturn JSON.stringify(value) ?? String(value);\n}\nfunction documentShapes(jsonSchema) {\n\treturn validatorDocumentShapesOf(jsonSchema).map((shape) => ({\n\t\tkey: shape.key,\n\t\trequired: new Set(shape.required),\n\t\tproperties: new Map(Object.entries(shape.properties).map(([field, schema]) => [field, canonicalize(schema)]))\n\t}));\n}\nconst ANY_VALUE = canonicalize({});\nconst NO_SHAPE = {\n\tkey: \"\",\n\trequired: /* @__PURE__ */ new Set(),\n\tproperties: /* @__PURE__ */ new Map()\n};\n/**\n* The fields a validator change makes required, and those whose accepted values it changes, each\n* kind of document compared with the same kind under the validator the collection has. A kind the\n* collection's validator does not describe is not compared; with no validator, every field it\n* requires is new.\n*/\nfunction fieldsTouched(before, after) {\n\tconst shapesBefore = documentShapes(before);\n\tconst requires = /* @__PURE__ */ new Set();\n\tconst retypes = /* @__PURE__ */ new Set();\n\tfor (const shape of documentShapes(after)) {\n\t\tconst previous = shapesBefore.length === 0 ? NO_SHAPE : shapesBefore.find(({ key }) => key === shape.key);\n\t\tif (previous === void 0) continue;\n\t\tfor (const field of shape.required) if (field !== \"_id\" && !previous.required.has(field)) requires.add(field);\n\t\tfor (const [field, schema] of shape.properties) {\n\t\t\tconst schemaBefore = previous.properties.get(field);\n\t\t\tif (schemaBefore !== void 0 && schemaBefore !== schema && schema !== ANY_VALUE) retypes.add(field);\n\t\t}\n\t}\n\treturn {\n\t\trequires: [...requires].sort(),\n\t\tretypes: [...retypes].filter((field) => !requires.has(field)).sort()\n\t};\n}\nfunction quotedList(fields) {\n\tconst quoted = fields.map((field) => JSON.stringify(field));\n\treturn quoted.length <= 1 ? quoted.join(\"\") : `${quoted.slice(0, -1).join(\", \")} and ${quoted.at(-1)}`;\n}\n/** What a validator change touches, in words: `This validator change makes \"plan\" required.` */\nfunction touchedSentence(touched) {\n\tconst parts = [...touched.requires.length === 0 ? [] : [`makes ${quotedList(touched.requires)} required`], ...touched.retypes.length === 0 ? [] : [`changes what ${quotedList(touched.retypes)} ${touched.retypes.length === 1 ? \"accepts\" : \"accept\"}`]];\n\treturn parts.length === 0 ? \"\" : `This validator change ${parts.join(\" and \")}. `;\n}\nconst MONGO_UNAUTHORIZED = 13;\n/**\n* The failure for a rewrite that skips validation when the database user lacks the\n* `bypassDocumentValidation` action, as a `readWrite` user on a hosted cluster does.\n*/\nfunction bypassValidationRefusal(op, plan, error) {\n\tif (!(plan.command instanceof RawUpdateManyCommand) || !plan.command.bypassDocumentValidation) return;\n\tif (typeof error !== \"object\" || error === null) return void 0;\n\tif (Reflect.get(error, \"code\") !== MONGO_UNAUTHORIZED) return void 0;\n\tconst codeName = Reflect.get(error, \"codeName\");\n\treturn runnerFailure(\"MIGRATION.EXECUTION_FAILED\", `Operation ${op.id} failed: the database user may not skip document validation`, {\n\t\twhy: `Rewriting documents to fit the new schema skips document validation, because the old validator rejects the new shape. MongoDB refused it with error ${MONGO_UNAUTHORIZED} (${String(codeName)}). Grant the user the bypassDocumentValidation action on the database, for example with the dbAdmin or restore role, then run the command again; operations that already ran are skipped.`,\n\t\tmeta: {\n\t\t\toperationId: op.id,\n\t\t\tmongoCode: MONGO_UNAUTHORIZED,\n\t\t\tcodeName\n\t\t}\n\t});\n}\nconst MONGO_CONVERSION_FAILURE = 241;\n/** The innermost cause MongoDB gives in an error's message, without its closing period. */\nfunction mongoErrorText(error) {\n\tconst message = String(Reflect.get(error, \"message\"));\n\treturn (message.split(\" :: caused by :: \").at(-1) ?? message).replace(/\\.+$/, \"\");\n}\n/** The field of the destination contract a collection stores under `storedName`, or the storage name when no model declares it. */\nfunction fieldStoredAt(contract, collection, storedName) {\n\tconst field = modelFieldStoredAs(contract.domain, collection, storedName);\n\treturn field === void 0 ? {\n\t\tkind: \"storage\",\n\t\tname: `${collection}.${storedName}`\n\t} : {\n\t\tkind: \"field\",\n\t\t...field,\n\t\tnamespaceId: asNamespaceId(field.namespaceId)\n\t};\n}\nconst MONGO_DUPLICATE_KEY = 11e3;\n/** What a user can do about a MongoDB error that stopped a rewrite, when the error says. */\nfunction rewriteErrorFix(mongoCode, reason) {\n\tif (mongoCode !== MONGO_DUPLICATE_KEY) return void 0;\n\tconst index = /index: (\\S+)/.exec(reason)?.[1];\n\treturn `The rewrite would give two documents the same value under ${index === void 0 ? \"a unique index\" : `unique index ${JSON.stringify(index)}`}. Change or remove the documents that would collide, then run the command again; operations that already ran are skipped.`;\n}\n/**\n* The failure when MongoDB cannot build a unique index because two documents hold the same value\n* of its keys, as documents without the field all hold `null`. The build changes nothing.\n*/\n/** The fields of a duplicate key MongoDB reports, when every one of them is `null` or missing. */\nfunction nullKeyFields(error) {\n\tconst keyValue = Reflect.get(error, \"keyValue\");\n\tif (typeof keyValue !== \"object\" || keyValue === null) return [];\n\tconst entries = Object.entries(keyValue);\n\treturn entries.length > 0 && entries.every(([, value]) => value === null) ? entries.map(([field]) => field) : [];\n}\nfunction isDuplicateKeyError(error) {\n\treturn typeof error === \"object\" && error !== null && Reflect.get(error, \"code\") === MONGO_DUPLICATE_KEY;\n}\nfunction indexBuildFailure(op, command, error, backfill) {\n\tconst reason = mongoErrorText(error);\n\tconst duplicate = /dup key: (\\{.*\\})/.exec(reason)?.[1];\n\tconst index = command.name ?? defaultMongoIndexName(command.keys);\n\tconst lacking = nullKeyFields(error);\n\tconst statements = backfill(lacking);\n\tconst why = [\n\t\tlacking.length === 0 ? \"A document without the field counts as holding null.\" : `The documents that collide lack ${quotedList(lacking)} or hold null in ${lacking.length === 1 ? \"it\" : \"them\"}, and a document without the field counts as holding null.`,\n\t\t\"Give each document its own value of the indexed fields, or remove the duplicates, then run the command again; operations that already ran are skipped.\",\n\t\t...statements.length === 0 ? [] : [`Under migration plan, ${statements.join(\" \")} writes a slot to give each document its own value.`]\n\t].join(\" \");\n\treturn runnerFailure(\"MIGRATION.EXECUTION_FAILED\", `Operation ${op.id} failed: the unique index ${index} cannot be built, because two documents in collection ${command.collection} hold the same value${duplicate === void 0 ? \"\" : ` ${duplicate}`}`, {\n\t\twhy,\n\t\tmeta: {\n\t\t\toperationId: op.id,\n\t\t\tmongoCode: MONGO_DUPLICATE_KEY,\n\t\t\tindex,\n\t\t\tcollection: command.collection,\n\t\t\t...duplicate === void 0 ? {} : { duplicateKey: duplicate }\n\t\t}\n\t});\n}\n/**\n* The failure when a rewrite fails after MongoDB began it: documents it reached may already be\n* rewritten. A planner cast that meets a value `$convert` cannot cast names the field, which the\n* advice reads to offer `--convert`. A data transform's update is the user's own, so its failure\n* never names a type change.\n*/\nfunction rewriteFailure(op, error, position) {\n\tif (typeof error !== \"object\" || error === null) return void 0;\n\tconst mongoCode = Reflect.get(error, \"code\");\n\tif (typeof mongoCode !== \"number\") return void 0;\n\tconst codeName = Reflect.get(error, \"codeName\");\n\tconst mongoError = typeof codeName === \"string\" ? `${mongoCode} (${codeName})` : `${mongoCode}`;\n\tconst reason = mongoErrorText(error);\n\tif (op.operationClass === \"data\") return mongoCode === MONGO_CONVERSION_FAILURE ? runnerFailure(\"MIGRATION.EXECUTION_FAILED\", `Operation ${op.id} failed: its update met a value MongoDB cannot convert`, {\n\t\twhy: `MongoDB stopped the data transform's update: ${reason}. Documents it updated before that value stay updated. Until a re-run finishes, a document the update already changed may no longer fit the collection's current validator, so updates to it fail. Fix the update in the migration's migration.ts, run the file with node, then run the command again.`,\n\t\tmeta: {\n\t\t\toperationId: op.id,\n\t\t\tmongoCode\n\t\t}\n\t}) : runnerFailure(\"MIGRATION.EXECUTION_FAILED\", `Operation ${op.id} failed: MongoDB error ${mongoError}: ${reason}`, {\n\t\twhy: \"Documents the update changed before the error stay changed. Until a re-run finishes, a document the update already changed may no longer fit the collection's current validator, so updates to it fail. Fix what MongoDB names; when it comes from the update, change the update in the migration's migration.ts so its filter and update work on a re-run, and run the file with node. Then run the command again.\",\n\t\tmeta: {\n\t\t\toperationId: op.id,\n\t\t\tmongoCode,\n\t\t\t...typeof codeName === \"string\" ? { codeName } : {}\n\t\t}\n\t});\n\tconst rewrite = fieldRewriteOf(op);\n\tif (rewrite === void 0) return void 0;\n\tconst cast = op.meta?.rewrite?.kind === \"cast\" ? op.meta.rewrite : void 0;\n\tif (mongoCode !== MONGO_CONVERSION_FAILURE || cast === void 0) {\n\t\tconst fix = rewriteErrorFix(mongoCode, reason);\n\t\treturn runnerFailure(\"MIGRATION.EXECUTION_FAILED\", `Operation ${op.id} failed: MongoDB error ${mongoError}: ${reason}`, {\n\t\t\twhy: [\"Documents the rewrite changed before the error stay changed.\", ...fix === void 0 ? [] : [fix]].join(\" \"),\n\t\t\tmeta: {\n\t\t\t\toperationId: op.id,\n\t\t\t\tmongoCode,\n\t\t\t\t...typeof codeName === \"string\" ? { codeName } : {}\n\t\t\t}\n\t\t});\n\t}\n\tconst field = fieldStoredAt(position.contract, rewrite.collection, rewrite.field);\n\tconst named = field.kind === \"field\" ? fieldStatementText(position.contract, field) : rewrite.field;\n\treturn runnerFailure(\"MIGRATION.EXECUTION_FAILED\", `Operation ${op.id} failed: a value of field \"${named}\" in collection ${cast.collection} cannot be cast to ${cast.to}`, {\n\t\twhy: `MongoDB's $convert met a value of field \"${named}\" it cannot cast to ${cast.to}: ${reason}. Documents cast before that value stay cast, and a re-run casts the rest. Until it does, a document already cast holds a type the collection's current validator does not allow, so updates to it fail.`,\n\t\tmeta: {\n\t\t\toperationId: op.id,\n\t\t\tmongoCode,\n\t\t\tfailedTypeChange: {\n\t\t\t\tfield,\n\t\t\t\tby: \"cast\",\n\t\t\t\treason: \"value\",\n\t\t\t\toperationIndex: position.operationIndex\n\t\t\t}\n\t\t}\n\t});\n}\nvar MongoMigrationRunner = class {\n\tdeps;\n\tconstructor(deps) {\n\t\tthis.deps = deps;\n\t}\n\tasync execute(options) {\n\t\tlet changedDatabase = false;\n\t\tconst result = await this.apply(options, () => {\n\t\t\tchangedDatabase = true;\n\t\t});\n\t\treturn result.ok ? ok({\n\t\t\t...result.value,\n\t\t\tchangedDatabase\n\t\t}) : notOk(withDatabaseUnchanged(result.failure, options.databaseChangedBefore !== true && !changedDatabase));\n\t}\n\t/** Applies the plan, calling `wrote` after each command that changes the database. */\n\tasync apply(options, wrote) {\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 [operationIndex, operation] of operations.entries()) {\n\t\t\toptions.callbacks?.onOperationStart?.(operation);\n\t\t\ttry {\n\t\t\t\tif (isMongoDmlOperation(operation)) {\n\t\t\t\t\tconst result = await this.executeDmlOperation(operation, adapter, driver, filterEvaluator, runIdempotency, runPrechecks, runPostchecks, wrote, {\n\t\t\t\t\t\toperationIndex,\n\t\t\t\t\t\tcontract: options.destinationContract\n\t\t\t\t\t});\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\tif (runPostchecks && runIdempotency) {\n\t\t\t\t\tif (await this.allChecksSatisfied(operation.postcheck, inspectionExecutor, filterEvaluator)) continue;\n\t\t\t\t}\n\t\t\t\tif (runPrechecks) {\n\t\t\t\t\tconst failing = await this.firstFailingCheck(operation.precheck, inspectionExecutor, filterEvaluator);\n\t\t\t\t\tif (failing !== void 0) {\n\t\t\t\t\t\tconst failedCheck = failedCheckOf(operation.id, \"precheck\", failing);\n\t\t\t\t\t\treturn renameTargetExistsRefusal(operation, failing) ?? await this.documentsFailingValidatorRefusal(operation, failing, options.destinationContract) ?? runnerFailure(\"MIGRATION.PRECHECK_FAILED\", `Operation ${operation.id} failed during precheck: ${failing.description}`, {\n\t\t\t\t\t\t\twhy: failedPrecheckWhy(failedCheck),\n\t\t\t\t\t\t\tmeta: { failedCheck }\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const step of operation.execute) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait executeDdl(step.command);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconst { command } = step;\n\t\t\t\t\t\tif (!(command instanceof CreateIndexCommand) || !isDuplicateKeyError(error)) throw error;\n\t\t\t\t\t\tconst inPlace = await this.collectionInPlace(command.collection);\n\t\t\t\t\t\treturn indexBuildFailure(operation, command, error, (fields) => backfillStatements(options.destinationContract, command.collection, fields, inPlace.rewrite).map(({ statement }) => `--backfill ${statement}`));\n\t\t\t\t\t}\n\t\t\t\t\twrote();\n\t\t\t\t}\n\t\t\t\tif (runPostchecks) {\n\t\t\t\t\tconst failing = await this.firstFailingCheck(operation.postcheck, inspectionExecutor, filterEvaluator);\n\t\t\t\t\tif (failing !== void 0) {\n\t\t\t\t\t\tconst failedCheck = failedCheckOf(operation.id, \"postcheck\", failing);\n\t\t\t\t\t\treturn runnerFailure(\"MIGRATION.POSTCHECK_FAILED\", `Operation ${operation.id} failed during postcheck: ${failing.description}`, {\n\t\t\t\t\t\t\twhy: failedPostcheckWhy(failedCheck),\n\t\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\t\toperationId: operation.id,\n\t\t\t\t\t\t\t\tfailedCheck\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\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: schemaCheckWhy(verifyResult.schema.issues),\n\t\t\t\tmeta: { schemaIssues: 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\twrote();\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 executeDmlOperation(op, adapter, driver, filterEvaluator, runIdempotency, runPrechecks, runPostchecks, wrote, position) {\n\t\tif (runPostchecks && runIdempotency && op.postcheck.length > 0) {\n\t\t\tif (await this.evaluateDmlChecks(op.postcheck, filterEvaluator)) return { executed: false };\n\t\t}\n\t\tif (runPrechecks && op.precheck.length > 0) {\n\t\t\tif (!await this.evaluateDmlChecks(op.precheck, filterEvaluator)) return {\n\t\t\t\texecuted: false,\n\t\t\t\tfailure: renameOverwriteRefusal(op) ?? 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\ttry {\n\t\t\t\tlet reportedNoChange = false;\n\t\t\t\tlet reportedChange = false;\n\t\t\t\tfor await (const row of driver.execute(wireCommand)) if (reportsNoChangedDocuments(row)) reportedNoChange = true;\n\t\t\t\telse reportedChange = true;\n\t\t\t\tif (reportedChange || !reportedNoChange) wrote();\n\t\t\t} catch (error) {\n\t\t\t\tconst refusal = bypassValidationRefusal(op, plan, error);\n\t\t\t\tif (refusal !== void 0) return {\n\t\t\t\t\texecuted: false,\n\t\t\t\t\tfailure: refusal\n\t\t\t\t};\n\t\t\t\tconst failure = rewriteFailure(op, error, position);\n\t\t\t\tif (failure === void 0) throw error;\n\t\t\t\twrote();\n\t\t\t\treturn {\n\t\t\t\t\texecuted: false,\n\t\t\t\t\tfailure\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\tif (runPostchecks && op.postcheck.length > 0) {\n\t\t\tif (!await this.evaluateDmlChecks(op.postcheck, filterEvaluator)) return {\n\t\t\t\texecuted: false,\n\t\t\t\tfailure: await this.documentsStillMatchingFailure(op) ?? 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\t/**\n\t* The failure when a validator change's precheck finds documents the new validator rejects: how\n\t* many, one `_id`, and the query that finds them all.\n\t*/\n\tasync documentsFailingValidatorRefusal(op, failed, contract) {\n\t\tif (isInspectionCheckSource(failed.source)) return void 0;\n\t\tconst collMod = validatorSetBy(op);\n\t\tif (collMod?.validator === void 0) return void 0;\n\t\tconst { collection, validator } = collMod;\n\t\tconst failing = { $nor: [validator] };\n\t\tconst counted = await this.firstRow({\n\t\t\t...failed.source,\n\t\t\tcommand: new RawAggregateCommand(collection, [{ $match: failing }, { $group: {\n\t\t\t\t_id: null,\n\t\t\t\tdocuments: { $sum: 1 },\n\t\t\t\tdocumentId: { $first: \"$_id\" }\n\t\t\t} }])\n\t\t});\n\t\tconst documents = Number(counted?.[\"documents\"] ?? 0);\n\t\tif (documents === 0) return void 0;\n\t\tconst documentId = mongoshValue(counted?.[\"documentId\"]);\n\t\tconst query = `db.getCollection(${JSON.stringify(collection)}).find(${JSON.stringify(failing)})`;\n\t\tconst inPlace = await this.collectionInPlace(collection);\n\t\tconst validatorBefore = inPlace.validator;\n\t\tconst touched = fieldsTouched(Reflect.get(validatorBefore ?? {}, \"$jsonSchema\"), Reflect.get(validator, \"$jsonSchema\"));\n\t\tconst one = documents === 1;\n\t\tconst documentObjectId = counted?.[\"documentId\"];\n\t\tconst fields = await this.fieldsOfDocument(failed.source, collection, documentObjectId, \"$$ROOT\");\n\t\tconst shape = fields.size === 0 ? void 0 : shapeOfDocument(fields, validatorDocumentShapesOf(Reflect.get(validator, \"$jsonSchema\")));\n\t\tconst problems = shape === void 0 ? [] : await this.documentProblems({\n\t\t\tsource: failed.source,\n\t\t\tcollection,\n\t\t\tid: documentObjectId\n\t\t}, fields, shape, \"\");\n\t\tconst hadValidator = typeof validatorBefore === \"object\" && validatorBefore !== null;\n\t\tconst found = [\n\t\t\t`${touchedSentence(touched)}${one ? \"It has\" : \"One of them has\"} _id ${documentId}.`,\n\t\t\t...problems.length === 0 ? [] : [`That document ${joinedList(problems.map(({ text }) => text))}.`],\n\t\t\t`Find them all with ${query} in mongosh.`\n\t\t];\n\t\tconst uncheckable = problems.length > 0 && problems.every((problem) => problem.uncheckable);\n\t\tconst advice = uncheckable ? [\"A document that holds such a field can never fit the validator, so changing the documents does not help: store the field under a name without \\\".\\\" that does not start with \\\"$\\\".\"] : hadValidator ? [...backfillAdvice(contract, collection, await this.fieldsSomeDocumentLacks(failed.source, collection, failing, touched.requires), inPlace.rewrite), byHandAdvice(collection)] : [\"Change them with a dataTransform in migration.ts, or with an update in mongosh.\"];\n\t\tconst why = [\n\t\t\t...found,\n\t\t\t...advice,\n\t\t\t`Under db migrate you can instead apply the validator over them: set checkDocuments to false on this operation in that migration.ts, run the file with node, and run db migrate again. db update writes no migration.ts, so there ${uncheckable ? \"store the field under another name\" : \"fix the documents\"} first.`,\n\t\t\t\"This operation did not change the validator.\",\n\t\t\t`${uncheckable ? \"Then run the command again\" : \"Once the documents are fixed, run the command again\"}; operations that already ran are skipped.`\n\t\t].join(\" \");\n\t\treturn runnerFailure(\"MIGRATION.PRECHECK_FAILED\", `Operation ${op.id} stopped: ${documents} ${one ? \"document\" : \"documents\"} in collection ${collection} ${one ? \"does\" : \"do\"} not fit the new validator`, {\n\t\t\twhy,\n\t\t\tmeta: {\n\t\t\t\toperationId: op.id,\n\t\t\t\tdocumentsFailingValidator: {\n\t\t\t\t\tcollection,\n\t\t\t\t\tdocuments,\n\t\t\t\t\tdocumentId,\n\t\t\t\t\tquery,\n\t\t\t\t\trequires: touched.requires,\n\t\t\t\t\tretypes: touched.retypes\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* The failure when a rewrite's check still finds documents after its update: how many, one `_id`,\n\t* and the query that finds them all. Only a data transform's update is the user's to change.\n\t*/\n\tasync documentsStillMatchingFailure(op) {\n\t\tconst [check] = op.postcheck;\n\t\tconst command = check?.source.command;\n\t\tif (check?.expect !== \"notExists\" || !(command instanceof RawAggregateCommand)) return void 0;\n\t\tconst match = Reflect.get(command.pipeline[0] ?? {}, \"$match\");\n\t\tif (typeof match !== \"object\" || match === null) return void 0;\n\t\tconst counted = await this.firstRow({\n\t\t\t...check.source,\n\t\t\tcommand: new RawAggregateCommand(command.collection, [{ $match: match }, { $group: {\n\t\t\t\t_id: null,\n\t\t\t\tdocuments: { $sum: 1 },\n\t\t\t\tdocumentId: { $first: \"$_id\" }\n\t\t\t} }])\n\t\t});\n\t\tconst documents = Number(counted?.[\"documents\"] ?? 0);\n\t\tif (documents === 0) return void 0;\n\t\tconst one = documents === 1;\n\t\tconst documentId = mongoshValue(counted?.[\"documentId\"]);\n\t\tconst query = `db.getCollection(${JSON.stringify(command.collection)}).find(${JSON.stringify(match)})`;\n\t\treturn runnerFailure(\"MIGRATION.POSTCHECK_FAILED\", `Operation ${op.id} failed: after its update, ${documents} ${one ? \"document\" : \"documents\"} in collection ${command.collection} still ${one ? \"matches\" : \"match\"} its check`, {\n\t\t\twhy: [`${one ? \"It has\" : \"One of them has\"} _id ${documentId}. Find them all with ${query} in mongosh.`, op.operationClass === \"data\" ? \"Change the update in the migration's migration.ts so it changes them too, run the file with node, then run the command again; operations that already ran are skipped.\" : \"The update this operation runs did not change them: another client may have written them during the apply, or the value it writes does not pass its own check. Run the command again; operations that already ran are skipped. If they are still found, change them by hand.\"].join(\" \"),\n\t\t\tmeta: {\n\t\t\t\toperationId: op.id,\n\t\t\t\tname: op.name,\n\t\t\t\tdocumentsStillMatching: {\n\t\t\t\t\tcollection: command.collection,\n\t\t\t\t\tdocuments,\n\t\t\t\t\tdocumentId,\n\t\t\t\t\tquery\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* Why a document does not fit a validator, against `shape`: the required fields it lacks, the\n\t* fields whose type the validator does not allow, the fields a closed validator does not name, and\n\t* the same inside each embedded document the validator describes, such as a value object.\n\t*/\n\tasync documentProblems(document, fields, shape, path) {\n\t\tconst nested = await Promise.all([...fields].map(async ([field, { type }]) => {\n\t\t\tconst nestedShape = type === \"object\" ? nestedShapeOf(shape.properties[field]) : void 0;\n\t\t\tif (nestedShape === void 0) return [];\n\t\t\tconst nestedPath = `${path}${field}`;\n\t\t\tconst nestedFields = await this.fieldsOfDocument(document.source, document.collection, document.id, `$${nestedPath}`);\n\t\t\treturn this.documentProblems(document, nestedFields, nestedShape, `${nestedPath}.`);\n\t\t}));\n\t\treturn [...problemsAgainst(fields, shape, path), ...nested.flat()];\n\t}\n\t/**\n\t* The collection as the database has it now: its validator, and what a rewrite's refusals read of\n\t* it, whether it is a time-series collection and its validator's `$jsonSchema`.\n\t*/\n\tasync collectionInPlace(collection) {\n\t\tconst [current] = (await this.deps.inspectionExecutor.listCollections(new ListCollectionsCommand())).filter((info) => info[\"name\"] === collection);\n\t\tconst options = current?.[\"options\"];\n\t\tconst readable = typeof options === \"object\" && options !== null;\n\t\tconst validator = readable ? Reflect.get(options, \"validator\") : void 0;\n\t\treturn {\n\t\t\tvalidator,\n\t\t\trewrite: {\n\t\t\t\ttimeSeries: readable && Reflect.get(options, \"timeseries\") !== void 0,\n\t\t\t\tvalidator: Reflect.get(validator ?? {}, \"$jsonSchema\")\n\t\t\t}\n\t\t};\n\t}\n\t/** Each of `fields` that a document matching `failing` lacks or holds as `null`. */\n\tasync fieldsSomeDocumentLacks(source, collection, failing, fields) {\n\t\treturn (await Promise.all(fields.map(async (field) => unrewritableFieldNameReason(field) === void 0 && await this.firstRow({\n\t\t\t...source,\n\t\t\tcommand: new RawAggregateCommand(collection, [{ $match: { $and: [failing, { [field]: null }] } }, { $limit: 1 }])\n\t\t}) !== void 0 ? [field] : []))).flat();\n\t}\n\t/**\n\t* Each field of the document with `_id`, at `input`, `$$ROOT` or the path of an embedded document:\n\t* its BSON type, read with `$type`, and its value.\n\t*/\n\tasync fieldsOfDocument(source, collection, id, input) {\n\t\tconst fields = (await this.firstRow({\n\t\t\t...source,\n\t\t\tcommand: new RawAggregateCommand(collection, [\n\t\t\t\t{ $match: { _id: id } },\n\t\t\t\t{ $limit: 1 },\n\t\t\t\t{ $project: {\n\t\t\t\t\t_id: 0,\n\t\t\t\t\tfields: { $map: {\n\t\t\t\t\t\tinput: { $objectToArray: input },\n\t\t\t\t\t\tin: [\n\t\t\t\t\t\t\t\"$$this.k\",\n\t\t\t\t\t\t\t{ $type: \"$$this.v\" },\n\t\t\t\t\t\t\t\"$$this.v\"\n\t\t\t\t\t\t]\n\t\t\t\t\t} }\n\t\t\t\t} }\n\t\t\t])\n\t\t}))?.[\"fields\"];\n\t\treturn new Map((Array.isArray(fields) ? fields : []).flatMap((entry) => Array.isArray(entry) && typeof entry[0] === \"string\" && typeof entry[1] === \"string\" ? [[entry[0], {\n\t\t\ttype: entry[1],\n\t\t\tvalue: entry[2]\n\t\t}]] : []));\n\t}\n\tasync firstRow(plan) {\n\t\tconst wireCommand = await this.deps.adapter.lower(plan, {});\n\t\tfor await (const row of this.deps.driver.execute(wireCommand)) return row;\n\t}\n\tasync evaluateDmlChecks(checks, filterEvaluator) {\n\t\tfor (const check of checks) {\n\t\t\tconst matchFound = await this.documentsMatch(check, check.source, filterEvaluator);\n\t\t\tif (!(check.expect === \"exists\" ? matchFound : !matchFound)) return false;\n\t\t}\n\t\treturn true;\n\t}\n\tasync documentsMatch(check, source, filterEvaluator) {\n\t\tconst commandKind = source.command.kind;\n\t\tif (!READ_ONLY_CHECK_COMMAND_KINDS.has(commandKind)) throw mongoTargetError(\"MIGRATION.DATA_TRANSFORM_CHECK_NOT_READ_ONLY\", `Migration check rejected: command kind \"${commandKind}\" is not read-only`, {\n\t\t\twhy: \"A migration check must read with an aggregate or rawAggregate command, so that running it cannot change the database.\",\n\t\t\tfix: \"Write the check's source as an aggregate or rawAggregate pipeline, not a command that writes.\",\n\t\t\tmeta: {\n\t\t\t\tcheckDescription: check.description,\n\t\t\t\tcommandKind,\n\t\t\t\tcollection: source.collection\n\t\t\t}\n\t\t});\n\t\tconst stage = writingStageOf(source.command);\n\t\tif (stage !== void 0) throw mongoTargetError(\"MIGRATION.DATA_TRANSFORM_CHECK_NOT_READ_ONLY\", `Migration check rejected: stage \"${stage}\" is not read-only`, {\n\t\t\twhy: `A migration check must only read, so that running it cannot change the database; the ${stage} stage of its pipeline writes its results to a collection.`,\n\t\t\tfix: `Remove the ${stage} stage from the check's pipeline.`,\n\t\t\tmeta: {\n\t\t\t\tcheckDescription: check.description,\n\t\t\t\tstage,\n\t\t\t\tcollection: source.collection\n\t\t\t}\n\t\t});\n\t\tconst wireCommand = await this.deps.adapter.lower(source, {});\n\t\tfor await (const row of this.deps.driver.execute(wireCommand)) if (filterEvaluator.evaluate(check.filter, row)) return true;\n\t\treturn false;\n\t}\n\tasync evaluateChecks(checks, inspectionExecutor, filterEvaluator) {\n\t\treturn await this.firstFailingCheck(checks, inspectionExecutor, filterEvaluator) === void 0;\n\t}\n\tasync firstFailingCheck(checks, inspectionExecutor, filterEvaluator) {\n\t\tfor (const check of checks) {\n\t\t\tconst matchFound = isInspectionCheckSource(check.source) ? (await check.source.accept(inspectionExecutor)).some((doc) => filterEvaluator.evaluate(check.filter, doc)) : await this.documentsMatch(check, check.source, filterEvaluator);\n\t\t\tif (!(check.expect === \"exists\" ? matchFound : !matchFound)) return check;\n\t\t}\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\nsetFallbackTemporal(Temporal);\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\tlet changedDatabase = false;\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\tdatabaseChangedBefore: changedDatabase\n\t\t\t\t\t});\n\t\t\t\t\tif (!result.ok) return notOk(withFailingSpace(result.failure, space));\n\t\t\t\t\tconst { changedDatabase: spaceChanged, ...value } = result.value;\n\t\t\t\t\tchangedDatabase ||= spaceChanged;\n\t\t\t\t\tperSpaceResults.push({\n\t\t\t\t\t\tspace,\n\t\t\t\t\t\tvalue\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, RenameCollectionCall, RenameFieldCall, UnsetFieldCall, deserializeMongoOp, deserializeMongoOps, mongoTargetDescriptor, renderCallsToTypeScript, renderOps, schemaCollectionToCreateCollectionOptions, schemaIndexToCreateIndexOptions, serializeMongoOps };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,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,yBAAyB,YAAY,wBAAwB,GAAG,OAAO,CAAC,CAAC;EAChH,OAAO,eAAe,MAAM,QAAQ;GACnC,OAAO;GACP,UAAU;GACV,YAAY;GACZ,cAAc;EACf,CAAC;EACD,WAAW,IAAI;CAChB;CACA,IAAI,aAAa;EAChB,OAAO,KAAK,QAAQ,cAAc,OAAO,OAAO,CAAC,CAAC;CACnD;;;;;CAKA,YAAY;EACX,OAAO,KAAK;CACb;;;;;;;CAOA,kBAAkB,gBAAgB;EACjC,OAAO,GAAG,KAAK,GAAG,GAAG;CACtB;AACD;;;;;;;;;;;;;;AAcA,IAAI,6BAA6B,MAAM,mCAAmC,oBAAoB;CAC7F,OAAO,WAAW,IAAI,2BAA2B;CACjD,cAAc;EACb,MAAM,EAAE,IAAI,qBAAqB,CAAC;CACnC;CAC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