@prisma/orm-family-mongo 8.0.0-rc.23-dev.1 → 8.0.0-rc.23-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{contract-builder-BUa0Oz34.mjs → contract-builder-B0Uzl6w0.mjs} +157 -65
- package/dist/contract-builder-B0Uzl6w0.mjs.map +1 -0
- package/dist/{contract-builder-x1bl1wIr.d.mts → contract-builder-DmreXzbK.d.mts} +124 -74
- package/dist/contract-builder-DmreXzbK.d.mts.map +1 -0
- package/dist/contract-prisma6__provider.mjs +2 -2
- 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/{control-P83KyI0L.mjs → control-RY2G6cin.mjs} +2 -2
- package/dist/{control-P83KyI0L.mjs.map → control-RY2G6cin.mjs.map} +1 -1
- package/dist/dist-BhDqnAiz.mjs.map +1 -1
- package/dist/family.mjs +1 -1
- package/dist/family__control.mjs +1 -1
- package/dist/family__pack.mjs +1 -1
- package/dist/{interpreter-DpW_wEiP-Clp24cvz.mjs → interpreter-v8GWMscU-BPPKIq1V.mjs} +71 -18
- package/dist/interpreter-v8GWMscU-BPPKIq1V.mjs.map +1 -0
- package/package.json +20 -20
- package/dist/contract-builder-BUa0Oz34.mjs.map +0 -1
- package/dist/contract-builder-x1bl1wIr.d.mts.map +0 -1
- package/dist/interpreter-DpW_wEiP-Clp24cvz.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-builder-B0Uzl6w0.mjs","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-ts/dist/contract-builder.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { buildExecutionSection, computeProfileHash } from \"@internal/contract/hashing\";\nimport { assembleGeneratorFunctions, createGeneratorHelpers } from \"@internal/framework-components/components\";\nimport { MongoCollectionOptions, MongoIndex, applyPolymorphicScopeToMongoIndex, buildMongoStorage, defaultMongoIndexName, deriveCollectionValidators, indexLookupKey, mongoContractRefusalsOf, mongoValueSetsOf, unsupportedStoredNameReason } from \"@internal/mongo-contract\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { crossRef } from \"@internal/contract/types\";\nimport { answerMissingPropertyReads, assertSafeAuthoringHelperKey, bindEnumType, composePackAuthoringNamespace, createEntityHelpersFromNamespace, enumMemberError, enumType, isEnumTypeHandle, member, resolveToOneRelationNullable } from \"@internal/contract-authoring\";\nimport { applyDiscriminatorRule, assembleDataTypeSupport, assertNoCrossRegistryCollisions, assertTypeAliasesValid, assertTypeChoicesValid, describeAdmittedForms, encodeEnumMembers, flushAuthoringWarnings, instantiateAuthoringTypeAlias, instantiateAuthoringTypeConstructor, isAuthoringTypeAliasDescriptor, isAuthoringTypeChoiceDescriptor, isAuthoringTypeConstructorDescriptor, readWrittenValueAs, resolveAuthoringTypeChoice, typeChoiceArgumentsFromObject, typeConstructorLookup, validateAuthoringHelperArguments, validateAuthoringTypeChoiceParams, validateAuthoringTypeParams } from \"@internal/framework-components/authoring\";\nimport { codecTypeParamsProblem } from \"@internal/mongo-contract/data-type\";\nimport { extractCodecLookup } from \"@internal/framework-components/control\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { dataTypeId, numeralText } from \"@internal/framework-components/codec\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/build-refusals.ts\nfunction modelFieldKey(model, field) {\n\treturn {\n\t\tkind: \"field\",\n\t\towner: {\n\t\t\tkind: \"model\",\n\t\t\tname: model\n\t\t},\n\t\tfield\n\t};\n}\nfunction valueObjectFieldKey(valueObject, field) {\n\treturn {\n\t\tkind: \"field\",\n\t\towner: {\n\t\t\tkind: \"valueObject\",\n\t\t\tname: valueObject\n\t\t},\n\t\tfield\n\t};\n}\n/** The key of a validator refusal: the part of the definition its subject names. */\nfunction validatorRefusalKey(refusal) {\n\tswitch (refusal.kind) {\n\t\tcase \"embeddedModelHasVariants\": return {\n\t\t\tkind: \"relation\",\n\t\t\tmodel: refusal.modelName,\n\t\t\trelation: refusal.relationName\n\t\t};\n\t\tcase \"enumBsonType\":\n\t\tcase \"enumNotListable\": return {\n\t\t\tkind: \"enum\",\n\t\t\tenumName: refusal.enumName\n\t\t};\n\t\tcase \"enumMemberNotListable\": return {\n\t\t\tkind: \"enumMember\",\n\t\t\tenumName: refusal.enumName,\n\t\t\tmember: refusal.member\n\t\t};\n\t\tcase \"fieldBsonType\": return {\n\t\t\tkind: \"field\",\n\t\t\towner: refusal.owner,\n\t\t\tfield: refusal.fieldName\n\t\t};\n\t\tcase \"documentId\": return modelFieldKey(refusal.modelName, refusal.fieldName);\n\t}\n}\n//#endregion\n//#region src/build-models.ts\nfunction storedNameOf(field) {\n\treturn field.storedName ?? field.fieldName;\n}\n/** The name documents store `fieldName` under, or `fieldName` itself when the fields do not declare it. */\nfunction storedFieldNameIn(fields, fieldName) {\n\tconst field = fields.find((candidate) => candidate.fieldName === fieldName);\n\treturn field === void 0 ? fieldName : storedNameOf(field);\n}\nfunction fieldWithoutValueSet(field) {\n\treturn {\n\t\ttype: field.type,\n\t\tnullable: field.nullable,\n\t\tmany: field.many\n\t};\n}\n/** A model's fields. A field an enum types refers to the domain enum. */\nfunction buildFields(fields, namespaceId) {\n\treturn Object.fromEntries(fields.map((field) => [field.fieldName, {\n\t\t...fieldWithoutValueSet(field),\n\t\t...ifDefined(\"valueSet\", field.enumName === void 0 ? void 0 : {\n\t\t\tplane: \"domain\",\n\t\t\tentityKind: \"enum\",\n\t\t\tnamespaceId,\n\t\t\tentityName: field.enumName\n\t\t})\n\t}]));\n}\n/** A value object's members. A value object is a storage entity, and storage never refers to the domain plane, so a member an enum types refers to the enum's storage value set. */\nfunction buildValueObjectMembers(fields, namespaceId) {\n\treturn Object.fromEntries(fields.map((field) => [field.fieldName, {\n\t\t...fieldWithoutValueSet(field),\n\t\t...ifDefined(\"valueSet\", field.enumName === void 0 ? void 0 : {\n\t\t\tplane: \"storage\",\n\t\t\tentityKind: \"valueSet\",\n\t\t\tnamespaceId,\n\t\t\tentityName: field.enumName\n\t\t})\n\t}]));\n}\nfunction buildStorageFields(modelName, fields, refusals) {\n\tconst storageFields = {};\n\tconst fieldsByStoredName = /* @__PURE__ */ new Map();\n\tfor (const field of fields) {\n\t\tconst { fieldName } = field;\n\t\tconst key = modelFieldKey(modelName, fieldName);\n\t\tconst storedName = storedNameOf(field);\n\t\tconst unsupported = unsupportedStoredNameReason(storedName);\n\t\tif (unsupported !== void 0) refusals.push({\n\t\t\tkind: \"storedNameUnsupported\",\n\t\t\tkey,\n\t\t\treason: unsupported\n\t\t});\n\t\tconst firstField = fieldsByStoredName.get(storedName);\n\t\tif (firstField !== void 0) {\n\t\t\trefusals.push({\n\t\t\t\tkind: \"storedNameDuplicate\",\n\t\t\t\tkey,\n\t\t\t\tstoredName,\n\t\t\t\tfirstField\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tfieldsByStoredName.set(storedName, fieldName);\n\t\tstorageFields[fieldName] = { field: storedName };\n\t}\n\treturn storageFields;\n}\nfunction toOneRelationNullable(key, relation, fields, refusals) {\n\tconst ownsForeignKey = relation.cardinality !== \"1:1\";\n\tconst localFields = [];\n\tif (ownsForeignKey) for (const fieldName of relation.on.localFields) {\n\t\tconst localField = fields.find((field) => field.fieldName === fieldName);\n\t\tif (localField === void 0) {\n\t\t\trefusals.push({\n\t\t\t\tkind: \"relationLocalFieldUnknown\",\n\t\t\t\tkey,\n\t\t\t\tfieldName\n\t\t\t});\n\t\t\treturn relation.nullable ?? false;\n\t\t}\n\t\tlocalFields.push(localField);\n\t}\n\tconst { nullable, contradiction } = resolveToOneRelationNullable({\n\t\tdeclaredNullable: relation.nullable,\n\t\tlocalFieldNullability: localFields.map((localField) => localField.nullable === true),\n\t\townsReference: ownsForeignKey\n\t});\n\tif (contradiction !== void 0) refusals.push({\n\t\tkind: \"relationNullability\",\n\t\tkey,\n\t\townsForeignKey,\n\t\tcontradiction\n\t});\n\treturn nullable;\n}\nfunction buildRelation(model, relation, namespaceId, refusals) {\n\tconst to = crossRef(relation.toModel, namespaceId);\n\tif (relation.on === void 0) return {\n\t\tto,\n\t\tcardinality: relation.cardinality\n\t};\n\tif (relation.cardinality === \"1:N\") return {\n\t\tto,\n\t\tcardinality: \"1:N\",\n\t\ton: relation.on\n\t};\n\tconst key = {\n\t\tkind: \"relation\",\n\t\tmodel: model.modelName,\n\t\trelation: relation.relationName\n\t};\n\treturn {\n\t\tto,\n\t\tcardinality: relation.cardinality,\n\t\tnullable: toOneRelationNullable(key, relation, model.fields, refusals),\n\t\ton: relation.on\n\t};\n}\nfunction buildValueObjects(valueObjects, namespaceId, refusals) {\n\tconst builtValueObjects = {};\n\tfor (const valueObject of valueObjects ?? []) {\n\t\tif (valueObject.name in builtValueObjects) {\n\t\t\trefusals.push({\n\t\t\t\tkind: \"duplicateValueObject\",\n\t\t\t\tkey: {\n\t\t\t\t\tkind: \"valueObject\",\n\t\t\t\t\tvalueObject: valueObject.name\n\t\t\t\t}\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const field of valueObject.fields) if (field.storedName !== void 0) refusals.push({\n\t\t\tkind: \"valueObjectFieldStoredName\",\n\t\t\tkey: valueObjectFieldKey(valueObject.name, field.fieldName)\n\t\t});\n\t\tbuiltValueObjects[valueObject.name] = { fields: buildValueObjectMembers(valueObject.fields, namespaceId) };\n\t}\n\treturn builtValueObjects;\n}\n/**\n* Refuses a variant field stored under a name another field of its base is stored under. A variant's documents hold its base's fields too, so the two would overwrite each other, the discriminator included. A variant that restates a base field under the same name restates that field.\n*/\nfunction restatementDifferences(variantField, baseField) {\n\tconst differences = [];\n\tif (storedNameOf(variantField) !== storedNameOf(baseField)) differences.push(\"storedName\");\n\tif (canonicalStringify([variantField.type, variantField.enumName]) !== canonicalStringify([baseField.type, baseField.enumName])) differences.push(\"type\");\n\tif (variantField.nullable !== baseField.nullable) differences.push(\"nullable\");\n\tif (canonicalStringify(variantField.many) !== canonicalStringify(baseField.many)) differences.push(\"many\");\n\treturn differences;\n}\n/**\n* A variant's documents hold its base's fields too, and its collection's validator is written from the base. A variant field may restate a base field only exactly, and may not take a stored name a different base field uses.\n*/\nfunction checkFieldsAgainstBase(variant, models, refusals) {\n\tif (variant.base === void 0) return;\n\tconst baseName = variant.base.model;\n\tconst base = models.find((model) => model.modelName === baseName);\n\tif (base === void 0) return;\n\tconst baseFieldsByName = new Map(base.fields.map((field) => [field.fieldName, field]));\n\tconst baseFieldsByStoredName = new Map(base.fields.map((field) => [storedNameOf(field), field]));\n\tfor (const field of variant.fields) {\n\t\tconst key = modelFieldKey(variant.modelName, field.fieldName);\n\t\tconst restated = baseFieldsByName.get(field.fieldName);\n\t\tif (restated !== void 0) {\n\t\t\tconst differences = restatementDifferences(field, restated);\n\t\t\tif (differences.length > 0) refusals.push({\n\t\t\t\tkind: \"restatedBaseFieldDiffers\",\n\t\t\t\tkey,\n\t\t\t\tbaseModel: baseName,\n\t\t\t\tdifferences\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst storedName = storedNameOf(field);\n\t\tconst baseField = baseFieldsByStoredName.get(storedName);\n\t\tif (baseField === void 0) continue;\n\t\trefusals.push({\n\t\t\tkind: \"storedNameSharedWithBase\",\n\t\t\tkey,\n\t\t\tstoredName,\n\t\t\tbaseModel: baseName,\n\t\t\tbaseField: baseField.fieldName\n\t\t});\n\t}\n}\n/**\n* Each model of the contract. `variantValues` holds each accepted variant's discriminator value as its base's field stores it; a base lists those variants.\n*/\nfunction buildModels(input) {\n\tconst { models, variantValues, namespaceId, refusals } = input;\n\tconst builtModels = {};\n\tfor (const model of models) {\n\t\tconst { modelName } = model;\n\t\tif (modelName in builtModels) {\n\t\t\trefusals.push({\n\t\t\t\tkind: \"duplicateModel\",\n\t\t\t\tkey: {\n\t\t\t\t\tkind: \"model\",\n\t\t\t\t\tmodel: modelName\n\t\t\t\t}\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tcheckFieldsAgainstBase(model, models, refusals);\n\t\tconst storage = {\n\t\t\t...model.collection ? { collection: model.collection } : {},\n\t\t\tfields: buildStorageFields(modelName, model.fields, refusals),\n\t\t\t...model.storageRelations ? { relations: model.storageRelations } : {}\n\t\t};\n\t\tconst variants = model.discriminator === void 0 ? void 0 : models.flatMap((variant) => {\n\t\t\tconst value = variantValues.get(variant.modelName);\n\t\t\treturn variant.base?.model === modelName && value !== void 0 ? [[value, crossRef(variant.modelName, namespaceId)]] : [];\n\t\t});\n\t\tbuiltModels[modelName] = {\n\t\t\tfields: buildFields(model.fields, namespaceId),\n\t\t\trelations: Object.fromEntries((model.relations ?? []).map((relation) => [relation.relationName, buildRelation(model, relation, namespaceId, refusals)])),\n\t\t\tstorage,\n\t\t\t...model.owner ? { owner: model.owner } : {},\n\t\t\t...model.base ? { base: crossRef(model.base.model, namespaceId) } : {},\n\t\t\t...model.discriminator ? { discriminator: { field: model.discriminator.field } } : {},\n\t\t\t...variants === void 0 ? {} : { variants: Object.fromEntries(variants) }\n\t\t};\n\t}\n\treturn builtModels;\n}\nfunction buildRoots(definition, models, namespaceId) {\n\tif (definition.roots !== void 0) return Object.fromEntries(Object.entries(definition.roots).map(([rootName, modelName]) => [rootName, crossRef(modelName, namespaceId)]));\n\tconst roots = {};\n\tfor (const model of models) {\n\t\tif (!model.collection || model.owner || model.base) continue;\n\t\troots[model.collection] = crossRef(model.modelName, namespaceId);\n\t}\n\treturn roots;\n}\n//#endregion\n//#region src/build-collections.ts\n/** The stored form of an index key: the field's stored name, with a wildcard scope kept. */\nfunction storedIndexKey(fields, key) {\n\tconst scope = key.match(/^(.+)\\.\\$\\*\\*$/)?.[1];\n\tif (scope !== void 0) return `${storedFieldNameIn(fields, scope)}.$**`;\n\treturn key === \"$**\" ? key : storedFieldNameIn(fields, key);\n}\n/** The name MongoDB gives the index when it is created without one, from its stored keys. */\nfunction defaultIndexNameOf(index, fields) {\n\treturn defaultMongoIndexName(Object.entries(index.fields).map(([field, direction]) => ({\n\t\tfield: storedIndexKey(fields, field),\n\t\tdirection\n\t})));\n}\n/** The index as its refusals show it: as written, without a name that is only the default. */\nfunction indexSignature(index, fields) {\n\tconst name = index.options?.name;\n\tif (name === void 0 || name !== defaultIndexNameOf(index, fields)) return canonicalStringify(index);\n\tconst { name: _, ...options } = index.options ?? {};\n\treturn canonicalStringify(Object.keys(options).length === 0 ? { fields: index.fields } : {\n\t\t...index,\n\t\toptions\n\t});\n}\nfunction toStorageIndex(index, fields) {\n\tif (index.options?.name === void 0) throw new InternalError(`An index on ${Object.keys(index.fields).join(\", \")} reached the MongoDB contract builder without a name. Call nameIndexes on the definition before building it.`);\n\tconst input = { keys: Object.entries(index.fields).map(([field, direction]) => ({\n\t\tfield: storedIndexKey(fields, field),\n\t\tdirection\n\t})) };\n\tif (index.options) {\n\t\tfor (const [key, value] of Object.entries(index.options)) if (value !== void 0) input[key] = value;\n\t}\n\treturn new MongoIndex(blindCast(input));\n}\nfunction scopedStorageIndex(written, fields, polymorphicScope) {\n\tconst storageIndex = toStorageIndex(written, fields);\n\treturn polymorphicScope === void 0 ? {\n\t\tkind: \"ok\",\n\t\tindex: storageIndex\n\t} : applyPolymorphicScopeToMongoIndex(storageIndex, polymorphicScope);\n}\nfunction toStorageCollectionOptions(opts) {\n\treturn new MongoCollectionOptions({\n\t\t...opts.capped ? { capped: {\n\t\t\tsize: opts.size ?? 0,\n\t\t\t...opts.max != null && { max: opts.max }\n\t\t} } : {},\n\t\t...ifDefined(\"storageEngine\", opts.storageEngine),\n\t\t...ifDefined(\"indexOptionDefaults\", opts.indexOptionDefaults),\n\t\t...ifDefined(\"collation\", opts.collation),\n\t\t...ifDefined(\"timeseries\", opts.timeseries),\n\t\t...opts.clusteredIndex !== void 0 && { clusteredIndex: opts.clusteredIndex.name !== void 0 ? { name: opts.clusteredIndex.name } : {} },\n\t\t...ifDefined(\"expireAfterSeconds\", opts.expireAfterSeconds),\n\t\t...ifDefined(\"changeStreamPreAndPostImages\", opts.changeStreamPreAndPostImages)\n\t});\n}\nfunction findMissingIndexField(index, fields) {\n\tfor (const fieldName of Object.keys(index.fields)) {\n\t\tconst wildcardMatch = fieldName.match(/^(.+)\\.\\$\\*\\*$/);\n\t\tconst lookupName = wildcardMatch ? wildcardMatch[1] : fieldName;\n\t\tif (lookupName === void 0 || lookupName.length === 0) continue;\n\t\tif (lookupName === \"$**\") continue;\n\t\tif (!fields.some((field) => field.fieldName === lookupName)) return lookupName;\n\t}\n}\nfunction isWildcardKey(key) {\n\treturn key === \"$**\" || key.endsWith(\".$**\");\n}\nfunction isTextIndex(index) {\n\treturn Object.values(index.fields).includes(\"text\");\n}\n/** The first shape rule an index breaks, of those MongoDB enforces when it creates the index. */\nfunction indexShapeProblem(index) {\n\tconst keys = Object.entries(index.fields);\n\tconst hasWildcard = keys.some(([key]) => isWildcardKey(key));\n\tconst directions = keys.map(([, direction]) => direction);\n\tconst options = index.options ?? {};\n\tif (hasWildcard && options.unique) return \"unique-wildcard\";\n\tif (hasWildcard && directions.some((direction) => [\n\t\t\"hashed\",\n\t\t\"2d\",\n\t\t\"2dsphere\"\n\t].includes(String(direction)))) return \"wildcard-with-type\";\n\tif (directions.includes(\"hashed\") && keys.length > 1) return \"hashed-several-fields\";\n\tif (hasWildcard && options.expireAfterSeconds !== void 0) return \"ttl-with-wildcard\";\n\tif (!hasWildcard && options.wildcardProjection !== void 0) return \"projection-without-wildcard\";\n\tif (options.collation !== void 0 && !options.collation.locale) return \"collation-without-locale\";\n}\nfunction resolveVariantScope(model, modelsByName, variantValues) {\n\tif (!model.base) return void 0;\n\tconst base = modelsByName.get(model.base.model);\n\tconst discriminatorField = base?.discriminator?.field;\n\tconst discriminatorValue = variantValues.get(model.modelName);\n\tif (base === void 0 || !discriminatorField || discriminatorValue === void 0) return;\n\treturn {\n\t\tdiscriminatorField: storedFieldNameIn(base.fields, discriminatorField),\n\t\tdiscriminatorValue\n\t};\n}\n/**\n* Each index the model writes, in order: the storage index, with a variant's discriminator scope applied, or the builder's refusal of it for an unknown field, a shape MongoDB refuses or a scope conflict.\n*/\nfunction checkModelIndexes(model, modelsByName, variantValues) {\n\tconst polymorphicScope = resolveVariantScope(model, modelsByName, variantValues);\n\treturn (model.indexes ?? []).map((written, position) => {\n\t\tconst key = {\n\t\t\tkind: \"index\",\n\t\t\tmodel: model.modelName,\n\t\t\tposition\n\t\t};\n\t\tconst signature = indexSignature(written, model.fields);\n\t\tconst missingField = findMissingIndexField(written, model.fields);\n\t\tif (missingField !== void 0) return {\n\t\t\tkind: \"refused\",\n\t\t\trefusal: {\n\t\t\t\tkind: \"indexFieldUnknown\",\n\t\t\t\tkey,\n\t\t\t\tfieldName: missingField,\n\t\t\t\tsignature\n\t\t\t}\n\t\t};\n\t\tconst shapeProblem = indexShapeProblem(written);\n\t\tif (shapeProblem !== void 0) return {\n\t\t\tkind: \"refused\",\n\t\t\trefusal: {\n\t\t\t\tkind: \"indexShape\",\n\t\t\t\tkey,\n\t\t\t\trule: shapeProblem,\n\t\t\t\tsignature\n\t\t\t}\n\t\t};\n\t\tconst scoped = scopedStorageIndex(written, model.fields, polymorphicScope);\n\t\tif (scoped.kind === \"conflict\") return {\n\t\t\tkind: \"refused\",\n\t\t\trefusal: {\n\t\t\t\tkind: \"indexScopeConflict\",\n\t\t\t\tkey,\n\t\t\t\treason: scoped.reason,\n\t\t\t\tsignature\n\t\t\t}\n\t\t};\n\t\treturn {\n\t\t\tkind: \"accepted\",\n\t\t\twritten,\n\t\t\tindex: scoped.index\n\t\t};\n\t});\n}\nfunction checkNoCollectionSettings(model, refusals) {\n\tconst key = {\n\t\tkind: \"collectionSettings\",\n\t\tmodel: model.modelName\n\t};\n\tif (model.indexes && model.indexes.length > 0) refusals.push({\n\t\tkind: \"collectionSettingWithoutCollection\",\n\t\tkey,\n\t\tsetting: \"indexes\"\n\t});\n\tif (model.collectionOptions) refusals.push({\n\t\tkind: \"collectionSettingWithoutCollection\",\n\t\tkey,\n\t\tsetting: \"collectionOptions\"\n\t});\n\tif (model.controlPolicy) refusals.push({\n\t\tkind: \"collectionSettingWithoutCollection\",\n\t\tkey,\n\t\tsetting: \"controlPolicy\"\n\t});\n}\n/** Each collection the models are stored in, with its indexes, options and control policy. Validators are added later. */\nfunction buildCollections(input) {\n\tconst { models, variantValues, refusals } = input;\n\tconst intermediate = {};\n\tconst indexOwnersByCollection = /* @__PURE__ */ new Map();\n\tconst indexNameOwnersByCollection = /* @__PURE__ */ new Map();\n\tconst textIndexCollections = /* @__PURE__ */ new Set();\n\tconst modelsByName = new Map(models.map((model) => [model.modelName, model]));\n\tfor (const model of models) {\n\t\tconst { modelName, collection } = model;\n\t\tif (!collection) {\n\t\t\tcheckNoCollectionSettings(model, refusals);\n\t\t\tcontinue;\n\t\t}\n\t\tconst collectionKey = {\n\t\t\tkind: \"collectionSettings\",\n\t\t\tmodel: modelName\n\t\t};\n\t\tconst existingCollection = intermediate[collection] ?? {};\n\t\tconst existingIndexes = existingCollection.indexes ?? [];\n\t\tconst indexOwners = indexOwnersByCollection.get(collection) ?? /* @__PURE__ */ new Map();\n\t\tindexOwnersByCollection.set(collection, indexOwners);\n\t\tconst nameOwners = indexNameOwnersByCollection.get(collection) ?? /* @__PURE__ */ new Map();\n\t\tindexNameOwnersByCollection.set(collection, nameOwners);\n\t\tif (existingCollection.options && model.collectionOptions) refusals.push({\n\t\t\tkind: \"collectionSettingTwice\",\n\t\t\tkey: collectionKey,\n\t\t\tsetting: \"collectionOptions\",\n\t\t\tcollection\n\t\t});\n\t\tif (existingCollection.control !== void 0 && model.controlPolicy) refusals.push({\n\t\t\tkind: \"collectionSettingTwice\",\n\t\t\tkey: collectionKey,\n\t\t\tsetting: \"controlPolicy\",\n\t\t\tcollection\n\t\t});\n\t\tconst storageIndexes = [];\n\t\tcheckModelIndexes(model, modelsByName, variantValues).forEach((checked, position) => {\n\t\t\tif (checked.kind === \"refused\") {\n\t\t\t\trefusals.push(checked.refusal);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst key = {\n\t\t\t\tkind: \"index\",\n\t\t\t\tmodel: modelName,\n\t\t\t\tposition\n\t\t\t};\n\t\t\tconst signature = indexSignature(checked.written, model.fields);\n\t\t\tif (isTextIndex(checked.written)) {\n\t\t\t\tif (textIndexCollections.has(collection)) {\n\t\t\t\t\trefusals.push({\n\t\t\t\t\t\tkind: \"indexShape\",\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\trule: \"second-text-index\",\n\t\t\t\t\t\tsignature\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttextIndexCollections.add(collection);\n\t\t\t}\n\t\t\tconst lookupKey = indexLookupKey(checked.index);\n\t\t\tconst first = indexOwners.get(lookupKey);\n\t\t\tif (first !== void 0) {\n\t\t\t\trefusals.push({\n\t\t\t\t\tkind: \"indexDuplicate\",\n\t\t\t\t\tkey,\n\t\t\t\t\tcollection,\n\t\t\t\t\tfirstModel: first.model,\n\t\t\t\t\tfirstPosition: first.position,\n\t\t\t\t\tsignature\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst firstNamed = nameOwners.get(checked.index.name);\n\t\t\tif (firstNamed !== void 0) {\n\t\t\t\trefusals.push({\n\t\t\t\t\tkind: \"indexNameDuplicate\",\n\t\t\t\t\tkey,\n\t\t\t\t\tcollection,\n\t\t\t\t\tname: checked.index.name,\n\t\t\t\t\tfirstModel: firstNamed.model,\n\t\t\t\t\tfirstPosition: firstNamed.position\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tindexOwners.set(lookupKey, key);\n\t\t\tnameOwners.set(checked.index.name, key);\n\t\t\tstorageIndexes.push(checked.index);\n\t\t});\n\t\tconst storageOptions = model.collectionOptions ? toStorageCollectionOptions(model.collectionOptions) : void 0;\n\t\tintermediate[collection] = {\n\t\t\t...existingCollection,\n\t\t\t...storageIndexes.length > 0 ? { indexes: [...existingIndexes, ...storageIndexes] } : {},\n\t\t\t...ifDefined(\"options\", storageOptions),\n\t\t\t...ifDefined(\"control\", model.controlPolicy)\n\t\t};\n\t}\n\treturn intermediate;\n}\n//#endregion\n//#region src/build-enums.ts\n/** Each enum with its members as its codec stores them. An enum the builder refuses is left out. */\nfunction buildEnums(definition, codecLookup, refusals) {\n\tconst builtEnums = {};\n\tfor (const [enumName, handle] of Object.entries(definition.enums ?? {})) {\n\t\tconst encoded = encodeEnumMembers(handle, codecLookup);\n\t\tif (!encoded.ok) {\n\t\t\tfor (const problem of encoded.failure) refusals.push({\n\t\t\t\tkind: \"enumMemberProblem\",\n\t\t\t\tkey: \"member\" in problem ? {\n\t\t\t\t\tkind: \"enumMember\",\n\t\t\t\t\tenumName,\n\t\t\t\t\tmember: problem.member\n\t\t\t\t} : {\n\t\t\t\t\tkind: \"enum\",\n\t\t\t\t\tenumName\n\t\t\t\t},\n\t\t\t\tenumName: handle.enumName,\n\t\t\t\tcodecId: handle.codecId,\n\t\t\t\tproblem\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tbuiltEnums[enumName] = {\n\t\t\tcodecId: handle.codecId,\n\t\t\tmembers: encoded.value\n\t\t};\n\t}\n\tfor (const [enumName, handle] of Object.entries(definition.enums ?? {})) if (enumName !== handle.enumName) refusals.push({\n\t\tkind: \"enumKeyMismatch\",\n\t\tkey: {\n\t\t\tkind: \"enum\",\n\t\t\tenumName\n\t\t},\n\t\tenumName: handle.enumName\n\t});\n\treturn builtEnums;\n}\n//#endregion\n//#region src/build-execution-defaults.ts\nconst PHASES = [\"onCreate\", \"onUpdate\"];\nfunction hasExecutionDefaults(field) {\n\tconst phases = field.executionDefaults;\n\tconst calls = field.generatorCalls;\n\tconst values = field.generatedValues;\n\treturn phases?.onCreate !== void 0 || phases?.onUpdate !== void 0 || values?.onCreate !== void 0 || values?.onUpdate !== void 0 || calls?.onCreate !== void 0 || calls?.onUpdate !== void 0;\n}\n/**\n* The phases a field generates: its resolved execution defaults, with the generators its calls resolve to for its codec. Undefined when a call is refused.\n*/\nfunction executionDefaultsOf(field, key, generatorFunctions, refusals) {\n\tconst typeGiven = field.executionDefaults;\n\tlet refused = false;\n\tfor (const phase of PHASES) if (typeGiven?.[phase] !== void 0 && field.generatedValues?.[phase] !== void 0) {\n\t\trefusals.push({\n\t\t\tkind: \"generatorPhaseSetTwice\",\n\t\t\tkey,\n\t\t\tphase\n\t\t});\n\t\trefused = true;\n\t}\n\tconst written = {\n\t\t...typeGiven,\n\t\t...field.generatedValues\n\t};\n\tconst calls = field.generatorCalls;\n\tif (calls === void 0) return refused ? void 0 : written;\n\tconst type = field.type;\n\tconst codecId = type.kind === \"scalar\" ? type.codecId : void 0;\n\tconst phases = written;\n\tfor (const phase of PHASES) {\n\t\tconst call = calls[phase];\n\t\tif (call === void 0) continue;\n\t\tif (written[phase] !== void 0) {\n\t\t\trefusals.push({\n\t\t\t\tkind: \"generatorPhaseSetTwice\",\n\t\t\t\tkey,\n\t\t\t\tphase\n\t\t\t});\n\t\t\trefused = true;\n\t\t\tcontinue;\n\t\t}\n\t\tconst resolution = type.kind === \"scalar\" ? generatorFunctions.resolve(call, {\n\t\t\tcodecId: type.codecId,\n\t\t\ttypeParams: type.typeParams,\n\t\t\tlength: void 0\n\t\t}) : void 0;\n\t\tif (resolution?.ok === true) {\n\t\t\tphases[phase] = resolution.generator;\n\t\t\tcontinue;\n\t\t}\n\t\trefused = true;\n\t\trefusals.push(resolution?.reason === \"unknown-function\" ? {\n\t\t\tkind: \"generatorUnknown\",\n\t\t\tkey,\n\t\t\tphase,\n\t\t\tfunctionName: call.name,\n\t\t\tcodecId\n\t\t} : {\n\t\t\tkind: \"generatorNotApplicable\",\n\t\t\tkey,\n\t\t\tphase,\n\t\t\tfunctionName: call.name,\n\t\t\tcodecId,\n\t\t\tmessage: resolution?.reason === \"refused\" ? resolution.message : void 0\n\t\t});\n\t}\n\treturn refused ? void 0 : phases;\n}\nfunction checkValueObjectExecutionDefaults(valueObjects, refusals) {\n\tfor (const valueObject of valueObjects ?? []) for (const field of valueObject.fields) if (hasExecutionDefaults(field)) refusals.push({\n\t\tkind: \"generatedOnValueObject\",\n\t\tkey: valueObjectFieldKey(valueObject.name, field.fieldName)\n\t});\n}\nfunction buildExecutionDefaults(input) {\n\tconst { models, generatorFunctions, namespaceId, refusals } = input;\n\tconst collectionByModelName = new Map(models.map((model) => [model.modelName, model.collection]));\n\tconst byRef = /* @__PURE__ */ new Map();\n\tconst defaults = [];\n\tfor (const model of models) {\n\t\tconst { modelName } = model;\n\t\tfor (const field of model.fields) {\n\t\t\tif (!hasExecutionDefaults(field)) continue;\n\t\t\tconst { fieldName } = field;\n\t\t\tconst key = modelFieldKey(modelName, fieldName);\n\t\t\tconst phases = executionDefaultsOf(field, key, generatorFunctions, refusals);\n\t\t\tif (phases === void 0) continue;\n\t\t\tif (field.many) {\n\t\t\t\trefusals.push({\n\t\t\t\t\tkind: \"generatedList\",\n\t\t\t\t\tkey\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (model.base !== void 0) {\n\t\t\t\trefusals.push({\n\t\t\t\t\tkind: \"generatedOnVariant\",\n\t\t\t\t\tkey,\n\t\t\t\t\tbaseModel: model.base.model,\n\t\t\t\t\tcollection: model.collection ?? collectionByModelName.get(model.base.model)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst entry = model.collection;\n\t\t\tif (entry === void 0) {\n\t\t\t\trefusals.push({\n\t\t\t\t\tkind: \"generatedWithoutCollection\",\n\t\t\t\t\tkey\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst storedName = storedNameOf(field);\n\t\t\tconst refKey = JSON.stringify([entry, storedName]);\n\t\t\tconst phasesKey = canonicalStringify(phases);\n\t\t\tconst existing = byRef.get(refKey);\n\t\t\tif (existing !== void 0) {\n\t\t\t\tif (existing.phasesKey !== phasesKey) refusals.push({\n\t\t\t\t\tkind: \"generatedConflict\",\n\t\t\t\t\tkey,\n\t\t\t\t\totherModel: existing.modelName,\n\t\t\t\t\totherField: existing.fieldName,\n\t\t\t\t\tcollection: entry\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbyRef.set(refKey, {\n\t\t\t\tmodelName,\n\t\t\t\tfieldName,\n\t\t\t\tphasesKey\n\t\t\t});\n\t\t\tdefaults.push({\n\t\t\t\tref: {\n\t\t\t\t\tnamespace: namespaceId,\n\t\t\t\t\tentry,\n\t\t\t\t\tfield: storedName\n\t\t\t\t},\n\t\t\t\t...phases\n\t\t\t});\n\t\t}\n\t}\n\treturn defaults;\n}\n//#endregion\n//#region src/build-fields.ts\nfunction checkField(field, key, input) {\n\tconst { type } = field;\n\tif (field.enumName !== void 0 && !input.declaredEnums.has(field.enumName)) input.refusals.push({\n\t\tkind: \"enumUnknown\",\n\t\tkey,\n\t\tenumName: field.enumName\n\t});\n\tif (type.kind === \"scalar\" && type.typeParams !== void 0) {\n\t\tconst problem = codecTypeParamsProblem(type.codecId, type.typeParams, input.lookups);\n\t\tif (problem !== void 0) input.refusals.push({\n\t\t\tkind: \"typeParamsInvalid\",\n\t\t\tkey,\n\t\t\tproblem\n\t\t});\n\t}\n}\n/**\n* Checks each field of the models and value objects on its own: its enum is declared, and its data type accepts its type parameters.\n*/\nfunction checkFields(input) {\n\tfor (const model of input.models) for (const field of model.fields) checkField(field, modelFieldKey(model.modelName, field.fieldName), input);\n\tfor (const valueObject of input.valueObjects ?? []) for (const field of valueObject.fields) checkField(field, valueObjectFieldKey(valueObject.name, field.fieldName), input);\n}\n//#endregion\n//#region src/build-polymorphism.ts\n/**\n* The models with each variant stored in its base's collection: a variant that names no collection takes its base's, and one that names another is refused.\n*/\nfunction inheritVariantCollections(models, refusals) {\n\tconst modelsByName = new Map(models.map((model) => [model.modelName, model]));\n\treturn models.map((model) => {\n\t\tif (model.base === void 0) return model;\n\t\tconst baseCollection = modelsByName.get(model.base.model)?.collection;\n\t\tif (baseCollection === void 0) return model;\n\t\tif (model.collection === void 0) return {\n\t\t\t...model,\n\t\t\tcollection: baseCollection\n\t\t};\n\t\tif (model.collection !== baseCollection) refusals.push({\n\t\t\tkind: \"variantCollectionDiffers\",\n\t\t\tkey: {\n\t\t\t\tkind: \"collectionSettings\",\n\t\t\t\tmodel: model.modelName\n\t\t\t},\n\t\t\tcollection: model.collection,\n\t\t\tbaseModel: model.base.model,\n\t\t\tbaseCollection\n\t\t});\n\t\treturn model;\n\t});\n}\nfunction checkVariantShape(model, modelsByName, refusals) {\n\tif (model.base === void 0) return;\n\tconst key = {\n\t\tkind: \"base\",\n\t\tvariant: model.modelName\n\t};\n\tconst baseModel = model.base.model;\n\tif (model.discriminator !== void 0) refusals.push({\n\t\tkind: \"discriminatorAndBase\",\n\t\tkey: {\n\t\t\tkind: \"discriminator\",\n\t\t\tmodel: model.modelName\n\t\t}\n\t});\n\tconst base = modelsByName.get(baseModel);\n\tif (base === void 0) {\n\t\trefusals.push({\n\t\t\tkind: \"baseUnknown\",\n\t\t\tkey,\n\t\t\tbaseModel\n\t\t});\n\t\treturn;\n\t}\n\tif (base.discriminator === void 0) {\n\t\trefusals.push({\n\t\t\tkind: \"baseWithoutDiscriminator\",\n\t\t\tkey,\n\t\t\tbaseModel\n\t\t});\n\t\treturn;\n\t}\n\tif (model.base.value === void 0) refusals.push({\n\t\tkind: \"variantWithoutValue\",\n\t\tkey,\n\t\tbaseModel\n\t});\n}\n/** Each variant of `base` with the value its source wrote, in the order of the models. */\nfunction writtenVariantsOf(base, models) {\n\treturn models.flatMap((model) => model.base?.model === base.modelName && model.base.value !== void 0 ? [{\n\t\tkey: model.modelName,\n\t\twritten: model.base.value\n\t}] : []);\n}\nfunction decideDiscriminator(input) {\n\tconst { base, models, refusals } = input;\n\tconst discriminator = base.discriminator;\n\tif (discriminator === void 0 || base.base !== void 0) return /* @__PURE__ */ new Map();\n\tconst key = {\n\t\tkind: \"discriminator\",\n\t\tmodel: base.modelName\n\t};\n\tconst variantNames = new Set(models.filter((model) => model.base?.model === base.modelName).map((model) => model.modelName));\n\tfor (const listed of discriminator.listedVariants ?? []) if (!variantNames.has(listed)) refusals.push({\n\t\tkind: \"listedVariantMissing\",\n\t\tkey,\n\t\tvariant: listed\n\t});\n\tif (variantNames.size === 0) refusals.push({\n\t\tkind: \"discriminatorWithoutVariants\",\n\t\tkey\n\t});\n\tconst fieldName = discriminator.field;\n\tconst field = base.fields.find((candidate) => candidate.fieldName === fieldName);\n\tif (field === void 0) {\n\t\trefusals.push({\n\t\t\tkind: \"discriminatorFieldUnknown\",\n\t\t\tkey,\n\t\t\tfieldName\n\t\t});\n\t\treturn /* @__PURE__ */ new Map();\n\t}\n\tconst { type } = field;\n\tconst enumMembers = field.enumName === void 0 ? void 0 : input.enums[field.enumName]?.members.map((member) => member.value);\n\tconst decision = applyDiscriminatorRule({\n\t\tfield: {\n\t\t\tref: type.kind === \"scalar\" ? {\n\t\t\t\tcodecId: type.codecId,\n\t\t\t\t...type.typeParams ? { typeParams: blindCast(type.typeParams) } : {}\n\t\t\t} : void 0,\n\t\t\tnullable: field.nullable,\n\t\t\tmany: field.many !== false,\n\t\t\tenumMembers\n\t\t},\n\t\tvariants: writtenVariantsOf(base, models),\n\t\tsubject: `Field \"${base.modelName}.${fieldName}\"`,\n\t\tcodecLookup: input.codecLookup,\n\t\tdataTypes: input.dataTypes\n\t});\n\tfor (const refusal of decision.fieldRefusals) refusals.push({\n\t\tkind: \"discriminatorField\",\n\t\tkey,\n\t\tfieldName,\n\t\trefusal\n\t});\n\tfor (const refusal of decision.variantRefusals) refusals.push({\n\t\tkind: \"discriminatorValue\",\n\t\tkey: {\n\t\t\tkind: \"base\",\n\t\t\tvariant: refusal.key\n\t\t},\n\t\tbaseModel: base.modelName,\n\t\tfieldName,\n\t\tenumName: field.enumName,\n\t\trefusal\n\t});\n\tconst variantsByValue = /* @__PURE__ */ new Map();\n\tfor (const [variant, value] of decision.values) {\n\t\tconst firstVariant = variantsByValue.get(value);\n\t\tif (firstVariant !== void 0) {\n\t\t\trefusals.push({\n\t\t\t\tkind: \"discriminatorValueDuplicate\",\n\t\t\t\tkey: {\n\t\t\t\t\tkind: \"base\",\n\t\t\t\t\tvariant\n\t\t\t\t},\n\t\t\t\tbaseModel: base.modelName,\n\t\t\t\tvalue,\n\t\t\t\tfirstVariant\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tvariantsByValue.set(value, variant);\n\t}\n\treturn decision.values;\n}\n/**\n* Checks each base and variant, and decides each variant's discriminator value with the framework's discriminator rule. Returns each accepted variant's value as its base's discriminator field stores it.\n*/\nfunction decidePolymorphism(input) {\n\tconst { models, refusals } = input;\n\tconst modelsByName = new Map(models.map((model) => [model.modelName, model]));\n\tconst values = /* @__PURE__ */ new Map();\n\tfor (const model of models) {\n\t\tcheckVariantShape(model, modelsByName, refusals);\n\t\tfor (const [variant, value] of decideDiscriminator({\n\t\t\t...input,\n\t\t\tbase: model\n\t\t})) values.set(variant, value);\n\t}\n\treturn values;\n}\n//#endregion\n//#region src/build-contract.ts\n/** Whether a refusal is about listing an enum in a collection validator, which matters only when collections get validators. */\nfunction isAboutEnumListing(refusal) {\n\treturn refusal.kind === \"enumBsonType\" || refusal.kind === \"enumNotListable\" || refusal.kind === \"enumMemberNotListable\";\n}\n/**\n* Builds a MongoDB contract from its plain-data definition, with the stack's codecs and data types. Every MongoDB family rule is checked here, and each refusal comes back as data keyed by the part of the definition it is about, for the source to report in its own terms.\n*/\nfunction buildMongoContractFromDefinition(definition, codecLookup, dataTypes) {\n\tconst refusals = [];\n\tconst warnings = (definition.warnings ?? []).map((warning) => ({\n\t\tkind: \"source\",\n\t\twarning\n\t}));\n\tconst namespaceId = definition.target.defaultNamespaceId;\n\tconst lookups = {\n\t\tcodecLookup,\n\t\tdataTypeLookup: dataTypes.lookup\n\t};\n\tconst generatorFunctions = assembleGeneratorFunctions([definition.target, ...Object.values(definition.extensions ?? {})]);\n\tconst models = inheritVariantCollections(definition.models, refusals);\n\tconst builtEnums = buildEnums(definition, codecLookup, refusals);\n\tconst variantValues = decidePolymorphism({\n\t\tmodels,\n\t\tenums: builtEnums,\n\t\tcodecLookup,\n\t\tdataTypes,\n\t\trefusals\n\t});\n\tconst builtModels = buildModels({\n\t\tmodels,\n\t\tvariantValues,\n\t\tnamespaceId,\n\t\trefusals\n\t});\n\tconst builtValueObjects = buildValueObjects(definition.valueObjects, namespaceId, refusals);\n\tcheckFields({\n\t\tmodels,\n\t\tvalueObjects: definition.valueObjects,\n\t\tdeclaredEnums: new Set(Object.keys(definition.enums ?? {})),\n\t\tlookups,\n\t\trefusals,\n\t\twarnings\n\t});\n\tconst collections = buildCollections({\n\t\tmodels,\n\t\tvariantValues,\n\t\trefusals\n\t});\n\tcheckValueObjectExecutionDefaults(definition.valueObjects, refusals);\n\tconst executionDefaults = buildExecutionDefaults({\n\t\tmodels,\n\t\tgeneratorFunctions,\n\t\tnamespaceId,\n\t\trefusals\n\t});\n\tif (refusals.length > 0) return notOk({\n\t\trefusals,\n\t\twarnings\n\t});\n\tconst controlPolicies = {\n\t\tcollections: Object.fromEntries(Object.entries(collections).map(([name, collection]) => [name, collection.control])),\n\t\tdefaultControlPolicy: definition.defaultControlPolicy\n\t};\n\tconst validatorRefusals = mongoContractRefusalsOf({\n\t\tmodels: builtModels,\n\t\tvalueObjects: builtValueObjects,\n\t\tenums: builtEnums,\n\t\tlookups,\n\t\tcontrolPolicies\n\t}).filter((refusal) => definition.writesCollectionValidators || !isAboutEnumListing(refusal));\n\tif (validatorRefusals.length > 0) return notOk({\n\t\trefusals: validatorRefusals.map((refusal) => ({\n\t\t\tkind: \"validator\",\n\t\t\tkey: validatorRefusalKey(refusal),\n\t\t\trefusal\n\t\t})),\n\t\twarnings\n\t});\n\tconst storageValueSets = mongoValueSetsOf(builtEnums);\n\tconst validators = definition.writesCollectionValidators ? deriveCollectionValidators({\n\t\tmodels: builtModels,\n\t\tlookups,\n\t\tstorage: { namespaces: { [namespaceId]: {\n\t\t\tid: namespaceId,\n\t\t\tentries: { valueObject: builtValueObjects }\n\t\t} } },\n\t\tvalueSets: storageValueSets,\n\t\tcontrolPolicies\n\t}) : {};\n\tconst storage = buildMongoStorage({\n\t\tnamespaceId,\n\t\tcollections: Object.fromEntries(Object.entries(collections).map(([name, collection]) => [name, {\n\t\t\t...collection,\n\t\t\t...ifDefined(\"validator\", validators[name])\n\t\t}])),\n\t\tvalueSets: storageValueSets,\n\t\tvalueObjects: builtValueObjects\n\t});\n\tconst capabilities = {};\n\tconst execution = buildExecutionSection({\n\t\ttarget: definition.target.targetId,\n\t\ttargetFamily: definition.target.familyId,\n\t\tdefaults: executionDefaults\n\t});\n\treturn ok({\n\t\tcontract: {\n\t\t\ttarget: definition.target.targetId,\n\t\t\ttargetFamily: definition.target.familyId,\n\t\t\t...ifDefined(\"defaultControlPolicy\", definition.defaultControlPolicy),\n\t\t\troots: buildRoots(definition, models, namespaceId),\n\t\t\tdomain: { namespaces: { [namespaceId]: {\n\t\t\t\tmodels: builtModels,\n\t\t\t\t...Object.keys(builtEnums).length > 0 ? { enum: builtEnums } : {}\n\t\t\t} } },\n\t\t\tstorage,\n\t\t\tcapabilities,\n\t\t\textensions: definition.extensions ?? {},\n\t\t\tprofileHash: computeProfileHash({\n\t\t\t\ttarget: definition.target.targetId,\n\t\t\t\ttargetFamily: definition.target.familyId,\n\t\t\t\tcapabilities\n\t\t\t}),\n\t\t\tmeta: {},\n\t\t\t...ifDefined(\"execution\", execution)\n\t\t},\n\t\twarnings\n\t});\n}\n//#endregion\n//#region src/authoring-helper-runtime.ts\n/** The written value a TypeScript argument stands for: a number, string or boolean as PSL writes it. */\nfunction writtenValueOf(value) {\n\tif (typeof value === \"number\") return {\n\t\tkind: \"number\",\n\t\ttext: numeralText(value)\n\t};\n\tif (typeof value === \"string\") return {\n\t\tkind: \"string\",\n\t\ttext: value\n\t};\n\tif (typeof value === \"boolean\") return {\n\t\tkind: \"boolean\",\n\t\tvalue\n\t};\n}\n/** The arguments of a call as the constructor receives them: each `value` argument read as a value of its data type, through the same read as a PSL argument, so both give the same type parameters. */\nfunction readValueArguments(helperPath, descriptors, args, dataTypes) {\n\treturn args.map((value, index) => {\n\t\tconst descriptor = descriptors?.[index];\n\t\tif (descriptor?.kind !== \"value\" || value === void 0) return value;\n\t\tconst label = descriptor.name === void 0 ? `Argument #${index + 1} of ${helperPath}` : `Argument \"${descriptor.name}\" of ${helperPath}`;\n\t\tconst dataType = dataTypeId(descriptor.dataType);\n\t\tconst refuse = (message) => {\n\t\t\tthrow contractError(\"CONTRACT.ARGUMENT_INVALID\", `${label}: ${message}`, { meta: { dataType } });\n\t\t};\n\t\tconst written = writtenValueOf(value);\n\t\tif (written === void 0) return refuse(`Expected ${describeAdmittedForms(dataTypes, dataType)}`);\n\t\tconst read = readWrittenValueAs(dataTypes, dataType, written);\n\t\treturn read.ok ? read.value.value : refuse(read.failure.message);\n\t});\n}\nfunction fieldTypeOf(output) {\n\treturn {\n\t\tkind: \"scalar\",\n\t\tcodecId: output.codecId,\n\t\t...ifDefined(\"typeParams\", output.typeParams)\n\t};\n}\n/** The runtime `type` helpers of `namespace`: each type constructor, type choice and type alias as a function giving the MongoDB field type it stands for. A constructor marked `deprecated` is a PSL name only, and has no helper. */\nfunction createTypeHelpersFromNamespace(namespace, lookups, path = []) {\n\tconst helpers = {};\n\tfor (const [key, value] of Object.entries(namespace)) {\n\t\tassertSafeAuthoringHelperKey(key, path);\n\t\tconst helperPath = [...path, key].join(\".\");\n\t\tif (isAuthoringTypeConstructorDescriptor(value)) {\n\t\t\tif (value.deprecated !== void 0) continue;\n\t\t\thelpers[key] = (...written) => {\n\t\t\t\tvalidateAuthoringHelperArguments(helperPath, value.args, written);\n\t\t\t\tconst args = readValueArguments(helperPath, value.args, written, lookups.dataTypes);\n\t\t\t\tconst output = instantiateAuthoringTypeConstructor(value, args);\n\t\t\t\tvalidateAuthoringTypeParams(helperPath, value.output, output.typeParams, lookups.codecLookup.descriptorFor(output.codecId)?.paramsSchema);\n\t\t\t\treturn fieldTypeOf(output);\n\t\t\t};\n\t\t\tcontinue;\n\t\t}\n\t\tif (isAuthoringTypeChoiceDescriptor(value)) {\n\t\t\tconst constructorNamed = typeConstructorLookup(namespace);\n\t\t\thelpers[key] = (...written) => {\n\t\t\t\tconst args = typeChoiceArgumentsFromObject(helperPath, value, written);\n\t\t\t\tvalidateAuthoringHelperArguments(helperPath, value.args, args);\n\t\t\t\tconst chosen = resolveAuthoringTypeChoice({\n\t\t\t\t\thelperPath,\n\t\t\t\t\tdescriptor: value,\n\t\t\t\t\targs: readValueArguments(helperPath, value.args, args, lookups.dataTypes),\n\t\t\t\t\tconstructorNamed\n\t\t\t\t});\n\t\t\t\tconst output = instantiateAuthoringTypeConstructor(chosen.descriptor, chosen.args);\n\t\t\t\tvalidateAuthoringTypeChoiceParams(helperPath, value, chosen.descriptor, output.typeParams, lookups.codecLookup.descriptorFor(output.codecId)?.paramsSchema);\n\t\t\t\treturn fieldTypeOf(output);\n\t\t\t};\n\t\t\tcontinue;\n\t\t}\n\t\tif (isAuthoringTypeAliasDescriptor(value)) {\n\t\t\thelpers[key] = (...args) => {\n\t\t\t\tvalidateAuthoringHelperArguments(helperPath, [], args);\n\t\t\t\tconst { type, onCreate, onUpdate } = instantiateAuthoringTypeAlias(value);\n\t\t\t\tconst generatorCalls = {\n\t\t\t\t\t...ifDefined(\"onCreate\", onCreate),\n\t\t\t\t\t...ifDefined(\"onUpdate\", onUpdate)\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\t...fieldTypeOf(type),\n\t\t\t\t\t...Object.keys(generatorCalls).length === 0 ? {} : { generatorCalls }\n\t\t\t\t};\n\t\t\t};\n\t\t\tcontinue;\n\t\t}\n\t\thelpers[key] = createTypeHelpersFromNamespace(value, lookups, [...path, key]);\n\t}\n\treturn helpers;\n}\n//#endregion\n//#region src/contract-dsl.ts\nfunction resolveModelName(value) {\n\treturn typeof value === \"string\" ? value : value.__name;\n}\n//#endregion\n//#region src/contract-lowering.ts\nfunction validateTargetPackRef(family, target) {\n\tif (family.familyId !== \"mongo\") throw contractError(\"CONTRACT.PACK_FAMILY_MISMATCH\", `defineContract only accepts Mongo family packs. Received family \"${family.familyId}\".`, { meta: {\n\t\tpackId: family.id,\n\t\tpackFamilyId: family.familyId,\n\t\tcontractFamilyId: \"mongo\"\n\t} });\n\tif (target.familyId !== family.familyId) throw contractError(\"CONTRACT.PACK_FAMILY_MISMATCH\", `target pack \"${target.id}\" targets family \"${target.familyId}\" but contract family is \"${family.familyId}\".`, { meta: {\n\t\tpackId: target.id,\n\t\tpackFamilyId: target.familyId,\n\t\tcontractFamilyId: family.familyId\n\t} });\n}\nfunction validateExtensionPackRefs(target, extensions) {\n\tfor (const packRef of Object.values(extensions ?? {})) {\n\t\tif (packRef.kind !== \"extension\") throw contractError(\"CONTRACT.PACK_REF_INVALID\", `defineContract only accepts extension pack refs in extensions. Received kind \"${packRef.kind}\".`, { meta: {\n\t\t\tpackId: packRef.id,\n\t\t\tkind: packRef.kind\n\t\t} });\n\t\tif (packRef.familyId !== target.familyId) throw contractError(\"CONTRACT.PACK_FAMILY_MISMATCH\", `extension pack \"${packRef.id}\" targets family \"${packRef.familyId}\" but contract target family is \"${target.familyId}\".`, { meta: {\n\t\t\tpackId: packRef.id,\n\t\t\tpackFamilyId: packRef.familyId,\n\t\t\tcontractFamilyId: target.familyId\n\t\t} });\n\t\tif (packRef.targetId && packRef.targetId !== target.targetId) throw contractError(\"CONTRACT.PACK_TARGET_MISMATCH\", `extension pack \"${packRef.id}\" targets \"${packRef.targetId}\" but contract target is \"${target.targetId}\".`, { meta: {\n\t\t\tpackId: packRef.id,\n\t\t\tpackTargetId: packRef.targetId,\n\t\t\tcontractTargetId: target.targetId\n\t\t} });\n\t}\n}\nfunction fieldNodes(fields) {\n\treturn Object.entries(fields).map(([fieldName, builder]) => ({\n\t\tfieldName,\n\t\t...ifDefined(\"storedName\", builder.__storedName),\n\t\ttype: builder.__type,\n\t\tnullable: builder.__nullable,\n\t\tmany: builder.__many,\n\t\t...ifDefined(\"enumName\", builder.__enumHandle?.enumName),\n\t\t...ifDefined(\"executionDefaults\", builder.__executionDefaults),\n\t\t...ifDefined(\"generatorCalls\", builder.__generatorCalls)\n\t}));\n}\nfunction relationNodes(builder) {\n\treturn Object.entries(builder.__relations).map(([relationName, relation]) => {\n\t\tconst common = {\n\t\t\trelationName,\n\t\t\ttoModel: relation.__to,\n\t\t\tnullable: relation.__nullable\n\t\t};\n\t\treturn relation.__on === void 0 ? {\n\t\t\t...common,\n\t\t\tcardinality: relation.__cardinality\n\t\t} : {\n\t\t\t...common,\n\t\t\tcardinality: relation.__cardinality,\n\t\t\ton: relation.__on\n\t\t};\n\t});\n}\nfunction modelNode(builder, buildersByName) {\n\tconst base = builder.__base;\n\tconst variantValue = base === void 0 ? void 0 : buildersByName.get(base)?.__variants?.[builder.__name]?.value;\n\treturn {\n\t\tmodelName: builder.__name,\n\t\t...ifDefined(\"collection\", builder.__collection),\n\t\t...ifDefined(\"owner\", builder.__owner),\n\t\t...ifDefined(\"storageRelations\", builder.__storageRelations),\n\t\t...ifDefined(\"controlPolicy\", builder.__controlPolicy),\n\t\t...ifDefined(\"collectionOptions\", builder.__collectionOptions),\n\t\t...ifDefined(\"indexes\", builder.__indexes),\n\t\tfields: fieldNodes(builder.__fields),\n\t\trelations: relationNodes(builder),\n\t\t...builder.__discriminator === void 0 ? {} : { discriminator: {\n\t\t\tfield: builder.__discriminator.field,\n\t\t\tlistedVariants: Object.keys(builder.__variants ?? {})\n\t\t} },\n\t\t...base === void 0 ? {} : { base: {\n\t\t\tmodel: base,\n\t\t\tvalue: variantValue === void 0 ? void 0 : {\n\t\t\t\tkind: \"string\",\n\t\t\t\ttext: variantValue\n\t\t\t}\n\t\t} }\n\t};\n}\nfunction valueObjectNode(builder) {\n\treturn {\n\t\tname: builder.__name,\n\t\tfields: fieldNodes(builder.__fields)\n\t};\n}\n/** Turns `defineContract`'s builder objects into the plain-data definition the contract is built from. */\nfunction buildContractDefinition(input) {\n\tconst { target } = input;\n\tvalidateTargetPackRef(input.family, target);\n\tvalidateExtensionPackRefs(target, input.extensions);\n\tconst builders = Object.values(input.models ?? {});\n\tconst buildersByName = /* @__PURE__ */ new Map();\n\tfor (const builder of builders) if (!buildersByName.has(builder.__name)) buildersByName.set(builder.__name, builder);\n\treturn {\n\t\ttarget,\n\t\t...ifDefined(\"extensions\", input.extensions),\n\t\t...ifDefined(\"defaultControlPolicy\", input.defaultControlPolicy),\n\t\tmodels: builders.map((builder) => modelNode(builder, buildersByName)),\n\t\tvalueObjects: Object.values(input.valueObjects ?? {}).map(valueObjectNode),\n\t\t...ifDefined(\"enums\", input.enums),\n\t\t...ifDefined(\"roots\", input.roots === void 0 ? void 0 : Object.fromEntries(Object.entries(input.roots).map(([rootName, model]) => [rootName, resolveModelName(model)]))),\n\t\twritesCollectionValidators: true,\n\t\twarnings: void 0\n\t};\n}\n//#endregion\n//#region src/merge-redundant-indexes.ts\nfunction positionKey({ model, position }) {\n\treturn JSON.stringify([model, position]);\n}\n/**\n* Removes each identical or redundant index in a collection, for the Prisma 8 authoring sources to call after `nameIndexes` and before the builder. Two indexes match when they have the same name and their storage indexes, variant scope applied, have the same `indexLookupKey` with `unique` left out. Indexes with different names are both kept: the user named them apart, and the builder refuses two identical ones. Of a matching pair the first is kept, unless only the later one is unique; then the later one is kept and the earlier removed. Indexes the builder refuses are left for it to refuse. A source that reports the builder's refusals by index position maps them back through `removedIndexes`.\n*/\nfunction mergeRedundantIndexes(definition, codecLookup, dataTypes) {\n\tconst refusalsLeftToTheBuilder = [];\n\tconst models = inheritVariantCollections(definition.models, refusalsLeftToTheBuilder);\n\tconst variantValues = decidePolymorphism({\n\t\tmodels,\n\t\tenums: buildEnums(definition, codecLookup, refusalsLeftToTheBuilder),\n\t\tcodecLookup,\n\t\tdataTypes,\n\t\trefusals: refusalsLeftToTheBuilder\n\t});\n\tconst modelsByName = new Map(models.map((model) => [model.modelName, model]));\n\tconst heldByCollection = /* @__PURE__ */ new Map();\n\tconst removedIndexes = [];\n\tfor (const model of models) {\n\t\tconst { collection } = model;\n\t\tif (!collection) continue;\n\t\tconst held = heldByCollection.get(collection) ?? [];\n\t\theldByCollection.set(collection, held);\n\t\tcheckModelIndexes(model, modelsByName, variantValues).forEach((checked, position) => {\n\t\t\tif (checked.kind === \"refused\") return;\n\t\t\tconst index = {\n\t\t\t\tmodel: model.modelName,\n\t\t\t\tposition,\n\t\t\t\tlookupKey: indexLookupKey({\n\t\t\t\t\t...checked.index,\n\t\t\t\t\tunique: void 0\n\t\t\t\t}),\n\t\t\t\tname: checked.index.name,\n\t\t\t\tunique: checked.index.unique === true\n\t\t\t};\n\t\t\tconst matchingAt = held.findIndex((candidate) => candidate.lookupKey === index.lookupKey && candidate.name === index.name);\n\t\t\tconst match = held[matchingAt];\n\t\t\tif (match !== void 0) {\n\t\t\t\tif (match.unique || !index.unique) {\n\t\t\t\t\tremovedIndexes.push({\n\t\t\t\t\t\tmodel: index.model,\n\t\t\t\t\t\tposition: index.position\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tremovedIndexes.push({\n\t\t\t\t\tmodel: match.model,\n\t\t\t\t\tposition: match.position\n\t\t\t\t});\n\t\t\t\theld.splice(matchingAt, 1);\n\t\t\t}\n\t\t\theld.push(index);\n\t\t});\n\t}\n\tif (removedIndexes.length === 0) return {\n\t\tdefinition,\n\t\tremovedIndexes\n\t};\n\tconst removed = new Set(removedIndexes.map(positionKey));\n\tconst withoutRemoved = (model) => model.indexes === void 0 ? model : {\n\t\t...model,\n\t\tindexes: model.indexes.filter((_, position) => !removed.has(positionKey({\n\t\t\tmodel: model.modelName,\n\t\t\tposition\n\t\t})))\n\t};\n\treturn {\n\t\tdefinition: {\n\t\t\t...definition,\n\t\t\tmodels: definition.models.map(withoutRemoved)\n\t\t},\n\t\tremovedIndexes\n\t};\n}\n/** The position a model wrote an index at, from its position in the model's indexes after the merge. */\nfunction writtenIndexPosition(removedIndexes, model, mergedPosition) {\n\tconst removed = removedIndexes.filter((index) => index.model === model).map((index) => index.position).sort((a, b) => a - b);\n\tlet position = mergedPosition;\n\tfor (const removedPosition of removed) if (removedPosition <= position) position++;\n\treturn position;\n}\n/** The refusal with its index positions counted as the source wrote them, before the merge. */\nfunction refusalAtWrittenPositions(refusal, removedIndexes) {\n\tif (refusal.key.kind !== \"index\" || removedIndexes.length === 0) return refusal;\n\tconst key = {\n\t\t...refusal.key,\n\t\tposition: writtenIndexPosition(removedIndexes, refusal.key.model, refusal.key.position)\n\t};\n\tswitch (refusal.kind) {\n\t\tcase \"indexDuplicate\":\n\t\tcase \"indexNameDuplicate\": return {\n\t\t\t...refusal,\n\t\t\tkey,\n\t\t\tfirstPosition: writtenIndexPosition(removedIndexes, refusal.firstModel, refusal.firstPosition)\n\t\t};\n\t\tdefault: return blindCast({\n\t\t\t...refusal,\n\t\t\tkey\n\t\t});\n\t}\n}\n//#endregion\n//#region src/name-indexes.ts\nfunction namedIndex(index, model) {\n\tif (index.options?.name !== void 0) return index;\n\treturn {\n\t\t...index,\n\t\toptions: {\n\t\t\t...index.options,\n\t\t\tname: defaultIndexNameOf(index, model.fields)\n\t\t}\n\t};\n}\n/**\n* Names each index the definition writes without a name as MongoDB names an index created without one: its stored keys and directions, such as `email_1`. The Prisma 8 authoring sources call it before `mergeRedundantIndexes` and the builder. Two indexes of one collection that get one name are left for the builder to refuse.\n*/\nfunction nameIndexes(definition) {\n\treturn {\n\t\t...definition,\n\t\tmodels: definition.models.map((model) => model.indexes === void 0 ? model : {\n\t\t\t...model,\n\t\t\tindexes: model.indexes.map((index) => namedIndex(index, model))\n\t\t})\n\t};\n}\n//#endregion\n//#region src/refusal-errors.ts\nconst LIST_THE_CODEC_PACK = \"List the pack that provides the codec in `extensions` in defineContract.\";\nfunction codecRefusalError(subject, meta, codecId, refusal) {\n\tif (refusal.kind === \"unknownCodec\") return contractError(\"CONTRACT.CODEC_DESCRIPTOR_MISSING\", `${subject} ${refusal.reason}`, {\n\t\tfix: LIST_THE_CODEC_PACK,\n\t\tmeta: {\n\t\t\t...meta,\n\t\t\tcodecId\n\t\t}\n\t});\n\treturn contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `${subject} ${refusal.reason}`, {\n\t\tfix: \"Use a codec whose data type is a MongoDB data type, declared with mongoDataType.\",\n\t\tmeta: {\n\t\t\t...meta,\n\t\t\tcodecId,\n\t\t\tdataType: refusal.dataType,\n\t\t\treason: \"data-type-not-mongo\"\n\t\t}\n\t});\n}\nfunction validatorRefusalError(refusal) {\n\tswitch (refusal.kind) {\n\t\tcase \"embeddedModelHasVariants\": return contractError(\"CONTRACT.RELATION_INVALID\", `Relation \"${refusal.modelName}.${refusal.relationName}\" ${refusal.reason}`, { meta: {\n\t\t\tmodelName: refusal.modelName,\n\t\t\trelationName: refusal.relationName,\n\t\t\treason: \"embedded-model-has-variants\"\n\t\t} });\n\t\tcase \"enumBsonType\": return codecRefusalError(`enumType(\"${refusal.enumName}\")`, { enumName: refusal.enumName }, refusal.codecId, refusal.refusal);\n\t\tcase \"enumNotListable\": return contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${refusal.enumName}\") codec \"${refusal.codecId}\" ${refusal.reason}`, { meta: {\n\t\t\tenumName: refusal.enumName,\n\t\t\tcodecId: refusal.codecId,\n\t\t\treason: \"not-listable-by-validator\"\n\t\t} });\n\t\tcase \"enumMemberNotListable\": return contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${refusal.enumName}\") member \"${refusal.member}\" ${refusal.reason}`, { meta: {\n\t\t\tenumName: refusal.enumName,\n\t\t\tmember: refusal.member,\n\t\t\tcodecId: refusal.codecId,\n\t\t\treason: \"member-not-listable-by-validator\"\n\t\t} });\n\t\tcase \"fieldBsonType\": {\n\t\t\tconst { owner } = refusal;\n\t\t\tconst label = owner.kind === \"model\" ? \"Model\" : \"Value object\";\n\t\t\tconst ownerMeta = owner.kind === \"model\" ? { modelName: owner.name } : { valueObjectName: owner.name };\n\t\t\treturn codecRefusalError(`${label} \"${owner.name}\" field \"${refusal.fieldName}\"`, {\n\t\t\t\t...ownerMeta,\n\t\t\t\tfieldName: refusal.fieldName\n\t\t\t}, refusal.codecId, refusal.refusal);\n\t\t}\n\t\tcase \"documentId\": return contractError(\"CONTRACT.COLLECTION_INVALID\", `Model \"${refusal.modelName}\" field \"${refusal.fieldName}\" ${refusal.reason}`, { meta: {\n\t\t\tmodelName: refusal.modelName,\n\t\t\tfieldName: refusal.fieldName,\n\t\t\tcollection: refusal.collection,\n\t\t\tcodecId: refusal.codecId,\n\t\t\tbsonTypes: refusal.forbidden,\n\t\t\treason: \"document-id-bson-type\"\n\t\t} });\n\t}\n}\nfunction defaultError(key, reason, message) {\n\treturn contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${`${key.owner.name}.${key.field}`}\" ${message}`, { meta: {\n\t\tmodelName: key.owner.name,\n\t\tfieldName: key.field,\n\t\treason\n\t} });\n}\nfunction ownerMetaOf(key) {\n\treturn key.owner.kind === \"model\" ? {\n\t\tmodelName: key.owner.name,\n\t\tfieldName: key.field\n\t} : {\n\t\tvalueObjectName: key.owner.name,\n\t\tfieldName: key.field\n\t};\n}\nfunction ownerLabelOf(key) {\n\treturn `${key.owner.kind === \"model\" ? \"Model\" : \"Value object\"} \"${key.owner.name}\" field \"${key.field}\"`;\n}\nconst INDEX_SHAPE_MESSAGES = {\n\t\"unique-wildcard\": \"is unique and has a wildcard key; a unique index cannot use a wildcard.\",\n\t\"wildcard-with-type\": \"combines a wildcard key with a hashed, 2d or 2dsphere key, which MongoDB does not allow.\",\n\t\"hashed-several-fields\": \"is hashed on several fields; a hashed index has exactly one field.\",\n\t\"ttl-with-wildcard\": \"sets expireAfterSeconds on a wildcard index, which MongoDB does not allow.\",\n\t\"projection-without-wildcard\": \"sets wildcardProjection but has no wildcard key; a wildcard projection needs a wildcard index.\",\n\t\"collation-without-locale\": \"sets a collation without a locale; a collation needs a locale.\",\n\t\"second-text-index\": \"is a second text index in its collection; MongoDB allows one text index per collection.\"\n};\nfunction discriminatorFieldError(refusal) {\n\tconst field = `Discriminator field \"${refusal.key.model}.${refusal.fieldName}\"`;\n\tconst meta = {\n\t\tmodelName: refusal.key.model,\n\t\tfieldName: refusal.fieldName\n\t};\n\tswitch (refusal.refusal.kind) {\n\t\tcase \"optional\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `${field} must be required, but it is optional. Remove .optional().`, { meta: {\n\t\t\t...meta,\n\t\t\treason: \"discriminator-optional\"\n\t\t} });\n\t\tcase \"list\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `${field} must hold one value, but it is a list. Remove .many().`, { meta: {\n\t\t\t...meta,\n\t\t\treason: \"discriminator-list\"\n\t\t} });\n\t\tcase \"not-text\": {\n\t\t\tconst { dataType } = refusal.refusal;\n\t\t\treturn contractError(\"CONTRACT.ARGUMENT_INVALID\", `${field} must be text, such as field.scalar(type.String()), but its data type is ${dataType === void 0 ? \"not a scalar\" : `\"${dataType}\"`}.`, { meta: {\n\t\t\t\t...meta,\n\t\t\t\tdataType,\n\t\t\t\treason: \"discriminator-not-text\"\n\t\t\t} });\n\t\t}\n\t}\n}\n/** The error `defineContract` throws for a refusal of the builder. */\nfunction refusalError(refusal) {\n\tswitch (refusal.kind) {\n\t\tcase \"duplicateModel\": return contractError(\"CONTRACT.NAME_DUPLICATE\", `Duplicate model name \"${refusal.key.model}\" in defineContract().`, { meta: {\n\t\t\tkind: \"model\",\n\t\t\tname: refusal.key.model\n\t\t} });\n\t\tcase \"duplicateValueObject\": return contractError(\"CONTRACT.NAME_DUPLICATE\", `Duplicate value object name \"${refusal.key.valueObject}\" in defineContract().`, { meta: {\n\t\t\tkind: \"valueObject\",\n\t\t\tname: refusal.key.valueObject\n\t\t} });\n\t\tcase \"storedNameUnsupported\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Model \"${refusal.key.owner.name}\" field \"${refusal.key.field}\" ${refusal.reason}. Give it another stored name.`, { meta: {\n\t\t\tmodelName: refusal.key.owner.name,\n\t\t\tfieldName: refusal.key.field,\n\t\t\treason: \"stored-name-unsupported\"\n\t\t} });\n\t\tcase \"storedNameDuplicate\": return contractError(\"CONTRACT.NAME_DUPLICATE\", `Model \"${refusal.key.owner.name}\" stores both \"${refusal.firstField}\" and \"${refusal.key.field}\" as \"${refusal.storedName}\".`, { meta: {\n\t\t\tkind: \"field\",\n\t\t\tname: refusal.storedName,\n\t\t\tfirst: refusal.firstField,\n\t\t\tsecond: refusal.key.field\n\t\t} });\n\t\tcase \"restatedBaseFieldDiffers\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Variant model \"${refusal.key.owner.name}\" restates field \"${refusal.key.field}\" of its base \"${refusal.baseModel}\" with a different ${refusal.differences.map(differenceWording).join(\" and \")}. A variant's documents are checked against the base's field, so restate it exactly or remove it from the variant.`, { meta: {\n\t\t\tmodelName: refusal.key.owner.name,\n\t\t\tfieldName: refusal.key.field,\n\t\t\tbaseModel: refusal.baseModel,\n\t\t\tdifferences: refusal.differences,\n\t\t\treason: \"restated-base-field-differs\"\n\t\t} });\n\t\tcase \"storedNameSharedWithBase\": return contractError(\"CONTRACT.NAME_DUPLICATE\", `Variant model \"${refusal.key.owner.name}\" field \"${refusal.key.field}\" is stored as \"${refusal.storedName}\", which its base \"${refusal.baseModel}\" stores field \"${refusal.baseField}\" under. A variant's documents hold its base's fields too, so give the field another stored name.`, { meta: {\n\t\t\tkind: \"field\",\n\t\t\tname: refusal.storedName,\n\t\t\tfirst: `${refusal.baseModel}.${refusal.baseField}`,\n\t\t\tsecond: `${refusal.key.owner.name}.${refusal.key.field}`,\n\t\t\treason: \"stored-name-shared-with-base\"\n\t\t} });\n\t\tcase \"valueObjectFieldStoredName\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Value object \"${refusal.key.owner.name}\" field \"${refusal.key.field}\" sets .mongo({ field }), but a field of a value object is stored under its own name.`, { meta: {\n\t\t\tvalueObjectName: refusal.key.owner.name,\n\t\t\tfieldName: refusal.key.field,\n\t\t\treason: \"value-object-field-stored-name\"\n\t\t} });\n\t\tcase \"relationLocalFieldUnknown\": {\n\t\t\tconst { model, relation } = refusal.key;\n\t\t\treturn contractError(\"CONTRACT.RELATION_INVALID\", `Relation \"${model}.${relation}\" joins on local field \"${refusal.fieldName}\", which model \"${model}\" does not declare`, { meta: {\n\t\t\t\tmodelName: model,\n\t\t\t\trelationName: relation,\n\t\t\t\tfieldName: refusal.fieldName,\n\t\t\t\treason: \"local-field-unknown\"\n\t\t\t} });\n\t\t}\n\t\tcase \"relationNullability\": {\n\t\t\tconst { model, relation } = refusal.key;\n\t\t\tconst location = `Relation \"${model}.${relation}\"`;\n\t\t\treturn contractError(\"CONTRACT.RELATION_INVALID\", !refusal.ownsForeignKey ? `${location} is required but does not own the foreign key, so nothing in storage guarantees the related document exists` : refusal.contradiction === \"declared-optional\" ? `${location} is optional but every local field it joins on is required` : `${location} is required but a local field it joins on is nullable`, { meta: {\n\t\t\t\tmodelName: model,\n\t\t\t\trelationName: relation,\n\t\t\t\treason: \"to-one-nullability-mismatch\"\n\t\t\t} });\n\t\t}\n\t\tcase \"collectionSettingWithoutCollection\": {\n\t\t\tconst modelName = refusal.key.model;\n\t\t\tconst what = refusal.setting === \"controlPolicy\" ? \"it\" : \"them\";\n\t\t\treturn contractError(\"CONTRACT.COLLECTION_INVALID\", `Model \"${modelName}\" defines ${refusal.setting} but has no collection to attach ${what} to.`, { meta: {\n\t\t\t\tmodelName,\n\t\t\t\treason: `${refusal.setting}-without-collection`\n\t\t\t} });\n\t\t}\n\t\tcase \"collectionSettingTwice\": return contractError(\"CONTRACT.COLLECTION_INVALID\", `Collection \"${refusal.collection}\" has ${refusal.setting} declared by multiple models. Author ${refusal.setting} on a single model per collection.`, { meta: {\n\t\t\tmodelName: refusal.key.model,\n\t\t\tcollection: refusal.collection,\n\t\t\treason: `${refusal.setting}-declared-by-multiple-models`\n\t\t} });\n\t\tcase \"variantCollectionDiffers\": return contractError(\"CONTRACT.COLLECTION_INVALID\", `Variant model \"${refusal.key.model}\" is stored in collection \"${refusal.collection}\", but its base \"${refusal.baseModel}\" is stored in \"${refusal.baseCollection}\". A variant is stored in its base's collection; leave its collection out.`, { meta: {\n\t\t\tmodelName: refusal.key.model,\n\t\t\tcollection: refusal.collection,\n\t\t\tbaseModel: refusal.baseModel,\n\t\t\tbaseCollection: refusal.baseCollection,\n\t\t\treason: \"variant-collection-differs\"\n\t\t} });\n\t\tcase \"indexFieldUnknown\": return contractError(\"CONTRACT.FIELD_UNKNOWN\", `Model \"${refusal.key.model}\" index ${refusal.signature} references unknown field \"${refusal.fieldName}\".`, { meta: {\n\t\t\tmodelName: refusal.key.model,\n\t\t\tfieldName: refusal.fieldName,\n\t\t\tindexSignature: refusal.signature\n\t\t} });\n\t\tcase \"indexShape\": return contractError(\"CONTRACT.INDEX_INVALID\", `Model \"${refusal.key.model}\" index ${refusal.signature} ${INDEX_SHAPE_MESSAGES[refusal.rule]}`, { meta: {\n\t\t\tmodelName: refusal.key.model,\n\t\t\tindexSignature: refusal.signature,\n\t\t\treason: refusal.rule\n\t\t} });\n\t\tcase \"indexScopeConflict\": return contractError(\"CONTRACT.INDEX_INVALID\", `Variant model \"${refusal.key.model}\" index ${refusal.signature} conflicts with discriminator scope: ${refusal.reason}`, { meta: {\n\t\t\tvariantName: refusal.key.model,\n\t\t\tindexLabel: refusal.signature,\n\t\t\treason: refusal.reason\n\t\t} });\n\t\tcase \"indexDuplicate\": return contractError(\"CONTRACT.NAME_DUPLICATE\", `Collection \"${refusal.collection}\" defines duplicate index ${refusal.signature}. First declared on model \"${refusal.firstModel}\" and duplicated on model \"${refusal.key.model}\".`, { meta: {\n\t\t\tkind: \"index\",\n\t\t\tname: refusal.signature,\n\t\t\tcollection: refusal.collection,\n\t\t\tfirst: refusal.firstModel,\n\t\t\tsecond: refusal.key.model\n\t\t} });\n\t\tcase \"indexNameDuplicate\": return contractError(\"CONTRACT.NAME_DUPLICATE\", `Collection \"${refusal.collection}\" has two indexes named \"${refusal.name}\": index ${refusal.firstPosition} of model \"${refusal.firstModel}\" and index ${refusal.key.position} of model \"${refusal.key.model}\". An index without a name is named after its keys and directions. Give one of them another name with the index option name.`, { meta: {\n\t\t\tkind: \"index\",\n\t\t\tname: refusal.name,\n\t\t\tcollection: refusal.collection,\n\t\t\tfirst: refusal.firstModel,\n\t\t\tsecond: refusal.key.model,\n\t\t\treason: \"index-name-duplicate\"\n\t\t} });\n\t\tcase \"generatedOnValueObject\": return defaultError(refusal.key, \"executionDefaults-on-value-object\", \"has executionDefaults, but it belongs to a value object. Generated values are only supported on model fields.\");\n\t\tcase \"generatorUnknown\": {\n\t\t\tconst { owner, field } = refusal.key;\n\t\t\treturn contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${owner.name}.${field}\": no pack in the contract declares the generator function \"${refusal.functionName}\".`, { meta: {\n\t\t\t\tmodelName: owner.name,\n\t\t\t\tfieldName: field,\n\t\t\t\tcodecId: refusal.codecId,\n\t\t\t\tfunction: refusal.functionName,\n\t\t\t\treason: \"generator-unknown\"\n\t\t\t} });\n\t\t}\n\t\tcase \"generatorNotApplicable\": {\n\t\t\tconst { owner, field } = refusal.key;\n\t\t\tconst subject = `Field \"${owner.name}.${field}\"`;\n\t\t\treturn contractError(\"CONTRACT.DEFAULT_INVALID\", refusal.message !== void 0 ? `${subject}: ${refusal.message}` : `${subject}: ${refusal.functionName}() does not apply to ${refusal.codecId === void 0 ? \"the field's type\" : `codec \"${refusal.codecId}\"`}.`, { meta: {\n\t\t\t\tmodelName: owner.name,\n\t\t\t\tfieldName: field,\n\t\t\t\tcodecId: refusal.codecId,\n\t\t\t\tfunction: refusal.functionName,\n\t\t\t\treason: \"generator-not-applicable\"\n\t\t\t} });\n\t\t}\n\t\tcase \"generatorPhaseSetTwice\": return contractError(\"CONTRACT.DEFAULT_INVALID\", `.${refusal.phase}() is called on a field that already generates a value ${refusal.phase === \"onCreate\" ? \"on create\" : \"on update\"}. Set each phase once, and do not combine .${refusal.phase}() with a type alias or alias constant that sets it.`, { meta: {\n\t\t\tmodelName: refusal.key.owner.name,\n\t\t\tfieldName: refusal.key.field,\n\t\t\treason: \"generator-phase-set-twice\",\n\t\t\tphase: refusal.phase\n\t\t} });\n\t\tcase \"generatedList\": return defaultError(refusal.key, \"many-with-executionDefaults\", \"generates a value on write, so it cannot be a list; remove .many().\");\n\t\tcase \"generatedOnVariant\": return defaultError(refusal.key, \"executionDefaults-on-variant\", `has executionDefaults, but \"${refusal.key.owner.name}\" is a variant of \"${refusal.baseModel}\". Execution defaults apply to every document in collection \"${refusal.collection}\", so declare them on the base model.`);\n\t\tcase \"generatedWithoutCollection\": return defaultError(refusal.key, \"executionDefaults-without-collection\", \"has executionDefaults, but its model has no collection. Generated values are only supported on fields of a model stored in a collection.\");\n\t\tcase \"generatedConflict\": return defaultError(refusal.key, \"executionDefaults-conflict\", `has different executionDefaults than \"${refusal.otherModel}.${refusal.otherField}\", which is stored in the same collection \"${refusal.collection}\". Use the same executionDefaults on both models.`);\n\t\tcase \"typeParamsInvalid\": return structuredError(\"CONTRACT.TYPE_PARAMS_INVALID\", refusal.problem.message, { meta: {\n\t\t\tdataType: refusal.problem.dataType,\n\t\t\tparameters: refusal.problem.parameters,\n\t\t\t...ownerMetaOf(refusal.key)\n\t\t} });\n\t\tcase \"enumKeyMismatch\": return contractError(\"CONTRACT.ENUM_INVALID\", `enum declaration key \"${refusal.key.enumName}\" must match enumType name \"${refusal.enumName}\". Aliases are not supported.`, { meta: {\n\t\t\tenumName: refusal.enumName,\n\t\t\tdeclaredKey: refusal.key.enumName,\n\t\t\treason: \"declaration-key-mismatch\"\n\t\t} });\n\t\tcase \"enumMemberProblem\": return enumMemberError({\n\t\t\tenumName: refusal.enumName,\n\t\t\tcodecId: refusal.codecId\n\t\t}, refusal.problem, \"the field\");\n\t\tcase \"enumUnknown\": return contractError(\"CONTRACT.ENUM_UNKNOWN\", `${ownerLabelOf(refusal.key)} references enum \"${refusal.enumName}\" which is not declared in defineContract({ enums: { ... } }).`, { meta: {\n\t\t\t...ownerMetaOf(refusal.key),\n\t\t\tenumName: refusal.enumName\n\t\t} });\n\t\tcase \"discriminatorValueDuplicate\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Discriminator value \"${refusal.value}\" is used by both \"${refusal.firstVariant}\" and \"${refusal.key.variant}\" on base model \"${refusal.baseModel}\".`, { meta: {\n\t\t\tmodelName: refusal.baseModel,\n\t\t\tvalue: refusal.value,\n\t\t\tvariants: [refusal.firstVariant, refusal.key.variant],\n\t\t\treason: \"duplicate-discriminator-value\"\n\t\t} });\n\t\tcase \"discriminatorFieldUnknown\": return contractError(\"CONTRACT.FIELD_UNKNOWN\", `Model \"${refusal.key.model}\" names \"${refusal.fieldName}\" as its discriminator, but declares no field \"${refusal.fieldName}\".`, { meta: {\n\t\t\tmodelName: refusal.key.model,\n\t\t\tfieldName: refusal.fieldName,\n\t\t\treason: \"discriminator-field-unknown\"\n\t\t} });\n\t\tcase \"discriminatorField\": return discriminatorFieldError(refusal);\n\t\tcase \"discriminatorValue\": {\n\t\t\tconst variant = refusal.key.variant;\n\t\t\tconst meta = {\n\t\t\t\tmodelName: variant,\n\t\t\t\tbaseModel: refusal.baseModel,\n\t\t\t\tfieldName: refusal.fieldName\n\t\t\t};\n\t\t\tif (refusal.refusal.kind === \"unreadable\") return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Variant model \"${variant}\" has a discriminator value that discriminator field \"${refusal.baseModel}.${refusal.fieldName}\" cannot hold: ${refusal.refusal.refusal.message}`, { meta: {\n\t\t\t\t...meta,\n\t\t\t\treason: \"discriminator-value-unreadable\"\n\t\t\t} });\n\t\t\treturn contractError(\"CONTRACT.ARGUMENT_INVALID\", `Variant model \"${variant}\" has discriminator value ${JSON.stringify(refusal.refusal.stored)}, which is not a member of enum \"${refusal.enumName}\", the type of discriminator field \"${refusal.baseModel}.${refusal.fieldName}\". Use one of: ${refusal.refusal.members.map((member) => JSON.stringify(member)).join(\", \")}.`, { meta: {\n\t\t\t\t...meta,\n\t\t\t\treason: \"discriminator-value-not-a-member\"\n\t\t\t} });\n\t\t}\n\t\tcase \"discriminatorAndBase\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Model \"${refusal.key.model}\" has both a discriminator and a base. A model is either a base with variants or a variant of one base.`, { meta: {\n\t\t\tmodelName: refusal.key.model,\n\t\t\treason: \"discriminator-and-base\"\n\t\t} });\n\t\tcase \"discriminatorWithoutVariants\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Model \"${refusal.key.model}\" has a discriminator, but no model names it as its base.`, { meta: {\n\t\t\tmodelName: refusal.key.model,\n\t\t\treason: \"discriminator-without-variants\"\n\t\t} });\n\t\tcase \"listedVariantMissing\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Model \"${refusal.key.model}\" lists variant \"${refusal.variant}\", but no model \"${refusal.variant}\" names \"${refusal.key.model}\" as its base.`, { meta: {\n\t\t\tmodelName: refusal.key.model,\n\t\t\tvariant: refusal.variant,\n\t\t\treason: \"listed-variant-missing\"\n\t\t} });\n\t\tcase \"baseWithoutDiscriminator\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Model \"${refusal.key.variant}\" names \"${refusal.baseModel}\" as its base, but \"${refusal.baseModel}\" has no discriminator.`, { meta: {\n\t\t\tmodelName: refusal.key.variant,\n\t\t\tbaseModel: refusal.baseModel,\n\t\t\treason: \"base-without-discriminator\"\n\t\t} });\n\t\tcase \"baseUnknown\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Model \"${refusal.key.variant}\" names \"${refusal.baseModel}\" as its base, but the contract has no model \"${refusal.baseModel}\".`, { meta: {\n\t\t\tmodelName: refusal.key.variant,\n\t\t\tbaseModel: refusal.baseModel,\n\t\t\treason: \"base-unknown\"\n\t\t} });\n\t\tcase \"variantWithoutValue\": return contractError(\"CONTRACT.ARGUMENT_INVALID\", `Model \"${refusal.key.variant}\" names \"${refusal.baseModel}\" as its base, but \"${refusal.baseModel}\" lists no discriminator value for it.`, { meta: {\n\t\t\tmodelName: refusal.key.variant,\n\t\t\tbaseModel: refusal.baseModel,\n\t\t\treason: \"variant-without-value\"\n\t\t} });\n\t\tcase \"validator\": return validatorRefusalError(refusal.refusal);\n\t}\n}\n/** A builder warning as `defineContract` reports it. */\nfunction authoringWarningOf(warning) {\n\treturn warning.warning;\n}\nfunction differenceWording(difference) {\n\tswitch (difference) {\n\t\tcase \"storedName\": return \"stored name\";\n\t\tcase \"type\": return \"type\";\n\t\tcase \"nullable\": return \"nullability\";\n\t\tcase \"many\": return \"list shape\";\n\t}\n}\n//#endregion\n//#region src/removed-field-presets.ts\nconst GUIDE = \"The upgrade guide \\\"Field presets are removed\\\" lists every rewrite.\";\nconst TEMPORAL_REWRITES = {\n\tcreatedAt: \"field.scalar(type.temporal.CreatedAt())\",\n\tupdatedAt: \"field.scalar(type.temporal.UpdatedAt())\",\n\ttimestamp: \"field.scalar(type.Date()), with .onCreate(gen.now()) and .onUpdate(gen.now()) for the phases the preset set\"\n};\n/** Each removed scalar field helper and the type constructor its field is now written with. */\nconst REMOVED_SCALAR_HELPERS = {\n\tobjectId: \"ObjectId\",\n\tstring: \"String\",\n\tdouble: \"Double\",\n\tint32: \"Int32\",\n\tbool: \"Bool\",\n\tdate: \"Date\",\n\tint64: \"Int64\",\n\tint64Number: \"Int64Number\",\n\tdecimal128: \"Decimal128\",\n\tbinary: \"Binary\",\n\tjson: \"Json\",\n\tbson: \"Bson\",\n\tvector: \"Vector\"\n};\nfunction refusePreset(preset) {\n\tconst helper = `field.temporal.${preset}`;\n\tthrow contractError(\"CONTRACT.FIELD_HELPER_UNKNOWN\", `${helper} was a field preset, and Prisma 8 removed field presets. Write ${TEMPORAL_REWRITES[preset]}. ${GUIDE}`, { meta: { helper } });\n}\nfunction refuseScalarHelper(name) {\n\tconst helper = `field.${name}`;\n\tconst typeName = REMOVED_SCALAR_HELPERS[name];\n\tthrow contractError(\"CONTRACT.FIELD_HELPER_UNKNOWN\", `${helper}() was removed. Write field.scalar(type.${typeName}())${name === \"vector\" ? \", or field.scalar(type.Vector(n)) for a length n\" : \"\"}.`, { meta: { helper } });\n}\n/** Refuses an argument of `field.scalar()` that is not a type from the type helpers, naming the type to write when `value` is the codec id of a removed scalar helper. */\nfunction refuseScalarArgument(value) {\n\tconst helper = Object.keys(REMOVED_SCALAR_HELPERS).find((name) => value === `mongo/${name}@1`);\n\tconst typeName = helper === void 0 ? void 0 : REMOVED_SCALAR_HELPERS[helper];\n\tthrow contractError(\"CONTRACT.ARGUMENT_INVALID\", typeName === void 0 ? `field.scalar() takes a type from the type helpers, such as field.scalar(type.String()), and was given ${JSON.stringify(value)}.` : `field.scalar() takes a type, not the codec id \"${String(value)}\". Write field.scalar(type.${typeName}()).`, { meta: { helper: \"field.scalar\" } });\n}\n/**\n* The MongoDB `field` helpers, where a read of a removed scalar helper such as `field.objectId`, or of a removed field preset under `field.temporal`, throws `CONTRACT.FIELD_HELPER_UNKNOWN` with its rewrite, so a JavaScript caller, or a contract emitted before it is type-checked, learns what to write instead. Every other read behaves as on `helpers`.\n*/\nfunction refusingRemovedFieldHelpers(helpers) {\n\tconst temporal = () => answerMissingPropertyReads({}, new Set(Object.keys(TEMPORAL_REWRITES)), refusePreset);\n\treturn answerMissingPropertyReads(helpers, /* @__PURE__ */ new Set([\"temporal\", ...Object.keys(REMOVED_SCALAR_HELPERS)]), (name) => name === \"temporal\" ? temporal() : refuseScalarHelper(name));\n}\n//#endregion\n//#region src/contract-builder.ts\nconst MONGO_RESERVED_HELPER_KEYS = [\n\t\"field\",\n\t\"gen\",\n\t\"index\",\n\t\"model\",\n\t\"rel\",\n\t\"type\",\n\t\"valueObject\"\n];\nfunction stackLookupsOf(components) {\n\tconst codecLookup = extractCodecLookup(components);\n\tassertTypeAliasesValid(composePackAuthoringNamespace(components, \"type\"), {\n\t\tgeneratorFunctions: assembleGeneratorFunctions(components),\n\t\tparamsSchemaOf: (codecId) => codecLookup.descriptorFor(codecId)?.paramsSchema,\n\t\tfieldLength: () => void 0\n\t});\n\tconst { support } = assembleDataTypeSupport(components, (codecId) => codecLookup.descriptorFor(codecId)?.dataType);\n\treturn {\n\t\tcodecLookup,\n\t\tdataTypes: support\n\t};\n}\nfunction composeMongoAuthoringHelpers(family, target, extensions, lookups) {\n\tconst components = [\n\t\tfamily,\n\t\ttarget,\n\t\t...Object.values(extensions ?? {})\n\t];\n\tconst entityNamespace = composePackAuthoringNamespace(components, \"entityTypes\");\n\tconst typeNamespace = composePackAuthoringNamespace(components, \"type\");\n\tassertNoCrossRegistryCollisions(typeNamespace, entityNamespace);\n\tfor (const component of components) assertTypeChoicesValid(component.authoring?.type ?? {}, component.id);\n\tconst collisions = Object.keys(entityNamespace).filter((name) => MONGO_RESERVED_HELPER_KEYS.includes(name));\n\tif (collisions.length > 0) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Pack-contributed entity type(s) ${collisions.map((c) => `\"${c}\"`).join(\", \")} collide with the reserved built-in helper key(s) on the Mongo composed helpers surface. Reserved keys: ${MONGO_RESERVED_HELPER_KEYS.map((k) => `\"${k}\"`).join(\", \")}.`, { meta: {\n\t\treason: \"reserved-helper-key-collision\",\n\t\tcontribution: collisions\n\t} });\n\treturn blindCast({\n\t\t...createEntityHelpersFromNamespace(entityNamespace, { ctx: {\n\t\t\tfamily: family.familyId,\n\t\t\ttarget: target.targetId,\n\t\t\tcodecLookup: lookups.codecLookup,\n\t\t\tdataTypes: lookups.dataTypes\n\t\t} }),\n\t\tfield,\n\t\tgen: createGeneratorHelpers(components),\n\t\tindex,\n\t\tmodel,\n\t\trel,\n\t\ttype: createTypeHelpersFromNamespace(typeNamespace, lookups),\n\t\tvalueObject\n\t});\n}\n/**\n* The helpers the `defineContract` callback receives for a stack of `family`, `target` and `extensions`: `field`, `model`, `rel`, `index`, `valueObject`, `gen`, `type` and the packs' entity types. A facade builds its standalone `field`, `gen` and `type` from them.\n*/\nfunction createContractAuthoringHelpers(options) {\n\tconst { family, target, extensions } = options;\n\treturn composeMongoAuthoringHelpers(family, target, extensions, stackLookupsOf([\n\t\tfamily,\n\t\ttarget,\n\t\t...Object.values(extensions ?? {})\n\t]));\n}\nfunction createFieldBuilder(spec, enumHandle, executionDefaults, storedName, generatorCalls) {\n\tfunction many(options) {\n\t\treturn createFieldBuilder({\n\t\t\ttype: spec.type,\n\t\t\tnullable: spec.nullable,\n\t\t\tmany: { elementNullable: options?.elementsNullable ?? false }\n\t\t}, enumHandle, executionDefaults, storedName, generatorCalls);\n\t}\n\tfunction withGeneratorCall(phase, call) {\n\t\tif (generatorCalls?.[phase] !== void 0 || executionDefaults?.[phase] !== void 0) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `.${phase}() is called on a field that already generates a value ${phase === \"onCreate\" ? \"on create\" : \"on update\"}. Set each phase once, and do not combine .${phase}() with a type alias or alias constant that sets it.`, { meta: {\n\t\t\treason: \"generator-phase-set-twice\",\n\t\t\tphase\n\t\t} });\n\t\treturn createFieldBuilder(spec, enumHandle, blindCast(executionDefaults), storedName, {\n\t\t\t...generatorCalls,\n\t\t\t[phase]: call\n\t\t});\n\t}\n\treturn {\n\t\t__kind: \"field\",\n\t\t...ifDefined(\"__executionDefaults\", executionDefaults),\n\t\t...ifDefined(\"__generatorCalls\", generatorCalls),\n\t\tonCreate: (call) => withGeneratorCall(\"onCreate\", call),\n\t\tonUpdate: (call) => withGeneratorCall(\"onUpdate\", call),\n\t\t__type: spec.type,\n\t\t__nullable: spec.nullable,\n\t\t__many: spec.many,\n\t\t__enumHandle: blindCast(enumHandle),\n\t\t__storedName: blindCast(storedName),\n\t\toptional: () => createFieldBuilder({\n\t\t\ttype: spec.type,\n\t\t\tnullable: true,\n\t\t\tmany: spec.many\n\t\t}, enumHandle, executionDefaults, storedName, generatorCalls),\n\t\tmany: blindCast(many),\n\t\tmongo: ({ field }) => createFieldBuilder(spec, enumHandle, executionDefaults, field, generatorCalls)\n\t};\n}\nfunction isTypeInstance(value) {\n\treturn typeof value === \"object\" && value !== null && \"kind\" in value && value.kind === \"scalar\" && \"codecId\" in value && typeof value.codecId === \"string\";\n}\nfunction scalarField(type) {\n\tif (!isTypeInstance(type)) refuseScalarArgument(type);\n\tconst { generatorCalls, ...fieldType } = type;\n\treturn createFieldBuilder({\n\t\ttype: blindCast(fieldType),\n\t\tnullable: false,\n\t\tmany: false\n\t}, void 0, blindCast(void 0), void 0, generatorCalls);\n}\nconst field = refusingRemovedFieldHelpers({\n\tscalar: scalarField,\n\tvalueObject(valueObjectName) {\n\t\treturn createFieldBuilder({\n\t\t\ttype: blindCast({\n\t\t\t\tkind: \"valueObject\",\n\t\t\t\tplane: \"storage\",\n\t\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\t\tentityKind: \"valueObject\",\n\t\t\t\tentityName: resolveValueObjectName(valueObjectName)\n\t\t\t}),\n\t\t\tnullable: false,\n\t\t\tmany: false\n\t\t});\n\t},\n\tnamedType(handle) {\n\t\treturn createFieldBuilder({\n\t\t\ttype: blindCast({\n\t\t\t\tkind: \"scalar\",\n\t\t\t\tcodecId: handle.codecId\n\t\t\t}),\n\t\t\tnullable: false,\n\t\t\tmany: false\n\t\t}, handle);\n\t}\n});\nfunction index(fields, options) {\n\treturn {\n\t\tfields,\n\t\t...options ? { options } : {}\n\t};\n}\nfunction createFieldReference(modelName, fieldName) {\n\treturn {\n\t\t__kind: \"fieldRef\",\n\t\tmodelName,\n\t\tfieldName\n\t};\n}\nfunction isFieldReference(value) {\n\treturn typeof value === \"object\" && value !== null && \"__kind\" in value && value.__kind === \"fieldRef\";\n}\nfunction resolveValueObjectName(value) {\n\treturn typeof value === \"string\" ? value : value.__name;\n}\nfunction normalizeStringList(value) {\n\treturn typeof value === \"string\" ? [value] : [...value];\n}\nfunction normalizeTargetField(targetModelName, value) {\n\tif (!isFieldReference(value)) return value;\n\tif (value.modelName !== targetModelName) throw contractError(\"CONTRACT.RELATION_INVALID\", `Relation target \"${targetModelName}\" cannot reference field \"${value.modelName}.${value.fieldName}\".`, { meta: {\n\t\tmodelName: targetModelName,\n\t\treason: \"cross-model-field-reference\",\n\t\treferencedModel: value.modelName,\n\t\treferencedField: value.fieldName\n\t} });\n\treturn value.fieldName;\n}\nfunction normalizeTargetFields(targetModelName, value) {\n\tif (typeof value === \"string\") return [value];\n\tif (isFieldReference(value)) return [normalizeTargetField(targetModelName, value)];\n\treturn value.map((entry) => normalizeTargetField(targetModelName, entry));\n}\nfunction createRelationBuilder(spec) {\n\treturn {\n\t\t__kind: \"relation\",\n\t\t__to: spec.to,\n\t\t__cardinality: spec.cardinality,\n\t\t__on: spec.on,\n\t\t__nullable: spec.nullable\n\t};\n}\nfunction createReferenceRelationBuilder(target, cardinality, options, nullable) {\n\tconst targetModelName = resolveModelName(target);\n\treturn createRelationBuilder({\n\t\tto: blindCast(targetModelName),\n\t\tcardinality,\n\t\ton: {\n\t\t\tlocalFields: blindCast(normalizeStringList(options.from)),\n\t\t\ttargetFields: blindCast(normalizeTargetFields(targetModelName, options.to))\n\t\t},\n\t\tnullable\n\t});\n}\nfunction createEmbedRelationBuilder(target, cardinality) {\n\treturn createRelationBuilder({\n\t\tto: blindCast(resolveModelName(target)),\n\t\tcardinality,\n\t\ton: void 0,\n\t\tnullable: void 0\n\t});\n}\nfunction hasOne(target, options) {\n\tif (!options) return createEmbedRelationBuilder(target, \"1:1\");\n\treturn createReferenceRelationBuilder(target, \"1:1\", options, true);\n}\nfunction hasMany(target, options) {\n\tif (!options) return createEmbedRelationBuilder(target, \"1:N\");\n\treturn createReferenceRelationBuilder(target, \"1:N\", options, void 0);\n}\nfunction belongsTo(target, options) {\n\treturn createReferenceRelationBuilder(target, \"N:1\", options, options.optional);\n}\nconst rel = {\n\tbelongsTo,\n\thasMany,\n\thasOne\n};\nfunction valueObject(name, input) {\n\treturn {\n\t\t__kind: \"valueObject\",\n\t\t__name: name,\n\t\t__fields: input.fields\n\t};\n}\nfunction model(name, input) {\n\treturn {\n\t\t__kind: \"model\",\n\t\t__name: name,\n\t\t__fields: input.fields,\n\t\t__relations: blindCast(input.relations ?? {}),\n\t\t__indexes: input.indexes,\n\t\t__collectionOptions: input.collectionOptions,\n\t\t__controlPolicy: input.controlPolicy,\n\t\t__collection: blindCast(input.collection),\n\t\t__owner: blindCast(input.owner ? resolveModelName(input.owner) : void 0),\n\t\t__base: blindCast(input.base ? resolveModelName(input.base) : void 0),\n\t\t__storageRelations: blindCast(input.storageRelations),\n\t\t__discriminator: blindCast(input.discriminator ? { field: input.discriminator.field } : void 0),\n\t\t__variants: blindCast(input.discriminator?.variants),\n\t\tref(fieldName) {\n\t\t\treturn createFieldReference(name, fieldName);\n\t\t}\n\t};\n}\nfunction isContractScaffold(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\treturn \"family\" in value && \"target\" in value;\n}\nfunction buildContractFromDsl(input, lookups) {\n\tconst definition = buildContractDefinition(input);\n\tconst { codecLookup, dataTypes } = lookups ?? stackLookupsOf([\n\t\tinput.family,\n\t\tinput.target,\n\t\t...Object.values(input.extensions ?? {})\n\t]);\n\tconst merged = mergeRedundantIndexes(nameIndexes(definition), codecLookup, dataTypes);\n\tconst built = buildMongoContractFromDefinition(merged.definition, codecLookup, dataTypes);\n\tflushAuthoringWarnings((built.ok ? built.value.warnings : built.failure.warnings).map(authoringWarningOf));\n\tif (!built.ok) {\n\t\tconst [first] = built.failure.refusals;\n\t\tassertDefined(first, \"a refused build has at least one refusal\");\n\t\tthrow refusalError(refusalAtWrittenPositions(first, merged.removedIndexes));\n\t}\n\treturn blindCast(built.value.contract);\n}\n/** Implementation. */\nfunction buildBoundContract(family, target, definition, factory) {\n\tconst full = {\n\t\t...definition,\n\t\tfamily,\n\t\ttarget\n\t};\n\tif (factory !== void 0) {\n\t\tconst lookups = stackLookupsOf([\n\t\t\tfamily,\n\t\t\ttarget,\n\t\t\t...Object.values(definition.extensions ?? {})\n\t\t]);\n\t\tconst built = factory(composeMongoAuthoringHelpers(family, target, definition.extensions, lookups));\n\t\treturn buildContractFromDsl({\n\t\t\t...full,\n\t\t\t...ifDefined(\"models\", built.models),\n\t\t\t...ifDefined(\"valueObjects\", built.valueObjects),\n\t\t\t...ifDefined(\"roots\", built.roots)\n\t\t}, lookups);\n\t}\n\treturn buildContractFromDsl(full);\n}\nfunction defineContract(definition, factory) {\n\tif (!isContractScaffold(definition)) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", \"defineContract expects a contract definition object. Define your contract with defineContract({ family, target, models, ... }).\");\n\tif (factory !== void 0) return buildBoundContract(definition.family, definition.target, definition, factory);\n\treturn buildBoundContract(definition.family, definition.target, definition);\n}\n//#endregion\nexport { bindEnumType, buildBoundContract, buildMongoContractFromDefinition, createContractAuthoringHelpers, defineContract, enumType, field, index, isEnumTypeHandle, member, mergeRedundantIndexes, model, nameIndexes, rel, valueObject };\n\n//# sourceMappingURL=contract-builder.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmBA,SAAS,cAAc,OAAO,OAAO;CACpC,OAAO;EACN,MAAM;EACN,OAAO;GACN,MAAM;GACN,MAAM;EACP;EACA;CACD;AACD;AACA,SAAS,oBAAoB,aAAa,OAAO;CAChD,OAAO;EACN,MAAM;EACN,OAAO;GACN,MAAM;GACN,MAAM;EACP;EACA;CACD;AACD;;AAEA,SAAS,oBAAoB,SAAS;CACrC,QAAQ,QAAQ,MAAhB;EACC,KAAK,4BAA4B,OAAO;GACvC,MAAM;GACN,OAAO,QAAQ;GACf,UAAU,QAAQ;EACnB;EACA,KAAK;EACL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E,MAAM,OAAO;EACZ,GAAG;EACH;EACA;CACD;CACA,IAAI,YAAY,KAAK,GAAG;EACvB,MAAM,UAAU,eAAe;GAC9B;GACA;GACA,GAAG,OAAO,OAAO,WAAW,cAAc,CAAC,CAAC;EAC7C,CAAC;EACD,MAAM,QAAQ,QAAQ,6BAA6B,QAAQ,QAAQ,WAAW,YAAY,OAAO,CAAC;EAClG,OAAO,qBAAqB;GAC3B,GAAG;GACH,GAAG,UAAU,UAAU,MAAM,MAAM;GACnC,GAAG,UAAU,gBAAgB,MAAM,YAAY;GAC/C,GAAG,UAAU,SAAS,MAAM,KAAK;EAClC,GAAG,OAAO;CACX;CACA,OAAO,qBAAqB,IAAI;AACjC;AACA,SAAS,eAAe,YAAY,SAAS;CAC5C,IAAI,CAAC,mBAAmB,UAAU,GAAG,MAAM,cAAc,6BAA6B,iIAAiI;CACvN,IAAI,YAAY,KAAK,GAAG,OAAO,mBAAmB,WAAW,QAAQ,WAAW,QAAQ,YAAY,OAAO;CAC3G,OAAO,mBAAmB,WAAW,QAAQ,WAAW,QAAQ,UAAU;AAC3E"}
|
|
@@ -5,8 +5,8 @@ import { CodecLookupWithDescriptors, DataTypeParamsProblem } from "@prisma/orm-f
|
|
|
5
5
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
6
6
|
import { ContractExecutionSection, ContractField, ContractFieldType, ControlPolicy, CrossReference, EnumMemberValueType, ExecutionHashBase, ExecutionMutationDefault, ExecutionMutationDefaultPhases, ExecutionMutationDefaultValue, FieldTypesFromDomain, JsonValue, ProfileHashBase, StorageHashBase } from "@prisma/orm-framework/contract/types";
|
|
7
7
|
import { Result } from "@prisma/orm-framework/utils/result";
|
|
8
|
-
import { BoundEnumType, CodecTypeMap, EntityHelpersFromNamespace, EnumMember, EnumTypeHandle, ExtractAuthoringNamespaceFromPack, ExtractParameterizedOutputTypesFromPack, MergeExtensionAuthoringNamespaces, bindEnumType, enumType as enumType$1, isEnumTypeHandle, member } from "@prisma/orm-framework/contract-authoring";
|
|
9
|
-
import { AuthoringWarning, DataTypeSupport, DiscriminatorFieldRefusal, DiscriminatorVariantRefusal, EnumMemberProblem, WrittenValue } from "@prisma/orm-framework/components/authoring";
|
|
8
|
+
import { ArgTypeFromDescriptor, BoundEnumType, CanonicalArguments, CodecTypeMap, DataTypeArgumentTypes, EntityHelpersFromNamespace, EnumMember, EnumTypeHandle, ExtractAuthoringNamespaceFromPack, ExtractDataTypeArgumentTypesFromPack, ExtractParameterizedOutputTypesFromPack, MergeExtensionAuthoringNamespaces, ResolveTemplateValue, TupleFromArgumentDescriptors, UnionToIntersection, bindEnumType, enumType as enumType$1, isEnumTypeHandle, member } from "@prisma/orm-framework/contract-authoring";
|
|
9
|
+
import { AuthoringArgumentDescriptor, AuthoringTypeAliasDescriptor, AuthoringTypeChoiceArgument, AuthoringTypeChoiceDescriptor, AuthoringTypeChoiceRow, AuthoringTypeConstructorDescriptor, AuthoringWarning, DataTypeSupport, DiscriminatorFieldRefusal, DiscriminatorVariantRefusal, EnumMemberProblem, WrittenValue } from "@prisma/orm-framework/components/authoring";
|
|
10
10
|
import { ExtensionPackRef, ExtensionPackValues, FamilyPackRef, GeneratorFunctionCall, GeneratorHelpersOf, GeneratorPhase, TargetPackRef } from "@prisma/orm-framework/components/components";
|
|
11
11
|
//#region ../../../2-mongo-family/2-authoring/contract-ts/dist/contract-builder.d.mts
|
|
12
12
|
//#region src/build-refusals.d.ts
|
|
@@ -513,6 +513,97 @@ type NamedModelBuilder<Name extends string = string, Fields extends Record<strin
|
|
|
513
513
|
type AnyModelBuilder = NamedModelBuilder;
|
|
514
514
|
type ModelNameInput = string | AnyModelBuilder;
|
|
515
515
|
//#endregion
|
|
516
|
+
//#region src/type-helpers.d.ts
|
|
517
|
+
/** The type of a MongoDB scalar field: its codec, and its type parameters when it has any. */
|
|
518
|
+
type ScalarFieldType<CodecId extends string, TypeParams extends Record<string, unknown>> = keyof TypeParams extends never ? {
|
|
519
|
+
readonly kind: 'scalar';
|
|
520
|
+
readonly codecId: CodecId;
|
|
521
|
+
} : {
|
|
522
|
+
readonly kind: 'scalar';
|
|
523
|
+
readonly codecId: CodecId;
|
|
524
|
+
readonly typeParams: TypeParams;
|
|
525
|
+
};
|
|
526
|
+
/** What a `type.*` helper returns: the field type, and for a type alias the generator calls every field typed by it takes. */
|
|
527
|
+
type MongoTypeInstance = {
|
|
528
|
+
readonly kind: 'scalar';
|
|
529
|
+
readonly codecId: string;
|
|
530
|
+
readonly typeParams?: Record<string, unknown>;
|
|
531
|
+
readonly generatorCalls?: FieldGeneratorCalls;
|
|
532
|
+
};
|
|
533
|
+
/** The type parameters a call gives, without those it leaves out, as the built field has them. */
|
|
534
|
+
type GivenTypeParams<TypeParams> = { readonly [Key in keyof TypeParams as TypeParams[Key] extends undefined ? never : Key]: Exclude<TypeParams[Key], undefined>; };
|
|
535
|
+
type FieldTypeFromDescriptor<Descriptor extends AuthoringTypeConstructorDescriptor, Args extends readonly unknown[]> = ScalarFieldType<Descriptor['output']['codecId'], Descriptor['output'] extends {
|
|
536
|
+
readonly typeParams: infer TypeParams extends Record<string, unknown>;
|
|
537
|
+
} ? GivenTypeParams<ResolveTemplateValue<TypeParams, Args>> : Record<never, never>>;
|
|
538
|
+
type TypeHelperFunction<Descriptor extends AuthoringTypeConstructorDescriptor, ValueTypes extends DataTypeArgumentTypes> = Descriptor extends {
|
|
539
|
+
readonly args: infer Args extends readonly AuthoringArgumentDescriptor[];
|
|
540
|
+
} ? <const Params extends TupleFromArgumentDescriptors<Args, ValueTypes>>(...args: Params) => FieldTypeFromDescriptor<Descriptor, CanonicalArguments<Args, Params, ValueTypes>> : () => FieldTypeFromDescriptor<Descriptor, readonly []>;
|
|
541
|
+
type RowDefault<Row extends AuthoringTypeChoiceRow, Name extends string> = Row extends {
|
|
542
|
+
readonly defaults: infer Defaults;
|
|
543
|
+
} ? Name extends keyof Defaults ? Defaults[Name] : undefined : undefined;
|
|
544
|
+
/** The arguments a type choice passes on to the constructor its row chooses, by that constructor's argument positions: the written value, or the row's default. */
|
|
545
|
+
type PassedOnArguments<Parameters extends readonly AuthoringArgumentDescriptor[], Written extends object, Row extends AuthoringTypeChoiceRow> = { readonly [Index in keyof Parameters]: Parameters[Index] extends {
|
|
546
|
+
readonly name: infer Name extends string;
|
|
547
|
+
} ? Name extends keyof Written ? Written[Name] extends undefined ? RowDefault<Row, Name> : Written[Name] : RowDefault<Row, Name> : undefined; };
|
|
548
|
+
type ChosenFieldType<Chosen, Written extends object, Row extends AuthoringTypeChoiceRow, ValueTypes extends DataTypeArgumentTypes> = Chosen extends AuthoringTypeConstructorDescriptor ? Chosen extends {
|
|
549
|
+
readonly args: infer Parameters extends readonly AuthoringArgumentDescriptor[];
|
|
550
|
+
} ? FieldTypeFromDescriptor<Chosen, CanonicalArguments<Parameters, PassedOnArguments<Parameters, Written, Row>, ValueTypes>> : FieldTypeFromDescriptor<Chosen, readonly []> : never;
|
|
551
|
+
type ParameterNames<Chosen> = Chosen extends {
|
|
552
|
+
readonly args: readonly (infer Parameter)[];
|
|
553
|
+
} ? Parameter extends {
|
|
554
|
+
readonly name: infer Name extends string;
|
|
555
|
+
} ? Name : never : never;
|
|
556
|
+
type RowValue<Row extends AuthoringTypeChoiceRow, Name extends string> = Name extends keyof Row['when'] ? Row['when'][Name] : never;
|
|
557
|
+
/** Whether `Row` gives the option `Argument` its default, so a call choosing the row may leave it out. */
|
|
558
|
+
type RowTakesDefault<Argument extends AuthoringTypeChoiceArgument, Row extends AuthoringTypeChoiceRow> = Argument extends {
|
|
559
|
+
readonly default: infer Default;
|
|
560
|
+
} ? RowValue<Row, Argument['name']> extends Default ? true : false : true;
|
|
561
|
+
/** The options a call choosing `Row` must write: those whose value in the row is not their default. */
|
|
562
|
+
type RequiredRowOptions<Args extends readonly AuthoringTypeChoiceArgument[], Row extends AuthoringTypeChoiceRow> = { readonly [Argument in Args[number] as Argument extends {
|
|
563
|
+
readonly kind: 'option';
|
|
564
|
+
} ? RowTakesDefault<Argument, Row> extends true ? never : Argument['name'] : never]: RowValue<Row, Argument['name']>; };
|
|
565
|
+
/** What else a call choosing `Row` may write: an option the row gives its default, and an argument the chosen constructor takes. */
|
|
566
|
+
type OptionalRowArguments<Args extends readonly AuthoringTypeChoiceArgument[], Row extends AuthoringTypeChoiceRow, Chosen, ValueTypes extends DataTypeArgumentTypes> = { readonly [Argument in Args[number] as Argument extends {
|
|
567
|
+
readonly kind: 'option';
|
|
568
|
+
} ? RowTakesDefault<Argument, Row> extends true ? Argument['name'] : never : Argument['name'] extends ParameterNames<Chosen> ? Argument['name'] : never]?: (Argument extends {
|
|
569
|
+
readonly kind: 'option';
|
|
570
|
+
} ? RowValue<Row, Argument['name']> : Argument extends AuthoringArgumentDescriptor ? ArgTypeFromDescriptor<Argument, ValueTypes> : never) | undefined; };
|
|
571
|
+
/** `Params`, with every key `Allowed` does not name typed `never`, so a call writing such a key does not compile. */
|
|
572
|
+
type OnlyKeys<Params, Allowed extends PropertyKey> = Params & { readonly [Key in Exclude<keyof Params, Allowed>]: never; };
|
|
573
|
+
type RowArguments<Args extends readonly AuthoringTypeChoiceArgument[], Row extends AuthoringTypeChoiceRow, Chosen, ValueTypes extends DataTypeArgumentTypes> = RequiredRowOptions<Args, Row> & OptionalRowArguments<Args, Row, Chosen, ValueTypes>;
|
|
574
|
+
type RowObjectHelperFunction<Args extends readonly AuthoringTypeChoiceArgument[], Row extends AuthoringTypeChoiceRow, Chosen, ValueTypes extends DataTypeArgumentTypes> = <const Params extends RowArguments<Args, Row, Chosen, ValueTypes>>(args: OnlyKeys<Params, keyof RowArguments<Args, Row, Chosen, ValueTypes>>) => ChosenFieldType<Chosen, Params, Row, ValueTypes>;
|
|
575
|
+
/** A call choosing `Row`: with no arguments too when the row gives every option its default. */
|
|
576
|
+
type RowHelperFunction<Args extends readonly AuthoringTypeChoiceArgument[], Row extends AuthoringTypeChoiceRow, Chosen, ValueTypes extends DataTypeArgumentTypes> = keyof RequiredRowOptions<Args, Row> extends never ? (() => ChosenFieldType<Chosen, Record<never, never>, Row, ValueTypes>) & RowObjectHelperFunction<Args, Row, Chosen, ValueTypes> : RowObjectHelperFunction<Args, Row, Chosen, ValueTypes>;
|
|
577
|
+
type RowOverloads<Args extends readonly AuthoringTypeChoiceArgument[], Rows extends readonly AuthoringTypeChoiceRow[], Namespace, ValueTypes extends DataTypeArgumentTypes> = Rows extends readonly [infer Row extends AuthoringTypeChoiceRow, ...infer Rest extends readonly AuthoringTypeChoiceRow[]] ? RowHelperFunction<Args, Row, Row['type'] extends keyof Namespace ? Namespace[Row['type']] : never, ValueTypes> & RowOverloads<Args, Rest, Namespace, ValueTypes> : unknown;
|
|
578
|
+
/** A type choice's helper, which takes its arguments as one object keyed by name: one overload per row, so a call is typed by the row its option values choose, and a combination with no row, an unknown key, or an argument the chosen type does not take does not compile. */
|
|
579
|
+
type TypeChoiceHelperFunction<Descriptor extends AuthoringTypeChoiceDescriptor, Namespace, ValueTypes extends DataTypeArgumentTypes> = RowOverloads<Descriptor['args'], Descriptor['choices'], Namespace, ValueTypes>;
|
|
580
|
+
type AliasGeneratorCalls<Output> = (Output extends {
|
|
581
|
+
readonly onCreate: GeneratorFunctionCall;
|
|
582
|
+
} ? {
|
|
583
|
+
readonly onCreate: GeneratorFunctionCall;
|
|
584
|
+
} : unknown) & (Output extends {
|
|
585
|
+
readonly onUpdate: GeneratorFunctionCall;
|
|
586
|
+
} ? {
|
|
587
|
+
readonly onUpdate: GeneratorFunctionCall;
|
|
588
|
+
} : unknown);
|
|
589
|
+
type TypeAliasHelperFunction<Descriptor extends AuthoringTypeAliasDescriptor> = () => ScalarFieldType<Descriptor['output']['type']['codecId'], Descriptor['output']['type'] extends {
|
|
590
|
+
readonly typeParams: infer TypeParams extends Record<string, unknown>;
|
|
591
|
+
} ? TypeParams : Record<never, never>> & (Descriptor['output'] extends {
|
|
592
|
+
readonly onCreate: GeneratorFunctionCall;
|
|
593
|
+
} | {
|
|
594
|
+
readonly onUpdate: GeneratorFunctionCall;
|
|
595
|
+
} ? {
|
|
596
|
+
readonly generatorCalls: AliasGeneratorCalls<Descriptor['output']>;
|
|
597
|
+
} : unknown);
|
|
598
|
+
/** The `type` helpers of a type namespace: a call of a type constructor, type choice or type alias gives the field type it stands for. A constructor marked `deprecated` is a PSL name only, and has no helper. */
|
|
599
|
+
type TypeHelpersFromNamespace<Namespace, ValueTypes extends DataTypeArgumentTypes> = { readonly [K in keyof Namespace as Namespace[K] extends {
|
|
600
|
+
readonly deprecated: unknown;
|
|
601
|
+
} ? never : K]: Namespace[K] extends AuthoringTypeConstructorDescriptor ? TypeHelperFunction<Namespace[K], ValueTypes> : Namespace[K] extends AuthoringTypeAliasDescriptor ? TypeAliasHelperFunction<Namespace[K]> : Namespace[K] extends AuthoringTypeChoiceDescriptor ? TypeChoiceHelperFunction<Namespace[K], Namespace, ValueTypes> : Namespace[K] extends Record<string, unknown> ? TypeHelpersFromNamespace<Namespace[K], ValueTypes> : never; };
|
|
602
|
+
type ExtractTypeNamespaceFromPack<Pack> = ExtractAuthoringNamespaceFromPack<Pack, 'type', Record<never, never>>;
|
|
603
|
+
type MergeExtensionDataTypeArgumentTypes<Extensions> = Extensions extends Record<string, unknown> ? keyof Extensions extends never ? Record<never, never> : UnionToIntersection<{ [K in keyof Extensions]: ExtractDataTypeArgumentTypesFromPack<Extensions[K]>; }[keyof Extensions]> : Record<never, never>;
|
|
604
|
+
/** The `type` helpers of a stack: the type namespaces of its family, target and extension packs. */
|
|
605
|
+
type TypeHelpersOfPacks<Family, Target, Extensions> = TypeHelpersFromNamespace<ExtractTypeNamespaceFromPack<Family> & ExtractTypeNamespaceFromPack<Target> & MergeExtensionAuthoringNamespaces<Extensions, 'type'>, ExtractDataTypeArgumentTypesFromPack<Family> & ExtractDataTypeArgumentTypesFromPack<Target> & MergeExtensionDataTypeArgumentTypes<Extensions>>;
|
|
606
|
+
//#endregion
|
|
516
607
|
//#region src/contract-builder.d.ts
|
|
517
608
|
type StringListInput = string | readonly string[];
|
|
518
609
|
type Present<T> = Exclude<T, undefined>;
|
|
@@ -520,7 +611,7 @@ type EmptyObject = Record<never, never>;
|
|
|
520
611
|
type Simplify<T> = { [K in keyof T]: T[K]; } & EmptyObject;
|
|
521
612
|
type Flatten<T> = { [K in keyof T]: T[K]; };
|
|
522
613
|
type StrictShape<Actual, Shape> = Actual & Shape & Record<Exclude<keyof Actual, keyof Shape>, never>;
|
|
523
|
-
type UnionToIntersection<Union> = (Union extends unknown ? (value: Union) => void : never) extends ((value: infer Intersection) => void) ? Intersection : never;
|
|
614
|
+
type UnionToIntersection$1<Union> = (Union extends unknown ? (value: Union) => void : never) extends ((value: infer Intersection) => void) ? Intersection : never;
|
|
524
615
|
type ExtractCodecTypesFromPack<P> = P extends {
|
|
525
616
|
__codecTypes?: infer CodecTypes;
|
|
526
617
|
} ? CodecTypes extends Record<string, {
|
|
@@ -594,7 +685,7 @@ type MongoCodecTypes = {
|
|
|
594
685
|
readonly traits: never;
|
|
595
686
|
};
|
|
596
687
|
};
|
|
597
|
-
type MergeExtensionCodecTypes<Packs extends Record<string, unknown>> = UnionToIntersection<{ [K in keyof Packs]: ExtractCodecTypesFromPack<Packs[K]>; }[keyof Packs]>;
|
|
688
|
+
type MergeExtensionCodecTypes<Packs extends Record<string, unknown>> = UnionToIntersection$1<{ [K in keyof Packs]: ExtractCodecTypesFromPack<Packs[K]>; }[keyof Packs]>;
|
|
598
689
|
type MergeExtensionCodecTypesSafe<Packs> = Packs extends Record<string, unknown> ? keyof Packs extends never ? Record<never, never> : MergeExtensionCodecTypes<Packs> : Record<never, never>;
|
|
599
690
|
type ExtractFieldReferenceName<T> = T extends FieldReference<string, infer FieldName extends string> ? FieldName : never;
|
|
600
691
|
type ExtractModelName<T> = T extends NamedModelBuilder<infer Name> ? Name : never;
|
|
@@ -804,8 +895,17 @@ type ContractAuthoringHelpers<Family extends FamilyPackRef<string> = FamilyPackR
|
|
|
804
895
|
readonly model: typeof model;
|
|
805
896
|
readonly rel: typeof rel;
|
|
806
897
|
readonly valueObject: typeof valueObject;
|
|
898
|
+
readonly type: TypeHelpersOfPacks<Family, Target, Extensions>;
|
|
807
899
|
readonly gen: GeneratorHelpersOf<Family | Target | ExtensionPackValues<Extensions>>;
|
|
808
900
|
};
|
|
901
|
+
/**
|
|
902
|
+
* The helpers the `defineContract` callback receives for a stack of `family`, `target` and `extensions`: `field`, `model`, `rel`, `index`, `valueObject`, `gen`, `type` and the packs' entity types. A facade builds its standalone `field`, `gen` and `type` from them.
|
|
903
|
+
*/
|
|
904
|
+
declare function createContractAuthoringHelpers<Family extends FamilyPackRef<string>, Target extends TargetPackRef<string, string>, Extensions extends Record<string, ExtensionPackRef<string, string>> | undefined = undefined>(options: {
|
|
905
|
+
readonly family: Family;
|
|
906
|
+
readonly target: Target;
|
|
907
|
+
readonly extensions?: Extensions;
|
|
908
|
+
}): ContractAuthoringHelpers<Family, Target, Extensions>;
|
|
809
909
|
type ContractScaffold<Family extends FamilyPackRef<string>, Target extends TargetPackRef<string, string>, Extensions extends Record<string, ExtensionPackRef<string, string>> | undefined = undefined, Roots extends Record<string, ModelNameInput> | undefined = undefined> = {
|
|
810
910
|
readonly family: Family;
|
|
811
911
|
readonly target: Target;
|
|
@@ -823,75 +923,25 @@ type ContractFactory<Models extends Record<string, AnyModelBuilder> = Record<nev
|
|
|
823
923
|
readonly valueObjects?: ValueObjects;
|
|
824
924
|
readonly roots?: Roots;
|
|
825
925
|
};
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
readonly
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
readonly
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
readonly
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
}, false, false>;
|
|
926
|
+
/** The field type a `type.*` helper's result stands for, without a type alias's generator calls. */
|
|
927
|
+
type FieldTypeOfInstance<Instance extends MongoTypeInstance> = ScalarFieldType<Instance['codecId'], Instance extends {
|
|
928
|
+
readonly typeParams: infer TypeParams extends Record<string, unknown>;
|
|
929
|
+
} ? TypeParams : Record<never, never>>;
|
|
930
|
+
/** The generated phases a type alias gives every field typed by it, or none. */
|
|
931
|
+
type AliasExecutionDefaults<Instance> = Instance extends {
|
|
932
|
+
readonly generatorCalls: infer Calls;
|
|
933
|
+
} ? (Calls extends {
|
|
934
|
+
readonly onCreate: GeneratorFunctionCall;
|
|
935
|
+
} ? {
|
|
936
|
+
readonly onCreate: ExecutionMutationDefaultValue;
|
|
937
|
+
} : unknown) & (Calls extends {
|
|
938
|
+
readonly onUpdate: GeneratorFunctionCall;
|
|
939
|
+
} ? {
|
|
940
|
+
readonly onUpdate: ExecutionMutationDefaultValue;
|
|
941
|
+
} : unknown) : undefined;
|
|
942
|
+
declare function scalarField<const Instance extends MongoTypeInstance>(type: Instance): FieldBuilder<FieldTypeOfInstance<Instance>, false, false, undefined, AliasExecutionDefaults<Instance>>;
|
|
844
943
|
declare const field: {
|
|
845
|
-
readonly scalar: typeof
|
|
846
|
-
readonly objectId: () => FieldBuilder<{
|
|
847
|
-
readonly kind: "scalar";
|
|
848
|
-
readonly codecId: "mongo/objectId@1";
|
|
849
|
-
} & EmptyObject, false, false, EnumTypeHandle<string, readonly unknown[], readonly string[], Record<string, unknown>, string> | undefined, undefined, string | undefined>;
|
|
850
|
-
readonly string: () => FieldBuilder<{
|
|
851
|
-
readonly kind: "scalar";
|
|
852
|
-
readonly codecId: "mongo/string@1";
|
|
853
|
-
} & EmptyObject, false, false, EnumTypeHandle<string, readonly unknown[], readonly string[], Record<string, unknown>, string> | undefined, undefined, string | undefined>;
|
|
854
|
-
readonly double: () => FieldBuilder<{
|
|
855
|
-
readonly kind: "scalar";
|
|
856
|
-
readonly codecId: "mongo/double@1";
|
|
857
|
-
} & EmptyObject, false, false, EnumTypeHandle<string, readonly unknown[], readonly string[], Record<string, unknown>, string> | undefined, undefined, string | undefined>;
|
|
858
|
-
readonly int32: () => FieldBuilder<{
|
|
859
|
-
readonly kind: "scalar";
|
|
860
|
-
readonly codecId: "mongo/int32@1";
|
|
861
|
-
} & EmptyObject, false, false, EnumTypeHandle<string, readonly unknown[], readonly string[], Record<string, unknown>, string> | undefined, undefined, string | undefined>;
|
|
862
|
-
readonly bool: () => FieldBuilder<{
|
|
863
|
-
readonly kind: "scalar";
|
|
864
|
-
readonly codecId: "mongo/bool@1";
|
|
865
|
-
} & EmptyObject, false, false, EnumTypeHandle<string, readonly unknown[], readonly string[], Record<string, unknown>, string> | undefined, undefined, string | undefined>;
|
|
866
|
-
readonly date: () => FieldBuilder<{
|
|
867
|
-
readonly kind: "scalar";
|
|
868
|
-
readonly codecId: "mongo/date@1";
|
|
869
|
-
} & EmptyObject, false, false, EnumTypeHandle<string, readonly unknown[], readonly string[], Record<string, unknown>, string> | undefined, undefined, string | undefined>;
|
|
870
|
-
readonly int64: () => FieldBuilder<{
|
|
871
|
-
readonly kind: "scalar";
|
|
872
|
-
readonly codecId: "mongo/int64@1";
|
|
873
|
-
} & EmptyObject, false, false, EnumTypeHandle<string, readonly unknown[], readonly string[], Record<string, unknown>, string> | undefined, undefined, string | undefined>;
|
|
874
|
-
readonly int64Number: () => FieldBuilder<{
|
|
875
|
-
readonly kind: "scalar";
|
|
876
|
-
readonly codecId: "mongo/int64Number@1";
|
|
877
|
-
} & EmptyObject, false, false, EnumTypeHandle<string, readonly unknown[], readonly string[], Record<string, unknown>, string> | undefined, undefined, string | undefined>;
|
|
878
|
-
readonly decimal128: () => FieldBuilder<{
|
|
879
|
-
readonly kind: "scalar";
|
|
880
|
-
readonly codecId: "mongo/decimal128@1";
|
|
881
|
-
} & EmptyObject, false, false, EnumTypeHandle<string, readonly unknown[], readonly string[], Record<string, unknown>, string> | undefined, undefined, string | undefined>;
|
|
882
|
-
readonly binary: () => FieldBuilder<{
|
|
883
|
-
readonly kind: "scalar";
|
|
884
|
-
readonly codecId: "mongo/binary@1";
|
|
885
|
-
} & EmptyObject, false, false, EnumTypeHandle<string, readonly unknown[], readonly string[], Record<string, unknown>, string> | undefined, undefined, string | undefined>;
|
|
886
|
-
readonly json: () => FieldBuilder<{
|
|
887
|
-
readonly kind: "scalar";
|
|
888
|
-
readonly codecId: "mongo/json@1";
|
|
889
|
-
} & EmptyObject, false, false, EnumTypeHandle<string, readonly unknown[], readonly string[], Record<string, unknown>, string> | undefined, undefined, string | undefined>;
|
|
890
|
-
readonly bson: () => FieldBuilder<{
|
|
891
|
-
readonly kind: "scalar";
|
|
892
|
-
readonly codecId: "mongo/bson@1";
|
|
893
|
-
} & EmptyObject, false, false, EnumTypeHandle<string, readonly unknown[], readonly string[], Record<string, unknown>, string> | undefined, undefined, string | undefined>;
|
|
894
|
-
readonly vector: typeof vectorField;
|
|
944
|
+
readonly scalar: typeof scalarField;
|
|
895
945
|
readonly valueObject: <const ValueObject extends ValueObjectNameInput>(valueObjectName: ValueObject) => FieldBuilder<{
|
|
896
946
|
readonly kind: "valueObject";
|
|
897
947
|
readonly plane: "storage";
|
|
@@ -1022,5 +1072,5 @@ declare function mergeRedundantIndexes(definition: ContractDefinition, codecLook
|
|
|
1022
1072
|
*/
|
|
1023
1073
|
declare function nameIndexes(definition: ContractDefinition): ContractDefinition;
|
|
1024
1074
|
//#endregion
|
|
1025
|
-
export { RelationNode as A,
|
|
1026
|
-
//# sourceMappingURL=contract-builder-
|
|
1075
|
+
export { RelationNode as A, defineContract as B, MergedIndexes as C, ReferenceRelationNode as D, MongoContractResult as E, VariantBaseNode as F, member as G, field as H, bindEnumType as I, nameIndexes as J, mergeRedundantIndexes as K, buildBoundContract as L, RestatedFieldDifference as M, ValueObjectBuilder as N, RefusalKey as O, ValueObjectNode as P, buildMongoContractFromDefinition as R, IndexShapeRule as S, ModelNode as T, index as U, enumType$1 as V, isEnumTypeHandle as W, valueObject as X, rel as Y, FieldBuilder as _, BuiltContract as a, FieldReference as b, ContractDefinition as c, ContractScaffold as d, DiscriminatorNode as f, ExtractCodecTypesFromPack as g, EnumTypeHandle as h, BuildWarning as i, RemovedIndex as j, RelationBuilder as k, ContractFactory as l, EnumMember as m, BuildFailure as n, CodecTypeMap as o, EmbedRelationNode as p, model as q, BuildRefusal as r, ContractAuthoringHelpers as s, BoundEnumType as t, ContractInput as u, FieldKey as v, ModelBuilder as w, IndexNode as x, FieldNode as y, createContractAuthoringHelpers as z };
|
|
1076
|
+
//# sourceMappingURL=contract-builder-DmreXzbK.d.mts.map
|