@prisma/orm-framework 8.0.0-rc.18-dev.32 → 8.0.0-rc.18-dev.34
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-BY3RNM--.d.mts → authoring-BJgarhJI.d.mts} +10 -8
- package/dist/authoring-BJgarhJI.d.mts.map +1 -0
- package/dist/{authoring-D77CrCtb.mjs → authoring-so3aBYD8.mjs} +70 -42
- package/dist/authoring-so3aBYD8.mjs.map +1 -0
- package/dist/{binder-Cm0N-oPu-deLbJ-j9.d.mts → binder-Cm0N-oPu-WASgR3Jw.d.mts} +12 -12
- package/dist/{binder-Cm0N-oPu-deLbJ-j9.d.mts.map → binder-Cm0N-oPu-WASgR3Jw.d.mts.map} +1 -1
- package/dist/codec-DGRG8oEH.mjs +56 -0
- package/dist/codec-DGRG8oEH.mjs.map +1 -0
- package/dist/{codec-CGFT5YKu.d.mts → codec-DkiEF2cQ.d.mts} +15 -3
- package/dist/codec-DkiEF2cQ.d.mts.map +1 -0
- package/dist/{codec-descriptor-DEfL2Kb6-B-vOB0ue.mjs → codec-descriptor-V2-N5Qmm-BR-5owl6.mjs} +3 -3
- package/dist/{codec-descriptor-DEfL2Kb6-B-vOB0ue.mjs.map → codec-descriptor-V2-N5Qmm-BR-5owl6.mjs.map} +1 -1
- package/dist/{codec-types-B5_YzEwo-DVCRRWlg.d.mts → codec-types-DjozIOvT-BIcpyFea.d.mts} +10 -2
- package/dist/codec-types-DjozIOvT-BIcpyFea.d.mts.map +1 -0
- package/dist/{components-BdXloTpj.d.mts → components-BbJVTEds.d.mts} +4 -4
- package/dist/{components-BdXloTpj.d.mts.map → components-BbJVTEds.d.mts.map} +1 -1
- package/dist/components.d.mts +16 -16
- package/dist/components.mjs +6 -6
- package/dist/components__authoring.d.mts +3 -3
- package/dist/components__authoring.mjs +1 -1
- package/dist/components__codec.d.mts +3 -3
- package/dist/components__codec.mjs +4 -4
- package/dist/components__components.d.mts +3 -3
- package/dist/components__control.d.mts +3 -3
- package/dist/components__control.mjs +2 -2
- package/dist/components__emission.d.mts +3 -3
- package/dist/components__execution.d.mts +1 -1
- package/dist/components__psl-ast.d.mts +3 -3
- package/dist/components__runtime.d.mts +1 -1
- package/dist/{config-types-BXw8w6h9.d.mts → config-types-DWa3fsKB.d.mts} +9 -9
- package/dist/{config-types-BXw8w6h9.d.mts.map → config-types-DWa3fsKB.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 +5 -5
- package/dist/contract-authoring.mjs +3 -3
- package/dist/contract-authoring.mjs.map +1 -1
- package/dist/contract.d.mts +3 -3
- package/dist/contract.mjs +1 -1
- package/dist/contract__enum-accessor.d.mts +1 -1
- package/dist/contract__enum-accessor.mjs +1 -1
- package/dist/contract__types.d.mts +2 -2
- package/dist/{control-C_zs63JQ-BFg3u8U5.d.mts → control-B5ezUWD2-DSW4M09S.d.mts} +6 -4
- package/dist/{control-C_zs63JQ-BFg3u8U5.d.mts.map → control-B5ezUWD2-DSW4M09S.d.mts.map} +1 -1
- package/dist/{control-D2f07K6R.d.mts → control-BKuRvAVY.d.mts} +44 -23
- package/dist/control-BKuRvAVY.d.mts.map +1 -0
- package/dist/control-CgOeB4TR.d.mts +1 -0
- package/dist/{control-BJypoZfu.mjs → control-DrorRbwa.mjs} +77 -3
- package/dist/control-DrorRbwa.mjs.map +1 -0
- package/dist/{control-Bv8UK63M-dBsEDbTP.mjs → control-KsXr4fYD-BWq94TJe.mjs} +5 -4
- package/dist/control-KsXr4fYD-BWq94TJe.mjs.map +1 -0
- package/dist/{data-type-DPhZLx30-DP2Kmnf5.mjs → data-type-CVNHtd6y-BFa_VnCb.mjs} +4 -3
- package/dist/data-type-CVNHtd6y-BFa_VnCb.mjs.map +1 -0
- package/dist/emission-XBYOUuHN.d.mts +2 -0
- package/dist/{emission-types-CH6r1DQ8-eg79TO6Y.d.mts → emission-types-sz0-pyyS-D3-ssRUu.d.mts} +4 -4
- package/dist/{emission-types-CH6r1DQ8-eg79TO6Y.d.mts.map → emission-types-sz0-pyyS-D3-ssRUu.d.mts.map} +1 -1
- package/dist/{enum-accessor-BUVBc6ZH.d.mts → enum-accessor-2OZgavDX.d.mts} +4 -2
- package/dist/enum-accessor-2OZgavDX.d.mts.map +1 -0
- package/dist/{enum-accessor-CAlX-HOl.mjs → enum-accessor-B-A2wNok.mjs} +17 -4
- package/dist/enum-accessor-B-A2wNok.mjs.map +1 -0
- package/dist/errors.d.mts +5 -5
- package/dist/errors.mjs +4 -4
- package/dist/errors__control.d.mts +2 -2
- package/dist/errors__control.mjs +1 -1
- package/dist/errors__execution.d.mts +2 -2
- package/dist/errors__execution.mjs +2 -2
- package/dist/errors__migration.d.mts +1 -1
- package/dist/errors__migration.mjs +1 -1
- package/dist/{execution-B_f4fR5R.d.mts → execution-Dnl9Zc7s.d.mts} +4 -14
- package/dist/{execution-B_f4fR5R.d.mts.map → execution-Dnl9Zc7s.d.mts.map} +1 -1
- package/dist/{execution-okmamhD2.mjs → execution-YDOVHN67.mjs} +3 -15
- package/dist/{execution-okmamhD2.mjs.map → execution-YDOVHN67.mjs.map} +1 -1
- package/dist/{execution-DbU_RTsu.d.mts → execution-oZAqgZPd.d.mts} +2 -2
- package/dist/{execution-DbU_RTsu.d.mts.map → execution-oZAqgZPd.d.mts.map} +1 -1
- package/dist/{framework-authoring-CdKfPz3Y-BGocjz36.d.mts → framework-authoring-D3AsJskV-BALZR-J9.d.mts} +131 -10
- package/dist/framework-authoring-D3AsJskV-BALZR-J9.d.mts.map +1 -0
- package/dist/{framework-components-CDiuJNYP-CwszHrSy.d.mts → framework-components-CTibZus8-BK5QlxM-.d.mts} +5 -5
- package/dist/{framework-components-CDiuJNYP-CwszHrSy.d.mts.map → framework-components-CTibZus8-BK5QlxM-.d.mts.map} +1 -1
- package/dist/ids.d.mts +1 -1
- package/dist/{migration-BfUEEHWP.mjs → migration-BOOO5ZD-.mjs} +2 -2
- package/dist/{migration-BfUEEHWP.mjs.map → migration-BOOO5ZD-.mjs.map} +1 -1
- package/dist/{migration-BmIe8pwt.d.mts → migration-CHa1k8VR.d.mts} +2 -2
- package/dist/{migration-BmIe8pwt.d.mts.map → migration-CHa1k8VR.d.mts.map} +1 -1
- package/dist/{parse-CJtBvEYy-wRfXv1HQ.d.mts → parse-CJtBvEYy-CW8BvW5O.d.mts} +6 -6
- package/dist/{parse-CJtBvEYy-wRfXv1HQ.d.mts.map → parse-CJtBvEYy-CW8BvW5O.d.mts.map} +1 -1
- package/dist/psl-ast-DOJH1ZST.d.mts +2 -0
- package/dist/{psl-ast-DJhMWL6S-Bwyl-NrU.d.mts → psl-ast-JQykH4Uz-D6tMHdnz.d.mts} +3 -3
- package/dist/{psl-ast-DJhMWL6S-Bwyl-NrU.d.mts.map → psl-ast-JQykH4Uz-D6tMHdnz.d.mts.map} +1 -1
- package/dist/psl-parser.d.mts +19 -14
- package/dist/psl-parser.d.mts.map +1 -1
- package/dist/psl-parser.mjs +145 -116
- 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/{runtime-CsMROQco.d.mts → runtime-BXPhK_oW.d.mts} +2 -2
- package/dist/{runtime-CsMROQco.d.mts.map → runtime-BXPhK_oW.d.mts.map} +1 -1
- package/dist/{written-value-CQt_C72W-aKFkxVmA.d.mts → temporal-presets-adW53vQH-DPdAe_Oe.d.mts} +4 -125
- package/dist/temporal-presets-adW53vQH-DPdAe_Oe.d.mts.map +1 -0
- package/dist/{types-BBb-tMcj.d.mts → types-GNXJ7xW2.d.mts} +16 -3
- package/dist/types-GNXJ7xW2.d.mts.map +1 -0
- package/dist/{types-import-spec-B2nK2jwW-DkF7t1NL.d.mts → types-import-spec-hkPsnreE-C-fa8812.d.mts} +3 -3
- package/dist/{types-import-spec-B2nK2jwW-DkF7t1NL.d.mts.map → types-import-spec-hkPsnreE-C-fa8812.d.mts.map} +1 -1
- package/dist/utils.d.mts +1 -1
- package/package.json +15 -15
- package/dist/authoring-BY3RNM--.d.mts.map +0 -1
- package/dist/authoring-D77CrCtb.mjs.map +0 -1
- package/dist/codec-BYGt3r-S.mjs +0 -28
- package/dist/codec-BYGt3r-S.mjs.map +0 -1
- package/dist/codec-CGFT5YKu.d.mts.map +0 -1
- package/dist/codec-types-B5_YzEwo-DVCRRWlg.d.mts.map +0 -1
- package/dist/control-BJypoZfu.mjs.map +0 -1
- package/dist/control-Bv8UK63M-dBsEDbTP.mjs.map +0 -1
- package/dist/control-D2f07K6R.d.mts.map +0 -1
- package/dist/control-GrJDRvbD.d.mts +0 -1
- package/dist/data-type-DPhZLx30-DP2Kmnf5.mjs.map +0 -1
- package/dist/emission-D9fjPyAg.d.mts +0 -2
- package/dist/enum-accessor-BUVBc6ZH.d.mts.map +0 -1
- package/dist/enum-accessor-CAlX-HOl.mjs.map +0 -1
- package/dist/framework-authoring-CdKfPz3Y-BGocjz36.d.mts.map +0 -1
- package/dist/psl-ast-BrpUfqBu.d.mts +0 -2
- package/dist/types-BBb-tMcj.d.mts.map +0 -1
- package/dist/written-value-CQt_C72W-aKFkxVmA.d.mts.map +0 -1
package/dist/psl-parser.d.mts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { v as DataTypeId } from "./codec-types-
|
|
2
|
-
import { B as PslExtensionBlockParsedAttribute, C as AuthoringPslBlockDescriptorNamespace, F as ParsedPslExtensionBlock, H as PslPosition, I as PslDiagnosticCode, L as PslExtensionBlock, R as PslExtensionBlockAttribute, S as AuthoringPslBlockDescriptor, U as PslSpan, V as PslExtensionBlockPrintEntry, z as PslExtensionBlockAttributeArg } from "./framework-authoring-CdKfPz3Y-BGocjz36.mjs";
|
|
3
|
-
import { r as ControlMutationDefaultRegistry } from "./mutation-default-types-js6llINX-WGmpaAAL.mjs";
|
|
1
|
+
import { v as DataTypeId } from "./codec-types-DjozIOvT-BIcpyFea.mjs";
|
|
4
2
|
import { r as Result } from "./result-BYCOANWy.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import
|
|
9
|
-
import "./components-
|
|
10
|
-
import
|
|
11
|
-
import { r as
|
|
12
|
-
import "./
|
|
3
|
+
import { B as PslExtensionBlockAttribute, C as AuthoringPslBlockDescriptorNamespace, F as DataTypeSupport, G as PslSpan, H as PslExtensionBlockParsedAttribute, L as ParsedPslExtensionBlock, R as PslDiagnosticCode, S as AuthoringPslBlockDescriptor, U as PslExtensionBlockPrintEntry, V as PslExtensionBlockAttributeArg, W as PslPosition, Z as WrittenScalar, z as PslExtensionBlock } from "./framework-authoring-D3AsJskV-BALZR-J9.mjs";
|
|
4
|
+
import { r as ControlMutationDefaultRegistry } from "./mutation-default-types-js6llINX-WGmpaAAL.mjs";
|
|
5
|
+
import "./authoring-BJgarhJI.mjs";
|
|
6
|
+
import "./codec-DkiEF2cQ.mjs";
|
|
7
|
+
import { D as GeneratorPhase, w as GeneratorFunctionRegistry } from "./framework-components-CTibZus8-BK5QlxM-.mjs";
|
|
8
|
+
import "./components-BbJVTEds.mjs";
|
|
9
|
+
import { C as PslTypesBlock, O as flatPslModels, S as PslTypeConstructorCall, _ as PslModelAttribute, a as PslAttributePositionalArgument, c as PslDefaultFunctionValue, f as PslDocumentAst, g as PslModel, i as PslAttributeNamedArgument, j as namespacePslExtensionBlocks, l as PslDefaultLiteralValue, m as PslFieldAttribute, n as PslAttribute, o as PslAttributeTarget, p as PslField, r as PslAttributeArgument, s as PslCompositeType, u as PslDefaultValue, v as PslNamedTypeDeclaration, y as PslNamespace } from "./psl-ast-JQykH4Uz-D6tMHdnz.mjs";
|
|
10
|
+
import { r as AssembledAuthoringContributions } from "./control-BKuRvAVY.mjs";
|
|
11
|
+
import "./psl-ast-DOJH1ZST.mjs";
|
|
13
12
|
import { i as isPslIdentifier } from "./tokenizer-i8RaVWVa-7fRwlCPP.mjs";
|
|
14
|
-
import { B as PslDiagnosticCollector, D as ModelAttributeAst, V as PslSources, Y as SyntaxNode, at as diagnosticFromSpan, d as DiagnosticSource, m as FieldAttributeAst, n as AstNode, ot as diagnosticSource, p as ExpressionAst, pt as mapPslDiagnostics, r as AttributeArgAst, rt as createPslDiagnosticCollector, z as PslDiagnostic } from "./parse-CJtBvEYy-
|
|
15
|
-
import { $ as ModelSymbol, A as DescribeUnresolvedType, At as SymbolTableResult, B as FixedStrArgType, Bt as createBinder, C as ContributedTypeNamespace, Ct as ResolvedAttributeArg, D as CtxOf, Dt as Scope, E as CreateBinderInput, Et as ResolvedTypeConstructorCall, F as FieldAttributeCtx, Ft as UnrestrictedNumArgType, G as InferAttr, Gt as memberEntries, H as FuncCallSig, Ht as isNamespaceLike, I as FieldRefArgType, It as UnrestrictedStrArgType, J as JsonArgType, Jt as readResolvedAttributes, K as InspectableArgType, Kt as nodePslSpan, L as FieldSymbol, Lt as UnsupportedAttribute, M as EntityDeclaration, Mt as TypedFuncCall, N as EntityRefArgType, Nt as UnresolvedTypeReference, O as DataTypeValueArgType, Ot as ScopeResolution, P as EntitySelector, Pt as UnrestrictedIdentifierArgType, Q as ModelAttributeCtx, R as FixedIdentifierArgType, Rt as buildSymbolTable, S as ContributedTypeDescriptor, St as ResolvedAttribute, T as ContributedTypeSymbol, Tt as ResolvedNamedTypeBinding, U as FunctionSymbol, Ut as keywordPslSpan, V as FuncCallArgType, Vt as entityReference, W as IdentifierArgType, Wt as matchesSelector, X as ListArgType, Xt as typeReferenceNode, Y as JsonValueArgType, Yt as readResolvedConstructorCall, Z as MixinSymbol, _ as CompositeTypeSymbol, _t as RecordArgType, a as AttributeLevel, at as NumLiteralArgType, b as ContributedMember, bt as RequiredContextFor, c as AttributeSymbol, ct as OutOf, d as BinderResult, dt as ParameterSymbol, et as NamedOut, f as BlockAttributeCtx, ft as ParsedTaggedLiteral, g as BuildSymbolTableOptions, gt as PslSymbol, h as BoundSpec, ht as PositionalParam, i as AttributeCtx, it as NumLiteral, j as DescribeUnsupportedAttribute, jt as TaggedLiteralArgType, k as DeclarationFor, kt as SymbolTable, l as Binder, lt as PSL_UNRESOLVED_REFERENCE, m as BoolArgType, mt as PosOut, n as ArgType, nt as NamespaceSymbol, o as AttributeOut, ot as OneOfArgType, p as BlockSymbol, pt as ParsedTypedValue, q as IntArgType, qt as readResolvedAttribute, r as ArgTypeKind, rt as NullArgType, s as AttributeSpec, st as OptionalArgType, t as AnyArgType, tt as NamedTypeSymbol, u as BinderContext, ut as Param, v as ConstantSymbol, vt as ReferencedFieldRefArgType, w as ContributedTypeScope, wt as ResolvedEntityReference, x as ContributedNamespaceSymbol, xt as Resolution, y as ContextForRequirement, yt as RejectingArgType, z as FixedNumArgType, zt as contributedTypeOf } from "./binder-Cm0N-oPu-
|
|
13
|
+
import { B as PslDiagnosticCollector, D as ModelAttributeAst, V as PslSources, Y as SyntaxNode, at as diagnosticFromSpan, d as DiagnosticSource, m as FieldAttributeAst, n as AstNode, ot as diagnosticSource, p as ExpressionAst, pt as mapPslDiagnostics, r as AttributeArgAst, rt as createPslDiagnosticCollector, z as PslDiagnostic } from "./parse-CJtBvEYy-CW8BvW5O.mjs";
|
|
14
|
+
import { $ as ModelSymbol, A as DescribeUnresolvedType, At as SymbolTableResult, B as FixedStrArgType, Bt as createBinder, C as ContributedTypeNamespace, Ct as ResolvedAttributeArg, D as CtxOf, Dt as Scope, E as CreateBinderInput, Et as ResolvedTypeConstructorCall, F as FieldAttributeCtx, Ft as UnrestrictedNumArgType, G as InferAttr, Gt as memberEntries, H as FuncCallSig, Ht as isNamespaceLike, I as FieldRefArgType, It as UnrestrictedStrArgType, J as JsonArgType, Jt as readResolvedAttributes, K as InspectableArgType, Kt as nodePslSpan, L as FieldSymbol, Lt as UnsupportedAttribute, M as EntityDeclaration, Mt as TypedFuncCall, N as EntityRefArgType, Nt as UnresolvedTypeReference, O as DataTypeValueArgType, Ot as ScopeResolution, P as EntitySelector, Pt as UnrestrictedIdentifierArgType, Q as ModelAttributeCtx, R as FixedIdentifierArgType, Rt as buildSymbolTable, S as ContributedTypeDescriptor, St as ResolvedAttribute, T as ContributedTypeSymbol, Tt as ResolvedNamedTypeBinding, U as FunctionSymbol, Ut as keywordPslSpan, V as FuncCallArgType, Vt as entityReference, W as IdentifierArgType, Wt as matchesSelector, X as ListArgType, Xt as typeReferenceNode, Y as JsonValueArgType, Yt as readResolvedConstructorCall, Z as MixinSymbol, _ as CompositeTypeSymbol, _t as RecordArgType, a as AttributeLevel, at as NumLiteralArgType, b as ContributedMember, bt as RequiredContextFor, c as AttributeSymbol, ct as OutOf, d as BinderResult, dt as ParameterSymbol, et as NamedOut, f as BlockAttributeCtx, ft as ParsedTaggedLiteral, g as BuildSymbolTableOptions, gt as PslSymbol, h as BoundSpec, ht as PositionalParam, i as AttributeCtx, it as NumLiteral, j as DescribeUnsupportedAttribute, jt as TaggedLiteralArgType, k as DeclarationFor, kt as SymbolTable, l as Binder, lt as PSL_UNRESOLVED_REFERENCE, m as BoolArgType, mt as PosOut, n as ArgType, nt as NamespaceSymbol, o as AttributeOut, ot as OneOfArgType, p as BlockSymbol, pt as ParsedTypedValue, q as IntArgType, qt as readResolvedAttribute, r as ArgTypeKind, rt as NullArgType, s as AttributeSpec, st as OptionalArgType, t as AnyArgType, tt as NamedTypeSymbol, u as BinderContext, ut as Param, v as ConstantSymbol, vt as ReferencedFieldRefArgType, w as ContributedTypeScope, wt as ResolvedEntityReference, x as ContributedNamespaceSymbol, xt as Resolution, y as ContextForRequirement, yt as RejectingArgType, z as FixedNumArgType, zt as contributedTypeOf } from "./binder-Cm0N-oPu-WASgR3Jw.mjs";
|
|
16
15
|
//#region ../../../1-framework/2-authoring/psl-parser/dist/index.d.mts
|
|
17
16
|
//#region src/attribute-helpers.d.ts
|
|
18
17
|
declare function getPositionalArgument(attribute: PslAttribute, index?: number): string | undefined;
|
|
@@ -95,6 +94,12 @@ declare function leafDiagnostic(ctx: Pick<AttributeCtx, 'sources'>, node: AstNod
|
|
|
95
94
|
//#region src/attribute-spec/combinators/entity-ref.d.ts
|
|
96
95
|
declare function entityRef<const S extends EntitySelector>(expected: S): EntityRefArgType<DeclarationFor<S>, AttributeCtx>;
|
|
97
96
|
//#endregion
|
|
97
|
+
//#region src/attribute-spec/combinators/enum-member-value.d.ts
|
|
98
|
+
/**
|
|
99
|
+
* An enum member's written value: a string, a number, a boolean, or a tagged literal, which it yields as the written value, its tag and canonical text. A tagged literal whose text cannot be canonicalized is refused. The block also records each member as written in `writtenValues`, from which the member reader takes it by the cast rule. ADR 254.
|
|
100
|
+
*/
|
|
101
|
+
declare function enumMemberValue(): OneOfArgType<[UnrestrictedStrArgType<AttributeCtx>, UnrestrictedNumArgType<AttributeCtx>, BoolArgType<AttributeCtx>, ArgType<WrittenScalar, AttributeCtx>], AttributeCtx>;
|
|
102
|
+
//#endregion
|
|
98
103
|
//#region src/attribute-spec/combinators/field-ref.d.ts
|
|
99
104
|
declare function fieldRef(): FieldRefArgType<ModelAttributeCtx>;
|
|
100
105
|
declare function referencedFieldRef(): ReferencedFieldRefArgType<FieldAttributeCtx>;
|
|
@@ -333,5 +338,5 @@ type WrittenScalarResult = {
|
|
|
333
338
|
/** Reads a PSL literal expression as a `WrittenScalar`, for a position that takes a value of a data type. ADR 254. */
|
|
334
339
|
declare function readWrittenScalar(expression: ExpressionAst): WrittenScalarResult;
|
|
335
340
|
//#endregion
|
|
336
|
-
export { type ArgBindingSpec, type ArgType, type ArgTypeKind, type AssembledAttributeSpecs, type AttributeCtx, type AttributeLevel, type AttributeOut, type AttributeSpec, type AttributeSpecContext, type AttributeSpecNamespace, type AttributeSymbol, type Binder, type BinderContext, type BinderResult, type BlockAttributeCtx, type BlockAttributeSpecFactory, type BlockEntryValueSpec, type BlockSpec, type BlockSpecContext, type BlockSpecFactory, type BlockSymbol, type BoundSpec, type BuildSymbolTableOptions, type CompositeTypeSymbol, type ConstantSymbol, type ContributedMember, type ContributedNamespaceSymbol, type ContributedTypeDescriptor, type ContributedTypeNamespace, type ContributedTypeScope, type ContributedTypeSymbol, type CreateBinderInput, type DataTypeValueArgType, type DeclarationFor, type DescribeUnresolvedType, type DescribeUnsupportedAttribute, type DiagnosticSource, EMPTY_DATA_TYPES, type EntityDeclaration, type EntityRefArgType, type EntitySelector, type FieldAttributeCtx, type FieldAttributeSpecContext, type FieldAttributeSpecFactory, type FieldSymbol, type FixedIdentifierArgType, type FixedNumArgType, type FuncCallSig, type FunctionSymbol, type IdentifierArgType, type InferAttr, type InferBlock, type InspectableArgType, type IntArgType, type InterpretExtensionBlockAttributesInput, type InterpretExtensionBlockInput, type InterpretExtensionBlocksResult, type JsonValueArgType, type ListOptions, type MapBlockSpec, type MixinSymbol, type ModelAttributeCtx, type ModelAttributeSpecFactory, type ModelSymbol, NAME_THE_PSL_SOURCE_LOSES, type NamedOut, type NamedTypeSymbol, type NamespaceSymbol, type NullArgType, type NumLiteral, type OneOfArgType, type OptionalArgType, type OutOf, PSL_UNRESOLVED_REFERENCE, type Param, type ParameterSymbol, type ParsedPslExtensionBlock, type ParsedTaggedLiteral, type ParsedTypedValue, type ParsedWrittenList, type ParsedWrittenScalar, type PosOut, type PositionalParam, type PslAttribute, type PslAttributeArgument, type PslAttributeNamedArgument, type PslAttributePositionalArgument, type PslAttributeTarget, type PslBlockSpecDescriptor, type PslCompositeType, type PslDefaultFunctionValue, type PslDefaultLiteralValue, type PslDefaultValue, type PslDiagnostic, type PslDiagnosticCode, type PslDiagnosticCollector, type PslDocumentAst, type PslExtensionBlock, type PslExtensionBlockAttribute, type PslExtensionBlockAttributeArg, type PslExtensionBlockParsedAttribute, type PslExtensionBlockPrintEntry, type PslField, type PslFieldAttribute, type PslModel, type PslModelAttribute, type PslNamedTypeDeclaration, type PslNamespace, type PslPosition, type PslSpan, type PslSymbol, type PslTypeConstructorCall, type PslTypesBlock, type RejectingArgType, type Resolution, type ResolvedAttribute, type ResolvedAttributeArg, type ResolvedEntityReference, type ResolvedNamedTypeBinding, type ResolvedTypeConstructorCall, type Scope, type ScopeResolution, type StructBlockSpec, type SymbolTable, type SymbolTableResult, type TaggedLiteralArgType, type TypedFuncCall, type UnresolvedTypeReference, type UnrestrictedIdentifierArgType, type UnrestrictedNumArgType, type UnsupportedAttribute, type WrittenScalarResult, assembleAttributeSpecs, blockAttribute, blockSpecContext, blockSpecFactoryOf, bool, buildSymbolTable, contributedTypeOf, createBinder, createPslDiagnosticCollector, dataTypeValue, diagnosticFromSpan, diagnosticSource, entityRef, entityReference, 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 };
|
|
341
|
+
export { type ArgBindingSpec, type ArgType, type ArgTypeKind, type AssembledAttributeSpecs, type AttributeCtx, type AttributeLevel, type AttributeOut, type AttributeSpec, type AttributeSpecContext, type AttributeSpecNamespace, type AttributeSymbol, type Binder, type BinderContext, type BinderResult, type BlockAttributeCtx, type BlockAttributeSpecFactory, type BlockEntryValueSpec, type BlockSpec, type BlockSpecContext, type BlockSpecFactory, type BlockSymbol, type BoundSpec, type BuildSymbolTableOptions, type CompositeTypeSymbol, type ConstantSymbol, type ContributedMember, type ContributedNamespaceSymbol, type ContributedTypeDescriptor, type ContributedTypeNamespace, type ContributedTypeScope, type ContributedTypeSymbol, type CreateBinderInput, type DataTypeValueArgType, type DeclarationFor, type DescribeUnresolvedType, type DescribeUnsupportedAttribute, type DiagnosticSource, EMPTY_DATA_TYPES, type EntityDeclaration, type EntityRefArgType, type EntitySelector, type FieldAttributeCtx, type FieldAttributeSpecContext, type FieldAttributeSpecFactory, type FieldSymbol, type FixedIdentifierArgType, type FixedNumArgType, type FuncCallSig, type FunctionSymbol, type IdentifierArgType, type InferAttr, type InferBlock, type InspectableArgType, type IntArgType, type InterpretExtensionBlockAttributesInput, type InterpretExtensionBlockInput, type InterpretExtensionBlocksResult, type JsonValueArgType, type ListOptions, type MapBlockSpec, type MixinSymbol, type ModelAttributeCtx, type ModelAttributeSpecFactory, type ModelSymbol, NAME_THE_PSL_SOURCE_LOSES, type NamedOut, type NamedTypeSymbol, type NamespaceSymbol, type NullArgType, type NumLiteral, type OneOfArgType, type OptionalArgType, type OutOf, PSL_UNRESOLVED_REFERENCE, type Param, type ParameterSymbol, type ParsedPslExtensionBlock, type ParsedTaggedLiteral, type ParsedTypedValue, type ParsedWrittenList, type ParsedWrittenScalar, type PosOut, type PositionalParam, type PslAttribute, type PslAttributeArgument, type PslAttributeNamedArgument, type PslAttributePositionalArgument, type PslAttributeTarget, type PslBlockSpecDescriptor, type PslCompositeType, type PslDefaultFunctionValue, type PslDefaultLiteralValue, type PslDefaultValue, type PslDiagnostic, type PslDiagnosticCode, type PslDiagnosticCollector, type PslDocumentAst, type PslExtensionBlock, type PslExtensionBlockAttribute, type PslExtensionBlockAttributeArg, type PslExtensionBlockParsedAttribute, type PslExtensionBlockPrintEntry, type PslField, type PslFieldAttribute, type PslModel, type PslModelAttribute, type PslNamedTypeDeclaration, type PslNamespace, type PslPosition, type PslSpan, type PslSymbol, type PslTypeConstructorCall, type PslTypesBlock, type RejectingArgType, type Resolution, type ResolvedAttribute, type ResolvedAttributeArg, type ResolvedEntityReference, type ResolvedNamedTypeBinding, type ResolvedTypeConstructorCall, type Scope, type ScopeResolution, type StructBlockSpec, type SymbolTable, type SymbolTableResult, type TaggedLiteralArgType, type TypedFuncCall, type UnresolvedTypeReference, type UnrestrictedIdentifierArgType, type UnrestrictedNumArgType, type UnsupportedAttribute, type WrittenScalarResult, 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 };
|
|
337
342
|
//# sourceMappingURL=psl-parser.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"psl-parser.d.mts","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/index.d.mts"],"mappings":"
|
|
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,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,8BAA8B;;;UAGpE,6BAA6B;WAC5B,OAAO;WACP,YAAY;WACZ,MAAM;WACN,SAAS;WACT,SAAS;WACT,QAAQ;WACR,WAAW;;iBAEL,wBAAwB,UAAU,oBAAoB,OAAO,6BAA6B,KAAK,OAAO,wBAA0B,WAAW,cAAc;UAChK;WACC,OAAO;WACP,YAAY;WACZ,SAAS;WACT,SAAS;WACT,QAAQ;WACR,WAAW;;iBAEL,kCAAkC,OAAO;WAC/C,YAAY,SAAS,eAAe;WACpC,sBAAsB;;UAEvB;WACC,cAAc,YAAY,aAAa;WACvC,sBAAsB;;UAEvB;WACC,aAAa;WACb,SAAS;WACT,qBAAqB;WACrB,QAAQ;;WAER,WAAW;;iBAEL,yBAAyB,OAAO,gCAAgC;;;;iBAIhE,iBAAiB;WACvB,SAAS;WACT,WAAW;IAClB;;;iBAGa,oBAAoB,aAAa,kDAAkD,kBAAkB;;;;;;cAMxG;;;iBAGG,mBAAmB;;iBAEnB,sBAAsB;;;;KAIlC;WACM;WACA,SAAS;;WAET;WACA;;WAEA;WACA;WACA;;;iBAGM,kBAAkB,YAAY,gBAAgB"}
|
package/dist/psl-parser.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
|
|
2
2
|
import { t as InternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
|
|
3
3
|
import { a as or, i as okVoid, n as notOk, r as ok, t as and } from "./result-8OXF26MN.mjs";
|
|
4
|
-
import { c as createDataTypeLookup } from "./data-type-
|
|
4
|
+
import { c as createDataTypeLookup } from "./data-type-CVNHtd6y-BFa_VnCb.mjs";
|
|
5
5
|
import { b as isAuthoringModelAttributeDescriptor, d as describeTaggedLiteralFailure, x as isAuthoringPslBlockDescriptor } from "./temporal-presets-BcDyr_hK-CFplJNGz.mjs";
|
|
6
6
|
import { r as UNBOUND_NAMESPACE_ID } from "./namespace-VUH2dgnS-By5y75h9.mjs";
|
|
7
|
-
import { S as tagForm, a as castTypedValue, c as describeRefusal, h as exactRewrite, n as admittedTags, o as describeAdmittedForms, s as describeExpected, t as admittedForms, x as readWrittenValue } from "./authoring-
|
|
7
|
+
import { S as tagForm, a as castTypedValue, c as describeRefusal, h as exactRewrite, n as admittedTags, o as describeAdmittedForms, s as describeExpected, t as admittedForms, x as readWrittenValue } from "./authoring-so3aBYD8.mjs";
|
|
8
8
|
import { a as flatPslModels, c as namespacePslExtensionBlocks, n as UNBOUND_PSL_NAMESPACE_NAME } from "./psl-ast-CyvE6CR-.mjs";
|
|
9
9
|
import { l as printSyntax } from "./ast-helpers-CzydMPdh-Mi0SrZRa.mjs";
|
|
10
10
|
import { n as isPslIdentifier } from "./tokenizer-C-GTKKjR-B1vOzJy0.mjs";
|
|
@@ -1588,7 +1588,7 @@ function bool() {
|
|
|
1588
1588
|
}
|
|
1589
1589
|
};
|
|
1590
1590
|
}
|
|
1591
|
-
const TAGGED_LITERAL_FAILURE_CODES = {
|
|
1591
|
+
const TAGGED_LITERAL_FAILURE_CODES$1 = {
|
|
1592
1592
|
nul: "PSL_TAGGED_LITERAL_NUL",
|
|
1593
1593
|
"too-large": "PSL_TAGGED_LITERAL_TOO_LARGE"
|
|
1594
1594
|
};
|
|
@@ -1615,7 +1615,7 @@ function parseDataTypeValue(arg, ctx, dataType, support, forms) {
|
|
|
1615
1615
|
code: "PSL_INVALID_ATTRIBUTE_SYNTAX",
|
|
1616
1616
|
message: `${describeExpected(forms)}; got ${literal.found}`
|
|
1617
1617
|
}) : refuse({
|
|
1618
|
-
code: TAGGED_LITERAL_FAILURE_CODES[literal.reason],
|
|
1618
|
+
code: TAGGED_LITERAL_FAILURE_CODES$1[literal.reason],
|
|
1619
1619
|
message: describeTaggedLiteralFailure(literal.reason)
|
|
1620
1620
|
});
|
|
1621
1621
|
const read = readWrittenValue(support, literal.written);
|
|
@@ -1657,6 +1657,136 @@ function entityRef(expected) {
|
|
|
1657
1657
|
}
|
|
1658
1658
|
};
|
|
1659
1659
|
}
|
|
1660
|
+
function num(value) {
|
|
1661
|
+
if (value === void 0) return {
|
|
1662
|
+
kind: "num",
|
|
1663
|
+
label: "number",
|
|
1664
|
+
value: void 0,
|
|
1665
|
+
parse: (arg, ctx) => {
|
|
1666
|
+
const literal = NumberLiteralExprAst.cast(arg.syntax);
|
|
1667
|
+
if (literal !== void 0) {
|
|
1668
|
+
const parsed = literal.value();
|
|
1669
|
+
if (parsed !== void 0) return ok(parsed);
|
|
1670
|
+
}
|
|
1671
|
+
return notOk([leafDiagnostic(ctx, arg, "Expected a number literal")]);
|
|
1672
|
+
}
|
|
1673
|
+
};
|
|
1674
|
+
return {
|
|
1675
|
+
kind: "num",
|
|
1676
|
+
label: String(value),
|
|
1677
|
+
value,
|
|
1678
|
+
parse: (arg, ctx) => {
|
|
1679
|
+
const literal = NumberLiteralExprAst.cast(arg.syntax);
|
|
1680
|
+
if (literal !== void 0) {
|
|
1681
|
+
if (literal.value() === value) return ok(value);
|
|
1682
|
+
}
|
|
1683
|
+
return notOk([leafDiagnostic(ctx, arg, `Expected ${value}`)]);
|
|
1684
|
+
}
|
|
1685
|
+
};
|
|
1686
|
+
}
|
|
1687
|
+
/**
|
|
1688
|
+
* 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
|
+
function oneOf(...alts) {
|
|
1691
|
+
const label = alts.map((alt) => alt.label).join(" | ");
|
|
1692
|
+
return {
|
|
1693
|
+
kind: "oneOf",
|
|
1694
|
+
label,
|
|
1695
|
+
alternatives: alts,
|
|
1696
|
+
parse: (arg, ctx) => {
|
|
1697
|
+
const [head, ...tail] = blindCast(alts);
|
|
1698
|
+
const claiming = [head, ...tail].filter((alt) => alt.claims?.(arg) === true);
|
|
1699
|
+
const [only] = claiming;
|
|
1700
|
+
if (only !== void 0 && claiming.length === 1) return only.parse(arg, ctx);
|
|
1701
|
+
let rejection = head.parse(arg, ctx);
|
|
1702
|
+
if (rejection.ok) return rejection;
|
|
1703
|
+
for (const alt of tail) {
|
|
1704
|
+
const result = alt.parse(arg, ctx);
|
|
1705
|
+
if (result.ok) return result;
|
|
1706
|
+
rejection = or(rejection, result);
|
|
1707
|
+
}
|
|
1708
|
+
if (!rejection.ok && rejection.failure.length === 0) return notOk([]);
|
|
1709
|
+
return notOk([leafDiagnostic(ctx, arg, `Expected one of: ${label}`)]);
|
|
1710
|
+
}
|
|
1711
|
+
};
|
|
1712
|
+
}
|
|
1713
|
+
function str(value) {
|
|
1714
|
+
if (value === void 0) return {
|
|
1715
|
+
kind: "str",
|
|
1716
|
+
label: "string",
|
|
1717
|
+
value: void 0,
|
|
1718
|
+
parse: (arg, ctx) => {
|
|
1719
|
+
const literal = StringLiteralExprAst.cast(arg.syntax);
|
|
1720
|
+
if (literal !== void 0) {
|
|
1721
|
+
const parsed = literal.value();
|
|
1722
|
+
if (parsed !== void 0) return ok(parsed);
|
|
1723
|
+
}
|
|
1724
|
+
return notOk([leafDiagnostic(ctx, arg, "Expected a string literal")]);
|
|
1725
|
+
}
|
|
1726
|
+
};
|
|
1727
|
+
return {
|
|
1728
|
+
kind: "str",
|
|
1729
|
+
label: JSON.stringify(value),
|
|
1730
|
+
value,
|
|
1731
|
+
parse: (arg, ctx) => {
|
|
1732
|
+
const literal = StringLiteralExprAst.cast(arg.syntax);
|
|
1733
|
+
if (literal !== void 0) {
|
|
1734
|
+
if (literal.value() === value) return ok(value);
|
|
1735
|
+
}
|
|
1736
|
+
return notOk([leafDiagnostic(ctx, arg, `Expected ${JSON.stringify(value)}`)]);
|
|
1737
|
+
}
|
|
1738
|
+
};
|
|
1739
|
+
}
|
|
1740
|
+
/**
|
|
1741
|
+
* A `` tag`...` ``, `tag"..."`, or `tag'...'` argument. `tags` and `documentation` describe the
|
|
1742
|
+
* registered tags for tooling; parsing accepts any tag.
|
|
1743
|
+
*/
|
|
1744
|
+
function taggedLiteral(tags, options) {
|
|
1745
|
+
return {
|
|
1746
|
+
kind: "taggedLiteral",
|
|
1747
|
+
label: `${tags[0] ?? "tag"}\`...\``,
|
|
1748
|
+
tags,
|
|
1749
|
+
documentation: options.documentation,
|
|
1750
|
+
parse: (arg, ctx) => {
|
|
1751
|
+
const literal = TaggedLiteralExprAst.cast(arg.syntax);
|
|
1752
|
+
if (literal === void 0) return notOk([leafDiagnostic(ctx, arg, "Expected a tagged literal")]);
|
|
1753
|
+
return ok({
|
|
1754
|
+
tag: literal.tagName(),
|
|
1755
|
+
canonicalization: literal.canonicalization(),
|
|
1756
|
+
span: nodePslSpan(literal.syntax, ctx.sources)
|
|
1757
|
+
});
|
|
1758
|
+
}
|
|
1759
|
+
};
|
|
1760
|
+
}
|
|
1761
|
+
const TAGGED_LITERAL_FAILURE_CODES = {
|
|
1762
|
+
nul: "PSL_TAGGED_LITERAL_NUL",
|
|
1763
|
+
"too-large": "PSL_TAGGED_LITERAL_TOO_LARGE"
|
|
1764
|
+
};
|
|
1765
|
+
/** A tagged literal as the written value it holds, refused when its text cannot be canonicalized. */
|
|
1766
|
+
function writtenTaggedLiteral() {
|
|
1767
|
+
const arm = taggedLiteral([], { documentation: "A value written with its data type's tag." });
|
|
1768
|
+
const parse = (arg, ctx) => {
|
|
1769
|
+
const parsed = arm.parse(arg, ctx);
|
|
1770
|
+
if (!parsed.ok) return parsed;
|
|
1771
|
+
const { tag, canonicalization } = parsed.value;
|
|
1772
|
+
return canonicalization.ok ? ok({
|
|
1773
|
+
kind: "tag",
|
|
1774
|
+
tag,
|
|
1775
|
+
text: canonicalization.text
|
|
1776
|
+
}) : notOk([leafDiagnostic(ctx, arg, describeTaggedLiteralFailure(canonicalization.reason), TAGGED_LITERAL_FAILURE_CODES[canonicalization.reason])]);
|
|
1777
|
+
};
|
|
1778
|
+
return blindCast({
|
|
1779
|
+
...arm,
|
|
1780
|
+
parse,
|
|
1781
|
+
claims: (arg) => TaggedLiteralExprAst.cast(arg.syntax) !== void 0
|
|
1782
|
+
});
|
|
1783
|
+
}
|
|
1784
|
+
/**
|
|
1785
|
+
* An enum member's written value: a string, a number, a boolean, or a tagged literal, which it yields as the written value, its tag and canonical text. A tagged literal whose text cannot be canonicalized is refused. The block also records each member as written in `writtenValues`, from which the member reader takes it by the cast rule. ADR 254.
|
|
1786
|
+
*/
|
|
1787
|
+
function enumMemberValue() {
|
|
1788
|
+
return oneOf(str(), num(), bool(), writtenTaggedLiteral());
|
|
1789
|
+
}
|
|
1660
1790
|
function parseFieldName(arg, ctx) {
|
|
1661
1791
|
const identifier = IdentifierAst.cast(arg.syntax);
|
|
1662
1792
|
if (identifier === void 0) return notOk([leafDiagnostic(ctx, arg, "Expected a field name")]);
|
|
@@ -1906,32 +2036,6 @@ function list(of, opts) {
|
|
|
1906
2036
|
}
|
|
1907
2037
|
};
|
|
1908
2038
|
}
|
|
1909
|
-
/**
|
|
1910
|
-
* 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.
|
|
1911
|
-
*/
|
|
1912
|
-
function oneOf(...alts) {
|
|
1913
|
-
const label = alts.map((alt) => alt.label).join(" | ");
|
|
1914
|
-
return {
|
|
1915
|
-
kind: "oneOf",
|
|
1916
|
-
label,
|
|
1917
|
-
alternatives: alts,
|
|
1918
|
-
parse: (arg, ctx) => {
|
|
1919
|
-
const [head, ...tail] = blindCast(alts);
|
|
1920
|
-
const claiming = [head, ...tail].filter((alt) => alt.claims?.(arg) === true);
|
|
1921
|
-
const [only] = claiming;
|
|
1922
|
-
if (only !== void 0 && claiming.length === 1) return only.parse(arg, ctx);
|
|
1923
|
-
let rejection = head.parse(arg, ctx);
|
|
1924
|
-
if (rejection.ok) return rejection;
|
|
1925
|
-
for (const alt of tail) {
|
|
1926
|
-
const result = alt.parse(arg, ctx);
|
|
1927
|
-
if (result.ok) return result;
|
|
1928
|
-
rejection = or(rejection, result);
|
|
1929
|
-
}
|
|
1930
|
-
if (!rejection.ok && rejection.failure.length === 0) return notOk([]);
|
|
1931
|
-
return notOk([leafDiagnostic(ctx, arg, `Expected one of: ${label}`)]);
|
|
1932
|
-
}
|
|
1933
|
-
};
|
|
1934
|
-
}
|
|
1935
2039
|
function record(of) {
|
|
1936
2040
|
return {
|
|
1937
2041
|
kind: "record",
|
|
@@ -1971,33 +2075,6 @@ function record(of) {
|
|
|
1971
2075
|
}
|
|
1972
2076
|
};
|
|
1973
2077
|
}
|
|
1974
|
-
function str(value) {
|
|
1975
|
-
if (value === void 0) return {
|
|
1976
|
-
kind: "str",
|
|
1977
|
-
label: "string",
|
|
1978
|
-
value: void 0,
|
|
1979
|
-
parse: (arg, ctx) => {
|
|
1980
|
-
const literal = StringLiteralExprAst.cast(arg.syntax);
|
|
1981
|
-
if (literal !== void 0) {
|
|
1982
|
-
const parsed = literal.value();
|
|
1983
|
-
if (parsed !== void 0) return ok(parsed);
|
|
1984
|
-
}
|
|
1985
|
-
return notOk([leafDiagnostic(ctx, arg, "Expected a string literal")]);
|
|
1986
|
-
}
|
|
1987
|
-
};
|
|
1988
|
-
return {
|
|
1989
|
-
kind: "str",
|
|
1990
|
-
label: JSON.stringify(value),
|
|
1991
|
-
value,
|
|
1992
|
-
parse: (arg, ctx) => {
|
|
1993
|
-
const literal = StringLiteralExprAst.cast(arg.syntax);
|
|
1994
|
-
if (literal !== void 0) {
|
|
1995
|
-
if (literal.value() === value) return ok(value);
|
|
1996
|
-
}
|
|
1997
|
-
return notOk([leafDiagnostic(ctx, arg, `Expected ${JSON.stringify(value)}`)]);
|
|
1998
|
-
}
|
|
1999
|
-
};
|
|
2000
|
-
}
|
|
2001
2078
|
function jsonValue() {
|
|
2002
2079
|
const self = {
|
|
2003
2080
|
kind: "oneOf",
|
|
@@ -2047,33 +2124,6 @@ function mapArg(arm, map) {
|
|
|
2047
2124
|
parse
|
|
2048
2125
|
});
|
|
2049
2126
|
}
|
|
2050
|
-
function num(value) {
|
|
2051
|
-
if (value === void 0) return {
|
|
2052
|
-
kind: "num",
|
|
2053
|
-
label: "number",
|
|
2054
|
-
value: void 0,
|
|
2055
|
-
parse: (arg, ctx) => {
|
|
2056
|
-
const literal = NumberLiteralExprAst.cast(arg.syntax);
|
|
2057
|
-
if (literal !== void 0) {
|
|
2058
|
-
const parsed = literal.value();
|
|
2059
|
-
if (parsed !== void 0) return ok(parsed);
|
|
2060
|
-
}
|
|
2061
|
-
return notOk([leafDiagnostic(ctx, arg, "Expected a number literal")]);
|
|
2062
|
-
}
|
|
2063
|
-
};
|
|
2064
|
-
return {
|
|
2065
|
-
kind: "num",
|
|
2066
|
-
label: String(value),
|
|
2067
|
-
value,
|
|
2068
|
-
parse: (arg, ctx) => {
|
|
2069
|
-
const literal = NumberLiteralExprAst.cast(arg.syntax);
|
|
2070
|
-
if (literal !== void 0) {
|
|
2071
|
-
if (literal.value() === value) return ok(value);
|
|
2072
|
-
}
|
|
2073
|
-
return notOk([leafDiagnostic(ctx, arg, `Expected ${value}`)]);
|
|
2074
|
-
}
|
|
2075
|
-
};
|
|
2076
|
-
}
|
|
2077
2127
|
/** A number literal kept as its source text, for consumers that must not round it through a JS number. */
|
|
2078
2128
|
function numLiteral() {
|
|
2079
2129
|
return {
|
|
@@ -2088,27 +2138,6 @@ function numLiteral() {
|
|
|
2088
2138
|
};
|
|
2089
2139
|
}
|
|
2090
2140
|
/**
|
|
2091
|
-
* A `` tag`...` ``, `tag"..."`, or `tag'...'` argument. `tags` and `documentation` describe the
|
|
2092
|
-
* registered tags for tooling; parsing accepts any tag.
|
|
2093
|
-
*/
|
|
2094
|
-
function taggedLiteral(tags, options) {
|
|
2095
|
-
return {
|
|
2096
|
-
kind: "taggedLiteral",
|
|
2097
|
-
label: `${tags[0] ?? "tag"}\`...\``,
|
|
2098
|
-
tags,
|
|
2099
|
-
documentation: options.documentation,
|
|
2100
|
-
parse: (arg, ctx) => {
|
|
2101
|
-
const literal = TaggedLiteralExprAst.cast(arg.syntax);
|
|
2102
|
-
if (literal === void 0) return notOk([leafDiagnostic(ctx, arg, "Expected a tagged literal")]);
|
|
2103
|
-
return ok({
|
|
2104
|
-
tag: literal.tagName(),
|
|
2105
|
-
canonicalization: literal.canonicalization(),
|
|
2106
|
-
span: nodePslSpan(literal.syntax, ctx.sources)
|
|
2107
|
-
});
|
|
2108
|
-
}
|
|
2109
|
-
};
|
|
2110
|
-
}
|
|
2111
|
-
/**
|
|
2112
2141
|
* `arm`, yielding the literal it accepts as a written scalar with its span, so a consumer that reads
|
|
2113
2142
|
* the value by the cast rule reports at the value. `arm` must accept only literals. The result keeps
|
|
2114
2143
|
* the arm's `kind` and metadata, which describe the syntax it accepts for tooling, not its output.
|
|
@@ -2273,7 +2302,7 @@ function interpretExtensionBlock(input) {
|
|
|
2273
2302
|
name: block.name,
|
|
2274
2303
|
values: blindCast(entries.values),
|
|
2275
2304
|
parameterSpans: entries.parameterSpans,
|
|
2276
|
-
|
|
2305
|
+
writtenValues: entries.writtenValues,
|
|
2277
2306
|
attributes: interpretedAttributes.attributes,
|
|
2278
2307
|
span: block.span
|
|
2279
2308
|
});
|
|
@@ -2283,7 +2312,7 @@ function interpretStructBlock(block, spec, ctx) {
|
|
|
2283
2312
|
let failed = false;
|
|
2284
2313
|
const values = Object.create(null);
|
|
2285
2314
|
const parameterSpans = Object.create(null);
|
|
2286
|
-
const
|
|
2315
|
+
const writtenValues = Object.create(null);
|
|
2287
2316
|
const seen = /* @__PURE__ */ new Set();
|
|
2288
2317
|
for (const entry of block.entries) {
|
|
2289
2318
|
const key = entry.key()?.name();
|
|
@@ -2308,7 +2337,7 @@ function interpretStructBlock(block, spec, ctx) {
|
|
|
2308
2337
|
const parsed = rule.parse(value, ctx);
|
|
2309
2338
|
if (parsed.ok) {
|
|
2310
2339
|
values[key] = parsed.value;
|
|
2311
|
-
|
|
2340
|
+
recordWrittenValue(writtenValues, key, value);
|
|
2312
2341
|
} else {
|
|
2313
2342
|
failed = true;
|
|
2314
2343
|
diagnostics.push(...parsed.failure);
|
|
@@ -2325,7 +2354,7 @@ function interpretStructBlock(block, spec, ctx) {
|
|
|
2325
2354
|
return {
|
|
2326
2355
|
values,
|
|
2327
2356
|
parameterSpans,
|
|
2328
|
-
|
|
2357
|
+
writtenValues,
|
|
2329
2358
|
diagnostics,
|
|
2330
2359
|
failed
|
|
2331
2360
|
};
|
|
@@ -2335,7 +2364,7 @@ function interpretMapBlock(block, spec, ctx) {
|
|
|
2335
2364
|
let failed = false;
|
|
2336
2365
|
const values = Object.create(null);
|
|
2337
2366
|
const parameterSpans = Object.create(null);
|
|
2338
|
-
const
|
|
2367
|
+
const writtenValues = Object.create(null);
|
|
2339
2368
|
const seen = /* @__PURE__ */ new Set();
|
|
2340
2369
|
for (const entry of block.entries) {
|
|
2341
2370
|
const key = entry.key()?.name();
|
|
@@ -2359,7 +2388,7 @@ function interpretMapBlock(block, spec, ctx) {
|
|
|
2359
2388
|
const parsed = spec.value.type.parse(value, ctx);
|
|
2360
2389
|
if (parsed.ok) {
|
|
2361
2390
|
values[key] = parsed.value;
|
|
2362
|
-
|
|
2391
|
+
recordWrittenValue(writtenValues, key, value);
|
|
2363
2392
|
} else {
|
|
2364
2393
|
failed = true;
|
|
2365
2394
|
diagnostics.push(...parsed.failure);
|
|
@@ -2368,14 +2397,14 @@ function interpretMapBlock(block, spec, ctx) {
|
|
|
2368
2397
|
return {
|
|
2369
2398
|
values,
|
|
2370
2399
|
parameterSpans,
|
|
2371
|
-
|
|
2400
|
+
writtenValues,
|
|
2372
2401
|
diagnostics,
|
|
2373
2402
|
failed
|
|
2374
2403
|
};
|
|
2375
2404
|
}
|
|
2376
|
-
function
|
|
2377
|
-
const
|
|
2378
|
-
if (
|
|
2405
|
+
function recordWrittenValue(writtenValues, key, value) {
|
|
2406
|
+
const literal = readWrittenScalar(value);
|
|
2407
|
+
if (literal.ok) writtenValues[key] = literal.written;
|
|
2379
2408
|
}
|
|
2380
2409
|
function duplicateParameterDiagnostic(block, key, ctx, node, span) {
|
|
2381
2410
|
return entryDiagnostic("PSL_EXTENSION_DUPLICATE_PARAMETER", `Duplicate parameter "${key}" in "${block.keyword}" block "${block.name}"; first occurrence wins`, ctx, node, span);
|
|
@@ -2485,6 +2514,6 @@ function renameLegacyDirective(text) {
|
|
|
2485
2514
|
return text.replace(DIRECTIVE, (whole, lead, name, trail) => name === LEGACY_NAME ? `${lead}prisma-8${trail}` : whole);
|
|
2486
2515
|
}
|
|
2487
2516
|
//#endregion
|
|
2488
|
-
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, 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 };
|
|
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 };
|
|
2489
2518
|
|
|
2490
2519
|
//# sourceMappingURL=psl-parser.mjs.map
|