@prisma/orm-family-mongo 8.0.0-rc.8-dev.2 → 8.0.0-rc.8-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__provider.mjs +1 -1
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/{interpreter-BxbUTQ3k-ClR98Ned.mjs → interpreter-O09WlHk7-BiV9gBae.mjs} +494 -363
- package/dist/interpreter-O09WlHk7-BiV9gBae.mjs.map +1 -0
- package/package.json +19 -19
- package/dist/interpreter-BxbUTQ3k-ClR98Ned.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpreter-O09WlHk7-BiV9gBae.mjs","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-psl/dist/interpreter-O09WlHk7.mjs"],"sourcesContent":["import { MongoIndex, MongoStorage, MongoValidator, applyPolymorphicScopeToMongoIndex, buildMongoNamespace } from \"@internal/mongo-contract\";\nimport { computeProfileHash, computeStorageHash } from \"@internal/contract/hashing\";\nimport { crossRef } from \"@internal/contract/types\";\nimport { errorEnumCodecNotInPackStack } from \"@internal/errors/control\";\nimport { instantiateAuthoringEntityType, isAuthoringEntityTypeDescriptor } from \"@internal/framework-components/authoring\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { mongoContractCanonicalizationHooks } from \"@internal/mongo-contract/canonicalization-hooks\";\nimport { bool, entityRef, fieldAttribute, fieldRef, funcCall, identifier, int, interpretAttribute, json, list, modelAttribute, nodePslSpan, num, oneOf, optional, record, str } from \"@internal/psl-parser\";\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\nfunction resolveBsonType(codecId, codecLookup) {\n\treturn codecLookup?.targetTypesFor(codecId)?.[0];\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) return void 0;\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/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 buildModelInterpretCtx(input) {\n\treturn {\n\t\tlevel: \"model\",\n\t\tsourceId: input.sourceId,\n\t\tsourceFile: input.sourceFile,\n\t\tselfModel: input.selfModel,\n\t\tresolveReferencedModel: () => void 0\n\t};\n}\nfunction buildFieldInterpretCtx(input) {\n\treturn {\n\t\tlevel: \"field\",\n\t\tsourceId: input.sourceId,\n\t\tsourceFile: input.sourceFile,\n\t\tselfModel: input.selfModel,\n\t\tresolveReferencedModel: input.resolveReferencedModel ?? (() => void 0),\n\t\tfield: input.field\n\t};\n}\nfunction interpretModelAttribute(input) {\n\tconst result = interpretAttribute(input.node, input.spec, buildModelInterpretCtx({\n\t\tselfModel: input.model,\n\t\tsourceFile: input.sourceFile,\n\t\tsourceId: input.sourceId\n\t}));\n\tif (!result.ok) {\n\t\tfor (const failure of result.failure) input.diagnostics.push(failure);\n\t\treturn;\n\t}\n\treturn result.value;\n}\nfunction interpretFieldAttribute(input) {\n\tconst result = interpretAttribute(input.node, input.spec, buildFieldInterpretCtx({\n\t\tselfModel: input.model,\n\t\tfield: input.field,\n\t\tsourceFile: input.sourceFile,\n\t\tsourceId: input.sourceId,\n\t\tresolveReferencedModel: input.resolveReferencedModel\n\t}));\n\tif (!result.ok) {\n\t\tfor (const failure of result.failure) input.diagnostics.push(failure);\n\t\treturn;\n\t}\n\treturn result.value;\n}\nconst mapModelSpec = modelAttribute(\"map\", { positional: [{\n\tkey: \"name\",\n\ttype: str()\n}] });\nconst mapFieldSpec = fieldAttribute(\"map\", { positional: [{\n\tkey: \"name\",\n\ttype: str()\n}] });\nconst relationFieldSpec = fieldAttribute(\"relation\", {\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: optional(str())\n\t}],\n\tnamed: {\n\t\tname: optional(str()),\n\t\tfields: optional(list(fieldRef(\"self\"), {\n\t\t\tnonEmpty: true,\n\t\t\tunique: true\n\t\t})),\n\t\treferences: optional(list(fieldRef(\"referenced\"), {\n\t\t\tnonEmpty: true,\n\t\t\tunique: true\n\t\t}))\n\t}\n});\nconst discriminatorModelSpec = modelAttribute(\"discriminator\", { positional: [{\n\tkey: \"field\",\n\ttype: fieldRef(\"self\")\n}] });\nconst baseModelSpec = modelAttribute(\"base\", { positional: [{\n\tkey: \"base\",\n\ttype: entityRef()\n}, {\n\tkey: \"value\",\n\ttype: str()\n}] });\nconst sortSig = { named: { sort: oneOf(identifier(\"Asc\"), identifier(\"Desc\")) } };\nfunction indexFieldElement(fieldNames) {\n\treturn oneOf(...[\n\t\tfieldRef(\"self\"),\n\t\tfuncCall(\"wildcard\", { positional: [{\n\t\t\tkey: \"scope\",\n\t\t\ttype: optional(entityRef())\n\t\t}] }),\n\t\t...fieldNames.map((name) => funcCall(name, sortSig))\n\t]);\n}\nconst collationNamedArgs = {\n\tcollationLocale: optional(str()),\n\tcollationStrength: optional(oneOf(num(1), num(2), num(3), num(4), num(5))),\n\tcollationCaseLevel: optional(bool()),\n\tcollationCaseFirst: optional(oneOf(str(\"upper\"), str(\"lower\"), str(\"off\"))),\n\tcollationNumericOrdering: optional(bool()),\n\tcollationAlternate: optional(oneOf(str(\"non-ignorable\"), str(\"shifted\"))),\n\tcollationMaxVariable: optional(oneOf(str(\"punct\"), str(\"space\"))),\n\tcollationBackwards: optional(bool()),\n\tcollationNormalization: optional(bool())\n};\nfunction buildIndexModelSpec(name, fieldElement) {\n\treturn modelAttribute(name, {\n\t\tpositional: [{\n\t\t\tkey: \"fields\",\n\t\t\ttype: list(fieldElement, { nonEmpty: true })\n\t\t}],\n\t\tnamed: {\n\t\t\ttype: optional(oneOf(num(1), num(-1), str(\"text\"), str(\"2dsphere\"), str(\"2d\"), str(\"hashed\"))),\n\t\t\tsparse: optional(bool()),\n\t\t\texpireAfterSeconds: optional(int()),\n\t\t\tfilter: optional(json()),\n\t\t\tinclude: optional(list(str())),\n\t\t\texclude: optional(list(str())),\n\t\t\tdefault_language: optional(str()),\n\t\t\tlanguageOverride: optional(str()),\n\t\t\t...collationNamedArgs\n\t\t}\n\t});\n}\nfunction buildTextIndexModelSpec(fieldElement) {\n\treturn modelAttribute(\"textIndex\", {\n\t\tpositional: [{\n\t\t\tkey: \"fields\",\n\t\t\ttype: list(fieldElement, { nonEmpty: true })\n\t\t}],\n\t\tnamed: {\n\t\t\tfilter: optional(json()),\n\t\t\tweights: optional(record(int({\n\t\t\t\tmin: 1,\n\t\t\t\tmax: 99999\n\t\t\t}))),\n\t\t\tlanguage: optional(str()),\n\t\t\tlanguageOverride: optional(str()),\n\t\t\t...collationNamedArgs\n\t\t}\n\t});\n}\nfunction buildIndexModelSpecs(fieldNames) {\n\tconst fieldElement = indexFieldElement(fieldNames);\n\treturn {\n\t\tindex: buildIndexModelSpec(\"index\", fieldElement),\n\t\tunique: buildIndexModelSpec(\"unique\", fieldElement),\n\t\ttextIndex: buildTextIndexModelSpec(fieldElement)\n\t};\n}\n//#endregion\n//#region src/psl-helpers.ts\nfunction lowerFirst(value) {\n\tif (value.length === 0) return value;\n\treturn value[0]?.toLowerCase() + value.slice(1);\n}\nfunction getAttribute(attributes, name) {\n\treturn attributes.find((attr) => attr.name === name);\n}\n//#endregion\n//#region src/interpreter.ts\n/**\n* Encode an authored enum value to its codec-encoded JSON form via the codec resolved by id from the\n* contract's codec lookup, so a non-identity `encodeJson` (permitted by the `mongoCodec` factory) is\n* respected. Matches the TS builder's `encodeEnumValue`: the lookup is always threaded in production,\n* and a codecId the lookup cannot resolve is a hard error — the enum uses a codec that is not part of\n* the contract's pack stack.\n*/\nfunction encodeEnumValue(value, codecId, codecLookup) {\n\tconst codec = codecLookup.get(codecId);\n\tif (!codec) throw errorEnumCodecNotInPackStack({ codecId });\n\treturn codec.encodeJson(value);\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) 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\tsourceId: input.sourceId,\n\t\tspan: nodePslSpan(namespace.node.syntax, input.sourceFile)\n\t});\n}\nfunction fkRelationPairKey(declaringModel, targetModel) {\n\treturn `${declaringModel}::${targetModel}`;\n}\nfunction resolveFieldMappings(input) {\n\tconst { model, sourceFile, sourceId, 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\tnode: mapNode,\n\t\t\tspec: mapFieldSpec,\n\t\t\tmodel,\n\t\t\tfield,\n\t\t\tsourceFile,\n\t\t\tsourceId,\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, sourceFile, sourceId, diagnostics } = input;\n\tconst mapNode = findModelAttributeNode(model, \"map\");\n\treturn (mapNode ? interpretModelAttribute({\n\t\tnode: mapNode,\n\t\tspec: mapModelSpec,\n\t\tmodel,\n\t\tsourceFile,\n\t\tsourceId,\n\t\tdiagnostics\n\t})?.name : void 0) ?? lowerFirst(model.name);\n}\nfunction mongoCrossRef(modelName) {\n\treturn crossRef(modelName, UNBOUND_NAMESPACE_ID);\n}\nfunction collectPolymorphismDeclarations(models, modelMetadataByName, sourceFile, sourceId, diagnostics) {\n\tconst discriminatorDeclarations = /* @__PURE__ */ new Map();\n\tconst baseDeclarations = /* @__PURE__ */ new Map();\n\tfor (const model of models) {\n\t\tconst discNode = findModelAttributeNode(model, \"discriminator\");\n\t\tif (discNode) {\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tnode: discNode,\n\t\t\t\tspec: discriminatorModelSpec,\n\t\t\t\tmodel,\n\t\t\t\tsourceFile,\n\t\t\t\tsourceId,\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\tsourceId,\n\t\t\t\t\tspan: nodePslSpan(discNode.syntax, sourceFile)\n\t\t\t\t});\n\t\t\t\telse discriminatorDeclarations.set(model.name, {\n\t\t\t\t\tfieldName,\n\t\t\t\t\tspan: nodePslSpan(discNode.syntax, sourceFile)\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\tnode: baseNode,\n\t\t\t\tspec: baseModelSpec,\n\t\t\t\tmodel,\n\t\t\t\tsourceFile,\n\t\t\t\tsourceId,\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 ?? lowerFirst(model.name);\n\t\t\t\tbaseDeclarations.set(model.name, {\n\t\t\t\t\tbaseName: parsed.base,\n\t\t\t\t\tvalue: parsed.value,\n\t\t\t\t\tcollectionName,\n\t\t\t\t\tspan: nodePslSpan(baseNode.syntax, sourceFile)\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, modelNames, modelMetadataByName, sourceId, allModels: allModelViews, indexSpans, modelIndexesByName } = input;\n\tlet patched = input.models;\n\tlet roots = input.roots;\n\tlet collections = input.collections;\n\tconst diagnostics = [];\n\tfor (const [modelName, decl] of discriminatorDeclarations) {\n\t\tif (baseDeclarations.has(modelName)) {\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\tsourceId,\n\t\t\t\tspan: 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\tsourceId,\n\t\t\t\tspan: decl.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst variants = {};\n\t\tfor (const [variantName, baseDecl] of baseDeclarations) {\n\t\t\tif (baseDecl.baseName !== modelName) continue;\n\t\t\tvariants[variantName] = { 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\tsourceId,\n\t\t\t\tspan: 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 [variantName, baseDecl] of baseDeclarations) {\n\t\tif (!modelNames.has(baseDecl.baseName)) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_BASE_TARGET_NOT_FOUND\",\n\t\t\t\tmessage: `Model \"${variantName}\" @@base references non-existent model \"${baseDecl.baseName}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: baseDecl.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (!discriminatorDeclarations.has(baseDecl.baseName)) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_ORPHANED_BASE\",\n\t\t\t\tmessage: `Model \"${variantName}\" declares @@base(${baseDecl.baseName}, ...) but \"${baseDecl.baseName}\" has no @@discriminator`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: baseDecl.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (discriminatorDeclarations.has(variantName)) continue;\n\t\tconst baseModel = patched[baseDecl.baseName];\n\t\tconst variantModelView = allModelViews.find((m) => m.name === variantName);\n\t\tif (!variantModelView) continue;\n\t\tif (getAttribute(variantModelView.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 \"${baseDecl.baseName}\". Mongo only supports single-collection polymorphism.`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: 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(baseDecl.baseName),\n\t\t\t\tstorage: { collection: baseCollection }\n\t\t\t}\n\t\t};\n\t\tconst variantCollectionName = modelMetadataByName.get(variantName)?.collectionName ?? lowerFirst(variantName);\n\t\tif (roots[variantCollectionName]?.model === variantName) if (variantCollectionName === baseCollection && baseModel) roots = {\n\t\t\t...roots,\n\t\t\t[variantCollectionName]: mongoCrossRef(baseDecl.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[baseDecl.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\tsourceId,\n\t\t\t\t\tspan\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\tsourceId: ctx.sourceId,\n\t\t\tspan: 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\tsourceId: ctx.sourceId,\n\t\t\t\tspan: 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\tsourceId: ctx.sourceId,\n\t\t\tspan: 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\tsourceId: ctx.sourceId,\n\t\t\tspan: 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\tsourceId: ctx.sourceId,\n\t\t\tspan: 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\tsourceId: ctx.sourceId,\n\t\t\tspan: 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\tsourceId: ctx.sourceId,\n\t\t\tspan: 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\tsourceId: ctx.sourceId,\n\t\t\tspan: 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\tsourceId: ctx.sourceId,\n\t\t\tspan: 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\tsourceId: ctx.sourceId,\n\t\t\tspan: 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\tsourceId: ctx.sourceId,\n\t\t\tspan: 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, fieldMappings, modelNames, sourceId, sourceFile, diagnostics, indexSpans) {\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 uniqueAttr = getAttribute(field.attributes, \"unique\");\n\t\tif (!uniqueAttr) 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, uniqueAttr.span);\n\t}\n\tconst specs = buildIndexModelSpecs(Object.keys(pslModel.fields));\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 ctx = {\n\t\t\tpslModel,\n\t\t\tfieldMappings,\n\t\t\tindexableFieldNames,\n\t\t\tsourceId,\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\tnode,\n\t\t\t\tspec: specs.textIndex,\n\t\t\t\tmodel: pslModel,\n\t\t\t\tsourceFile,\n\t\t\t\tsourceId,\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\tsourceId,\n\t\t\t\t\tspan: 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\tnode,\n\t\t\t\tspec: unique ? specs.unique : specs.index,\n\t\t\t\tmodel: pslModel,\n\t\t\t\tsourceFile,\n\t\t\t\tsourceId,\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}\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}\nfunction resolveNonRelationField(field, ownerName, compositeTypeNames, scalarTypeCodecIds, codecIdByEnumName, sourceId, diagnostics) {\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.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.list ? {\n\t\t\t...result,\n\t\t\tmany: true\n\t\t} : result;\n\t}\n\tif (field.malformedType) return;\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\tsourceId,\n\t\t\tspan: field.span\n\t\t});\n\t\treturn;\n\t}\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.list ? {\n\t\t...result,\n\t\tmany: true\n\t} : result;\n}\nfunction processEnumDeclarations(input) {\n\tconst builtEnums = {};\n\tif (input.enumBlocks.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 decl of input.enumBlocks) input.diagnostics.push({\n\t\t\tcode: \"PSL_ENUM_MISSING_FACTORY\",\n\t\t\tmessage: `enum \"${decl.name}\" requires an \"enum\" entityType factory in the active authoring contributions`,\n\t\t\tsourceId: input.sourceId,\n\t\t\tspan: decl.span\n\t\t});\n\t\treturn builtEnums;\n\t}\n\tfor (const decl of input.enumBlocks) {\n\t\tconst handle = instantiateAuthoringEntityType(\"enum\", enumDescriptor, [decl], input.entityContext);\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, sourceFile, scalarTypeCodecIds, codecLookup } = input;\n\tconst sourceId = input.sourceId;\n\tconst diagnostics = [...input.seedDiagnostics ?? []];\n\tconst topLevel = symbolTable.topLevel;\n\tvalidateNamespaceBlocksForMongoTarget({\n\t\tnamespaces: Object.values(topLevel.namespaces),\n\t\tsourceId,\n\t\tsourceFile,\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 modelMetadataByName = /* @__PURE__ */ new Map();\n\tfor (const model of allModels) modelMetadataByName.set(model.name, {\n\t\tcollectionName: resolveCollectionName({\n\t\t\tmodel,\n\t\t\tsourceFile,\n\t\t\tsourceId,\n\t\t\tdiagnostics\n\t\t}),\n\t\tfieldMappings: resolveFieldMappings({\n\t\t\tmodel,\n\t\t\tsourceFile,\n\t\t\tsourceId,\n\t\t\tdiagnostics\n\t\t})\n\t});\n\tconst builtEnums = processEnumDeclarations({\n\t\tenumBlocks: Object.values(topLevel.blocks).filter((b) => b.keyword === \"enum\").map((b) => b.block),\n\t\tsourceId,\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\tsourceId,\n\t\t\tdiagnostics: { push: (d) => {\n\t\t\t\tdiagnostics.push(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 modelIndexesByName = /* @__PURE__ */ new Map();\n\tconst backrelationCandidates = [];\n\tfor (const pslModel of allModels) {\n\t\tconst metadata = modelMetadataByName.get(pslModel.name);\n\t\tif (!metadata) continue;\n\t\tconst { collectionName, fieldMappings } = metadata;\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\tnode: relationNode,\n\t\t\t\t\tspec: relationFieldSpec,\n\t\t\t\t\tmodel: pslModel,\n\t\t\t\t\tfield,\n\t\t\t\t\tsourceFile,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tdiagnostics,\n\t\t\t\t\tresolveReferencedModel: () => allModels.find((m) => m.name === field.typeName)\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\tfieldName: field.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});\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\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\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\tfieldName: field.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, pslModel.name, compositeTypeNames, scalarTypeCodecIds, codecIdByEnumName, sourceId, diagnostics);\n\t\t\tif (!resolved) continue;\n\t\t\tconst mappedName = fieldMappings.pslNameToMapped.get(field.name) ?? field.name;\n\t\t\tfields[mappedName] = resolved;\n\t\t}\n\t\tconst isVariantModel = pslModel.attributes.some((attr) => attr.name === \"base\");\n\t\tconst hasIdField = Object.values(pslModel.fields).some((f) => getAttribute(f.attributes, \"id\") !== void 0);\n\t\tif (!isVariantModel) if (!hasIdField) diagnostics.push({\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\tsourceId\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.push({\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\tsourceId\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, fieldMappings, modelNames, sourceId, sourceFile, diagnostics, indexSpans);\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, compositeType.name, compositeTypeNames, scalarTypeCodecIds, codecIdByEnumName, sourceId, diagnostics);\n\t\t\tif (!resolved) continue;\n\t\t\tfields[field.name] = resolved;\n\t\t}\n\t\tvalueObjects[compositeType.name] = { fields };\n\t}\n\tconst fkRelationsByPair = /* @__PURE__ */ new Map();\n\tfor (const fk of allFkRelations) {\n\t\tconst key = fkRelationPairKey(fk.declaringModel, fk.targetModel);\n\t\tconst existing = fkRelationsByPair.get(key);\n\t\tif (existing) existing.push(fk);\n\t\telse fkRelationsByPair.set(key, [fk]);\n\t}\n\tfor (const candidate of backrelationCandidates) {\n\t\tconst pairKey = fkRelationPairKey(candidate.targetModelName, candidate.modelName);\n\t\tconst pairMatches = fkRelationsByPair.get(pairKey) ?? [];\n\t\tconst matches = candidate.relationName ? pairMatches.filter((r) => r.relationName === candidate.relationName) : [...pairMatches];\n\t\tif (matches.length === 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_ORPHANED_BACKRELATION\",\n\t\t\t\tmessage: `Backrelation list field \"${candidate.modelName}.${candidate.fieldName}\" has no matching FK-side relation on model \"${candidate.targetModelName}\". Add @relation(fields: [...], references: [...]) on the FK-side relation or use an explicit join model for many-to-many.`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: candidate.field.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (matches.length > 1) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_AMBIGUOUS_BACKRELATION\",\n\t\t\t\tmessage: `Backrelation list field \"${candidate.modelName}.${candidate.fieldName}\" matches multiple FK-side relations on model \"${candidate.targetModelName}\". Add @relation(\"...\") to both sides to disambiguate.`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: candidate.field.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst fk = matches[0];\n\t\tif (!fk) continue;\n\t\tconst modelEntry = models[candidate.modelName];\n\t\tif (!modelEntry) continue;\n\t\tmodelEntry.relations[candidate.fieldName] = {\n\t\t\tto: mongoCrossRef(candidate.targetModelName),\n\t\t\tcardinality: candidate.cardinality,\n\t\t\ton: {\n\t\t\t\tlocalFields: fk.targetFields,\n\t\t\t\ttargetFields: fk.localFields\n\t\t\t}\n\t\t};\n\t}\n\tconst { discriminatorDeclarations, baseDeclarations } = collectPolymorphismDeclarations(allModels, modelMetadataByName, sourceFile, sourceId, diagnostics);\n\tconst polyResult = resolvePolymorphism({\n\t\tmodels,\n\t\troots,\n\t\tcollections,\n\t\tallModels,\n\t\tdiscriminatorDeclarations,\n\t\tbaseDeclarations,\n\t\tmodelNames,\n\t\tindexSpans,\n\t\tmodelIndexesByName,\n\t\tmodelMetadataByName,\n\t\tsourceId\n\t});\n\tif (diagnostics.length > 0 || polyResult.diagnostics.length > 0) return notOk({\n\t\tsummary: \"PSL to Mongo contract interpretation failed\",\n\t\tdiagnostics: [...diagnostics, ...polyResult.diagnostics]\n\t});\n\tconst resolvedModels = polyResult.models;\n\tconst resolvedCollections = polyResult.collections;\n\tconst storageValueSets = {};\n\tconst enumEntries = Object.entries(builtEnums);\n\tif (enumEntries.length > 0) {\n\t\tassertDefined(codecLookup, \"Mongo PSL interpretation requires a codec lookup to encode enum values\");\n\t\tfor (const [enumName, builtEnum] of enumEntries) storageValueSets[enumName] = {\n\t\t\tkind: \"valueSet\",\n\t\t\tvalues: builtEnum.members.map((m) => encodeEnumValue(m.value, builtEnum.codecId, codecLookup))\n\t\t};\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 unboundNamespace = buildMongoNamespace({\n\t\tid: UNBOUND_NAMESPACE_ID,\n\t\tentries: {\n\t\t\tcollection: collectionInputs,\n\t\t\t...Object.keys(storageValueSets).length > 0 ? { valueSet: storageValueSets } : {}\n\t\t}\n\t});\n\tconst storage = blindCast(new MongoStorage({\n\t\tstorageHash: computeStorageHash({\n\t\t\ttarget,\n\t\t\ttargetFamily,\n\t\t\tstorage: { namespaces: { [UNBOUND_NAMESPACE_ID]: {\n\t\t\t\tid: UNBOUND_NAMESPACE_ID,\n\t\t\t\tentries: {\n\t\t\t\t\tcollection: unboundNamespace.entries.collection,\n\t\t\t\t\t...unboundNamespace.entries.valueSet !== void 0 ? { valueSet: unboundNamespace.entries.valueSet } : {}\n\t\t\t\t}\n\t\t\t} } },\n\t\t\t...mongoContractCanonicalizationHooks\n\t\t}),\n\t\tnamespaces: { [UNBOUND_NAMESPACE_ID]: unboundNamespace }\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});\n}\n//#endregion\nexport { deriveJsonSchema as n, derivePolymorphicJsonSchema as r, interpretPslDocumentToMongoContract as t };\n\n//# sourceMappingURL=interpreter-O09WlHk7.mjs.map"],"mappings":";;;;;;;;;;;;;;AAaA,SAAS,gBAAgB,SAAS,aAAa;CAC9C,OAAO,aAAa,eAAe,OAAO,CAAC,GAAG;AAC/C;AACA,SAAS,kBAAkB,OAAO,cAAc,aAAa,WAAW;CACvE,IAAI,MAAM,KAAK,SAAS,UAAU;EACjC,MAAM,WAAW,gBAAgB,MAAM,KAAK,SAAS,WAAW;EAChE,IAAI,CAAC,UAAU,OAAO,KAAK;EAC3B,MAAM,aAAa,MAAM,aAAa,KAAK,IAAI,YAAY,MAAM,SAAS,WAAW,EAAE,UAAU,OAAO;EACxG,IAAI,UAAU,SAAS,MAAM,MAAM;GAClC,MAAM,QAAQ,EA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{
|
|
2
2
|
"name": "@prisma/orm-family-mongo",
|
|
3
|
-
"version": "8.0.0-rc.8-dev.
|
|
3
|
+
"version": "8.0.0-rc.8-dev.4",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -9,29 +9,29 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@prisma/orm-framework": "8.0.0-rc.8-dev.
|
|
13
|
-
"@prisma/orm-toolchain": "8.0.0-rc.8-dev.
|
|
12
|
+
"@prisma/orm-framework": "8.0.0-rc.8-dev.4",
|
|
13
|
+
"@prisma/orm-toolchain": "8.0.0-rc.8-dev.4",
|
|
14
14
|
"arktype": "^2.2.2",
|
|
15
15
|
"mongodb": "^7.4.0",
|
|
16
16
|
"pathe": "^2.0.3"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@internal/family-mongo": "8.0.0-rc.8-dev.
|
|
20
|
-
"@internal/mongo-codec": "8.0.0-rc.8-dev.
|
|
21
|
-
"@internal/mongo-contract": "8.0.0-rc.8-dev.
|
|
22
|
-
"@internal/mongo-contract-psl": "8.0.0-rc.8-dev.
|
|
23
|
-
"@internal/mongo-contract-ts": "8.0.0-rc.8-dev.
|
|
24
|
-
"@internal/mongo-emitter": "8.0.0-rc.8-dev.
|
|
25
|
-
"@internal/mongo-lowering": "8.0.0-rc.8-dev.
|
|
26
|
-
"@internal/mongo-orm": "8.0.0-rc.8-dev.
|
|
27
|
-
"@internal/mongo-query-ast": "8.0.0-rc.8-dev.
|
|
28
|
-
"@internal/mongo-query-builder": "8.0.0-rc.8-dev.
|
|
29
|
-
"@internal/mongo-runtime": "8.0.0-rc.8-dev.
|
|
30
|
-
"@internal/mongo-schema-ir": "8.0.0-rc.8-dev.
|
|
31
|
-
"@internal/mongo-value": "8.0.0-rc.8-dev.
|
|
32
|
-
"@internal/mongo-wire": "8.0.0-rc.8-dev.
|
|
33
|
-
"@repo/tsconfig": "8.0.0-rc.8-dev.
|
|
34
|
-
"@repo/tsdown": "8.0.0-rc.8-dev.
|
|
19
|
+
"@internal/family-mongo": "8.0.0-rc.8-dev.4",
|
|
20
|
+
"@internal/mongo-codec": "8.0.0-rc.8-dev.4",
|
|
21
|
+
"@internal/mongo-contract": "8.0.0-rc.8-dev.4",
|
|
22
|
+
"@internal/mongo-contract-psl": "8.0.0-rc.8-dev.4",
|
|
23
|
+
"@internal/mongo-contract-ts": "8.0.0-rc.8-dev.4",
|
|
24
|
+
"@internal/mongo-emitter": "8.0.0-rc.8-dev.4",
|
|
25
|
+
"@internal/mongo-lowering": "8.0.0-rc.8-dev.4",
|
|
26
|
+
"@internal/mongo-orm": "8.0.0-rc.8-dev.4",
|
|
27
|
+
"@internal/mongo-query-ast": "8.0.0-rc.8-dev.4",
|
|
28
|
+
"@internal/mongo-query-builder": "8.0.0-rc.8-dev.4",
|
|
29
|
+
"@internal/mongo-runtime": "8.0.0-rc.8-dev.4",
|
|
30
|
+
"@internal/mongo-schema-ir": "8.0.0-rc.8-dev.4",
|
|
31
|
+
"@internal/mongo-value": "8.0.0-rc.8-dev.4",
|
|
32
|
+
"@internal/mongo-wire": "8.0.0-rc.8-dev.4",
|
|
33
|
+
"@repo/tsconfig": "8.0.0-rc.8-dev.4",
|
|
34
|
+
"@repo/tsdown": "8.0.0-rc.8-dev.4",
|
|
35
35
|
"tsdown": "0.22.14",
|
|
36
36
|
"typescript": "5.9.3"
|
|
37
37
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interpreter-BxbUTQ3k-ClR98Ned.mjs","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-psl/dist/interpreter-BxbUTQ3k.mjs"],"sourcesContent":["import { MongoIndex, MongoStorage, MongoValidator, applyPolymorphicScopeToMongoIndex, buildMongoNamespace } from \"@internal/mongo-contract\";\nimport { computeProfileHash, computeStorageHash } from \"@internal/contract/hashing\";\nimport { crossRef } from \"@internal/contract/types\";\nimport { errorEnumCodecNotInPackStack } from \"@internal/errors/control\";\nimport { instantiateAuthoringEntityType, isAuthoringEntityTypeDescriptor } from \"@internal/framework-components/authoring\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { mongoContractCanonicalizationHooks } from \"@internal/mongo-contract/canonicalization-hooks\";\nimport { nodePslSpan, parseQuotedStringLiteral } from \"@internal/psl-parser\";\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\nfunction resolveBsonType(codecId, codecLookup) {\n\treturn codecLookup?.targetTypesFor(codecId)?.[0];\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) return void 0;\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\nfunction getPositionalArgument(attr, index = 0) {\n\treturn attr.args.filter((arg) => arg.kind === \"positional\")[index]?.value;\n}\nfunction getNamedArgument(attr, name) {\n\treturn attr.args.find((a) => a.kind === \"named\" && a.name === name)?.value;\n}\nfunction parseFieldList(value) {\n\tconst inner = value.replace(/^\\[/, \"\").replace(/\\]$/, \"\").trim();\n\tif (inner.length === 0) return [];\n\treturn splitTopLevel(inner).map((s) => s.trim());\n}\nfunction parseIndexFieldList(value) {\n\treturn parseFieldList(value).map(parseIndexFieldSegment);\n}\nfunction parseIndexFieldSegment(segment) {\n\tconst wildcardMatch = segment.match(/^wildcard\\(\\s*(.*?)\\s*\\)$/);\n\tif (wildcardMatch) {\n\t\tconst scope = wildcardMatch[1] ?? \"\";\n\t\treturn {\n\t\t\tname: scope.length > 0 ? `${scope}.$**` : \"$**\",\n\t\t\tisWildcard: true\n\t\t};\n\t}\n\tconst modifierMatch = segment.match(/^(\\w+)\\(\\s*sort:\\s*(\\w+)\\s*\\)$/);\n\tif (modifierMatch) return {\n\t\tname: modifierMatch[1] ?? segment,\n\t\tisWildcard: false,\n\t\tdirection: modifierMatch[2] === \"Desc\" ? -1 : 1\n\t};\n\treturn {\n\t\tname: segment,\n\t\tisWildcard: false\n\t};\n}\nfunction splitTopLevel(input) {\n\tconst parts = [];\n\tlet depth = 0;\n\tlet start = 0;\n\tfor (let i = 0; i < input.length; i++) {\n\t\tconst ch = input[i];\n\t\tif (ch === \"(\" || ch === \"[\" || ch === \"{\") depth++;\n\t\telse if (ch === \")\" || ch === \"]\" || ch === \"}\") depth = Math.max(0, depth - 1);\n\t\telse if (ch === \",\" && depth === 0) {\n\t\t\tparts.push(input.slice(start, i));\n\t\t\tstart = i + 1;\n\t\t}\n\t}\n\tparts.push(input.slice(start));\n\treturn parts;\n}\nfunction lowerFirst(value) {\n\tif (value.length === 0) return value;\n\treturn value[0]?.toLowerCase() + value.slice(1);\n}\nfunction getAttribute(attributes, name) {\n\treturn attributes.find((attr) => attr.name === name);\n}\nfunction getMapName(attributes) {\n\tconst mapAttr = getAttribute(attributes, \"map\");\n\tif (!mapAttr) return void 0;\n\tconst arg = mapAttr.args[0];\n\tif (!arg) return void 0;\n\treturn stripQuotes(arg.value);\n}\nfunction parseRelationAttribute(attributes) {\n\tconst relationAttr = getAttribute(attributes, \"relation\");\n\tif (!relationAttr) return void 0;\n\tlet relationName;\n\tlet fieldsArg;\n\tlet referencesArg;\n\tfor (const arg of relationAttr.args) if (arg.kind === \"positional\") relationName = stripQuotes(arg.value);\n\telse if (arg.name === \"name\") relationName = stripQuotes(arg.value);\n\telse if (arg.name === \"fields\") fieldsArg = arg;\n\telse if (arg.name === \"references\") referencesArg = arg;\n\tconst fields = fieldsArg ? parseFieldList(fieldsArg.value) : void 0;\n\tconst references = referencesArg ? parseFieldList(referencesArg.value) : void 0;\n\treturn {\n\t\t...ifDefined(\"relationName\", relationName),\n\t\t...ifDefined(\"fields\", fields),\n\t\t...ifDefined(\"references\", references)\n\t};\n}\nfunction stripQuotes(value) {\n\tif (value.startsWith(\"\\\"\") && value.endsWith(\"\\\"\")) return value.slice(1, -1);\n\treturn value;\n}\n//#endregion\n//#region src/interpreter.ts\n/**\n* Encode an authored enum value to its codec-encoded JSON form via the codec resolved by id from the\n* contract's codec lookup, so a non-identity `encodeJson` (permitted by the `mongoCodec` factory) is\n* respected. Matches the TS builder's `encodeEnumValue`: the lookup is always threaded in production,\n* and a codecId the lookup cannot resolve is a hard error — the enum uses a codec that is not part of\n* the contract's pack stack.\n*/\nfunction encodeEnumValue(value, codecId, codecLookup) {\n\tconst codec = codecLookup.get(codecId);\n\tif (!codec) throw errorEnumCodecNotInPackStack({ codecId });\n\treturn codec.encodeJson(value);\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) 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\tsourceId: input.sourceId,\n\t\tspan: nodePslSpan(namespace.node.syntax, input.sourceFile)\n\t});\n}\nfunction fkRelationPairKey(declaringModel, targetModel) {\n\treturn `${declaringModel}::${targetModel}`;\n}\nfunction resolveFieldMappings(model) {\n\tconst pslNameToMapped = /* @__PURE__ */ new Map();\n\tfor (const field of Object.values(model.fields)) {\n\t\tconst mapped = getMapName(field.attributes) ?? field.name;\n\t\tpslNameToMapped.set(field.name, mapped);\n\t}\n\treturn { pslNameToMapped };\n}\nfunction resolveCollectionName(model) {\n\treturn getMapName(model.attributes) ?? lowerFirst(model.name);\n}\nfunction mongoCrossRef(modelName) {\n\treturn crossRef(modelName, UNBOUND_NAMESPACE_ID);\n}\nfunction collectPolymorphismDeclarations(models, sourceId, diagnostics) {\n\tconst discriminatorDeclarations = /* @__PURE__ */ new Map();\n\tconst baseDeclarations = /* @__PURE__ */ new Map();\n\tfor (const model of models) for (const attr of model.attributes) {\n\t\tif (attr.name === \"discriminator\") {\n\t\t\tconst fieldName = getPositionalArgument(attr);\n\t\t\tif (!fieldName) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\t\t\tmessage: `Model \"${model.name}\" @@discriminator requires a field name argument`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan: attr.span\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst discField = model.fields[fieldName];\n\t\t\tif (discField && discField.typeName !== \"String\") {\n\t\t\t\tdiagnostics.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\tsourceId,\n\t\t\t\t\tspan: attr.span\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdiscriminatorDeclarations.set(model.name, {\n\t\t\t\tfieldName,\n\t\t\t\tspan: attr.span\n\t\t\t});\n\t\t}\n\t\tif (attr.name === \"base\") {\n\t\t\tconst baseName = getPositionalArgument(attr, 0);\n\t\t\tconst rawValue = getPositionalArgument(attr, 1);\n\t\t\tif (!baseName || !rawValue) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\t\t\tmessage: `Model \"${model.name}\" @@base requires two arguments: base model name and discriminator value`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan: attr.span\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst value = parseQuotedStringLiteral(rawValue);\n\t\t\tif (value === void 0) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\t\t\tmessage: `Model \"${model.name}\" @@base discriminator value must be a quoted string literal`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan: attr.span\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst collectionName = resolveCollectionName(model);\n\t\t\tbaseDeclarations.set(model.name, {\n\t\t\t\tbaseName,\n\t\t\t\tvalue,\n\t\t\t\tcollectionName,\n\t\t\t\tspan: attr.span\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, modelNames, sourceId, allModels: allModelViews, indexSpans, modelIndexesByName } = input;\n\tlet patched = input.models;\n\tlet roots = input.roots;\n\tlet collections = input.collections;\n\tconst diagnostics = [];\n\tfor (const [modelName, decl] of discriminatorDeclarations) {\n\t\tif (baseDeclarations.has(modelName)) {\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\tsourceId,\n\t\t\t\tspan: 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 modelView = allModelViews.find((m) => m.name === modelName);\n\t\tconst mappedDiscriminatorField = modelView ? resolveFieldMappings(modelView).pslNameToMapped.get(decl.fieldName) ?? 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\tsourceId,\n\t\t\t\tspan: decl.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst variants = {};\n\t\tfor (const [variantName, baseDecl] of baseDeclarations) {\n\t\t\tif (baseDecl.baseName !== modelName) continue;\n\t\t\tvariants[variantName] = { 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\tsourceId,\n\t\t\t\tspan: 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 [variantName, baseDecl] of baseDeclarations) {\n\t\tif (!modelNames.has(baseDecl.baseName)) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_BASE_TARGET_NOT_FOUND\",\n\t\t\t\tmessage: `Model \"${variantName}\" @@base references non-existent model \"${baseDecl.baseName}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: baseDecl.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (!discriminatorDeclarations.has(baseDecl.baseName)) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_ORPHANED_BASE\",\n\t\t\t\tmessage: `Model \"${variantName}\" declares @@base(${baseDecl.baseName}, ...) but \"${baseDecl.baseName}\" has no @@discriminator`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: baseDecl.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (discriminatorDeclarations.has(variantName)) continue;\n\t\tconst baseModel = patched[baseDecl.baseName];\n\t\tconst variantModelView = allModelViews.find((m) => m.name === variantName);\n\t\tif (!variantModelView) continue;\n\t\tif (getMapName(variantModelView.attributes) !== 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 \"${baseDecl.baseName}\". Mongo only supports single-collection polymorphism.`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: 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(baseDecl.baseName),\n\t\t\t\tstorage: { collection: baseCollection }\n\t\t\t}\n\t\t};\n\t\tconst variantCollectionName = resolveCollectionName(variantModelView);\n\t\tif (roots[variantCollectionName]?.model === variantName) if (variantCollectionName === baseCollection && baseModel) roots = {\n\t\t\t...roots,\n\t\t\t[variantCollectionName]: mongoCrossRef(baseDecl.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[baseDecl.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\tsourceId,\n\t\t\t\t\tspan\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 = baseColl[\"indexes\"] ?? [];\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 = baseColl[\"indexes\"] ?? [];\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 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 parseIndexDirection(raw) {\n\tif (!raw) return 1;\n\tconst stripped = raw.replace(/^[\"']/, \"\").replace(/[\"']$/, \"\");\n\tconst num = Number(stripped);\n\tif (num === 1 || num === -1) return num;\n\tif ([\n\t\t\"text\",\n\t\t\"2dsphere\",\n\t\t\"2d\",\n\t\t\"hashed\"\n\t].includes(stripped)) return stripped;\n\treturn 1;\n}\nfunction parseNumericArg(raw) {\n\tif (!raw) return void 0;\n\tconst n = Number(raw);\n\treturn Number.isFinite(n) ? n : void 0;\n}\nfunction parseBooleanArg(raw) {\n\tif (raw === \"true\") return true;\n\tif (raw === \"false\") return false;\n}\nfunction parseJsonArg(raw) {\n\tif (!raw) return void 0;\n\tconst stripped = raw.replace(/^[\"']/, \"\").replace(/[\"']$/, \"\").replace(/\\\\\"/g, \"\\\"\");\n\ttry {\n\t\tconst parsed = JSON.parse(stripped);\n\t\tif (typeof parsed === \"object\" && parsed !== null && !Array.isArray(parsed)) return parsed;\n\t} catch {}\n}\nfunction parseCollation(attr) {\n\tconst locale = stripQuotesHelper(getNamedArgument(attr, \"collationLocale\"));\n\tif (!locale) return getNamedArgument(attr, \"collationStrength\") != null || getNamedArgument(attr, \"collationCaseLevel\") != null || getNamedArgument(attr, \"collationCaseFirst\") != null || getNamedArgument(attr, \"collationNumericOrdering\") != null || getNamedArgument(attr, \"collationAlternate\") != null || getNamedArgument(attr, \"collationMaxVariable\") != null || getNamedArgument(attr, \"collationBackwards\") != null || getNamedArgument(attr, \"collationNormalization\") != null ? null : void 0;\n\tconst collation = { locale };\n\tconst strength = parseNumericArg(getNamedArgument(attr, \"collationStrength\"));\n\tif (strength != null) collation.strength = strength;\n\tconst caseLevel = parseBooleanArg(getNamedArgument(attr, \"collationCaseLevel\"));\n\tif (caseLevel != null) collation.caseLevel = caseLevel;\n\tconst caseFirst = stripQuotesHelper(getNamedArgument(attr, \"collationCaseFirst\"));\n\tif (caseFirst != null) collation.caseFirst = caseFirst;\n\tconst numericOrdering = parseBooleanArg(getNamedArgument(attr, \"collationNumericOrdering\"));\n\tif (numericOrdering != null) collation.numericOrdering = numericOrdering;\n\tconst alternate = stripQuotesHelper(getNamedArgument(attr, \"collationAlternate\"));\n\tif (alternate != null) collation.alternate = alternate;\n\tconst maxVariable = stripQuotesHelper(getNamedArgument(attr, \"collationMaxVariable\"));\n\tif (maxVariable != null) collation.maxVariable = maxVariable;\n\tconst backwards = parseBooleanArg(getNamedArgument(attr, \"collationBackwards\"));\n\tif (backwards != null) collation.backwards = backwards;\n\tconst normalization = parseBooleanArg(getNamedArgument(attr, \"collationNormalization\"));\n\tif (normalization != null) collation.normalization = normalization;\n\treturn collation;\n}\nfunction stripQuotesHelper(raw) {\n\tif (!raw) return void 0;\n\treturn raw.replace(/^[\"']/, \"\").replace(/[\"']$/, \"\");\n}\nfunction parseProjectionList(raw, value) {\n\tif (!raw) return void 0;\n\tconst inner = raw.replace(/^[\"']/, \"\").replace(/[\"']$/, \"\").replace(/^\\[/, \"\").replace(/\\]$/, \"\").trim();\n\tif (inner.length === 0) return void 0;\n\tconst fields = inner.split(\",\").map((s) => s.trim()).filter((s) => s.length > 0);\n\tconst result = {};\n\tfor (const f of fields) result[f] = value;\n\treturn result;\n}\nfunction collectIndexes(pslModel, fieldMappings, modelNames, sourceId, diagnostics, indexSpans) {\n\tconst indexes = [];\n\tlet textIndexCount = 0;\n\tconst indexableFieldNames = /* @__PURE__ */ new Set();\n\tfor (const f of Object.values(pslModel.fields)) {\n\t\tif (modelNames.has(f.typeName)) continue;\n\t\tindexableFieldNames.add(f.name);\n\t}\n\tfor (const field of Object.values(pslModel.fields)) {\n\t\tif (modelNames.has(field.typeName)) continue;\n\t\tconst uniqueAttr = getAttribute(field.attributes, \"unique\");\n\t\tif (!uniqueAttr) 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, uniqueAttr.span);\n\t}\n\tfor (const attr of pslModel.attributes) {\n\t\tconst isIndex = attr.name === \"index\";\n\t\tconst isUnique = attr.name === \"unique\";\n\t\tconst isTextIndex = attr.name === \"textIndex\";\n\t\tif (!isIndex && !isUnique && !isTextIndex) continue;\n\t\tconst fieldsArg = getPositionalArgument(attr, 0);\n\t\tif (!fieldsArg) continue;\n\t\tconst parsedFields = parseIndexFieldList(fieldsArg);\n\t\tif (parsedFields.length === 0) continue;\n\t\tconst hasWildcard = parsedFields.some((f) => f.isWildcard);\n\t\tif (parsedFields.filter((f) => f.isWildcard).length > 1) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\t\tmessage: \"An index can contain at most one wildcard() field\",\n\t\t\t\tsourceId,\n\t\t\t\tspan: attr.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (isUnique && hasWildcard) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\t\tmessage: \"Unique indexes cannot use wildcard() fields\",\n\t\t\t\tsourceId,\n\t\t\t\tspan: attr.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (isTextIndex) {\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\tsourceId,\n\t\t\t\t\tspan: attr.span\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (hasWildcard) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\t\t\tmessage: \"wildcard() fields cannot be combined with type: hashed/2dsphere/2d or @@textIndex\",\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan: attr.span\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tconst typeArg = getNamedArgument(attr, \"type\");\n\t\tconst defaultDirection = isTextIndex ? \"text\" : parseIndexDirection(typeArg);\n\t\tif (hasWildcard && typeof defaultDirection === \"string\" && [\n\t\t\t\"hashed\",\n\t\t\t\"2dsphere\",\n\t\t\t\"2d\"\n\t\t].includes(defaultDirection)) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\t\tmessage: `wildcard() fields cannot be combined with type: ${defaultDirection}`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: attr.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (defaultDirection === \"hashed\" && parsedFields.length > 1) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\t\tmessage: \"Hashed indexes must have exactly one field\",\n\t\t\t\tsourceId,\n\t\t\t\tspan: attr.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tlet missingField;\n\t\tfor (const pf of parsedFields) {\n\t\t\tlet fieldNameForLookup;\n\t\t\tif (pf.isWildcard) {\n\t\t\t\tconst wildcardMatch = pf.name.match(/^(.+)\\.\\$\\*\\*$/);\n\t\t\t\tfieldNameForLookup = wildcardMatch ? wildcardMatch[1] : void 0;\n\t\t\t} else fieldNameForLookup = pf.name;\n\t\t\tif (fieldNameForLookup === void 0 || fieldNameForLookup.length === 0) continue;\n\t\t\tif (!indexableFieldNames.has(fieldNameForLookup)) {\n\t\t\t\tmissingField = fieldNameForLookup;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (missingField !== void 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INDEX_FIELD_NOT_FOUND\",\n\t\t\t\tmessage: `Index on model \"${pslModel.name}\" references unknown field \"${missingField}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: attr.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst keys = parsedFields.map((pf) => {\n\t\t\treturn {\n\t\t\t\tfield: pf.isWildcard ? pf.name.replace(/^(.+)\\.\\$\\*\\*$/, (_, prefix) => {\n\t\t\t\t\tconst mapped = fieldMappings.pslNameToMapped.get(prefix);\n\t\t\t\t\treturn mapped ? `${mapped}.$**` : `${prefix}.$**`;\n\t\t\t\t}) : fieldMappings.pslNameToMapped.get(pf.name) ?? pf.name,\n\t\t\t\tdirection: pf.direction != null ? pf.direction : defaultDirection\n\t\t\t};\n\t\t});\n\t\tconst unique = isUnique ? true : void 0;\n\t\tconst sparse = isTextIndex ? void 0 : parseBooleanArg(getNamedArgument(attr, \"sparse\"));\n\t\tconst expireAfterSeconds = isTextIndex ? void 0 : parseNumericArg(getNamedArgument(attr, \"expireAfterSeconds\"));\n\t\tif (hasWildcard && expireAfterSeconds != null) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\t\tmessage: \"expireAfterSeconds cannot be combined with wildcard() fields\",\n\t\t\t\tsourceId,\n\t\t\t\tspan: attr.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst partialFilterExpression = parseJsonArg(getNamedArgument(attr, \"filter\"));\n\t\tconst includeArg = getNamedArgument(attr, \"include\");\n\t\tconst excludeArg = getNamedArgument(attr, \"exclude\");\n\t\tif (includeArg != null && excludeArg != null) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\t\tmessage: \"Cannot specify both include and exclude on the same index\",\n\t\t\t\tsourceId,\n\t\t\t\tspan: attr.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif ((includeArg != null || excludeArg != null) && !hasWildcard) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\t\tmessage: \"include/exclude options are only valid when the index contains a wildcard() field\",\n\t\t\t\tsourceId,\n\t\t\t\tspan: attr.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst wildcardProjection = includeArg != null ? parseProjectionList(includeArg, 1) : excludeArg != null ? parseProjectionList(excludeArg, 0) : void 0;\n\t\tconst collation = parseCollation(attr);\n\t\tif (collation === null) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\t\tmessage: \"collationLocale is required when using collation options\",\n\t\t\t\tsourceId,\n\t\t\t\tspan: attr.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst rawWeights = parseJsonArg(getNamedArgument(attr, \"weights\"));\n\t\tlet weights;\n\t\tif (rawWeights) {\n\t\t\tweights = {};\n\t\t\tfor (const [k, v] of Object.entries(rawWeights)) if (typeof v === \"number\") weights[k] = v;\n\t\t}\n\t\tconst default_language = stripQuotesHelper(isTextIndex ? getNamedArgument(attr, \"language\") : getNamedArgument(attr, \"default_language\"));\n\t\tconst language_override = stripQuotesHelper(getNamedArgument(attr, \"languageOverride\"));\n\t\tconst index = new MongoIndex({\n\t\t\tkeys,\n\t\t\t...unique != null && { unique },\n\t\t\t...sparse != null && { sparse },\n\t\t\t...expireAfterSeconds != null && { expireAfterSeconds },\n\t\t\t...partialFilterExpression != null && { partialFilterExpression },\n\t\t\t...wildcardProjection != null && { wildcardProjection },\n\t\t\t...collation != null && { collation },\n\t\t\t...weights != null && { weights },\n\t\t\t...default_language != null && { default_language },\n\t\t\t...language_override != null && { language_override }\n\t\t});\n\t\tindexes.push(index);\n\t\tindexSpans.set(index, attr.span);\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}\nfunction resolveNonRelationField(field, ownerName, compositeTypeNames, scalarTypeCodecIds, codecIdByEnumName, sourceId, diagnostics) {\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.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.list ? {\n\t\t\t...result,\n\t\t\tmany: true\n\t\t} : result;\n\t}\n\tif (field.malformedType) return;\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\tsourceId,\n\t\t\tspan: field.span\n\t\t});\n\t\treturn;\n\t}\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.list ? {\n\t\t...result,\n\t\tmany: true\n\t} : result;\n}\nfunction processEnumDeclarations(input) {\n\tconst builtEnums = {};\n\tif (input.enumBlocks.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 decl of input.enumBlocks) input.diagnostics.push({\n\t\t\tcode: \"PSL_ENUM_MISSING_FACTORY\",\n\t\t\tmessage: `enum \"${decl.name}\" requires an \"enum\" entityType factory in the active authoring contributions`,\n\t\t\tsourceId: input.sourceId,\n\t\t\tspan: decl.span\n\t\t});\n\t\treturn builtEnums;\n\t}\n\tfor (const decl of input.enumBlocks) {\n\t\tconst handle = instantiateAuthoringEntityType(\"enum\", enumDescriptor, [decl], input.entityContext);\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, sourceFile, scalarTypeCodecIds, codecLookup } = input;\n\tconst sourceId = input.sourceId;\n\tconst diagnostics = [...input.seedDiagnostics ?? []];\n\tconst topLevel = symbolTable.topLevel;\n\tvalidateNamespaceBlocksForMongoTarget({\n\t\tnamespaces: Object.values(topLevel.namespaces),\n\t\tsourceId,\n\t\tsourceFile,\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 builtEnums = processEnumDeclarations({\n\t\tenumBlocks: Object.values(topLevel.blocks).filter((b) => b.keyword === \"enum\").map((b) => b.block),\n\t\tsourceId,\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\tsourceId,\n\t\t\tdiagnostics: { push: (d) => {\n\t\t\t\tdiagnostics.push(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 modelIndexesByName = /* @__PURE__ */ new Map();\n\tconst backrelationCandidates = [];\n\tfor (const pslModel of allModels) {\n\t\tconst collectionName = resolveCollectionName(pslModel);\n\t\tconst fieldMappings = resolveFieldMappings(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 relation = parseRelationAttribute(field.attributes);\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\tfieldName: field.name,\n\t\t\t\t\t\ttargetModelName: field.typeName,\n\t\t\t\t\t\t...ifDefined(\"relationName\", relation?.relationName),\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});\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\tconst localMapped = relation.fields.map((f) => fieldMappings.pslNameToMapped.get(f) ?? f);\n\t\t\t\t\tconst targetModel = allModels.find((m) => m.name === field.typeName);\n\t\t\t\t\tconst targetFieldMappings = targetModel ? resolveFieldMappings(targetModel) : void 0;\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\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\tfieldName: field.name,\n\t\t\t\t\t\ttargetModel: field.typeName,\n\t\t\t\t\t\t...ifDefined(\"relationName\", relation.relationName),\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, pslModel.name, compositeTypeNames, scalarTypeCodecIds, codecIdByEnumName, sourceId, diagnostics);\n\t\t\tif (!resolved) continue;\n\t\t\tconst mappedName = fieldMappings.pslNameToMapped.get(field.name) ?? field.name;\n\t\t\tfields[mappedName] = resolved;\n\t\t}\n\t\tconst isVariantModel = pslModel.attributes.some((attr) => attr.name === \"base\");\n\t\tconst hasIdField = Object.values(pslModel.fields).some((f) => getAttribute(f.attributes, \"id\") !== void 0);\n\t\tif (!isVariantModel) if (!hasIdField) diagnostics.push({\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\tsourceId\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.push({\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\tsourceId\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, fieldMappings, modelNames, sourceId, diagnostics, indexSpans);\n\t\tmodelIndexesByName.set(pslModel.name, modelIndexes);\n\t\tconst existingColl = collections[collectionName];\n\t\tif (existingColl && modelIndexes.length > 0) collections[collectionName] = { indexes: [...existingColl[\"indexes\"] ?? [], ...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, compositeType.name, compositeTypeNames, scalarTypeCodecIds, codecIdByEnumName, sourceId, diagnostics);\n\t\t\tif (!resolved) continue;\n\t\t\tfields[field.name] = resolved;\n\t\t}\n\t\tvalueObjects[compositeType.name] = { fields };\n\t}\n\tconst fkRelationsByPair = /* @__PURE__ */ new Map();\n\tfor (const fk of allFkRelations) {\n\t\tconst key = fkRelationPairKey(fk.declaringModel, fk.targetModel);\n\t\tconst existing = fkRelationsByPair.get(key);\n\t\tif (existing) existing.push(fk);\n\t\telse fkRelationsByPair.set(key, [fk]);\n\t}\n\tfor (const candidate of backrelationCandidates) {\n\t\tconst pairKey = fkRelationPairKey(candidate.targetModelName, candidate.modelName);\n\t\tconst pairMatches = fkRelationsByPair.get(pairKey) ?? [];\n\t\tconst matches = candidate.relationName ? pairMatches.filter((r) => r.relationName === candidate.relationName) : [...pairMatches];\n\t\tif (matches.length === 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_ORPHANED_BACKRELATION\",\n\t\t\t\tmessage: `Backrelation list field \"${candidate.modelName}.${candidate.fieldName}\" has no matching FK-side relation on model \"${candidate.targetModelName}\". Add @relation(fields: [...], references: [...]) on the FK-side relation or use an explicit join model for many-to-many.`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: candidate.field.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (matches.length > 1) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_AMBIGUOUS_BACKRELATION\",\n\t\t\t\tmessage: `Backrelation list field \"${candidate.modelName}.${candidate.fieldName}\" matches multiple FK-side relations on model \"${candidate.targetModelName}\". Add @relation(\"...\") to both sides to disambiguate.`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: candidate.field.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst fk = matches[0];\n\t\tif (!fk) continue;\n\t\tconst modelEntry = models[candidate.modelName];\n\t\tif (!modelEntry) continue;\n\t\tmodelEntry.relations[candidate.fieldName] = {\n\t\t\tto: mongoCrossRef(candidate.targetModelName),\n\t\t\tcardinality: candidate.cardinality,\n\t\t\ton: {\n\t\t\t\tlocalFields: fk.targetFields,\n\t\t\t\ttargetFields: fk.localFields\n\t\t\t}\n\t\t};\n\t}\n\tconst { discriminatorDeclarations, baseDeclarations } = collectPolymorphismDeclarations(allModels, sourceId, diagnostics);\n\tconst polyResult = resolvePolymorphism({\n\t\tmodels,\n\t\troots,\n\t\tcollections,\n\t\tallModels,\n\t\tdiscriminatorDeclarations,\n\t\tbaseDeclarations,\n\t\tmodelNames,\n\t\tindexSpans,\n\t\tmodelIndexesByName,\n\t\tsourceId\n\t});\n\tif (diagnostics.length > 0 || polyResult.diagnostics.length > 0) return notOk({\n\t\tsummary: \"PSL to Mongo contract interpretation failed\",\n\t\tdiagnostics: [...diagnostics, ...polyResult.diagnostics]\n\t});\n\tconst resolvedModels = polyResult.models;\n\tconst resolvedCollections = polyResult.collections;\n\tconst storageValueSets = {};\n\tconst enumEntries = Object.entries(builtEnums);\n\tif (enumEntries.length > 0) {\n\t\tassertDefined(codecLookup, \"Mongo PSL interpretation requires a codec lookup to encode enum values\");\n\t\tfor (const [enumName, builtEnum] of enumEntries) storageValueSets[enumName] = {\n\t\t\tkind: \"valueSet\",\n\t\t\tvalues: builtEnum.members.map((m) => encodeEnumValue(m.value, builtEnum.codecId, codecLookup))\n\t\t};\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 unboundNamespace = buildMongoNamespace({\n\t\tid: UNBOUND_NAMESPACE_ID,\n\t\tentries: {\n\t\t\tcollection: collectionInputs,\n\t\t\t...Object.keys(storageValueSets).length > 0 ? { valueSet: storageValueSets } : {}\n\t\t}\n\t});\n\tconst storage = new MongoStorage({\n\t\tstorageHash: computeStorageHash({\n\t\t\ttarget,\n\t\t\ttargetFamily,\n\t\t\tstorage: { namespaces: { [UNBOUND_NAMESPACE_ID]: {\n\t\t\t\tid: UNBOUND_NAMESPACE_ID,\n\t\t\t\tentries: {\n\t\t\t\t\tcollection: unboundNamespace.entries.collection,\n\t\t\t\t\t...unboundNamespace.entries.valueSet !== void 0 ? { valueSet: unboundNamespace.entries.valueSet } : {}\n\t\t\t\t}\n\t\t\t} } },\n\t\t\t...mongoContractCanonicalizationHooks\n\t\t}),\n\t\tnamespaces: { [UNBOUND_NAMESPACE_ID]: unboundNamespace }\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});\n}\n//#endregion\nexport { deriveJsonSchema as n, derivePolymorphicJsonSchema as r, interpretPslDocumentToMongoContract as t };\n\n//# sourceMappingURL=interpreter-BxbUTQ3k.mjs.map"],"mappings":";;;;;;;;;;;;;;AAaA,SAAS,gBAAgB,SAAS,aAAa;CAC9C,OAAO,aAAa,eAAe,OAAO,CAAC,GAAG;AAC/C;AACA,SAAS,kBAAkB,OAAO,cAAc,aAAa,WAAW;CACvE,IAAI,MAAM,KAAK,SAAS,UAAU;EACjC,MAAM,WAAW,gBAAgB,MAAM,KAAK,SAAS,WAAW;EAChE,IAAI,CAAC,UAAU,OAAO,KAAK;EAC3B,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,UAA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