@prisma/orm-family-mongo 8.0.0-rc.13-dev.1 → 8.0.0-rc.13-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{authoring-entity-types-CZX-S_hY-w2tu7EVk.mjs → authoring-entity-types-Ctbm8zR5-NEMkwnme.mjs} +33 -42
- package/dist/authoring-entity-types-Ctbm8zR5-NEMkwnme.mjs.map +1 -0
- package/dist/contract-prisma6__provider.mjs +16 -20
- package/dist/contract-prisma6__provider.mjs.map +1 -1
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__provider.mjs +2 -3
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/{control-DRB8P8fy.mjs → control-CCEXS0ul.mjs} +3 -3
- package/dist/{control-DRB8P8fy.mjs.map → control-CCEXS0ul.mjs.map} +1 -1
- package/dist/family.d.mts +1 -1
- package/dist/family.mjs +2 -2
- package/dist/family__control.mjs +1 -1
- package/dist/family__pack.d.mts +1 -1
- package/dist/family__pack.mjs +2 -2
- package/dist/family__pack.mjs.map +1 -1
- package/dist/{interpreter-EqDVFiIr-C-rDel_u.mjs → interpreter-Byn7x79Q-BgOpCN1s.mjs} +17 -7
- package/dist/interpreter-Byn7x79Q-BgOpCN1s.mjs.map +1 -0
- package/dist/{pack-BUb_cutQ.d.mts → pack-Dqa_jXtB.d.mts} +21 -21
- package/dist/pack-Dqa_jXtB.d.mts.map +1 -0
- package/package.json +20 -20
- package/dist/authoring-entity-types-CZX-S_hY-w2tu7EVk.mjs.map +0 -1
- package/dist/interpreter-EqDVFiIr-C-rDel_u.mjs.map +0 -1
- package/dist/pack-BUb_cutQ.d.mts.map +0 -1
|
@@ -2,16 +2,22 @@ import "@prisma/orm-framework/components/ir";
|
|
|
2
2
|
import "@prisma/orm-framework/contract/types";
|
|
3
3
|
import "@prisma/orm-framework/contract/hashing";
|
|
4
4
|
import "@prisma/orm-framework/errors/control";
|
|
5
|
-
import
|
|
5
|
+
import "@prisma/orm-framework/utils/casts";
|
|
6
6
|
import { enumType } from "@prisma/orm-framework/contract-authoring";
|
|
7
7
|
import { resolveEnumCodecId } from "@prisma/orm-framework/components/authoring";
|
|
8
|
-
import { blockAttribute, str } from "@prisma/orm-framework/psl-parser";
|
|
8
|
+
import { blockAttribute, jsonValue, mapBlock, str } from "@prisma/orm-framework/psl-parser";
|
|
9
9
|
import "@prisma/orm-framework/utils/defined";
|
|
10
10
|
import "@prisma/orm-framework/components/control";
|
|
11
11
|
import "@prisma/orm-framework/utils/canonical-stringify";
|
|
12
|
-
//#region ../../../2-mongo-family/9-family/dist/authoring-entity-types-
|
|
13
|
-
function
|
|
14
|
-
return
|
|
12
|
+
//#region ../../../2-mongo-family/9-family/dist/authoring-entity-types-Ctbm8zR5.mjs
|
|
13
|
+
function mongoFamilyEnumSpec() {
|
|
14
|
+
return mapBlock({
|
|
15
|
+
value: {
|
|
16
|
+
type: jsonValue(),
|
|
17
|
+
documentation: "The stored member value; a bare member stores its own name."
|
|
18
|
+
},
|
|
19
|
+
allowBare: true
|
|
20
|
+
});
|
|
15
21
|
}
|
|
16
22
|
const mongoFamilyEntityTypes = { enum: {
|
|
17
23
|
kind: "entity",
|
|
@@ -28,7 +34,7 @@ const mongoFamilyEntityTypes = { enum: {
|
|
|
28
34
|
code: "PSL_EXTENSION_INVALID_VALUE",
|
|
29
35
|
message: `enum "${block.name}" @@type references unknown codec "${codecId}"`,
|
|
30
36
|
sourceId,
|
|
31
|
-
span:
|
|
37
|
+
span: codecSpan
|
|
32
38
|
});
|
|
33
39
|
return;
|
|
34
40
|
}
|
|
@@ -38,7 +44,7 @@ const mongoFamilyEntityTypes = { enum: {
|
|
|
38
44
|
code: "PSL_EXTENSION_INVALID_VALUE",
|
|
39
45
|
message: `enum "${block.name}" @@type codec "${codecId}" declares ${bsonTypes.length} BSON types; an enum needs exactly one`,
|
|
40
46
|
sourceId,
|
|
41
|
-
span:
|
|
47
|
+
span: codecSpan
|
|
42
48
|
});
|
|
43
49
|
return;
|
|
44
50
|
}
|
|
@@ -55,55 +61,41 @@ const mongoFamilyEntityTypes = { enum: {
|
|
|
55
61
|
const seenValues = /* @__PURE__ */ new Set();
|
|
56
62
|
const members = [];
|
|
57
63
|
let memberError = false;
|
|
58
|
-
for (const [memberName,
|
|
64
|
+
for (const [memberName, memberValue] of Object.entries(block.values)) {
|
|
65
|
+
const span = block.parameterSpans[memberName] ?? block.span;
|
|
59
66
|
let value;
|
|
60
|
-
if (
|
|
67
|
+
if (memberValue === void 0) try {
|
|
61
68
|
value = codec.decodeJson(memberName);
|
|
62
69
|
} catch {
|
|
63
70
|
diagnostics?.push({
|
|
64
71
|
code: "PSL_ENUM_BARE_MEMBER_NON_STRING_CODEC",
|
|
65
72
|
message: `enum "${block.name}" member "${memberName}" has no value and codec "${codecId}" does not accept a bare name as input`,
|
|
66
73
|
sourceId,
|
|
67
|
-
span
|
|
74
|
+
span
|
|
75
|
+
});
|
|
76
|
+
memberError = true;
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
else try {
|
|
80
|
+
value = codec.decodeJson(memberValue);
|
|
81
|
+
} catch (err) {
|
|
82
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
83
|
+
diagnostics?.push({
|
|
84
|
+
code: "PSL_EXTENSION_INVALID_VALUE",
|
|
85
|
+
message: `enum "${block.name}" member "${memberName}" was rejected by codec "${codecId}": ${reason}`,
|
|
86
|
+
sourceId,
|
|
87
|
+
span
|
|
68
88
|
});
|
|
69
89
|
memberError = true;
|
|
70
90
|
continue;
|
|
71
91
|
}
|
|
72
|
-
else if (paramValue.kind === "value") {
|
|
73
|
-
let jsonValue;
|
|
74
|
-
try {
|
|
75
|
-
jsonValue = JSON.parse(paramValue.raw);
|
|
76
|
-
} catch {
|
|
77
|
-
diagnostics?.push({
|
|
78
|
-
code: "PSL_EXTENSION_INVALID_VALUE",
|
|
79
|
-
message: `enum "${block.name}" member "${memberName}" value "${paramValue.raw}" is not valid JSON`,
|
|
80
|
-
sourceId,
|
|
81
|
-
span: paramValue.span
|
|
82
|
-
});
|
|
83
|
-
memberError = true;
|
|
84
|
-
continue;
|
|
85
|
-
}
|
|
86
|
-
try {
|
|
87
|
-
value = codec.decodeJson(blindCast(jsonValue));
|
|
88
|
-
} catch (err) {
|
|
89
|
-
const reason = err instanceof Error ? err.message : String(err);
|
|
90
|
-
diagnostics?.push({
|
|
91
|
-
code: "PSL_EXTENSION_INVALID_VALUE",
|
|
92
|
-
message: `enum "${block.name}" member "${memberName}" was rejected by codec "${codecId}": ${reason}`,
|
|
93
|
-
sourceId,
|
|
94
|
-
span: paramValue.span
|
|
95
|
-
});
|
|
96
|
-
memberError = true;
|
|
97
|
-
continue;
|
|
98
|
-
}
|
|
99
|
-
} else continue;
|
|
100
92
|
const valueKey = String(value);
|
|
101
93
|
if (seenValues.has(valueKey)) {
|
|
102
94
|
diagnostics?.push({
|
|
103
95
|
code: "PSL_ENUM_DUPLICATE_MEMBER_VALUE",
|
|
104
96
|
message: `enum "${block.name}": duplicate member value "${valueKey}"`,
|
|
105
97
|
sourceId,
|
|
106
|
-
span
|
|
98
|
+
span
|
|
107
99
|
});
|
|
108
100
|
memberError = true;
|
|
109
101
|
continue;
|
|
@@ -147,11 +139,10 @@ const mongoFamilyPslBlockDescriptors = { enum: {
|
|
|
147
139
|
documentation: "Defines an enum with named values and an inferred or explicitly selected storage codec.",
|
|
148
140
|
discriminator: "enum",
|
|
149
141
|
name: { required: true },
|
|
150
|
-
|
|
151
|
-
variadicParameters: true,
|
|
142
|
+
spec: mongoFamilyEnumSpec,
|
|
152
143
|
attributes: { type: () => enumTypeBlockAttribute }
|
|
153
144
|
} };
|
|
154
145
|
//#endregion
|
|
155
146
|
export { mongoFamilyPslBlockDescriptors as n, mongoFamilyEntityTypes as t };
|
|
156
147
|
|
|
157
|
-
//# sourceMappingURL=authoring-entity-types-
|
|
148
|
+
//# sourceMappingURL=authoring-entity-types-Ctbm8zR5-NEMkwnme.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoring-entity-types-Ctbm8zR5-NEMkwnme.mjs","names":[],"sources":["../../../../2-mongo-family/9-family/dist/authoring-entity-types-Ctbm8zR5.mjs"],"sourcesContent":["import \"@internal/utils/defined\";\nimport { resolveEnumCodecId } from \"@internal/framework-components/authoring\";\nimport \"@internal/contract/hashing\";\nimport \"@internal/contract/types\";\nimport { enumType } from \"@internal/contract-authoring\";\nimport \"@internal/errors/control\";\nimport \"@internal/framework-components/control\";\nimport \"@internal/framework-components/ir\";\nimport \"@internal/mongo-contract\";\nimport \"@internal/mongo-contract/canonicalization-hooks\";\nimport \"@internal/utils/canonical-stringify\";\nimport \"@internal/utils/casts\";\nimport { blockAttribute, jsonValue, mapBlock, str } from \"@internal/psl-parser\";\n//#region src/core/authoring-entity-types.ts\nfunction mongoFamilyEnumSpec() {\n\treturn mapBlock({\n\t\tvalue: {\n\t\t\ttype: jsonValue(),\n\t\t\tdocumentation: \"The stored member value; a bare member stores its own name.\"\n\t\t},\n\t\tallowBare: true\n\t});\n}\nconst mongoFamilyEntityTypes = { enum: {\n\tkind: \"entity\",\n\tdiscriminator: \"enum\",\n\toutput: { factory: (block, ctx) => {\n\t\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\t\tconst diagnostics = ctx.diagnostics;\n\t\tconst resolved = resolveEnumCodecId(block, ctx);\n\t\tif (resolved === void 0) return;\n\t\tconst { codecId, codecSpan } = resolved;\n\t\tconst bsonTypes = ctx.codecLookup?.targetTypesFor(codecId);\n\t\tif (bsonTypes === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type references unknown codec \"${codecId}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst [bsonType, ...otherBsonTypes] = bsonTypes;\n\t\tif (bsonType === void 0 || otherBsonTypes.length > 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type codec \"${codecId}\" declares ${bsonTypes.length} BSON types; an enum needs exactly one`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst codec = ctx.codecLookup?.get(codecId);\n\t\tif (codec === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type codec \"${codecId}\" resolves in targetTypesFor but is absent from codecLookup.get`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst seenValues = /* @__PURE__ */ new Set();\n\t\tconst members = [];\n\t\tlet memberError = false;\n\t\tfor (const [memberName, memberValue] of Object.entries(block.values)) {\n\t\t\tconst span = block.parameterSpans[memberName] ?? block.span;\n\t\t\tlet value;\n\t\t\tif (memberValue === void 0) try {\n\t\t\t\tvalue = codec.decodeJson(memberName);\n\t\t\t} catch {\n\t\t\t\tdiagnostics?.push({\n\t\t\t\t\tcode: \"PSL_ENUM_BARE_MEMBER_NON_STRING_CODEC\",\n\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" has no value and codec \"${codecId}\" does not accept a bare name as input`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan\n\t\t\t\t});\n\t\t\t\tmemberError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse try {\n\t\t\t\tvalue = codec.decodeJson(memberValue);\n\t\t\t} catch (err) {\n\t\t\t\tconst reason = err instanceof Error ? err.message : String(err);\n\t\t\t\tdiagnostics?.push({\n\t\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" was rejected by codec \"${codecId}\": ${reason}`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan\n\t\t\t\t});\n\t\t\t\tmemberError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst valueKey = String(value);\n\t\t\tif (seenValues.has(valueKey)) {\n\t\t\t\tdiagnostics?.push({\n\t\t\t\t\tcode: \"PSL_ENUM_DUPLICATE_MEMBER_VALUE\",\n\t\t\t\t\tmessage: `enum \"${block.name}\": duplicate member value \"${valueKey}\"`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan\n\t\t\t\t});\n\t\t\t\tmemberError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tseenValues.add(valueKey);\n\t\t\tmembers.push({\n\t\t\t\tname: memberName,\n\t\t\t\tvalue\n\t\t\t});\n\t\t}\n\t\tif (memberError) return void 0;\n\t\tif (members.length === 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_ENUM_MISSING_TYPE\",\n\t\t\t\tmessage: `enum \"${block.name}\" must have at least one member`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: block.span\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\treturn enumType(block.name, {\n\t\t\tcodecId,\n\t\t\tnativeType: bsonType\n\t\t}, ...members.map((m) => ({\n\t\t\tname: m.name,\n\t\t\tvalue: m.value\n\t\t})));\n\t} }\n} };\nconst enumTypeBlockAttribute = blockAttribute(\"type\", {\n\tdocumentation: \"Selects the storage codec for this enum.\",\n\tpositional: [{\n\t\tkey: \"codecId\",\n\t\ttype: str(),\n\t\tdocumentation: \"The fully qualified codec identifier used to store enum values.\"\n\t}]\n});\nconst mongoFamilyPslBlockDescriptors = { enum: {\n\tkind: \"pslBlock\",\n\tkeyword: \"enum\",\n\tdocumentation: \"Defines an enum with named values and an inferred or explicitly selected storage codec.\",\n\tdiscriminator: \"enum\",\n\tname: { required: true },\n\tspec: mongoFamilyEnumSpec,\n\tattributes: { type: () => enumTypeBlockAttribute }\n} };\n//#endregion\nexport { mongoFamilyPslBlockDescriptors as n, mongoFamilyEntityTypes as t };\n\n//# sourceMappingURL=authoring-entity-types-Ctbm8zR5.mjs.map"],"mappings":";;;;;;;;;;;;AAcA,SAAS,sBAAsB;CAC9B,OAAO,SAAS;EACf,OAAO;GACN,MAAM,UAAU;GAChB,eAAe;EAChB;EACA,WAAW;CACZ,CAAC;AACF;AACA,MAAM,yBAAyB,EAAE,MAAM;CACtC,MAAM;CACN,eAAe;CACf,QAAQ,EAAE,UAAU,OAAO,QAAQ;EAClC,MAAM,WAAW,IAAI,YAAY;EACjC,MAAM,cAAc,IAAI;EACxB,MAAM,WAAW,mBAAmB,OAAO,GAAG;EAC9C,IAAI,aAAa,KAAK,GAAG;EACzB,MAAM,EAAE,SAAS,cAAc;EAC/B,MAAM,YAAY,IAAI,aAAa,eAAe,OAAO;EACzD,IAAI,cAAc,KAAK,GAAG;GACzB,aAAa,KAAK;IACjB,MAAM;IACN,SAAS,SAAS,MAAM,KAAK,qCAAqC,QAAQ;IAC1E;IACA,MAAM;GACP,CAAC;GACD;EACD;EACA,MAAM,CAAC,UAAU,GAAG,kBAAkB;EACtC,IAAI,aAAa,KAAK,KAAK,eAAe,SAAS,GAAG;GACrD,aAAa,KAAK;IACjB,MAAM;IACN,SAAS,SAAS,MAAM,KAAK,kBAAkB,QAAQ,aAAa,UAAU,OAAO;IACrF;IACA,MAAM;GACP,CAAC;GACD;EACD;EACA,MAAM,QAAQ,IAAI,aAAa,IAAI,OAAO;EAC1C,IAAI,UAAU,KAAK,GAAG;GACrB,aAAa,KAAK;IACjB,MAAM;IACN,SAAS,SAAS,MAAM,KAAK,kBAAkB,QAAQ;IACvD;IACA,MAAM;GACP,CAAC;GACD;EACD;EACA,MAAM,6BAA6B,IAAI,IAAI;EAC3C,MAAM,UAAU,CAAC;EACjB,IAAI,cAAc;EAClB,KAAK,MAAM,CAAC,YAAY,gBAAgB,OAAO,QAAQ,MAAM,MAAM,GAAG;GACrE,MAAM,O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E,MAAM;CAC9C,MAAM;CACN,SAAS;CACT,eAAe;CACf,eAAe;CACf,MAAM,EAAE,UAAU,KAAK;CACvB,MAAM;CACN,YAAY,EAAE,YAAY,uBAAuB;AAClD,EAAE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as MongoIndex } from "./entity-kinds-BFgLffz7-D8WUc2oo.mjs";
|
|
2
2
|
import { f as encodeMongoValueSets, l as buildMongoStorage, m as validateMongoStorage } from "./dist-Dvr-nVtl.mjs";
|
|
3
|
-
import { a as pairMongoBackRelations } from "./interpreter-
|
|
3
|
+
import { a as pairMongoBackRelations } from "./interpreter-Byn7x79Q-BgOpCN1s.mjs";
|
|
4
4
|
import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
5
5
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
6
6
|
import { crossRef } from "@prisma/orm-framework/contract/types";
|
|
@@ -174,8 +174,7 @@ function interpretPrisma6Documents(input) {
|
|
|
174
174
|
for (const { document, sources, sourceFile, sourceId } of input.documents) {
|
|
175
175
|
const { symbolTable, diagnostics: tableDiagnostics } = buildSymbolTable({
|
|
176
176
|
documents: [document],
|
|
177
|
-
sources
|
|
178
|
-
pslBlockDescriptors: {}
|
|
177
|
+
sources
|
|
179
178
|
});
|
|
180
179
|
for (const diagnostic of tableDiagnostics) diagnostics.push({
|
|
181
180
|
code: diagnostic.code,
|
|
@@ -309,16 +308,15 @@ function checkDatasource(datasources, fallbackSourceId, binding, diagnostics) {
|
|
|
309
308
|
diagnostics.push(prisma6Diagnostic("PSL.PRISMA6_MONGO_PROVIDER_MISMATCH", `No datasource block found; add \`datasource db { provider = "${namedProvider}" }\`.`, fallbackSourceId, void 0));
|
|
310
309
|
return;
|
|
311
310
|
}
|
|
312
|
-
const block = datasource.symbol
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
provider = typeof parsed === "string" ? parsed : void 0;
|
|
318
|
-
} catch {
|
|
319
|
-
provider = void 0;
|
|
311
|
+
const block = datasource.symbol;
|
|
312
|
+
let parameter;
|
|
313
|
+
for (const entry of block.node.entries()) if (entry.key()?.name() === "provider") {
|
|
314
|
+
parameter = entry;
|
|
315
|
+
break;
|
|
320
316
|
}
|
|
321
|
-
|
|
317
|
+
const expression = parameter?.value();
|
|
318
|
+
const provider = expression instanceof StringLiteralExprAst ? expression.value() : void 0;
|
|
319
|
+
if (provider === void 0 || !binding.providers.includes(provider)) diagnostics.push(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)));
|
|
322
320
|
}
|
|
323
321
|
function buildEnum(located, input, diagnostics) {
|
|
324
322
|
const { symbol: block, sourceId, sources } = located;
|
|
@@ -330,7 +328,8 @@ function buildEnum(located, input, diagnostics) {
|
|
|
330
328
|
}
|
|
331
329
|
diagnostics.push(unknownAttribute(`Enum "${block.name}"`, attribute, "@@", sourceId));
|
|
332
330
|
}
|
|
333
|
-
const
|
|
331
|
+
const values = Object.create(null);
|
|
332
|
+
const parameterSpans = Object.create(null);
|
|
334
333
|
for (const entry of block.node.entries()) {
|
|
335
334
|
const name = entry.key()?.name();
|
|
336
335
|
if (name === void 0) continue;
|
|
@@ -340,11 +339,8 @@ function buildEnum(located, input, diagnostics) {
|
|
|
340
339
|
if (attribute.name === "map") value = requireString(attribute, `Enum member "${block.name}.${name}"`, sourceId, diagnostics) ?? value;
|
|
341
340
|
else diagnostics.push(unknownAttribute(`Enum member "${block.name}.${name}"`, attribute, "@", sourceId));
|
|
342
341
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
raw: JSON.stringify(value),
|
|
346
|
-
span: nodePslSpan(entry.syntax, sources)
|
|
347
|
-
};
|
|
342
|
+
values[name] = value;
|
|
343
|
+
parameterSpans[name] = nodePslSpan(entry.syntax, sources);
|
|
348
344
|
}
|
|
349
345
|
const descriptor = input.authoringContributions.entityTypes["enum"];
|
|
350
346
|
if (descriptor === void 0 || !isAuthoringEntityTypeDescriptor(descriptor)) {
|
|
@@ -373,8 +369,8 @@ function buildEnum(located, input, diagnostics) {
|
|
|
373
369
|
kind: "enum",
|
|
374
370
|
keyword: "enum",
|
|
375
371
|
name: block.name,
|
|
376
|
-
|
|
377
|
-
|
|
372
|
+
values,
|
|
373
|
+
parameterSpans,
|
|
378
374
|
attributes: {},
|
|
379
375
|
span: block.span
|
|
380
376
|
}], context);
|
|
@@ -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, encodeMongoValueSets, validateMongoStorage } from \"@internal/mongo-contract\";\nimport { ArrayLiteralAst, FunctionCallAst, IdentifierAst, StringLiteralExprAst, parse } 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 { 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, readResolvedAttributes } 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 = call?.path() ?? [];\n\t\tconst [callee] = path;\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.`, 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\tpslBlockDescriptors: {}\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\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\tbreak;\n\t\t\tcase \"generator\": break;\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.`, 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 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\tcheckDatasource(datasources, input.documents[0]?.sourceId ?? \"schema.prisma\", binding, diagnostics);\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 typeContext = {\n\t\tbinding,\n\t\tenums,\n\t\tcompositeTypeNames: new Set(compositeTypes.map((c) => c.symbol.name)),\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\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\tcodecLookup: input.codecLookup\n\t}));\n}\nfunction checkDatasource(datasources, fallbackSourceId, binding, diagnostics) {\n\tconst [datasource] = datasources;\n\tconst [namedProvider] = binding.providers;\n\tif (datasource === void 0) {\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_PROVIDER_MISMATCH\", `No datasource block found; add \\`datasource db { provider = \"${namedProvider}\" }\\`.`, fallbackSourceId, void 0));\n\t\treturn;\n\t}\n\tconst block = datasource.symbol.block;\n\tconst parameter = block.parameters[\"provider\"];\n\tlet provider;\n\tif (parameter?.kind === \"value\") try {\n\t\tconst parsed = JSON.parse(parameter.raw);\n\t\tprovider = typeof parsed === \"string\" ? parsed : void 0;\n\t} catch {\n\t\tprovider = void 0;\n\t}\n\tif (provider === void 0 || !binding.providers.includes(provider)) diagnostics.push(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 : parameter.span));\n}\nfunction buildEnum(located, input, diagnostics) {\n\tconst { symbol: block, sourceId, sources } = located;\n\tfor (const attribute of readResolvedAttributes(block.node.attributes(), sources)) {\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 parameters = {};\n\tfor (const entry of block.node.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\tparameters[name] = {\n\t\t\tkind: \"value\",\n\t\t\traw: JSON.stringify(value),\n\t\t\tspan: nodePslSpan(entry.syntax, sources)\n\t\t};\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\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\tparameters,\n\t\tblockAttributes: [],\n\t\tattributes: {},\n\t\tspan: block.span\n\t}], context);\n\tif (handle === void 0 || handle === null) return void 0;\n\treturn {\n\t\tcodecId: handle.codecId,\n\t\tmembers: handle.enumMembers.map((member) => ({\n\t\t\tname: member.name,\n\t\t\tvalue: member.value\n\t\t}))\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 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\", attribute.name === \"db.ObjectId\" ? `${label}: @db.ObjectId is only supported on a String field, and this field is \"${field.typeName}\". Remove @db.ObjectId, or change the field type to String.` : `${label}: native type \"@${attribute.name}\" is not supported by the Prisma 6 MongoDB contract source; only @db.ObjectId is. Remove it: the stored BSON type then follows the field type.`, sourceId, attribute.span));\n\t};\n\tconst many = field.list ? { many: true } : {};\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\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\tif (nativeType.name !== \"db.ObjectId\" || field.typeName !== \"String\") return nativeTypeUnsupported(nativeType);\n\t\tcodecId = binding.objectIdCodecId;\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, 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}\nfunction defaultUnsupported(label, attribute, 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. Remove the default and set the value when you create documents.`, 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};\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], `@unique on field \"${symbol.name}.${field.name}\"`, 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});\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 resolved = resolveFieldType(field, {\n\t\tkind: \"model\",\n\t\tname: symbol.name\n\t}, 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\\`.`, 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, 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. Remove @updatedAt and set the value when you write documents.`, 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, 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\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_OPTIONAL_GENERATED_FIELD_UNSUPPORTED\", `${label} is optional and its value comes from ${written === void 0 ? \"a generator\" : attributeText(written)}, which Prisma 8 cannot express on an optional field yet. Make the field required, or remove ${written === void 0 ? \"the generator\" : attributeText(written)} and set the value when you write documents.`, 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}\nfunction readRelationArguments(attribute, label, sourceId, diagnostics) {\n\tlet name;\n\tlet fields;\n\tlet references;\n\tconst invalid = (what, span) => {\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) return 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) return 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) return 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\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\".` : `${label}: @relation argument \"${key}\" is not supported; Prisma 8 enforces no referential actions on MongoDB. Remove \"${key}\" and handle related documents in application code.`, sourceId, arg.span));\n\t\t\t\treturn;\n\t\t\tdefault: return invalid(`argument \"${key ?? \"\"}\" is not supported`, arg.span);\n\t\t}\n\t}\n\treturn {\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\treturn prisma6Diagnostic(\"PSL.PRISMA6_MONGO_IGNORED_FIELD_REFERENCED\", `${one ? \"Field\" : \"Fields\"} ${fields} ${one ? \"is\" : \"are\"} marked @ignore, but ${usedBy} uses ${one ? \"it\" : \"them\"}. Remove @ignore from ${fields}, or remove ${usedBy}.`, 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, 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.`, 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, `relation field \"${symbol.name}.${field.name}\"`, 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, `relation field \"${symbol.name}.${field.name}\"`, 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 = build.uniqueFields.includes(attribute) ? `@unique on field \"${symbol.name}.${attribute.fields[0]?.name ?? \"\"}\"` : `@@${attribute.kind} on model \"${symbol.name}\"`;\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 = {};\n\tfor (const [enumName, built] of input.enums) builtEnums[enumName] = {\n\t\tcodecId: built.codecId,\n\t\tmembers: built.members.map((member) => ({\n\t\t\tname: member.name,\n\t\t\tvalue: blindCast(member.value)\n\t\t}))\n\t};\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: encodeMongoValueSets(Object.fromEntries(input.enums), input.codecLookup)\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 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\treturn {\n\t\tsource: {\n\t\t\tformat: \"psl\",\n\t\t\tinputs: [schemaPath],\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 message = String(error);\n\t\t\t\t\treturn readFailure(schemaPath, message, {\n\t\t\t\t\t\tschemaPath,\n\t\t\t\t\t\tabsolutePath,\n\t\t\t\t\t\tcause: message\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);\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});\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,gD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AAI,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, encodeMongoValueSets, validateMongoStorage } from \"@internal/mongo-contract\";\nimport { ArrayLiteralAst, FunctionCallAst, IdentifierAst, StringLiteralExprAst, parse } 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 { 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, readResolvedAttributes } 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 = call?.path() ?? [];\n\t\tconst [callee] = path;\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.`, 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\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\tbreak;\n\t\t\tcase \"generator\": break;\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.`, 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 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\tcheckDatasource(datasources, input.documents[0]?.sourceId ?? \"schema.prisma\", binding, diagnostics);\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 typeContext = {\n\t\tbinding,\n\t\tenums,\n\t\tcompositeTypeNames: new Set(compositeTypes.map((c) => c.symbol.name)),\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\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\tcodecLookup: input.codecLookup\n\t}));\n}\nfunction checkDatasource(datasources, fallbackSourceId, binding, diagnostics) {\n\tconst [datasource] = datasources;\n\tconst [namedProvider] = binding.providers;\n\tif (datasource === void 0) {\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_PROVIDER_MISMATCH\", `No datasource block found; add \\`datasource db { provider = \"${namedProvider}\" }\\`.`, fallbackSourceId, void 0));\n\t\treturn;\n\t}\n\tconst block = datasource.symbol;\n\tlet parameter;\n\tfor (const entry of block.node.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)) diagnostics.push(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 readResolvedAttributes(block.node.attributes(), sources)) {\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.node.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\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\treturn {\n\t\tcodecId: handle.codecId,\n\t\tmembers: handle.enumMembers.map((member) => ({\n\t\t\tname: member.name,\n\t\t\tvalue: member.value\n\t\t}))\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 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\", attribute.name === \"db.ObjectId\" ? `${label}: @db.ObjectId is only supported on a String field, and this field is \"${field.typeName}\". Remove @db.ObjectId, or change the field type to String.` : `${label}: native type \"@${attribute.name}\" is not supported by the Prisma 6 MongoDB contract source; only @db.ObjectId is. Remove it: the stored BSON type then follows the field type.`, sourceId, attribute.span));\n\t};\n\tconst many = field.list ? { many: true } : {};\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\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\tif (nativeType.name !== \"db.ObjectId\" || field.typeName !== \"String\") return nativeTypeUnsupported(nativeType);\n\t\tcodecId = binding.objectIdCodecId;\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, 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}\nfunction defaultUnsupported(label, attribute, 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. Remove the default and set the value when you create documents.`, 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};\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], `@unique on field \"${symbol.name}.${field.name}\"`, 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});\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 resolved = resolveFieldType(field, {\n\t\tkind: \"model\",\n\t\tname: symbol.name\n\t}, 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\\`.`, 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, 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. Remove @updatedAt and set the value when you write documents.`, 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, 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\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_OPTIONAL_GENERATED_FIELD_UNSUPPORTED\", `${label} is optional and its value comes from ${written === void 0 ? \"a generator\" : attributeText(written)}, which Prisma 8 cannot express on an optional field yet. Make the field required, or remove ${written === void 0 ? \"the generator\" : attributeText(written)} and set the value when you write documents.`, 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}\nfunction readRelationArguments(attribute, label, sourceId, diagnostics) {\n\tlet name;\n\tlet fields;\n\tlet references;\n\tconst invalid = (what, span) => {\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) return 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) return 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) return 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\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\".` : `${label}: @relation argument \"${key}\" is not supported; Prisma 8 enforces no referential actions on MongoDB. Remove \"${key}\" and handle related documents in application code.`, sourceId, arg.span));\n\t\t\t\treturn;\n\t\t\tdefault: return invalid(`argument \"${key ?? \"\"}\" is not supported`, arg.span);\n\t\t}\n\t}\n\treturn {\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\treturn prisma6Diagnostic(\"PSL.PRISMA6_MONGO_IGNORED_FIELD_REFERENCED\", `${one ? \"Field\" : \"Fields\"} ${fields} ${one ? \"is\" : \"are\"} marked @ignore, but ${usedBy} uses ${one ? \"it\" : \"them\"}. Remove @ignore from ${fields}, or remove ${usedBy}.`, 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, 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.`, 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, `relation field \"${symbol.name}.${field.name}\"`, 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, `relation field \"${symbol.name}.${field.name}\"`, 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 = build.uniqueFields.includes(attribute) ? `@unique on field \"${symbol.name}.${attribute.fields[0]?.name ?? \"\"}\"` : `@@${attribute.kind} on model \"${symbol.name}\"`;\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 = {};\n\tfor (const [enumName, built] of input.enums) builtEnums[enumName] = {\n\t\tcodecId: built.codecId,\n\t\tmembers: built.members.map((member) => ({\n\t\t\tname: member.name,\n\t\t\tvalue: blindCast(member.value)\n\t\t}))\n\t};\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: encodeMongoValueSets(Object.fromEntries(input.enums), input.codecLookup)\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 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\treturn {\n\t\tsource: {\n\t\t\tformat: \"psl\",\n\t\t\tinputs: [schemaPath],\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 message = String(error);\n\t\t\t\t\treturn readFailure(schemaPath, message, {\n\t\t\t\t\t\tschemaPath,\n\t\t\t\t\t\tabsolutePath,\n\t\t\t\t\t\tcause: message\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);\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});\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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;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.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as pairMongoBackRelations, i as mongoAttributeSpecs, n as derivePolymorphicJsonSchema, r as interpretPslDocumentToMongoContract, t as deriveJsonSchema } from "./interpreter-
|
|
1
|
+
import { a as pairMongoBackRelations, i as mongoAttributeSpecs, n as derivePolymorphicJsonSchema, r as interpretPslDocumentToMongoContract, t as deriveJsonSchema } from "./interpreter-Byn7x79Q-BgOpCN1s.mjs";
|
|
2
2
|
export { deriveJsonSchema, derivePolymorphicJsonSchema, interpretPslDocumentToMongoContract, mongoAttributeSpecs, pairMongoBackRelations };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as interpretPslDocumentToMongoContract } from "./interpreter-
|
|
1
|
+
import { r as interpretPslDocumentToMongoContract } from "./interpreter-Byn7x79Q-BgOpCN1s.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";
|
|
@@ -87,8 +87,7 @@ function mongoContract(schemaPath, options) {
|
|
|
87
87
|
const sources = firstSources.merge(...restSources);
|
|
88
88
|
const { symbolTable, diagnostics: symbolTableDiagnostics } = buildSymbolTable({
|
|
89
89
|
documents,
|
|
90
|
-
sources
|
|
91
|
-
pslBlockDescriptors: context.authoringContributions.pslBlockDescriptors
|
|
90
|
+
sources
|
|
92
91
|
});
|
|
93
92
|
const seedDiagnostics = [...readDiagnostics, ...mapPslDiagnostics([...parsed.flatMap(({ diagnostics }) => diagnostics), ...symbolTableDiagnostics], sources)];
|
|
94
93
|
return withSeedDiagnostics(this.interpret({
|