@prisma/orm-family-mongo 8.0.0-rc.12-dev.12 → 8.0.0-rc.12-dev.13

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 (113) hide show
  1. package/dist/{authoring-entity-types-DkFfee0x-CRRHtwhi.mjs → authoring-entity-types-DkFfee0x-DzGu9hUw.mjs} +3 -3
  2. package/dist/{authoring-entity-types-DkFfee0x-CRRHtwhi.mjs.map → authoring-entity-types-DkFfee0x-DzGu9hUw.mjs.map} +1 -1
  3. package/dist/{canonicalization-hooks-BXCTdx8s.mjs → canonicalization-hooks-CRVM-Kqh-Qi-VmEVg.mjs} +2 -2
  4. package/dist/canonicalization-hooks-CRVM-Kqh-Qi-VmEVg.mjs.map +1 -0
  5. package/dist/{config-types-v_AdyJzO.mjs → config-types-x4rKdA0F.mjs} +4 -4
  6. package/dist/{config-types-v_AdyJzO.mjs.map → config-types-x4rKdA0F.mjs.map} +1 -1
  7. package/dist/{contract-builder-C0TMb001.mjs → contract-builder-0eayq5gp.mjs} +6 -6
  8. package/dist/{contract-builder-C0TMb001.mjs.map → contract-builder-0eayq5gp.mjs.map} +1 -1
  9. package/dist/{contract-builder-DVBFIIYp.d.mts → contract-builder-D0Fsm4m-.d.mts} +4 -4
  10. package/dist/{contract-builder-DVBFIIYp.d.mts.map → contract-builder-D0Fsm4m-.d.mts.map} +1 -1
  11. package/dist/contract-prisma6__provider.d.mts +35 -0
  12. package/dist/contract-prisma6__provider.d.mts.map +1 -0
  13. package/dist/contract-prisma6__provider.mjs +1020 -0
  14. package/dist/contract-prisma6__provider.mjs.map +1 -0
  15. package/dist/contract-psl.d.mts +43 -7
  16. package/dist/contract-psl.d.mts.map +1 -1
  17. package/dist/contract-psl.mjs +2 -2
  18. package/dist/contract-psl__provider.mjs +4 -4
  19. package/dist/contract-psl__provider.mjs.map +1 -1
  20. package/dist/contract-ts.d.mts +1 -1
  21. package/dist/contract-ts.mjs +2 -2
  22. package/dist/contract-ts__config-types.mjs +1 -1
  23. package/dist/contract-ts__contract-builder.d.mts +1 -1
  24. package/dist/contract-ts__contract-builder.mjs +1 -1
  25. package/dist/contract.d.mts +3 -3
  26. package/dist/contract.mjs +3 -3
  27. package/dist/contract__canonicalization-hooks.mjs +1 -1
  28. package/dist/contract__entity-kinds.d.mts +1 -1
  29. package/dist/contract__entity-kinds.mjs +1 -1
  30. package/dist/{control-BtmriDhU.mjs → control-BG0O1wDj.mjs} +12 -12
  31. package/dist/control-BG0O1wDj.mjs.map +1 -0
  32. package/dist/{control-9Vd-XWkM.d.mts → control-BXKlnxAS.d.mts} +3 -3
  33. package/dist/{control-9Vd-XWkM.d.mts.map → control-BXKlnxAS.d.mts.map} +1 -1
  34. package/dist/{control-adapter-Bh_ZraGM-7HXImyjy.d.mts → control-adapter-Bh_ZraGM-XeWQ672u.d.mts} +4 -4
  35. package/dist/{control-adapter-Bh_ZraGM-7HXImyjy.d.mts.map → control-adapter-Bh_ZraGM-XeWQ672u.d.mts.map} +1 -1
  36. package/dist/control-adapter-miP7lGv5.d.mts +1 -0
  37. package/dist/{control-C6gTadl8.d.mts → control-zKduRmAA.d.mts} +5 -5
  38. package/dist/{control-C6gTadl8.d.mts.map → control-zKduRmAA.d.mts.map} +1 -1
  39. package/dist/{dist-Dyp05u64.mjs → dist-C_TI9T_n.mjs} +2 -2
  40. package/dist/{dist-Dyp05u64.mjs.map → dist-C_TI9T_n.mjs.map} +1 -1
  41. package/dist/{dist-B4a9eijw.mjs → dist-DsIID5AE.mjs} +87 -41
  42. package/dist/dist-DsIID5AE.mjs.map +1 -0
  43. package/dist/{entity-kinds-FlR_bJNA-D4NYzPhs.mjs → entity-kinds-BFgLffz7-D8WUc2oo.mjs} +3 -3
  44. package/dist/{entity-kinds-FlR_bJNA-D4NYzPhs.mjs.map → entity-kinds-BFgLffz7-D8WUc2oo.mjs.map} +1 -1
  45. package/dist/family.d.mts +9 -9
  46. package/dist/family.mjs +8 -8
  47. package/dist/family__control-adapter.d.mts +2 -2
  48. package/dist/family__control.d.mts +1 -1
  49. package/dist/family__control.mjs +2 -2
  50. package/dist/family__ir.d.mts +2 -2
  51. package/dist/family__ir.mjs +3 -3
  52. package/dist/family__migration.d.mts +1 -1
  53. package/dist/family__migration.mjs +1 -1
  54. package/dist/family__pack.mjs +2 -2
  55. package/dist/family__runtime.d.mts +2 -2
  56. package/dist/family__runtime.mjs +1 -1
  57. package/dist/family__schema-verify.d.mts +1 -1
  58. package/dist/family__schema-verify.mjs +1 -1
  59. package/dist/{field-accessor-DHsAPiW3-iwRb2vC-.d.mts → field-accessor-DHsAPiW3-mw_sFEGx.d.mts} +3 -3
  60. package/dist/{field-accessor-DHsAPiW3-iwRb2vC-.d.mts.map → field-accessor-DHsAPiW3-mw_sFEGx.d.mts.map} +1 -1
  61. package/dist/{index-s1CL1J5A.d.mts → index-BpA_pfO1.d.mts} +4 -4
  62. package/dist/{index-s1CL1J5A.d.mts.map → index-BpA_pfO1.d.mts.map} +1 -1
  63. package/dist/{index-BfSjP_y5.d.mts → index-DJLkZc6k.d.mts} +3 -3
  64. package/dist/{index-BfSjP_y5.d.mts.map → index-DJLkZc6k.d.mts.map} +1 -1
  65. package/dist/{index-D-8mmTbj.d.mts → index-Db33rU3r.d.mts} +3 -3
  66. package/dist/{index-D-8mmTbj.d.mts.map → index-Db33rU3r.d.mts.map} +1 -1
  67. package/dist/{index-B-iG-2je.d.mts → index-XiYJVhuE.d.mts} +3 -3
  68. package/dist/{index-B-iG-2je.d.mts.map → index-XiYJVhuE.d.mts.map} +1 -1
  69. package/dist/{index-BUYcBNdw.d.mts → index-b-S3URri.d.mts} +50 -30
  70. package/dist/index-b-S3URri.d.mts.map +1 -0
  71. package/dist/{interpreter-D1CQbops-C_hzRtYe.mjs → interpreter-DPALasb4-BORWXsN5.mjs} +98 -103
  72. package/dist/interpreter-DPALasb4-BORWXsN5.mjs.map +1 -0
  73. package/dist/{ir-Dun4Br3Q.d.mts → ir-9VhpVaDJ.d.mts} +5 -5
  74. package/dist/{ir-Dun4Br3Q.d.mts.map → ir-9VhpVaDJ.d.mts.map} +1 -1
  75. package/dist/{ir-Ch2aPr7a.mjs → ir-vZWjElPY.mjs} +2 -2
  76. package/dist/{ir-Ch2aPr7a.mjs.map → ir-vZWjElPY.mjs.map} +1 -1
  77. package/dist/lowering.d.mts +1 -1
  78. package/dist/{migration-Cs9Lwv2y.d.mts → migration-9n6DCvlw.d.mts} +5 -5
  79. package/dist/{migration-Cs9Lwv2y.d.mts.map → migration-9n6DCvlw.d.mts.map} +1 -1
  80. package/dist/{migration-BsJgtw77.mjs → migration-DofqFxoZ.mjs} +2 -2
  81. package/dist/{migration-BsJgtw77.mjs.map → migration-DofqFxoZ.mjs.map} +1 -1
  82. package/dist/{mongo-contract-serializer-DC_DM9_Y-MJjsJZwM.mjs → mongo-contract-serializer-DC_DM9_Y-CDk1Veya.mjs} +6 -6
  83. package/dist/{mongo-contract-serializer-DC_DM9_Y-MJjsJZwM.mjs.map → mongo-contract-serializer-DC_DM9_Y-CDk1Veya.mjs.map} +1 -1
  84. package/dist/{mongo-contract-view-AnejqfrQ-nd-SP6W4.d.mts → mongo-contract-view-AnejqfrQ-DLhDjvsh.d.mts} +3 -3
  85. package/dist/{mongo-contract-view-AnejqfrQ-nd-SP6W4.d.mts.map → mongo-contract-view-AnejqfrQ-DLhDjvsh.d.mts.map} +1 -1
  86. package/dist/{mongo-contract-view-JZOa0Ry--BTfPzsVC.mjs → mongo-contract-view-JZOa0Ry--BL8lTjbw.mjs} +3 -3
  87. package/dist/{mongo-contract-view-JZOa0Ry--BTfPzsVC.mjs.map → mongo-contract-view-JZOa0Ry--BL8lTjbw.mjs.map} +1 -1
  88. package/dist/{mongo-value-set-tNn9-pun-dJYx_rVD.d.mts → mongo-value-set-BngSUlOh-BhDGXjM_.d.mts} +3 -3
  89. package/dist/{mongo-value-set-tNn9-pun-dJYx_rVD.d.mts.map → mongo-value-set-BngSUlOh-BhDGXjM_.d.mts.map} +1 -1
  90. package/dist/orm.d.mts +2 -2
  91. package/dist/orm.mjs +3 -3
  92. package/dist/query-ast.d.mts +2 -2
  93. package/dist/query-ast__control.d.mts +2 -2
  94. package/dist/query-builder.d.mts +3 -3
  95. package/dist/query-builder.mjs +1 -1
  96. package/dist/query-builder__contract-free.d.mts +3 -3
  97. package/dist/{runtime-BPRKmAdg.d.mts → runtime-F95l7p-U.d.mts} +3 -3
  98. package/dist/runtime-F95l7p-U.d.mts.map +1 -0
  99. package/dist/runtime.d.mts +1 -1
  100. package/dist/schema-ir.d.mts +1 -1
  101. package/dist/{schema-verify-BQA8oyKJ.d.mts → schema-verify-DehTbLkM.d.mts} +4 -4
  102. package/dist/{schema-verify-BQA8oyKJ.d.mts.map → schema-verify-DehTbLkM.d.mts.map} +1 -1
  103. package/dist/{verify-mongo-schema-B0bMHQW0-DSZhsvrk.mjs → verify-mongo-schema-B0bMHQW0-BuK0Jv5S.mjs} +3 -3
  104. package/dist/{verify-mongo-schema-B0bMHQW0-DSZhsvrk.mjs.map → verify-mongo-schema-B0bMHQW0-BuK0Jv5S.mjs.map} +1 -1
  105. package/dist/wire.d.mts +1 -1
  106. package/package.json +21 -19
  107. package/dist/canonicalization-hooks-BXCTdx8s.mjs.map +0 -1
  108. package/dist/control-BtmriDhU.mjs.map +0 -1
  109. package/dist/control-adapter-Bjc81f8y.d.mts +0 -1
  110. package/dist/dist-B4a9eijw.mjs.map +0 -1
  111. package/dist/index-BUYcBNdw.d.mts.map +0 -1
  112. package/dist/interpreter-D1CQbops-C_hzRtYe.mjs.map +0 -1
  113. package/dist/runtime-BPRKmAdg.d.mts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interpreter-DPALasb4-BORWXsN5.mjs","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-psl/dist/interpreter-DPALasb4.mjs"],"sourcesContent":["import { MongoIndex, MongoValidator, applyPolymorphicScopeToMongoIndex, buildMongoExecutionSection, buildMongoStorage, encodeMongoValueSets } from \"@internal/mongo-contract\";\nimport { computeProfileHash } from \"@internal/contract/hashing\";\nimport { crossRef } from \"@internal/contract/types\";\nimport { resolveToOneRelationNullable } from \"@internal/contract-authoring\";\nimport { checkUncomposedNamespace, getAuthoringFieldPreset, hasRegisteredFieldNamespace, instantiateAuthoringEntityType, isAuthoringEntityTypeDescriptor, isAuthoringPslBlockDescriptor, isAuthoringTypeConstructorDescriptor } from \"@internal/framework-components/authoring\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { bool, createBinder, createPslDiagnosticCollector, diagnosticSource, entityRef, fieldAttribute, fieldRef, funcCall, identifier, int, interpretAttribute, json, keywordPslSpan, list, mapPslDiagnostics, modelAttribute, nodePslSpan, num, oneOf, optional, record, referencedFieldRef, str } from \"@internal/psl-parser\";\nimport { consumeInvalidFkPairing, fkRelationPairKey, instantiatePslFieldPreset, reportUncomposedNamespace, reportUnknownFieldPreset, requiredOneToOneBackrelationDiagnostic } from \"@internal/psl-parser/interpret\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk, ok } from \"@internal/utils/result\";\n//#region src/derive-json-schema.ts\n/**\n* `undefined` for a codec the lookup does not know. `null` for one it knows that declares no BSON type (`mongo/json@1` holds any value), which the validator admits unconstrained rather than dropping: with `additionalProperties: false` a dropped field would reject every document that carries it.\n*/\nfunction resolveBsonType(codecId, codecLookup) {\n\tconst targetTypes = codecLookup?.targetTypesFor(codecId);\n\tif (targetTypes === void 0) return void 0;\n\treturn targetTypes[0] ?? null;\n}\nfunction fieldToBsonSchema(field, valueObjects, codecLookup, valueSets) {\n\tif (field.type.kind === \"scalar\") {\n\t\tconst bsonType = resolveBsonType(field.type.codecId, codecLookup);\n\t\tif (bsonType === void 0) return void 0;\n\t\tif (bsonType === null) return \"many\" in field && field.many ? {\n\t\t\tbsonType: \"array\",\n\t\t\titems: {}\n\t\t} : {};\n\t\tconst enumValues = field.valueSet !== void 0 ? valueSets?.[field.valueSet.entityName]?.values ?? null : null;\n\t\tif (\"many\" in field && field.many) {\n\t\t\tconst items = { bsonType };\n\t\t\tif (enumValues) items[\"enum\"] = enumValues;\n\t\t\treturn {\n\t\t\t\tbsonType: \"array\",\n\t\t\t\titems\n\t\t\t};\n\t\t}\n\t\tif (field.nullable) {\n\t\t\tconst s = { bsonType: [\"null\", bsonType] };\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 = valueObjects?.[field.type.name];\n\t\tif (!vo) return void 0;\n\t\tconst voSchema = deriveObjectSchema(vo.fields, valueObjects, codecLookup, valueSets);\n\t\tif (\"many\" in field && field.many) return {\n\t\t\tbsonType: \"array\",\n\t\t\titems: voSchema\n\t\t};\n\t\tif (field.nullable) return { oneOf: [{ bsonType: \"null\" }, voSchema] };\n\t\treturn voSchema;\n\t}\n}\nfunction deriveObjectSchema(fields, valueObjects, codecLookup, valueSets) {\n\tconst properties = {};\n\tconst required = [];\n\tfor (const [fieldName, field] of Object.entries(fields)) {\n\t\tconst schema = fieldToBsonSchema(field, valueObjects, codecLookup, valueSets);\n\t\tif (schema) {\n\t\t\tproperties[fieldName] = schema;\n\t\t\tif (!field.nullable) required.push(fieldName);\n\t\t}\n\t}\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(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction deriveJsonSchema(fields, valueObjects, codecLookup, valueSets) {\n\treturn new MongoValidator({\n\t\tjsonSchema: deriveObjectSchema(fields, valueObjects, codecLookup, valueSets),\n\t\tvalidationLevel: \"strict\",\n\t\tvalidationAction: \"error\"\n\t});\n}\nfunction derivePolymorphicJsonSchema(baseFields, discriminatorField, variants, valueObjects, codecLookup, valueSets) {\n\tconst baseSchema = deriveObjectSchema(baseFields, valueObjects, codecLookup, valueSets);\n\tconst baseProperties = isRecord(baseSchema[\"properties\"]) ? baseSchema[\"properties\"] : {};\n\tconst oneOf = [];\n\tfor (const variant of variants) {\n\t\tconst variantOnlyFields = {};\n\t\tfor (const [name, field] of Object.entries(variant.fields)) if (!(name in baseFields)) variantOnlyFields[name] = field;\n\t\tconst variantProperties = {};\n\t\tconst variantRequired = [discriminatorField];\n\t\tfor (const [name, field] of Object.entries(variantOnlyFields)) {\n\t\t\tconst schema = fieldToBsonSchema(field, valueObjects, codecLookup, valueSets);\n\t\t\tif (schema) {\n\t\t\t\tvariantProperties[name] = schema;\n\t\t\t\tif (!field.nullable) variantRequired.push(name);\n\t\t\t}\n\t\t}\n\t\tconst entry = {\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: variantRequired.sort(),\n\t\t\tadditionalProperties: false\n\t\t};\n\t\toneOf.push(entry);\n\t}\n\tconst jsonSchema = { ...baseSchema };\n\tdelete jsonSchema[\"additionalProperties\"];\n\tif (oneOf.length > 0) jsonSchema[\"oneOf\"] = oneOf;\n\treturn new MongoValidator({\n\t\tjsonSchema,\n\t\tvalidationLevel: \"strict\",\n\t\tvalidationAction: \"error\"\n\t});\n}\n//#endregion\n//#region src/psl-helpers.ts\n/** Storage collection name of a model that declares no `@@map`: the model name, verbatim. */\nfunction defaultCollectionName(modelName) {\n\treturn modelName;\n}\nfunction getAttribute(attributes, name) {\n\treturn attributes.find((attr) => attr.name === name);\n}\n//#endregion\n//#region src/field-presets.ts\nconst NONE = { kind: \"none\" };\nconst INVALID = { kind: \"invalid\" };\nfunction unsupportedContributions(instantiated) {\n\treturn [\n\t\t...instantiated.default !== void 0 ? [\"a storage default\"] : [],\n\t\t...instantiated.id ? [\"id semantics\"] : [],\n\t\t...instantiated.unique ? [\"a unique constraint\"] : []\n\t];\n}\n/**\n* Resolves a field whose type is a field-preset call (`temporal.updatedAt()`) against the composed field presets. Returns `none` when the type is not a preset call, so the caller falls back to scalar resolution.\n*/\nfunction resolveFieldPreset(input) {\n\tconst { field, ownerName, context } = input;\n\tconst call = field.typeConstructor;\n\tif (!call) return NONE;\n\tconst { diagnostics } = context;\n\tconst source = diagnosticSource(context.sources, field.node.syntax);\n\tconst entityLabel = `Field \"${ownerName}.${field.name}\"`;\n\tconst helperPath = call.path.join(\".\");\n\tconst descriptor = getAuthoringFieldPreset(context.authoringContributions, call.path);\n\tif (!descriptor) {\n\t\tconst namespace = call.path.length > 1 ? call.path[0] : void 0;\n\t\tif (namespace && hasRegisteredFieldNamespace(context.authoringContributions, namespace)) {\n\t\t\treportUnknownFieldPreset({\n\t\t\t\tentityLabel,\n\t\t\t\tnamespace,\n\t\t\t\thelperPath,\n\t\t\t\tsource,\n\t\t\t\tspan: call.span,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\treturn INVALID;\n\t\t}\n\t\tconst uncomposedNamespace = checkUncomposedNamespace(helperPath, context.composedExtensions, {\n\t\t\tfamilyId: \"mongo\",\n\t\t\ttargetId: \"mongo\",\n\t\t\tauthoringContributions: context.authoringContributions\n\t\t});\n\t\tif (uncomposedNamespace) {\n\t\t\treportUncomposedNamespace({\n\t\t\t\tsubjectLabel: `Type constructor \"${helperPath}\"`,\n\t\t\t\tnamespace: uncomposedNamespace,\n\t\t\t\tsource,\n\t\t\t\tspan: call.span,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\treturn INVALID;\n\t\t}\n\t\treturn NONE;\n\t}\n\tif (input.ownerKind === \"compositeType\") {\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_UNSUPPORTED_FIELD_TYPE\",\n\t\t\tmessage: `${entityLabel} uses field preset \"${helperPath}\". Field presets can only be used on model fields, not on fields of a composite type.`,\n\t\t\t...source.at(field.span)\n\t\t});\n\t\treturn INVALID;\n\t}\n\tif (field.list) {\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_PRESET_NOT_LIST\",\n\t\t\tmessage: `${entityLabel} uses a field-preset call as a list element type. Presets cannot be list elements; remove \"[]\" or use a scalar type.`,\n\t\t\t...source.at(field.span)\n\t\t});\n\t\treturn INVALID;\n\t}\n\tif (field.optional) {\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_PRESET_NOT_OPTIONAL\",\n\t\t\tmessage: `${entityLabel} uses a field-preset call and cannot be optional. Remove \"?\" or use a different field type.`,\n\t\t\t...source.at(field.span)\n\t\t});\n\t\treturn INVALID;\n\t}\n\tconst instantiated = instantiatePslFieldPreset({\n\t\tcall,\n\t\tdescriptor,\n\t\tdiagnostics,\n\t\tsource,\n\t\tentityLabel\n\t});\n\tif (!instantiated) return INVALID;\n\tconst idAttribute = getAttribute(field.attributes, \"id\");\n\tif (idAttribute && !instantiated.id) {\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_PRESET_AND_ID_CONFLICT\",\n\t\t\tmessage: `${entityLabel} uses a field-preset call and cannot also declare @id. Use a preset that contributes id semantics, or drop @id.`,\n\t\t\t...source.at(idAttribute.span)\n\t\t});\n\t\treturn INVALID;\n\t}\n\tconst unsupported = unsupportedContributions(instantiated);\n\tif (unsupported.length > 0) {\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_UNSUPPORTED_FIELD_TYPE\",\n\t\t\tmessage: `${entityLabel} uses field preset \"${helperPath}\", which contributes ${unsupported.join(\" and \")}. Mongo supports presets that set a codec and execution defaults only.`,\n\t\t\t...source.at(call.span)\n\t\t});\n\t\treturn INVALID;\n\t}\n\treturn {\n\t\tkind: \"preset\",\n\t\tfield: {\n\t\t\ttype: {\n\t\t\t\tkind: \"scalar\",\n\t\t\t\tcodecId: instantiated.descriptor.codecId,\n\t\t\t\t...ifDefined(\"typeParams\", instantiated.descriptor.typeParams)\n\t\t\t},\n\t\t\tnullable: instantiated.nullable\n\t\t},\n\t\t...ifDefined(\"executionDefaults\", instantiated.executionDefaults)\n\t};\n}\n//#endregion\n//#region src/mongo-attribute-specs.ts\nfunction findModelAttributeNode(model, name) {\n\tfor (const attribute of model.node.attributes()) if (attribute.name()?.isSimpleName(name) === true) return attribute;\n}\nfunction findFieldAttributeNode(field, name) {\n\tfor (const attribute of field.node.attributes()) if (attribute.name()?.isSimpleName(name) === true) return attribute;\n}\nfunction buildModelAttributeCtx(input) {\n\treturn {\n\t\tsources: input.sources,\n\t\tselfModel: input.selfModel,\n\t\tbinder: input.binder,\n\t\tsymbols: input.symbols\n\t};\n}\nfunction buildFieldAttributeCtx(input) {\n\treturn {\n\t\tsources: input.sources,\n\t\tselfModel: input.selfModel,\n\t\tfield: input.field,\n\t\tbinder: input.binder,\n\t\tsymbols: input.symbols\n\t};\n}\nconst UNLOWERED_FIELD_ATTRIBUTE_HINTS = /* @__PURE__ */ new Map([[\"updatedAt\", \"To fill the timestamp on create and update, use `temporal.updatedAt()` as the field type.\"]]);\nfunction describeUnsupportedMongoAttribute(sources) {\n\treturn ({ attribute, level, owner, field }) => {\n\t\tif (level === \"model\") return {\n\t\t\tcode: \"PSL_UNSUPPORTED_MODEL_ATTRIBUTE\",\n\t\t\tmessage: `Model \"${owner.name}\" uses unsupported attribute \"@@${attribute.name}\"`,\n\t\t\t...diagnosticSource(sources, owner.node.syntax).at(attribute.span)\n\t\t};\n\t\tif (field === void 0) return void 0;\n\t\tconst base = `Field \"${owner.name}.${field.name}\" uses unsupported attribute \"@${attribute.name}\"`;\n\t\tconst hint = UNLOWERED_FIELD_ATTRIBUTE_HINTS.get(attribute.name);\n\t\treturn {\n\t\t\tcode: \"PSL_UNSUPPORTED_FIELD_ATTRIBUTE\",\n\t\t\tmessage: hint === void 0 ? base : `${base}. ${hint}`,\n\t\t\t...diagnosticSource(sources, field.node.syntax).at(attribute.span)\n\t\t};\n\t};\n}\nfunction createMongoBinder(input) {\n\tconst scalars = {};\n\tfor (const [name, codecId] of input.scalarTypeCodecIds) scalars[name] = {\n\t\tkind: \"typeConstructor\",\n\t\toutput: { codecId }\n\t};\n\treturn createBinder({\n\t\tsources: input.sources,\n\t\tsymbolTable: input.symbolTable,\n\t\ttypeConstructors: {\n\t\t\t...scalars,\n\t\t\t...input.authoringContributions?.type ?? {}\n\t\t},\n\t\tattributeSpecs: mongoAttributeSpecs,\n\t\tcontrolMutationDefaults: input.controlMutationDefaults,\n\t\tdescribeUnsupportedAttribute: describeUnsupportedMongoAttribute(input.sources)\n\t});\n}\nfunction interpretModelAttribute(input) {\n\tconst result = interpretAttribute(input.node, input.spec, buildModelAttributeCtx({\n\t\tsymbols: input.symbols,\n\t\tselfModel: input.model,\n\t\tsources: input.sources,\n\t\tbinder: input.binder\n\t}));\n\tif (!result.ok) {\n\t\tinput.diagnostics.push(...result.failure);\n\t\treturn;\n\t}\n\treturn result.value;\n}\nfunction interpretFieldAttribute(input) {\n\tconst result = interpretAttribute(input.node, input.spec, buildFieldAttributeCtx({\n\t\tsymbols: input.symbols,\n\t\tselfModel: input.model,\n\t\tfield: input.field,\n\t\tsources: input.sources,\n\t\tbinder: input.binder\n\t}));\n\tif (!result.ok) {\n\t\tinput.diagnostics.push(...result.failure);\n\t\treturn;\n\t}\n\treturn result.value;\n}\nconst mapModelSpec = modelAttribute(\"map\", {\n\tdocumentation: \"Maps this model to a MongoDB collection name.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: str(),\n\t\tdocumentation: \"The collection name stored in MongoDB.\"\n\t}]\n});\nconst mapFieldSpec = fieldAttribute(\"map\", {\n\tdocumentation: \"Maps this field to a stored document key.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: str(),\n\t\tdocumentation: \"The key stored in MongoDB documents.\"\n\t}]\n});\nconst idFieldSpec = fieldAttribute(\"id\", { documentation: \"Identifies the document’s primary-key field.\" });\nconst uniqueFieldSpec = fieldAttribute(\"unique\", { documentation: \"Requires values in this field to be unique across the collection.\" });\nconst relationFieldSpec = fieldAttribute(\"relation\", {\n\tdocumentation: \"Names a relation and associates local fields with fields on the referenced model.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: optional(str()),\n\t\tdocumentation: \"The relation name used to pair both sides. May also be supplied by name.\"\n\t}],\n\tnamed: {\n\t\tname: {\n\t\t\ttype: optional(str()),\n\t\t\tdocumentation: \"The relation name used to pair both sides. Cannot also be supplied positionally.\"\n\t\t},\n\t\tfields: {\n\t\t\ttype: optional(list(fieldRef(), {\n\t\t\t\tallowEmpty: false,\n\t\t\t\tunique: true\n\t\t\t})),\n\t\t\tdocumentation: \"The ordered local fields holding references to related documents.\"\n\t\t},\n\t\treferences: {\n\t\t\ttype: optional(list(referencedFieldRef(), {\n\t\t\t\tallowEmpty: false,\n\t\t\t\tunique: true\n\t\t\t})),\n\t\t\tdocumentation: \"The corresponding fields on the referenced model.\"\n\t\t}\n\t}\n});\nconst discriminatorModelSpec = modelAttribute(\"discriminator\", {\n\tdocumentation: \"Selects the field that distinguishes inheritance variants in this collection.\",\n\tpositional: [{\n\t\tkey: \"field\",\n\t\ttype: fieldRef(),\n\t\tdocumentation: \"The discriminator field on this model.\"\n\t}]\n});\nfunction baseModelSpec() {\n\treturn modelAttribute(\"base\", {\n\t\tdocumentation: \"Declares this model as a variant of a base model.\",\n\t\tpositional: [{\n\t\t\tkey: \"base\",\n\t\t\ttype: entityRef({ kind: \"model\" }),\n\t\t\tdocumentation: \"The base model to inherit from.\"\n\t\t}, {\n\t\t\tkey: \"value\",\n\t\t\ttype: str(),\n\t\t\tdocumentation: \"The discriminator value identifying this variant.\"\n\t\t}]\n\t});\n}\nconst sortSig = {\n\tdocumentation: \"Selects an index field with an explicit sort direction.\",\n\tnamed: { sort: {\n\t\ttype: oneOf(identifier(\"Asc\", { documentation: \"Sort ascending.\" }), identifier(\"Desc\", { documentation: \"Sort descending.\" })),\n\t\tdocumentation: \"The index order for this field: `Asc` or `Desc`.\"\n\t} }\n};\nfunction indexFieldElement(fieldNames) {\n\treturn oneOf(...[\n\t\tfieldRef(),\n\t\tfuncCall(\"wildcard\", {\n\t\t\tdocumentation: \"Indexes document fields using a MongoDB wildcard index.\",\n\t\t\tpositional: [{\n\t\t\t\tkey: \"scope\",\n\t\t\t\ttype: optional(identifier()),\n\t\t\t\tdocumentation: \"The field path to index recursively. Omit to index all document fields.\"\n\t\t\t}]\n\t\t}),\n\t\t...fieldNames.map((name) => funcCall(name, sortSig))\n\t]);\n}\nconst collationNamedArgs = {\n\tcollationLocale: {\n\t\ttype: optional(str()),\n\t\tdocumentation: \"The ICU locale used for string comparison, or `simple` for binary comparison.\"\n\t},\n\tcollationStrength: {\n\t\ttype: optional(oneOf(num(1), num(2), num(3), num(4), num(5))),\n\t\tdocumentation: \"The collation comparison level, from `1` (primary differences) through `5` (identical).\"\n\t},\n\tcollationCaseLevel: {\n\t\ttype: optional(bool()),\n\t\tdocumentation: \"Whether case differences are compared at strength `1` or `2`.\"\n\t},\n\tcollationCaseFirst: {\n\t\ttype: optional(oneOf(str(\"upper\"), str(\"lower\"), str(\"off\"))),\n\t\tdocumentation: \"Whether uppercase or lowercase sorts first, or `off` for the locale default.\"\n\t},\n\tcollationNumericOrdering: {\n\t\ttype: optional(bool()),\n\t\tdocumentation: \"Whether numeric strings are compared as numbers rather than lexicographically.\"\n\t},\n\tcollationAlternate: {\n\t\ttype: optional(oneOf(str(\"non-ignorable\"), str(\"shifted\"))),\n\t\tdocumentation: \"Whether punctuation and whitespace are significant or shifted to a later comparison level.\"\n\t},\n\tcollationMaxVariable: {\n\t\ttype: optional(oneOf(str(\"punct\"), str(\"space\"))),\n\t\tdocumentation: \"Which characters are ignored when alternate handling is `shifted`: punctuation or spaces.\"\n\t},\n\tcollationBackwards: {\n\t\ttype: optional(bool()),\n\t\tdocumentation: \"Whether secondary differences, such as accents, are compared in reverse order.\"\n\t},\n\tcollationNormalization: {\n\t\ttype: optional(bool()),\n\t\tdocumentation: \"Whether strings are checked and normalized before comparison.\"\n\t}\n};\nfunction buildIndexModelSpec(name, fieldElement) {\n\treturn modelAttribute(name, {\n\t\tdocumentation: name === \"unique\" ? \"Declares a unique MongoDB index over the selected fields.\" : \"Declares a MongoDB index over the selected fields.\",\n\t\tpositional: [{\n\t\t\tkey: \"fields\",\n\t\t\ttype: list(fieldElement, { allowEmpty: false }),\n\t\t\tdocumentation: name === \"unique\" ? \"The nonempty list of indexed fields, optionally with sort directions. Wildcard scopes are not supported.\" : \"The nonempty list of indexed fields, optionally with sort directions or a wildcard scope.\"\n\t\t}],\n\t\tnamed: {\n\t\t\ttype: {\n\t\t\t\ttype: optional(oneOf(num(1), num(-1), str(\"text\"), str(\"2dsphere\"), str(\"2d\"), str(\"hashed\"))),\n\t\t\t\tdocumentation: \"The MongoDB index key type: ascending `1`, descending `-1`, text, geospatial, or hashed.\"\n\t\t\t},\n\t\t\tsparse: {\n\t\t\t\ttype: optional(bool()),\n\t\t\t\tdocumentation: \"Whether documents missing indexed fields are omitted from the index.\"\n\t\t\t},\n\t\t\texpireAfterSeconds: {\n\t\t\t\ttype: optional(int()),\n\t\t\t\tdocumentation: \"The expiration interval in seconds for a TTL index.\"\n\t\t\t},\n\t\t\tfilter: {\n\t\t\t\ttype: optional(json()),\n\t\t\t\tdocumentation: \"A JSON partial-filter expression limiting which documents are indexed.\"\n\t\t\t},\n\t\t\tinclude: {\n\t\t\t\ttype: optional(list(str())),\n\t\t\t\tdocumentation: \"Document paths included in the wildcard index projection.\"\n\t\t\t},\n\t\t\texclude: {\n\t\t\t\ttype: optional(list(str())),\n\t\t\t\tdocumentation: \"Document paths excluded from the wildcard index projection.\"\n\t\t\t},\n\t\t\tdefault_language: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The default language for text-index tokenization and stemming.\"\n\t\t\t},\n\t\t\tlanguageOverride: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The document field that overrides the text-index language.\"\n\t\t\t},\n\t\t\t...collationNamedArgs\n\t\t}\n\t});\n}\nfunction buildTextIndexModelSpec(fieldElement) {\n\treturn modelAttribute(\"textIndex\", {\n\t\tdocumentation: \"Declares a MongoDB text index with optional field weights and language settings.\",\n\t\tpositional: [{\n\t\t\tkey: \"fields\",\n\t\t\ttype: list(fieldElement, { allowEmpty: false }),\n\t\t\tdocumentation: \"The nonempty list of fields whose text is indexed.\"\n\t\t}],\n\t\tnamed: {\n\t\t\tfilter: {\n\t\t\t\ttype: optional(json()),\n\t\t\t\tdocumentation: \"A JSON partial-filter expression limiting which documents are indexed.\"\n\t\t\t},\n\t\t\tweights: {\n\t\t\t\ttype: optional(record(int({\n\t\t\t\t\tmin: 1,\n\t\t\t\t\tmax: 99999\n\t\t\t\t}))),\n\t\t\t\tdocumentation: \"Relative text-search weights by field, each from `1` through `99999`.\"\n\t\t\t},\n\t\t\tlanguage: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The default language for tokenization and stemming.\"\n\t\t\t},\n\t\t\tlanguageOverride: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The document field that overrides the text-index language.\"\n\t\t\t},\n\t\t\t...collationNamedArgs\n\t\t}\n\t});\n}\nfunction modelFieldElement(ctx) {\n\treturn indexFieldElement(Object.keys(ctx.model.fields));\n}\nfunction staticModelSpec(spec) {\n\treturn () => spec;\n}\nfunction staticFieldSpec(spec) {\n\treturn () => spec;\n}\nconst mongoAttributeSpecs = {\n\tmodel: {\n\t\tmap: staticModelSpec(mapModelSpec),\n\t\tdiscriminator: staticModelSpec(discriminatorModelSpec),\n\t\tbase: baseModelSpec,\n\t\tindex: (ctx) => buildIndexModelSpec(\"index\", modelFieldElement(ctx)),\n\t\tunique: (ctx) => buildIndexModelSpec(\"unique\", modelFieldElement(ctx)),\n\t\ttextIndex: (ctx) => buildTextIndexModelSpec(modelFieldElement(ctx))\n\t},\n\tfield: {\n\t\tid: staticFieldSpec(idFieldSpec),\n\t\tunique: staticFieldSpec(uniqueFieldSpec),\n\t\tmap: staticFieldSpec(mapFieldSpec),\n\t\trelation: staticFieldSpec(relationFieldSpec)\n\t}\n};\n//#endregion\n//#region src/pair-back-relations.ts\n/**\n* Matches each back-relation with the foreign key on the other model: same model pair, and the same relation name when the back-relation has one. A back-relation with no match is orphaned unless its foreign key was already reported (`invalidFkPairings`); one with several matches is ambiguous.\n*/\nfunction pairMongoBackRelations(input) {\n\tconst foreignKeysByPair = /* @__PURE__ */ new Map();\n\tfor (const fk of input.foreignKeys) {\n\t\tconst key = fkRelationPairKey(fk.declaringModel, fk.targetModel);\n\t\tconst existing = foreignKeysByPair.get(key);\n\t\tif (existing) existing.push(fk);\n\t\telse foreignKeysByPair.set(key, [fk]);\n\t}\n\tconst relations = [];\n\tconst diagnostics = [];\n\tfor (const candidate of input.candidates) {\n\t\tconst { field, modelName, targetModelName } = candidate;\n\t\tconst source = diagnosticSource(candidate.sources, field.node.syntax);\n\t\tconst pairKey = fkRelationPairKey(targetModelName, modelName);\n\t\tconst pairMatches = foreignKeysByPair.get(pairKey) ?? [];\n\t\tconst matches = candidate.relationName ? pairMatches.filter((fk) => fk.relationName === candidate.relationName) : pairMatches;\n\t\tif (matches.length === 0) {\n\t\t\tif (consumeInvalidFkPairing(candidate, pairKey, input.invalidFkPairings)) continue;\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_ORPHANED_BACKRELATION\",\n\t\t\t\tmessage: `Backrelation list field \"${modelName}.${field.name}\" has no matching FK-side relation on model \"${targetModelName}\". Add @relation(fields: [...], references: [...]) on the FK-side relation or use an explicit join model for many-to-many.`,\n\t\t\t\t...source.at(field.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst [fk] = matches;\n\t\tif (fk === void 0 || matches.length > 1) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_AMBIGUOUS_BACKRELATION\",\n\t\t\t\tmessage: `Backrelation list field \"${modelName}.${field.name}\" matches multiple FK-side relations on model \"${targetModelName}\". Add @relation(\"...\") to both sides to disambiguate.`,\n\t\t\t\t...source.at(field.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (candidate.cardinality === \"1:1\" && !field.optional) diagnostics.push(requiredOneToOneBackrelationDiagnostic({\n\t\t\tmodelName,\n\t\t\tfield,\n\t\t\ttargetModelName,\n\t\t\tsources: candidate.sources,\n\t\t\trecordNoun: \"document\"\n\t\t}));\n\t\trelations.push({\n\t\t\tmodelName,\n\t\t\tfieldName: field.name,\n\t\t\trelation: {\n\t\t\t\tto: crossRef(targetModelName, UNBOUND_NAMESPACE_ID),\n\t\t\t\t...candidate.cardinality === \"1:N\" ? { cardinality: \"1:N\" } : {\n\t\t\t\t\tcardinality: \"1:1\",\n\t\t\t\t\tnullable: true\n\t\t\t\t},\n\t\t\t\ton: {\n\t\t\t\t\tlocalFields: fk.targetFields,\n\t\t\t\t\ttargetFields: fk.localFields\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\treturn {\n\t\trelations,\n\t\tdiagnostics\n\t};\n}\n//#endregion\n//#region src/interpreter.ts\n/**\n* Reports `PSL_DEPRECATED_SCALAR_NAME` at the type of a field whose scalar name is a deprecated alias, naming the replacement. The alias resolves to the same codec, so the contract does not change.\n*/\nfunction deprecatedScalarWarner(input) {\n\tconst { reportWarning } = input;\n\tif (reportWarning === void 0) return () => {};\n\treturn (field) => {\n\t\tif (field.typeConstructor !== void 0) return;\n\t\tconst descriptor = input.types?.[field.typeName];\n\t\tif (descriptor === void 0 || !isAuthoringTypeConstructorDescriptor(descriptor) || descriptor.deprecated === void 0) return;\n\t\tconst typeNode = field.node.typeAnnotation()?.name()?.syntax ?? field.node.syntax;\n\t\tconst [warning] = mapPslDiagnostics([{\n\t\t\tcode: \"PSL_DEPRECATED_SCALAR_NAME\",\n\t\t\tmessage: `Scalar type \"${field.typeName}\" is deprecated and will be removed; use \"${descriptor.deprecated.replacement}\" (stored as BSON ${descriptor.output.nativeType}).`,\n\t\t\t...diagnosticSource(input.sources, typeNode).at()\n\t\t}], input.sources);\n\t\tif (warning !== void 0) reportWarning({\n\t\t\t...warning,\n\t\t\tseverity: \"warning\"\n\t\t});\n\t};\n}\n/**\n* Mongo's PSL surface binds the database from the connection string, so every\n* explicit namespace block is invalid, including `namespace unbound { … }`.\n*/\nfunction validateNamespaceBlocksForMongoTarget(input) {\n\tfor (const namespace of input.namespaces) for (const { node, span } of namespace.declarations) input.diagnostics.push({\n\t\tcode: \"PSL_UNSUPPORTED_NAMESPACE_BLOCK\",\n\t\tmessage: `Mongo does not support \\`namespace ${namespace.name} { … }\\` blocks (the database is bound by the connection string; declare models at the document top level instead).`,\n\t\t...diagnosticSource(input.sources, node.syntax).at(span)\n\t});\n}\nfunction relationNullabilityMismatchDiagnostic(modelName, field, sources) {\n\tconst source = diagnosticSource(sources, field.node.syntax);\n\tconst fieldLabel = `Relation field \"${modelName}.${field.name}\"`;\n\treturn {\n\t\tcode: \"PSL_RELATION_NULLABILITY_MISMATCH\",\n\t\tmessage: field.optional ? `${fieldLabel} is optional but every field in @relation(fields: [...]) is required. Make one of those fields optional with \"?\" or remove \"?\" from \"${field.name}\".` : `${fieldLabel} is required but a field in @relation(fields: [...]) is optional. Add \"?\" to \"${field.name}\" or make those fields required.`,\n\t\t...source.at(field.span)\n\t};\n}\nfunction resolveFieldMappings(input) {\n\tconst { model, specContext, sources, binder, diagnostics } = input;\n\tconst pslNameToMapped = /* @__PURE__ */ new Map();\n\tfor (const field of Object.values(model.fields)) {\n\t\tconst mapNode = findFieldAttributeNode(field, \"map\");\n\t\tconst mapped = (mapNode ? interpretFieldAttribute({\n\t\t\tsymbols: specContext.symbols,\n\t\t\tnode: mapNode,\n\t\t\tspec: mongoAttributeSpecs.field.map({\n\t\t\t\t...specContext,\n\t\t\t\tfield\n\t\t\t}),\n\t\t\tmodel,\n\t\t\tfield,\n\t\t\tsources,\n\t\t\tbinder,\n\t\t\tdiagnostics\n\t\t})?.name : void 0) ?? field.name;\n\t\tpslNameToMapped.set(field.name, mapped);\n\t}\n\treturn { pslNameToMapped };\n}\nfunction resolveCollectionName(input) {\n\tconst { model, specContext, sources, binder, diagnostics } = input;\n\tconst mapNode = findModelAttributeNode(model, \"map\");\n\treturn (mapNode ? interpretModelAttribute({\n\t\tsymbols: specContext.symbols,\n\t\tnode: mapNode,\n\t\tspec: mongoAttributeSpecs.model.map(specContext),\n\t\tmodel,\n\t\tsources,\n\t\tbinder,\n\t\tdiagnostics\n\t})?.name : void 0) ?? defaultCollectionName(model.name);\n}\nfunction mongoCrossRef(modelName) {\n\treturn crossRef(modelName, UNBOUND_NAMESPACE_ID);\n}\nfunction collectPolymorphismDeclarations(models, specContextFor, modelMetadataByName, sources, binder, diagnostics) {\n\tconst discriminatorDeclarations = /* @__PURE__ */ new Map();\n\tconst baseDeclarations = /* @__PURE__ */ new Map();\n\tfor (const model of models) {\n\t\tconst specContext = specContextFor(model);\n\t\tconst discNode = findModelAttributeNode(model, \"discriminator\");\n\t\tif (discNode) {\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\tnode: discNode,\n\t\t\t\tspec: mongoAttributeSpecs.model.discriminator(specContext),\n\t\t\t\tmodel,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed) {\n\t\t\t\tconst fieldName = parsed.field;\n\t\t\t\tconst discField = model.fields[fieldName];\n\t\t\t\tif (discField && discField.typeName !== \"String\") diagnostics.push({\n\t\t\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\t\t\tmessage: `Discriminator field \"${fieldName}\" on model \"${model.name}\" must be of type String, but is \"${discField.typeName}\"`,\n\t\t\t\t\t...diagnosticSource(sources, discNode.syntax).at(nodePslSpan(discNode.syntax, sources))\n\t\t\t\t});\n\t\t\t\telse discriminatorDeclarations.set(model, {\n\t\t\t\t\tfieldName,\n\t\t\t\t\tsource: diagnosticSource(sources, discNode.syntax),\n\t\t\t\t\tspan: nodePslSpan(discNode.syntax, sources)\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst baseNode = findModelAttributeNode(model, \"base\");\n\t\tif (baseNode) {\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\tnode: baseNode,\n\t\t\t\tspec: mongoAttributeSpecs.model.base(),\n\t\t\t\tmodel,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed) {\n\t\t\t\tconst collectionName = modelMetadataByName.get(model.name)?.collectionName ?? defaultCollectionName(model.name);\n\t\t\t\tbaseDeclarations.set(model, {\n\t\t\t\t\tbase: parsed.base.declaration,\n\t\t\t\t\tvalue: parsed.value,\n\t\t\t\t\tcollectionName,\n\t\t\t\t\tsource: diagnosticSource(sources, baseNode.syntax),\n\t\t\t\t\tspan: nodePslSpan(baseNode.syntax, sources)\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tdiscriminatorDeclarations,\n\t\tbaseDeclarations\n\t};\n}\nfunction resolvePolymorphism(input) {\n\tconst { discriminatorDeclarations, baseDeclarations, modelMetadataByName, indexSpans, modelIndexesByName, indexSources } = input;\n\tlet patched = input.models;\n\tlet roots = input.roots;\n\tlet collections = input.collections;\n\tconst diagnostics = createPslDiagnosticCollector(input.sources);\n\tfor (const [declaration, decl] of discriminatorDeclarations) {\n\t\tconst modelName = declaration.name;\n\t\tif (baseDeclarations.has(declaration)) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_DISCRIMINATOR_AND_BASE\",\n\t\t\t\tmessage: `Model \"${modelName}\" cannot have both @@discriminator and @@base`,\n\t\t\t\t...decl.source.at(decl.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst model = patched[modelName];\n\t\tif (!model) continue;\n\t\tconst mappedDiscriminatorField = modelMetadataByName.get(modelName)?.fieldMappings.pslNameToMapped.get(decl.fieldName) ?? decl.fieldName;\n\t\tif (!Object.hasOwn(model.fields, mappedDiscriminatorField)) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_DISCRIMINATOR_FIELD_NOT_FOUND\",\n\t\t\t\tmessage: `Discriminator field \"${decl.fieldName}\" is not a field on model \"${modelName}\"`,\n\t\t\t\t...decl.source.at(decl.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst variants = {};\n\t\tfor (const [variant, baseDecl] of baseDeclarations) {\n\t\t\tif (baseDecl.base !== declaration) continue;\n\t\t\tvariants[variant.name] = { value: baseDecl.value };\n\t\t}\n\t\tif (Object.keys(variants).length === 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_ORPHANED_DISCRIMINATOR\",\n\t\t\t\tmessage: `Model \"${modelName}\" has @@discriminator but no variant models declare @@base(${modelName}, ...)`,\n\t\t\t\t...decl.source.at(decl.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tpatched = {\n\t\t\t...patched,\n\t\t\t[modelName]: {\n\t\t\t\t...model,\n\t\t\t\tdiscriminator: { field: mappedDiscriminatorField },\n\t\t\t\tvariants\n\t\t\t}\n\t\t};\n\t}\n\tfor (const [variant, baseDecl] of baseDeclarations) {\n\t\tconst variantName = variant.name;\n\t\tconst baseName = baseDecl.base.name;\n\t\tif (!discriminatorDeclarations.has(baseDecl.base)) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_ORPHANED_BASE\",\n\t\t\t\tmessage: `Model \"${variantName}\" declares @@base(${baseName}, ...) but \"${baseName}\" has no @@discriminator`,\n\t\t\t\t...baseDecl.source.at(baseDecl.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (discriminatorDeclarations.has(variant)) continue;\n\t\tconst baseModel = patched[baseName];\n\t\tif (getAttribute(variant.attributes, \"map\") !== void 0 && baseModel && baseDecl.collectionName !== baseModel.storage.collection) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_MONGO_VARIANT_SEPARATE_COLLECTION\",\n\t\t\t\tmessage: `Mongo variant \"${variantName}\" cannot use a different collection than its base \"${baseName}\". Mongo only supports single-collection polymorphism.`,\n\t\t\t\t...baseDecl.source.at(baseDecl.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst baseCollection = baseModel?.storage.collection ?? baseDecl.collectionName;\n\t\tconst variantModel = patched[variantName];\n\t\tif (variantModel) patched = {\n\t\t\t...patched,\n\t\t\t[variantName]: {\n\t\t\t\t...variantModel,\n\t\t\t\tbase: mongoCrossRef(baseName),\n\t\t\t\tstorage: { collection: baseCollection }\n\t\t\t}\n\t\t};\n\t\tconst variantCollectionName = modelMetadataByName.get(variantName)?.collectionName ?? defaultCollectionName(variantName);\n\t\tif (roots[variantCollectionName]?.model === variantName) if (variantCollectionName === baseCollection && baseModel) roots = {\n\t\t\t...roots,\n\t\t\t[variantCollectionName]: mongoCrossRef(baseName)\n\t\t};\n\t\telse roots = Object.fromEntries(Object.entries(roots).filter(([key]) => key !== variantCollectionName));\n\t\tconst variantOwnIndexes = modelIndexesByName.get(variantName) ?? [];\n\t\tconst baseColl = collections[baseCollection];\n\t\tconst discriminatorField = patched[baseName]?.discriminator?.field;\n\t\tconst scopedVariantIndexes = [];\n\t\tif (discriminatorField) for (const idx of variantOwnIndexes) {\n\t\t\tconst result = applyPolymorphicScopeToMongoIndex(idx, {\n\t\t\t\tdiscriminatorField,\n\t\t\t\tdiscriminatorValue: baseDecl.value\n\t\t\t});\n\t\t\tif (result.kind === \"conflict\") {\n\t\t\t\tconst span = indexSpans.get(idx) ?? baseDecl.span;\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\t\t\tmessage: `Variant \"${variantName}\" index conflicts with discriminator scope: ${result.reason}`,\n\t\t\t\t\t...(indexSources.get(idx) ?? baseDecl.source).at(span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (result.index !== idx) indexSpans.set(result.index, indexSpans.get(idx) ?? baseDecl.span);\n\t\t\tscopedVariantIndexes.push(result.index);\n\t\t}\n\t\telse scopedVariantIndexes.push(...variantOwnIndexes);\n\t\tif (variantCollectionName !== baseCollection) {\n\t\t\tconst filtered = Object.fromEntries(Object.entries(collections).filter(([key]) => key !== variantCollectionName));\n\t\t\tif (scopedVariantIndexes.length > 0 && baseColl) {\n\t\t\t\tconst baseIndexes = collectionIndexes(baseColl);\n\t\t\t\tcollections = {\n\t\t\t\t\t...filtered,\n\t\t\t\t\t[baseCollection]: {\n\t\t\t\t\t\t...baseColl,\n\t\t\t\t\t\tindexes: [...baseIndexes, ...scopedVariantIndexes]\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t} else collections = filtered;\n\t\t} else if (baseColl) {\n\t\t\tconst existingIndexes = collectionIndexes(baseColl);\n\t\t\tconst variantIndexSet = new Set(variantOwnIndexes);\n\t\t\tconst withoutUnscopedVariants = existingIndexes.filter((idx) => !variantIndexSet.has(idx));\n\t\t\tconst mergedIndexes = [...withoutUnscopedVariants];\n\t\t\tfor (const idx of scopedVariantIndexes) {\n\t\t\t\tconst idxKey = canonicalJson(idx);\n\t\t\t\tif (!withoutUnscopedVariants.some((existing) => canonicalJson(existing) === idxKey)) mergedIndexes.push(idx);\n\t\t\t}\n\t\t\tif (mergedIndexes.length !== existingIndexes.length || mergedIndexes.some((idx, i) => idx !== existingIndexes[i])) {\n\t\t\t\tconst next = { ...baseColl };\n\t\t\t\tif (mergedIndexes.length > 0) next[\"indexes\"] = mergedIndexes;\n\t\t\t\telse delete next[\"indexes\"];\n\t\t\t\tcollections = {\n\t\t\t\t\t...collections,\n\t\t\t\t\t[baseCollection]: next\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tmodels: patched,\n\t\troots,\n\t\tcollections,\n\t\tdiagnostics\n\t};\n}\nfunction collectionIndexes(collection) {\n\treturn blindCast(collection[\"indexes\"] ?? []);\n}\nfunction canonicalJson(value) {\n\tif (Array.isArray(value)) return `[${value.map(canonicalJson).join(\",\")}]`;\n\tif (value && typeof value === \"object\") return `{${Object.entries(value).sort(([left], [right]) => left.localeCompare(right)).map(([key, entry]) => `${JSON.stringify(key)}:${canonicalJson(entry)}`).join(\",\")}}`;\n\treturn JSON.stringify(value);\n}\nfunction normalizeIndexField(element) {\n\tif (typeof element === \"string\") return {\n\t\tkind: \"field\",\n\t\tname: element\n\t};\n\tif (element.fn === \"wildcard\" && element.args[\"sort\"] === void 0) {\n\t\tconst scope = element.args[\"scope\"];\n\t\treturn typeof scope === \"string\" ? {\n\t\t\tkind: \"wildcard\",\n\t\t\tscope\n\t\t} : { kind: \"wildcard\" };\n\t}\n\tconst sort = element.args[\"sort\"];\n\treturn {\n\t\tkind: \"field\",\n\t\tname: element.fn,\n\t\tdirection: sort === \"Desc\" ? -1 : 1\n\t};\n}\nfunction buildCollationFromSpec(args) {\n\tconst locale = args.collationLocale;\n\tif (locale === void 0) return args.collationStrength !== void 0 || args.collationCaseLevel !== void 0 || args.collationCaseFirst !== void 0 || args.collationNumericOrdering !== void 0 || args.collationAlternate !== void 0 || args.collationMaxVariable !== void 0 || args.collationBackwards !== void 0 || args.collationNormalization !== void 0 ? null : void 0;\n\tconst collation = { locale };\n\tif (args.collationStrength !== void 0) collation.strength = args.collationStrength;\n\tif (args.collationCaseLevel !== void 0) collation.caseLevel = args.collationCaseLevel;\n\tif (args.collationCaseFirst !== void 0) collation.caseFirst = args.collationCaseFirst;\n\tif (args.collationNumericOrdering !== void 0) collation.numericOrdering = args.collationNumericOrdering;\n\tif (args.collationAlternate !== void 0) collation.alternate = args.collationAlternate;\n\tif (args.collationMaxVariable !== void 0) collation.maxVariable = args.collationMaxVariable;\n\tif (args.collationBackwards !== void 0) collation.backwards = args.collationBackwards;\n\tif (args.collationNormalization !== void 0) collation.normalization = args.collationNormalization;\n\treturn collation;\n}\nfunction resolveIndexKeys(parsedFields, defaultDirection, ctx) {\n\tconst wildcardCount = parsedFields.filter((field) => field.kind === \"wildcard\").length;\n\tif (wildcardCount > 1) {\n\t\tctx.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\tmessage: \"An index can contain at most one wildcard() field\",\n\t\t\t...ctx.source.at(ctx.span)\n\t\t});\n\t\treturn;\n\t}\n\tfor (const field of parsedFields) {\n\t\tconst fieldName = field.kind === \"wildcard\" ? field.scope : field.name;\n\t\tif (fieldName !== void 0 && !ctx.indexableFieldNames.has(fieldName)) {\n\t\t\tctx.diagnostics.push({\n\t\t\t\tcode: \"PSL_INDEX_FIELD_NOT_FOUND\",\n\t\t\t\tmessage: `Index on model \"${ctx.pslModel.name}\" references unknown field \"${fieldName}\"`,\n\t\t\t\t...ctx.source.at(ctx.span)\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t}\n\treturn {\n\t\tkeys: parsedFields.map((field) => {\n\t\t\tif (field.kind === \"wildcard\") {\n\t\t\t\tif (field.scope === void 0) return {\n\t\t\t\t\tfield: \"$**\",\n\t\t\t\t\tdirection: defaultDirection\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\tfield: `${ctx.fieldMappings.pslNameToMapped.get(field.scope) ?? field.scope}.$**`,\n\t\t\t\t\tdirection: defaultDirection\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tfield: ctx.fieldMappings.pslNameToMapped.get(field.name) ?? field.name,\n\t\t\t\tdirection: field.direction ?? defaultDirection\n\t\t\t};\n\t\t}),\n\t\thasWildcard: wildcardCount === 1\n\t};\n}\nfunction buildProjection(include, exclude, hasWildcard, ctx) {\n\tif (include !== void 0 && exclude !== void 0) {\n\t\tctx.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\tmessage: \"Cannot specify both include and exclude on the same index\",\n\t\t\t...ctx.source.at(ctx.span)\n\t\t});\n\t\treturn null;\n\t}\n\tconst fields = include ?? exclude;\n\tif (fields === void 0) return void 0;\n\tif (!hasWildcard) {\n\t\tctx.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\tmessage: \"include/exclude options are only valid when the index contains a wildcard() field\",\n\t\t\t...ctx.source.at(ctx.span)\n\t\t});\n\t\treturn null;\n\t}\n\tif (fields.length === 0) return void 0;\n\tconst value = include === void 0 ? 0 : 1;\n\tconst projection = {};\n\tfor (const field of fields) projection[field] = value;\n\treturn projection;\n}\nfunction buildNormalIndex(parsed, unique, ctx) {\n\tconst parsedFields = parsed.fields.map(normalizeIndexField);\n\tif (parsedFields.length === 0) return void 0;\n\tconst defaultDirection = parsed.type ?? 1;\n\tconst resolved = resolveIndexKeys(parsedFields, defaultDirection, ctx);\n\tif (!resolved) return void 0;\n\tif (unique && resolved.hasWildcard) {\n\t\tctx.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\tmessage: \"Unique indexes cannot use wildcard() fields\",\n\t\t\t...ctx.source.at(ctx.span)\n\t\t});\n\t\treturn;\n\t}\n\tif (resolved.hasWildcard && typeof defaultDirection === \"string\" && [\n\t\t\"hashed\",\n\t\t\"2dsphere\",\n\t\t\"2d\"\n\t].includes(defaultDirection)) {\n\t\tctx.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\tmessage: `wildcard() fields cannot be combined with type: ${defaultDirection}`,\n\t\t\t...ctx.source.at(ctx.span)\n\t\t});\n\t\treturn;\n\t}\n\tif (defaultDirection === \"hashed\" && parsedFields.length > 1) {\n\t\tctx.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\tmessage: \"Hashed indexes must have exactly one field\",\n\t\t\t...ctx.source.at(ctx.span)\n\t\t});\n\t\treturn;\n\t}\n\tif (resolved.hasWildcard && parsed.expireAfterSeconds !== void 0) {\n\t\tctx.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\tmessage: \"expireAfterSeconds cannot be combined with wildcard() fields\",\n\t\t\t...ctx.source.at(ctx.span)\n\t\t});\n\t\treturn;\n\t}\n\tconst wildcardProjection = buildProjection(parsed.include, parsed.exclude, resolved.hasWildcard, ctx);\n\tif (wildcardProjection === null) return void 0;\n\tconst collation = buildCollationFromSpec(parsed);\n\tif (collation === null) {\n\t\tctx.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\tmessage: \"collationLocale is required when using collation options\",\n\t\t\t...ctx.source.at(ctx.span)\n\t\t});\n\t\treturn;\n\t}\n\treturn new MongoIndex({\n\t\tkeys: resolved.keys,\n\t\t...unique && { unique: true },\n\t\t...parsed.sparse !== void 0 && { sparse: parsed.sparse },\n\t\t...parsed.expireAfterSeconds !== void 0 && { expireAfterSeconds: parsed.expireAfterSeconds },\n\t\t...parsed.filter !== void 0 && { partialFilterExpression: parsed.filter },\n\t\t...wildcardProjection !== void 0 && { wildcardProjection },\n\t\t...collation !== void 0 && { collation },\n\t\t...parsed.default_language !== void 0 && { default_language: parsed.default_language },\n\t\t...parsed.languageOverride !== void 0 && { language_override: parsed.languageOverride }\n\t});\n}\nfunction buildTextIndex(parsed, ctx) {\n\tconst parsedFields = parsed.fields.map(normalizeIndexField);\n\tif (parsedFields.length === 0) return void 0;\n\tconst resolved = resolveIndexKeys(parsedFields, \"text\", ctx);\n\tif (!resolved) return void 0;\n\tif (resolved.hasWildcard) {\n\t\tctx.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\tmessage: \"wildcard() fields cannot be combined with type: hashed/2dsphere/2d or @@textIndex\",\n\t\t\t...ctx.source.at(ctx.span)\n\t\t});\n\t\treturn;\n\t}\n\tconst collation = buildCollationFromSpec(parsed);\n\tif (collation === null) {\n\t\tctx.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\tmessage: \"collationLocale is required when using collation options\",\n\t\t\t...ctx.source.at(ctx.span)\n\t\t});\n\t\treturn;\n\t}\n\treturn new MongoIndex({\n\t\tkeys: resolved.keys,\n\t\t...parsed.filter !== void 0 && { partialFilterExpression: parsed.filter },\n\t\t...collation !== void 0 && { collation },\n\t\t...ifDefined(\"weights\", parsed.weights),\n\t\t...parsed.language !== void 0 && { default_language: parsed.language },\n\t\t...parsed.languageOverride !== void 0 && { language_override: parsed.languageOverride }\n\t});\n}\nfunction collectIndexes(pslModel, specContext, fieldMappings, modelNames, sources, binder, diagnostics, indexSpans, indexSources) {\n\tconst indexes = [];\n\tlet textIndexCount = 0;\n\tconst indexableFieldNames = /* @__PURE__ */ new Set();\n\tfor (const field of Object.values(pslModel.fields)) if (!modelNames.has(field.typeName)) indexableFieldNames.add(field.name);\n\tfor (const field of Object.values(pslModel.fields)) {\n\t\tif (modelNames.has(field.typeName)) continue;\n\t\tconst uniqueNode = findFieldAttributeNode(field, \"unique\");\n\t\tif (!uniqueNode) continue;\n\t\tif (interpretFieldAttribute({\n\t\t\tsymbols: specContext.symbols,\n\t\t\tnode: uniqueNode,\n\t\t\tspec: mongoAttributeSpecs.field.unique({\n\t\t\t\t...specContext,\n\t\t\t\tfield\n\t\t\t}),\n\t\t\tmodel: pslModel,\n\t\t\tfield,\n\t\t\tsources,\n\t\t\tbinder,\n\t\t\tdiagnostics\n\t\t}) === void 0) continue;\n\t\tconst fieldUniqueIndex = new MongoIndex({\n\t\t\tkeys: [{\n\t\t\t\tfield: fieldMappings.pslNameToMapped.get(field.name) ?? field.name,\n\t\t\t\tdirection: 1\n\t\t\t}],\n\t\t\tunique: true\n\t\t});\n\t\tindexes.push(fieldUniqueIndex);\n\t\tindexSpans.set(fieldUniqueIndex, nodePslSpan(uniqueNode.syntax, sources));\n\t\tindexSources.set(fieldUniqueIndex, diagnosticSource(sources, uniqueNode.syntax));\n\t}\n\tconst attributeNodes = Array.from(pslModel.node.attributes());\n\tfor (const [attrIndex, attr] of pslModel.attributes.entries()) {\n\t\tif (attr.name !== \"index\" && attr.name !== \"unique\" && attr.name !== \"textIndex\") continue;\n\t\tconst node = attributeNodes[attrIndex];\n\t\tif (!node) continue;\n\t\tconst source = diagnosticSource(sources, node.syntax);\n\t\tconst ctx = {\n\t\t\tpslModel,\n\t\t\tfieldMappings,\n\t\t\tindexableFieldNames,\n\t\t\tsource,\n\t\t\tspan: attr.span,\n\t\t\tdiagnostics\n\t\t};\n\t\tlet index;\n\t\tif (attr.name === \"textIndex\") {\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\tnode,\n\t\t\t\tspec: mongoAttributeSpecs.model.textIndex(specContext),\n\t\t\t\tmodel: pslModel,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (!parsed || parsed.fields.length === 0) continue;\n\t\t\ttextIndexCount++;\n\t\t\tif (textIndexCount > 1) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\t\t\tmessage: `Only one @@textIndex is allowed per collection (model \"${pslModel.name}\")`,\n\t\t\t\t\t...source.at(attr.span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tindex = buildTextIndex(parsed, ctx);\n\t\t} else {\n\t\t\tconst unique = attr.name === \"unique\";\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\tnode,\n\t\t\t\tspec: unique ? mongoAttributeSpecs.model.unique(specContext) : mongoAttributeSpecs.model.index(specContext),\n\t\t\t\tmodel: pslModel,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (!parsed) continue;\n\t\t\tindex = buildNormalIndex(parsed, unique, ctx);\n\t\t}\n\t\tif (!index) continue;\n\t\tindexes.push(index);\n\t\tindexSpans.set(index, attr.span);\n\t\tindexSources.set(index, source);\n\t}\n\treturn indexes;\n}\nfunction isRelationField(field, modelNames) {\n\treturn modelNames.has(field.typeName);\n}\nconst MONGO_OBJECT_ID_PSL_TYPE = \"ObjectId\";\nfunction resolveFieldCodecId(field, scalarTypeCodecIds) {\n\treturn scalarTypeCodecIds.get(field.typeName);\n}\n/**\n* Keys each preset's execution defaults by collection and stored field. Rejects presets on variant fields, since a default keyed by collection applies to every document in it, and merges identical defaults that two models declare for the same collection field.\n*/\nfunction resolvePresetExecutionDefaults(input) {\n\tconst byRef = /* @__PURE__ */ new Map();\n\tconst resolved = [];\n\tfor (const preset of input.defaults) {\n\t\tconst model = input.models[preset.modelName];\n\t\tif (model === void 0) continue;\n\t\tconst collection = model.storage.collection;\n\t\tconst call = preset.field.typeConstructor;\n\t\tconst presetPath = call?.path.join(\".\") ?? preset.field.typeName;\n\t\tconst at = diagnosticSource(input.sources, preset.field.node.syntax).at(call?.span ?? preset.field.span);\n\t\tif (model.base !== void 0) {\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: \"PSL_PRESET_ON_VARIANT_FIELD\",\n\t\t\t\tmessage: `Preset \"${presetPath}\" on variant \"${preset.modelName}\" field \"${preset.field.name}\": execution defaults apply to every document in collection \"${collection}\", so declare them on the base model.`,\n\t\t\t\t...at\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst refKey = JSON.stringify([collection, preset.storedField]);\n\t\tconst phasesKey = canonicalJson(preset.phases);\n\t\tconst existing = byRef.get(refKey);\n\t\tif (existing === void 0) {\n\t\t\tbyRef.set(refKey, {\n\t\t\t\towner: preset,\n\t\t\t\tphasesKey\n\t\t\t});\n\t\t\tresolved.push({\n\t\t\t\tref: {\n\t\t\t\t\tnamespace: UNBOUND_NAMESPACE_ID,\n\t\t\t\t\tentry: collection,\n\t\t\t\t\tfield: preset.storedField\n\t\t\t\t},\n\t\t\t\t...preset.phases\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (existing.phasesKey !== phasesKey) input.diagnostics.push({\n\t\t\tcode: \"PSL_PRESET_CONFLICT\",\n\t\t\tmessage: `Preset \"${presetPath}\" on \"${preset.modelName}.${preset.field.name}\" sets different execution defaults than the preset on \"${existing.owner.modelName}.${existing.owner.field.name}\" for field \"${preset.storedField}\" of collection \"${collection}\". Use the same preset on both models.`,\n\t\t\t...at\n\t\t});\n\t}\n\treturn resolved;\n}\nfunction resolveNonRelationField(field, owner, compositeTypeNames, scalarTypeCodecIds, codecIdByEnumName, presetContext, warnDeprecatedScalar) {\n\tconst { sources, diagnostics } = presetContext;\n\tconst ownerName = owner.name;\n\tif (compositeTypeNames.has(field.typeName)) {\n\t\tconst result = {\n\t\t\ttype: {\n\t\t\t\tkind: \"valueObject\",\n\t\t\t\tname: field.typeName\n\t\t\t},\n\t\t\tnullable: field.optional\n\t\t};\n\t\treturn { field: field.list ? {\n\t\t\t...result,\n\t\t\tmany: true\n\t\t} : result };\n\t}\n\tconst enumCodecId = codecIdByEnumName.get(field.typeName);\n\tif (enumCodecId !== void 0) {\n\t\tconst valueSet = {\n\t\t\tplane: \"domain\",\n\t\t\tentityKind: \"enum\",\n\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\tentityName: field.typeName\n\t\t};\n\t\tconst result = {\n\t\t\ttype: {\n\t\t\t\tkind: \"scalar\",\n\t\t\t\tcodecId: enumCodecId\n\t\t\t},\n\t\t\tnullable: field.optional,\n\t\t\tvalueSet\n\t\t};\n\t\treturn { field: field.list ? {\n\t\t\t...result,\n\t\t\tmany: true\n\t\t} : result };\n\t}\n\tif (field.malformedType) return;\n\tconst preset = resolveFieldPreset({\n\t\tfield,\n\t\townerName,\n\t\townerKind: owner.kind,\n\t\tcontext: presetContext\n\t});\n\tif (preset.kind === \"invalid\") return;\n\tif (preset.kind === \"preset\") return {\n\t\tfield: preset.field,\n\t\t...ifDefined(\"executionDefaults\", preset.executionDefaults)\n\t};\n\tconst codecId = resolveFieldCodecId(field, scalarTypeCodecIds);\n\tif (!codecId) {\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_UNSUPPORTED_FIELD_TYPE\",\n\t\t\tmessage: `Field \"${ownerName}.${field.name}\" type \"${field.typeName}\" is not supported in Mongo PSL interpreter`,\n\t\t\t...diagnosticSource(sources, field.node.syntax).at(field.span)\n\t\t});\n\t\treturn;\n\t}\n\twarnDeprecatedScalar(field);\n\tconst result = {\n\t\ttype: {\n\t\t\tkind: \"scalar\",\n\t\t\tcodecId\n\t\t},\n\t\tnullable: field.optional\n\t};\n\treturn { field: field.list ? {\n\t\t...result,\n\t\tmany: true\n\t} : result };\n}\nfunction processEnumDeclarations(input) {\n\tconst builtEnums = {};\n\tif (input.enumSymbols.length === 0) return builtEnums;\n\tconst enumDescriptor = input.authoringContributions?.entityTypes?.[\"enum\"] !== void 0 && isAuthoringEntityTypeDescriptor(input.authoringContributions.entityTypes[\"enum\"]) ? input.authoringContributions.entityTypes[\"enum\"] : void 0;\n\tif (!enumDescriptor) {\n\t\tfor (const enumSymbol of input.enumSymbols) {\n\t\t\tconst source = diagnosticSource(input.sources, enumSymbol.node.syntax);\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: \"PSL_ENUM_MISSING_FACTORY\",\n\t\t\t\tmessage: `enum \"${enumSymbol.block.name}\" requires an \"enum\" entityType factory in the active authoring contributions`,\n\t\t\t\t...source.at(enumSymbol.span)\n\t\t\t});\n\t\t}\n\t\treturn builtEnums;\n\t}\n\tfor (const enumSymbol of input.enumSymbols) {\n\t\tconst sourceFile = input.sources.sourceFileFor(enumSymbol.node.syntax);\n\t\tconst decl = enumSymbol.block;\n\t\tconst handle = instantiateAuthoringEntityType(\"enum\", enumDescriptor, [decl], {\n\t\t\t...input.entityContext,\n\t\t\tsourceId: sourceFile.filename\n\t\t});\n\t\tif (handle === void 0 || handle === null) continue;\n\t\tbuiltEnums[decl.name] = {\n\t\t\tcodecId: handle.codecId,\n\t\t\tmembers: handle.enumMembers.map((m) => ({\n\t\t\t\tname: m.name,\n\t\t\t\tvalue: blindCast(m.value)\n\t\t\t}))\n\t\t};\n\t}\n\treturn builtEnums;\n}\nfunction interpretPslDocumentToMongoContract(input) {\n\tconst { symbolTable, sources, scalarTypeCodecIds, codecLookup } = input;\n\tconst diagnostics = createPslDiagnosticCollector(sources);\n\tconst presetContext = {\n\t\tauthoringContributions: input.authoringContributions,\n\t\tcomposedExtensions: new Set(input.composedExtensions ?? []),\n\t\tsources,\n\t\tdiagnostics\n\t};\n\tconst presetExecutionDefaults = [];\n\tconst warnDeprecatedScalar = deprecatedScalarWarner({\n\t\ttypes: input.authoringContributions?.type,\n\t\tsources,\n\t\treportWarning: input.reportWarning\n\t});\n\tconst { binder, diagnostics: binderDiagnostics } = createMongoBinder({\n\t\tsymbolTable,\n\t\tsources,\n\t\tscalarTypeCodecIds,\n\t\tcontrolMutationDefaults: input.controlMutationDefaults,\n\t\tauthoringContributions: input.authoringContributions\n\t});\n\tdiagnostics.push(...binderDiagnostics.filter((diagnostic) => diagnostic.data?.[\"reference\"] !== \"type\"));\n\tconst topLevel = symbolTable.topLevel;\n\tvalidateNamespaceBlocksForMongoTarget({\n\t\tnamespaces: Object.values(topLevel.namespaces),\n\t\tsources,\n\t\tbinder,\n\t\tdiagnostics\n\t});\n\tconst allModels = Object.values(topLevel.models);\n\tconst allCompositeTypes = Object.values(topLevel.compositeTypes);\n\tconst modelNames = new Set(allModels.map((m) => m.name));\n\tconst compositeTypeNames = new Set(allCompositeTypes.map((ct) => ct.name));\n\tconst specContextFor = (model) => ({\n\t\tsymbols: symbolTable,\n\t\tmodel,\n\t\tcontrolMutationDefaults: input.controlMutationDefaults\n\t});\n\tconst modelMetadataByName = /* @__PURE__ */ new Map();\n\tfor (const model of allModels) {\n\t\tconst specContext = specContextFor(model);\n\t\tmodelMetadataByName.set(model.name, {\n\t\t\tcollectionName: resolveCollectionName({\n\t\t\t\tmodel,\n\t\t\t\tspecContext,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t}),\n\t\t\tfieldMappings: resolveFieldMappings({\n\t\t\t\tmodel,\n\t\t\t\tspecContext,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t})\n\t\t});\n\t}\n\tconst legitimateBlockKeywords = /* @__PURE__ */ new Set([\"enum\", ...Object.entries(input.authoringContributions?.pslBlockDescriptors ?? {}).filter(([, descriptor]) => isAuthoringPslBlockDescriptor(descriptor)).map(([keyword]) => keyword)]);\n\tfor (const block of Object.values(topLevel.blocks)) {\n\t\tif (legitimateBlockKeywords.has(block.keyword)) continue;\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_UNSUPPORTED_TOP_LEVEL_BLOCK\",\n\t\t\tmessage: `Unsupported top-level block \"${block.keyword}\"`,\n\t\t\t...diagnosticSource(sources, block.node.syntax).at(keywordPslSpan(block.node.syntax, block.keyword, sources))\n\t\t});\n\t}\n\tconst builtEnums = processEnumDeclarations({\n\t\tenumSymbols: Object.values(topLevel.blocks).filter((b) => b.keyword === \"enum\"),\n\t\tsources,\n\t\tbinder,\n\t\tauthoringContributions: input.authoringContributions,\n\t\tentityContext: {\n\t\t\tfamily: \"mongo\",\n\t\t\ttarget: \"mongo\",\n\t\t\t...ifDefined(\"enumInferenceCodecs\", input.enumInferenceCodecs),\n\t\t\t...ifDefined(\"codecLookup\", codecLookup),\n\t\t\tdiagnostics: { push: (d) => {\n\t\t\t\tdiagnostics.pushExternal(blindCast(d));\n\t\t\t} }\n\t\t},\n\t\tdiagnostics\n\t});\n\tconst codecIdByEnumName = new Map(Object.entries(builtEnums).map(([name, e]) => [name, e.codecId]));\n\tconst models = {};\n\tconst collections = {};\n\tconst roots = {};\n\tconst allFkRelations = [];\n\tconst indexSpans = /* @__PURE__ */ new Map();\n\tconst indexSources = /* @__PURE__ */ new Map();\n\tconst modelIndexesByName = /* @__PURE__ */ new Map();\n\tconst backrelationCandidates = [];\n\tconst invalidFkPairings = [];\n\tfor (const pslModel of allModels) {\n\t\tconst modelSource = diagnosticSource(sources, pslModel.node.syntax);\n\t\tconst metadata = modelMetadataByName.get(pslModel.name);\n\t\tif (!metadata) continue;\n\t\tconst { collectionName, fieldMappings } = metadata;\n\t\tconst specContext = specContextFor(pslModel);\n\t\tconst fields = {};\n\t\tconst relations = {};\n\t\tfor (const field of Object.values(pslModel.fields)) {\n\t\t\tif (isRelationField(field, modelNames)) {\n\t\t\t\tconst relationNode = findFieldAttributeNode(field, \"relation\");\n\t\t\t\tconst relation = relationNode ? interpretFieldAttribute({\n\t\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\t\tnode: relationNode,\n\t\t\t\t\tspec: mongoAttributeSpecs.field.relation({\n\t\t\t\t\t\t...specContext,\n\t\t\t\t\t\tfield\n\t\t\t\t\t}),\n\t\t\t\t\tmodel: pslModel,\n\t\t\t\t\tfield,\n\t\t\t\t\tsources,\n\t\t\t\t\tbinder,\n\t\t\t\t\tdiagnostics\n\t\t\t\t}) : void 0;\n\t\t\t\tif (field.list || !(relation?.fields && relation?.references)) {\n\t\t\t\t\tbackrelationCandidates.push({\n\t\t\t\t\t\tmodelName: pslModel.name,\n\t\t\t\t\t\ttargetModelName: field.typeName,\n\t\t\t\t\t\t...ifDefined(\"relationName\", relation?.name),\n\t\t\t\t\t\tcardinality: field.list ? \"1:N\" : \"1:1\",\n\t\t\t\t\t\tfield,\n\t\t\t\t\t\tsources\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (relation?.fields && relation?.references) {\n\t\t\t\t\tif (resolveToOneRelationNullable({\n\t\t\t\t\t\tdeclaredNullable: field.optional,\n\t\t\t\t\t\tlocalFieldNullability: relation.fields.map((localFieldName) => pslModel.fields[localFieldName]?.optional === true),\n\t\t\t\t\t\townsReference: true\n\t\t\t\t\t}).contradiction !== void 0) {\n\t\t\t\t\t\tdiagnostics.push(relationNullabilityMismatchDiagnostic(pslModel.name, field, sources));\n\t\t\t\t\t\tinvalidFkPairings.push({\n\t\t\t\t\t\t\tpairKey: fkRelationPairKey(pslModel.name, field.typeName),\n\t\t\t\t\t\t\t...ifDefined(\"relationName\", relation.name)\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tconst localMapped = relation.fields.map((f) => fieldMappings.pslNameToMapped.get(f) ?? f);\n\t\t\t\t\tconst targetFieldMappings = modelMetadataByName.get(field.typeName)?.fieldMappings;\n\t\t\t\t\tconst targetMapped = relation.references.map((f) => targetFieldMappings?.pslNameToMapped.get(f) ?? f);\n\t\t\t\t\trelations[field.name] = {\n\t\t\t\t\t\tto: mongoCrossRef(field.typeName),\n\t\t\t\t\t\tcardinality: \"N:1\",\n\t\t\t\t\t\tnullable: field.optional,\n\t\t\t\t\t\ton: {\n\t\t\t\t\t\t\tlocalFields: localMapped,\n\t\t\t\t\t\t\ttargetFields: targetMapped\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tallFkRelations.push({\n\t\t\t\t\t\tdeclaringModel: pslModel.name,\n\t\t\t\t\t\ttargetModel: field.typeName,\n\t\t\t\t\t\t...ifDefined(\"relationName\", relation.name),\n\t\t\t\t\t\tlocalFields: localMapped,\n\t\t\t\t\t\ttargetFields: targetMapped\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst resolved = resolveNonRelationField(field, {\n\t\t\t\tname: pslModel.name,\n\t\t\t\tkind: \"model\"\n\t\t\t}, compositeTypeNames, scalarTypeCodecIds, codecIdByEnumName, presetContext, warnDeprecatedScalar);\n\t\t\tif (!resolved) continue;\n\t\t\tconst mappedName = fieldMappings.pslNameToMapped.get(field.name) ?? field.name;\n\t\t\tfields[mappedName] = resolved.field;\n\t\t\tif (resolved.executionDefaults) presetExecutionDefaults.push({\n\t\t\t\tmodelName: pslModel.name,\n\t\t\t\tfield,\n\t\t\t\tstoredField: mappedName,\n\t\t\t\tphases: resolved.executionDefaults\n\t\t\t});\n\t\t}\n\t\tconst isVariantModel = pslModel.attributes.some((attr) => attr.name === \"base\");\n\t\tconst hasIdField = Object.values(pslModel.fields).filter((field) => {\n\t\t\tconst idNode = findFieldAttributeNode(field, \"id\");\n\t\t\tif (!idNode) return false;\n\t\t\treturn interpretFieldAttribute({\n\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\tnode: idNode,\n\t\t\t\tspec: mongoAttributeSpecs.field.id({\n\t\t\t\t\t...specContext,\n\t\t\t\t\tfield\n\t\t\t\t}),\n\t\t\t\tmodel: pslModel,\n\t\t\t\tfield,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t}) !== void 0;\n\t\t}).length > 0;\n\t\tif (!isVariantModel) if (!hasIdField) diagnostics.pushUnlocated({\n\t\t\tcode: \"PSL_MISSING_ID_FIELD\",\n\t\t\tmessage: `Model \"${pslModel.name}\" has no field with @id attribute. Every model must have exactly one @id field.`,\n\t\t\t...modelSource.at()\n\t\t});\n\t\telse {\n\t\t\tconst objectIdCodecId = scalarTypeCodecIds.get(MONGO_OBJECT_ID_PSL_TYPE);\n\t\t\tconst idField = fields[\"_id\"];\n\t\t\tif (!(idField !== void 0 && idField.type.kind === \"scalar\" && objectIdCodecId !== void 0 && idField.type.codecId === objectIdCodecId)) diagnostics.pushUnlocated({\n\t\t\t\tcode: \"PSL_MONGO_ID_REQUIRED\",\n\t\t\t\tmessage: `Model \"${pslModel.name}\" must declare an _id field of type ObjectId (e.g. \\`id ObjectId @id @map(\"_id\")\\`).`,\n\t\t\t\t...modelSource.at()\n\t\t\t});\n\t\t}\n\t\tmodels[pslModel.name] = {\n\t\t\tfields,\n\t\t\trelations,\n\t\t\tstorage: { collection: collectionName }\n\t\t};\n\t\tconst modelIndexes = collectIndexes(pslModel, specContext, fieldMappings, modelNames, sources, binder, diagnostics, indexSpans, indexSources);\n\t\tmodelIndexesByName.set(pslModel.name, modelIndexes);\n\t\tconst existingColl = collections[collectionName];\n\t\tif (existingColl && modelIndexes.length > 0) collections[collectionName] = { indexes: [...collectionIndexes(existingColl), ...modelIndexes] };\n\t\telse if (!existingColl) collections[collectionName] = modelIndexes.length > 0 ? { indexes: modelIndexes } : {};\n\t\troots[collectionName] = mongoCrossRef(pslModel.name);\n\t}\n\tconst valueObjects = {};\n\tfor (const compositeType of allCompositeTypes) {\n\t\tconst fields = {};\n\t\tfor (const field of Object.values(compositeType.fields)) {\n\t\t\tconst resolved = resolveNonRelationField(field, {\n\t\t\t\tname: compositeType.name,\n\t\t\t\tkind: \"compositeType\"\n\t\t\t}, compositeTypeNames, scalarTypeCodecIds, codecIdByEnumName, presetContext, warnDeprecatedScalar);\n\t\t\tif (!resolved) continue;\n\t\t\tfields[field.name] = resolved.field;\n\t\t}\n\t\tvalueObjects[compositeType.name] = { fields };\n\t}\n\tconst paired = pairMongoBackRelations({\n\t\tforeignKeys: allFkRelations,\n\t\tcandidates: backrelationCandidates,\n\t\tinvalidFkPairings\n\t});\n\tdiagnostics.push(...paired.diagnostics);\n\tfor (const { modelName, fieldName, relation } of paired.relations) {\n\t\tconst modelEntry = models[modelName];\n\t\tif (modelEntry) modelEntry.relations[fieldName] = relation;\n\t}\n\tconst { discriminatorDeclarations, baseDeclarations } = collectPolymorphismDeclarations(allModels, specContextFor, modelMetadataByName, sources, binder, diagnostics);\n\tconst polyResult = resolvePolymorphism({\n\t\tsources,\n\t\tmodels,\n\t\troots,\n\t\tcollections,\n\t\tdiscriminatorDeclarations,\n\t\tbaseDeclarations,\n\t\tindexSpans,\n\t\tmodelIndexesByName,\n\t\tmodelMetadataByName,\n\t\tindexSources\n\t});\n\tconst executionDefaults = resolvePresetExecutionDefaults({\n\t\tdefaults: presetExecutionDefaults,\n\t\tmodels: polyResult.models,\n\t\tsources,\n\t\tdiagnostics\n\t});\n\tif (diagnostics.length > 0 || polyResult.diagnostics.length > 0 || (input.seedDiagnostics?.length ?? 0) > 0) return notOk({\n\t\tsummary: \"PSL to Mongo contract interpretation failed\",\n\t\tdiagnostics: [\n\t\t\t...input.seedDiagnostics ?? [],\n\t\t\t...diagnostics.toExternal(),\n\t\t\t...polyResult.diagnostics.toExternal()\n\t\t]\n\t});\n\tconst resolvedModels = polyResult.models;\n\tconst resolvedCollections = polyResult.collections;\n\tconst execution = buildMongoExecutionSection(executionDefaults);\n\tlet storageValueSets = {};\n\tif (Object.keys(builtEnums).length > 0) {\n\t\tassertDefined(codecLookup, \"Mongo PSL interpretation requires a codec lookup to encode enum values\");\n\t\tstorageValueSets = encodeMongoValueSets(builtEnums, codecLookup);\n\t}\n\tfor (const [, modelEntry] of Object.entries(resolvedModels)) {\n\t\tif (modelEntry.base) continue;\n\t\tconst coll = resolvedCollections[modelEntry.storage.collection];\n\t\tif (!coll) continue;\n\t\tif (modelEntry.discriminator && modelEntry.variants) {\n\t\t\tconst variantEntries = Object.entries(modelEntry.variants).map(([variantName, { value }]) => ({\n\t\t\t\tdiscriminatorValue: value,\n\t\t\t\tfields: resolvedModels[variantName]?.fields ?? {}\n\t\t\t}));\n\t\t\tcoll[\"validator\"] = derivePolymorphicJsonSchema(modelEntry.fields, modelEntry.discriminator.field, variantEntries, valueObjects, codecLookup, storageValueSets);\n\t\t} else coll[\"validator\"] = deriveJsonSchema(modelEntry.fields, valueObjects, codecLookup, storageValueSets);\n\t}\n\tconst target = \"mongo\";\n\tconst targetFamily = \"mongo\";\n\tconst collectionInputs = {};\n\tfor (const [name, coll] of Object.entries(resolvedCollections)) {\n\t\tconst raw = {};\n\t\tif (coll[\"indexes\"] != null) raw[\"indexes\"] = coll[\"indexes\"];\n\t\tif (coll[\"validator\"] != null) raw[\"validator\"] = coll[\"validator\"];\n\t\tif (coll[\"options\"] != null) raw[\"options\"] = coll[\"options\"];\n\t\tcollectionInputs[name] = blindCast(raw);\n\t}\n\tconst storage = blindCast(buildMongoStorage({\n\t\tcollections: collectionInputs,\n\t\tvalueSets: storageValueSets\n\t}));\n\tconst capabilities = {};\n\tconst hasEnums = Object.keys(builtEnums).length > 0;\n\treturn ok({\n\t\ttargetFamily,\n\t\ttarget,\n\t\troots: polyResult.roots,\n\t\tdomain: { namespaces: { [UNBOUND_NAMESPACE_ID]: {\n\t\t\tmodels: polyResult.models,\n\t\t\t...Object.keys(valueObjects).length > 0 ? { valueObjects } : {},\n\t\t\t...hasEnums ? { enum: builtEnums } : {}\n\t\t} } },\n\t\tstorage,\n\t\textensions: {},\n\t\tcapabilities,\n\t\tprofileHash: computeProfileHash({\n\t\t\ttarget,\n\t\t\ttargetFamily,\n\t\t\tcapabilities\n\t\t}),\n\t\tmeta: {},\n\t\t...ifDefined(\"execution\", execution)\n\t});\n}\n//#endregion\nexport { derivePolymorphicJsonSchema as a, deriveJsonSchema as i, pairMongoBackRelations as n, mongoAttributeSpecs as r, interpretPslDocumentToMongoContract as t };\n\n//# sourceMappingURL=interpreter-DPALasb4.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,SAAS,gBAAgB,SAAS,aAAa;CAC9C,MAAM,cAAc,aAAa,eAAe,OAAO;CACvD,IAAI,gBAAgB,KAAK,GAAG,OAAO,KAAK;CACxC,OAAO,YAAY,MAAM;AAC1B;AACA,SAAS,kBAAkB,OAAO,cAAc,aAAa,WAAW;CACvE,IAAI,MAAM,KAAK,SAAS,UAAU;EACjC,MAAM,WAAW,gBAAgB,MAAM,KAAK,SAAS,WAAW;EAChE,IAAI,aAAa,KAAK,GAAG,OAAO,KAAK;EACrC,IAAI,aAAa,MAAM,OAAO,UAAU,SAAS,MAAM,OAAO;GAC7D,UAAU;GACV,OAAO,CAAC;EACT,IAAI,CAAC;EACL,MAAM,aAAa,MAAM,aAAa,KAAK,IAAI,YAAY,MAAM,SAAS,WAAW,EAAE,UAAU,OAAO;EACxG,IAAI,UAAU,SAAS,MAAM,MAAM;GAClC,MAAM,QAAQ,EAAE,SAAS;GACzB,IAAI,YAAY,MAAM,UAAU;GAChC,OAAO;IACN,UAAU;IACV;GACD;EACD;EACA,IAAI,MAAM,UAAU;GACnB,MAAM,IAAI,EAAE,UAAU,CAAC,QAAQ,QAAQ,EAA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EACvC,EAAE,EAAE;EACJ;EACA,YAAY,CAAC;EACb;EACA,aAAa,mBAAmB;GAC/B;GACA;GACA;EACD,CAAC;EACD,MAAM,CAAC;EACP,GAAG,UAAU,aAAa,SAAS;CACpC,CAAC;AACF"}
@@ -1,9 +1,9 @@
1
- import { C as MongoContract, v as MongoCollection } from "./mongo-value-set-tNn9-pun-dJYx_rVD.mjs";
2
- import { d as MongoStorage } from "./index-BUYcBNdw.mjs";
3
- import "./mongo-contract-view-AnejqfrQ-nd-SP6W4.mjs";
1
+ import { C as MongoContract, v as MongoCollection } from "./mongo-value-set-BngSUlOh-BhDGXjM_.mjs";
2
+ import { f as MongoStorage } from "./index-b-S3URri.mjs";
3
+ import "./mongo-contract-view-AnejqfrQ-DLhDjvsh.mjs";
4
+ import { AnyEntityKindDescriptor, Namespace } from "@prisma/orm-framework/components/ir";
4
5
  import { ControlPolicy } from "@prisma/orm-framework/contract/types";
5
6
  import { Type } from "arktype";
6
- import { AnyEntityKindDescriptor, Namespace } from "@prisma/orm-framework/components/ir";
7
7
  import { ContractSerializer, SchemaDiffIssue, SchemaVerifier, SchemaVerifyOptions, SchemaVerifyResult } from "@prisma/orm-framework/components/control";
8
8
  import { JsonObject } from "@prisma/orm-framework/utils/json";
9
9
  //#region ../../../2-mongo-family/9-family/dist/ir.d.mts
@@ -123,4 +123,4 @@ declare abstract class MongoSchemaVerifierBase<TContract extends {
123
123
  }
124
124
  //#endregion
125
125
  export { MongoContractSerializerBase as n, MongoSchemaVerifierBase as r, MongoContractSerializer as t };
126
- //# sourceMappingURL=ir-Dun4Br3Q.d.mts.map
126
+ //# sourceMappingURL=ir-9VhpVaDJ.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ir-Dun4Br3Q.d.mts","names":[],"sources":["../../../../2-mongo-family/9-family/dist/ir.d.mts"],"mappings":";;;;;;;;;;uBAQuB,4BAA4B,sBAAsB,mBAAmB;mBACzE;mBACA;EACjB,YAAY,qBAAqB,oBAAoB,gBAAg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AoB,eAAe,WAAW;EAC/C,aAAa,SAAS,oBAAoB,WAAW,WAAW;YACtD,iCAAiC,UAAU,WAAW,YAAY,8BAA8B;YAChG,+BAA+B,UAAU,WAAW,yBAAyB;YAC7E,wBAAwB,SAAS,oBAAoB,WAAW,oBAAoB;;;;;;;;;qBAS3E,gBAAgB;aACxB,UAAU;aACV,QAAQ;aACR;aACA,WAAW;eACT;;;;;;qBAMM,uBAAuB,SAAS,oBAAoB,WAAW,oBAAoB"}
@@ -1,5 +1,5 @@
1
- import { effectiveControlPolicy } from "@prisma/orm-framework/contract/types";
2
1
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
2
+ import { effectiveControlPolicy } from "@prisma/orm-framework/contract/types";
3
3
  //#region ../../../2-mongo-family/9-family/dist/ir.mjs
4
4
  /**
5
5
  * Mongo family `SchemaVerifier` abstract base. Commits the Mongo family
@@ -59,4 +59,4 @@ var MongoSchemaVerifierBase = class {
59
59
  //#endregion
60
60
  export { MongoSchemaVerifierBase as t };
61
61
 
62
- //# sourceMappingURL=ir-Ch2aPr7a.mjs.map
62
+ //# sourceMappingURL=ir-vZWjElPY.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ir-Ch2aPr7a.mjs","names":[],"sources":["../../../../2-mongo-family/9-family/dist/ir.mjs"],"sourcesContent":["import { n as MongoContractSerializerBase, t as MongoContractSerializer } from \"./mongo-contract-serializer-DC_DM9_Y.mjs\";\nimport { t as MongoContractView } from \"./mongo-contract-view-JZOa0Ry-.mjs\";\nimport { effectiveControlPolicy } from \"@internal/contract/types\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\n//#region src/core/ir/mongo-schema-verifier-base.ts\n/**\n* Mongo family `SchemaVerifier` abstract base. Commits the Mongo family\n* to namespace-keyed verification: the family-shared walk iterates\n* `storage.namespaces` in sorted order and dispatches per-namespace\n* through the protected `verifyNamespace` hook, then aggregates\n* target-extension issues from `verifyTargetExtensions`.\n*\n* Per-element diff work (collection / index / validator comparisons)\n* lives on the target inside `verifyNamespace`. The family's structural\n* commitment is \"verification is namespaced\"; the target's commitment is\n* \"verification of a given namespace's collections is the existing\n* diff/canonicalize pipeline\". The split keeps target-mongo's\n* introspection-side helpers (`contractToMongoSchemaIR`,\n* `canonicalizeSchemasForVerification`, `diffMongoSchemas`) in the target\n* layer where they belong, while the family base owns the iteration\n* scaffolding that makes namespaces a first-class verifier concept.\n*\n* Target-specific issue kinds (Atlas-only, future RLS-equivalents)\n* surface through `verifyTargetExtensions`; that hook returns the empty\n* list when no extensions exist over the Mongo family alphabet.\n*/\nvar MongoSchemaVerifierBase = class {\n\tverifySchema(options) {\n\t\tconst issues = [];\n\t\tissues.push(...this.verifyCommonMongoSchema(options));\n\t\tissues.push(...this.verifyTargetExtensions(options));\n\t\treturn {\n\t\t\tok: issues.length === 0,\n\t\t\tissues\n\t\t};\n\t}\n\teffectiveCollectionControlPolicy(contract, collection) {\n\t\treturn effectiveControlPolicy(collection?.control, contract.defaultControlPolicy);\n\t}\n\tcollectionControlPolicyForName(contract, collectionName) {\n\t\tconst collection = contract.storage.namespaces[UNBOUND_NAMESPACE_ID]?.entries.collection?.[collectionName];\n\t\treturn this.effectiveCollectionControlPolicy(contract, collection);\n\t}\n\tverifyCommonMongoSchema(options) {\n\t\tconst issues = [];\n\t\tconst { namespaces } = options.contract.storage;\n\t\tconst namespaceIds = Object.keys(namespaces).sort();\n\t\tfor (const namespaceId of namespaceIds) {\n\t\t\tconst namespace = namespaces[namespaceId];\n\t\t\tif (!namespace) continue;\n\t\t\tissues.push(...this.verifyNamespace({\n\t\t\t\tcontract: options.contract,\n\t\t\t\tschema: options.schema,\n\t\t\t\tnamespaceId,\n\t\t\t\tnamespace\n\t\t\t}));\n\t\t}\n\t\treturn issues;\n\t}\n};\n//#endregion\nexport { MongoContractSerializer, MongoContractSerializerBase, MongoContractView, MongoSchemaVerifierBase };\n\n//# sourceMappingURL=ir.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAI,0BAA0B,MAAM;CACnC,aAAa,SAAS;EACrB,MAAM,SAAS,CAAC;EAChB,OAAO,KAAK,GAAG,KAAK,wBAAwB,OAAO,CAAC;EACpD,OAAO,KAAK,GAAG,KAAK,uBAAuB,OAAO,CAAC;EACnD,OAAO;GACN,IAAI,OAAO,WAAW;GACtB;EACD;CACD;CACA,iCAAiC,UAAU,YAAY;EACtD,OAAO,uBAAuB,YAAY,SAAS,SAAS,oBAAoB;CACjF;CACA,+BAA+B,UAAU,gBAAgB;EACxD,MAAM,aAAa,SAAS,QAAQ,WAAW,qBAAqB,EAAE,QAAQ,aAAa;EAC3F,OAAO,KAAK,iCAAiC,UAAU,UAAU;CAClE;CACA,wBAAwB,SAAS;EAChC,MAAM,SAAS,CAAC;EAChB,MAAM,EAAE,eAAe,QAAQ,SAAS;EACxC,MAAM,eAAe,OAAO,KAAK,UAAU,CAAC,CAAC,KAAK;EAClD,KAAK,MAAM,eAAe,cAAc;GACvC,MAAM,YAAY,WAAW;GAC7B,IAAI,CAAC,WAAW;GAChB,OAAO,KAAK,GAAG,KAAK,gBAAgB;IACnC,UAAU,QAAQ;IAClB,QAAQ,QAAQ;IAChB;IACA;GACD,CAAC,CAAC;EACH;EACA,OAAO;CACR;AACD"}
1
+ {"version":3,"file":"ir-vZWjElPY.mjs","names":[],"sources":["../../../../2-mongo-family/9-family/dist/ir.mjs"],"sourcesContent":["import { n as MongoContractSerializerBase, t as MongoContractSerializer } from \"./mongo-contract-serializer-DC_DM9_Y.mjs\";\nimport { t as MongoContractView } from \"./mongo-contract-view-JZOa0Ry-.mjs\";\nimport { effectiveControlPolicy } from \"@internal/contract/types\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\n//#region src/core/ir/mongo-schema-verifier-base.ts\n/**\n* Mongo family `SchemaVerifier` abstract base. Commits the Mongo family\n* to namespace-keyed verification: the family-shared walk iterates\n* `storage.namespaces` in sorted order and dispatches per-namespace\n* through the protected `verifyNamespace` hook, then aggregates\n* target-extension issues from `verifyTargetExtensions`.\n*\n* Per-element diff work (collection / index / validator comparisons)\n* lives on the target inside `verifyNamespace`. The family's structural\n* commitment is \"verification is namespaced\"; the target's commitment is\n* \"verification of a given namespace's collections is the existing\n* diff/canonicalize pipeline\". The split keeps target-mongo's\n* introspection-side helpers (`contractToMongoSchemaIR`,\n* `canonicalizeSchemasForVerification`, `diffMongoSchemas`) in the target\n* layer where they belong, while the family base owns the iteration\n* scaffolding that makes namespaces a first-class verifier concept.\n*\n* Target-specific issue kinds (Atlas-only, future RLS-equivalents)\n* surface through `verifyTargetExtensions`; that hook returns the empty\n* list when no extensions exist over the Mongo family alphabet.\n*/\nvar MongoSchemaVerifierBase = class {\n\tverifySchema(options) {\n\t\tconst issues = [];\n\t\tissues.push(...this.verifyCommonMongoSchema(options));\n\t\tissues.push(...this.verifyTargetExtensions(options));\n\t\treturn {\n\t\t\tok: issues.length === 0,\n\t\t\tissues\n\t\t};\n\t}\n\teffectiveCollectionControlPolicy(contract, collection) {\n\t\treturn effectiveControlPolicy(collection?.control, contract.defaultControlPolicy);\n\t}\n\tcollectionControlPolicyForName(contract, collectionName) {\n\t\tconst collection = contract.storage.namespaces[UNBOUND_NAMESPACE_ID]?.entries.collection?.[collectionName];\n\t\treturn this.effectiveCollectionControlPolicy(contract, collection);\n\t}\n\tverifyCommonMongoSchema(options) {\n\t\tconst issues = [];\n\t\tconst { namespaces } = options.contract.storage;\n\t\tconst namespaceIds = Object.keys(namespaces).sort();\n\t\tfor (const namespaceId of namespaceIds) {\n\t\t\tconst namespace = namespaces[namespaceId];\n\t\t\tif (!namespace) continue;\n\t\t\tissues.push(...this.verifyNamespace({\n\t\t\t\tcontract: options.contract,\n\t\t\t\tschema: options.schema,\n\t\t\t\tnamespaceId,\n\t\t\t\tnamespace\n\t\t\t}));\n\t\t}\n\t\treturn issues;\n\t}\n};\n//#endregion\nexport { MongoContractSerializer, MongoContractSerializerBase, MongoContractView, MongoSchemaVerifierBase };\n\n//# sourceMappingURL=ir.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAI,0BAA0B,MAAM;CACnC,aAAa,SAAS;EACrB,MAAM,SAAS,CAAC;EAChB,OAAO,KAAK,GAAG,KAAK,wBAAwB,OAAO,CAAC;EACpD,OAAO,KAAK,GAAG,KAAK,uBAAuB,OAAO,CAAC;EACnD,OAAO;GACN,IAAI,OAAO,WAAW;GACtB;EACD;CACD;CACA,iCAAiC,UAAU,YAAY;EACtD,OAAO,uBAAuB,YAAY,SAAS,SAAS,oBAAoB;CACjF;CACA,+BAA+B,UAAU,gBAAgB;EACxD,MAAM,aAAa,SAAS,QAAQ,WAAW,qBAAqB,EAAE,QAAQ,aAAa;EAC3F,OAAO,KAAK,iCAAiC,UAAU,UAAU;CAClE;CACA,wBAAwB,SAAS;EAChC,MAAM,SAAS,CAAC;EAChB,MAAM,EAAE,eAAe,QAAQ,SAAS;EACxC,MAAM,eAAe,OAAO,KAAK,UAAU,CAAC,CAAC,KAAK;EAClD,KAAK,MAAM,eAAe,cAAc;GACvC,MAAM,YAAY,WAAW;GAC7B,IAAI,CAAC,WAAW;GAChB,OAAO,KAAK,GAAG,KAAK,gBAAgB;IACnC,UAAU,QAAQ;IAClB,QAAQ,QAAQ;IAChB;IACA;GACD,CAAC,CAAC;EACH;EACA,OAAO;CACR;AACD"}
@@ -1,2 +1,2 @@
1
- import { a as MongoLoweredDraft, i as MongoDriver, n as MongoControlDriverInstance, r as MongoDdlPlan, t as MongoAdapter } from "./index-BfSjP_y5.mjs";
1
+ import { a as MongoLoweredDraft, i as MongoDriver, n as MongoControlDriverInstance, r as MongoDdlPlan, t as MongoAdapter } from "./index-DJLkZc6k.mjs";
2
2
  export type { MongoAdapter, MongoControlDriverInstance, MongoDdlPlan, MongoDriver, MongoLoweredDraft };
@@ -1,7 +1,7 @@
1
- import { C as MongoContract } from "./mongo-value-set-tNn9-pun-dJYx_rVD.mjs";
2
- import "./index-BUYcBNdw.mjs";
3
- import { r as AnyMongoMigrationOperation } from "./control-9Vd-XWkM.mjs";
4
- import { t as MongoContractView$1 } from "./mongo-contract-view-AnejqfrQ-nd-SP6W4.mjs";
1
+ import { C as MongoContract } from "./mongo-value-set-BngSUlOh-BhDGXjM_.mjs";
2
+ import "./index-b-S3URri.mjs";
3
+ import { r as AnyMongoMigrationOperation } from "./control-BXKlnxAS.mjs";
4
+ import { t as MongoContractView$1 } from "./mongo-contract-view-AnejqfrQ-DLhDjvsh.mjs";
5
5
  import { Migration } from "@prisma/orm-toolchain/migration-tools/migration";
6
6
  //#region ../../../2-mongo-family/9-family/dist/migration.d.mts
7
7
  //#region src/core/mongo-migration.d.ts
@@ -47,4 +47,4 @@ declare abstract class MongoMigration<Start extends MongoContract = MongoContrac
47
47
  }
48
48
  //#endregion
49
49
  export { MongoMigration as t };
50
- //# sourceMappingURL=migration-Cs9Lwv2y.d.mts.map
50
+ //# sourceMappingURL=migration-9n6DCvlw.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"migration-Cs9Lwv2y.d.mts","names":[],"sources":["../../../../2-mongo-family/9-family/dist/migration.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA6BuB,eAAe,cAAc,gBAAgB,eAAe,YAAY,gBAAgB,uBAAuB,UAAU,4CAA4C,OAAO;;WAExL;;;;;;;MAOL,eAAe,oBAAoB;;;;;MAKnC,iBAAiB,oBAAoB"}
1
+ {"version":3,"file":"migration-9n6DCvlw.d.mts","names":[],"sources":["../../../../2-mongo-family/9-family/dist/migration.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA6BuB,eAAe,cAAc,gBAAgB,eAAe,YAAY,gBAAgB,uBAAuB,UAAU,4CAA4C,OAAO;;WAExL;;;;;;;MAOL,eAAe,oBAAoB;;;;;MAKnC,iBAAiB,oBAAoB"}
@@ -1,4 +1,4 @@
1
- import { t as MongoContractView$1 } from "./mongo-contract-view-JZOa0Ry--BTfPzsVC.mjs";
1
+ import { t as MongoContractView$1 } from "./mongo-contract-view-JZOa0Ry--BL8lTjbw.mjs";
2
2
  import { Migration, MigrationContractViews } from "@prisma/orm-toolchain/migration-tools/migration";
3
3
  //#region ../../../2-mongo-family/9-family/dist/migration.mjs
4
4
  /**
@@ -49,4 +49,4 @@ var MongoMigration = class extends Migration {
49
49
  //#endregion
50
50
  export { MongoMigration as t };
51
51
 
52
- //# sourceMappingURL=migration-BsJgtw77.mjs.map
52
+ //# sourceMappingURL=migration-DofqFxoZ.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"migration-BsJgtw77.mjs","names":["MongoContractView","#endView","#startView"],"sources":["../../../../2-mongo-family/9-family/dist/migration.mjs"],"sourcesContent":["import { t as MongoContractView } from \"./mongo-contract-view-JZOa0Ry-.mjs\";\nimport { Migration, MigrationContractViews } from \"@internal/migration-tools/migration\";\n//#region src/core/mongo-migration.ts\n/**\n* Family-owned base class for Mongo migrations.\n*\n* Provides the fixed `targetId = 'mongo'` so that user-authored migrations\n* and renderer-generated scaffolds (e.g. the output of\n* `renderCallsToTypeScript`) inherit it directly and don't have to re-declare\n* the abstract `targetId` member from `Migration`.\n*\n* The operation type parameter is `AnyMongoMigrationOperation` — the union\n* of DDL-shaped `MongoMigrationPlanOperation` and `MongoDataTransformOperation` —\n* so subclasses can return a mix of schema operations (e.g. `createIndex`,\n* `setValidation`) and data-transform operations (e.g. `dataTransform`).\n* Mirrors the generic parameter used by `PlannerProducedMongoMigration`.\n*\n* Binds the framework base's `Start` / `End` contract generics so a subclass\n* that assigns its snapshot-store `contract.json` imports to\n* `startContractJson` / `endContractJson` gets fully-typed view accessors:\n* `this.endContract` is a `MongoContractView<End>`\n* (and `this.startContract` a `MongoContractView<Start> | null`), built lazily\n* from those JSON fields via the shared `MigrationContractViews` helper. The\n* framework base derives `describe()` from the same JSON. View getters live on\n* the family base (not the framework base) because `MongoContractView`'s shape\n* is Mongo-specific.\n*/\nvar MongoMigration = class extends Migration {\n\ttargetId = \"mongo\";\n\t#endView = new MigrationContractViews(this, \"MongoMigration\", (json) => MongoContractView.fromJson(json));\n\t#startView = new MigrationContractViews(this, \"MongoMigration\", (json) => MongoContractView.fromJson(json));\n\t/**\n\t* The typed, namespace-unwrapped view over this migration's end-state\n\t* contract — `this.endContract.collection.<name>.validator`, etc. Throws if\n\t* no `endContractJson` was provided (a `describe()`-overriding migration\n\t* with no contract has no view to expose).\n\t*/\n\tget endContract() {\n\t\treturn this.#endView.endContract;\n\t}\n\t/**\n\t* The typed view over this migration's start-state contract, or `null` for\n\t* a baseline migration (no `startContractJson`).\n\t*/\n\tget startContract() {\n\t\treturn this.#startView.startContract;\n\t}\n};\n//#endregion\nexport { MongoMigration as Migration };\n\n//# sourceMappingURL=migration.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,IAAI,iBAAiB,cAAc,UAAU;CAC5C,WAAW;CACX,WAAW,IAAI,uBAAuB,MAAM,mBAAmB,SAASA,oBAAkB,SAAS,IAAI,CAAC;CACxG,aAAa,IAAI,uBAAuB,MAAM,mBAAmB,SAASA,oBAAkB,SAAS,IAAI,CAAC;;;;;;;CAO1G,IAAI,cAAc;EACjB,OAAO,KAAKC,SAAS;CACtB;;;;;CAKA,IAAI,gBAAgB;EACnB,OAAO,KAAKC,WAAW;CACxB;AACD"}
1
+ {"version":3,"file":"migration-DofqFxoZ.mjs","names":["MongoContractView","#endView","#startView"],"sources":["../../../../2-mongo-family/9-family/dist/migration.mjs"],"sourcesContent":["import { t as MongoContractView } from \"./mongo-contract-view-JZOa0Ry-.mjs\";\nimport { Migration, MigrationContractViews } from \"@internal/migration-tools/migration\";\n//#region src/core/mongo-migration.ts\n/**\n* Family-owned base class for Mongo migrations.\n*\n* Provides the fixed `targetId = 'mongo'` so that user-authored migrations\n* and renderer-generated scaffolds (e.g. the output of\n* `renderCallsToTypeScript`) inherit it directly and don't have to re-declare\n* the abstract `targetId` member from `Migration`.\n*\n* The operation type parameter is `AnyMongoMigrationOperation` — the union\n* of DDL-shaped `MongoMigrationPlanOperation` and `MongoDataTransformOperation` —\n* so subclasses can return a mix of schema operations (e.g. `createIndex`,\n* `setValidation`) and data-transform operations (e.g. `dataTransform`).\n* Mirrors the generic parameter used by `PlannerProducedMongoMigration`.\n*\n* Binds the framework base's `Start` / `End` contract generics so a subclass\n* that assigns its snapshot-store `contract.json` imports to\n* `startContractJson` / `endContractJson` gets fully-typed view accessors:\n* `this.endContract` is a `MongoContractView<End>`\n* (and `this.startContract` a `MongoContractView<Start> | null`), built lazily\n* from those JSON fields via the shared `MigrationContractViews` helper. The\n* framework base derives `describe()` from the same JSON. View getters live on\n* the family base (not the framework base) because `MongoContractView`'s shape\n* is Mongo-specific.\n*/\nvar MongoMigration = class extends Migration {\n\ttargetId = \"mongo\";\n\t#endView = new MigrationContractViews(this, \"MongoMigration\", (json) => MongoContractView.fromJson(json));\n\t#startView = new MigrationContractViews(this, \"MongoMigration\", (json) => MongoContractView.fromJson(json));\n\t/**\n\t* The typed, namespace-unwrapped view over this migration's end-state\n\t* contract — `this.endContract.collection.<name>.validator`, etc. Throws if\n\t* no `endContractJson` was provided (a `describe()`-overriding migration\n\t* with no contract has no view to expose).\n\t*/\n\tget endContract() {\n\t\treturn this.#endView.endContract;\n\t}\n\t/**\n\t* The typed view over this migration's start-state contract, or `null` for\n\t* a baseline migration (no `startContractJson`).\n\t*/\n\tget startContract() {\n\t\treturn this.#startView.startContract;\n\t}\n};\n//#endregion\nexport { MongoMigration as Migration };\n\n//# sourceMappingURL=migration.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,IAAI,iBAAiB,cAAc,UAAU;CAC5C,WAAW;CACX,WAAW,IAAI,uBAAuB,MAAM,mBAAmB,SAASA,oBAAkB,SAAS,IAAI,CAAC;CACxG,aAAa,IAAI,uBAAuB,MAAM,mBAAmB,SAASA,oBAAkB,SAAS,IAAI,CAAC;;;;;;;CAO1G,IAAI,cAAc;EACjB,OAAO,KAAKC,SAAS;CACtB;;;;;CAKA,IAAI,gBAAgB;EACnB,OAAO,KAAKC,WAAW;CACxB;AACD"}
@@ -1,12 +1,12 @@
1
- import { a as MongoContractSchema, m as createMongoContractSchema, p as composeMongoEntityKinds } from "./entity-kinds-FlR_bJNA-D4NYzPhs.mjs";
2
- import { f as resolveMongoToOneRelationFields, p as validateMongoStorage } from "./dist-B4a9eijw.mjs";
3
- import { t as mongoContractCanonicalizationHooks } from "./canonicalization-hooks-BXCTdx8s.mjs";
1
+ import { t as mongoContractCanonicalizationHooks } from "./canonicalization-hooks-CRVM-Kqh-Qi-VmEVg.mjs";
2
+ import { a as MongoContractSchema, m as createMongoContractSchema, p as composeMongoEntityKinds } from "./entity-kinds-BFgLffz7-D8WUc2oo.mjs";
3
+ import { h as validateMongoStorage, m as resolveMongoToOneRelationFields } from "./dist-DsIID5AE.mjs";
4
4
  import { structuredError } from "@prisma/orm-framework/utils/structured-error";
5
- import { type } from "arktype";
6
5
  import { hydrateNamespaceEntities } from "@prisma/orm-framework/components/ir";
6
+ import { type } from "arktype";
7
7
  import { blindCast } from "@prisma/orm-framework/utils/casts";
8
- import { withDerivedToOneRelationNullability } from "@prisma/orm-framework/contract-authoring";
9
8
  import { validateContractDomain } from "@prisma/orm-framework/contract/validate-domain";
9
+ import { withDerivedToOneRelationNullability } from "@prisma/orm-framework/contract-authoring";
10
10
  //#region ../../../2-mongo-family/9-family/dist/mongo-contract-serializer-DC_DM9_Y.mjs
11
11
  /**
12
12
  * Mongo family `ContractSerializer` abstract base. Owns the family-shared
@@ -135,4 +135,4 @@ var MongoContractSerializer = class extends MongoContractSerializerBase {
135
135
  //#endregion
136
136
  export { MongoContractSerializerBase as n, MongoContractSerializer as t };
137
137
 
138
- //# sourceMappingURL=mongo-contract-serializer-DC_DM9_Y-MJjsJZwM.mjs.map
138
+ //# sourceMappingURL=mongo-contract-serializer-DC_DM9_Y-CDk1Veya.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"mongo-contract-serializer-DC_DM9_Y-MJjsJZwM.mjs","names":[],"sources":["../../../../2-mongo-family/9-family/dist/mongo-contract-serializer-DC_DM9_Y.mjs"],"sourcesContent":["import { structuredError } from \"@internal/utils/structured-error\";\nimport { withDerivedToOneRelationNullability } from \"@internal/contract-authoring\";\nimport { hydrateNamespaceEntities } from \"@internal/framework-components/ir\";\nimport { MongoContractSchema, createMongoContractSchema, resolveMongoToOneRelationFields, validateMongoStorage } from \"@internal/mongo-contract\";\nimport { mongoContractCanonicalizationHooks } from \"@internal/mongo-contract/canonicalization-hooks\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { validateContractDomain } from \"@internal/contract/validate-domain\";\nimport { composeMongoEntityKinds } from \"@internal/mongo-contract/entity-kinds\";\nimport { type } from \"arktype\";\n//#region src/core/ir/mongo-contract-serializer-base.ts\n/**\n* Mongo family `ContractSerializer` abstract base. Owns the family-shared\n* deserialization pipeline:\n*\n* 1. Structural validation against the Mongo contract arktype schema\n* (`MongoContractSchema`).\n* 2. Framework-shared domain validation (`validateContractDomain`).\n* 3. Family-shared storage validation (`validateMongoStorage`).\n*\n* The validated value is handed to the target via the\n* `constructTargetContract` hook, which wraps the plain-JSON shape in\n* the family-layer `MongoStorage` class instance (carrying the\n* target-supplied `namespaces` map). Targets that need to add\n* structural checks beyond the family default can override\n* `parseMongoContractStructure`.\n*\n* Default `serializeContract` is identity over the contract — Mongo\n* target classes carry JSON-clean fields by construction, so the value\n* can be `JSON.stringify`'d directly. Targets that need on-the-way-out\n* canonicalization override `serializeContract`.\n*/\n/**\n* A `contract.json` written before to-one relations recorded `nullable` (rc.9 and earlier)\n* loads with the flag derived from the model: nullable when any local field is nullable or is\n* not declared.\n*/\nfunction withMongoToOneRelationNullability(contract) {\n\tconst domain = withDerivedToOneRelationNullability(contract.domain, ({ model, relation }) => {\n\t\tconst { ownsForeignKey, fields } = resolveMongoToOneRelationFields(model, relation);\n\t\treturn {\n\t\t\townsReference: ownsForeignKey,\n\t\t\tlocalFieldNullability: fields.map((field) => field.nullable)\n\t\t};\n\t});\n\treturn {\n\t\t...contract,\n\t\tdomain\n\t};\n}\nvar MongoContractSerializerBase = class {\n\tcontractSchema;\n\tentryKinds;\n\tconstructor(validatorFragments, packEntityKinds = []) {\n\t\tthis.entryKinds = composeMongoEntityKinds(packEntityKinds);\n\t\tthis.contractSchema = validatorFragments !== void 0 && validatorFragments.size > 0 ? createMongoContractSchema(validatorFragments) : void 0;\n\t}\n\tdeserializeContract(json) {\n\t\tconst validated = this.parseMongoContractStructure(json);\n\t\treturn this.constructTargetContract(validated);\n\t}\n\tserializeContract(contract) {\n\t\treturn contract;\n\t}\n\t/**\n\t* Preserve empty `collections` maps and per-collection payloads. Mongo\n\t* collections legitimately serialize empty (a declared collection with no\n\t* schema is valid); SQL tables never do — that asymmetry lives here rather\n\t* than in the family-agnostic canonicalizer.\n\t*/\n\tshouldPreserveEmpty = mongoContractCanonicalizationHooks.shouldPreserveEmpty;\n\t/**\n\t* Family-shared structural validation: parse against the Mongo\n\t* contract arktype schema, then run framework-shared domain + Mongo\n\t* family storage checks, then hydrate the validated tree into Mongo\n\t* Contract IR class instances. Targets can override to add\n\t* target-specific structural checks; most targets accept the family\n\t* default.\n\t*\n\t* The returned `MongoContract` carries class instances under\n\t* `storage.namespaces[namespaceId].entries.collection[collectionName]` (each value is a\n\t* `MongoCollection`, with nested `MongoIndex` / `MongoValidator` /\n\t* `MongoCollectionOptions` constructed by the `MongoCollection` constructor).\n\t* The rest of the contract envelope (models, valueObjects, capabilities, …)\n\t* remains in plain-JSON form; those IR layers are handled by sibling\n\t* subsystems and don't sit behind this SPI.\n\t*/\n\tparseMongoContractStructure(json) {\n\t\tconst parsed = (this.contractSchema ?? MongoContractSchema)(json);\n\t\tif (parsed instanceof type.errors) throw structuredError(\"CONTRACT.VALIDATION_FAILED\", `Contract structural validation failed: ${parsed.summary}`);\n\t\tconst validatedShape = parsed;\n\t\tconst hydratedContract = this.hydrateMongoContract(withMongoToOneRelationNullability(validatedShape));\n\t\tvalidateContractDomain(hydratedContract);\n\t\tvalidateMongoStorage(hydratedContract);\n\t\treturn hydratedContract;\n\t}\n\t/**\n\t* Walk a structurally-validated Mongo contract and hydrate each namespace's\n\t* entries via the registered entity-kind descriptors. Unknown kinds throw (fail-closed),\n\t* preserving the existing Mongo serializer semantics.\n\t*/\n\thydrateMongoContract(contract) {\n\t\tconst rawNamespaces = contract.storage.namespaces;\n\t\tconst hydratedNamespaces = Object.fromEntries(Object.entries(rawNamespaces).map(([nsId, nsEnvelope]) => {\n\t\t\tconst hydratedEntries = hydrateNamespaceEntities(blindCast(nsEnvelope.entries), this.entryKinds, \"fail\", nsId);\n\t\t\treturn [nsId, {\n\t\t\t\t...nsEnvelope,\n\t\t\t\tid: nsEnvelope.id,\n\t\t\t\tentries: blindCast(hydratedEntries)\n\t\t\t}];\n\t\t}));\n\t\treturn {\n\t\t\t...contract,\n\t\t\tstorage: {\n\t\t\t\t...contract.storage,\n\t\t\t\tnamespaces: hydratedNamespaces\n\t\t\t}\n\t\t};\n\t}\n};\n//#endregion\n//#region src/core/ir/mongo-contract-serializer.ts\n/**\n* Default Mongo family `ContractSerializer` concretion. Inherits the\n* Mongo-shared deserialization pipeline (structural validation +\n* collection-level hydration) and falls through `constructTargetContract`\n* with the validated `MongoContract` shape. Family-level call sites\n* (family-instance methods, family-layer tests that don't reach into\n* a target descriptor) instantiate this directly; targets with their\n* own storage concretion (`target-mongo`'s `MongoTargetContractSerializer`)\n* override `constructTargetContract` to wrap the storage shape.\n*/\nvar MongoContractSerializer = class extends MongoContractSerializerBase {\n\tconstructTargetContract(validated) {\n\t\treturn validated;\n\t}\n};\n//#endregion\nexport { MongoContractSerializerBase as n, MongoContractSerializer as t };\n\n//# sourceMappingURL=mongo-contract-serializer-DC_DM9_Y.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,SAAS,kCAAkC,UAAU;CACpD,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CAAC,CAAC;EACF,OAAO;GACN,GAAG;GACH,SAAS;IACR,GAAG,SAAS;IACZ,YAAY;GACb;EACD;CACD;AACD;;;;;;;;;;;AAaA,IAAI,0BAA0B,cAAc,4BAA4B;CACvE,wBAAwB,WAAW;EAClC,OAAO;CACR;AACD"}
1
+ {"version":3,"file":"mongo-contract-serializer-DC_DM9_Y-CDk1Veya.mjs","names":[],"sources":["../../../../2-mongo-family/9-family/dist/mongo-contract-serializer-DC_DM9_Y.mjs"],"sourcesContent":["import { structuredError } from \"@internal/utils/structured-error\";\nimport { withDerivedToOneRelationNullability } from \"@internal/contract-authoring\";\nimport { hydrateNamespaceEntities } from \"@internal/framework-components/ir\";\nimport { MongoContractSchema, createMongoContractSchema, resolveMongoToOneRelationFields, validateMongoStorage } from \"@internal/mongo-contract\";\nimport { mongoContractCanonicalizationHooks } from \"@internal/mongo-contract/canonicalization-hooks\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { validateContractDomain } from \"@internal/contract/validate-domain\";\nimport { composeMongoEntityKinds } from \"@internal/mongo-contract/entity-kinds\";\nimport { type } from \"arktype\";\n//#region src/core/ir/mongo-contract-serializer-base.ts\n/**\n* Mongo family `ContractSerializer` abstract base. Owns the family-shared\n* deserialization pipeline:\n*\n* 1. Structural validation against the Mongo contract arktype schema\n* (`MongoContractSchema`).\n* 2. Framework-shared domain validation (`validateContractDomain`).\n* 3. Family-shared storage validation (`validateMongoStorage`).\n*\n* The validated value is handed to the target via the\n* `constructTargetContract` hook, which wraps the plain-JSON shape in\n* the family-layer `MongoStorage` class instance (carrying the\n* target-supplied `namespaces` map). Targets that need to add\n* structural checks beyond the family default can override\n* `parseMongoContractStructure`.\n*\n* Default `serializeContract` is identity over the contract — Mongo\n* target classes carry JSON-clean fields by construction, so the value\n* can be `JSON.stringify`'d directly. Targets that need on-the-way-out\n* canonicalization override `serializeContract`.\n*/\n/**\n* A `contract.json` written before to-one relations recorded `nullable` (rc.9 and earlier)\n* loads with the flag derived from the model: nullable when any local field is nullable or is\n* not declared.\n*/\nfunction withMongoToOneRelationNullability(contract) {\n\tconst domain = withDerivedToOneRelationNullability(contract.domain, ({ model, relation }) => {\n\t\tconst { ownsForeignKey, fields } = resolveMongoToOneRelationFields(model, relation);\n\t\treturn {\n\t\t\townsReference: ownsForeignKey,\n\t\t\tlocalFieldNullability: fields.map((field) => field.nullable)\n\t\t};\n\t});\n\treturn {\n\t\t...contract,\n\t\tdomain\n\t};\n}\nvar MongoContractSerializerBase = class {\n\tcontractSchema;\n\tentryKinds;\n\tconstructor(validatorFragments, packEntityKinds = []) {\n\t\tthis.entryKinds = composeMongoEntityKinds(packEntityKinds);\n\t\tthis.contractSchema = validatorFragments !== void 0 && validatorFragments.size > 0 ? createMongoContractSchema(validatorFragments) : void 0;\n\t}\n\tdeserializeContract(json) {\n\t\tconst validated = this.parseMongoContractStructure(json);\n\t\treturn this.constructTargetContract(validated);\n\t}\n\tserializeContract(contract) {\n\t\treturn contract;\n\t}\n\t/**\n\t* Preserve empty `collections` maps and per-collection payloads. Mongo\n\t* collections legitimately serialize empty (a declared collection with no\n\t* schema is valid); SQL tables never do — that asymmetry lives here rather\n\t* than in the family-agnostic canonicalizer.\n\t*/\n\tshouldPreserveEmpty = mongoContractCanonicalizationHooks.shouldPreserveEmpty;\n\t/**\n\t* Family-shared structural validation: parse against the Mongo\n\t* contract arktype schema, then run framework-shared domain + Mongo\n\t* family storage checks, then hydrate the validated tree into Mongo\n\t* Contract IR class instances. Targets can override to add\n\t* target-specific structural checks; most targets accept the family\n\t* default.\n\t*\n\t* The returned `MongoContract` carries class instances under\n\t* `storage.namespaces[namespaceId].entries.collection[collectionName]` (each value is a\n\t* `MongoCollection`, with nested `MongoIndex` / `MongoValidator` /\n\t* `MongoCollectionOptions` constructed by the `MongoCollection` constructor).\n\t* The rest of the contract envelope (models, valueObjects, capabilities, …)\n\t* remains in plain-JSON form; those IR layers are handled by sibling\n\t* subsystems and don't sit behind this SPI.\n\t*/\n\tparseMongoContractStructure(json) {\n\t\tconst parsed = (this.contractSchema ?? MongoContractSchema)(json);\n\t\tif (parsed instanceof type.errors) throw structuredError(\"CONTRACT.VALIDATION_FAILED\", `Contract structural validation failed: ${parsed.summary}`);\n\t\tconst validatedShape = parsed;\n\t\tconst hydratedContract = this.hydrateMongoContract(withMongoToOneRelationNullability(validatedShape));\n\t\tvalidateContractDomain(hydratedContract);\n\t\tvalidateMongoStorage(hydratedContract);\n\t\treturn hydratedContract;\n\t}\n\t/**\n\t* Walk a structurally-validated Mongo contract and hydrate each namespace's\n\t* entries via the registered entity-kind descriptors. Unknown kinds throw (fail-closed),\n\t* preserving the existing Mongo serializer semantics.\n\t*/\n\thydrateMongoContract(contract) {\n\t\tconst rawNamespaces = contract.storage.namespaces;\n\t\tconst hydratedNamespaces = Object.fromEntries(Object.entries(rawNamespaces).map(([nsId, nsEnvelope]) => {\n\t\t\tconst hydratedEntries = hydrateNamespaceEntities(blindCast(nsEnvelope.entries), this.entryKinds, \"fail\", nsId);\n\t\t\treturn [nsId, {\n\t\t\t\t...nsEnvelope,\n\t\t\t\tid: nsEnvelope.id,\n\t\t\t\tentries: blindCast(hydratedEntries)\n\t\t\t}];\n\t\t}));\n\t\treturn {\n\t\t\t...contract,\n\t\t\tstorage: {\n\t\t\t\t...contract.storage,\n\t\t\t\tnamespaces: hydratedNamespaces\n\t\t\t}\n\t\t};\n\t}\n};\n//#endregion\n//#region src/core/ir/mongo-contract-serializer.ts\n/**\n* Default Mongo family `ContractSerializer` concretion. Inherits the\n* Mongo-shared deserialization pipeline (structural validation +\n* collection-level hydration) and falls through `constructTargetContract`\n* with the validated `MongoContract` shape. Family-level call sites\n* (family-instance methods, family-layer tests that don't reach into\n* a target descriptor) instantiate this directly; targets with their\n* own storage concretion (`target-mongo`'s `MongoTargetContractSerializer`)\n* override `constructTargetContract` to wrap the storage shape.\n*/\nvar MongoContractSerializer = class extends MongoContractSerializerBase {\n\tconstructTargetContract(validated) {\n\t\treturn validated;\n\t}\n};\n//#endregion\nexport { MongoContractSerializerBase as n, MongoContractSerializer as t };\n\n//# sourceMappingURL=mongo-contract-serializer-DC_DM9_Y.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,SAAS,kCAAkC,UAAU;CACpD,MAAM,SAAS,oCAAoC,SAAS,SAAS,EAAE,OAAO,eAAe;EAC5F,MAAM,EAAE,gBAAgB,WAAW,gCAAgC,OAAO,QAAQ;EAClF,OAAO;GACN,eAAe;GACf,uBAAuB,OAAO,KAAK,UAAU,MAAM,QAAQ;EAC5D;CACD,CAAC;CACD,OAAO;EACN,GAAG;EACH;CACD;AACD;AACA,IAAI,8BAA8B,MAAM;CACvC;CACA;CACA,YAAY,oBAAoB,kBAAkB,CAAC,GAAG;EACrD,KAAK,aAAa,wBAAwB,eAAe;EACzD,KAAK,iBAAiB,uBAAuB,KAAK,KAAK,mBAAmB,OAAO,IAAI,0BAA0B,kBAAkB,IAAI,KAAK;CAC3I;CACA,oBAAoB,MAAM;EACzB,MAAM,YAAY,KAAK,4BAA4B,IAAI;EACvD,OAAO,KAAK,wBAAwB,SAAS;CAC9C;CACA,kBAAkB,UAAU;EAC3B,OAAO;CACR;;;;;;;CAOA,sBAAsB,mCAAmC;;;;;;;;;;;;;;;;;CAiBzD,4BAA4B,MAAM;EACjC,MAAM,UAAU,KAAK,kBAAkB,oBAAA,CAAqB,IAAI;EAChE,IAAI,kBAAkB,KAAK,QAAQ,MAAM,gBAAgB,8BAA8B,0CAA0C,OAAO,SAAS;EACjJ,MAAM,iBAAiB;EACvB,MAAM,mBAAmB,KAAK,qBAAqB,kCAAkC,cAAc,CAAC;EACpG,uBAAuB,gBAAgB;EACvC,qBAAqB,gBAAgB;EACrC,OAAO;CACR;;;;;;CAMA,qBAAqB,UAAU;EAC9B,MAAM,gBAAgB,SAAS,QAAQ;EACvC,MAAM,qBAAqB,OAAO,YAAY,OAAO,QAAQ,aAAa,CAAC,CAAC,KAAK,CAAC,MAAM,gBAAgB;GACvG,MAAM,kBAAkB,yBAAyB,UAAU,WAAW,OAAO,GAAG,KAAK,YAAY,QAAQ,IAAI;GAC7G,OAAO,CAAC,MAAM;IACb,GAAG;IACH,IAAI,WAAW;IACf,SAAS,UAAU,eAAe;GACnC,CAAC;EACF,CAAC,CAAC;EACF,OAAO;GACN,GAAG;GACH,SAAS;IACR,GAAG,SAAS;IACZ,YAAY;GACb;EACD;CACD;AACD;;;;;;;;;;;AAaA,IAAI,0BAA0B,cAAc,4BAA4B;CACvE,wBAAwB,WAAW;EAClC,OAAO;CACR;AACD"}
@@ -1,5 +1,5 @@
1
- import { C as MongoContract } from "./mongo-value-set-tNn9-pun-dJYx_rVD.mjs";
2
- import { a as MongoContractView } from "./index-BUYcBNdw.mjs";
1
+ import { C as MongoContract } from "./mongo-value-set-BngSUlOh-BhDGXjM_.mjs";
2
+ import { a as MongoContractView } from "./index-b-S3URri.mjs";
3
3
  //#region ../../../2-mongo-family/9-family/dist/mongo-contract-view-AnejqfrQ.d.mts
4
4
  //#region src/core/ir/mongo-contract-view.d.ts
5
5
  /**
@@ -24,4 +24,4 @@ declare const MongoContractView$1: {
24
24
  };
25
25
  //#endregion
26
26
  export { MongoContractView$1 as t };
27
- //# sourceMappingURL=mongo-contract-view-AnejqfrQ-nd-SP6W4.d.mts.map
27
+ //# sourceMappingURL=mongo-contract-view-AnejqfrQ-DLhDjvsh.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mongo-contract-view-AnejqfrQ-nd-SP6W4.d.mts","names":[],"sources":["../../../../2-mongo-family/9-family/dist/mongo-contract-view-AnejqfrQ.d.mts"],"mappings":";;;;;;;;;;;;;;;;;KAeK,oBAAoB,kBAAkB,gBAAgB,iBAAiB,kBAAkB;cAChF;;EAEZ,KAAK,kBAAkB,eAAe,UAAU,YAAY,oBAAoB;;EAEhF,SAAS,kBAAkB,gBAAgB,eAAe,gBAAgB,oBAAoB"}
1
+ {"version":3,"file":"mongo-contract-view-AnejqfrQ-DLhDjvsh.d.mts","names":[],"sources":["../../../../2-mongo-family/9-family/dist/mongo-contract-view-AnejqfrQ.d.mts"],"mappings":";;;;;;;;;;;;;;;;;KAeK,oBAAoB,kBAAkB,gBAAgB,iBAAiB,kBAAkB;cAChF;;EAEZ,KAAK,kBAAkB,eAAe,UAAU,YAAY,oBAAoB;;EAEhF,SAAS,kBAAkB,gBAAgB,eAAe,gBAAgB,oBAAoB"}
@@ -1,5 +1,5 @@
1
- import { s as buildMongoContractView } from "./dist-B4a9eijw.mjs";
2
- import { t as MongoContractSerializer } from "./mongo-contract-serializer-DC_DM9_Y-MJjsJZwM.mjs";
1
+ import { s as buildMongoContractView } from "./dist-DsIID5AE.mjs";
2
+ import { t as MongoContractSerializer } from "./mongo-contract-serializer-DC_DM9_Y-CDk1Veya.mjs";
3
3
  //#region ../../../2-mongo-family/9-family/dist/mongo-contract-view-JZOa0Ry-.mjs
4
4
  const MongoContractView$1 = {
5
5
  /** Wrap an already-deserialized Mongo contract in a view. */
@@ -14,4 +14,4 @@ const MongoContractView$1 = {
14
14
  //#endregion
15
15
  export { MongoContractView$1 as t };
16
16
 
17
- //# sourceMappingURL=mongo-contract-view-JZOa0Ry--BTfPzsVC.mjs.map
17
+ //# sourceMappingURL=mongo-contract-view-JZOa0Ry--BL8lTjbw.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"mongo-contract-view-JZOa0Ry--BTfPzsVC.mjs","names":[],"sources":["../../../../2-mongo-family/9-family/dist/mongo-contract-view-JZOa0Ry-.mjs"],"sourcesContent":["import { t as MongoContractSerializer } from \"./mongo-contract-serializer-DC_DM9_Y.mjs\";\nimport { buildMongoContractView } from \"@internal/mongo-contract\";\n//#region src/core/ir/mongo-contract-view.ts\nconst MongoContractView$1 = {\n\t/** Wrap an already-deserialized Mongo contract in a view. */\n\tfrom(contract) {\n\t\treturn buildMongoContractView(contract);\n\t},\n\t/** Deserialize a Mongo contract JSON envelope and wrap it in a view. */\n\tfromJson(json) {\n\t\treturn buildMongoContractView(new MongoContractSerializer().deserializeContract(json));\n\t}\n};\n//#endregion\nexport { MongoContractView$1 as t };\n\n//# sourceMappingURL=mongo-contract-view-JZOa0Ry-.mjs.map"],"mappings":";;;AAGA,MAAM,sBAAsB;;CAE3B,KAAK,UAAU;EACd,OAAO,uBAAuB,QAAQ;CACvC;;CAEA,SAAS,MAAM;EACd,OAAO,uBAAuB,IAAI,wBAAwB,CAAC,CAAC,oBAAoB,IAAI,CAAC;CACtF;AACD"}
1
+ {"version":3,"file":"mongo-contract-view-JZOa0Ry--BL8lTjbw.mjs","names":[],"sources":["../../../../2-mongo-family/9-family/dist/mongo-contract-view-JZOa0Ry-.mjs"],"sourcesContent":["import { t as MongoContractSerializer } from \"./mongo-contract-serializer-DC_DM9_Y.mjs\";\nimport { buildMongoContractView } from \"@internal/mongo-contract\";\n//#region src/core/ir/mongo-contract-view.ts\nconst MongoContractView$1 = {\n\t/** Wrap an already-deserialized Mongo contract in a view. */\n\tfrom(contract) {\n\t\treturn buildMongoContractView(contract);\n\t},\n\t/** Deserialize a Mongo contract JSON envelope and wrap it in a view. */\n\tfromJson(json) {\n\t\treturn buildMongoContractView(new MongoContractSerializer().deserializeContract(json));\n\t}\n};\n//#endregion\nexport { MongoContractView$1 as t };\n\n//# sourceMappingURL=mongo-contract-view-JZOa0Ry-.mjs.map"],"mappings":";;;AAGA,MAAM,sBAAsB;;CAE3B,KAAK,UAAU;EACd,OAAO,uBAAuB,QAAQ;CACvC;;CAEA,SAAS,MAAM;EACd,OAAO,uBAAuB,IAAI,wBAAwB,CAAC,CAAC,oBAAoB,IAAI,CAAC;CACtF;AACD"}
@@ -1,7 +1,7 @@
1
1
  import { t as CollationOptions } from "./mongodb-types-B4HmhF1S.mjs";
2
- import { Contract, ContractModel, ControlPolicy, JsonValue, StorageBase } from "@prisma/orm-framework/contract/types";
3
2
  import { IRNodeBase, Namespace, UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
4
- //#region ../../../2-mongo-family/1-foundation/mongo-contract/dist/mongo-value-set-tNn9-pun.d.mts
3
+ import { Contract, ContractModel, ControlPolicy, JsonValue, StorageBase } from "@prisma/orm-framework/contract/types";
4
+ //#region ../../../2-mongo-family/1-foundation/mongo-contract/dist/mongo-value-set-BngSUlOh.d.mts
5
5
  //#region src/ir/mongo-collation-options.d.ts
6
6
  type MongoCollationCaseFirst = 'off' | 'upper' | 'lower';
7
7
  type MongoCollationStrength = 1 | 2 | 3 | 4 | 5;
@@ -533,4 +533,4 @@ declare class MongoValueSet extends IRNodeBase {
533
533
  }
534
534
  //#endregion
535
535
  export { MongoValidatorInput as $, MongoIndexKey as A, MongoModelStorage as B, MongoContract as C, MongoIndexFieldValue as D, MongoIndexAuthoringInput as E, MongoIndexOptionsInput as F, MongoTimeSeriesCollectionOptions as G, MongoStorageCappedShape as H, MongoJsonObject as I, MongoTypeMaps as J, MongoTimeSeriesCollectionOptionsInput as K, MongoJsonPrimitive as L, MongoIndexOptionDefaults as M, MongoIndexOptionDefaultsInput as N, MongoIndexFields as O, MongoIndexOptions as P, MongoValidator as Q, MongoJsonValue as R, MongoCollectionOptionsInput as S, MongoIndex as T, MongoStorageClusteredIndexShape as U, MongoModelsMap as V, MongoStorageShape as W, MongoUnboundFieldInputTypes as X, MongoTypeMapsPhantomKey as Y, MongoUnboundFieldOutputTypes as Z, MongoCollationStrength as _, ExtractMongoTypeMaps as a, RootModelName as at, MongoCollectionOptions as b, MongoChangeStreamPreAndPostImagesOptionsInput as c, MongoClusteredCollectionOptionsInput as d, MongoValidatorValidationAction as et, MongoCollationAlternate as f, MongoCollationOptionsInput as g, MongoCollationOptions as h, ExtractMongoFieldOutputTypes as i, MongoWildcardProjection as it, MongoIndexKeyDirection as j, MongoIndexInput as k, MongoClusteredCollectionKey as l, MongoCollationMaxVariable as m, ExtractMongoCodecTypes as n, MongoValueSet as nt, InferModelRow as o, MongoCollationCaseFirst as p, MongoTimeSeriesGranularity as q, ExtractMongoFieldInputTypes as r, MongoValueSetInput as rt, MongoChangeStreamPreAndPostImagesOptions as s, AnyMongoTypeMaps as t, MongoValidatorValidationLevel as tt, MongoClusteredCollectionOptions as u, MongoCollection as v, MongoContractWithTypeMaps as w, MongoCollectionOptionsAuthoringInput as x, MongoCollectionInput as y, MongoModelDefinition as z };
536
- //# sourceMappingURL=mongo-value-set-tNn9-pun-dJYx_rVD.d.mts.map
536
+ //# sourceMappingURL=mongo-value-set-BngSUlOh-BhDGXjM_.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mongo-value-set-tNn9-pun-dJYx_rVD.d.mts","names":[],"sources":["../../../../2-mongo-family/1-foundation/mongo-contract/dist/mongo-value-set-tNn9-pun.d.mts"],"mappings":";;;;;KAIK;KACA;KACA;KACA;;;;;;;;UAQK;WACC;WACA;WACA,YAAY;WACZ,WAAW;WACX;WACA,YAAY;WACZ,cAAc;WACd;WACA;;;;;;;;;;;;;;;;cAgBG,8BAA8B;WACjC;WACA;WACA;WACA,YAAY;WACZ,WAAW;WACX;WACA,YAAY;WACZ,cAAc;WACd;WACA;EACT,YAAY,SAAS;;;;;;;;;;UAUb;WACC;WACA;WACA,0BAA0B;WAC1B;WACA;WACA,UAAU,SAAS;WACnB;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,YAAY,wBAAwB;WACpC,qBAAqB;;;;;;;;;;;;cAYlB,0BAA0B;WAC7B;WACA;WACA;WACA,0BAA0B;WAC1B;WACA;WACA,UAAU,SAAS;WACnB;WACA;WACA;;WAEA;WACA;WACA;WACA;WACA;WACA,YAAY;WACZ,qBAAqB;EAC9B,YAAY,UAAU;;;;KAInB;KACA,mBAAmB,eAAe;KAClC;KACA,iBAAiB,8BAA8B,mBAAmB;KAClE;YACO,cAAc;;KAErB,0BAA0B,SAAS;;;;;;;KAOnC;WACM,QAAQ;WACR,UAAU;;KAEhB;UACK;WACC;WACA,WAAW;;KAEjB;WACM;WACA,YAAY;aACV;;;KAGR,uBAAuB,cAAc;KACrC,wBAAw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C,UAAU,cAAc,aAAa;WACrC,YAAY,iBAAiB;WAC7B,UAAU,yBAAyB;WACnC,UAAU;;;;;;;;;;;;;;;;;;;;;;cAsBP,wBAAwB;WAC3B;WACA,UAAU,cAAc;WACxB,YAAY;WACZ,UAAU;WACV,UAAU;EACnB,YAAY,QAAQ;;;;;;;;;UASZ;WACC;;WAEA,iBAAiB;;;;;;;;;;cAUd,sBAAsB;WACzB;WACA,iBAAiB;EAC1B,YAAY,OAAO"}
1
+ {"version":3,"file":"mongo-value-set-BngSUlOh-BhDGXjM_.d.mts","names":[],"sources":["../../../../2-mongo-family/1-foundation/mongo-contract/dist/mongo-value-set-BngSUlOh.d.mts"],"mappings":";;;;;KAIK;KACA;KACA;KACA;;;;;;;;UAQK;WACC;WACA;WACA,YAAY;WACZ,WAAW;WACX;WACA,YAAY;WACZ,cAAc;WACd;WACA;;;;;;;;;;;;;;;;cAgBG,8BAA8B;WACjC;WACA;WACA;WACA,YAAY;WACZ,WAAW;WACX;WACA,YAAY;WACZ,cAAc;WACd;WACA;EACT,YAAY,SAAS;;;;;;;;;;UAUb;WACC;WACA;WACA,0BAA0B;WAC1B;WACA;WACA,UAAU,SAAS;WACnB;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,YAAY,wBAAwB;WACpC,qBAAqB;;;;;;;;;;;;cAYlB,0BAA0B;WAC7B;WACA;WACA;WACA,0BAA0B;WAC1B;WACA;WACA,UAAU,SAAS;WACnB;WACA;WACA;;WAEA;WACA;WACA;WACA;WACA;WACA,YAAY;WACZ,qBAAqB;EAC9B,YAAY,UAAU;;;;KAInB;KACA,mBAAmB,eAAe;KAClC;KACA,iBAAiB,8BAA8B,mBAAmB;KAClE;YACO,cAAc;;KAErB,0BAA0B,SAAS;;;;;;;KAOnC;WACM,QAAQ;WACR,UAAU;;KAEhB;UACK;WACC;WACA,WAAW;;KAEjB;WACM;WACA,YAAY;aACV;;;KAGR,uBAAuB,cAAc;KACrC,wBAAwB,SAAS,eAAe,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aAAa;WACrC,YAAY,iBAAiB;WAC7B,UAAU,yBAAyB;WACnC,UAAU;;;;;;;;;;;;;;;;;;;;;;cAsBP,wBAAwB;WAC3B;WACA,UAAU,cAAc;WACxB,YAAY;WACZ,UAAU;WACV,UAAU;EACnB,YAAY,QAAQ;;;;;;;;;UASZ;WACC;;WAEA,iBAAiB;;;;;;;;;;cAUd,sBAAsB;WACzB;WACA,iBAAiB;EAC1B,YAAY,OAAO"}
package/dist/orm.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as MongoContract, V as MongoModelsMap, X as MongoUnboundFieldInputTypes, Z as MongoUnboundFieldOutputTypes, at as RootModelName, n as ExtractMongoCodecTypes, o as InferModelRow, t as AnyMongoTypeMaps, w as MongoContractWithTypeMaps, z as MongoModelDefinition } from "./mongo-value-set-tNn9-pun-dJYx_rVD.mjs";
2
- import { o as MongoMutationDefaults } from "./index-BUYcBNdw.mjs";
1
+ import { C as MongoContract, V as MongoModelsMap, X as MongoUnboundFieldInputTypes, Z as MongoUnboundFieldOutputTypes, at as RootModelName, n as ExtractMongoCodecTypes, o as InferModelRow, t as AnyMongoTypeMaps, w as MongoContractWithTypeMaps, z as MongoModelDefinition } from "./mongo-value-set-BngSUlOh-BhDGXjM_.mjs";
2
+ import { s as MongoMutationDefaults } from "./index-b-S3URri.mjs";
3
3
  import { c as MongoValue, t as Document } from "./index-wKMm41HC.mjs";
4
4
  import { B as MongoFilterExpr, rt as MongoQueryPlan } from "./query-plan-C0-Yu8hf-DdilEdW6.mjs";
5
5
  import "./execution-CKnUiOfm.mjs";
package/dist/orm.mjs CHANGED
@@ -1,14 +1,14 @@
1
1
  import { t as MongoParamRef } from "./dist-C7Ykq48Q.mjs";
2
2
  import { a as MongoFieldFilter, c as isMongoFilterExpr, t as MongoAndExpr } from "./filter-expressions-Uo8ZdzwB-53qnqceS.mjs";
3
3
  import { $ as RawInsertOneCommand, A as MongoLookupStage, G as MongoUnwindStage, J as RawDeleteManyCommand, P as MongoProjectStage, Q as RawInsertManyCommand, U as MongoSortStage, V as MongoSkipStage, X as RawFindOneAndDeleteCommand, Y as RawDeleteOneCommand, Z as RawFindOneAndUpdateCommand, a as FindOneAndUpdateCommand, at as freezeMongoResultShape, et as RawUpdateManyCommand, i as FindOneAndDeleteCommand, j as MongoMatchStage, k as MongoLimitStage, n as DeleteManyCommand, nt as UpdateManyCommand, o as InsertManyCommand, q as RawAggregateCommand, s as InsertOneCommand, t as AggregateCommand, tt as RawUpdateOneCommand } from "./execution-D5XyZ5XS.mjs";
4
- import { a as contractFieldToMongoFieldShape, o as contractModelToMongoResultShape } from "./dist-Dyp05u64.mjs";
4
+ import { a as contractFieldToMongoFieldShape, o as contractModelToMongoResultShape } from "./dist-C_TI9T_n.mjs";
5
5
  import { structuredError } from "@prisma/orm-framework/utils/structured-error";
6
- import { domainModelsAtDefaultNamespace, domainValueObjectsAtDefaultNamespace } from "@prisma/orm-framework/contract/types";
7
6
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
7
+ import { domainModelsAtDefaultNamespace, domainValueObjectsAtDefaultNamespace } from "@prisma/orm-framework/contract/types";
8
8
  import { AsyncIterableResult } from "@prisma/orm-framework/components/runtime";
9
9
  import { blindCast, castAs } from "@prisma/orm-framework/utils/casts";
10
- import { ifDefined } from "@prisma/orm-framework/utils/defined";
11
10
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
11
+ import { ifDefined } from "@prisma/orm-framework/utils/defined";
12
12
  //#region ../../../2-mongo-family/5-query-builders/orm/dist/index.mjs
13
13
  function emptyCollectionState() {
14
14
  return {
@@ -1,5 +1,5 @@
1
- import { A as MongoIndexKey, j as MongoIndexKeyDirection } from "./mongo-value-set-tNn9-pun-dJYx_rVD.mjs";
1
+ import { A as MongoIndexKey, j as MongoIndexKeyDirection } from "./mongo-value-set-BngSUlOh-BhDGXjM_.mjs";
2
2
  import { $ as MongoOutStage, A as MongoCountStage, At as RawUpdateManyCommand, B as MongoFilterExpr, C as MongoAggReduce, Ct as RawDeleteManyCommand, Dt as RawInsertManyCommand, E as MongoAndExpr, Et as RawFindOneAndUpdateCommand, F as MongoFacetStage, Ft as freezeMongoResultShape, G as MongoGroupId, H as MongoFilterVisitor, I as MongoFieldFilter, It as isExprArray, J as MongoLookupStage, K as MongoGroupStage, L as MongoFieldShape, Lt as isMongoFilterExpr, M as MongoDensifyStage, Mt as UpdateManyCommand, N as MongoExistsExpr, Nt as UpdateOneCommand, O as MongoBucketAutoStage, Ot as RawInsertOneCommand, P as MongoExprFilter, Pt as freezeMongoFieldShape, Q as MongoOrExpr, R as MongoFillOutput, Rt as isRecordArgs, S as MongoAggOperator, St as RawAggregateCommand, T as MongoAggSwitchBranch, Tt as RawFindOneAndDeleteCommand, U as MongoGeoNearStage, V as MongoFilterRewriter, W as MongoGraphLookupStage, X as MongoMergeStage, Y as MongoMatchStage, Z as MongoNotExpr, _ as MongoAggFieldRef, _t as MongoUnwindStage, a as DeleteOneCommand, at as MongoReplaceRootStage, b as MongoAggMap, bt as MongoVectorSearchStage, c as InsertManyCommand, ct as MongoSearchMetaStage, d as MongoAggAccumulator, dt as MongoSkipStage, et as MongoPipelineStage, f as MongoAggArrayFilter, ft as MongoSortByCountStage, g as MongoAggExprVisitor, gt as MongoUnionWithStage, h as MongoAggExprRewriter, ht as MongoStageVisitor, i as DeleteManyCommand, it as MongoRedactStage, j as MongoDensifyRange, jt as RawUpdateOneCommand, k as MongoBucketStage, kt as RawMongoCommand, l as InsertOneCommand, lt as MongoSearchStage, m as MongoAggExpr, mt as MongoStageRewriterContext, n as AggregateCommand, nt as MongoProjectionValue, o as FindOneAndDeleteCommand, ot as MongoResultShape, p as MongoAggCond, pt as MongoSortStage, q as MongoLimitStage, r as AnyMongoCommand, rt as MongoQueryPlan, s as FindOneAndUpdateCommand, st as MongoSampleStage, t as AggRecordArgs, tt as MongoProjectStage, u as MongoAddFieldsStage, ut as MongoSetWindowFieldsStage, v as MongoAggLet, vt as MongoUpdatePipelineStage, w as MongoAggSwitch, wt as RawDeleteOneCommand, x as MongoAggMergeObjects, xt as MongoWindowField, y as MongoAggLiteral, yt as MongoUpdateSpec, z as MongoFillStage } from "./query-plan-C0-Yu8hf-DdilEdW6.mjs";
3
- import { C as keysToKeySpec, S as defaultMongoIndexName, _ as MongoInspectionCommandVisitor, a as CollModOptions, b as MongoMigrationStep, c as CreateIndexCommand, d as DropIndexCommand, f as ListCollectionsCommand, g as MongoDdlCommandVisitor, h as MongoDataTransformOperation, i as CollModCommand, l as CreateIndexOptions, m as MongoDataTransformCheck, n as AnyMongoInspectionCommand, o as CreateCollectionCommand, p as ListIndexesCommand, r as AnyMongoMigrationOperation, s as CreateCollectionOptions, t as AnyMongoDdlCommand, u as DropCollectionCommand, v as MongoMigrationCheck, x as buildIndexOpId, y as MongoMigrationPlanOperation } from "./control-9Vd-XWkM.mjs";
3
+ import { C as keysToKeySpec, S as defaultMongoIndexName, _ as MongoInspectionCommandVisitor, a as CollModOptions, b as MongoMigrationStep, c as CreateIndexCommand, d as DropIndexCommand, f as ListCollectionsCommand, g as MongoDdlCommandVisitor, h as MongoDataTransformOperation, i as CollModCommand, l as CreateIndexOptions, m as MongoDataTransformCheck, n as AnyMongoInspectionCommand, o as CreateCollectionCommand, p as ListIndexesCommand, r as AnyMongoMigrationOperation, s as CreateCollectionOptions, t as AnyMongoDdlCommand, u as DropCollectionCommand, v as MongoMigrationCheck, x as buildIndexOpId, y as MongoMigrationPlanOperation } from "./control-BXKlnxAS.mjs";
4
4
  import { a as InsertOneResult, c as UpdateResult, i as InsertManyResult, n as DeleteOneResult, o as UpdateManyResult, r as DeleteResult, s as UpdateOneResult, t as DeleteManyResult } from "./execution-CKnUiOfm.mjs";
5
5
  export { type AggRecordArgs, AggregateCommand, type AnyMongoCommand, type AnyMongoDdlCommand, type AnyMongoInspectionCommand, type AnyMongoMigrationOperation, CollModCommand, type CollModOptions, CreateCollectionCommand, type CreateCollectionOptions, CreateIndexCommand, type CreateIndexOptions, DeleteManyCommand, type DeleteManyResult, DeleteOneCommand, type DeleteOneResult, type DeleteResult, DropCollectionCommand, DropIndexCommand, FindOneAndDeleteCommand, FindOneAndUpdateCommand, InsertManyCommand, type InsertManyResult, InsertOneCommand, type InsertOneResult, ListCollectionsCommand, ListIndexesCommand, MongoAddFieldsStage, MongoAggAccumulator, MongoAggArrayFilter, MongoAggCond, type MongoAggExpr, type MongoAggExprRewriter, type MongoAggExprVisitor, MongoAggFieldRef, MongoAggLet, MongoAggLiteral, MongoAggMap, MongoAggMergeObjects, MongoAggOperator, MongoAggReduce, MongoAggSwitch, type MongoAggSwitchBranch, MongoAndExpr, MongoBucketAutoStage, MongoBucketStage, MongoCountStage, type MongoDataTransformCheck, type MongoDataTransformOperation, type MongoDdlCommandVisitor, type MongoDensifyRange, MongoDensifyStage, MongoExistsExpr, MongoExprFilter, MongoFacetStage, MongoFieldFilter, type MongoFieldShape, type MongoFillOutput, MongoFillStage, type MongoFilterExpr, type MongoFilterRewriter, type MongoFilterVisitor, MongoGeoNearStage, MongoGraphLookupStage, type MongoGroupId, MongoGroupStage, type MongoIndexKey, type MongoIndexKeyDirection, type MongoInspectionCommandVisitor, MongoLimitStage, MongoLookupStage, MongoMatchStage, MongoMergeStage, type MongoMigrationCheck, type MongoMigrationPlanOperation, type MongoMigrationStep, MongoNotExpr, MongoOrExpr, MongoOutStage, type MongoPipelineStage, MongoProjectStage, type MongoProjectionValue, type MongoQueryPlan, MongoRedactStage, MongoReplaceRootStage, type MongoResultShape, MongoSampleStage, MongoSearchMetaStage, MongoSearchStage, MongoSetWindowFieldsStage, MongoSkipStage, MongoSortByCountStage, MongoSortStage, type MongoStageRewriterContext, type MongoStageVisitor, MongoUnionWithStage, MongoUnwindStage, type MongoUpdatePipelineStage, type MongoUpdateSpec, MongoVectorSearchStage, type MongoWindowField, RawAggregateCommand, RawDeleteManyCommand, RawDeleteOneCommand, RawFindOneAndDeleteCommand, RawFindOneAndUpdateCommand, RawInsertManyCommand, RawInsertOneCommand, type RawMongoCommand, RawUpdateManyCommand, RawUpdateOneCommand, UpdateManyCommand, type UpdateManyResult, UpdateOneCommand, type UpdateOneResult, type UpdateResult, buildIndexOpId, defaultMongoIndexName, freezeMongoFieldShape, freezeMongoResultShape, isExprArray, isMongoFilterExpr, isRecordArgs, keysToKeySpec };