@prisma/orm-framework 8.0.0-rc.18-dev.37 → 8.0.0-rc.18-dev.39
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-BJgarhJI.d.mts → authoring-BKO7sRLw.d.mts} +3 -3
- package/dist/{authoring-BJgarhJI.d.mts.map → authoring-BKO7sRLw.d.mts.map} +1 -1
- package/dist/{binder-Cm0N-oPu-WASgR3Jw.d.mts → binder-WS9-1Mu9-MJi8x3Gm.d.mts} +12 -10
- package/dist/{binder-Cm0N-oPu-WASgR3Jw.d.mts.map → binder-WS9-1Mu9-MJi8x3Gm.d.mts.map} +1 -1
- package/dist/{components-DJ5O7uwz.mjs → components-C83PWIWw.mjs} +10 -2
- package/dist/components-C83PWIWw.mjs.map +1 -0
- package/dist/{components-BbJVTEds.d.mts → components-D-8GZwNo.d.mts} +5 -3
- package/dist/{components-BbJVTEds.d.mts.map → components-D-8GZwNo.d.mts.map} +1 -1
- package/dist/components.d.mts +9 -9
- package/dist/components.mjs +2 -2
- package/dist/components__authoring.d.mts +3 -3
- package/dist/components__components.d.mts +2 -2
- package/dist/components__components.mjs +1 -1
- package/dist/components__control.d.mts +2 -2
- package/dist/components__control.mjs +1 -1
- package/dist/components__execution.d.mts +1 -1
- package/dist/components__psl-ast.d.mts +3 -3
- package/dist/{config-types-DWa3fsKB.d.mts → config-types-CfdMN7t-.d.mts} +6 -6
- package/dist/{config-types-DWa3fsKB.d.mts.map → config-types-CfdMN7t-.d.mts.map} +1 -1
- package/dist/config.d.mts +1 -1
- package/dist/config__config-types.d.mts +1 -1
- package/dist/contract-authoring.d.mts +2 -2
- package/dist/contract-authoring.mjs +1 -1
- package/dist/{control-BKuRvAVY.d.mts → control-7DsPHRLi.d.mts} +7 -5
- package/dist/{control-BKuRvAVY.d.mts.map → control-7DsPHRLi.d.mts.map} +1 -1
- package/dist/{control-DrorRbwa.mjs → control-AlBtrJUn.mjs} +2 -1
- package/dist/control-AlBtrJUn.mjs.map +1 -0
- package/dist/{control-B5ezUWD2-DSW4M09S.d.mts → control-B5ezUWD2-BgUEggvd.d.mts} +2 -2
- package/dist/{control-B5ezUWD2-DSW4M09S.d.mts.map → control-B5ezUWD2-BgUEggvd.d.mts.map} +1 -1
- package/dist/control-CIEbQ0bK.d.mts +1 -0
- package/dist/{control-KsXr4fYD-BWq94TJe.mjs → control-KsXr4fYD-DJm_48Db.mjs} +2 -2
- package/dist/{control-KsXr4fYD-BWq94TJe.mjs.map → control-KsXr4fYD-DJm_48Db.mjs.map} +1 -1
- package/dist/errors.d.mts +4 -4
- package/dist/errors.mjs +3 -3
- package/dist/errors__control.d.mts +2 -2
- package/dist/errors__control.mjs +1 -1
- package/dist/errors__execution.d.mts +1 -1
- package/dist/errors__execution.mjs +1 -1
- package/dist/errors__migration.d.mts +1 -1
- package/dist/errors__migration.mjs +1 -1
- package/dist/{execution-Dnl9Zc7s.d.mts → execution-BkcXd7Tn.d.mts} +3 -3
- package/dist/{execution-Dnl9Zc7s.d.mts.map → execution-BkcXd7Tn.d.mts.map} +1 -1
- package/dist/{execution-oZAqgZPd.d.mts → execution-DXQQRCfR.d.mts} +2 -2
- package/dist/{execution-oZAqgZPd.d.mts.map → execution-DXQQRCfR.d.mts.map} +1 -1
- package/dist/{execution-YDOVHN67.mjs → execution-KLhn9sSn.mjs} +2 -2
- package/dist/{execution-YDOVHN67.mjs.map → execution-KLhn9sSn.mjs.map} +1 -1
- package/dist/{framework-authoring-D3AsJskV-BALZR-J9.d.mts → framework-authoring-hZgq-M2K-Daz3kgWL.d.mts} +6 -2
- package/dist/{framework-authoring-D3AsJskV-BALZR-J9.d.mts.map → framework-authoring-hZgq-M2K-Daz3kgWL.d.mts.map} +1 -1
- package/dist/{framework-components-CTibZus8-BK5QlxM-.d.mts → framework-components-B-yaLbst-nZJUGMuf.d.mts} +5 -3
- package/dist/framework-components-B-yaLbst-nZJUGMuf.d.mts.map +1 -0
- package/dist/ids.d.mts +17 -1
- package/dist/ids.d.mts.map +1 -1
- package/dist/ids.mjs +19 -2
- package/dist/ids.mjs.map +1 -1
- package/dist/{migration-CHa1k8VR.d.mts → migration-BVDJBmyi.d.mts} +2 -2
- package/dist/{migration-CHa1k8VR.d.mts.map → migration-BVDJBmyi.d.mts.map} +1 -1
- package/dist/{migration-BOOO5ZD-.mjs → migration-CZik9OxU.mjs} +2 -2
- package/dist/{migration-BOOO5ZD-.mjs.map → migration-CZik9OxU.mjs.map} +1 -1
- package/dist/{parse-CJtBvEYy-CW8BvW5O.d.mts → parse-CJtBvEYy-BCae0181.d.mts} +6 -6
- package/dist/{parse-CJtBvEYy-CW8BvW5O.d.mts.map → parse-CJtBvEYy-BCae0181.d.mts.map} +1 -1
- package/dist/{psl-ast-JQykH4Uz-D6tMHdnz.d.mts → psl-ast-BIJIW24G-B8ptjyuO.d.mts} +3 -3
- package/dist/{psl-ast-JQykH4Uz-D6tMHdnz.d.mts.map → psl-ast-BIJIW24G-B8ptjyuO.d.mts.map} +1 -1
- package/dist/psl-ast-rf0UoVty.d.mts +2 -0
- package/dist/psl-parser.d.mts +29 -14
- package/dist/psl-parser.d.mts.map +1 -1
- package/dist/psl-parser.mjs +37 -12
- package/dist/psl-parser.mjs.map +1 -1
- package/dist/psl-parser__format.d.mts +1 -1
- package/dist/psl-parser__interpret.d.mts +6 -6
- package/dist/psl-parser__syntax.d.mts +1 -1
- package/dist/psl-printer.d.mts +4 -4
- package/dist/{temporal-presets-adW53vQH-DPdAe_Oe.d.mts → temporal-presets-Cumws2z--DcYWooYJ.d.mts} +3 -3
- package/dist/{temporal-presets-adW53vQH-DPdAe_Oe.d.mts.map → temporal-presets-Cumws2z--DcYWooYJ.d.mts.map} +1 -1
- package/package.json +15 -15
- package/dist/components-DJ5O7uwz.mjs.map +0 -1
- package/dist/control-CgOeB4TR.d.mts +0 -1
- package/dist/control-DrorRbwa.mjs.map +0 -1
- package/dist/framework-components-CTibZus8-BK5QlxM-.d.mts.map +0 -1
- package/dist/psl-ast-DOJH1ZST.d.mts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"psl-parser.d.mts","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/index.d.mts"],"mappings":";;;;;;;;;;;;;;;;iBAWiB,sBAAsB,WAAW,cAAgB;iBACjD,yBAAyB;;;UAGhC;WACC,SAAS;WACT,WAAW;;UAEZ;WACC,MAAM,iBAAiB;WACvB;;UAED,gBAAgB;WACf;WACA,YAAY,SAAS,eAAe,eAAe;WACnD,OAAO;;UAER,aAAa;WACZ;WACA,OAAO;WACP;WACA,OAAO;;KAEb,UAAU,iBAAiB,gBAAgB,OAAO,aAAa;KAC/D,WAAW,KAAK,UAAU,gBAAgB,OAAO;KACjD,oBAAoB,KAAK,qBAAqB,UAAU,SAAS;;;UAG5D;WACC,SAAS;WACT,OAAO,cAAc;WACrB,yBAAyB;WACzB,oBAAoB;WACpB,WAAW;;;cAGR,kBAAkB;UACtB,kCAAkC;WACjC,OAAO;WACP,gBAAgB;;WAEhB,iBAAiB;;KAEvB,6BAA6B,KAAK,yBAAyB,qBAAqB;KAChF,6BAA6B,KAAK,8BAA8B,qBAAqB;UAChF;WACC,OAAO,SAAS,eAAe;WAC/B,OAAO,SAAS,eAAe;;KAErC,6BAA6B,KAAK,qBAAqB,qBAAqB;;;UAGvE;WACC,OAAO,SAAS,eAAe;WAC/B,OAAO,SAAS,eAAe;;iBAEzB,uBAAuB,eAAe,kCAAkC;;;UAG/E,qBAAqB,qBAAqB,yBAAyB,sBAAsB,cAAc,eAAe,eAAe;WACpI;WACA,aAAa;WACb,QAAQ;WACR,UAAU,QAAQ,aAAa,KAAK,QAAQ,KAAK,mBAAmB,eAAe,qBAAqB;;iBAElG,qBAAqB,qBAAqB,yBAAyB,0CAA0C,cAAc,eAAe,eAAe,sBAAsB,sBAAsB,cAAc,QAAQ,qBAAqB,KAAK,SAAS,cAAc,aAAa,KAAK,QAAQ;;;iBAGtS,QAAQ,YAAY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MxG;;;iBAGG,mBAAmB;;iBAEnB,sBAAsB;;;;KAIlC;WACM;WACA,SAAS;;WAET;WACA;;WAEA;WACA;WACA;;;iBAGM,kBAAkB,YAAY,gBAAgB"}
|
package/dist/psl-parser.mjs
CHANGED
|
@@ -1592,17 +1592,18 @@ const TAGGED_LITERAL_FAILURE_CODES$1 = {
|
|
|
1592
1592
|
nul: "PSL_TAGGED_LITERAL_NUL",
|
|
1593
1593
|
"too-large": "PSL_TAGGED_LITERAL_TOO_LARGE"
|
|
1594
1594
|
};
|
|
1595
|
-
/** An argument typed by a data type: any literal, admitted by the ADR 254 cast rule. Used as a parameter of an attribute, a block or a `funcCall
|
|
1596
|
-
function dataTypeValue(dataType, support) {
|
|
1595
|
+
/** An argument typed by a data type: any literal, admitted by the ADR 254 cast rule. Used as a parameter of an attribute, a block or a `funcCall`; `oneOf` refuses it as an arm. ADR 231, ADR 254, ADR 268. */
|
|
1596
|
+
function dataTypeValue(dataType, support, options = {}) {
|
|
1597
1597
|
const tags = admittedTags(support, dataType);
|
|
1598
1598
|
const [firstTag] = tags;
|
|
1599
1599
|
const forms = admittedForms(support, [dataType]);
|
|
1600
1600
|
return {
|
|
1601
1601
|
kind: "dataTypeValue",
|
|
1602
|
-
label: firstTag === void 0 ? describeAdmittedForms(support, dataType) : tagForm(firstTag).phrase,
|
|
1602
|
+
label: options.label ?? (firstTag === void 0 ? describeAdmittedForms(support, dataType) : tagForm(firstTag).phrase),
|
|
1603
1603
|
dataType,
|
|
1604
1604
|
tags,
|
|
1605
1605
|
documentation: support.entries[dataType]?.documentation ?? "",
|
|
1606
|
+
suggestions: options.suggestions ?? [],
|
|
1606
1607
|
parse: (arg, ctx) => parseDataTypeValue(arg, ctx, dataType, support, forms)
|
|
1607
1608
|
};
|
|
1608
1609
|
}
|
|
@@ -1688,6 +1689,7 @@ function num(value) {
|
|
|
1688
1689
|
* The first alternative that accepts the argument. When exactly one alternative claims the argument's shape, its result, success or failure, so its diagnostics about the argument are kept.
|
|
1689
1690
|
*/
|
|
1690
1691
|
function oneOf(...alts) {
|
|
1692
|
+
for (const alt of alts) if (alt.kind === "dataTypeValue") throw new InternalError(`oneOf was given an arm typed by data type "${alt.dataType}" (${alt.label}). A value of a data type is a parameter of an attribute, a block or a function call, never an arm of oneOf.`);
|
|
1691
1693
|
const label = alts.map((alt) => alt.label).join(" | ");
|
|
1692
1694
|
return {
|
|
1693
1695
|
kind: "oneOf",
|
|
@@ -1826,7 +1828,7 @@ function interpretArgs(args, spec, ctx, span, sourceNode) {
|
|
|
1826
1828
|
const posParam = spec.positional[positionalSlot];
|
|
1827
1829
|
if (posParam === void 0) {
|
|
1828
1830
|
if (!reportedExcess) {
|
|
1829
|
-
outcome = and(outcome, notOk([diagnostic(
|
|
1831
|
+
outcome = and(outcome, notOk([diagnostic(`${spec.label} received too many positional arguments`, ctx, span, sourceNode)]));
|
|
1830
1832
|
reportedExcess = true;
|
|
1831
1833
|
}
|
|
1832
1834
|
continue;
|
|
@@ -1837,14 +1839,14 @@ function interpretArgs(args, spec, ctx, span, sourceNode) {
|
|
|
1837
1839
|
} else {
|
|
1838
1840
|
const namedParam = Object.hasOwn(spec.named, name) ? spec.named[name] : void 0;
|
|
1839
1841
|
if (namedParam === void 0) {
|
|
1840
|
-
outcome = and(outcome, notOk([diagnostic(
|
|
1842
|
+
outcome = and(outcome, notOk([diagnostic(`${spec.label} received unknown argument "${name}"`, ctx, nodePslSpan(arg.syntax, ctx.sources), arg.syntax)]));
|
|
1841
1843
|
continue;
|
|
1842
1844
|
}
|
|
1843
1845
|
key = name;
|
|
1844
1846
|
param = namedParam.type;
|
|
1845
1847
|
}
|
|
1846
1848
|
if (seen.has(key)) {
|
|
1847
|
-
outcome = and(outcome, notOk([diagnostic(
|
|
1849
|
+
outcome = and(outcome, notOk([diagnostic(`${spec.label} received duplicate argument "${key}"`, ctx, nodePslSpan(arg.syntax, ctx.sources), arg.syntax)]));
|
|
1848
1850
|
continue;
|
|
1849
1851
|
}
|
|
1850
1852
|
seen.add(key);
|
|
@@ -1862,7 +1864,7 @@ function interpretArgs(args, spec, ctx, span, sourceNode) {
|
|
|
1862
1864
|
if (effective.hasDefault) output[key] = effective.defaultValue;
|
|
1863
1865
|
return;
|
|
1864
1866
|
}
|
|
1865
|
-
outcome = and(outcome, notOk([diagnostic(
|
|
1867
|
+
outcome = and(outcome, notOk([diagnostic(`${spec.label} is missing required argument "${key}"`, ctx, span, sourceNode)]));
|
|
1866
1868
|
};
|
|
1867
1869
|
for (const param of spec.positional) {
|
|
1868
1870
|
const namedParam = Object.hasOwn(spec.named, param.key) ? spec.named[param.key] : void 0;
|
|
@@ -1874,7 +1876,10 @@ function interpretArgs(args, spec, ctx, span, sourceNode) {
|
|
|
1874
1876
|
}
|
|
1875
1877
|
function interpretAttribute(attrNode, spec, ctx) {
|
|
1876
1878
|
const attributeSpan = nodePslSpan(attrNode.syntax, ctx.sources);
|
|
1877
|
-
const bound = interpretArgs(attrNode.argList()?.args() ?? [],
|
|
1879
|
+
const bound = interpretArgs(attrNode.argList()?.args() ?? [], {
|
|
1880
|
+
...spec,
|
|
1881
|
+
label: `Attribute "${spec.name}"`
|
|
1882
|
+
}, ctx, attributeSpan, attrNode.syntax);
|
|
1878
1883
|
if (!bound.ok) return notOk(bound.failure);
|
|
1879
1884
|
const value = blindCast(bound.value);
|
|
1880
1885
|
if (spec.refine !== void 0) {
|
|
@@ -1898,7 +1903,7 @@ function diagnostic(message, ctx, span, sourceNode) {
|
|
|
1898
1903
|
...diagnosticSource(ctx.sources, sourceNode).at(span)
|
|
1899
1904
|
};
|
|
1900
1905
|
}
|
|
1901
|
-
function funcCall(name, sig) {
|
|
1906
|
+
function funcCall(name, sig, options = {}) {
|
|
1902
1907
|
return {
|
|
1903
1908
|
kind: "funcCall",
|
|
1904
1909
|
label: `${name}()`,
|
|
@@ -1910,7 +1915,7 @@ function funcCall(name, sig) {
|
|
|
1910
1915
|
if (!guard.ok) return guard;
|
|
1911
1916
|
const span = nodePslSpan(guard.value.syntax, ctx.sources);
|
|
1912
1917
|
const bound = interpretArgs(guard.value.args(), {
|
|
1913
|
-
name
|
|
1918
|
+
label: options.label ?? `Attribute "${name}"`,
|
|
1914
1919
|
positional: sig.positional ?? [],
|
|
1915
1920
|
named: sig.named ?? {}
|
|
1916
1921
|
}, ctx, span, guard.value.syntax);
|
|
@@ -2124,6 +2129,19 @@ function mapArg(arm, map) {
|
|
|
2124
2129
|
parse
|
|
2125
2130
|
});
|
|
2126
2131
|
}
|
|
2132
|
+
/**
|
|
2133
|
+
* `arm`, with the value it parses passed through `refine`, which may refuse it. The result keeps the arm's `kind`, `label` and metadata, as `mapArg` does. A refusal of the arm passes through without running `refine`.
|
|
2134
|
+
*/
|
|
2135
|
+
function refineArg(arm, refine) {
|
|
2136
|
+
const parse = (arg, ctx) => {
|
|
2137
|
+
const parsed = arm.parse(arg, ctx);
|
|
2138
|
+
return parsed.ok ? refine(parsed.value, arg, ctx) : parsed;
|
|
2139
|
+
};
|
|
2140
|
+
return blindCast({
|
|
2141
|
+
...arm,
|
|
2142
|
+
parse
|
|
2143
|
+
});
|
|
2144
|
+
}
|
|
2127
2145
|
/** A number literal kept as its source text, for consumers that must not round it through a JS number. */
|
|
2128
2146
|
function numLiteral() {
|
|
2129
2147
|
return {
|
|
@@ -2195,6 +2213,13 @@ function functionListText(functions, codecKnown) {
|
|
|
2195
2213
|
return codecKnown ? "No generator function applies to this codec." : "No generator function applies to it.";
|
|
2196
2214
|
}
|
|
2197
2215
|
/**
|
|
2216
|
+
* A call to the generator function `name`, with its signature built from the stack's data types when it is written as a function of them. Its binding diagnostics name it as a generator function.
|
|
2217
|
+
*/
|
|
2218
|
+
function generatorFunctionCall(name, signature, dataTypes) {
|
|
2219
|
+
const declared = blindCast(signature);
|
|
2220
|
+
return funcCall(name, typeof declared === "function" ? declared(dataTypes) : declared, { label: `Generator function "${name}"` });
|
|
2221
|
+
}
|
|
2222
|
+
/**
|
|
2198
2223
|
* The generator function arms for a field's codec. A call to a function that does not apply to the codec, or that no component declares, is refused before the arms are tried, so the author is told which functions do apply.
|
|
2199
2224
|
*/
|
|
2200
2225
|
function generatorCallArm(ctx) {
|
|
@@ -2206,7 +2231,7 @@ function generatorCallArm(ctx) {
|
|
|
2206
2231
|
const name = calleeName(arg);
|
|
2207
2232
|
return notOk([name !== void 0 && !ctx.generatorFunctions.has(name) ? leafDiagnostic(attributeCtx, arg, `Field "${fieldPath}": unknown generator function "${name}". ${functionListText(functions, codecId !== void 0)}`, "PSL_UNKNOWN_GENERATOR_FUNCTION") : leafDiagnostic(attributeCtx, arg, `Field "${fieldPath}": ${nodeSourceText(arg, attributeCtx)} does not apply to ${target}. ${functionListText(functions, codecId !== void 0)}`, "PSL_GENERATOR_NOT_APPLICABLE")]);
|
|
2208
2233
|
};
|
|
2209
|
-
const [first, ...rest] = functions.map(({ name, signature }) =>
|
|
2234
|
+
const [first, ...rest] = functions.map(({ name, signature }) => generatorFunctionCall(name, signature, ctx.dataTypes));
|
|
2210
2235
|
if (first === void 0) return {
|
|
2211
2236
|
kind: "rejecting",
|
|
2212
2237
|
label: "generator function",
|
|
@@ -2514,6 +2539,6 @@ function renameLegacyDirective(text) {
|
|
|
2514
2539
|
return text.replace(DIRECTIVE, (whole, lead, name, trail) => name === LEGACY_NAME ? `${lead}prisma-8${trail}` : whole);
|
|
2515
2540
|
}
|
|
2516
2541
|
//#endregion
|
|
2517
|
-
export { EMPTY_DATA_TYPES, NAME_THE_PSL_SOURCE_LOSES, PSL_UNRESOLVED_REFERENCE, assembleAttributeSpecs, blockAttribute, blockSpecContext, blockSpecFactoryOf, bool, buildSymbolTable, contributedTypeOf, createBinder, createPslDiagnosticCollector, dataTypeValue, diagnosticFromSpan, diagnosticSource, entityRef, entityReference, enumMemberValue, fieldAttribute, fieldRef, findBlockDescriptor, flatPslModels, funcCall, generatorAttributeSpec, getPositionalArgument, identifier, int, interpretArgs, interpretAttribute, interpretExtensionBlock, interpretExtensionBlockAttributes, interpretExtensionBlocks, isNamespaceLike, isPrismaNextSchema, isPslIdentifier, json, jsonValue, keywordPslSpan, leafDiagnostic, list, mapArg, mapBlock, mapPslDiagnostics, matchesSelector, memberEntries, modelAttribute, namespacePslExtensionBlocks, nodePslSpan, nodeSourceText, num, numLiteral, oneOf, optional, parseQuotedStringLiteral, readResolvedAttribute, readResolvedAttributes, readResolvedConstructorCall, readWrittenScalar, record, referencedFieldRef, renameLegacyDirective, str, structBlock, taggedLiteral, typeReferenceNode, writtenList, writtenScalar };
|
|
2542
|
+
export { EMPTY_DATA_TYPES, NAME_THE_PSL_SOURCE_LOSES, PSL_UNRESOLVED_REFERENCE, assembleAttributeSpecs, blockAttribute, blockSpecContext, blockSpecFactoryOf, bool, buildSymbolTable, contributedTypeOf, createBinder, createPslDiagnosticCollector, dataTypeValue, diagnosticFromSpan, diagnosticSource, entityRef, entityReference, enumMemberValue, fieldAttribute, fieldRef, findBlockDescriptor, flatPslModels, funcCall, generatorAttributeSpec, generatorFunctionCall, getPositionalArgument, identifier, int, interpretArgs, interpretAttribute, interpretExtensionBlock, interpretExtensionBlockAttributes, interpretExtensionBlocks, isNamespaceLike, isPrismaNextSchema, isPslIdentifier, json, jsonValue, keywordPslSpan, leafDiagnostic, list, mapArg, mapBlock, mapPslDiagnostics, matchesSelector, memberEntries, modelAttribute, namespacePslExtensionBlocks, nodePslSpan, nodeSourceText, num, numLiteral, oneOf, optional, parseQuotedStringLiteral, readResolvedAttribute, readResolvedAttributes, readResolvedConstructorCall, readWrittenScalar, record, referencedFieldRef, refineArg, renameLegacyDirective, str, structBlock, taggedLiteral, typeReferenceNode, writtenList, writtenScalar };
|
|
2518
2543
|
|
|
2519
2544
|
//# sourceMappingURL=psl-parser.mjs.map
|