@prisma/orm-family-mongo 8.0.0-rc.22-dev.12 → 8.0.0-rc.22-dev.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{authoring-entity-types-J_patbMZ-C509nMfw.mjs → authoring-entity-types-qeRu8r5L-kYG8jSMg.mjs} +3 -2
- package/dist/authoring-entity-types-qeRu8r5L-kYG8jSMg.mjs.map +1 -0
- package/dist/config-types-D4SnQaTy.mjs.map +1 -1
- package/dist/{contract-builder-Cr65NhJk.mjs → contract-builder-BUa0Oz34.mjs} +105 -10
- package/dist/contract-builder-BUa0Oz34.mjs.map +1 -0
- package/dist/{contract-builder-DurxXsaj.d.mts → contract-builder-x1bl1wIr.d.mts} +20 -5
- package/dist/contract-builder-x1bl1wIr.d.mts.map +1 -0
- package/dist/contract-prisma6__provider.mjs +83 -8
- package/dist/contract-prisma6__provider.mjs.map +1 -1
- package/dist/contract-psl.d.mts +6 -1
- package/dist/contract-psl.d.mts.map +1 -1
- 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/contract-ts.d.mts +2 -2
- package/dist/contract-ts.mjs +2 -2
- package/dist/contract-ts__contract-builder.d.mts +2 -2
- package/dist/contract-ts__contract-builder.mjs +2 -2
- package/dist/contract.d.mts +3 -3
- package/dist/contract.mjs +3 -3
- package/dist/contract__entity-kinds.d.mts +1 -1
- package/dist/contract__entity-kinds.mjs +1 -1
- package/dist/{control-0YmjHGNw.d.mts → control-CJLG6g2G.d.mts} +5 -6
- package/dist/{control-0YmjHGNw.d.mts.map → control-CJLG6g2G.d.mts.map} +1 -1
- package/dist/{control-DMkn0GMN.d.mts → control-CvUovwse.d.mts} +6 -6
- package/dist/{control-DMkn0GMN.d.mts.map → control-CvUovwse.d.mts.map} +1 -1
- package/dist/{control-DzA3bjX-.mjs → control-P83KyI0L.mjs} +8 -7
- package/dist/control-P83KyI0L.mjs.map +1 -0
- package/dist/{control-adapter-BheElqfe-iFCyJUfP.d.mts → control-adapter-BheElqfe-DxUxWoeq.d.mts} +4 -4
- package/dist/{control-adapter-BheElqfe-iFCyJUfP.d.mts.map → control-adapter-BheElqfe-DxUxWoeq.d.mts.map} +1 -1
- package/dist/control-adapter-DfRH_2nl.d.mts +1 -0
- package/dist/{control-BQMBG11d.mjs → control-ywVRqK1i.mjs} +4 -7
- package/dist/{control-BQMBG11d.mjs.map → control-ywVRqK1i.mjs.map} +1 -1
- package/dist/{dist-BbJV26vR.mjs → dist-BXMjjRsI.mjs} +2 -2
- package/dist/{dist-BbJV26vR.mjs.map → dist-BXMjjRsI.mjs.map} +1 -1
- package/dist/dist-BhDqnAiz.mjs.map +1 -1
- package/dist/{dist-B-Ml8wpa.mjs → dist-By5gbTEW.mjs} +10 -5
- package/dist/dist-By5gbTEW.mjs.map +1 -0
- package/dist/{entity-kinds-BI-PWX8L-DRxc2Flr.mjs → entity-kinds-D5mTQzuZ-BY1vGgFk.mjs} +6 -2
- package/dist/entity-kinds-D5mTQzuZ-BY1vGgFk.mjs.map +1 -0
- package/dist/{execution-CGierEKK.d.mts → execution-B3Fogex9.d.mts} +3 -3
- package/dist/{execution-CGierEKK.d.mts.map → execution-B3Fogex9.d.mts.map} +1 -1
- package/dist/{exports-B2tu3O-g.mjs → exports-BRIh38XT.mjs} +9 -3
- package/dist/exports-BRIh38XT.mjs.map +1 -0
- package/dist/family.d.mts +9 -9
- package/dist/family.mjs +8 -8
- package/dist/family__control-adapter.d.mts +2 -2
- package/dist/family__control.d.mts +1 -1
- package/dist/family__control.mjs +2 -2
- package/dist/family__ir.d.mts +2 -2
- package/dist/family__ir.mjs +3 -3
- package/dist/family__migration.d.mts +1 -1
- package/dist/family__migration.mjs +1 -1
- package/dist/family__pack.mjs +2 -2
- package/dist/family__pack.mjs.map +1 -1
- package/dist/family__runtime.d.mts +2 -2
- package/dist/family__runtime.mjs +1 -1
- package/dist/family__schema-verify.d.mts +1 -1
- package/dist/family__schema-verify.mjs +1 -1
- package/dist/{field-accessor-CqKt9hxI-AngsT5mI.d.mts → field-accessor-CqKt9hxI-CI_pUKZN.d.mts} +4 -4
- package/dist/{field-accessor-CqKt9hxI-AngsT5mI.d.mts.map → field-accessor-CqKt9hxI-CI_pUKZN.d.mts.map} +1 -1
- package/dist/{index-DXhwK4nr.d.mts → index-BK3HyX9U.d.mts} +4 -4
- package/dist/{index-DXhwK4nr.d.mts.map → index-BK3HyX9U.d.mts.map} +1 -1
- package/dist/{index-TNRD-MRI.d.mts → index-BrDXnKtf.d.mts} +4 -4
- package/dist/{index-TNRD-MRI.d.mts.map → index-BrDXnKtf.d.mts.map} +1 -1
- package/dist/{index-D21Pb9vL.d.mts → index-D6MtleDl.d.mts} +11 -4
- package/dist/index-D6MtleDl.d.mts.map +1 -0
- package/dist/{index-DcQFfwkK.d.mts → index-JpsaTpKi.d.mts} +9 -5
- package/dist/{index-DcQFfwkK.d.mts.map → index-JpsaTpKi.d.mts.map} +1 -1
- package/dist/{interpreter-BX0gy2Yu-Byy8LdrE.mjs → interpreter-DpW_wEiP-Clp24cvz.mjs} +70 -17
- package/dist/interpreter-DpW_wEiP-Clp24cvz.mjs.map +1 -0
- package/dist/{ir-BGD9W6Cu.mjs → ir-Bm8xm1eu.mjs} +2 -2
- package/dist/{ir-BGD9W6Cu.mjs.map → ir-Bm8xm1eu.mjs.map} +1 -1
- package/dist/{ir-DH1ciHWj.d.mts → ir-BzKq60Lv.d.mts} +4 -4
- package/dist/{ir-DH1ciHWj.d.mts.map → ir-BzKq60Lv.d.mts.map} +1 -1
- package/dist/lowering.d.mts +1 -1
- package/dist/{migration-DDXXsPCK.mjs → migration-LHRzvIrb.mjs} +2 -2
- package/dist/{migration-DDXXsPCK.mjs.map → migration-LHRzvIrb.mjs.map} +1 -1
- package/dist/{migration-fjq98toS.d.mts → migration-VHZaMXZ5.d.mts} +5 -5
- package/dist/{migration-fjq98toS.d.mts.map → migration-VHZaMXZ5.d.mts.map} +1 -1
- package/dist/{mongo-contract-serializer-BBknnHWy-BYVYfFCj.mjs → mongo-contract-serializer-BBknnHWy-DAzm09wB.mjs} +3 -3
- package/dist/{mongo-contract-serializer-BBknnHWy-BYVYfFCj.mjs.map → mongo-contract-serializer-BBknnHWy-DAzm09wB.mjs.map} +1 -1
- package/dist/{mongo-contract-view-AnejqfrQ-CPjNHMFu.d.mts → mongo-contract-view-AnejqfrQ-CIb7qlMp.d.mts} +3 -3
- package/dist/{mongo-contract-view-AnejqfrQ-CPjNHMFu.d.mts.map → mongo-contract-view-AnejqfrQ-CIb7qlMp.d.mts.map} +1 -1
- package/dist/{mongo-contract-view-CF5trX6R-D-7KBBF2.mjs → mongo-contract-view-CF5trX6R-BIF8ciuY.mjs} +3 -3
- package/dist/{mongo-contract-view-CF5trX6R-D-7KBBF2.mjs.map → mongo-contract-view-CF5trX6R-BIF8ciuY.mjs.map} +1 -1
- package/dist/{mongo-value-set-DAGBOegv-B0Vel8d-.d.mts → mongo-value-set-bK4eBlxO-BCGb8sSL.d.mts} +5 -2
- package/dist/{mongo-value-set-DAGBOegv-B0Vel8d-.d.mts.map → mongo-value-set-bK4eBlxO-BCGb8sSL.d.mts.map} +1 -1
- package/dist/orm.d.mts +3 -3
- package/dist/orm.mjs +2 -2
- package/dist/query-ast.d.mts +4 -4
- package/dist/query-ast.mjs +2 -2
- package/dist/query-ast__control.d.mts +3 -3
- package/dist/query-ast__control.mjs +2 -2
- package/dist/query-ast__execution.d.mts +1 -1
- package/dist/query-builder.d.mts +4 -4
- package/dist/query-builder.mjs +1 -1
- package/dist/query-builder__contract-free.d.mts +4 -4
- package/dist/query-builder__contract-free.mjs +1 -1
- package/dist/{runtime-ZGXLjqEe.d.mts → runtime-Bf-SFBMj.d.mts} +2 -2
- package/dist/runtime-Bf-SFBMj.d.mts.map +1 -0
- package/dist/runtime.d.mts +5 -5
- package/dist/schema-ir.d.mts +1 -1
- package/dist/schema-ir.mjs +1 -1
- package/dist/{schema-verify-CpWcSHyM.d.mts → schema-verify-BJAMkVFt.d.mts} +4 -4
- package/dist/{schema-verify-CpWcSHyM.d.mts.map → schema-verify-BJAMkVFt.d.mts.map} +1 -1
- package/dist/{verify-mongo-schema-CyvUewwP-DwSUNc5f.mjs → verify-mongo-schema-D8rznxzZ-CjYf39zu.mjs} +34 -23
- package/dist/verify-mongo-schema-D8rznxzZ-CjYf39zu.mjs.map +1 -0
- package/dist/wire.d.mts +2 -2
- package/package.json +20 -20
- package/dist/authoring-entity-types-J_patbMZ-C509nMfw.mjs.map +0 -1
- package/dist/contract-builder-Cr65NhJk.mjs.map +0 -1
- package/dist/contract-builder-DurxXsaj.d.mts.map +0 -1
- package/dist/control-DzA3bjX-.mjs.map +0 -1
- package/dist/control-adapter-lmZYICe8.d.mts +0 -1
- package/dist/dist-B-Ml8wpa.mjs.map +0 -1
- package/dist/entity-kinds-BI-PWX8L-DRxc2Flr.mjs.map +0 -1
- package/dist/exports-B2tu3O-g.mjs.map +0 -1
- package/dist/index-D21Pb9vL.d.mts.map +0 -1
- package/dist/interpreter-BX0gy2Yu-Byy8LdrE.mjs.map +0 -1
- package/dist/runtime-ZGXLjqEe.d.mts.map +0 -1
- package/dist/verify-mongo-schema-CyvUewwP-DwSUNc5f.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interpreter-BX0gy2Yu-Byy8LdrE.mjs","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-psl/dist/interpreter-BX0gy2Yu.mjs"],"sourcesContent":["import { describeDiscriminatorRefusal, enumMemberProblemDiagnostic, instantiateAuthoringEntityType, instantiateAuthoringTypeAlias, instantiateAuthoringTypeConstructor, isAuthoringEntityTypeDescriptor, resolveTypeAliasGenerators } from \"@internal/framework-components/authoring\";\nimport { claimedBlockKeywords, consumeInvalidFkPairing, enumMemberAttributeDiagnostics, fkRelationPairKey, instantiatePslTypeChoice, isBareTypeConstructor, reportTypeConstructorNotCalled, requiredOneToOneBackrelationDiagnostic, unsupportedBlockDiagnostic } from \"@internal/psl-parser/interpret\";\nimport { resolveToOneRelationNullable } from \"@internal/contract-authoring\";\nimport { DOCUMENT_ID } from \"@internal/mongo-contract\";\nimport { buildMongoContractFromDefinition, mergeRedundantIndexes } from \"@internal/mongo-contract-ts/contract-builder\";\nimport { bool, contributedTypeAliasOf, contributedTypeOf, createPslDiagnosticCollector, diagnosticSource, entityRef, fieldAttribute, fieldRef, funcCall, generatorAttributeSpec, identifier, int, interpretAttribute, interpretExtensionBlocks, isContributedTypeChoice, json, list, mapPslDiagnostics, modelAttribute, nodePslSpan, num, oneOf, optional, record, referencedFieldRef, refuseRepeatedTypeAliasAttributes, resolveTypeAliases, str, typeAliasSpecContext, typeAttributeSpecContextOfField, typeAttributeSubjectLabel, typeGeneratorAttributeSpec, typeReferenceNode, writtenScalar } from \"@internal/psl-parser\";\nimport { ArrayLiteralAst, FunctionCallAst, PathExprAst } from \"@internal/psl-parser/syntax\";\nimport { assertDefined, invariant } from \"@internal/utils/assertions\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { crossRef } from \"@internal/contract/types\";\n//#region src/mongo-attribute-specs.ts\nfunction buildModelAttributeCtx(input) {\n\treturn {\n\t\tsources: input.sources,\n\t\tselfModel: input.selfModel,\n\t\tbinder: input.binder,\n\t\tsymbols: input.symbols\n\t};\n}\nfunction buildFieldAttributeCtx(input) {\n\treturn {\n\t\tsources: input.sources,\n\t\tselfModel: input.selfModel,\n\t\tfield: input.field,\n\t\tbinder: input.binder,\n\t\tsymbols: input.symbols\n\t};\n}\nconst UNLOWERED_FIELD_ATTRIBUTE_HINTS = /* @__PURE__ */ new Map([[\"updatedAt\", \"Use @onCreate(now()) @onUpdate(now()), or type the field temporal.UpdatedAt.\"]]);\nconst DEFAULT_NOW_HINT = \"Use @onCreate(now()) instead; MongoDB has no database defaults.\";\n/** The hint for an attribute MongoDB PSL does not lower, naming what to write instead. */\nfunction unloweredAttributeHint(attribute) {\n\tif (attribute.name === \"default\" && attribute.args[0]?.value.replace(/\\s/g, \"\") === \"now()\") return DEFAULT_NOW_HINT;\n\treturn UNLOWERED_FIELD_ATTRIBUTE_HINTS.get(attribute.name);\n}\nfunction describeUnsupportedMongoAttribute(sources) {\n\treturn ({ attribute, level, owner, field }) => {\n\t\tif (level === \"model\") return {\n\t\t\tcode: \"PSL_UNSUPPORTED_MODEL_ATTRIBUTE\",\n\t\t\tmessage: `${owner.kind === \"mixin\" ? \"Mixin\" : \"Model\"} \"${owner.name}\" uses unsupported attribute \"@@${attribute.name}\"`,\n\t\t\t...diagnosticSource(sources, owner.node.syntax).at(attribute.span)\n\t\t};\n\t\tif (field === void 0) return void 0;\n\t\tconst base = `Field \"${owner.name}.${field.name}\" uses unsupported attribute \"@${attribute.name}\"`;\n\t\tconst hint = unloweredAttributeHint(attribute);\n\t\treturn {\n\t\t\tcode: \"PSL_UNSUPPORTED_FIELD_ATTRIBUTE\",\n\t\t\tmessage: hint === void 0 ? base : `${base}. ${hint}`,\n\t\t\t...diagnosticSource(sources, field.node.syntax).at(attribute.span)\n\t\t};\n\t};\n}\nfunction interpretModelAttribute(input) {\n\tconst result = interpretAttribute(input.node, input.spec, buildModelAttributeCtx({\n\t\tsymbols: input.symbols,\n\t\tselfModel: input.model,\n\t\tsources: input.sources,\n\t\tbinder: input.binder\n\t}));\n\tif (!result.ok) {\n\t\tinput.diagnostics.push(...result.failure);\n\t\treturn;\n\t}\n\treturn result.value;\n}\nfunction interpretFieldAttribute(input) {\n\tconst result = interpretAttribute(input.node, input.spec, buildFieldAttributeCtx({\n\t\tsymbols: input.symbols,\n\t\tselfModel: input.model,\n\t\tfield: input.field,\n\t\tsources: input.sources,\n\t\tbinder: input.binder\n\t}));\n\tif (!result.ok) {\n\t\tinput.diagnostics.push(...result.failure);\n\t\treturn;\n\t}\n\treturn result.value;\n}\nconst mapModelSpec = modelAttribute(\"map\", {\n\tdocumentation: \"Maps this model to a MongoDB collection name.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: str(),\n\t\tdocumentation: \"The collection name stored in MongoDB.\"\n\t}]\n});\nconst mapFieldSpec = fieldAttribute(\"map\", {\n\tdocumentation: \"Maps this field to a stored document key.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: str(),\n\t\tdocumentation: \"The key stored in MongoDB documents.\"\n\t}]\n});\nconst idFieldSpec = fieldAttribute(\"id\", { documentation: \"Marks the field stored as `_id`, the document’s id. The field must be stored as `_id`: name it `_id` or add `@map(\\\"_id\\\")`. A model may leave `@id` out; its documents still get an ObjectId `_id`.\" });\nconst uniqueFieldSpec = fieldAttribute(\"unique\", { documentation: \"Requires values in this field to be unique across the collection.\" });\nconst relationFieldSpec = fieldAttribute(\"relation\", {\n\tdocumentation: \"Names a relation and associates local fields with fields on the referenced model.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: optional(str()),\n\t\tdocumentation: \"The relation name used to pair both sides. May also be supplied by name.\"\n\t}],\n\tnamed: {\n\t\tname: {\n\t\t\ttype: optional(str()),\n\t\t\tdocumentation: \"The relation name used to pair both sides. Cannot also be supplied positionally.\"\n\t\t},\n\t\tfields: {\n\t\t\ttype: optional(list(fieldRef(), {\n\t\t\t\tallowEmpty: false,\n\t\t\t\tunique: true\n\t\t\t})),\n\t\t\tdocumentation: \"The ordered local fields holding references to related documents.\"\n\t\t},\n\t\treferences: {\n\t\t\ttype: optional(list(referencedFieldRef(), {\n\t\t\t\tallowEmpty: false,\n\t\t\t\tunique: true\n\t\t\t})),\n\t\t\tdocumentation: \"The corresponding fields on the referenced model.\"\n\t\t}\n\t}\n});\nconst discriminatorModelSpec = modelAttribute(\"discriminator\", {\n\tdocumentation: \"Selects the field that distinguishes inheritance variants in this collection.\",\n\tpositional: [{\n\t\tkey: \"field\",\n\t\ttype: fieldRef(),\n\t\tdocumentation: \"The discriminator field on this model.\"\n\t}]\n});\nfunction baseModelSpec() {\n\treturn modelAttribute(\"base\", {\n\t\tdocumentation: \"Declares this model as a variant of a base model.\",\n\t\tpositional: [{\n\t\t\tkey: \"base\",\n\t\t\ttype: entityRef({ kind: \"model\" }),\n\t\t\tdocumentation: \"The base model to inherit from.\"\n\t\t}, {\n\t\t\tkey: \"value\",\n\t\t\ttype: writtenScalar(str()),\n\t\t\tdocumentation: \"The discriminator value identifying this variant, a value of the discriminator field's type.\"\n\t\t}]\n\t});\n}\nconst indexFieldElement = oneOf(fieldRef(), funcCall(\"wildcard\", {\n\tdocumentation: \"Indexes document fields using a MongoDB wildcard index.\",\n\tpositional: [{\n\t\tkey: \"scope\",\n\t\ttype: optional(identifier()),\n\t\tdocumentation: \"The field path to index recursively. Omit to index all document fields.\"\n\t}]\n}), funcCall(\"sort\", {\n\tdocumentation: \"Selects an index field with an explicit sort direction.\",\n\tpositional: [{\n\t\tkey: \"field\",\n\t\ttype: fieldRef(),\n\t\tdocumentation: \"The model field to index.\"\n\t}, {\n\t\tkey: \"direction\",\n\t\ttype: oneOf(identifier(\"Asc\", { documentation: \"Sort ascending.\" }), identifier(\"Desc\", { documentation: \"Sort descending.\" })),\n\t\tdocumentation: \"The index order for this field: `Asc` or `Desc`.\"\n\t}]\n}));\nconst collationNamedArgs = {\n\tcollationLocale: {\n\t\ttype: optional(str()),\n\t\tdocumentation: \"The ICU locale used for string comparison, or `simple` for binary comparison.\"\n\t},\n\tcollationStrength: {\n\t\ttype: optional(oneOf(num(1), num(2), num(3), num(4), num(5))),\n\t\tdocumentation: \"The collation comparison level, from `1` (primary differences) through `5` (identical).\"\n\t},\n\tcollationCaseLevel: {\n\t\ttype: optional(bool()),\n\t\tdocumentation: \"Whether case differences are compared at strength `1` or `2`.\"\n\t},\n\tcollationCaseFirst: {\n\t\ttype: optional(oneOf(str(\"upper\"), str(\"lower\"), str(\"off\"))),\n\t\tdocumentation: \"Whether uppercase or lowercase sorts first, or `off` for the locale default.\"\n\t},\n\tcollationNumericOrdering: {\n\t\ttype: optional(bool()),\n\t\tdocumentation: \"Whether numeric strings are compared as numbers rather than lexicographically.\"\n\t},\n\tcollationAlternate: {\n\t\ttype: optional(oneOf(str(\"non-ignorable\"), str(\"shifted\"))),\n\t\tdocumentation: \"Whether punctuation and whitespace are significant or shifted to a later comparison level.\"\n\t},\n\tcollationMaxVariable: {\n\t\ttype: optional(oneOf(str(\"punct\"), str(\"space\"))),\n\t\tdocumentation: \"Which characters are ignored when alternate handling is `shifted`: punctuation or spaces.\"\n\t},\n\tcollationBackwards: {\n\t\ttype: optional(bool()),\n\t\tdocumentation: \"Whether secondary differences, such as accents, are compared in reverse order.\"\n\t},\n\tcollationNormalization: {\n\t\ttype: optional(bool()),\n\t\tdocumentation: \"Whether strings are checked and normalized before comparison.\"\n\t}\n};\nfunction buildIndexModelSpec(name) {\n\treturn modelAttribute(name, {\n\t\tdocumentation: name === \"unique\" ? \"Declares a unique MongoDB index over the selected fields.\" : \"Declares a MongoDB index over the selected fields.\",\n\t\tpositional: [{\n\t\t\tkey: \"fields\",\n\t\t\ttype: list(indexFieldElement, { allowEmpty: false }),\n\t\t\tdocumentation: name === \"unique\" ? \"The nonempty list of indexed fields, optionally with sort directions. Wildcard scopes are not supported.\" : \"The nonempty list of indexed fields, optionally with sort directions or a wildcard scope.\"\n\t\t}],\n\t\tnamed: {\n\t\t\ttype: {\n\t\t\t\ttype: optional(oneOf(num(1), num(-1), str(\"text\"), str(\"2dsphere\"), str(\"2d\"), str(\"hashed\"))),\n\t\t\t\tdocumentation: \"The MongoDB index key type: ascending `1`, descending `-1`, text, geospatial, or hashed.\"\n\t\t\t},\n\t\t\tsparse: {\n\t\t\t\ttype: optional(bool()),\n\t\t\t\tdocumentation: \"Whether documents missing indexed fields are omitted from the index.\"\n\t\t\t},\n\t\t\texpireAfterSeconds: {\n\t\t\t\ttype: optional(int()),\n\t\t\t\tdocumentation: \"The expiration interval in seconds for a TTL index.\"\n\t\t\t},\n\t\t\tfilter: {\n\t\t\t\ttype: optional(json()),\n\t\t\t\tdocumentation: \"A JSON partial-filter expression limiting which documents are indexed.\"\n\t\t\t},\n\t\t\tinclude: {\n\t\t\t\ttype: optional(list(str())),\n\t\t\t\tdocumentation: \"Document paths included in the wildcard index projection.\"\n\t\t\t},\n\t\t\texclude: {\n\t\t\t\ttype: optional(list(str())),\n\t\t\t\tdocumentation: \"Document paths excluded from the wildcard index projection.\"\n\t\t\t},\n\t\t\tdefault_language: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The default language for text-index tokenization and stemming.\"\n\t\t\t},\n\t\t\tlanguageOverride: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The document field that overrides the text-index language.\"\n\t\t\t},\n\t\t\t...collationNamedArgs\n\t\t}\n\t});\n}\nfunction buildTextIndexModelSpec() {\n\treturn modelAttribute(\"textIndex\", {\n\t\tdocumentation: \"Declares a MongoDB text index with optional field weights and language settings.\",\n\t\tpositional: [{\n\t\t\tkey: \"fields\",\n\t\t\ttype: list(indexFieldElement, { allowEmpty: false }),\n\t\t\tdocumentation: \"The nonempty list of fields whose text is indexed.\"\n\t\t}],\n\t\tnamed: {\n\t\t\tfilter: {\n\t\t\t\ttype: optional(json()),\n\t\t\t\tdocumentation: \"A JSON partial-filter expression limiting which documents are indexed.\"\n\t\t\t},\n\t\t\tweights: {\n\t\t\t\ttype: optional(record(int({\n\t\t\t\t\tmin: 1,\n\t\t\t\t\tmax: 99999\n\t\t\t\t}))),\n\t\t\t\tdocumentation: \"Relative text-search weights by field, each from `1` through `99999`.\"\n\t\t\t},\n\t\t\tlanguage: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The default language for tokenization and stemming.\"\n\t\t\t},\n\t\t\tlanguageOverride: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The document field that overrides the text-index language.\"\n\t\t\t},\n\t\t\t...collationNamedArgs\n\t\t}\n\t});\n}\nfunction staticModelSpec(spec) {\n\treturn () => spec;\n}\nfunction staticFieldSpec(spec) {\n\treturn () => spec;\n}\nconst mongoAttributeSpecs = {\n\tmodel: {\n\t\tmap: staticModelSpec(mapModelSpec),\n\t\tdiscriminator: staticModelSpec(discriminatorModelSpec),\n\t\tbase: baseModelSpec,\n\t\tindex: staticModelSpec(buildIndexModelSpec(\"index\")),\n\t\tunique: staticModelSpec(buildIndexModelSpec(\"unique\")),\n\t\ttextIndex: staticModelSpec(buildTextIndexModelSpec())\n\t},\n\tfield: {\n\t\tid: staticFieldSpec(idFieldSpec),\n\t\tunique: staticFieldSpec(uniqueFieldSpec),\n\t\tmap: staticFieldSpec(mapFieldSpec),\n\t\trelation: staticFieldSpec(relationFieldSpec),\n\t\tonCreate: generatorAttributeSpec(\"onCreate\"),\n\t\tonUpdate: generatorAttributeSpec(\"onUpdate\")\n\t}\n};\n//#endregion\n//#region src/pair-back-relations.ts\n/**\n* Matches each back-relation with the foreign key on the other model: same model pair, and the same relation name when the back-relation has one. A back-relation with no match is orphaned unless its foreign key was already reported (`invalidFkPairings`); one with several matches is ambiguous.\n*/\nfunction pairMongoBackRelations(input) {\n\tconst foreignKeysByPair = /* @__PURE__ */ new Map();\n\tfor (const fk of input.foreignKeys) {\n\t\tconst key = fkRelationPairKey(fk.declaringModel, fk.targetModel);\n\t\tconst existing = foreignKeysByPair.get(key);\n\t\tif (existing) existing.push(fk);\n\t\telse foreignKeysByPair.set(key, [fk]);\n\t}\n\tconst relations = [];\n\tconst diagnostics = [];\n\tfor (const candidate of input.candidates) {\n\t\tconst { field, modelName, targetModelName } = candidate;\n\t\tconst source = diagnosticSource(candidate.sources, field.node.syntax);\n\t\tconst pairKey = fkRelationPairKey(targetModelName, modelName);\n\t\tconst pairMatches = foreignKeysByPair.get(pairKey) ?? [];\n\t\tconst matches = candidate.relationName ? pairMatches.filter((fk) => fk.relationName === candidate.relationName) : pairMatches;\n\t\tif (matches.length === 0) {\n\t\t\tif (consumeInvalidFkPairing(candidate, pairKey, input.invalidFkPairings)) continue;\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_ORPHANED_BACKRELATION\",\n\t\t\t\tmessage: `Backrelation list field \"${modelName}.${field.name}\" has no matching FK-side relation on model \"${targetModelName}\". Add @relation(fields: [...], references: [...]) on the FK-side relation or use an explicit join model for many-to-many.`,\n\t\t\t\t...source.at(field.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst [fk] = matches;\n\t\tif (fk === void 0 || matches.length > 1) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_AMBIGUOUS_BACKRELATION\",\n\t\t\t\tmessage: `Backrelation list field \"${modelName}.${field.name}\" matches multiple FK-side relations on model \"${targetModelName}\". Add @relation(\"...\") to both sides to disambiguate.`,\n\t\t\t\t...source.at(field.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (candidate.cardinality === \"1:1\" && !field.optional) diagnostics.push(requiredOneToOneBackrelationDiagnostic({\n\t\t\tmodelName,\n\t\t\tfield,\n\t\t\ttargetModelName,\n\t\t\tsources: candidate.sources,\n\t\t\trecordNoun: \"document\"\n\t\t}));\n\t\trelations.push({\n\t\t\tmodelName,\n\t\t\tfieldName: field.name,\n\t\t\trelation: {\n\t\t\t\tto: crossRef(targetModelName, input.namespaceId),\n\t\t\t\t...candidate.cardinality === \"1:N\" ? { cardinality: \"1:N\" } : {\n\t\t\t\t\tcardinality: \"1:1\",\n\t\t\t\t\tnullable: true\n\t\t\t\t},\n\t\t\t\ton: {\n\t\t\t\t\tlocalFields: fk.targetFields,\n\t\t\t\t\ttargetFields: fk.localFields\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\treturn {\n\t\trelations,\n\t\tdiagnostics\n\t};\n}\n//#endregion\n//#region src/psl-helpers.ts\n/** Storage collection name of a model that declares no `@@map`: the model name, verbatim. */\nfunction defaultCollectionName(modelName) {\n\treturn modelName;\n}\nfunction getAttribute(attributes, name) {\n\treturn attributes.find((attr) => attr.name === name);\n}\n//#endregion\n//#region src/refusal-diagnostics.ts\nfunction fieldSiteKey(owner, fieldName) {\n\treturn JSON.stringify([owner, fieldName]);\n}\nfunction fieldSiteOf(sites, key) {\n\tconst site = sites.fields.get(fieldSiteKey(key.owner.name, key.field));\n\tif (site === void 0) throw new InternalError(`A refused field \"${key.owner.name}.${key.field}\" has a site.`);\n\treturn site;\n}\nfunction modelSitesOf(sites, model) {\n\tconst modelSites = sites.models.get(model);\n\tif (modelSites === void 0) throw new InternalError(`A refused model \"${model}\" has sites.`);\n\treturn modelSites;\n}\nfunction at(site, code, message) {\n\treturn {\n\t\tcode,\n\t\tmessage,\n\t\t...site.source.at(site.span)\n\t};\n}\nfunction atField(field, code, message) {\n\treturn {\n\t\tcode,\n\t\tmessage,\n\t\t...field.source.at(field.symbol.span)\n\t};\n}\nfunction atFieldCall(field, code, message) {\n\treturn {\n\t\tcode,\n\t\tmessage,\n\t\t...field.source.at(field.symbol.typeConstructor?.span ?? field.symbol.span)\n\t};\n}\nfunction generatedListDiagnostic(field, label) {\n\tconst perElement = \"Lists have no per-element generated values;\";\n\tconst phase = field.generatorAttributes.onCreate !== void 0 ? \"onCreate\" : \"onUpdate\";\n\tconst attribute = field.generatorAttributes[phase];\n\tif (attribute !== void 0) return {\n\t\tcode: \"PSL_LIST_EXECUTION_DEFAULT_UNSUPPORTED\",\n\t\tmessage: `${label} is a list and cannot use @${phase}(${attribute.argument}). ${perElement} remove @${phase}(...).`,\n\t\t...field.source.at(attribute.span)\n\t};\n\treturn atField(field, \"PSL_LIST_EXECUTION_DEFAULT_UNSUPPORTED\", `${label} is a list, and its type alias \"${field.typeAlias?.name}\" generates a value. ${perElement} remove \"[]\" or type the field without the alias.`);\n}\nfunction generatedOnValueObjectDiagnostic(field, owner) {\n\tconst fieldName = field.symbol.name;\n\treturn atField(field, \"PSL_UNSUPPORTED_FIELD_TYPE\", `Member \"${fieldName}\" of composite type \"${owner}\" is typed by the type alias \"${field.typeAlias?.name}\", which generates a value; a composite type member has no generated values.`);\n}\nfunction relationNullabilityDiagnostic(field, model, ownsForeignKey) {\n\tconst fieldLabel = `Relation field \"${model}.${field.symbol.name}\"`;\n\tif (!ownsForeignKey) return atField(field, \"PSL_REQUIRED_ONE_TO_ONE_BACKRELATION\", `${fieldLabel} is required, but the other model holds the relation fields, so nothing in storage guarantees the related document exists. Make it optional with \"?\".`);\n\treturn atField(field, \"PSL_RELATION_NULLABILITY_MISMATCH\", field.symbol.optional ? `${fieldLabel} is optional but every field in @relation(fields: [...]) is required. Make one of those fields optional with \"?\" or remove \"?\" from \"${field.symbol.name}\".` : `${fieldLabel} is required but a field in @relation(fields: [...]) is optional. Add \"?\" to \"${field.symbol.name}\" or make those fields required.`);\n}\nconst INDEX_SHAPE_MESSAGES = {\n\t\"unique-wildcard\": () => \"Unique indexes cannot use wildcard() fields\",\n\t\"hashed-several-fields\": () => \"Hashed indexes must have exactly one field\",\n\t\"ttl-with-wildcard\": () => \"expireAfterSeconds cannot be combined with wildcard() fields\",\n\t\"projection-without-wildcard\": () => \"include/exclude options are only valid when the index contains a wildcard() field\",\n\t\"collation-without-locale\": () => \"collationLocale is required when using collation options\",\n\t\"second-text-index\": (model) => `Only one @@textIndex is allowed per collection (model \"${model}\")`\n};\nfunction validatorDiagnostic(refusal, sites) {\n\tswitch (refusal.kind) {\n\t\tcase \"enumBsonType\":\n\t\tcase \"enumNotListable\":\n\t\tcase \"enumMemberNotListable\": {\n\t\t\tconst site = sites.enums.get(refusal.enumName);\n\t\t\tif (site === void 0) throw new InternalError(`Enum \"${refusal.enumName}\" has a site.`);\n\t\t\tconst subject = `enum \"${refusal.enumName}\"`;\n\t\t\tconst base = {\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tsourceId: site.block.sourceId\n\t\t\t};\n\t\t\tif (refusal.kind === \"enumBsonType\") return {\n\t\t\t\t...base,\n\t\t\t\tmessage: `${subject} ${refusal.refusal.reason}`,\n\t\t\t\tspan: site.codecSpan\n\t\t\t};\n\t\t\tif (refusal.kind === \"enumNotListable\") return {\n\t\t\t\t...base,\n\t\t\t\tmessage: `${subject} @@type codec \"${refusal.codecId}\" ${refusal.reason}`,\n\t\t\t\tspan: site.codecSpan\n\t\t\t};\n\t\t\treturn {\n\t\t\t\t...base,\n\t\t\t\tmessage: `${subject} member \"${refusal.member}\" ${refusal.reason}`,\n\t\t\t\tspan: site.block.memberSpans[refusal.member] ?? site.codecSpan\n\t\t\t};\n\t\t}\n\t\tcase \"fieldBsonType\":\n\t\tcase \"documentId\": {\n\t\t\tconst owner = refusal.kind === \"fieldBsonType\" ? refusal.owner.name : refusal.modelName;\n\t\t\tconst field = fieldSiteOf(sites, {\n\t\t\t\tkind: \"field\",\n\t\t\t\towner: {\n\t\t\t\t\tkind: \"model\",\n\t\t\t\t\tname: owner\n\t\t\t\t},\n\t\t\t\tfield: refusal.fieldName\n\t\t\t});\n\t\t\treturn atField(field, refusal.kind === \"fieldBsonType\" ? \"PSL_UNSUPPORTED_FIELD_TYPE\" : \"PSL_MONGO_ID_INVALID\", `Field \"${owner}.${field.symbol.name}\" ${refusal.kind === \"fieldBsonType\" ? refusal.refusal.reason : refusal.reason}`);\n\t\t}\n\t\tcase \"embeddedModelHasVariants\": throw new InternalError(\"A PSL schema writes no embed relations.\");\n\t}\n}\n/**\n* The diagnostic for one refusal of the builder, at the place in the schema it is about, worded as PSL words it. A source position comes from the refusal's key.\n*/\nfunction refusalDiagnostic(refusal, sites) {\n\tswitch (refusal.kind) {\n\t\tcase \"storedNameUnsupported\": return atField(fieldSiteOf(sites, refusal.key), \"PSL_STORED_NAME_UNSUPPORTED\", `Field \"${refusal.key.owner.name}.${refusal.key.field}\" ${refusal.reason}. Give the field another stored name with @map.`);\n\t\tcase \"storedNameDuplicate\": {\n\t\t\tconst model = refusal.key.owner.name;\n\t\t\treturn atField(fieldSiteOf(sites, refusal.key), \"PSL_DUPLICATE_STORED_NAME\", `Fields \"${model}.${refusal.firstField}\" and \"${model}.${refusal.key.field}\" are both stored as \"${refusal.storedName}\". Give each field its own stored name with @map.`);\n\t\t}\n\t\tcase \"restatedBaseFieldDiffers\": return atField(fieldSiteOf(sites, refusal.key), \"PSL_VARIANT_FIELD_DIFFERS_FROM_BASE\", `Field \"${refusal.key.owner.name}.${refusal.key.field}\" restates field \"${refusal.key.field}\" of base model \"${refusal.baseModel}\" with a different ${refusal.differences.map(differenceWording).join(\" and \")}. A variant's documents are checked against the base's field, so declare it exactly as the base does, or remove it from the variant.`);\n\t\tcase \"storedNameSharedWithBase\": return atField(fieldSiteOf(sites, refusal.key), \"PSL_DUPLICATE_STORED_NAME\", `Fields \"${refusal.baseModel}.${refusal.baseField}\" and \"${refusal.key.owner.name}.${refusal.key.field}\" are both stored as \"${refusal.storedName}\", and a variant's documents hold its base's fields too. Give each field its own stored name with @map.`);\n\t\tcase \"valueObjectFieldStoredName\": {\n\t\t\tconst field = fieldSiteOf(sites, refusal.key);\n\t\t\treturn at(field.map ?? {\n\t\t\t\tsource: field.source,\n\t\t\t\tspan: field.symbol.span\n\t\t\t}, \"PSL_MONGO_TYPE_FIELD_MAP_UNSUPPORTED\", `Field \"${refusal.key.owner.name}.${refusal.key.field}\" has @map, but a field of a composite type is stored under its own name. Remove @map, or rename the field to the name it is stored under.`);\n\t\t}\n\t\tcase \"relationLocalFieldUnknown\": {\n\t\t\tconst { model, relation } = refusal.key;\n\t\t\treturn atField(fieldSiteOf(sites, {\n\t\t\t\tkind: \"field\",\n\t\t\t\towner: {\n\t\t\t\t\tkind: \"model\",\n\t\t\t\t\tname: model\n\t\t\t\t},\n\t\t\t\tfield: relation\n\t\t\t}), \"PSL_INVALID_ATTRIBUTE_ARGUMENT\", `Relation field \"${model}.${relation}\" joins on field \"${refusal.fieldName}\", which model \"${model}\" does not declare`);\n\t\t}\n\t\tcase \"relationNullability\": {\n\t\t\tconst { model, relation } = refusal.key;\n\t\t\treturn relationNullabilityDiagnostic(fieldSiteOf(sites, {\n\t\t\t\tkind: \"field\",\n\t\t\t\towner: {\n\t\t\t\t\tkind: \"model\",\n\t\t\t\t\tname: model\n\t\t\t\t},\n\t\t\t\tfield: relation\n\t\t\t}), model, refusal.ownsForeignKey);\n\t\t}\n\t\tcase \"variantCollectionDiffers\": {\n\t\t\tconst base = modelSitesOf(sites, refusal.key.model).base;\n\t\t\tif (base === void 0) throw new InternalError(\"A variant has a @@base site.\");\n\t\t\treturn at(base, \"PSL_MONGO_VARIANT_SEPARATE_COLLECTION\", `Mongo variant \"${refusal.key.model}\" cannot use a different collection than its base \"${refusal.baseModel}\". Mongo only supports single-collection polymorphism.`);\n\t\t}\n\t\tcase \"indexFieldUnknown\":\n\t\tcase \"indexShape\":\n\t\tcase \"indexScopeConflict\":\n\t\tcase \"indexDuplicate\": {\n\t\t\tconst { model, position } = refusal.key;\n\t\t\tconst site = modelSitesOf(sites, model).indexes[position];\n\t\t\tif (site === void 0) throw new InternalError(`Index ${position} of \"${model}\" has a site.`);\n\t\t\tswitch (refusal.kind) {\n\t\t\t\tcase \"indexFieldUnknown\": return at(site, \"PSL_INDEX_FIELD_NOT_FOUND\", `Index on model \"${model}\" references unknown field \"${refusal.fieldName}\"`);\n\t\t\t\tcase \"indexShape\": return at(site, \"PSL_INVALID_INDEX\", refusal.rule === \"wildcard-with-type\" ? `wildcard() fields cannot be combined with type: ${wildcardTypeOf(site.index)}` : INDEX_SHAPE_MESSAGES[refusal.rule](model));\n\t\t\t\tcase \"indexScopeConflict\": return at(site, \"PSL_INVALID_INDEX\", `Variant \"${model}\" index conflicts with discriminator scope: ${refusal.reason}`);\n\t\t\t\tcase \"indexDuplicate\": throw new InternalError(`PSL merges identical indexes before the build, so index ${position} of \"${model}\" cannot duplicate one of model \"${refusal.firstModel}\" in collection \"${refusal.collection}\". This is a defect in the PSL interpreter.`);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"generatedOnValueObject\": return generatedOnValueObjectDiagnostic(fieldSiteOf(sites, refusal.key), refusal.key.owner.name);\n\t\tcase \"generatorPhaseSetTwice\": throw new InternalError(`Field \"${refusal.key.owner.name}.${refusal.key.field}\" sets a phase twice, which PSL refuses as a repeated type alias attribute before building.`);\n\t\tcase \"generatedList\": return generatedListDiagnostic(fieldSiteOf(sites, refusal.key), `Field \"${refusal.key.owner.name}.${refusal.key.field}\"`);\n\t\tcase \"generatedOnVariant\": return atField(fieldSiteOf(sites, refusal.key), \"PSL_GENERATOR_ON_VARIANT_FIELD\", `Generated value on variant \"${refusal.key.owner.name}\" field \"${refusal.key.field}\": execution defaults apply to every document in collection \"${refusal.collection}\", so declare them on the base model.`);\n\t\tcase \"generatedConflict\": {\n\t\t\tconst field = fieldSiteOf(sites, refusal.key);\n\t\t\treturn atField(field, \"PSL_GENERATOR_CONFLICT\", `Generated value on \"${refusal.key.owner.name}.${refusal.key.field}\" sets different execution defaults than \"${refusal.otherModel}.${refusal.otherField}\" for field \"${field.storedName}\" of collection \"${refusal.collection}\". Generate the same values on both models.`);\n\t\t}\n\t\tcase \"typeParamsInvalid\": return atFieldCall(fieldSiteOf(sites, refusal.key), \"PSL_INVALID_ATTRIBUTE_ARGUMENT\", `${`Field \"${refusal.key.owner.name}.${refusal.key.field}\"`} has type parameters its type refuses: ${refusal.problem.message}`);\n\t\tcase \"enumMemberProblem\": {\n\t\t\tconst site = sites.enums.get(refusal.enumName);\n\t\t\tif (site === void 0) throw new InternalError(`Enum \"${refusal.enumName}\" has a site.`);\n\t\t\treturn enumMemberProblemDiagnostic(refusal.problem, site.block);\n\t\t}\n\t\tcase \"enumUnknown\": return atField(fieldSiteOf(sites, refusal.key), \"PSL_UNRESOLVED_REFERENCE\", `Field \"${refusal.key.owner.name}.${refusal.key.field}\" is typed by enum \"${refusal.enumName}\", which the schema does not declare`);\n\t\tcase \"discriminatorValueDuplicate\": {\n\t\t\tconst base = modelSitesOf(sites, refusal.key.variant).base;\n\t\t\tif (base === void 0) throw new InternalError(\"A variant has a @@base site.\");\n\t\t\treturn at(base, \"PSL_DUPLICATE_DISCRIMINATOR_VALUE\", `Discriminator value \"${refusal.value}\" is used by both \"${refusal.firstVariant}\" and \"${refusal.key.variant}\" on base model \"${refusal.baseModel}\"`);\n\t\t}\n\t\tcase \"discriminatorFieldUnknown\":\n\t\tcase \"discriminatorField\":\n\t\tcase \"discriminatorAndBase\":\n\t\tcase \"discriminatorWithoutVariants\": {\n\t\t\tconst model = refusal.key.model;\n\t\t\tconst site = modelSitesOf(sites, model).discriminator;\n\t\t\tif (site === void 0) throw new InternalError(\"A base has a @@discriminator site.\");\n\t\t\tswitch (refusal.kind) {\n\t\t\t\tcase \"discriminatorFieldUnknown\": return at(site, \"PSL_DISCRIMINATOR_FIELD_NOT_FOUND\", `Discriminator field \"${refusal.fieldName}\" is not a field on model \"${model}\"`);\n\t\t\t\tcase \"discriminatorField\": return at(site, \"PSL_INVALID_ATTRIBUTE_ARGUMENT\", describeDiscriminatorRefusal(refusal.refusal, {\n\t\t\t\t\tmodelName: model,\n\t\t\t\t\tfieldName: refusal.fieldName,\n\t\t\t\t\ttypeName: discriminatorTypeName(sites, model, refusal.fieldName),\n\t\t\t\t\tenumName: void 0,\n\t\t\t\t\tvariantName: () => model\n\t\t\t\t}));\n\t\t\t\tcase \"discriminatorAndBase\": return at(site, \"PSL_DISCRIMINATOR_AND_BASE\", `Model \"${model}\" cannot have both @@discriminator and @@base`);\n\t\t\t\tcase \"discriminatorWithoutVariants\": return at(site, \"PSL_ORPHANED_DISCRIMINATOR\", `Model \"${model}\" has @@discriminator but no variant models declare @@base(${model}, ...)`);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"discriminatorValue\": {\n\t\t\tconst base = modelSitesOf(sites, refusal.key.variant).base;\n\t\t\tif (base === void 0) throw new InternalError(\"A variant has a @@base site.\");\n\t\t\tconst valueSite = {\n\t\t\t\tsource: base.source,\n\t\t\t\tspan: base.valueSpan\n\t\t\t};\n\t\t\tif (refusal.refusal.kind === \"unreadable\") return {\n\t\t\t\t...refusal.refusal.refusal,\n\t\t\t\t...valueSite.source.at(valueSite.span)\n\t\t\t};\n\t\t\treturn at(valueSite, \"PSL_INVALID_ATTRIBUTE_ARGUMENT\", describeDiscriminatorRefusal(refusal.refusal, {\n\t\t\t\tmodelName: refusal.baseModel,\n\t\t\t\tfieldName: refusal.fieldName,\n\t\t\t\ttypeName: discriminatorTypeName(sites, refusal.baseModel, refusal.fieldName),\n\t\t\t\tenumName: refusal.enumName,\n\t\t\t\tvariantName: (variant) => variant\n\t\t\t}));\n\t\t}\n\t\tcase \"baseWithoutDiscriminator\": {\n\t\t\tconst base = modelSitesOf(sites, refusal.key.variant).base;\n\t\t\tif (base === void 0) throw new InternalError(\"A variant has a @@base site.\");\n\t\t\treturn at(base, \"PSL_ORPHANED_BASE\", `Model \"${refusal.key.variant}\" declares @@base(${refusal.baseModel}, ...) but \"${refusal.baseModel}\" has no @@discriminator`);\n\t\t}\n\t\tcase \"validator\": return validatorDiagnostic(refusal.refusal, sites);\n\t\tcase \"duplicateModel\":\n\t\tcase \"duplicateValueObject\":\n\t\tcase \"collectionSettingWithoutCollection\":\n\t\tcase \"collectionSettingTwice\":\n\t\tcase \"generatorUnknown\":\n\t\tcase \"generatorNotApplicable\":\n\t\tcase \"generatedWithoutCollection\":\n\t\tcase \"enumKeyMismatch\":\n\t\tcase \"listedVariantMissing\":\n\t\tcase \"baseUnknown\":\n\t\tcase \"variantWithoutValue\": throw new InternalError(`A PSL definition cannot be refused with \"${refusal.kind}\".`);\n\t}\n}\n/** The key type a wildcard index combines with. */\nfunction wildcardTypeOf(index) {\n\treturn (Object.values(index.fields).find((direction) => direction === \"hashed\" || direction === \"2d\" || direction === \"2dsphere\") ?? \"hashed\").toString();\n}\nfunction discriminatorTypeName(sites, model, fieldName) {\n\treturn sites.fields.get(fieldSiteKey(model, fieldName))?.symbol.typeName ?? fieldName;\n}\nfunction differenceWording(difference) {\n\tswitch (difference) {\n\t\tcase \"storedName\": return \"@map\";\n\t\tcase \"type\": return \"type\";\n\t\tcase \"nullable\": return \"optionality\";\n\t\tcase \"many\": return \"list shape\";\n\t}\n}\n//#endregion\n//#region src/type-aliases.ts\n/** The field type a use of a type choice gives: the column of the constructor its call chooses, read and refused as a SQL column's is. `undefined`, with a diagnostic pushed, when the call is refused. */\nfunction scalarTypeOfChoice(input) {\n\tconst output = instantiatePslTypeChoice(input);\n\treturn output === void 0 ? void 0 : {\n\t\tkind: \"scalar\",\n\t\tcodecId: output.codecId,\n\t\t...ifDefined(\"typeParams\", output.typeParams)\n\t};\n}\n/** The field type a type constructor gives, keeping a bare constructor's fixed type params. */\nfunction scalarTypeOfConstructor(descriptor, call) {\n\tif (call !== void 0) return {\n\t\tkind: \"scalar\",\n\t\tcodecId: descriptor.output.codecId\n\t};\n\tconst { codecId, typeParams } = instantiateAuthoringTypeConstructor(descriptor, []);\n\treturn {\n\t\tkind: \"scalar\",\n\t\tcodecId,\n\t\t...ifDefined(\"typeParams\", typeParams)\n\t};\n}\nconst GENERATOR_PHASES$1 = [\"onCreate\", \"onUpdate\"];\nconst MONGO_TYPE_ALIAS_ATTRIBUTE_NAMES = new Set(GENERATOR_PHASES$1);\nfunction describeUnsupportedMongoAliasAttribute(attribute, declaration) {\n\tif (attribute.name !== \"default\") return void 0;\n\tconst base = `Type alias \"${declaration.name}\" uses unsupported attribute \"@default\"`;\n\tconst hint = unloweredAttributeHint(attribute);\n\treturn hint === void 0 ? base : `${base}. ${hint}`;\n}\n/**\n* The generator a field's or type alias's `@onCreate(fn())` or `@onUpdate(fn())` resolves to for its type, or `undefined` once the attribute is diagnosed.\n*/\nfunction lowerGeneratorAttribute(input) {\n\tconst interpreted = interpretAttribute(input.attribute.node, typeGeneratorAttributeSpec(input.phase, input.specContext), {\n\t\tsources: input.sources,\n\t\tsymbols: input.symbols,\n\t\tbinder: input.binder\n\t});\n\tif (!interpreted.ok) {\n\t\tinput.diagnostics.push(...interpreted.failure);\n\t\treturn;\n\t}\n\tconst call = interpreted.value.value;\n\tconst { type } = input;\n\tconst resolution = type.kind === \"scalar\" ? input.generatorFunctions.resolve({\n\t\tname: call.fn,\n\t\targs: call.args\n\t}, {\n\t\tcodecId: type.codecId,\n\t\ttypeParams: type.typeParams,\n\t\tlength: void 0\n\t}) : void 0;\n\tif (resolution?.ok === true) return resolution.generator;\n\tconst label = typeAttributeSubjectLabel(input.specContext.subject);\n\tinput.diagnostics.push({\n\t\tcode: \"PSL_GENERATOR_NOT_APPLICABLE\",\n\t\tmessage: resolution?.reason === \"refused\" ? `${label}: ${resolution.message}` : `${label}: ${call.fn}() does not apply to this field's type.`,\n\t\t...diagnosticSource(input.sources, input.attribute.node.syntax).at(call.span)\n\t});\n}\nfunction aliasType(alias, input) {\n\tconst { base, symbol } = alias;\n\tif (base.kind === \"typeConstructor\") return {\n\t\ttype: scalarTypeOfConstructor(base.descriptor, base.call),\n\t\tvalueSet: void 0\n\t};\n\tif (base.kind === \"typeChoice\") {\n\t\tconst type = scalarTypeOfChoice({\n\t\t\tsymbol: base.symbol,\n\t\t\tcall: base.call,\n\t\t\tspan: symbol.span,\n\t\t\tcodecLookup: input.codecLookup,\n\t\t\tdiagnostics: input.diagnostics,\n\t\t\tsource: diagnosticSource(input.sources, symbol.node.syntax),\n\t\t\tentityLabel: `Type alias \"${symbol.name}\"`,\n\t\t\tdataTypes: input.dataTypes\n\t\t});\n\t\treturn type === void 0 ? void 0 : {\n\t\t\ttype,\n\t\t\tvalueSet: void 0\n\t\t};\n\t}\n\tif (base.symbol.keyword !== \"enum\") {\n\t\tinput.diagnostics.push({\n\t\t\tcode: \"PSL_UNSUPPORTED_NAMED_TYPE_BASE\",\n\t\t\tmessage: `Type alias \"${symbol.name}\" references unsupported base type \"${alias.baseName}\"`,\n\t\t\t...diagnosticSource(input.sources, symbol.node.syntax).at(symbol.span)\n\t\t});\n\t\treturn;\n\t}\n\tconst codecId = input.codecIdByEnumName.get(base.symbol.name);\n\tif (codecId === void 0 || alias.baseResolution.kind !== \"block\") return void 0;\n\treturn {\n\t\ttype: {\n\t\t\tkind: \"scalar\",\n\t\t\tcodecId\n\t\t},\n\t\tvalueSet: {\n\t\t\tplane: \"domain\",\n\t\t\tentityKind: \"enum\",\n\t\t\tnamespaceId: alias.baseResolution.namespace.id,\n\t\t\tentityName: base.symbol.name\n\t\t}\n\t};\n}\nfunction lowerAliasGenerators(alias, type, input) {\n\tconst specContext = typeAliasSpecContext(alias, input);\n\tconst phases = {};\n\tfor (const phase of GENERATOR_PHASES$1) {\n\t\tconst [attribute, duplicate] = alias.attributes.filter(({ name }) => name === phase);\n\t\tif (attribute === void 0) continue;\n\t\tif (duplicate !== void 0) {\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: \"PSL_DUPLICATE_ATTRIBUTE\",\n\t\t\t\tmessage: `\\`@${phase}\\` declared more than once on type alias \"${alias.symbol.name}\".`,\n\t\t\t\t...diagnosticSource(input.sources, duplicate.node.syntax).at(duplicate.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst generator = lowerGeneratorAttribute({\n\t\t\t...input,\n\t\t\tphase,\n\t\t\tattribute,\n\t\t\tspecContext,\n\t\t\ttype\n\t\t});\n\t\tif (generator !== void 0) phases[phase] = generator;\n\t}\n\treturn phases.onCreate === void 0 && phases.onUpdate === void 0 ? void 0 : phases;\n}\nfunction resolveContributedTypeAlias(alias, generatorFunctions) {\n\tconst { type } = instantiateAuthoringTypeAlias(alias.descriptor);\n\treturn {\n\t\talias,\n\t\tname: alias.name,\n\t\ttype: {\n\t\t\tkind: \"scalar\",\n\t\t\tcodecId: type.codecId,\n\t\t\t...ifDefined(\"typeParams\", type.typeParams)\n\t\t},\n\t\tvalueSet: void 0,\n\t\texecutionDefaults: resolveTypeAliasGenerators({\n\t\t\tpath: alias.name,\n\t\t\tdescriptor: alias.descriptor,\n\t\t\tgeneratorFunctions,\n\t\t\tlength: void 0\n\t\t})\n\t};\n}\n/**\n* Resolves each `types {}` alias once: its field type and the values its `@onCreate` and `@onUpdate` generate. MongoDB has no database defaults, so an alias's `@default` is refused here, once, not at each field typed by it.\n*/\nfunction resolveMongoTypeAliases(input) {\n\tconst declared = /* @__PURE__ */ new Map();\n\tconst aliases = resolveTypeAliases({\n\t\tdeclarations: input.declarations,\n\t\tbinder: input.binder,\n\t\tsources: input.sources,\n\t\tdiagnostics: input.diagnostics,\n\t\tauthoringTypes: input.authoringTypes,\n\t\tacceptedAttributes: MONGO_TYPE_ALIAS_ATTRIBUTE_NAMES,\n\t\tdescribeUnsupportedAttribute: describeUnsupportedMongoAliasAttribute\n\t});\n\tfor (const alias of aliases.values()) {\n\t\tconst resolved = aliasType(alias, input);\n\t\tif (resolved === void 0) continue;\n\t\tdeclared.set(alias.symbol, {\n\t\t\talias,\n\t\t\tname: alias.symbol.name,\n\t\t\t...resolved,\n\t\t\texecutionDefaults: lowerAliasGenerators(alias, resolved.type, input)\n\t\t});\n\t}\n\tconst contributed = /* @__PURE__ */ new Map();\n\treturn { ofResolution(resolution) {\n\t\tif (resolution?.kind === \"namedType\") return declared.get(resolution.symbol);\n\t\tconst alias = contributedTypeAliasOf(resolution);\n\t\tif (alias === void 0) return void 0;\n\t\tconst existing = contributed.get(alias.descriptor);\n\t\tif (existing !== void 0) return existing;\n\t\tconst resolved = resolveContributedTypeAlias(alias, input.generatorFunctions);\n\t\tcontributed.set(alias.descriptor, resolved);\n\t\treturn resolved;\n\t} };\n}\n//#endregion\n//#region src/interpreter.ts\n/**\n* Reports `PSL_DEPRECATED_SCALAR_NAME` at the type of a field whose scalar name is a deprecated alias, naming the replacement. The alias resolves to the same codec, so the contract does not change.\n*/\nfunction deprecatedScalarWarner(input) {\n\tconst { reportWarning } = input;\n\tif (reportWarning === void 0) return () => {};\n\treturn (field, descriptor) => {\n\t\tif (descriptor.deprecated === void 0) return;\n\t\tconst typeNode = field.node.typeAnnotation()?.name()?.syntax ?? field.node.syntax;\n\t\tconst [warning] = mapPslDiagnostics([{\n\t\t\tcode: \"PSL_DEPRECATED_SCALAR_NAME\",\n\t\t\tmessage: `Scalar type \"${field.typeName}\" is deprecated and will be removed; use \"${descriptor.deprecated.replacement}\".`,\n\t\t\t...diagnosticSource(input.sources, typeNode).at()\n\t\t}], input.sources);\n\t\tif (warning !== void 0) reportWarning({\n\t\t\t...warning,\n\t\t\tseverity: \"warning\"\n\t\t});\n\t};\n}\n/**\n* Mongo's PSL surface binds the database from the connection string, so every\n* explicit namespace block is invalid, including `namespace unbound { … }`.\n*/\nfunction validateNamespaceBlocksForMongoTarget(input) {\n\tfor (const namespace of input.namespaces) for (const { node, span } of namespace.declarations) input.diagnostics.push({\n\t\tcode: \"PSL_UNSUPPORTED_NAMESPACE_BLOCK\",\n\t\tmessage: `Mongo does not support \\`namespace ${node.name()?.name() ?? namespace.name} { … }\\` blocks (the database is bound by the connection string; declare models at the document top level instead).`,\n\t\t...diagnosticSource(input.sources, node.syntax).at(span)\n\t});\n}\nfunction resolvePhysicalNames(input) {\n\tconst { model, physicalNames, specContext, sources, binder, diagnostics } = input;\n\tconst modelMap = model.attributes.find((attr) => attr.name === \"map\");\n\tconst collectionName = modelMap ? interpretModelAttribute({\n\t\tsymbols: specContext.symbols,\n\t\tnode: modelMap.node,\n\t\tspec: mongoAttributeSpecs.model.map(specContext),\n\t\tmodel,\n\t\tsources,\n\t\tbinder,\n\t\tdiagnostics\n\t})?.name : void 0;\n\tphysicalNames.set(model, collectionName ?? defaultCollectionName(model.name));\n\tfor (const field of Object.values(model.fields)) {\n\t\tconst fieldMap = field.attributes.find((attr) => attr.name === \"map\");\n\t\tconst mapped = fieldMap ? interpretFieldAttribute({\n\t\t\tsymbols: specContext.symbols,\n\t\t\tnode: fieldMap.node,\n\t\t\tspec: mongoAttributeSpecs.field.map({\n\t\t\t\t...specContext,\n\t\t\t\tfield,\n\t\t\t\ttypeResolution: fieldTypeResolution(field, binder),\n\t\t\t\tcontributedType: contributedTypeOf(fieldTypeResolution(field, binder), binder, field.typeConstructor)\n\t\t\t}),\n\t\t\tmodel,\n\t\t\tfield,\n\t\t\tsources,\n\t\t\tbinder,\n\t\t\tdiagnostics\n\t\t})?.name : void 0;\n\t\tphysicalNames.set(field, mapped ?? field.name);\n\t}\n}\nfunction physicalName(physicalNames, symbol) {\n\tassertDefined(symbol, \"Physical names require a bound declaration\");\n\tconst name = physicalNames.get(symbol);\n\tassertDefined(name, \"Physical names must be populated before lowering\");\n\treturn name;\n}\n/** A `@@base` value as it is written; the grammar reads only a quoted string there. */\nfunction writtenBaseValue(written) {\n\tif (written.written === void 0) throw new InternalError(\"A @@base value is a quoted string, never a tagged literal.\");\n\treturn written.written;\n}\nfunction collectPolymorphismDeclarations(input) {\n\tconst { sources, binder, diagnostics } = input;\n\tconst discriminators = /* @__PURE__ */ new Map();\n\tconst bases = /* @__PURE__ */ new Map();\n\tconst reported = {\n\t\tdiscriminators: /* @__PURE__ */ new Set(),\n\t\tbaseTargets: /* @__PURE__ */ new Set()\n\t};\n\tfor (const model of input.models) {\n\t\tconst specContext = input.specContextFor(model);\n\t\tconst discNode = model.attributes.find((attr) => attr.name === \"discriminator\")?.node;\n\t\tif (discNode) {\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\tnode: discNode,\n\t\t\t\tspec: mongoAttributeSpecs.model.discriminator(specContext),\n\t\t\t\tmodel,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed) discriminators.set(model, {\n\t\t\t\tfieldName: parsed.field,\n\t\t\t\tsource: diagnosticSource(sources, discNode.syntax),\n\t\t\t\tspan: nodePslSpan(discNode.syntax, sources)\n\t\t\t});\n\t\t\telse reported.discriminators.add(model.name);\n\t\t}\n\t\tconst baseAttribute = model.attributes.find((attr) => attr.name === \"base\");\n\t\tconst baseNode = baseAttribute?.node;\n\t\tif (baseNode) {\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\tnode: baseNode,\n\t\t\t\tspec: mongoAttributeSpecs.model.base(),\n\t\t\t\tmodel,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed) bases.set(model, {\n\t\t\t\tbase: parsed.base.declaration,\n\t\t\t\twritten: writtenBaseValue(parsed.value),\n\t\t\t\tvalueSpan: parsed.value.span,\n\t\t\t\tsource: diagnosticSource(sources, baseNode.syntax),\n\t\t\t\tspan: nodePslSpan(baseNode.syntax, sources)\n\t\t\t});\n\t\t\telse {\n\t\t\t\tconst target = baseAttribute?.args[0]?.value;\n\t\t\t\tif (target !== void 0) reported.baseTargets.add(target);\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tdiscriminators,\n\t\tbases,\n\t\treported\n\t};\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\") {\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 field = element.args[\"field\"];\n\tinvariant(typeof field === \"string\", \"The sort function spec requires a field reference\");\n\treturn {\n\t\tkind: \"field\",\n\t\tname: field,\n\t\tdirection: element.args[\"direction\"] === \"Desc\" ? -1 : 1\n\t};\n}\n/** The collation the index arguments name, or undefined when they name none. A collation without `collationLocale` is passed on for the builder to refuse. */\nfunction buildCollationFromSpec(args) {\n\tconst collation = {\n\t\t...ifDefined(\"locale\", args.collationLocale),\n\t\t...ifDefined(\"strength\", args.collationStrength),\n\t\t...ifDefined(\"caseLevel\", args.collationCaseLevel),\n\t\t...ifDefined(\"caseFirst\", args.collationCaseFirst),\n\t\t...ifDefined(\"numericOrdering\", args.collationNumericOrdering),\n\t\t...ifDefined(\"alternate\", args.collationAlternate),\n\t\t...ifDefined(\"maxVariable\", args.collationMaxVariable),\n\t\t...ifDefined(\"backwards\", args.collationBackwards),\n\t\t...ifDefined(\"normalization\", args.collationNormalization)\n\t};\n\treturn Object.keys(collation).length === 0 ? void 0 : collation;\n}\n/** The index keys by field name, as the builder takes them: a wildcard is `$**` or `<field>.$**`. */\nfunction resolveIndexKeys(parsedFields, defaultDirection, ctx) {\n\tconst wildcardCount = parsedFields.filter((field) => field.kind === \"wildcard\").length;\n\tif (wildcardCount > 1) {\n\t\tctx.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\tmessage: \"An index can contain at most one wildcard() field\",\n\t\t\t...ctx.source.at(ctx.span)\n\t\t});\n\t\treturn;\n\t}\n\tconst fields = {};\n\tfor (const field of parsedFields) if (field.kind === \"wildcard\") fields[field.scope === void 0 ? \"$**\" : `${field.scope}.$**`] = defaultDirection;\n\telse fields[field.name] = field.direction ?? defaultDirection;\n\treturn {\n\t\tfields,\n\t\thasWildcard: wildcardCount === 1\n\t};\n}\nfunction buildProjection(include, exclude, hasWildcard, ctx) {\n\tif (include !== void 0 && exclude !== void 0) {\n\t\tctx.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\tmessage: \"Cannot specify both include and exclude on the same index\",\n\t\t\t...ctx.source.at(ctx.span)\n\t\t});\n\t\treturn null;\n\t}\n\tconst fields = include ?? exclude;\n\tif (fields === void 0 || fields.length === 0 && hasWildcard) 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}\n/** Index options as the attribute specs read them, which are the values MongoDB takes. */\nfunction indexOptions(options) {\n\treturn blindCast(options);\n}\nfunction buildNormalIndex(parsed, unique, ctx) {\n\tconst parsedFields = parsed.fields.map(normalizeIndexField);\n\tif (parsedFields.length === 0) return void 0;\n\tconst resolved = resolveIndexKeys(parsedFields, parsed.type ?? 1, ctx);\n\tif (!resolved) return void 0;\n\tconst wildcardProjection = buildProjection(parsed.include, parsed.exclude, resolved.hasWildcard, ctx);\n\tif (wildcardProjection === null) return void 0;\n\tconst collation = buildCollationFromSpec(parsed);\n\treturn {\n\t\tfields: resolved.fields,\n\t\toptions: indexOptions({\n\t\t\t...unique && { unique: true },\n\t\t\t...ifDefined(\"sparse\", parsed.sparse),\n\t\t\t...ifDefined(\"expireAfterSeconds\", parsed.expireAfterSeconds),\n\t\t\t...ifDefined(\"partialFilterExpression\", parsed.filter),\n\t\t\t...ifDefined(\"wildcardProjection\", wildcardProjection),\n\t\t\t...ifDefined(\"collation\", collation),\n\t\t\t...ifDefined(\"default_language\", parsed.default_language),\n\t\t\t...ifDefined(\"language_override\", parsed.languageOverride)\n\t\t})\n\t};\n}\nfunction buildTextIndex(parsed, ctx) {\n\tconst parsedFields = parsed.fields.map(normalizeIndexField);\n\tif (parsedFields.length === 0) return void 0;\n\tconst resolved = resolveIndexKeys(parsedFields, \"text\", ctx);\n\tif (!resolved) return void 0;\n\tif (resolved.hasWildcard) {\n\t\tctx.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\tmessage: \"wildcard() fields cannot be combined with type: hashed/2dsphere/2d or @@textIndex\",\n\t\t\t...ctx.source.at(ctx.span)\n\t\t});\n\t\treturn;\n\t}\n\tconst collation = buildCollationFromSpec(parsed);\n\treturn {\n\t\tfields: resolved.fields,\n\t\toptions: indexOptions({\n\t\t\t...ifDefined(\"partialFilterExpression\", parsed.filter),\n\t\t\t...ifDefined(\"collation\", collation),\n\t\t\t...ifDefined(\"weights\", parsed.weights),\n\t\t\t...ifDefined(\"default_language\", parsed.language),\n\t\t\t...ifDefined(\"language_override\", parsed.languageOverride)\n\t\t})\n\t};\n}\nfunction nestedIndexPath(node) {\n\tfor (const arg of node.argList()?.args() ?? []) {\n\t\tconst name = arg.name()?.name();\n\t\tconst list = arg.value();\n\t\tif (name !== void 0 && name !== \"fields\" || !(list instanceof ArrayLiteralAst)) continue;\n\t\tfor (const element of list.elements()) {\n\t\t\tconst field = element instanceof FunctionCallAst && element.name()?.identifier()?.token()?.text === \"sort\" ? [...element.args()][0]?.value() : element;\n\t\t\tconst path = field instanceof PathExprAst ? field.path() : [];\n\t\t\tif (field instanceof PathExprAst && path.length > 1) return {\n\t\t\t\tpath,\n\t\t\t\tsyntax: field.syntax\n\t\t\t};\n\t\t}\n\t}\n}\nfunction nestedIndexPathMessage(path, pslModel, binder) {\n\tconst [root = \"\"] = path;\n\tconst label = `Index field \"${path.join(\".\")}\" on model \"${pslModel.name}\"`;\n\tconst rootField = Object.hasOwn(pslModel.fields, root) ? pslModel.fields[root] : void 0;\n\treturn rootField !== void 0 && fieldTypeResolution(rootField, binder)?.kind === \"compositeType\" ? `${label} is a path into a composite type; indexes on fields of a composite type are not supported yet. Index a top-level field of \"${pslModel.name}\" or remove the index.` : `${label} is a dotted path, but \"${root}\" is not a field of \"${pslModel.name}\" whose type is a composite type, so the path names no field. List fields of \"${pslModel.name}\" by name.`;\n}\n/**\n* A model's indexes as the schema writes them, with where each is written: a field's `@unique` first, then `@@index`, `@@unique` and `@@textIndex` in the order the model lists them.\n*/\nfunction collectIndexes(pslModel, specContext, sources, binder, diagnostics) {\n\tconst indexes = [];\n\tfor (const field of Object.values(pslModel.fields)) {\n\t\tif (fieldTypeResolution(field, binder)?.kind === \"model\") continue;\n\t\tconst uniqueNode = field.attributes.find((attr) => attr.name === \"unique\")?.node;\n\t\tif (!uniqueNode) continue;\n\t\tif (interpretFieldAttribute({\n\t\t\tsymbols: specContext.symbols,\n\t\t\tnode: uniqueNode,\n\t\t\tspec: mongoAttributeSpecs.field.unique({\n\t\t\t\t...specContext,\n\t\t\t\tfield,\n\t\t\t\ttypeResolution: fieldTypeResolution(field, binder),\n\t\t\t\tcontributedType: contributedTypeOf(fieldTypeResolution(field, binder), binder, field.typeConstructor)\n\t\t\t}),\n\t\t\tmodel: pslModel,\n\t\t\tfield,\n\t\t\tsources,\n\t\t\tbinder,\n\t\t\tdiagnostics\n\t\t}) === void 0) continue;\n\t\tindexes.push({\n\t\t\tindex: {\n\t\t\t\tfields: { [field.name]: 1 },\n\t\t\t\toptions: { unique: true }\n\t\t\t},\n\t\t\tsource: diagnosticSource(sources, uniqueNode.syntax),\n\t\t\tspan: nodePslSpan(uniqueNode.syntax, sources)\n\t\t});\n\t}\n\tfor (const attr of pslModel.attributes) {\n\t\tif (attr.name !== \"index\" && attr.name !== \"unique\" && attr.name !== \"textIndex\") continue;\n\t\tconst node = attr.node;\n\t\tconst source = diagnosticSource(sources, node.syntax);\n\t\tconst ctx = {\n\t\t\tsource,\n\t\t\tspan: attr.span,\n\t\t\tdiagnostics\n\t\t};\n\t\tconst nested = nestedIndexPath(node);\n\t\tif (nested !== void 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\t\tmessage: nestedIndexPathMessage(nested.path, pslModel, binder),\n\t\t\t\t...source.at(nodePslSpan(nested.syntax, sources))\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tlet index;\n\t\tif (attr.name === \"textIndex\") {\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\tnode,\n\t\t\t\tspec: mongoAttributeSpecs.model.textIndex(specContext),\n\t\t\t\tmodel: pslModel,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (!parsed || parsed.fields.length === 0) continue;\n\t\t\tindex = buildTextIndex(parsed, ctx);\n\t\t} else {\n\t\t\tconst unique = attr.name === \"unique\";\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\tnode,\n\t\t\t\tspec: unique ? mongoAttributeSpecs.model.unique(specContext) : mongoAttributeSpecs.model.index(specContext),\n\t\t\t\tmodel: pslModel,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (!parsed) continue;\n\t\t\tindex = buildNormalIndex(parsed, unique, ctx);\n\t\t}\n\t\tif (index !== void 0) indexes.push({\n\t\t\tindex,\n\t\t\tsource,\n\t\t\tspan: attr.span\n\t\t});\n\t}\n\treturn indexes;\n}\nfunction fieldTypeResolution(field, binder) {\n\tconst node = typeReferenceNode(field);\n\treturn node === void 0 ? void 0 : binder.symbolForNode(node);\n}\nconst GENERATOR_PHASES = [\"onCreate\", \"onUpdate\"];\n/**\n* The generators a field's `@onCreate(fn())` and `@onUpdate(fn())` resolve to, and where each attribute is written. An attribute written twice, or one whose call is refused, is reported here.\n*/\nfunction lowerGeneratorAttributes(input) {\n\tconst { field, modelName, diagnostics } = input;\n\tconst phases = {};\n\tconst sites = {};\n\tlet refused = false;\n\tfor (const phase of GENERATOR_PHASES) {\n\t\tconst [attribute, duplicate] = field.attributes.filter(({ name }) => name === phase);\n\t\tif (attribute === void 0) continue;\n\t\tsites[phase] = {\n\t\t\tspan: attribute.span,\n\t\t\targument: attribute.args.find((arg) => arg.kind === \"positional\")?.value.trim() ?? \"\"\n\t\t};\n\t\tif (duplicate !== void 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_DUPLICATE_ATTRIBUTE\",\n\t\t\t\tmessage: `\\`@${phase}\\` declared more than once on field \"${modelName}.${field.name}\".`,\n\t\t\t\t...diagnosticSource(input.sources, field.node.syntax).at(duplicate.span)\n\t\t\t});\n\t\t\trefused = true;\n\t\t\tcontinue;\n\t\t}\n\t\tconst generator = lowerGeneratorAttribute({\n\t\t\tphase,\n\t\t\tattribute,\n\t\t\tspecContext: typeAttributeSpecContextOfField(input.specContext),\n\t\t\ttype: input.resolved.field.type,\n\t\t\tsymbols: input.specContext.symbols,\n\t\t\tbinder: input.binder,\n\t\t\tsources: input.sources,\n\t\t\tgeneratorFunctions: input.generatorFunctions,\n\t\t\tdiagnostics\n\t\t});\n\t\tif (generator === void 0) {\n\t\t\trefused = true;\n\t\t\tcontinue;\n\t\t}\n\t\tphases[phase] = generator;\n\t}\n\tconst none = phases.onCreate === void 0 && phases.onUpdate === void 0;\n\treturn {\n\t\tvalues: refused || none ? void 0 : phases,\n\t\tsites\n\t};\n}\nfunction fieldOfTypeAlias(field, typeAlias) {\n\treturn {\n\t\tfield: {\n\t\t\ttype: typeAlias.type,\n\t\t\tnullable: field.optional,\n\t\t\tmany: field.list ? { elementNullable: field.elementOptional } : false,\n\t\t\t...ifDefined(\"valueSet\", typeAlias.valueSet)\n\t\t},\n\t\ttypeAlias\n\t};\n}\n/**\n* Whether a field may take what its type alias carries: it repeats none of the alias's attributes. Reports each refusal at the field.\n*/\nfunction acceptsTypeAlias(input) {\n\treturn !refuseRepeatedTypeAliasAttributes({\n\t\tfield: input.field,\n\t\tfieldPath: `${input.modelName}.${input.field.name}`,\n\t\talias: input.typeAlias.alias,\n\t\tsources: input.sources,\n\t\tdiagnostics: input.diagnostics\n\t});\n}\nfunction resolveNonRelationField(field, owner, resolution, codecIdByEnumName, context, scalarNames, typeAliases, codecLookup) {\n\tconst ownerName = owner.name;\n\tif (resolution?.kind === \"compositeType\") return { field: {\n\t\ttype: {\n\t\t\tkind: \"valueObject\",\n\t\t\tplane: \"storage\",\n\t\t\tnamespaceId: resolution.namespace.id,\n\t\t\tentityKind: \"valueObject\",\n\t\t\tentityName: resolution.symbol.name\n\t\t},\n\t\tnullable: field.optional,\n\t\tmany: field.list ? { elementNullable: field.elementOptional } : false\n\t} };\n\tif (resolution?.kind === \"block\" && resolution.symbol.keyword === \"enum\") {\n\t\tconst enumCodecId = codecIdByEnumName.get(resolution.symbol.name);\n\t\tif (enumCodecId === void 0) return void 0;\n\t\tconst valueSet = {\n\t\t\tplane: \"domain\",\n\t\t\tentityKind: \"enum\",\n\t\t\tnamespaceId: resolution.namespace.id,\n\t\t\tentityName: resolution.symbol.name\n\t\t};\n\t\treturn { field: {\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\tmany: field.list ? { elementNullable: field.elementOptional } : false,\n\t\t\tvalueSet\n\t\t} };\n\t}\n\tif (resolution?.kind === \"namedType\") {\n\t\tif (field.typeConstructor !== void 0) {\n\t\t\tcontext.diagnostics.push({\n\t\t\t\tcode: \"PSL_UNSUPPORTED_FIELD_TYPE\",\n\t\t\t\tmessage: `Field \"${ownerName}.${field.name}\" calls \"${field.typeConstructor.path.join(\".\")}\", which is a type alias, not a type constructor. Remove the arguments.`,\n\t\t\t\t...diagnosticSource(context.sources, field.node.syntax).at(field.span)\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst typeAlias = typeAliases.ofResolution(resolution);\n\t\treturn typeAlias === void 0 ? void 0 : fieldOfTypeAlias(field, typeAlias);\n\t}\n\tif (resolution?.kind === \"model\" || resolution?.kind === \"block\" || resolution?.kind === \"crossSpace\") {\n\t\tcontext.diagnostics.push({\n\t\t\tcode: \"PSL_UNSUPPORTED_FIELD_TYPE\",\n\t\t\tmessage: `Field \"${ownerName}.${field.name}\" type \"${field.typeName}\" is not supported in Mongo PSL interpreter`,\n\t\t\t...diagnosticSource(context.sources, field.node.syntax).at(field.span)\n\t\t});\n\t\treturn;\n\t}\n\tif (resolution?.kind !== \"contributedType\") return;\n\tconst call = field.typeConstructor;\n\tconst entityLabel = `Field \"${ownerName}.${field.name}\"`;\n\tconst source = diagnosticSource(context.sources, field.node.syntax);\n\tif (isContributedTypeChoice(resolution.symbol)) {\n\t\tconst type = scalarTypeOfChoice({\n\t\t\tsymbol: resolution.symbol,\n\t\t\tcall,\n\t\t\tspan: field.span,\n\t\t\tcodecLookup,\n\t\t\tdiagnostics: context.diagnostics,\n\t\t\tsource,\n\t\t\tentityLabel,\n\t\t\tdataTypes: context.dataTypes\n\t\t});\n\t\treturn type === void 0 ? void 0 : { field: {\n\t\t\ttype,\n\t\t\tnullable: field.optional,\n\t\t\tmany: field.list ? { elementNullable: field.elementOptional } : false\n\t\t} };\n\t}\n\tconst { descriptor, path } = resolution.symbol;\n\tif (descriptor.kind === \"typeAlias\") {\n\t\tif (call !== void 0) {\n\t\t\tcontext.diagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\t\tmessage: `${path.join(\".\")} is a type alias and takes no arguments.`,\n\t\t\t\t...source.at(call.span)\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst typeAlias = typeAliases.ofResolution(resolution);\n\t\tinvariant(typeAlias !== void 0, \"A contributed type alias always resolves\");\n\t\treturn fieldOfTypeAlias(field, typeAlias);\n\t}\n\tif (call === void 0 && !isBareTypeConstructor(descriptor)) {\n\t\treportTypeConstructorNotCalled({\n\t\t\tentityLabel,\n\t\t\tpath: path.join(\".\"),\n\t\t\tdescriptor,\n\t\t\tsource,\n\t\t\tspan: field.span,\n\t\t\tdiagnostics: context.diagnostics\n\t\t});\n\t\treturn;\n\t}\n\tif (call === void 0) scalarNames.warnDeprecated(field, descriptor);\n\treturn { field: {\n\t\ttype: scalarTypeOfConstructor(descriptor, call),\n\t\tnullable: field.optional,\n\t\tmany: field.list ? { elementNullable: field.elementOptional } : false\n\t} };\n}\nfunction processEnumDeclarations(input) {\n\tconst handles = {};\n\tif (input.enumSymbols.length === 0) return handles;\n\tconst enumDescriptor = input.authoringContributions?.entityTypes?.[\"enum\"] !== void 0 && isAuthoringEntityTypeDescriptor(input.authoringContributions.entityTypes[\"enum\"]) ? input.authoringContributions.entityTypes[\"enum\"] : void 0;\n\tif (!enumDescriptor) {\n\t\tfor (const enumSymbol of input.enumSymbols) {\n\t\t\tconst source = diagnosticSource(input.sources, enumSymbol.node.syntax);\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: \"PSL_ENUM_MISSING_FACTORY\",\n\t\t\t\tmessage: `enum \"${enumSymbol.name}\" requires an \"enum\" entityType factory in the active authoring contributions`,\n\t\t\t\t...source.at(enumSymbol.span)\n\t\t\t});\n\t\t}\n\t\treturn handles;\n\t}\n\tfor (const enumSymbol of input.enumSymbols) {\n\t\tconst sourceFile = input.sources.sourceFileFor(enumSymbol.node.syntax);\n\t\tconst envelope = input.parsedBlocks.get(enumSymbol);\n\t\tinput.diagnostics.push(...enumMemberAttributeDiagnostics(enumSymbol, input.sources));\n\t\tif (envelope === void 0) continue;\n\t\tconst handle = instantiateAuthoringEntityType(\"enum\", enumDescriptor, [envelope], {\n\t\t\t...input.entityContext,\n\t\t\tsourceId: sourceFile.filename\n\t\t});\n\t\tif (handle === void 0 || handle === null) continue;\n\t\thandles[envelope.name] = handle;\n\t\tconst typeAttribute = envelope.attributes[\"type\"];\n\t\tinput.sites.set(envelope.name, {\n\t\t\tblock: {\n\t\t\t\tenumName: envelope.name,\n\t\t\t\tcodecId: handle.codecId,\n\t\t\t\tsourceId: sourceFile.filename,\n\t\t\t\tspan: envelope.span,\n\t\t\t\tmemberSpans: envelope.parameterSpans\n\t\t\t},\n\t\t\tcodecSpan: typeAttribute?.argSpans?.[\"codecId\"] ?? typeAttribute?.span ?? envelope.span\n\t\t});\n\t}\n\treturn handles;\n}\nfunction withoutMergedIndexSites(modelSites, removedIndexes) {\n\treturn new Map([...modelSites].map(([modelName, sites]) => {\n\t\tconst removed = new Set(removedIndexes.filter(({ model }) => model === modelName).map(({ position }) => position));\n\t\treturn [modelName, {\n\t\t\t...sites,\n\t\t\tindexes: sites.indexes.filter((_, position) => !removed.has(position))\n\t\t}];\n\t}));\n}\n/** Whether PSL already reported the cause of a refusal, so the builder's refusal would repeat it. */\nfunction alreadyReported(refusal, dropped, reported) {\n\tswitch (refusal.kind) {\n\t\tcase \"indexFieldUnknown\": return dropped.has(fieldSiteKey(refusal.key.model, refusal.fieldName));\n\t\tcase \"relationLocalFieldUnknown\": return dropped.has(fieldSiteKey(refusal.key.model, refusal.fieldName));\n\t\tcase \"discriminatorFieldUnknown\": return dropped.has(fieldSiteKey(refusal.key.model, refusal.fieldName));\n\t\tcase \"discriminatorWithoutVariants\": return reported.baseTargets.has(refusal.key.model);\n\t\tcase \"baseWithoutDiscriminator\": return reported.discriminators.has(refusal.baseModel);\n\t\tdefault: return false;\n\t}\n}\nfunction enumNameOf(field) {\n\treturn field.valueSet?.entityKind === \"enum\" ? field.valueSet.entityName : void 0;\n}\nfunction fieldNodeOf(fieldName, storedName, resolved, generatedValues) {\n\tconst { field } = resolved;\n\tconst executionDefaults = resolved.typeAlias?.executionDefaults;\n\treturn {\n\t\tfieldName,\n\t\t...storedName === fieldName ? {} : { storedName },\n\t\ttype: field.type,\n\t\tnullable: field.nullable,\n\t\tmany: field.many ?? false,\n\t\t...ifDefined(\"enumName\", enumNameOf(field)),\n\t\t...ifDefined(\"executionDefaults\", executionDefaults),\n\t\t...ifDefined(\"generatedValues\", generatedValues)\n\t};\n}\nfunction relationNodeOf(fieldName, relation) {\n\tif (relation.cardinality === \"N:M\") throw new InternalError(\"A paired MongoDB back-relation is one-to-one or one-to-many.\");\n\treturn {\n\t\trelationName: fieldName,\n\t\ttoModel: relation.to.model,\n\t\tcardinality: relation.cardinality,\n\t\ton: relation.on,\n\t\tnullable: \"nullable\" in relation ? relation.nullable : void 0\n\t};\n}\nfunction interpretPslDocumentToMongoContract(input) {\n\tconst { symbolTable, sources, codecLookup } = input;\n\tconst diagnostics = createPslDiagnosticCollector(sources);\n\tconst fieldResolution = {\n\t\tsources,\n\t\tdiagnostics,\n\t\tdataTypes: input.dataTypes\n\t};\n\tconst scalarNames = { warnDeprecated: deprecatedScalarWarner({\n\t\tsources,\n\t\treportWarning: input.reportWarning\n\t}) };\n\tconst { binder } = input;\n\tconst { parsedBlocks, diagnostics: blockDiagnostics } = interpretExtensionBlocks({\n\t\tsymbolTable,\n\t\tsources,\n\t\tpslBlockDescriptors: input.authoringContributions?.pslBlockDescriptors ?? {},\n\t\tbinder,\n\t\tdataTypes: input.dataTypes\n\t});\n\tdiagnostics.push(...blockDiagnostics);\n\tconst { defaultNamespace } = symbolTable;\n\tvalidateNamespaceBlocksForMongoTarget({\n\t\tnamespaces: Object.values(symbolTable.namespaces),\n\t\tsources,\n\t\tbinder,\n\t\tdiagnostics\n\t});\n\tconst allModels = Object.values(defaultNamespace.models);\n\tconst allCompositeTypes = Object.values(defaultNamespace.compositeTypes);\n\tconst { generatorFunctions } = input;\n\tconst specContextFor = (model) => ({\n\t\tsymbols: symbolTable,\n\t\tmodel,\n\t\tdefaultFunctionRegistry: input.defaultFunctionRegistry,\n\t\tgeneratorFunctions,\n\t\tdataTypes: input.dataTypes\n\t});\n\tconst physicalNames = /* @__PURE__ */ new Map();\n\tfor (const model of allModels) resolvePhysicalNames({\n\t\tmodel,\n\t\tphysicalNames,\n\t\tspecContext: specContextFor(model),\n\t\tsources,\n\t\tbinder,\n\t\tdiagnostics\n\t});\n\tconst blockKeywords = /* @__PURE__ */ new Set([\"enum\", ...claimedBlockKeywords(input.authoringContributions?.pslBlockDescriptors)]);\n\tfor (const block of Object.values(defaultNamespace.blocks)) if (!blockKeywords.has(block.keyword)) diagnostics.push(unsupportedBlockDiagnostic(block, sources));\n\tconst topLevelEnumSymbols = Object.values(defaultNamespace.blocks).filter((b) => b.keyword === \"enum\");\n\tconst enumSites = /* @__PURE__ */ new Map();\n\tconst enumHandles = processEnumDeclarations({\n\t\tsites: enumSites,\n\t\tenumSymbols: topLevelEnumSymbols,\n\t\tparsedBlocks,\n\t\tsources,\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\tcodecLookup,\n\t\t\tdataTypes: input.dataTypes,\n\t\t\tdiagnostics: { push: (d) => {\n\t\t\t\tdiagnostics.pushExternal(blindCast(d));\n\t\t\t} }\n\t\t},\n\t\tdiagnostics\n\t});\n\tconst codecIdByEnumName = new Map(Object.entries(enumHandles).map(([name, handle]) => [name, handle.codecId]));\n\tconst typeAliases = resolveMongoTypeAliases({\n\t\tdeclarations: Object.values(symbolTable.namedTypes),\n\t\tsymbols: symbolTable,\n\t\tbinder,\n\t\tsources,\n\t\tdiagnostics,\n\t\tcodecIdByEnumName,\n\t\tdefaultFunctionRegistry: input.defaultFunctionRegistry,\n\t\tgeneratorFunctions,\n\t\tdataTypes: input.dataTypes,\n\t\tcodecLookup: input.codecLookup,\n\t\tauthoringTypes: input.authoringContributions?.type\n\t});\n\tconst polymorphism = collectPolymorphismDeclarations({\n\t\tmodels: allModels,\n\t\tspecContextFor,\n\t\tsources,\n\t\tbinder,\n\t\tdiagnostics\n\t});\n\tconst allFkRelations = [];\n\tconst backrelationCandidates = [];\n\tconst invalidFkPairings = [];\n\tconst fieldSites = /* @__PURE__ */ new Map();\n\tconst modelSites = /* @__PURE__ */ new Map();\n\tconst droppedFields = /* @__PURE__ */ new Set();\n\tconst relationsByModel = /* @__PURE__ */ new Map();\n\tconst modelDrafts = [];\n\tfor (const pslModel of allModels) {\n\t\tconst specContext = specContextFor(pslModel);\n\t\tconst fields = [];\n\t\tconst relations = [];\n\t\trelationsByModel.set(pslModel.name, relations);\n\t\tfor (const field of Object.values(pslModel.fields)) {\n\t\t\tconst source = diagnosticSource(sources, field.node.syntax);\n\t\t\tconst siteKey = fieldSiteKey(pslModel.name, field.name);\n\t\t\tconst resolution = fieldTypeResolution(field, binder);\n\t\t\tif (resolution?.kind === \"model\") {\n\t\t\t\tfieldSites.set(siteKey, {\n\t\t\t\t\tsymbol: field,\n\t\t\t\t\tsource,\n\t\t\t\t\tgeneratorAttributes: {},\n\t\t\t\t\tstoredName: field.name\n\t\t\t\t});\n\t\t\t\tconst target = resolution.symbol;\n\t\t\t\tconst relationNode = field.attributes.find((attr) => attr.name === \"relation\")?.node;\n\t\t\t\tconst relation = relationNode ? interpretFieldAttribute({\n\t\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\t\tnode: relationNode,\n\t\t\t\t\tspec: mongoAttributeSpecs.field.relation({\n\t\t\t\t\t\t...specContext,\n\t\t\t\t\t\tfield,\n\t\t\t\t\t\ttypeResolution: fieldTypeResolution(field, binder),\n\t\t\t\t\t\tcontributedType: contributedTypeOf(fieldTypeResolution(field, binder), binder, field.typeConstructor)\n\t\t\t\t\t}),\n\t\t\t\t\tmodel: pslModel,\n\t\t\t\t\tfield,\n\t\t\t\t\tsources,\n\t\t\t\t\tbinder,\n\t\t\t\t\tdiagnostics\n\t\t\t\t}) : void 0;\n\t\t\t\tif (field.list || !(relation?.fields && relation?.references)) {\n\t\t\t\t\tbackrelationCandidates.push({\n\t\t\t\t\t\tmodelName: pslModel.name,\n\t\t\t\t\t\ttargetModelName: target.name,\n\t\t\t\t\t\t...ifDefined(\"relationName\", relation?.name),\n\t\t\t\t\t\tcardinality: field.list ? \"1:N\" : \"1:1\",\n\t\t\t\t\t\tfield,\n\t\t\t\t\t\tsources\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!physicalNames.has(target)) continue;\n\t\t\t\trelations.push({\n\t\t\t\t\trelationName: field.name,\n\t\t\t\t\ttoModel: target.name,\n\t\t\t\t\tcardinality: \"N:1\",\n\t\t\t\t\ton: {\n\t\t\t\t\t\tlocalFields: relation.fields,\n\t\t\t\t\t\ttargetFields: relation.references\n\t\t\t\t\t},\n\t\t\t\t\tnullable: field.optional\n\t\t\t\t});\n\t\t\t\tif (resolveToOneRelationNullable({\n\t\t\t\t\tdeclaredNullable: field.optional,\n\t\t\t\t\tlocalFieldNullability: relation.fields.map((localFieldName) => pslModel.fields[localFieldName]?.optional === true),\n\t\t\t\t\townsReference: true\n\t\t\t\t}).contradiction !== void 0) {\n\t\t\t\t\tinvalidFkPairings.push({\n\t\t\t\t\t\tpairKey: fkRelationPairKey(pslModel.name, target.name),\n\t\t\t\t\t\t...ifDefined(\"relationName\", relation.name)\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tallFkRelations.push({\n\t\t\t\t\tdeclaringModel: pslModel.name,\n\t\t\t\t\ttargetModel: target.name,\n\t\t\t\t\t...ifDefined(\"relationName\", relation.name),\n\t\t\t\t\tlocalFields: relation.fields,\n\t\t\t\t\ttargetFields: relation.references\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst resolved = resolveNonRelationField(field, {\n\t\t\t\tname: pslModel.name,\n\t\t\t\tkind: \"model\"\n\t\t\t}, resolution, codecIdByEnumName, fieldResolution, scalarNames, typeAliases, codecLookup);\n\t\t\tif (resolved === void 0 || resolved.typeAlias !== void 0 && !acceptsTypeAlias({\n\t\t\t\tfield,\n\t\t\t\tmodelName: pslModel.name,\n\t\t\t\ttypeAlias: resolved.typeAlias,\n\t\t\t\tsources,\n\t\t\t\tdiagnostics\n\t\t\t})) {\n\t\t\t\tdroppedFields.add(siteKey);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst storedName = physicalName(physicalNames, field);\n\t\t\tconst generated = lowerGeneratorAttributes({\n\t\t\t\tfield,\n\t\t\t\tmodelName: pslModel.name,\n\t\t\t\tresolved,\n\t\t\t\tspecContext: {\n\t\t\t\t\t...specContext,\n\t\t\t\t\tfield,\n\t\t\t\t\ttypeResolution: resolution,\n\t\t\t\t\tcontributedType: contributedTypeOf(resolution, binder, field.typeConstructor)\n\t\t\t\t},\n\t\t\t\tgeneratorFunctions,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tfields.push(fieldNodeOf(field.name, storedName, resolved, generated.values));\n\t\t\tfieldSites.set(siteKey, {\n\t\t\t\tsymbol: field,\n\t\t\t\tsource,\n\t\t\t\t...ifDefined(\"typeAlias\", resolved.typeAlias),\n\t\t\t\tgeneratorAttributes: generated.sites,\n\t\t\t\tstoredName\n\t\t\t});\n\t\t}\n\t\tconst idFields = [];\n\t\tfor (const field of Object.values(pslModel.fields)) {\n\t\t\tconst idNode = field.attributes.find((attr) => attr.name === \"id\")?.node;\n\t\t\tif (!idNode) continue;\n\t\t\tif (interpretFieldAttribute({\n\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\tnode: idNode,\n\t\t\t\tspec: mongoAttributeSpecs.field.id({\n\t\t\t\t\t...specContext,\n\t\t\t\t\tfield,\n\t\t\t\t\ttypeResolution: fieldTypeResolution(field, binder),\n\t\t\t\t\tcontributedType: contributedTypeOf(fieldTypeResolution(field, binder), binder, field.typeConstructor)\n\t\t\t\t}),\n\t\t\t\tmodel: pslModel,\n\t\t\t\tfield,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t}) === void 0) continue;\n\t\t\tidFields.push(field);\n\t\t\tconst storedName = physicalName(physicalNames, field);\n\t\t\tif (storedName !== DOCUMENT_ID) diagnostics.push({\n\t\t\t\tcode: \"PSL_MONGO_ID_ATTRIBUTE_INVALID\",\n\t\t\t\tmessage: `Field \"${pslModel.name}.${field.name}\" has @id but is stored as \"${storedName}\". In MongoDB, @id marks the field stored as _id, the document id: add @map(\"_id\") to it, or remove @id.`,\n\t\t\t\t...diagnosticSource(sources, field.node.syntax).at(field.span)\n\t\t\t});\n\t\t}\n\t\tconst [, secondIdField] = idFields;\n\t\tif (secondIdField !== void 0) diagnostics.push({\n\t\t\tcode: \"PSL_MONGO_ID_ATTRIBUTE_INVALID\",\n\t\t\tmessage: `Model \"${pslModel.name}\" has @id on ${idFields.length} fields, ${idFields.map((field) => `\"${field.name}\"`).join(\" and \")}. A document has one id: keep @id only on the field stored as _id.`,\n\t\t\t...diagnosticSource(sources, secondIdField.node.syntax).at(secondIdField.span)\n\t\t});\n\t\tconst indexes = collectIndexes(pslModel, specContext, sources, binder, diagnostics);\n\t\tconst discriminator = polymorphism.discriminators.get(pslModel);\n\t\tconst base = polymorphism.bases.get(pslModel);\n\t\tmodelSites.set(pslModel.name, {\n\t\t\tindexes,\n\t\t\t...ifDefined(\"discriminator\", discriminator),\n\t\t\t...ifDefined(\"base\", base)\n\t\t});\n\t\tconst inheritsCollection = base !== void 0 && getAttribute(pslModel.attributes, \"map\") === void 0;\n\t\tmodelDrafts.push({\n\t\t\tsymbol: pslModel,\n\t\t\tnode: {\n\t\t\t\tmodelName: pslModel.name,\n\t\t\t\t...inheritsCollection ? {} : { collection: physicalName(physicalNames, pslModel) },\n\t\t\t\tfields,\n\t\t\t\tindexes: indexes.map(({ index }) => index),\n\t\t\t\t...discriminator === void 0 ? {} : { discriminator: { field: discriminator.fieldName } },\n\t\t\t\t...base === void 0 ? {} : { base: {\n\t\t\t\t\tmodel: base.base.name,\n\t\t\t\t\tvalue: base.written\n\t\t\t\t} }\n\t\t\t}\n\t\t});\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 siteKey = fieldSiteKey(compositeType.name, field.name);\n\t\t\tconst fieldMap = field.attributes.find((attr) => attr.name === \"map\");\n\t\t\tconst resolved = resolveNonRelationField(field, {\n\t\t\t\tname: compositeType.name,\n\t\t\t\tkind: \"compositeType\"\n\t\t\t}, fieldTypeResolution(field, binder), codecIdByEnumName, fieldResolution, scalarNames, typeAliases, codecLookup);\n\t\t\tif (resolved === void 0) {\n\t\t\t\tdroppedFields.add(siteKey);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst storedName = fieldMap?.args[0]?.value.replace(/^\"|\"$/g, \"\") ?? field.name;\n\t\t\tfields.push({\n\t\t\t\t...fieldNodeOf(field.name, field.name, resolved, void 0),\n\t\t\t\t...fieldMap === void 0 ? {} : { storedName }\n\t\t\t});\n\t\t\tfieldSites.set(siteKey, {\n\t\t\t\tsymbol: field,\n\t\t\t\tsource: diagnosticSource(sources, field.node.syntax),\n\t\t\t\t...ifDefined(\"typeAlias\", resolved.typeAlias),\n\t\t\t\tgeneratorAttributes: {},\n\t\t\t\t...fieldMap === void 0 ? {} : { map: {\n\t\t\t\t\tsource: diagnosticSource(sources, fieldMap.node.syntax),\n\t\t\t\t\tspan: nodePslSpan(fieldMap.node.syntax, sources)\n\t\t\t\t} },\n\t\t\t\tstoredName\n\t\t\t});\n\t\t}\n\t\tvalueObjects.push({\n\t\t\tname: compositeType.name,\n\t\t\tfields\n\t\t});\n\t}\n\tconst paired = pairMongoBackRelations({\n\t\tforeignKeys: allFkRelations,\n\t\tcandidates: backrelationCandidates,\n\t\tinvalidFkPairings,\n\t\tnamespaceId: defaultNamespace.id\n\t});\n\tdiagnostics.push(...paired.diagnostics);\n\tfor (const { modelName, fieldName, relation } of paired.relations) relationsByModel.get(modelName)?.push(relationNodeOf(fieldName, relation));\n\tconst modelNodes = modelDrafts.map(({ node }) => ({\n\t\t...node,\n\t\trelations: relationsByModel.get(node.modelName) ?? []\n\t}));\n\tconst { definition, removedIndexes } = mergeRedundantIndexes({\n\t\ttarget: input.target,\n\t\t...ifDefined(\"extensions\", input.extensionPacks),\n\t\tmodels: [...modelNodes.filter((model) => model.base === void 0), ...modelNodes.filter((model) => model.base !== void 0)],\n\t\tvalueObjects,\n\t\tenums: enumHandles,\n\t\twritesCollectionValidators: true,\n\t\twarnings: void 0\n\t}, codecLookup, input.dataTypes);\n\tconst sites = {\n\t\tmodels: withoutMergedIndexSites(modelSites, removedIndexes),\n\t\tfields: fieldSites,\n\t\tenums: enumSites\n\t};\n\tconst built = buildMongoContractFromDefinition(definition, codecLookup, input.dataTypes);\n\tfor (const refusal of built.ok ? [] : built.failure.refusals) {\n\t\tif (alreadyReported(refusal, droppedFields, polymorphism.reported)) continue;\n\t\tconst diagnostic = refusalDiagnostic(refusal, sites);\n\t\tif (\"range\" in diagnostic) diagnostics.push(diagnostic);\n\t\telse diagnostics.pushExternal(diagnostic);\n\t}\n\tif (!built.ok || diagnostics.length > 0 || (input.seedDiagnostics?.length ?? 0) > 0) return notOk({\n\t\tsummary: \"PSL to Mongo contract interpretation failed\",\n\t\tdiagnostics: [...input.seedDiagnostics ?? [], ...diagnostics.toExternal()]\n\t});\n\treturn ok(built.value.contract);\n}\n//#endregion\nexport { mongoAttributeSpecs as i, pairMongoBackRelations as n, describeUnsupportedMong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iB,UAAU,KAAK,GAAG,OAAO,MAAM;EACjG,SAAS;EACT,aAAa,CAAC,GAAG,MAAM,mBAAmB,CAAC,GAAG,GAAG,YAAY,WAAW,CAAC;CAC1E,CAAC;CACD,OAAO,GAAG,MAAM,MAAM,QAAQ;AAC/B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-ZGXLjqEe.d.mts","names":[],"sources":["../../../../2-mongo-family/9-family/dist/runtime.d.mts"],"mappings":";;;;;;;iBAMiB,gCAAgC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verify-mongo-schema-CyvUewwP-DwSUNc5f.mjs","names":[],"sources":["../../../../2-mongo-family/9-family/dist/verify-mongo-schema-CyvUewwP.mjs"],"sourcesContent":["import { MongoSchemaCollection, MongoSchemaCollectionOptions, MongoSchemaIR, MongoSchemaIndex, MongoSchemaValidator, deepEqual } from \"@internal/mongo-schema-ir\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { canonicalize, collectionControlPoliciesOf, collectionControlPolicyOf, indexLookupKey } from \"@internal/mongo-contract\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { VERIFY_CODE_SCHEMA_FAILURE, dispositionForCategory, issueOutcome } from \"@internal/framework-components/control\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/core/contract-to-schema.ts\nfunction convertIndex(index) {\n\treturn new MongoSchemaIndex({\n\t\tkeys: index.keys,\n\t\tunique: index.unique,\n\t\tsparse: index.sparse,\n\t\texpireAfterSeconds: index.expireAfterSeconds,\n\t\tpartialFilterExpression: index.partialFilterExpression,\n\t\twildcardProjection: index.wildcardProjection,\n\t\tcollation: index.collation,\n\t\tweights: index.weights,\n\t\tdefault_language: index.default_language,\n\t\tlanguage_override: index.language_override\n\t});\n}\nfunction convertValidator(v) {\n\treturn new MongoSchemaValidator({\n\t\tjsonSchema: v.jsonSchema,\n\t\tvalidationLevel: v.validationLevel,\n\t\tvalidationAction: v.validationAction\n\t});\n}\nfunction convertOptions(o) {\n\treturn new MongoSchemaCollectionOptions({\n\t\t...ifDefined(\"capped\", o.capped !== void 0 ? {\n\t\t\tsize: o.capped.size,\n\t\t\t...ifDefined(\"max\", o.capped.max)\n\t\t} : void 0),\n\t\t...o.timeseries !== void 0 ? { timeseries: {\n\t\t\ttimeField: o.timeseries.timeField,\n\t\t\t...ifDefined(\"metaField\", o.timeseries.metaField),\n\t\t\t...ifDefined(\"granularity\", o.timeseries.granularity)\n\t\t} } : {},\n\t\t...o.collation !== void 0 ? { collation: {\n\t\t\tlocale: o.collation.locale,\n\t\t\t...ifDefined(\"caseLevel\", o.collation.caseLevel),\n\t\t\t...ifDefined(\"caseFirst\", o.collation.caseFirst),\n\t\t\t...ifDefined(\"strength\", o.collation.strength),\n\t\t\t...ifDefined(\"numericOrdering\", o.collation.numericOrdering),\n\t\t\t...ifDefined(\"alternate\", o.collation.alternate),\n\t\t\t...ifDefined(\"maxVariable\", o.collation.maxVariable),\n\t\t\t...ifDefined(\"backwards\", o.collation.backwards),\n\t\t\t...ifDefined(\"normalization\", o.collation.normalization)\n\t\t} } : {},\n\t\t...ifDefined(\"changeStreamPreAndPostImages\", o.changeStreamPreAndPostImages !== void 0 ? { enabled: o.changeStreamPreAndPostImages.enabled } : void 0),\n\t\t...ifDefined(\"clusteredIndex\", o.clusteredIndex)\n\t});\n}\nfunction convertCollection(name, def) {\n\treturn new MongoSchemaCollection({\n\t\tname,\n\t\tindexes: (def.indexes ?? []).map(convertIndex),\n\t\t...ifDefined(\"validator\", def.validator != null ? convertValidator(def.validator) : void 0),\n\t\t...ifDefined(\"options\", def.options != null ? convertOptions(def.options) : void 0)\n\t});\n}\nfunction contractToMongoSchemaIR(contract) {\n\tif (!contract) return new MongoSchemaIR([]);\n\tconst collections = [];\n\tfor (const ns of Object.values(contract.storage.namespaces)) for (const [name, def] of Object.entries(ns.entries.collection ?? {})) collections.push(convertCollection(name, def));\n\treturn new MongoSchemaIR(collections);\n}\n//#endregion\n//#region src/core/schema-verify/verifier-disposition.ts\n/**\n* Classifies a Mongo schema-diff issue into the target-neutral categories the\n* framework grades. Mongo issues carry their coordinate as `path`\n* (`[collectionName]` for a whole collection, `[collectionName, auxiliary]`\n* for an index/validator/options finding), so a `not-expected` issue at\n* depth 1 is an undeclared whole collection and anything deeper is an\n* undeclared auxiliary. Mongo owns this mapping rather than importing the\n* SQL classifier — the two families share only the framework's category\n* grading.\n*/\nfunction classifyMongoDiffIssue(issue) {\n\tif (issueOutcome(issue) === \"not-found\") return \"declaredMissing\";\n\tif (issueOutcome(issue) === \"not-expected\") return issue.path.length <= 1 ? \"extraTopLevelObject\" : \"extraAuxiliary\";\n\treturn \"declaredIncompatible\";\n}\nfunction verifierDisposition(controlPolicy, issue) {\n\treturn dispositionForCategory(controlPolicy, classifyMongoDiffIssue(issue));\n}\n//#endregion\n//#region src/core/schema-diff.ts\n/**\n* Reconciles a control-policy disposition with the Mongo family's strict-mode\n* contract for live-only extras — the single point where `strict` and the\n* control policy meet.\n*\n* The control policy decides first; only a `fail` is reconciled against the\n* caller's base outcome. Call sites grade a live-only extra with\n* `strict ? 'fail' : 'warn'` and a declared missing/mismatch with `fail`, so\n* this one step encodes the whole matrix:\n*\n* | live-vs-declared | strict | non-strict |\n* |-------------------------------------|----------|------------|\n* | declared missing / mismatch | fail | fail |\n* | live-only extra (managed/tolerated) | fail | warn |\n* | live-only extra (external) | suppress (extras ignored, both modes) |\n* | anything (observed) | warn (both modes) |\n*\n* `tolerated` does not diverge from `managed` on a non-strict extra index:\n* both soften to `warn`, because the softening comes from the base outcome the\n* caller already computed from `strict`, not from per-policy special-casing.\n*/\nfunction emitMongoIssueUnderControlPolicy(controlPolicy, issue, baseOutcome, failures, warnings) {\n\tconst disposition = verifierDisposition(controlPolicy, issue);\n\tconst outcome = disposition === \"fail\" ? baseOutcome : disposition;\n\tif (outcome === \"suppress\") return \"suppress\";\n\tif (outcome === \"warn\") warnings.push(issue);\n\telse failures.push(issue);\n\treturn outcome;\n}\nfunction diffMongoSchemas(live, expected, strict, collectionControlPolicy) {\n\tconst failures = [];\n\tconst warnings = [];\n\tconst allNames = /* @__PURE__ */ new Set([...live.collectionNames, ...expected.collectionNames]);\n\tfor (const name of [...allNames].sort()) {\n\t\tconst liveColl = live.collection(name);\n\t\tconst expectedColl = expected.collection(name);\n\t\tif (!liveColl && expectedColl) {\n\t\t\temitMongoIssueUnderControlPolicy(collectionControlPolicy(name), {\n\t\t\t\tpath: [name],\n\t\t\t\texpected: expectedColl\n\t\t\t}, \"fail\", failures, warnings);\n\t\t\tcontinue;\n\t\t}\n\t\tif (liveColl && !expectedColl) {\n\t\t\temitMongoIssueUnderControlPolicy(collectionControlPolicy(name), {\n\t\t\t\tpath: [name],\n\t\t\t\tactual: liveColl\n\t\t\t}, strict ? \"fail\" : \"warn\", failures, warnings);\n\t\t\tcontinue;\n\t\t}\n\t\tconst lc = liveColl;\n\t\tconst ec = expectedColl;\n\t\tconst controlPolicy = collectionControlPolicy(name);\n\t\tdiffIndexes(name, lc, ec, strict, controlPolicy, failures, warnings);\n\t\tdiffValidator(name, lc, ec, strict, controlPolicy, failures, warnings);\n\t\tdiffOptions(name, lc, ec, strict, controlPolicy, failures, warnings);\n\t}\n\treturn {\n\t\tfailures,\n\t\twarnings\n\t};\n}\nfunction formatIndexName(index) {\n\treturn index.keys.map((k) => `${k.field}:${k.direction}`).join(\", \");\n}\nfunction diffIndexes(collName, live, expected, strict, collectionControlPolicy, failures, warnings) {\n\tconst liveLookup = /* @__PURE__ */ new Map();\n\tfor (const idx of live.indexes) liveLookup.set(indexLookupKey(idx), idx);\n\tconst expectedLookup = /* @__PURE__ */ new Map();\n\tfor (const idx of expected.indexes) expectedLookup.set(indexLookupKey(idx), idx);\n\tfor (const [key, idx] of expectedLookup) if (!liveLookup.has(key)) emitMongoIssueUnderControlPolicy(collectionControlPolicy, {\n\t\tpath: [collName, `index:${formatIndexName(idx)}`],\n\t\texpected: idx\n\t}, \"fail\", failures, warnings);\n\tfor (const [key, idx] of liveLookup) if (!expectedLookup.has(key)) emitMongoIssueUnderControlPolicy(collectionControlPolicy, {\n\t\tpath: [collName, `index:${formatIndexName(idx)}`],\n\t\tactual: idx\n\t}, strict ? \"fail\" : \"warn\", failures, warnings);\n}\nfunction diffValidator(collName, live, expected, strict, collectionControlPolicy, failures, warnings) {\n\tif (!live.validator && !expected.validator) return;\n\tif (expected.validator && !live.validator) {\n\t\temitMongoIssueUnderControlPolicy(collectionControlPolicy, {\n\t\t\tpath: [collName, \"validator\"],\n\t\t\texpected: expected.validator\n\t\t}, \"fail\", failures, warnings);\n\t\treturn;\n\t}\n\tif (!expected.validator && live.validator) {\n\t\temitMongoIssueUnderControlPolicy(collectionControlPolicy, {\n\t\t\tpath: [collName, \"validator\"],\n\t\t\tactual: live.validator\n\t\t}, strict ? \"fail\" : \"warn\", failures, warnings);\n\t\treturn;\n\t}\n\tconst liveVal = live.validator;\n\tconst expectedVal = expected.validator;\n\tif (canonicalize(liveVal.jsonSchema) !== canonicalize(expectedVal.jsonSchema) || liveVal.validationLevel !== expectedVal.validationLevel || liveVal.validationAction !== expectedVal.validationAction) emitMongoIssueUnderControlPolicy(collectionControlPolicy, {\n\t\tpath: [collName, \"validator\"],\n\t\texpected: expectedVal,\n\t\tactual: liveVal\n\t}, \"fail\", failures, warnings);\n}\nfunction diffOptions(collName, live, expected, strict, collectionControlPolicy, failures, warnings) {\n\tif (!live.options && !expected.options) return;\n\tif (!expected.options && live.options) {\n\t\temitMongoIssueUnderControlPolicy(collectionControlPolicy, {\n\t\t\tpath: [collName, \"options\"],\n\t\t\tactual: live.options\n\t\t}, strict ? \"fail\" : \"warn\", failures, warnings);\n\t\treturn;\n\t}\n\tif (deepEqual(live.options, expected.options)) return;\n\temitMongoIssueUnderControlPolicy(collectionControlPolicy, {\n\t\tpath: [collName, \"options\"],\n\t\t...ifDefined(\"expected\", expected.options),\n\t\t...ifDefined(\"actual\", live.options)\n\t}, \"fail\", failures, warnings);\n}\n//#endregion\n//#region src/core/schema-verify/canonicalize-introspection.ts\n/**\n* Canonicalizes a live (introspected) `MongoSchemaIR` against the expected\n* (contract-built) IR before diffing. MongoDB applies server-side defaults\n* to several option/index families that are absent from authored contracts,\n* which would otherwise cause `verifyMongoSchema` to report false-positive\n* drift on a fresh `migrate` run.\n*\n* The normalization is contract-aware where it has to be: server defaults\n* are stripped from the live IR for fields the contract did not specify, so\n* a contract that *does* specify a value still gets compared faithfully.\n*\n* Symmetric defaults — like `changeStreamPreAndPostImages: { enabled: false }`,\n* which is equivalent to \"absent\" on both sides — are stripped from both IRs\n* so either authoring style verifies.\n*/\nfunction canonicalizeSchemasForVerification(live, expected) {\n\tconst expectedByName = /* @__PURE__ */ new Map();\n\tfor (const c of expected.collections) expectedByName.set(c.name, c);\n\tconst liveByName = /* @__PURE__ */ new Map();\n\tfor (const c of live.collections) liveByName.set(c.name, c);\n\tconst canonicalLive = live.collections.map((c) => canonicalizeLiveCollection(c, expectedByName.get(c.name)));\n\tconst canonicalExpected = expected.collections.map((c) => canonicalizeExpectedCollection(c, liveByName.get(c.name)));\n\treturn {\n\t\tlive: new MongoSchemaIR(canonicalLive),\n\t\texpected: new MongoSchemaIR(canonicalExpected)\n\t};\n}\nfunction canonicalizeLiveCollection(liveColl, expectedColl) {\n\tconst expectedIndexes = expectedColl?.indexes ?? [];\n\tconst indexes = liveColl.indexes.map((idx) => canonicalizeLiveIndex(idx, findExpectedIndexCounterpart(idx, expectedIndexes)));\n\tconst options = liveColl.options ? canonicalizeLiveOptions(liveColl.options, expectedColl?.options) : void 0;\n\treturn new MongoSchemaCollection({\n\t\tname: liveColl.name,\n\t\tindexes,\n\t\t...ifDefined(\"validator\", liveColl.validator),\n\t\t...ifDefined(\"options\", options)\n\t});\n}\nfunction canonicalizeExpectedCollection(expectedColl, liveColl) {\n\tconst indexes = expectedColl.indexes.map(canonicalizeTextIndexKeyOrder);\n\tconst options = expectedColl.options ? canonicalizeExpectedOptions(expectedColl.options, liveColl?.options) : void 0;\n\treturn new MongoSchemaCollection({\n\t\tname: expectedColl.name,\n\t\tindexes,\n\t\t...ifDefined(\"validator\", expectedColl.validator),\n\t\t...ifDefined(\"options\", options)\n\t});\n}\nfunction canonicalizeTextIndexKeyOrder(index) {\n\tif (!index.keys.some((k) => k.direction === \"text\")) return index;\n\treturn new MongoSchemaIndex({\n\t\tkeys: sortTextKeys(index.keys),\n\t\tunique: index.unique,\n\t\t...ifDefined(\"sparse\", index.sparse),\n\t\t...ifDefined(\"expireAfterSeconds\", index.expireAfterSeconds),\n\t\t...ifDefined(\"partialFilterExpression\", index.partialFilterExpression),\n\t\t...ifDefined(\"wildcardProjection\", index.wildcardProjection),\n\t\t...ifDefined(\"collation\", index.collation),\n\t\t...ifDefined(\"weights\", index.weights),\n\t\t...ifDefined(\"default_language\", index.default_language),\n\t\t...ifDefined(\"language_override\", index.language_override)\n\t});\n}\n/**\n* Returns a copy of `keys` with text-direction entries sorted alphabetically\n* while preserving the relative position of non-text entries. Compound text\n* indexes (`{a: 1, _fts: 'text', _ftsx: 1, b: 1}`) keep their scalar\n* prefix/suffix layout; only the contiguous text block is reordered.\n*/\nfunction sortTextKeys(keys) {\n\tconst textEntries = keys.filter((k) => k.direction === \"text\");\n\tif (textEntries.length <= 1) return keys;\n\tconst sortedText = [...textEntries].sort((a, b) => a.field.localeCompare(b.field));\n\tlet textIdx = 0;\n\treturn keys.map((k) => {\n\t\tif (k.direction !== \"text\") return k;\n\t\tconst next = sortedText[textIdx++];\n\t\t/* v8 ignore next 3 -- @preserve invariant guard: textIdx is always < sortedText.length here because we only consume sortedText for text-direction entries and sortedText is built from the same filter. */\n\t\tif (next === void 0) throw new InternalError(\"sortTextKeys: text-key counts mismatched\");\n\t\treturn next;\n\t});\n}\nfunction canonicalizeLiveIndex(liveIndex, expectedIndex) {\n\tconst projectedKeys = sortTextKeys(projectTextIndexKeys(liveIndex));\n\tconst collation = liveIndex.collation ? stripCollationFields(liveIndex.collation, expectedIndex?.collation) : liveIndex.collation;\n\tconst weights = expectedIndex?.weights === void 0 && hasDefaultTextWeights(projectedKeys, liveIndex.weights) ? void 0 : liveIndex.weights;\n\tconst default_language = expectedIndex?.default_language === void 0 && liveIndex.default_language === \"english\" ? void 0 : liveIndex.default_language;\n\tconst language_override = expectedIndex?.language_override === void 0 && liveIndex.language_override === \"language\" ? void 0 : liveIndex.language_override;\n\treturn new MongoSchemaIndex({\n\t\tkeys: projectedKeys,\n\t\tunique: liveIndex.unique,\n\t\t...ifDefined(\"sparse\", liveIndex.sparse),\n\t\t...ifDefined(\"expireAfterSeconds\", liveIndex.expireAfterSeconds),\n\t\t...ifDefined(\"partialFilterExpression\", liveIndex.partialFilterExpression),\n\t\t...ifDefined(\"wildcardProjection\", liveIndex.wildcardProjection),\n\t\t...ifDefined(\"collation\", collation),\n\t\t...ifDefined(\"weights\", weights),\n\t\t...ifDefined(\"default_language\", default_language),\n\t\t...ifDefined(\"language_override\", language_override)\n\t});\n}\n/**\n* Locate the contract-side index that corresponds to a live index for the\n* purpose of contract-aware normalization. We deliberately match by the\n* *projected* (contract-shaped) key list — so a live `_fts/_ftsx` index\n* resolves to a contract `{title: 'text', body: 'text'}` index — and pick\n* the first match. Contracts very rarely contain duplicate-key indexes; if\n* we have no counterpart we fall back to no normalization for that index.\n*/\nfunction findExpectedIndexCounterpart(liveIndex, expectedIndexes) {\n\tconst liveKeys = keyPatternOf(projectTextIndexKeys(liveIndex));\n\treturn expectedIndexes.find((expected) => keyPatternOf(expected.keys) === liveKeys);\n}\nfunction keyPatternOf(keys) {\n\treturn canonicalize(sortTextKeys(keys).map((k) => [k.field, k.direction]));\n}\n/**\n* MongoDB expands a contract-shaped text index like\n* `[{title: 'text'}, {body: 'text'}]` into its internal weighted vector\n* representation `[{_fts: 'text'}, {_ftsx: 1}]`. We project back to\n* contract-shaped keys via `weights`, iterating in whatever order MongoDB\n* returns them (alphabetical, in practice). `sortTextKeys` is applied\n* downstream to canonicalize the order on both sides, so this projection\n* does not depend on a specific iteration order.\n*/\nfunction projectTextIndexKeys(liveIndex) {\n\tif (!(liveIndex.keys.length >= 1 && liveIndex.keys.some((k) => k.field === \"_fts\" && k.direction === \"text\")) || !liveIndex.weights) return liveIndex.keys;\n\tconst textKeys = Object.keys(liveIndex.weights).map((field) => ({\n\t\tfield,\n\t\tdirection: \"text\"\n\t}));\n\tconst projectedKeys = [];\n\tfor (const key of liveIndex.keys) {\n\t\tif (key.field === \"_ftsx\") continue;\n\t\tif (key.field === \"_fts\") {\n\t\t\tprojectedKeys.push(...textKeys);\n\t\t\tcontinue;\n\t\t}\n\t\tprojectedKeys.push(key);\n\t}\n\treturn projectedKeys;\n}\n/**\n* MongoDB's server-default `weights` for an authored-without-weights text\n* index assigns `1` to every text-direction field. Returns `true` only when\n* `liveWeights` is exactly that uniform shape (every projected text-direction\n* key weighted at `1`) so the canonicalizer leaves non-default weights —\n* including out-of-band relevance tweaks — visible to the verifier.\n*\n* `projectTextIndexKeys` derives text-direction keys from the live weights\n* map, so the count is guaranteed to match; we only have to check the value\n* shape.\n*/\nfunction hasDefaultTextWeights(projectedKeys, liveWeights) {\n\tif (liveWeights === void 0) return false;\n\treturn projectedKeys.filter((k) => k.direction === \"text\").map((k) => k.field).every((field) => liveWeights[field] === 1);\n}\nfunction canonicalizeLiveOptions(liveOptions, expectedOptions) {\n\tconst collation = liveOptions.collation ? stripCollationFields(liveOptions.collation, expectedOptions?.collation) : void 0;\n\tconst timeseries = liveOptions.timeseries ? stripUnspecifiedFields(liveOptions.timeseries, expectedOptions?.timeseries) : void 0;\n\tconst clusteredIndex = liveOptions.clusteredIndex ? stripUnspecifiedFields(liveOptions.clusteredIndex, expectedOptions?.clusteredIndex) : void 0;\n\tconst changeStreamPreAndPostImages = isDisabledChangeStream(liveOptions.changeStreamPreAndPostImages) ? void 0 : liveOptions.changeStreamPreAndPostImages;\n\tif (!(liveOptions.capped || timeseries || collation || changeStreamPreAndPostImages || clusteredIndex)) return void 0;\n\treturn new MongoSchemaCollectionOptions({\n\t\t...ifDefined(\"capped\", liveOptions.capped),\n\t\t...ifDefined(\"timeseries\", timeseries),\n\t\t...ifDefined(\"collation\", collation),\n\t\t...ifDefined(\"changeStreamPreAndPostImages\", changeStreamPreAndPostImages),\n\t\t...ifDefined(\"clusteredIndex\", clusteredIndex)\n\t});\n}\nfunction canonicalizeExpectedOptions(expectedOptions, _liveOptions) {\n\tconst changeStreamPreAndPostImages = isDisabledChangeStream(expectedOptions.changeStreamPreAndPostImages) ? void 0 : expectedOptions.changeStreamPreAndPostImages;\n\tif (!(expectedOptions.capped || expectedOptions.timeseries || expectedOptions.collation || changeStreamPreAndPostImages || expectedOptions.clusteredIndex)) return void 0;\n\treturn new MongoSchemaCollectionOptions({\n\t\t...ifDefined(\"capped\", expectedOptions.capped),\n\t\t...ifDefined(\"timeseries\", expectedOptions.timeseries),\n\t\t...ifDefined(\"collation\", expectedOptions.collation),\n\t\t...ifDefined(\"changeStreamPreAndPostImages\", changeStreamPreAndPostImages),\n\t\t...ifDefined(\"clusteredIndex\", expectedOptions.clusteredIndex)\n\t});\n}\nfunction isDisabledChangeStream(value) {\n\treturn value !== void 0 && value.enabled === false;\n}\n/**\n* Returns a copy of `live` containing only the keys that `expected` defines.\n* Used for option families whose individual sub-fields are server-extended\n* with platform defaults (collation, timeseries, clusteredIndex), so the\n* verifier should compare only what the contract actually authored.\n*\n* When `expected` is `undefined` — i.e. the contract authored nothing for\n* this whole option family but the live IR has it — we return `live`\n* unchanged so the verifier still sees the entire live block and can\n* surface it as drift. (Returning `undefined` here would silently strip a\n* server-attached collation/timeseries/clusteredIndex that the contract\n* never asked for, hiding real drift.)\n*/\nfunction stripCollationFields(live, expected) {\n\treturn blindCast(stripUnspecifiedFields(live, expected));\n}\nfunction stripUnspecifiedFields(live, expected) {\n\tif (expected === void 0) return live;\n\tconst out = {};\n\tfor (const key of Object.keys(expected)) if (Object.hasOwn(live, key)) out[key] = live[key];\n\treturn out;\n}\n//#endregion\n//#region src/core/schema-verify/verify-mongo-schema.ts\nfunction verifyMongoSchema(options) {\n\tconst { contract, schema, strict, context } = options;\n\tconst startTime = Date.now();\n\tconst { live: canonicalLive, expected: canonicalExpected } = canonicalizeSchemasForVerification(schema, contractToMongoSchemaIR(contract));\n\tconst { failures, warnings } = diffMongoSchemas(canonicalLive, canonicalExpected, strict, resolveMongoCollectionControlPolicy(contract));\n\tconst ok = failures.length === 0;\n\tconst profileHash = typeof contract.profileHash === \"string\" ? contract.profileHash : \"\";\n\treturn {\n\t\tok,\n\t\t...ifDefined(\"code\", ok ? void 0 : VERIFY_CODE_SCHEMA_FAILURE),\n\t\tsummary: ok ? \"Schema matches contract\" : `Schema verification found ${failures.length} issue(s)`,\n\t\tcontract: {\n\t\t\tstorageHash: contract.storage.storageHash,\n\t\t\t...profileHash ? { profileHash } : {}\n\t\t},\n\t\ttarget: { expected: contract.target },\n\t\tschema: {\n\t\t\tissues: failures,\n\t\t\twarnings: { issues: warnings }\n\t\t},\n\t\tmeta: {\n\t\t\tstrict,\n\t\t\t...ifDefined(\"contractPath\", context?.contractPath),\n\t\t\t...ifDefined(\"configPath\", context?.configPath)\n\t\t},\n\t\ttimings: { total: Date.now() - startTime }\n\t};\n}\nfunction resolveMongoCollectionControlPolicy(contract) {\n\tconst policies = collectionControlPoliciesOf(contract);\n\treturn (collectionName) => collectionControlPolicyOf(collectionName, policies);\n}\n//#endregion\nexport { contractToMongoSchemaIR as i, canonicalizeSchemasForVerification as n, diffMongoSchemas as r, verifyMongoSchema as t };\n\n//# sourceMappingURL=verify-mongo-schema-CyvUewwP.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,aAAa,OAAO;CAC5B,OAAO,IAAI,iBAAiB;EAC3B,MAAM,MAAM;EACZ,QAAQ,MAAM;EACd,QAAQ,MAAM;EACd,oBAAoB,MAAM;EAC1B,yBAAyB,MAAM;EAC/B,oBAAoB,MAAM;EAC1B,WAAW,MAAM;EACjB,SAAS,MAAM;EACf,kBAAkB,MAAM;EACxB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