@cydm/pie 1.0.5 → 1.0.6
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 +11 -0
- package/dist/builtin/extensions/ask-user/index.js +11 -2911
- package/dist/builtin/extensions/changelog/index.js +3 -8
- package/dist/builtin/extensions/deploy/index.js +1 -1
- package/dist/builtin/extensions/document-attachments/index.js +1 -0
- package/dist/builtin/extensions/files/index.js +1 -1
- package/dist/builtin/extensions/init/index.js +1 -3
- package/dist/builtin/extensions/kimi-attachments/index.js +1 -0
- package/dist/builtin/extensions/plan-mode/index.js +30 -97
- package/dist/builtin/extensions/subagent/index.js +26 -10994
- package/dist/builtin/extensions/todo/index.js +11 -2719
- package/dist/chunks/capabilities-FENCOHVA.js +9 -0
- package/dist/chunks/chunk-JYBXCEJJ.js +315 -0
- package/dist/chunks/chunk-MWFBYJOI.js +7334 -0
- package/dist/{builtin/extensions/questionnaire/index.js → chunks/chunk-RID3574D.js} +1453 -1488
- package/dist/chunks/chunk-TBJ25UWB.js +3657 -0
- package/dist/chunks/chunk-TG2EQLX2.js +43 -0
- package/dist/chunks/chunk-XZXLO7YB.js +322 -0
- package/dist/chunks/file-logger-AL5VVZHH.js +22 -0
- package/dist/chunks/src-EGWRDMLB.js +13 -0
- package/dist/chunks/src-WRUACRN2.js +132 -0
- package/dist/cli.js +1108 -15659
- package/package.json +4 -5
|
@@ -1,126 +1,74 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
6
|
-
};
|
|
2
|
+
import {
|
|
3
|
+
__export
|
|
4
|
+
} from "./chunk-TG2EQLX2.js";
|
|
7
5
|
|
|
8
|
-
// ../../node_modules/@sinclair/typebox/build/esm/
|
|
9
|
-
var value_exports = {};
|
|
10
|
-
__export(value_exports, {
|
|
11
|
-
HasPropertyKey: () => HasPropertyKey,
|
|
12
|
-
IsArray: () => IsArray,
|
|
13
|
-
IsAsyncIterator: () => IsAsyncIterator,
|
|
14
|
-
IsBigInt: () => IsBigInt,
|
|
15
|
-
IsBoolean: () => IsBoolean,
|
|
16
|
-
IsDate: () => IsDate,
|
|
17
|
-
IsFunction: () => IsFunction,
|
|
18
|
-
IsIterator: () => IsIterator,
|
|
19
|
-
IsNull: () => IsNull,
|
|
20
|
-
IsNumber: () => IsNumber,
|
|
21
|
-
IsObject: () => IsObject,
|
|
22
|
-
IsRegExp: () => IsRegExp,
|
|
23
|
-
IsString: () => IsString,
|
|
24
|
-
IsSymbol: () => IsSymbol,
|
|
25
|
-
IsUint8Array: () => IsUint8Array,
|
|
26
|
-
IsUndefined: () => IsUndefined
|
|
27
|
-
});
|
|
28
|
-
function HasPropertyKey(value, key) {
|
|
29
|
-
return key in value;
|
|
30
|
-
}
|
|
6
|
+
// ../../node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs
|
|
31
7
|
function IsAsyncIterator(value) {
|
|
32
|
-
return IsObject(value) &&
|
|
33
|
-
}
|
|
34
|
-
function IsArray(value) {
|
|
35
|
-
return Array.isArray(value);
|
|
36
|
-
}
|
|
37
|
-
function IsBigInt(value) {
|
|
38
|
-
return typeof value === "bigint";
|
|
39
|
-
}
|
|
40
|
-
function IsBoolean(value) {
|
|
41
|
-
return typeof value === "boolean";
|
|
42
|
-
}
|
|
43
|
-
function IsDate(value) {
|
|
44
|
-
return value instanceof globalThis.Date;
|
|
45
|
-
}
|
|
46
|
-
function IsFunction(value) {
|
|
47
|
-
return typeof value === "function";
|
|
8
|
+
return IsObject(value) && globalThis.Symbol.asyncIterator in value;
|
|
48
9
|
}
|
|
49
10
|
function IsIterator(value) {
|
|
50
|
-
return IsObject(value) &&
|
|
11
|
+
return IsObject(value) && globalThis.Symbol.iterator in value;
|
|
51
12
|
}
|
|
52
|
-
function
|
|
53
|
-
return value === null;
|
|
13
|
+
function IsStandardObject(value) {
|
|
14
|
+
return IsObject(value) && (globalThis.Object.getPrototypeOf(value) === Object.prototype || globalThis.Object.getPrototypeOf(value) === null);
|
|
54
15
|
}
|
|
55
|
-
function
|
|
56
|
-
return
|
|
16
|
+
function IsPromise(value) {
|
|
17
|
+
return value instanceof globalThis.Promise;
|
|
57
18
|
}
|
|
58
|
-
function
|
|
59
|
-
return
|
|
19
|
+
function IsDate(value) {
|
|
20
|
+
return value instanceof Date && globalThis.Number.isFinite(value.getTime());
|
|
60
21
|
}
|
|
61
|
-
function
|
|
62
|
-
return value instanceof globalThis.
|
|
22
|
+
function IsMap(value) {
|
|
23
|
+
return value instanceof globalThis.Map;
|
|
63
24
|
}
|
|
64
|
-
function
|
|
65
|
-
return
|
|
25
|
+
function IsSet(value) {
|
|
26
|
+
return value instanceof globalThis.Set;
|
|
66
27
|
}
|
|
67
|
-
function
|
|
68
|
-
return
|
|
28
|
+
function IsTypedArray(value) {
|
|
29
|
+
return globalThis.ArrayBuffer.isView(value);
|
|
69
30
|
}
|
|
70
31
|
function IsUint8Array(value) {
|
|
71
32
|
return value instanceof globalThis.Uint8Array;
|
|
72
33
|
}
|
|
73
|
-
function
|
|
74
|
-
return
|
|
34
|
+
function HasPropertyKey(value, key) {
|
|
35
|
+
return key in value;
|
|
75
36
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
function ArrayType(value) {
|
|
79
|
-
return value.map((value2) => Visit(value2));
|
|
37
|
+
function IsObject(value) {
|
|
38
|
+
return value !== null && typeof value === "object";
|
|
80
39
|
}
|
|
81
|
-
function
|
|
82
|
-
return
|
|
40
|
+
function IsArray(value) {
|
|
41
|
+
return globalThis.Array.isArray(value) && !globalThis.ArrayBuffer.isView(value);
|
|
83
42
|
}
|
|
84
|
-
function
|
|
85
|
-
return
|
|
43
|
+
function IsUndefined(value) {
|
|
44
|
+
return value === void 0;
|
|
86
45
|
}
|
|
87
|
-
function
|
|
88
|
-
return
|
|
46
|
+
function IsNull(value) {
|
|
47
|
+
return value === null;
|
|
89
48
|
}
|
|
90
|
-
function
|
|
91
|
-
|
|
92
|
-
for (const key of Object.getOwnPropertyNames(value)) {
|
|
93
|
-
result[key] = Visit(value[key]);
|
|
94
|
-
}
|
|
95
|
-
for (const key of Object.getOwnPropertySymbols(value)) {
|
|
96
|
-
result[key] = Visit(value[key]);
|
|
97
|
-
}
|
|
98
|
-
return result;
|
|
49
|
+
function IsBoolean(value) {
|
|
50
|
+
return typeof value === "boolean";
|
|
99
51
|
}
|
|
100
|
-
function
|
|
101
|
-
return
|
|
52
|
+
function IsNumber(value) {
|
|
53
|
+
return typeof value === "number";
|
|
102
54
|
}
|
|
103
|
-
function
|
|
104
|
-
return
|
|
55
|
+
function IsInteger(value) {
|
|
56
|
+
return globalThis.Number.isInteger(value);
|
|
105
57
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
function CloneType(schema, options) {
|
|
109
|
-
return options === void 0 ? Clone(schema) : Clone({ ...options, ...schema });
|
|
58
|
+
function IsBigInt(value) {
|
|
59
|
+
return typeof value === "bigint";
|
|
110
60
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
function IsObject2(value) {
|
|
114
|
-
return value !== null && typeof value === "object";
|
|
61
|
+
function IsString(value) {
|
|
62
|
+
return typeof value === "string";
|
|
115
63
|
}
|
|
116
|
-
function
|
|
117
|
-
return
|
|
64
|
+
function IsFunction(value) {
|
|
65
|
+
return typeof value === "function";
|
|
118
66
|
}
|
|
119
|
-
function
|
|
120
|
-
return value ===
|
|
67
|
+
function IsSymbol(value) {
|
|
68
|
+
return typeof value === "symbol";
|
|
121
69
|
}
|
|
122
|
-
function
|
|
123
|
-
return
|
|
70
|
+
function IsValueType(value) {
|
|
71
|
+
return IsBigInt(value) || IsBoolean(value) || IsNull(value) || IsNumber(value) || IsString(value) || IsSymbol(value) || IsUndefined(value);
|
|
124
72
|
}
|
|
125
73
|
|
|
126
74
|
// ../../node_modules/@sinclair/typebox/build/esm/system/policy.mjs
|
|
@@ -136,8 +84,8 @@ var TypeSystemPolicy;
|
|
|
136
84
|
}
|
|
137
85
|
TypeSystemPolicy2.IsExactOptionalProperty = IsExactOptionalProperty;
|
|
138
86
|
function IsObjectLike(value) {
|
|
139
|
-
const isObject =
|
|
140
|
-
return TypeSystemPolicy2.AllowArrayObject ? isObject : isObject && !
|
|
87
|
+
const isObject = IsObject(value);
|
|
88
|
+
return TypeSystemPolicy2.AllowArrayObject ? isObject : isObject && !IsArray(value);
|
|
141
89
|
}
|
|
142
90
|
TypeSystemPolicy2.IsObjectLike = IsObjectLike;
|
|
143
91
|
function IsRecordLike(value) {
|
|
@@ -145,16 +93,85 @@ var TypeSystemPolicy;
|
|
|
145
93
|
}
|
|
146
94
|
TypeSystemPolicy2.IsRecordLike = IsRecordLike;
|
|
147
95
|
function IsNumberLike(value) {
|
|
148
|
-
return TypeSystemPolicy2.AllowNaN ?
|
|
96
|
+
return TypeSystemPolicy2.AllowNaN ? IsNumber(value) : Number.isFinite(value);
|
|
149
97
|
}
|
|
150
98
|
TypeSystemPolicy2.IsNumberLike = IsNumberLike;
|
|
151
99
|
function IsVoidLike(value) {
|
|
152
|
-
const isUndefined =
|
|
100
|
+
const isUndefined = IsUndefined(value);
|
|
153
101
|
return TypeSystemPolicy2.AllowNullVoid ? isUndefined || value === null : isUndefined;
|
|
154
102
|
}
|
|
155
103
|
TypeSystemPolicy2.IsVoidLike = IsVoidLike;
|
|
156
104
|
})(TypeSystemPolicy || (TypeSystemPolicy = {}));
|
|
157
105
|
|
|
106
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
107
|
+
var value_exports = {};
|
|
108
|
+
__export(value_exports, {
|
|
109
|
+
HasPropertyKey: () => HasPropertyKey2,
|
|
110
|
+
IsArray: () => IsArray2,
|
|
111
|
+
IsAsyncIterator: () => IsAsyncIterator2,
|
|
112
|
+
IsBigInt: () => IsBigInt2,
|
|
113
|
+
IsBoolean: () => IsBoolean2,
|
|
114
|
+
IsDate: () => IsDate2,
|
|
115
|
+
IsFunction: () => IsFunction2,
|
|
116
|
+
IsIterator: () => IsIterator2,
|
|
117
|
+
IsNull: () => IsNull2,
|
|
118
|
+
IsNumber: () => IsNumber2,
|
|
119
|
+
IsObject: () => IsObject2,
|
|
120
|
+
IsRegExp: () => IsRegExp,
|
|
121
|
+
IsString: () => IsString2,
|
|
122
|
+
IsSymbol: () => IsSymbol2,
|
|
123
|
+
IsUint8Array: () => IsUint8Array2,
|
|
124
|
+
IsUndefined: () => IsUndefined2
|
|
125
|
+
});
|
|
126
|
+
function HasPropertyKey2(value, key) {
|
|
127
|
+
return key in value;
|
|
128
|
+
}
|
|
129
|
+
function IsAsyncIterator2(value) {
|
|
130
|
+
return IsObject2(value) && !IsArray2(value) && !IsUint8Array2(value) && Symbol.asyncIterator in value;
|
|
131
|
+
}
|
|
132
|
+
function IsArray2(value) {
|
|
133
|
+
return Array.isArray(value);
|
|
134
|
+
}
|
|
135
|
+
function IsBigInt2(value) {
|
|
136
|
+
return typeof value === "bigint";
|
|
137
|
+
}
|
|
138
|
+
function IsBoolean2(value) {
|
|
139
|
+
return typeof value === "boolean";
|
|
140
|
+
}
|
|
141
|
+
function IsDate2(value) {
|
|
142
|
+
return value instanceof globalThis.Date;
|
|
143
|
+
}
|
|
144
|
+
function IsFunction2(value) {
|
|
145
|
+
return typeof value === "function";
|
|
146
|
+
}
|
|
147
|
+
function IsIterator2(value) {
|
|
148
|
+
return IsObject2(value) && !IsArray2(value) && !IsUint8Array2(value) && Symbol.iterator in value;
|
|
149
|
+
}
|
|
150
|
+
function IsNull2(value) {
|
|
151
|
+
return value === null;
|
|
152
|
+
}
|
|
153
|
+
function IsNumber2(value) {
|
|
154
|
+
return typeof value === "number";
|
|
155
|
+
}
|
|
156
|
+
function IsObject2(value) {
|
|
157
|
+
return typeof value === "object" && value !== null;
|
|
158
|
+
}
|
|
159
|
+
function IsRegExp(value) {
|
|
160
|
+
return value instanceof globalThis.RegExp;
|
|
161
|
+
}
|
|
162
|
+
function IsString2(value) {
|
|
163
|
+
return typeof value === "string";
|
|
164
|
+
}
|
|
165
|
+
function IsSymbol2(value) {
|
|
166
|
+
return typeof value === "symbol";
|
|
167
|
+
}
|
|
168
|
+
function IsUint8Array2(value) {
|
|
169
|
+
return value instanceof globalThis.Uint8Array;
|
|
170
|
+
}
|
|
171
|
+
function IsUndefined2(value) {
|
|
172
|
+
return value === void 0;
|
|
173
|
+
}
|
|
174
|
+
|
|
158
175
|
// ../../node_modules/@sinclair/typebox/build/esm/type/create/immutable.mjs
|
|
159
176
|
function ImmutableArray(value) {
|
|
160
177
|
return globalThis.Object.freeze(value).map((value2) => Immutable(value2));
|
|
@@ -179,7 +196,37 @@ function ImmutableObject(value) {
|
|
|
179
196
|
return globalThis.Object.freeze(result);
|
|
180
197
|
}
|
|
181
198
|
function Immutable(value) {
|
|
182
|
-
return
|
|
199
|
+
return IsArray2(value) ? ImmutableArray(value) : IsDate2(value) ? ImmutableDate(value) : IsUint8Array2(value) ? ImmutableUint8Array(value) : IsRegExp(value) ? ImmutableRegExp(value) : IsObject2(value) ? ImmutableObject(value) : value;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/clone/value.mjs
|
|
203
|
+
function ArrayType(value) {
|
|
204
|
+
return value.map((value2) => Visit(value2));
|
|
205
|
+
}
|
|
206
|
+
function DateType(value) {
|
|
207
|
+
return new Date(value.getTime());
|
|
208
|
+
}
|
|
209
|
+
function Uint8ArrayType(value) {
|
|
210
|
+
return new Uint8Array(value);
|
|
211
|
+
}
|
|
212
|
+
function RegExpType(value) {
|
|
213
|
+
return new RegExp(value.source, value.flags);
|
|
214
|
+
}
|
|
215
|
+
function ObjectType(value) {
|
|
216
|
+
const result = {};
|
|
217
|
+
for (const key of Object.getOwnPropertyNames(value)) {
|
|
218
|
+
result[key] = Visit(value[key]);
|
|
219
|
+
}
|
|
220
|
+
for (const key of Object.getOwnPropertySymbols(value)) {
|
|
221
|
+
result[key] = Visit(value[key]);
|
|
222
|
+
}
|
|
223
|
+
return result;
|
|
224
|
+
}
|
|
225
|
+
function Visit(value) {
|
|
226
|
+
return IsArray2(value) ? ArrayType(value) : IsDate2(value) ? DateType(value) : IsUint8Array2(value) ? Uint8ArrayType(value) : IsRegExp(value) ? RegExpType(value) : IsObject2(value) ? ObjectType(value) : value;
|
|
227
|
+
}
|
|
228
|
+
function Clone(value) {
|
|
229
|
+
return Visit(value);
|
|
183
230
|
}
|
|
184
231
|
|
|
185
232
|
// ../../node_modules/@sinclair/typebox/build/esm/type/create/type.mjs
|
|
@@ -195,6 +242,65 @@ function CreateType(schema, options) {
|
|
|
195
242
|
}
|
|
196
243
|
}
|
|
197
244
|
|
|
245
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.mjs
|
|
246
|
+
var TransformKind = Symbol.for("TypeBox.Transform");
|
|
247
|
+
var ReadonlyKind = Symbol.for("TypeBox.Readonly");
|
|
248
|
+
var OptionalKind = Symbol.for("TypeBox.Optional");
|
|
249
|
+
var Hint = Symbol.for("TypeBox.Hint");
|
|
250
|
+
var Kind = Symbol.for("TypeBox.Kind");
|
|
251
|
+
|
|
252
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/any/any.mjs
|
|
253
|
+
function Any(options) {
|
|
254
|
+
return CreateType({ [Kind]: "Any" }, options);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/array/array.mjs
|
|
258
|
+
function Array2(items, options) {
|
|
259
|
+
return CreateType({ [Kind]: "Array", type: "array", items }, options);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs
|
|
263
|
+
function Boolean(options) {
|
|
264
|
+
return CreateType({ [Kind]: "Boolean", type: "boolean" }, options);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs
|
|
268
|
+
function DiscardKey(value, key) {
|
|
269
|
+
const { [key]: _, ...rest } = value;
|
|
270
|
+
return rest;
|
|
271
|
+
}
|
|
272
|
+
function Discard(value, keys) {
|
|
273
|
+
return keys.reduce((acc, key) => DiscardKey(acc, key), value);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/never/never.mjs
|
|
277
|
+
function Never(options) {
|
|
278
|
+
return CreateType({ [Kind]: "Never", not: {} }, options);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs
|
|
282
|
+
function MappedResult(properties) {
|
|
283
|
+
return CreateType({
|
|
284
|
+
[Kind]: "MappedResult",
|
|
285
|
+
properties
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs
|
|
290
|
+
function AsyncIterator(items, options) {
|
|
291
|
+
return CreateType({ [Kind]: "AsyncIterator", type: "AsyncIterator", items }, options);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs
|
|
295
|
+
function Constructor(parameters, returns, options) {
|
|
296
|
+
return CreateType({ [Kind]: "Constructor", type: "Constructor", parameters, returns }, options);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/function/function.mjs
|
|
300
|
+
function Function(parameters, returns, options) {
|
|
301
|
+
return CreateType({ [Kind]: "Function", type: "Function", parameters, returns }, options);
|
|
302
|
+
}
|
|
303
|
+
|
|
198
304
|
// ../../node_modules/@sinclair/typebox/build/esm/type/error/error.mjs
|
|
199
305
|
var TypeBoxError = class extends Error {
|
|
200
306
|
constructor(message) {
|
|
@@ -202,19 +308,22 @@ var TypeBoxError = class extends Error {
|
|
|
202
308
|
}
|
|
203
309
|
};
|
|
204
310
|
|
|
205
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
311
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/computed/computed.mjs
|
|
312
|
+
function Computed(target, parameters, options) {
|
|
313
|
+
return CreateType({ [Kind]: "Computed", target, parameters }, options);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs
|
|
317
|
+
function UnionCreate(T, options) {
|
|
318
|
+
return CreateType({ [Kind]: "Union", anyOf: T }, options);
|
|
319
|
+
}
|
|
211
320
|
|
|
212
321
|
// ../../node_modules/@sinclair/typebox/build/esm/type/guard/kind.mjs
|
|
213
322
|
function IsReadonly(value) {
|
|
214
|
-
return
|
|
323
|
+
return IsObject2(value) && value[ReadonlyKind] === "Readonly";
|
|
215
324
|
}
|
|
216
325
|
function IsOptional(value) {
|
|
217
|
-
return
|
|
326
|
+
return IsObject2(value) && value[OptionalKind] === "Optional";
|
|
218
327
|
}
|
|
219
328
|
function IsAny(value) {
|
|
220
329
|
return IsKindOf(value, "Any");
|
|
@@ -225,13 +334,13 @@ function IsArgument(value) {
|
|
|
225
334
|
function IsArray3(value) {
|
|
226
335
|
return IsKindOf(value, "Array");
|
|
227
336
|
}
|
|
228
|
-
function
|
|
337
|
+
function IsAsyncIterator3(value) {
|
|
229
338
|
return IsKindOf(value, "AsyncIterator");
|
|
230
339
|
}
|
|
231
|
-
function
|
|
340
|
+
function IsBigInt3(value) {
|
|
232
341
|
return IsKindOf(value, "BigInt");
|
|
233
342
|
}
|
|
234
|
-
function
|
|
343
|
+
function IsBoolean3(value) {
|
|
235
344
|
return IsKindOf(value, "Boolean");
|
|
236
345
|
}
|
|
237
346
|
function IsComputed(value) {
|
|
@@ -240,26 +349,26 @@ function IsComputed(value) {
|
|
|
240
349
|
function IsConstructor(value) {
|
|
241
350
|
return IsKindOf(value, "Constructor");
|
|
242
351
|
}
|
|
243
|
-
function
|
|
352
|
+
function IsDate3(value) {
|
|
244
353
|
return IsKindOf(value, "Date");
|
|
245
354
|
}
|
|
246
|
-
function
|
|
355
|
+
function IsFunction3(value) {
|
|
247
356
|
return IsKindOf(value, "Function");
|
|
248
357
|
}
|
|
249
|
-
function
|
|
358
|
+
function IsInteger2(value) {
|
|
250
359
|
return IsKindOf(value, "Integer");
|
|
251
360
|
}
|
|
252
361
|
function IsIntersect(value) {
|
|
253
362
|
return IsKindOf(value, "Intersect");
|
|
254
363
|
}
|
|
255
|
-
function
|
|
364
|
+
function IsIterator3(value) {
|
|
256
365
|
return IsKindOf(value, "Iterator");
|
|
257
366
|
}
|
|
258
367
|
function IsKindOf(value, kind) {
|
|
259
|
-
return
|
|
368
|
+
return IsObject2(value) && Kind in value && value[Kind] === kind;
|
|
260
369
|
}
|
|
261
370
|
function IsLiteralValue(value) {
|
|
262
|
-
return
|
|
371
|
+
return IsBoolean2(value) || IsNumber2(value) || IsString2(value);
|
|
263
372
|
}
|
|
264
373
|
function IsLiteral(value) {
|
|
265
374
|
return IsKindOf(value, "Literal");
|
|
@@ -276,7 +385,7 @@ function IsNever(value) {
|
|
|
276
385
|
function IsNot(value) {
|
|
277
386
|
return IsKindOf(value, "Not");
|
|
278
387
|
}
|
|
279
|
-
function
|
|
388
|
+
function IsNull3(value) {
|
|
280
389
|
return IsKindOf(value, "Null");
|
|
281
390
|
}
|
|
282
391
|
function IsNumber3(value) {
|
|
@@ -285,7 +394,7 @@ function IsNumber3(value) {
|
|
|
285
394
|
function IsObject3(value) {
|
|
286
395
|
return IsKindOf(value, "Object");
|
|
287
396
|
}
|
|
288
|
-
function
|
|
397
|
+
function IsPromise2(value) {
|
|
289
398
|
return IsKindOf(value, "Promise");
|
|
290
399
|
}
|
|
291
400
|
function IsRecord(value) {
|
|
@@ -297,10 +406,10 @@ function IsRef(value) {
|
|
|
297
406
|
function IsRegExp2(value) {
|
|
298
407
|
return IsKindOf(value, "RegExp");
|
|
299
408
|
}
|
|
300
|
-
function
|
|
409
|
+
function IsString3(value) {
|
|
301
410
|
return IsKindOf(value, "String");
|
|
302
411
|
}
|
|
303
|
-
function
|
|
412
|
+
function IsSymbol3(value) {
|
|
304
413
|
return IsKindOf(value, "Symbol");
|
|
305
414
|
}
|
|
306
415
|
function IsTemplateLiteral(value) {
|
|
@@ -310,7 +419,7 @@ function IsThis(value) {
|
|
|
310
419
|
return IsKindOf(value, "This");
|
|
311
420
|
}
|
|
312
421
|
function IsTransform(value) {
|
|
313
|
-
return
|
|
422
|
+
return IsObject2(value) && TransformKind in value;
|
|
314
423
|
}
|
|
315
424
|
function IsTuple(value) {
|
|
316
425
|
return IsKindOf(value, "Tuple");
|
|
@@ -321,7 +430,7 @@ function IsUndefined3(value) {
|
|
|
321
430
|
function IsUnion(value) {
|
|
322
431
|
return IsKindOf(value, "Union");
|
|
323
432
|
}
|
|
324
|
-
function
|
|
433
|
+
function IsUint8Array3(value) {
|
|
325
434
|
return IsKindOf(value, "Uint8Array");
|
|
326
435
|
}
|
|
327
436
|
function IsUnknown(value) {
|
|
@@ -334,302 +443,272 @@ function IsVoid(value) {
|
|
|
334
443
|
return IsKindOf(value, "Void");
|
|
335
444
|
}
|
|
336
445
|
function IsKind(value) {
|
|
337
|
-
return
|
|
446
|
+
return IsObject2(value) && Kind in value && IsString2(value[Kind]);
|
|
338
447
|
}
|
|
339
448
|
function IsSchema(value) {
|
|
340
|
-
return IsAny(value) || IsArgument(value) || IsArray3(value) ||
|
|
449
|
+
return IsAny(value) || IsArgument(value) || IsArray3(value) || IsBoolean3(value) || IsBigInt3(value) || IsAsyncIterator3(value) || IsComputed(value) || IsConstructor(value) || IsDate3(value) || IsFunction3(value) || IsInteger2(value) || IsIntersect(value) || IsIterator3(value) || IsLiteral(value) || IsMappedKey(value) || IsMappedResult(value) || IsNever(value) || IsNot(value) || IsNull3(value) || IsNumber3(value) || IsObject3(value) || IsPromise2(value) || IsRecord(value) || IsRef(value) || IsRegExp2(value) || IsString3(value) || IsSymbol3(value) || IsTemplateLiteral(value) || IsThis(value) || IsTuple(value) || IsUndefined3(value) || IsUnion(value) || IsUint8Array3(value) || IsUnknown(value) || IsUnsafe(value) || IsVoid(value) || IsKind(value);
|
|
341
450
|
}
|
|
342
451
|
|
|
343
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
IsAny: () => IsAny2,
|
|
347
|
-
IsArgument: () => IsArgument2,
|
|
348
|
-
IsArray: () => IsArray4,
|
|
349
|
-
IsAsyncIterator: () => IsAsyncIterator3,
|
|
350
|
-
IsBigInt: () => IsBigInt3,
|
|
351
|
-
IsBoolean: () => IsBoolean3,
|
|
352
|
-
IsComputed: () => IsComputed2,
|
|
353
|
-
IsConstructor: () => IsConstructor2,
|
|
354
|
-
IsDate: () => IsDate3,
|
|
355
|
-
IsFunction: () => IsFunction3,
|
|
356
|
-
IsImport: () => IsImport,
|
|
357
|
-
IsInteger: () => IsInteger2,
|
|
358
|
-
IsIntersect: () => IsIntersect2,
|
|
359
|
-
IsIterator: () => IsIterator3,
|
|
360
|
-
IsKind: () => IsKind2,
|
|
361
|
-
IsKindOf: () => IsKindOf2,
|
|
362
|
-
IsLiteral: () => IsLiteral2,
|
|
363
|
-
IsLiteralBoolean: () => IsLiteralBoolean,
|
|
364
|
-
IsLiteralNumber: () => IsLiteralNumber,
|
|
365
|
-
IsLiteralString: () => IsLiteralString,
|
|
366
|
-
IsLiteralValue: () => IsLiteralValue2,
|
|
367
|
-
IsMappedKey: () => IsMappedKey2,
|
|
368
|
-
IsMappedResult: () => IsMappedResult2,
|
|
369
|
-
IsNever: () => IsNever2,
|
|
370
|
-
IsNot: () => IsNot2,
|
|
371
|
-
IsNull: () => IsNull3,
|
|
372
|
-
IsNumber: () => IsNumber4,
|
|
373
|
-
IsObject: () => IsObject4,
|
|
374
|
-
IsOptional: () => IsOptional2,
|
|
375
|
-
IsPromise: () => IsPromise2,
|
|
376
|
-
IsProperties: () => IsProperties,
|
|
377
|
-
IsReadonly: () => IsReadonly2,
|
|
378
|
-
IsRecord: () => IsRecord2,
|
|
379
|
-
IsRecursive: () => IsRecursive,
|
|
380
|
-
IsRef: () => IsRef2,
|
|
381
|
-
IsRegExp: () => IsRegExp3,
|
|
382
|
-
IsSchema: () => IsSchema2,
|
|
383
|
-
IsString: () => IsString3,
|
|
384
|
-
IsSymbol: () => IsSymbol3,
|
|
385
|
-
IsTemplateLiteral: () => IsTemplateLiteral2,
|
|
386
|
-
IsThis: () => IsThis2,
|
|
387
|
-
IsTransform: () => IsTransform2,
|
|
388
|
-
IsTuple: () => IsTuple2,
|
|
389
|
-
IsUint8Array: () => IsUint8Array3,
|
|
390
|
-
IsUndefined: () => IsUndefined4,
|
|
391
|
-
IsUnion: () => IsUnion2,
|
|
392
|
-
IsUnionLiteral: () => IsUnionLiteral,
|
|
393
|
-
IsUnknown: () => IsUnknown2,
|
|
394
|
-
IsUnsafe: () => IsUnsafe2,
|
|
395
|
-
IsVoid: () => IsVoid2,
|
|
396
|
-
TypeGuardUnknownTypeError: () => TypeGuardUnknownTypeError
|
|
397
|
-
});
|
|
398
|
-
var TypeGuardUnknownTypeError = class extends TypeBoxError {
|
|
399
|
-
};
|
|
400
|
-
var KnownTypes = [
|
|
401
|
-
"Argument",
|
|
402
|
-
"Any",
|
|
403
|
-
"Array",
|
|
404
|
-
"AsyncIterator",
|
|
405
|
-
"BigInt",
|
|
406
|
-
"Boolean",
|
|
407
|
-
"Computed",
|
|
408
|
-
"Constructor",
|
|
409
|
-
"Date",
|
|
410
|
-
"Enum",
|
|
411
|
-
"Function",
|
|
412
|
-
"Integer",
|
|
413
|
-
"Intersect",
|
|
414
|
-
"Iterator",
|
|
415
|
-
"Literal",
|
|
416
|
-
"MappedKey",
|
|
417
|
-
"MappedResult",
|
|
418
|
-
"Not",
|
|
419
|
-
"Null",
|
|
420
|
-
"Number",
|
|
421
|
-
"Object",
|
|
422
|
-
"Promise",
|
|
423
|
-
"Record",
|
|
424
|
-
"Ref",
|
|
425
|
-
"RegExp",
|
|
426
|
-
"String",
|
|
427
|
-
"Symbol",
|
|
428
|
-
"TemplateLiteral",
|
|
429
|
-
"This",
|
|
430
|
-
"Tuple",
|
|
431
|
-
"Undefined",
|
|
432
|
-
"Union",
|
|
433
|
-
"Uint8Array",
|
|
434
|
-
"Unknown",
|
|
435
|
-
"Void"
|
|
436
|
-
];
|
|
437
|
-
function IsPattern(value) {
|
|
438
|
-
try {
|
|
439
|
-
new RegExp(value);
|
|
440
|
-
return true;
|
|
441
|
-
} catch {
|
|
442
|
-
return false;
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
function IsControlCharacterFree(value) {
|
|
446
|
-
if (!IsString(value))
|
|
447
|
-
return false;
|
|
448
|
-
for (let i = 0; i < value.length; i++) {
|
|
449
|
-
const code = value.charCodeAt(i);
|
|
450
|
-
if (code >= 7 && code <= 13 || code === 27 || code === 127) {
|
|
451
|
-
return false;
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
return true;
|
|
455
|
-
}
|
|
456
|
-
function IsAdditionalProperties(value) {
|
|
457
|
-
return IsOptionalBoolean(value) || IsSchema2(value);
|
|
458
|
-
}
|
|
459
|
-
function IsOptionalBigInt(value) {
|
|
460
|
-
return IsUndefined(value) || IsBigInt(value);
|
|
461
|
-
}
|
|
462
|
-
function IsOptionalNumber(value) {
|
|
463
|
-
return IsUndefined(value) || IsNumber(value);
|
|
464
|
-
}
|
|
465
|
-
function IsOptionalBoolean(value) {
|
|
466
|
-
return IsUndefined(value) || IsBoolean(value);
|
|
467
|
-
}
|
|
468
|
-
function IsOptionalString(value) {
|
|
469
|
-
return IsUndefined(value) || IsString(value);
|
|
470
|
-
}
|
|
471
|
-
function IsOptionalPattern(value) {
|
|
472
|
-
return IsUndefined(value) || IsString(value) && IsControlCharacterFree(value) && IsPattern(value);
|
|
473
|
-
}
|
|
474
|
-
function IsOptionalFormat(value) {
|
|
475
|
-
return IsUndefined(value) || IsString(value) && IsControlCharacterFree(value);
|
|
476
|
-
}
|
|
477
|
-
function IsOptionalSchema(value) {
|
|
478
|
-
return IsUndefined(value) || IsSchema2(value);
|
|
479
|
-
}
|
|
480
|
-
function IsReadonly2(value) {
|
|
481
|
-
return IsObject(value) && value[ReadonlyKind] === "Readonly";
|
|
482
|
-
}
|
|
483
|
-
function IsOptional2(value) {
|
|
484
|
-
return IsObject(value) && value[OptionalKind] === "Optional";
|
|
485
|
-
}
|
|
486
|
-
function IsAny2(value) {
|
|
487
|
-
return IsKindOf2(value, "Any") && IsOptionalString(value.$id);
|
|
488
|
-
}
|
|
489
|
-
function IsArgument2(value) {
|
|
490
|
-
return IsKindOf2(value, "Argument") && IsNumber(value.index);
|
|
491
|
-
}
|
|
492
|
-
function IsArray4(value) {
|
|
493
|
-
return IsKindOf2(value, "Array") && value.type === "array" && IsOptionalString(value.$id) && IsSchema2(value.items) && IsOptionalNumber(value.minItems) && IsOptionalNumber(value.maxItems) && IsOptionalBoolean(value.uniqueItems) && IsOptionalSchema(value.contains) && IsOptionalNumber(value.minContains) && IsOptionalNumber(value.maxContains);
|
|
452
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs
|
|
453
|
+
function IsUnionOptional(types) {
|
|
454
|
+
return types.some((type) => IsOptional(type));
|
|
494
455
|
}
|
|
495
|
-
function
|
|
496
|
-
return
|
|
456
|
+
function RemoveOptionalFromRest(types) {
|
|
457
|
+
return types.map((left) => IsOptional(left) ? RemoveOptionalFromType(left) : left);
|
|
497
458
|
}
|
|
498
|
-
function
|
|
499
|
-
return
|
|
459
|
+
function RemoveOptionalFromType(T) {
|
|
460
|
+
return Discard(T, [OptionalKind]);
|
|
500
461
|
}
|
|
501
|
-
function
|
|
502
|
-
|
|
462
|
+
function ResolveUnion(types, options) {
|
|
463
|
+
const isOptional = IsUnionOptional(types);
|
|
464
|
+
return isOptional ? Optional(UnionCreate(RemoveOptionalFromRest(types), options)) : UnionCreate(RemoveOptionalFromRest(types), options);
|
|
503
465
|
}
|
|
504
|
-
function
|
|
505
|
-
return
|
|
466
|
+
function UnionEvaluated(T, options) {
|
|
467
|
+
return T.length === 1 ? CreateType(T[0], options) : T.length === 0 ? Never(options) : ResolveUnion(T, options);
|
|
506
468
|
}
|
|
507
|
-
|
|
508
|
-
|
|
469
|
+
|
|
470
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/union/union.mjs
|
|
471
|
+
function Union(types, options) {
|
|
472
|
+
return types.length === 0 ? Never(options) : types.length === 1 ? CreateType(types[0], options) : UnionCreate(types, options);
|
|
509
473
|
}
|
|
510
|
-
|
|
511
|
-
|
|
474
|
+
|
|
475
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs
|
|
476
|
+
var TemplateLiteralParserError = class extends TypeBoxError {
|
|
477
|
+
};
|
|
478
|
+
function Unescape(pattern) {
|
|
479
|
+
return pattern.replace(/\\\$/g, "$").replace(/\\\*/g, "*").replace(/\\\^/g, "^").replace(/\\\|/g, "|").replace(/\\\(/g, "(").replace(/\\\)/g, ")");
|
|
512
480
|
}
|
|
513
|
-
function
|
|
514
|
-
return
|
|
481
|
+
function IsNonEscaped(pattern, index, char) {
|
|
482
|
+
return pattern[index] === char && pattern.charCodeAt(index - 1) !== 92;
|
|
515
483
|
}
|
|
516
|
-
function
|
|
517
|
-
return
|
|
484
|
+
function IsOpenParen(pattern, index) {
|
|
485
|
+
return IsNonEscaped(pattern, index, "(");
|
|
518
486
|
}
|
|
519
|
-
function
|
|
520
|
-
return
|
|
487
|
+
function IsCloseParen(pattern, index) {
|
|
488
|
+
return IsNonEscaped(pattern, index, ")");
|
|
521
489
|
}
|
|
522
|
-
function
|
|
523
|
-
return
|
|
490
|
+
function IsSeparator(pattern, index) {
|
|
491
|
+
return IsNonEscaped(pattern, index, "|");
|
|
524
492
|
}
|
|
525
|
-
function
|
|
526
|
-
|
|
493
|
+
function IsGroup(pattern) {
|
|
494
|
+
if (!(IsOpenParen(pattern, 0) && IsCloseParen(pattern, pattern.length - 1)))
|
|
495
|
+
return false;
|
|
496
|
+
let count = 0;
|
|
497
|
+
for (let index = 0; index < pattern.length; index++) {
|
|
498
|
+
if (IsOpenParen(pattern, index))
|
|
499
|
+
count += 1;
|
|
500
|
+
if (IsCloseParen(pattern, index))
|
|
501
|
+
count -= 1;
|
|
502
|
+
if (count === 0 && index !== pattern.length - 1)
|
|
503
|
+
return false;
|
|
504
|
+
}
|
|
505
|
+
return true;
|
|
527
506
|
}
|
|
528
|
-
function
|
|
529
|
-
return
|
|
507
|
+
function InGroup(pattern) {
|
|
508
|
+
return pattern.slice(1, pattern.length - 1);
|
|
530
509
|
}
|
|
531
|
-
function
|
|
532
|
-
|
|
510
|
+
function IsPrecedenceOr(pattern) {
|
|
511
|
+
let count = 0;
|
|
512
|
+
for (let index = 0; index < pattern.length; index++) {
|
|
513
|
+
if (IsOpenParen(pattern, index))
|
|
514
|
+
count += 1;
|
|
515
|
+
if (IsCloseParen(pattern, index))
|
|
516
|
+
count -= 1;
|
|
517
|
+
if (IsSeparator(pattern, index) && count === 0)
|
|
518
|
+
return true;
|
|
519
|
+
}
|
|
520
|
+
return false;
|
|
533
521
|
}
|
|
534
|
-
function
|
|
535
|
-
|
|
522
|
+
function IsPrecedenceAnd(pattern) {
|
|
523
|
+
for (let index = 0; index < pattern.length; index++) {
|
|
524
|
+
if (IsOpenParen(pattern, index))
|
|
525
|
+
return true;
|
|
526
|
+
}
|
|
527
|
+
return false;
|
|
536
528
|
}
|
|
537
|
-
function
|
|
538
|
-
|
|
529
|
+
function Or(pattern) {
|
|
530
|
+
let [count, start] = [0, 0];
|
|
531
|
+
const expressions = [];
|
|
532
|
+
for (let index = 0; index < pattern.length; index++) {
|
|
533
|
+
if (IsOpenParen(pattern, index))
|
|
534
|
+
count += 1;
|
|
535
|
+
if (IsCloseParen(pattern, index))
|
|
536
|
+
count -= 1;
|
|
537
|
+
if (IsSeparator(pattern, index) && count === 0) {
|
|
538
|
+
const range2 = pattern.slice(start, index);
|
|
539
|
+
if (range2.length > 0)
|
|
540
|
+
expressions.push(TemplateLiteralParse(range2));
|
|
541
|
+
start = index + 1;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
const range = pattern.slice(start);
|
|
545
|
+
if (range.length > 0)
|
|
546
|
+
expressions.push(TemplateLiteralParse(range));
|
|
547
|
+
if (expressions.length === 0)
|
|
548
|
+
return { type: "const", const: "" };
|
|
549
|
+
if (expressions.length === 1)
|
|
550
|
+
return expressions[0];
|
|
551
|
+
return { type: "or", expr: expressions };
|
|
539
552
|
}
|
|
540
|
-
function
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
}
|
|
555
|
-
function
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
553
|
+
function And(pattern) {
|
|
554
|
+
function Group(value, index) {
|
|
555
|
+
if (!IsOpenParen(value, index))
|
|
556
|
+
throw new TemplateLiteralParserError(`TemplateLiteralParser: Index must point to open parens`);
|
|
557
|
+
let count = 0;
|
|
558
|
+
for (let scan = index; scan < value.length; scan++) {
|
|
559
|
+
if (IsOpenParen(value, scan))
|
|
560
|
+
count += 1;
|
|
561
|
+
if (IsCloseParen(value, scan))
|
|
562
|
+
count -= 1;
|
|
563
|
+
if (count === 0)
|
|
564
|
+
return [index, scan];
|
|
565
|
+
}
|
|
566
|
+
throw new TemplateLiteralParserError(`TemplateLiteralParser: Unclosed group parens in expression`);
|
|
567
|
+
}
|
|
568
|
+
function Range(pattern2, index) {
|
|
569
|
+
for (let scan = index; scan < pattern2.length; scan++) {
|
|
570
|
+
if (IsOpenParen(pattern2, scan))
|
|
571
|
+
return [index, scan];
|
|
572
|
+
}
|
|
573
|
+
return [index, pattern2.length];
|
|
574
|
+
}
|
|
575
|
+
const expressions = [];
|
|
576
|
+
for (let index = 0; index < pattern.length; index++) {
|
|
577
|
+
if (IsOpenParen(pattern, index)) {
|
|
578
|
+
const [start, end] = Group(pattern, index);
|
|
579
|
+
const range = pattern.slice(start, end + 1);
|
|
580
|
+
expressions.push(TemplateLiteralParse(range));
|
|
581
|
+
index = end;
|
|
582
|
+
} else {
|
|
583
|
+
const [start, end] = Range(pattern, index);
|
|
584
|
+
const range = pattern.slice(start, end);
|
|
585
|
+
if (range.length > 0)
|
|
586
|
+
expressions.push(TemplateLiteralParse(range));
|
|
587
|
+
index = end - 1;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
return expressions.length === 0 ? { type: "const", const: "" } : expressions.length === 1 ? expressions[0] : { type: "and", expr: expressions };
|
|
566
591
|
}
|
|
567
|
-
function
|
|
568
|
-
return
|
|
592
|
+
function TemplateLiteralParse(pattern) {
|
|
593
|
+
return IsGroup(pattern) ? TemplateLiteralParse(InGroup(pattern)) : IsPrecedenceOr(pattern) ? Or(pattern) : IsPrecedenceAnd(pattern) ? And(pattern) : { type: "const", const: Unescape(pattern) };
|
|
569
594
|
}
|
|
570
|
-
function
|
|
571
|
-
return
|
|
595
|
+
function TemplateLiteralParseExact(pattern) {
|
|
596
|
+
return TemplateLiteralParse(pattern.slice(1, pattern.length - 1));
|
|
572
597
|
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
598
|
+
|
|
599
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.mjs
|
|
600
|
+
var TemplateLiteralFiniteError = class extends TypeBoxError {
|
|
601
|
+
};
|
|
602
|
+
function IsNumberExpression(expression) {
|
|
603
|
+
return expression.type === "or" && expression.expr.length === 2 && expression.expr[0].type === "const" && expression.expr[0].const === "0" && expression.expr[1].type === "const" && expression.expr[1].const === "[1-9][0-9]*";
|
|
578
604
|
}
|
|
579
|
-
function
|
|
580
|
-
return
|
|
605
|
+
function IsBooleanExpression(expression) {
|
|
606
|
+
return expression.type === "or" && expression.expr.length === 2 && expression.expr[0].type === "const" && expression.expr[0].const === "true" && expression.expr[1].type === "const" && expression.expr[1].const === "false";
|
|
581
607
|
}
|
|
582
|
-
function
|
|
583
|
-
return
|
|
608
|
+
function IsStringExpression(expression) {
|
|
609
|
+
return expression.type === "const" && expression.const === ".*";
|
|
584
610
|
}
|
|
585
|
-
function
|
|
586
|
-
return
|
|
611
|
+
function IsTemplateLiteralExpressionFinite(expression) {
|
|
612
|
+
return IsNumberExpression(expression) || IsStringExpression(expression) ? false : IsBooleanExpression(expression) ? true : expression.type === "and" ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : expression.type === "or" ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : expression.type === "const" ? true : (() => {
|
|
613
|
+
throw new TemplateLiteralFiniteError(`Unknown expression type`);
|
|
614
|
+
})();
|
|
587
615
|
}
|
|
588
|
-
function
|
|
589
|
-
|
|
616
|
+
function IsTemplateLiteralFinite(schema) {
|
|
617
|
+
const expression = TemplateLiteralParseExact(schema.pattern);
|
|
618
|
+
return IsTemplateLiteralExpressionFinite(expression);
|
|
590
619
|
}
|
|
591
|
-
|
|
592
|
-
|
|
620
|
+
|
|
621
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.mjs
|
|
622
|
+
var TemplateLiteralGenerateError = class extends TypeBoxError {
|
|
623
|
+
};
|
|
624
|
+
function* GenerateReduce(buffer) {
|
|
625
|
+
if (buffer.length === 1)
|
|
626
|
+
return yield* buffer[0];
|
|
627
|
+
for (const left of buffer[0]) {
|
|
628
|
+
for (const right of GenerateReduce(buffer.slice(1))) {
|
|
629
|
+
yield `${left}${right}`;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
593
632
|
}
|
|
594
|
-
function
|
|
595
|
-
return
|
|
633
|
+
function* GenerateAnd(expression) {
|
|
634
|
+
return yield* GenerateReduce(expression.expr.map((expr) => [...TemplateLiteralExpressionGenerate(expr)]));
|
|
596
635
|
}
|
|
597
|
-
function
|
|
598
|
-
|
|
636
|
+
function* GenerateOr(expression) {
|
|
637
|
+
for (const expr of expression.expr)
|
|
638
|
+
yield* TemplateLiteralExpressionGenerate(expr);
|
|
599
639
|
}
|
|
600
|
-
function
|
|
601
|
-
return
|
|
640
|
+
function* GenerateConst(expression) {
|
|
641
|
+
return yield expression.const;
|
|
602
642
|
}
|
|
603
|
-
function
|
|
604
|
-
return
|
|
605
|
-
|
|
643
|
+
function* TemplateLiteralExpressionGenerate(expression) {
|
|
644
|
+
return expression.type === "and" ? yield* GenerateAnd(expression) : expression.type === "or" ? yield* GenerateOr(expression) : expression.type === "const" ? yield* GenerateConst(expression) : (() => {
|
|
645
|
+
throw new TemplateLiteralGenerateError("Unknown expression");
|
|
646
|
+
})();
|
|
606
647
|
}
|
|
607
|
-
function
|
|
608
|
-
|
|
648
|
+
function TemplateLiteralGenerate(schema) {
|
|
649
|
+
const expression = TemplateLiteralParseExact(schema.pattern);
|
|
650
|
+
return IsTemplateLiteralExpressionFinite(expression) ? [...TemplateLiteralExpressionGenerate(expression)] : [];
|
|
609
651
|
}
|
|
610
|
-
|
|
611
|
-
|
|
652
|
+
|
|
653
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs
|
|
654
|
+
function Literal(value, options) {
|
|
655
|
+
return CreateType({
|
|
656
|
+
[Kind]: "Literal",
|
|
657
|
+
const: value,
|
|
658
|
+
type: typeof value
|
|
659
|
+
}, options);
|
|
612
660
|
}
|
|
613
|
-
|
|
614
|
-
|
|
661
|
+
|
|
662
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs
|
|
663
|
+
function BigInt(options) {
|
|
664
|
+
return CreateType({ [Kind]: "BigInt", type: "bigint" }, options);
|
|
615
665
|
}
|
|
616
|
-
|
|
617
|
-
|
|
666
|
+
|
|
667
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/number/number.mjs
|
|
668
|
+
function Number2(options) {
|
|
669
|
+
return CreateType({ [Kind]: "Number", type: "number" }, options);
|
|
618
670
|
}
|
|
619
|
-
|
|
620
|
-
|
|
671
|
+
|
|
672
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/string/string.mjs
|
|
673
|
+
function String(options) {
|
|
674
|
+
return CreateType({ [Kind]: "String", type: "string" }, options);
|
|
621
675
|
}
|
|
622
|
-
|
|
623
|
-
|
|
676
|
+
|
|
677
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs
|
|
678
|
+
function* FromUnion(syntax) {
|
|
679
|
+
const trim = syntax.trim().replace(/"|'/g, "");
|
|
680
|
+
return trim === "boolean" ? yield Boolean() : trim === "number" ? yield Number2() : trim === "bigint" ? yield BigInt() : trim === "string" ? yield String() : yield (() => {
|
|
681
|
+
const literals = trim.split("|").map((literal) => Literal(literal.trim()));
|
|
682
|
+
return literals.length === 0 ? Never() : literals.length === 1 ? literals[0] : UnionEvaluated(literals);
|
|
683
|
+
})();
|
|
624
684
|
}
|
|
625
|
-
function
|
|
626
|
-
|
|
685
|
+
function* FromTerminal(syntax) {
|
|
686
|
+
if (syntax[1] !== "{") {
|
|
687
|
+
const L = Literal("$");
|
|
688
|
+
const R = FromSyntax(syntax.slice(1));
|
|
689
|
+
return yield* [L, ...R];
|
|
690
|
+
}
|
|
691
|
+
for (let i = 2; i < syntax.length; i++) {
|
|
692
|
+
if (syntax[i] === "}") {
|
|
693
|
+
const L = FromUnion(syntax.slice(2, i));
|
|
694
|
+
const R = FromSyntax(syntax.slice(i + 1));
|
|
695
|
+
return yield* [...L, ...R];
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
yield Literal(syntax);
|
|
627
699
|
}
|
|
628
|
-
function
|
|
629
|
-
|
|
700
|
+
function* FromSyntax(syntax) {
|
|
701
|
+
for (let i = 0; i < syntax.length; i++) {
|
|
702
|
+
if (syntax[i] === "$") {
|
|
703
|
+
const L = Literal(syntax.slice(0, i));
|
|
704
|
+
const R = FromTerminal(syntax.slice(i));
|
|
705
|
+
return yield* [L, ...R];
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
yield Literal(syntax);
|
|
630
709
|
}
|
|
631
|
-
function
|
|
632
|
-
return
|
|
710
|
+
function TemplateLiteralSyntax(syntax) {
|
|
711
|
+
return [...FromSyntax(syntax)];
|
|
633
712
|
}
|
|
634
713
|
|
|
635
714
|
// ../../node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs
|
|
@@ -642,867 +721,809 @@ var PatternNumberExact = `^${PatternNumber}$`;
|
|
|
642
721
|
var PatternStringExact = `^${PatternString}$`;
|
|
643
722
|
var PatternNeverExact = `^${PatternNever}$`;
|
|
644
723
|
|
|
645
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
return [...new Set(T)];
|
|
651
|
-
}
|
|
652
|
-
function SetIntersect(T, S) {
|
|
653
|
-
return T.filter((L) => S.includes(L));
|
|
654
|
-
}
|
|
655
|
-
function SetIntersectManyResolve(T, Init) {
|
|
656
|
-
return T.reduce((Acc, L) => {
|
|
657
|
-
return SetIntersect(Acc, L);
|
|
658
|
-
}, Init);
|
|
724
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.mjs
|
|
725
|
+
var TemplateLiteralPatternError = class extends TypeBoxError {
|
|
726
|
+
};
|
|
727
|
+
function Escape(value) {
|
|
728
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
659
729
|
}
|
|
660
|
-
function
|
|
661
|
-
return
|
|
730
|
+
function Visit2(schema, acc) {
|
|
731
|
+
return IsTemplateLiteral(schema) ? schema.pattern.slice(1, schema.pattern.length - 1) : IsUnion(schema) ? `(${schema.anyOf.map((schema2) => Visit2(schema2, acc)).join("|")})` : IsNumber3(schema) ? `${acc}${PatternNumber}` : IsInteger2(schema) ? `${acc}${PatternNumber}` : IsBigInt3(schema) ? `${acc}${PatternNumber}` : IsString3(schema) ? `${acc}${PatternString}` : IsLiteral(schema) ? `${acc}${Escape(schema.const.toString())}` : IsBoolean3(schema) ? `${acc}${PatternBoolean}` : (() => {
|
|
732
|
+
throw new TemplateLiteralPatternError(`Unexpected Kind '${schema[Kind]}'`);
|
|
733
|
+
})();
|
|
662
734
|
}
|
|
663
|
-
function
|
|
664
|
-
|
|
665
|
-
for (const L of T)
|
|
666
|
-
Acc.push(...L);
|
|
667
|
-
return Acc;
|
|
735
|
+
function TemplateLiteralPattern(kinds) {
|
|
736
|
+
return `^${kinds.map((schema) => Visit2(schema, "")).join("")}$`;
|
|
668
737
|
}
|
|
669
738
|
|
|
670
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
671
|
-
function
|
|
672
|
-
|
|
739
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/union.mjs
|
|
740
|
+
function TemplateLiteralToUnion(schema) {
|
|
741
|
+
const R = TemplateLiteralGenerate(schema);
|
|
742
|
+
const L = R.map((S) => Literal(S));
|
|
743
|
+
return UnionEvaluated(L);
|
|
673
744
|
}
|
|
674
745
|
|
|
675
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
676
|
-
function
|
|
677
|
-
|
|
746
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs
|
|
747
|
+
function TemplateLiteral(unresolved, options) {
|
|
748
|
+
const pattern = IsString2(unresolved) ? TemplateLiteralPattern(TemplateLiteralSyntax(unresolved)) : TemplateLiteralPattern(unresolved);
|
|
749
|
+
return CreateType({ [Kind]: "TemplateLiteral", type: "string", pattern }, options);
|
|
678
750
|
}
|
|
679
751
|
|
|
680
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
681
|
-
function
|
|
682
|
-
|
|
752
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs
|
|
753
|
+
function FromTemplateLiteral(templateLiteral) {
|
|
754
|
+
const keys = TemplateLiteralGenerate(templateLiteral);
|
|
755
|
+
return keys.map((key) => key.toString());
|
|
683
756
|
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
757
|
+
function FromUnion2(types) {
|
|
758
|
+
const result = [];
|
|
759
|
+
for (const type of types)
|
|
760
|
+
result.push(...IndexPropertyKeys(type));
|
|
761
|
+
return result;
|
|
688
762
|
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
763
|
+
function FromLiteral(literalValue) {
|
|
764
|
+
return [literalValue.toString()];
|
|
765
|
+
}
|
|
766
|
+
function IndexPropertyKeys(type) {
|
|
767
|
+
return [...new Set(IsTemplateLiteral(type) ? FromTemplateLiteral(type) : IsUnion(type) ? FromUnion2(type.anyOf) : IsLiteral(type) ? FromLiteral(type.const) : IsNumber3(type) ? ["[number]"] : IsInteger2(type) ? ["[number]"] : [])];
|
|
693
768
|
}
|
|
694
769
|
|
|
695
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
696
|
-
function
|
|
697
|
-
const
|
|
698
|
-
|
|
770
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs
|
|
771
|
+
function FromProperties(type, properties, options) {
|
|
772
|
+
const result = {};
|
|
773
|
+
for (const K2 of Object.getOwnPropertyNames(properties)) {
|
|
774
|
+
result[K2] = Index(type, IndexPropertyKeys(properties[K2]), options);
|
|
775
|
+
}
|
|
776
|
+
return result;
|
|
699
777
|
}
|
|
700
|
-
function
|
|
701
|
-
return
|
|
778
|
+
function FromMappedResult(type, mappedResult, options) {
|
|
779
|
+
return FromProperties(type, mappedResult.properties, options);
|
|
702
780
|
}
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
return CreateType({ [Kind]: "Never", not: {} }, options);
|
|
781
|
+
function IndexFromMappedResult(type, mappedResult, options) {
|
|
782
|
+
const properties = FromMappedResult(type, mappedResult, options);
|
|
783
|
+
return MappedResult(properties);
|
|
707
784
|
}
|
|
708
785
|
|
|
709
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
710
|
-
function
|
|
711
|
-
return
|
|
712
|
-
[Kind]: "MappedResult",
|
|
713
|
-
properties
|
|
714
|
-
});
|
|
786
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs
|
|
787
|
+
function FromRest(types, key) {
|
|
788
|
+
return types.map((type) => IndexFromPropertyKey(type, key));
|
|
715
789
|
}
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
function Constructor(parameters, returns, options) {
|
|
719
|
-
return CreateType({ [Kind]: "Constructor", type: "Constructor", parameters, returns }, options);
|
|
790
|
+
function FromIntersectRest(types) {
|
|
791
|
+
return types.filter((type) => !IsNever(type));
|
|
720
792
|
}
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
function Function(parameters, returns, options) {
|
|
724
|
-
return CreateType({ [Kind]: "Function", type: "Function", parameters, returns }, options);
|
|
793
|
+
function FromIntersect(types, key) {
|
|
794
|
+
return IntersectEvaluated(FromIntersectRest(FromRest(types, key)));
|
|
725
795
|
}
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
function UnionCreate(T, options) {
|
|
729
|
-
return CreateType({ [Kind]: "Union", anyOf: T }, options);
|
|
796
|
+
function FromUnionRest(types) {
|
|
797
|
+
return types.some((L) => IsNever(L)) ? [] : types;
|
|
730
798
|
}
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
function IsUnionOptional(types) {
|
|
734
|
-
return types.some((type) => IsOptional(type));
|
|
799
|
+
function FromUnion3(types, key) {
|
|
800
|
+
return UnionEvaluated(FromUnionRest(FromRest(types, key)));
|
|
735
801
|
}
|
|
736
|
-
function
|
|
737
|
-
return types
|
|
802
|
+
function FromTuple(types, key) {
|
|
803
|
+
return key in types ? types[key] : key === "[number]" ? UnionEvaluated(types) : Never();
|
|
738
804
|
}
|
|
739
|
-
function
|
|
740
|
-
return
|
|
805
|
+
function FromArray(type, key) {
|
|
806
|
+
return key === "[number]" ? type : Never();
|
|
741
807
|
}
|
|
742
|
-
function
|
|
743
|
-
|
|
744
|
-
return isOptional ? Optional(UnionCreate(RemoveOptionalFromRest(types), options)) : UnionCreate(RemoveOptionalFromRest(types), options);
|
|
808
|
+
function FromProperty(properties, propertyKey) {
|
|
809
|
+
return propertyKey in properties ? properties[propertyKey] : Never();
|
|
745
810
|
}
|
|
746
|
-
function
|
|
747
|
-
return
|
|
811
|
+
function IndexFromPropertyKey(type, propertyKey) {
|
|
812
|
+
return IsIntersect(type) ? FromIntersect(type.allOf, propertyKey) : IsUnion(type) ? FromUnion3(type.anyOf, propertyKey) : IsTuple(type) ? FromTuple(type.items ?? [], propertyKey) : IsArray3(type) ? FromArray(type.items, propertyKey) : IsObject3(type) ? FromProperty(type.properties, propertyKey) : Never();
|
|
748
813
|
}
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
814
|
+
function IndexFromPropertyKeys(type, propertyKeys) {
|
|
815
|
+
return propertyKeys.map((propertyKey) => IndexFromPropertyKey(type, propertyKey));
|
|
816
|
+
}
|
|
817
|
+
function FromSchema(type, propertyKeys) {
|
|
818
|
+
return UnionEvaluated(IndexFromPropertyKeys(type, propertyKeys));
|
|
819
|
+
}
|
|
820
|
+
function Index(type, key, options) {
|
|
821
|
+
if (IsRef(type) || IsRef(key)) {
|
|
822
|
+
const error = `Index types using Ref parameters require both Type and Key to be of TSchema`;
|
|
823
|
+
if (!IsSchema(type) || !IsSchema(key))
|
|
824
|
+
throw new TypeBoxError(error);
|
|
825
|
+
return Computed("Index", [type, key]);
|
|
826
|
+
}
|
|
827
|
+
if (IsMappedResult(key))
|
|
828
|
+
return IndexFromMappedResult(type, key, options);
|
|
829
|
+
if (IsMappedKey(key))
|
|
830
|
+
return IndexFromMappedKey(type, key, options);
|
|
831
|
+
return CreateType(IsSchema(key) ? FromSchema(type, IndexPropertyKeys(key)) : FromSchema(type, key), options);
|
|
753
832
|
}
|
|
754
833
|
|
|
755
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
756
|
-
|
|
757
|
-
};
|
|
758
|
-
function Unescape(pattern) {
|
|
759
|
-
return pattern.replace(/\\\$/g, "$").replace(/\\\*/g, "*").replace(/\\\^/g, "^").replace(/\\\|/g, "|").replace(/\\\(/g, "(").replace(/\\\)/g, ")");
|
|
834
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs
|
|
835
|
+
function MappedIndexPropertyKey(type, key, options) {
|
|
836
|
+
return { [key]: Index(type, [key], Clone(options)) };
|
|
760
837
|
}
|
|
761
|
-
function
|
|
762
|
-
return
|
|
838
|
+
function MappedIndexPropertyKeys(type, propertyKeys, options) {
|
|
839
|
+
return propertyKeys.reduce((result, left) => {
|
|
840
|
+
return { ...result, ...MappedIndexPropertyKey(type, left, options) };
|
|
841
|
+
}, {});
|
|
763
842
|
}
|
|
764
|
-
function
|
|
765
|
-
return
|
|
843
|
+
function MappedIndexProperties(type, mappedKey, options) {
|
|
844
|
+
return MappedIndexPropertyKeys(type, mappedKey.keys, options);
|
|
766
845
|
}
|
|
767
|
-
function
|
|
768
|
-
|
|
846
|
+
function IndexFromMappedKey(type, mappedKey, options) {
|
|
847
|
+
const properties = MappedIndexProperties(type, mappedKey, options);
|
|
848
|
+
return MappedResult(properties);
|
|
769
849
|
}
|
|
770
|
-
|
|
771
|
-
|
|
850
|
+
|
|
851
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs
|
|
852
|
+
function Iterator(items, options) {
|
|
853
|
+
return CreateType({ [Kind]: "Iterator", type: "Iterator", items }, options);
|
|
772
854
|
}
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
for (let index = 0; index < pattern.length; index++) {
|
|
778
|
-
if (IsOpenParen(pattern, index))
|
|
779
|
-
count += 1;
|
|
780
|
-
if (IsCloseParen(pattern, index))
|
|
781
|
-
count -= 1;
|
|
782
|
-
if (count === 0 && index !== pattern.length - 1)
|
|
783
|
-
return false;
|
|
784
|
-
}
|
|
785
|
-
return true;
|
|
855
|
+
|
|
856
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/object/object.mjs
|
|
857
|
+
function RequiredArray(properties) {
|
|
858
|
+
return globalThis.Object.keys(properties).filter((key) => !IsOptional(properties[key]));
|
|
786
859
|
}
|
|
787
|
-
function
|
|
788
|
-
|
|
860
|
+
function _Object(properties, options) {
|
|
861
|
+
const required = RequiredArray(properties);
|
|
862
|
+
const schema = required.length > 0 ? { [Kind]: "Object", type: "object", required, properties } : { [Kind]: "Object", type: "object", properties };
|
|
863
|
+
return CreateType(schema, options);
|
|
789
864
|
}
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
if (IsCloseParen(pattern, index))
|
|
796
|
-
count -= 1;
|
|
797
|
-
if (IsSeparator(pattern, index) && count === 0)
|
|
798
|
-
return true;
|
|
799
|
-
}
|
|
800
|
-
return false;
|
|
865
|
+
var Object2 = _Object;
|
|
866
|
+
|
|
867
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs
|
|
868
|
+
function Promise2(item, options) {
|
|
869
|
+
return CreateType({ [Kind]: "Promise", type: "Promise", item }, options);
|
|
801
870
|
}
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
}
|
|
807
|
-
return false;
|
|
871
|
+
|
|
872
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs
|
|
873
|
+
function RemoveReadonly(schema) {
|
|
874
|
+
return CreateType(Discard(schema, [ReadonlyKind]));
|
|
808
875
|
}
|
|
809
|
-
function
|
|
810
|
-
|
|
811
|
-
const expressions = [];
|
|
812
|
-
for (let index = 0; index < pattern.length; index++) {
|
|
813
|
-
if (IsOpenParen(pattern, index))
|
|
814
|
-
count += 1;
|
|
815
|
-
if (IsCloseParen(pattern, index))
|
|
816
|
-
count -= 1;
|
|
817
|
-
if (IsSeparator(pattern, index) && count === 0) {
|
|
818
|
-
const range2 = pattern.slice(start, index);
|
|
819
|
-
if (range2.length > 0)
|
|
820
|
-
expressions.push(TemplateLiteralParse(range2));
|
|
821
|
-
start = index + 1;
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
const range = pattern.slice(start);
|
|
825
|
-
if (range.length > 0)
|
|
826
|
-
expressions.push(TemplateLiteralParse(range));
|
|
827
|
-
if (expressions.length === 0)
|
|
828
|
-
return { type: "const", const: "" };
|
|
829
|
-
if (expressions.length === 1)
|
|
830
|
-
return expressions[0];
|
|
831
|
-
return { type: "or", expr: expressions };
|
|
876
|
+
function AddReadonly(schema) {
|
|
877
|
+
return CreateType({ ...schema, [ReadonlyKind]: "Readonly" });
|
|
832
878
|
}
|
|
833
|
-
function
|
|
834
|
-
|
|
835
|
-
if (!IsOpenParen(value, index))
|
|
836
|
-
throw new TemplateLiteralParserError(`TemplateLiteralParser: Index must point to open parens`);
|
|
837
|
-
let count = 0;
|
|
838
|
-
for (let scan = index; scan < value.length; scan++) {
|
|
839
|
-
if (IsOpenParen(value, scan))
|
|
840
|
-
count += 1;
|
|
841
|
-
if (IsCloseParen(value, scan))
|
|
842
|
-
count -= 1;
|
|
843
|
-
if (count === 0)
|
|
844
|
-
return [index, scan];
|
|
845
|
-
}
|
|
846
|
-
throw new TemplateLiteralParserError(`TemplateLiteralParser: Unclosed group parens in expression`);
|
|
847
|
-
}
|
|
848
|
-
function Range(pattern2, index) {
|
|
849
|
-
for (let scan = index; scan < pattern2.length; scan++) {
|
|
850
|
-
if (IsOpenParen(pattern2, scan))
|
|
851
|
-
return [index, scan];
|
|
852
|
-
}
|
|
853
|
-
return [index, pattern2.length];
|
|
854
|
-
}
|
|
855
|
-
const expressions = [];
|
|
856
|
-
for (let index = 0; index < pattern.length; index++) {
|
|
857
|
-
if (IsOpenParen(pattern, index)) {
|
|
858
|
-
const [start, end] = Group(pattern, index);
|
|
859
|
-
const range = pattern.slice(start, end + 1);
|
|
860
|
-
expressions.push(TemplateLiteralParse(range));
|
|
861
|
-
index = end;
|
|
862
|
-
} else {
|
|
863
|
-
const [start, end] = Range(pattern, index);
|
|
864
|
-
const range = pattern.slice(start, end);
|
|
865
|
-
if (range.length > 0)
|
|
866
|
-
expressions.push(TemplateLiteralParse(range));
|
|
867
|
-
index = end - 1;
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
return expressions.length === 0 ? { type: "const", const: "" } : expressions.length === 1 ? expressions[0] : { type: "and", expr: expressions };
|
|
879
|
+
function ReadonlyWithFlag(schema, F) {
|
|
880
|
+
return F === false ? RemoveReadonly(schema) : AddReadonly(schema);
|
|
871
881
|
}
|
|
872
|
-
function
|
|
873
|
-
|
|
882
|
+
function Readonly(schema, enable) {
|
|
883
|
+
const F = enable ?? true;
|
|
884
|
+
return IsMappedResult(schema) ? ReadonlyFromMappedResult(schema, F) : ReadonlyWithFlag(schema, F);
|
|
874
885
|
}
|
|
875
|
-
|
|
876
|
-
|
|
886
|
+
|
|
887
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.mjs
|
|
888
|
+
function FromProperties2(K, F) {
|
|
889
|
+
const Acc = {};
|
|
890
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(K))
|
|
891
|
+
Acc[K2] = Readonly(K[K2], F);
|
|
892
|
+
return Acc;
|
|
893
|
+
}
|
|
894
|
+
function FromMappedResult2(R, F) {
|
|
895
|
+
return FromProperties2(R.properties, F);
|
|
896
|
+
}
|
|
897
|
+
function ReadonlyFromMappedResult(R, F) {
|
|
898
|
+
const P = FromMappedResult2(R, F);
|
|
899
|
+
return MappedResult(P);
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs
|
|
903
|
+
function Tuple(types, options) {
|
|
904
|
+
return CreateType(types.length > 0 ? { [Kind]: "Tuple", type: "array", items: types, additionalItems: false, minItems: types.length, maxItems: types.length } : { [Kind]: "Tuple", type: "array", minItems: types.length, maxItems: types.length }, options);
|
|
877
905
|
}
|
|
878
906
|
|
|
879
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
function IsNumberExpression(expression) {
|
|
883
|
-
return expression.type === "or" && expression.expr.length === 2 && expression.expr[0].type === "const" && expression.expr[0].const === "0" && expression.expr[1].type === "const" && expression.expr[1].const === "[1-9][0-9]*";
|
|
907
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs
|
|
908
|
+
function SetIncludes(T, S) {
|
|
909
|
+
return T.includes(S);
|
|
884
910
|
}
|
|
885
|
-
function
|
|
886
|
-
return
|
|
911
|
+
function SetDistinct(T) {
|
|
912
|
+
return [...new Set(T)];
|
|
887
913
|
}
|
|
888
|
-
function
|
|
889
|
-
return
|
|
914
|
+
function SetIntersect(T, S) {
|
|
915
|
+
return T.filter((L) => S.includes(L));
|
|
890
916
|
}
|
|
891
|
-
function
|
|
892
|
-
return
|
|
893
|
-
|
|
894
|
-
})
|
|
917
|
+
function SetIntersectManyResolve(T, Init) {
|
|
918
|
+
return T.reduce((Acc, L) => {
|
|
919
|
+
return SetIntersect(Acc, L);
|
|
920
|
+
}, Init);
|
|
895
921
|
}
|
|
896
|
-
function
|
|
897
|
-
|
|
898
|
-
return IsTemplateLiteralExpressionFinite(expression);
|
|
922
|
+
function SetIntersectMany(T) {
|
|
923
|
+
return T.length === 1 ? T[0] : T.length > 1 ? SetIntersectManyResolve(T.slice(1), T[0]) : [];
|
|
899
924
|
}
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
if (buffer.length === 1)
|
|
906
|
-
return yield* buffer[0];
|
|
907
|
-
for (const left of buffer[0]) {
|
|
908
|
-
for (const right of GenerateReduce(buffer.slice(1))) {
|
|
909
|
-
yield `${left}${right}`;
|
|
910
|
-
}
|
|
911
|
-
}
|
|
925
|
+
function SetUnionMany(T) {
|
|
926
|
+
const Acc = [];
|
|
927
|
+
for (const L of T)
|
|
928
|
+
Acc.push(...L);
|
|
929
|
+
return Acc;
|
|
912
930
|
}
|
|
913
|
-
|
|
914
|
-
|
|
931
|
+
|
|
932
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs
|
|
933
|
+
function FromMappedResult3(K, P) {
|
|
934
|
+
return K in P ? FromSchemaType(K, P[K]) : MappedResult(P);
|
|
915
935
|
}
|
|
916
|
-
function
|
|
917
|
-
|
|
918
|
-
yield* TemplateLiteralExpressionGenerate(expr);
|
|
936
|
+
function MappedKeyToKnownMappedResultProperties(K) {
|
|
937
|
+
return { [K]: Literal(K) };
|
|
919
938
|
}
|
|
920
|
-
function
|
|
921
|
-
|
|
939
|
+
function MappedKeyToUnknownMappedResultProperties(P) {
|
|
940
|
+
const Acc = {};
|
|
941
|
+
for (const L of P)
|
|
942
|
+
Acc[L] = Literal(L);
|
|
943
|
+
return Acc;
|
|
922
944
|
}
|
|
923
|
-
function
|
|
924
|
-
return
|
|
925
|
-
throw new TemplateLiteralGenerateError("Unknown expression");
|
|
926
|
-
})();
|
|
945
|
+
function MappedKeyToMappedResultProperties(K, P) {
|
|
946
|
+
return SetIncludes(P, K) ? MappedKeyToKnownMappedResultProperties(K) : MappedKeyToUnknownMappedResultProperties(P);
|
|
927
947
|
}
|
|
928
|
-
function
|
|
929
|
-
const
|
|
930
|
-
return
|
|
948
|
+
function FromMappedKey(K, P) {
|
|
949
|
+
const R = MappedKeyToMappedResultProperties(K, P);
|
|
950
|
+
return FromMappedResult3(K, R);
|
|
931
951
|
}
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
function Literal(value, options) {
|
|
935
|
-
return CreateType({
|
|
936
|
-
[Kind]: "Literal",
|
|
937
|
-
const: value,
|
|
938
|
-
type: typeof value
|
|
939
|
-
}, options);
|
|
952
|
+
function FromRest2(K, T) {
|
|
953
|
+
return T.map((L) => FromSchemaType(K, L));
|
|
940
954
|
}
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
955
|
+
function FromProperties3(K, T) {
|
|
956
|
+
const Acc = {};
|
|
957
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(T))
|
|
958
|
+
Acc[K2] = FromSchemaType(K, T[K2]);
|
|
959
|
+
return Acc;
|
|
945
960
|
}
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
961
|
+
function FromSchemaType(K, T) {
|
|
962
|
+
const options = { ...T };
|
|
963
|
+
return (
|
|
964
|
+
// unevaluated modifier types
|
|
965
|
+
IsOptional(T) ? Optional(FromSchemaType(K, Discard(T, [OptionalKind]))) : IsReadonly(T) ? Readonly(FromSchemaType(K, Discard(T, [ReadonlyKind]))) : (
|
|
966
|
+
// unevaluated mapped types
|
|
967
|
+
IsMappedResult(T) ? FromMappedResult3(K, T.properties) : IsMappedKey(T) ? FromMappedKey(K, T.keys) : (
|
|
968
|
+
// unevaluated types
|
|
969
|
+
IsConstructor(T) ? Constructor(FromRest2(K, T.parameters), FromSchemaType(K, T.returns), options) : IsFunction3(T) ? Function(FromRest2(K, T.parameters), FromSchemaType(K, T.returns), options) : IsAsyncIterator3(T) ? AsyncIterator(FromSchemaType(K, T.items), options) : IsIterator3(T) ? Iterator(FromSchemaType(K, T.items), options) : IsIntersect(T) ? Intersect(FromRest2(K, T.allOf), options) : IsUnion(T) ? Union(FromRest2(K, T.anyOf), options) : IsTuple(T) ? Tuple(FromRest2(K, T.items ?? []), options) : IsObject3(T) ? Object2(FromProperties3(K, T.properties), options) : IsArray3(T) ? Array2(FromSchemaType(K, T.items), options) : IsPromise2(T) ? Promise2(FromSchemaType(K, T.item), options) : T
|
|
970
|
+
)
|
|
971
|
+
)
|
|
972
|
+
);
|
|
950
973
|
}
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
974
|
+
function MappedFunctionReturnType(K, T) {
|
|
975
|
+
const Acc = {};
|
|
976
|
+
for (const L of K)
|
|
977
|
+
Acc[L] = FromSchemaType(L, T);
|
|
978
|
+
return Acc;
|
|
955
979
|
}
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
980
|
+
function Mapped(key, map, options) {
|
|
981
|
+
const K = IsSchema(key) ? IndexPropertyKeys(key) : key;
|
|
982
|
+
const RT = map({ [Kind]: "MappedKey", keys: K });
|
|
983
|
+
const R = MappedFunctionReturnType(K, RT);
|
|
984
|
+
return Object2(R, options);
|
|
960
985
|
}
|
|
961
986
|
|
|
962
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
963
|
-
function
|
|
964
|
-
|
|
965
|
-
return trim === "boolean" ? yield Boolean() : trim === "number" ? yield Number2() : trim === "bigint" ? yield BigInt() : trim === "string" ? yield String2() : yield (() => {
|
|
966
|
-
const literals = trim.split("|").map((literal) => Literal(literal.trim()));
|
|
967
|
-
return literals.length === 0 ? Never() : literals.length === 1 ? literals[0] : UnionEvaluated(literals);
|
|
968
|
-
})();
|
|
987
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs
|
|
988
|
+
function RemoveOptional(schema) {
|
|
989
|
+
return CreateType(Discard(schema, [OptionalKind]));
|
|
969
990
|
}
|
|
970
|
-
function
|
|
971
|
-
|
|
972
|
-
const L = Literal("$");
|
|
973
|
-
const R = FromSyntax(syntax.slice(1));
|
|
974
|
-
return yield* [L, ...R];
|
|
975
|
-
}
|
|
976
|
-
for (let i = 2; i < syntax.length; i++) {
|
|
977
|
-
if (syntax[i] === "}") {
|
|
978
|
-
const L = FromUnion(syntax.slice(2, i));
|
|
979
|
-
const R = FromSyntax(syntax.slice(i + 1));
|
|
980
|
-
return yield* [...L, ...R];
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
yield Literal(syntax);
|
|
991
|
+
function AddOptional(schema) {
|
|
992
|
+
return CreateType({ ...schema, [OptionalKind]: "Optional" });
|
|
984
993
|
}
|
|
985
|
-
function
|
|
986
|
-
|
|
987
|
-
if (syntax[i] === "$") {
|
|
988
|
-
const L = Literal(syntax.slice(0, i));
|
|
989
|
-
const R = FromTerminal(syntax.slice(i));
|
|
990
|
-
return yield* [L, ...R];
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
yield Literal(syntax);
|
|
994
|
+
function OptionalWithFlag(schema, F) {
|
|
995
|
+
return F === false ? RemoveOptional(schema) : AddOptional(schema);
|
|
994
996
|
}
|
|
995
|
-
function
|
|
996
|
-
|
|
997
|
+
function Optional(schema, enable) {
|
|
998
|
+
const F = enable ?? true;
|
|
999
|
+
return IsMappedResult(schema) ? OptionalFromMappedResult(schema, F) : OptionalWithFlag(schema, F);
|
|
997
1000
|
}
|
|
998
1001
|
|
|
999
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
1000
|
-
|
|
1001
|
-
};
|
|
1002
|
-
|
|
1003
|
-
|
|
1002
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.mjs
|
|
1003
|
+
function FromProperties4(P, F) {
|
|
1004
|
+
const Acc = {};
|
|
1005
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
1006
|
+
Acc[K2] = Optional(P[K2], F);
|
|
1007
|
+
return Acc;
|
|
1004
1008
|
}
|
|
1005
|
-
function
|
|
1006
|
-
return
|
|
1007
|
-
throw new TemplateLiteralPatternError(`Unexpected Kind '${schema[Kind]}'`);
|
|
1008
|
-
})();
|
|
1009
|
+
function FromMappedResult4(R, F) {
|
|
1010
|
+
return FromProperties4(R.properties, F);
|
|
1009
1011
|
}
|
|
1010
|
-
function
|
|
1011
|
-
|
|
1012
|
+
function OptionalFromMappedResult(R, F) {
|
|
1013
|
+
const P = FromMappedResult4(R, F);
|
|
1014
|
+
return MappedResult(P);
|
|
1012
1015
|
}
|
|
1013
1016
|
|
|
1014
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
1015
|
-
function
|
|
1016
|
-
const
|
|
1017
|
-
const
|
|
1018
|
-
return
|
|
1017
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs
|
|
1018
|
+
function IntersectCreate(T, options = {}) {
|
|
1019
|
+
const allObjects = T.every((schema) => IsObject3(schema));
|
|
1020
|
+
const clonedUnevaluatedProperties = IsSchema(options.unevaluatedProperties) ? { unevaluatedProperties: options.unevaluatedProperties } : {};
|
|
1021
|
+
return CreateType(options.unevaluatedProperties === false || IsSchema(options.unevaluatedProperties) || allObjects ? { ...clonedUnevaluatedProperties, [Kind]: "Intersect", type: "object", allOf: T } : { ...clonedUnevaluatedProperties, [Kind]: "Intersect", allOf: T }, options);
|
|
1019
1022
|
}
|
|
1020
1023
|
|
|
1021
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
1022
|
-
function
|
|
1023
|
-
|
|
1024
|
-
return CreateType({ [Kind]: "TemplateLiteral", type: "string", pattern }, options);
|
|
1024
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs
|
|
1025
|
+
function IsIntersectOptional(types) {
|
|
1026
|
+
return types.every((left) => IsOptional(left));
|
|
1025
1027
|
}
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
function FromTemplateLiteral(templateLiteral) {
|
|
1029
|
-
const keys = TemplateLiteralGenerate(templateLiteral);
|
|
1030
|
-
return keys.map((key) => key.toString());
|
|
1028
|
+
function RemoveOptionalFromType2(type) {
|
|
1029
|
+
return Discard(type, [OptionalKind]);
|
|
1031
1030
|
}
|
|
1032
|
-
function
|
|
1033
|
-
|
|
1034
|
-
for (const type of types)
|
|
1035
|
-
result.push(...IndexPropertyKeys(type));
|
|
1036
|
-
return result;
|
|
1031
|
+
function RemoveOptionalFromRest2(types) {
|
|
1032
|
+
return types.map((left) => IsOptional(left) ? RemoveOptionalFromType2(left) : left);
|
|
1037
1033
|
}
|
|
1038
|
-
function
|
|
1039
|
-
return
|
|
1034
|
+
function ResolveIntersect(types, options) {
|
|
1035
|
+
return IsIntersectOptional(types) ? Optional(IntersectCreate(RemoveOptionalFromRest2(types), options)) : IntersectCreate(RemoveOptionalFromRest2(types), options);
|
|
1040
1036
|
}
|
|
1041
|
-
function
|
|
1042
|
-
|
|
1037
|
+
function IntersectEvaluated(types, options = {}) {
|
|
1038
|
+
if (types.length === 1)
|
|
1039
|
+
return CreateType(types[0], options);
|
|
1040
|
+
if (types.length === 0)
|
|
1041
|
+
return Never(options);
|
|
1042
|
+
if (types.some((schema) => IsTransform(schema)))
|
|
1043
|
+
throw new Error("Cannot intersect transform types");
|
|
1044
|
+
return ResolveIntersect(types, options);
|
|
1043
1045
|
}
|
|
1044
1046
|
|
|
1045
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
1046
|
-
function
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
return FromProperties(type, mappedResult.properties, options);
|
|
1055
|
-
}
|
|
1056
|
-
function IndexFromMappedResult(type, mappedResult, options) {
|
|
1057
|
-
const properties = FromMappedResult(type, mappedResult, options);
|
|
1058
|
-
return MappedResult(properties);
|
|
1047
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs
|
|
1048
|
+
function Intersect(types, options) {
|
|
1049
|
+
if (types.length === 1)
|
|
1050
|
+
return CreateType(types[0], options);
|
|
1051
|
+
if (types.length === 0)
|
|
1052
|
+
return Never(options);
|
|
1053
|
+
if (types.some((schema) => IsTransform(schema)))
|
|
1054
|
+
throw new Error("Cannot intersect transform types");
|
|
1055
|
+
return IntersectCreate(types, options);
|
|
1059
1056
|
}
|
|
1060
1057
|
|
|
1061
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
1062
|
-
function
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
return
|
|
1067
|
-
}
|
|
1068
|
-
function FromIntersect(types, key) {
|
|
1069
|
-
return IntersectEvaluated(FromIntersectRest(FromRest(types, key)));
|
|
1058
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs
|
|
1059
|
+
function Ref(...args) {
|
|
1060
|
+
const [$ref, options] = typeof args[0] === "string" ? [args[0], args[1]] : [args[0].$id, args[1]];
|
|
1061
|
+
if (typeof $ref !== "string")
|
|
1062
|
+
throw new TypeBoxError("Ref: $ref must be a string");
|
|
1063
|
+
return CreateType({ [Kind]: "Ref", $ref }, options);
|
|
1070
1064
|
}
|
|
1071
|
-
|
|
1072
|
-
|
|
1065
|
+
|
|
1066
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs
|
|
1067
|
+
function FromRest3(types) {
|
|
1068
|
+
const result = [];
|
|
1069
|
+
for (const L of types)
|
|
1070
|
+
result.push(KeyOfPropertyKeys(L));
|
|
1071
|
+
return result;
|
|
1073
1072
|
}
|
|
1074
|
-
function
|
|
1075
|
-
|
|
1073
|
+
function FromIntersect2(types) {
|
|
1074
|
+
const propertyKeysArray = FromRest3(types);
|
|
1075
|
+
const propertyKeys = SetUnionMany(propertyKeysArray);
|
|
1076
|
+
return propertyKeys;
|
|
1076
1077
|
}
|
|
1077
|
-
function
|
|
1078
|
-
|
|
1078
|
+
function FromUnion4(types) {
|
|
1079
|
+
const propertyKeysArray = FromRest3(types);
|
|
1080
|
+
const propertyKeys = SetIntersectMany(propertyKeysArray);
|
|
1081
|
+
return propertyKeys;
|
|
1079
1082
|
}
|
|
1080
|
-
function
|
|
1081
|
-
return
|
|
1083
|
+
function FromTuple2(types) {
|
|
1084
|
+
return types.map((_, indexer) => indexer.toString());
|
|
1082
1085
|
}
|
|
1083
|
-
function
|
|
1084
|
-
return
|
|
1086
|
+
function FromArray2(_) {
|
|
1087
|
+
return ["[number]"];
|
|
1085
1088
|
}
|
|
1086
|
-
function
|
|
1087
|
-
return
|
|
1089
|
+
function FromProperties5(T) {
|
|
1090
|
+
return globalThis.Object.getOwnPropertyNames(T);
|
|
1088
1091
|
}
|
|
1089
|
-
function
|
|
1090
|
-
|
|
1092
|
+
function FromPatternProperties(patternProperties) {
|
|
1093
|
+
if (!includePatternProperties)
|
|
1094
|
+
return [];
|
|
1095
|
+
const patternPropertyKeys = globalThis.Object.getOwnPropertyNames(patternProperties);
|
|
1096
|
+
return patternPropertyKeys.map((key) => {
|
|
1097
|
+
return key[0] === "^" && key[key.length - 1] === "$" ? key.slice(1, key.length - 1) : key;
|
|
1098
|
+
});
|
|
1091
1099
|
}
|
|
1092
|
-
function
|
|
1093
|
-
return
|
|
1100
|
+
function KeyOfPropertyKeys(type) {
|
|
1101
|
+
return IsIntersect(type) ? FromIntersect2(type.allOf) : IsUnion(type) ? FromUnion4(type.anyOf) : IsTuple(type) ? FromTuple2(type.items ?? []) : IsArray3(type) ? FromArray2(type.items) : IsObject3(type) ? FromProperties5(type.properties) : IsRecord(type) ? FromPatternProperties(type.patternProperties) : [];
|
|
1094
1102
|
}
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
}
|
|
1102
|
-
if (IsMappedResult(key))
|
|
1103
|
-
return IndexFromMappedResult(type, key, options);
|
|
1104
|
-
if (IsMappedKey(key))
|
|
1105
|
-
return IndexFromMappedKey(type, key, options);
|
|
1106
|
-
return CreateType(IsSchema(key) ? FromSchema(type, IndexPropertyKeys(key)) : FromSchema(type, key), options);
|
|
1103
|
+
var includePatternProperties = false;
|
|
1104
|
+
function KeyOfPattern(schema) {
|
|
1105
|
+
includePatternProperties = true;
|
|
1106
|
+
const keys = KeyOfPropertyKeys(schema);
|
|
1107
|
+
includePatternProperties = false;
|
|
1108
|
+
const pattern = keys.map((key) => `(${key})`);
|
|
1109
|
+
return `^(${pattern.join("|")})$`;
|
|
1107
1110
|
}
|
|
1108
1111
|
|
|
1109
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
1110
|
-
function
|
|
1111
|
-
return
|
|
1112
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs
|
|
1113
|
+
function FromComputed(target, parameters) {
|
|
1114
|
+
return Computed("KeyOf", [Computed(target, parameters)]);
|
|
1112
1115
|
}
|
|
1113
|
-
function
|
|
1114
|
-
return
|
|
1115
|
-
return { ...result, ...MappedIndexPropertyKey(type, left, options) };
|
|
1116
|
-
}, {});
|
|
1116
|
+
function FromRef($ref) {
|
|
1117
|
+
return Computed("KeyOf", [Ref($ref)]);
|
|
1117
1118
|
}
|
|
1118
|
-
function
|
|
1119
|
-
|
|
1119
|
+
function KeyOfFromType(type, options) {
|
|
1120
|
+
const propertyKeys = KeyOfPropertyKeys(type);
|
|
1121
|
+
const propertyKeyTypes = KeyOfPropertyKeysToRest(propertyKeys);
|
|
1122
|
+
const result = UnionEvaluated(propertyKeyTypes);
|
|
1123
|
+
return CreateType(result, options);
|
|
1120
1124
|
}
|
|
1121
|
-
function
|
|
1122
|
-
|
|
1123
|
-
return MappedResult(properties);
|
|
1125
|
+
function KeyOfPropertyKeysToRest(propertyKeys) {
|
|
1126
|
+
return propertyKeys.map((L) => L === "[number]" ? Number2() : Literal(L));
|
|
1124
1127
|
}
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
function Iterator(items, options) {
|
|
1128
|
-
return CreateType({ [Kind]: "Iterator", type: "Iterator", items }, options);
|
|
1128
|
+
function KeyOf(type, options) {
|
|
1129
|
+
return IsComputed(type) ? FromComputed(type.target, type.parameters) : IsRef(type) ? FromRef(type.$ref) : IsMappedResult(type) ? KeyOfFromMappedResult(type, options) : KeyOfFromType(type, options);
|
|
1129
1130
|
}
|
|
1130
1131
|
|
|
1131
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
1132
|
-
function
|
|
1133
|
-
|
|
1132
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs
|
|
1133
|
+
function FromProperties6(properties, options) {
|
|
1134
|
+
const result = {};
|
|
1135
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
|
|
1136
|
+
result[K2] = KeyOf(properties[K2], Clone(options));
|
|
1137
|
+
return result;
|
|
1134
1138
|
}
|
|
1135
|
-
function
|
|
1136
|
-
|
|
1137
|
-
const schema = required.length > 0 ? { [Kind]: "Object", type: "object", required, properties } : { [Kind]: "Object", type: "object", properties };
|
|
1138
|
-
return CreateType(schema, options);
|
|
1139
|
+
function FromMappedResult5(mappedResult, options) {
|
|
1140
|
+
return FromProperties6(mappedResult.properties, options);
|
|
1139
1141
|
}
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
function Promise2(item, options) {
|
|
1144
|
-
return CreateType({ [Kind]: "Promise", type: "Promise", item }, options);
|
|
1142
|
+
function KeyOfFromMappedResult(mappedResult, options) {
|
|
1143
|
+
const properties = FromMappedResult5(mappedResult, options);
|
|
1144
|
+
return MappedResult(properties);
|
|
1145
1145
|
}
|
|
1146
1146
|
|
|
1147
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
1148
|
-
function
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
return
|
|
1147
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs
|
|
1148
|
+
function CompositeKeys(T) {
|
|
1149
|
+
const Acc = [];
|
|
1150
|
+
for (const L of T)
|
|
1151
|
+
Acc.push(...KeyOfPropertyKeys(L));
|
|
1152
|
+
return SetDistinct(Acc);
|
|
1153
1153
|
}
|
|
1154
|
-
function
|
|
1155
|
-
return
|
|
1154
|
+
function FilterNever(T) {
|
|
1155
|
+
return T.filter((L) => !IsNever(L));
|
|
1156
1156
|
}
|
|
1157
|
-
function
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1157
|
+
function CompositeProperty(T, K) {
|
|
1158
|
+
const Acc = [];
|
|
1159
|
+
for (const L of T)
|
|
1160
|
+
Acc.push(...IndexFromPropertyKeys(L, [K]));
|
|
1161
|
+
return FilterNever(Acc);
|
|
1160
1162
|
}
|
|
1161
|
-
|
|
1162
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.mjs
|
|
1163
|
-
function FromProperties2(K, F) {
|
|
1163
|
+
function CompositeProperties(T, K) {
|
|
1164
1164
|
const Acc = {};
|
|
1165
|
-
for (const
|
|
1166
|
-
Acc[
|
|
1165
|
+
for (const L of K) {
|
|
1166
|
+
Acc[L] = IntersectEvaluated(CompositeProperty(T, L));
|
|
1167
|
+
}
|
|
1167
1168
|
return Acc;
|
|
1168
1169
|
}
|
|
1169
|
-
function
|
|
1170
|
-
|
|
1170
|
+
function Composite(T, options) {
|
|
1171
|
+
const K = CompositeKeys(T);
|
|
1172
|
+
const P = CompositeProperties(T, K);
|
|
1173
|
+
const R = Object2(P, options);
|
|
1174
|
+
return R;
|
|
1171
1175
|
}
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1176
|
+
|
|
1177
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/date/date.mjs
|
|
1178
|
+
function Date2(options) {
|
|
1179
|
+
return CreateType({ [Kind]: "Date", type: "Date" }, options);
|
|
1175
1180
|
}
|
|
1176
1181
|
|
|
1177
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
1178
|
-
function
|
|
1179
|
-
return CreateType(
|
|
1182
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/null/null.mjs
|
|
1183
|
+
function Null(options) {
|
|
1184
|
+
return CreateType({ [Kind]: "Null", type: "null" }, options);
|
|
1180
1185
|
}
|
|
1181
1186
|
|
|
1182
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
1183
|
-
function
|
|
1184
|
-
return
|
|
1187
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs
|
|
1188
|
+
function Symbol2(options) {
|
|
1189
|
+
return CreateType({ [Kind]: "Symbol", type: "symbol" }, options);
|
|
1185
1190
|
}
|
|
1186
|
-
|
|
1187
|
-
|
|
1191
|
+
|
|
1192
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs
|
|
1193
|
+
function Undefined(options) {
|
|
1194
|
+
return CreateType({ [Kind]: "Undefined", type: "undefined" }, options);
|
|
1188
1195
|
}
|
|
1189
|
-
|
|
1196
|
+
|
|
1197
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs
|
|
1198
|
+
function Uint8Array2(options) {
|
|
1199
|
+
return CreateType({ [Kind]: "Uint8Array", type: "Uint8Array" }, options);
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs
|
|
1203
|
+
function Unknown(options) {
|
|
1204
|
+
return CreateType({ [Kind]: "Unknown" }, options);
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/const/const.mjs
|
|
1208
|
+
function FromArray3(T) {
|
|
1209
|
+
return T.map((L) => FromValue(L, false));
|
|
1210
|
+
}
|
|
1211
|
+
function FromProperties7(value) {
|
|
1190
1212
|
const Acc = {};
|
|
1191
|
-
for (const
|
|
1192
|
-
Acc[
|
|
1213
|
+
for (const K of globalThis.Object.getOwnPropertyNames(value))
|
|
1214
|
+
Acc[K] = Readonly(FromValue(value[K], false));
|
|
1193
1215
|
return Acc;
|
|
1194
1216
|
}
|
|
1195
|
-
function
|
|
1196
|
-
return
|
|
1217
|
+
function ConditionalReadonly(T, root) {
|
|
1218
|
+
return root === true ? T : Readonly(T);
|
|
1197
1219
|
}
|
|
1198
|
-
function
|
|
1199
|
-
|
|
1200
|
-
return FromMappedResult3(K, R);
|
|
1220
|
+
function FromValue(value, root) {
|
|
1221
|
+
return IsAsyncIterator2(value) ? ConditionalReadonly(Any(), root) : IsIterator2(value) ? ConditionalReadonly(Any(), root) : IsArray2(value) ? Readonly(Tuple(FromArray3(value))) : IsUint8Array2(value) ? Uint8Array2() : IsDate2(value) ? Date2() : IsObject2(value) ? ConditionalReadonly(Object2(FromProperties7(value)), root) : IsFunction2(value) ? ConditionalReadonly(Function([], Unknown()), root) : IsUndefined2(value) ? Undefined() : IsNull2(value) ? Null() : IsSymbol2(value) ? Symbol2() : IsBigInt2(value) ? BigInt() : IsNumber2(value) ? Literal(value) : IsBoolean2(value) ? Literal(value) : IsString2(value) ? Literal(value) : Object2({});
|
|
1201
1222
|
}
|
|
1202
|
-
function
|
|
1203
|
-
return
|
|
1223
|
+
function Const(T, options) {
|
|
1224
|
+
return CreateType(FromValue(T, true), options);
|
|
1204
1225
|
}
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1226
|
+
|
|
1227
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs
|
|
1228
|
+
function Enum(item, options) {
|
|
1229
|
+
if (IsUndefined2(item))
|
|
1230
|
+
throw new Error("Enum undefined or empty");
|
|
1231
|
+
const values1 = globalThis.Object.getOwnPropertyNames(item).filter((key) => isNaN(key)).map((key) => item[key]);
|
|
1232
|
+
const values2 = [...new Set(values1)];
|
|
1233
|
+
const anyOf = values2.map((value) => Literal(value));
|
|
1234
|
+
return Union(anyOf, { ...options, [Hint]: "Enum" });
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs
|
|
1238
|
+
var type_exports = {};
|
|
1239
|
+
__export(type_exports, {
|
|
1240
|
+
IsAny: () => IsAny2,
|
|
1241
|
+
IsArgument: () => IsArgument2,
|
|
1242
|
+
IsArray: () => IsArray4,
|
|
1243
|
+
IsAsyncIterator: () => IsAsyncIterator4,
|
|
1244
|
+
IsBigInt: () => IsBigInt4,
|
|
1245
|
+
IsBoolean: () => IsBoolean4,
|
|
1246
|
+
IsComputed: () => IsComputed2,
|
|
1247
|
+
IsConstructor: () => IsConstructor2,
|
|
1248
|
+
IsDate: () => IsDate4,
|
|
1249
|
+
IsFunction: () => IsFunction4,
|
|
1250
|
+
IsImport: () => IsImport,
|
|
1251
|
+
IsInteger: () => IsInteger3,
|
|
1252
|
+
IsIntersect: () => IsIntersect2,
|
|
1253
|
+
IsIterator: () => IsIterator4,
|
|
1254
|
+
IsKind: () => IsKind2,
|
|
1255
|
+
IsKindOf: () => IsKindOf2,
|
|
1256
|
+
IsLiteral: () => IsLiteral2,
|
|
1257
|
+
IsLiteralBoolean: () => IsLiteralBoolean,
|
|
1258
|
+
IsLiteralNumber: () => IsLiteralNumber,
|
|
1259
|
+
IsLiteralString: () => IsLiteralString,
|
|
1260
|
+
IsLiteralValue: () => IsLiteralValue2,
|
|
1261
|
+
IsMappedKey: () => IsMappedKey2,
|
|
1262
|
+
IsMappedResult: () => IsMappedResult2,
|
|
1263
|
+
IsNever: () => IsNever2,
|
|
1264
|
+
IsNot: () => IsNot2,
|
|
1265
|
+
IsNull: () => IsNull4,
|
|
1266
|
+
IsNumber: () => IsNumber4,
|
|
1267
|
+
IsObject: () => IsObject4,
|
|
1268
|
+
IsOptional: () => IsOptional2,
|
|
1269
|
+
IsPromise: () => IsPromise3,
|
|
1270
|
+
IsProperties: () => IsProperties,
|
|
1271
|
+
IsReadonly: () => IsReadonly2,
|
|
1272
|
+
IsRecord: () => IsRecord2,
|
|
1273
|
+
IsRecursive: () => IsRecursive,
|
|
1274
|
+
IsRef: () => IsRef2,
|
|
1275
|
+
IsRegExp: () => IsRegExp3,
|
|
1276
|
+
IsSchema: () => IsSchema2,
|
|
1277
|
+
IsString: () => IsString4,
|
|
1278
|
+
IsSymbol: () => IsSymbol4,
|
|
1279
|
+
IsTemplateLiteral: () => IsTemplateLiteral2,
|
|
1280
|
+
IsThis: () => IsThis2,
|
|
1281
|
+
IsTransform: () => IsTransform2,
|
|
1282
|
+
IsTuple: () => IsTuple2,
|
|
1283
|
+
IsUint8Array: () => IsUint8Array4,
|
|
1284
|
+
IsUndefined: () => IsUndefined4,
|
|
1285
|
+
IsUnion: () => IsUnion2,
|
|
1286
|
+
IsUnionLiteral: () => IsUnionLiteral,
|
|
1287
|
+
IsUnknown: () => IsUnknown2,
|
|
1288
|
+
IsUnsafe: () => IsUnsafe2,
|
|
1289
|
+
IsVoid: () => IsVoid2,
|
|
1290
|
+
TypeGuardUnknownTypeError: () => TypeGuardUnknownTypeError
|
|
1291
|
+
});
|
|
1292
|
+
var TypeGuardUnknownTypeError = class extends TypeBoxError {
|
|
1293
|
+
};
|
|
1294
|
+
var KnownTypes = [
|
|
1295
|
+
"Argument",
|
|
1296
|
+
"Any",
|
|
1297
|
+
"Array",
|
|
1298
|
+
"AsyncIterator",
|
|
1299
|
+
"BigInt",
|
|
1300
|
+
"Boolean",
|
|
1301
|
+
"Computed",
|
|
1302
|
+
"Constructor",
|
|
1303
|
+
"Date",
|
|
1304
|
+
"Enum",
|
|
1305
|
+
"Function",
|
|
1306
|
+
"Integer",
|
|
1307
|
+
"Intersect",
|
|
1308
|
+
"Iterator",
|
|
1309
|
+
"Literal",
|
|
1310
|
+
"MappedKey",
|
|
1311
|
+
"MappedResult",
|
|
1312
|
+
"Not",
|
|
1313
|
+
"Null",
|
|
1314
|
+
"Number",
|
|
1315
|
+
"Object",
|
|
1316
|
+
"Promise",
|
|
1317
|
+
"Record",
|
|
1318
|
+
"Ref",
|
|
1319
|
+
"RegExp",
|
|
1320
|
+
"String",
|
|
1321
|
+
"Symbol",
|
|
1322
|
+
"TemplateLiteral",
|
|
1323
|
+
"This",
|
|
1324
|
+
"Tuple",
|
|
1325
|
+
"Undefined",
|
|
1326
|
+
"Union",
|
|
1327
|
+
"Uint8Array",
|
|
1328
|
+
"Unknown",
|
|
1329
|
+
"Void"
|
|
1330
|
+
];
|
|
1331
|
+
function IsPattern(value) {
|
|
1332
|
+
try {
|
|
1333
|
+
new RegExp(value);
|
|
1334
|
+
return true;
|
|
1335
|
+
} catch {
|
|
1336
|
+
return false;
|
|
1337
|
+
}
|
|
1210
1338
|
}
|
|
1211
|
-
function
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
)
|
|
1222
|
-
);
|
|
1339
|
+
function IsControlCharacterFree(value) {
|
|
1340
|
+
if (!IsString2(value))
|
|
1341
|
+
return false;
|
|
1342
|
+
for (let i = 0; i < value.length; i++) {
|
|
1343
|
+
const code = value.charCodeAt(i);
|
|
1344
|
+
if (code >= 7 && code <= 13 || code === 27 || code === 127) {
|
|
1345
|
+
return false;
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
return true;
|
|
1223
1349
|
}
|
|
1224
|
-
function
|
|
1225
|
-
|
|
1226
|
-
for (const L of K)
|
|
1227
|
-
Acc[L] = FromSchemaType(L, T);
|
|
1228
|
-
return Acc;
|
|
1350
|
+
function IsAdditionalProperties(value) {
|
|
1351
|
+
return IsOptionalBoolean(value) || IsSchema2(value);
|
|
1229
1352
|
}
|
|
1230
|
-
function
|
|
1231
|
-
|
|
1232
|
-
const RT = map({ [Kind]: "MappedKey", keys: K });
|
|
1233
|
-
const R = MappedFunctionReturnType(K, RT);
|
|
1234
|
-
return Object2(R, options);
|
|
1353
|
+
function IsOptionalBigInt(value) {
|
|
1354
|
+
return IsUndefined2(value) || IsBigInt2(value);
|
|
1235
1355
|
}
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
function RemoveOptional(schema) {
|
|
1239
|
-
return CreateType(Discard(schema, [OptionalKind]));
|
|
1356
|
+
function IsOptionalNumber(value) {
|
|
1357
|
+
return IsUndefined2(value) || IsNumber2(value);
|
|
1240
1358
|
}
|
|
1241
|
-
function
|
|
1242
|
-
return
|
|
1359
|
+
function IsOptionalBoolean(value) {
|
|
1360
|
+
return IsUndefined2(value) || IsBoolean2(value);
|
|
1243
1361
|
}
|
|
1244
|
-
function
|
|
1245
|
-
return
|
|
1362
|
+
function IsOptionalString(value) {
|
|
1363
|
+
return IsUndefined2(value) || IsString2(value);
|
|
1246
1364
|
}
|
|
1247
|
-
function
|
|
1248
|
-
|
|
1249
|
-
return IsMappedResult(schema) ? OptionalFromMappedResult(schema, F) : OptionalWithFlag(schema, F);
|
|
1365
|
+
function IsOptionalPattern(value) {
|
|
1366
|
+
return IsUndefined2(value) || IsString2(value) && IsControlCharacterFree(value) && IsPattern(value);
|
|
1250
1367
|
}
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
function FromProperties4(P, F) {
|
|
1254
|
-
const Acc = {};
|
|
1255
|
-
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
1256
|
-
Acc[K2] = Optional(P[K2], F);
|
|
1257
|
-
return Acc;
|
|
1368
|
+
function IsOptionalFormat(value) {
|
|
1369
|
+
return IsUndefined2(value) || IsString2(value) && IsControlCharacterFree(value);
|
|
1258
1370
|
}
|
|
1259
|
-
function
|
|
1260
|
-
return
|
|
1371
|
+
function IsOptionalSchema(value) {
|
|
1372
|
+
return IsUndefined2(value) || IsSchema2(value);
|
|
1261
1373
|
}
|
|
1262
|
-
function
|
|
1263
|
-
|
|
1264
|
-
return MappedResult(P);
|
|
1374
|
+
function IsReadonly2(value) {
|
|
1375
|
+
return IsObject2(value) && value[ReadonlyKind] === "Readonly";
|
|
1265
1376
|
}
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
function IntersectCreate(T, options = {}) {
|
|
1269
|
-
const allObjects = T.every((schema) => IsObject3(schema));
|
|
1270
|
-
const clonedUnevaluatedProperties = IsSchema(options.unevaluatedProperties) ? { unevaluatedProperties: options.unevaluatedProperties } : {};
|
|
1271
|
-
return CreateType(options.unevaluatedProperties === false || IsSchema(options.unevaluatedProperties) || allObjects ? { ...clonedUnevaluatedProperties, [Kind]: "Intersect", type: "object", allOf: T } : { ...clonedUnevaluatedProperties, [Kind]: "Intersect", allOf: T }, options);
|
|
1377
|
+
function IsOptional2(value) {
|
|
1378
|
+
return IsObject2(value) && value[OptionalKind] === "Optional";
|
|
1272
1379
|
}
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
function IsIntersectOptional(types) {
|
|
1276
|
-
return types.every((left) => IsOptional(left));
|
|
1380
|
+
function IsAny2(value) {
|
|
1381
|
+
return IsKindOf2(value, "Any") && IsOptionalString(value.$id);
|
|
1277
1382
|
}
|
|
1278
|
-
function
|
|
1279
|
-
return
|
|
1383
|
+
function IsArgument2(value) {
|
|
1384
|
+
return IsKindOf2(value, "Argument") && IsNumber2(value.index);
|
|
1280
1385
|
}
|
|
1281
|
-
function
|
|
1282
|
-
return
|
|
1386
|
+
function IsArray4(value) {
|
|
1387
|
+
return IsKindOf2(value, "Array") && value.type === "array" && IsOptionalString(value.$id) && IsSchema2(value.items) && IsOptionalNumber(value.minItems) && IsOptionalNumber(value.maxItems) && IsOptionalBoolean(value.uniqueItems) && IsOptionalSchema(value.contains) && IsOptionalNumber(value.minContains) && IsOptionalNumber(value.maxContains);
|
|
1283
1388
|
}
|
|
1284
|
-
function
|
|
1285
|
-
return
|
|
1389
|
+
function IsAsyncIterator4(value) {
|
|
1390
|
+
return IsKindOf2(value, "AsyncIterator") && value.type === "AsyncIterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
|
|
1286
1391
|
}
|
|
1287
|
-
function
|
|
1288
|
-
|
|
1289
|
-
return CreateType(types[0], options);
|
|
1290
|
-
if (types.length === 0)
|
|
1291
|
-
return Never(options);
|
|
1292
|
-
if (types.some((schema) => IsTransform(schema)))
|
|
1293
|
-
throw new Error("Cannot intersect transform types");
|
|
1294
|
-
return ResolveIntersect(types, options);
|
|
1392
|
+
function IsBigInt4(value) {
|
|
1393
|
+
return IsKindOf2(value, "BigInt") && value.type === "bigint" && IsOptionalString(value.$id) && IsOptionalBigInt(value.exclusiveMaximum) && IsOptionalBigInt(value.exclusiveMinimum) && IsOptionalBigInt(value.maximum) && IsOptionalBigInt(value.minimum) && IsOptionalBigInt(value.multipleOf);
|
|
1295
1394
|
}
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
function Intersect(types, options) {
|
|
1299
|
-
if (types.length === 1)
|
|
1300
|
-
return CreateType(types[0], options);
|
|
1301
|
-
if (types.length === 0)
|
|
1302
|
-
return Never(options);
|
|
1303
|
-
if (types.some((schema) => IsTransform(schema)))
|
|
1304
|
-
throw new Error("Cannot intersect transform types");
|
|
1305
|
-
return IntersectCreate(types, options);
|
|
1395
|
+
function IsBoolean4(value) {
|
|
1396
|
+
return IsKindOf2(value, "Boolean") && value.type === "boolean" && IsOptionalString(value.$id);
|
|
1306
1397
|
}
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
function Ref(...args) {
|
|
1310
|
-
const [$ref, options] = typeof args[0] === "string" ? [args[0], args[1]] : [args[0].$id, args[1]];
|
|
1311
|
-
if (typeof $ref !== "string")
|
|
1312
|
-
throw new TypeBoxError("Ref: $ref must be a string");
|
|
1313
|
-
return CreateType({ [Kind]: "Ref", $ref }, options);
|
|
1398
|
+
function IsComputed2(value) {
|
|
1399
|
+
return IsKindOf2(value, "Computed") && IsString2(value.target) && IsArray2(value.parameters) && value.parameters.every((schema) => IsSchema2(schema));
|
|
1314
1400
|
}
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
function FromComputed(target, parameters) {
|
|
1318
|
-
return Computed("Awaited", [Computed(target, parameters)]);
|
|
1401
|
+
function IsConstructor2(value) {
|
|
1402
|
+
return IsKindOf2(value, "Constructor") && value.type === "Constructor" && IsOptionalString(value.$id) && IsArray2(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
|
|
1319
1403
|
}
|
|
1320
|
-
function
|
|
1321
|
-
return
|
|
1404
|
+
function IsDate4(value) {
|
|
1405
|
+
return IsKindOf2(value, "Date") && value.type === "Date" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximumTimestamp) && IsOptionalNumber(value.exclusiveMinimumTimestamp) && IsOptionalNumber(value.maximumTimestamp) && IsOptionalNumber(value.minimumTimestamp) && IsOptionalNumber(value.multipleOfTimestamp);
|
|
1322
1406
|
}
|
|
1323
|
-
function
|
|
1324
|
-
return
|
|
1407
|
+
function IsFunction4(value) {
|
|
1408
|
+
return IsKindOf2(value, "Function") && value.type === "Function" && IsOptionalString(value.$id) && IsArray2(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
|
|
1325
1409
|
}
|
|
1326
|
-
function
|
|
1327
|
-
return
|
|
1410
|
+
function IsImport(value) {
|
|
1411
|
+
return IsKindOf2(value, "Import") && HasPropertyKey2(value, "$defs") && IsObject2(value.$defs) && IsProperties(value.$defs) && HasPropertyKey2(value, "$ref") && IsString2(value.$ref) && value.$ref in value.$defs;
|
|
1328
1412
|
}
|
|
1329
|
-
function
|
|
1330
|
-
return
|
|
1413
|
+
function IsInteger3(value) {
|
|
1414
|
+
return IsKindOf2(value, "Integer") && value.type === "integer" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximum) && IsOptionalNumber(value.exclusiveMinimum) && IsOptionalNumber(value.maximum) && IsOptionalNumber(value.minimum) && IsOptionalNumber(value.multipleOf);
|
|
1331
1415
|
}
|
|
1332
|
-
function
|
|
1333
|
-
return
|
|
1416
|
+
function IsProperties(value) {
|
|
1417
|
+
return IsObject2(value) && Object.entries(value).every(([key, schema]) => IsControlCharacterFree(key) && IsSchema2(schema));
|
|
1334
1418
|
}
|
|
1335
|
-
function
|
|
1336
|
-
return
|
|
1419
|
+
function IsIntersect2(value) {
|
|
1420
|
+
return IsKindOf2(value, "Intersect") && (IsString2(value.type) && value.type !== "object" ? false : true) && IsArray2(value.allOf) && value.allOf.every((schema) => IsSchema2(schema) && !IsTransform2(schema)) && IsOptionalString(value.type) && (IsOptionalBoolean(value.unevaluatedProperties) || IsOptionalSchema(value.unevaluatedProperties)) && IsOptionalString(value.$id);
|
|
1337
1421
|
}
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
function FromRest4(types) {
|
|
1341
|
-
const result = [];
|
|
1342
|
-
for (const L of types)
|
|
1343
|
-
result.push(KeyOfPropertyKeys(L));
|
|
1344
|
-
return result;
|
|
1422
|
+
function IsIterator4(value) {
|
|
1423
|
+
return IsKindOf2(value, "Iterator") && value.type === "Iterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
|
|
1345
1424
|
}
|
|
1346
|
-
function
|
|
1347
|
-
|
|
1348
|
-
const propertyKeys = SetUnionMany(propertyKeysArray);
|
|
1349
|
-
return propertyKeys;
|
|
1425
|
+
function IsKindOf2(value, kind) {
|
|
1426
|
+
return IsObject2(value) && Kind in value && value[Kind] === kind;
|
|
1350
1427
|
}
|
|
1351
|
-
function
|
|
1352
|
-
|
|
1353
|
-
const propertyKeys = SetIntersectMany(propertyKeysArray);
|
|
1354
|
-
return propertyKeys;
|
|
1428
|
+
function IsLiteralString(value) {
|
|
1429
|
+
return IsLiteral2(value) && IsString2(value.const);
|
|
1355
1430
|
}
|
|
1356
|
-
function
|
|
1357
|
-
return
|
|
1431
|
+
function IsLiteralNumber(value) {
|
|
1432
|
+
return IsLiteral2(value) && IsNumber2(value.const);
|
|
1358
1433
|
}
|
|
1359
|
-
function
|
|
1360
|
-
return
|
|
1434
|
+
function IsLiteralBoolean(value) {
|
|
1435
|
+
return IsLiteral2(value) && IsBoolean2(value.const);
|
|
1361
1436
|
}
|
|
1362
|
-
function
|
|
1363
|
-
return
|
|
1437
|
+
function IsLiteral2(value) {
|
|
1438
|
+
return IsKindOf2(value, "Literal") && IsOptionalString(value.$id) && IsLiteralValue2(value.const);
|
|
1364
1439
|
}
|
|
1365
|
-
function
|
|
1366
|
-
|
|
1367
|
-
return [];
|
|
1368
|
-
const patternPropertyKeys = globalThis.Object.getOwnPropertyNames(patternProperties);
|
|
1369
|
-
return patternPropertyKeys.map((key) => {
|
|
1370
|
-
return key[0] === "^" && key[key.length - 1] === "$" ? key.slice(1, key.length - 1) : key;
|
|
1371
|
-
});
|
|
1440
|
+
function IsLiteralValue2(value) {
|
|
1441
|
+
return IsBoolean2(value) || IsNumber2(value) || IsString2(value);
|
|
1372
1442
|
}
|
|
1373
|
-
function
|
|
1374
|
-
return
|
|
1443
|
+
function IsMappedKey2(value) {
|
|
1444
|
+
return IsKindOf2(value, "MappedKey") && IsArray2(value.keys) && value.keys.every((key) => IsNumber2(key) || IsString2(key));
|
|
1375
1445
|
}
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs
|
|
1379
|
-
function FromComputed2(target, parameters) {
|
|
1380
|
-
return Computed("KeyOf", [Computed(target, parameters)]);
|
|
1446
|
+
function IsMappedResult2(value) {
|
|
1447
|
+
return IsKindOf2(value, "MappedResult") && IsProperties(value.properties);
|
|
1381
1448
|
}
|
|
1382
|
-
function
|
|
1383
|
-
return
|
|
1449
|
+
function IsNever2(value) {
|
|
1450
|
+
return IsKindOf2(value, "Never") && IsObject2(value.not) && Object.getOwnPropertyNames(value.not).length === 0;
|
|
1384
1451
|
}
|
|
1385
|
-
function
|
|
1386
|
-
|
|
1387
|
-
const propertyKeyTypes = KeyOfPropertyKeysToRest(propertyKeys);
|
|
1388
|
-
const result = UnionEvaluated(propertyKeyTypes);
|
|
1389
|
-
return CreateType(result, options);
|
|
1452
|
+
function IsNot2(value) {
|
|
1453
|
+
return IsKindOf2(value, "Not") && IsSchema2(value.not);
|
|
1390
1454
|
}
|
|
1391
|
-
function
|
|
1392
|
-
return
|
|
1455
|
+
function IsNull4(value) {
|
|
1456
|
+
return IsKindOf2(value, "Null") && value.type === "null" && IsOptionalString(value.$id);
|
|
1393
1457
|
}
|
|
1394
|
-
function
|
|
1395
|
-
return
|
|
1458
|
+
function IsNumber4(value) {
|
|
1459
|
+
return IsKindOf2(value, "Number") && value.type === "number" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximum) && IsOptionalNumber(value.exclusiveMinimum) && IsOptionalNumber(value.maximum) && IsOptionalNumber(value.minimum) && IsOptionalNumber(value.multipleOf);
|
|
1396
1460
|
}
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
function FromProperties6(properties, options) {
|
|
1400
|
-
const result = {};
|
|
1401
|
-
for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
|
|
1402
|
-
result[K2] = KeyOf(properties[K2], Clone(options));
|
|
1403
|
-
return result;
|
|
1461
|
+
function IsObject4(value) {
|
|
1462
|
+
return IsKindOf2(value, "Object") && value.type === "object" && IsOptionalString(value.$id) && IsProperties(value.properties) && IsAdditionalProperties(value.additionalProperties) && IsOptionalNumber(value.minProperties) && IsOptionalNumber(value.maxProperties);
|
|
1404
1463
|
}
|
|
1405
|
-
function
|
|
1406
|
-
return
|
|
1464
|
+
function IsPromise3(value) {
|
|
1465
|
+
return IsKindOf2(value, "Promise") && value.type === "Promise" && IsOptionalString(value.$id) && IsSchema2(value.item);
|
|
1407
1466
|
}
|
|
1408
|
-
function
|
|
1409
|
-
|
|
1410
|
-
|
|
1467
|
+
function IsRecord2(value) {
|
|
1468
|
+
return IsKindOf2(value, "Record") && value.type === "object" && IsOptionalString(value.$id) && IsAdditionalProperties(value.additionalProperties) && IsObject2(value.patternProperties) && ((schema) => {
|
|
1469
|
+
const keys = Object.getOwnPropertyNames(schema.patternProperties);
|
|
1470
|
+
return keys.length === 1 && IsPattern(keys[0]) && IsObject2(schema.patternProperties) && IsSchema2(schema.patternProperties[keys[0]]);
|
|
1471
|
+
})(value);
|
|
1411
1472
|
}
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
function CompositeKeys(T) {
|
|
1415
|
-
const Acc = [];
|
|
1416
|
-
for (const L of T)
|
|
1417
|
-
Acc.push(...KeyOfPropertyKeys(L));
|
|
1418
|
-
return SetDistinct(Acc);
|
|
1473
|
+
function IsRecursive(value) {
|
|
1474
|
+
return IsObject2(value) && Hint in value && value[Hint] === "Recursive";
|
|
1419
1475
|
}
|
|
1420
|
-
function
|
|
1421
|
-
return
|
|
1476
|
+
function IsRef2(value) {
|
|
1477
|
+
return IsKindOf2(value, "Ref") && IsOptionalString(value.$id) && IsString2(value.$ref);
|
|
1422
1478
|
}
|
|
1423
|
-
function
|
|
1424
|
-
|
|
1425
|
-
for (const L of T)
|
|
1426
|
-
Acc.push(...IndexFromPropertyKeys(L, [K]));
|
|
1427
|
-
return FilterNever(Acc);
|
|
1479
|
+
function IsRegExp3(value) {
|
|
1480
|
+
return IsKindOf2(value, "RegExp") && IsOptionalString(value.$id) && IsString2(value.source) && IsString2(value.flags) && IsOptionalNumber(value.maxLength) && IsOptionalNumber(value.minLength);
|
|
1428
1481
|
}
|
|
1429
|
-
function
|
|
1430
|
-
|
|
1431
|
-
for (const L of K) {
|
|
1432
|
-
Acc[L] = IntersectEvaluated(CompositeProperty(T, L));
|
|
1433
|
-
}
|
|
1434
|
-
return Acc;
|
|
1482
|
+
function IsString4(value) {
|
|
1483
|
+
return IsKindOf2(value, "String") && value.type === "string" && IsOptionalString(value.$id) && IsOptionalNumber(value.minLength) && IsOptionalNumber(value.maxLength) && IsOptionalPattern(value.pattern) && IsOptionalFormat(value.format);
|
|
1435
1484
|
}
|
|
1436
|
-
function
|
|
1437
|
-
|
|
1438
|
-
const P = CompositeProperties(T, K);
|
|
1439
|
-
const R = Object2(P, options);
|
|
1440
|
-
return R;
|
|
1485
|
+
function IsSymbol4(value) {
|
|
1486
|
+
return IsKindOf2(value, "Symbol") && value.type === "symbol" && IsOptionalString(value.$id);
|
|
1441
1487
|
}
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
function Date2(options) {
|
|
1445
|
-
return CreateType({ [Kind]: "Date", type: "Date" }, options);
|
|
1488
|
+
function IsTemplateLiteral2(value) {
|
|
1489
|
+
return IsKindOf2(value, "TemplateLiteral") && value.type === "string" && IsString2(value.pattern) && value.pattern[0] === "^" && value.pattern[value.pattern.length - 1] === "$";
|
|
1446
1490
|
}
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
function Null(options) {
|
|
1450
|
-
return CreateType({ [Kind]: "Null", type: "null" }, options);
|
|
1491
|
+
function IsThis2(value) {
|
|
1492
|
+
return IsKindOf2(value, "This") && IsOptionalString(value.$id) && IsString2(value.$ref);
|
|
1451
1493
|
}
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
function Symbol2(options) {
|
|
1455
|
-
return CreateType({ [Kind]: "Symbol", type: "symbol" }, options);
|
|
1494
|
+
function IsTransform2(value) {
|
|
1495
|
+
return IsObject2(value) && TransformKind in value;
|
|
1456
1496
|
}
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
return CreateType({ [Kind]: "Undefined", type: "undefined" }, options);
|
|
1497
|
+
function IsTuple2(value) {
|
|
1498
|
+
return IsKindOf2(value, "Tuple") && value.type === "array" && IsOptionalString(value.$id) && IsNumber2(value.minItems) && IsNumber2(value.maxItems) && value.minItems === value.maxItems && // empty
|
|
1499
|
+
(IsUndefined2(value.items) && IsUndefined2(value.additionalItems) && value.minItems === 0 || IsArray2(value.items) && value.items.every((schema) => IsSchema2(schema)));
|
|
1461
1500
|
}
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
function Uint8Array2(options) {
|
|
1465
|
-
return CreateType({ [Kind]: "Uint8Array", type: "Uint8Array" }, options);
|
|
1501
|
+
function IsUndefined4(value) {
|
|
1502
|
+
return IsKindOf2(value, "Undefined") && value.type === "undefined" && IsOptionalString(value.$id);
|
|
1466
1503
|
}
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
function Unknown(options) {
|
|
1470
|
-
return CreateType({ [Kind]: "Unknown" }, options);
|
|
1504
|
+
function IsUnionLiteral(value) {
|
|
1505
|
+
return IsUnion2(value) && value.anyOf.every((schema) => IsLiteralString(schema) || IsLiteralNumber(schema));
|
|
1471
1506
|
}
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
function FromArray3(T) {
|
|
1475
|
-
return T.map((L) => FromValue(L, false));
|
|
1507
|
+
function IsUnion2(value) {
|
|
1508
|
+
return IsKindOf2(value, "Union") && IsOptionalString(value.$id) && IsObject2(value) && IsArray2(value.anyOf) && value.anyOf.every((schema) => IsSchema2(schema));
|
|
1476
1509
|
}
|
|
1477
|
-
function
|
|
1478
|
-
|
|
1479
|
-
for (const K of globalThis.Object.getOwnPropertyNames(value))
|
|
1480
|
-
Acc[K] = Readonly(FromValue(value[K], false));
|
|
1481
|
-
return Acc;
|
|
1510
|
+
function IsUint8Array4(value) {
|
|
1511
|
+
return IsKindOf2(value, "Uint8Array") && value.type === "Uint8Array" && IsOptionalString(value.$id) && IsOptionalNumber(value.minByteLength) && IsOptionalNumber(value.maxByteLength);
|
|
1482
1512
|
}
|
|
1483
|
-
function
|
|
1484
|
-
return
|
|
1513
|
+
function IsUnknown2(value) {
|
|
1514
|
+
return IsKindOf2(value, "Unknown") && IsOptionalString(value.$id);
|
|
1485
1515
|
}
|
|
1486
|
-
function
|
|
1487
|
-
return
|
|
1516
|
+
function IsUnsafe2(value) {
|
|
1517
|
+
return IsKindOf2(value, "Unsafe");
|
|
1488
1518
|
}
|
|
1489
|
-
function
|
|
1490
|
-
return
|
|
1519
|
+
function IsVoid2(value) {
|
|
1520
|
+
return IsKindOf2(value, "Void") && value.type === "void" && IsOptionalString(value.$id);
|
|
1491
1521
|
}
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
function ConstructorParameters(schema, options) {
|
|
1495
|
-
return IsConstructor(schema) ? Tuple(schema.parameters, options) : Never(options);
|
|
1522
|
+
function IsKind2(value) {
|
|
1523
|
+
return IsObject2(value) && Kind in value && IsString2(value[Kind]) && !KnownTypes.includes(value[Kind]);
|
|
1496
1524
|
}
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
function Enum(item, options) {
|
|
1500
|
-
if (IsUndefined(item))
|
|
1501
|
-
throw new Error("Enum undefined or empty");
|
|
1502
|
-
const values1 = globalThis.Object.getOwnPropertyNames(item).filter((key) => isNaN(key)).map((key) => item[key]);
|
|
1503
|
-
const values2 = [...new Set(values1)];
|
|
1504
|
-
const anyOf = values2.map((value) => Literal(value));
|
|
1505
|
-
return Union(anyOf, { ...options, [Hint]: "Enum" });
|
|
1525
|
+
function IsSchema2(value) {
|
|
1526
|
+
return IsObject2(value) && (IsAny2(value) || IsArgument2(value) || IsArray4(value) || IsBoolean4(value) || IsBigInt4(value) || IsAsyncIterator4(value) || IsComputed2(value) || IsConstructor2(value) || IsDate4(value) || IsFunction4(value) || IsInteger3(value) || IsIntersect2(value) || IsIterator4(value) || IsLiteral2(value) || IsMappedKey2(value) || IsMappedResult2(value) || IsNever2(value) || IsNot2(value) || IsNull4(value) || IsNumber4(value) || IsObject4(value) || IsPromise3(value) || IsRecord2(value) || IsRef2(value) || IsRegExp3(value) || IsString4(value) || IsSymbol4(value) || IsTemplateLiteral2(value) || IsThis2(value) || IsTuple2(value) || IsUndefined4(value) || IsUnion2(value) || IsUint8Array4(value) || IsUnknown2(value) || IsUnsafe2(value) || IsVoid2(value) || IsKind2(value));
|
|
1506
1527
|
}
|
|
1507
1528
|
|
|
1508
1529
|
// ../../node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.mjs
|
|
@@ -1568,7 +1589,7 @@ function FromInteger(left, right) {
|
|
|
1568
1589
|
function FromIntersectRight(left, right) {
|
|
1569
1590
|
return right.allOf.every((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1570
1591
|
}
|
|
1571
|
-
function
|
|
1592
|
+
function FromIntersect3(left, right) {
|
|
1572
1593
|
return left.allOf.some((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1573
1594
|
}
|
|
1574
1595
|
function FromIterator(left, right) {
|
|
@@ -1670,11 +1691,11 @@ function FromObject(left, right) {
|
|
|
1670
1691
|
return ExtendsResult.True;
|
|
1671
1692
|
})();
|
|
1672
1693
|
}
|
|
1673
|
-
function
|
|
1694
|
+
function FromPromise(left, right) {
|
|
1674
1695
|
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) && IsObjectPromiseLike(right) ? ExtendsResult.True : !type_exports.IsPromise(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.item, right.item));
|
|
1675
1696
|
}
|
|
1676
1697
|
function RecordKey(schema) {
|
|
1677
|
-
return PatternNumberExact in schema.patternProperties ? Number2() : PatternStringExact in schema.patternProperties ?
|
|
1698
|
+
return PatternNumberExact in schema.patternProperties ? Number2() : PatternStringExact in schema.patternProperties ? String() : Throw("Unknown record key pattern");
|
|
1678
1699
|
}
|
|
1679
1700
|
function RecordValue(schema) {
|
|
1680
1701
|
return PatternNumberExact in schema.patternProperties ? schema.patternProperties[PatternNumberExact] : PatternStringExact in schema.patternProperties ? schema.patternProperties[PatternStringExact] : Throw("Unable to get record value schema");
|
|
@@ -1694,8 +1715,8 @@ function FromRecord(left, right) {
|
|
|
1694
1715
|
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : !type_exports.IsRecord(right) ? ExtendsResult.False : Visit3(RecordValue(left), RecordValue(right));
|
|
1695
1716
|
}
|
|
1696
1717
|
function FromRegExp(left, right) {
|
|
1697
|
-
const L = type_exports.IsRegExp(left) ?
|
|
1698
|
-
const R = type_exports.IsRegExp(right) ?
|
|
1718
|
+
const L = type_exports.IsRegExp(left) ? String() : left;
|
|
1719
|
+
const R = type_exports.IsRegExp(right) ? String() : right;
|
|
1699
1720
|
return Visit3(L, R);
|
|
1700
1721
|
}
|
|
1701
1722
|
function FromStringRight(left, right) {
|
|
@@ -1728,7 +1749,7 @@ function FromUndefined(left, right) {
|
|
|
1728
1749
|
function FromUnionRight(left, right) {
|
|
1729
1750
|
return right.anyOf.some((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1730
1751
|
}
|
|
1731
|
-
function
|
|
1752
|
+
function FromUnion5(left, right) {
|
|
1732
1753
|
return left.anyOf.every((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1733
1754
|
}
|
|
1734
1755
|
function FromUnknownRight(left, right) {
|
|
@@ -1748,7 +1769,7 @@ function Visit3(left, right) {
|
|
|
1748
1769
|
// resolvable
|
|
1749
1770
|
type_exports.IsTemplateLiteral(left) || type_exports.IsTemplateLiteral(right) ? FromTemplateLiteral2(left, right) : type_exports.IsRegExp(left) || type_exports.IsRegExp(right) ? FromRegExp(left, right) : type_exports.IsNot(left) || type_exports.IsNot(right) ? FromNot(left, right) : (
|
|
1750
1771
|
// standard
|
|
1751
|
-
type_exports.IsAny(left) ? FromAny(left, right) : type_exports.IsArray(left) ? FromArray4(left, right) : type_exports.IsBigInt(left) ? FromBigInt(left, right) : type_exports.IsBoolean(left) ? FromBoolean(left, right) : type_exports.IsAsyncIterator(left) ? FromAsyncIterator(left, right) : type_exports.IsConstructor(left) ? FromConstructor(left, right) : type_exports.IsDate(left) ? FromDate(left, right) : type_exports.IsFunction(left) ? FromFunction(left, right) : type_exports.IsInteger(left) ? FromInteger(left, right) : type_exports.IsIntersect(left) ?
|
|
1772
|
+
type_exports.IsAny(left) ? FromAny(left, right) : type_exports.IsArray(left) ? FromArray4(left, right) : type_exports.IsBigInt(left) ? FromBigInt(left, right) : type_exports.IsBoolean(left) ? FromBoolean(left, right) : type_exports.IsAsyncIterator(left) ? FromAsyncIterator(left, right) : type_exports.IsConstructor(left) ? FromConstructor(left, right) : type_exports.IsDate(left) ? FromDate(left, right) : type_exports.IsFunction(left) ? FromFunction(left, right) : type_exports.IsInteger(left) ? FromInteger(left, right) : type_exports.IsIntersect(left) ? FromIntersect3(left, right) : type_exports.IsIterator(left) ? FromIterator(left, right) : type_exports.IsLiteral(left) ? FromLiteral2(left, right) : type_exports.IsNever(left) ? FromNever(left, right) : type_exports.IsNull(left) ? FromNull(left, right) : type_exports.IsNumber(left) ? FromNumber(left, right) : type_exports.IsObject(left) ? FromObject(left, right) : type_exports.IsRecord(left) ? FromRecord(left, right) : type_exports.IsString(left) ? FromString(left, right) : type_exports.IsSymbol(left) ? FromSymbol(left, right) : type_exports.IsTuple(left) ? FromTuple3(left, right) : type_exports.IsPromise(left) ? FromPromise(left, right) : type_exports.IsUint8Array(left) ? FromUint8Array(left, right) : type_exports.IsUndefined(left) ? FromUndefined(left, right) : type_exports.IsUnion(left) ? FromUnion5(left, right) : type_exports.IsUnknown(left) ? FromUnknown(left, right) : type_exports.IsVoid(left) ? FromVoid(left, right) : Throw(`Unknown left type operand '${left[Kind]}'`)
|
|
1752
1773
|
)
|
|
1753
1774
|
);
|
|
1754
1775
|
}
|
|
@@ -1805,204 +1826,64 @@ function ExcludeFromTemplateLiteral(L, R) {
|
|
|
1805
1826
|
}
|
|
1806
1827
|
|
|
1807
1828
|
// ../../node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.mjs
|
|
1808
|
-
function ExcludeRest(L, R) {
|
|
1809
|
-
const excluded = L.filter((inner) => ExtendsCheck(inner, R) === ExtendsResult.False);
|
|
1810
|
-
return excluded.length === 1 ? excluded[0] : Union(excluded);
|
|
1811
|
-
}
|
|
1812
|
-
function Exclude(L, R, options = {}) {
|
|
1813
|
-
if (IsTemplateLiteral(L))
|
|
1814
|
-
return CreateType(ExcludeFromTemplateLiteral(L, R), options);
|
|
1815
|
-
if (IsMappedResult(L))
|
|
1816
|
-
return CreateType(ExcludeFromMappedResult(L, R), options);
|
|
1817
|
-
return CreateType(IsUnion(L) ? ExcludeRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? Never() : L, options);
|
|
1818
|
-
}
|
|
1819
|
-
|
|
1820
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs
|
|
1821
|
-
function FromProperties9(P, U) {
|
|
1822
|
-
const Acc = {};
|
|
1823
|
-
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
1824
|
-
Acc[K2] = Exclude(P[K2], U);
|
|
1825
|
-
return Acc;
|
|
1826
|
-
}
|
|
1827
|
-
function FromMappedResult7(R, T) {
|
|
1828
|
-
return FromProperties9(R.properties, T);
|
|
1829
|
-
}
|
|
1830
|
-
function ExcludeFromMappedResult(R, T) {
|
|
1831
|
-
const P = FromMappedResult7(R, T);
|
|
1832
|
-
return MappedResult(P);
|
|
1833
|
-
}
|
|
1834
|
-
|
|
1835
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.mjs
|
|
1836
|
-
function ExtractFromTemplateLiteral(L, R) {
|
|
1837
|
-
return Extract(TemplateLiteralToUnion(L), R);
|
|
1838
|
-
}
|
|
1839
|
-
|
|
1840
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/extract/extract.mjs
|
|
1841
|
-
function ExtractRest(L, R) {
|
|
1842
|
-
const extracted = L.filter((inner) => ExtendsCheck(inner, R) !== ExtendsResult.False);
|
|
1843
|
-
return extracted.length === 1 ? extracted[0] : Union(extracted);
|
|
1844
|
-
}
|
|
1845
|
-
function Extract(L, R, options) {
|
|
1846
|
-
if (IsTemplateLiteral(L))
|
|
1847
|
-
return CreateType(ExtractFromTemplateLiteral(L, R), options);
|
|
1848
|
-
if (IsMappedResult(L))
|
|
1849
|
-
return CreateType(ExtractFromMappedResult(L, R), options);
|
|
1850
|
-
return CreateType(IsUnion(L) ? ExtractRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? L : Never(), options);
|
|
1851
|
-
}
|
|
1852
|
-
|
|
1853
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs
|
|
1854
|
-
function FromProperties10(P, T) {
|
|
1855
|
-
const Acc = {};
|
|
1856
|
-
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
1857
|
-
Acc[K2] = Extract(P[K2], T);
|
|
1858
|
-
return Acc;
|
|
1859
|
-
}
|
|
1860
|
-
function FromMappedResult8(R, T) {
|
|
1861
|
-
return FromProperties10(R.properties, T);
|
|
1862
|
-
}
|
|
1863
|
-
function ExtractFromMappedResult(R, T) {
|
|
1864
|
-
const P = FromMappedResult8(R, T);
|
|
1865
|
-
return MappedResult(P);
|
|
1866
|
-
}
|
|
1867
|
-
|
|
1868
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs
|
|
1869
|
-
function InstanceType(schema, options) {
|
|
1870
|
-
return IsConstructor(schema) ? CreateType(schema.returns, options) : Never(options);
|
|
1871
|
-
}
|
|
1872
|
-
|
|
1873
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs
|
|
1874
|
-
function ReadonlyOptional(schema) {
|
|
1875
|
-
return Readonly(Optional(schema));
|
|
1876
|
-
}
|
|
1877
|
-
|
|
1878
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/record/record.mjs
|
|
1879
|
-
function RecordCreateFromPattern(pattern, T, options) {
|
|
1880
|
-
return CreateType({ [Kind]: "Record", type: "object", patternProperties: { [pattern]: T } }, options);
|
|
1881
|
-
}
|
|
1882
|
-
function RecordCreateFromKeys(K, T, options) {
|
|
1883
|
-
const result = {};
|
|
1884
|
-
for (const K2 of K)
|
|
1885
|
-
result[K2] = T;
|
|
1886
|
-
return Object2(result, { ...options, [Hint]: "Record" });
|
|
1887
|
-
}
|
|
1888
|
-
function FromTemplateLiteralKey(K, T, options) {
|
|
1889
|
-
return IsTemplateLiteralFinite(K) ? RecordCreateFromKeys(IndexPropertyKeys(K), T, options) : RecordCreateFromPattern(K.pattern, T, options);
|
|
1890
|
-
}
|
|
1891
|
-
function FromUnionKey(key, type, options) {
|
|
1892
|
-
return RecordCreateFromKeys(IndexPropertyKeys(Union(key)), type, options);
|
|
1893
|
-
}
|
|
1894
|
-
function FromLiteralKey(key, type, options) {
|
|
1895
|
-
return RecordCreateFromKeys([key.toString()], type, options);
|
|
1896
|
-
}
|
|
1897
|
-
function FromRegExpKey(key, type, options) {
|
|
1898
|
-
return RecordCreateFromPattern(key.source, type, options);
|
|
1899
|
-
}
|
|
1900
|
-
function FromStringKey(key, type, options) {
|
|
1901
|
-
const pattern = IsUndefined(key.pattern) ? PatternStringExact : key.pattern;
|
|
1902
|
-
return RecordCreateFromPattern(pattern, type, options);
|
|
1903
|
-
}
|
|
1904
|
-
function FromAnyKey(_, type, options) {
|
|
1905
|
-
return RecordCreateFromPattern(PatternStringExact, type, options);
|
|
1906
|
-
}
|
|
1907
|
-
function FromNeverKey(_key, type, options) {
|
|
1908
|
-
return RecordCreateFromPattern(PatternNeverExact, type, options);
|
|
1909
|
-
}
|
|
1910
|
-
function FromBooleanKey(_key, type, options) {
|
|
1911
|
-
return Object2({ true: type, false: type }, options);
|
|
1912
|
-
}
|
|
1913
|
-
function FromIntegerKey(_key, type, options) {
|
|
1914
|
-
return RecordCreateFromPattern(PatternNumberExact, type, options);
|
|
1915
|
-
}
|
|
1916
|
-
function FromNumberKey(_, type, options) {
|
|
1917
|
-
return RecordCreateFromPattern(PatternNumberExact, type, options);
|
|
1918
|
-
}
|
|
1919
|
-
function Record(key, type, options = {}) {
|
|
1920
|
-
return IsUnion(key) ? FromUnionKey(key.anyOf, type, options) : IsTemplateLiteral(key) ? FromTemplateLiteralKey(key, type, options) : IsLiteral(key) ? FromLiteralKey(key.const, type, options) : IsBoolean2(key) ? FromBooleanKey(key, type, options) : IsInteger(key) ? FromIntegerKey(key, type, options) : IsNumber3(key) ? FromNumberKey(key, type, options) : IsRegExp2(key) ? FromRegExpKey(key, type, options) : IsString2(key) ? FromStringKey(key, type, options) : IsAny(key) ? FromAnyKey(key, type, options) : IsNever(key) ? FromNeverKey(key, type, options) : Never(options);
|
|
1921
|
-
}
|
|
1922
|
-
function RecordPattern(record) {
|
|
1923
|
-
return globalThis.Object.getOwnPropertyNames(record.patternProperties)[0];
|
|
1924
|
-
}
|
|
1925
|
-
function RecordKey2(type) {
|
|
1926
|
-
const pattern = RecordPattern(type);
|
|
1927
|
-
return pattern === PatternStringExact ? String2() : pattern === PatternNumberExact ? Number2() : String2({ pattern });
|
|
1928
|
-
}
|
|
1929
|
-
function RecordValue2(type) {
|
|
1930
|
-
return type.patternProperties[RecordPattern(type)];
|
|
1931
|
-
}
|
|
1932
|
-
|
|
1933
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.mjs
|
|
1934
|
-
function FromConstructor2(args, type) {
|
|
1935
|
-
type.parameters = FromTypes(args, type.parameters);
|
|
1936
|
-
type.returns = FromType(args, type.returns);
|
|
1937
|
-
return type;
|
|
1938
|
-
}
|
|
1939
|
-
function FromFunction2(args, type) {
|
|
1940
|
-
type.parameters = FromTypes(args, type.parameters);
|
|
1941
|
-
type.returns = FromType(args, type.returns);
|
|
1942
|
-
return type;
|
|
1943
|
-
}
|
|
1944
|
-
function FromIntersect5(args, type) {
|
|
1945
|
-
type.allOf = FromTypes(args, type.allOf);
|
|
1946
|
-
return type;
|
|
1947
|
-
}
|
|
1948
|
-
function FromUnion7(args, type) {
|
|
1949
|
-
type.anyOf = FromTypes(args, type.anyOf);
|
|
1950
|
-
return type;
|
|
1951
|
-
}
|
|
1952
|
-
function FromTuple4(args, type) {
|
|
1953
|
-
if (IsUndefined(type.items))
|
|
1954
|
-
return type;
|
|
1955
|
-
type.items = FromTypes(args, type.items);
|
|
1956
|
-
return type;
|
|
1957
|
-
}
|
|
1958
|
-
function FromArray5(args, type) {
|
|
1959
|
-
type.items = FromType(args, type.items);
|
|
1960
|
-
return type;
|
|
1961
|
-
}
|
|
1962
|
-
function FromAsyncIterator2(args, type) {
|
|
1963
|
-
type.items = FromType(args, type.items);
|
|
1964
|
-
return type;
|
|
1829
|
+
function ExcludeRest(L, R) {
|
|
1830
|
+
const excluded = L.filter((inner) => ExtendsCheck(inner, R) === ExtendsResult.False);
|
|
1831
|
+
return excluded.length === 1 ? excluded[0] : Union(excluded);
|
|
1965
1832
|
}
|
|
1966
|
-
function
|
|
1967
|
-
|
|
1968
|
-
|
|
1833
|
+
function Exclude(L, R, options = {}) {
|
|
1834
|
+
if (IsTemplateLiteral(L))
|
|
1835
|
+
return CreateType(ExcludeFromTemplateLiteral(L, R), options);
|
|
1836
|
+
if (IsMappedResult(L))
|
|
1837
|
+
return CreateType(ExcludeFromMappedResult(L, R), options);
|
|
1838
|
+
return CreateType(IsUnion(L) ? ExcludeRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? Never() : L, options);
|
|
1969
1839
|
}
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1840
|
+
|
|
1841
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs
|
|
1842
|
+
function FromProperties9(P, U) {
|
|
1843
|
+
const Acc = {};
|
|
1844
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
1845
|
+
Acc[K2] = Exclude(P[K2], U);
|
|
1846
|
+
return Acc;
|
|
1973
1847
|
}
|
|
1974
|
-
function
|
|
1975
|
-
|
|
1976
|
-
return { ...type, ...Object2(mappedProperties) };
|
|
1848
|
+
function FromMappedResult7(R, T) {
|
|
1849
|
+
return FromProperties9(R.properties, T);
|
|
1977
1850
|
}
|
|
1978
|
-
function
|
|
1979
|
-
const
|
|
1980
|
-
|
|
1981
|
-
const result = Record(mappedKey, mappedValue);
|
|
1982
|
-
return { ...type, ...result };
|
|
1851
|
+
function ExcludeFromMappedResult(R, T) {
|
|
1852
|
+
const P = FromMappedResult7(R, T);
|
|
1853
|
+
return MappedResult(P);
|
|
1983
1854
|
}
|
|
1984
|
-
|
|
1985
|
-
|
|
1855
|
+
|
|
1856
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.mjs
|
|
1857
|
+
function ExtractFromTemplateLiteral(L, R) {
|
|
1858
|
+
return Extract(TemplateLiteralToUnion(L), R);
|
|
1986
1859
|
}
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
const
|
|
1991
|
-
return
|
|
1860
|
+
|
|
1861
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/extract/extract.mjs
|
|
1862
|
+
function ExtractRest(L, R) {
|
|
1863
|
+
const extracted = L.filter((inner) => ExtendsCheck(inner, R) !== ExtendsResult.False);
|
|
1864
|
+
return extracted.length === 1 ? extracted[0] : Union(extracted);
|
|
1992
1865
|
}
|
|
1993
|
-
function
|
|
1994
|
-
|
|
1995
|
-
return
|
|
1996
|
-
|
|
1866
|
+
function Extract(L, R, options) {
|
|
1867
|
+
if (IsTemplateLiteral(L))
|
|
1868
|
+
return CreateType(ExtractFromTemplateLiteral(L, R), options);
|
|
1869
|
+
if (IsMappedResult(L))
|
|
1870
|
+
return CreateType(ExtractFromMappedResult(L, R), options);
|
|
1871
|
+
return CreateType(IsUnion(L) ? ExtractRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? L : Never(), options);
|
|
1997
1872
|
}
|
|
1998
|
-
|
|
1999
|
-
|
|
1873
|
+
|
|
1874
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs
|
|
1875
|
+
function FromProperties10(P, T) {
|
|
1876
|
+
const Acc = {};
|
|
1877
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
1878
|
+
Acc[K2] = Extract(P[K2], T);
|
|
1879
|
+
return Acc;
|
|
2000
1880
|
}
|
|
2001
|
-
function
|
|
2002
|
-
return
|
|
1881
|
+
function FromMappedResult8(R, T) {
|
|
1882
|
+
return FromProperties10(R.properties, T);
|
|
2003
1883
|
}
|
|
2004
|
-
function
|
|
2005
|
-
|
|
1884
|
+
function ExtractFromMappedResult(R, T) {
|
|
1885
|
+
const P = FromMappedResult8(R, T);
|
|
1886
|
+
return MappedResult(P);
|
|
2006
1887
|
}
|
|
2007
1888
|
|
|
2008
1889
|
// ../../node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs
|
|
@@ -2052,14 +1933,14 @@ function FromTemplateLiteral3(schema, mode, options) {
|
|
|
2052
1933
|
return { ...schema, pattern: FromLiteralValue(schema.pattern, mode) };
|
|
2053
1934
|
const strings = [...TemplateLiteralExpressionGenerate(expression)];
|
|
2054
1935
|
const literals = strings.map((value) => Literal(value));
|
|
2055
|
-
const mapped =
|
|
1936
|
+
const mapped = FromRest4(literals, mode);
|
|
2056
1937
|
const union = Union(mapped);
|
|
2057
1938
|
return TemplateLiteral([union], options);
|
|
2058
1939
|
}
|
|
2059
1940
|
function FromLiteralValue(value, mode) {
|
|
2060
1941
|
return typeof value === "string" ? mode === "Uncapitalize" ? ApplyUncapitalize(value) : mode === "Capitalize" ? ApplyCapitalize(value) : mode === "Uppercase" ? ApplyUppercase(value) : mode === "Lowercase" ? ApplyLowercase(value) : value : value.toString();
|
|
2061
1942
|
}
|
|
2062
|
-
function
|
|
1943
|
+
function FromRest4(T, M) {
|
|
2063
1944
|
return T.map((L) => Intrinsic(L, M));
|
|
2064
1945
|
}
|
|
2065
1946
|
function Intrinsic(schema, mode, options = {}) {
|
|
@@ -2067,7 +1948,7 @@ function Intrinsic(schema, mode, options = {}) {
|
|
|
2067
1948
|
// Intrinsic-Mapped-Inference
|
|
2068
1949
|
IsMappedKey(schema) ? IntrinsicFromMappedKey(schema, mode, options) : (
|
|
2069
1950
|
// Standard-Inference
|
|
2070
|
-
IsTemplateLiteral(schema) ? FromTemplateLiteral3(schema, mode, options) : IsUnion(schema) ? Union(
|
|
1951
|
+
IsTemplateLiteral(schema) ? FromTemplateLiteral3(schema, mode, options) : IsUnion(schema) ? Union(FromRest4(schema.anyOf, mode), options) : IsLiteral(schema) ? Literal(FromLiteralValue(schema.const, mode), options) : (
|
|
2071
1952
|
// Default Type
|
|
2072
1953
|
CreateType(schema, options)
|
|
2073
1954
|
)
|
|
@@ -2095,15 +1976,48 @@ function Uppercase(T, options = {}) {
|
|
|
2095
1976
|
return Intrinsic(T, "Uppercase", options);
|
|
2096
1977
|
}
|
|
2097
1978
|
|
|
1979
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/not/not.mjs
|
|
1980
|
+
function Not(type, options) {
|
|
1981
|
+
return CreateType({ [Kind]: "Not", not: type }, options);
|
|
1982
|
+
}
|
|
1983
|
+
|
|
1984
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs
|
|
1985
|
+
function CloneType(schema, options) {
|
|
1986
|
+
return options === void 0 ? Clone(schema) : Clone({ ...options, ...schema });
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs
|
|
1990
|
+
function FromComputed2(target, parameters) {
|
|
1991
|
+
return Computed("Awaited", [Computed(target, parameters)]);
|
|
1992
|
+
}
|
|
1993
|
+
function FromRef2($ref) {
|
|
1994
|
+
return Computed("Awaited", [Ref($ref)]);
|
|
1995
|
+
}
|
|
1996
|
+
function FromIntersect4(types) {
|
|
1997
|
+
return Intersect(FromRest5(types));
|
|
1998
|
+
}
|
|
1999
|
+
function FromUnion6(types) {
|
|
2000
|
+
return Union(FromRest5(types));
|
|
2001
|
+
}
|
|
2002
|
+
function FromPromise2(type) {
|
|
2003
|
+
return Awaited(type);
|
|
2004
|
+
}
|
|
2005
|
+
function FromRest5(types) {
|
|
2006
|
+
return types.map((type) => Awaited(type));
|
|
2007
|
+
}
|
|
2008
|
+
function Awaited(type, options) {
|
|
2009
|
+
return CreateType(IsComputed(type) ? FromComputed2(type.target, type.parameters) : IsIntersect(type) ? FromIntersect4(type.allOf) : IsUnion(type) ? FromUnion6(type.anyOf) : IsPromise2(type) ? FromPromise2(type.item) : IsRef(type) ? FromRef2(type.$ref) : type, options);
|
|
2010
|
+
}
|
|
2011
|
+
|
|
2098
2012
|
// ../../node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs
|
|
2099
|
-
function
|
|
2013
|
+
function FromProperties11(properties, propertyKeys, options) {
|
|
2100
2014
|
const result = {};
|
|
2101
2015
|
for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
|
|
2102
2016
|
result[K2] = Omit(properties[K2], propertyKeys, Clone(options));
|
|
2103
2017
|
return result;
|
|
2104
2018
|
}
|
|
2105
2019
|
function FromMappedResult9(mappedResult, propertyKeys, options) {
|
|
2106
|
-
return
|
|
2020
|
+
return FromProperties11(mappedResult.properties, propertyKeys, options);
|
|
2107
2021
|
}
|
|
2108
2022
|
function OmitFromMappedResult(mappedResult, propertyKeys, options) {
|
|
2109
2023
|
const properties = FromMappedResult9(mappedResult, propertyKeys, options);
|
|
@@ -2111,22 +2025,22 @@ function OmitFromMappedResult(mappedResult, propertyKeys, options) {
|
|
|
2111
2025
|
}
|
|
2112
2026
|
|
|
2113
2027
|
// ../../node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs
|
|
2114
|
-
function
|
|
2028
|
+
function FromIntersect5(types, propertyKeys) {
|
|
2115
2029
|
return types.map((type) => OmitResolve(type, propertyKeys));
|
|
2116
2030
|
}
|
|
2117
|
-
function
|
|
2031
|
+
function FromUnion7(types, propertyKeys) {
|
|
2118
2032
|
return types.map((type) => OmitResolve(type, propertyKeys));
|
|
2119
2033
|
}
|
|
2120
|
-
function
|
|
2034
|
+
function FromProperty2(properties, key) {
|
|
2121
2035
|
const { [key]: _, ...R } = properties;
|
|
2122
2036
|
return R;
|
|
2123
2037
|
}
|
|
2124
|
-
function
|
|
2125
|
-
return propertyKeys.reduce((T, K2) =>
|
|
2038
|
+
function FromProperties12(properties, propertyKeys) {
|
|
2039
|
+
return propertyKeys.reduce((T, K2) => FromProperty2(T, K2), properties);
|
|
2126
2040
|
}
|
|
2127
|
-
function
|
|
2041
|
+
function FromObject2(type, propertyKeys, properties) {
|
|
2128
2042
|
const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
|
|
2129
|
-
const mappedProperties =
|
|
2043
|
+
const mappedProperties = FromProperties12(properties, propertyKeys);
|
|
2130
2044
|
return Object2(mappedProperties, options);
|
|
2131
2045
|
}
|
|
2132
2046
|
function UnionFromPropertyKeys(propertyKeys) {
|
|
@@ -2134,10 +2048,10 @@ function UnionFromPropertyKeys(propertyKeys) {
|
|
|
2134
2048
|
return Union(result);
|
|
2135
2049
|
}
|
|
2136
2050
|
function OmitResolve(type, propertyKeys) {
|
|
2137
|
-
return IsIntersect(type) ? Intersect(
|
|
2051
|
+
return IsIntersect(type) ? Intersect(FromIntersect5(type.allOf, propertyKeys)) : IsUnion(type) ? Union(FromUnion7(type.anyOf, propertyKeys)) : IsObject3(type) ? FromObject2(type, propertyKeys, type.properties) : Object2({});
|
|
2138
2052
|
}
|
|
2139
2053
|
function Omit(type, key, options) {
|
|
2140
|
-
const typeKey =
|
|
2054
|
+
const typeKey = IsArray2(key) ? UnionFromPropertyKeys(key) : key;
|
|
2141
2055
|
const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
|
|
2142
2056
|
const isTypeRef = IsRef(type);
|
|
2143
2057
|
const isKeyRef = IsRef(key);
|
|
@@ -2162,14 +2076,14 @@ function OmitFromMappedKey(type, mappedKey, options) {
|
|
|
2162
2076
|
}
|
|
2163
2077
|
|
|
2164
2078
|
// ../../node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs
|
|
2165
|
-
function
|
|
2079
|
+
function FromProperties13(properties, propertyKeys, options) {
|
|
2166
2080
|
const result = {};
|
|
2167
2081
|
for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
|
|
2168
2082
|
result[K2] = Pick(properties[K2], propertyKeys, Clone(options));
|
|
2169
2083
|
return result;
|
|
2170
2084
|
}
|
|
2171
2085
|
function FromMappedResult10(mappedResult, propertyKeys, options) {
|
|
2172
|
-
return
|
|
2086
|
+
return FromProperties13(mappedResult.properties, propertyKeys, options);
|
|
2173
2087
|
}
|
|
2174
2088
|
function PickFromMappedResult(mappedResult, propertyKeys, options) {
|
|
2175
2089
|
const properties = FromMappedResult10(mappedResult, propertyKeys, options);
|
|
@@ -2177,22 +2091,22 @@ function PickFromMappedResult(mappedResult, propertyKeys, options) {
|
|
|
2177
2091
|
}
|
|
2178
2092
|
|
|
2179
2093
|
// ../../node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs
|
|
2180
|
-
function
|
|
2094
|
+
function FromIntersect6(types, propertyKeys) {
|
|
2181
2095
|
return types.map((type) => PickResolve(type, propertyKeys));
|
|
2182
2096
|
}
|
|
2183
|
-
function
|
|
2097
|
+
function FromUnion8(types, propertyKeys) {
|
|
2184
2098
|
return types.map((type) => PickResolve(type, propertyKeys));
|
|
2185
2099
|
}
|
|
2186
|
-
function
|
|
2100
|
+
function FromProperties14(properties, propertyKeys) {
|
|
2187
2101
|
const result = {};
|
|
2188
2102
|
for (const K2 of propertyKeys)
|
|
2189
2103
|
if (K2 in properties)
|
|
2190
2104
|
result[K2] = properties[K2];
|
|
2191
2105
|
return result;
|
|
2192
2106
|
}
|
|
2193
|
-
function
|
|
2107
|
+
function FromObject3(Type2, keys, properties) {
|
|
2194
2108
|
const options = Discard(Type2, [TransformKind, "$id", "required", "properties"]);
|
|
2195
|
-
const mappedProperties =
|
|
2109
|
+
const mappedProperties = FromProperties14(properties, keys);
|
|
2196
2110
|
return Object2(mappedProperties, options);
|
|
2197
2111
|
}
|
|
2198
2112
|
function UnionFromPropertyKeys2(propertyKeys) {
|
|
@@ -2200,10 +2114,10 @@ function UnionFromPropertyKeys2(propertyKeys) {
|
|
|
2200
2114
|
return Union(result);
|
|
2201
2115
|
}
|
|
2202
2116
|
function PickResolve(type, propertyKeys) {
|
|
2203
|
-
return IsIntersect(type) ? Intersect(
|
|
2117
|
+
return IsIntersect(type) ? Intersect(FromIntersect6(type.allOf, propertyKeys)) : IsUnion(type) ? Union(FromUnion8(type.anyOf, propertyKeys)) : IsObject3(type) ? FromObject3(type, propertyKeys, type.properties) : Object2({});
|
|
2204
2118
|
}
|
|
2205
2119
|
function Pick(type, key, options) {
|
|
2206
|
-
const typeKey =
|
|
2120
|
+
const typeKey = IsArray2(key) ? UnionFromPropertyKeys2(key) : key;
|
|
2207
2121
|
const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
|
|
2208
2122
|
const isTypeRef = IsRef(type);
|
|
2209
2123
|
const isKeyRef = IsRef(key);
|
|
@@ -2236,15 +2150,15 @@ function FromComputed3(target, parameters) {
|
|
|
2236
2150
|
function FromRef3($ref) {
|
|
2237
2151
|
return Computed("Partial", [Ref($ref)]);
|
|
2238
2152
|
}
|
|
2239
|
-
function
|
|
2153
|
+
function FromProperties15(properties) {
|
|
2240
2154
|
const partialProperties = {};
|
|
2241
2155
|
for (const K of globalThis.Object.getOwnPropertyNames(properties))
|
|
2242
2156
|
partialProperties[K] = Optional(properties[K]);
|
|
2243
2157
|
return partialProperties;
|
|
2244
2158
|
}
|
|
2245
|
-
function
|
|
2159
|
+
function FromObject4(type, properties) {
|
|
2246
2160
|
const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
|
|
2247
|
-
const mappedProperties =
|
|
2161
|
+
const mappedProperties = FromProperties15(properties);
|
|
2248
2162
|
return Object2(mappedProperties, options);
|
|
2249
2163
|
}
|
|
2250
2164
|
function FromRest6(types) {
|
|
@@ -2253,9 +2167,9 @@ function FromRest6(types) {
|
|
|
2253
2167
|
function PartialResolve(type) {
|
|
2254
2168
|
return (
|
|
2255
2169
|
// Mappable
|
|
2256
|
-
IsComputed(type) ? FromComputed3(type.target, type.parameters) : IsRef(type) ? FromRef3(type.$ref) : IsIntersect(type) ? Intersect(FromRest6(type.allOf)) : IsUnion(type) ? Union(FromRest6(type.anyOf)) : IsObject3(type) ?
|
|
2170
|
+
IsComputed(type) ? FromComputed3(type.target, type.parameters) : IsRef(type) ? FromRef3(type.$ref) : IsIntersect(type) ? Intersect(FromRest6(type.allOf)) : IsUnion(type) ? Union(FromRest6(type.anyOf)) : IsObject3(type) ? FromObject4(type, type.properties) : (
|
|
2257
2171
|
// Intrinsic
|
|
2258
|
-
|
|
2172
|
+
IsBigInt3(type) ? type : IsBoolean3(type) ? type : IsInteger2(type) ? type : IsLiteral(type) ? type : IsNull3(type) ? type : IsNumber3(type) ? type : IsString3(type) ? type : IsSymbol3(type) ? type : IsUndefined3(type) ? type : (
|
|
2259
2173
|
// Passthrough
|
|
2260
2174
|
Object2({})
|
|
2261
2175
|
)
|
|
@@ -2271,20 +2185,75 @@ function Partial(type, options) {
|
|
|
2271
2185
|
}
|
|
2272
2186
|
|
|
2273
2187
|
// ../../node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs
|
|
2274
|
-
function
|
|
2188
|
+
function FromProperties16(K, options) {
|
|
2275
2189
|
const Acc = {};
|
|
2276
2190
|
for (const K2 of globalThis.Object.getOwnPropertyNames(K))
|
|
2277
2191
|
Acc[K2] = Partial(K[K2], Clone(options));
|
|
2278
2192
|
return Acc;
|
|
2279
2193
|
}
|
|
2280
2194
|
function FromMappedResult11(R, options) {
|
|
2281
|
-
return
|
|
2195
|
+
return FromProperties16(R.properties, options);
|
|
2282
2196
|
}
|
|
2283
2197
|
function PartialFromMappedResult(R, options) {
|
|
2284
2198
|
const P = FromMappedResult11(R, options);
|
|
2285
2199
|
return MappedResult(P);
|
|
2286
2200
|
}
|
|
2287
2201
|
|
|
2202
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/record/record.mjs
|
|
2203
|
+
function RecordCreateFromPattern(pattern, T, options) {
|
|
2204
|
+
return CreateType({ [Kind]: "Record", type: "object", patternProperties: { [pattern]: T } }, options);
|
|
2205
|
+
}
|
|
2206
|
+
function RecordCreateFromKeys(K, T, options) {
|
|
2207
|
+
const result = {};
|
|
2208
|
+
for (const K2 of K)
|
|
2209
|
+
result[K2] = T;
|
|
2210
|
+
return Object2(result, { ...options, [Hint]: "Record" });
|
|
2211
|
+
}
|
|
2212
|
+
function FromTemplateLiteralKey(K, T, options) {
|
|
2213
|
+
return IsTemplateLiteralFinite(K) ? RecordCreateFromKeys(IndexPropertyKeys(K), T, options) : RecordCreateFromPattern(K.pattern, T, options);
|
|
2214
|
+
}
|
|
2215
|
+
function FromUnionKey(key, type, options) {
|
|
2216
|
+
return RecordCreateFromKeys(IndexPropertyKeys(Union(key)), type, options);
|
|
2217
|
+
}
|
|
2218
|
+
function FromLiteralKey(key, type, options) {
|
|
2219
|
+
return RecordCreateFromKeys([key.toString()], type, options);
|
|
2220
|
+
}
|
|
2221
|
+
function FromRegExpKey(key, type, options) {
|
|
2222
|
+
return RecordCreateFromPattern(key.source, type, options);
|
|
2223
|
+
}
|
|
2224
|
+
function FromStringKey(key, type, options) {
|
|
2225
|
+
const pattern = IsUndefined2(key.pattern) ? PatternStringExact : key.pattern;
|
|
2226
|
+
return RecordCreateFromPattern(pattern, type, options);
|
|
2227
|
+
}
|
|
2228
|
+
function FromAnyKey(_, type, options) {
|
|
2229
|
+
return RecordCreateFromPattern(PatternStringExact, type, options);
|
|
2230
|
+
}
|
|
2231
|
+
function FromNeverKey(_key, type, options) {
|
|
2232
|
+
return RecordCreateFromPattern(PatternNeverExact, type, options);
|
|
2233
|
+
}
|
|
2234
|
+
function FromBooleanKey(_key, type, options) {
|
|
2235
|
+
return Object2({ true: type, false: type }, options);
|
|
2236
|
+
}
|
|
2237
|
+
function FromIntegerKey(_key, type, options) {
|
|
2238
|
+
return RecordCreateFromPattern(PatternNumberExact, type, options);
|
|
2239
|
+
}
|
|
2240
|
+
function FromNumberKey(_, type, options) {
|
|
2241
|
+
return RecordCreateFromPattern(PatternNumberExact, type, options);
|
|
2242
|
+
}
|
|
2243
|
+
function Record(key, type, options = {}) {
|
|
2244
|
+
return IsUnion(key) ? FromUnionKey(key.anyOf, type, options) : IsTemplateLiteral(key) ? FromTemplateLiteralKey(key, type, options) : IsLiteral(key) ? FromLiteralKey(key.const, type, options) : IsBoolean3(key) ? FromBooleanKey(key, type, options) : IsInteger2(key) ? FromIntegerKey(key, type, options) : IsNumber3(key) ? FromNumberKey(key, type, options) : IsRegExp2(key) ? FromRegExpKey(key, type, options) : IsString3(key) ? FromStringKey(key, type, options) : IsAny(key) ? FromAnyKey(key, type, options) : IsNever(key) ? FromNeverKey(key, type, options) : Never(options);
|
|
2245
|
+
}
|
|
2246
|
+
function RecordPattern(record) {
|
|
2247
|
+
return globalThis.Object.getOwnPropertyNames(record.patternProperties)[0];
|
|
2248
|
+
}
|
|
2249
|
+
function RecordKey2(type) {
|
|
2250
|
+
const pattern = RecordPattern(type);
|
|
2251
|
+
return pattern === PatternStringExact ? String() : pattern === PatternNumberExact ? Number2() : String({ pattern });
|
|
2252
|
+
}
|
|
2253
|
+
function RecordValue2(type) {
|
|
2254
|
+
return type.patternProperties[RecordPattern(type)];
|
|
2255
|
+
}
|
|
2256
|
+
|
|
2288
2257
|
// ../../node_modules/@sinclair/typebox/build/esm/type/required/required.mjs
|
|
2289
2258
|
function FromComputed4(target, parameters) {
|
|
2290
2259
|
return Computed("Required", [Computed(target, parameters)]);
|
|
@@ -2292,15 +2261,15 @@ function FromComputed4(target, parameters) {
|
|
|
2292
2261
|
function FromRef4($ref) {
|
|
2293
2262
|
return Computed("Required", [Ref($ref)]);
|
|
2294
2263
|
}
|
|
2295
|
-
function
|
|
2264
|
+
function FromProperties17(properties) {
|
|
2296
2265
|
const requiredProperties = {};
|
|
2297
2266
|
for (const K of globalThis.Object.getOwnPropertyNames(properties))
|
|
2298
2267
|
requiredProperties[K] = Discard(properties[K], [OptionalKind]);
|
|
2299
2268
|
return requiredProperties;
|
|
2300
2269
|
}
|
|
2301
|
-
function
|
|
2270
|
+
function FromObject5(type, properties) {
|
|
2302
2271
|
const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
|
|
2303
|
-
const mappedProperties =
|
|
2272
|
+
const mappedProperties = FromProperties17(properties);
|
|
2304
2273
|
return Object2(mappedProperties, options);
|
|
2305
2274
|
}
|
|
2306
2275
|
function FromRest7(types) {
|
|
@@ -2309,9 +2278,9 @@ function FromRest7(types) {
|
|
|
2309
2278
|
function RequiredResolve(type) {
|
|
2310
2279
|
return (
|
|
2311
2280
|
// Mappable
|
|
2312
|
-
IsComputed(type) ? FromComputed4(type.target, type.parameters) : IsRef(type) ? FromRef4(type.$ref) : IsIntersect(type) ? Intersect(FromRest7(type.allOf)) : IsUnion(type) ? Union(FromRest7(type.anyOf)) : IsObject3(type) ?
|
|
2281
|
+
IsComputed(type) ? FromComputed4(type.target, type.parameters) : IsRef(type) ? FromRef4(type.$ref) : IsIntersect(type) ? Intersect(FromRest7(type.allOf)) : IsUnion(type) ? Union(FromRest7(type.anyOf)) : IsObject3(type) ? FromObject5(type, type.properties) : (
|
|
2313
2282
|
// Intrinsic
|
|
2314
|
-
|
|
2283
|
+
IsBigInt3(type) ? type : IsBoolean3(type) ? type : IsInteger2(type) ? type : IsLiteral(type) ? type : IsNull3(type) ? type : IsNumber3(type) ? type : IsString3(type) ? type : IsSymbol3(type) ? type : IsUndefined3(type) ? type : (
|
|
2315
2284
|
// Passthrough
|
|
2316
2285
|
Object2({})
|
|
2317
2286
|
)
|
|
@@ -2327,14 +2296,14 @@ function Required(type, options) {
|
|
|
2327
2296
|
}
|
|
2328
2297
|
|
|
2329
2298
|
// ../../node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs
|
|
2330
|
-
function
|
|
2299
|
+
function FromProperties18(P, options) {
|
|
2331
2300
|
const Acc = {};
|
|
2332
2301
|
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
2333
2302
|
Acc[K2] = Required(P[K2], options);
|
|
2334
2303
|
return Acc;
|
|
2335
2304
|
}
|
|
2336
2305
|
function FromMappedResult12(R, options) {
|
|
2337
|
-
return
|
|
2306
|
+
return FromProperties18(R.properties, options);
|
|
2338
2307
|
}
|
|
2339
2308
|
function RequiredFromMappedResult(R, options) {
|
|
2340
2309
|
const P = FromMappedResult12(R, options);
|
|
@@ -2344,11 +2313,11 @@ function RequiredFromMappedResult(R, options) {
|
|
|
2344
2313
|
// ../../node_modules/@sinclair/typebox/build/esm/type/module/compute.mjs
|
|
2345
2314
|
function DereferenceParameters(moduleProperties, types) {
|
|
2346
2315
|
return types.map((type) => {
|
|
2347
|
-
return IsRef(type) ? Dereference(moduleProperties, type.$ref) :
|
|
2316
|
+
return IsRef(type) ? Dereference(moduleProperties, type.$ref) : FromType(moduleProperties, type);
|
|
2348
2317
|
});
|
|
2349
2318
|
}
|
|
2350
2319
|
function Dereference(moduleProperties, ref) {
|
|
2351
|
-
return ref in moduleProperties ? IsRef(moduleProperties[ref]) ? Dereference(moduleProperties, moduleProperties[ref].$ref) :
|
|
2320
|
+
return ref in moduleProperties ? IsRef(moduleProperties[ref]) ? Dereference(moduleProperties, moduleProperties[ref].$ref) : FromType(moduleProperties, moduleProperties[ref]) : Never();
|
|
2352
2321
|
}
|
|
2353
2322
|
function FromAwaited(parameters) {
|
|
2354
2323
|
return Awaited(parameters[0]);
|
|
@@ -2375,31 +2344,31 @@ function FromComputed5(moduleProperties, target, parameters) {
|
|
|
2375
2344
|
const dereferenced = DereferenceParameters(moduleProperties, parameters);
|
|
2376
2345
|
return target === "Awaited" ? FromAwaited(dereferenced) : target === "Index" ? FromIndex(dereferenced) : target === "KeyOf" ? FromKeyOf(dereferenced) : target === "Partial" ? FromPartial(dereferenced) : target === "Omit" ? FromOmit(dereferenced) : target === "Pick" ? FromPick(dereferenced) : target === "Required" ? FromRequired(dereferenced) : Never();
|
|
2377
2346
|
}
|
|
2378
|
-
function
|
|
2379
|
-
return Array2(
|
|
2347
|
+
function FromArray5(moduleProperties, type) {
|
|
2348
|
+
return Array2(FromType(moduleProperties, type));
|
|
2380
2349
|
}
|
|
2381
|
-
function
|
|
2382
|
-
return AsyncIterator(
|
|
2350
|
+
function FromAsyncIterator2(moduleProperties, type) {
|
|
2351
|
+
return AsyncIterator(FromType(moduleProperties, type));
|
|
2383
2352
|
}
|
|
2384
|
-
function
|
|
2385
|
-
return Constructor(
|
|
2353
|
+
function FromConstructor2(moduleProperties, parameters, instanceType) {
|
|
2354
|
+
return Constructor(FromTypes(moduleProperties, parameters), FromType(moduleProperties, instanceType));
|
|
2386
2355
|
}
|
|
2387
|
-
function
|
|
2388
|
-
return Function(
|
|
2356
|
+
function FromFunction2(moduleProperties, parameters, returnType) {
|
|
2357
|
+
return Function(FromTypes(moduleProperties, parameters), FromType(moduleProperties, returnType));
|
|
2389
2358
|
}
|
|
2390
|
-
function
|
|
2391
|
-
return Intersect(
|
|
2359
|
+
function FromIntersect7(moduleProperties, types) {
|
|
2360
|
+
return Intersect(FromTypes(moduleProperties, types));
|
|
2392
2361
|
}
|
|
2393
|
-
function
|
|
2394
|
-
return Iterator(
|
|
2362
|
+
function FromIterator2(moduleProperties, type) {
|
|
2363
|
+
return Iterator(FromType(moduleProperties, type));
|
|
2395
2364
|
}
|
|
2396
|
-
function
|
|
2365
|
+
function FromObject6(moduleProperties, properties) {
|
|
2397
2366
|
return Object2(globalThis.Object.keys(properties).reduce((result, key) => {
|
|
2398
|
-
return { ...result, [key]:
|
|
2367
|
+
return { ...result, [key]: FromType(moduleProperties, properties[key]) };
|
|
2399
2368
|
}, {}));
|
|
2400
2369
|
}
|
|
2401
|
-
function
|
|
2402
|
-
const [value, pattern] = [
|
|
2370
|
+
function FromRecord2(moduleProperties, type) {
|
|
2371
|
+
const [value, pattern] = [FromType(moduleProperties, RecordValue2(type)), RecordPattern(type)];
|
|
2403
2372
|
const result = CloneType(type);
|
|
2404
2373
|
result.patternProperties[pattern] = value;
|
|
2405
2374
|
return result;
|
|
@@ -2407,29 +2376,29 @@ function FromRecord3(moduleProperties, type) {
|
|
|
2407
2376
|
function FromTransform(moduleProperties, transform) {
|
|
2408
2377
|
return IsRef(transform) ? { ...Dereference(moduleProperties, transform.$ref), [TransformKind]: transform[TransformKind] } : transform;
|
|
2409
2378
|
}
|
|
2410
|
-
function
|
|
2411
|
-
return Tuple(
|
|
2379
|
+
function FromTuple4(moduleProperties, types) {
|
|
2380
|
+
return Tuple(FromTypes(moduleProperties, types));
|
|
2412
2381
|
}
|
|
2413
|
-
function
|
|
2414
|
-
return Union(
|
|
2382
|
+
function FromUnion9(moduleProperties, types) {
|
|
2383
|
+
return Union(FromTypes(moduleProperties, types));
|
|
2415
2384
|
}
|
|
2416
|
-
function
|
|
2417
|
-
return types.map((type) =>
|
|
2385
|
+
function FromTypes(moduleProperties, types) {
|
|
2386
|
+
return types.map((type) => FromType(moduleProperties, type));
|
|
2418
2387
|
}
|
|
2419
|
-
function
|
|
2388
|
+
function FromType(moduleProperties, type) {
|
|
2420
2389
|
return (
|
|
2421
2390
|
// Modifiers
|
|
2422
|
-
IsOptional(type) ? CreateType(
|
|
2391
|
+
IsOptional(type) ? CreateType(FromType(moduleProperties, Discard(type, [OptionalKind])), type) : IsReadonly(type) ? CreateType(FromType(moduleProperties, Discard(type, [ReadonlyKind])), type) : (
|
|
2423
2392
|
// Transform
|
|
2424
2393
|
IsTransform(type) ? CreateType(FromTransform(moduleProperties, type), type) : (
|
|
2425
2394
|
// Types
|
|
2426
|
-
IsArray3(type) ? CreateType(
|
|
2395
|
+
IsArray3(type) ? CreateType(FromArray5(moduleProperties, type.items), type) : IsAsyncIterator3(type) ? CreateType(FromAsyncIterator2(moduleProperties, type.items), type) : IsComputed(type) ? CreateType(FromComputed5(moduleProperties, type.target, type.parameters)) : IsConstructor(type) ? CreateType(FromConstructor2(moduleProperties, type.parameters, type.returns), type) : IsFunction3(type) ? CreateType(FromFunction2(moduleProperties, type.parameters, type.returns), type) : IsIntersect(type) ? CreateType(FromIntersect7(moduleProperties, type.allOf), type) : IsIterator3(type) ? CreateType(FromIterator2(moduleProperties, type.items), type) : IsObject3(type) ? CreateType(FromObject6(moduleProperties, type.properties), type) : IsRecord(type) ? CreateType(FromRecord2(moduleProperties, type)) : IsTuple(type) ? CreateType(FromTuple4(moduleProperties, type.items || []), type) : IsUnion(type) ? CreateType(FromUnion9(moduleProperties, type.anyOf), type) : type
|
|
2427
2396
|
)
|
|
2428
2397
|
)
|
|
2429
2398
|
);
|
|
2430
2399
|
}
|
|
2431
2400
|
function ComputeType(moduleProperties, key) {
|
|
2432
|
-
return key in moduleProperties ?
|
|
2401
|
+
return key in moduleProperties ? FromType(moduleProperties, moduleProperties[key]) : Never();
|
|
2433
2402
|
}
|
|
2434
2403
|
function ComputeModuleProperties(moduleProperties) {
|
|
2435
2404
|
return globalThis.Object.getOwnPropertyNames(moduleProperties).reduce((result, key) => {
|
|
@@ -2460,32 +2429,21 @@ function Module(properties) {
|
|
|
2460
2429
|
return new TModule(properties);
|
|
2461
2430
|
}
|
|
2462
2431
|
|
|
2463
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/
|
|
2464
|
-
function
|
|
2465
|
-
return
|
|
2466
|
-
}
|
|
2467
|
-
|
|
2468
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs
|
|
2469
|
-
function Parameters(schema, options) {
|
|
2470
|
-
return IsFunction2(schema) ? Tuple(schema.parameters, options) : Never();
|
|
2432
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs
|
|
2433
|
+
function ReadonlyOptional(schema) {
|
|
2434
|
+
return Readonly(Optional(schema));
|
|
2471
2435
|
}
|
|
2472
2436
|
|
|
2473
2437
|
// ../../node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs
|
|
2474
2438
|
var Ordinal = 0;
|
|
2475
2439
|
function Recursive(callback, options = {}) {
|
|
2476
|
-
if (
|
|
2440
|
+
if (IsUndefined2(options.$id))
|
|
2477
2441
|
options.$id = `T${Ordinal++}`;
|
|
2478
2442
|
const thisType = CloneType(callback({ [Kind]: "This", $ref: `${options.$id}` }));
|
|
2479
2443
|
thisType.$id = options.$id;
|
|
2480
2444
|
return CreateType({ [Hint]: "Recursive", ...thisType }, options);
|
|
2481
2445
|
}
|
|
2482
2446
|
|
|
2483
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs
|
|
2484
|
-
function RegExp2(unresolved, options) {
|
|
2485
|
-
const expr = IsString(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;
|
|
2486
|
-
return CreateType({ [Kind]: "RegExp", type: "RegExp", source: expr.source, flags: expr.flags }, options);
|
|
2487
|
-
}
|
|
2488
|
-
|
|
2489
2447
|
// ../../node_modules/@sinclair/typebox/build/esm/type/rest/rest.mjs
|
|
2490
2448
|
function RestResolve(T) {
|
|
2491
2449
|
return IsIntersect(T) ? T.allOf : IsUnion(T) ? T.anyOf : IsTuple(T) ? T.items ?? [] : [];
|
|
@@ -2494,11 +2452,6 @@ function Rest(T) {
|
|
|
2494
2452
|
return RestResolve(T);
|
|
2495
2453
|
}
|
|
2496
2454
|
|
|
2497
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs
|
|
2498
|
-
function ReturnType(schema, options) {
|
|
2499
|
-
return IsFunction2(schema) ? CreateType(schema.returns, options) : Never(options);
|
|
2500
|
-
}
|
|
2501
|
-
|
|
2502
2455
|
// ../../node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs
|
|
2503
2456
|
var TransformDecodeBuilder = class {
|
|
2504
2457
|
constructor(schema) {
|
|
@@ -2536,11 +2489,6 @@ function Unsafe(options = {}) {
|
|
|
2536
2489
|
return CreateType({ [Kind]: options[Kind] ?? "Unsafe" }, options);
|
|
2537
2490
|
}
|
|
2538
2491
|
|
|
2539
|
-
// ../../node_modules/@sinclair/typebox/build/esm/type/void/void.mjs
|
|
2540
|
-
function Void(options) {
|
|
2541
|
-
return CreateType({ [Kind]: "Void", type: "void" }, options);
|
|
2542
|
-
}
|
|
2543
|
-
|
|
2544
2492
|
// ../../node_modules/@sinclair/typebox/build/esm/type/type/type.mjs
|
|
2545
2493
|
var type_exports2 = {};
|
|
2546
2494
|
__export(type_exports2, {
|
|
@@ -2593,7 +2541,7 @@ __export(type_exports2, {
|
|
|
2593
2541
|
Required: () => Required,
|
|
2594
2542
|
Rest: () => Rest,
|
|
2595
2543
|
ReturnType: () => ReturnType,
|
|
2596
|
-
String: () =>
|
|
2544
|
+
String: () => String,
|
|
2597
2545
|
Symbol: () => Symbol2,
|
|
2598
2546
|
TemplateLiteral: () => TemplateLiteral,
|
|
2599
2547
|
Transform: () => Transform,
|
|
@@ -2608,146 +2556,163 @@ __export(type_exports2, {
|
|
|
2608
2556
|
Void: () => Void
|
|
2609
2557
|
});
|
|
2610
2558
|
|
|
2559
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/argument/argument.mjs
|
|
2560
|
+
function Argument(index) {
|
|
2561
|
+
return CreateType({ [Kind]: "Argument", index });
|
|
2562
|
+
}
|
|
2563
|
+
|
|
2564
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs
|
|
2565
|
+
function ConstructorParameters(schema, options) {
|
|
2566
|
+
return IsConstructor(schema) ? Tuple(schema.parameters, options) : Never(options);
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs
|
|
2570
|
+
function InstanceType(schema, options) {
|
|
2571
|
+
return IsConstructor(schema) ? CreateType(schema.returns, options) : Never(options);
|
|
2572
|
+
}
|
|
2573
|
+
|
|
2574
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.mjs
|
|
2575
|
+
function FromConstructor3(args, type) {
|
|
2576
|
+
type.parameters = FromTypes2(args, type.parameters);
|
|
2577
|
+
type.returns = FromType2(args, type.returns);
|
|
2578
|
+
return type;
|
|
2579
|
+
}
|
|
2580
|
+
function FromFunction3(args, type) {
|
|
2581
|
+
type.parameters = FromTypes2(args, type.parameters);
|
|
2582
|
+
type.returns = FromType2(args, type.returns);
|
|
2583
|
+
return type;
|
|
2584
|
+
}
|
|
2585
|
+
function FromIntersect8(args, type) {
|
|
2586
|
+
type.allOf = FromTypes2(args, type.allOf);
|
|
2587
|
+
return type;
|
|
2588
|
+
}
|
|
2589
|
+
function FromUnion10(args, type) {
|
|
2590
|
+
type.anyOf = FromTypes2(args, type.anyOf);
|
|
2591
|
+
return type;
|
|
2592
|
+
}
|
|
2593
|
+
function FromTuple5(args, type) {
|
|
2594
|
+
if (IsUndefined2(type.items))
|
|
2595
|
+
return type;
|
|
2596
|
+
type.items = FromTypes2(args, type.items);
|
|
2597
|
+
return type;
|
|
2598
|
+
}
|
|
2599
|
+
function FromArray6(args, type) {
|
|
2600
|
+
type.items = FromType2(args, type.items);
|
|
2601
|
+
return type;
|
|
2602
|
+
}
|
|
2603
|
+
function FromAsyncIterator3(args, type) {
|
|
2604
|
+
type.items = FromType2(args, type.items);
|
|
2605
|
+
return type;
|
|
2606
|
+
}
|
|
2607
|
+
function FromIterator3(args, type) {
|
|
2608
|
+
type.items = FromType2(args, type.items);
|
|
2609
|
+
return type;
|
|
2610
|
+
}
|
|
2611
|
+
function FromPromise3(args, type) {
|
|
2612
|
+
type.item = FromType2(args, type.item);
|
|
2613
|
+
return type;
|
|
2614
|
+
}
|
|
2615
|
+
function FromObject7(args, type) {
|
|
2616
|
+
const mappedProperties = FromProperties19(args, type.properties);
|
|
2617
|
+
return { ...type, ...Object2(mappedProperties) };
|
|
2618
|
+
}
|
|
2619
|
+
function FromRecord3(args, type) {
|
|
2620
|
+
const mappedKey = FromType2(args, RecordKey2(type));
|
|
2621
|
+
const mappedValue = FromType2(args, RecordValue2(type));
|
|
2622
|
+
const result = Record(mappedKey, mappedValue);
|
|
2623
|
+
return { ...type, ...result };
|
|
2624
|
+
}
|
|
2625
|
+
function FromArgument(args, argument) {
|
|
2626
|
+
return argument.index in args ? args[argument.index] : Unknown();
|
|
2627
|
+
}
|
|
2628
|
+
function FromProperty3(args, type) {
|
|
2629
|
+
const isReadonly = IsReadonly(type);
|
|
2630
|
+
const isOptional = IsOptional(type);
|
|
2631
|
+
const mapped = FromType2(args, type);
|
|
2632
|
+
return isReadonly && isOptional ? ReadonlyOptional(mapped) : isReadonly && !isOptional ? Readonly(mapped) : !isReadonly && isOptional ? Optional(mapped) : mapped;
|
|
2633
|
+
}
|
|
2634
|
+
function FromProperties19(args, properties) {
|
|
2635
|
+
return globalThis.Object.getOwnPropertyNames(properties).reduce((result, key) => {
|
|
2636
|
+
return { ...result, [key]: FromProperty3(args, properties[key]) };
|
|
2637
|
+
}, {});
|
|
2638
|
+
}
|
|
2639
|
+
function FromTypes2(args, types) {
|
|
2640
|
+
return types.map((type) => FromType2(args, type));
|
|
2641
|
+
}
|
|
2642
|
+
function FromType2(args, type) {
|
|
2643
|
+
return IsConstructor(type) ? FromConstructor3(args, type) : IsFunction3(type) ? FromFunction3(args, type) : IsIntersect(type) ? FromIntersect8(args, type) : IsUnion(type) ? FromUnion10(args, type) : IsTuple(type) ? FromTuple5(args, type) : IsArray3(type) ? FromArray6(args, type) : IsAsyncIterator3(type) ? FromAsyncIterator3(args, type) : IsIterator3(type) ? FromIterator3(args, type) : IsPromise2(type) ? FromPromise3(args, type) : IsObject3(type) ? FromObject7(args, type) : IsRecord(type) ? FromRecord3(args, type) : IsArgument(type) ? FromArgument(args, type) : type;
|
|
2644
|
+
}
|
|
2645
|
+
function Instantiate(type, args) {
|
|
2646
|
+
return FromType2(args, CloneType(type));
|
|
2647
|
+
}
|
|
2648
|
+
|
|
2649
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs
|
|
2650
|
+
function Parameters(schema, options) {
|
|
2651
|
+
return IsFunction3(schema) ? Tuple(schema.parameters, options) : Never();
|
|
2652
|
+
}
|
|
2653
|
+
|
|
2654
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs
|
|
2655
|
+
function RegExp2(unresolved, options) {
|
|
2656
|
+
const expr = IsString2(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;
|
|
2657
|
+
return CreateType({ [Kind]: "RegExp", type: "RegExp", source: expr.source, flags: expr.flags }, options);
|
|
2658
|
+
}
|
|
2659
|
+
|
|
2660
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs
|
|
2661
|
+
function ReturnType(schema, options) {
|
|
2662
|
+
return IsFunction3(schema) ? CreateType(schema.returns, options) : Never(options);
|
|
2663
|
+
}
|
|
2664
|
+
|
|
2665
|
+
// ../../node_modules/@sinclair/typebox/build/esm/type/void/void.mjs
|
|
2666
|
+
function Void(options) {
|
|
2667
|
+
return CreateType({ [Kind]: "Void", type: "void" }, options);
|
|
2668
|
+
}
|
|
2669
|
+
|
|
2611
2670
|
// ../../node_modules/@sinclair/typebox/build/esm/type/type/index.mjs
|
|
2612
2671
|
var Type = type_exports2;
|
|
2613
2672
|
|
|
2614
|
-
// builtin/extensions/questionnaire/index.ts
|
|
2615
|
-
var QuestionnaireParams = Type.Object({
|
|
2616
|
-
prompt: Type.String({
|
|
2617
|
-
description: "REQUIRED: The question text to display to the user (e.g., 'What is your favorite color?')"
|
|
2618
|
-
}),
|
|
2619
|
-
options: Type.Array(
|
|
2620
|
-
Type.String({ description: "An option label" }),
|
|
2621
|
-
{ description: "REQUIRED: Array of option strings (e.g., ['Red', 'Blue', 'Green']). Must have at least 2 items." }
|
|
2622
|
-
),
|
|
2623
|
-
allowOther: Type.Optional(Type.Boolean({
|
|
2624
|
-
description: "Whether to show '\u270F\uFE0F Other' option for custom input (default: true)",
|
|
2625
|
-
default: true
|
|
2626
|
-
}))
|
|
2627
|
-
});
|
|
2628
|
-
function questionnaireExtension(ctx) {
|
|
2629
|
-
ctx.log("Questionnaire extension loaded");
|
|
2630
|
-
ctx.registerTool({
|
|
2631
|
-
name: "questionnaire",
|
|
2632
|
-
label: "Questionnaire",
|
|
2633
|
-
description: `INTERACTIVE QUESTION TOOL - Ask the user a multiple-choice question with optional "Other" input.
|
|
2634
|
-
|
|
2635
|
-
WHEN TO USE:
|
|
2636
|
-
- Asking the user to choose from multiple options
|
|
2637
|
-
- Getting user confirmation (Yes/No)
|
|
2638
|
-
- Interactive questionnaires or surveys
|
|
2639
|
-
- When you need a definitive answer from the user
|
|
2640
|
-
|
|
2641
|
-
FEATURES:
|
|
2642
|
-
- Auto "\u270F\uFE0F Other" option (default: true) - user can type custom answer
|
|
2643
|
-
- Arrow key navigation (up/down)
|
|
2644
|
-
- Letter shortcuts (A, B, C...)
|
|
2645
|
-
|
|
2646
|
-
PARAMETERS:
|
|
2647
|
-
- prompt: Question text (required)
|
|
2648
|
-
- options: Array of options, min 2 items (required)
|
|
2649
|
-
- allowOther: Show "Other" option (default: true)
|
|
2650
|
-
|
|
2651
|
-
EXAMPLES:
|
|
2652
|
-
1. With auto "Other":
|
|
2653
|
-
{"prompt": "Favorite color?", "options": ["Red", "Blue"]}
|
|
2654
|
-
\u2192 Shows: A. Red, B. Blue, C. \u270F\uFE0F Other
|
|
2655
|
-
|
|
2656
|
-
2. Yes/No only:
|
|
2657
|
-
{"prompt": "Proceed?", "options": ["Yes", "No"], "allowOther": false}
|
|
2658
|
-
|
|
2659
|
-
3. Multiple questions (call tool multiple times):
|
|
2660
|
-
Q1: {"prompt": "Language?", "options": ["Python", "JS"]}
|
|
2661
|
-
Q2: {"prompt": "Framework?", "options": ["React", "Vue"]}`,
|
|
2662
|
-
parameters: QuestionnaireParams,
|
|
2663
|
-
async execute(args) {
|
|
2664
|
-
ctx.log(`[questionnaire] Called with args: ${JSON.stringify(args)}`);
|
|
2665
|
-
const { prompt, options, allowOther = true } = args;
|
|
2666
|
-
if (!prompt || typeof prompt !== "string") {
|
|
2667
|
-
return {
|
|
2668
|
-
content: [{
|
|
2669
|
-
type: "text",
|
|
2670
|
-
text: "Error: 'prompt' parameter is required and must be a string. Example: prompt: 'What is your favorite color?'"
|
|
2671
|
-
}],
|
|
2672
|
-
isError: true
|
|
2673
|
-
};
|
|
2674
|
-
}
|
|
2675
|
-
if (!Array.isArray(options) || options.length < 2) {
|
|
2676
|
-
return {
|
|
2677
|
-
content: [{
|
|
2678
|
-
type: "text",
|
|
2679
|
-
text: "Error: 'options' parameter is required and must be an array with at least 2 items. Example: options: ['Red', 'Blue', 'Green']"
|
|
2680
|
-
}],
|
|
2681
|
-
isError: true
|
|
2682
|
-
};
|
|
2683
|
-
}
|
|
2684
|
-
if (!ctx.hasUI) {
|
|
2685
|
-
const otherText = allowOther ? " / Other" : "";
|
|
2686
|
-
return {
|
|
2687
|
-
content: [{
|
|
2688
|
-
type: "text",
|
|
2689
|
-
text: `${prompt}
|
|
2690
|
-
Options: ${options.join(", ")}${otherText}
|
|
2691
|
-
|
|
2692
|
-
Please reply with your choice.`
|
|
2693
|
-
}],
|
|
2694
|
-
isError: false
|
|
2695
|
-
};
|
|
2696
|
-
}
|
|
2697
|
-
let displayOptions = [...options];
|
|
2698
|
-
if (allowOther !== false) {
|
|
2699
|
-
displayOptions.push("\u270F\uFE0F Other (type your own)");
|
|
2700
|
-
}
|
|
2701
|
-
const optionLabels = displayOptions.map(
|
|
2702
|
-
(opt, idx) => `${String.fromCharCode(65 + idx)}. ${opt}`
|
|
2703
|
-
);
|
|
2704
|
-
const selection = await ctx.ui.select(prompt, optionLabels);
|
|
2705
|
-
if (selection === void 0) {
|
|
2706
|
-
return {
|
|
2707
|
-
content: [{ type: "text", text: "User cancelled the questionnaire" }],
|
|
2708
|
-
details: { cancelled: true }
|
|
2709
|
-
};
|
|
2710
|
-
}
|
|
2711
|
-
const selectedIndex = optionLabels.indexOf(selection);
|
|
2712
|
-
const selectedValue = displayOptions[selectedIndex];
|
|
2713
|
-
if (selectedValue === "\u270F\uFE0F Other (type your own)") {
|
|
2714
|
-
const customAnswer = await ctx.ui.input(`${prompt} (Other)`, "Please specify...");
|
|
2715
|
-
if (customAnswer === void 0) {
|
|
2716
|
-
return {
|
|
2717
|
-
content: [{ type: "text", text: "User cancelled" }],
|
|
2718
|
-
details: { cancelled: true }
|
|
2719
|
-
};
|
|
2720
|
-
}
|
|
2721
|
-
return {
|
|
2722
|
-
content: [{
|
|
2723
|
-
type: "text",
|
|
2724
|
-
text: `Other: ${customAnswer}`
|
|
2725
|
-
}],
|
|
2726
|
-
details: {
|
|
2727
|
-
prompt,
|
|
2728
|
-
selectedValue: customAnswer,
|
|
2729
|
-
isOther: true,
|
|
2730
|
-
cancelled: false
|
|
2731
|
-
}
|
|
2732
|
-
};
|
|
2733
|
-
}
|
|
2734
|
-
return {
|
|
2735
|
-
content: [{
|
|
2736
|
-
type: "text",
|
|
2737
|
-
text: `${String.fromCharCode(65 + selectedIndex)}. ${selectedValue}`
|
|
2738
|
-
}],
|
|
2739
|
-
details: {
|
|
2740
|
-
prompt,
|
|
2741
|
-
selectedValue,
|
|
2742
|
-
selectedIndex: selectedIndex + 1,
|
|
2743
|
-
isOther: false,
|
|
2744
|
-
cancelled: false
|
|
2745
|
-
}
|
|
2746
|
-
};
|
|
2747
|
-
}
|
|
2748
|
-
});
|
|
2749
|
-
ctx.ui.notify("\u2753 Questionnaire extension loaded", "info");
|
|
2750
|
-
}
|
|
2751
2673
|
export {
|
|
2752
|
-
|
|
2674
|
+
IsAsyncIterator,
|
|
2675
|
+
IsIterator,
|
|
2676
|
+
IsStandardObject,
|
|
2677
|
+
IsPromise,
|
|
2678
|
+
IsDate,
|
|
2679
|
+
IsMap,
|
|
2680
|
+
IsSet,
|
|
2681
|
+
IsTypedArray,
|
|
2682
|
+
IsUint8Array,
|
|
2683
|
+
HasPropertyKey,
|
|
2684
|
+
IsObject,
|
|
2685
|
+
IsArray,
|
|
2686
|
+
IsUndefined,
|
|
2687
|
+
IsNull,
|
|
2688
|
+
IsBoolean,
|
|
2689
|
+
IsNumber,
|
|
2690
|
+
IsInteger,
|
|
2691
|
+
IsBigInt,
|
|
2692
|
+
IsString,
|
|
2693
|
+
IsFunction,
|
|
2694
|
+
IsSymbol,
|
|
2695
|
+
IsValueType,
|
|
2696
|
+
TypeSystemPolicy,
|
|
2697
|
+
TypeBoxError,
|
|
2698
|
+
TransformKind,
|
|
2699
|
+
Kind,
|
|
2700
|
+
IsTransform,
|
|
2701
|
+
IsUndefined3 as IsUndefined2,
|
|
2702
|
+
IsKind,
|
|
2703
|
+
IsSchema,
|
|
2704
|
+
IsSchema2,
|
|
2705
|
+
Never,
|
|
2706
|
+
Union,
|
|
2707
|
+
IsTemplateLiteralFinite,
|
|
2708
|
+
TemplateLiteralGenerate,
|
|
2709
|
+
Literal,
|
|
2710
|
+
String,
|
|
2711
|
+
IndexFromPropertyKeys,
|
|
2712
|
+
Object2 as Object,
|
|
2713
|
+
Ref,
|
|
2714
|
+
KeyOfPropertyKeys,
|
|
2715
|
+
KeyOfPattern,
|
|
2716
|
+
Unknown,
|
|
2717
|
+
Type
|
|
2753
2718
|
};
|