@prisma/orm-framework 8.0.0-rc.21-dev.6 → 8.0.0-rc.21-dev.8

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.
Files changed (99) hide show
  1. package/dist/{authoring-D75oR8Nt.d.mts → authoring-BKOoGNxH.d.mts} +56 -4
  2. package/dist/authoring-BKOoGNxH.d.mts.map +1 -0
  3. package/dist/{authoring-4wc_1ETR.mjs → authoring-CcfXu8Dz.mjs} +377 -31
  4. package/dist/authoring-CcfXu8Dz.mjs.map +1 -0
  5. package/dist/{framework-authoring-ebqZ8M_M-Bdi8MutX.d.mts → authoring-type-choice-CHcRX0RP-CkG1L8a9.d.mts} +111 -27
  6. package/dist/authoring-type-choice-CHcRX0RP-CkG1L8a9.d.mts.map +1 -0
  7. package/dist/{binder-BszqDG1t-pSH-fXt5.d.mts → binder-CMy3WM5A-DRrDzBAq.d.mts} +35 -17
  8. package/dist/{binder-BszqDG1t-pSH-fXt5.d.mts.map → binder-CMy3WM5A-DRrDzBAq.d.mts.map} +1 -1
  9. package/dist/{components-CHWGZJ5q.d.mts → components-BvnVHOK3.d.mts} +3 -3
  10. package/dist/{components-CHWGZJ5q.d.mts.map → components-BvnVHOK3.d.mts.map} +1 -1
  11. package/dist/components.d.mts +11 -11
  12. package/dist/components.mjs +4 -4
  13. package/dist/components__authoring.d.mts +4 -4
  14. package/dist/components__authoring.mjs +3 -3
  15. package/dist/components__components.d.mts +3 -3
  16. package/dist/components__control.d.mts +3 -3
  17. package/dist/components__control.mjs +2 -2
  18. package/dist/components__execution.d.mts +1 -1
  19. package/dist/components__psl-ast.d.mts +3 -3
  20. package/dist/components__runtime.d.mts +2 -2
  21. package/dist/{config-types-B0JjhuaX.d.mts → config-types-De3gHQOy.d.mts} +5 -5
  22. package/dist/{config-types-B0JjhuaX.d.mts.map → config-types-De3gHQOy.d.mts.map} +1 -1
  23. package/dist/config.d.mts +1 -1
  24. package/dist/config__config-types.d.mts +1 -1
  25. package/dist/contract-authoring.d.mts +2 -2
  26. package/dist/contract-authoring.mjs +3 -3
  27. package/dist/{control-DLpQIwer.mjs → control-BE0sjzPI.mjs} +6 -2
  28. package/dist/control-BE0sjzPI.mjs.map +1 -0
  29. package/dist/{control-BeXOxtXA-DyPvQsqJ.d.mts → control-BeXOxtXA-DOfRFBDx.d.mts} +2 -2
  30. package/dist/{control-BeXOxtXA-DyPvQsqJ.d.mts.map → control-BeXOxtXA-DOfRFBDx.d.mts.map} +1 -1
  31. package/dist/{control-BrO2h8ed.d.mts → control-DanUY6NX.d.mts} +5 -5
  32. package/dist/{control-BrO2h8ed.d.mts.map → control-DanUY6NX.d.mts.map} +1 -1
  33. package/dist/{control-MllEQmML-yjvIIvnf.mjs → control-MllEQmML-BgM0TgK3.mjs} +2 -2
  34. package/dist/{control-MllEQmML-yjvIIvnf.mjs.map → control-MllEQmML-BgM0TgK3.mjs.map} +1 -1
  35. package/dist/control-QJnHVB3m.d.mts +1 -0
  36. package/dist/{declarations-BgUAq1RG-D99LhVXe.mjs → declarations-BgUAq1RG-DvmyJ8LS.mjs} +2 -2
  37. package/dist/{declarations-BgUAq1RG-D99LhVXe.mjs.map → declarations-BgUAq1RG-DvmyJ8LS.mjs.map} +1 -1
  38. package/dist/errors.d.mts +4 -4
  39. package/dist/errors.mjs +3 -3
  40. package/dist/errors__control.d.mts +2 -2
  41. package/dist/errors__control.mjs +1 -1
  42. package/dist/errors__execution.d.mts +1 -1
  43. package/dist/errors__execution.mjs +1 -1
  44. package/dist/errors__migration.d.mts +1 -1
  45. package/dist/errors__migration.mjs +1 -1
  46. package/dist/{execution-Cgkrs6UV.d.mts → execution-0NPar3Ng.d.mts} +3 -3
  47. package/dist/{execution-Cgkrs6UV.d.mts.map → execution-0NPar3Ng.d.mts.map} +1 -1
  48. package/dist/{execution-CXXKXfwB.mjs → execution-BkFLjpfc.mjs} +2 -2
  49. package/dist/{execution-CXXKXfwB.mjs.map → execution-BkFLjpfc.mjs.map} +1 -1
  50. package/dist/{execution-BhFeCTkt.d.mts → execution-CyddhERj.d.mts} +2 -2
  51. package/dist/{execution-BhFeCTkt.d.mts.map → execution-CyddhERj.d.mts.map} +1 -1
  52. package/dist/{expressions-CMQzbnHk-Db8YJA0B.mjs → expressions-CMQzbnHk-B7zBWJ0c.mjs} +2 -2
  53. package/dist/{expressions-CMQzbnHk-Db8YJA0B.mjs.map → expressions-CMQzbnHk-B7zBWJ0c.mjs.map} +1 -1
  54. package/dist/{framework-components-BqHA1V92-D_nUDFf9.d.mts → framework-components-GBAmsfWO-DUJQpMpU.d.mts} +3 -3
  55. package/dist/{framework-components-BqHA1V92-D_nUDFf9.d.mts.map → framework-components-GBAmsfWO-DUJQpMpU.d.mts.map} +1 -1
  56. package/dist/{migration-CMMT3vcR.d.mts → migration-B7ur91Et.d.mts} +2 -2
  57. package/dist/{migration-CMMT3vcR.d.mts.map → migration-B7ur91Et.d.mts.map} +1 -1
  58. package/dist/{migration-B1TEF2ij.mjs → migration-CQufZA_7.mjs} +2 -2
  59. package/dist/{migration-B1TEF2ij.mjs.map → migration-CQufZA_7.mjs.map} +1 -1
  60. package/dist/{parse-bZgfjovA-CaBuZnet.mjs → parse-bZgfjovA-Vk8LMIu5.mjs} +3 -3
  61. package/dist/{parse-bZgfjovA-CaBuZnet.mjs.map → parse-bZgfjovA-Vk8LMIu5.mjs.map} +1 -1
  62. package/dist/{parse-djL5wker-Bf4uawTE.d.mts → parse-djL5wker-4_2Cqwev.d.mts} +6 -6
  63. package/dist/{parse-djL5wker-Bf4uawTE.d.mts.map → parse-djL5wker-4_2Cqwev.d.mts.map} +1 -1
  64. package/dist/{psl-ast-0oMzInxd-BjKbrwNk.d.mts → psl-ast-B4ZxpQdr-DT9LRqBC.d.mts} +3 -3
  65. package/dist/{psl-ast-0oMzInxd-BjKbrwNk.d.mts.map → psl-ast-B4ZxpQdr-DT9LRqBC.d.mts.map} +1 -1
  66. package/dist/psl-ast-Dsf1-QLK.d.mts +2 -0
  67. package/dist/psl-parser.d.mts +22 -13
  68. package/dist/psl-parser.d.mts.map +1 -1
  69. package/dist/psl-parser.mjs +29 -43
  70. package/dist/psl-parser.mjs.map +1 -1
  71. package/dist/psl-parser__format.d.mts +1 -1
  72. package/dist/psl-parser__format.mjs +3 -3
  73. package/dist/psl-parser__interpret.d.mts +64 -22
  74. package/dist/psl-parser__interpret.d.mts.map +1 -1
  75. package/dist/psl-parser__interpret.mjs +135 -140
  76. package/dist/psl-parser__interpret.mjs.map +1 -1
  77. package/dist/psl-parser__syntax.d.mts +1 -1
  78. package/dist/psl-parser__syntax.mjs +3 -3
  79. package/dist/psl-printer.d.mts +4 -4
  80. package/dist/psl-printer.mjs +1 -1
  81. package/dist/{runtime-BERs-lBJ.d.mts → runtime-BgorXwT2.d.mts} +5 -3
  82. package/dist/runtime-BgorXwT2.d.mts.map +1 -0
  83. package/dist/{temporal-type-aliases-C9tIy4rv-Dsun86cY.mjs → temporal-type-aliases-BI3SL5iB-DIP8j4Gv.mjs} +383 -172
  84. package/dist/temporal-type-aliases-BI3SL5iB-DIP8j4Gv.mjs.map +1 -0
  85. package/dist/{temporal-type-aliases-BIiamFSH-DLxWO37e.d.mts → temporal-type-aliases-D5QWPhYa-BNKiNvmd.d.mts} +3 -3
  86. package/dist/{temporal-type-aliases-BIiamFSH-DLxWO37e.d.mts.map → temporal-type-aliases-D5QWPhYa-BNKiNvmd.d.mts.map} +1 -1
  87. package/dist/type-constructor-calls-Bfg5ojed-DYHnzC9z.mjs +538 -0
  88. package/dist/type-constructor-calls-Bfg5ojed-DYHnzC9z.mjs.map +1 -0
  89. package/package.json +15 -15
  90. package/dist/authoring-4wc_1ETR.mjs.map +0 -1
  91. package/dist/authoring-D75oR8Nt.d.mts.map +0 -1
  92. package/dist/control-COPuZO7V.d.mts +0 -1
  93. package/dist/control-DLpQIwer.mjs.map +0 -1
  94. package/dist/framework-authoring-ebqZ8M_M-Bdi8MutX.d.mts.map +0 -1
  95. package/dist/psl-ast-DjTRQDW7.d.mts +0 -2
  96. package/dist/runtime-BERs-lBJ.d.mts.map +0 -1
  97. package/dist/temporal-type-aliases-C9tIy4rv-Dsun86cY.mjs.map +0 -1
  98. package/dist/type-constructor-calls-CNd1Xlw2-CfYTYNSm.mjs +0 -306
  99. package/dist/type-constructor-calls-CNd1Xlw2-CfYTYNSm.mjs.map +0 -1
@@ -0,0 +1,538 @@
1
+ import { r as isInternalError, t as InternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
2
+ import { n as notOk, r as ok } from "./result-8OXF26MN.mjs";
3
+ import { c as createDataTypeLookup, u as dataTypeId } from "./data-type-DPsP4_9m-BRPJX_-z.mjs";
4
+ import { B as resolveAuthoringTypeChoice, X as typeConstructorLookup, _ as describeTaggedLiteralFailure } from "./temporal-type-aliases-BI3SL5iB-DIP8j4Gv.mjs";
5
+ import { C as readWrittenValueAs, l as describeExpected, t as admittedForms } from "./authoring-CcfXu8Dz.mjs";
6
+ import { C as printSyntax, a as IdentifierAst, c as ObjectLiteralExprAst, d as StringLiteralExprAst, i as FunctionCallAst, m as TaggedLiteralExprAst, o as NumberLiteralExprAst, r as BooleanLiteralExprAst, t as ArrayLiteralAst } from "./expressions-CMQzbnHk-B7zBWJ0c.mjs";
7
+ //#region ../../../1-framework/2-authoring/psl-parser/dist/contributed-type-scope-Ds4uDG91.mjs
8
+ function diagnosticSource(sources, node) {
9
+ return {
10
+ sources,
11
+ node,
12
+ at(span) {
13
+ const sourceFile = sources.sourceFileFor(node);
14
+ const range = span === void 0 ? {
15
+ start: sourceFile.positionAt(node.offset),
16
+ end: sourceFile.positionAt(node.endOffset)
17
+ } : sourceFile.pslSpanToRange(span);
18
+ return {
19
+ filename: sourceFile.filename,
20
+ range
21
+ };
22
+ }
23
+ };
24
+ }
25
+ function diagnosticFromSpan(diagnostic, source) {
26
+ if (diagnostic.span === void 0) throw new InternalError("Owned PSL diagnostic has no span");
27
+ return {
28
+ code: diagnostic.code,
29
+ message: diagnostic.message,
30
+ ...source.at(diagnostic.span),
31
+ ...diagnostic.data === void 0 ? {} : { data: diagnostic.data }
32
+ };
33
+ }
34
+ function mapPslDiagnostics(diagnostics, sources) {
35
+ return diagnostics.map(({ filename, code, message, range, data }) => ({
36
+ code,
37
+ message,
38
+ sourceId: filename,
39
+ span: sources.sourceFileNamed(filename).rangeToPslSpan(range),
40
+ ...data === void 0 ? {} : { data }
41
+ }));
42
+ }
43
+ function createPslDiagnosticCollector(sources) {
44
+ const entries = [];
45
+ return {
46
+ get length() {
47
+ return entries.length;
48
+ },
49
+ push(...diagnostics) {
50
+ for (const diagnostic of diagnostics) entries.push({
51
+ kind: "psl",
52
+ diagnostic
53
+ });
54
+ },
55
+ pushUnlocated(...diagnostics) {
56
+ for (const diagnostic of diagnostics) entries.push({
57
+ kind: "psl",
58
+ diagnostic,
59
+ omitSpan: true
60
+ });
61
+ },
62
+ pushExternal(...diagnostics) {
63
+ for (const diagnostic of diagnostics) entries.push({
64
+ kind: "external",
65
+ diagnostic
66
+ });
67
+ },
68
+ toExternal() {
69
+ return entries.flatMap((entry) => {
70
+ if (entry.kind === "external") return [entry.diagnostic];
71
+ if (entry.omitSpan) {
72
+ const { code, message, filename, data } = entry.diagnostic;
73
+ return [{
74
+ code,
75
+ message,
76
+ sourceId: filename,
77
+ ...data === void 0 ? {} : { data }
78
+ }];
79
+ }
80
+ return mapPslDiagnostics([entry.diagnostic], sources);
81
+ });
82
+ }
83
+ };
84
+ }
85
+ function readResolvedAttribute(attribute, sources) {
86
+ return {
87
+ name: attributeName(attribute.name()),
88
+ args: readResolvedArgList(attribute.argList(), sources),
89
+ span: nodePslSpan(attribute.syntax, sources),
90
+ node: attribute
91
+ };
92
+ }
93
+ function readResolvedAttributes(attributes, sources) {
94
+ return Array.from(attributes, (attribute) => readResolvedAttribute(attribute, sources));
95
+ }
96
+ function readResolvedConstructorCall(annotation, sources) {
97
+ const argList = annotation?.argList();
98
+ if (annotation === void 0 || argList === void 0) return void 0;
99
+ return {
100
+ path: annotation.name()?.path() ?? [],
101
+ args: readResolvedArgList(argList, sources),
102
+ span: nodePslSpan(annotation.syntax, sources)
103
+ };
104
+ }
105
+ function readResolvedArgList(argList, sources) {
106
+ if (argList === void 0) return [];
107
+ const args = [];
108
+ for (const arg of argList.args()) {
109
+ const name = arg.name()?.name();
110
+ const expression = arg.value();
111
+ args.push({
112
+ kind: name !== void 0 ? "named" : "positional",
113
+ ...name !== void 0 ? { name } : {},
114
+ value: renderExpression(expression),
115
+ ...expression !== void 0 ? { expression } : {},
116
+ span: nodePslSpan(arg.syntax, sources),
117
+ node: arg
118
+ });
119
+ }
120
+ return args;
121
+ }
122
+ function attributeName(name) {
123
+ return name?.path().join(".") ?? "";
124
+ }
125
+ function renderExpression(expression) {
126
+ if (expression === void 0) return "";
127
+ return printSyntax(expression.syntax).trim();
128
+ }
129
+ function nodePslSpan(node, sources) {
130
+ const sourceFile = sources.sourceFileFor(node);
131
+ const start = node.offset;
132
+ const end = start + node.green.textLength;
133
+ return {
134
+ start: sourceFile.offsetToPslPosition(start),
135
+ end: sourceFile.offsetToPslPosition(end)
136
+ };
137
+ }
138
+ /** Unsupported-top-level-block diagnostics are anchored to the keyword token. */
139
+ function keywordPslSpan(node, keyword, sources) {
140
+ const sourceFile = sources.sourceFileFor(node);
141
+ const start = node.offset;
142
+ const end = start + keyword.length;
143
+ return {
144
+ start: sourceFile.offsetToPslPosition(start),
145
+ end: sourceFile.offsetToPslPosition(end)
146
+ };
147
+ }
148
+ const AN_EXPRESSION = {
149
+ ok: false,
150
+ reason: "not-a-literal",
151
+ found: "an expression"
152
+ };
153
+ function written(value) {
154
+ return {
155
+ ok: true,
156
+ written: value
157
+ };
158
+ }
159
+ /** Reads a PSL literal expression as a `WrittenScalar`, for a position that takes a value of a data type. ADR 254. */
160
+ function readWrittenScalar(expression) {
161
+ const syntax = expression.syntax;
162
+ const string = StringLiteralExprAst.cast(syntax)?.value();
163
+ if (string !== void 0) return written({
164
+ kind: "string",
165
+ text: string
166
+ });
167
+ const number = NumberLiteralExprAst.cast(syntax);
168
+ if (number !== void 0) {
169
+ const text = number.token()?.text;
170
+ return text === void 0 ? AN_EXPRESSION : written({
171
+ kind: "number",
172
+ text
173
+ });
174
+ }
175
+ const boolean = BooleanLiteralExprAst.cast(syntax)?.value();
176
+ if (boolean !== void 0) return written({
177
+ kind: "boolean",
178
+ value: boolean
179
+ });
180
+ const tagged = TaggedLiteralExprAst.cast(syntax);
181
+ if (tagged !== void 0) {
182
+ const canonicalization = tagged.canonicalization();
183
+ return canonicalization.ok ? written({
184
+ kind: "tag",
185
+ tag: tagged.tagName(),
186
+ text: canonicalization.text
187
+ }) : {
188
+ ok: false,
189
+ reason: canonicalization.reason
190
+ };
191
+ }
192
+ if (IdentifierAst.cast(syntax) !== void 0) return {
193
+ ok: false,
194
+ reason: "not-a-literal",
195
+ found: "an identifier"
196
+ };
197
+ if (FunctionCallAst.cast(syntax) !== void 0) return {
198
+ ok: false,
199
+ reason: "not-a-literal",
200
+ found: "a function call"
201
+ };
202
+ if (ArrayLiteralAst.cast(syntax) !== void 0) return {
203
+ ok: false,
204
+ reason: "not-a-literal",
205
+ found: "a list"
206
+ };
207
+ if (ObjectLiteralExprAst.cast(syntax) !== void 0) return {
208
+ ok: false,
209
+ reason: "not-a-literal",
210
+ found: "an object"
211
+ };
212
+ return AN_EXPRESSION;
213
+ }
214
+ const TAGGED_LITERAL_FAILURE_CODES = {
215
+ nul: "PSL_TAGGED_LITERAL_NUL",
216
+ "too-large": "PSL_TAGGED_LITERAL_TOO_LARGE"
217
+ };
218
+ /**
219
+ * Reads `expression` as a value of `dataType`: the literal is read through the authoring entry for its syntax, then taken into `dataType` directly or through a cast it declares. The read every argument typed by a data type takes, in an attribute or a type constructor. ADR 254.
220
+ */
221
+ function readExpressionAs(support, dataType, expression) {
222
+ if (!support.lookup.has(dataType)) throw new InternalError(`An argument receives data type "${dataType}", which this stack does not register.`);
223
+ const forms = admittedForms(support, [dataType]);
224
+ if (forms.length === 0) throw new InternalError(`An argument receives data type "${dataType}", which nothing in this stack writes.`);
225
+ const literal = readWrittenScalar(expression);
226
+ if (!literal.ok) return literal.reason === "not-a-literal" ? notOk({
227
+ code: "PSL_INVALID_ATTRIBUTE_SYNTAX",
228
+ message: `${describeExpected(forms)}; got ${literal.found}`
229
+ }) : notOk({
230
+ code: TAGGED_LITERAL_FAILURE_CODES[literal.reason],
231
+ message: describeTaggedLiteralFailure(literal.reason)
232
+ });
233
+ return readWrittenValueAs(support, dataType, literal.written);
234
+ }
235
+ /** The data types of a stack that registers none. */
236
+ const EMPTY_DATA_TYPES = {
237
+ entries: {},
238
+ lookup: createDataTypeLookup([]),
239
+ dataTypeOfCodec: () => void 0
240
+ };
241
+ /** How a diagnostic names a subject, as in `Field "Post.slug"` or `Type alias "Slug"`. */
242
+ function typeAttributeSubjectLabel(subject) {
243
+ return `${subject.kind === "field" ? "Field" : "Type alias"} "${subject.name}"`;
244
+ }
245
+ function typeAttributeSpecContextOfField(ctx) {
246
+ return {
247
+ symbols: ctx.symbols,
248
+ defaultFunctionRegistry: ctx.defaultFunctionRegistry,
249
+ generatorFunctions: ctx.generatorFunctions,
250
+ dataTypes: ctx.dataTypes,
251
+ subject: {
252
+ kind: "field",
253
+ name: `${ctx.model.name}.${ctx.field.name}`
254
+ },
255
+ list: ctx.field.list,
256
+ typeName: ctx.field.typeName,
257
+ typeResolution: ctx.typeResolution,
258
+ contributedType: ctx.contributedType
259
+ };
260
+ }
261
+ /** The call as the schema writes it, with its arguments separated by `, `. */
262
+ function printTypeConstructorCall(call) {
263
+ const args = call.args.map((arg) => arg.kind === "named" ? `${arg.name}: ${arg.value}` : arg.value);
264
+ return `${call.path.join(".")}(${args.join(", ")})`;
265
+ }
266
+ /**
267
+ * Binds a call's arguments to its parameters, as PSL reads every call: the positional arguments fill the parameters in order, wherever named ones sit among them, and a named argument fills the parameter it names, which no other argument may fill. The bound arguments come positional ones first, then named ones, each in the order written.
268
+ */
269
+ function bindCallArguments(args, parameters) {
270
+ const positional = args.filter((arg) => arg.kind === "positional");
271
+ if (positional.length > parameters.length) return notOk({
272
+ kind: "tooManyPositional",
273
+ received: positional.length,
274
+ bound: []
275
+ });
276
+ const bound = positional.map((argument, index) => ({
277
+ argument,
278
+ index
279
+ }));
280
+ const filled = new Set(bound.map(({ index }) => index));
281
+ for (const argument of args.filter((arg) => arg.kind === "named")) {
282
+ const index = argument.name === void 0 ? -1 : parameters.indexOf(argument.name);
283
+ if (index < 0) return notOk({
284
+ kind: "unknownName",
285
+ argument,
286
+ bound
287
+ });
288
+ if (filled.has(index)) return notOk({
289
+ kind: "filledTwice",
290
+ argument,
291
+ bound
292
+ });
293
+ filled.add(index);
294
+ bound.push({
295
+ argument,
296
+ index
297
+ });
298
+ }
299
+ return ok(bound);
300
+ }
301
+ /** Each argument's value, keyed by the parameter it fills, as {@link bindCallArguments} binds them; `undefined` when they do not bind. */
302
+ function argumentsByParameter(args, parameters) {
303
+ const bound = bindCallArguments(args, parameters);
304
+ if (!bound.ok) return void 0;
305
+ const values = /* @__PURE__ */ new Map();
306
+ for (const { argument, index } of bound.value) {
307
+ const parameter = parameters[index];
308
+ if (parameter === void 0) return void 0;
309
+ values.set(parameter, argument.value);
310
+ }
311
+ return values;
312
+ }
313
+ const INVALID_AUTHORING_ARGUMENT = Symbol("invalidAuthoringArgument");
314
+ /** Why a written value is not one of the names an option takes, and, for a number that only one value argument takes, that argument. */
315
+ function misplacedOptionMessage(descriptors, dataTypes, option, written, argumentLabel) {
316
+ const refused = `${argumentLabel} is ${written}, but argument "${option.name}" takes one of these names, written without quotes: ${option.values.join(", ")}.`;
317
+ if (!/^[+-]?\d/.test(written)) return refused;
318
+ const takers = descriptors.flatMap((descriptor) => descriptor.kind === "value" && descriptor.name !== void 0 && readWrittenValueAs(dataTypes, dataTypeId(descriptor.dataType), {
319
+ kind: "number",
320
+ text: written
321
+ }).ok ? [descriptor.name] : []);
322
+ const [taker] = takers;
323
+ return takers.length === 1 && taker !== void 0 ? `${refused} Write ${taker} by name, as in ${taker}: ${written}.` : refused;
324
+ }
325
+ const SILENT_REFUSALS = {
326
+ call: () => {},
327
+ argument: () => {},
328
+ value: () => {}
329
+ };
330
+ /**
331
+ * The value of one argument as `descriptor` reads it: a `value` argument as a value of its data type, read from its expression as attribute arguments are, and a type choice's option as a bare name. A refusal is reported at the argument.
332
+ */
333
+ function readPslHelperArgument(input, refusals, descriptor, argument, argumentLabel) {
334
+ const refuse = (message) => {
335
+ refusals.argument(argument.span, message);
336
+ return INVALID_AUTHORING_ARGUMENT;
337
+ };
338
+ if (descriptor.kind === "option") {
339
+ const written = argument.value.trim();
340
+ if (/^[A-Za-z_][A-Za-z0-9_]*$/.test(written)) return written;
341
+ return refuse(misplacedOptionMessage(input.descriptors, input.dataTypes, descriptor, written, argumentLabel));
342
+ }
343
+ const { expression } = argument;
344
+ if (expression === void 0 && argument.node !== void 0) return refuse(`${argumentLabel} has no value.`);
345
+ if (expression === void 0) throw new InternalError(`A call received ${argumentLabel} with no expression. A value argument is read from the expression a schema writes; a reader that builds a call must pass the arguments it parsed, or instantiate the constructor with values.`);
346
+ const read = readExpressionAs(input.dataTypes, dataTypeId(descriptor.dataType), expression);
347
+ if (read.ok) return read.value.value;
348
+ refusals.value(expression.syntax, read.failure);
349
+ return INVALID_AUTHORING_ARGUMENT;
350
+ }
351
+ function readPslHelperArgsReporting(input, refusals) {
352
+ const bound = bindCallArguments(input.args, input.descriptors.map((descriptor) => descriptor?.name));
353
+ const mappedArgs = input.descriptors.map(() => void 0);
354
+ for (const { argument, index } of bound.ok ? bound.value : bound.failure.bound) {
355
+ const descriptor = input.descriptors[index];
356
+ if (!descriptor) {
357
+ refusals.argument(argument.span, `does not define positional argument #${index + 1}.`);
358
+ return;
359
+ }
360
+ const value = readPslHelperArgument(input, refusals, descriptor, argument, argument.kind === "named" ? `named argument "${argument.name}"` : `argument #${index + 1}`);
361
+ if (value === INVALID_AUTHORING_ARGUMENT) return void 0;
362
+ mappedArgs[index] = value;
363
+ }
364
+ if (bound.ok) return mappedArgs;
365
+ const failure = bound.failure;
366
+ switch (failure.kind) {
367
+ case "tooManyPositional":
368
+ refusals.call(`accepts at most ${input.descriptors.length} argument(s), received ${failure.received}.`);
369
+ return;
370
+ case "unknownName":
371
+ refusals.argument(failure.argument.span, `received unknown named argument "${failure.argument.name}".`);
372
+ return;
373
+ case "filledTwice":
374
+ refusals.argument(failure.argument.span, `received duplicate value for argument "${failure.argument.name}".`);
375
+ return;
376
+ }
377
+ }
378
+ /**
379
+ * The arguments of a type constructor or type choice call, positional and named, each read as its descriptor says. `undefined`, with a diagnostic pushed, when one cannot be read or does not match a descriptor.
380
+ */
381
+ function mapPslHelperArgs(input) {
382
+ const refused = (span, message) => input.diagnostics.push({
383
+ code: "PSL_INVALID_ATTRIBUTE_ARGUMENT",
384
+ message: `${input.entityLabel} ${input.helperLabel} ${message}`,
385
+ ...input.source.at(span)
386
+ });
387
+ return readPslHelperArgsReporting(input, {
388
+ call: (message) => refused(input.span, message),
389
+ argument: refused,
390
+ value: (node, failure) => input.diagnostics.push({
391
+ code: failure.code,
392
+ message: failure.message,
393
+ ...input.source.at(nodePslSpan(node, input.source.sources))
394
+ })
395
+ });
396
+ }
397
+ /**
398
+ * The arguments of a call read as {@link mapPslHelperArgs} reads them, without reporting what it refuses: `undefined` when the call does not read, which the reader that resolves the column reports.
399
+ */
400
+ function readPslHelperArgs(input) {
401
+ return readPslHelperArgsReporting(input, SILENT_REFUSALS);
402
+ }
403
+ function isContributedTypeChoice(symbol) {
404
+ return symbol.descriptor.kind === "typeChoice";
405
+ }
406
+ function isContributedTypeDescriptor(value) {
407
+ return "kind" in value && (value.kind === "typeConstructor" || value.kind === "typeAlias" || value.kind === "typeChoice");
408
+ }
409
+ /** The explicit type a call of the type choice `symbol` chooses and the arguments it is built with, reading the call as the column does, or why it chooses none. */
410
+ function chosenTypeConstructor(symbol, call, dataTypes) {
411
+ const helperPath = symbol.path.join(".");
412
+ const args = readPslHelperArgs({
413
+ args: call?.args ?? [],
414
+ descriptors: symbol.descriptor.args,
415
+ dataTypes
416
+ });
417
+ if (args === void 0) return notOk(`The arguments of ${helperPath} do not read.`);
418
+ try {
419
+ return ok(resolveAuthoringTypeChoice({
420
+ helperPath,
421
+ descriptor: symbol.descriptor,
422
+ args,
423
+ constructorNamed: (name) => symbol.choiceTypes.get(name)
424
+ }));
425
+ } catch (error) {
426
+ if (isInternalError(error) || !(error instanceof Error)) throw error;
427
+ return notOk(error.message);
428
+ }
429
+ }
430
+ /** The codec a column typed by `use` is stored with; `undefined` for a type choice whose call chooses no type, which the column's resolution reports. */
431
+ function contributedTypeCodecId(use, dataTypes) {
432
+ const { symbol } = use;
433
+ if (isContributedTypeChoice(symbol)) {
434
+ const chosen = chosenTypeConstructor(symbol, use.call, dataTypes);
435
+ return chosen.ok ? chosen.value.descriptor.output.codecId : void 0;
436
+ }
437
+ const { descriptor } = symbol;
438
+ return descriptor.kind === "typeAlias" ? descriptor.output.type.codecId : descriptor.output.codecId;
439
+ }
440
+ /** The descriptor at `path` in `namespace`, or `undefined` when none is contributed there. */
441
+ function contributedTypeAt(namespace, path) {
442
+ const [name, ...rest] = path;
443
+ if (name === void 0 || !Object.hasOwn(namespace, name)) return void 0;
444
+ const value = namespace[name];
445
+ if (value === void 0) return void 0;
446
+ if (isContributedTypeDescriptor(value)) return rest.length === 0 ? value : void 0;
447
+ return contributedTypeAt(value, rest);
448
+ }
449
+ /** The codec a column typed by `call` is stored with, reading the call's arguments as the column does, or `undefined` when no type is contributed at its path or it is a type choice whose arguments choose no type. */
450
+ function writtenContributedTypeCodecId(namespace, call) {
451
+ return codecIdAtPath(namespace, call.path, [], call);
452
+ }
453
+ function codecIdAtPath(namespace, path, prefix, call) {
454
+ const [name, ...rest] = path;
455
+ if (name === void 0 || !Object.hasOwn(namespace, name)) return void 0;
456
+ const value = namespace[name];
457
+ if (value === void 0) return void 0;
458
+ const at = [...prefix, name];
459
+ if (!isContributedTypeDescriptor(value)) return codecIdAtPath(value, rest, at, call);
460
+ if (rest.length > 0) return void 0;
461
+ return contributedTypeCodecId({
462
+ symbol: contributedTypeSymbol(name, at, value, namespace),
463
+ call
464
+ }, EMPTY_DATA_TYPES);
465
+ }
466
+ function contributedTypeScope(contributedTypes) {
467
+ const members = collect(contributedTypes, []);
468
+ return {
469
+ lookup(name) {
470
+ return members.get(name);
471
+ },
472
+ entries() {
473
+ return members.entries();
474
+ }
475
+ };
476
+ }
477
+ function collect(namespace, prefix) {
478
+ const members = /* @__PURE__ */ new Map();
479
+ for (const [name, value] of Object.entries(namespace)) {
480
+ const path = [...prefix, name];
481
+ members.set(name, isContributedTypeDescriptor(value) ? contributedTypeSymbol(name, path, value, namespace) : {
482
+ kind: "contributedNamespace",
483
+ name,
484
+ path,
485
+ members: collect(value, path)
486
+ });
487
+ }
488
+ return members;
489
+ }
490
+ function contributedTypeSymbol(name, path, descriptor, namespace) {
491
+ if (descriptor.kind !== "typeChoice") return {
492
+ kind: "contributedType",
493
+ name,
494
+ path,
495
+ descriptor
496
+ };
497
+ const constructorNamed = typeConstructorLookup(namespace);
498
+ const choiceTypes = /* @__PURE__ */ new Map();
499
+ for (const { type } of descriptor.choices) {
500
+ const chosen = constructorNamed(type);
501
+ if (chosen !== void 0) choiceTypes.set(type, chosen);
502
+ }
503
+ return {
504
+ kind: "contributedType",
505
+ name,
506
+ path,
507
+ descriptor,
508
+ choiceTypes
509
+ };
510
+ }
511
+ //#endregion
512
+ //#region ../../../1-framework/2-authoring/psl-parser/dist/type-constructor-calls-Bfg5ojed.mjs
513
+ function isBareTypeConstructor(descriptor) {
514
+ return descriptor.entityRefArg === void 0 && (descriptor.args ?? []).every((arg) => arg.optional === true);
515
+ }
516
+ function argumentSpelling(descriptor) {
517
+ const args = descriptor.args ?? [];
518
+ const reference = descriptor.entityRefArg;
519
+ const count = Math.max(args.length, (reference?.index ?? -1) + 1);
520
+ const names = [];
521
+ for (let index = 0; index < count; index++) {
522
+ const arg = args[index];
523
+ if (index === reference?.index) names.push(reference.entityKind);
524
+ else if (arg !== void 0 && arg.optional !== true) names.push(arg.name ?? `argument${index + 1}`);
525
+ }
526
+ return names.join(", ");
527
+ }
528
+ function reportTypeConstructorNotCalled(input) {
529
+ input.diagnostics.push({
530
+ code: "PSL_TYPE_CONSTRUCTOR_NOT_CALLED",
531
+ message: `${input.entityLabel} uses type constructor "${input.path}" without arguments. Write ${input.path}(${argumentSpelling(input.descriptor)}).`,
532
+ ...input.source.at(input.span)
533
+ });
534
+ }
535
+ //#endregion
536
+ export { typeAttributeSpecContextOfField as C, readWrittenScalar as S, writtenContributedTypeCodecId as T, printTypeConstructorCall as _, chosenTypeConstructor as a, readResolvedAttributes as b, contributedTypeScope as c, diagnosticSource as d, isContributedTypeChoice as f, nodePslSpan as g, mapPslHelperArgs as h, argumentsByParameter as i, createPslDiagnosticCollector as l, mapPslDiagnostics as m, reportTypeConstructorNotCalled as n, contributedTypeAt as o, keywordPslSpan as p, EMPTY_DATA_TYPES as r, contributedTypeCodecId as s, isBareTypeConstructor as t, diagnosticFromSpan as u, readExpressionAs as v, typeAttributeSubjectLabel as w, readResolvedConstructorCall as x, readResolvedAttribute as y };
537
+
538
+ //# sourceMappingURL=type-constructor-calls-Bfg5ojed-DYHnzC9z.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-constructor-calls-Bfg5ojed-DYHnzC9z.mjs","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/contributed-type-scope-Ds4uDG91.mjs","../../../../1-framework/2-authoring/psl-parser/dist/type-constructor-calls-Bfg5ojed.mjs"],"sourcesContent":["import { a as NumberLiteralExprAst, i as FunctionCallAst, l as StringLiteralExprAst, m as IdentifierAst, r as BooleanLiteralExprAst, s as ObjectLiteralExprAst, t as ArrayLiteralAst, u as TaggedLiteralExprAst, y as printSyntax } from \"./expressions-CMQzbnHk.mjs\";\nimport { admittedForms, describeExpected, readWrittenValueAs, resolveAuthoringTypeChoice, typeConstructorLookup } from \"@internal/framework-components/authoring\";\nimport { InternalError, isInternalError } from \"@internal/utils/internal-error\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { describeTaggedLiteralFailure } from \"@internal/framework-components/control\";\nimport { createDataTypeLookup, dataTypeId } from \"@internal/framework-components/codec\";\n//#region src/diagnostic.ts\nfunction diagnosticSource(sources, node) {\n\treturn {\n\t\tsources,\n\t\tnode,\n\t\tat(span) {\n\t\t\tconst sourceFile = sources.sourceFileFor(node);\n\t\t\tconst range = span === void 0 ? {\n\t\t\t\tstart: sourceFile.positionAt(node.offset),\n\t\t\t\tend: sourceFile.positionAt(node.endOffset)\n\t\t\t} : sourceFile.pslSpanToRange(span);\n\t\t\treturn {\n\t\t\t\tfilename: sourceFile.filename,\n\t\t\t\trange\n\t\t\t};\n\t\t}\n\t};\n}\nfunction diagnosticFromSpan(diagnostic, source) {\n\tif (diagnostic.span === void 0) throw new InternalError(\"Owned PSL diagnostic has no span\");\n\treturn {\n\t\tcode: diagnostic.code,\n\t\tmessage: diagnostic.message,\n\t\t...source.at(diagnostic.span),\n\t\t...diagnostic.data === void 0 ? {} : { data: diagnostic.data }\n\t};\n}\nfunction mapPslDiagnostics(diagnostics, sources) {\n\treturn diagnostics.map(({ filename, code, message, range, data }) => ({\n\t\tcode,\n\t\tmessage,\n\t\tsourceId: filename,\n\t\tspan: sources.sourceFileNamed(filename).rangeToPslSpan(range),\n\t\t...data === void 0 ? {} : { data }\n\t}));\n}\nfunction createPslDiagnosticCollector(sources) {\n\tconst entries = [];\n\treturn {\n\t\tget length() {\n\t\t\treturn entries.length;\n\t\t},\n\t\tpush(...diagnostics) {\n\t\t\tfor (const diagnostic of diagnostics) entries.push({\n\t\t\t\tkind: \"psl\",\n\t\t\t\tdiagnostic\n\t\t\t});\n\t\t},\n\t\tpushUnlocated(...diagnostics) {\n\t\t\tfor (const diagnostic of diagnostics) entries.push({\n\t\t\t\tkind: \"psl\",\n\t\t\t\tdiagnostic,\n\t\t\t\tomitSpan: true\n\t\t\t});\n\t\t},\n\t\tpushExternal(...diagnostics) {\n\t\t\tfor (const diagnostic of diagnostics) entries.push({\n\t\t\t\tkind: \"external\",\n\t\t\t\tdiagnostic\n\t\t\t});\n\t\t},\n\t\ttoExternal() {\n\t\t\treturn entries.flatMap((entry) => {\n\t\t\t\tif (entry.kind === \"external\") return [entry.diagnostic];\n\t\t\t\tif (entry.omitSpan) {\n\t\t\t\t\tconst { code, message, filename, data } = entry.diagnostic;\n\t\t\t\t\treturn [{\n\t\t\t\t\t\tcode,\n\t\t\t\t\t\tmessage,\n\t\t\t\t\t\tsourceId: filename,\n\t\t\t\t\t\t...data === void 0 ? {} : { data }\n\t\t\t\t\t}];\n\t\t\t\t}\n\t\t\t\treturn mapPslDiagnostics([entry.diagnostic], sources);\n\t\t\t});\n\t\t}\n\t};\n}\n//#endregion\n//#region src/resolve.ts\nfunction readResolvedAttribute(attribute, sources) {\n\treturn {\n\t\tname: attributeName(attribute.name()),\n\t\targs: readResolvedArgList(attribute.argList(), sources),\n\t\tspan: nodePslSpan(attribute.syntax, sources),\n\t\tnode: attribute\n\t};\n}\nfunction readResolvedAttributes(attributes, sources) {\n\treturn Array.from(attributes, (attribute) => readResolvedAttribute(attribute, sources));\n}\nfunction readResolvedConstructorCall(annotation, sources) {\n\tconst argList = annotation?.argList();\n\tif (annotation === void 0 || argList === void 0) return void 0;\n\treturn {\n\t\tpath: annotation.name()?.path() ?? [],\n\t\targs: readResolvedArgList(argList, sources),\n\t\tspan: nodePslSpan(annotation.syntax, sources)\n\t};\n}\nfunction readResolvedArgList(argList, sources) {\n\tif (argList === void 0) return [];\n\tconst args = [];\n\tfor (const arg of argList.args()) {\n\t\tconst name = arg.name()?.name();\n\t\tconst expression = arg.value();\n\t\targs.push({\n\t\t\tkind: name !== void 0 ? \"named\" : \"positional\",\n\t\t\t...name !== void 0 ? { name } : {},\n\t\t\tvalue: renderExpression(expression),\n\t\t\t...expression !== void 0 ? { expression } : {},\n\t\t\tspan: nodePslSpan(arg.syntax, sources),\n\t\t\tnode: arg\n\t\t});\n\t}\n\treturn args;\n}\nfunction attributeName(name) {\n\treturn name?.path().join(\".\") ?? \"\";\n}\nfunction renderExpression(expression) {\n\tif (expression === void 0) return \"\";\n\treturn printSyntax(expression.syntax).trim();\n}\nfunction nodePslSpan(node, sources) {\n\tconst sourceFile = sources.sourceFileFor(node);\n\tconst start = node.offset;\n\tconst end = start + node.green.textLength;\n\treturn {\n\t\tstart: sourceFile.offsetToPslPosition(start),\n\t\tend: sourceFile.offsetToPslPosition(end)\n\t};\n}\n/** Unsupported-top-level-block diagnostics are anchored to the keyword token. */\nfunction keywordPslSpan(node, keyword, sources) {\n\tconst sourceFile = sources.sourceFileFor(node);\n\tconst start = node.offset;\n\tconst end = start + keyword.length;\n\treturn {\n\t\tstart: sourceFile.offsetToPslPosition(start),\n\t\tend: sourceFile.offsetToPslPosition(end)\n\t};\n}\n//#endregion\n//#region src/written-scalar.ts\nconst AN_EXPRESSION = {\n\tok: false,\n\treason: \"not-a-literal\",\n\tfound: \"an expression\"\n};\nfunction written(value) {\n\treturn {\n\t\tok: true,\n\t\twritten: value\n\t};\n}\n/** Reads a PSL literal expression as a `WrittenScalar`, for a position that takes a value of a data type. ADR 254. */\nfunction readWrittenScalar(expression) {\n\tconst syntax = expression.syntax;\n\tconst string = StringLiteralExprAst.cast(syntax)?.value();\n\tif (string !== void 0) return written({\n\t\tkind: \"string\",\n\t\ttext: string\n\t});\n\tconst number = NumberLiteralExprAst.cast(syntax);\n\tif (number !== void 0) {\n\t\tconst text = number.token()?.text;\n\t\treturn text === void 0 ? AN_EXPRESSION : written({\n\t\t\tkind: \"number\",\n\t\t\ttext\n\t\t});\n\t}\n\tconst boolean = BooleanLiteralExprAst.cast(syntax)?.value();\n\tif (boolean !== void 0) return written({\n\t\tkind: \"boolean\",\n\t\tvalue: boolean\n\t});\n\tconst tagged = TaggedLiteralExprAst.cast(syntax);\n\tif (tagged !== void 0) {\n\t\tconst canonicalization = tagged.canonicalization();\n\t\treturn canonicalization.ok ? written({\n\t\t\tkind: \"tag\",\n\t\t\ttag: tagged.tagName(),\n\t\t\ttext: canonicalization.text\n\t\t}) : {\n\t\t\tok: false,\n\t\t\treason: canonicalization.reason\n\t\t};\n\t}\n\tif (IdentifierAst.cast(syntax) !== void 0) return {\n\t\tok: false,\n\t\treason: \"not-a-literal\",\n\t\tfound: \"an identifier\"\n\t};\n\tif (FunctionCallAst.cast(syntax) !== void 0) return {\n\t\tok: false,\n\t\treason: \"not-a-literal\",\n\t\tfound: \"a function call\"\n\t};\n\tif (ArrayLiteralAst.cast(syntax) !== void 0) return {\n\t\tok: false,\n\t\treason: \"not-a-literal\",\n\t\tfound: \"a list\"\n\t};\n\tif (ObjectLiteralExprAst.cast(syntax) !== void 0) return {\n\t\tok: false,\n\t\treason: \"not-a-literal\",\n\t\tfound: \"an object\"\n\t};\n\treturn AN_EXPRESSION;\n}\n//#endregion\n//#region src/read-expression-as.ts\nconst TAGGED_LITERAL_FAILURE_CODES = {\n\tnul: \"PSL_TAGGED_LITERAL_NUL\",\n\t\"too-large\": \"PSL_TAGGED_LITERAL_TOO_LARGE\"\n};\n/**\n* Reads `expression` as a value of `dataType`: the literal is read through the authoring entry for its syntax, then taken into `dataType` directly or through a cast it declares. The read every argument typed by a data type takes, in an attribute or a type constructor. ADR 254.\n*/\nfunction readExpressionAs(support, dataType, expression) {\n\tif (!support.lookup.has(dataType)) throw new InternalError(`An argument receives data type \"${dataType}\", which this stack does not register.`);\n\tconst forms = admittedForms(support, [dataType]);\n\tif (forms.length === 0) throw new InternalError(`An argument receives data type \"${dataType}\", which nothing in this stack writes.`);\n\tconst literal = readWrittenScalar(expression);\n\tif (!literal.ok) return literal.reason === \"not-a-literal\" ? notOk({\n\t\tcode: \"PSL_INVALID_ATTRIBUTE_SYNTAX\",\n\t\tmessage: `${describeExpected(forms)}; got ${literal.found}`\n\t}) : notOk({\n\t\tcode: TAGGED_LITERAL_FAILURE_CODES[literal.reason],\n\t\tmessage: describeTaggedLiteralFailure(literal.reason)\n\t});\n\treturn readWrittenValueAs(support, dataType, literal.written);\n}\n//#endregion\n//#region src/attribute-spec/spec-context.ts\n/** The data types of a stack that registers none. */\nconst EMPTY_DATA_TYPES = {\n\tentries: {},\n\tlookup: createDataTypeLookup([]),\n\tdataTypeOfCodec: () => void 0\n};\n/** How a diagnostic names a subject, as in `Field \"Post.slug\"` or `Type alias \"Slug\"`. */\nfunction typeAttributeSubjectLabel(subject) {\n\treturn `${subject.kind === \"field\" ? \"Field\" : \"Type alias\"} \"${subject.name}\"`;\n}\nfunction typeAttributeSpecContextOfField(ctx) {\n\treturn {\n\t\tsymbols: ctx.symbols,\n\t\tdefaultFunctionRegistry: ctx.defaultFunctionRegistry,\n\t\tgeneratorFunctions: ctx.generatorFunctions,\n\t\tdataTypes: ctx.dataTypes,\n\t\tsubject: {\n\t\t\tkind: \"field\",\n\t\t\tname: `${ctx.model.name}.${ctx.field.name}`\n\t\t},\n\t\tlist: ctx.field.list,\n\t\ttypeName: ctx.field.typeName,\n\t\ttypeResolution: ctx.typeResolution,\n\t\tcontributedType: ctx.contributedType\n\t};\n}\n//#endregion\n//#region src/call-arguments.ts\n/** The call as the schema writes it, with its arguments separated by `, `. */\nfunction printTypeConstructorCall(call) {\n\tconst args = call.args.map((arg) => arg.kind === \"named\" ? `${arg.name}: ${arg.value}` : arg.value);\n\treturn `${call.path.join(\".\")}(${args.join(\", \")})`;\n}\n/**\n* Binds a call's arguments to its parameters, as PSL reads every call: the positional arguments fill the parameters in order, wherever named ones sit among them, and a named argument fills the parameter it names, which no other argument may fill. The bound arguments come positional ones first, then named ones, each in the order written.\n*/\nfunction bindCallArguments(args, parameters) {\n\tconst positional = args.filter((arg) => arg.kind === \"positional\");\n\tif (positional.length > parameters.length) return notOk({\n\t\tkind: \"tooManyPositional\",\n\t\treceived: positional.length,\n\t\tbound: []\n\t});\n\tconst bound = positional.map((argument, index) => ({\n\t\targument,\n\t\tindex\n\t}));\n\tconst filled = new Set(bound.map(({ index }) => index));\n\tfor (const argument of args.filter((arg) => arg.kind === \"named\")) {\n\t\tconst index = argument.name === void 0 ? -1 : parameters.indexOf(argument.name);\n\t\tif (index < 0) return notOk({\n\t\t\tkind: \"unknownName\",\n\t\t\targument,\n\t\t\tbound\n\t\t});\n\t\tif (filled.has(index)) return notOk({\n\t\t\tkind: \"filledTwice\",\n\t\t\targument,\n\t\t\tbound\n\t\t});\n\t\tfilled.add(index);\n\t\tbound.push({\n\t\t\targument,\n\t\t\tindex\n\t\t});\n\t}\n\treturn ok(bound);\n}\n/** Each argument's value, keyed by the parameter it fills, as {@link bindCallArguments} binds them; `undefined` when they do not bind. */\nfunction argumentsByParameter(args, parameters) {\n\tconst bound = bindCallArguments(args, parameters);\n\tif (!bound.ok) return void 0;\n\tconst values = /* @__PURE__ */ new Map();\n\tfor (const { argument, index } of bound.value) {\n\t\tconst parameter = parameters[index];\n\t\tif (parameter === void 0) return void 0;\n\t\tvalues.set(parameter, argument.value);\n\t}\n\treturn values;\n}\n//#endregion\n//#region src/authoring-arguments.ts\nconst INVALID_AUTHORING_ARGUMENT = Symbol(\"invalidAuthoringArgument\");\n/** Why a written value is not one of the names an option takes, and, for a number that only one value argument takes, that argument. */\nfunction misplacedOptionMessage(descriptors, dataTypes, option, written, argumentLabel) {\n\tconst refused = `${argumentLabel} is ${written}, but argument \"${option.name}\" takes one of these names, written without quotes: ${option.values.join(\", \")}.`;\n\tif (!/^[+-]?\\d/.test(written)) return refused;\n\tconst takers = descriptors.flatMap((descriptor) => descriptor.kind === \"value\" && descriptor.name !== void 0 && readWrittenValueAs(dataTypes, dataTypeId(descriptor.dataType), {\n\t\tkind: \"number\",\n\t\ttext: written\n\t}).ok ? [descriptor.name] : []);\n\tconst [taker] = takers;\n\treturn takers.length === 1 && taker !== void 0 ? `${refused} Write ${taker} by name, as in ${taker}: ${written}.` : refused;\n}\nconst SILENT_REFUSALS = {\n\tcall: () => {},\n\targument: () => {},\n\tvalue: () => {}\n};\n/**\n* The value of one argument as `descriptor` reads it: a `value` argument as a value of its data type, read from its expression as attribute arguments are, and a type choice's option as a bare name. A refusal is reported at the argument.\n*/\nfunction readPslHelperArgument(input, refusals, descriptor, argument, argumentLabel) {\n\tconst refuse = (message) => {\n\t\trefusals.argument(argument.span, message);\n\t\treturn INVALID_AUTHORING_ARGUMENT;\n\t};\n\tif (descriptor.kind === \"option\") {\n\t\tconst written = argument.value.trim();\n\t\tif (/^[A-Za-z_][A-Za-z0-9_]*$/.test(written)) return written;\n\t\treturn refuse(misplacedOptionMessage(input.descriptors, input.dataTypes, descriptor, written, argumentLabel));\n\t}\n\tconst { expression } = argument;\n\tif (expression === void 0 && argument.node !== void 0) return refuse(`${argumentLabel} has no value.`);\n\tif (expression === void 0) throw new InternalError(`A call received ${argumentLabel} with no expression. A value argument is read from the expression a schema writes; a reader that builds a call must pass the arguments it parsed, or instantiate the constructor with values.`);\n\tconst read = readExpressionAs(input.dataTypes, dataTypeId(descriptor.dataType), expression);\n\tif (read.ok) return read.value.value;\n\trefusals.value(expression.syntax, read.failure);\n\treturn INVALID_AUTHORING_ARGUMENT;\n}\nfunction readPslHelperArgsReporting(input, refusals) {\n\tconst bound = bindCallArguments(input.args, input.descriptors.map((descriptor) => descriptor?.name));\n\tconst mappedArgs = input.descriptors.map(() => void 0);\n\tfor (const { argument, index } of bound.ok ? bound.value : bound.failure.bound) {\n\t\tconst descriptor = input.descriptors[index];\n\t\tif (!descriptor) {\n\t\t\trefusals.argument(argument.span, `does not define positional argument #${index + 1}.`);\n\t\t\treturn;\n\t\t}\n\t\tconst value = readPslHelperArgument(input, refusals, descriptor, argument, argument.kind === \"named\" ? `named argument \"${argument.name}\"` : `argument #${index + 1}`);\n\t\tif (value === INVALID_AUTHORING_ARGUMENT) return void 0;\n\t\tmappedArgs[index] = value;\n\t}\n\tif (bound.ok) return mappedArgs;\n\tconst failure = bound.failure;\n\tswitch (failure.kind) {\n\t\tcase \"tooManyPositional\":\n\t\t\trefusals.call(`accepts at most ${input.descriptors.length} argument(s), received ${failure.received}.`);\n\t\t\treturn;\n\t\tcase \"unknownName\":\n\t\t\trefusals.argument(failure.argument.span, `received unknown named argument \"${failure.argument.name}\".`);\n\t\t\treturn;\n\t\tcase \"filledTwice\":\n\t\t\trefusals.argument(failure.argument.span, `received duplicate value for argument \"${failure.argument.name}\".`);\n\t\t\treturn;\n\t}\n}\n/**\n* The arguments of a type constructor or type choice call, positional and named, each read as its descriptor says. `undefined`, with a diagnostic pushed, when one cannot be read or does not match a descriptor.\n*/\nfunction mapPslHelperArgs(input) {\n\tconst refused = (span, message) => input.diagnostics.push({\n\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\tmessage: `${input.entityLabel} ${input.helperLabel} ${message}`,\n\t\t...input.source.at(span)\n\t});\n\treturn readPslHelperArgsReporting(input, {\n\t\tcall: (message) => refused(input.span, message),\n\t\targument: refused,\n\t\tvalue: (node, failure) => input.diagnostics.push({\n\t\t\tcode: failure.code,\n\t\t\tmessage: failure.message,\n\t\t\t...input.source.at(nodePslSpan(node, input.source.sources))\n\t\t})\n\t});\n}\n/**\n* The arguments of a call read as {@link mapPslHelperArgs} reads them, without reporting what it refuses: `undefined` when the call does not read, which the reader that resolves the column reports.\n*/\nfunction readPslHelperArgs(input) {\n\treturn readPslHelperArgsReporting(input, SILENT_REFUSALS);\n}\n//#endregion\n//#region src/contributed-type-scope.ts\nfunction isContributedTypeChoice(symbol) {\n\treturn symbol.descriptor.kind === \"typeChoice\";\n}\nfunction isContributedTypeDescriptor(value) {\n\treturn \"kind\" in value && (value.kind === \"typeConstructor\" || value.kind === \"typeAlias\" || value.kind === \"typeChoice\");\n}\n/** The explicit type a call of the type choice `symbol` chooses and the arguments it is built with, reading the call as the column does, or why it chooses none. */\nfunction chosenTypeConstructor(symbol, call, dataTypes) {\n\tconst helperPath = symbol.path.join(\".\");\n\tconst args = readPslHelperArgs({\n\t\targs: call?.args ?? [],\n\t\tdescriptors: symbol.descriptor.args,\n\t\tdataTypes\n\t});\n\tif (args === void 0) return notOk(`The arguments of ${helperPath} do not read.`);\n\ttry {\n\t\treturn ok(resolveAuthoringTypeChoice({\n\t\t\thelperPath,\n\t\t\tdescriptor: symbol.descriptor,\n\t\t\targs,\n\t\t\tconstructorNamed: (name) => symbol.choiceTypes.get(name)\n\t\t}));\n\t} catch (error) {\n\t\tif (isInternalError(error) || !(error instanceof Error)) throw error;\n\t\treturn notOk(error.message);\n\t}\n}\n/** The codec a column typed by `use` is stored with; `undefined` for a type choice whose call chooses no type, which the column's resolution reports. */\nfunction contributedTypeCodecId(use, dataTypes) {\n\tconst { symbol } = use;\n\tif (isContributedTypeChoice(symbol)) {\n\t\tconst chosen = chosenTypeConstructor(symbol, use.call, dataTypes);\n\t\treturn chosen.ok ? chosen.value.descriptor.output.codecId : void 0;\n\t}\n\tconst { descriptor } = symbol;\n\treturn descriptor.kind === \"typeAlias\" ? descriptor.output.type.codecId : descriptor.output.codecId;\n}\n/** The descriptor at `path` in `namespace`, or `undefined` when none is contributed there. */\nfunction contributedTypeAt(namespace, path) {\n\tconst [name, ...rest] = path;\n\tif (name === void 0 || !Object.hasOwn(namespace, name)) return void 0;\n\tconst value = namespace[name];\n\tif (value === void 0) return void 0;\n\tif (isContributedTypeDescriptor(value)) return rest.length === 0 ? value : void 0;\n\treturn contributedTypeAt(value, rest);\n}\n/** The codec a column typed by `call` is stored with, reading the call's arguments as the column does, or `undefined` when no type is contributed at its path or it is a type choice whose arguments choose no type. */\nfunction writtenContributedTypeCodecId(namespace, call) {\n\treturn codecIdAtPath(namespace, call.path, [], call);\n}\nfunction codecIdAtPath(namespace, path, prefix, call) {\n\tconst [name, ...rest] = path;\n\tif (name === void 0 || !Object.hasOwn(namespace, name)) return void 0;\n\tconst value = namespace[name];\n\tif (value === void 0) return void 0;\n\tconst at = [...prefix, name];\n\tif (!isContributedTypeDescriptor(value)) return codecIdAtPath(value, rest, at, call);\n\tif (rest.length > 0) return void 0;\n\treturn contributedTypeCodecId({\n\t\tsymbol: contributedTypeSymbol(name, at, value, namespace),\n\t\tcall\n\t}, EMPTY_DATA_TYPES);\n}\nfunction contributedTypeScope(contributedTypes) {\n\tconst members = collect(contributedTypes, []);\n\treturn {\n\t\tlookup(name) {\n\t\t\treturn members.get(name);\n\t\t},\n\t\tentries() {\n\t\t\treturn members.entries();\n\t\t}\n\t};\n}\nfunction collect(namespace, prefix) {\n\tconst members = /* @__PURE__ */ new Map();\n\tfor (const [name, value] of Object.entries(namespace)) {\n\t\tconst path = [...prefix, name];\n\t\tmembers.set(name, isContributedTypeDescriptor(value) ? contributedTypeSymbol(name, path, value, namespace) : {\n\t\t\tkind: \"contributedNamespace\",\n\t\t\tname,\n\t\t\tpath,\n\t\t\tmembers: collect(value, path)\n\t\t});\n\t}\n\treturn members;\n}\nfunction contributedTypeSymbol(name, path, descriptor, namespace) {\n\tif (descriptor.kind !== \"typeChoice\") return {\n\t\tkind: \"contributedType\",\n\t\tname,\n\t\tpath,\n\t\tdescriptor\n\t};\n\tconst constructorNamed = typeConstructorLookup(namespace);\n\tconst choiceTypes = /* @__PURE__ */ new Map();\n\tfor (const { type } of descriptor.choices) {\n\t\tconst chosen = constructorNamed(type);\n\t\tif (chosen !== void 0) choiceTypes.set(type, chosen);\n\t}\n\treturn {\n\t\tkind: \"contributedType\",\n\t\tname,\n\t\tpath,\n\t\tdescriptor,\n\t\tchoiceTypes\n\t};\n}\n//#endregion\nexport { mapPslDiagnostics as C, diagnosticSource as S, readResolvedAttribute as _, isContributedTypeChoice as a, createPslDiagnosticCollector as b, argumentsByParameter as c, typeAttributeSpecContextOfField as d, typeAttributeSubjectLabel as f, nodePslSpan as g, keywordPslSpan as h, contributedTypeScope as i, printTypeConstructorCall as l, readWrittenScalar as m, contributedTypeAt as n, writtenContributedTypeCodecId as o, readExpressionAs as p, contributedTypeCodecId as r, mapPslHelperArgs as s, chosenTypeConstructor as t, EMPTY_DATA_TYPES as u, readResolvedAttributes as v, diagnosticFromSpan as x, readResolvedConstructorCall as y };\n\n//# sourceMappingURL=contributed-type-scope-Ds4uDG91.mjs.map","//#region src/type-constructor-calls.ts\nfunction isBareTypeConstructor(descriptor) {\n\treturn descriptor.entityRefArg === void 0 && (descriptor.args ?? []).every((arg) => arg.optional === true);\n}\nfunction argumentSpelling(descriptor) {\n\tconst args = descriptor.args ?? [];\n\tconst reference = descriptor.entityRefArg;\n\tconst count = Math.max(args.length, (reference?.index ?? -1) + 1);\n\tconst names = [];\n\tfor (let index = 0; index < count; index++) {\n\t\tconst arg = args[index];\n\t\tif (index === reference?.index) names.push(reference.entityKind);\n\t\telse if (arg !== void 0 && arg.optional !== true) names.push(arg.name ?? `argument${index + 1}`);\n\t}\n\treturn names.join(\", \");\n}\nfunction reportTypeConstructorNotCalled(input) {\n\tinput.diagnostics.push({\n\t\tcode: \"PSL_TYPE_CONSTRUCTOR_NOT_CALLED\",\n\t\tmessage: `${input.entityLabel} uses type constructor \"${input.path}\" without arguments. Write ${input.path}(${argumentSpelling(input.descriptor)}).`,\n\t\t...input.source.at(input.span)\n\t});\n}\n//#endregion\nexport { reportTypeConstructorNotCalled as n, isBareTypeConstructor as t };\n\n//# sourceMappingURL=type-constructor-calls-Bfg5ojed.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,iBAAiB,SAAS,MAAM;CACxC,OAAO;EACN;EACA;EACA,GAAG,MAAM;GACR,MAAM,aAAa,QAAQ,cAAc,IAAI;GAC7C,MAAM,QAAQ,SAAS,KAAK,IAAI;IAC/B,OAAO,WAAW,WAAW,KAAK,MAAM;IACxC,KAAK,WAAW,WAAW,KAAK,SAAS;GAC1C,IAAI,WAAW,eAAe,IAAI;GAClC,OAAO;IACN,UAAU,WAAW;IACrB;GACD;EACD;CACD;AACD;AACA,SAAS,mBAAmB,YAAY,QAAQ;CAC/C,IAAI,WAAW,SAAS,KAAK,GAAG,MAAM,IAAI,cAAc,kCAAkC;CAC1F,OAAO;EACN,MAAM,WAAW;EACjB,SAAS,WAAW;EAC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,CAAC;CAChE,MAAM,QAAQ,CAAC;CACf,KAAK,IAAI,QAAQ,GAAG,QAAQ,OAAO,SAAS;EAC3C,MAAM,MAAM,KAAK;EACjB,IAAI,UAAU,WAAW,OAAO,MAAM,KAAK,UAAU,UAAU;OAC1D,IAAI,QAAQ,KAAK,KAAK,IAAI,aAAa,MAAM,MAAM,KAAK,IAAI,QAAQ,WAAW,QAAQ,GAAG;CAChG;CACA,OAAO,MAAM,KAAK,IAAI;AACvB;AACA,SAAS,+BAA+B,OAAO;CAC9C,MAAM,YAAY,KAAK;EACtB,MAAM;EACN,SAAS,GAAG,MAAM,YAAY,0BAA0B,MAAM,KAAK,6BAA6B,MAAM,KAAK,GAAG,iBAAiB,MAAM,UAAU,EAAE;EACjJ,GAAG,MAAM,OAAO,GAAG,MAAM,IAAI;CAC9B,CAAC;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/orm-framework",
3
- "version": "8.0.0-rc.21-dev.6",
3
+ "version": "8.0.0-rc.21-dev.8",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -16,20 +16,20 @@
16
16
  "uniku": "^0.5.0"
17
17
  },
18
18
  "devDependencies": {
19
- "@internal/config": "8.0.0-rc.21-dev.6",
20
- "@internal/contract": "8.0.0-rc.21-dev.6",
21
- "@internal/contract-authoring": "8.0.0-rc.21-dev.6",
22
- "@internal/errors": "8.0.0-rc.21-dev.6",
23
- "@internal/framework-components": "8.0.0-rc.21-dev.6",
24
- "@internal/ids": "8.0.0-rc.21-dev.6",
25
- "@internal/operations": "8.0.0-rc.21-dev.6",
26
- "@internal/psl-parser": "8.0.0-rc.21-dev.6",
27
- "@internal/psl-printer": "8.0.0-rc.21-dev.6",
28
- "@internal/ts-render": "8.0.0-rc.21-dev.6",
29
- "@repo/tsconfig": "8.0.0-rc.21-dev.6",
30
- "@internal/publish-surface": "8.0.0-rc.21-dev.6",
31
- "@repo/tsdown": "8.0.0-rc.21-dev.6",
32
- "@internal/utils": "8.0.0-rc.21-dev.6",
19
+ "@internal/config": "8.0.0-rc.21-dev.8",
20
+ "@internal/contract": "8.0.0-rc.21-dev.8",
21
+ "@internal/contract-authoring": "8.0.0-rc.21-dev.8",
22
+ "@internal/errors": "8.0.0-rc.21-dev.8",
23
+ "@internal/framework-components": "8.0.0-rc.21-dev.8",
24
+ "@internal/ids": "8.0.0-rc.21-dev.8",
25
+ "@internal/operations": "8.0.0-rc.21-dev.8",
26
+ "@internal/psl-parser": "8.0.0-rc.21-dev.8",
27
+ "@internal/psl-printer": "8.0.0-rc.21-dev.8",
28
+ "@internal/ts-render": "8.0.0-rc.21-dev.8",
29
+ "@repo/tsconfig": "8.0.0-rc.21-dev.8",
30
+ "@internal/publish-surface": "8.0.0-rc.21-dev.8",
31
+ "@repo/tsdown": "8.0.0-rc.21-dev.8",
32
+ "@internal/utils": "8.0.0-rc.21-dev.8",
33
33
  "tsdown": "0.22.14",
34
34
  "typescript": "5.9.3",
35
35
  "vitest": "5.0.0-rc.2"