schemair 0.1.0 → 0.3.0
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 +542 -32
- package/dist/authoring/index.cjs +13 -350
- package/dist/authoring/index.d.cts +2 -90
- package/dist/authoring/index.d.ts +2 -90
- package/dist/authoring/index.js +2 -304
- package/dist/authoring-Dnrg5TXm.cjs +389 -0
- package/dist/authoring-DyJNYs5o.js +362 -0
- package/dist/chunk-bFfwrPtJ.js +18 -0
- package/dist/compatibility/index.cjs +43 -0
- package/dist/compatibility/index.d.cts +2 -0
- package/dist/compatibility/index.d.ts +2 -0
- package/dist/compatibility/index.js +42 -0
- package/dist/definition/index.cjs +10 -2
- package/dist/definition/index.d.cts +3 -21
- package/dist/definition/index.d.ts +3 -21
- package/dist/definition/index.js +2 -2
- package/dist/definition-BH_LzXGc.js +1115 -0
- package/dist/definition-BLLBpLKv.cjs +1187 -0
- package/dist/index-1sDuqu05.d.ts +373 -0
- package/dist/index-BFSMT_2d.d.ts +53 -0
- package/dist/index-BGz7L_Fq.d.cts +73 -0
- package/dist/index-BTtdqi_M.d.ts +418 -0
- package/dist/index-BfbClf6R.d.cts +20 -0
- package/dist/index-CK7Is7vy.d.cts +420 -0
- package/dist/index-CUGhtuwA.d.cts +53 -0
- package/dist/index-CV8EZQy8.d.ts +92 -0
- package/dist/index-CzNxjqVg.d.cts +47 -0
- package/dist/index-DGHMUZ5m.d.cts +92 -0
- package/dist/{index-eK2Xgrwp.d.ts → index-DxvfPmw6.d.ts} +13 -9
- package/dist/index-T6nFhvGQ.d.ts +20 -0
- package/dist/{index-TACcK_mi.d.cts → index-ba_52Yu9.d.cts} +13 -9
- package/dist/index-hrcM9oJe.d.ts +47 -0
- package/dist/index-i7Au-FQ6.d.cts +373 -0
- package/dist/index-mu1znI1F.d.ts +73 -0
- package/dist/index.cjs +70 -58
- package/dist/index.d.cts +9 -7
- package/dist/index.d.ts +9 -7
- package/dist/index.js +10 -6
- package/dist/integrations/json-schema/index.cjs +328 -0
- package/dist/integrations/json-schema/index.d.cts +53 -0
- package/dist/integrations/json-schema/index.d.ts +53 -0
- package/dist/integrations/json-schema/index.js +324 -0
- package/dist/integrations/standard-schema/index.cjs +32 -0
- package/dist/integrations/standard-schema/index.d.cts +22 -0
- package/dist/integrations/standard-schema/index.d.ts +22 -0
- package/dist/integrations/standard-schema/index.js +32 -0
- package/dist/payload/index.cjs +45 -82
- package/dist/payload/index.d.cts +2 -56
- package/dist/payload/index.d.ts +2 -56
- package/dist/payload/index.js +45 -81
- package/dist/relations/index.cjs +3 -4
- package/dist/relations/index.d.cts +2 -2
- package/dist/relations/index.d.ts +2 -2
- package/dist/relations/index.js +2 -2
- package/dist/{relations-CMz_0nf4.cjs → relations-NUVJkAG8.cjs} +143 -211
- package/dist/{relations-By0bK3UK.js → relations-QtnCRW9x.js} +140 -202
- package/dist/resolve/index.cjs +308 -0
- package/dist/resolve/index.d.cts +2 -0
- package/dist/resolve/index.d.ts +2 -0
- package/dist/resolve/index.js +305 -0
- package/dist/schema-ref-key-BHVFVfj1.cjs +26 -0
- package/dist/schema-ref-key-DR__tPr-.js +14 -0
- package/dist/spec/index.cjs +9 -0
- package/dist/spec/index.d.cts +2 -2
- package/dist/spec/index.d.ts +2 -2
- package/dist/spec/index.js +3 -1
- package/dist/standard/index.cjs +810 -0
- package/dist/standard/index.d.cts +3 -0
- package/dist/standard/index.d.ts +3 -0
- package/dist/standard/index.js +777 -0
- package/dist/standard-BGMgbbEQ.js +471 -0
- package/dist/standard-etPFZDJI.cjs +513 -0
- package/dist/type-interpreter/index.cjs +3 -7
- package/dist/type-interpreter/index.d.cts +2 -99
- package/dist/type-interpreter/index.d.ts +2 -99
- package/dist/type-interpreter/index.js +2 -2
- package/dist/{type-interpreter-Ck0VDhzn.js → type-interpreter-BA8gcLUU.js} +58 -560
- package/dist/{type-interpreter-DAIBUqKf.cjs → type-interpreter-D8xETgq1.cjs} +63 -589
- package/package.json +60 -5
- package/dist/definition-BXj3T94L.js +0 -467
- package/dist/definition-DSZZTz4e.cjs +0 -473
- package/dist/index-CEzHfht2.d.ts +0 -269
- package/dist/index-rzkFjgrt.d.cts +0 -269
|
@@ -1,99 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
//#region src/type-interpreter/interpreter.d.ts
|
|
5
|
-
type TypeInterpreterPath = readonly (string | number)[];
|
|
6
|
-
interface TypeInterpreterDiagnostic {
|
|
7
|
-
readonly code: string;
|
|
8
|
-
readonly path: TypeInterpreterPath;
|
|
9
|
-
readonly message: string;
|
|
10
|
-
}
|
|
11
|
-
type TypeInterpreterStatus = 'evaluated' | 'incomplete' | 'rejected';
|
|
12
|
-
type EvaluatedTypeTerm = SchemaNode | SchemaValueTypeExpr;
|
|
13
|
-
type TypeInterpreterResult = {
|
|
14
|
-
readonly status: 'evaluated';
|
|
15
|
-
readonly term: EvaluatedTypeTerm;
|
|
16
|
-
readonly schema?: SchemaNode;
|
|
17
|
-
readonly unresolvedTypeVars?: readonly string[];
|
|
18
|
-
readonly issues: readonly TypeInterpreterDiagnostic[];
|
|
19
|
-
} | {
|
|
20
|
-
readonly status: 'incomplete';
|
|
21
|
-
readonly issues: readonly TypeInterpreterDiagnostic[];
|
|
22
|
-
} | {
|
|
23
|
-
readonly status: 'rejected';
|
|
24
|
-
readonly issues: readonly TypeInterpreterDiagnostic[];
|
|
25
|
-
};
|
|
26
|
-
type TypeInterpreterRefResolution = SchemaNode | {
|
|
27
|
-
readonly status: 'resolved';
|
|
28
|
-
readonly schema: SchemaNode;
|
|
29
|
-
} | {
|
|
30
|
-
readonly status: 'unknown' | 'unsupported';
|
|
31
|
-
readonly message?: string;
|
|
32
|
-
} | undefined;
|
|
33
|
-
type AsyncTypeInterpreterRefResolution = TypeInterpreterRefResolution | PromiseLike<TypeInterpreterRefResolution>;
|
|
34
|
-
interface TypeInterpreterContext {
|
|
35
|
-
readonly typeVars?: Readonly<Record<string, SchemaValueTypeTerm>>;
|
|
36
|
-
readonly resolveRef?: (refPath: readonly string[]) => TypeInterpreterRefResolution;
|
|
37
|
-
readonly maxDepth?: number;
|
|
38
|
-
readonly maxSteps?: number;
|
|
39
|
-
}
|
|
40
|
-
interface AsyncTypeInterpreterContext {
|
|
41
|
-
readonly typeVars?: Readonly<Record<string, SchemaValueTypeTerm>>;
|
|
42
|
-
readonly resolveRef?: (refPath: readonly string[]) => AsyncTypeInterpreterRefResolution;
|
|
43
|
-
readonly maxDepth?: number;
|
|
44
|
-
readonly maxSteps?: number;
|
|
45
|
-
}
|
|
46
|
-
declare function evaluateExpression(term: unknown, context?: TypeInterpreterContext): TypeInterpreterResult;
|
|
47
|
-
declare function evaluateExpressionAsync(term: unknown, context?: AsyncTypeInterpreterContext): Promise<TypeInterpreterResult>;
|
|
48
|
-
declare const evaluateSchemaValueTypeTerm: typeof evaluateExpression;
|
|
49
|
-
declare const evaluateSchemaValueTypeTermAsync: typeof evaluateExpressionAsync;
|
|
50
|
-
//#endregion
|
|
51
|
-
//#region src/type-interpreter/term-relation.d.ts
|
|
52
|
-
interface TypeTermRelationContext {
|
|
53
|
-
readonly interpreter?: TypeInterpreterContext;
|
|
54
|
-
readonly relation?: RelationContext;
|
|
55
|
-
readonly hostTypeRelation?: (sourcePath: readonly string[], targetPath: readonly string[]) => HostTypeRelationDecision;
|
|
56
|
-
}
|
|
57
|
-
interface AsyncTypeTermRelationContext {
|
|
58
|
-
readonly interpreter?: AsyncTypeInterpreterContext;
|
|
59
|
-
readonly relation?: AsyncRelationContext;
|
|
60
|
-
readonly hostTypeRelation?: (sourcePath: readonly string[], targetPath: readonly string[]) => HostTypeRelationDecision | PromiseLike<HostTypeRelationDecision>;
|
|
61
|
-
}
|
|
62
|
-
type HostTypeRelationDecision = boolean | {
|
|
63
|
-
readonly status: 'assignable' | 'incompatible' | 'unknown' | 'unsupported';
|
|
64
|
-
readonly message?: string;
|
|
65
|
-
};
|
|
66
|
-
declare function checkTypeTermRelation(source: SchemaValueTypeTerm, target: SchemaValueTypeTerm, context?: TypeTermRelationContext): RelationResult;
|
|
67
|
-
declare function checkTypeTermRelationAsync(source: SchemaValueTypeTerm, target: SchemaValueTypeTerm, context?: AsyncTypeTermRelationContext): Promise<RelationResult>;
|
|
68
|
-
//#endregion
|
|
69
|
-
//#region src/type-interpreter/type-variable-solver.d.ts
|
|
70
|
-
interface TypeVariableConstraint {
|
|
71
|
-
readonly source: SchemaValueTypeTerm;
|
|
72
|
-
readonly target: SchemaValueTypeTerm;
|
|
73
|
-
}
|
|
74
|
-
interface TypeVariableSolverInput {
|
|
75
|
-
readonly variables: readonly string[];
|
|
76
|
-
readonly constraints: readonly TypeVariableConstraint[];
|
|
77
|
-
}
|
|
78
|
-
interface TypeVariableSolverIssue {
|
|
79
|
-
readonly code: string;
|
|
80
|
-
readonly constraint?: number;
|
|
81
|
-
readonly variable?: string;
|
|
82
|
-
readonly message: string;
|
|
83
|
-
}
|
|
84
|
-
interface TypeVariableSolverResult {
|
|
85
|
-
readonly status: 'solved' | 'unknown' | 'incompatible' | 'rejected';
|
|
86
|
-
readonly bindings: Readonly<Record<string, EvaluatedTypeTerm>>;
|
|
87
|
-
readonly unresolved: readonly string[];
|
|
88
|
-
readonly issues: readonly TypeVariableSolverIssue[];
|
|
89
|
-
}
|
|
90
|
-
interface TypeVariableSolverContext extends TypeTermRelationContext {
|
|
91
|
-
readonly interpreter?: TypeInterpreterContext;
|
|
92
|
-
}
|
|
93
|
-
interface AsyncTypeVariableSolverContext extends AsyncTypeTermRelationContext {
|
|
94
|
-
readonly interpreter?: AsyncTypeInterpreterContext;
|
|
95
|
-
}
|
|
96
|
-
declare function solveTypeVariables(input: TypeVariableSolverInput, context?: TypeVariableSolverContext): TypeVariableSolverResult;
|
|
97
|
-
declare function solveTypeVariablesAsync(input: TypeVariableSolverInput, context?: AsyncTypeVariableSolverContext): Promise<TypeVariableSolverResult>;
|
|
98
|
-
//#endregion
|
|
99
|
-
export { AsyncTypeInterpreterContext, AsyncTypeInterpreterRefResolution, AsyncTypeTermRelationContext, AsyncTypeVariableSolverContext, EvaluatedTypeTerm, HostTypeRelationDecision, TypeInterpreterContext, TypeInterpreterDiagnostic, TypeInterpreterPath, TypeInterpreterRefResolution, TypeInterpreterResult, TypeInterpreterStatus, TypeTermRelationContext, TypeVariableConstraint, TypeVariableSolverContext, TypeVariableSolverInput, TypeVariableSolverIssue, TypeVariableSolverResult, checkTypeTermRelation, checkTypeTermRelationAsync, evaluateExpression, evaluateExpressionAsync, evaluateSchemaValueTypeTerm, evaluateSchemaValueTypeTermAsync, solveTypeVariables, solveTypeVariablesAsync };
|
|
1
|
+
import { _ as evaluateSchemaTypeTerm, a as TypeVariableSolverResult, c as TypeTermRelationContext, d as TypeInterpreterContext, f as TypeInterpreterDiagnostic, g as evaluateExpression, h as TypeInterpreterStatus, i as TypeVariableSolverIssue, l as checkTypeTermRelation, m as TypeInterpreterResult, n as TypeVariableSolverContext, o as solveTypeVariables, p as TypeInterpreterPath, r as TypeVariableSolverInput, s as HostTypeRelationDecision, t as TypeVariableConstraint, u as EvaluatedTypeTerm } from "../index-mu1znI1F.js";
|
|
2
|
+
export { EvaluatedTypeTerm, HostTypeRelationDecision, TypeInterpreterContext, TypeInterpreterDiagnostic, TypeInterpreterPath, TypeInterpreterResult, TypeInterpreterStatus, TypeTermRelationContext, TypeVariableConstraint, TypeVariableSolverContext, TypeVariableSolverInput, TypeVariableSolverIssue, TypeVariableSolverResult, checkTypeTermRelation, evaluateExpression, evaluateSchemaTypeTerm, solveTypeVariables };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as checkTypeTermRelation, n as evaluateExpression, r as evaluateSchemaTypeTerm, t as solveTypeVariables } from "../type-interpreter-BA8gcLUU.js";
|
|
2
2
|
|
|
3
|
-
export { checkTypeTermRelation,
|
|
3
|
+
export { checkTypeTermRelation, evaluateExpression, evaluateSchemaTypeTerm, solveTypeVariables };
|