@prisma/orm-family-mongo 8.0.0-rc.21-dev.19 → 8.0.0-rc.21-dev.21

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 (106) hide show
  1. package/dist/{contract-builder-Bhh9_UPS.d.mts → contract-builder-CKAOYSpC.d.mts} +2 -8
  2. package/dist/contract-builder-CKAOYSpC.d.mts.map +1 -0
  3. package/dist/{contract-builder-DzeVnjsm.mjs → contract-builder-bpLBqNm-.mjs} +33 -47
  4. package/dist/contract-builder-bpLBqNm-.mjs.map +1 -0
  5. package/dist/contract-prisma6__provider.mjs +6 -14
  6. package/dist/contract-prisma6__provider.mjs.map +1 -1
  7. package/dist/contract-psl.mjs +1 -1
  8. package/dist/contract-psl__provider.mjs +1 -1
  9. package/dist/contract-psl__provider.mjs.map +1 -1
  10. package/dist/contract-ts.d.mts +1 -1
  11. package/dist/contract-ts.mjs +1 -1
  12. package/dist/contract-ts__contract-builder.d.mts +1 -1
  13. package/dist/contract-ts__contract-builder.mjs +1 -1
  14. package/dist/contract.d.mts +2 -2
  15. package/dist/contract.mjs +2 -2
  16. package/dist/{control-D_aaZj4g.mjs → control-CVeZGRjw.mjs} +5 -5
  17. package/dist/{control-D_aaZj4g.mjs.map → control-CVeZGRjw.mjs.map} +1 -1
  18. package/dist/{control-7qLrKCcY.d.mts → control-Cpgdr11Q.d.mts} +5 -5
  19. package/dist/{control-7qLrKCcY.d.mts.map → control-Cpgdr11Q.d.mts.map} +1 -1
  20. package/dist/{control-BdNzdZKQ.d.mts → control-DVHcBUoh.d.mts} +2 -2
  21. package/dist/{control-BdNzdZKQ.d.mts.map → control-DVHcBUoh.d.mts.map} +1 -1
  22. package/dist/{control-adapter-CLIE-kQU-Bp01Cd9h.d.mts → control-adapter-BheElqfe-BVp5aOMr.d.mts} +6 -6
  23. package/dist/{control-adapter-CLIE-kQU-Bp01Cd9h.d.mts.map → control-adapter-BheElqfe-BVp5aOMr.d.mts.map} +1 -1
  24. package/dist/control-adapter-CGIKt9Hq.d.mts +1 -0
  25. package/dist/{dist-CroOs9BN.mjs → dist-BPlVwyAb.mjs} +40 -2
  26. package/dist/dist-BPlVwyAb.mjs.map +1 -0
  27. package/dist/dist-BhDqnAiz.mjs.map +1 -1
  28. package/dist/{dist-B1afy6LD.mjs → dist-BwYedu6-.mjs} +2 -2
  29. package/dist/{dist-B1afy6LD.mjs.map → dist-BwYedu6-.mjs.map} +1 -1
  30. package/dist/{execution-BCgTPyx1.d.mts → execution-CZhOXkot.d.mts} +2 -2
  31. package/dist/{execution-BCgTPyx1.d.mts.map → execution-CZhOXkot.d.mts.map} +1 -1
  32. package/dist/{exports-BAimNKOs.mjs → exports-B2tu3O-g.mjs} +3 -41
  33. package/dist/exports-B2tu3O-g.mjs.map +1 -0
  34. package/dist/family.d.mts +9 -9
  35. package/dist/family.mjs +7 -7
  36. package/dist/family__control-adapter.d.mts +2 -2
  37. package/dist/family__control.d.mts +1 -1
  38. package/dist/family__control.mjs +2 -2
  39. package/dist/family__ir.d.mts +2 -2
  40. package/dist/family__ir.mjs +3 -3
  41. package/dist/family__migration.d.mts +1 -1
  42. package/dist/family__migration.mjs +1 -1
  43. package/dist/family__pack.mjs +1 -1
  44. package/dist/family__runtime.d.mts +2 -2
  45. package/dist/family__runtime.mjs +1 -1
  46. package/dist/family__schema-verify.d.mts +1 -1
  47. package/dist/family__schema-verify.mjs +1 -1
  48. package/dist/{field-accessor-CqKt9hxI-BmcdFwrk.d.mts → field-accessor-CqKt9hxI-Co64FQ3V.d.mts} +3 -3
  49. package/dist/{field-accessor-CqKt9hxI-BmcdFwrk.d.mts.map → field-accessor-CqKt9hxI-Co64FQ3V.d.mts.map} +1 -1
  50. package/dist/{index-CgvlbMOw.d.mts → index-B3o8NFNH.d.mts} +17 -3
  51. package/dist/index-B3o8NFNH.d.mts.map +1 -0
  52. package/dist/{index-BvhsteM2.d.mts → index-Bh6a8q-2.d.mts} +10 -7
  53. package/dist/{index-BvhsteM2.d.mts.map → index-Bh6a8q-2.d.mts.map} +1 -1
  54. package/dist/{index-LvXZZ_jC.d.mts → index-BonKbeyU.d.mts} +102 -110
  55. package/dist/index-BonKbeyU.d.mts.map +1 -0
  56. package/dist/{index-BmMMEdyQ.d.mts → index-D9TThYU9.d.mts} +3 -3
  57. package/dist/{index-BmMMEdyQ.d.mts.map → index-D9TThYU9.d.mts.map} +1 -1
  58. package/dist/{interpreter-DqVj74Rn-DgfRcygL.mjs → interpreter-K6G8SumZ-DVZw4CFe.mjs} +5 -7
  59. package/dist/interpreter-K6G8SumZ-DVZw4CFe.mjs.map +1 -0
  60. package/dist/{ir-FZi5ql4K.mjs → ir-C7oVYJg2.mjs} +2 -2
  61. package/dist/{ir-FZi5ql4K.mjs.map → ir-C7oVYJg2.mjs.map} +1 -1
  62. package/dist/{ir-MBl4vT_o.d.mts → ir-ZONNL1YV.d.mts} +3 -3
  63. package/dist/{ir-MBl4vT_o.d.mts.map → ir-ZONNL1YV.d.mts.map} +1 -1
  64. package/dist/lowering.d.mts +2 -2
  65. package/dist/{migration-KD7yy64Y.mjs → migration-C0N4Uamo.mjs} +2 -2
  66. package/dist/{migration-KD7yy64Y.mjs.map → migration-C0N4Uamo.mjs.map} +1 -1
  67. package/dist/{migration-xxic7RBq.d.mts → migration-RzYuoweU.d.mts} +4 -4
  68. package/dist/{migration-xxic7RBq.d.mts.map → migration-RzYuoweU.d.mts.map} +1 -1
  69. package/dist/{mongo-contract-serializer-BBknnHWy-yE74wFbz.mjs → mongo-contract-serializer-BBknnHWy-CZOnQGdR.mjs} +2 -2
  70. package/dist/{mongo-contract-serializer-BBknnHWy-yE74wFbz.mjs.map → mongo-contract-serializer-BBknnHWy-CZOnQGdR.mjs.map} +1 -1
  71. package/dist/{mongo-contract-view-AnejqfrQ-DJ2JKgA-.d.mts → mongo-contract-view-AnejqfrQ-k0FbFieN.d.mts} +2 -2
  72. package/dist/{mongo-contract-view-AnejqfrQ-DJ2JKgA-.d.mts.map → mongo-contract-view-AnejqfrQ-k0FbFieN.d.mts.map} +1 -1
  73. package/dist/{mongo-contract-view-CF5trX6R-D_Bus9dt.mjs → mongo-contract-view-CF5trX6R-BCPkEgiL.mjs} +3 -3
  74. package/dist/{mongo-contract-view-CF5trX6R-D_Bus9dt.mjs.map → mongo-contract-view-CF5trX6R-BCPkEgiL.mjs.map} +1 -1
  75. package/dist/orm.d.mts +2 -2
  76. package/dist/orm.mjs +2 -2
  77. package/dist/query-ast.d.mts +2 -2
  78. package/dist/query-ast__control.d.mts +1 -1
  79. package/dist/query-ast__execution.d.mts +1 -1
  80. package/dist/query-builder.d.mts +3 -3
  81. package/dist/query-builder.mjs +1 -1
  82. package/dist/query-builder__contract-free.d.mts +3 -3
  83. package/dist/{runtime-CXoFcIme.d.mts → runtime-D_E5N6Ii.d.mts} +2 -2
  84. package/dist/runtime-D_E5N6Ii.d.mts.map +1 -0
  85. package/dist/runtime.d.mts +21 -10
  86. package/dist/runtime.d.mts.map +1 -1
  87. package/dist/runtime.mjs +19 -3
  88. package/dist/runtime.mjs.map +1 -1
  89. package/dist/schema-ir.d.mts +2 -2
  90. package/dist/schema-ir.mjs +2 -2
  91. package/dist/{schema-verify-DldhIjOX.d.mts → schema-verify-BTRGeQWE.d.mts} +3 -3
  92. package/dist/{schema-verify-DldhIjOX.d.mts.map → schema-verify-BTRGeQWE.d.mts.map} +1 -1
  93. package/dist/{verify-mongo-schema-nsnAhPm8-DvsVH5bL.mjs → verify-mongo-schema-CyvUewwP-Dl3QC2wh.mjs} +24 -6
  94. package/dist/verify-mongo-schema-CyvUewwP-Dl3QC2wh.mjs.map +1 -0
  95. package/dist/wire.d.mts +2 -2
  96. package/package.json +20 -20
  97. package/dist/contract-builder-Bhh9_UPS.d.mts.map +0 -1
  98. package/dist/contract-builder-DzeVnjsm.mjs.map +0 -1
  99. package/dist/control-adapter-DoykpdEX.d.mts +0 -1
  100. package/dist/dist-CroOs9BN.mjs.map +0 -1
  101. package/dist/exports-BAimNKOs.mjs.map +0 -1
  102. package/dist/index-CgvlbMOw.d.mts.map +0 -1
  103. package/dist/index-LvXZZ_jC.d.mts.map +0 -1
  104. package/dist/interpreter-DqVj74Rn-DgfRcygL.mjs.map +0 -1
  105. package/dist/runtime-CXoFcIme.d.mts.map +0 -1
  106. package/dist/verify-mongo-schema-nsnAhPm8-DvsVH5bL.mjs.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/orm-family-mongo",
3
- "version": "8.0.0-rc.21-dev.19",
3
+ "version": "8.0.0-rc.21-dev.21",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -9,30 +9,30 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@prisma/orm-framework": "8.0.0-rc.21-dev.19",
13
- "@prisma/orm-toolchain": "8.0.0-rc.21-dev.19",
12
+ "@prisma/orm-framework": "8.0.0-rc.21-dev.21",
13
+ "@prisma/orm-toolchain": "8.0.0-rc.21-dev.21",
14
14
  "arktype": "^2.2.2",
15
15
  "mongodb": "^7.4.0",
16
16
  "pathe": "^2.0.3"
17
17
  },
18
18
  "devDependencies": {
19
- "@internal/family-mongo": "8.0.0-rc.21-dev.19",
20
- "@internal/mongo-codec": "8.0.0-rc.21-dev.19",
21
- "@internal/mongo-contract": "8.0.0-rc.21-dev.19",
22
- "@internal/mongo-contract-prisma6": "8.0.0-rc.21-dev.19",
23
- "@internal/mongo-contract-psl": "8.0.0-rc.21-dev.19",
24
- "@internal/mongo-contract-ts": "8.0.0-rc.21-dev.19",
25
- "@internal/mongo-emitter": "8.0.0-rc.21-dev.19",
26
- "@internal/mongo-lowering": "8.0.0-rc.21-dev.19",
27
- "@internal/mongo-orm": "8.0.0-rc.21-dev.19",
28
- "@internal/mongo-query-ast": "8.0.0-rc.21-dev.19",
29
- "@internal/mongo-query-builder": "8.0.0-rc.21-dev.19",
30
- "@internal/mongo-runtime": "8.0.0-rc.21-dev.19",
31
- "@internal/mongo-schema-ir": "8.0.0-rc.21-dev.19",
32
- "@internal/mongo-value": "8.0.0-rc.21-dev.19",
33
- "@internal/mongo-wire": "8.0.0-rc.21-dev.19",
34
- "@repo/tsconfig": "8.0.0-rc.21-dev.19",
35
- "@repo/tsdown": "8.0.0-rc.21-dev.19",
19
+ "@internal/family-mongo": "8.0.0-rc.21-dev.21",
20
+ "@internal/mongo-codec": "8.0.0-rc.21-dev.21",
21
+ "@internal/mongo-contract": "8.0.0-rc.21-dev.21",
22
+ "@internal/mongo-contract-prisma6": "8.0.0-rc.21-dev.21",
23
+ "@internal/mongo-contract-psl": "8.0.0-rc.21-dev.21",
24
+ "@internal/mongo-contract-ts": "8.0.0-rc.21-dev.21",
25
+ "@internal/mongo-emitter": "8.0.0-rc.21-dev.21",
26
+ "@internal/mongo-lowering": "8.0.0-rc.21-dev.21",
27
+ "@internal/mongo-orm": "8.0.0-rc.21-dev.21",
28
+ "@internal/mongo-query-ast": "8.0.0-rc.21-dev.21",
29
+ "@internal/mongo-query-builder": "8.0.0-rc.21-dev.21",
30
+ "@internal/mongo-runtime": "8.0.0-rc.21-dev.21",
31
+ "@internal/mongo-schema-ir": "8.0.0-rc.21-dev.21",
32
+ "@internal/mongo-value": "8.0.0-rc.21-dev.21",
33
+ "@internal/mongo-wire": "8.0.0-rc.21-dev.21",
34
+ "@repo/tsconfig": "8.0.0-rc.21-dev.21",
35
+ "@repo/tsdown": "8.0.0-rc.21-dev.21",
36
36
  "tsdown": "0.22.14",
37
37
  "typescript": "5.9.3"
38
38
  },
@@ -1 +0,0 @@
1
- {"version":3,"file":"contract-builder-Bhh9_UPS.d.mts","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-ts/dist/contract-builder.d.mts"],"mappings":";;;;;;;;;;;;;KAWK;WACM;WACA;;WAEA;WACA;;WAEA;WACA,OAAO;WACP;;WAEA;WACA;;WAEA;WACA;WACA;;;;WAIA;WACA;WACA;;WAEA;WACA;WACA;;;;WAIA;W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S,eAAe;WACxB,eAAe,eAAe;WAC9B,QAAQ,eAAe;GAC/B,QAAQ,GAAG,QAAQ,GAAG,YAAY,YAAY,UAAU,SAAS,yBAAyB,GAAG,GAAG,YAAY,+BAA+B,QAAQ,oBAAoB,iBAAiB,aAAa,OAAO,GAAG;iBACjM,qBAAqB,mBAAmB,cAAc,uBAAuB,+BAA+B,eAAe,kBAAkB,eAAe,wBAAwB,eAAe,+CAA+C,eAAe,8BAA8B,YAAY,aAAa,oBAAoB;iBAC5U,qBAAqB,mBAAmB,iBAAiB,uBAAuB,+BAA+B,eAAe,+CAA+C,eAAe,oCAAoC;WACtO,SAAS,eAAe;WACxB,eAAe,eAAe;WAC9B,QAAQ,eAAe;GAC/B,YAAY,YAAY,UAAU,SAAS,yBAAyB,sBAAsB,sBAAsB,mBAAmB,iBAAiB,QAAQ,oBAAoB,aAAa"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"contract-builder-DzeVnjsm.mjs","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-ts/dist/contract-builder.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { buildExecutionSection, computeProfileHash } from \"@internal/contract/hashing\";\nimport { assembleGeneratorFunctions, createGeneratorHelpers } from \"@internal/framework-components/components\";\nimport { MongoCollectionOptions, MongoIndex, applyPolymorphicScopeToMongoIndex, buildMongoStorage, deriveCollectionValidators, mongoContractRefusalsOf, mongoValueSetsOf, unsupportedStoredNameReason } from \"@internal/mongo-contract\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { crossRef } from \"@internal/contract/types\";\nimport { answerMissingPropertyReads, bindEnumType, composePackAuthoringNamespace, createEntityHelpersFromNamespace, enumMemberError, enumType, isEnumTypeHandle, member, resolveToOneRelationNullable } from \"@internal/contract-authoring\";\nimport { applyDiscriminatorRule, assembleDataTypeSupport, assertNoCrossRegistryCollisions, assertTypeAliasesValid, encodeEnumMembers, flushAuthoringWarnings } from \"@internal/framework-components/authoring\";\nimport { codecTypeParamsProblem } from \"@internal/mongo-contract/data-type\";\nimport { extractCodecLookup } from \"@internal/framework-components/control\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/build-refusals.ts\nfunction modelFieldKey(model, field) {\n\treturn {\n\t\tkind: \"field\",\n\t\towner: {\n\t\t\tkind: \"model\",\n\t\t\tname: model\n\t\t},\n\t\tfield\n\t};\n}\nfunction valueObjectFieldKey(valueObject, field) {\n\treturn {\n\t\tkind: \"field\",\n\t\towner: {\n\t\t\tkind: \"valueObject\",\n\t\t\tname: valueObject\n\t\t},\n\t\tfield\n\t};\n}\n/** The key of a validator refusal: the part of the definition its subject names. */\nfunction validatorRefusalKey(refusal) {\n\tswitch (refusal.kind) {\n\t\tcase \"embeddedModelHasVariants\": return {\n\t\t\tkind: \"relation\",\n\t\t\tmodel: refusal.modelName,\n\t\t\trelation: refusal.relationName\n\t\t};\n\t\tcase \"enumBsonType\":\n\t\tcase \"enumNotListable\": return {\n\t\t\tkind: \"enum\",\n\t\t\tenumName: refusal.enumName\n\t\t};\n\t\tcase \"enumMemberNotListable\": return {\n\t\t\tkind: \"enumMember\",\n\t\t\tenumName: refusal.enumName,\n\t\t\tmember: refusal.member\n\t\t};\n\t\tcase \"fieldBsonType\": return {\n\t\t\tkind: \"field\",\n\t\t\towner: refusal.owner,\n\t\t\tfield: refusal.fieldName\n\t\t};\n\t\tcase \"documentId\": return modelFieldKey(refusal.modelName, refusal.fieldName);\n\t}\n}\n//#endregion\n//#region src/build-models.ts\nfunction storedNameOf(field) {\n\treturn field.storedName ?? field.fieldName;\n}\n/** The name documents store `fieldName` under, or `fieldName` itself when the fields do not declare it. */\nfunction storedFieldNameIn(fields, fieldName) {\n\tconst field = fields.find((candidate) => candidate.fieldName === fieldName);\n\treturn field === void 0 ? fieldName : storedNameOf(field);\n}\nfunction fieldWithoutValueSet(field) {\n\treturn {\n\t\ttype: field.type,\n\t\tnullable: field.nullable,\n\t\tmany: field.many\n\t};\n}\n/** A model's fields. A field an enum types refers to the domain enum. */\nfunction buildFields(fields, namespaceId) {\n\treturn Object.fromEntries(fields.map((field) => [field.fieldName, {\n\t\t...fieldWithoutValueSet(field),\n\t\t...ifDefined(\"valueSet\", field.enumName === void 0 ? void 0 : {\n\t\t\tplane: \"domain\",\n\t\t\tentityKind: \"enum\",\n\t\t\tnamespaceId,\n\t\t\tentityName: field.enumName\n\t\t})\n\t}]));\n}\n/** A value object's members. A value object is a storage entity, and storage never refers to the domain plane, so a member an enum types refers to the enum's storage value set. */\nfunction buildValueObjectMembers(fields, namespaceId) {\n\treturn Object.fromEntries(fields.map((field) => [field.fieldName, {\n\t\t...fieldWithoutValueSet(field),\n\t\t...ifDefined(\"valueSet\", field.enumName === void 0 ? void 0 : {\n\t\t\tplane: \"storage\",\n\t\t\tentityKind: \"valueSet\",\n\t\t\tnamespaceId,\n\t\t\tentityName: field.enumName\n\t\t})\n\t}]));\n}\nfunction buildStorageFields(modelName, fields, refusals) {\n\tconst storageFields = {};\n\tconst fieldsByStoredName = /* @__PURE__ */ new Map();\n\tfor (const field of fields) {\n\t\tconst { fieldName } = field;\n\t\tconst key = modelFieldKey(modelName, fieldName);\n\t\tconst storedName = storedNameOf(field);\n\t\tconst unsupported = unsupportedStoredNameReason(storedName);\n\t\tif (unsupported !== void 0) refusals.push({\n\t\t\tkind: \"storedNameUnsupported\",\n\t\t\tkey,\n\t\t\treason: unsupported\n\t\t});\n\t\tconst firstField = fieldsByStoredName.get(storedName);\n\t\tif (firstField !== void 0) {\n\t\t\trefusals.push({\n\t\t\t\tkind: \"storedNameDuplicate\",\n\t\t\t\tkey,\n\t\t\t\tstoredName,\n\t\t\t\tfirstField\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tfieldsByStoredName.set(storedName, fieldName);\n\t\tstorageFields[fieldName] = { field: storedName };\n\t}\n\treturn storageFields;\n}\nfunction toOneRelationNullable(key, relation, fields, refusals) {\n\tconst ownsForeignKey = relation.cardinality !== \"1:1\";\n\tconst localFields = [];\n\tif (ownsForeignKey) for (const fieldName of relation.on.localFields) {\n\t\tconst localField = fields.find((field) => field.fieldName === fieldName);\n\t\tif (localField === void 0) {\n\t\t\trefusals.push({\n\t\t\t\tkind: \"relationLocalFieldUnknown\",\n\t\t\t\tkey,\n\t\t\t\tfieldName\n\t\t\t});\n\t\t\treturn relation.nullable ?? false;\n\t\t}\n\t\tlocalFields.push(localField);\n\t}\n\tconst { nullable, contradiction } = resolveToOneRelationNullable({\n\t\tdeclaredNullable: relation.nullable,\n\t\tlocalFieldNullability: localFields.map((localField) => localField.nullable === true),\n\t\townsReference: ownsForeignKey\n\t});\n\tif (contradiction !== void 0) refusals.push({\n\t\tkind: \"relationNullability\",\n\t\tkey,\n\t\townsForeignKey,\n\t\tcontradiction\n\t});\n\treturn nullable;\n}\nfunction buildRelation(model, relation, namespaceId, refusals) {\n\tconst to = crossRef(relation.toModel, namespaceId);\n\tif (relation.on === void 0) return {\n\t\tto,\n\t\tcardinality: relation.cardinality\n\t};\n\tif (relation.cardinality === \"1:N\") return {\n\t\tto,\n\t\tcardinality: \"1:N\",\n\t\ton: relation.on\n\t};\n\tconst key = {\n\t\tkind: \"relation\",\n\t\tmodel: model.modelName,\n\t\trelation: relation.relationName\n\t};\n\treturn {\n\t\tto,\n\t\tcardinality: relation.cardinality,\n\t\tnullable: toOneRelationNullable(key, relation, model.fields, refusals),\n\t\ton: relation.on\n\t};\n}\nfunction buildValueObjects(valueObjects, namespaceId, refusals) {\n\tconst builtValueObjects = {};\n\tfor (const valueObject of valueObjects ?? []) {\n\t\tif (valueObject.name in builtValueObjects) {\n\t\t\trefusals.push({\n\t\t\t\tkind: \"duplicateValueObject\",\n\t\t\t\tkey: {\n\t\t\t\t\tkind: \"valueObject\",\n\t\t\t\t\tvalueObject: valueObject.name\n\t\t\t\t}\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const field of valueObject.fields) if (field.storedName !== void 0) refusals.push({\n\t\t\tkind: \"valueObjectFieldStoredName\",\n\t\t\tkey: valueObjectFieldKey(valueObject.name, field.fieldName)\n\t\t});\n\t\tbuiltValueObjects[valueObject.name] = { fields: buildValueObjectMembers(valueObject.fields, namespaceId) };\n\t}\n\treturn builtValueObjects;\n}\n/**\n* Refuses a variant field stored under a name another field of its base is stored under. A variant's documents hold its base's fields too, so the two would overwrite each other, the discriminator included. A variant that restates a base field under the same name restates that field.\n*/\nfunction restatementDifferences(variantField, baseField) {\n\tconst differences = [];\n\tif (storedNameOf(variantField) !== storedNameOf(baseField)) differences.push(\"storedName\");\n\tif (canonicalStringify([variantField.type, variantField.enumName]) !== canonicalStringify([baseField.type, baseField.enumName])) differences.push(\"type\");\n\tif (variantField.nullable !== baseField.nullable) differences.push(\"nullable\");\n\tif (canonicalStringify(variantField.many) !== canonicalStringify(baseField.many)) differences.push(\"many\");\n\treturn differences;\n}\n/**\n* A variant's documents hold its base's fields too, and its collection's validator is written from the base. A variant field may restate a base field only exactly, and may not take a stored name a different base field uses.\n*/\nfunction checkFieldsAgainstBase(variant, models, refusals) {\n\tif (variant.base === void 0) return;\n\tconst baseName = variant.base.model;\n\tconst base = models.find((model) => model.modelName === baseName);\n\tif (base === void 0) return;\n\tconst baseFieldsByName = new Map(base.fields.map((field) => [field.fieldName, field]));\n\tconst baseFieldsByStoredName = new Map(base.fields.map((field) => [storedNameOf(field), field]));\n\tfor (const field of variant.fields) {\n\t\tconst key = modelFieldKey(variant.modelName, field.fieldName);\n\t\tconst restated = baseFieldsByName.get(field.fieldName);\n\t\tif (restated !== void 0) {\n\t\t\tconst differences = restatementDifferences(field, restated);\n\t\t\tif (differences.length > 0) refusals.push({\n\t\t\t\tkind: \"restatedBaseFieldDiffers\",\n\t\t\t\tkey,\n\t\t\t\tbaseModel: baseName,\n\t\t\t\tdifferences\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst storedName = storedNameOf(field);\n\t\tconst baseField = baseFieldsByStoredName.get(storedName);\n\t\tif (baseField === void 0) continue;\n\t\trefusals.push({\n\t\t\tkind: \"storedNameSharedWithBase\",\n\t\t\tkey,\n\t\t\tstoredName,\n\t\t\tbaseModel: baseName,\n\t\t\tbaseField: baseField.fieldName\n\t\t});\n\t}\n}\n/**\n* Each model of the contract. `variantValues` holds each accepted variant's discriminator value as its base's field stores it; a base lists those variants.\n*/\nfunction buildModels(input) {\n\tconst { models, variantValues, namespaceId, refusals } = input;\n\tconst builtModels = {};\n\tfor (const model of models) {\n\t\tconst { modelName } = model;\n\t\tif (modelName in builtModels) {\n\t\t\trefusals.push({\n\t\t\t\tkind: \"duplicateModel\",\n\t\t\t\tkey: {\n\t\t\t\t\tkind: \"model\",\n\t\t\t\t\tmodel: modelName\n\t\t\t\t}\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tcheckFieldsAgainstBase(model, models, refusals);\n\t\tconst storage = {\n\t\t\t...model.collection ? { collection: model.collection } : {},\n\t\t\tfields: buildStorageFields(modelName, model.fields, refusals),\n\t\t\t...model.storageRelations ? { relations: model.storageRelations } : {}\n\t\t};\n\t\tconst variants = model.discriminator === void 0 ? void 0 : models.flatMap((variant) => {\n\t\t\tconst value = variantValues.get(variant.modelName);\n\t\t\treturn variant.base?.model === modelName && value !== void 0 ? [[value, crossRef(variant.modelName, namespaceId)]] : [];\n\t\t});\n\t\tbuiltModels[modelName] = {\n\t\t\tfields: buildFields(model.fields, namespaceId),\n\t\t\trelations: Object.fromEntries((model.relations ?? []).map((relation) => [relation.relationName, buildRelation(model, relation, namespaceId, refusals)])),\n\t\t\tstorage,\n\t\t\t...model.owner ? { owner: model.owner } : {},\n\t\t\t...model.base ? { base: crossRef(model.base.model, namespaceId) } : {},\n\t\t\t...model.discriminator ? { discriminator: { field: model.discriminator.field } } : {},\n\t\t\t...variants === void 0 ? {} : { variants: Object.fromEntries(variants) }\n\t\t};\n\t}\n\treturn builtModels;\n}\nfunction buildRoots(definition, models, namespaceId) {\n\tif (definition.roots !== void 0) return Object.fromEntries(Object.entries(definition.roots).map(([rootName, modelName]) => [rootName, crossRef(modelName, namespaceId)]));\n\tconst roots = {};\n\tfor (const model of models) {\n\t\tif (!model.collection || model.owner || model.base) continue;\n\t\troots[model.collection] = crossRef(model.modelName, namespaceId);\n\t}\n\treturn roots;\n}\n//#endregion\n//#region src/build-collections.ts\n/**\n* A key-sorted signature of a storage index, used only to find duplicate indexes. `canonicalStringify` refuses class instances such as `MongoIndex`, so this reads their enumerable properties instead.\n*/\nfunction stableStringify(value) {\n\tif (Array.isArray(value)) return `[${value.map(stableStringify).join(\",\")}]`;\n\tif (value && typeof value === \"object\") return `{${Object.entries(value).sort(([left], [right]) => left.localeCompare(right)).map(([key, entry]) => `${JSON.stringify(key)}:${stableStringify(entry)}`).join(\",\")}}`;\n\treturn JSON.stringify(value);\n}\nfunction storedIndexKey(fields, key) {\n\tconst scope = key.match(/^(.+)\\.\\$\\*\\*$/)?.[1];\n\tif (scope !== void 0) return `${storedFieldNameIn(fields, scope)}.$**`;\n\treturn key === \"$**\" ? key : storedFieldNameIn(fields, key);\n}\nfunction toStorageIndex(index, fields) {\n\tconst input = { keys: Object.entries(index.fields).map(([field, direction]) => ({\n\t\tfield: storedIndexKey(fields, field),\n\t\tdirection\n\t})) };\n\tif (index.options) {\n\t\tfor (const [key, value] of Object.entries(index.options)) if (value !== void 0) input[key] = value;\n\t}\n\treturn new MongoIndex(blindCast(input));\n}\nfunction toStorageCollectionOptions(opts) {\n\treturn new MongoCollectionOptions({\n\t\t...opts.capped ? { capped: {\n\t\t\tsize: opts.size ?? 0,\n\t\t\t...opts.max != null && { max: opts.max }\n\t\t} } : {},\n\t\t...ifDefined(\"storageEngine\", opts.storageEngine),\n\t\t...ifDefined(\"indexOptionDefaults\", opts.indexOptionDefaults),\n\t\t...ifDefined(\"collation\", opts.collation),\n\t\t...ifDefined(\"timeseries\", opts.timeseries),\n\t\t...opts.clusteredIndex !== void 0 && { clusteredIndex: opts.clusteredIndex.name !== void 0 ? { name: opts.clusteredIndex.name } : {} },\n\t\t...ifDefined(\"expireAfterSeconds\", opts.expireAfterSeconds),\n\t\t...ifDefined(\"changeStreamPreAndPostImages\", opts.changeStreamPreAndPostImages)\n\t});\n}\nfunction findMissingIndexField(index, fields) {\n\tfor (const fieldName of Object.keys(index.fields)) {\n\t\tconst wildcardMatch = fieldName.match(/^(.+)\\.\\$\\*\\*$/);\n\t\tconst lookupName = wildcardMatch ? wildcardMatch[1] : fieldName;\n\t\tif (lookupName === void 0 || lookupName.length === 0) continue;\n\t\tif (lookupName === \"$**\") continue;\n\t\tif (!fields.some((field) => field.fieldName === lookupName)) return lookupName;\n\t}\n}\nfunction isWildcardKey(key) {\n\treturn key === \"$**\" || key.endsWith(\".$**\");\n}\nfunction isTextIndex(index) {\n\treturn Object.values(index.fields).includes(\"text\");\n}\n/** The first shape rule an index breaks, of those MongoDB enforces when it creates the index. */\nfunction indexShapeProblem(index) {\n\tconst keys = Object.entries(index.fields);\n\tconst hasWildcard = keys.some(([key]) => isWildcardKey(key));\n\tconst directions = keys.map(([, direction]) => direction);\n\tconst options = index.options ?? {};\n\tif (hasWildcard && options.unique) return \"unique-wildcard\";\n\tif (hasWildcard && directions.some((direction) => [\n\t\t\"hashed\",\n\t\t\"2d\",\n\t\t\"2dsphere\"\n\t].includes(String(direction)))) return \"wildcard-with-type\";\n\tif (directions.includes(\"hashed\") && keys.length > 1) return \"hashed-several-fields\";\n\tif (hasWildcard && options.expireAfterSeconds !== void 0) return \"ttl-with-wildcard\";\n\tif (!hasWildcard && options.wildcardProjection !== void 0) return \"projection-without-wildcard\";\n\tif (options.collation !== void 0 && !options.collation.locale) return \"collation-without-locale\";\n}\nfunction resolveVariantScope(model, modelsByName, variantValues) {\n\tif (!model.base) return void 0;\n\tconst base = modelsByName.get(model.base.model);\n\tconst discriminatorField = base?.discriminator?.field;\n\tconst discriminatorValue = variantValues.get(model.modelName);\n\tif (base === void 0 || !discriminatorField || discriminatorValue === void 0) return;\n\treturn {\n\t\tdiscriminatorField: storedFieldNameIn(base.fields, discriminatorField),\n\t\tdiscriminatorValue\n\t};\n}\nfunction checkNoCollectionSettings(model, refusals) {\n\tconst key = {\n\t\tkind: \"collectionSettings\",\n\t\tmodel: model.modelName\n\t};\n\tif (model.indexes && model.indexes.length > 0) refusals.push({\n\t\tkind: \"collectionSettingWithoutCollection\",\n\t\tkey,\n\t\tsetting: \"indexes\"\n\t});\n\tif (model.collectionOptions) refusals.push({\n\t\tkind: \"collectionSettingWithoutCollection\",\n\t\tkey,\n\t\tsetting: \"collectionOptions\"\n\t});\n\tif (model.controlPolicy) refusals.push({\n\t\tkind: \"collectionSettingWithoutCollection\",\n\t\tkey,\n\t\tsetting: \"controlPolicy\"\n\t});\n}\n/** Each collection the models are stored in, with its indexes, options and control policy. Validators are added later. */\nfunction buildCollections(input) {\n\tconst { models, variantValues, refusals } = input;\n\tconst intermediate = {};\n\tconst declaredIndexOwners = /* @__PURE__ */ new Map();\n\tconst textIndexCollections = /* @__PURE__ */ new Set();\n\tconst modelsByName = new Map(models.map((model) => [model.modelName, model]));\n\tfor (const model of models) {\n\t\tconst { modelName, collection } = model;\n\t\tif (!collection) {\n\t\t\tcheckNoCollectionSettings(model, refusals);\n\t\t\tcontinue;\n\t\t}\n\t\tconst collectionKey = {\n\t\t\tkind: \"collectionSettings\",\n\t\t\tmodel: modelName\n\t\t};\n\t\tconst existingCollection = intermediate[collection] ?? {};\n\t\tconst existingIndexes = existingCollection.indexes ?? [];\n\t\tif (existingCollection.options && model.collectionOptions) refusals.push({\n\t\t\tkind: \"collectionSettingTwice\",\n\t\t\tkey: collectionKey,\n\t\t\tsetting: \"collectionOptions\",\n\t\t\tcollection\n\t\t});\n\t\tif (existingCollection.control !== void 0 && model.controlPolicy) refusals.push({\n\t\t\tkind: \"collectionSettingTwice\",\n\t\t\tkey: collectionKey,\n\t\t\tsetting: \"controlPolicy\",\n\t\t\tcollection\n\t\t});\n\t\tconst polymorphicScope = resolveVariantScope(model, modelsByName, variantValues);\n\t\tconst storageIndexes = [];\n\t\t(model.indexes ?? []).forEach((written, position) => {\n\t\t\tconst key = {\n\t\t\t\tkind: \"index\",\n\t\t\t\tmodel: modelName,\n\t\t\t\tposition\n\t\t\t};\n\t\t\tconst signature = canonicalStringify(written);\n\t\t\tconst missingField = findMissingIndexField(written, model.fields);\n\t\t\tif (missingField !== void 0) {\n\t\t\t\trefusals.push({\n\t\t\t\t\tkind: \"indexFieldUnknown\",\n\t\t\t\t\tkey,\n\t\t\t\t\tfieldName: missingField,\n\t\t\t\t\tsignature\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst shapeProblem = indexShapeProblem(written);\n\t\t\tif (shapeProblem !== void 0) {\n\t\t\t\trefusals.push({\n\t\t\t\t\tkind: \"indexShape\",\n\t\t\t\t\tkey,\n\t\t\t\t\trule: shapeProblem,\n\t\t\t\t\tsignature\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (isTextIndex(written)) {\n\t\t\t\tif (textIndexCollections.has(collection)) {\n\t\t\t\t\trefusals.push({\n\t\t\t\t\t\tkind: \"indexShape\",\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\trule: \"second-text-index\",\n\t\t\t\t\t\tsignature\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttextIndexCollections.add(collection);\n\t\t\t}\n\t\t\tconst storageIndex = toStorageIndex(written, model.fields);\n\t\t\tconst scoped = polymorphicScope === void 0 ? {\n\t\t\t\tkind: \"ok\",\n\t\t\t\tindex: storageIndex\n\t\t\t} : applyPolymorphicScopeToMongoIndex(storageIndex, polymorphicScope);\n\t\t\tif (scoped.kind === \"conflict\") {\n\t\t\t\trefusals.push({\n\t\t\t\t\tkind: \"indexScopeConflict\",\n\t\t\t\t\tkey,\n\t\t\t\t\treason: scoped.reason,\n\t\t\t\t\tsignature\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst collectionIndexKey = `${collection}:${stableStringify(scoped.index)}`;\n\t\t\tconst firstModel = declaredIndexOwners.get(collectionIndexKey);\n\t\t\tif (firstModel !== void 0) {\n\t\t\t\trefusals.push({\n\t\t\t\t\tkind: \"indexDuplicate\",\n\t\t\t\t\tkey,\n\t\t\t\t\tcollection,\n\t\t\t\t\tfirstModel,\n\t\t\t\t\tsignature\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdeclaredIndexOwners.set(collectionIndexKey, modelName);\n\t\t\tstorageIndexes.push(scoped.index);\n\t\t});\n\t\tconst storageOptions = model.collectionOptions ? toStorageCollectionOptions(model.collectionOptions) : void 0;\n\t\tconst controlPatch = model.controlPolicy !== void 0 ? { control: model.controlPolicy } : {};\n\t\tintermediate[collection] = storageIndexes.length > 0 ? {\n\t\t\t...existingCollection,\n\t\t\tindexes: [...existingIndexes, ...storageIndexes],\n\t\t\t...storageOptions ? { options: storageOptions } : {},\n\t\t\t...controlPatch\n\t\t} : storageOptions ? {\n\t\t\t...existingCollection,\n\t\t\toptions: storageOptions,\n\t\t\t...controlPatch\n\t\t} : Object.keys(controlPatch).length > 0 ? {\n\t\t\t...existingCollection,\n\t\t\t...controlPatch\n\t\t} : existingCollection;\n\t}\n\treturn intermediate;\n}\n//#endregion\n//#region src/build-enums.ts\n/** Each enum with its members as its codec stores them. An enum the builder refuses is left out. */\nfunction buildEnums(definition, codecLookup, refusals) {\n\tconst builtEnums = {};\n\tfor (const [enumName, handle] of Object.entries(definition.enums ?? {})) {\n\t\tconst encoded = encodeEnumMembers(handle, codecLookup);\n\t\tif (!encoded.ok) {\n\t\t\tfor (const problem of encoded.failure) refusals.push({\n\t\t\t\tkind: \"enumMemberProblem\",\n\t\t\t\tkey: \"member\" in problem ? {\n\t\t\t\t\tkind: \"enumMember\",\n\t\t\t\t\tenumName,\n\t\t\t\t\tmember: problem.member\n\t\t\t\t} : {\n\t\t\t\t\tkind: \"enum\",\n\t\t\t\t\tenumName\n\t\t\t\t},\n\t\t\t\tenumName: handle.enumName,\n\t\t\t\tcodecId: handle.codecId,\n\t\t\t\tproblem\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tbuiltEnums[enumName] = {\n\t\t\tcodecId: handle.codecId,\n\t\t\tmembers: encoded.value\n\t\t};\n\t}\n\tfor (const [enumName, handle] of Object.entries(definition.enums ?? {})) if (enumName !== handle.enumName) refusals.push({\n\t\tkind: \"enumKeyMismatch\",\n\t\tkey: {\n\t\t\tkind: \"enum\",\n\t\t\tenumName\n\t\t},\n\t\tenumName: handle.enumName\n\t});\n\treturn builtEnums;\n}\n//#endregion\n//#region src/build-execution-defaults.ts\nconst PHASES = [\"onCreate\", \"onUpdate\"];\nfunction hasExecutionDefaults(field) {\n\tconst phases = field.executionDefaults;\n\tconst calls = field.generatorCalls;\n\tconst values = field.generatedValues;\n\treturn phases?.onCreate !== void 0 || phases?.onUpdate !== void 0 || values?.onCreate !== void 0 || values?.onUpdate !== void 0 || calls?.onCreate !== void 0 || calls?.onUpdate !== void 0;\n}\n/**\n* The phases a field generates: its resolved execution defaults, with the generators its calls resolve to for its codec. Undefined when a call is refused.\n*/\nfunction executionDefaultsOf(field, key, generatorFunctions, refusals) {\n\tconst typeGiven = field.executionDefaults;\n\tlet refused = false;\n\tfor (const phase of PHASES) if (typeGiven?.[phase] !== void 0 && field.generatedValues?.[phase] !== void 0) {\n\t\trefusals.push({\n\t\t\tkind: \"generatorPhaseSetTwice\",\n\t\t\tkey,\n\t\t\tphase\n\t\t});\n\t\trefused = true;\n\t}\n\tconst written = {\n\t\t...typeGiven,\n\t\t...field.generatedValues\n\t};\n\tconst calls = field.generatorCalls;\n\tif (calls === void 0) return refused ? void 0 : written;\n\tconst type = field.type;\n\tconst codecId = type.kind === \"scalar\" ? type.codecId : void 0;\n\tconst phases = written;\n\tfor (const phase of PHASES) {\n\t\tconst call = calls[phase];\n\t\tif (call === void 0) continue;\n\t\tif (written[phase] !== void 0) {\n\t\t\trefusals.push({\n\t\t\t\tkind: \"generatorPhaseSetTwice\",\n\t\t\t\tkey,\n\t\t\t\tphase\n\t\t\t});\n\t\t\trefused = true;\n\t\t\tcontinue;\n\t\t}\n\t\tconst resolution = type.kind === \"scalar\" ? generatorFunctions.resolve(call, {\n\t\t\tcodecId: type.codecId,\n\t\t\ttypeParams: type.typeParams,\n\t\t\tlength: void 0\n\t\t}) : void 0;\n\t\tif (resolution?.ok === true) {\n\t\t\tphases[phase] = resolution.generator;\n\t\t\tcontinue;\n\t\t}\n\t\trefused = true;\n\t\trefusals.push(resolution?.reason === \"unknown-function\" ? {\n\t\t\tkind: \"generatorUnknown\",\n\t\t\tkey,\n\t\t\tphase,\n\t\t\tfunctionName: call.name,\n\t\t\tcodecId\n\t\t} : {\n\t\t\tkind: \"generatorNotApplicable\",\n\t\t\tkey,\n\t\t\tphase,\n\t\t\tfunctionName: call.name,\n\t\t\tcodecId,\n\t\t\tmessage: resolution?.reason === \"refused\" ? resolution.message : void 0\n\t\t});\n\t}\n\treturn refused ? void 0 : phases;\n}\nfunction checkValueObjectExecutionDefaults(valueObjects, refusals) {\n\tfor (const valueObject of valueObjects ?? []) for (const field of valueObject.fields) if (hasExecutionDefaults(field)) refusals.push({\n\t\tkind: \"generatedOnValueObject\",\n\t\tkey: valueObjectFieldKey(valueObject.name, field.fieldName)\n\t});\n}\nfunction buildExecutionDefaults(input) {\n\tconst { models, generatorFunctions, namespaceId, refusals } = input;\n\tconst collectionByModelName = new Map(models.map((model) => [model.modelName, model.collection]));\n\tconst byRef = /* @__PURE__ */ new Map();\n\tconst defaults = [];\n\tfor (const model of models) {\n\t\tconst { modelName } = model;\n\t\tfor (const field of model.fields) {\n\t\t\tif (!hasExecutionDefaults(field)) continue;\n\t\t\tconst { fieldName } = field;\n\t\t\tconst key = modelFieldKey(modelName, fieldName);\n\t\t\tconst phases = executionDefaultsOf(field, key, generatorFunctions, refusals);\n\t\t\tif (phases === void 0) continue;\n\t\t\tif (field.many) {\n\t\t\t\trefusals.push({\n\t\t\t\t\tkind: \"generatedList\",\n\t\t\t\t\tkey\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (model.base !== void 0) {\n\t\t\t\trefusals.push({\n\t\t\t\t\tkind: \"generatedOnVariant\",\n\t\t\t\t\tkey,\n\t\t\t\t\tbaseModel: model.base.model,\n\t\t\t\t\tcollection: model.collection ?? collectionByModelName.get(model.base.model)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst entry = model.collection;\n\t\t\tif (entry === void 0) {\n\t\t\t\trefusals.push({\n\t\t\t\t\tkind: \"generatedWithoutCollection\",\n\t\t\t\t\tkey\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst storedName = storedNameOf(field);\n\t\t\tconst refKey = JSON.stringify([entry, storedName]);\n\t\t\tconst phasesKey = canonicalStringify(phases);\n\t\t\tconst existing = byRef.get(refKey);\n\t\t\tif (existing !== void 0) {\n\t\t\t\tif (existing.phasesKey !== phasesKey) refusals.push({\n\t\t\t\t\tkind: \"generatedConflict\",\n\t\t\t\t\tkey,\n\t\t\t\t\totherModel: existing.modelName,\n\t\t\t\t\totherField: existing.fieldName,\n\t\t\t\t\tcollection: entry\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbyRef.set(refKey, {\n\t\t\t\tmodelName,\n\t\t\t\tfieldName,\n\t\t\t\tphasesKey\n\t\t\t});\n\t\t\tdefaults.push({\n\t\t\t\tref: {\n\t\t\t\t\tnamespace: namespaceId,\n\t\t\t\t\tentry,\n\t\t\t\t\tfield: storedName\n\t\t\t\t},\n\t\t\t\t...phases\n\t\t\t});\n\t\t}\n\t}\n\treturn defaults;\n}\n//#endregion\n//#region src/build-fields.ts\nfunction checkField(field, key, input) {\n\tconst { type } = field;\n\tif (field.enumName !== void 0 && !input.declaredEnums.has(field.enumName)) input.refusals.push({\n\t\tkind: \"enumUnknown\",\n\t\tkey,\n\t\tenumName: field.enumName\n\t});\n\tif (type.kind === \"scalar\" && type.typeParams !== void 0) {\n\t\tconst problem = codecTypeParamsProblem(type.codecId, type.typeParams, input.lookups);\n\t\tif (problem !== void 0) input.refusals.push({\n\t\t\tkind: \"typeParamsInvalid\",\n\t\t\tkey,\n\t\t\tproblem\n\t\t});\n\t}\n}\n/**\n* Checks each field of the models and value objects on its own: its enum is declared, and its data type accepts its type parameters.\n*/\nfunction checkFields(input) {\n\tfor (const model of input.models) for (const field of model.fields) checkField(field, modelFieldKey(model.modelName, field.fieldName), input);\n\tfor (const valueObject of input.valueObjects ?? []) for (const field of valueObject.fields) checkField(field, valueObjectFieldKey(valueObject.name, field.fieldName), input);\n}\n//#endregion\n//#region src/build-polymorphism.ts\n/**\n* The models with each variant stored in its base's collection: a variant that names no collection takes its base's, and one that names another is refused.\n*/\nfunction inheritVariantCollections(models, refusals) {\n\tconst modelsByName = new Map(models.map((model) => [model.modelName, model]));\n\treturn models.map((model) => {\n\t\tif (model.base === void 0) return model;\n\t\tconst baseCollection = modelsByName.get(model.base.model)?.collection;\n\t\tif (baseCollection === void 0) return model;\n\t\tif (model.collection === void 0) return {\n\t\t\t...model,\n\t\t\tcollection: baseCollection\n\t\t};\n\t\tif (model.collection !== baseCollection) refusals.push({\n\t\t\tkind: \"variantCollectionDiffers\",\n\t\t\tkey: {\n\t\t\t\tkind: \"collectionSettings\",\n\t\t\t\tmodel: model.modelName\n\t\t\t},\n\t\t\tcollection: model.collection,\n\t\t\tbaseModel: model.base.model,\n\t\t\tbaseCollection\n\t\t});\n\t\treturn model;\n\t});\n}\nfunction checkVariantShape(model, modelsByName, refusals) {\n\tif (model.base === void 0) return;\n\tconst key = {\n\t\tkind: \"base\",\n\t\tvariant: model.modelName\n\t};\n\tconst baseModel = model.base.model;\n\tif (model.discriminator !== void 0) refusals.push({\n\t\tkind: \"discriminatorAndBase\",\n\t\tkey: {\n\t\t\tkind: \"discriminator\",\n\t\t\tmodel: model.modelName\n\t\t}\n\t});\n\tconst base = modelsByName.get(baseModel);\n\tif (base === void 0) {\n\t\trefusals.push({\n\t\t\tkind: \"baseUnknown\",\n\t\t\tkey,\n\t\t\tbaseModel\n\t\t});\n\t\treturn;\n\t}\n\tif (base.discriminator === void 0) {\n\t\trefusals.push({\n\t\t\tkind: \"baseWithoutDiscriminator\",\n\t\t\tkey,\n\t\t\tbaseModel\n\t\t});\n\t\treturn;\n\t}\n\tif (model.base.value === void 0) refusals.push({\n\t\tkind: \"variantWithoutValue\",\n\t\tkey,\n\t\tbaseModel\n\t});\n}\n/** Each variant of `base` with the value its source wrote, in the order of the models. */\nfunction writtenVariantsOf(base, models) {\n\treturn models.flatMap((model) => model.base?.model === base.modelName && model.base.value !== void 0 ? [{\n\t\tkey: model.modelName,\n\t\twritten: model.base.value\n\t}] : []);\n}\nfunction decideDiscriminator(input) {\n\tconst { base, models, refusals } = input;\n\tconst discriminator = base.discriminator;\n\tif (discriminator === void 0 || base.base !== void 0) return /* @__PURE__ */ new Map();\n\tconst key = {\n\t\tkind: \"discriminator\",\n\t\tmodel: base.modelName\n\t};\n\tconst variantNames = new Set(models.filter((model) => model.base?.model === base.modelName).map((model) => model.modelName));\n\tfor (const listed of discriminator.listedVariants ?? []) if (!variantNames.has(listed)) refusals.push({\n\t\tkind: \"listedVariantMissing\",\n\t\tkey,\n\t\tvariant: listed\n\t});\n\tif (variantNames.size === 0) refusals.push({\n\t\tkind: \"discriminatorWithoutVariants\",\n\t\tkey\n\t});\n\tconst fieldName = discriminator.field;\n\tconst field = base.fields.find((candidate) => candidate.fieldName === fieldName);\n\tif (field === void 0) {\n\t\trefusals.push({\n\t\t\tkind: \"discriminatorFieldUnknown\",\n\t\t\tkey,\n\t\t\tfieldName\n\t\t});\n\t\treturn /* @__PURE__ */ new Map();\n\t}\n\tconst { type } = field;\n\tconst enumMembers = field.enumName === void 0 ? void 0 : input.enums[field.enumName]?.members.map((member) => member.value);\n\tconst decision = applyDiscriminatorRule({\n\t\tfield: {\n\t\t\tref: type.kind === \"scalar\" ? {\n\t\t\t\tcodecId: type.codecId,\n\t\t\t\t...type.typeParams ? { typeParams: blindCast(type.typeParams) } : {}\n\t\t\t} : void 0,\n\t\t\tnullable: field.nullable,\n\t\t\tmany: field.many !== false,\n\t\t\tenumMembers\n\t\t},\n\t\tvariants: writtenVariantsOf(base, models),\n\t\tsubject: `Field \"${base.modelName}.${fieldName}\"`,\n\t\tcodecLookup: input.codecLookup,\n\t\tdataTypes: input.dataTypes\n\t});\n\tfor (const refusal of decision.fieldRefusals) refusals.push({\n\t\tkind: \"discriminatorField\",\n\t\tkey,\n\t\tfieldName,\n\t\trefusal\n\t});\n\tfor (const refusal of decision.variantRefusals) refusals.push({\n\t\tkind: \"discriminatorValue\",\n\t\tkey: {\n\t\t\tkind: \"base\",\n\t\t\tvariant: refusal.key\n\t\t},\n\t\tbaseModel: base.modelName,\n\t\tfieldName,\n\t\tenumName: field.enumName,\n\t\trefusal\n\t});\n\tconst variantsByValue = /* @__PURE__ */ new Map();\n\tfor (const [variant, value] of decision.values) {\n\t\tconst firstVariant = variantsByValue.get(value);\n\t\tif (firstVariant !== void 0) {\n\t\t\trefusals.push({\n\t\t\t\tkind: \"discriminatorValueDuplicate\",\n\t\t\t\tkey: {\n\t\t\t\t\tkind: \"base\",\n\t\t\t\t\tvariant\n\t\t\t\t},\n\t\t\t\tbaseModel: base.modelName,\n\t\t\t\tvalue,\n\t\t\t\tfirstVariant\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tvariantsByValue.set(value, variant);\n\t}\n\treturn decision.values;\n}\n/**\n* Checks each base and variant, and decides each variant's discriminator value with the framework's discriminator rule. Returns each accepted variant's value as its base's discriminator field stores it.\n*/\nfunction decidePolymorphism(input) {\n\tconst { models, refusals } = input;\n\tconst modelsByName = new Map(models.map((model) => [model.modelName, model]));\n\tconst values = /* @__PURE__ */ new Map();\n\tfor (const model of models) {\n\t\tcheckVariantShape(model, modelsByName, refusals);\n\t\tfor (const [variant, value] of decideDiscriminator({\n\t\t\t...input,\n\t\t\tbase: model\n\t\t})) values.set(variant, value);\n\t}\n\treturn values;\n}\n//#endregion\n//#region src/build-contract.ts\n/** Whether a refusal is about listing an enum in a collection validator, which matters only when collections get validators. */\nfunction isAboutEnumListing(refusal) {\n\treturn refusal.kind === \"enumBsonType\" || refusal.kind === \"enumNotListable\" || refusal.kind === \"enumMemberNotListable\";\n}\n/**\n* Builds a MongoDB contract from its plain-data definition, with the stack's codecs and data types. Every MongoDB family rule is checked here, and each refusal comes back as data keyed by the part of the definition it is about, for the source to report in its own terms.\n*/\nfunction buildMongoContractFromDefinition(definition, codecLookup, dataTypes) {\n\tconst refusals = [];\n\tconst warnings = (definition.warnings ?? []).map((warning) => ({\n\t\tkind: \"source\",\n\t\twarning\n\t}));\n\tconst namespaceId = definition.target.defaultNamespaceId;\n\tconst lookups = {\n\t\tcodecLookup,\n\t\tdataTypeLookup: dataTypes.lookup\n\t};\n\tconst generatorFunctions = assembleGeneratorFunctions([definition.target, ...Object.values(definition.extensions ?? {})]);\n\tconst models = inheritVariantCollections(definition.models, refusals);\n\tconst builtEnums = buildEnums(definition, codecLookup, refusals);\n\tconst variantValues = decidePolymorphism({\n\t\tmodels,\n\t\tenums: builtEnums,\n\t\tcodecLookup,\n\t\tdataTypes,\n\t\trefusals\n\t});\n\tconst builtModels = buildModels({\n\t\tmodels,\n\t\tvariantValues,\n\t\tnamespaceId,\n\t\trefusals\n\t});\n\tconst builtValueObjects = buildValueObjects(definition.valueObjects, namespaceId, refusals);\n\tcheckFields({\n\t\tmodels,\n\t\tvalueObjects: definition.valueObjects,\n\t\tdeclaredEnums: new Set(Object.keys(definition.enums ?? {})),\n\t\tlookups,\n\t\trefusals,\n\t\twarnings\n\t});\n\tconst collections = buildCollections({\n\t\tmodels,\n\t\tvariantValues,\n\t\trefusals\n\t});\n\tcheckValueObjectExecutionDefaults(definition.valueObjects, refusals);\n\tconst executionDefaults = buildExecutionDefaults({\n\t\tmodels,\n\t\tgeneratorFunctions,\n\t\tnamespaceId,\n\t\trefusals\n\t});\n\tif (refusals.length > 0) return notOk({\n\t\trefusals,\n\t\twarnings\n\t});\n\tconst controlPolicies = {\n\t\tcollections: Object.fromEntries(Object.entries(collections).map(([name, collection]) => [name, collection.control])),\n\t\tdefaultControlPolicy: definition.defaultControlPolicy\n\t};\n\tconst validatorRefusals = mongoContractRefusalsOf({\n\t\tmodels: builtModels,\n\t\tvalueObjects: builtValueObjects,\n\t\tenums: builtEnums,\n\t\tlookups,\n\t\tcontrolPolicies\n\t}).filter((refusal) => definition.writesCollectionValidators || !isAboutEnumListing(refusal));\n\tif (validatorRefusals.length > 0) return notOk({\n\t\trefusals: validatorRefusals.map((refusal) => ({\n\t\t\tkind: \"validator\",\n\t\t\tkey: validatorRefusalKey(refusal),\n\t\t\trefusal\n\t\t})),\n\t\twarnings\n\t});\n\tconst storageValueSets = mongoValueSetsOf(builtEnums);\n\tconst validators = definition.writesCollectionValidators ? deriveCollectionValidators({\n\t\tmodels: builtModels,\n\t\tlookups,\n\t\tstorage: { namespaces: { [namespaceId]: {\n\t\t\tid: namespaceId,\n\t\t\tentries: { valueObject: builtValueObjects }\n\t\t} } },\n\t\tvalueSets: storageValueSets,\n\t\tcontrolPolicies\n\t}) : {};\n\tconst storage = buildMongoStorage({\n\t\tnamespaceId,\n\t\tcollections: Object.fromEntries(Object.entries(collections).map(([name, collection]) => [name, {\n\t\t\t...collection,\n\t\t\t...ifDefined(\"validator\", validators[name])\n\t\t}])),\n\t\tvalueSets: storageValueSets,\n\t\tvalueObjects: builtValueObjects\n\t});\n\tconst capabilities = {};\n\tconst execution = buildExecutionSection({\n\t\ttarget: definition.target.targetId,\n\t\ttargetFamily: definition.target.familyId,\n\t\tdefaults: executionDefaults\n\t});\n\treturn ok({\n\t\tcontract: {\n\t\t\ttarget: definition.target.targetId,\n\t\t\ttargetFamily: definition.target.familyId,\n\t\t\t...ifDefined(\"defaultControlPolicy\", definition.defaultControlPolicy),\n\t\t\troots: buildRoots(definition, models, namespaceId),\n\t\t\tdomain: { namespaces: { [namespaceId]: {\n\t\t\t\tmodels: builtModels,\n\t\t\t\t...Object.keys(builtEnums).length > 0 ? { enum: builtEnums } : {}\n\t\t\t} } },\n\t\t\tstorage,\n\t\t\tcapabilities,\n\t\t\textensions: definition.extensions ?? {},\n\t\t\tprofileHash: computeProfileHash({\n\t\t\t\ttarget: definition.target.targetId,\n\t\t\t\ttargetFamily: definition.target.familyId,\n\t\t\t\tcapabilities\n\t\t\t}),\n\t\t\tmeta: {},\n\t\t\t...ifDefined(\"execution\", execution)\n\t\t},\n\t\twarnings\n\t});\n}\n//#endregion\n//#region src/contract-dsl.ts\nfunction resolveModelName(value) {\n\treturn typeof value === \"string\" ? value : value.__name;\n}\n//#endregion\n//#region src/contract-lowering.ts\nfunction validateTargetPackRef(family, target) {\n\tif (family.familyId !== \"mongo\") throw contractError(\"CONTRACT.PACK_FAMILY_MISMATCH\", `defineContract only accepts Mongo family packs. Received family \"${family.familyId}\".`, { meta: {\n\t\tpackId: family.id,\n\t\tpackFamilyId: family.familyId,\n\t\tcontractFamilyId: \"mongo\"\n\t} });\n\tif (target.familyId !== family.familyId) throw contractError(\"CONTRACT.PACK_FAMILY_MISMATCH\", `target pack \"${target.id}\" targets family \"${target.familyId}\" but contract family is \"${family.familyId}\".`, { meta: {\n\t\tpackId: target.id,\n\t\tpackFamilyId: target.familyId,\n\t\tcontractFamilyId: family.familyId\n\t} });\n}\nfunction validateExtensionPackRefs(target, extensions) {\n\tfor (const packRef of Object.values(extensions ?? {})) {\n\t\tif (packRef.kind !== \"extension\") throw contractError(\"CONTRACT.PACK_REF_INVALID\", `defineContract only accepts extension pack refs in extensions. Received kind \"${packRef.kind}\".`, { meta: {\n\t\t\tpackId: packRef.id,\n\t\t\tkind: packRef.kind\n\t\t} });\n\t\tif (packRef.familyId !== target.familyId) throw contractError(\"CONTRACT.PACK_FAMILY_MISMATCH\", `extension pack \"${packRef.id}\" targets family \"${packRef.familyId}\" but contract target family is \"${target.familyId}\".`, { meta: {\n\t\t\tpackId: packRef.id,\n\t\t\tpackFamilyId: packRef.familyId,\n\t\t\tcontractFamilyId: target.familyId\n\t\t} });\n\t\tif (packRef.targetId && packRef.targetId !== target.targetId) throw contractError(\"CONTRACT.PACK_TARGET_MISMATCH\", `extension pack \"${packRef.id}\" targets \"${packRef.targetId}\" but contract target is \"${target.targetId}\".`, { meta: {\n\t\t\tpackId: packRef.id,\n\t\t\tpackTargetId: packRef.targetId,\n\t\t\tcontractTargetId: target.targetId\n\t\t} });\n\t}\n}\nfunction fieldNodes(fields) {\n\treturn Object.entries(fields).map(([fieldName, builder]) => ({\n\t\tfieldName,\n\t\t...ifDefined(\"storedName\", builder.__storedName),\n\t\ttype: builder.__type,\n\t\tnullable: builder.__nullable,\n\t\tmany: builder.__many,\n\t\t...ifDefined(\"enumName\", builder.__enumHandle?.enumName),\n\t\t...ifDefined(\"executionDefaults\", builder.__executionDefaults),\n\t\t...ifDefined(\"generatorCalls\", builder.__generatorCalls)\n\t}));\n}\nfunction relationNodes(builder) {\n\treturn Object.entries(builder.__relations).map(([relationName, relation]) => {\n\t\tconst common = {\n\t\t\trelationName,\n\t\t\ttoModel: relation.__to,\n\t\t\tnullable: relation.__nullable\n\t\t};\n\t\treturn relation.__on === void 0 ? {\n\t\t\t...common,\n\t\t\tcardinality: relation.__cardinality\n\t\t} : {\n\t\t\t...common,\n\t\t\tcardinality: relation.__cardinality,\n\t\t\ton: relation.__on\n\t\t};\n\t});\n}\nfunction modelNode(builder, buildersByName) {\n\tconst base = builder.__base;\n\tconst variantValue = base === void 0 ? void 0 : buildersByName.get(base)?.__variants?.[builder.__name]?.value;\n\treturn {\n\t\tmodelName: builder.__name,\n\t\t...ifDefined(\"collection\", builder.__collection),\n\t\t...ifDefined(\"owner\", builder.__owner),\n\t\t...ifDefined(\"storageRelations\", builder.__storageRelations),\n\t\t...ifDefined(\"controlPolicy\", builder.__controlPolicy),\n\t\t...ifDefined(\"collectionOptions\", builder.__collectionOptions),\n\t\t...ifDefined(\"indexes\", builder.__indexes),\n\t\tfields: fieldNodes(builder.__fields),\n\t\trelations: relationNodes(builder),\n\t\t...builder.__discriminator === void 0 ? {} : { discriminator: {\n\t\t\tfield: builder.__discriminator.field,\n\t\t\tlistedVariants: Object.keys(builder.__variants ?? {})\n\t\t} },\n\t\t...base === void 0 ? {} : { base: {\n\t\t\tmodel: base,\n\t\t\tvalue: variantValue === void 0 ? void 0 : {\n\t\t\t\tkind: \"string\",\n\t\t\t\ttext: variantValue\n\t\t\t}\n\t\t} }\n\t};\n}\nfunction valueObjectNode(builder) {\n\treturn {\n\t\tname: builder.__name,\n\t\tfields: fieldNodes(builder.__fields)\n\t};\n}\n/** Turns `defineContract`'s builder objects into the plain-data definition the contract is built from. */\nfunction buildContractDefinition(input) {\n\tconst { target } = input;\n\tvalidateTargetPackRef(input.family, target);\n\tvalidateExtensionPackRefs(target, input.extensions);\n\tconst builders = Object.values(input.models ?? {});\n\tconst buildersByName = /* @__PURE__ */ new Map();\n\tfor (const builder of builders) if (!buildersByName.has(builder.__name)) buildersByName.set(builder.__name, builder);\n\treturn {\n\t\ttarget,\n\t\t...ifDefined(\"extensions\", input.extensions),\n\t\t...ifDefined(\"defaultControlPolicy\", input.defaultControlPolicy),\n\t\tmodels: builders.map((builder) => modelNode(builder, buildersByName)),\n\t\tvalueObjects: Object.values(input.valueObjects ?? {}).map(valueObjectNode),\n\t\t...ifDefined(\"enums\", input.enums),\n\t\t...ifDefined(\"roots\", input.roots === void 0 ? void 0 : Object.fromEntries(Object.entries(input.roots).map(([rootName, model]) => [rootName, resolveModelName(model)]))),\n\t\twritesCollectionValidators: true,\n\t\twarnings: void 0\n\t};\n}\n//#endregion\n//#region src/refusal-errors.ts\nconst LIST_THE_CODEC_PACK = \"List the pack that provides the codec in `extensions` in defineContract.\";\nfunction codecRefusalError(subject, meta, codecId, refusal) {\n\tif (refusal.kind === \"unknownCodec\") return contractError(\"CONTRACT.CODEC_DESCRIPTOR_MISSING\", `${subject} ${refusal.reason}`, {\n\t\tfix: LIST_THE_CODEC_PACK,\n\t\tmeta: {\n\t\t\t...meta,\n\t\t\tcodecId\n\t\t}\n\t});\n\treturn contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `${subject} ${refusal.reason}`, {\n\t\tfix: \"Use a codec whose data type is a MongoDB data type, declared with mongoDataType.\",\n\t\tmeta: {\n\t\t\t...meta,\n\t\t\tcodecId,\n\t\t\tdataType: refusal.dataType,\n\t\t\treason: \"data-type-not-mongo\"\n\t\t}\n\t});\n}\nfunction validatorRefusalError(refusal) {\n\tswitch (refusal.kind) {\n\t\tcase \"embeddedModelHasVariants\": return contractError(\"CONTRACT.RELATION_INVALID\", `Relation \"${refusal.modelName}.${refusal.relationName}\" ${refusal.reason}`, { meta: {\n\t\t\tmodelName: refusal.modelName,\n\t\t\trelationName: refusal.relationName,\n\t\t\treason: \"embedded-model-has-variants\"\n\t\t} });\n\t\tcase \"enumBsonType\": return codecRefusalError(`enumType(\"${refusal.enumName}\")`, { enumName: refusal.enumName }, refusal.codecId, refusal.refusal);\n\t\tcase \"enumNotListable\": return contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${refusal.enumName}\") codec \"${refusal.codecId}\" ${refusal.reason}`, { meta: {\n\t\t\tenumName: refusal.enumName,\n\t\t\tcodecId: refusal.codecId,\n\t\t\treason: \"not-listable-by-validator\"\n\t\t} });\n\t\tcase \"enumMemberNotListable\": return contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${refusal.enumName}\") member \"${refusal.member}\" ${refusal.reason}`, { meta: {\n\t\t\tenumName: refusal.enumName,\n\t\t\tmember: refusal.member,\n\t\t\tcodecId: refusal.codecId,\n\t\t\treason: \"member-not-listable-by-validator\"\n\t\t} });\n\t\tcase \"fieldBsonType\": {\n\t\t\tconst { owner } = refusal;\n\t\t\tconst label = owner.kind === \"model\" ? \"Model\" : \"Value object\";\n\t\t\tconst ownerMeta = owner.kind === \"model\" ? { modelName: owner.name } : { valueObjectName: owner.name };\n\t\t\treturn codecRefusalError(`${label} \"${owner.name}\" field \"${refusal.fieldName}\"`, {\n\t\t\t\t...ownerMeta,\n\t\t\t\tfieldName: refusal.fieldName\n\t\t\t}, refusal.codecId, refusal.refusal);\n\t\t}\n\t\tcase \"documentId\": return contractError(\"CONTRACT.COLLECTION_INVALID\", `Model \"${refusal.modelName}\" field \"${refusal.fieldName}\" ${refusal.reason}`, { meta: {\n\t\t\tmodelName: refusal.modelName,\n\t\t\tfieldName: refusal.fieldName,\n\t\t\tcollection: refusal.collection,\n\t\t\tcodecId: refusal.codecId,\n\t\t\tbsonTypes: refusal.forbidden,\n\t\t\treason: \"document-id-bson-type\"\n\t\t} });\n\t}\n}\nfunction defaultError(key, reason, message) {\n\treturn contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${`${key.owner.name}.${key.field}`}\" ${message}`, { meta: {\n\t\tmodelName: key.owner.name,\n\t\tfieldName: key.field,\n\t\treason\n\t} });\n}\nfunction ownerMetaOf(key) {\n\treturn key.owner.kind === \"model\" ? {\n\t\tmodelName: key.owner.name,\n\t\tfieldName: key.field\n\t} : {\n\t\tvalueObjectName: key.owner.name,\n\t\tfieldName: key.field\n\t};\n}\nfunction ownerLabelOf(key) {\n\treturn `${key.owner.kind === \"model\" ? \"Model\" : \"Value object\"} \"${key.owner.name}\" field \"${key.field}\"`;\n}\nconst INDEX_SHAPE_MESSAGES = {\n\t\"unique-wildcard\": \"is unique and has a wildcard key; a unique index cannot use a wildcard.\",\n\t\"wildcard-with-type\": \"combines a wildcard key with a hashed, 2d or 2dsphere key, which MongoDB does not allow.\",\n\t\"hashed-several-fields\": \"is hashed on several fields; a hashed index has exactly one field.\",\n\t\"ttl-with-wildcard\": \"sets expireAfterSeconds on a wildcard index, which MongoDB does not allow.\",\n\t\"projection-without-wildcard\": \"sets wildcardProjection but has no wildcard key; a wildcard projection needs a wildcard index.\",\n\t\"collation-without-locale\": \"sets a collation without a locale; a collation needs a locale.\",\n\t\"second-text-index\": \"is a second text index in its collection; MongoDB allows one text index per collection.\"\n};\nfunction discriminatorFieldError(refusal) {\n\tconst field = `Discriminator field \"${refusal.key.model}.${refusal.fieldName}\"`;\n\tconst meta = {\n\t\tmodelName: refusal.key.model,\n\t\tfieldName: refusal.fieldName\n\t};\n\tswitch (refusal.refusal.kind) {\n\t\tcase \"optional\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `${field} must be required, but it is optional. Remove .optional().`, { meta: {\n\t\t\t...meta,\n\t\t\treason: \"discriminator-optional\"\n\t\t} });\n\t\tcase \"list\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `${field} must hold one value, but it is a list. Remove .many().`, { meta: {\n\t\t\t...meta,\n\t\t\treason: \"discriminator-list\"\n\t\t} });\n\t\tcase \"not-text\": {\n\t\t\tconst { dataType } = refusal.refusal;\n\t\t\treturn contractError(\"CONTRACT.ARGUMENT_INVALID\", `${field} must be text, such as field.string(), but its data type is ${dataType === void 0 ? \"not a scalar\" : `\"${dataType}\"`}.`, { meta: {\n\t\t\t\t...meta,\n\t\t\t\tdataType,\n\t\t\t\treason: \"discriminator-not-text\"\n\t\t\t} });\n\t\t}\n\t}\n}\n/** The error `defineContract` throws for a refusal of the builder. */\nfunction refusalError(refusal) {\n\tswitch (refusal.kind) {\n\t\tcase \"duplicateModel\": return contractError(\"CONTRACT.NAME_DUPLICATE\", `Duplicate model name \"${refusal.key.model}\" in defineContract().`, { meta: {\n\t\t\tkind: \"model\",\n\t\t\tname: refusal.key.model\n\t\t} });\n\t\tcase \"duplicateValueObject\": return contractError(\"CONTRACT.NAME_DUPLICATE\", `Duplicate value object name \"${refusal.key.valueObject}\" in defineContract().`, { meta: {\n\t\t\tkind: \"valueObject\",\n\t\t\tname: refusal.key.valueObject\n\t\t} });\n\t\tcase \"storedNameUnsupported\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Model \"${refusal.key.owner.name}\" field \"${refusal.key.field}\" ${refusal.reason}. Give it another stored name.`, { meta: {\n\t\t\tmodelName: refusal.key.owner.name,\n\t\t\tfieldName: refusal.key.field,\n\t\t\treason: \"stored-name-unsupported\"\n\t\t} });\n\t\tcase \"storedNameDuplicate\": return contractError(\"CONTRACT.NAME_DUPLICATE\", `Model \"${refusal.key.owner.name}\" stores both \"${refusal.firstField}\" and \"${refusal.key.field}\" as \"${refusal.storedName}\".`, { meta: {\n\t\t\tkind: \"field\",\n\t\t\tname: refusal.storedName,\n\t\t\tfirst: refusal.firstField,\n\t\t\tsecond: refusal.key.field\n\t\t} });\n\t\tcase \"restatedBaseFieldDiffers\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Variant model \"${refusal.key.owner.name}\" restates field \"${refusal.key.field}\" of its base \"${refusal.baseModel}\" with a different ${refusal.differences.map(differenceWording).join(\" and \")}. A variant's documents are checked against the base's field, so restate it exactly or remove it from the variant.`, { meta: {\n\t\t\tmodelName: refusal.key.owner.name,\n\t\t\tfieldName: refusal.key.field,\n\t\t\tbaseModel: refusal.baseModel,\n\t\t\tdifferences: refusal.differences,\n\t\t\treason: \"restated-base-field-differs\"\n\t\t} });\n\t\tcase \"storedNameSharedWithBase\": return contractError(\"CONTRACT.NAME_DUPLICATE\", `Variant model \"${refusal.key.owner.name}\" field \"${refusal.key.field}\" is stored as \"${refusal.storedName}\", which its base \"${refusal.baseModel}\" stores field \"${refusal.baseField}\" under. A variant's documents hold its base's fields too, so give the field another stored name.`, { meta: {\n\t\t\tkind: \"field\",\n\t\t\tname: refusal.storedName,\n\t\t\tfirst: `${refusal.baseModel}.${refusal.baseField}`,\n\t\t\tsecond: `${refusal.key.owner.name}.${refusal.key.field}`,\n\t\t\treason: \"stored-name-shared-with-base\"\n\t\t} });\n\t\tcase \"valueObjectFieldStoredName\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Value object \"${refusal.key.owner.name}\" field \"${refusal.key.field}\" sets .mongo({ field }), but a field of a value object is stored under its own name.`, { meta: {\n\t\t\tvalueObjectName: refusal.key.owner.name,\n\t\t\tfieldName: refusal.key.field,\n\t\t\treason: \"value-object-field-stored-name\"\n\t\t} });\n\t\tcase \"relationLocalFieldUnknown\": {\n\t\t\tconst { model, relation } = refusal.key;\n\t\t\treturn contractError(\"CONTRACT.RELATION_INVALID\", `Relation \"${model}.${relation}\" joins on local field \"${refusal.fieldName}\", which model \"${model}\" does not declare`, { meta: {\n\t\t\t\tmodelName: model,\n\t\t\t\trelationName: relation,\n\t\t\t\tfieldName: refusal.fieldName,\n\t\t\t\treason: \"local-field-unknown\"\n\t\t\t} });\n\t\t}\n\t\tcase \"relationNullability\": {\n\t\t\tconst { model, relation } = refusal.key;\n\t\t\tconst location = `Relation \"${model}.${relation}\"`;\n\t\t\treturn contractError(\"CONTRACT.RELATION_INVALID\", !refusal.ownsForeignKey ? `${location} is required but does not own the foreign key, so nothing in storage guarantees the related document exists` : refusal.contradiction === \"declared-optional\" ? `${location} is optional but every local field it joins on is required` : `${location} is required but a local field it joins on is nullable`, { meta: {\n\t\t\t\tmodelName: model,\n\t\t\t\trelationName: relation,\n\t\t\t\treason: \"to-one-nullability-mismatch\"\n\t\t\t} });\n\t\t}\n\t\tcase \"collectionSettingWithoutCollection\": {\n\t\t\tconst modelName = refusal.key.model;\n\t\t\tconst what = refusal.setting === \"controlPolicy\" ? \"it\" : \"them\";\n\t\t\treturn contractError(\"CONTRACT.COLLECTION_INVALID\", `Model \"${modelName}\" defines ${refusal.setting} but has no collection to attach ${what} to.`, { meta: {\n\t\t\t\tmodelName,\n\t\t\t\treason: `${refusal.setting}-without-collection`\n\t\t\t} });\n\t\t}\n\t\tcase \"collectionSettingTwice\": return contractError(\"CONTRACT.COLLECTION_INVALID\", `Collection \"${refusal.collection}\" has ${refusal.setting} declared by multiple models. Author ${refusal.setting} on a single model per collection.`, { meta: {\n\t\t\tmodelName: refusal.key.model,\n\t\t\tcollection: refusal.collection,\n\t\t\treason: `${refusal.setting}-declared-by-multiple-models`\n\t\t} });\n\t\tcase \"variantCollectionDiffers\": return contractError(\"CONTRACT.COLLECTION_INVALID\", `Variant model \"${refusal.key.model}\" is stored in collection \"${refusal.collection}\", but its base \"${refusal.baseModel}\" is stored in \"${refusal.baseCollection}\". A variant is stored in its base's collection; leave its collection out.`, { meta: {\n\t\t\tmodelName: refusal.key.model,\n\t\t\tcollection: refusal.collection,\n\t\t\tbaseModel: refusal.baseModel,\n\t\t\tbaseCollection: refusal.baseCollection,\n\t\t\treason: \"variant-collection-differs\"\n\t\t} });\n\t\tcase \"indexFieldUnknown\": return contractError(\"CONTRACT.FIELD_UNKNOWN\", `Model \"${refusal.key.model}\" index ${refusal.signature} references unknown field \"${refusal.fieldName}\".`, { meta: {\n\t\t\tmodelName: refusal.key.model,\n\t\t\tfieldName: refusal.fieldName,\n\t\t\tindexSignature: refusal.signature\n\t\t} });\n\t\tcase \"indexShape\": return contractError(\"CONTRACT.INDEX_INVALID\", `Model \"${refusal.key.model}\" index ${refusal.signature} ${INDEX_SHAPE_MESSAGES[refusal.rule]}`, { meta: {\n\t\t\tmodelName: refusal.key.model,\n\t\t\tindexSignature: refusal.signature,\n\t\t\treason: refusal.rule\n\t\t} });\n\t\tcase \"indexScopeConflict\": return contractError(\"CONTRACT.INDEX_INVALID\", `Variant model \"${refusal.key.model}\" index ${refusal.signature} conflicts with discriminator scope: ${refusal.reason}`, { meta: {\n\t\t\tvariantName: refusal.key.model,\n\t\t\tindexLabel: refusal.signature,\n\t\t\treason: refusal.reason\n\t\t} });\n\t\tcase \"indexDuplicate\": return contractError(\"CONTRACT.NAME_DUPLICATE\", `Collection \"${refusal.collection}\" defines duplicate index ${refusal.signature}. First declared on model \"${refusal.firstModel}\" and duplicated on model \"${refusal.key.model}\".`, { meta: {\n\t\t\tkind: \"index\",\n\t\t\tname: refusal.signature,\n\t\t\tcollection: refusal.collection,\n\t\t\tfirst: refusal.firstModel,\n\t\t\tsecond: refusal.key.model\n\t\t} });\n\t\tcase \"generatedOnValueObject\": return defaultError(refusal.key, \"executionDefaults-on-value-object\", \"has executionDefaults, but it belongs to a value object. Generated values are only supported on model fields.\");\n\t\tcase \"generatorUnknown\": {\n\t\t\tconst { owner, field } = refusal.key;\n\t\t\treturn contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${owner.name}.${field}\": no pack in the contract declares the generator function \"${refusal.functionName}\".`, { meta: {\n\t\t\t\tmodelName: owner.name,\n\t\t\t\tfieldName: field,\n\t\t\t\tcodecId: refusal.codecId,\n\t\t\t\tfunction: refusal.functionName,\n\t\t\t\treason: \"generator-unknown\"\n\t\t\t} });\n\t\t}\n\t\tcase \"generatorNotApplicable\": {\n\t\t\tconst { owner, field } = refusal.key;\n\t\t\tconst subject = `Field \"${owner.name}.${field}\"`;\n\t\t\treturn contractError(\"CONTRACT.DEFAULT_INVALID\", refusal.message !== void 0 ? `${subject}: ${refusal.message}` : `${subject}: ${refusal.functionName}() does not apply to ${refusal.codecId === void 0 ? \"the field's type\" : `codec \"${refusal.codecId}\"`}.`, { meta: {\n\t\t\t\tmodelName: owner.name,\n\t\t\t\tfieldName: field,\n\t\t\t\tcodecId: refusal.codecId,\n\t\t\t\tfunction: refusal.functionName,\n\t\t\t\treason: \"generator-not-applicable\"\n\t\t\t} });\n\t\t}\n\t\tcase \"generatorPhaseSetTwice\": return contractError(\"CONTRACT.DEFAULT_INVALID\", `.${refusal.phase}() is called on a field that already generates a value ${refusal.phase === \"onCreate\" ? \"on create\" : \"on update\"}. Set each phase once, and do not combine .${refusal.phase}() with a type alias or alias constant that sets it.`, { meta: {\n\t\t\tmodelName: refusal.key.owner.name,\n\t\t\tfieldName: refusal.key.field,\n\t\t\treason: \"generator-phase-set-twice\",\n\t\t\tphase: refusal.phase\n\t\t} });\n\t\tcase \"generatedList\": return defaultError(refusal.key, \"many-with-executionDefaults\", \"generates a value on write, so it cannot be a list; remove .many().\");\n\t\tcase \"generatedOnVariant\": return defaultError(refusal.key, \"executionDefaults-on-variant\", `has executionDefaults, but \"${refusal.key.owner.name}\" is a variant of \"${refusal.baseModel}\". Execution defaults apply to every document in collection \"${refusal.collection}\", so declare them on the base model.`);\n\t\tcase \"generatedWithoutCollection\": return defaultError(refusal.key, \"executionDefaults-without-collection\", \"has executionDefaults, but its model has no collection. Generated values are only supported on fields of a model stored in a collection.\");\n\t\tcase \"generatedConflict\": return defaultError(refusal.key, \"executionDefaults-conflict\", `has different executionDefaults than \"${refusal.otherModel}.${refusal.otherField}\", which is stored in the same collection \"${refusal.collection}\". Use the same executionDefaults on both models.`);\n\t\tcase \"typeParamsInvalid\": return structuredError(\"CONTRACT.TYPE_PARAMS_INVALID\", refusal.problem.message, { meta: {\n\t\t\tdataType: refusal.problem.dataType,\n\t\t\tparameters: refusal.problem.parameters,\n\t\t\t...ownerMetaOf(refusal.key)\n\t\t} });\n\t\tcase \"enumKeyMismatch\": return contractError(\"CONTRACT.ENUM_INVALID\", `enum declaration key \"${refusal.key.enumName}\" must match enumType name \"${refusal.enumName}\". Aliases are not supported.`, { meta: {\n\t\t\tenumName: refusal.enumName,\n\t\t\tdeclaredKey: refusal.key.enumName,\n\t\t\treason: \"declaration-key-mismatch\"\n\t\t} });\n\t\tcase \"enumMemberProblem\": return enumMemberError({\n\t\t\tenumName: refusal.enumName,\n\t\t\tcodecId: refusal.codecId\n\t\t}, refusal.problem, \"the field\");\n\t\tcase \"enumUnknown\": return contractError(\"CONTRACT.ENUM_UNKNOWN\", `${ownerLabelOf(refusal.key)} references enum \"${refusal.enumName}\" which is not declared in defineContract({ enums: { ... } }).`, { meta: {\n\t\t\t...ownerMetaOf(refusal.key),\n\t\t\tenumName: refusal.enumName\n\t\t} });\n\t\tcase \"discriminatorValueDuplicate\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Discriminator value \"${refusal.value}\" is used by both \"${refusal.firstVariant}\" and \"${refusal.key.variant}\" on base model \"${refusal.baseModel}\".`, { meta: {\n\t\t\tmodelName: refusal.baseModel,\n\t\t\tvalue: refusal.value,\n\t\t\tvariants: [refusal.firstVariant, refusal.key.variant],\n\t\t\treason: \"duplicate-discriminator-value\"\n\t\t} });\n\t\tcase \"discriminatorFieldUnknown\": return contractError(\"CONTRACT.FIELD_UNKNOWN\", `Model \"${refusal.key.model}\" names \"${refusal.fieldName}\" as its discriminator, but declares no field \"${refusal.fieldName}\".`, { meta: {\n\t\t\tmodelName: refusal.key.model,\n\t\t\tfieldName: refusal.fieldName,\n\t\t\treason: \"discriminator-field-unknown\"\n\t\t} });\n\t\tcase \"discriminatorField\": return discriminatorFieldError(refusal);\n\t\tcase \"discriminatorValue\": {\n\t\t\tconst variant = refusal.key.variant;\n\t\t\tconst meta = {\n\t\t\t\tmodelName: variant,\n\t\t\t\tbaseModel: refusal.baseModel,\n\t\t\t\tfieldName: refusal.fieldName\n\t\t\t};\n\t\t\tif (refusal.refusal.kind === \"unreadable\") return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Variant model \"${variant}\" has a discriminator value that discriminator field \"${refusal.baseModel}.${refusal.fieldName}\" cannot hold: ${refusal.refusal.refusal.message}`, { meta: {\n\t\t\t\t...meta,\n\t\t\t\treason: \"discriminator-value-unreadable\"\n\t\t\t} });\n\t\t\treturn contractError(\"CONTRACT.ARGUMENT_INVALID\", `Variant model \"${variant}\" has discriminator value ${JSON.stringify(refusal.refusal.stored)}, which is not a member of enum \"${refusal.enumName}\", the type of discriminator field \"${refusal.baseModel}.${refusal.fieldName}\". Use one of: ${refusal.refusal.members.map((member) => JSON.stringify(member)).join(\", \")}.`, { meta: {\n\t\t\t\t...meta,\n\t\t\t\treason: \"discriminator-value-not-a-member\"\n\t\t\t} });\n\t\t}\n\t\tcase \"discriminatorAndBase\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Model \"${refusal.key.model}\" has both a discriminator and a base. A model is either a base with variants or a variant of one base.`, { meta: {\n\t\t\tmodelName: refusal.key.model,\n\t\t\treason: \"discriminator-and-base\"\n\t\t} });\n\t\tcase \"discriminatorWithoutVariants\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Model \"${refusal.key.model}\" has a discriminator, but no model names it as its base.`, { meta: {\n\t\t\tmodelName: refusal.key.model,\n\t\t\treason: \"discriminator-without-variants\"\n\t\t} });\n\t\tcase \"listedVariantMissing\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Model \"${refusal.key.model}\" lists variant \"${refusal.variant}\", but no model \"${refusal.variant}\" names \"${refusal.key.model}\" as its base.`, { meta: {\n\t\t\tmodelName: refusal.key.model,\n\t\t\tvariant: refusal.variant,\n\t\t\treason: \"listed-variant-missing\"\n\t\t} });\n\t\tcase \"baseWithoutDiscriminator\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Model \"${refusal.key.variant}\" names \"${refusal.baseModel}\" as its base, but \"${refusal.baseModel}\" has no discriminator.`, { meta: {\n\t\t\tmodelName: refusal.key.variant,\n\t\t\tbaseModel: refusal.baseModel,\n\t\t\treason: \"base-without-discriminator\"\n\t\t} });\n\t\tcase \"baseUnknown\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Model \"${refusal.key.variant}\" names \"${refusal.baseModel}\" as its base, but the contract has no model \"${refusal.baseModel}\".`, { meta: {\n\t\t\tmodelName: refusal.key.variant,\n\t\t\tbaseModel: refusal.baseModel,\n\t\t\treason: \"base-unknown\"\n\t\t} });\n\t\tcase \"variantWithoutValue\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Model \"${refusal.key.variant}\" names \"${refusal.baseModel}\" as its base, but \"${refusal.baseModel}\" lists no discriminator value for it.`, { meta: {\n\t\t\tmodelName: refusal.key.variant,\n\t\t\tbaseModel: refusal.baseModel,\n\t\t\treason: \"variant-without-value\"\n\t\t} });\n\t\tcase \"validator\": return validatorRefusalError(refusal.refusal);\n\t}\n}\n/** A builder warning as `defineContract` reports it. */\nfunction authoringWarningOf(warning) {\n\treturn warning.warning;\n}\nfunction differenceWording(difference) {\n\tswitch (difference) {\n\t\tcase \"storedName\": return \"stored name\";\n\t\tcase \"type\": return \"type\";\n\t\tcase \"nullable\": return \"nullability\";\n\t\tcase \"many\": return \"list shape\";\n\t}\n}\n//#endregion\n//#region src/removed-field-presets.ts\nconst GUIDE = \"The upgrade guide \\\"Field presets are removed\\\" lists every rewrite.\";\nconst TEMPORAL_REWRITES = {\n\tcreatedAt: \"field.date().onCreate(gen.now())\",\n\tupdatedAt: \"field.date().onCreate(gen.now()).onUpdate(gen.now())\",\n\ttimestamp: \"field.date(), with .onCreate(gen.now()) and .onUpdate(gen.now()) for the phases the preset set\"\n};\nfunction refuse(preset) {\n\tconst helper = `field.temporal.${preset}`;\n\tthrow contractError(\"CONTRACT.FIELD_HELPER_UNKNOWN\", `${helper} was a field preset, and Prisma 8 removed field presets. Write ${TEMPORAL_REWRITES[preset]}. ${GUIDE}`, { meta: { helper } });\n}\n/**\n* The MongoDB `field` helpers, where `field.temporal`, which held the removed field presets, gives an object whose read of a preset throws `CONTRACT.FIELD_HELPER_UNKNOWN` with its rewrite, so a JavaScript caller, or a contract emitted before it is type-checked, learns what to write instead. Every other read behaves as on `helpers`.\n*/\nfunction refusingRemovedFieldPresets(helpers) {\n\treturn answerMissingPropertyReads(helpers, /* @__PURE__ */ new Set([\"temporal\"]), () => answerMissingPropertyReads({}, new Set(Object.keys(TEMPORAL_REWRITES)), refuse));\n}\n//#endregion\n//#region src/contract-builder.ts\nconst MONGO_RESERVED_HELPER_KEYS = [\n\t\"field\",\n\t\"gen\",\n\t\"index\",\n\t\"model\",\n\t\"rel\",\n\t\"valueObject\"\n];\nfunction stackLookupsOf(components) {\n\tconst codecLookup = extractCodecLookup(components);\n\tassertTypeAliasesValid(composePackAuthoringNamespace(components, \"type\"), {\n\t\tgeneratorFunctions: assembleGeneratorFunctions(components),\n\t\tparamsSchemaOf: (codecId) => codecLookup.descriptorFor(codecId)?.paramsSchema,\n\t\tfieldLength: () => void 0\n\t});\n\tconst { support } = assembleDataTypeSupport(components, (codecId) => codecLookup.descriptorFor(codecId)?.dataType);\n\treturn {\n\t\tcodecLookup,\n\t\tdataTypes: support\n\t};\n}\nfunction composeMongoAuthoringHelpers(family, target, extensions, lookups) {\n\tconst components = [\n\t\tfamily,\n\t\ttarget,\n\t\t...Object.values(extensions ?? {})\n\t];\n\tconst entityNamespace = composePackAuthoringNamespace(components, \"entityTypes\");\n\tassertNoCrossRegistryCollisions(composePackAuthoringNamespace(components, \"type\"), entityNamespace);\n\tconst collisions = Object.keys(entityNamespace).filter((name) => MONGO_RESERVED_HELPER_KEYS.includes(name));\n\tif (collisions.length > 0) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Pack-contributed entity type(s) ${collisions.map((c) => `\"${c}\"`).join(\", \")} collide with the reserved built-in helper key(s) on the Mongo composed helpers surface. Reserved keys: ${MONGO_RESERVED_HELPER_KEYS.map((k) => `\"${k}\"`).join(\", \")}.`, { meta: {\n\t\treason: \"reserved-helper-key-collision\",\n\t\tcontribution: collisions\n\t} });\n\treturn blindCast({\n\t\t...createEntityHelpersFromNamespace(entityNamespace, { ctx: {\n\t\t\tfamily: family.familyId,\n\t\t\ttarget: target.targetId,\n\t\t\tcodecLookup: lookups.codecLookup,\n\t\t\tdataTypes: lookups.dataTypes\n\t\t} }),\n\t\tfield,\n\t\tgen: createGeneratorHelpers(components),\n\t\tindex,\n\t\tmodel,\n\t\trel,\n\t\tvalueObject\n\t});\n}\nfunction createFieldBuilder(spec, enumHandle, executionDefaults, storedName, generatorCalls) {\n\tfunction many(options) {\n\t\treturn createFieldBuilder({\n\t\t\ttype: spec.type,\n\t\t\tnullable: spec.nullable,\n\t\t\tmany: { elementNullable: options?.elementsNullable ?? false }\n\t\t}, enumHandle, executionDefaults, storedName, generatorCalls);\n\t}\n\tfunction withGeneratorCall(phase, call) {\n\t\tif (generatorCalls?.[phase] !== void 0 || executionDefaults?.[phase] !== void 0) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `.${phase}() is called on a field that already generates a value ${phase === \"onCreate\" ? \"on create\" : \"on update\"}. Set each phase once, and do not combine .${phase}() with a type alias or alias constant that sets it.`, { meta: {\n\t\t\treason: \"generator-phase-set-twice\",\n\t\t\tphase\n\t\t} });\n\t\treturn createFieldBuilder(spec, enumHandle, blindCast(executionDefaults), storedName, {\n\t\t\t...generatorCalls,\n\t\t\t[phase]: call\n\t\t});\n\t}\n\treturn {\n\t\t__kind: \"field\",\n\t\t...ifDefined(\"__executionDefaults\", executionDefaults),\n\t\t...ifDefined(\"__generatorCalls\", generatorCalls),\n\t\tonCreate: (call) => withGeneratorCall(\"onCreate\", call),\n\t\tonUpdate: (call) => withGeneratorCall(\"onUpdate\", call),\n\t\t__type: spec.type,\n\t\t__nullable: spec.nullable,\n\t\t__many: spec.many,\n\t\t__enumHandle: blindCast(enumHandle),\n\t\t__storedName: blindCast(storedName),\n\t\toptional: () => createFieldBuilder({\n\t\t\ttype: spec.type,\n\t\t\tnullable: true,\n\t\t\tmany: spec.many\n\t\t}, enumHandle, executionDefaults, storedName, generatorCalls),\n\t\tmany: blindCast(many),\n\t\tmongo: ({ field }) => createFieldBuilder(spec, enumHandle, executionDefaults, field, generatorCalls)\n\t};\n}\nfunction normalizeOptionalTypeParams(typeParams) {\n\tif (!typeParams) return {};\n\treturn { typeParams };\n}\nfunction createScalarFieldBuilder(codecId, options) {\n\treturn createFieldBuilder({\n\t\ttype: blindCast({\n\t\t\tkind: \"scalar\",\n\t\t\tcodecId,\n\t\t\t...normalizeOptionalTypeParams(options?.typeParams)\n\t\t}),\n\t\tnullable: false,\n\t\tmany: false\n\t});\n}\nfunction vectorField(options) {\n\treturn createScalarFieldBuilder(\"mongo/vector@1\", options);\n}\nconst field = refusingRemovedFieldPresets({\n\tscalar: createScalarFieldBuilder,\n\tobjectId() {\n\t\treturn createScalarFieldBuilder(\"mongo/objectId@1\");\n\t},\n\tstring() {\n\t\treturn createScalarFieldBuilder(\"mongo/string@1\");\n\t},\n\tdouble() {\n\t\treturn createScalarFieldBuilder(\"mongo/double@1\");\n\t},\n\tint32() {\n\t\treturn createScalarFieldBuilder(\"mongo/int32@1\");\n\t},\n\tbool() {\n\t\treturn createScalarFieldBuilder(\"mongo/bool@1\");\n\t},\n\tdate() {\n\t\treturn createScalarFieldBuilder(\"mongo/date@1\");\n\t},\n\tint64() {\n\t\treturn createScalarFieldBuilder(\"mongo/int64@1\");\n\t},\n\tint64Number() {\n\t\treturn createScalarFieldBuilder(\"mongo/int64Number@1\");\n\t},\n\tdecimal128() {\n\t\treturn createScalarFieldBuilder(\"mongo/decimal128@1\");\n\t},\n\tbinary() {\n\t\treturn createScalarFieldBuilder(\"mongo/binary@1\");\n\t},\n\tjson() {\n\t\treturn createScalarFieldBuilder(\"mongo/json@1\");\n\t},\n\tbson() {\n\t\treturn createScalarFieldBuilder(\"mongo/bson@1\");\n\t},\n\tvector: vectorField,\n\tvalueObject(valueObjectName) {\n\t\treturn createFieldBuilder({\n\t\t\ttype: blindCast({\n\t\t\t\tkind: \"valueObject\",\n\t\t\t\tplane: \"storage\",\n\t\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\t\tentityKind: \"valueObject\",\n\t\t\t\tentityName: resolveValueObjectName(valueObjectName)\n\t\t\t}),\n\t\t\tnullable: false,\n\t\t\tmany: false\n\t\t});\n\t},\n\tnamedType(handle) {\n\t\treturn createFieldBuilder({\n\t\t\ttype: blindCast({\n\t\t\t\tkind: \"scalar\",\n\t\t\t\tcodecId: handle.codecId\n\t\t\t}),\n\t\t\tnullable: false,\n\t\t\tmany: false\n\t\t}, handle);\n\t}\n});\nfunction index(fields, options) {\n\treturn {\n\t\tfields,\n\t\t...options ? { options } : {}\n\t};\n}\nfunction createFieldReference(modelName, fieldName) {\n\treturn {\n\t\t__kind: \"fieldRef\",\n\t\tmodelName,\n\t\tfieldName\n\t};\n}\nfunction isFieldReference(value) {\n\treturn typeof value === \"object\" && value !== null && \"__kind\" in value && value.__kind === \"fieldRef\";\n}\nfunction resolveValueObjectName(value) {\n\treturn typeof value === \"string\" ? value : value.__name;\n}\nfunction normalizeStringList(value) {\n\treturn typeof value === \"string\" ? [value] : [...value];\n}\nfunction normalizeTargetField(targetModelName, value) {\n\tif (!isFieldReference(value)) return value;\n\tif (value.modelName !== targetModelName) throw contractError(\"CONTRACT.RELATION_INVALID\", `Relation target \"${targetModelName}\" cannot reference field \"${value.modelName}.${value.fieldName}\".`, { meta: {\n\t\tmodelName: targetModelName,\n\t\treason: \"cross-model-field-reference\",\n\t\treferencedModel: value.modelName,\n\t\treferencedField: value.fieldName\n\t} });\n\treturn value.fieldName;\n}\nfunction normalizeTargetFields(targetModelName, value) {\n\tif (typeof value === \"string\") return [value];\n\tif (isFieldReference(value)) return [normalizeTargetField(targetModelName, value)];\n\treturn value.map((entry) => normalizeTargetField(targetModelName, entry));\n}\nfunction createRelationBuilder(spec) {\n\treturn {\n\t\t__kind: \"relation\",\n\t\t__to: spec.to,\n\t\t__cardinality: spec.cardinality,\n\t\t__on: spec.on,\n\t\t__nullable: spec.nullable\n\t};\n}\nfunction createReferenceRelationBuilder(target, cardinality, options, nullable) {\n\tconst targetModelName = resolveModelName(target);\n\treturn createRelationBuilder({\n\t\tto: blindCast(targetModelName),\n\t\tcardinality,\n\t\ton: {\n\t\t\tlocalFields: blindCast(normalizeStringList(options.from)),\n\t\t\ttargetFields: blindCast(normalizeTargetFields(targetModelName, options.to))\n\t\t},\n\t\tnullable\n\t});\n}\nfunction createEmbedRelationBuilder(target, cardinality) {\n\treturn createRelationBuilder({\n\t\tto: blindCast(resolveModelName(target)),\n\t\tcardinality,\n\t\ton: void 0,\n\t\tnullable: void 0\n\t});\n}\nfunction hasOne(target, options) {\n\tif (!options) return createEmbedRelationBuilder(target, \"1:1\");\n\treturn createReferenceRelationBuilder(target, \"1:1\", options, true);\n}\nfunction hasMany(target, options) {\n\tif (!options) return createEmbedRelationBuilder(target, \"1:N\");\n\treturn createReferenceRelationBuilder(target, \"1:N\", options, void 0);\n}\nfunction belongsTo(target, options) {\n\treturn createReferenceRelationBuilder(target, \"N:1\", options, options.optional);\n}\nconst rel = {\n\tbelongsTo,\n\thasMany,\n\thasOne\n};\nfunction valueObject(name, input) {\n\treturn {\n\t\t__kind: \"valueObject\",\n\t\t__name: name,\n\t\t__fields: input.fields\n\t};\n}\nfunction model(name, input) {\n\treturn {\n\t\t__kind: \"model\",\n\t\t__name: name,\n\t\t__fields: input.fields,\n\t\t__relations: blindCast(input.relations ?? {}),\n\t\t__indexes: input.indexes,\n\t\t__collectionOptions: input.collectionOptions,\n\t\t__controlPolicy: input.controlPolicy,\n\t\t__collection: blindCast(input.collection),\n\t\t__owner: blindCast(input.owner ? resolveModelName(input.owner) : void 0),\n\t\t__base: blindCast(input.base ? resolveModelName(input.base) : void 0),\n\t\t__storageRelations: blindCast(input.storageRelations),\n\t\t__discriminator: blindCast(input.discriminator ? { field: input.discriminator.field } : void 0),\n\t\t__variants: blindCast(input.discriminator?.variants),\n\t\tref(fieldName) {\n\t\t\treturn createFieldReference(name, fieldName);\n\t\t}\n\t};\n}\nfunction isContractScaffold(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\treturn \"family\" in value && \"target\" in value;\n}\nfunction buildContractFromDsl(input, lookups) {\n\tconst definition = buildContractDefinition(input);\n\tconst { codecLookup, dataTypes } = lookups ?? stackLookupsOf([\n\t\tinput.family,\n\t\tinput.target,\n\t\t...Object.values(input.extensions ?? {})\n\t]);\n\tconst built = buildMongoContractFromDefinition(definition, codecLookup, dataTypes);\n\tflushAuthoringWarnings((built.ok ? built.value.warnings : built.failure.warnings).map(authoringWarningOf));\n\tif (!built.ok) {\n\t\tconst [first] = built.failure.refusals;\n\t\tassertDefined(first, \"a refused build has at least one refusal\");\n\t\tthrow refusalError(first);\n\t}\n\treturn blindCast(built.value.contract);\n}\n/** Implementation. */\nfunction buildBoundContract(family, target, definition, factory) {\n\tconst full = {\n\t\t...definition,\n\t\tfamily,\n\t\ttarget\n\t};\n\tif (factory !== void 0) {\n\t\tconst lookups = stackLookupsOf([\n\t\t\tfamily,\n\t\t\ttarget,\n\t\t\t...Object.values(definition.extensions ?? {})\n\t\t]);\n\t\tconst built = factory(composeMongoAuthoringHelpers(family, target, definition.extensions, lookups));\n\t\treturn buildContractFromDsl({\n\t\t\t...full,\n\t\t\t...ifDefined(\"models\", built.models),\n\t\t\t...ifDefined(\"valueObjects\", built.valueObjects),\n\t\t\t...ifDefined(\"roots\", built.roots)\n\t\t}, lookups);\n\t}\n\treturn buildContractFromDsl(full);\n}\nfunction defineContract(definition, factory) {\n\tif (!isContractScaffold(definition)) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", \"defineContract expects a contract definition object. Define your contract with defineContract({ family, target, models, ... }).\");\n\tif (factory !== void 0) return buildBoundContract(definition.family, definition.target, definition, factory);\n\treturn buildBoundContract(definition.family, definition.target, definition);\n}\n//#endregion\nexport { bindEnumType, buildBoundContract, buildMongoContractFromDefinition, defineContract, enumType, field, index, isEnumTypeHandle, member, model, rel, valueObject };\n\n//# sourceMappingURL=contract-builder.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,SAAS,cAAc,OAAO,OAAO;CACpC,OAAO;EACN,MAAM;EACN,OAAO;GACN,MAAM;GACN,MAAM;EACP;EACA;CACD;AACD;AACA,SAAS,oBAAoB,aAAa,OAAO;CAChD,OAAO;EACN,MAAM;EACN,OAAO;GACN,MAAM;GACN,MAAM;EACP;EACA;CACD;AACD;;AAEA,SAAS,oBAAoB,SAAS;CACrC,QAAQ,QAAQ,MAAhB;EACC,KAAK,4BAA4B,OAAO;GACvC,MAAM;GACN,OAAO,QAAQ;GACf,UAAU,QAAQ;EACnB;EACA,KAAK;EACL,KAAK,mBAAmB,OAAO;GAC9B,MAAM;GACN,UAAU,QAAQ;EACnB;EACA,KAAK,yBAAyB,OAAO;GACpC,MAAM;GACN,UAAU,QAA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MAAM,UAAU,eAAe;GAC9B;GACA;GACA,GAAG,OAAO,OAAO,WAAW,cAAc,CAAC,CAAC;EAC7C,CAAC;EACD,MAAM,QAAQ,QAAQ,6BAA6B,QAAQ,QAAQ,WAAW,YAAY,OAAO,CAAC;EAClG,OAAO,qBAAqB;GAC3B,GAAG;GACH,GAAG,UAAU,UAAU,MAAM,MAAM;GACnC,GAAG,UAAU,gBAAgB,MAAM,YAAY;GAC/C,GAAG,UAAU,SAAS,MAAM,KAAK;EAClC,GAAG,OAAO;CACX;CACA,OAAO,qBAAqB,IAAI;AACjC;AACA,SAAS,eAAe,YAAY,SAAS;CAC5C,IAAI,CAAC,mBAAmB,UAAU,GAAG,MAAM,cAAc,6BAA6B,iIAAiI;CACvN,IAAI,YAAY,KAAK,GAAG,OAAO,mBAAmB,WAAW,QAAQ,WAAW,QAAQ,YAAY,OAAO;CAC3G,OAAO,mBAAmB,WAAW,QAAQ,WAAW,QAAQ,UAAU;AAC3E"}
@@ -1 +0,0 @@
1
- import "./control-adapter-CLIE-kQU-Bp01Cd9h.mjs";
@@ -1 +0,0 @@
1
- {"version":3,"file":"dist-CroOs9BN.mjs","names":[],"sources":["../../../../2-mongo-family/1-foundation/mongo-contract/dist/index.mjs"],"sourcesContent":["import { t as mongoContractCanonicalizationHooks } from \"./canonicalization-hooks-CRVM-Kqh.mjs\";\nimport { _ as createMongoContractSchema, a as MongoValueSet, c as MongoValidator, d as MongoTimeSeriesCollectionOptions, f as MongoIndexOptionDefaults, g as StorageValueSetSchema, h as MongoContractSchema, l as MongoIndex, m as MongoChangeStreamPreAndPostImagesOptions, n as composeMongoEntityKinds, o as MongoValueObject, p as MongoCollationOptions, s as MongoCollection, u as MongoCollectionOptions, v as createMongoNamespaceEnvelopeSchema } from \"./entity-kinds-CoJfiouk.mjs\";\nimport { t as bsonTypesOfCodec } from \"./mongo-data-type-Bv8Bd0zu.mjs\";\nimport { RelationKeys } from \"@internal/framework-components/runtime\";\nimport { computeStorageHash } from \"@internal/contract/hashing\";\nimport { IRNodeBase, NamespaceBase, UNBOUND_NAMESPACE_ID, buildNamespacedEntities, buildSingleNamespaceView, freezeNode, hydrateNamespaceEntities } from \"@internal/framework-components/ir\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { governingControlPolicy, valueObjectAt, valueObjectsWithCoordinates } from \"@internal/contract/types\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { UNBOUND_DOMAIN_NAMESPACE_ID } from \"@internal/contract/default-namespace\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { validateStorageValueObjects } from \"@internal/contract/validate-storage\";\n//#region src/ir/mongo-unbound-namespace.ts\nvar MongoUnboundNamespace = class MongoUnboundNamespace extends NamespaceBase {\n\tstatic instance = new MongoUnboundNamespace();\n\tid = UNBOUND_NAMESPACE_ID;\n\tentries = Object.freeze({ collection: Object.freeze({}) });\n\tconstructor() {\n\t\tsuper();\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"mongo-namespace\",\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};\n//#endregion\n//#region src/ir/build-mongo-namespace.ts\nconst MONGO_NAMESPACE_KIND = \"mongo-namespace\";\nvar MongoBoundNamespace = class MongoBoundNamespace extends NamespaceBase {\n\tid;\n\tentries;\n\tstatic fromCollectionsInput(input) {\n\t\tconst collectionMap = input.entries[\"collection\"];\n\t\tconst collectionCount = collectionMap !== void 0 ? Object.keys(collectionMap).length : 0;\n\t\tconst hasUnknownKinds = Object.keys(input.entries).some((kind) => kind !== \"collection\");\n\t\tif (input.id === UNBOUND_NAMESPACE_ID && collectionCount === 0 && !hasUnknownKinds) return MongoUnboundNamespace.instance;\n\t\treturn new MongoBoundNamespace(input);\n\t}\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: MONGO_NAMESPACE_KIND,\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};\nfunction buildMongoNamespace(input) {\n\treturn MongoBoundNamespace.fromCollectionsInput(input);\n}\n//#endregion\n//#region src/ir/mongo-storage.ts\nvar MongoStorage = class extends IRNodeBase {\n\tstorageHash;\n\tnamespaces;\n\tconstructor(input) {\n\t\tsuper();\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"mongo-storage\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true\n\t\t});\n\t\tthis.storageHash = input.storageHash;\n\t\tthis.namespaces = Object.freeze(input.namespaces);\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/build-mongo-storage.ts\n/**\n* Builds a Mongo contract's storage: the namespace `namespaceId` holding the collections, value sets and value objects, and the storage hash that `db sign` and `db verify` compare. Every Mongo contract source calls this, so they hash storage the same way.\n*/\nfunction buildMongoStorage(input) {\n\tconst hasValueSets = Object.keys(input.valueSets).length > 0;\n\tconst valueObjects = input.valueObjects ?? {};\n\tconst namespace = buildMongoNamespace({\n\t\tid: input.namespaceId,\n\t\tentries: {\n\t\t\tcollection: input.collections,\n\t\t\t...hasValueSets ? { valueSet: input.valueSets } : {},\n\t\t\t...Object.keys(valueObjects).length > 0 ? { valueObject: valueObjects } : {}\n\t\t}\n\t});\n\treturn new MongoStorage({\n\t\tstorageHash: computeStorageHash({\n\t\t\ttarget: \"mongo\",\n\t\t\ttargetFamily: \"mongo\",\n\t\t\tstorage: { namespaces: { [input.namespaceId]: {\n\t\t\t\tid: input.namespaceId,\n\t\t\t\tentries: {\n\t\t\t\t\tcollection: namespace.entries.collection,\n\t\t\t\t\t...namespace.entries.valueSet !== void 0 ? { valueSet: namespace.entries.valueSet } : {},\n\t\t\t\t\t...namespace.entries.valueObject !== void 0 ? { valueObject: namespace.entries.valueObject } : {}\n\t\t\t\t}\n\t\t\t} } },\n\t\t\t...mongoContractCanonicalizationHooks\n\t\t}),\n\t\tnamespaces: { [input.namespaceId]: namespace }\n\t});\n}\n//#endregion\n//#region src/collection-control-policies.ts\n/** The control policies a built contract declares for its collections. */\nfunction collectionControlPoliciesOf(contract) {\n\treturn {\n\t\tcollections: Object.fromEntries(Object.values(contract.storage.namespaces).flatMap((namespace) => Object.entries(namespace.entries.collection ?? {}).map(([name, collection]) => [name, collection.control]))),\n\t\tdefaultControlPolicy: contract.defaultControlPolicy\n\t};\n}\n/** The control policy that governs `collection`, with the `external` default as a floor, as the planner, the validator derivation and the verifier all read it. */\nfunction collectionControlPolicyOf(collection, policies) {\n\treturn governingControlPolicy({ explicitNodeControlPolicy: policies.collections[collection] }, policies.defaultControlPolicy);\n}\n/** Whether `collection` is managed, so it gets a validator. */\nfunction isManaged(collection, policies) {\n\treturn collectionControlPolicyOf(collection, policies) === \"managed\";\n}\n//#endregion\n//#region src/collection-root-models.ts\n/**\n* The root models of each collection, keyed by collection name: every model stored in the collection that is neither a variant nor embedded, sorted by name.\n*/\nfunction collectionRootModelsOf(models) {\n\tconst roots = {};\n\tfor (const [name, model] of Object.entries(models)) {\n\t\tconst collection = model.storage[\"collection\"];\n\t\tif (typeof collection !== \"string\" || model.base !== void 0 || model.owner !== void 0) continue;\n\t\troots[collection] = [...roots[collection] ?? [], name];\n\t}\n\tfor (const names of Object.values(roots)) names.sort();\n\treturn roots;\n}\n//#endregion\n//#region src/document-id-refusal.ts\n/** The BSON types an `_id` cannot have: MongoDB refuses an array, a regular expression and undefined, and every document has an `_id`. */\nconst FORBIDDEN_DOCUMENT_ID_BSON_TYPES = /* @__PURE__ */ new Set([\n\t\"array\",\n\t\"regex\",\n\t\"undefined\",\n\t\"null\"\n]);\n/**\n* Why an `_id` stored by `codecId` cannot hold `forbidden`, the BSON types it can hold that an `_id` cannot have; an empty list means it can hold any BSON type. The subject is left out, so each caller leads with its own.\n*/\nfunction documentIdRefusalReason(codecId, forbidden) {\n\treturn `can hold ${forbidden.length === 0 ? \"any BSON type\" : `BSON type ${forbidden.join(\" or \")}`} (codec \"${codecId}\"). An _id cannot be an array, a regular expression, undefined or null: MongoDB refuses the first three, and every document has an _id.`;\n}\n/**\n* The refusal of an `_id` that can hold `bsonTypes`, or undefined when an `_id` can. An empty list means any BSON type, which includes all of them.\n*/\nfunction documentIdRefusalOf(codecId, bsonTypes) {\n\tif (bsonTypes.length === 0) return {\n\t\tforbidden: [...FORBIDDEN_DOCUMENT_ID_BSON_TYPES],\n\t\treason: documentIdRefusalReason(codecId, [])\n\t};\n\tconst forbidden = bsonTypes.filter((bsonType) => FORBIDDEN_DOCUMENT_ID_BSON_TYPES.has(bsonType));\n\treturn forbidden.length === 0 ? void 0 : {\n\t\tforbidden,\n\t\treason: documentIdRefusalReason(codecId, forbidden)\n\t};\n}\n/**\n* The BSON types a field stored as `_id` can hold: its codec's, an array for a list, and null for a nullable field. Undefined for a value object, which is stored as an object, and for a codec whose BSON types are unknown, which the field rule refuses.\n*/\nfunction documentIdBsonTypesOf(field, lookups) {\n\tif (field.type.kind !== \"scalar\") return void 0;\n\tconst codecTypes = bsonTypesOfCodec(field.type.codecId, lookups);\n\tif (codecTypes === void 0) return void 0;\n\tconst stored = field.many ? [\"array\"] : codecTypes;\n\treturn field.nullable ? [...stored, \"null\"] : stored;\n}\n//#endregion\n//#region src/field-bson-type-refusal.ts\nconst CANNOT_GIVE = \"so its BSON type is unknown and the contract cannot describe the field.\";\n/**\n* Why a field of codec `codecId` cannot be described, or undefined when its BSON type is known. The reason leaves out its subject so each authoring surface can lead with its own, as in `Field \"Place.location\" uses codec ...`.\n*/\nfunction fieldBsonTypeRefusalOf(codecId, lookups) {\n\tif (bsonTypesOfCodec(codecId, lookups) !== void 0) return void 0;\n\tconst descriptor = lookups.codecLookup.descriptorFor(codecId);\n\tif (descriptor === void 0) return {\n\t\tkind: \"unknownCodec\",\n\t\treason: `uses codec \"${codecId}\", which no pack in the contract provides, ${CANNOT_GIVE}`\n\t};\n\treturn {\n\t\tkind: \"notMongoDataType\",\n\t\tdataType: descriptor.dataType,\n\t\treason: `uses codec \"${codecId}\", whose data type \"${descriptor.dataType}\" is not a MongoDB data type of any pack in the contract, ${CANNOT_GIVE}`\n\t};\n}\n//#endregion\n//#region src/mongo-models.ts\n/** The models of namespace `namespaceId` of a validated MongoDB contract, whose storage records the stored name of every field. */\nfunction mongoModelsOf(domain, namespaceId) {\n\treturn blindCast(domain.namespaces[namespaceId]?.models ?? {});\n}\n/** Model `modelName` followed by its base models, nearest first; empty when the model is not in `models`. */\nfunction modelAndBasesOf(models, modelName) {\n\tconst chain = [];\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (let name = modelName; name !== void 0 && !seen.has(name);) {\n\t\tseen.add(name);\n\t\tconst model = models[name];\n\t\tif (model === void 0) break;\n\t\tchain.push(model);\n\t\tname = model.base?.model;\n\t}\n\treturn chain;\n}\n//#endregion\n//#region src/stored-names.ts\n/** The name MongoDB stores a document's id under. */\nconst DOCUMENT_ID = \"_id\";\n/** Why a field or embed relation cannot be stored as `storedName`, if it cannot; the subject is the field or relation. */\nfunction unsupportedStoredNameReason(storedName) {\n\treturn storedName === \"__proto__\" ? \"is stored as \\\"__proto__\\\", which JavaScript reads as the prototype of an object rather than as a key\" : void 0;\n}\n/** The stored name of each of `model`'s own fields, keyed by field name. */\nfunction ownStoredNamesOf(model) {\n\tconst storageFields = model.storage.fields;\n\treturn Object.fromEntries(Object.keys(model.fields).map((name) => {\n\t\tconst entry = Object.hasOwn(storageFields, name) ? storageFields[name] : void 0;\n\t\tif (entry === void 0) throw new InternalError(`Field \"${name}\" has no entry in its model's storage.fields`);\n\t\treturn [name, entry.field];\n\t}));\n}\n/** The stored name of each field of a value object: its own name, since a value object has no storage block. */\nfunction valueObjectStoredNamesOf(valueObject) {\n\treturn Object.fromEntries(Object.keys(valueObject.fields).map((name) => [name, name]));\n}\n/** The stored name of `fieldName`, one of `model`'s own fields. */\nfunction ownStoredNameOf(model, fieldName) {\n\tconst storedNames = ownStoredNamesOf(model);\n\tconst storedName = Object.hasOwn(storedNames, fieldName) ? storedNames[fieldName] : void 0;\n\tif (storedName === void 0) throw new InternalError(`Model has no field \"${fieldName}\"`);\n\treturn storedName;\n}\n/** The own field of `model` stored under `storedName`, or undefined when no own field is. */\nfunction ownFieldStoredAs(model, storedName) {\n\treturn Object.entries(ownStoredNamesOf(model)).find(([, stored]) => stored === storedName)?.[0];\n}\n/** Whether one of `model`'s own fields is stored under `storedName`. */\nfunction hasOwnFieldStoredAs(model, storedName) {\n\treturn ownFieldStoredAs(model, storedName) !== void 0;\n}\n/** The own field of `model` stored as `_id`, with its name, or undefined when none of its own fields is. */\nfunction ownDocumentIdFieldOf(model) {\n\tconst name = ownFieldStoredAs(model, \"_id\");\n\tconst field = name === void 0 ? void 0 : model.fields[name];\n\treturn name === void 0 || field === void 0 ? void 0 : {\n\t\tname,\n\t\tfield\n\t};\n}\n/**\n* The stored name of each of `model`'s own embed relations, keyed by relation name: its `storage.relations` entry, or the relation's own name when it has none.\n*/\nfunction ownEmbedStoredNamesOf(model) {\n\treturn Object.fromEntries(Object.entries(model.relations).filter(([, relation]) => !(\"on\" in relation) && !(\"through\" in relation)).map(([name]) => [name, model.storage.relations?.[name]?.field ?? name]));\n}\n/** The stored name of each field of model `modelName`, its own and those it inherits from its base models, keyed by field name. */\nfunction storedNamesOf(models, modelName) {\n\tconst chain = [...modelAndBasesOf(models, modelName)].reverse();\n\treturn Object.assign({}, ...chain.map((model) => ownStoredNamesOf(model)));\n}\n//#endregion\n//#region src/relation-fields.ts\n/**\n* The model facts behind a same-space to-one relation's nullability: which side owns the\n* foreign key, and whether each local field is nullable.\n*/\nfunction resolveMongoToOneRelationFields(model, relation) {\n\tconst fields = relation.on.localFields.map((name) => ({\n\t\tname,\n\t\tnullable: model.fields[name]?.nullable ?? true\n\t}));\n\treturn {\n\t\townsForeignKey: !(relation.cardinality === \"1:1\" && fields.every((field) => Object.hasOwn(model.fields, field.name) && ownStoredNameOf(model, field.name) === \"_id\")),\n\t\tfields\n\t};\n}\n/** Whether `relation` stores the related model inside the document, rather than referring to documents elsewhere. */\nfunction isEmbedRelation(relation) {\n\treturn !(\"on\" in relation) && !(\"through\" in relation);\n}\n//#endregion\n//#region src/validator-enum-refusal.ts\nconst STORED_JSON_TYPE_NAMES = {\n\tstring: \"a string\",\n\tnumber: \"a finite number\",\n\tboolean: \"a boolean\",\n\tobject: \"a JSON object\",\n\tarray: \"a JSON array\"\n};\n/**\n* A collection validator lists an enum's members in their stored forms, so an enum's BSON type must be one whose values JSON holds. Maps each such type to the JSON type of a member's stored form.\n*/\nconst VALIDATOR_LISTABLE_BSON_TYPES = {\n\tstring: \"string\",\n\tint: \"number\",\n\tdouble: \"number\",\n\tbool: \"boolean\",\n\tobject: \"object\",\n\tarray: \"array\"\n};\nfunction storedJsonTypeOf(stored) {\n\tif (stored === null) return \"null\";\n\tif (Array.isArray(stored)) return \"array\";\n\tif (typeof stored === \"number\" && !Number.isFinite(stored)) return \"non-finite number\";\n\treturn typeof stored;\n}\nfunction storedText(stored) {\n\treturn typeof stored === \"number\" || typeof stored === \"bigint\" ? String(stored) : JSON.stringify(stored);\n}\n/**\n* Why a collection validator cannot list the members of an enum whose codec stores `bsonTypes`, or undefined when it can. Like {@link validatorEnumMemberRefusalOf}, the reason leaves out its subject so each authoring surface can lead with its own, as in `enum \"Role\" @@type codec \"mongo/int64@1\" stores BSON type long, ...`.\n*/\nfunction validatorEnumRefusalOf(bsonTypes) {\n\tconst [bsonType, ...otherBsonTypes] = bsonTypes;\n\tif (bsonType === void 0 || otherBsonTypes.length > 0) return `declares ${bsonTypes.length} BSON types; an enum needs exactly one. Use a codec with one BSON type, such as mongo/string@1.`;\n\tif (VALIDATOR_LISTABLE_BSON_TYPES[bsonType] === void 0) return `stores BSON type ${bsonType}, which a collection validator cannot list as an enum value. Use a codec whose BSON type is string, int, double, bool, object or array.`;\n}\n/**\n* Why a collection validator cannot list an enum member stored as `stored`, for an enum whose codec stores `bsonTypes`, or undefined when it can. The reason leaves out its subject, as in `enum \"Role\" member \"Admin\" is stored as ...`.\n*/\nfunction validatorEnumMemberRefusalOf(bsonTypes, stored) {\n\tconst enumRefusal = validatorEnumRefusalOf(bsonTypes);\n\tif (enumRefusal !== void 0) return enumRefusal;\n\tconst [bsonType] = bsonTypes;\n\tconst storedJsonType = bsonType === void 0 ? void 0 : VALIDATOR_LISTABLE_BSON_TYPES[bsonType];\n\tif (storedJsonType === void 0 || storedJsonTypeOf(stored) === storedJsonType) return void 0;\n\treturn `is stored as ${storedText(stored)}, which a collection validator cannot list as a ${bsonType}. A member of a ${bsonType} enum must be ${STORED_JSON_TYPE_NAMES[storedJsonType]}.`;\n}\n//#endregion\n//#region src/contract-refusals.ts\n/** Why an embed relation cannot target `embeddedModel`, a model with variants; the subject is the relation. */\nfunction embeddedVariantsReason(embeddedModel) {\n\treturn `embeds model \"${embeddedModel}\", which has variants. The ORM reads and writes only the base fields of an embedded model, so an embedded model cannot have variants.`;\n}\n/**\n* The parts of a MongoDB contract its validators cannot describe that can be decided without codec lookups: an embed relation to a model with variants. `mongoContractRefusalsOf` includes them, and `validateMongoStorage` applies them to a contract read back from `contract.json`.\n*/\nfunction lookupFreeRefusalsOf(models) {\n\treturn Object.entries(models).flatMap(([modelName, model]) => Object.entries(model.relations).flatMap(([relationName, relation]) => isEmbedRelation(relation) && models[relation.to.model]?.variants !== void 0 ? [{\n\t\tkind: \"embeddedModelHasVariants\",\n\t\tmodelName,\n\t\trelationName,\n\t\tembeddedModel: relation.to.model,\n\t\treason: embeddedVariantsReason(relation.to.model)\n\t}] : []));\n}\n/**\n* The enums a collection validator lists: those stored by a model in a managed collection, by one of its variants or embedded models, or by a value object any of them holds. A model field refers to its domain enum and a value object member to the enum's storage value set; both carry the enum's name.\n*/\nfunction validatedEnumNames(input) {\n\tconst { models, valueObjects, controlPolicies } = input;\n\tconst visitedModels = new Set(Object.entries(collectionRootModelsOf(models)).flatMap(([collection, names]) => isManaged(collection, controlPolicies) ? names : []));\n\tconst visitedValueObjects = /* @__PURE__ */ new Set();\n\tconst enums = /* @__PURE__ */ new Set();\n\tconst visitFields = (fields) => {\n\t\tfor (const field of Object.values(fields)) {\n\t\t\tif (field.valueSet !== void 0) enums.add(field.valueSet.entityName);\n\t\t\tif (field.type.kind === \"valueObject\" && !visitedValueObjects.has(field.type.entityName)) {\n\t\t\t\tvisitedValueObjects.add(field.type.entityName);\n\t\t\t\tvisitFields(valueObjects[field.type.entityName]?.fields ?? {});\n\t\t\t}\n\t\t}\n\t};\n\tconst pending = [...visitedModels];\n\tconst reach = (name) => {\n\t\tif (visitedModels.has(name)) return;\n\t\tvisitedModels.add(name);\n\t\tpending.push(name);\n\t};\n\tfor (let name = pending.pop(); name !== void 0; name = pending.pop()) {\n\t\tconst model = models[name];\n\t\tif (model === void 0) continue;\n\t\tvisitFields(model.fields);\n\t\tfor (const relation of Object.values(model.relations)) if (isEmbedRelation(relation)) reach(relation.to.model);\n\t\tfor (const [variant, candidate] of Object.entries(models)) if (candidate.base?.model === name) reach(variant);\n\t}\n\treturn enums;\n}\nfunction enumRefusals(input) {\n\tconst { enums, lookups } = input;\n\tconst validated = validatedEnumNames(input);\n\treturn Object.entries(enums).flatMap(([enumName, { codecId, members }]) => {\n\t\tconst refusal = fieldBsonTypeRefusalOf(codecId, lookups);\n\t\tif (refusal !== void 0) return [{\n\t\t\tkind: \"enumBsonType\",\n\t\t\tenumName,\n\t\t\tcodecId,\n\t\t\trefusal\n\t\t}];\n\t\tif (!validated.has(enumName)) return [];\n\t\tconst bsonTypes = bsonTypesOfCodec(codecId, lookups) ?? [];\n\t\tconst reason = validatorEnumRefusalOf(bsonTypes);\n\t\tif (reason !== void 0) return [{\n\t\t\tkind: \"enumNotListable\",\n\t\t\tenumName,\n\t\t\tcodecId,\n\t\t\treason\n\t\t}];\n\t\treturn members.flatMap((member) => {\n\t\t\tconst memberReason = validatorEnumMemberRefusalOf(bsonTypes, member.value);\n\t\t\treturn memberReason === void 0 ? [] : [{\n\t\t\t\tkind: \"enumMemberNotListable\",\n\t\t\t\tenumName,\n\t\t\t\tmember: member.name,\n\t\t\t\tcodecId,\n\t\t\t\treason: memberReason\n\t\t\t}];\n\t\t});\n\t});\n}\nfunction fieldRefusals(owner, fields, lookups) {\n\treturn Object.entries(fields).flatMap(([fieldName, field]) => {\n\t\tif (field.type.kind !== \"scalar\") return [];\n\t\tconst refusal = fieldBsonTypeRefusalOf(field.type.codecId, lookups);\n\t\treturn refusal === void 0 ? [] : [{\n\t\t\tkind: \"fieldBsonType\",\n\t\t\towner,\n\t\t\tfieldName,\n\t\t\tcodecId: field.type.codecId,\n\t\t\trefusal\n\t\t}];\n\t});\n}\nfunction documentIdRefusals(models, lookups) {\n\treturn Object.entries(collectionRootModelsOf(models)).flatMap(([collection, modelNames]) => modelNames.flatMap((modelName) => {\n\t\tconst model = models[modelName];\n\t\tconst id = model === void 0 ? void 0 : ownDocumentIdFieldOf(model);\n\t\tif (id === void 0 || id.field.type.kind !== \"scalar\") return [];\n\t\tconst bsonTypes = documentIdBsonTypesOf(id.field, lookups);\n\t\tconst codecId = id.field.type.codecId;\n\t\tconst refusal = bsonTypes === void 0 ? void 0 : documentIdRefusalOf(codecId, bsonTypes);\n\t\treturn refusal === void 0 ? [] : [{\n\t\t\tkind: \"documentId\",\n\t\t\tmodelName,\n\t\t\tfieldName: id.name,\n\t\t\tcollection,\n\t\t\tcodecId,\n\t\t\t...refusal\n\t\t}];\n\t}));\n}\n/**\n* Every part of a built MongoDB contract that its collection validators cannot describe: an embed relation to a model with variants, an enum a validator of a managed collection cannot list, a field whose codec has no MongoDB data type, and a root model's field stored as `_id` that can hold a BSON type an `_id` cannot have. Both authoring surfaces call it on what they built, so the rules are decided in one place.\n*/\nfunction mongoContractRefusalsOf(input) {\n\tconst { models, valueObjects, lookups } = input;\n\treturn [\n\t\t...lookupFreeRefusalsOf(models),\n\t\t...enumRefusals(input),\n\t\t...Object.entries(models).flatMap(([name, model]) => fieldRefusals({\n\t\t\tkind: \"model\",\n\t\t\tname\n\t\t}, model.fields, lookups)),\n\t\t...Object.entries(valueObjects).flatMap(([name, valueObject]) => fieldRefusals({\n\t\t\tkind: \"valueObject\",\n\t\t\tname\n\t\t}, valueObject.fields, lookups)),\n\t\t...documentIdRefusals(models, lookups)\n\t];\n}\n//#endregion\n//#region src/contract-view.ts\nconst MONGO_BUILTIN_KINDS = [\"collection\"];\n/**\n* Builds the Mongo view: unwraps the sole namespace's built-in `collection` kind\n* to the root, attaches the namespace-keyed `namespace` map, and layers both\n* over the deserialized contract so the result is a structural superset of the\n* contract.\n*/\nfunction buildMongoContractView(contract) {\n\tconst rootAccessors = buildSingleNamespaceView(contract.storage, MONGO_BUILTIN_KINDS);\n\tconst namespace = buildNamespacedEntities(contract.storage, MONGO_BUILTIN_KINDS);\n\treturn {\n\t\t...contract,\n\t\t...rootAccessors,\n\t\tnamespace\n\t};\n}\n//#endregion\n//#region src/default-namespace.ts\n/** Default storage namespace for Mongo-family contracts at runtime. */\nconst defaultMongoStorageNamespaceId = UNBOUND_NAMESPACE_ID;\n/** Default domain namespace for Mongo-family contracts at runtime. */\nconst defaultMongoDomainNamespaceId = UNBOUND_DOMAIN_NAMESPACE_ID;\n//#endregion\n//#region src/recursive-groups.ts\nfunction modelKey(name) {\n\treturn `model:${name}`;\n}\n/** The key of a value object, by its storage coordinate, so value objects of one name in two namespaces stay apart. */\nfunction valueObjectKey(reference) {\n\treturn `valueObject:${JSON.stringify([reference.namespaceId, reference.entityName])}`;\n}\nfunction referencesOf(fields) {\n\treturn Object.values(fields).flatMap((field) => field.type.kind === \"valueObject\" ? [valueObjectKey(field.type)] : []);\n}\n/**\n* The recursive groups of value objects and embedded models: each set of types that can reach each other through value-object fields and embed relations (a strongly connected component of that graph), and each type that refers to itself. Maps the {@link valueObjectKey} or {@link modelKey} of every type in such a group to the group's number; a type in no recursive group is absent.\n*/\nfunction recursiveGroupsOf(storage, models) {\n\tconst edges = /* @__PURE__ */ new Map();\n\tfor (const { coordinate, valueObject } of valueObjectsWithCoordinates(storage)) edges.set(valueObjectKey(coordinate), referencesOf(valueObject.fields));\n\tfor (const [name, model] of Object.entries(models)) {\n\t\tconst embeds = Object.values(model.relations).flatMap((relation) => isEmbedRelation(relation) ? [modelKey(relation.to.model)] : []);\n\t\tedges.set(modelKey(name), [...referencesOf(model.fields), ...embeds]);\n\t}\n\tconst groups = /* @__PURE__ */ new Map();\n\tconst index = /* @__PURE__ */ new Map();\n\tconst lowLink = /* @__PURE__ */ new Map();\n\tconst stack = [];\n\tconst onStack = /* @__PURE__ */ new Set();\n\tlet nextIndex = 0;\n\tlet nextGroup = 0;\n\tconst visit = (node) => {\n\t\tindex.set(node, nextIndex);\n\t\tlowLink.set(node, nextIndex);\n\t\tnextIndex++;\n\t\tstack.push(node);\n\t\tonStack.add(node);\n\t\tfor (const target of edges.get(node) ?? []) {\n\t\t\tif (!edges.has(target)) continue;\n\t\t\tif (!index.has(target)) {\n\t\t\t\tvisit(target);\n\t\t\t\tlowLink.set(node, Math.min(lowLink.get(node) ?? 0, lowLink.get(target) ?? 0));\n\t\t\t} else if (onStack.has(target)) lowLink.set(node, Math.min(lowLink.get(node) ?? 0, index.get(target) ?? 0));\n\t\t}\n\t\tif (lowLink.get(node) !== index.get(node)) return;\n\t\tconst members = [];\n\t\tlet member;\n\t\tdo {\n\t\t\tmember = stack.pop();\n\t\t\tif (member === void 0) break;\n\t\t\tonStack.delete(member);\n\t\t\tmembers.push(member);\n\t\t} while (member !== node);\n\t\tconst refersToItself = (edges.get(node) ?? []).includes(node);\n\t\tif (members.length > 1 || refersToItself) {\n\t\t\tfor (const each of members) groups.set(each, nextGroup);\n\t\t\tnextGroup++;\n\t\t}\n\t};\n\tfor (const node of edges.keys()) if (!index.has(node)) visit(node);\n\treturn groups;\n}\n//#endregion\n//#region src/derive-json-schema.ts\n/**\n* `$jsonSchema` has no references, so a type that contains itself, directly or through other types, cannot be described at every depth. The validator describes the type through which a path enters a recursive group in full, and accepts any object for each field below it that refers back into that group. So each group is written out once for each place a document enters it, and no valid document is refused.\n*/\nconst OPEN_OBJECT = { bsonType: \"object\" };\nfunction sourcesFor(input, rootKey) {\n\tconst groups = recursiveGroupsOf(input.storage, input.models);\n\tconst rootGroup = groups.get(rootKey);\n\treturn {\n\t\t...input,\n\t\tgroups,\n\t\tenteredGroups: new Set(rootGroup === void 0 ? [] : [rootGroup])\n\t};\n}\nfunction objectSchemaOf(key, shape, sources) {\n\tconst group = sources.groups.get(key);\n\tif (group !== void 0 && sources.enteredGroups.has(group)) return OPEN_OBJECT;\n\treturn deriveObjectSchema(shape, entering(key, sources));\n}\n/** `sources` with the recursive group of the type `key` entered, if it has one. */\nfunction entering(key, sources) {\n\tconst group = sources.groups.get(key);\n\tif (group === void 0 || sources.enteredGroups.has(group)) return sources;\n\treturn {\n\t\t...sources,\n\t\tenteredGroups: /* @__PURE__ */ new Set([...sources.enteredGroups, group])\n\t};\n}\nfunction modelShape(model) {\n\treturn {\n\t\tfields: model.fields,\n\t\trelations: model.relations,\n\t\tstoredNames: ownStoredNamesOf(model),\n\t\tembedStoredNames: ownEmbedStoredNamesOf(model)\n\t};\n}\nfunction valueObjectShape(valueObject) {\n\treturn {\n\t\tfields: valueObject.fields,\n\t\trelations: {},\n\t\tstoredNames: valueObjectStoredNamesOf(valueObject),\n\t\tembedStoredNames: {}\n\t};\n}\nconst NOTHING_INHERITED = {\n\tfields: {},\n\trelations: {},\n\tstoredNames: {},\n\tembedStoredNames: {}\n};\n/**\n* The `bsonType` keyword for a list of BSON type names: the name itself for one entry, the list for several.\n*/\nfunction bsonTypeKeyword(bsonTypes) {\n\tconst [only, ...rest] = bsonTypes;\n\treturn only !== void 0 && rest.length === 0 ? only : [...bsonTypes];\n}\nfunction withNull(bsonTypes) {\n\treturn bsonTypes.includes(\"null\") ? bsonTypes : [\"null\", ...bsonTypes];\n}\nfunction anyValueSchema(field) {\n\tif (\"many\" in field && field.many) return {\n\t\tbsonType: field.nullable ? [\"null\", \"array\"] : \"array\",\n\t\titems: {}\n\t};\n\treturn {};\n}\nfunction fieldToBsonSchema(field, sources) {\n\tconst { lookups, storage, valueSets } = sources;\n\tif (field.type.kind === \"scalar\") {\n\t\tconst bsonTypes = bsonTypesOfCodec(field.type.codecId, lookups);\n\t\tassertDefined(bsonTypes, `Field codec \"${field.type.codecId}\" has no MongoDB data type; the authoring surface refuses such a field before it derives the validator`);\n\t\tif (bsonTypes.length === 0) return anyValueSchema(field);\n\t\tconst bsonType = bsonTypeKeyword(bsonTypes);\n\t\tconst enumValues = field.valueSet !== void 0 ? valueSets[field.valueSet.entityName]?.values ?? null : null;\n\t\tif (field.many) {\n\t\t\tconst items = { bsonType: field.many.elementNullable ? [\"null\", bsonType] : bsonType };\n\t\t\tif (enumValues) items[\"enum\"] = field.many.elementNullable ? [...enumValues, null] : enumValues;\n\t\t\treturn {\n\t\t\t\tbsonType: field.nullable ? [\"null\", \"array\"] : \"array\",\n\t\t\t\titems\n\t\t\t};\n\t\t}\n\t\tif (field.nullable) {\n\t\t\tconst s = { bsonType: bsonTypeKeyword(withNull(bsonTypes)) };\n\t\t\tif (enumValues) s[\"enum\"] = [...enumValues, null];\n\t\t\treturn s;\n\t\t}\n\t\tconst s = { bsonType };\n\t\tif (enumValues) s[\"enum\"] = enumValues;\n\t\treturn s;\n\t}\n\tif (field.type.kind === \"valueObject\") {\n\t\tconst vo = valueObjectAt(storage, field.type);\n\t\tif (!vo) return void 0;\n\t\tconst voSchema = objectSchemaOf(valueObjectKey(field.type), valueObjectShape(vo), sources);\n\t\tif (field.many) return {\n\t\t\tbsonType: field.nullable ? [\"null\", \"array\"] : \"array\",\n\t\t\titems: field.many.elementNullable ? { oneOf: [{ bsonType: \"null\" }, voSchema] } : voSchema\n\t\t};\n\t\tif (field.nullable) return { oneOf: [{ bsonType: \"null\" }, voSchema] };\n\t\treturn voSchema;\n\t}\n}\n/**\n* An embedded model is stored inside its owner's document as a closed object (a list of them for `1:N`). The contract does not say whether one must be present, and the ORM creates documents without them, so the property is never required.\n*/\nfunction embedToBsonSchema(relation, sources) {\n\tconst embeddedName = relation.to.model;\n\tconst embedded = sources.models[embeddedName];\n\tassertDefined(embedded, `Embedded model \"${embeddedName}\" is missing`);\n\tconst schema = objectSchemaOf(modelKey(embeddedName), modelShape(embedded), sources);\n\treturn relation.cardinality === \"1:N\" ? {\n\t\tbsonType: \"array\",\n\t\titems: schema\n\t} : schema;\n}\n/**\n* The properties of `shape`, leaving out the fields and relations `inherited` already describes.\n*/\nfunction propertiesOf(shape, sources, inherited) {\n\tconst properties = {};\n\tconst required = [];\n\tfor (const [fieldName, field] of Object.entries(shape.fields)) {\n\t\tif (Object.hasOwn(inherited.fields, fieldName)) continue;\n\t\tconst schema = fieldToBsonSchema(field, sources);\n\t\tif (schema) {\n\t\t\tconst storedName = shape.storedNames[fieldName];\n\t\t\tassertDefined(storedName, `Field \"${fieldName}\" has a stored name`);\n\t\t\tproperties[storedName] = schema;\n\t\t\tif (!field.nullable) required.push(storedName);\n\t\t}\n\t}\n\tfor (const [relationName, relation] of Object.entries(shape.relations)) {\n\t\tif (Object.hasOwn(inherited.relations, relationName) || !isEmbedRelation(relation)) continue;\n\t\tconst storedName = shape.embedStoredNames[relationName];\n\t\tassertDefined(storedName, `Embed relation \"${relationName}\" has a stored name`);\n\t\tproperties[storedName] = embedToBsonSchema(relation, sources);\n\t}\n\treturn {\n\t\tproperties,\n\t\trequired\n\t};\n}\nconst OBJECT_ID_SCHEMA = { bsonType: \"objectId\" };\nfunction deriveObjectSchema(shape, sources, { isDocument } = { isDocument: false }) {\n\tconst own = propertiesOf(shape, sources, NOTHING_INHERITED);\n\tconst addsDocumentId = isDocument && !Object.values(shape.storedNames).includes(\"_id\");\n\tconst properties = addsDocumentId ? {\n\t\t[\"_id\"]: OBJECT_ID_SCHEMA,\n\t\t...own.properties\n\t} : own.properties;\n\tconst required = addsDocumentId ? [\"_id\", ...own.required] : own.required;\n\tconst result = {\n\t\tbsonType: \"object\",\n\t\tproperties,\n\t\tadditionalProperties: false\n\t};\n\tif (required.length > 0) result[\"required\"] = required.sort();\n\treturn result;\n}\nfunction isRecord$1(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction validatorOf(jsonSchema) {\n\treturn new MongoValidator({\n\t\tjsonSchema,\n\t\tvalidationLevel: \"strict\",\n\t\tvalidationAction: \"error\"\n\t});\n}\nfunction polymorphicSchema(base, discriminatorField, variants, sources) {\n\tconst baseSchema = deriveObjectSchema(base, sources, { isDocument: true });\n\tconst baseProperties = isRecord$1(baseSchema[\"properties\"]) ? baseSchema[\"properties\"] : {};\n\tconst oneOf = [];\n\tfor (const variant of variants) {\n\t\tconst { properties: variantProperties, required } = propertiesOf(variant, entering(modelKey(variant.modelName), sources), base);\n\t\toneOf.push({\n\t\t\tproperties: {\n\t\t\t\t...baseProperties,\n\t\t\t\t[discriminatorField]: { enum: [variant.discriminatorValue] },\n\t\t\t\t...variantProperties\n\t\t\t},\n\t\t\trequired: [discriminatorField, ...required].sort(),\n\t\t\tadditionalProperties: false\n\t\t});\n\t}\n\tconst jsonSchema = { ...baseSchema };\n\tdelete jsonSchema[\"additionalProperties\"];\n\tif (oneOf.length > 0) jsonSchema[\"oneOf\"] = oneOf;\n\treturn jsonSchema;\n}\n/**\n* The `$jsonSchema` of a root model's documents: the model's fields and embedded models, and for a model with variants one `oneOf` branch per variant.\n*/\nfunction deriveModelJsonSchema(modelName, model, sources) {\n\tconst schemaSources = sourcesFor(sources, modelKey(modelName));\n\tif (!model.discriminator || !model.variants) return deriveObjectSchema(modelShape(model), schemaSources, { isDocument: true });\n\tconst variants = Object.entries(model.variants).map(([discriminatorValue, variant]) => {\n\t\tconst variantModel = sources.models[variant.model];\n\t\tassertDefined(variantModel, `Variant model \"${variant.model}\" of \"${modelName}\" is missing`);\n\t\treturn {\n\t\t\tdiscriminatorValue,\n\t\t\tmodelName: variant.model,\n\t\t\t...modelShape(variantModel)\n\t\t};\n\t});\n\treturn polymorphicSchema(modelShape(model), ownStoredNameOf(model, model.discriminator.field), variants, schemaSources);\n}\n//#endregion\n//#region src/derive-collection-validators.ts\n/**\n* The validator of each managed collection that stores a root model, keyed by collection name. A collection under another control policy holds documents Prisma does not own the shape of, so it gets none. A root model with variants gets one polymorphic schema covering every variant. A collection that stores several root models accepts a document of any of them: its schema has one `anyOf` branch per root model.\n*/\nfunction deriveCollectionValidators(input) {\n\tconst validators = {};\n\tfor (const [collectionName, modelNames] of Object.entries(collectionRootModelsOf(input.models))) {\n\t\tif (!isManaged(collectionName, input.controlPolicies)) continue;\n\t\tconst schemas = modelNames.map((modelName) => {\n\t\t\tconst model = input.models[modelName];\n\t\t\tassertDefined(model, `Root model \"${modelName}\" of collection \"${collectionName}\" is missing`);\n\t\t\treturn deriveModelJsonSchema(modelName, model, input);\n\t\t});\n\t\tconst [only, ...others] = schemas;\n\t\tassertDefined(only, `Collection \"${collectionName}\" has no root model`);\n\t\tvalidators[collectionName] = validatorOf(others.length === 0 ? only : {\n\t\t\tbsonType: \"object\",\n\t\t\tanyOf: schemas\n\t\t});\n\t}\n\treturn validators;\n}\n//#endregion\n//#region src/ir/mongo-clustered-collection-options.ts\n/**\n* Clustered-collection options (the `clusteredIndex` collection-creation\n* field). Lifted from a `type =` data shape to an AST class extending\n* `IRNodeBase` per FR18.\n*\n* MongoDB requires `key` and `unique` for any clustered collection; the\n* constructor enforces presence by type signature.\n*/\nvar MongoClusteredCollectionOptions = class extends IRNodeBase {\n\tkind = \"mongo-clustered-collection-options\";\n\tkey;\n\tunique;\n\tconstructor(options) {\n\t\tsuper();\n\t\tif (options.name !== void 0) this.name = options.name;\n\t\tthis.key = options.key;\n\t\tthis.unique = options.unique;\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/ir/mongo-index-options.ts\n/**\n* Mongo Contract IR node for the per-index option vocabulary (the second\n* argument to `db.collection.createIndex(keys, options)` minus the keys\n* themselves). Lifted from a `type =` data shape to an AST class\n* extending `IRNodeBase` per FR18.\n*\n* Nested `collation` is itself an IR class (`MongoCollationOptions`); the\n* constructor accepts either a class instance or a data literal and\n* normalises to the class form so downstream walks see a uniform IR tree.\n*/\nvar MongoIndexOptions = class extends IRNodeBase {\n\tkind = \"mongo-index-options\";\n\tconstructor(options = {}) {\n\t\tsuper();\n\t\tif (options.unique !== void 0) this.unique = options.unique;\n\t\tif (options.name !== void 0) this.name = options.name;\n\t\tif (options.partialFilterExpression !== void 0) this.partialFilterExpression = options.partialFilterExpression;\n\t\tif (options.sparse !== void 0) this.sparse = options.sparse;\n\t\tif (options.expireAfterSeconds !== void 0) this.expireAfterSeconds = options.expireAfterSeconds;\n\t\tif (options.weights !== void 0) this.weights = options.weights;\n\t\tif (options.default_language !== void 0) this.default_language = options.default_language;\n\t\tif (options.language_override !== void 0) this.language_override = options.language_override;\n\t\tif (options.textIndexVersion !== void 0) this.textIndexVersion = options.textIndexVersion;\n\t\tif (options[\"2dsphereIndexVersion\"] !== void 0) this[\"2dsphereIndexVersion\"] = options[\"2dsphereIndexVersion\"];\n\t\tif (options.bits !== void 0) this.bits = options.bits;\n\t\tif (options.min !== void 0) this.min = options.min;\n\t\tif (options.max !== void 0) this.max = options.max;\n\t\tif (options.bucketSize !== void 0) this.bucketSize = options.bucketSize;\n\t\tif (options.hidden !== void 0) this.hidden = options.hidden;\n\t\tif (options.collation !== void 0) this.collation = options.collation instanceof MongoCollationOptions ? options.collation : new MongoCollationOptions(options.collation);\n\t\tif (options.wildcardProjection !== void 0) this.wildcardProjection = options.wildcardProjection;\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/mongo-enum.ts\n/**\n* The storage value set of each enum: its members as the contract holds them, in the form their codec stores.\n*/\nfunction mongoValueSetsOf(enums) {\n\tconst valueSets = {};\n\tfor (const [enumName, { members }] of Object.entries(enums)) valueSets[enumName] = {\n\t\tkind: \"valueSet\",\n\t\tvalues: members.map((member) => member.value)\n\t};\n\treturn valueSets;\n}\n//#endregion\n//#region src/polymorphic-index-scope.ts\nfunction isScalarDiscriminatorValue(value) {\n\tconst t = typeof value;\n\treturn t === \"string\" || t === \"number\" || t === \"boolean\";\n}\nfunction formatValue(value) {\n\tif (typeof value === \"string\") return JSON.stringify(value);\n\tif (value === null) return \"null\";\n\tif (Array.isArray(value)) return JSON.stringify(value);\n\tif (typeof value === \"object\") return JSON.stringify(value);\n\treturn String(value);\n}\nfunction applyPolymorphicScopeToMongoIndex(index, scope) {\n\tif (!isScalarDiscriminatorValue(scope.discriminatorValue)) return {\n\t\tkind: \"conflict\",\n\t\treason: `Variant-scoped indexes require a scalar (string, number, or boolean) discriminator value for field \"${scope.discriminatorField}\", but received ${formatValue(scope.discriminatorValue)}.`\n\t};\n\tconst existing = index.partialFilterExpression;\n\tif (existing && Object.hasOwn(existing, scope.discriminatorField)) {\n\t\tconst existingValue = existing[scope.discriminatorField];\n\t\tif (existingValue === scope.discriminatorValue) return {\n\t\t\tkind: \"ok\",\n\t\t\tindex\n\t\t};\n\t\treturn {\n\t\t\tkind: \"conflict\",\n\t\t\treason: `Index partialFilterExpression sets \"${scope.discriminatorField}\" to ${formatValue(existingValue)}, which conflicts with the variant's discriminator value ${formatValue(scope.discriminatorValue)}.`\n\t\t};\n\t}\n\tconst merged = {\n\t\t...existing ?? {},\n\t\t[scope.discriminatorField]: scope.discriminatorValue\n\t};\n\treturn {\n\t\tkind: \"ok\",\n\t\tindex: new MongoIndex({\n\t\t\tkeys: index.keys,\n\t\t\t...index.unique !== void 0 && { unique: index.unique },\n\t\t\t...index.sparse !== void 0 && { sparse: index.sparse },\n\t\t\t...index.expireAfterSeconds !== void 0 && { expireAfterSeconds: index.expireAfterSeconds },\n\t\t\tpartialFilterExpression: merged,\n\t\t\t...index.wildcardProjection !== void 0 && { wildcardProjection: index.wildcardProjection },\n\t\t\t...index.collation !== void 0 && { collation: index.collation },\n\t\t\t...index.weights !== void 0 && { weights: index.weights },\n\t\t\t...index.default_language !== void 0 && { default_language: index.default_language },\n\t\t\t...index.language_override !== void 0 && { language_override: index.language_override }\n\t\t})\n\t};\n}\n//#endregion\n//#region src/validator-shapes.ts\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction records(value) {\n\treturn Array.isArray(value) ? value.filter(isRecord) : [];\n}\nfunction shapeOf(schema) {\n\tconst properties = schema[\"properties\"];\n\tconst required = schema[\"required\"];\n\treturn {\n\t\tproperties: isRecord(properties) ? properties : {},\n\t\trequired: Array.isArray(required) ? required.filter((name) => typeof name === \"string\") : []\n\t};\n}\n/**\n* The root model shapes a collection validator's `$jsonSchema` describes, as `deriveCollectionValidators` writes it: one per `anyOf` branch when the collection stores several root models, otherwise the schema itself, each with its variants' `oneOf` branches.\n*/\nfunction validatorRootShapesOf(jsonSchema) {\n\tif (!isRecord(jsonSchema)) return [];\n\treturn (Array.isArray(jsonSchema[\"anyOf\"]) ? records(jsonSchema[\"anyOf\"]) : [jsonSchema]).map((root) => ({\n\t\t...shapeOf(root),\n\t\tvariants: records(root[\"oneOf\"]).map(shapeOf)\n\t}));\n}\n/** Every field name a collection validator declares, for a root model or for a variant. */\nfunction validatorFieldNamesOf(jsonSchema) {\n\treturn new Set(validatorRootShapesOf(jsonSchema).flatMap((root) => [...Object.keys(root.properties), ...root.variants.flatMap((variant) => Object.keys(variant.properties))]));\n}\n//#endregion\n//#region src/validate-storage.ts\nfunction bsonTypesOf(schema) {\n\tif (!(\"bsonType\" in schema)) return [];\n\tconst { bsonType } = schema;\n\treturn (Array.isArray(bsonType) ? bsonType : [bsonType]).filter((type) => typeof type === \"string\");\n}\nfunction idSchemaOf(shape) {\n\tconst id = shape.properties[\"_id\"];\n\treturn shape.required.includes(\"_id\") && typeof id === \"object\" && id !== null ? id : void 0;\n}\n/**\n* What a collection validator gets wrong about `_id`: a root model's branch that does not require it, or an `_id` that can hold a BSON type an `_id` cannot have, refused with the reason the build gives.\n*/\nfunction documentIdErrors(contract) {\n\tconst models = Object.assign({}, ...Object.keys(contract.domain.namespaces).map((namespaceId) => mongoModelsOf(contract.domain, namespaceId)));\n\tconst rootModels = collectionRootModelsOf(models);\n\treturn Object.values(contract.storage.namespaces).flatMap((namespace) => Object.entries(namespace.entries[\"collection\"] ?? {}).flatMap(([name, collection]) => {\n\t\tif (collection.validator === void 0) return [];\n\t\tconst shapes = validatorRootShapesOf(collection.validator.jsonSchema);\n\t\tconst idSchemas = shapes.map(idSchemaOf);\n\t\tif (shapes.length === 0 || idSchemas.includes(void 0)) return [`Collection \"${name}\": its validator must require _id, for every model the collection stores, since every document has an _id`];\n\t\tconst names = rootModels[name] ?? [];\n\t\treturn idSchemas.flatMap((idSchema, index) => {\n\t\t\tconst modelName = names.length === shapes.length ? names[index] : void 0;\n\t\t\tconst model = modelName === void 0 ? void 0 : models[modelName];\n\t\t\tconst id = model === void 0 ? void 0 : ownDocumentIdFieldOf(model);\n\t\t\tconst codecId = id?.field.type.kind === \"scalar\" ? id.field.type.codecId : \"unknown\";\n\t\t\tconst refusal = idSchema === void 0 ? void 0 : documentIdRefusalOf(codecId, bsonTypesOf(idSchema));\n\t\t\tif (refusal === void 0) return [];\n\t\t\treturn [id === void 0 ? `Collection \"${name}\": its validator's _id ${refusal.reason}` : `Model \"${modelName}\" field \"${id.name}\" ${refusal.reason}`];\n\t\t});\n\t}));\n}\nfunction formatCrossRef(crossRef) {\n\treturn `${crossRef.namespace}.${crossRef.model}`;\n}\nfunction storageDeclaresCollection(storage, collectionName) {\n\tfor (const ns of Object.values(storage.namespaces)) if (Object.hasOwn(ns.entries[\"collection\"] ?? {}, collectionName)) return true;\n\treturn false;\n}\nfunction fieldStorageErrors(qualifiedName, modelName, model, models) {\n\tconst errors = [];\n\tconst storageFields = model.storage.fields;\n\tfor (const fieldName of Object.keys(model.fields)) if (!Object.hasOwn(storageFields, fieldName)) errors.push(`Model \"${qualifiedName}\" field \"${fieldName}\" has no entry in storage.fields`);\n\tfor (const fieldName of Object.keys(storageFields)) if (!Object.hasOwn(model.fields, fieldName)) errors.push(`Model \"${qualifiedName}\" storage.fields names \"${fieldName}\", which is not a field of the model`);\n\terrors.push(...unsupportedStoredNameErrors(qualifiedName, model));\n\tif (errors.length > 0) return errors;\n\tconst chain = [...modelAndBasesOf(models, modelName)].reverse();\n\tif (!chain.every(hasCompleteFieldStorage)) return errors;\n\tconst membersByStoredName = /* @__PURE__ */ new Map();\n\tconst members = chain.flatMap((each) => [...Object.entries(ownStoredNamesOf(each)).map(([name, storedName]) => [`field \"${name}\"`, storedName]), ...Object.entries(ownEmbedStoredNamesOf(each)).map(([name, storedName]) => [`embed relation \"${name}\"`, storedName])]);\n\tfor (const [member, storedName] of members) {\n\t\tconst other = membersByStoredName.get(storedName);\n\t\tif (other !== void 0 && other !== member) errors.push(bothStoredAs(qualifiedName, other, member, storedName));\n\t\tmembersByStoredName.set(storedName, member);\n\t}\n\treturn errors;\n}\nfunction unsupportedStoredNameErrors(qualifiedName, model) {\n\treturn [...Object.entries(model.storage.fields).map(([name, { field }]) => [`field \"${name}\"`, field]), ...Object.entries(model.storage.relations ?? {}).map(([name, { field }]) => [`embed relation \"${name}\"`, field])].flatMap(([member, storedName]) => {\n\t\tconst reason = unsupportedStoredNameReason(storedName);\n\t\treturn reason === void 0 ? [] : [`Model \"${qualifiedName}\" ${member} ${reason}`];\n\t});\n}\nfunction hasCompleteFieldStorage(model) {\n\treturn Object.keys(model.fields).every((name) => Object.hasOwn(model.storage.fields, name));\n}\nfunction bothStoredAs(qualifiedName, first, second, storedName) {\n\tconst fieldPrefix = \"field \\\"\";\n\tif (first.startsWith(fieldPrefix) && second.startsWith(fieldPrefix)) {\n\t\tconst [a, b] = [first, second].map((member) => member.slice(7, -1)).sort();\n\t\treturn `Model \"${qualifiedName}\" fields \"${a}\" and \"${b}\" are both stored as \"${storedName}\"`;\n\t}\n\treturn `Model \"${qualifiedName}\" ${first} and ${second} are both stored as \"${storedName}\"`;\n}\nfunction validateMongoStorage(contract) {\n\tvalidateStorageValueObjects(contract.storage);\n\tconst errors = [];\n\tlet fieldStorageComplete = true;\n\tfor (const namespaceId of Object.keys(contract.domain.namespaces)) {\n\t\tconst models = mongoModelsOf(contract.domain, namespaceId);\n\t\tfor (const [modelName, model] of Object.entries(models)) {\n\t\t\tconst qualifiedName = `${namespaceId}:${modelName}`;\n\t\t\tconst fieldErrors = fieldStorageErrors(qualifiedName, modelName, model, models);\n\t\t\tif (fieldErrors.length > 0) fieldStorageComplete = false;\n\t\t\terrors.push(...fieldErrors);\n\t\t\tif (model.storage.collection && !storageDeclaresCollection(contract.storage, model.storage.collection)) errors.push(`Model \"${qualifiedName}\" references collection \"${model.storage.collection}\" which is not declared under any namespace's collections map`);\n\t\t\tif (model.base) {\n\t\t\t\tconst baseModel = models[model.base.model];\n\t\t\t\tif (baseModel) {\n\t\t\t\t\tconst variantCollection = model.storage.collection;\n\t\t\t\t\tconst baseCollection = baseModel.storage.collection;\n\t\t\t\t\tif (variantCollection !== baseCollection) errors.push(`Mongo does not support multi-table inheritance; variant \"${qualifiedName}\" must share its base's collection (\"${baseCollection ?? \"(none)\"}\"), but has \"${variantCollection ?? \"(none)\"}\"`);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const [relName, relation] of Object.entries(model.relations ?? {})) {\n\t\t\t\tconst targetModel = models[relation.to.model];\n\t\t\t\tconst targetLabel = formatCrossRef(relation.to);\n\t\t\t\tif (targetModel?.owner) {\n\t\t\t\t\tif (targetModel.owner !== modelName) errors.push(`Embed relation \"${relName}\" targets \"${targetLabel}\" which is owned by \"${targetModel.owner}\", not \"${qualifiedName}\"`);\n\t\t\t\t\tif (targetModel.storage.collection) errors.push(`Embed relation \"${relName}\" targets \"${targetLabel}\" which must not have a collection`);\n\t\t\t\t} else if (\"on\" in relation && relation.on) {\n\t\t\t\t\tfor (const localField of relation.on.localFields) if (!(localField in model.fields)) errors.push(`Reference relation \"${relName}\": localField \"${localField}\" is not a field on model \"${qualifiedName}\"`);\n\t\t\t\t\tif (targetModel) {\n\t\t\t\t\t\tfor (const targetField of relation.on.targetFields) if (!(targetField in targetModel.fields)) errors.push(`Reference relation \"${relName}\": targetField \"${targetField}\" is not a field on model \"${targetLabel}\"`);\n\t\t\t\t\t}\n\t\t\t\t\tconst nullabilityError = fieldErrors.length > 0 ? void 0 : toOneRelationNullabilityError(qualifiedName, relName, relation, model);\n\t\t\t\t\tif (nullabilityError !== void 0) errors.push(nullabilityError);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfor (const namespace of Object.values(contract.domain.namespaces)) for (const refusal of lookupFreeRefusalsOf(namespace.models)) if (refusal.kind === \"embeddedModelHasVariants\") errors.push(`Relation \"${refusal.modelName}.${refusal.relationName}\" ${refusal.reason}`);\n\tif (fieldStorageComplete) errors.push(...documentIdErrors(contract));\n\tif (errors.length > 0) throw structuredError(\"CONTRACT.VALIDATION_FAILED\", `Contract storage validation failed:\\n- ${errors.join(\"\\n- \")}`);\n}\n/**\n* A same-space to-one relation that states `nullable` must agree with its local fields: nullable\n* exactly when one of them is nullable (a field that is not declared counts as nullable). A\n* relation without the flag is left to hydration, which derives it the same way.\n*/\nfunction toOneRelationNullabilityError(qualifiedName, relationName, relation, model) {\n\tif (!(\"on\" in relation && (relation.cardinality === \"1:1\" || relation.cardinality === \"N:1\") && relation.to.space === void 0) || relation.nullable === void 0) return void 0;\n\tconst location = `Relation \"${relationName}\" on model \"${qualifiedName}\"`;\n\tconst { ownsForeignKey, fields } = resolveMongoToOneRelationFields(model, relation);\n\tif (!ownsForeignKey) return relation.nullable ? void 0 : `${location} is required but does not own the foreign key, so nothing in storage guarantees the related document exists`;\n\tconst anyNullable = fields.some((field) => field.nullable);\n\tif (relation.nullable === anyNullable) return void 0;\n\tconst fieldList = fields.filter((field) => field.nullable !== relation.nullable).map((field) => `\"${field.name}\"`).join(\", \");\n\treturn relation.nullable ? `${location} is nullable but every local field is required (fields ${fieldList})` : `${location} is required but a local field is nullable (fields ${fieldList})`;\n}\n//#endregion\nexport { DOCUMENT_ID, MongoChangeStreamPreAndPostImagesOptions, MongoClusteredCollectionOptions, MongoCollationOptions, MongoCollection, MongoCollectionOptions, MongoContractSchema, MongoIndex, MongoIndexOptionDefaults, MongoIndexOptions, MongoStorage, MongoTimeSeriesCollectionOptions, MongoUnboundNamespace, MongoValidator, MongoValueObject, MongoValueSet, RelationKeys, StorageValueSetSchema, applyPolymorphicScopeToMongoIndex, buildMongoContractView, buildMongoNamespace, buildMongoStorage, collectionControlPoliciesOf, collectionControlPolicyOf, collectionRootModelsOf, createMongoContractSchema, createMongoNamespaceEnvelopeSchema, defaultMongoDomainNamespaceId, defaultMongoStorageNamespaceId, deriveCollectionValidators, documentIdRefusalReason, fieldBsonTypeRefusalOf, hasOwnFieldStoredAs, isEmbedRelation, modelAndBasesOf, mongoContractRefusalsOf, mongoModelsOf, mongoValueSetsOf, ownDocumentIdFieldOf, ownEmbedStoredNamesOf, ownFieldStoredAs, ownStoredNameOf, ownStoredNamesOf, resolveMongoToOneRelationFields, storedNamesOf, unsupportedStoredNameReason, validateMongoStorage, validatorEnumMemberRefusalOf, validatorEnumRefusalOf, validatorFieldNamesOf, validatorRootShapesOf, valueObjectStoredNamesOf };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,IAAI,wBAAwB,MAAM,8BAA8B,cAAc;CAC7E,OAAO,WAAW,IAAI,sBAAsB;CAC5C,KAAK;CACL,UAAU,OAAO,OAAO,EAAE,YAAY,OAAO,OAAO,CAAC,CAAC,EAAE,CAAC;CACzD,cAAc;EACb,MAAM;EACN,OAAO,eAAe,MAAM,QAAQ;GACnC,OAAO;GACP,UAAU;GACV,YAAY;GACZ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