@jarenjs/linq 0.67.0 → 0.72.2
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/README.md +15 -2
- package/docs/AI-PEN.md +98 -0
- package/docs/APP-PEN.md +3 -3
- package/docs/CHARTS-PEN.md +94 -0
- package/docs/CONTRACT-PEN.md +4 -4
- package/docs/DB-CLIENT.md +3 -3
- package/docs/FORMS-PEN.md +2 -2
- package/docs/JTLT-PEN.md +83 -0
- package/docs/LINQ-FORMAT.md +171 -43
- package/docs/MESSAGES-PEN.md +105 -0
- package/docs/MIGRATION-PEN.md +1 -1
- package/docs/MODEL-PEN.md +3 -3
- package/docs/PROJECT-PEN.md +75 -0
- package/docs/QUERY-PEN.md +6 -5
- package/docs/SCHEMA-PEN.md +70 -83
- package/package.json +27 -7
- package/src/ai/index.js +76 -0
- package/src/authored.js +38 -0
- package/src/charts/index.js +131 -0
- package/src/charts/vocabulary.js +119 -0
- package/src/expression.js +1 -1
- package/src/federate.js +6 -17
- package/src/jtlt/index.js +97 -0
- package/src/messages/index.js +96 -0
- package/src/messages/vocabulary.js +259 -0
- package/src/project/index.js +54 -0
- package/src/schema/builders.js +100 -9
- package/src/schema/emit.js +29 -13
- package/types/ai.d.ts +56 -0
- package/types/charts.d.ts +481 -0
- package/types/jtlt.d.ts +45 -0
- package/types/message-vocabulary.d.ts +96 -0
- package/types/messages.d.ts +32 -0
- package/types/project.d.ts +45 -0
- package/types/schema.d.ts +54 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** Structural JSON input: readonly documents and schema interfaces participate.
|
|
2
|
+
* Unknown schema extension members still cross the runtime JSON boundary. */
|
|
3
|
+
type JsonData = string | number | boolean | null | readonly JsonData[] | { readonly [key: string]: JsonData };
|
|
4
|
+
export type JsonInput<T> = unknown extends T ? unknown
|
|
5
|
+
: T extends JsonData ? T
|
|
6
|
+
: T extends (...args: never[]) => unknown ? never
|
|
7
|
+
: T extends object ? { readonly [K in keyof T]: JsonInput<T[K]> } : never;
|
|
8
|
+
|
|
9
|
+
export type FileKind = 'app' | 'jslt' | 'query' | 'state' | 'data' | 'schema' | 'fsm' | 'dag' | 'model' | 'contract';
|
|
10
|
+
export interface ProjectFile<Name extends string = string, Kind extends FileKind = FileKind> {
|
|
11
|
+
readonly name: Name;
|
|
12
|
+
readonly kind: Kind;
|
|
13
|
+
readonly text: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ProjectLayout {
|
|
16
|
+
readonly mode?: 'classic' | 'right' | 'top';
|
|
17
|
+
readonly ratio?: number;
|
|
18
|
+
readonly autorun?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface ProjectDocument {
|
|
21
|
+
readonly project: '0.1';
|
|
22
|
+
readonly files: readonly ProjectFile[];
|
|
23
|
+
readonly active?: string;
|
|
24
|
+
readonly layout?: ProjectLayout;
|
|
25
|
+
}
|
|
26
|
+
export const FILE_KINDS: readonly FileKind[];
|
|
27
|
+
export function file<const N extends string, K extends FileKind>(name: N, kind: K, text: string): ProjectFile<N, K>;
|
|
28
|
+
export function jsonFile<const N extends string, K extends FileKind, const D>(name: N, kind: K, document: D & JsonInput<D>): ProjectFile<N, K>;
|
|
29
|
+
/** Names are a phantom; the public document has no extra registry. */
|
|
30
|
+
export class ProjectBuilder<Names extends string = never> {
|
|
31
|
+
protected constructor();
|
|
32
|
+
readonly __names: Names;
|
|
33
|
+
readonly schema: ProjectDocument;
|
|
34
|
+
toJSON(): ProjectDocument;
|
|
35
|
+
files<const F extends readonly ProjectFile[]>(files: F): ProjectBuilder<F[number]['name']>;
|
|
36
|
+
file<const N extends string>(file: ProjectFile<N>): ProjectBuilder<Names | N>;
|
|
37
|
+
active(name: Names): ProjectBuilder<Names>;
|
|
38
|
+
layout(layout: ProjectLayout): ProjectBuilder<Names>;
|
|
39
|
+
}
|
|
40
|
+
export function defineProject<const F extends readonly ProjectFile[] = []>(files?: F, options?: {
|
|
41
|
+
readonly active?: F[number]['name'];
|
|
42
|
+
readonly layout?: ProjectLayout;
|
|
43
|
+
}): ProjectBuilder<F[number]['name']>;
|
|
44
|
+
/** No filename inference is claimed for an arbitrary raw document. */
|
|
45
|
+
export function from(document: ProjectDocument): ProjectBuilder<string>;
|
package/types/schema.d.ts
CHANGED
|
@@ -161,6 +161,42 @@ export class SchemaBuilder<Out = unknown, In = Out, F extends Flag = never> {
|
|
|
161
161
|
readonly schema: JsonSchema | boolean;
|
|
162
162
|
/** `JSON.stringify(builder)` is the document. */
|
|
163
163
|
toJSON(): JsonSchema | boolean;
|
|
164
|
+
/** `$id`: resource identity; the phantom is unchanged. */
|
|
165
|
+
id(uri: string): this;
|
|
166
|
+
/** Raw constraint escape hatch, without inferred narrowing. */
|
|
167
|
+
keyword(key: string, value: Json): this;
|
|
168
|
+
/** Validation or annotation only; retains the current phantom. */
|
|
169
|
+
anchor(value: string): this;
|
|
170
|
+
/** Validation or annotation only; retains the current phantom. */
|
|
171
|
+
dynamicRef(value: string): this;
|
|
172
|
+
/** Validation or annotation only; retains the current phantom. */
|
|
173
|
+
dynamicAnchor(value: string): this;
|
|
174
|
+
/** Validation or annotation only; retains the current phantom. */
|
|
175
|
+
recursiveRef(value: string): this;
|
|
176
|
+
/** Validation or annotation only; retains the current phantom. */
|
|
177
|
+
recursiveAnchor(value: boolean): this;
|
|
178
|
+
/** Validation or annotation only; retains the current phantom. */
|
|
179
|
+
dollarData(value: string): this;
|
|
180
|
+
/** Validation or annotation only; retains the current phantom. */
|
|
181
|
+
vocabulary(value: Readonly<Record<string, boolean>>): this;
|
|
182
|
+
/** Validation or annotation only; retains the current phantom. */
|
|
183
|
+
data(value: Readonly<Record<string, string>>): this;
|
|
184
|
+
/** Validation or annotation only; retains the current phantom. */
|
|
185
|
+
not(value: AnyBuilder): this;
|
|
186
|
+
/** Validation or annotation only; retains the current phantom. */
|
|
187
|
+
unevaluatedProperties(value: AnyBuilder): this;
|
|
188
|
+
/** Validation or annotation only; retains the current phantom. */
|
|
189
|
+
unevaluatedItems(value: AnyBuilder): this;
|
|
190
|
+
/** Validation or annotation only; retains the current phantom. */
|
|
191
|
+
dependentSchemas(value: Props): this;
|
|
192
|
+
/** Validation or annotation only; retains the current phantom. */
|
|
193
|
+
definitions(value: Props): this;
|
|
194
|
+
/** Validation or annotation only; retains the current phantom. */
|
|
195
|
+
additionalItems(value: AnyBuilder): this;
|
|
196
|
+
/** Validation or annotation only; retains the current phantom. */
|
|
197
|
+
dependencies(value: Readonly<Record<string, AnyBuilder | readonly string[]>>): this;
|
|
198
|
+
/** Legacy nullable may widen acceptance; no inferred shape is claimed. */
|
|
199
|
+
legacyNullable(value: boolean): SchemaBuilder<unknown, unknown, F>;
|
|
164
200
|
/** As an object member: left out of `required`. */
|
|
165
201
|
optional(): SchemaBuilder<Out, In, F | 'optional'>;
|
|
166
202
|
/** Admit `null`. */
|
|
@@ -183,6 +219,20 @@ export class SchemaBuilder<Out = unknown, In = Out, F extends Flag = never> {
|
|
|
183
219
|
|
|
184
220
|
/** `{ type: 'string' }` and the string constraints. */
|
|
185
221
|
export class StringBuilder<Out = string, In = Out, F extends Flag = never> extends SchemaBuilder<Out, In, F> {
|
|
222
|
+
/** `contentEncoding`; retains the current phantom. */
|
|
223
|
+
contentEncoding(value: string): this;
|
|
224
|
+
/** `contentMediaType`; retains the current phantom. */
|
|
225
|
+
contentMediaType(value: string): this;
|
|
226
|
+
/** `contentSchema`; retains the current phantom. */
|
|
227
|
+
contentSchema(value: AnyBuilder): this;
|
|
228
|
+
/** `formatMinimum`; retains the current phantom. */
|
|
229
|
+
formatMinimum(value: string): this;
|
|
230
|
+
/** `formatMaximum`; retains the current phantom. */
|
|
231
|
+
formatMaximum(value: string): this;
|
|
232
|
+
/** `formatExclusiveMinimum`; retains the current phantom. */
|
|
233
|
+
formatExclusiveMinimum(value: string): this;
|
|
234
|
+
/** `formatExclusiveMaximum`; retains the current phantom. */
|
|
235
|
+
formatExclusiveMaximum(value: string): this;
|
|
186
236
|
optional(): StringBuilder<Out, In, F | 'optional'>;
|
|
187
237
|
nullable(): StringBuilder<Out | null, In | null, F>;
|
|
188
238
|
default(value: Out): StringBuilder<Out, In, F | 'defaulted'>;
|
|
@@ -254,6 +304,10 @@ declare class NullBuilder<Out = null, In = Out, F extends Flag = never> extends
|
|
|
254
304
|
|
|
255
305
|
/** `{ type: 'array', items }` and the array constraints. */
|
|
256
306
|
export class ArrayBuilder<Out = unknown[], In = Out, F extends Flag = never> extends SchemaBuilder<Out, In, F> {
|
|
307
|
+
/** `minContains`; retains the current phantom. */
|
|
308
|
+
minContains(value: number): this;
|
|
309
|
+
/** `maxContains`; retains the current phantom. */
|
|
310
|
+
maxContains(value: number): this;
|
|
257
311
|
optional(): ArrayBuilder<Out, In, F | 'optional'>;
|
|
258
312
|
nullable(): ArrayBuilder<Out | null, In | null, F>;
|
|
259
313
|
default(value: Out): ArrayBuilder<Out, In, F | 'defaulted'>;
|