schemair 0.1.0 → 0.2.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 +420 -11
- 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-D3V0iyTe.js +362 -0
- package/dist/authoring-Dnrg5TXm.cjs +389 -0
- package/dist/chunk-BgLxgFZR.js +18 -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-BLLBpLKv.cjs +1187 -0
- package/dist/definition-DmYnDmQO.js +1115 -0
- package/dist/index-4aMF0cTE.d.ts +368 -0
- package/dist/index-BqfGAU1K.d.ts +56 -0
- package/dist/{index-eK2Xgrwp.d.ts → index-CBbd4hXJ.d.ts} +13 -2
- package/dist/index-CIim1dG7.d.cts +92 -0
- package/dist/{index-TACcK_mi.d.cts → index-CNjYUKvu.d.cts} +13 -2
- package/dist/index-CQynt7ft.d.cts +420 -0
- package/dist/index-D3mfwaSO.d.cts +56 -0
- package/dist/index-DDMwVy2I.d.cts +368 -0
- package/dist/index-DM5DSLLL.d.ts +99 -0
- package/dist/index-DXWoNYFB.d.ts +92 -0
- package/dist/index-DhmHCGpT.d.cts +99 -0
- package/dist/index-bQy-C-1l.d.ts +418 -0
- package/dist/index.cjs +64 -52
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +7 -5
- 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 +1 -1
- package/dist/payload/index.d.cts +1 -55
- package/dist/payload/index.d.ts +1 -55
- package/dist/payload/index.js +1 -1
- package/dist/relations/index.cjs +3 -1
- 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-Cymx4iTc.cjs} +158 -5
- package/dist/{relations-By0bK3UK.js → relations-ysXDmi-Z.js} +147 -6
- 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-DhKsxu9U.js +471 -0
- package/dist/standard-etPFZDJI.cjs +513 -0
- package/dist/type-interpreter/index.cjs +3 -3
- 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-DnrId8aM.js} +5 -284
- package/dist/{type-interpreter-DAIBUqKf.cjs → type-interpreter-OLt2W2yd.cjs} +15 -294
- package/package.json +38 -3
- 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
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/spec/standard/paths.ts
|
|
3
|
+
const STANDARD_SEMANTIC_PATHS = {
|
|
4
|
+
string: {
|
|
5
|
+
date: [
|
|
6
|
+
"std",
|
|
7
|
+
"string",
|
|
8
|
+
"date"
|
|
9
|
+
],
|
|
10
|
+
datetime: [
|
|
11
|
+
"std",
|
|
12
|
+
"string",
|
|
13
|
+
"datetime"
|
|
14
|
+
],
|
|
15
|
+
datetimeIso: [
|
|
16
|
+
"std",
|
|
17
|
+
"string",
|
|
18
|
+
"datetime",
|
|
19
|
+
"iso"
|
|
20
|
+
],
|
|
21
|
+
email: [
|
|
22
|
+
"std",
|
|
23
|
+
"string",
|
|
24
|
+
"email"
|
|
25
|
+
],
|
|
26
|
+
url: [
|
|
27
|
+
"std",
|
|
28
|
+
"string",
|
|
29
|
+
"url"
|
|
30
|
+
],
|
|
31
|
+
ipV4: [
|
|
32
|
+
"std",
|
|
33
|
+
"string",
|
|
34
|
+
"ip",
|
|
35
|
+
"v4"
|
|
36
|
+
],
|
|
37
|
+
ipV6: [
|
|
38
|
+
"std",
|
|
39
|
+
"string",
|
|
40
|
+
"ip",
|
|
41
|
+
"v6"
|
|
42
|
+
],
|
|
43
|
+
uuid: [
|
|
44
|
+
"std",
|
|
45
|
+
"string",
|
|
46
|
+
"uuid"
|
|
47
|
+
],
|
|
48
|
+
uuidV4: [
|
|
49
|
+
"std",
|
|
50
|
+
"string",
|
|
51
|
+
"uuid",
|
|
52
|
+
"v4"
|
|
53
|
+
],
|
|
54
|
+
json: [
|
|
55
|
+
"std",
|
|
56
|
+
"string",
|
|
57
|
+
"json"
|
|
58
|
+
],
|
|
59
|
+
base64: [
|
|
60
|
+
"std",
|
|
61
|
+
"string",
|
|
62
|
+
"base64"
|
|
63
|
+
],
|
|
64
|
+
base64url: [
|
|
65
|
+
"std",
|
|
66
|
+
"string",
|
|
67
|
+
"base64url"
|
|
68
|
+
],
|
|
69
|
+
hex: [
|
|
70
|
+
"std",
|
|
71
|
+
"string",
|
|
72
|
+
"hex"
|
|
73
|
+
],
|
|
74
|
+
decimal: [
|
|
75
|
+
"std",
|
|
76
|
+
"string",
|
|
77
|
+
"decimal"
|
|
78
|
+
],
|
|
79
|
+
bigint: [
|
|
80
|
+
"std",
|
|
81
|
+
"string",
|
|
82
|
+
"bigint"
|
|
83
|
+
],
|
|
84
|
+
secret: [
|
|
85
|
+
"std",
|
|
86
|
+
"string",
|
|
87
|
+
"secret"
|
|
88
|
+
],
|
|
89
|
+
token: [
|
|
90
|
+
"std",
|
|
91
|
+
"string",
|
|
92
|
+
"secret",
|
|
93
|
+
"token"
|
|
94
|
+
],
|
|
95
|
+
password: [
|
|
96
|
+
"std",
|
|
97
|
+
"string",
|
|
98
|
+
"secret",
|
|
99
|
+
"password"
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
number: {
|
|
103
|
+
integer: [
|
|
104
|
+
"std",
|
|
105
|
+
"number",
|
|
106
|
+
"integer"
|
|
107
|
+
],
|
|
108
|
+
safeInteger: [
|
|
109
|
+
"std",
|
|
110
|
+
"number",
|
|
111
|
+
"safeInteger"
|
|
112
|
+
],
|
|
113
|
+
epochMillis: [
|
|
114
|
+
"std",
|
|
115
|
+
"number",
|
|
116
|
+
"epochMillis"
|
|
117
|
+
],
|
|
118
|
+
epochSeconds: [
|
|
119
|
+
"std",
|
|
120
|
+
"number",
|
|
121
|
+
"epochSeconds"
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
const STANDARD_SEMANTIC_PATH_LIST = [
|
|
126
|
+
STANDARD_SEMANTIC_PATHS.string.date,
|
|
127
|
+
STANDARD_SEMANTIC_PATHS.string.datetime,
|
|
128
|
+
STANDARD_SEMANTIC_PATHS.string.datetimeIso,
|
|
129
|
+
STANDARD_SEMANTIC_PATHS.string.email,
|
|
130
|
+
STANDARD_SEMANTIC_PATHS.string.url,
|
|
131
|
+
STANDARD_SEMANTIC_PATHS.string.ipV4,
|
|
132
|
+
STANDARD_SEMANTIC_PATHS.string.ipV6,
|
|
133
|
+
STANDARD_SEMANTIC_PATHS.string.uuid,
|
|
134
|
+
STANDARD_SEMANTIC_PATHS.string.uuidV4,
|
|
135
|
+
STANDARD_SEMANTIC_PATHS.string.json,
|
|
136
|
+
STANDARD_SEMANTIC_PATHS.string.base64,
|
|
137
|
+
STANDARD_SEMANTIC_PATHS.string.base64url,
|
|
138
|
+
STANDARD_SEMANTIC_PATHS.string.hex,
|
|
139
|
+
STANDARD_SEMANTIC_PATHS.string.decimal,
|
|
140
|
+
STANDARD_SEMANTIC_PATHS.string.bigint,
|
|
141
|
+
STANDARD_SEMANTIC_PATHS.string.secret,
|
|
142
|
+
STANDARD_SEMANTIC_PATHS.string.token,
|
|
143
|
+
STANDARD_SEMANTIC_PATHS.string.password,
|
|
144
|
+
STANDARD_SEMANTIC_PATHS.number.integer,
|
|
145
|
+
STANDARD_SEMANTIC_PATHS.number.safeInteger,
|
|
146
|
+
STANDARD_SEMANTIC_PATHS.number.epochMillis,
|
|
147
|
+
STANDARD_SEMANTIC_PATHS.number.epochSeconds
|
|
148
|
+
];
|
|
149
|
+
const STANDARD_CONSTRAINT_PATHS = {
|
|
150
|
+
string: {
|
|
151
|
+
minLength: ["std", "minLength"],
|
|
152
|
+
maxLength: ["std", "maxLength"],
|
|
153
|
+
pattern: ["std", "pattern"]
|
|
154
|
+
},
|
|
155
|
+
number: {
|
|
156
|
+
minimum: ["std", "minimum"],
|
|
157
|
+
maximum: ["std", "maximum"],
|
|
158
|
+
exclusiveMinimum: ["std", "exclusiveMinimum"],
|
|
159
|
+
exclusiveMaximum: ["std", "exclusiveMaximum"],
|
|
160
|
+
multipleOf: ["std", "multipleOf"]
|
|
161
|
+
},
|
|
162
|
+
array: {
|
|
163
|
+
minItems: ["std", "minItems"],
|
|
164
|
+
maxItems: ["std", "maxItems"],
|
|
165
|
+
uniqueItems: ["std", "uniqueItems"]
|
|
166
|
+
},
|
|
167
|
+
record: {
|
|
168
|
+
minProperties: ["std", "minProperties"],
|
|
169
|
+
maxProperties: ["std", "maxProperties"]
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
const STANDARD_CONSTRAINT_PATH_LIST = [
|
|
173
|
+
STANDARD_CONSTRAINT_PATHS.string.minLength,
|
|
174
|
+
STANDARD_CONSTRAINT_PATHS.string.maxLength,
|
|
175
|
+
STANDARD_CONSTRAINT_PATHS.string.pattern,
|
|
176
|
+
STANDARD_CONSTRAINT_PATHS.number.minimum,
|
|
177
|
+
STANDARD_CONSTRAINT_PATHS.number.maximum,
|
|
178
|
+
STANDARD_CONSTRAINT_PATHS.number.exclusiveMinimum,
|
|
179
|
+
STANDARD_CONSTRAINT_PATHS.number.exclusiveMaximum,
|
|
180
|
+
STANDARD_CONSTRAINT_PATHS.number.multipleOf,
|
|
181
|
+
STANDARD_CONSTRAINT_PATHS.array.minItems,
|
|
182
|
+
STANDARD_CONSTRAINT_PATHS.array.maxItems,
|
|
183
|
+
STANDARD_CONSTRAINT_PATHS.array.uniqueItems,
|
|
184
|
+
STANDARD_CONSTRAINT_PATHS.record.minProperties,
|
|
185
|
+
STANDARD_CONSTRAINT_PATHS.record.maxProperties
|
|
186
|
+
];
|
|
187
|
+
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region src/spec/standard/definitions.ts
|
|
190
|
+
const STANDARD_SEMANTIC_DEFINITIONS = [
|
|
191
|
+
{
|
|
192
|
+
path: STANDARD_SEMANTIC_PATHS.string.date,
|
|
193
|
+
label: "Date",
|
|
194
|
+
description: "Calendar date string in YYYY-MM-DD form.",
|
|
195
|
+
primitive: "string",
|
|
196
|
+
role: "validation"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
path: STANDARD_SEMANTIC_PATHS.string.datetime,
|
|
200
|
+
label: "DateTime",
|
|
201
|
+
description: "Date-time string.",
|
|
202
|
+
primitive: "string",
|
|
203
|
+
role: "validation"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
path: STANDARD_SEMANTIC_PATHS.string.datetimeIso,
|
|
207
|
+
label: "ISO DateTime",
|
|
208
|
+
description: "ISO-like date-time string.",
|
|
209
|
+
primitive: "string",
|
|
210
|
+
role: "validation"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
path: STANDARD_SEMANTIC_PATHS.string.email,
|
|
214
|
+
label: "Email",
|
|
215
|
+
description: "Email address string.",
|
|
216
|
+
primitive: "string",
|
|
217
|
+
role: "validation"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
path: STANDARD_SEMANTIC_PATHS.string.url,
|
|
221
|
+
label: "URL",
|
|
222
|
+
description: "URL string.",
|
|
223
|
+
primitive: "string",
|
|
224
|
+
role: "validation"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
path: STANDARD_SEMANTIC_PATHS.string.ipV4,
|
|
228
|
+
label: "IPv4",
|
|
229
|
+
description: "IPv4 address string.",
|
|
230
|
+
primitive: "string",
|
|
231
|
+
role: "validation"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
path: STANDARD_SEMANTIC_PATHS.string.ipV6,
|
|
235
|
+
label: "IPv6",
|
|
236
|
+
description: "IPv6 address string.",
|
|
237
|
+
primitive: "string",
|
|
238
|
+
role: "validation"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
path: STANDARD_SEMANTIC_PATHS.string.uuid,
|
|
242
|
+
label: "UUID",
|
|
243
|
+
description: "UUID string.",
|
|
244
|
+
primitive: "string",
|
|
245
|
+
role: "validation"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
path: STANDARD_SEMANTIC_PATHS.string.uuidV4,
|
|
249
|
+
label: "UUID v4",
|
|
250
|
+
description: "UUID version 4 string.",
|
|
251
|
+
primitive: "string",
|
|
252
|
+
role: "validation"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
path: STANDARD_SEMANTIC_PATHS.string.json,
|
|
256
|
+
label: "JSON String",
|
|
257
|
+
description: "String containing JSON text.",
|
|
258
|
+
primitive: "string",
|
|
259
|
+
role: "validation"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
path: STANDARD_SEMANTIC_PATHS.string.base64,
|
|
263
|
+
label: "Base64",
|
|
264
|
+
description: "Base64 encoded string.",
|
|
265
|
+
primitive: "string",
|
|
266
|
+
role: "validation"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
path: STANDARD_SEMANTIC_PATHS.string.base64url,
|
|
270
|
+
label: "Base64URL",
|
|
271
|
+
description: "Base64URL encoded string.",
|
|
272
|
+
primitive: "string",
|
|
273
|
+
role: "validation"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
path: STANDARD_SEMANTIC_PATHS.string.hex,
|
|
277
|
+
label: "Hex",
|
|
278
|
+
description: "Hexadecimal string.",
|
|
279
|
+
primitive: "string",
|
|
280
|
+
role: "validation"
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
path: STANDARD_SEMANTIC_PATHS.string.decimal,
|
|
284
|
+
label: "Decimal",
|
|
285
|
+
description: "Exact finite decimal value stored as text.",
|
|
286
|
+
primitive: "string",
|
|
287
|
+
role: "validation"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
path: STANDARD_SEMANTIC_PATHS.string.bigint,
|
|
291
|
+
label: "Big Integer",
|
|
292
|
+
description: "Canonical arbitrary-precision integer stored as text.",
|
|
293
|
+
primitive: "string",
|
|
294
|
+
role: "validation"
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
path: STANDARD_SEMANTIC_PATHS.string.secret,
|
|
298
|
+
label: "Secret",
|
|
299
|
+
description: "Sensitive secret-like string value.",
|
|
300
|
+
primitive: "string",
|
|
301
|
+
role: "annotation"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
path: STANDARD_SEMANTIC_PATHS.string.token,
|
|
305
|
+
label: "Token",
|
|
306
|
+
description: "Sensitive token-like string value.",
|
|
307
|
+
primitive: "string",
|
|
308
|
+
role: "annotation"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
path: STANDARD_SEMANTIC_PATHS.string.password,
|
|
312
|
+
label: "Password",
|
|
313
|
+
description: "Sensitive password-like string value.",
|
|
314
|
+
primitive: "string",
|
|
315
|
+
role: "annotation"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
path: STANDARD_SEMANTIC_PATHS.number.integer,
|
|
319
|
+
label: "Integer",
|
|
320
|
+
description: "Whole number.",
|
|
321
|
+
primitive: "number",
|
|
322
|
+
role: "validation"
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
path: STANDARD_SEMANTIC_PATHS.number.safeInteger,
|
|
326
|
+
label: "Safe Integer",
|
|
327
|
+
description: "Binary64 integer from -9007199254740991 through 9007199254740991.",
|
|
328
|
+
primitive: "number",
|
|
329
|
+
role: "validation"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
path: STANDARD_SEMANTIC_PATHS.number.epochMillis,
|
|
333
|
+
label: "Epoch Millis",
|
|
334
|
+
description: "Unix timestamp in milliseconds.",
|
|
335
|
+
primitive: "number",
|
|
336
|
+
role: "validation"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
path: STANDARD_SEMANTIC_PATHS.number.epochSeconds,
|
|
340
|
+
label: "Epoch Seconds",
|
|
341
|
+
description: "Unix timestamp in seconds.",
|
|
342
|
+
primitive: "number",
|
|
343
|
+
role: "validation"
|
|
344
|
+
}
|
|
345
|
+
];
|
|
346
|
+
/** Explicit accepted-set implications; carrier types are not semantic paths. */
|
|
347
|
+
const STANDARD_SEMANTIC_RELATIONS = [
|
|
348
|
+
{
|
|
349
|
+
source: STANDARD_SEMANTIC_PATHS.string.datetimeIso,
|
|
350
|
+
target: STANDARD_SEMANTIC_PATHS.string.datetime,
|
|
351
|
+
kind: "acceptedSetSubset"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
source: STANDARD_SEMANTIC_PATHS.string.uuidV4,
|
|
355
|
+
target: STANDARD_SEMANTIC_PATHS.string.uuid,
|
|
356
|
+
kind: "acceptedSetSubset"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
source: STANDARD_SEMANTIC_PATHS.number.safeInteger,
|
|
360
|
+
target: STANDARD_SEMANTIC_PATHS.number.integer,
|
|
361
|
+
kind: "acceptedSetSubset"
|
|
362
|
+
}
|
|
363
|
+
];
|
|
364
|
+
const STANDARD_CONSTRAINT_DEFINITIONS = [
|
|
365
|
+
{
|
|
366
|
+
path: STANDARD_CONSTRAINT_PATHS.string.minLength,
|
|
367
|
+
label: "Min Length",
|
|
368
|
+
description: "Minimum string length.",
|
|
369
|
+
target: "string",
|
|
370
|
+
argsType: "number",
|
|
371
|
+
argsDomain: "nonNegativeInteger"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
path: STANDARD_CONSTRAINT_PATHS.string.maxLength,
|
|
375
|
+
label: "Max Length",
|
|
376
|
+
description: "Maximum string length.",
|
|
377
|
+
target: "string",
|
|
378
|
+
argsType: "number",
|
|
379
|
+
argsDomain: "nonNegativeInteger"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
path: STANDARD_CONSTRAINT_PATHS.string.pattern,
|
|
383
|
+
label: "Pattern",
|
|
384
|
+
description: "Regular expression pattern.",
|
|
385
|
+
target: "string",
|
|
386
|
+
argsType: "string",
|
|
387
|
+
argsDomain: "regexSource"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
path: STANDARD_CONSTRAINT_PATHS.number.minimum,
|
|
391
|
+
label: "Minimum",
|
|
392
|
+
description: "Inclusive numeric minimum.",
|
|
393
|
+
target: "number",
|
|
394
|
+
argsType: "number",
|
|
395
|
+
argsDomain: "finiteNumber"
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
path: STANDARD_CONSTRAINT_PATHS.number.maximum,
|
|
399
|
+
label: "Maximum",
|
|
400
|
+
description: "Inclusive numeric maximum.",
|
|
401
|
+
target: "number",
|
|
402
|
+
argsType: "number",
|
|
403
|
+
argsDomain: "finiteNumber"
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
path: STANDARD_CONSTRAINT_PATHS.number.exclusiveMinimum,
|
|
407
|
+
label: "Exclusive Minimum",
|
|
408
|
+
description: "Exclusive numeric minimum.",
|
|
409
|
+
target: "number",
|
|
410
|
+
argsType: "number",
|
|
411
|
+
argsDomain: "finiteNumber"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
path: STANDARD_CONSTRAINT_PATHS.number.exclusiveMaximum,
|
|
415
|
+
label: "Exclusive Maximum",
|
|
416
|
+
description: "Exclusive numeric maximum.",
|
|
417
|
+
target: "number",
|
|
418
|
+
argsType: "number",
|
|
419
|
+
argsDomain: "finiteNumber"
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
path: STANDARD_CONSTRAINT_PATHS.number.multipleOf,
|
|
423
|
+
label: "Multiple Of",
|
|
424
|
+
description: "Numeric divisor constraint.",
|
|
425
|
+
target: "number",
|
|
426
|
+
argsType: "number",
|
|
427
|
+
argsDomain: "positiveNumber"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
path: STANDARD_CONSTRAINT_PATHS.array.minItems,
|
|
431
|
+
label: "Min Items",
|
|
432
|
+
description: "Minimum array length.",
|
|
433
|
+
target: "array",
|
|
434
|
+
argsType: "number",
|
|
435
|
+
argsDomain: "nonNegativeInteger"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
path: STANDARD_CONSTRAINT_PATHS.array.maxItems,
|
|
439
|
+
label: "Max Items",
|
|
440
|
+
description: "Maximum array length.",
|
|
441
|
+
target: "array",
|
|
442
|
+
argsType: "number",
|
|
443
|
+
argsDomain: "nonNegativeInteger"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
path: STANDARD_CONSTRAINT_PATHS.array.uniqueItems,
|
|
447
|
+
label: "Unique Items",
|
|
448
|
+
description: "Require array items to be unique.",
|
|
449
|
+
target: "array",
|
|
450
|
+
argsType: "boolean",
|
|
451
|
+
argsDomain: "boolean"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
path: STANDARD_CONSTRAINT_PATHS.record.minProperties,
|
|
455
|
+
label: "Min Properties",
|
|
456
|
+
description: "Minimum object property count.",
|
|
457
|
+
target: "record",
|
|
458
|
+
argsType: "number",
|
|
459
|
+
argsDomain: "nonNegativeInteger"
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
path: STANDARD_CONSTRAINT_PATHS.record.maxProperties,
|
|
463
|
+
label: "Max Properties",
|
|
464
|
+
description: "Maximum object property count.",
|
|
465
|
+
target: "record",
|
|
466
|
+
argsType: "number",
|
|
467
|
+
argsDomain: "nonNegativeInteger"
|
|
468
|
+
}
|
|
469
|
+
];
|
|
470
|
+
|
|
471
|
+
//#endregion
|
|
472
|
+
Object.defineProperty(exports, 'STANDARD_CONSTRAINT_DEFINITIONS', {
|
|
473
|
+
enumerable: true,
|
|
474
|
+
get: function () {
|
|
475
|
+
return STANDARD_CONSTRAINT_DEFINITIONS;
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
Object.defineProperty(exports, 'STANDARD_CONSTRAINT_PATHS', {
|
|
479
|
+
enumerable: true,
|
|
480
|
+
get: function () {
|
|
481
|
+
return STANDARD_CONSTRAINT_PATHS;
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
Object.defineProperty(exports, 'STANDARD_CONSTRAINT_PATH_LIST', {
|
|
485
|
+
enumerable: true,
|
|
486
|
+
get: function () {
|
|
487
|
+
return STANDARD_CONSTRAINT_PATH_LIST;
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
Object.defineProperty(exports, 'STANDARD_SEMANTIC_DEFINITIONS', {
|
|
491
|
+
enumerable: true,
|
|
492
|
+
get: function () {
|
|
493
|
+
return STANDARD_SEMANTIC_DEFINITIONS;
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
Object.defineProperty(exports, 'STANDARD_SEMANTIC_PATHS', {
|
|
497
|
+
enumerable: true,
|
|
498
|
+
get: function () {
|
|
499
|
+
return STANDARD_SEMANTIC_PATHS;
|
|
500
|
+
}
|
|
501
|
+
});
|
|
502
|
+
Object.defineProperty(exports, 'STANDARD_SEMANTIC_PATH_LIST', {
|
|
503
|
+
enumerable: true,
|
|
504
|
+
get: function () {
|
|
505
|
+
return STANDARD_SEMANTIC_PATH_LIST;
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
Object.defineProperty(exports, 'STANDARD_SEMANTIC_RELATIONS', {
|
|
509
|
+
enumerable: true,
|
|
510
|
+
get: function () {
|
|
511
|
+
return STANDARD_SEMANTIC_RELATIONS;
|
|
512
|
+
}
|
|
513
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const require_type_interpreter = require('../type-interpreter-
|
|
1
|
+
const require_type_interpreter = require('../type-interpreter-OLt2W2yd.cjs');
|
|
2
2
|
|
|
3
3
|
exports.checkTypeTermRelation = require_type_interpreter.checkTypeTermRelation;
|
|
4
4
|
exports.checkTypeTermRelationAsync = require_type_interpreter.checkTypeTermRelationAsync;
|
|
5
5
|
exports.evaluateExpression = require_type_interpreter.evaluateExpression;
|
|
6
6
|
exports.evaluateExpressionAsync = require_type_interpreter.evaluateExpressionAsync;
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
7
|
+
exports.evaluateSchemaTypeTerm = require_type_interpreter.evaluateSchemaTypeTerm;
|
|
8
|
+
exports.evaluateSchemaTypeTermAsync = require_type_interpreter.evaluateSchemaTypeTermAsync;
|
|
9
9
|
exports.solveTypeVariables = require_type_interpreter.solveTypeVariables;
|
|
10
10
|
exports.solveTypeVariablesAsync = require_type_interpreter.solveTypeVariablesAsync;
|
|
@@ -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 { C as evaluateExpression, E as evaluateSchemaTypeTermAsync, S as TypeInterpreterStatus, T as evaluateSchemaTypeTerm, _ as TypeInterpreterContext, a as TypeVariableSolverIssue, b as TypeInterpreterRefResolution, c as solveTypeVariablesAsync, d as TypeTermRelationContext, f as checkTypeTermRelation, g as EvaluatedTypeTerm, h as AsyncTypeInterpreterRefResolution, i as TypeVariableSolverInput, l as AsyncTypeTermRelationContext, m as AsyncTypeInterpreterContext, n as TypeVariableConstraint, o as TypeVariableSolverResult, p as checkTypeTermRelationAsync, r as TypeVariableSolverContext, s as solveTypeVariables, t as AsyncTypeVariableSolverContext, u as HostTypeRelationDecision, v as TypeInterpreterDiagnostic, w as evaluateExpressionAsync, x as TypeInterpreterResult, y as TypeInterpreterPath } from "../index-DhmHCGpT.cjs";
|
|
2
|
+
export { AsyncTypeInterpreterContext, AsyncTypeInterpreterRefResolution, AsyncTypeTermRelationContext, AsyncTypeVariableSolverContext, EvaluatedTypeTerm, HostTypeRelationDecision, TypeInterpreterContext, TypeInterpreterDiagnostic, TypeInterpreterPath, TypeInterpreterRefResolution, TypeInterpreterResult, TypeInterpreterStatus, TypeTermRelationContext, TypeVariableConstraint, TypeVariableSolverContext, TypeVariableSolverInput, TypeVariableSolverIssue, TypeVariableSolverResult, checkTypeTermRelation, checkTypeTermRelationAsync, evaluateExpression, evaluateExpressionAsync, evaluateSchemaTypeTerm, evaluateSchemaTypeTermAsync, solveTypeVariables, solveTypeVariablesAsync };
|