@prisma-next/framework-components 0.12.0-dev.61 → 0.12.0-dev.62
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.d.mts +2 -2
- package/dist/authoring.mjs +2 -2
- package/dist/components.d.mts +1 -1
- package/dist/control.d.mts +4 -3
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +8 -3
- package/dist/control.mjs.map +1 -1
- package/dist/execution.d.mts +1 -1
- package/dist/{framework-authoring-Szvddbl3.mjs → framework-authoring-CnwPJCO4.mjs} +76 -5
- package/dist/framework-authoring-CnwPJCO4.mjs.map +1 -0
- package/dist/framework-authoring-Cyde8zSN.d.mts +380 -0
- package/dist/framework-authoring-Cyde8zSN.d.mts.map +1 -0
- package/dist/{framework-components-Ce_Cdw76.d.mts → framework-components-DdqvMc8S.d.mts} +2 -2
- package/dist/{framework-components-Ce_Cdw76.d.mts.map → framework-components-DdqvMc8S.d.mts.map} +1 -1
- package/dist/{psl-ast-CTuBYLYj.d.mts → psl-ast-DRzRF9rS.d.mts} +46 -12
- package/dist/psl-ast-DRzRF9rS.d.mts.map +1 -0
- package/dist/psl-ast.d.mts +37 -2
- package/dist/psl-ast.d.mts.map +1 -0
- package/dist/psl-ast.mjs +142 -1
- package/dist/psl-ast.mjs.map +1 -1
- package/package.json +7 -7
- package/src/control/control-stack.ts +25 -1
- package/src/control/psl-ast.ts +62 -25
- package/src/control/psl-extension-block-validator.ts +340 -0
- package/src/exports/authoring.ts +16 -0
- package/src/exports/psl-ast.ts +2 -0
- package/src/shared/framework-authoring.ts +215 -2
- package/src/shared/psl-extension-block.ts +184 -0
- package/dist/framework-authoring-Cv04iZjB.d.mts +0 -183
- package/dist/framework-authoring-Cv04iZjB.d.mts.map +0 -1
- package/dist/framework-authoring-Szvddbl3.mjs.map +0 -1
- package/dist/psl-ast-CTuBYLYj.d.mts.map +0 -1
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import { ColumnDefault, ExecutionMutationDefaultPhases } from "@prisma-next/contract/types";
|
|
2
|
+
import { Type } from "arktype";
|
|
3
|
+
|
|
4
|
+
//#region src/shared/psl-extension-block.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Shape-only types for the PSL source-position primitives, diagnostic
|
|
7
|
+
* codes, extension-block descriptor vocabulary, and the uniform
|
|
8
|
+
* extension-block AST node base.
|
|
9
|
+
*
|
|
10
|
+
* These live in the shared plane so an extension's authoring descriptor
|
|
11
|
+
* (`AuthoringPslBlockDescriptor` in `framework-authoring`) can reference
|
|
12
|
+
* them without crossing the shared → migration-plane boundary. The
|
|
13
|
+
* migration-plane `psl-ast.ts` re-exports everything here for consumers
|
|
14
|
+
* that import PSL AST types from the control entrypoint.
|
|
15
|
+
*/
|
|
16
|
+
interface PslPosition {
|
|
17
|
+
readonly offset: number;
|
|
18
|
+
readonly line: number;
|
|
19
|
+
readonly column: number;
|
|
20
|
+
}
|
|
21
|
+
interface PslSpan {
|
|
22
|
+
readonly start: PslPosition;
|
|
23
|
+
readonly end: PslPosition;
|
|
24
|
+
}
|
|
25
|
+
type PslDiagnosticCode = 'PSL_UNTERMINATED_BLOCK' | 'PSL_UNSUPPORTED_TOP_LEVEL_BLOCK' | 'PSL_INVALID_NAMESPACE_BLOCK' | 'PSL_INVALID_ATTRIBUTE_SYNTAX' | 'PSL_INVALID_MODEL_MEMBER' | 'PSL_UNSUPPORTED_MODEL_ATTRIBUTE' | 'PSL_UNSUPPORTED_FIELD_ATTRIBUTE' | 'PSL_INVALID_RELATION_ATTRIBUTE' | 'PSL_INVALID_REFERENTIAL_ACTION' | 'PSL_INVALID_DEFAULT_VALUE' | 'PSL_INVALID_ENUM_MEMBER' | 'PSL_INVALID_TYPES_MEMBER' | 'PSL_INVALID_QUALIFIED_TYPE'
|
|
26
|
+
/**
|
|
27
|
+
* A malformed line inside an extension-contributed top-level block body, or
|
|
28
|
+
* a structurally invalid element inside a `list` parameter value.
|
|
29
|
+
*
|
|
30
|
+
* Replaces the overloaded `PSL_UNSUPPORTED_TOP_LEVEL_BLOCK` code that the
|
|
31
|
+
* generic framework parser previously used for these two parse-error sites
|
|
32
|
+
* inside extension blocks — keeping `PSL_UNSUPPORTED_TOP_LEVEL_BLOCK` for
|
|
33
|
+
* its original meaning (an unknown keyword at the top level) and giving
|
|
34
|
+
* extension-block parse errors their own code.
|
|
35
|
+
*/
|
|
36
|
+
| 'PSL_INVALID_EXTENSION_BLOCK_MEMBER'
|
|
37
|
+
/**
|
|
38
|
+
* An unknown parameter key in an extension-contributed block — a key present
|
|
39
|
+
* in the source block but absent from the descriptor's `parameters` map.
|
|
40
|
+
*/
|
|
41
|
+
| 'PSL_EXTENSION_UNKNOWN_PARAMETER'
|
|
42
|
+
/**
|
|
43
|
+
* A required parameter declared in the descriptor is absent from the parsed block.
|
|
44
|
+
*/
|
|
45
|
+
| 'PSL_EXTENSION_MISSING_REQUIRED_PARAMETER'
|
|
46
|
+
/**
|
|
47
|
+
* An `option`-kind parameter value is not one of the allowed tokens listed
|
|
48
|
+
* in the descriptor's `values` array.
|
|
49
|
+
*/
|
|
50
|
+
| 'PSL_EXTENSION_OPTION_OUT_OF_SET'
|
|
51
|
+
/**
|
|
52
|
+
* A `value`-kind parameter's raw text is not a valid JSON literal, or the
|
|
53
|
+
* parsed JSON value was rejected by the codec's `decodeJson` method, or the
|
|
54
|
+
* codec id is not registered in the lookup.
|
|
55
|
+
*/
|
|
56
|
+
| 'PSL_EXTENSION_INVALID_VALUE'
|
|
57
|
+
/**
|
|
58
|
+
* A `ref`-kind parameter identifier does not resolve to a declared entity of
|
|
59
|
+
* the required `refKind` within the declared scope.
|
|
60
|
+
*/
|
|
61
|
+
| 'PSL_EXTENSION_UNRESOLVED_REF';
|
|
62
|
+
/**
|
|
63
|
+
* Descriptor vocabulary for a single parameter on a declared block.
|
|
64
|
+
*
|
|
65
|
+
* Four kinds:
|
|
66
|
+
* - `ref` — the parameter value is an identifier that must resolve to a
|
|
67
|
+
* declared entity of `refKind` within the declared `scope`.
|
|
68
|
+
* - `value` — the parameter value is a PSL literal parsed and printed
|
|
69
|
+
* through the codec identified by `codecId`.
|
|
70
|
+
* - `option` — the parameter value is one of the literal tokens in `values`.
|
|
71
|
+
* Not a codec; not persisted data. A closed authoring-time constraint only.
|
|
72
|
+
* - `list` — a bracketed list whose elements each match the `of` descriptor.
|
|
73
|
+
*/
|
|
74
|
+
type PslBlockParam = PslBlockParamRef | PslBlockParamValue | PslBlockParamOption | PslBlockParamList;
|
|
75
|
+
interface PslBlockParamRef {
|
|
76
|
+
readonly kind: 'ref';
|
|
77
|
+
readonly refKind: string;
|
|
78
|
+
readonly scope: 'same-namespace' | 'same-space' | 'cross-space';
|
|
79
|
+
readonly required?: boolean;
|
|
80
|
+
}
|
|
81
|
+
interface PslBlockParamValue {
|
|
82
|
+
readonly kind: 'value';
|
|
83
|
+
readonly codecId: string;
|
|
84
|
+
readonly required?: boolean;
|
|
85
|
+
}
|
|
86
|
+
interface PslBlockParamOption {
|
|
87
|
+
readonly kind: 'option';
|
|
88
|
+
readonly values: readonly string[];
|
|
89
|
+
readonly required?: boolean;
|
|
90
|
+
}
|
|
91
|
+
interface PslBlockParamList {
|
|
92
|
+
readonly kind: 'list';
|
|
93
|
+
readonly of: PslBlockParam;
|
|
94
|
+
readonly required?: boolean;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The parsed representation of a single parameter value on a uniform
|
|
98
|
+
* extension-block AST node. Mirrors the `PslBlockParam` descriptor
|
|
99
|
+
* vocabulary:
|
|
100
|
+
*
|
|
101
|
+
* - `ref` → `PslExtensionBlockParamRef` — a raw identifier string
|
|
102
|
+
* (resolution runs in the validator, not the parser).
|
|
103
|
+
* - `value` → `PslExtensionBlockParamValue` — a raw PSL literal string
|
|
104
|
+
* (codec validation runs in the validator).
|
|
105
|
+
* - `option` → `PslExtensionBlockParamOption` — the chosen token.
|
|
106
|
+
* - `list` → `PslExtensionBlockParamList` — ordered list of the above.
|
|
107
|
+
*
|
|
108
|
+
* These shapes are intentionally minimal. The validator and lowering refine
|
|
109
|
+
* and consume them; the generic framework parser produces them.
|
|
110
|
+
*/
|
|
111
|
+
type PslExtensionBlockParamValue = PslExtensionBlockParamRef | PslExtensionBlockParamScalarValue | PslExtensionBlockParamOption | PslExtensionBlockParamList;
|
|
112
|
+
interface PslExtensionBlockParamRef {
|
|
113
|
+
readonly kind: 'ref';
|
|
114
|
+
readonly identifier: string;
|
|
115
|
+
readonly span: PslSpan;
|
|
116
|
+
}
|
|
117
|
+
interface PslExtensionBlockParamScalarValue {
|
|
118
|
+
readonly kind: 'value';
|
|
119
|
+
readonly raw: string;
|
|
120
|
+
readonly span: PslSpan;
|
|
121
|
+
}
|
|
122
|
+
interface PslExtensionBlockParamOption {
|
|
123
|
+
readonly kind: 'option';
|
|
124
|
+
readonly token: string;
|
|
125
|
+
readonly span: PslSpan;
|
|
126
|
+
}
|
|
127
|
+
interface PslExtensionBlockParamList {
|
|
128
|
+
readonly kind: 'list';
|
|
129
|
+
readonly items: readonly PslExtensionBlockParamValue[];
|
|
130
|
+
readonly span: PslSpan;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Base shape for a uniform extension-contributed top-level PSL block
|
|
134
|
+
* node, as produced by the generic framework parser and consumed by the
|
|
135
|
+
* validator and lowering factory.
|
|
136
|
+
*
|
|
137
|
+
* - `kind` is the routing discriminant, equal to the descriptor's
|
|
138
|
+
* `discriminator`. The framework parser sets this to
|
|
139
|
+
* `descriptor.discriminator` for every block it parses.
|
|
140
|
+
* - `name` is the block's declared name (the identifier after the keyword).
|
|
141
|
+
* - `parameters` is the descriptor-driven parameter map. Keys are
|
|
142
|
+
* parameter names from the descriptor; values are the parsed parameter
|
|
143
|
+
* representations. Only parameters present in the source are included
|
|
144
|
+
* — absence of a required parameter is a validator concern, not a
|
|
145
|
+
* parser concern.
|
|
146
|
+
* - `span` covers the full block from keyword to closing brace.
|
|
147
|
+
*/
|
|
148
|
+
interface PslExtensionBlock {
|
|
149
|
+
readonly kind: string;
|
|
150
|
+
readonly name: string;
|
|
151
|
+
readonly parameters: Record<string, PslExtensionBlockParamValue>;
|
|
152
|
+
readonly span: PslSpan;
|
|
153
|
+
}
|
|
154
|
+
//#endregion
|
|
155
|
+
//#region src/shared/framework-authoring.d.ts
|
|
156
|
+
type AuthoringArgRef = {
|
|
157
|
+
readonly kind: 'arg';
|
|
158
|
+
readonly index: number;
|
|
159
|
+
readonly path?: readonly string[];
|
|
160
|
+
readonly default?: AuthoringTemplateValue;
|
|
161
|
+
};
|
|
162
|
+
type AuthoringTemplateValue = string | number | boolean | null | AuthoringArgRef | readonly AuthoringTemplateValue[] | {
|
|
163
|
+
readonly [key: string]: AuthoringTemplateValue;
|
|
164
|
+
};
|
|
165
|
+
interface AuthoringArgumentDescriptorCommon {
|
|
166
|
+
readonly name?: string;
|
|
167
|
+
readonly optional?: boolean;
|
|
168
|
+
}
|
|
169
|
+
type AuthoringArgumentDescriptor = AuthoringArgumentDescriptorCommon & ({
|
|
170
|
+
readonly kind: 'string';
|
|
171
|
+
} | {
|
|
172
|
+
readonly kind: 'boolean';
|
|
173
|
+
} | {
|
|
174
|
+
readonly kind: 'number';
|
|
175
|
+
readonly integer?: boolean;
|
|
176
|
+
readonly minimum?: number;
|
|
177
|
+
readonly maximum?: number;
|
|
178
|
+
} | {
|
|
179
|
+
readonly kind: 'stringArray';
|
|
180
|
+
} | {
|
|
181
|
+
readonly kind: 'object';
|
|
182
|
+
readonly properties: Record<string, AuthoringArgumentDescriptor>;
|
|
183
|
+
});
|
|
184
|
+
interface AuthoringStorageTypeTemplate {
|
|
185
|
+
readonly codecId: string;
|
|
186
|
+
readonly nativeType: AuthoringTemplateValue;
|
|
187
|
+
readonly typeParams?: Record<string, AuthoringTemplateValue>;
|
|
188
|
+
}
|
|
189
|
+
interface AuthoringTypeConstructorDescriptor {
|
|
190
|
+
readonly kind: 'typeConstructor';
|
|
191
|
+
readonly args?: readonly AuthoringArgumentDescriptor[];
|
|
192
|
+
readonly output: AuthoringStorageTypeTemplate;
|
|
193
|
+
}
|
|
194
|
+
interface AuthoringColumnDefaultTemplateLiteral {
|
|
195
|
+
readonly kind: 'literal';
|
|
196
|
+
readonly value: AuthoringTemplateValue;
|
|
197
|
+
}
|
|
198
|
+
interface AuthoringColumnDefaultTemplateFunction {
|
|
199
|
+
readonly kind: 'function';
|
|
200
|
+
readonly expression: AuthoringTemplateValue;
|
|
201
|
+
}
|
|
202
|
+
type AuthoringColumnDefaultTemplate = AuthoringColumnDefaultTemplateLiteral | AuthoringColumnDefaultTemplateFunction;
|
|
203
|
+
interface AuthoringExecutionDefaultsTemplate {
|
|
204
|
+
readonly onCreate?: AuthoringTemplateValue;
|
|
205
|
+
readonly onUpdate?: AuthoringTemplateValue;
|
|
206
|
+
}
|
|
207
|
+
interface AuthoringFieldPresetOutput extends AuthoringStorageTypeTemplate {
|
|
208
|
+
readonly nullable?: boolean;
|
|
209
|
+
readonly default?: AuthoringColumnDefaultTemplate;
|
|
210
|
+
readonly executionDefaults?: AuthoringExecutionDefaultsTemplate;
|
|
211
|
+
readonly id?: boolean;
|
|
212
|
+
readonly unique?: boolean;
|
|
213
|
+
}
|
|
214
|
+
interface AuthoringFieldPresetDescriptor {
|
|
215
|
+
readonly kind: 'fieldPreset';
|
|
216
|
+
readonly args?: readonly AuthoringArgumentDescriptor[];
|
|
217
|
+
readonly output: AuthoringFieldPresetOutput;
|
|
218
|
+
}
|
|
219
|
+
type AuthoringTypeNamespace = {
|
|
220
|
+
readonly [name: string]: AuthoringTypeConstructorDescriptor | AuthoringTypeNamespace;
|
|
221
|
+
};
|
|
222
|
+
type AuthoringFieldNamespace = {
|
|
223
|
+
readonly [name: string]: AuthoringFieldPresetDescriptor | AuthoringFieldNamespace;
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* Context surfaced to entity-type factories at call time. Currently a
|
|
227
|
+
* placeholder — sharpened as concrete consumers (enum, namespace, …)
|
|
228
|
+
* discover what the factory actually needs to read (codec lookup,
|
|
229
|
+
* namespace registry, …).
|
|
230
|
+
*/
|
|
231
|
+
interface AuthoringEntityContext {
|
|
232
|
+
readonly family: string;
|
|
233
|
+
readonly target: string;
|
|
234
|
+
}
|
|
235
|
+
interface AuthoringEntityTypeTemplateOutput {
|
|
236
|
+
readonly template: AuthoringTemplateValue;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Default `Input = never` is load-bearing for pack-bag-driven type
|
|
240
|
+
* narrowing. Factory parameter positions are contravariant, so a pack
|
|
241
|
+
* literal declaring `factory: (input: DemoEntityInput) => DemoEntity`
|
|
242
|
+
* is only assignable to the base descriptor's factory shape if the
|
|
243
|
+
* base's input is `never` (the bottom of the contravariant position).
|
|
244
|
+
* The concrete input/output types are recovered at the helper-derivation
|
|
245
|
+
* site via `EntityHelperFunction<Descriptor>`'s conditional inference,
|
|
246
|
+
* which reads them from the pack's `as const` literal factory signature
|
|
247
|
+
* — the base widening does not erase the literal because `satisfies`
|
|
248
|
+
* does not widen the declared type.
|
|
249
|
+
*/
|
|
250
|
+
interface AuthoringEntityTypeFactoryOutput<Input = never, Output = unknown> {
|
|
251
|
+
readonly factory: (input: Input, ctx: AuthoringEntityContext) => Output;
|
|
252
|
+
}
|
|
253
|
+
interface AuthoringEntityTypeDescriptor<Input = never, Output = unknown> {
|
|
254
|
+
readonly kind: 'entity';
|
|
255
|
+
readonly discriminator: string;
|
|
256
|
+
readonly args?: readonly AuthoringArgumentDescriptor[];
|
|
257
|
+
readonly output: AuthoringEntityTypeTemplateOutput | AuthoringEntityTypeFactoryOutput<Input, Output>;
|
|
258
|
+
/**
|
|
259
|
+
* arktype schema fragment for one entry whose envelope `kind` matches
|
|
260
|
+
* this descriptor's {@link discriminator}. The family validator composes
|
|
261
|
+
* contributed fragments into the per-namespace entry schema at
|
|
262
|
+
* validator construction time so the structural check covers
|
|
263
|
+
* pack-introduced kinds without the family core hard-coding the schema.
|
|
264
|
+
*
|
|
265
|
+
* Hydration uses {@link AuthoringEntityTypeFactoryOutput.factory}
|
|
266
|
+
* directly — the wire shape conforms structurally to the factory's
|
|
267
|
+
* `Input` after `validatorSchema` validates it.
|
|
268
|
+
*/
|
|
269
|
+
readonly validatorSchema?: Type<unknown>;
|
|
270
|
+
}
|
|
271
|
+
type AuthoringEntityTypeNamespace = {
|
|
272
|
+
readonly [name: string]: AuthoringEntityTypeDescriptor | AuthoringEntityTypeNamespace;
|
|
273
|
+
};
|
|
274
|
+
/**
|
|
275
|
+
* Declarative descriptor for an extension-contributed top-level PSL block.
|
|
276
|
+
*
|
|
277
|
+
* An extension registers one of these per keyword it contributes. The
|
|
278
|
+
* framework owns the generic parser, validator, and printer — no
|
|
279
|
+
* parsing or printing code runs from the extension.
|
|
280
|
+
*
|
|
281
|
+
* - `keyword` is the PSL top-level identifier this descriptor claims
|
|
282
|
+
* (`policy_select`, `role`, …).
|
|
283
|
+
* - `discriminator` is the routing key used by the printer dispatch and
|
|
284
|
+
* the `entityTypes` lowering factory lookup. Convention:
|
|
285
|
+
* `<target-or-family>-<kind>` (`postgres-policy-select`).
|
|
286
|
+
* - `name.required` declares whether the block must have a name token
|
|
287
|
+
* after the keyword. Currently always `true` — anonymous blocks are
|
|
288
|
+
* not part of the closed-grammar premise — but the field is explicit
|
|
289
|
+
* so the type can evolve without a breaking change.
|
|
290
|
+
* - `parameters` maps parameter names to their value-kind descriptors
|
|
291
|
+
* (`ref` / `value` / `option` / `list`). The generic parser and
|
|
292
|
+
* validator interpret these; the extension supplies no parser or
|
|
293
|
+
* printer function.
|
|
294
|
+
*/
|
|
295
|
+
interface AuthoringPslBlockDescriptor {
|
|
296
|
+
readonly kind: 'pslBlock';
|
|
297
|
+
readonly keyword: string;
|
|
298
|
+
readonly discriminator: string;
|
|
299
|
+
readonly name: {
|
|
300
|
+
readonly required: boolean;
|
|
301
|
+
};
|
|
302
|
+
readonly parameters: Record<string, PslBlockParam>;
|
|
303
|
+
}
|
|
304
|
+
type AuthoringPslBlockDescriptorNamespace = {
|
|
305
|
+
readonly [name: string]: AuthoringPslBlockDescriptor | AuthoringPslBlockDescriptorNamespace;
|
|
306
|
+
};
|
|
307
|
+
interface AuthoringContributions {
|
|
308
|
+
readonly type?: AuthoringTypeNamespace;
|
|
309
|
+
readonly field?: AuthoringFieldNamespace;
|
|
310
|
+
readonly entityTypes?: AuthoringEntityTypeNamespace;
|
|
311
|
+
/**
|
|
312
|
+
* Registry of declarative block descriptors this contribution registers,
|
|
313
|
+
* keyed by arbitrary path segments. Each leaf is an
|
|
314
|
+
* {@link AuthoringPslBlockDescriptor} that claims a PSL top-level keyword.
|
|
315
|
+
* The framework owns the generic parser, validator, and printer; the
|
|
316
|
+
* contribution supplies only these declarative descriptors.
|
|
317
|
+
*
|
|
318
|
+
* Contrast with {@link PslNamespace.extensionBlocks}: that field holds
|
|
319
|
+
* the parsed block nodes in a namespace; this field holds the registry
|
|
320
|
+
* of descriptors that teach the parser how to read those blocks.
|
|
321
|
+
*/
|
|
322
|
+
readonly pslBlockDescriptors?: AuthoringPslBlockDescriptorNamespace;
|
|
323
|
+
}
|
|
324
|
+
declare function isAuthoringArgRef(value: unknown): value is AuthoringArgRef;
|
|
325
|
+
declare function isAuthoringTypeConstructorDescriptor(value: unknown): value is AuthoringTypeConstructorDescriptor;
|
|
326
|
+
declare function isAuthoringFieldPresetDescriptor(value: unknown): value is AuthoringFieldPresetDescriptor;
|
|
327
|
+
declare function isAuthoringEntityTypeDescriptor(value: unknown): value is AuthoringEntityTypeDescriptor;
|
|
328
|
+
declare function isAuthoringPslBlockDescriptor(value: unknown): value is AuthoringPslBlockDescriptor;
|
|
329
|
+
/**
|
|
330
|
+
* Returns true when `namespace` is a non-leaf key in `contributions.field`.
|
|
331
|
+
*
|
|
332
|
+
* `AuthoringFieldNamespace` permits a leaf descriptor at any depth — including
|
|
333
|
+
* the root — so a top-level `field: { Foo: { kind: 'fieldPreset', ... } }`
|
|
334
|
+
* registration must NOT be treated as a "namespace" with sub-paths. Callers
|
|
335
|
+
* use this predicate to gate dot-namespaced lookups (e.g. PSL `@Foo.bar`).
|
|
336
|
+
*/
|
|
337
|
+
declare function hasRegisteredFieldNamespace(contributions: AuthoringContributions | undefined, namespace: string): boolean;
|
|
338
|
+
/**
|
|
339
|
+
* Merges `source` into `target` recursively at the descriptor-namespace
|
|
340
|
+
* level. `leafGuard` decides which values are descriptors (terminal
|
|
341
|
+
* merge points; same-path registrations across components are reported
|
|
342
|
+
* as duplicates) versus sub-namespaces (recursion targets).
|
|
343
|
+
*
|
|
344
|
+
* Path segments are validated against prototype-pollution names
|
|
345
|
+
* (`__proto__`, `constructor`, `prototype`). A value that is neither a
|
|
346
|
+
* recognized leaf nor a plain object — e.g. a malformed descriptor
|
|
347
|
+
* where the canonical leaf guard rejected it for missing `output` —
|
|
348
|
+
* is reported as an invalid contribution rather than recursed into,
|
|
349
|
+
* which would either silently mangle state or infinite-loop on
|
|
350
|
+
* primitive properties.
|
|
351
|
+
*
|
|
352
|
+
* Within-registry duplicate detection is this walker's job;
|
|
353
|
+
* cross-registry detection runs separately via
|
|
354
|
+
* `assertNoCrossRegistryCollisions` after merging completes.
|
|
355
|
+
*/
|
|
356
|
+
declare function mergeAuthoringNamespaces(target: Record<string, unknown>, source: Record<string, unknown>, path: readonly string[], leafGuard: (value: unknown) => boolean, label: string): void;
|
|
357
|
+
declare function assertNoCrossRegistryCollisions(typeNamespace: AuthoringTypeNamespace, fieldNamespace: AuthoringFieldNamespace, entityTypeNamespace?: AuthoringEntityTypeNamespace, pslBlockNamespace?: AuthoringPslBlockDescriptorNamespace): void;
|
|
358
|
+
declare function resolveAuthoringTemplateValue(template: AuthoringTemplateValue, args: readonly unknown[]): unknown;
|
|
359
|
+
declare function validateAuthoringHelperArguments(helperPath: string, descriptors: readonly AuthoringArgumentDescriptor[] | undefined, args: readonly unknown[]): void;
|
|
360
|
+
declare function instantiateAuthoringTypeConstructor(descriptor: AuthoringTypeConstructorDescriptor, args: readonly unknown[]): {
|
|
361
|
+
readonly codecId: string;
|
|
362
|
+
readonly nativeType: string;
|
|
363
|
+
readonly typeParams?: Record<string, unknown>;
|
|
364
|
+
};
|
|
365
|
+
declare function instantiateAuthoringEntityType(helperPath: string, descriptor: AuthoringEntityTypeDescriptor, args: readonly unknown[], ctx: AuthoringEntityContext): unknown;
|
|
366
|
+
declare function instantiateAuthoringFieldPreset(descriptor: AuthoringFieldPresetDescriptor, args: readonly unknown[]): {
|
|
367
|
+
readonly descriptor: {
|
|
368
|
+
readonly codecId: string;
|
|
369
|
+
readonly nativeType: string;
|
|
370
|
+
readonly typeParams?: Record<string, unknown>;
|
|
371
|
+
};
|
|
372
|
+
readonly nullable: boolean;
|
|
373
|
+
readonly default?: ColumnDefault;
|
|
374
|
+
readonly executionDefaults?: ExecutionMutationDefaultPhases;
|
|
375
|
+
readonly id: boolean;
|
|
376
|
+
readonly unique: boolean;
|
|
377
|
+
};
|
|
378
|
+
//#endregion
|
|
379
|
+
export { resolveAuthoringTemplateValue as A, PslExtensionBlockParamOption as B, instantiateAuthoringTypeConstructor as C, isAuthoringPslBlockDescriptor as D, isAuthoringFieldPresetDescriptor as E, PslBlockParamRef as F, PslSpan as G, PslExtensionBlockParamScalarValue as H, PslBlockParamValue as I, PslDiagnosticCode as L, PslBlockParam as M, PslBlockParamList as N, isAuthoringTypeConstructorDescriptor as O, PslBlockParamOption as P, PslExtensionBlock as R, instantiateAuthoringFieldPreset as S, isAuthoringEntityTypeDescriptor as T, PslExtensionBlockParamValue as U, PslExtensionBlockParamRef as V, PslPosition as W, AuthoringTypeConstructorDescriptor as _, AuthoringEntityContext as a, hasRegisteredFieldNamespace as b, AuthoringEntityTypeNamespace as c, AuthoringFieldPresetDescriptor as d, AuthoringFieldPresetOutput as f, AuthoringTemplateValue as g, AuthoringStorageTypeTemplate as h, AuthoringContributions as i, validateAuthoringHelperArguments as j, mergeAuthoringNamespaces as k, AuthoringEntityTypeTemplateOutput as l, AuthoringPslBlockDescriptorNamespace as m, AuthoringArgumentDescriptor as n, AuthoringEntityTypeDescriptor as o, AuthoringPslBlockDescriptor as p, AuthoringColumnDefaultTemplate as r, AuthoringEntityTypeFactoryOutput as s, AuthoringArgRef as t, AuthoringFieldNamespace as u, AuthoringTypeNamespace as v, isAuthoringArgRef as w, instantiateAuthoringEntityType as x, assertNoCrossRegistryCollisions as y, PslExtensionBlockParamList as z };
|
|
380
|
+
//# sourceMappingURL=framework-authoring-Cyde8zSN.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framework-authoring-Cyde8zSN.d.mts","names":[],"sources":["../src/shared/psl-extension-block.ts","../src/shared/framework-authoring.ts"],"mappings":";;;;;;;;AAYA;;;;;;;UAAiB,WAAA;EAAA,SACN,MAAA;EAAA,SACA,IAAA;EAAA,SACA,MAAA;AAAA;AAAA,UAGM,OAAA;EAAA,SACN,KAAA,EAAO,WAAA;EAAA,SACP,GAAA,EAAK,WAAW;AAAA;AAAA,KAGf,iBAAA;;AAHe;AAG3B;;;;AAA6B;AA+D7B;;;;;;;;;;;;;;AAIqB;AAErB;;;;;;;;;AAImB;AAGnB;;;AAHmB;;;;;AAMA;AAGnB;;;;;;;KAnBY,aAAA,GACR,gBAAA,GACA,kBAAA,GACA,mBAAA,GACA,iBAAA;AAAA,UAEa,gBAAA;EAAA,SACN,IAAA;EAAA,SACA,OAAA;EAAA,SACA,KAAA;EAAA,SACA,QAAA;AAAA;AAAA,UAGM,kBAAA;EAAA,SACN,IAAA;EAAA,SACA,OAAA;EAAA,SACA,QAAA;AAAA;AAAA,UAGM,mBAAA;EAAA,SACN,IAAA;EAAA,SACA,MAAA;EAAA,SACA,QAAA;AAAA;AAAA,UAGM,iBAAA;EAAA,SACN,IAAA;EAAA,SACA,EAAA,EAAI,aAAa;EAAA,SACjB,QAAA;AAAA;;;;;AAsBmB;AAE9B;;;;;;;;;AAGwB;KATZ,2BAAA,GACR,yBAAA,GACA,iCAAA,GACA,4BAAA,GACA,0BA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A2B,gBACjD,IAAA;AAAA,iBAmHc,mCAAA,CACd,UAAA,EAAY,kCAAA,EACZ,IAAA;EAAA,SAES,OAAA;EAAA,SACA,UAAA;EAAA,SACA,UAAA,GAAa,MAAM;AAAA;AAAA,iBAKd,8BAAA,CACd,UAAA,UACA,UAAA,EAAY,6BAAA,EACZ,IAAA,sBACA,GAAA,EAAK,sBAAsB;AAAA,iBA0Bb,+BAAA,CACd,UAAA,EAAY,8BAAA,EACZ,IAAA;EAAA,SAES,UAAA;IAAA,SACE,OAAA;IAAA,SACA,UAAA;IAAA,SACA,UAAA,GAAa,MAAA;EAAA;EAAA,SAEf,QAAA;EAAA,SACA,OAAA,GAAU,aAAA;EAAA,SACV,iBAAA,GAAoB,8BAAA;EAAA,SACpB,EAAA;EAAA,SACA,MAAA;AAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as AuthoringContributions } from "./framework-authoring-
|
|
1
|
+
import { i as AuthoringContributions } from "./framework-authoring-Cyde8zSN.mjs";
|
|
2
2
|
import { r as AnyCodecDescriptor } from "./codec-DCQAerzB.mjs";
|
|
3
3
|
import { t as TypesImportSpec } from "./types-import-spec-DRKzrJ20.mjs";
|
|
4
4
|
import { ColumnDefault, ExecutionMutationDefaultPhases, ExecutionMutationDefaultValue } from "@prisma-next/contract/types";
|
|
@@ -409,4 +409,4 @@ interface ExtensionInstance<TFamilyId extends string, TTargetId extends string>
|
|
|
409
409
|
}
|
|
410
410
|
//#endregion
|
|
411
411
|
export { LoweredDefaultResult as A, ControlMutationDefaultEntry as C, DefaultFunctionLoweringHandler as D, DefaultFunctionLoweringContext as E, SourceSpan as F, MutationDefaultGeneratorDescriptor as M, ParsedDefaultFunctionCall as N, DefaultFunctionRegistry as O, SourceDiagnostic as P, checkContractComponentRequirements as S, ControlMutationDefaults as T, PackRefBase as _, ComponentMetadata as a, TargetInstance as b, DriverDescriptor as c, ExtensionDescriptor as d, ExtensionInstance as f, FamilyPackRef as g, FamilyInstance as h, ComponentDescriptor as i, LoweredDefaultValue as j, DefaultFunctionRegistryEntry as k, DriverInstance as l, FamilyDescriptor as m, AdapterInstance as n, ContractComponentRequirementsCheckInput as o, ExtensionPackRef as p, AdapterPackRef as r, ContractComponentRequirementsCheckResult as s, AdapterDescriptor as t, DriverPackRef as u, TargetBoundComponentDescriptor as v, ControlMutationDefaultRegistry as w, TargetPackRef as x, TargetDescriptor as y };
|
|
412
|
-
//# sourceMappingURL=framework-components-
|
|
412
|
+
//# sourceMappingURL=framework-components-DdqvMc8S.d.mts.map
|
package/dist/{framework-components-Ce_Cdw76.d.mts.map → framework-components-DdqvMc8S.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework-components-
|
|
1
|
+
{"version":3,"file":"framework-components-DdqvMc8S.d.mts","names":[],"sources":["../src/shared/mutation-default-types.ts","../src/shared/framework-components.ts"],"mappings":";;;;;;UAMU,cAAA;EAAA,SACC,MAAA;EAAA,SACA,IAAA;EAAA,SACA,MAAA;AAAA;AAAA,UAGM,UAAA;EAAA,SACN,KAAA,EAAO,cAAA;EAAA,SACP,GAAA,EAAK,cAAc;AAAA;AAAA,UAGb,gBAAA;EAAA,SACN,IAAA;EAAA,SACA,OAAA;EAAA,SACA,QAAA;EAAA,SACA,IAAA,GAAO,UAAA;EAAA,SACP,IAAA,GAAO,QAAA,CAAS,MAAA;AAAA;AAAA,UAGjB,uBAAA;EAAA,SACC,GAAA;EAAA,SACA,IAAA,EAAM,UAAU;AAAA;AAAA,UAGV,yBAAA;EAAA,SACN,IAAA;EAAA,SACA,GAAA;EAAA,SACA,IAAA,WAAe,uBAAA;EAAA,SACf,IAAA,EAAM,UAAU;AAAA;AAAA,UAGV,8BAAA;EAAA,SACN,QAAA;EAAA,SACA,SAAA;EAAA,SACA,SAAA;EAAA,SACA,aAAA;AAAA;AAAA,KAGC,mBAAA;EAAA,SACG,IAAA;EAAA,SAA0B,YAAA,EAAc,aAAA;AAAA;EAAA,SACxC,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AA,IAC5B,mBAAA,CAAoB,SAAA,EAAW,SAAA;AAAA,UAElB,cAAA;EAAA,SACN,QAAA,EAAU,SAAS;AAAA;AAAA,UAGb,cAAA;EAAA,SACN,QAAA,EAAU,SAAA;EAAA,SACV,QAAA,EAAU,SAAS;AAAA;AAAA,UAGb,eAAA;EAAA,SACN,QAAA,EAAU,SAAA;EAAA,SACV,QAAA,EAAU,SAAS;AAAA;AAAA,UAGb,cAAA;EAAA,SACN,QAAA,EAAU,SAAA;EAAA,SACV,QAAA,EAAU,SAAS;AAAA;AAAA,UAGb,iBAAA;EAAA,SACN,QAAA,EAAU,SAAA;EAAA,SACV,QAAA,EAAU,SAAS;AAAA"}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
+
import { G as PslSpan, L as PslDiagnosticCode, R as PslExtensionBlock, m as AuthoringPslBlockDescriptorNamespace } from "./framework-authoring-Cyde8zSN.mjs";
|
|
2
|
+
import { c as CodecLookup } from "./codec-DCQAerzB.mjs";
|
|
3
|
+
|
|
1
4
|
//#region src/control/psl-ast.d.ts
|
|
2
|
-
interface PslPosition {
|
|
3
|
-
readonly offset: number;
|
|
4
|
-
readonly line: number;
|
|
5
|
-
readonly column: number;
|
|
6
|
-
}
|
|
7
|
-
interface PslSpan {
|
|
8
|
-
readonly start: PslPosition;
|
|
9
|
-
readonly end: PslPosition;
|
|
10
|
-
}
|
|
11
|
-
type PslDiagnosticCode = 'PSL_UNTERMINATED_BLOCK' | 'PSL_UNSUPPORTED_TOP_LEVEL_BLOCK' | 'PSL_INVALID_NAMESPACE_BLOCK' | 'PSL_INVALID_ATTRIBUTE_SYNTAX' | 'PSL_INVALID_MODEL_MEMBER' | 'PSL_UNSUPPORTED_MODEL_ATTRIBUTE' | 'PSL_UNSUPPORTED_FIELD_ATTRIBUTE' | 'PSL_INVALID_RELATION_ATTRIBUTE' | 'PSL_INVALID_REFERENTIAL_ACTION' | 'PSL_INVALID_DEFAULT_VALUE' | 'PSL_INVALID_ENUM_MEMBER' | 'PSL_INVALID_TYPES_MEMBER' | 'PSL_INVALID_QUALIFIED_TYPE';
|
|
12
5
|
interface PslDiagnostic {
|
|
13
6
|
readonly code: PslDiagnosticCode;
|
|
14
7
|
readonly message: string;
|
|
@@ -174,6 +167,23 @@ interface PslNamespace {
|
|
|
174
167
|
readonly models: readonly PslModel[];
|
|
175
168
|
readonly enums: readonly PslEnum[];
|
|
176
169
|
readonly compositeTypes: readonly PslCompositeType[];
|
|
170
|
+
/**
|
|
171
|
+
* Extension-contributed top-level blocks parsed inside this namespace.
|
|
172
|
+
* These are the parsed AST nodes produced by the generic framework parser
|
|
173
|
+
* when it encounters a keyword claimed by a registered
|
|
174
|
+
* {@link AuthoringPslBlockDescriptorNamespace} entry.
|
|
175
|
+
*
|
|
176
|
+
* Absent when no extension blocks appear in this namespace. Order matches
|
|
177
|
+
* source order within the namespace; extension-contributed and built-in
|
|
178
|
+
* blocks live in their own slots, so a namespace mixing `model X { … }` and
|
|
179
|
+
* `policy_select Y { … }` keeps the model in `models` and the policy in
|
|
180
|
+
* `extensionBlocks`.
|
|
181
|
+
*
|
|
182
|
+
* Contrast with {@link ParsePslDocumentInput.pslBlockDescriptors}: that
|
|
183
|
+
* field holds the registry of declarative descriptors that teach the parser
|
|
184
|
+
* which keywords to accept; this field holds the resulting parsed nodes.
|
|
185
|
+
*/
|
|
186
|
+
readonly extensionBlocks?: readonly PslExtensionBlock[];
|
|
177
187
|
readonly span: PslSpan;
|
|
178
188
|
}
|
|
179
189
|
interface PslDocumentAst {
|
|
@@ -199,6 +209,30 @@ declare function flatPslCompositeTypes(ast: PslDocumentAst): readonly PslComposi
|
|
|
199
209
|
interface ParsePslDocumentInput {
|
|
200
210
|
readonly schema: string;
|
|
201
211
|
readonly sourceId: string;
|
|
212
|
+
/**
|
|
213
|
+
* Registry of declarative block descriptors, keyed by arbitrary path
|
|
214
|
+
* segments with {@link AuthoringPslBlockDescriptor} leaves. The registry
|
|
215
|
+
* teaches the parser which top-level keywords belong to extension
|
|
216
|
+
* contributions: when the parser encounters an unknown keyword, it looks
|
|
217
|
+
* it up here and, when found, reads the block generically into a
|
|
218
|
+
* {@link PslExtensionBlock} node. Absent or undefined means no extension
|
|
219
|
+
* blocks are registered and any unknown keyword yields
|
|
220
|
+
* `PSL_UNSUPPORTED_TOP_LEVEL_BLOCK`.
|
|
221
|
+
*
|
|
222
|
+
* Contrast with {@link PslNamespace.extensionBlocks}: that field holds the
|
|
223
|
+
* parsed block nodes in a namespace; this field holds the registry of
|
|
224
|
+
* descriptors that teach the parser how to read those blocks.
|
|
225
|
+
*/
|
|
226
|
+
readonly pslBlockDescriptors?: AuthoringPslBlockDescriptorNamespace;
|
|
227
|
+
/**
|
|
228
|
+
* Codec lookup for validating `value`-kind extension block parameters.
|
|
229
|
+
* When provided alongside `pslBlockDescriptors`, the generic validator runs
|
|
230
|
+
* over every parsed extension block after the full AST is assembled,
|
|
231
|
+
* appending any diagnostics to the parse result. Absent or undefined means
|
|
232
|
+
* no codec validation runs; `ref` resolution still runs when namespace
|
|
233
|
+
* context is available (built from the assembled namespaces).
|
|
234
|
+
*/
|
|
235
|
+
readonly codecLookup?: CodecLookup;
|
|
202
236
|
}
|
|
203
237
|
interface ParsePslDocumentResult {
|
|
204
238
|
readonly ast: PslDocumentAst;
|
|
@@ -206,5 +240,5 @@ interface ParsePslDocumentResult {
|
|
|
206
240
|
readonly ok: boolean;
|
|
207
241
|
}
|
|
208
242
|
//#endregion
|
|
209
|
-
export {
|
|
210
|
-
//# sourceMappingURL=psl-ast-
|
|
243
|
+
export { flatPslModels as A, PslReferentialAction as C, UNSPECIFIED_PSL_NAMESPACE_ID as D, PslUniqueConstraint as E, flatPslCompositeTypes as O, PslNamespace as S, PslTypesBlock as T, PslFieldAttribute as _, PslAttributeNamedArgument as a, PslModelAttribute as b, PslCompositeType as c, PslDefaultValue as d, PslDiagnostic as f, PslField as g, PslEnumValue as h, PslAttributeArgument as i, flatPslEnums as k, PslDefaultFunctionValue as l, PslEnum as m, ParsePslDocumentResult as n, PslAttributePositionalArgument as o, PslDocumentAst as p, PslAttribute as r, PslAttributeTarget as s, ParsePslDocumentInput as t, PslDefaultLiteralValue as u, PslIndexConstraint as v, PslTypeConstructorCall as w, PslNamedTypeDeclaration as x, PslModel as y };
|
|
244
|
+
//# sourceMappingURL=psl-ast-DRzRF9rS.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"psl-ast-DRzRF9rS.d.mts","names":[],"sources":["../src/control/psl-ast.ts"],"mappings":";;;;UAsBiB,aAAA;EAAA,SACN,IAAA,EAAM,iBAAA;EAAA,SACN,OAAA;EAAA,SACA,QAAA;EAAA,SACA,IAAA,EAAM,OAAO;AAAA;AAAA,UAGP,uBAAA;EAAA,SACN,IAAA;EAAA,SACA,IAAI;AAAA;AAAA,UAGE,sBAAA;EAAA,SACN,IAAA;EAAA,SACA,KAAK;AAAA;AAAA,KAGJ,eAAA,GAAkB,uBAAA,GAA0B,sBAAsB;AAAA,KAElE,kBAAA;AAAA,UAEK,8BAAA;EAAA,SACN,IAAA;EAAA,SACA,KAAA;EAAA,SACA,IAAA,EAAM,OAAO;AAAA;AAAA,UAGP,yBAAA;EAAA,SACN,IAAA;EAAA,SACA,IAAA;EAAA,SACA,KAAA;EAAA,SACA,IAAA,EAAM,OAAO;AAAA;AAAA,KAGZ,oBAAA,GAAuB,8BAAA,GAAiC,yBAAyB;AAAA,UAE5E,sBAAA;EAAA,SACN,IAAA;EAAA,SACA,IAAA;EAAA,SACA,IAAA,WAAe,oBAAA;EAAA,SACf,IAAA,EAAM,OAAO;AAAA;AAAA,UAGP,YAAA;EAAA,SACN,IAAA;EAAA,SACA,MAAA,EAAQ,kBAAA;EAAA,SACR,IAAA;EAAA,SACA,IAAA,WAAe,oBAAA;EAAA,SACf,IAAA,EAAM,OAAA;AAAA;AAAA,KAGL,oBAAA;AAAA,KAEA,iBAAA,GAAoB,YAAY;AAAA,UAE3B,QAAA;EAAA,SACN,IAAA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Ref, G as PslSpan, H as PslExtensionBlockParamScalarValue, I as PslBlockParamValue, L as PslDiagnosticCode, M as PslBlockParam, N as PslBlockParamList, P as PslBlockParamOption, R as PslExtensionBlock, U as PslExtensionBlockParamValue, V as PslExtensionBlockParamRef, W as PslPosition, m as AuthoringPslBlockDescriptorNamespace, p as AuthoringPslBlockDescriptor, z as PslExtensionBlockParamList } from "./framework-authoring-Cyde8zSN.mjs";
|
|
2
|
+
import { c as CodecLookup } from "./codec-DCQAerzB.mjs";
|
|
3
|
+
import { A as flatPslModels, C as PslReferentialAction, D as UNSPECIFIED_PSL_NAMESPACE_ID, E as PslUniqueConstraint, O as flatPslCompositeTypes, S as PslNamespace, T as PslTypesBlock, _ as PslFieldAttribute, a as PslAttributeNamedArgument, b as PslModelAttribute, c as PslCompositeType, d as PslDefaultValue, f as PslDiagnostic, g as PslField, h as PslEnumValue, i as PslAttributeArgument, k as flatPslEnums, l as PslDefaultFunctionValue, m as PslEnum, n as ParsePslDocumentResult, o as PslAttributePositionalArgument, p as PslDocumentAst, r as PslAttribute, s as PslAttributeTarget, t as ParsePslDocumentInput, u as PslDefaultLiteralValue, v as PslIndexConstraint, w as PslTypeConstructorCall, x as PslNamedTypeDeclaration, y as PslModel } from "./psl-ast-DRzRF9rS.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/control/psl-extension-block-validator.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Context for ref resolution during extension-block validation.
|
|
8
|
+
*
|
|
9
|
+
* - `ownerNamespace` is the `PslNamespace` that contains the block being
|
|
10
|
+
* validated. Used for `same-namespace` scope checks.
|
|
11
|
+
* - `allNamespaces` is every namespace in the document. Used for `same-space`
|
|
12
|
+
* scope checks.
|
|
13
|
+
*/
|
|
14
|
+
interface ExtensionBlockRefResolutionContext {
|
|
15
|
+
readonly ownerNamespace: PslNamespace;
|
|
16
|
+
readonly allNamespaces: readonly PslNamespace[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Validate a single parsed extension block against its descriptor.
|
|
20
|
+
*
|
|
21
|
+
* Returns an array of {@link PslDiagnostic} objects (possibly empty). The
|
|
22
|
+
* caller is responsible for threading `sourceId` into each returned diagnostic
|
|
23
|
+
* — the returned objects already have `sourceId` set from the `sourceId`
|
|
24
|
+
* parameter.
|
|
25
|
+
*
|
|
26
|
+
* @param node - The parsed block node produced by the generic framework parser.
|
|
27
|
+
* @param descriptor - The descriptor that claims this block's keyword.
|
|
28
|
+
* @param sourceId - The PSL source file identifier (threaded into diagnostics).
|
|
29
|
+
* @param codecLookup - Used to validate `value`-kind parameter literals via
|
|
30
|
+
* `codecLookup.get(codecId)?.decodeJson(JSON.parse(raw))`.
|
|
31
|
+
* @param refCtx - Namespace context for `ref`-kind scope resolution. Required
|
|
32
|
+
* when any descriptor parameter is `kind: 'ref'`; may be omitted if none are.
|
|
33
|
+
*/
|
|
34
|
+
declare function validateExtensionBlock(node: PslExtensionBlock, descriptor: AuthoringPslBlockDescriptor, sourceId: string, codecLookup: CodecLookup, refCtx?: ExtensionBlockRefResolutionContext): readonly PslDiagnostic[];
|
|
35
|
+
//#endregion
|
|
36
|
+
export { type AuthoringPslBlockDescriptorNamespace, type ExtensionBlockRefResolutionContext, ParsePslDocumentInput, ParsePslDocumentResult, PslAttribute, PslAttributeArgument, PslAttributeNamedArgument, PslAttributePositionalArgument, PslAttributeTarget, type PslBlockParam, type PslBlockParamList, type PslBlockParamOption, type PslBlockParamRef, type PslBlockParamValue, PslCompositeType, PslDefaultFunctionValue, PslDefaultLiteralValue, PslDefaultValue, PslDiagnostic, type PslDiagnosticCode, PslDocumentAst, PslEnum, PslEnumValue, type PslExtensionBlock, type PslExtensionBlockParamList, type PslExtensionBlockParamOption, type PslExtensionBlockParamRef, type PslExtensionBlockParamScalarValue, type PslExtensionBlockParamValue, PslField, PslFieldAttribute, PslIndexConstraint, PslModel, PslModelAttribute, PslNamedTypeDeclaration, PslNamespace, type PslPosition, PslReferentialAction, type PslSpan, PslTypeConstructorCall, PslTypesBlock, PslUniqueConstraint, UNSPECIFIED_PSL_NAMESPACE_ID, flatPslCompositeTypes, flatPslEnums, flatPslModels, validateExtensionBlock };
|
|
37
|
+
//# sourceMappingURL=psl-ast.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"psl-ast.d.mts","names":[],"sources":["../src/control/psl-extension-block-validator.ts"],"mappings":";;;;;;;;;;;;;UA2EiB,kCAAA;EAAA,SACN,cAAA,EAAgB,YAAA;EAAA,SAChB,aAAA,WAAwB,YAAY;AAAA;;;;;;;;;;;;;;;;;iBAmB/B,sBAAA,CACd,IAAA,EAAM,iBAAA,EACN,UAAA,EAAY,2BAAA,EACZ,QAAA,UACA,WAAA,EAAa,WAAA,EACb,MAAA,GAAS,kCAAA,YACC,aAAA"}
|