@prisma/orm-family-mongo 8.0.0-rc.17-dev.40 → 8.0.0-rc.17-dev.42
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-prisma6__provider.mjs +27 -23
- package/dist/contract-prisma6__provider.mjs.map +1 -1
- package/dist/contract-psl.d.mts +1 -0
- package/dist/contract-psl.d.mts.map +1 -1
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__provider.mjs +3 -2
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/{control-BDIVZAvv.mjs → control-P-lUuq2V.mjs} +2 -2
- package/dist/{control-BDIVZAvv.mjs.map → control-P-lUuq2V.mjs.map} +1 -1
- package/dist/dist-xk_0xOR-.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-BbLjGwe9-CkEyEhoA.mjs → interpreter-Bhe8FSI4-uGNm4vAs.mjs} +23 -24
- package/dist/interpreter-Bhe8FSI4-uGNm4vAs.mjs.map +1 -0
- package/package.json +20 -20
- package/dist/interpreter-BbLjGwe9-CkEyEhoA.mjs.map +0 -1
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { o as MongoIndex } from "./entity-kinds-RooUvcN8-B1AF_ppw.mjs";
|
|
2
2
|
import { f as mongoValueSetsOf, l as buildMongoStorage, m as validateMongoStorage } from "./dist-CYYrUE3W.mjs";
|
|
3
|
-
import { o as pairMongoBackRelations } from "./interpreter-
|
|
3
|
+
import { o as pairMongoBackRelations } from "./interpreter-Bhe8FSI4-uGNm4vAs.mjs";
|
|
4
4
|
import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
5
|
-
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
6
5
|
import { crossRef } from "@prisma/orm-framework/contract/types";
|
|
7
6
|
import { buildExecutionSection, computeProfileHash } from "@prisma/orm-framework/contract/hashing";
|
|
8
7
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
@@ -175,7 +174,8 @@ function interpretPrisma6Documents(input) {
|
|
|
175
174
|
for (const { document, sources, sourceFile, sourceId } of input.documents) {
|
|
176
175
|
const { symbolTable, diagnostics: tableDiagnostics } = buildSymbolTable({
|
|
177
176
|
documents: [document],
|
|
178
|
-
sources
|
|
177
|
+
sources,
|
|
178
|
+
defaultNamespaceId: input.defaultNamespaceId
|
|
179
179
|
});
|
|
180
180
|
for (const diagnostic of tableDiagnostics) diagnostics.push({
|
|
181
181
|
code: diagnostic.code,
|
|
@@ -199,7 +199,7 @@ function interpretPrisma6Documents(input) {
|
|
|
199
199
|
span: nodePslSpan(inclusion.syntax, sources)
|
|
200
200
|
});
|
|
201
201
|
};
|
|
202
|
-
for (const block of Object.values(symbolTable.
|
|
202
|
+
for (const block of Object.values(symbolTable.defaultNamespace.blocks)) switch (block.keyword) {
|
|
203
203
|
case "datasource":
|
|
204
204
|
datasources.push({
|
|
205
205
|
symbol: block,
|
|
@@ -223,18 +223,18 @@ function interpretPrisma6Documents(input) {
|
|
|
223
223
|
break;
|
|
224
224
|
default: unsupported(block.keyword, keywordPslSpan(block.node.syntax, block.keyword, sources));
|
|
225
225
|
}
|
|
226
|
-
for (const namespace of Object.values(symbolTable.
|
|
227
|
-
for (const namedType of Object.values(symbolTable.
|
|
228
|
-
for (const mixin of Object.values(symbolTable.
|
|
229
|
-
unsupportedInclusions("PSL_INVALID_MODEL_MEMBER", symbolTable.
|
|
230
|
-
unsupportedInclusions("PSL_INVALID_MODEL_MEMBER", symbolTable.
|
|
231
|
-
unsupportedInclusions("PSL_INVALID_EXTENSION_BLOCK_MEMBER", symbolTable.
|
|
232
|
-
for (const symbol of Object.values(symbolTable.
|
|
226
|
+
for (const namespace of Object.values(symbolTable.namespaces)) for (const { span } of namespace.declarations) unsupported("namespace", span);
|
|
227
|
+
for (const namedType of Object.values(symbolTable.namedTypes)) unsupported("types", namedType.span);
|
|
228
|
+
for (const mixin of Object.values(symbolTable.defaultNamespace.mixins)) unsupported(`${mixin.keyword} mixin`, mixin.span);
|
|
229
|
+
unsupportedInclusions("PSL_INVALID_MODEL_MEMBER", symbolTable.defaultNamespace.models);
|
|
230
|
+
unsupportedInclusions("PSL_INVALID_MODEL_MEMBER", symbolTable.defaultNamespace.compositeTypes);
|
|
231
|
+
unsupportedInclusions("PSL_INVALID_EXTENSION_BLOCK_MEMBER", symbolTable.defaultNamespace.blocks);
|
|
232
|
+
for (const symbol of Object.values(symbolTable.defaultNamespace.compositeTypes)) if (claimName("type", symbol.name, sourceId, symbol.span)) compositeTypes.push({
|
|
233
233
|
symbol,
|
|
234
234
|
sourceId,
|
|
235
235
|
sources
|
|
236
236
|
});
|
|
237
|
-
for (const symbol of Object.values(symbolTable.
|
|
237
|
+
for (const symbol of Object.values(symbolTable.defaultNamespace.models)) {
|
|
238
238
|
if (!claimName("model", symbol.name, sourceId, symbol.span)) continue;
|
|
239
239
|
if (symbol.attributes.some((attribute) => attribute.name === "ignore")) ignoredModels.add(symbol.name);
|
|
240
240
|
else models.push({
|
|
@@ -261,7 +261,8 @@ function interpretPrisma6Documents(input) {
|
|
|
261
261
|
enums,
|
|
262
262
|
enumNames: new Set(enumBlocks.map((located) => located.symbol.name)),
|
|
263
263
|
compositeTypeNames,
|
|
264
|
-
diagnostics
|
|
264
|
+
diagnostics,
|
|
265
|
+
namespaceId: input.defaultNamespaceId
|
|
265
266
|
};
|
|
266
267
|
const valueObjects = {};
|
|
267
268
|
for (const located of compositeTypes) valueObjects[located.symbol.name] = { fields: readCompositeFields(located, typeContext) };
|
|
@@ -274,11 +275,12 @@ function interpretPrisma6Documents(input) {
|
|
|
274
275
|
foreignKeys,
|
|
275
276
|
invalidFkPairings,
|
|
276
277
|
backRelations
|
|
277
|
-
}, diagnostics);
|
|
278
|
+
}, diagnostics, input.defaultNamespaceId);
|
|
278
279
|
const paired = pairMongoBackRelations({
|
|
279
280
|
foreignKeys,
|
|
280
281
|
candidates: backRelations,
|
|
281
|
-
invalidFkPairings
|
|
282
|
+
invalidFkPairings,
|
|
283
|
+
namespaceId: input.defaultNamespaceId
|
|
282
284
|
});
|
|
283
285
|
diagnostics.push(...mapPslDiagnostics(paired.diagnostics, mergedSources(input.documents)));
|
|
284
286
|
for (const { modelName, fieldName, relation } of paired.relations) {
|
|
@@ -292,10 +294,10 @@ function interpretPrisma6Documents(input) {
|
|
|
292
294
|
const indexes = buildIndexes(build, diagnostics);
|
|
293
295
|
const existing = collections[build.collection];
|
|
294
296
|
collections[build.collection] = { indexes: [...existing?.indexes ?? [], ...indexes] };
|
|
295
|
-
roots[build.collection] = crossRef(modelName,
|
|
297
|
+
roots[build.collection] = crossRef(modelName, input.defaultNamespaceId);
|
|
296
298
|
for (const { field, phases } of build.executionDefaults) executionDefaults.push({
|
|
297
299
|
ref: {
|
|
298
|
-
namespace:
|
|
300
|
+
namespace: input.defaultNamespaceId,
|
|
299
301
|
entry: build.collection,
|
|
300
302
|
field
|
|
301
303
|
},
|
|
@@ -319,7 +321,8 @@ function interpretPrisma6Documents(input) {
|
|
|
319
321
|
roots,
|
|
320
322
|
valueObjects,
|
|
321
323
|
enums,
|
|
322
|
-
executionDefaults
|
|
324
|
+
executionDefaults,
|
|
325
|
+
namespaceId: input.defaultNamespaceId
|
|
323
326
|
}));
|
|
324
327
|
}
|
|
325
328
|
/**
|
|
@@ -525,7 +528,7 @@ function resolveFieldType(field, owner, nativeType, sourceId, ctx) {
|
|
|
525
528
|
const valueSet = {
|
|
526
529
|
plane: "domain",
|
|
527
530
|
entityKind: "enum",
|
|
528
|
-
namespaceId:
|
|
531
|
+
namespaceId: ctx.namespaceId,
|
|
529
532
|
entityName: field.typeName
|
|
530
533
|
};
|
|
531
534
|
return {
|
|
@@ -854,7 +857,7 @@ function ignoredFieldReferenced(modelName, fieldNames, usedBy, sourceId, span) {
|
|
|
854
857
|
const removal = usedBy.kind === "index" ? "which makes Prisma 6 `db push` drop the index" : "which removes that relation from the Prisma 6 client";
|
|
855
858
|
return prisma6Diagnostic("PSL.PRISMA6_MONGO_IGNORED_FIELD_REFERENCED", `${one ? "Field" : "Fields"} ${fields} ${one ? "is" : "are"} marked @ignore, but ${usedBy.text} uses ${one ? "it" : "them"}. Remove @ignore from ${fields}, which adds ${one ? "it" : "them"} to the Prisma 6 client, or remove ${usedBy.text}, ${removal}.`, sourceId, span);
|
|
856
859
|
}
|
|
857
|
-
function readRelationFields(build, builds, out, diagnostics) {
|
|
860
|
+
function readRelationFields(build, builds, out, diagnostics, namespaceId) {
|
|
858
861
|
const { symbol, sourceId, sources } = build.located;
|
|
859
862
|
for (const { field, relation } of build.relationFields) {
|
|
860
863
|
const label = `Relation field "${symbol.name}.${field.name}"`;
|
|
@@ -940,7 +943,7 @@ function readRelationFields(build, builds, out, diagnostics) {
|
|
|
940
943
|
const local = localFields.filter((name) => name !== void 0);
|
|
941
944
|
const referenced = targetFields.filter((name) => name !== void 0);
|
|
942
945
|
build.relations[field.name] = {
|
|
943
|
-
to: crossRef(field.typeName,
|
|
946
|
+
to: crossRef(field.typeName, namespaceId),
|
|
944
947
|
cardinality: "N:1",
|
|
945
948
|
nullable: field.optional,
|
|
946
949
|
on: {
|
|
@@ -1027,7 +1030,7 @@ function assembleContract(input) {
|
|
|
1027
1030
|
targetFamily,
|
|
1028
1031
|
target,
|
|
1029
1032
|
roots: input.roots,
|
|
1030
|
-
domain: { namespaces: { [
|
|
1033
|
+
domain: { namespaces: { [input.namespaceId]: {
|
|
1031
1034
|
models: blindCast(models),
|
|
1032
1035
|
...Object.keys(input.valueObjects).length > 0 ? { valueObjects: input.valueObjects } : {},
|
|
1033
1036
|
...Object.keys(builtEnums).length > 0 ? { enum: builtEnums } : {}
|
|
@@ -1149,7 +1152,8 @@ function prisma6Contract(schemaPath, options) {
|
|
|
1149
1152
|
binding: options.binding,
|
|
1150
1153
|
authoringContributions: context.authoringContributions,
|
|
1151
1154
|
codecLookup: context.codecLookup,
|
|
1152
|
-
dataTypes: context.dataTypes
|
|
1155
|
+
dataTypes: context.dataTypes,
|
|
1156
|
+
defaultNamespaceId: context.defaultNamespaceId
|
|
1153
1157
|
});
|
|
1154
1158
|
if (!interpreted.ok) return interpreted;
|
|
1155
1159
|
contract = applySpecifierDefaultControlPolicy(interpreted.value, options.defaultControlPolicy);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-prisma6__provider.mjs","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-prisma6/dist/provider.mjs"],"sourcesContent":["import { readFile, readdir, stat } from \"node:fs/promises\";\nimport { applySpecifierDefaultControlPolicy } from \"@internal/contract/apply-specifier-default-control-policy\";\nimport { validateContractDomain } from \"@internal/contract/validate-domain\";\nimport { MongoIndex, buildMongoStorage, mongoValueSetsOf, validateMongoStorage } from \"@internal/mongo-contract\";\nimport { ArrayLiteralAst, FunctionCallAst, IdentifierAst, PathExprAst, StringLiteralExprAst, dottedPathsIn, parse, printSyntax } from \"@internal/psl-parser/syntax\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { isStructuredError } from \"@internal/utils/structured-error\";\nimport { basename, dirname, extname, join, normalize } from \"pathe\";\nimport { buildExecutionSection, computeProfileHash } from \"@internal/contract/hashing\";\nimport { crossRef } from \"@internal/contract/types\";\nimport { resolveToOneRelationNullable } from \"@internal/contract-authoring\";\nimport { encodeEnumMembers, enumMemberProblemDiagnostic, instantiateAuthoringEntityType, isAuthoringEntityTypeDescriptor } from \"@internal/framework-components/authoring\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { pairMongoBackRelations } from \"@internal/mongo-contract-psl\";\nimport { buildSymbolTable, keywordPslSpan, mapPslDiagnostics, nodePslSpan, readResolvedAttribute } from \"@internal/psl-parser\";\nimport { fkRelationPairKey } from \"@internal/psl-parser/interpret\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/diagnostics.ts\nfunction prisma6Diagnostic(code, message, sourceId, span) {\n\treturn {\n\t\tcode,\n\t\tmessage,\n\t\tsourceId,\n\t\t...span !== void 0 ? { span } : {}\n\t};\n}\n//#endregion\n//#region src/indexes.ts\nfunction unsupported(attribute, what, span, ctx) {\n\tctx.diagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_INDEX_ARGUMENT_UNSUPPORTED\", `${ctx.owner}: ${ctx.prefix}${attribute.name} ${what}`, ctx.sourceId, span));\n}\nfunction sortDirection(expression) {\n\tif (expression === void 0) return void 0;\n\tconst token = IdentifierAst.cast(expression.syntax)?.name();\n\treturn token === \"Asc\" ? 1 : token === \"Desc\" ? -1 : void 0;\n}\n/**\n* Reads `sort:` from one index element's or `@unique`'s arguments. `length:` and every other argument are refused: a MongoDB index has no prefix length, and Prisma 6 accepts no other argument there on MongoDB.\n*/\nfunction readSort(attribute, args, ctx) {\n\tlet direction;\n\tfor (const arg of args) {\n\t\tconst key = arg.name()?.name();\n\t\tconst span = nodePslSpan(arg.syntax, ctx.sources);\n\t\tif (key !== \"sort\") return unsupported(attribute, key === \"length\" ? \"argument \\\"length\\\" is not supported: a MongoDB index has no prefix length. Remove it; Prisma 6 ignores it on MongoDB.\" : `argument \"${key ?? \"\"}\" is not supported.`, span, ctx);\n\t\tdirection = sortDirection(arg.value());\n\t\tif (direction === void 0) return unsupported(attribute, \"sort must be Asc or Desc.\", span, ctx);\n\t}\n\treturn { direction };\n}\nfunction readFields(attribute, expression, span, ctx) {\n\tconst array = expression === void 0 ? void 0 : ArrayLiteralAst.cast(expression.syntax);\n\tif (array === void 0) return unsupported(attribute, \"expects a list of field names.\", span, ctx);\n\tconst fields = [];\n\tfor (const element of array.elements()) {\n\t\tconst name = IdentifierAst.cast(element.syntax)?.name();\n\t\tif (name !== void 0) {\n\t\t\tfields.push({\n\t\t\t\tname,\n\t\t\t\tdirection: void 0\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst call = FunctionCallAst.cast(element.syntax);\n\t\tconst path = PathExprAst.cast(element.syntax)?.path() ?? call?.path() ?? [];\n\t\tconst [callee] = path;\n\t\tif (path.length > 1 && (callee === void 0 || !ctx.compositeFields.has(callee))) return unsupported(attribute, `lists the dotted path \"${path.join(\".\")}\", but \"${callee ?? \"\"}\" is not a composite-type field of the model, and Prisma 6 refuses the path as an unknown field. List fields of the model by name.`, nodePslSpan(element.syntax, ctx.sources), ctx);\n\t\tif (path.length > 1) {\n\t\t\tctx.diagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_COMPOSITE_INDEX_PATH_UNSUPPORTED\", `Index path \"${path.join(\".\")}\" reaches into a composite type; indexes on composite-type fields are not supported yet. Index a top-level field or remove the index. Either change also reaches the Prisma 6 app, whose \\`db push\\` builds its indexes from this schema.`, ctx.sourceId, nodePslSpan(element.syntax, ctx.sources)));\n\t\t\treturn;\n\t\t}\n\t\tif (call === void 0 || callee === void 0) return unsupported(attribute, \"expects a list of field names.\", nodePslSpan(element.syntax, ctx.sources), ctx);\n\t\tconst sort = readSort(attribute, call.args(), ctx);\n\t\tif (sort === void 0) return void 0;\n\t\tfields.push({\n\t\t\tname: callee,\n\t\t\tdirection: sort.direction\n\t\t});\n\t}\n\treturn fields;\n}\n/** Reads `@@index`, `@@unique` or `@@fulltext`. `map:` and `name:` are dropped: MongoDB verify never compares index names. */\nfunction parseIndexAttribute(attribute, ctx) {\n\tlet fields;\n\tfor (const arg of attribute.args) {\n\t\tconst key = arg.kind === \"positional\" ? \"fields\" : arg.name;\n\t\tif (key === \"map\" || key === \"name\") continue;\n\t\tif (key !== \"fields\") return unsupported(attribute, `argument \"${key ?? \"\"}\" is not supported.`, arg.span, ctx);\n\t\tfields = readFields(attribute, arg.expression, arg.span, ctx);\n\t\tif (fields === void 0) return void 0;\n\t}\n\tif (fields === void 0 || fields.length === 0) return unsupported(attribute, \"expects a list of field names.\", attribute.span, ctx);\n\treturn {\n\t\tkind: attribute.name,\n\t\tfields,\n\t\tspan: attribute.span\n\t};\n}\n/** Reads a field's `@unique`: `sort:` sets the key direction; `map:` and `name:` are dropped. */\nfunction parseFieldUnique(attribute, fieldName, ctx) {\n\tlet direction;\n\tfor (const arg of attribute.args) {\n\t\tconst key = arg.kind === \"positional\" ? void 0 : arg.name;\n\t\tif (key === \"map\" || key === \"name\") continue;\n\t\tif (key === \"sort\") {\n\t\t\tdirection = sortDirection(arg.expression);\n\t\t\tif (direction === void 0) return unsupported(attribute, \"sort must be Asc or Desc.\", arg.span, ctx);\n\t\t\tcontinue;\n\t\t}\n\t\treturn unsupported(attribute, key === \"length\" ? \"argument \\\"length\\\" is not supported: a MongoDB index has no prefix length. Remove it; Prisma 6 ignores it on MongoDB.\" : `argument \"${key ?? \"\"}\" is not supported.`, arg.span, ctx);\n\t}\n\treturn {\n\t\tkind: \"unique\",\n\t\tfields: [{\n\t\t\tname: fieldName,\n\t\t\tdirection\n\t\t}],\n\t\tspan: attribute.span\n\t};\n}\n//#endregion\n//#region src/interpreter.ts\nconst SUMMARY = \"Prisma 6 MongoDB schema interpretation failed\";\nfunction stringArgument(attribute) {\n\tconst expression = (attribute.args.find((arg) => arg.kind === \"positional\") ?? attribute.args.find((arg) => arg.name === \"name\"))?.expression;\n\treturn expression === void 0 ? void 0 : StringLiteralExprAst.cast(expression.syntax)?.value();\n}\nfunction requireString(attribute, owner, sourceId, diagnostics) {\n\tconst value = stringArgument(attribute);\n\tif (value === void 0) diagnostics.push({\n\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\tmessage: `${owner}: attribute \"@${attribute.name}\" expects one string argument.`,\n\t\tsourceId,\n\t\tspan: attribute.span\n\t});\n\treturn value;\n}\nfunction attributeText(attribute) {\n\tconst args = attribute.args.map((arg) => arg.kind === \"named\" ? `${arg.name}: ${arg.value}` : arg.value);\n\treturn args.length === 0 ? `@${attribute.name}` : `@${attribute.name}(${args.join(\", \")})`;\n}\n/** `auto()` and `now()` with no arguments; any other `@default` value is `other`. */\nfunction defaultKind(attribute) {\n\tconst expression = attribute.args.find((arg) => arg.kind === \"positional\")?.expression;\n\tconst call = expression === void 0 ? void 0 : FunctionCallAst.cast(expression.syntax);\n\tif (call === void 0 || [...call.args()].length > 0) return \"other\";\n\tconst path = call.path().join(\".\");\n\treturn path === \"auto\" ? \"auto\" : path === \"now\" ? \"now\" : \"other\";\n}\nfunction unknownAttribute(owner, attribute, prefix, sourceId) {\n\treturn prisma6Diagnostic(\"PSL.PRISMA6_MONGO_UNKNOWN_ATTRIBUTE\", `${owner}: attribute \"${prefix}${attribute.name}\" is not supported by the Prisma 6 MongoDB contract source.`, sourceId, attribute.span);\n}\nfunction interpretPrisma6Documents(input) {\n\tconst { binding } = input;\n\tconst diagnostics = [...input.seedDiagnostics];\n\tconst datasources = [];\n\tconst enumBlocks = [];\n\tconst compositeTypes = [];\n\tconst models = [];\n\tconst ignoredModels = /* @__PURE__ */ new Set();\n\tconst declaredNames = /* @__PURE__ */ new Map();\n\tconst claimName = (kind, name, sourceId, span) => {\n\t\tconst previous = declaredNames.get(name);\n\t\tif (previous === void 0) {\n\t\t\tdeclaredNames.set(name, sourceId);\n\t\t\treturn true;\n\t\t}\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_DUPLICATE_DECLARATION\",\n\t\t\tmessage: `Duplicate declaration of ${kind} \"${name}\"; first declared in ${basename(previous)}.`,\n\t\t\tsourceId,\n\t\t\tspan\n\t\t});\n\t\treturn false;\n\t};\n\tfor (const { document, sources, sourceFile, sourceId } of input.documents) {\n\t\tconst { symbolTable, diagnostics: tableDiagnostics } = buildSymbolTable({\n\t\t\tdocuments: [document],\n\t\t\tsources\n\t\t});\n\t\tfor (const diagnostic of tableDiagnostics) diagnostics.push({\n\t\t\tcode: diagnostic.code,\n\t\t\tmessage: diagnostic.message,\n\t\t\tsourceId,\n\t\t\tspan: sourceFile.rangeToPslSpan(diagnostic.range)\n\t\t});\n\t\tconst unsupported = (keyword, span) => {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_UNSUPPORTED_TOP_LEVEL_BLOCK\",\n\t\t\t\tmessage: `Unsupported top-level block \"${keyword}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan\n\t\t\t});\n\t\t};\n\t\tconst unsupportedInclusions = (code, holders) => {\n\t\t\tfor (const holder of Object.values(holders)) for (const inclusion of holder.node.inclusions()) diagnostics.push({\n\t\t\t\tcode,\n\t\t\t\tmessage: `Unsupported mixin inclusion \"${printSyntax(inclusion.syntax).trim()}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: nodePslSpan(inclusion.syntax, sources)\n\t\t\t});\n\t\t};\n\t\tfor (const block of Object.values(symbolTable.topLevel.blocks)) switch (block.keyword) {\n\t\t\tcase \"datasource\":\n\t\t\t\tdatasources.push({\n\t\t\t\t\tsymbol: block,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tsources\n\t\t\t\t});\n\t\t\t\treportDottedBlockValues(block, sourceId, sources, diagnostics);\n\t\t\t\tbreak;\n\t\t\tcase \"generator\":\n\t\t\t\treportDottedBlockValues(block, sourceId, sources, diagnostics);\n\t\t\t\tbreak;\n\t\t\tcase \"enum\":\n\t\t\t\tif (claimName(\"enum\", block.name, sourceId, block.span)) enumBlocks.push({\n\t\t\t\t\tsymbol: block,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tsources\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"view\":\n\t\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_VIEW_UNSUPPORTED\", `View \"${block.name}\" is not supported; Prisma 8 has no views on MongoDB. Remove the view from the schema this contract source reads. The Prisma 6 client then loses the view's model too.`, sourceId, keywordPslSpan(block.node.syntax, block.keyword, sources)));\n\t\t\t\tbreak;\n\t\t\tdefault: unsupported(block.keyword, keywordPslSpan(block.node.syntax, block.keyword, sources));\n\t\t}\n\t\tfor (const namespace of Object.values(symbolTable.topLevel.namespaces)) for (const { span } of namespace.declarations) unsupported(\"namespace\", span);\n\t\tfor (const namedType of Object.values(symbolTable.topLevel.namedTypes)) unsupported(\"types\", namedType.span);\n\t\tfor (const mixin of Object.values(symbolTable.topLevel.mixins)) unsupported(`${mixin.keyword} mixin`, mixin.span);\n\t\tunsupportedInclusions(\"PSL_INVALID_MODEL_MEMBER\", symbolTable.topLevel.models);\n\t\tunsupportedInclusions(\"PSL_INVALID_MODEL_MEMBER\", symbolTable.topLevel.compositeTypes);\n\t\tunsupportedInclusions(\"PSL_INVALID_EXTENSION_BLOCK_MEMBER\", symbolTable.topLevel.blocks);\n\t\tfor (const symbol of Object.values(symbolTable.topLevel.compositeTypes)) if (claimName(\"type\", symbol.name, sourceId, symbol.span)) compositeTypes.push({\n\t\t\tsymbol,\n\t\t\tsourceId,\n\t\t\tsources\n\t\t});\n\t\tfor (const symbol of Object.values(symbolTable.topLevel.models)) {\n\t\t\tif (!claimName(\"model\", symbol.name, sourceId, symbol.span)) continue;\n\t\t\tif (symbol.attributes.some((attribute) => attribute.name === \"ignore\")) ignoredModels.add(symbol.name);\n\t\t\telse models.push({\n\t\t\t\tsymbol,\n\t\t\t\tsourceId,\n\t\t\t\tsources\n\t\t\t});\n\t\t}\n\t}\n\tconst providerMismatch = checkDatasource(datasources, input.documents[0]?.sourceId ?? \"schema.prisma\", binding);\n\tif (providerMismatch !== void 0) return notOk({\n\t\tsummary: SUMMARY,\n\t\tdiagnostics: inSourceOrder([...input.seedDiagnostics, providerMismatch], input.documents)\n\t});\n\tconst enums = /* @__PURE__ */ new Map();\n\tfor (const located of enumBlocks) {\n\t\tconst built = buildEnum(located, input, diagnostics);\n\t\tif (built !== void 0) enums.set(located.symbol.name, built);\n\t}\n\tconst modelNames = /* @__PURE__ */ new Set([...models.map((m) => m.symbol.name), ...ignoredModels]);\n\tconst compositeTypeNames = new Set(compositeTypes.map((c) => c.symbol.name));\n\tconst typeContext = {\n\t\tbinding,\n\t\tenums,\n\t\tenumNames: new Set(enumBlocks.map((located) => located.symbol.name)),\n\t\tcompositeTypeNames,\n\t\tdiagnostics\n\t};\n\tconst valueObjects = {};\n\tfor (const located of compositeTypes) valueObjects[located.symbol.name] = { fields: readCompositeFields(located, typeContext) };\n\tconst builds = /* @__PURE__ */ new Map();\n\tfor (const located of models) builds.set(located.symbol.name, readModel(located, modelNames, ignoredModels, typeContext));\n\tconst foreignKeys = [];\n\tconst invalidFkPairings = [];\n\tconst backRelations = [];\n\tfor (const build of builds.values()) readRelationFields(build, builds, {\n\t\tforeignKeys,\n\t\tinvalidFkPairings,\n\t\tbackRelations\n\t}, diagnostics);\n\tconst paired = pairMongoBackRelations({\n\t\tforeignKeys,\n\t\tcandidates: backRelations,\n\t\tinvalidFkPairings\n\t});\n\tdiagnostics.push(...mapPslDiagnostics(paired.diagnostics, mergedSources(input.documents)));\n\tfor (const { modelName, fieldName, relation } of paired.relations) {\n\t\tconst build = builds.get(modelName);\n\t\tif (build !== void 0) build.relations[fieldName] = relation;\n\t}\n\tconst collections = {};\n\tconst roots = {};\n\tconst executionDefaults = [];\n\tfor (const [modelName, build] of builds) {\n\t\tconst indexes = buildIndexes(build, diagnostics);\n\t\tconst existing = collections[build.collection];\n\t\tcollections[build.collection] = { indexes: [...existing?.indexes ?? [], ...indexes] };\n\t\troots[build.collection] = crossRef(modelName, UNBOUND_NAMESPACE_ID);\n\t\tfor (const { field, phases } of build.executionDefaults) executionDefaults.push({\n\t\t\tref: {\n\t\t\t\tnamespace: UNBOUND_NAMESPACE_ID,\n\t\t\t\tentry: build.collection,\n\t\t\t\tfield\n\t\t\t},\n\t\t\t...phases\n\t\t});\n\t\tif (!build.hasId) diagnostics.push({\n\t\t\tcode: \"PSL_MISSING_ID_FIELD\",\n\t\t\tmessage: `Model \"${modelName}\" has no field with @id attribute. Every model must have exactly one @id field.`,\n\t\t\tsourceId: build.located.sourceId,\n\t\t\tspan: build.located.symbol.span\n\t\t});\n\t}\n\tif (diagnostics.length > 0) return notOk({\n\t\tsummary: SUMMARY,\n\t\tdiagnostics: inSourceOrder(diagnostics, input.documents)\n\t});\n\treturn ok(assembleContract({\n\t\tbinding,\n\t\tbuilds,\n\t\tcollections,\n\t\troots,\n\t\tvalueObjects,\n\t\tenums,\n\t\texecutionDefaults\n\t}));\n}\n/**\n* Diagnostics by file, in the order the schema files were read, then by position; one with no position comes first in its file.\n*/\nfunction inSourceOrder(diagnostics, documents) {\n\tconst fileOrder = new Map(documents.map((document, index) => [document.sourceId, index]));\n\tconst fileRank = (diagnostic) => fileOrder.get(diagnostic.sourceId) ?? documents.length;\n\tconst offset = (diagnostic) => diagnostic.span?.start.offset ?? -1;\n\treturn [...diagnostics].sort((a, b) => fileRank(a) - fileRank(b) || offset(a) - offset(b));\n}\n/** Prisma 6 accepts no dotted path in a datasource or generator block, though the parser reads one as a value. */\nfunction reportDottedBlockValues(block, sourceId, sources, diagnostics) {\n\tfor (const entry of block.entries) {\n\t\tconst value = entry.value();\n\t\tif (value === void 0) continue;\n\t\tfor (const path of dottedPathsIn(value)) diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_EXTENSION_BLOCK_MEMBER\",\n\t\t\tmessage: `${block.keyword} \"${block.name}\": the value of \"${entry.key()?.name() ?? \"\"}\" holds the dotted path ${path.path().join(\".\")}, which Prisma 6 does not accept in a ${block.keyword} block.`,\n\t\t\tsourceId,\n\t\t\tspan: nodePslSpan(path.syntax, sources)\n\t\t});\n\t}\n}\n/** The provider-mismatch diagnostic, or `undefined` when the schema names a provider the target reads. */\nfunction checkDatasource(datasources, fallbackSourceId, binding) {\n\tconst [datasource] = datasources;\n\tconst [namedProvider] = binding.providers;\n\tif (datasource === void 0) return prisma6Diagnostic(\"PSL.PRISMA6_MONGO_PROVIDER_MISMATCH\", `No datasource block found; add \\`datasource db { provider = \"${namedProvider}\" }\\`.`, fallbackSourceId, void 0);\n\tconst block = datasource.symbol;\n\tlet parameter;\n\tfor (const entry of block.entries) if (entry.key()?.name() === \"provider\") {\n\t\tparameter = entry;\n\t\tbreak;\n\t}\n\tconst expression = parameter?.value();\n\tconst provider = expression instanceof StringLiteralExprAst ? expression.value() : void 0;\n\tif (provider !== void 0 && binding.providers.includes(provider)) return void 0;\n\treturn prisma6Diagnostic(\"PSL.PRISMA6_MONGO_PROVIDER_MISMATCH\", provider === void 0 ? `The datasource block declares no string \\`provider\\`; this contract source reads Prisma 6 schemas for provider \"${namedProvider}\".` : `The datasource provider is \"${provider}\"; this contract source reads Prisma 6 schemas for provider \"${namedProvider}\".`, datasource.sourceId, parameter === void 0 ? block.span : nodePslSpan(parameter.syntax, datasource.sources));\n}\nfunction buildEnum(located, input, diagnostics) {\n\tconst { symbol: block, sourceId, sources } = located;\n\tfor (const attribute of block.attributes) {\n\t\tif (attribute.name === \"map\") continue;\n\t\tif (attribute.name === \"schema\") {\n\t\t\tdiagnostics.push(schemaUnsupported(`Enum \"${block.name}\"`, attribute, sourceId));\n\t\t\tcontinue;\n\t\t}\n\t\tdiagnostics.push(unknownAttribute(`Enum \"${block.name}\"`, attribute, \"@@\", sourceId));\n\t}\n\tconst values = Object.create(null);\n\tconst parameterSpans = Object.create(null);\n\tfor (const entry of block.entries) {\n\t\tconst name = entry.key()?.name();\n\t\tif (name === void 0) continue;\n\t\tlet value = name;\n\t\tfor (const attributeNode of entry.attributes()) {\n\t\t\tconst attribute = readResolvedAttribute(attributeNode, sources);\n\t\t\tif (attribute.name === \"map\") value = requireString(attribute, `Enum member \"${block.name}.${name}\"`, sourceId, diagnostics) ?? value;\n\t\t\telse diagnostics.push(unknownAttribute(`Enum member \"${block.name}.${name}\"`, attribute, \"@\", sourceId));\n\t\t}\n\t\tvalues[name] = value;\n\t\tparameterSpans[name] = nodePslSpan(entry.syntax, sources);\n\t}\n\tconst descriptor = input.authoringContributions.entityTypes[\"enum\"];\n\tif (descriptor === void 0 || !isAuthoringEntityTypeDescriptor(descriptor)) {\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_ENUM_MISSING_FACTORY\",\n\t\t\tmessage: `enum \"${block.name}\" requires an \"enum\" entityType factory in the active authoring contributions`,\n\t\t\tsourceId,\n\t\t\tspan: block.span\n\t\t});\n\t\treturn;\n\t}\n\tconst context = {\n\t\tfamily: input.binding.target.familyId,\n\t\ttarget: input.binding.target.targetId,\n\t\tcodecLookup: input.codecLookup,\n\t\tdataTypeLookup: input.dataTypes.lookup,\n\t\tsourceId,\n\t\tenumInferenceCodecs: {\n\t\t\ttext: input.binding.scalarCodecIds.String,\n\t\t\tint: input.binding.scalarCodecIds.Int\n\t\t},\n\t\tdiagnostics: { push: (diagnostic) => {\n\t\t\tdiagnostics.push(blindCast(diagnostic));\n\t\t} }\n\t};\n\tconst handle = instantiateAuthoringEntityType(\"enum\", descriptor, [{\n\t\tkind: \"enum\",\n\t\tkeyword: \"enum\",\n\t\tname: block.name,\n\t\tvalues,\n\t\tparameterSpans,\n\t\tattributes: {},\n\t\tspan: block.span\n\t}], context);\n\tif (handle === void 0 || handle === null) return void 0;\n\tconst encoded = encodeEnumMembers(handle, input.codecLookup);\n\tif (!encoded.ok) {\n\t\tconst site = {\n\t\t\tenumName: block.name,\n\t\t\tcodecId: handle.codecId,\n\t\t\tsourceId,\n\t\t\tspan: block.span,\n\t\t\tmemberSpans: parameterSpans\n\t\t};\n\t\tdiagnostics.push(...encoded.failure.map((problem) => enumMemberProblemDiagnostic(problem, site)));\n\t\treturn;\n\t}\n\treturn {\n\t\tcodecId: handle.codecId,\n\t\tmembers: encoded.value\n\t};\n}\nfunction schemaUnsupported(owner, attribute, sourceId) {\n\treturn prisma6Diagnostic(\"PSL.PRISMA6_MONGO_SCHEMA_UNSUPPORTED\", `${owner}: \"@@schema\" is not supported; a MongoDB contract has one database, bound by the connection string. Remove @@schema.`, sourceId, attribute.span);\n}\nfunction unsupportedTypeMessage(label, typeName, owner) {\n\tconst base = `${label} has type \"${typeName}(...)\", which has no Prisma 8 codec, so ${`${owner.kind} \"${owner.name}\"`} cannot use this contract source while it has the field. Prisma 6 rejects @ignore on an Unsupported field. Removing the field from the schema leaves its stored values in the documents, but the Prisma 6 client no longer reads or writes them.`;\n\tif (owner.kind === \"type\") return base;\n\treturn `${base} Adding @@ignore to model \"${owner.name}\" keeps the model out of the contract, but the model disappears from the Prisma 6 client too, and every relation field in another model that points to it needs @ignore, which removes that field from the Prisma 6 client as well.`;\n}\n/** The native types Prisma 6 accepts on each MongoDB scalar, checked with Prisma 6.19. */\nconst PRISMA6_NATIVE_TYPES = {\n\tString: [\"db.String\", \"db.ObjectId\"],\n\tBoolean: [\"db.Bool\"],\n\tInt: [\"db.Int\", \"db.Long\"],\n\tBigInt: [\"db.Long\"],\n\tFloat: [\"db.Double\"],\n\tDateTime: [\"db.Date\", \"db.Timestamp\"],\n\tBytes: [\"db.BinData\", \"db.ObjectId\"],\n\tJson: [\"db.Json\"]\n};\n/** The BSON type Prisma 6 stores for each native type. */\nconst PRISMA6_NATIVE_TYPE_BSON = {\n\t\"db.String\": \"string\",\n\t\"db.ObjectId\": \"objectId\",\n\t\"db.Bool\": \"bool\",\n\t\"db.Int\": \"int\",\n\t\"db.Long\": \"long\",\n\t\"db.Double\": \"double\",\n\t\"db.Date\": \"date\",\n\t\"db.Timestamp\": \"timestamp\",\n\t\"db.BinData\": \"binData\",\n\t\"db.Json\": \"object\"\n};\n/** The BSON type Prisma 6 stores for each MongoDB scalar that has no native type. `Int` is a long. */\nconst PRISMA6_SCALAR_BSON = {\n\tString: \"string\",\n\tBoolean: \"bool\",\n\tInt: \"long\",\n\tBigInt: \"long\",\n\tFloat: \"double\",\n\tDateTime: \"date\",\n\tBytes: \"binData\",\n\tJson: \"object\"\n};\nfunction withArticle(typeName) {\n\treturn `${/^[AEIOU]/.test(typeName) ? \"an\" : \"a\"} ${typeName}`;\n}\nfunction acceptedByPrisma6(nativeType, typeName) {\n\treturn (Object.hasOwn(PRISMA6_NATIVE_TYPES, typeName) ? PRISMA6_NATIVE_TYPES[typeName] : void 0)?.includes(nativeType) === true;\n}\n/** Why the reader refuses a native type, and what removing it does to the Prisma 6 app. */\nfunction nativeTypeRefusal(label, nativeType, typeName) {\n\tconst refused = `${label}: native type \"@${nativeType}\" is not supported`;\n\tif (!acceptedByPrisma6(nativeType, typeName)) return `${refused}, and Prisma 6 does not accept it on ${withArticle(typeName)} field either. Remove it.`;\n\tconst declared = PRISMA6_NATIVE_TYPE_BSON[nativeType];\n\tconst plain = PRISMA6_SCALAR_BSON[typeName];\n\treturn `${refused}: Prisma 6 stores it as a BSON ${declared}, and Prisma 8 has no codec for that BSON type. Remove it; this also changes the Prisma 6 app: its client then stores new ${typeName} values as BSON ${plain} instead of ${declared}. Documents already stored keep their ${declared} values, so rewrite them as ${plain}s before Prisma 8 reads them.`;\n}\nfunction nativeTypeCodecId(binding, typeName, nativeType) {\n\tconst forType = Object.hasOwn(binding.nativeTypeCodecIds, typeName) ? binding.nativeTypeCodecIds[typeName] : void 0;\n\treturn forType !== void 0 && Object.hasOwn(forType, nativeType) ? forType[nativeType] : void 0;\n}\n/** The field's contract type, or `undefined` after reporting why it has none. */\nfunction resolveFieldType(field, owner, nativeType, sourceId, ctx) {\n\tconst { binding, diagnostics } = ctx;\n\tconst label = `Field \"${owner.name}.${field.name}\"`;\n\tif (field.typeConstructor !== void 0) {\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_UNSUPPORTED_TYPE\", unsupportedTypeMessage(label, field.typeConstructor.path.join(\".\"), owner), sourceId, field.typeConstructor.span));\n\t\treturn;\n\t}\n\tconst nativeTypeUnsupported = (attribute) => {\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_NATIVE_TYPE_UNSUPPORTED\", nativeTypeRefusal(label, attribute.name, field.typeName), sourceId, attribute.span));\n\t};\n\tconst many = { many: field.list ? { elementNullable: false } : false };\n\tif (ctx.compositeTypeNames.has(field.typeName)) {\n\t\tif (nativeType !== void 0) return nativeTypeUnsupported(nativeType);\n\t\treturn {\n\t\t\ttype: {\n\t\t\t\tkind: \"valueObject\",\n\t\t\t\tname: field.typeName\n\t\t\t},\n\t\t\tnullable: field.optional,\n\t\t\t...many\n\t\t};\n\t}\n\tconst enumBuild = ctx.enums.get(field.typeName);\n\tif (enumBuild !== void 0) {\n\t\tif (nativeType !== void 0) return nativeTypeUnsupported(nativeType);\n\t\tconst valueSet = {\n\t\t\tplane: \"domain\",\n\t\t\tentityKind: \"enum\",\n\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\tentityName: field.typeName\n\t\t};\n\t\treturn {\n\t\t\ttype: {\n\t\t\t\tkind: \"scalar\",\n\t\t\t\tcodecId: enumBuild.codecId\n\t\t\t},\n\t\t\tnullable: field.optional,\n\t\t\tvalueSet,\n\t\t\t...many\n\t\t};\n\t}\n\tif (ctx.enumNames.has(field.typeName)) return nativeType === void 0 ? void 0 : nativeTypeUnsupported(nativeType);\n\tconst scalarCodecId = Object.hasOwn(binding.scalarCodecIds, field.typeName) ? binding.scalarCodecIds[field.typeName] : void 0;\n\tif (scalarCodecId === void 0) {\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_UNSUPPORTED_TYPE\", `${label} has unknown type \"${field.typeName}\": it is not a scalar type, an enum, a composite type, or a model. Correct the type name.`, sourceId, field.span));\n\t\treturn;\n\t}\n\tlet codecId = scalarCodecId;\n\tif (nativeType !== void 0) {\n\t\tconst nativeCodecId = nativeTypeCodecId(binding, field.typeName, nativeType.name);\n\t\tif (nativeCodecId === void 0) return nativeTypeUnsupported(nativeType);\n\t\tcodecId = nativeCodecId;\n\t}\n\treturn {\n\t\ttype: {\n\t\t\tkind: \"scalar\",\n\t\t\tcodecId\n\t\t},\n\t\tnullable: field.optional,\n\t\t...many\n\t};\n}\nfunction readCompositeFields(located, ctx) {\n\tconst { symbol, sourceId } = located;\n\tfor (const attribute of symbol.attributes) ctx.diagnostics.push(unknownAttribute(`Type \"${symbol.name}\"`, attribute, \"@@\", sourceId));\n\tconst fields = {};\n\tfor (const field of Object.values(symbol.fields)) {\n\t\tif (field.malformedType) continue;\n\t\tconst label = `Field \"${symbol.name}.${field.name}\"`;\n\t\tlet nativeType;\n\t\tlet rejected = false;\n\t\tfor (const attribute of field.attributes) if (attribute.name.startsWith(\"db.\")) nativeType = attribute;\n\t\telse if (attribute.name === \"map\") {\n\t\t\tctx.diagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_COMPOSITE_MAP_UNSUPPORTED\", `${label}: @map on a field of a composite type is not supported yet. The stored field keeps the name \"${stringArgument(attribute) ?? field.name}\", so removing @map renames it in storage; keep the schema as it is until Prisma 8 supports it.`, sourceId, attribute.span));\n\t\t\trejected = true;\n\t\t} else if (attribute.name === \"default\") {\n\t\t\tctx.diagnostics.push(defaultUnsupported(label, attribute, {\n\t\t\t\tkind: \"type\",\n\t\t\t\tname: symbol.name\n\t\t\t}, field, sourceId));\n\t\t\trejected = true;\n\t\t} else {\n\t\t\tctx.diagnostics.push(unknownAttribute(label, attribute, \"@\", sourceId));\n\t\t\trejected = true;\n\t\t}\n\t\tif (rejected) continue;\n\t\tconst resolved = resolveFieldType(field, {\n\t\t\tkind: \"type\",\n\t\t\tname: symbol.name\n\t\t}, nativeType, sourceId, ctx);\n\t\tif (resolved !== void 0) fields[field.name] = resolved;\n\t}\n\treturn fields;\n}\n/** What the Prisma 6 app loses when the Prisma 6 client stops filling a default. */\nfunction defaultRemovalConsequence(owner, field) {\n\tif (field.optional || field.list) return owner.kind === \"model\" ? `a Prisma 6 create call that leaves \"${field.name}\" out no longer gets the default value` : `a \"${owner.name}\" value written without \"${field.name}\" no longer gets the default value`;\n\treturn owner.kind === \"model\" ? `every Prisma 6 create call must then pass \"${field.name}\"` : `every \"${owner.name}\" value the Prisma 6 app writes must then include \"${field.name}\"`;\n}\nfunction defaultUnsupported(label, attribute, owner, field, sourceId) {\n\treturn prisma6Diagnostic(\"PSL.PRISMA6_MONGO_DEFAULT_UNSUPPORTED\", `${label}: ${attributeText(attribute)} is not supported. MongoDB has no stored defaults, and Prisma 8 fills only \\`now()\\` on DateTime fields. The Prisma 6 client fills this default today, so removing it also changes the Prisma 6 app: ${defaultRemovalConsequence(owner, field)}. Set the value in the application code that creates documents, then remove the default.`, sourceId, attribute.span);\n}\nfunction readModel(located, modelNames, ignoredModels, ctx) {\n\tconst { symbol, sourceId, sources } = located;\n\tconst { diagnostics } = ctx;\n\tconst modelLabel = `Model \"${symbol.name}\"`;\n\tlet collection = symbol.name;\n\tconst build = {\n\t\tlocated,\n\t\tcollection: symbol.name,\n\t\tstoredNames: /* @__PURE__ */ new Map(),\n\t\tignoredFields: /* @__PURE__ */ new Set(),\n\t\trejectedFields: /* @__PURE__ */ new Set(),\n\t\tfields: {},\n\t\trelations: {},\n\t\texecutionDefaults: [],\n\t\tuniqueFields: [],\n\t\tmodelIndexes: [],\n\t\trelationFields: [],\n\t\thasId: false\n\t};\n\tconst indexContext = {\n\t\towner: modelLabel,\n\t\tprefix: \"@@\",\n\t\tsourceId,\n\t\tsources,\n\t\tdiagnostics,\n\t\tcompositeFields: new Set(Object.values(symbol.fields).filter((field) => ctx.compositeTypeNames.has(field.typeName)).map((field) => field.name))\n\t};\n\tfor (const attribute of symbol.attributes) switch (attribute.name) {\n\t\tcase \"map\":\n\t\t\tcollection = requireString(attribute, modelLabel, sourceId, diagnostics) ?? collection;\n\t\t\tbreak;\n\t\tcase \"index\":\n\t\tcase \"unique\":\n\t\tcase \"fulltext\": {\n\t\t\tconst parsed = parseIndexAttribute({\n\t\t\t\t...attribute,\n\t\t\t\tname: attribute.name\n\t\t\t}, indexContext);\n\t\t\tif (parsed !== void 0) build.modelIndexes.push(parsed);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"id\":\n\t\t\tbuild.hasId = true;\n\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_COMPOSITE_ID_UNSUPPORTED\", `${modelLabel}: @@id is not supported; a MongoDB document is identified by its \"_id\" field. Declare the id as \\`id String @id @default(auto()) @map(\"_id\") @db.ObjectId\\`.`, sourceId, attribute.span));\n\t\t\tbreak;\n\t\tcase \"schema\":\n\t\t\tdiagnostics.push(schemaUnsupported(modelLabel, attribute, sourceId));\n\t\t\tbreak;\n\t\tcase \"ignore\": break;\n\t\tdefault: diagnostics.push(unknownAttribute(modelLabel, attribute, \"@@\", sourceId));\n\t}\n\tfor (const field of Object.values(symbol.fields)) {\n\t\tconst reported = diagnostics.length;\n\t\treadModelField(field, build, modelNames, ignoredModels, ctx);\n\t\tif (diagnostics.length > reported) build.rejectedFields.add(field.name);\n\t}\n\treturn {\n\t\t...build,\n\t\tcollection\n\t};\n}\nfunction readModelField(field, build, modelNames, ignoredModels, ctx) {\n\tconst { symbol, sourceId, sources } = build.located;\n\tconst { diagnostics, binding } = ctx;\n\tconst label = `Field \"${symbol.name}.${field.name}\"`;\n\tconst isRelationField = modelNames.has(field.typeName) && field.typeConstructor === void 0;\n\tif (field.attributes.some((attribute) => attribute.name === \"ignore\")) {\n\t\tbuild.ignoredFields.add(field.name);\n\t\tconst unique = field.attributes.find((attribute) => attribute.name === \"unique\");\n\t\tif (unique !== void 0) diagnostics.push(ignoredFieldReferenced(symbol.name, [field.name], {\n\t\t\tkind: \"index\",\n\t\t\ttext: `@unique on field \"${symbol.name}.${field.name}\"`\n\t\t}, sourceId, unique.span));\n\t\treturn;\n\t}\n\tif (isRelationField) {\n\t\tif (ignoredModels.has(field.typeName)) return;\n\t\tlet relation;\n\t\tfor (const attribute of field.attributes) if (attribute.name === \"relation\") relation = attribute;\n\t\telse diagnostics.push(unknownAttribute(label, attribute, \"@\", sourceId));\n\t\tbuild.relationFields.push({\n\t\t\tfield,\n\t\t\trelation\n\t\t});\n\t\treturn;\n\t}\n\tlet storedName = field.name;\n\tlet nativeType;\n\tlet idAttribute;\n\tlet defaultAttribute;\n\tlet updatedAt;\n\tfor (const attribute of field.attributes) switch (attribute.name) {\n\t\tcase \"map\":\n\t\t\tstoredName = requireString(attribute, label, sourceId, diagnostics) ?? storedName;\n\t\t\tbreak;\n\t\tcase \"id\":\n\t\t\tidAttribute = attribute;\n\t\t\tbreak;\n\t\tcase \"default\":\n\t\t\tdefaultAttribute = attribute;\n\t\t\tbreak;\n\t\tcase \"updatedAt\":\n\t\t\tupdatedAt = attribute;\n\t\t\tbreak;\n\t\tcase \"unique\": {\n\t\t\tconst parsed = parseFieldUnique(attribute, field.name, {\n\t\t\t\towner: label,\n\t\t\t\tprefix: \"@\",\n\t\t\t\tsourceId,\n\t\t\t\tsources,\n\t\t\t\tdiagnostics,\n\t\t\t\tcompositeFields: /* @__PURE__ */ new Set()\n\t\t\t});\n\t\t\tif (parsed !== void 0) build.uniqueFields.push(parsed);\n\t\t\tbreak;\n\t\t}\n\t\tdefault: if (attribute.name.startsWith(\"db.\")) nativeType = attribute;\n\t\telse diagnostics.push(unknownAttribute(label, attribute, \"@\", sourceId));\n\t}\n\tbuild.storedNames.set(field.name, storedName);\n\tif (field.malformedType) return;\n\tconst owner = {\n\t\tkind: \"model\",\n\t\tname: symbol.name\n\t};\n\tconst resolved = resolveFieldType(field, owner, nativeType, sourceId, ctx);\n\tif (resolved === void 0) return;\n\tconst codecId = resolved.type.kind === \"scalar\" ? resolved.type.codecId : void 0;\n\tif (idAttribute !== void 0) {\n\t\tbuild.hasId = true;\n\t\tif (codecId !== binding.objectIdCodecId || storedName !== \"_id\" || field.optional || field.list) {\n\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_ID_NOT_OBJECTID\", `${label} is the model's @id, but it is not a required ObjectId stored as \"_id\". Prisma 8 identifies a MongoDB document by an ObjectId \"_id\"; declare the id as \\`${field.name} String @id @default(auto()) @map(\"_id\") @db.ObjectId\\`. If stored documents have \"_id\" values that are not ObjectIds, this model cannot use this contract source until they are rewritten with ObjectId \"_id\" values, along with every field that refers to them.`, sourceId, idAttribute.span));\n\t\t\treturn;\n\t\t}\n\t\tif (defaultAttribute !== void 0 && defaultKind(defaultAttribute) !== \"auto\") {\n\t\t\tdiagnostics.push(defaultUnsupported(label, defaultAttribute, owner, field, sourceId));\n\t\t\treturn;\n\t\t}\n\t\tbuild.fields[storedName] = resolved;\n\t\treturn;\n\t}\n\tconst isDateTime = codecId === binding.scalarCodecIds.DateTime && !field.list;\n\tif (updatedAt !== void 0 && !isDateTime) {\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_UPDATED_AT_TYPE_UNSUPPORTED\", `${label}: @updatedAt is only supported on a DateTime field. Removing it also stops the Prisma 6 client from setting the field on every update. Set the value in application code when you write documents, then remove @updatedAt.`, sourceId, updatedAt.span));\n\t\treturn;\n\t}\n\tconst defaultIsNow = defaultAttribute !== void 0 && defaultKind(defaultAttribute) === \"now\";\n\tif (defaultAttribute !== void 0 && (!defaultIsNow || !isDateTime)) {\n\t\tdiagnostics.push(defaultUnsupported(label, defaultAttribute, owner, field, sourceId));\n\t\treturn;\n\t}\n\tconst generator = {\n\t\tkind: \"generator\",\n\t\tid: binding.timestampGeneratorId\n\t};\n\tconst phases = updatedAt !== void 0 ? {\n\t\tonCreate: generator,\n\t\tonUpdate: generator\n\t} : defaultIsNow ? { onCreate: generator } : void 0;\n\tif (phases !== void 0 && field.optional) {\n\t\tconst written = updatedAt ?? defaultAttribute;\n\t\tconst generator = written === void 0 ? \"the generator\" : attributeText(written);\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_OPTIONAL_GENERATED_FIELD_UNSUPPORTED\", `${label} is optional and its value comes from ${generator}, which Prisma 8 cannot express on an optional field yet. Either fix also changes the Prisma 6 app: a required field makes the Prisma 6 client fail on a stored document that lacks it, and without ${generator} the Prisma 6 client no longer fills it. Make the field required once every stored document has a value, or set the value in application code and remove ${generator}.`, sourceId, written?.span ?? field.span));\n\t\treturn;\n\t}\n\tbuild.fields[storedName] = resolved;\n\tif (phases !== void 0) build.executionDefaults.push({\n\t\tfield: storedName,\n\t\tphases\n\t});\n}\nfunction identifierList(attributeArg) {\n\tconst expression = attributeArg.expression;\n\tconst array = expression === void 0 ? void 0 : ArrayLiteralAst.cast(expression.syntax);\n\tif (array === void 0) return void 0;\n\tconst names = [];\n\tfor (const element of array.elements()) {\n\t\tconst name = IdentifierAst.cast(element.syntax)?.name();\n\t\tif (name === void 0) return void 0;\n\t\tnames.push(name);\n\t}\n\treturn names;\n}\n/**\n* What removing `onDelete` or `onUpdate` does to the Prisma 6 app. The Prisma 6 client emulates referential actions on MongoDB with these defaults: `onDelete` is `Restrict` on a required relation (a delete fails with P2014) and `SetNull` on an optional one, and `onUpdate` is `Cascade`.\n*/\nfunction referentialActionRemoval(key, declared, sides) {\n\tconst fallback = key === \"onUpdate\" ? {\n\t\taction: \"Cascade\",\n\t\twhen: \"its default\",\n\t\teffect: `changing the field a ${sides.model} refers to in a ${sides.target} updates the key in its ${sides.model} documents`\n\t} : sides.optional ? {\n\t\taction: \"SetNull\",\n\t\twhen: \"its default for an optional relation\",\n\t\teffect: `deleting a ${sides.target} sets the key to null in its ${sides.model} documents`\n\t} : {\n\t\taction: \"Restrict\",\n\t\twhen: \"its default for a required relation\",\n\t\teffect: `deleting a ${sides.target} that still has ${sides.model} documents fails with P2014`\n\t};\n\tif (declared === fallback.action) return `Removing \"${key}: ${declared}\" leaves the Prisma 6 app as it is: ${declared} is already what the Prisma 6 client does for this relation.`;\n\treturn `The Prisma 6 client emulates referential actions, so removing \"${key}: ${declared}\" also changes the Prisma 6 app: its client then applies ${fallback.action}, ${fallback.when}, so ${fallback.effect}.`;\n}\nfunction readRelationArguments(attribute, label, sides, sourceId, diagnostics) {\n\tlet name;\n\tlet fields;\n\tlet references;\n\tlet rejected = false;\n\tconst invalid = (what, span) => {\n\t\trejected = true;\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\tmessage: `${label}: @relation ${what}.`,\n\t\t\tsourceId,\n\t\t\tspan\n\t\t});\n\t};\n\tfor (const arg of attribute.args) {\n\t\tconst key = arg.kind === \"positional\" ? \"name\" : arg.name;\n\t\tswitch (key) {\n\t\t\tcase \"name\": {\n\t\t\t\tconst expression = arg.expression;\n\t\t\t\tname = expression === void 0 ? void 0 : StringLiteralExprAst.cast(expression.syntax)?.value();\n\t\t\t\tif (name === void 0) invalid(\"name must be a string\", arg.span);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"fields\":\n\t\t\t\tfields = identifierList(arg);\n\t\t\t\tif (fields === void 0) invalid(\"fields must be a list of field names\", arg.span);\n\t\t\t\tbreak;\n\t\t\tcase \"references\":\n\t\t\t\treferences = identifierList(arg);\n\t\t\t\tif (references === void 0) invalid(\"references must be a list of field names\", arg.span);\n\t\t\t\tbreak;\n\t\t\tcase \"onDelete\":\n\t\t\tcase \"onUpdate\":\n\t\t\tcase \"map\":\n\t\t\t\trejected = true;\n\t\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_REFERENTIAL_ACTION_UNSUPPORTED\", key === \"map\" ? `${label}: @relation argument \"map\" is not supported; it names a foreign key constraint, and MongoDB has none. Remove \"map\"; the Prisma 6 app has no foreign key on MongoDB either, so nothing changes there.` : `${label}: @relation argument \"${key}\" is not supported; Prisma 8 enforces no referential actions on MongoDB. ${referentialActionRemoval(key, arg.value, sides)} Handle related documents in application code, then remove \"${key}\".`, sourceId, arg.span));\n\t\t\t\tbreak;\n\t\t\tdefault: invalid(`argument \"${key ?? \"\"}\" is not supported`, arg.span);\n\t\t}\n\t}\n\treturn rejected ? void 0 : {\n\t\tname,\n\t\tfields,\n\t\treferences\n\t};\n}\nfunction ignoredFieldReferenced(modelName, fieldNames, usedBy, sourceId, span) {\n\tconst one = fieldNames.length === 1;\n\tconst fields = fieldNames.map((name) => `\"${modelName}.${name}\"`).join(\", \");\n\tconst removal = usedBy.kind === \"index\" ? \"which makes Prisma 6 `db push` drop the index\" : \"which removes that relation from the Prisma 6 client\";\n\treturn prisma6Diagnostic(\"PSL.PRISMA6_MONGO_IGNORED_FIELD_REFERENCED\", `${one ? \"Field\" : \"Fields\"} ${fields} ${one ? \"is\" : \"are\"} marked @ignore, but ${usedBy.text} uses ${one ? \"it\" : \"them\"}. Remove @ignore from ${fields}, which adds ${one ? \"it\" : \"them\"} to the Prisma 6 client, or remove ${usedBy.text}, ${removal}.`, sourceId, span);\n}\nfunction readRelationFields(build, builds, out, diagnostics) {\n\tconst { symbol, sourceId, sources } = build.located;\n\tfor (const { field, relation } of build.relationFields) {\n\t\tconst label = `Relation field \"${symbol.name}.${field.name}\"`;\n\t\tconst reject = () => {\n\t\t\tout.invalidFkPairings.push({\n\t\t\t\tpairKey: fkRelationPairKey(symbol.name, field.typeName),\n\t\t\t\t...ifDefined(\"relationName\", relation === void 0 ? void 0 : stringArgument(relation))\n\t\t\t});\n\t\t};\n\t\tconst args = relation === void 0 ? void 0 : readRelationArguments(relation, label, {\n\t\t\tmodel: symbol.name,\n\t\t\ttarget: field.typeName,\n\t\t\toptional: field.optional\n\t\t}, sourceId, diagnostics);\n\t\tif (relation !== void 0 && args === void 0) {\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tconst target = builds.get(field.typeName);\n\t\tif (target === void 0) continue;\n\t\tif (!(args?.fields !== void 0 || args?.references !== void 0)) {\n\t\t\tout.backRelations.push({\n\t\t\t\tmodelName: symbol.name,\n\t\t\t\tfield,\n\t\t\t\ttargetModelName: field.typeName,\n\t\t\t\t...ifDefined(\"relationName\", args?.name),\n\t\t\t\tcardinality: field.list ? \"1:N\" : \"1:1\",\n\t\t\t\tsources\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (field.list) {\n\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_LIST_RELATION_UNSUPPORTED\", `${label} is a list relation that stores its keys in a list field (a many-to-many relation on MongoDB), which Prisma 8 does not support yet. Remove the relation fields from the schema this contract source reads and keep the key list as a plain field. The Prisma 6 client then loses the relation fields too, so Prisma 6 code that reads or writes the relation through them (\\`include\\`, \\`connect\\`) has to use the key list instead.`, sourceId, relation?.span ?? field.span));\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tconst localNames = args?.fields ?? [];\n\t\tconst targetNames = args?.references ?? [];\n\t\tconst ignoredLocal = localNames.filter((name) => build.ignoredFields.has(name));\n\t\tif (ignoredLocal.length > 0) {\n\t\t\tdiagnostics.push(ignoredFieldReferenced(symbol.name, ignoredLocal, {\n\t\t\t\tkind: \"relation\",\n\t\t\t\ttext: `relation field \"${symbol.name}.${field.name}\"`\n\t\t\t}, sourceId, relation?.span ?? field.span));\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tconst ignoredTarget = targetNames.filter((name) => target.ignoredFields.has(name));\n\t\tif (ignoredTarget.length > 0) {\n\t\t\tdiagnostics.push(ignoredFieldReferenced(target.located.symbol.name, ignoredTarget, {\n\t\t\t\tkind: \"relation\",\n\t\t\t\ttext: `relation field \"${symbol.name}.${field.name}\"`\n\t\t\t}, sourceId, relation?.span ?? field.span));\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tconst localFields = localNames.map((name) => build.storedNames.get(name));\n\t\tconst targetFields = targetNames.map((name) => target.storedNames.get(name));\n\t\tif (localFields.some((name) => name === void 0) || targetFields.some((name) => name === void 0) || localNames.length !== targetNames.length || localNames.length === 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\t\tmessage: `${label}: @relation fields and references must name the same number of scalar fields of \"${symbol.name}\" and \"${field.typeName}\".`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: relation?.span ?? field.span\n\t\t\t});\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tif (resolveToOneRelationNullable({\n\t\t\tdeclaredNullable: field.optional,\n\t\t\tlocalFieldNullability: localNames.map((name) => symbol.fields[name]?.optional === true),\n\t\t\townsReference: true\n\t\t}).contradiction !== void 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_RELATION_NULLABILITY_MISMATCH\",\n\t\t\t\tmessage: field.optional ? `${label} is optional but every field in @relation(fields: [...]) is required. Make one of those fields optional with \"?\" or remove \"?\" from \"${field.name}\".` : `${label} is required but a field in @relation(fields: [...]) is optional. Add \"?\" to \"${field.name}\" or make those fields required.`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: field.span\n\t\t\t});\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tconst local = localFields.filter((name) => name !== void 0);\n\t\tconst referenced = targetFields.filter((name) => name !== void 0);\n\t\tbuild.relations[field.name] = {\n\t\t\tto: crossRef(field.typeName, UNBOUND_NAMESPACE_ID),\n\t\t\tcardinality: \"N:1\",\n\t\t\tnullable: field.optional,\n\t\t\ton: {\n\t\t\t\tlocalFields: local,\n\t\t\t\ttargetFields: referenced\n\t\t\t}\n\t\t};\n\t\tout.foreignKeys.push({\n\t\t\tdeclaringModel: symbol.name,\n\t\t\ttargetModel: field.typeName,\n\t\t\t...ifDefined(\"relationName\", args?.name),\n\t\t\tlocalFields: local,\n\t\t\ttargetFields: referenced\n\t\t});\n\t}\n}\nfunction buildIndexes(build, diagnostics) {\n\tconst { symbol, sourceId } = build.located;\n\tconst indexes = [];\n\tlet textIndexes = 0;\n\tconst keyFor = (field, text) => ({\n\t\tfield: build.storedNames.get(field.name) ?? field.name,\n\t\tdirection: field.direction ?? (text ? \"text\" : 1)\n\t});\n\tfor (const attribute of [...build.uniqueFields, ...build.modelIndexes]) {\n\t\tconst names = attribute.fields.map((field) => field.name);\n\t\tconst usedBy = {\n\t\t\tkind: \"index\",\n\t\t\ttext: build.uniqueFields.includes(attribute) ? `@unique on field \"${symbol.name}.${attribute.fields[0]?.name ?? \"\"}\"` : `@@${attribute.kind} on model \"${symbol.name}\"`\n\t\t};\n\t\tconst ignored = names.filter((name) => build.ignoredFields.has(name));\n\t\tif (ignored.length > 0) {\n\t\t\tdiagnostics.push(ignoredFieldReferenced(symbol.name, ignored, usedBy, sourceId, attribute.span));\n\t\t\tcontinue;\n\t\t}\n\t\tif (names.some((name) => build.rejectedFields.has(name))) continue;\n\t\tconst unknown = names.find((name) => !build.storedNames.has(name));\n\t\tif (unknown !== void 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INDEX_FIELD_NOT_FOUND\",\n\t\t\t\tmessage: `Index on model \"${symbol.name}\" references unknown field \"${unknown}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: attribute.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (attribute.kind === \"fulltext\") {\n\t\t\ttextIndexes++;\n\t\t\tif (textIndexes > 1) {\n\t\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_TEXT_INDEX_LIMIT\", `Model \"${symbol.name}\" has more than one @@fulltext; MongoDB allows one text index per collection. Merge the fields into one @@fulltext.`, sourceId, attribute.span));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tindexes.push(new MongoIndex({\n\t\t\tkeys: attribute.fields.map((field) => keyFor(field, attribute.kind === \"fulltext\")),\n\t\t\t...attribute.kind === \"unique\" ? { unique: true } : {}\n\t\t}));\n\t}\n\treturn indexes;\n}\nfunction assembleContract(input) {\n\tconst target = input.binding.target.targetId;\n\tconst targetFamily = input.binding.target.familyId;\n\tconst builtEnums = Object.fromEntries(input.enums);\n\tconst collections = {};\n\tfor (const [name, collection] of Object.entries(input.collections)) collections[name] = collection.indexes.length > 0 ? { indexes: collection.indexes } : {};\n\tconst storage = buildMongoStorage({\n\t\tcollections,\n\t\tvalueSets: mongoValueSetsOf(builtEnums)\n\t});\n\tconst models = {};\n\tfor (const [modelName, build] of input.builds) models[modelName] = {\n\t\tfields: build.fields,\n\t\trelations: build.relations,\n\t\tstorage: { collection: build.collection }\n\t};\n\tconst capabilities = {};\n\tconst execution = buildExecutionSection({\n\t\ttarget,\n\t\ttargetFamily,\n\t\tdefaults: input.executionDefaults\n\t});\n\treturn {\n\t\ttargetFamily,\n\t\ttarget,\n\t\troots: input.roots,\n\t\tdomain: { namespaces: { [UNBOUND_NAMESPACE_ID]: {\n\t\t\tmodels: blindCast(models),\n\t\t\t...Object.keys(input.valueObjects).length > 0 ? { valueObjects: input.valueObjects } : {},\n\t\t\t...Object.keys(builtEnums).length > 0 ? { enum: builtEnums } : {}\n\t\t} } },\n\t\tstorage,\n\t\textensions: {},\n\t\tcapabilities,\n\t\tprofileHash: computeProfileHash({\n\t\t\ttarget,\n\t\t\ttargetFamily,\n\t\t\tcapabilities\n\t\t}),\n\t\tmeta: {},\n\t\t...execution !== void 0 ? { execution } : {}\n\t};\n}\nfunction mergedSources(documents) {\n\tconst [first, ...rest] = documents.map((document) => document.sources);\n\tif (first === void 0) throw new InternalError(\"A Prisma 6 schema has at least one document\");\n\treturn first.merge(...rest);\n}\n//#endregion\n//#region src/provider.ts\nfunction defaultOutputFromSchemaPath(schemaPath) {\n\treturn join(dirname(schemaPath), \"contract.json\");\n}\nfunction mapParseDiagnostics(diagnostics, sourceFile, sourceId) {\n\treturn diagnostics.map((diagnostic) => ({\n\t\tcode: diagnostic.code,\n\t\tmessage: diagnostic.message,\n\t\tsourceId,\n\t\tspan: sourceFile.rangeToPslSpan(diagnostic.range)\n\t}));\n}\n/**\n* The files a Prisma 6 schema input names: the file itself, or every regular `.prisma` file under the directory, nested directories and symbolic links included, as Prisma 6 reads a schema directory. Sorted by path so duplicate detection blames the later file deterministically.\n*/\nasync function listSchemaFiles(absolutePath, displayPath) {\n\tif (!(await stat(absolutePath)).isDirectory()) return [{\n\t\tsourceId: displayPath,\n\t\tabsolutePath\n\t}];\n\tconst entries = await readdir(absolutePath, { recursive: true });\n\tconst files = [];\n\tfor (const entry of entries.filter((name) => extname(name) === \".prisma\").map((name) => normalize(name)).sort()) {\n\t\tconst entryPath = join(absolutePath, entry);\n\t\tif ((await stat(entryPath)).isFile()) files.push({\n\t\t\tsourceId: join(displayPath, entry),\n\t\t\tabsolutePath: entryPath\n\t\t});\n\t}\n\treturn files;\n}\nfunction isMissingPath(error) {\n\treturn error instanceof Error && Reflect.get(error, \"code\") === \"ENOENT\";\n}\nfunction readFailure(schemaPath, message, meta) {\n\treturn notOk({\n\t\tsummary: `Failed to read Prisma 6 schema at \"${schemaPath}\"`,\n\t\tdiagnostics: [prisma6Diagnostic(\"PSL.PRISMA6_MONGO_SCHEMA_READ_FAILED\", message, schemaPath, void 0)],\n\t\tmeta\n\t});\n}\n/**\n* A `ContractConfig` that reads a Prisma 6 MongoDB `schema.prisma` (a file, or a directory of `.prisma` files) as the contract source.\n*/\nfunction prisma6Contract(schemaPath, options) {\n\tconst parserOptions = { grammar: \"prisma-7\" };\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"psl\",\n\t\t\tinputs: [schemaPath],\n\t\t\tparserOptions,\n\t\t\tasync load(context) {\n\t\t\t\tconst [absolutePath] = context.resolvedInputs;\n\t\t\t\tif (absolutePath === void 0) throw new InternalError(\"prisma6Contract: context.resolvedInputs is empty. The CLI config loader should populate it from source.inputs.\");\n\t\t\t\tlet files;\n\t\t\t\ttry {\n\t\t\t\t\tfiles = await listSchemaFiles(absolutePath, schemaPath);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst cause = String(error);\n\t\t\t\t\treturn readFailure(schemaPath, isMissingPath(error) ? `There is no file or directory at \"${schemaPath}\". Fix the path passed to prisma6Schema() in prisma.config.ts.` : cause, {\n\t\t\t\t\t\tschemaPath,\n\t\t\t\t\t\tabsolutePath,\n\t\t\t\t\t\tcause\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (files.length === 0) return readFailure(schemaPath, `The schema directory \"${schemaPath}\" contains no .prisma file.`, {\n\t\t\t\t\tschemaPath,\n\t\t\t\t\tabsolutePath\n\t\t\t\t});\n\t\t\t\tconst documents = [];\n\t\t\t\tconst seedDiagnostics = [];\n\t\t\t\tfor (const file of files) {\n\t\t\t\t\tlet schema;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tschema = await readFile(file.absolutePath, \"utf-8\");\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconst message = String(error);\n\t\t\t\t\t\treturn readFailure(file.sourceId, message, {\n\t\t\t\t\t\t\tschemaPath: file.sourceId,\n\t\t\t\t\t\t\tabsoluteSchemaPath: file.absolutePath,\n\t\t\t\t\t\t\tcause: message\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tconst { document, sources, diagnostics } = parse(schema, file.sourceId, parserOptions);\n\t\t\t\t\tconst sourceFile = sources.sourceFileFor(document.syntax);\n\t\t\t\t\tseedDiagnostics.push(...mapParseDiagnostics(diagnostics, sourceFile, file.sourceId));\n\t\t\t\t\tdocuments.push({\n\t\t\t\t\t\tdocument,\n\t\t\t\t\t\tsources,\n\t\t\t\t\t\tsourceFile,\n\t\t\t\t\t\tsourceId: file.sourceId\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tlet contract;\n\t\t\t\ttry {\n\t\t\t\t\tconst interpreted = interpretPrisma6Documents({\n\t\t\t\t\t\tdocuments,\n\t\t\t\t\t\tseedDiagnostics,\n\t\t\t\t\t\tbinding: options.binding,\n\t\t\t\t\t\tauthoringContributions: context.authoringContributions,\n\t\t\t\t\t\tcodecLookup: context.codecLookup,\n\t\t\t\t\t\tdataTypes: context.dataTypes\n\t\t\t\t\t});\n\t\t\t\t\tif (!interpreted.ok) return interpreted;\n\t\t\t\t\tcontract = applySpecifierDefaultControlPolicy(interpreted.value, options.defaultControlPolicy);\n\t\t\t\t\tvalidateContractDomain(contract);\n\t\t\t\t\tvalidateMongoStorage(blindCast(contract));\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!isStructuredError(error)) throw error;\n\t\t\t\t\treturn notOk({\n\t\t\t\t\t\tsummary: \"Prisma 6 MongoDB schema interpretation failed\",\n\t\t\t\t\t\tdiagnostics: [prisma6Diagnostic(\"PSL.PRISMA6_MONGO_CONTRACT_INVALID\", `This schema gives a contract that Prisma 8 rejects, and the Prisma 6 MongoDB contract source has no specific diagnostic for the cause: ${error.message.replace(/\\.$/, \"\")}. This is a bug in Prisma ORM; please report it with this schema.`, schemaPath, void 0)],\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tschemaPath,\n\t\t\t\t\t\t\tcode: error.code\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn ok(contract);\n\t\t\t}\n\t\t},\n\t\toutput: options.output ?? defaultOutputFromSchemaPath(schemaPath)\n\t};\n}\n//#endregion\nexport { prisma6Contract };\n\n//# sourceMappingURL=provider.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoBA,SAAS,kBAAkB,MAAM,SAAS,UAAU,MAAM;CACzD,OAAO;EACN;EACA;EACA;EACA,GAAG,SAAS,KAAK,IAAI,EAAE,KAAK,IAAI,CAAC;CAClC;AACD;AAGA,SAAS,YAAY,WAAW,MAAM,MAAM,KAAK;CAChD,IAAI,YAAY,KAAK,kBAAkB,gDAAgD,GAAG,IAAI,MAAM,IAAI,IAAI,SAAS,UAAU,KAAK,GAAG,QAAQ,IAAI,UAAU,IAAI,CAAC;AACnK;AACA,SAAS,cAAc,YAAY;CAClC,IAAI,eAAe,KAAK,GAAG,OAAO,KAAK;CACvC,MAAM,QAAQ,cAAc,KAAK,WAAW,MAAM,CAAC,EAAE,KAAK;CAC1D,OAAO,UAAU,QAAQ,IAAI,UAAU,SAAS,KAAK,KAAK;AAC3D;;;;AAIA,SAAS,SAAS,WAAW,MAAM,KAAK;CACvC,IAAI;CACJ,KAAK,MAAM,OAAO,MAAM;EACvB,MAAM,MAAM,IAAI,KAAK,CAAC,EAAE,KAAK;EAC7B,MAAM,OAAO,YAAY,IAAI,QAAQ,IAAI,OAAO;EAChD,IAAI,QAAQ,QAAQ,OAAO,YAAY,WAAW,QAAQ,WAAW,2HAA2H,aAAa,OAAO,GAAG,sBAAsB,MAAM,GAAG;EACtP,YAAY,cAAc,IAAI,MAAM,CAAC;EACrC,IAAI,cAAc,KAAK,GAAG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Ac,OAAO;KACnD,SAAS,OAAO;MACf,MAAM,UAAU,OAAO,KAAK;MAC5B,OAAO,YAAY,KAAK,UAAU,SAAS;OAC1C,YAAY,KAAK;OACjB,oBAAoB,KAAK;OACzB,OAAO;MACR,CAAC;KACF;KACA,MAAM,EAAE,UAAU,SAAS,gBAAgB,MAAM,QAAQ,KAAK,UAAU,aAAa;KACrF,MAAM,aAAa,QAAQ,cAAc,SAAS,MAAM;KACxD,gBAAgB,KAAK,GAAG,oBAAoB,aAAa,YAAY,KAAK,QAAQ,CAAC;KACnF,UAAU,KAAK;MACd;MACA;MACA;MACA,UAAU,KAAK;KAChB,CAAC;IACF;IACA,IAAI;IACJ,IAAI;KACH,MAAM,cAAc,0BAA0B;MAC7C;MACA;MACA,SAAS,QAAQ;MACjB,wBAAwB,QAAQ;MAChC,aAAa,QAAQ;MACrB,WAAW,QAAQ;KACpB,CAAC;KACD,IAAI,CAAC,YAAY,IAAI,OAAO;KAC5B,WAAW,mCAAmC,YAAY,OAAO,QAAQ,oBAAoB;KAC7F,uBAAuB,QAAQ;KAC/B,qBAAqB,UAAU,QAAQ,CAAC;IACzC,SAAS,OAAO;KACf,IAAI,CAAC,kBAAkB,KAAK,GAAG,MAAM;KACrC,OAAO,MAAM;MACZ,SAAS;MACT,aAAa,CAAC,kBAAkB,sCAAsC,0IAA0I,MAAM,QAAQ,QAAQ,OAAO,EAAE,EAAE,oEAAoE,YAAY,KAAK,CAAC,CAAC;MACxU,MAAM;OACL;OACA,MAAM,MAAM;MACb;KACD,CAAC;IACF;IACA,OAAO,GAAG,QAAQ;GACnB;EACD;EACA,QAAQ,QAAQ,UAAU,4BAA4B,UAAU;CACjE;AACD"}
|
|
1
|
+
{"version":3,"file":"contract-prisma6__provider.mjs","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-prisma6/dist/provider.mjs"],"sourcesContent":["import { readFile, readdir, stat } from \"node:fs/promises\";\nimport { applySpecifierDefaultControlPolicy } from \"@internal/contract/apply-specifier-default-control-policy\";\nimport { validateContractDomain } from \"@internal/contract/validate-domain\";\nimport { MongoIndex, buildMongoStorage, mongoValueSetsOf, validateMongoStorage } from \"@internal/mongo-contract\";\nimport { ArrayLiteralAst, FunctionCallAst, IdentifierAst, PathExprAst, StringLiteralExprAst, dottedPathsIn, parse, printSyntax } from \"@internal/psl-parser/syntax\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { isStructuredError } from \"@internal/utils/structured-error\";\nimport { basename, dirname, extname, join, normalize } from \"pathe\";\nimport { buildExecutionSection, computeProfileHash } from \"@internal/contract/hashing\";\nimport { crossRef } from \"@internal/contract/types\";\nimport { resolveToOneRelationNullable } from \"@internal/contract-authoring\";\nimport { encodeEnumMembers, enumMemberProblemDiagnostic, instantiateAuthoringEntityType, isAuthoringEntityTypeDescriptor } from \"@internal/framework-components/authoring\";\nimport { pairMongoBackRelations } from \"@internal/mongo-contract-psl\";\nimport { buildSymbolTable, keywordPslSpan, mapPslDiagnostics, nodePslSpan, readResolvedAttribute } from \"@internal/psl-parser\";\nimport { fkRelationPairKey } from \"@internal/psl-parser/interpret\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/diagnostics.ts\nfunction prisma6Diagnostic(code, message, sourceId, span) {\n\treturn {\n\t\tcode,\n\t\tmessage,\n\t\tsourceId,\n\t\t...span !== void 0 ? { span } : {}\n\t};\n}\n//#endregion\n//#region src/indexes.ts\nfunction unsupported(attribute, what, span, ctx) {\n\tctx.diagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_INDEX_ARGUMENT_UNSUPPORTED\", `${ctx.owner}: ${ctx.prefix}${attribute.name} ${what}`, ctx.sourceId, span));\n}\nfunction sortDirection(expression) {\n\tif (expression === void 0) return void 0;\n\tconst token = IdentifierAst.cast(expression.syntax)?.name();\n\treturn token === \"Asc\" ? 1 : token === \"Desc\" ? -1 : void 0;\n}\n/**\n* Reads `sort:` from one index element's or `@unique`'s arguments. `length:` and every other argument are refused: a MongoDB index has no prefix length, and Prisma 6 accepts no other argument there on MongoDB.\n*/\nfunction readSort(attribute, args, ctx) {\n\tlet direction;\n\tfor (const arg of args) {\n\t\tconst key = arg.name()?.name();\n\t\tconst span = nodePslSpan(arg.syntax, ctx.sources);\n\t\tif (key !== \"sort\") return unsupported(attribute, key === \"length\" ? \"argument \\\"length\\\" is not supported: a MongoDB index has no prefix length. Remove it; Prisma 6 ignores it on MongoDB.\" : `argument \"${key ?? \"\"}\" is not supported.`, span, ctx);\n\t\tdirection = sortDirection(arg.value());\n\t\tif (direction === void 0) return unsupported(attribute, \"sort must be Asc or Desc.\", span, ctx);\n\t}\n\treturn { direction };\n}\nfunction readFields(attribute, expression, span, ctx) {\n\tconst array = expression === void 0 ? void 0 : ArrayLiteralAst.cast(expression.syntax);\n\tif (array === void 0) return unsupported(attribute, \"expects a list of field names.\", span, ctx);\n\tconst fields = [];\n\tfor (const element of array.elements()) {\n\t\tconst name = IdentifierAst.cast(element.syntax)?.name();\n\t\tif (name !== void 0) {\n\t\t\tfields.push({\n\t\t\t\tname,\n\t\t\t\tdirection: void 0\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst call = FunctionCallAst.cast(element.syntax);\n\t\tconst path = PathExprAst.cast(element.syntax)?.path() ?? call?.path() ?? [];\n\t\tconst [callee] = path;\n\t\tif (path.length > 1 && (callee === void 0 || !ctx.compositeFields.has(callee))) return unsupported(attribute, `lists the dotted path \"${path.join(\".\")}\", but \"${callee ?? \"\"}\" is not a composite-type field of the model, and Prisma 6 refuses the path as an unknown field. List fields of the model by name.`, nodePslSpan(element.syntax, ctx.sources), ctx);\n\t\tif (path.length > 1) {\n\t\t\tctx.diagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_COMPOSITE_INDEX_PATH_UNSUPPORTED\", `Index path \"${path.join(\".\")}\" reaches into a composite type; indexes on composite-type fields are not supported yet. Index a top-level field or remove the index. Either change also reaches the Prisma 6 app, whose \\`db push\\` builds its indexes from this schema.`, ctx.sourceId, nodePslSpan(element.syntax, ctx.sources)));\n\t\t\treturn;\n\t\t}\n\t\tif (call === void 0 || callee === void 0) return unsupported(attribute, \"expects a list of field names.\", nodePslSpan(element.syntax, ctx.sources), ctx);\n\t\tconst sort = readSort(attribute, call.args(), ctx);\n\t\tif (sort === void 0) return void 0;\n\t\tfields.push({\n\t\t\tname: callee,\n\t\t\tdirection: sort.direction\n\t\t});\n\t}\n\treturn fields;\n}\n/** Reads `@@index`, `@@unique` or `@@fulltext`. `map:` and `name:` are dropped: MongoDB verify never compares index names. */\nfunction parseIndexAttribute(attribute, ctx) {\n\tlet fields;\n\tfor (const arg of attribute.args) {\n\t\tconst key = arg.kind === \"positional\" ? \"fields\" : arg.name;\n\t\tif (key === \"map\" || key === \"name\") continue;\n\t\tif (key !== \"fields\") return unsupported(attribute, `argument \"${key ?? \"\"}\" is not supported.`, arg.span, ctx);\n\t\tfields = readFields(attribute, arg.expression, arg.span, ctx);\n\t\tif (fields === void 0) return void 0;\n\t}\n\tif (fields === void 0 || fields.length === 0) return unsupported(attribute, \"expects a list of field names.\", attribute.span, ctx);\n\treturn {\n\t\tkind: attribute.name,\n\t\tfields,\n\t\tspan: attribute.span\n\t};\n}\n/** Reads a field's `@unique`: `sort:` sets the key direction; `map:` and `name:` are dropped. */\nfunction parseFieldUnique(attribute, fieldName, ctx) {\n\tlet direction;\n\tfor (const arg of attribute.args) {\n\t\tconst key = arg.kind === \"positional\" ? void 0 : arg.name;\n\t\tif (key === \"map\" || key === \"name\") continue;\n\t\tif (key === \"sort\") {\n\t\t\tdirection = sortDirection(arg.expression);\n\t\t\tif (direction === void 0) return unsupported(attribute, \"sort must be Asc or Desc.\", arg.span, ctx);\n\t\t\tcontinue;\n\t\t}\n\t\treturn unsupported(attribute, key === \"length\" ? \"argument \\\"length\\\" is not supported: a MongoDB index has no prefix length. Remove it; Prisma 6 ignores it on MongoDB.\" : `argument \"${key ?? \"\"}\" is not supported.`, arg.span, ctx);\n\t}\n\treturn {\n\t\tkind: \"unique\",\n\t\tfields: [{\n\t\t\tname: fieldName,\n\t\t\tdirection\n\t\t}],\n\t\tspan: attribute.span\n\t};\n}\n//#endregion\n//#region src/interpreter.ts\nconst SUMMARY = \"Prisma 6 MongoDB schema interpretation failed\";\nfunction stringArgument(attribute) {\n\tconst expression = (attribute.args.find((arg) => arg.kind === \"positional\") ?? attribute.args.find((arg) => arg.name === \"name\"))?.expression;\n\treturn expression === void 0 ? void 0 : StringLiteralExprAst.cast(expression.syntax)?.value();\n}\nfunction requireString(attribute, owner, sourceId, diagnostics) {\n\tconst value = stringArgument(attribute);\n\tif (value === void 0) diagnostics.push({\n\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\tmessage: `${owner}: attribute \"@${attribute.name}\" expects one string argument.`,\n\t\tsourceId,\n\t\tspan: attribute.span\n\t});\n\treturn value;\n}\nfunction attributeText(attribute) {\n\tconst args = attribute.args.map((arg) => arg.kind === \"named\" ? `${arg.name}: ${arg.value}` : arg.value);\n\treturn args.length === 0 ? `@${attribute.name}` : `@${attribute.name}(${args.join(\", \")})`;\n}\n/** `auto()` and `now()` with no arguments; any other `@default` value is `other`. */\nfunction defaultKind(attribute) {\n\tconst expression = attribute.args.find((arg) => arg.kind === \"positional\")?.expression;\n\tconst call = expression === void 0 ? void 0 : FunctionCallAst.cast(expression.syntax);\n\tif (call === void 0 || [...call.args()].length > 0) return \"other\";\n\tconst path = call.path().join(\".\");\n\treturn path === \"auto\" ? \"auto\" : path === \"now\" ? \"now\" : \"other\";\n}\nfunction unknownAttribute(owner, attribute, prefix, sourceId) {\n\treturn prisma6Diagnostic(\"PSL.PRISMA6_MONGO_UNKNOWN_ATTRIBUTE\", `${owner}: attribute \"${prefix}${attribute.name}\" is not supported by the Prisma 6 MongoDB contract source.`, sourceId, attribute.span);\n}\nfunction interpretPrisma6Documents(input) {\n\tconst { binding } = input;\n\tconst diagnostics = [...input.seedDiagnostics];\n\tconst datasources = [];\n\tconst enumBlocks = [];\n\tconst compositeTypes = [];\n\tconst models = [];\n\tconst ignoredModels = /* @__PURE__ */ new Set();\n\tconst declaredNames = /* @__PURE__ */ new Map();\n\tconst claimName = (kind, name, sourceId, span) => {\n\t\tconst previous = declaredNames.get(name);\n\t\tif (previous === void 0) {\n\t\t\tdeclaredNames.set(name, sourceId);\n\t\t\treturn true;\n\t\t}\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_DUPLICATE_DECLARATION\",\n\t\t\tmessage: `Duplicate declaration of ${kind} \"${name}\"; first declared in ${basename(previous)}.`,\n\t\t\tsourceId,\n\t\t\tspan\n\t\t});\n\t\treturn false;\n\t};\n\tfor (const { document, sources, sourceFile, sourceId } of input.documents) {\n\t\tconst { symbolTable, diagnostics: tableDiagnostics } = buildSymbolTable({\n\t\t\tdocuments: [document],\n\t\t\tsources,\n\t\t\tdefaultNamespaceId: input.defaultNamespaceId\n\t\t});\n\t\tfor (const diagnostic of tableDiagnostics) diagnostics.push({\n\t\t\tcode: diagnostic.code,\n\t\t\tmessage: diagnostic.message,\n\t\t\tsourceId,\n\t\t\tspan: sourceFile.rangeToPslSpan(diagnostic.range)\n\t\t});\n\t\tconst unsupported = (keyword, span) => {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_UNSUPPORTED_TOP_LEVEL_BLOCK\",\n\t\t\t\tmessage: `Unsupported top-level block \"${keyword}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan\n\t\t\t});\n\t\t};\n\t\tconst unsupportedInclusions = (code, holders) => {\n\t\t\tfor (const holder of Object.values(holders)) for (const inclusion of holder.node.inclusions()) diagnostics.push({\n\t\t\t\tcode,\n\t\t\t\tmessage: `Unsupported mixin inclusion \"${printSyntax(inclusion.syntax).trim()}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: nodePslSpan(inclusion.syntax, sources)\n\t\t\t});\n\t\t};\n\t\tfor (const block of Object.values(symbolTable.defaultNamespace.blocks)) switch (block.keyword) {\n\t\t\tcase \"datasource\":\n\t\t\t\tdatasources.push({\n\t\t\t\t\tsymbol: block,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tsources\n\t\t\t\t});\n\t\t\t\treportDottedBlockValues(block, sourceId, sources, diagnostics);\n\t\t\t\tbreak;\n\t\t\tcase \"generator\":\n\t\t\t\treportDottedBlockValues(block, sourceId, sources, diagnostics);\n\t\t\t\tbreak;\n\t\t\tcase \"enum\":\n\t\t\t\tif (claimName(\"enum\", block.name, sourceId, block.span)) enumBlocks.push({\n\t\t\t\t\tsymbol: block,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tsources\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"view\":\n\t\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_VIEW_UNSUPPORTED\", `View \"${block.name}\" is not supported; Prisma 8 has no views on MongoDB. Remove the view from the schema this contract source reads. The Prisma 6 client then loses the view's model too.`, sourceId, keywordPslSpan(block.node.syntax, block.keyword, sources)));\n\t\t\t\tbreak;\n\t\t\tdefault: unsupported(block.keyword, keywordPslSpan(block.node.syntax, block.keyword, sources));\n\t\t}\n\t\tfor (const namespace of Object.values(symbolTable.namespaces)) for (const { span } of namespace.declarations) unsupported(\"namespace\", span);\n\t\tfor (const namedType of Object.values(symbolTable.namedTypes)) unsupported(\"types\", namedType.span);\n\t\tfor (const mixin of Object.values(symbolTable.defaultNamespace.mixins)) unsupported(`${mixin.keyword} mixin`, mixin.span);\n\t\tunsupportedInclusions(\"PSL_INVALID_MODEL_MEMBER\", symbolTable.defaultNamespace.models);\n\t\tunsupportedInclusions(\"PSL_INVALID_MODEL_MEMBER\", symbolTable.defaultNamespace.compositeTypes);\n\t\tunsupportedInclusions(\"PSL_INVALID_EXTENSION_BLOCK_MEMBER\", symbolTable.defaultNamespace.blocks);\n\t\tfor (const symbol of Object.values(symbolTable.defaultNamespace.compositeTypes)) if (claimName(\"type\", symbol.name, sourceId, symbol.span)) compositeTypes.push({\n\t\t\tsymbol,\n\t\t\tsourceId,\n\t\t\tsources\n\t\t});\n\t\tfor (const symbol of Object.values(symbolTable.defaultNamespace.models)) {\n\t\t\tif (!claimName(\"model\", symbol.name, sourceId, symbol.span)) continue;\n\t\t\tif (symbol.attributes.some((attribute) => attribute.name === \"ignore\")) ignoredModels.add(symbol.name);\n\t\t\telse models.push({\n\t\t\t\tsymbol,\n\t\t\t\tsourceId,\n\t\t\t\tsources\n\t\t\t});\n\t\t}\n\t}\n\tconst providerMismatch = checkDatasource(datasources, input.documents[0]?.sourceId ?? \"schema.prisma\", binding);\n\tif (providerMismatch !== void 0) return notOk({\n\t\tsummary: SUMMARY,\n\t\tdiagnostics: inSourceOrder([...input.seedDiagnostics, providerMismatch], input.documents)\n\t});\n\tconst enums = /* @__PURE__ */ new Map();\n\tfor (const located of enumBlocks) {\n\t\tconst built = buildEnum(located, input, diagnostics);\n\t\tif (built !== void 0) enums.set(located.symbol.name, built);\n\t}\n\tconst modelNames = /* @__PURE__ */ new Set([...models.map((m) => m.symbol.name), ...ignoredModels]);\n\tconst compositeTypeNames = new Set(compositeTypes.map((c) => c.symbol.name));\n\tconst typeContext = {\n\t\tbinding,\n\t\tenums,\n\t\tenumNames: new Set(enumBlocks.map((located) => located.symbol.name)),\n\t\tcompositeTypeNames,\n\t\tdiagnostics,\n\t\tnamespaceId: input.defaultNamespaceId\n\t};\n\tconst valueObjects = {};\n\tfor (const located of compositeTypes) valueObjects[located.symbol.name] = { fields: readCompositeFields(located, typeContext) };\n\tconst builds = /* @__PURE__ */ new Map();\n\tfor (const located of models) builds.set(located.symbol.name, readModel(located, modelNames, ignoredModels, typeContext));\n\tconst foreignKeys = [];\n\tconst invalidFkPairings = [];\n\tconst backRelations = [];\n\tfor (const build of builds.values()) readRelationFields(build, builds, {\n\t\tforeignKeys,\n\t\tinvalidFkPairings,\n\t\tbackRelations\n\t}, diagnostics, input.defaultNamespaceId);\n\tconst paired = pairMongoBackRelations({\n\t\tforeignKeys,\n\t\tcandidates: backRelations,\n\t\tinvalidFkPairings,\n\t\tnamespaceId: input.defaultNamespaceId\n\t});\n\tdiagnostics.push(...mapPslDiagnostics(paired.diagnostics, mergedSources(input.documents)));\n\tfor (const { modelName, fieldName, relation } of paired.relations) {\n\t\tconst build = builds.get(modelName);\n\t\tif (build !== void 0) build.relations[fieldName] = relation;\n\t}\n\tconst collections = {};\n\tconst roots = {};\n\tconst executionDefaults = [];\n\tfor (const [modelName, build] of builds) {\n\t\tconst indexes = buildIndexes(build, diagnostics);\n\t\tconst existing = collections[build.collection];\n\t\tcollections[build.collection] = { indexes: [...existing?.indexes ?? [], ...indexes] };\n\t\troots[build.collection] = crossRef(modelName, input.defaultNamespaceId);\n\t\tfor (const { field, phases } of build.executionDefaults) executionDefaults.push({\n\t\t\tref: {\n\t\t\t\tnamespace: input.defaultNamespaceId,\n\t\t\t\tentry: build.collection,\n\t\t\t\tfield\n\t\t\t},\n\t\t\t...phases\n\t\t});\n\t\tif (!build.hasId) diagnostics.push({\n\t\t\tcode: \"PSL_MISSING_ID_FIELD\",\n\t\t\tmessage: `Model \"${modelName}\" has no field with @id attribute. Every model must have exactly one @id field.`,\n\t\t\tsourceId: build.located.sourceId,\n\t\t\tspan: build.located.symbol.span\n\t\t});\n\t}\n\tif (diagnostics.length > 0) return notOk({\n\t\tsummary: SUMMARY,\n\t\tdiagnostics: inSourceOrder(diagnostics, input.documents)\n\t});\n\treturn ok(assembleContract({\n\t\tbinding,\n\t\tbuilds,\n\t\tcollections,\n\t\troots,\n\t\tvalueObjects,\n\t\tenums,\n\t\texecutionDefaults,\n\t\tnamespaceId: input.defaultNamespaceId\n\t}));\n}\n/**\n* Diagnostics by file, in the order the schema files were read, then by position; one with no position comes first in its file.\n*/\nfunction inSourceOrder(diagnostics, documents) {\n\tconst fileOrder = new Map(documents.map((document, index) => [document.sourceId, index]));\n\tconst fileRank = (diagnostic) => fileOrder.get(diagnostic.sourceId) ?? documents.length;\n\tconst offset = (diagnostic) => diagnostic.span?.start.offset ?? -1;\n\treturn [...diagnostics].sort((a, b) => fileRank(a) - fileRank(b) || offset(a) - offset(b));\n}\n/** Prisma 6 accepts no dotted path in a datasource or generator block, though the parser reads one as a value. */\nfunction reportDottedBlockValues(block, sourceId, sources, diagnostics) {\n\tfor (const entry of block.entries) {\n\t\tconst value = entry.value();\n\t\tif (value === void 0) continue;\n\t\tfor (const path of dottedPathsIn(value)) diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_EXTENSION_BLOCK_MEMBER\",\n\t\t\tmessage: `${block.keyword} \"${block.name}\": the value of \"${entry.key()?.name() ?? \"\"}\" holds the dotted path ${path.path().join(\".\")}, which Prisma 6 does not accept in a ${block.keyword} block.`,\n\t\t\tsourceId,\n\t\t\tspan: nodePslSpan(path.syntax, sources)\n\t\t});\n\t}\n}\n/** The provider-mismatch diagnostic, or `undefined` when the schema names a provider the target reads. */\nfunction checkDatasource(datasources, fallbackSourceId, binding) {\n\tconst [datasource] = datasources;\n\tconst [namedProvider] = binding.providers;\n\tif (datasource === void 0) return prisma6Diagnostic(\"PSL.PRISMA6_MONGO_PROVIDER_MISMATCH\", `No datasource block found; add \\`datasource db { provider = \"${namedProvider}\" }\\`.`, fallbackSourceId, void 0);\n\tconst block = datasource.symbol;\n\tlet parameter;\n\tfor (const entry of block.entries) if (entry.key()?.name() === \"provider\") {\n\t\tparameter = entry;\n\t\tbreak;\n\t}\n\tconst expression = parameter?.value();\n\tconst provider = expression instanceof StringLiteralExprAst ? expression.value() : void 0;\n\tif (provider !== void 0 && binding.providers.includes(provider)) return void 0;\n\treturn prisma6Diagnostic(\"PSL.PRISMA6_MONGO_PROVIDER_MISMATCH\", provider === void 0 ? `The datasource block declares no string \\`provider\\`; this contract source reads Prisma 6 schemas for provider \"${namedProvider}\".` : `The datasource provider is \"${provider}\"; this contract source reads Prisma 6 schemas for provider \"${namedProvider}\".`, datasource.sourceId, parameter === void 0 ? block.span : nodePslSpan(parameter.syntax, datasource.sources));\n}\nfunction buildEnum(located, input, diagnostics) {\n\tconst { symbol: block, sourceId, sources } = located;\n\tfor (const attribute of block.attributes) {\n\t\tif (attribute.name === \"map\") continue;\n\t\tif (attribute.name === \"schema\") {\n\t\t\tdiagnostics.push(schemaUnsupported(`Enum \"${block.name}\"`, attribute, sourceId));\n\t\t\tcontinue;\n\t\t}\n\t\tdiagnostics.push(unknownAttribute(`Enum \"${block.name}\"`, attribute, \"@@\", sourceId));\n\t}\n\tconst values = Object.create(null);\n\tconst parameterSpans = Object.create(null);\n\tfor (const entry of block.entries) {\n\t\tconst name = entry.key()?.name();\n\t\tif (name === void 0) continue;\n\t\tlet value = name;\n\t\tfor (const attributeNode of entry.attributes()) {\n\t\t\tconst attribute = readResolvedAttribute(attributeNode, sources);\n\t\t\tif (attribute.name === \"map\") value = requireString(attribute, `Enum member \"${block.name}.${name}\"`, sourceId, diagnostics) ?? value;\n\t\t\telse diagnostics.push(unknownAttribute(`Enum member \"${block.name}.${name}\"`, attribute, \"@\", sourceId));\n\t\t}\n\t\tvalues[name] = value;\n\t\tparameterSpans[name] = nodePslSpan(entry.syntax, sources);\n\t}\n\tconst descriptor = input.authoringContributions.entityTypes[\"enum\"];\n\tif (descriptor === void 0 || !isAuthoringEntityTypeDescriptor(descriptor)) {\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_ENUM_MISSING_FACTORY\",\n\t\t\tmessage: `enum \"${block.name}\" requires an \"enum\" entityType factory in the active authoring contributions`,\n\t\t\tsourceId,\n\t\t\tspan: block.span\n\t\t});\n\t\treturn;\n\t}\n\tconst context = {\n\t\tfamily: input.binding.target.familyId,\n\t\ttarget: input.binding.target.targetId,\n\t\tcodecLookup: input.codecLookup,\n\t\tdataTypeLookup: input.dataTypes.lookup,\n\t\tsourceId,\n\t\tenumInferenceCodecs: {\n\t\t\ttext: input.binding.scalarCodecIds.String,\n\t\t\tint: input.binding.scalarCodecIds.Int\n\t\t},\n\t\tdiagnostics: { push: (diagnostic) => {\n\t\t\tdiagnostics.push(blindCast(diagnostic));\n\t\t} }\n\t};\n\tconst handle = instantiateAuthoringEntityType(\"enum\", descriptor, [{\n\t\tkind: \"enum\",\n\t\tkeyword: \"enum\",\n\t\tname: block.name,\n\t\tvalues,\n\t\tparameterSpans,\n\t\tattributes: {},\n\t\tspan: block.span\n\t}], context);\n\tif (handle === void 0 || handle === null) return void 0;\n\tconst encoded = encodeEnumMembers(handle, input.codecLookup);\n\tif (!encoded.ok) {\n\t\tconst site = {\n\t\t\tenumName: block.name,\n\t\t\tcodecId: handle.codecId,\n\t\t\tsourceId,\n\t\t\tspan: block.span,\n\t\t\tmemberSpans: parameterSpans\n\t\t};\n\t\tdiagnostics.push(...encoded.failure.map((problem) => enumMemberProblemDiagnostic(problem, site)));\n\t\treturn;\n\t}\n\treturn {\n\t\tcodecId: handle.codecId,\n\t\tmembers: encoded.value\n\t};\n}\nfunction schemaUnsupported(owner, attribute, sourceId) {\n\treturn prisma6Diagnostic(\"PSL.PRISMA6_MONGO_SCHEMA_UNSUPPORTED\", `${owner}: \"@@schema\" is not supported; a MongoDB contract has one database, bound by the connection string. Remove @@schema.`, sourceId, attribute.span);\n}\nfunction unsupportedTypeMessage(label, typeName, owner) {\n\tconst base = `${label} has type \"${typeName}(...)\", which has no Prisma 8 codec, so ${`${owner.kind} \"${owner.name}\"`} cannot use this contract source while it has the field. Prisma 6 rejects @ignore on an Unsupported field. Removing the field from the schema leaves its stored values in the documents, but the Prisma 6 client no longer reads or writes them.`;\n\tif (owner.kind === \"type\") return base;\n\treturn `${base} Adding @@ignore to model \"${owner.name}\" keeps the model out of the contract, but the model disappears from the Prisma 6 client too, and every relation field in another model that points to it needs @ignore, which removes that field from the Prisma 6 client as well.`;\n}\n/** The native types Prisma 6 accepts on each MongoDB scalar, checked with Prisma 6.19. */\nconst PRISMA6_NATIVE_TYPES = {\n\tString: [\"db.String\", \"db.ObjectId\"],\n\tBoolean: [\"db.Bool\"],\n\tInt: [\"db.Int\", \"db.Long\"],\n\tBigInt: [\"db.Long\"],\n\tFloat: [\"db.Double\"],\n\tDateTime: [\"db.Date\", \"db.Timestamp\"],\n\tBytes: [\"db.BinData\", \"db.ObjectId\"],\n\tJson: [\"db.Json\"]\n};\n/** The BSON type Prisma 6 stores for each native type. */\nconst PRISMA6_NATIVE_TYPE_BSON = {\n\t\"db.String\": \"string\",\n\t\"db.ObjectId\": \"objectId\",\n\t\"db.Bool\": \"bool\",\n\t\"db.Int\": \"int\",\n\t\"db.Long\": \"long\",\n\t\"db.Double\": \"double\",\n\t\"db.Date\": \"date\",\n\t\"db.Timestamp\": \"timestamp\",\n\t\"db.BinData\": \"binData\",\n\t\"db.Json\": \"object\"\n};\n/** The BSON type Prisma 6 stores for each MongoDB scalar that has no native type. `Int` is a long. */\nconst PRISMA6_SCALAR_BSON = {\n\tString: \"string\",\n\tBoolean: \"bool\",\n\tInt: \"long\",\n\tBigInt: \"long\",\n\tFloat: \"double\",\n\tDateTime: \"date\",\n\tBytes: \"binData\",\n\tJson: \"object\"\n};\nfunction withArticle(typeName) {\n\treturn `${/^[AEIOU]/.test(typeName) ? \"an\" : \"a\"} ${typeName}`;\n}\nfunction acceptedByPrisma6(nativeType, typeName) {\n\treturn (Object.hasOwn(PRISMA6_NATIVE_TYPES, typeName) ? PRISMA6_NATIVE_TYPES[typeName] : void 0)?.includes(nativeType) === true;\n}\n/** Why the reader refuses a native type, and what removing it does to the Prisma 6 app. */\nfunction nativeTypeRefusal(label, nativeType, typeName) {\n\tconst refused = `${label}: native type \"@${nativeType}\" is not supported`;\n\tif (!acceptedByPrisma6(nativeType, typeName)) return `${refused}, and Prisma 6 does not accept it on ${withArticle(typeName)} field either. Remove it.`;\n\tconst declared = PRISMA6_NATIVE_TYPE_BSON[nativeType];\n\tconst plain = PRISMA6_SCALAR_BSON[typeName];\n\treturn `${refused}: Prisma 6 stores it as a BSON ${declared}, and Prisma 8 has no codec for that BSON type. Remove it; this also changes the Prisma 6 app: its client then stores new ${typeName} values as BSON ${plain} instead of ${declared}. Documents already stored keep their ${declared} values, so rewrite them as ${plain}s before Prisma 8 reads them.`;\n}\nfunction nativeTypeCodecId(binding, typeName, nativeType) {\n\tconst forType = Object.hasOwn(binding.nativeTypeCodecIds, typeName) ? binding.nativeTypeCodecIds[typeName] : void 0;\n\treturn forType !== void 0 && Object.hasOwn(forType, nativeType) ? forType[nativeType] : void 0;\n}\n/** The field's contract type, or `undefined` after reporting why it has none. */\nfunction resolveFieldType(field, owner, nativeType, sourceId, ctx) {\n\tconst { binding, diagnostics } = ctx;\n\tconst label = `Field \"${owner.name}.${field.name}\"`;\n\tif (field.typeConstructor !== void 0) {\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_UNSUPPORTED_TYPE\", unsupportedTypeMessage(label, field.typeConstructor.path.join(\".\"), owner), sourceId, field.typeConstructor.span));\n\t\treturn;\n\t}\n\tconst nativeTypeUnsupported = (attribute) => {\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_NATIVE_TYPE_UNSUPPORTED\", nativeTypeRefusal(label, attribute.name, field.typeName), sourceId, attribute.span));\n\t};\n\tconst many = { many: field.list ? { elementNullable: false } : false };\n\tif (ctx.compositeTypeNames.has(field.typeName)) {\n\t\tif (nativeType !== void 0) return nativeTypeUnsupported(nativeType);\n\t\treturn {\n\t\t\ttype: {\n\t\t\t\tkind: \"valueObject\",\n\t\t\t\tname: field.typeName\n\t\t\t},\n\t\t\tnullable: field.optional,\n\t\t\t...many\n\t\t};\n\t}\n\tconst enumBuild = ctx.enums.get(field.typeName);\n\tif (enumBuild !== void 0) {\n\t\tif (nativeType !== void 0) return nativeTypeUnsupported(nativeType);\n\t\tconst valueSet = {\n\t\t\tplane: \"domain\",\n\t\t\tentityKind: \"enum\",\n\t\t\tnamespaceId: ctx.namespaceId,\n\t\t\tentityName: field.typeName\n\t\t};\n\t\treturn {\n\t\t\ttype: {\n\t\t\t\tkind: \"scalar\",\n\t\t\t\tcodecId: enumBuild.codecId\n\t\t\t},\n\t\t\tnullable: field.optional,\n\t\t\tvalueSet,\n\t\t\t...many\n\t\t};\n\t}\n\tif (ctx.enumNames.has(field.typeName)) return nativeType === void 0 ? void 0 : nativeTypeUnsupported(nativeType);\n\tconst scalarCodecId = Object.hasOwn(binding.scalarCodecIds, field.typeName) ? binding.scalarCodecIds[field.typeName] : void 0;\n\tif (scalarCodecId === void 0) {\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_UNSUPPORTED_TYPE\", `${label} has unknown type \"${field.typeName}\": it is not a scalar type, an enum, a composite type, or a model. Correct the type name.`, sourceId, field.span));\n\t\treturn;\n\t}\n\tlet codecId = scalarCodecId;\n\tif (nativeType !== void 0) {\n\t\tconst nativeCodecId = nativeTypeCodecId(binding, field.typeName, nativeType.name);\n\t\tif (nativeCodecId === void 0) return nativeTypeUnsupported(nativeType);\n\t\tcodecId = nativeCodecId;\n\t}\n\treturn {\n\t\ttype: {\n\t\t\tkind: \"scalar\",\n\t\t\tcodecId\n\t\t},\n\t\tnullable: field.optional,\n\t\t...many\n\t};\n}\nfunction readCompositeFields(located, ctx) {\n\tconst { symbol, sourceId } = located;\n\tfor (const attribute of symbol.attributes) ctx.diagnostics.push(unknownAttribute(`Type \"${symbol.name}\"`, attribute, \"@@\", sourceId));\n\tconst fields = {};\n\tfor (const field of Object.values(symbol.fields)) {\n\t\tif (field.malformedType) continue;\n\t\tconst label = `Field \"${symbol.name}.${field.name}\"`;\n\t\tlet nativeType;\n\t\tlet rejected = false;\n\t\tfor (const attribute of field.attributes) if (attribute.name.startsWith(\"db.\")) nativeType = attribute;\n\t\telse if (attribute.name === \"map\") {\n\t\t\tctx.diagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_COMPOSITE_MAP_UNSUPPORTED\", `${label}: @map on a field of a composite type is not supported yet. The stored field keeps the name \"${stringArgument(attribute) ?? field.name}\", so removing @map renames it in storage; keep the schema as it is until Prisma 8 supports it.`, sourceId, attribute.span));\n\t\t\trejected = true;\n\t\t} else if (attribute.name === \"default\") {\n\t\t\tctx.diagnostics.push(defaultUnsupported(label, attribute, {\n\t\t\t\tkind: \"type\",\n\t\t\t\tname: symbol.name\n\t\t\t}, field, sourceId));\n\t\t\trejected = true;\n\t\t} else {\n\t\t\tctx.diagnostics.push(unknownAttribute(label, attribute, \"@\", sourceId));\n\t\t\trejected = true;\n\t\t}\n\t\tif (rejected) continue;\n\t\tconst resolved = resolveFieldType(field, {\n\t\t\tkind: \"type\",\n\t\t\tname: symbol.name\n\t\t}, nativeType, sourceId, ctx);\n\t\tif (resolved !== void 0) fields[field.name] = resolved;\n\t}\n\treturn fields;\n}\n/** What the Prisma 6 app loses when the Prisma 6 client stops filling a default. */\nfunction defaultRemovalConsequence(owner, field) {\n\tif (field.optional || field.list) return owner.kind === \"model\" ? `a Prisma 6 create call that leaves \"${field.name}\" out no longer gets the default value` : `a \"${owner.name}\" value written without \"${field.name}\" no longer gets the default value`;\n\treturn owner.kind === \"model\" ? `every Prisma 6 create call must then pass \"${field.name}\"` : `every \"${owner.name}\" value the Prisma 6 app writes must then include \"${field.name}\"`;\n}\nfunction defaultUnsupported(label, attribute, owner, field, sourceId) {\n\treturn prisma6Diagnostic(\"PSL.PRISMA6_MONGO_DEFAULT_UNSUPPORTED\", `${label}: ${attributeText(attribute)} is not supported. MongoDB has no stored defaults, and Prisma 8 fills only \\`now()\\` on DateTime fields. The Prisma 6 client fills this default today, so removing it also changes the Prisma 6 app: ${defaultRemovalConsequence(owner, field)}. Set the value in the application code that creates documents, then remove the default.`, sourceId, attribute.span);\n}\nfunction readModel(located, modelNames, ignoredModels, ctx) {\n\tconst { symbol, sourceId, sources } = located;\n\tconst { diagnostics } = ctx;\n\tconst modelLabel = `Model \"${symbol.name}\"`;\n\tlet collection = symbol.name;\n\tconst build = {\n\t\tlocated,\n\t\tcollection: symbol.name,\n\t\tstoredNames: /* @__PURE__ */ new Map(),\n\t\tignoredFields: /* @__PURE__ */ new Set(),\n\t\trejectedFields: /* @__PURE__ */ new Set(),\n\t\tfields: {},\n\t\trelations: {},\n\t\texecutionDefaults: [],\n\t\tuniqueFields: [],\n\t\tmodelIndexes: [],\n\t\trelationFields: [],\n\t\thasId: false\n\t};\n\tconst indexContext = {\n\t\towner: modelLabel,\n\t\tprefix: \"@@\",\n\t\tsourceId,\n\t\tsources,\n\t\tdiagnostics,\n\t\tcompositeFields: new Set(Object.values(symbol.fields).filter((field) => ctx.compositeTypeNames.has(field.typeName)).map((field) => field.name))\n\t};\n\tfor (const attribute of symbol.attributes) switch (attribute.name) {\n\t\tcase \"map\":\n\t\t\tcollection = requireString(attribute, modelLabel, sourceId, diagnostics) ?? collection;\n\t\t\tbreak;\n\t\tcase \"index\":\n\t\tcase \"unique\":\n\t\tcase \"fulltext\": {\n\t\t\tconst parsed = parseIndexAttribute({\n\t\t\t\t...attribute,\n\t\t\t\tname: attribute.name\n\t\t\t}, indexContext);\n\t\t\tif (parsed !== void 0) build.modelIndexes.push(parsed);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"id\":\n\t\t\tbuild.hasId = true;\n\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_COMPOSITE_ID_UNSUPPORTED\", `${modelLabel}: @@id is not supported; a MongoDB document is identified by its \"_id\" field. Declare the id as \\`id String @id @default(auto()) @map(\"_id\") @db.ObjectId\\`.`, sourceId, attribute.span));\n\t\t\tbreak;\n\t\tcase \"schema\":\n\t\t\tdiagnostics.push(schemaUnsupported(modelLabel, attribute, sourceId));\n\t\t\tbreak;\n\t\tcase \"ignore\": break;\n\t\tdefault: diagnostics.push(unknownAttribute(modelLabel, attribute, \"@@\", sourceId));\n\t}\n\tfor (const field of Object.values(symbol.fields)) {\n\t\tconst reported = diagnostics.length;\n\t\treadModelField(field, build, modelNames, ignoredModels, ctx);\n\t\tif (diagnostics.length > reported) build.rejectedFields.add(field.name);\n\t}\n\treturn {\n\t\t...build,\n\t\tcollection\n\t};\n}\nfunction readModelField(field, build, modelNames, ignoredModels, ctx) {\n\tconst { symbol, sourceId, sources } = build.located;\n\tconst { diagnostics, binding } = ctx;\n\tconst label = `Field \"${symbol.name}.${field.name}\"`;\n\tconst isRelationField = modelNames.has(field.typeName) && field.typeConstructor === void 0;\n\tif (field.attributes.some((attribute) => attribute.name === \"ignore\")) {\n\t\tbuild.ignoredFields.add(field.name);\n\t\tconst unique = field.attributes.find((attribute) => attribute.name === \"unique\");\n\t\tif (unique !== void 0) diagnostics.push(ignoredFieldReferenced(symbol.name, [field.name], {\n\t\t\tkind: \"index\",\n\t\t\ttext: `@unique on field \"${symbol.name}.${field.name}\"`\n\t\t}, sourceId, unique.span));\n\t\treturn;\n\t}\n\tif (isRelationField) {\n\t\tif (ignoredModels.has(field.typeName)) return;\n\t\tlet relation;\n\t\tfor (const attribute of field.attributes) if (attribute.name === \"relation\") relation = attribute;\n\t\telse diagnostics.push(unknownAttribute(label, attribute, \"@\", sourceId));\n\t\tbuild.relationFields.push({\n\t\t\tfield,\n\t\t\trelation\n\t\t});\n\t\treturn;\n\t}\n\tlet storedName = field.name;\n\tlet nativeType;\n\tlet idAttribute;\n\tlet defaultAttribute;\n\tlet updatedAt;\n\tfor (const attribute of field.attributes) switch (attribute.name) {\n\t\tcase \"map\":\n\t\t\tstoredName = requireString(attribute, label, sourceId, diagnostics) ?? storedName;\n\t\t\tbreak;\n\t\tcase \"id\":\n\t\t\tidAttribute = attribute;\n\t\t\tbreak;\n\t\tcase \"default\":\n\t\t\tdefaultAttribute = attribute;\n\t\t\tbreak;\n\t\tcase \"updatedAt\":\n\t\t\tupdatedAt = attribute;\n\t\t\tbreak;\n\t\tcase \"unique\": {\n\t\t\tconst parsed = parseFieldUnique(attribute, field.name, {\n\t\t\t\towner: label,\n\t\t\t\tprefix: \"@\",\n\t\t\t\tsourceId,\n\t\t\t\tsources,\n\t\t\t\tdiagnostics,\n\t\t\t\tcompositeFields: /* @__PURE__ */ new Set()\n\t\t\t});\n\t\t\tif (parsed !== void 0) build.uniqueFields.push(parsed);\n\t\t\tbreak;\n\t\t}\n\t\tdefault: if (attribute.name.startsWith(\"db.\")) nativeType = attribute;\n\t\telse diagnostics.push(unknownAttribute(label, attribute, \"@\", sourceId));\n\t}\n\tbuild.storedNames.set(field.name, storedName);\n\tif (field.malformedType) return;\n\tconst owner = {\n\t\tkind: \"model\",\n\t\tname: symbol.name\n\t};\n\tconst resolved = resolveFieldType(field, owner, nativeType, sourceId, ctx);\n\tif (resolved === void 0) return;\n\tconst codecId = resolved.type.kind === \"scalar\" ? resolved.type.codecId : void 0;\n\tif (idAttribute !== void 0) {\n\t\tbuild.hasId = true;\n\t\tif (codecId !== binding.objectIdCodecId || storedName !== \"_id\" || field.optional || field.list) {\n\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_ID_NOT_OBJECTID\", `${label} is the model's @id, but it is not a required ObjectId stored as \"_id\". Prisma 8 identifies a MongoDB document by an ObjectId \"_id\"; declare the id as \\`${field.name} String @id @default(auto()) @map(\"_id\") @db.ObjectId\\`. If stored documents have \"_id\" values that are not ObjectIds, this model cannot use this contract source until they are rewritten with ObjectId \"_id\" values, along with every field that refers to them.`, sourceId, idAttribute.span));\n\t\t\treturn;\n\t\t}\n\t\tif (defaultAttribute !== void 0 && defaultKind(defaultAttribute) !== \"auto\") {\n\t\t\tdiagnostics.push(defaultUnsupported(label, defaultAttribute, owner, field, sourceId));\n\t\t\treturn;\n\t\t}\n\t\tbuild.fields[storedName] = resolved;\n\t\treturn;\n\t}\n\tconst isDateTime = codecId === binding.scalarCodecIds.DateTime && !field.list;\n\tif (updatedAt !== void 0 && !isDateTime) {\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_UPDATED_AT_TYPE_UNSUPPORTED\", `${label}: @updatedAt is only supported on a DateTime field. Removing it also stops the Prisma 6 client from setting the field on every update. Set the value in application code when you write documents, then remove @updatedAt.`, sourceId, updatedAt.span));\n\t\treturn;\n\t}\n\tconst defaultIsNow = defaultAttribute !== void 0 && defaultKind(defaultAttribute) === \"now\";\n\tif (defaultAttribute !== void 0 && (!defaultIsNow || !isDateTime)) {\n\t\tdiagnostics.push(defaultUnsupported(label, defaultAttribute, owner, field, sourceId));\n\t\treturn;\n\t}\n\tconst generator = {\n\t\tkind: \"generator\",\n\t\tid: binding.timestampGeneratorId\n\t};\n\tconst phases = updatedAt !== void 0 ? {\n\t\tonCreate: generator,\n\t\tonUpdate: generator\n\t} : defaultIsNow ? { onCreate: generator } : void 0;\n\tif (phases !== void 0 && field.optional) {\n\t\tconst written = updatedAt ?? defaultAttribute;\n\t\tconst generator = written === void 0 ? \"the generator\" : attributeText(written);\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_OPTIONAL_GENERATED_FIELD_UNSUPPORTED\", `${label} is optional and its value comes from ${generator}, which Prisma 8 cannot express on an optional field yet. Either fix also changes the Prisma 6 app: a required field makes the Prisma 6 client fail on a stored document that lacks it, and without ${generator} the Prisma 6 client no longer fills it. Make the field required once every stored document has a value, or set the value in application code and remove ${generator}.`, sourceId, written?.span ?? field.span));\n\t\treturn;\n\t}\n\tbuild.fields[storedName] = resolved;\n\tif (phases !== void 0) build.executionDefaults.push({\n\t\tfield: storedName,\n\t\tphases\n\t});\n}\nfunction identifierList(attributeArg) {\n\tconst expression = attributeArg.expression;\n\tconst array = expression === void 0 ? void 0 : ArrayLiteralAst.cast(expression.syntax);\n\tif (array === void 0) return void 0;\n\tconst names = [];\n\tfor (const element of array.elements()) {\n\t\tconst name = IdentifierAst.cast(element.syntax)?.name();\n\t\tif (name === void 0) return void 0;\n\t\tnames.push(name);\n\t}\n\treturn names;\n}\n/**\n* What removing `onDelete` or `onUpdate` does to the Prisma 6 app. The Prisma 6 client emulates referential actions on MongoDB with these defaults: `onDelete` is `Restrict` on a required relation (a delete fails with P2014) and `SetNull` on an optional one, and `onUpdate` is `Cascade`.\n*/\nfunction referentialActionRemoval(key, declared, sides) {\n\tconst fallback = key === \"onUpdate\" ? {\n\t\taction: \"Cascade\",\n\t\twhen: \"its default\",\n\t\teffect: `changing the field a ${sides.model} refers to in a ${sides.target} updates the key in its ${sides.model} documents`\n\t} : sides.optional ? {\n\t\taction: \"SetNull\",\n\t\twhen: \"its default for an optional relation\",\n\t\teffect: `deleting a ${sides.target} sets the key to null in its ${sides.model} documents`\n\t} : {\n\t\taction: \"Restrict\",\n\t\twhen: \"its default for a required relation\",\n\t\teffect: `deleting a ${sides.target} that still has ${sides.model} documents fails with P2014`\n\t};\n\tif (declared === fallback.action) return `Removing \"${key}: ${declared}\" leaves the Prisma 6 app as it is: ${declared} is already what the Prisma 6 client does for this relation.`;\n\treturn `The Prisma 6 client emulates referential actions, so removing \"${key}: ${declared}\" also changes the Prisma 6 app: its client then applies ${fallback.action}, ${fallback.when}, so ${fallback.effect}.`;\n}\nfunction readRelationArguments(attribute, label, sides, sourceId, diagnostics) {\n\tlet name;\n\tlet fields;\n\tlet references;\n\tlet rejected = false;\n\tconst invalid = (what, span) => {\n\t\trejected = true;\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\tmessage: `${label}: @relation ${what}.`,\n\t\t\tsourceId,\n\t\t\tspan\n\t\t});\n\t};\n\tfor (const arg of attribute.args) {\n\t\tconst key = arg.kind === \"positional\" ? \"name\" : arg.name;\n\t\tswitch (key) {\n\t\t\tcase \"name\": {\n\t\t\t\tconst expression = arg.expression;\n\t\t\t\tname = expression === void 0 ? void 0 : StringLiteralExprAst.cast(expression.syntax)?.value();\n\t\t\t\tif (name === void 0) invalid(\"name must be a string\", arg.span);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"fields\":\n\t\t\t\tfields = identifierList(arg);\n\t\t\t\tif (fields === void 0) invalid(\"fields must be a list of field names\", arg.span);\n\t\t\t\tbreak;\n\t\t\tcase \"references\":\n\t\t\t\treferences = identifierList(arg);\n\t\t\t\tif (references === void 0) invalid(\"references must be a list of field names\", arg.span);\n\t\t\t\tbreak;\n\t\t\tcase \"onDelete\":\n\t\t\tcase \"onUpdate\":\n\t\t\tcase \"map\":\n\t\t\t\trejected = true;\n\t\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_REFERENTIAL_ACTION_UNSUPPORTED\", key === \"map\" ? `${label}: @relation argument \"map\" is not supported; it names a foreign key constraint, and MongoDB has none. Remove \"map\"; the Prisma 6 app has no foreign key on MongoDB either, so nothing changes there.` : `${label}: @relation argument \"${key}\" is not supported; Prisma 8 enforces no referential actions on MongoDB. ${referentialActionRemoval(key, arg.value, sides)} Handle related documents in application code, then remove \"${key}\".`, sourceId, arg.span));\n\t\t\t\tbreak;\n\t\t\tdefault: invalid(`argument \"${key ?? \"\"}\" is not supported`, arg.span);\n\t\t}\n\t}\n\treturn rejected ? void 0 : {\n\t\tname,\n\t\tfields,\n\t\treferences\n\t};\n}\nfunction ignoredFieldReferenced(modelName, fieldNames, usedBy, sourceId, span) {\n\tconst one = fieldNames.length === 1;\n\tconst fields = fieldNames.map((name) => `\"${modelName}.${name}\"`).join(\", \");\n\tconst removal = usedBy.kind === \"index\" ? \"which makes Prisma 6 `db push` drop the index\" : \"which removes that relation from the Prisma 6 client\";\n\treturn prisma6Diagnostic(\"PSL.PRISMA6_MONGO_IGNORED_FIELD_REFERENCED\", `${one ? \"Field\" : \"Fields\"} ${fields} ${one ? \"is\" : \"are\"} marked @ignore, but ${usedBy.text} uses ${one ? \"it\" : \"them\"}. Remove @ignore from ${fields}, which adds ${one ? \"it\" : \"them\"} to the Prisma 6 client, or remove ${usedBy.text}, ${removal}.`, sourceId, span);\n}\nfunction readRelationFields(build, builds, out, diagnostics, namespaceId) {\n\tconst { symbol, sourceId, sources } = build.located;\n\tfor (const { field, relation } of build.relationFields) {\n\t\tconst label = `Relation field \"${symbol.name}.${field.name}\"`;\n\t\tconst reject = () => {\n\t\t\tout.invalidFkPairings.push({\n\t\t\t\tpairKey: fkRelationPairKey(symbol.name, field.typeName),\n\t\t\t\t...ifDefined(\"relationName\", relation === void 0 ? void 0 : stringArgument(relation))\n\t\t\t});\n\t\t};\n\t\tconst args = relation === void 0 ? void 0 : readRelationArguments(relation, label, {\n\t\t\tmodel: symbol.name,\n\t\t\ttarget: field.typeName,\n\t\t\toptional: field.optional\n\t\t}, sourceId, diagnostics);\n\t\tif (relation !== void 0 && args === void 0) {\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tconst target = builds.get(field.typeName);\n\t\tif (target === void 0) continue;\n\t\tif (!(args?.fields !== void 0 || args?.references !== void 0)) {\n\t\t\tout.backRelations.push({\n\t\t\t\tmodelName: symbol.name,\n\t\t\t\tfield,\n\t\t\t\ttargetModelName: field.typeName,\n\t\t\t\t...ifDefined(\"relationName\", args?.name),\n\t\t\t\tcardinality: field.list ? \"1:N\" : \"1:1\",\n\t\t\t\tsources\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (field.list) {\n\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_LIST_RELATION_UNSUPPORTED\", `${label} is a list relation that stores its keys in a list field (a many-to-many relation on MongoDB), which Prisma 8 does not support yet. Remove the relation fields from the schema this contract source reads and keep the key list as a plain field. The Prisma 6 client then loses the relation fields too, so Prisma 6 code that reads or writes the relation through them (\\`include\\`, \\`connect\\`) has to use the key list instead.`, sourceId, relation?.span ?? field.span));\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tconst localNames = args?.fields ?? [];\n\t\tconst targetNames = args?.references ?? [];\n\t\tconst ignoredLocal = localNames.filter((name) => build.ignoredFields.has(name));\n\t\tif (ignoredLocal.length > 0) {\n\t\t\tdiagnostics.push(ignoredFieldReferenced(symbol.name, ignoredLocal, {\n\t\t\t\tkind: \"relation\",\n\t\t\t\ttext: `relation field \"${symbol.name}.${field.name}\"`\n\t\t\t}, sourceId, relation?.span ?? field.span));\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tconst ignoredTarget = targetNames.filter((name) => target.ignoredFields.has(name));\n\t\tif (ignoredTarget.length > 0) {\n\t\t\tdiagnostics.push(ignoredFieldReferenced(target.located.symbol.name, ignoredTarget, {\n\t\t\t\tkind: \"relation\",\n\t\t\t\ttext: `relation field \"${symbol.name}.${field.name}\"`\n\t\t\t}, sourceId, relation?.span ?? field.span));\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tconst localFields = localNames.map((name) => build.storedNames.get(name));\n\t\tconst targetFields = targetNames.map((name) => target.storedNames.get(name));\n\t\tif (localFields.some((name) => name === void 0) || targetFields.some((name) => name === void 0) || localNames.length !== targetNames.length || localNames.length === 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\t\tmessage: `${label}: @relation fields and references must name the same number of scalar fields of \"${symbol.name}\" and \"${field.typeName}\".`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: relation?.span ?? field.span\n\t\t\t});\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tif (resolveToOneRelationNullable({\n\t\t\tdeclaredNullable: field.optional,\n\t\t\tlocalFieldNullability: localNames.map((name) => symbol.fields[name]?.optional === true),\n\t\t\townsReference: true\n\t\t}).contradiction !== void 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_RELATION_NULLABILITY_MISMATCH\",\n\t\t\t\tmessage: field.optional ? `${label} is optional but every field in @relation(fields: [...]) is required. Make one of those fields optional with \"?\" or remove \"?\" from \"${field.name}\".` : `${label} is required but a field in @relation(fields: [...]) is optional. Add \"?\" to \"${field.name}\" or make those fields required.`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: field.span\n\t\t\t});\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tconst local = localFields.filter((name) => name !== void 0);\n\t\tconst referenced = targetFields.filter((name) => name !== void 0);\n\t\tbuild.relations[field.name] = {\n\t\t\tto: crossRef(field.typeName, namespaceId),\n\t\t\tcardinality: \"N:1\",\n\t\t\tnullable: field.optional,\n\t\t\ton: {\n\t\t\t\tlocalFields: local,\n\t\t\t\ttargetFields: referenced\n\t\t\t}\n\t\t};\n\t\tout.foreignKeys.push({\n\t\t\tdeclaringModel: symbol.name,\n\t\t\ttargetModel: field.typeName,\n\t\t\t...ifDefined(\"relationName\", args?.name),\n\t\t\tlocalFields: local,\n\t\t\ttargetFields: referenced\n\t\t});\n\t}\n}\nfunction buildIndexes(build, diagnostics) {\n\tconst { symbol, sourceId } = build.located;\n\tconst indexes = [];\n\tlet textIndexes = 0;\n\tconst keyFor = (field, text) => ({\n\t\tfield: build.storedNames.get(field.name) ?? field.name,\n\t\tdirection: field.direction ?? (text ? \"text\" : 1)\n\t});\n\tfor (const attribute of [...build.uniqueFields, ...build.modelIndexes]) {\n\t\tconst names = attribute.fields.map((field) => field.name);\n\t\tconst usedBy = {\n\t\t\tkind: \"index\",\n\t\t\ttext: build.uniqueFields.includes(attribute) ? `@unique on field \"${symbol.name}.${attribute.fields[0]?.name ?? \"\"}\"` : `@@${attribute.kind} on model \"${symbol.name}\"`\n\t\t};\n\t\tconst ignored = names.filter((name) => build.ignoredFields.has(name));\n\t\tif (ignored.length > 0) {\n\t\t\tdiagnostics.push(ignoredFieldReferenced(symbol.name, ignored, usedBy, sourceId, attribute.span));\n\t\t\tcontinue;\n\t\t}\n\t\tif (names.some((name) => build.rejectedFields.has(name))) continue;\n\t\tconst unknown = names.find((name) => !build.storedNames.has(name));\n\t\tif (unknown !== void 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INDEX_FIELD_NOT_FOUND\",\n\t\t\t\tmessage: `Index on model \"${symbol.name}\" references unknown field \"${unknown}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: attribute.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (attribute.kind === \"fulltext\") {\n\t\t\ttextIndexes++;\n\t\t\tif (textIndexes > 1) {\n\t\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_TEXT_INDEX_LIMIT\", `Model \"${symbol.name}\" has more than one @@fulltext; MongoDB allows one text index per collection. Merge the fields into one @@fulltext.`, sourceId, attribute.span));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tindexes.push(new MongoIndex({\n\t\t\tkeys: attribute.fields.map((field) => keyFor(field, attribute.kind === \"fulltext\")),\n\t\t\t...attribute.kind === \"unique\" ? { unique: true } : {}\n\t\t}));\n\t}\n\treturn indexes;\n}\nfunction assembleContract(input) {\n\tconst target = input.binding.target.targetId;\n\tconst targetFamily = input.binding.target.familyId;\n\tconst builtEnums = Object.fromEntries(input.enums);\n\tconst collections = {};\n\tfor (const [name, collection] of Object.entries(input.collections)) collections[name] = collection.indexes.length > 0 ? { indexes: collection.indexes } : {};\n\tconst storage = buildMongoStorage({\n\t\tcollections,\n\t\tvalueSets: mongoValueSetsOf(builtEnums)\n\t});\n\tconst models = {};\n\tfor (const [modelName, build] of input.builds) models[modelName] = {\n\t\tfields: build.fields,\n\t\trelations: build.relations,\n\t\tstorage: { collection: build.collection }\n\t};\n\tconst capabilities = {};\n\tconst execution = buildExecutionSection({\n\t\ttarget,\n\t\ttargetFamily,\n\t\tdefaults: input.executionDefaults\n\t});\n\treturn {\n\t\ttargetFamily,\n\t\ttarget,\n\t\troots: input.roots,\n\t\tdomain: { namespaces: { [input.namespaceId]: {\n\t\t\tmodels: blindCast(models),\n\t\t\t...Object.keys(input.valueObjects).length > 0 ? { valueObjects: input.valueObjects } : {},\n\t\t\t...Object.keys(builtEnums).length > 0 ? { enum: builtEnums } : {}\n\t\t} } },\n\t\tstorage,\n\t\textensions: {},\n\t\tcapabilities,\n\t\tprofileHash: computeProfileHash({\n\t\t\ttarget,\n\t\t\ttargetFamily,\n\t\t\tcapabilities\n\t\t}),\n\t\tmeta: {},\n\t\t...execution !== void 0 ? { execution } : {}\n\t};\n}\nfunction mergedSources(documents) {\n\tconst [first, ...rest] = documents.map((document) => document.sources);\n\tif (first === void 0) throw new InternalError(\"A Prisma 6 schema has at least one document\");\n\treturn first.merge(...rest);\n}\n//#endregion\n//#region src/provider.ts\nfunction defaultOutputFromSchemaPath(schemaPath) {\n\treturn join(dirname(schemaPath), \"contract.json\");\n}\nfunction mapParseDiagnostics(diagnostics, sourceFile, sourceId) {\n\treturn diagnostics.map((diagnostic) => ({\n\t\tcode: diagnostic.code,\n\t\tmessage: diagnostic.message,\n\t\tsourceId,\n\t\tspan: sourceFile.rangeToPslSpan(diagnostic.range)\n\t}));\n}\n/**\n* The files a Prisma 6 schema input names: the file itself, or every regular `.prisma` file under the directory, nested directories and symbolic links included, as Prisma 6 reads a schema directory. Sorted by path so duplicate detection blames the later file deterministically.\n*/\nasync function listSchemaFiles(absolutePath, displayPath) {\n\tif (!(await stat(absolutePath)).isDirectory()) return [{\n\t\tsourceId: displayPath,\n\t\tabsolutePath\n\t}];\n\tconst entries = await readdir(absolutePath, { recursive: true });\n\tconst files = [];\n\tfor (const entry of entries.filter((name) => extname(name) === \".prisma\").map((name) => normalize(name)).sort()) {\n\t\tconst entryPath = join(absolutePath, entry);\n\t\tif ((await stat(entryPath)).isFile()) files.push({\n\t\t\tsourceId: join(displayPath, entry),\n\t\t\tabsolutePath: entryPath\n\t\t});\n\t}\n\treturn files;\n}\nfunction isMissingPath(error) {\n\treturn error instanceof Error && Reflect.get(error, \"code\") === \"ENOENT\";\n}\nfunction readFailure(schemaPath, message, meta) {\n\treturn notOk({\n\t\tsummary: `Failed to read Prisma 6 schema at \"${schemaPath}\"`,\n\t\tdiagnostics: [prisma6Diagnostic(\"PSL.PRISMA6_MONGO_SCHEMA_READ_FAILED\", message, schemaPath, void 0)],\n\t\tmeta\n\t});\n}\n/**\n* A `ContractConfig` that reads a Prisma 6 MongoDB `schema.prisma` (a file, or a directory of `.prisma` files) as the contract source.\n*/\nfunction prisma6Contract(schemaPath, options) {\n\tconst parserOptions = { grammar: \"prisma-7\" };\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"psl\",\n\t\t\tinputs: [schemaPath],\n\t\t\tparserOptions,\n\t\t\tasync load(context) {\n\t\t\t\tconst [absolutePath] = context.resolvedInputs;\n\t\t\t\tif (absolutePath === void 0) throw new InternalError(\"prisma6Contract: context.resolvedInputs is empty. The CLI config loader should populate it from source.inputs.\");\n\t\t\t\tlet files;\n\t\t\t\ttry {\n\t\t\t\t\tfiles = await listSchemaFiles(absolutePath, schemaPath);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst cause = String(error);\n\t\t\t\t\treturn readFailure(schemaPath, isMissingPath(error) ? `There is no file or directory at \"${schemaPath}\". Fix the path passed to prisma6Schema() in prisma.config.ts.` : cause, {\n\t\t\t\t\t\tschemaPath,\n\t\t\t\t\t\tabsolutePath,\n\t\t\t\t\t\tcause\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (files.length === 0) return readFailure(schemaPath, `The schema directory \"${schemaPath}\" contains no .prisma file.`, {\n\t\t\t\t\tschemaPath,\n\t\t\t\t\tabsolutePath\n\t\t\t\t});\n\t\t\t\tconst documents = [];\n\t\t\t\tconst seedDiagnostics = [];\n\t\t\t\tfor (const file of files) {\n\t\t\t\t\tlet schema;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tschema = await readFile(file.absolutePath, \"utf-8\");\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconst message = String(error);\n\t\t\t\t\t\treturn readFailure(file.sourceId, message, {\n\t\t\t\t\t\t\tschemaPath: file.sourceId,\n\t\t\t\t\t\t\tabsoluteSchemaPath: file.absolutePath,\n\t\t\t\t\t\t\tcause: message\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tconst { document, sources, diagnostics } = parse(schema, file.sourceId, parserOptions);\n\t\t\t\t\tconst sourceFile = sources.sourceFileFor(document.syntax);\n\t\t\t\t\tseedDiagnostics.push(...mapParseDiagnostics(diagnostics, sourceFile, file.sourceId));\n\t\t\t\t\tdocuments.push({\n\t\t\t\t\t\tdocument,\n\t\t\t\t\t\tsources,\n\t\t\t\t\t\tsourceFile,\n\t\t\t\t\t\tsourceId: file.sourceId\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tlet contract;\n\t\t\t\ttry {\n\t\t\t\t\tconst interpreted = interpretPrisma6Documents({\n\t\t\t\t\t\tdocuments,\n\t\t\t\t\t\tseedDiagnostics,\n\t\t\t\t\t\tbinding: options.binding,\n\t\t\t\t\t\tauthoringContributions: context.authoringContributions,\n\t\t\t\t\t\tcodecLookup: context.codecLookup,\n\t\t\t\t\t\tdataTypes: context.dataTypes,\n\t\t\t\t\t\tdefaultNamespaceId: context.defaultNamespaceId\n\t\t\t\t\t});\n\t\t\t\t\tif (!interpreted.ok) return interpreted;\n\t\t\t\t\tcontract = applySpecifierDefaultControlPolicy(interpreted.value, options.defaultControlPolicy);\n\t\t\t\t\tvalidateContractDomain(contract);\n\t\t\t\t\tvalidateMongoStorage(blindCast(contract));\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!isStructuredError(error)) throw error;\n\t\t\t\t\treturn notOk({\n\t\t\t\t\t\tsummary: \"Prisma 6 MongoDB schema interpretation failed\",\n\t\t\t\t\t\tdiagnostics: [prisma6Diagnostic(\"PSL.PRISMA6_MONGO_CONTRACT_INVALID\", `This schema gives a contract that Prisma 8 rejects, and the Prisma 6 MongoDB contract source has no specific diagnostic for the cause: ${error.message.replace(/\\.$/, \"\")}. This is a bug in Prisma ORM; please report it with this schema.`, schemaPath, void 0)],\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tschemaPath,\n\t\t\t\t\t\t\tcode: error.code\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn ok(contract);\n\t\t\t}\n\t\t},\n\t\toutput: options.output ?? defaultOutputFromSchemaPath(schemaPath)\n\t};\n}\n//#endregion\nex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S,gBAAgB,MAAM,QAAQ,KAAK,UAAU,aAAa;KACrF,MAAM,aAAa,QAAQ,cAAc,SAAS,MAAM;KACxD,gBAAgB,KAAK,GAAG,oBAAoB,aAAa,YAAY,KAAK,QAAQ,CAAC;KACnF,UAAU,KAAK;MACd;MACA;MACA;MACA,UAAU,KAAK;KAChB,CAAC;IACF;IACA,IAAI;IACJ,IAAI;KACH,MAAM,cAAc,0BAA0B;MAC7C;MACA;MACA,SAAS,QAAQ;MACjB,wBAAwB,QAAQ;MAChC,aAAa,QAAQ;MACrB,WAAW,QAAQ;MACnB,oBAAoB,QAAQ;KAC7B,CAAC;KACD,IAAI,CAAC,YAAY,IAAI,OAAO;KAC5B,WAAW,mCAAmC,YAAY,OAAO,QAAQ,oBAAoB;KAC7F,uBAAuB,QAAQ;KAC/B,qBAAqB,UAAU,QAAQ,CAAC;IACzC,SAAS,OAAO;KACf,IAAI,CAAC,kBAAkB,KAAK,GAAG,MAAM;KACrC,OAAO,MAAM;MACZ,SAAS;MACT,aAAa,CAAC,kBAAkB,sCAAsC,0IAA0I,MAAM,QAAQ,QAAQ,OAAO,EAAE,EAAE,oEAAoE,YAAY,KAAK,CAAC,CAAC;MACxU,MAAM;OACL;OACA,MAAM,MAAM;MACb;KACD,CAAC;IACF;IACA,OAAO,GAAG,QAAQ;GACnB;EACD;EACA,QAAQ,QAAQ,UAAU,4BAA4B,UAAU;CACjE;AACD"}
|
package/dist/contract-psl.d.mts
CHANGED
|
@@ -169,6 +169,7 @@ declare function pairMongoBackRelations(input: {
|
|
|
169
169
|
readonly foreignKeys: readonly MongoForeignKeyRelation[];
|
|
170
170
|
readonly candidates: readonly MongoBackRelationCandidate[];
|
|
171
171
|
readonly invalidFkPairings: InvalidFkPairing[];
|
|
172
|
+
readonly namespaceId: string;
|
|
172
173
|
}): {
|
|
173
174
|
readonly relations: PairedMongoBackRelation[];
|
|
174
175
|
readonly diagnostics: PslDiagnostic[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-psl.d.mts","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-psl/dist/interpreter-DTtFdfIL.d.mts","../../../../2-mongo-family/2-authoring/contract-psl/dist/index.d.mts"],"mappings":";;;;;;;;;;;;;;UASU;WACC,oBAAoB;WACpB,aAAa;WACb,SAAS;WACT,QAAQ;WACR,oBAAoB;WACpB,yBAAyB;WACzB,WAAW;WACX,aAAa;WACb,2BAA2B;WAC3B,yBAAyB;;WAEzB;aACE;aACA;;;WAGF,iBAAiB,YAAY;;iBAEvB,oCAAoC,OAAO,2CAA2C,OAAO,UAAU;;;;;;;;;KCdnH,iBAAiB;WACX,iBAAiB;;iBAEX,iBAAiB,QAAQ,eAAe,gBAAgB,SAAS,kBAAkB,eAAe,eAAe,sBAAsB,YAAY,iBAAiB;UAC3K;WACC;WACA,QAAQ,eAAe;;iBAEjB,4BAA4B,YAAY,eAAe,gBAAgB,4BAA4B,mBAAmB,sBAAsB,SAAS,kBAAkB,eAAe,eAAe,sBAAsB,YAAY,iBAAiB;;;iBAGxP,4BAA4B,eAAe,kCAAkC;;;iBAG7E,kCAAkC,SAAS,aAAa;iBACxD,iBAAiB;EAChC,qCAAqC,wBAAwB;EAC7D;GACC;cACW;WACH;aACE,MAAM,KAAK,yBAAyB;MAC3C;OACC;aACM,gBAAgB,KAAK,yBAAyB;MACrD;OACC;aACM,aAAa;aACb,QAAQ,KAAK,yBAAyB;MAC7C,iDAAiD;eACxC;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA,SAAS;eACT;eACA;eACA;eACA;OACR;aACM,SAAS,KAAK,yBAAyB;MAC9C,iDAAiD;eACxC;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA,SAAS;eACT;eACA;eACA;eACA;OACR;aACM,YAAY,KAAK,yBAAyB;MACjD,iDAAiD;eACxC;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA,SAAS;eACT,UAAU;eACV;eACA;OACR;;WAEI;aACE,KAAK,KAAK,8BAA8B,kBAAkB;aAC1D,SAAS,KAAK,8BAA8B,kBAAkB;aAC9D,MAAM,KAAK,8BAA8B;MAChD;OACC;aACM,WAAW,KAAK,8BAA8B;MACrD;eACS;eACA;OACR;;;;;;UAMG;WACC;WACA;WACA;WACA;WACA;;;UAGD;WACC;WACA;WACA;WACA;WACA,OAAO;WACP,SAAS;;UAEV;WACC;WACA;WACA,UAAU;;;;;iBAKJ,uBAAuB;WAC7B,sBAAsB;WACtB,qBAAqB;WACrB,mBAAmB;;
|
|
1
|
+
{"version":3,"file":"contract-psl.d.mts","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-psl/dist/interpreter-DTtFdfIL.d.mts","../../../../2-mongo-family/2-authoring/contract-psl/dist/index.d.mts"],"mappings":";;;;;;;;;;;;;;UASU;WACC,oBAAoB;WACpB,aAAa;WACb,SAAS;WACT,QAAQ;WACR,oBAAoB;WACpB,yBAAyB;WACzB,WAAW;WACX,aAAa;WACb,2BAA2B;WAC3B,yBAAyB;;WAEzB;aACE;aACA;;;WAGF,iBAAiB,YAAY;;iBAEvB,oCAAoC,OAAO,2CAA2C,OAAO,UAAU;;;;;;;;;KCdnH,iBAAiB;WACX,iBAAiB;;iBAEX,iBAAiB,QAAQ,eAAe,gBAAgB,SAAS,kBAAkB,eAAe,eAAe,sBAAsB,YAAY,iBAAiB;UAC3K;WACC;WACA,QAAQ,eAAe;;iBAEjB,4BAA4B,YAAY,eAAe,gBAAgB,4BAA4B,mBAAmB,sBAAsB,SAAS,kBAAkB,eAAe,eAAe,sBAAsB,YAAY,iBAAiB;;;iBAGxP,4BAA4B,eAAe,kCAAkC;;;iBAG7E,kCAAkC,SAAS,aAAa;iBACxD,iBAAiB;EAChC,qCAAqC,wBAAwB;EAC7D;GACC;cACW;WACH;aACE,MAAM,KAAK,yBAAyB;MAC3C;OACC;aACM,gBAAgB,KAAK,yBAAyB;MACrD;OACC;aACM,aAAa;aACb,QAAQ,KAAK,yBAAyB;MAC7C,iDAAiD;eACxC;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA,SAAS;eACT;eACA;eACA;eACA;OACR;aACM,SAAS,KAAK,yBAAyB;MAC9C,iDAAiD;eACxC;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA,SAAS;eACT;eACA;eACA;eACA;OACR;aACM,YAAY,KAAK,yBAAyB;MACjD,iDAAiD;eACxC;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA,SAAS;eACT,UAAU;eACV;eACA;OACR;;WAEI;aACE,KAAK,KAAK,8BAA8B,kBAAkB;aAC1D,SAAS,KAAK,8BAA8B,kBAAkB;aAC9D,MAAM,KAAK,8BAA8B;MAChD;OACC;aACM,WAAW,KAAK,8BAA8B;MACrD;eACS;eACA;OACR;;;;;;UAMG;WACC;WACA;WACA;WACA;WACA;;;UAGD;WACC;WACA;WACA;WACA;WACA,OAAO;WACP,SAAS;;UAEV;WACC;WACA;WACA,UAAU;;;;;iBAKJ,uBAAuB;WAC7B,sBAAsB;WACtB,qBAAqB;WACrB,mBAAmB;WACnB;;WAEA,WAAW;WACX,aAAa"}
|
package/dist/contract-psl.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as mongoAttributeSpecs, i as interpretPslDocumentToMongoContract, n as derivePolymorphicJsonSchema, o as pairMongoBackRelations, r as describeUnsupportedMongoAttribute, t as deriveJsonSchema } from "./interpreter-
|
|
1
|
+
import { a as mongoAttributeSpecs, i as interpretPslDocumentToMongoContract, n as derivePolymorphicJsonSchema, o as pairMongoBackRelations, r as describeUnsupportedMongoAttribute, t as deriveJsonSchema } from "./interpreter-Bhe8FSI4-uGNm4vAs.mjs";
|
|
2
2
|
import { t as describeUnresolvedMongoType } from "./dist-xk_0xOR-.mjs";
|
|
3
3
|
export { deriveJsonSchema, derivePolymorphicJsonSchema, describeUnresolvedMongoType, describeUnsupportedMongoAttribute, interpretPslDocumentToMongoContract, mongoAttributeSpecs, pairMongoBackRelations };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as interpretPslDocumentToMongoContract } from "./interpreter-
|
|
1
|
+
import { i as interpretPslDocumentToMongoContract } from "./interpreter-Bhe8FSI4-uGNm4vAs.mjs";
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
3
|
import { parse } from "@prisma/orm-framework/psl-parser/syntax";
|
|
4
4
|
import { notOk } from "@prisma/orm-framework/utils/result";
|
|
@@ -86,7 +86,8 @@ function mongoContract(schemaPath, options) {
|
|
|
86
86
|
const seedDiagnostics = [...readDiagnostics, ...mapPslDiagnostics(parsed.flatMap(({ diagnostics }) => diagnostics), sources)];
|
|
87
87
|
const { symbolTable, diagnostics: symbolTableDiagnostics } = buildSymbolTable({
|
|
88
88
|
documents,
|
|
89
|
-
sources
|
|
89
|
+
sources,
|
|
90
|
+
defaultNamespaceId: context.defaultNamespaceId
|
|
90
91
|
});
|
|
91
92
|
const { binder, diagnostics: binderDiagnostics } = createBinder({
|
|
92
93
|
symbolTable,
|