@spfn/auth 0.1.0-alpha.87 → 0.2.0-beta.1
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 +1385 -1199
- package/dist/config.d.ts +405 -0
- package/dist/config.js +240 -0
- package/dist/config.js.map +1 -0
- package/dist/dto-81uR9gzF.d.ts +630 -0
- package/dist/errors.d.ts +196 -0
- package/dist/errors.js +173 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +273 -14
- package/dist/index.js +511 -6665
- package/dist/index.js.map +1 -1
- package/dist/nextjs/api.js +345 -0
- package/dist/nextjs/api.js.map +1 -0
- package/dist/{adapters/nextjs → nextjs}/server.d.ts +47 -65
- package/dist/nextjs/server.js +179 -0
- package/dist/nextjs/server.js.map +1 -0
- package/dist/server.d.ts +4328 -529
- package/dist/server.js +7841 -1247
- package/dist/server.js.map +1 -1
- package/migrations/{0000_familiar_firebrand.sql → 0000_mysterious_colossus.sql} +53 -23
- package/migrations/meta/0000_snapshot.json +281 -46
- package/migrations/meta/_journal.json +2 -2
- package/package.json +33 -33
- package/dist/adapters/nextjs/api.d.ts +0 -446
- package/dist/adapters/nextjs/api.js +0 -3279
- package/dist/adapters/nextjs/api.js.map +0 -1
- package/dist/adapters/nextjs/server.js +0 -3645
- package/dist/adapters/nextjs/server.js.map +0 -1
- package/dist/lib/api/auth-codes-verify.d.ts +0 -37
- package/dist/lib/api/auth-codes-verify.js +0 -2949
- package/dist/lib/api/auth-codes-verify.js.map +0 -1
- package/dist/lib/api/auth-codes.d.ts +0 -37
- package/dist/lib/api/auth-codes.js +0 -2949
- package/dist/lib/api/auth-codes.js.map +0 -1
- package/dist/lib/api/auth-exists.d.ts +0 -38
- package/dist/lib/api/auth-exists.js +0 -2949
- package/dist/lib/api/auth-exists.js.map +0 -1
- package/dist/lib/api/auth-invitations-accept.d.ts +0 -38
- package/dist/lib/api/auth-invitations-accept.js +0 -2883
- package/dist/lib/api/auth-invitations-accept.js.map +0 -1
- package/dist/lib/api/auth-invitations-cancel.d.ts +0 -37
- package/dist/lib/api/auth-invitations-cancel.js +0 -2883
- package/dist/lib/api/auth-invitations-cancel.js.map +0 -1
- package/dist/lib/api/auth-invitations-delete.d.ts +0 -36
- package/dist/lib/api/auth-invitations-delete.js +0 -2883
- package/dist/lib/api/auth-invitations-delete.js.map +0 -1
- package/dist/lib/api/auth-invitations-resend.d.ts +0 -37
- package/dist/lib/api/auth-invitations-resend.js +0 -2883
- package/dist/lib/api/auth-invitations-resend.js.map +0 -1
- package/dist/lib/api/auth-invitations.d.ts +0 -109
- package/dist/lib/api/auth-invitations.js +0 -2887
- package/dist/lib/api/auth-invitations.js.map +0 -1
- package/dist/lib/api/auth-keys-rotate.d.ts +0 -37
- package/dist/lib/api/auth-keys-rotate.js +0 -2949
- package/dist/lib/api/auth-keys-rotate.js.map +0 -1
- package/dist/lib/api/auth-login.d.ts +0 -39
- package/dist/lib/api/auth-login.js +0 -2949
- package/dist/lib/api/auth-login.js.map +0 -1
- package/dist/lib/api/auth-logout.d.ts +0 -36
- package/dist/lib/api/auth-logout.js +0 -2949
- package/dist/lib/api/auth-logout.js.map +0 -1
- package/dist/lib/api/auth-me.d.ts +0 -50
- package/dist/lib/api/auth-me.js +0 -2949
- package/dist/lib/api/auth-me.js.map +0 -1
- package/dist/lib/api/auth-password.d.ts +0 -36
- package/dist/lib/api/auth-password.js +0 -2949
- package/dist/lib/api/auth-password.js.map +0 -1
- package/dist/lib/api/auth-register.d.ts +0 -38
- package/dist/lib/api/auth-register.js +0 -2949
- package/dist/lib/api/auth-register.js.map +0 -1
- package/dist/lib/api/index.d.ts +0 -356
- package/dist/lib/api/index.js +0 -3261
- package/dist/lib/api/index.js.map +0 -1
- package/dist/lib/config.d.ts +0 -70
- package/dist/lib/config.js +0 -64
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/contracts/auth.d.ts +0 -302
- package/dist/lib/contracts/auth.js +0 -2951
- package/dist/lib/contracts/auth.js.map +0 -1
- package/dist/lib/contracts/index.d.ts +0 -3
- package/dist/lib/contracts/index.js +0 -3190
- package/dist/lib/contracts/index.js.map +0 -1
- package/dist/lib/contracts/invitation.d.ts +0 -243
- package/dist/lib/contracts/invitation.js +0 -2883
- package/dist/lib/contracts/invitation.js.map +0 -1
- package/dist/lib/crypto.d.ts +0 -76
- package/dist/lib/crypto.js +0 -127
- package/dist/lib/crypto.js.map +0 -1
- package/dist/lib/index.d.ts +0 -4
- package/dist/lib/index.js +0 -313
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/session.d.ts +0 -68
- package/dist/lib/session.js +0 -126
- package/dist/lib/session.js.map +0 -1
- package/dist/lib/types/api.d.ts +0 -45
- package/dist/lib/types/api.js +0 -1
- package/dist/lib/types/api.js.map +0 -1
- package/dist/lib/types/index.d.ts +0 -3
- package/dist/lib/types/index.js +0 -2647
- package/dist/lib/types/index.js.map +0 -1
- package/dist/lib/types/schemas.d.ts +0 -45
- package/dist/lib/types/schemas.js +0 -2647
- package/dist/lib/types/schemas.js.map +0 -1
- package/dist/lib.js +0 -1
- package/dist/lib.js.map +0 -1
- package/dist/plugin.d.ts +0 -12
- package/dist/plugin.js +0 -9083
- package/dist/plugin.js.map +0 -1
- package/dist/server/entities/index.d.ts +0 -11
- package/dist/server/entities/index.js +0 -395
- package/dist/server/entities/index.js.map +0 -1
- package/dist/server/entities/invitations.d.ts +0 -241
- package/dist/server/entities/invitations.js +0 -184
- package/dist/server/entities/invitations.js.map +0 -1
- package/dist/server/entities/permissions.d.ts +0 -196
- package/dist/server/entities/permissions.js +0 -49
- package/dist/server/entities/permissions.js.map +0 -1
- package/dist/server/entities/role-permissions.d.ts +0 -107
- package/dist/server/entities/role-permissions.js +0 -115
- package/dist/server/entities/role-permissions.js.map +0 -1
- package/dist/server/entities/roles.d.ts +0 -196
- package/dist/server/entities/roles.js +0 -50
- package/dist/server/entities/roles.js.map +0 -1
- package/dist/server/entities/schema.d.ts +0 -14
- package/dist/server/entities/schema.js +0 -7
- package/dist/server/entities/schema.js.map +0 -1
- package/dist/server/entities/user-permissions.d.ts +0 -163
- package/dist/server/entities/user-permissions.js +0 -193
- package/dist/server/entities/user-permissions.js.map +0 -1
- package/dist/server/entities/user-public-keys.d.ts +0 -227
- package/dist/server/entities/user-public-keys.js +0 -156
- package/dist/server/entities/user-public-keys.js.map +0 -1
- package/dist/server/entities/user-social-accounts.d.ts +0 -189
- package/dist/server/entities/user-social-accounts.js +0 -149
- package/dist/server/entities/user-social-accounts.js.map +0 -1
- package/dist/server/entities/users.d.ts +0 -235
- package/dist/server/entities/users.js +0 -117
- package/dist/server/entities/users.js.map +0 -1
- package/dist/server/entities/verification-codes.d.ts +0 -191
- package/dist/server/entities/verification-codes.js +0 -49
- package/dist/server/entities/verification-codes.js.map +0 -1
- package/dist/server/routes/auth/index.d.ts +0 -10
- package/dist/server/routes/auth/index.js +0 -4460
- package/dist/server/routes/auth/index.js.map +0 -1
- package/dist/server/routes/index.d.ts +0 -6
- package/dist/server/routes/index.js +0 -6584
- package/dist/server/routes/index.js.map +0 -1
- package/dist/server/routes/invitations/index.d.ts +0 -10
- package/dist/server/routes/invitations/index.js +0 -4395
- package/dist/server/routes/invitations/index.js.map +0 -1
- /package/dist/{lib.d.ts → nextjs/api.d.ts} +0 -0
|
@@ -1,2949 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __export = (target, all) => {
|
|
3
|
-
for (var name in all)
|
|
4
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
// src/lib/api/auth-codes-verify.ts
|
|
8
|
-
import { client } from "@spfn/core/client";
|
|
9
|
-
|
|
10
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
11
|
-
var value_exports = {};
|
|
12
|
-
__export(value_exports, {
|
|
13
|
-
HasPropertyKey: () => HasPropertyKey,
|
|
14
|
-
IsArray: () => IsArray,
|
|
15
|
-
IsAsyncIterator: () => IsAsyncIterator,
|
|
16
|
-
IsBigInt: () => IsBigInt,
|
|
17
|
-
IsBoolean: () => IsBoolean,
|
|
18
|
-
IsDate: () => IsDate,
|
|
19
|
-
IsFunction: () => IsFunction,
|
|
20
|
-
IsIterator: () => IsIterator,
|
|
21
|
-
IsNull: () => IsNull,
|
|
22
|
-
IsNumber: () => IsNumber,
|
|
23
|
-
IsObject: () => IsObject,
|
|
24
|
-
IsRegExp: () => IsRegExp,
|
|
25
|
-
IsString: () => IsString,
|
|
26
|
-
IsSymbol: () => IsSymbol,
|
|
27
|
-
IsUint8Array: () => IsUint8Array,
|
|
28
|
-
IsUndefined: () => IsUndefined
|
|
29
|
-
});
|
|
30
|
-
function HasPropertyKey(value, key) {
|
|
31
|
-
return key in value;
|
|
32
|
-
}
|
|
33
|
-
function IsAsyncIterator(value) {
|
|
34
|
-
return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.asyncIterator in value;
|
|
35
|
-
}
|
|
36
|
-
function IsArray(value) {
|
|
37
|
-
return Array.isArray(value);
|
|
38
|
-
}
|
|
39
|
-
function IsBigInt(value) {
|
|
40
|
-
return typeof value === "bigint";
|
|
41
|
-
}
|
|
42
|
-
function IsBoolean(value) {
|
|
43
|
-
return typeof value === "boolean";
|
|
44
|
-
}
|
|
45
|
-
function IsDate(value) {
|
|
46
|
-
return value instanceof globalThis.Date;
|
|
47
|
-
}
|
|
48
|
-
function IsFunction(value) {
|
|
49
|
-
return typeof value === "function";
|
|
50
|
-
}
|
|
51
|
-
function IsIterator(value) {
|
|
52
|
-
return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.iterator in value;
|
|
53
|
-
}
|
|
54
|
-
function IsNull(value) {
|
|
55
|
-
return value === null;
|
|
56
|
-
}
|
|
57
|
-
function IsNumber(value) {
|
|
58
|
-
return typeof value === "number";
|
|
59
|
-
}
|
|
60
|
-
function IsObject(value) {
|
|
61
|
-
return typeof value === "object" && value !== null;
|
|
62
|
-
}
|
|
63
|
-
function IsRegExp(value) {
|
|
64
|
-
return value instanceof globalThis.RegExp;
|
|
65
|
-
}
|
|
66
|
-
function IsString(value) {
|
|
67
|
-
return typeof value === "string";
|
|
68
|
-
}
|
|
69
|
-
function IsSymbol(value) {
|
|
70
|
-
return typeof value === "symbol";
|
|
71
|
-
}
|
|
72
|
-
function IsUint8Array(value) {
|
|
73
|
-
return value instanceof globalThis.Uint8Array;
|
|
74
|
-
}
|
|
75
|
-
function IsUndefined(value) {
|
|
76
|
-
return value === void 0;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/clone/value.mjs
|
|
80
|
-
function ArrayType(value) {
|
|
81
|
-
return value.map((value2) => Visit(value2));
|
|
82
|
-
}
|
|
83
|
-
function DateType(value) {
|
|
84
|
-
return new Date(value.getTime());
|
|
85
|
-
}
|
|
86
|
-
function Uint8ArrayType(value) {
|
|
87
|
-
return new Uint8Array(value);
|
|
88
|
-
}
|
|
89
|
-
function RegExpType(value) {
|
|
90
|
-
return new RegExp(value.source, value.flags);
|
|
91
|
-
}
|
|
92
|
-
function ObjectType(value) {
|
|
93
|
-
const result = {};
|
|
94
|
-
for (const key of Object.getOwnPropertyNames(value)) {
|
|
95
|
-
result[key] = Visit(value[key]);
|
|
96
|
-
}
|
|
97
|
-
for (const key of Object.getOwnPropertySymbols(value)) {
|
|
98
|
-
result[key] = Visit(value[key]);
|
|
99
|
-
}
|
|
100
|
-
return result;
|
|
101
|
-
}
|
|
102
|
-
function Visit(value) {
|
|
103
|
-
return IsArray(value) ? ArrayType(value) : IsDate(value) ? DateType(value) : IsUint8Array(value) ? Uint8ArrayType(value) : IsRegExp(value) ? RegExpType(value) : IsObject(value) ? ObjectType(value) : value;
|
|
104
|
-
}
|
|
105
|
-
function Clone(value) {
|
|
106
|
-
return Visit(value);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs
|
|
110
|
-
function CloneType(schema, options) {
|
|
111
|
-
return options === void 0 ? Clone(schema) : Clone({ ...options, ...schema });
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs
|
|
115
|
-
function IsObject2(value) {
|
|
116
|
-
return value !== null && typeof value === "object";
|
|
117
|
-
}
|
|
118
|
-
function IsArray2(value) {
|
|
119
|
-
return globalThis.Array.isArray(value) && !globalThis.ArrayBuffer.isView(value);
|
|
120
|
-
}
|
|
121
|
-
function IsUndefined2(value) {
|
|
122
|
-
return value === void 0;
|
|
123
|
-
}
|
|
124
|
-
function IsNumber2(value) {
|
|
125
|
-
return typeof value === "number";
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/system/policy.mjs
|
|
129
|
-
var TypeSystemPolicy;
|
|
130
|
-
(function(TypeSystemPolicy2) {
|
|
131
|
-
TypeSystemPolicy2.InstanceMode = "default";
|
|
132
|
-
TypeSystemPolicy2.ExactOptionalPropertyTypes = false;
|
|
133
|
-
TypeSystemPolicy2.AllowArrayObject = false;
|
|
134
|
-
TypeSystemPolicy2.AllowNaN = false;
|
|
135
|
-
TypeSystemPolicy2.AllowNullVoid = false;
|
|
136
|
-
function IsExactOptionalProperty(value, key) {
|
|
137
|
-
return TypeSystemPolicy2.ExactOptionalPropertyTypes ? key in value : value[key] !== void 0;
|
|
138
|
-
}
|
|
139
|
-
TypeSystemPolicy2.IsExactOptionalProperty = IsExactOptionalProperty;
|
|
140
|
-
function IsObjectLike(value) {
|
|
141
|
-
const isObject = IsObject2(value);
|
|
142
|
-
return TypeSystemPolicy2.AllowArrayObject ? isObject : isObject && !IsArray2(value);
|
|
143
|
-
}
|
|
144
|
-
TypeSystemPolicy2.IsObjectLike = IsObjectLike;
|
|
145
|
-
function IsRecordLike(value) {
|
|
146
|
-
return IsObjectLike(value) && !(value instanceof Date) && !(value instanceof Uint8Array);
|
|
147
|
-
}
|
|
148
|
-
TypeSystemPolicy2.IsRecordLike = IsRecordLike;
|
|
149
|
-
function IsNumberLike(value) {
|
|
150
|
-
return TypeSystemPolicy2.AllowNaN ? IsNumber2(value) : Number.isFinite(value);
|
|
151
|
-
}
|
|
152
|
-
TypeSystemPolicy2.IsNumberLike = IsNumberLike;
|
|
153
|
-
function IsVoidLike(value) {
|
|
154
|
-
const isUndefined = IsUndefined2(value);
|
|
155
|
-
return TypeSystemPolicy2.AllowNullVoid ? isUndefined || value === null : isUndefined;
|
|
156
|
-
}
|
|
157
|
-
TypeSystemPolicy2.IsVoidLike = IsVoidLike;
|
|
158
|
-
})(TypeSystemPolicy || (TypeSystemPolicy = {}));
|
|
159
|
-
|
|
160
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/create/immutable.mjs
|
|
161
|
-
function ImmutableArray(value) {
|
|
162
|
-
return globalThis.Object.freeze(value).map((value2) => Immutable(value2));
|
|
163
|
-
}
|
|
164
|
-
function ImmutableDate(value) {
|
|
165
|
-
return value;
|
|
166
|
-
}
|
|
167
|
-
function ImmutableUint8Array(value) {
|
|
168
|
-
return value;
|
|
169
|
-
}
|
|
170
|
-
function ImmutableRegExp(value) {
|
|
171
|
-
return value;
|
|
172
|
-
}
|
|
173
|
-
function ImmutableObject(value) {
|
|
174
|
-
const result = {};
|
|
175
|
-
for (const key of Object.getOwnPropertyNames(value)) {
|
|
176
|
-
result[key] = Immutable(value[key]);
|
|
177
|
-
}
|
|
178
|
-
for (const key of Object.getOwnPropertySymbols(value)) {
|
|
179
|
-
result[key] = Immutable(value[key]);
|
|
180
|
-
}
|
|
181
|
-
return globalThis.Object.freeze(result);
|
|
182
|
-
}
|
|
183
|
-
function Immutable(value) {
|
|
184
|
-
return IsArray(value) ? ImmutableArray(value) : IsDate(value) ? ImmutableDate(value) : IsUint8Array(value) ? ImmutableUint8Array(value) : IsRegExp(value) ? ImmutableRegExp(value) : IsObject(value) ? ImmutableObject(value) : value;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/create/type.mjs
|
|
188
|
-
function CreateType(schema, options) {
|
|
189
|
-
const result = options !== void 0 ? { ...options, ...schema } : schema;
|
|
190
|
-
switch (TypeSystemPolicy.InstanceMode) {
|
|
191
|
-
case "freeze":
|
|
192
|
-
return Immutable(result);
|
|
193
|
-
case "clone":
|
|
194
|
-
return Clone(result);
|
|
195
|
-
default:
|
|
196
|
-
return result;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/error/error.mjs
|
|
201
|
-
var TypeBoxError = class extends Error {
|
|
202
|
-
constructor(message) {
|
|
203
|
-
super(message);
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.mjs
|
|
208
|
-
var TransformKind = Symbol.for("TypeBox.Transform");
|
|
209
|
-
var ReadonlyKind = Symbol.for("TypeBox.Readonly");
|
|
210
|
-
var OptionalKind = Symbol.for("TypeBox.Optional");
|
|
211
|
-
var Hint = Symbol.for("TypeBox.Hint");
|
|
212
|
-
var Kind = Symbol.for("TypeBox.Kind");
|
|
213
|
-
|
|
214
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/kind.mjs
|
|
215
|
-
function IsReadonly(value) {
|
|
216
|
-
return IsObject(value) && value[ReadonlyKind] === "Readonly";
|
|
217
|
-
}
|
|
218
|
-
function IsOptional(value) {
|
|
219
|
-
return IsObject(value) && value[OptionalKind] === "Optional";
|
|
220
|
-
}
|
|
221
|
-
function IsAny(value) {
|
|
222
|
-
return IsKindOf(value, "Any");
|
|
223
|
-
}
|
|
224
|
-
function IsArgument(value) {
|
|
225
|
-
return IsKindOf(value, "Argument");
|
|
226
|
-
}
|
|
227
|
-
function IsArray3(value) {
|
|
228
|
-
return IsKindOf(value, "Array");
|
|
229
|
-
}
|
|
230
|
-
function IsAsyncIterator2(value) {
|
|
231
|
-
return IsKindOf(value, "AsyncIterator");
|
|
232
|
-
}
|
|
233
|
-
function IsBigInt2(value) {
|
|
234
|
-
return IsKindOf(value, "BigInt");
|
|
235
|
-
}
|
|
236
|
-
function IsBoolean2(value) {
|
|
237
|
-
return IsKindOf(value, "Boolean");
|
|
238
|
-
}
|
|
239
|
-
function IsComputed(value) {
|
|
240
|
-
return IsKindOf(value, "Computed");
|
|
241
|
-
}
|
|
242
|
-
function IsConstructor(value) {
|
|
243
|
-
return IsKindOf(value, "Constructor");
|
|
244
|
-
}
|
|
245
|
-
function IsDate2(value) {
|
|
246
|
-
return IsKindOf(value, "Date");
|
|
247
|
-
}
|
|
248
|
-
function IsFunction2(value) {
|
|
249
|
-
return IsKindOf(value, "Function");
|
|
250
|
-
}
|
|
251
|
-
function IsInteger(value) {
|
|
252
|
-
return IsKindOf(value, "Integer");
|
|
253
|
-
}
|
|
254
|
-
function IsIntersect(value) {
|
|
255
|
-
return IsKindOf(value, "Intersect");
|
|
256
|
-
}
|
|
257
|
-
function IsIterator2(value) {
|
|
258
|
-
return IsKindOf(value, "Iterator");
|
|
259
|
-
}
|
|
260
|
-
function IsKindOf(value, kind) {
|
|
261
|
-
return IsObject(value) && Kind in value && value[Kind] === kind;
|
|
262
|
-
}
|
|
263
|
-
function IsLiteralValue(value) {
|
|
264
|
-
return IsBoolean(value) || IsNumber(value) || IsString(value);
|
|
265
|
-
}
|
|
266
|
-
function IsLiteral(value) {
|
|
267
|
-
return IsKindOf(value, "Literal");
|
|
268
|
-
}
|
|
269
|
-
function IsMappedKey(value) {
|
|
270
|
-
return IsKindOf(value, "MappedKey");
|
|
271
|
-
}
|
|
272
|
-
function IsMappedResult(value) {
|
|
273
|
-
return IsKindOf(value, "MappedResult");
|
|
274
|
-
}
|
|
275
|
-
function IsNever(value) {
|
|
276
|
-
return IsKindOf(value, "Never");
|
|
277
|
-
}
|
|
278
|
-
function IsNot(value) {
|
|
279
|
-
return IsKindOf(value, "Not");
|
|
280
|
-
}
|
|
281
|
-
function IsNull2(value) {
|
|
282
|
-
return IsKindOf(value, "Null");
|
|
283
|
-
}
|
|
284
|
-
function IsNumber3(value) {
|
|
285
|
-
return IsKindOf(value, "Number");
|
|
286
|
-
}
|
|
287
|
-
function IsObject3(value) {
|
|
288
|
-
return IsKindOf(value, "Object");
|
|
289
|
-
}
|
|
290
|
-
function IsPromise(value) {
|
|
291
|
-
return IsKindOf(value, "Promise");
|
|
292
|
-
}
|
|
293
|
-
function IsRecord(value) {
|
|
294
|
-
return IsKindOf(value, "Record");
|
|
295
|
-
}
|
|
296
|
-
function IsRef(value) {
|
|
297
|
-
return IsKindOf(value, "Ref");
|
|
298
|
-
}
|
|
299
|
-
function IsRegExp2(value) {
|
|
300
|
-
return IsKindOf(value, "RegExp");
|
|
301
|
-
}
|
|
302
|
-
function IsString2(value) {
|
|
303
|
-
return IsKindOf(value, "String");
|
|
304
|
-
}
|
|
305
|
-
function IsSymbol2(value) {
|
|
306
|
-
return IsKindOf(value, "Symbol");
|
|
307
|
-
}
|
|
308
|
-
function IsTemplateLiteral(value) {
|
|
309
|
-
return IsKindOf(value, "TemplateLiteral");
|
|
310
|
-
}
|
|
311
|
-
function IsThis(value) {
|
|
312
|
-
return IsKindOf(value, "This");
|
|
313
|
-
}
|
|
314
|
-
function IsTransform(value) {
|
|
315
|
-
return IsObject(value) && TransformKind in value;
|
|
316
|
-
}
|
|
317
|
-
function IsTuple(value) {
|
|
318
|
-
return IsKindOf(value, "Tuple");
|
|
319
|
-
}
|
|
320
|
-
function IsUndefined3(value) {
|
|
321
|
-
return IsKindOf(value, "Undefined");
|
|
322
|
-
}
|
|
323
|
-
function IsUnion(value) {
|
|
324
|
-
return IsKindOf(value, "Union");
|
|
325
|
-
}
|
|
326
|
-
function IsUint8Array2(value) {
|
|
327
|
-
return IsKindOf(value, "Uint8Array");
|
|
328
|
-
}
|
|
329
|
-
function IsUnknown(value) {
|
|
330
|
-
return IsKindOf(value, "Unknown");
|
|
331
|
-
}
|
|
332
|
-
function IsUnsafe(value) {
|
|
333
|
-
return IsKindOf(value, "Unsafe");
|
|
334
|
-
}
|
|
335
|
-
function IsVoid(value) {
|
|
336
|
-
return IsKindOf(value, "Void");
|
|
337
|
-
}
|
|
338
|
-
function IsKind(value) {
|
|
339
|
-
return IsObject(value) && Kind in value && IsString(value[Kind]);
|
|
340
|
-
}
|
|
341
|
-
function IsSchema(value) {
|
|
342
|
-
return IsAny(value) || IsArgument(value) || IsArray3(value) || IsBoolean2(value) || IsBigInt2(value) || IsAsyncIterator2(value) || IsComputed(value) || IsConstructor(value) || IsDate2(value) || IsFunction2(value) || IsInteger(value) || IsIntersect(value) || IsIterator2(value) || IsLiteral(value) || IsMappedKey(value) || IsMappedResult(value) || IsNever(value) || IsNot(value) || IsNull2(value) || IsNumber3(value) || IsObject3(value) || IsPromise(value) || IsRecord(value) || IsRef(value) || IsRegExp2(value) || IsString2(value) || IsSymbol2(value) || IsTemplateLiteral(value) || IsThis(value) || IsTuple(value) || IsUndefined3(value) || IsUnion(value) || IsUint8Array2(value) || IsUnknown(value) || IsUnsafe(value) || IsVoid(value) || IsKind(value);
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs
|
|
346
|
-
var type_exports = {};
|
|
347
|
-
__export(type_exports, {
|
|
348
|
-
IsAny: () => IsAny2,
|
|
349
|
-
IsArgument: () => IsArgument2,
|
|
350
|
-
IsArray: () => IsArray4,
|
|
351
|
-
IsAsyncIterator: () => IsAsyncIterator3,
|
|
352
|
-
IsBigInt: () => IsBigInt3,
|
|
353
|
-
IsBoolean: () => IsBoolean3,
|
|
354
|
-
IsComputed: () => IsComputed2,
|
|
355
|
-
IsConstructor: () => IsConstructor2,
|
|
356
|
-
IsDate: () => IsDate3,
|
|
357
|
-
IsFunction: () => IsFunction3,
|
|
358
|
-
IsImport: () => IsImport,
|
|
359
|
-
IsInteger: () => IsInteger2,
|
|
360
|
-
IsIntersect: () => IsIntersect2,
|
|
361
|
-
IsIterator: () => IsIterator3,
|
|
362
|
-
IsKind: () => IsKind2,
|
|
363
|
-
IsKindOf: () => IsKindOf2,
|
|
364
|
-
IsLiteral: () => IsLiteral2,
|
|
365
|
-
IsLiteralBoolean: () => IsLiteralBoolean,
|
|
366
|
-
IsLiteralNumber: () => IsLiteralNumber,
|
|
367
|
-
IsLiteralString: () => IsLiteralString,
|
|
368
|
-
IsLiteralValue: () => IsLiteralValue2,
|
|
369
|
-
IsMappedKey: () => IsMappedKey2,
|
|
370
|
-
IsMappedResult: () => IsMappedResult2,
|
|
371
|
-
IsNever: () => IsNever2,
|
|
372
|
-
IsNot: () => IsNot2,
|
|
373
|
-
IsNull: () => IsNull3,
|
|
374
|
-
IsNumber: () => IsNumber4,
|
|
375
|
-
IsObject: () => IsObject4,
|
|
376
|
-
IsOptional: () => IsOptional2,
|
|
377
|
-
IsPromise: () => IsPromise2,
|
|
378
|
-
IsProperties: () => IsProperties,
|
|
379
|
-
IsReadonly: () => IsReadonly2,
|
|
380
|
-
IsRecord: () => IsRecord2,
|
|
381
|
-
IsRecursive: () => IsRecursive,
|
|
382
|
-
IsRef: () => IsRef2,
|
|
383
|
-
IsRegExp: () => IsRegExp3,
|
|
384
|
-
IsSchema: () => IsSchema2,
|
|
385
|
-
IsString: () => IsString3,
|
|
386
|
-
IsSymbol: () => IsSymbol3,
|
|
387
|
-
IsTemplateLiteral: () => IsTemplateLiteral2,
|
|
388
|
-
IsThis: () => IsThis2,
|
|
389
|
-
IsTransform: () => IsTransform2,
|
|
390
|
-
IsTuple: () => IsTuple2,
|
|
391
|
-
IsUint8Array: () => IsUint8Array3,
|
|
392
|
-
IsUndefined: () => IsUndefined4,
|
|
393
|
-
IsUnion: () => IsUnion2,
|
|
394
|
-
IsUnionLiteral: () => IsUnionLiteral,
|
|
395
|
-
IsUnknown: () => IsUnknown2,
|
|
396
|
-
IsUnsafe: () => IsUnsafe2,
|
|
397
|
-
IsVoid: () => IsVoid2,
|
|
398
|
-
TypeGuardUnknownTypeError: () => TypeGuardUnknownTypeError
|
|
399
|
-
});
|
|
400
|
-
var TypeGuardUnknownTypeError = class extends TypeBoxError {
|
|
401
|
-
};
|
|
402
|
-
var KnownTypes = [
|
|
403
|
-
"Argument",
|
|
404
|
-
"Any",
|
|
405
|
-
"Array",
|
|
406
|
-
"AsyncIterator",
|
|
407
|
-
"BigInt",
|
|
408
|
-
"Boolean",
|
|
409
|
-
"Computed",
|
|
410
|
-
"Constructor",
|
|
411
|
-
"Date",
|
|
412
|
-
"Enum",
|
|
413
|
-
"Function",
|
|
414
|
-
"Integer",
|
|
415
|
-
"Intersect",
|
|
416
|
-
"Iterator",
|
|
417
|
-
"Literal",
|
|
418
|
-
"MappedKey",
|
|
419
|
-
"MappedResult",
|
|
420
|
-
"Not",
|
|
421
|
-
"Null",
|
|
422
|
-
"Number",
|
|
423
|
-
"Object",
|
|
424
|
-
"Promise",
|
|
425
|
-
"Record",
|
|
426
|
-
"Ref",
|
|
427
|
-
"RegExp",
|
|
428
|
-
"String",
|
|
429
|
-
"Symbol",
|
|
430
|
-
"TemplateLiteral",
|
|
431
|
-
"This",
|
|
432
|
-
"Tuple",
|
|
433
|
-
"Undefined",
|
|
434
|
-
"Union",
|
|
435
|
-
"Uint8Array",
|
|
436
|
-
"Unknown",
|
|
437
|
-
"Void"
|
|
438
|
-
];
|
|
439
|
-
function IsPattern(value) {
|
|
440
|
-
try {
|
|
441
|
-
new RegExp(value);
|
|
442
|
-
return true;
|
|
443
|
-
} catch {
|
|
444
|
-
return false;
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
function IsControlCharacterFree(value) {
|
|
448
|
-
if (!IsString(value))
|
|
449
|
-
return false;
|
|
450
|
-
for (let i = 0; i < value.length; i++) {
|
|
451
|
-
const code = value.charCodeAt(i);
|
|
452
|
-
if (code >= 7 && code <= 13 || code === 27 || code === 127) {
|
|
453
|
-
return false;
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
return true;
|
|
457
|
-
}
|
|
458
|
-
function IsAdditionalProperties(value) {
|
|
459
|
-
return IsOptionalBoolean(value) || IsSchema2(value);
|
|
460
|
-
}
|
|
461
|
-
function IsOptionalBigInt(value) {
|
|
462
|
-
return IsUndefined(value) || IsBigInt(value);
|
|
463
|
-
}
|
|
464
|
-
function IsOptionalNumber(value) {
|
|
465
|
-
return IsUndefined(value) || IsNumber(value);
|
|
466
|
-
}
|
|
467
|
-
function IsOptionalBoolean(value) {
|
|
468
|
-
return IsUndefined(value) || IsBoolean(value);
|
|
469
|
-
}
|
|
470
|
-
function IsOptionalString(value) {
|
|
471
|
-
return IsUndefined(value) || IsString(value);
|
|
472
|
-
}
|
|
473
|
-
function IsOptionalPattern(value) {
|
|
474
|
-
return IsUndefined(value) || IsString(value) && IsControlCharacterFree(value) && IsPattern(value);
|
|
475
|
-
}
|
|
476
|
-
function IsOptionalFormat(value) {
|
|
477
|
-
return IsUndefined(value) || IsString(value) && IsControlCharacterFree(value);
|
|
478
|
-
}
|
|
479
|
-
function IsOptionalSchema(value) {
|
|
480
|
-
return IsUndefined(value) || IsSchema2(value);
|
|
481
|
-
}
|
|
482
|
-
function IsReadonly2(value) {
|
|
483
|
-
return IsObject(value) && value[ReadonlyKind] === "Readonly";
|
|
484
|
-
}
|
|
485
|
-
function IsOptional2(value) {
|
|
486
|
-
return IsObject(value) && value[OptionalKind] === "Optional";
|
|
487
|
-
}
|
|
488
|
-
function IsAny2(value) {
|
|
489
|
-
return IsKindOf2(value, "Any") && IsOptionalString(value.$id);
|
|
490
|
-
}
|
|
491
|
-
function IsArgument2(value) {
|
|
492
|
-
return IsKindOf2(value, "Argument") && IsNumber(value.index);
|
|
493
|
-
}
|
|
494
|
-
function IsArray4(value) {
|
|
495
|
-
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);
|
|
496
|
-
}
|
|
497
|
-
function IsAsyncIterator3(value) {
|
|
498
|
-
return IsKindOf2(value, "AsyncIterator") && value.type === "AsyncIterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
|
|
499
|
-
}
|
|
500
|
-
function IsBigInt3(value) {
|
|
501
|
-
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);
|
|
502
|
-
}
|
|
503
|
-
function IsBoolean3(value) {
|
|
504
|
-
return IsKindOf2(value, "Boolean") && value.type === "boolean" && IsOptionalString(value.$id);
|
|
505
|
-
}
|
|
506
|
-
function IsComputed2(value) {
|
|
507
|
-
return IsKindOf2(value, "Computed") && IsString(value.target) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema));
|
|
508
|
-
}
|
|
509
|
-
function IsConstructor2(value) {
|
|
510
|
-
return IsKindOf2(value, "Constructor") && value.type === "Constructor" && IsOptionalString(value.$id) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
|
|
511
|
-
}
|
|
512
|
-
function IsDate3(value) {
|
|
513
|
-
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);
|
|
514
|
-
}
|
|
515
|
-
function IsFunction3(value) {
|
|
516
|
-
return IsKindOf2(value, "Function") && value.type === "Function" && IsOptionalString(value.$id) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
|
|
517
|
-
}
|
|
518
|
-
function IsImport(value) {
|
|
519
|
-
return IsKindOf2(value, "Import") && HasPropertyKey(value, "$defs") && IsObject(value.$defs) && IsProperties(value.$defs) && HasPropertyKey(value, "$ref") && IsString(value.$ref) && value.$ref in value.$defs;
|
|
520
|
-
}
|
|
521
|
-
function IsInteger2(value) {
|
|
522
|
-
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);
|
|
523
|
-
}
|
|
524
|
-
function IsProperties(value) {
|
|
525
|
-
return IsObject(value) && Object.entries(value).every(([key, schema]) => IsControlCharacterFree(key) && IsSchema2(schema));
|
|
526
|
-
}
|
|
527
|
-
function IsIntersect2(value) {
|
|
528
|
-
return IsKindOf2(value, "Intersect") && (IsString(value.type) && value.type !== "object" ? false : true) && IsArray(value.allOf) && value.allOf.every((schema) => IsSchema2(schema) && !IsTransform2(schema)) && IsOptionalString(value.type) && (IsOptionalBoolean(value.unevaluatedProperties) || IsOptionalSchema(value.unevaluatedProperties)) && IsOptionalString(value.$id);
|
|
529
|
-
}
|
|
530
|
-
function IsIterator3(value) {
|
|
531
|
-
return IsKindOf2(value, "Iterator") && value.type === "Iterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
|
|
532
|
-
}
|
|
533
|
-
function IsKindOf2(value, kind) {
|
|
534
|
-
return IsObject(value) && Kind in value && value[Kind] === kind;
|
|
535
|
-
}
|
|
536
|
-
function IsLiteralString(value) {
|
|
537
|
-
return IsLiteral2(value) && IsString(value.const);
|
|
538
|
-
}
|
|
539
|
-
function IsLiteralNumber(value) {
|
|
540
|
-
return IsLiteral2(value) && IsNumber(value.const);
|
|
541
|
-
}
|
|
542
|
-
function IsLiteralBoolean(value) {
|
|
543
|
-
return IsLiteral2(value) && IsBoolean(value.const);
|
|
544
|
-
}
|
|
545
|
-
function IsLiteral2(value) {
|
|
546
|
-
return IsKindOf2(value, "Literal") && IsOptionalString(value.$id) && IsLiteralValue2(value.const);
|
|
547
|
-
}
|
|
548
|
-
function IsLiteralValue2(value) {
|
|
549
|
-
return IsBoolean(value) || IsNumber(value) || IsString(value);
|
|
550
|
-
}
|
|
551
|
-
function IsMappedKey2(value) {
|
|
552
|
-
return IsKindOf2(value, "MappedKey") && IsArray(value.keys) && value.keys.every((key) => IsNumber(key) || IsString(key));
|
|
553
|
-
}
|
|
554
|
-
function IsMappedResult2(value) {
|
|
555
|
-
return IsKindOf2(value, "MappedResult") && IsProperties(value.properties);
|
|
556
|
-
}
|
|
557
|
-
function IsNever2(value) {
|
|
558
|
-
return IsKindOf2(value, "Never") && IsObject(value.not) && Object.getOwnPropertyNames(value.not).length === 0;
|
|
559
|
-
}
|
|
560
|
-
function IsNot2(value) {
|
|
561
|
-
return IsKindOf2(value, "Not") && IsSchema2(value.not);
|
|
562
|
-
}
|
|
563
|
-
function IsNull3(value) {
|
|
564
|
-
return IsKindOf2(value, "Null") && value.type === "null" && IsOptionalString(value.$id);
|
|
565
|
-
}
|
|
566
|
-
function IsNumber4(value) {
|
|
567
|
-
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);
|
|
568
|
-
}
|
|
569
|
-
function IsObject4(value) {
|
|
570
|
-
return IsKindOf2(value, "Object") && value.type === "object" && IsOptionalString(value.$id) && IsProperties(value.properties) && IsAdditionalProperties(value.additionalProperties) && IsOptionalNumber(value.minProperties) && IsOptionalNumber(value.maxProperties);
|
|
571
|
-
}
|
|
572
|
-
function IsPromise2(value) {
|
|
573
|
-
return IsKindOf2(value, "Promise") && value.type === "Promise" && IsOptionalString(value.$id) && IsSchema2(value.item);
|
|
574
|
-
}
|
|
575
|
-
function IsRecord2(value) {
|
|
576
|
-
return IsKindOf2(value, "Record") && value.type === "object" && IsOptionalString(value.$id) && IsAdditionalProperties(value.additionalProperties) && IsObject(value.patternProperties) && ((schema) => {
|
|
577
|
-
const keys = Object.getOwnPropertyNames(schema.patternProperties);
|
|
578
|
-
return keys.length === 1 && IsPattern(keys[0]) && IsObject(schema.patternProperties) && IsSchema2(schema.patternProperties[keys[0]]);
|
|
579
|
-
})(value);
|
|
580
|
-
}
|
|
581
|
-
function IsRecursive(value) {
|
|
582
|
-
return IsObject(value) && Hint in value && value[Hint] === "Recursive";
|
|
583
|
-
}
|
|
584
|
-
function IsRef2(value) {
|
|
585
|
-
return IsKindOf2(value, "Ref") && IsOptionalString(value.$id) && IsString(value.$ref);
|
|
586
|
-
}
|
|
587
|
-
function IsRegExp3(value) {
|
|
588
|
-
return IsKindOf2(value, "RegExp") && IsOptionalString(value.$id) && IsString(value.source) && IsString(value.flags) && IsOptionalNumber(value.maxLength) && IsOptionalNumber(value.minLength);
|
|
589
|
-
}
|
|
590
|
-
function IsString3(value) {
|
|
591
|
-
return IsKindOf2(value, "String") && value.type === "string" && IsOptionalString(value.$id) && IsOptionalNumber(value.minLength) && IsOptionalNumber(value.maxLength) && IsOptionalPattern(value.pattern) && IsOptionalFormat(value.format);
|
|
592
|
-
}
|
|
593
|
-
function IsSymbol3(value) {
|
|
594
|
-
return IsKindOf2(value, "Symbol") && value.type === "symbol" && IsOptionalString(value.$id);
|
|
595
|
-
}
|
|
596
|
-
function IsTemplateLiteral2(value) {
|
|
597
|
-
return IsKindOf2(value, "TemplateLiteral") && value.type === "string" && IsString(value.pattern) && value.pattern[0] === "^" && value.pattern[value.pattern.length - 1] === "$";
|
|
598
|
-
}
|
|
599
|
-
function IsThis2(value) {
|
|
600
|
-
return IsKindOf2(value, "This") && IsOptionalString(value.$id) && IsString(value.$ref);
|
|
601
|
-
}
|
|
602
|
-
function IsTransform2(value) {
|
|
603
|
-
return IsObject(value) && TransformKind in value;
|
|
604
|
-
}
|
|
605
|
-
function IsTuple2(value) {
|
|
606
|
-
return IsKindOf2(value, "Tuple") && value.type === "array" && IsOptionalString(value.$id) && IsNumber(value.minItems) && IsNumber(value.maxItems) && value.minItems === value.maxItems && // empty
|
|
607
|
-
(IsUndefined(value.items) && IsUndefined(value.additionalItems) && value.minItems === 0 || IsArray(value.items) && value.items.every((schema) => IsSchema2(schema)));
|
|
608
|
-
}
|
|
609
|
-
function IsUndefined4(value) {
|
|
610
|
-
return IsKindOf2(value, "Undefined") && value.type === "undefined" && IsOptionalString(value.$id);
|
|
611
|
-
}
|
|
612
|
-
function IsUnionLiteral(value) {
|
|
613
|
-
return IsUnion2(value) && value.anyOf.every((schema) => IsLiteralString(schema) || IsLiteralNumber(schema));
|
|
614
|
-
}
|
|
615
|
-
function IsUnion2(value) {
|
|
616
|
-
return IsKindOf2(value, "Union") && IsOptionalString(value.$id) && IsObject(value) && IsArray(value.anyOf) && value.anyOf.every((schema) => IsSchema2(schema));
|
|
617
|
-
}
|
|
618
|
-
function IsUint8Array3(value) {
|
|
619
|
-
return IsKindOf2(value, "Uint8Array") && value.type === "Uint8Array" && IsOptionalString(value.$id) && IsOptionalNumber(value.minByteLength) && IsOptionalNumber(value.maxByteLength);
|
|
620
|
-
}
|
|
621
|
-
function IsUnknown2(value) {
|
|
622
|
-
return IsKindOf2(value, "Unknown") && IsOptionalString(value.$id);
|
|
623
|
-
}
|
|
624
|
-
function IsUnsafe2(value) {
|
|
625
|
-
return IsKindOf2(value, "Unsafe");
|
|
626
|
-
}
|
|
627
|
-
function IsVoid2(value) {
|
|
628
|
-
return IsKindOf2(value, "Void") && value.type === "void" && IsOptionalString(value.$id);
|
|
629
|
-
}
|
|
630
|
-
function IsKind2(value) {
|
|
631
|
-
return IsObject(value) && Kind in value && IsString(value[Kind]) && !KnownTypes.includes(value[Kind]);
|
|
632
|
-
}
|
|
633
|
-
function IsSchema2(value) {
|
|
634
|
-
return IsObject(value) && (IsAny2(value) || IsArgument2(value) || IsArray4(value) || IsBoolean3(value) || IsBigInt3(value) || IsAsyncIterator3(value) || IsComputed2(value) || IsConstructor2(value) || IsDate3(value) || IsFunction3(value) || IsInteger2(value) || IsIntersect2(value) || IsIterator3(value) || IsLiteral2(value) || IsMappedKey2(value) || IsMappedResult2(value) || IsNever2(value) || IsNot2(value) || IsNull3(value) || IsNumber4(value) || IsObject4(value) || IsPromise2(value) || IsRecord2(value) || IsRef2(value) || IsRegExp3(value) || IsString3(value) || IsSymbol3(value) || IsTemplateLiteral2(value) || IsThis2(value) || IsTuple2(value) || IsUndefined4(value) || IsUnion2(value) || IsUint8Array3(value) || IsUnknown2(value) || IsUnsafe2(value) || IsVoid2(value) || IsKind2(value));
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs
|
|
638
|
-
var PatternBoolean = "(true|false)";
|
|
639
|
-
var PatternNumber = "(0|[1-9][0-9]*)";
|
|
640
|
-
var PatternString = "(.*)";
|
|
641
|
-
var PatternNever = "(?!.*)";
|
|
642
|
-
var PatternBooleanExact = `^${PatternBoolean}$`;
|
|
643
|
-
var PatternNumberExact = `^${PatternNumber}$`;
|
|
644
|
-
var PatternStringExact = `^${PatternString}$`;
|
|
645
|
-
var PatternNeverExact = `^${PatternNever}$`;
|
|
646
|
-
|
|
647
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs
|
|
648
|
-
function SetIncludes(T, S) {
|
|
649
|
-
return T.includes(S);
|
|
650
|
-
}
|
|
651
|
-
function SetDistinct(T) {
|
|
652
|
-
return [...new Set(T)];
|
|
653
|
-
}
|
|
654
|
-
function SetIntersect(T, S) {
|
|
655
|
-
return T.filter((L) => S.includes(L));
|
|
656
|
-
}
|
|
657
|
-
function SetIntersectManyResolve(T, Init) {
|
|
658
|
-
return T.reduce((Acc, L) => {
|
|
659
|
-
return SetIntersect(Acc, L);
|
|
660
|
-
}, Init);
|
|
661
|
-
}
|
|
662
|
-
function SetIntersectMany(T) {
|
|
663
|
-
return T.length === 1 ? T[0] : T.length > 1 ? SetIntersectManyResolve(T.slice(1), T[0]) : [];
|
|
664
|
-
}
|
|
665
|
-
function SetUnionMany(T) {
|
|
666
|
-
const Acc = [];
|
|
667
|
-
for (const L of T)
|
|
668
|
-
Acc.push(...L);
|
|
669
|
-
return Acc;
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/any/any.mjs
|
|
673
|
-
function Any(options) {
|
|
674
|
-
return CreateType({ [Kind]: "Any" }, options);
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/array/array.mjs
|
|
678
|
-
function Array2(items, options) {
|
|
679
|
-
return CreateType({ [Kind]: "Array", type: "array", items }, options);
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/argument/argument.mjs
|
|
683
|
-
function Argument(index) {
|
|
684
|
-
return CreateType({ [Kind]: "Argument", index });
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs
|
|
688
|
-
function AsyncIterator(items, options) {
|
|
689
|
-
return CreateType({ [Kind]: "AsyncIterator", type: "AsyncIterator", items }, options);
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/computed/computed.mjs
|
|
693
|
-
function Computed(target, parameters, options) {
|
|
694
|
-
return CreateType({ [Kind]: "Computed", target, parameters }, options);
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs
|
|
698
|
-
function DiscardKey(value, key) {
|
|
699
|
-
const { [key]: _, ...rest } = value;
|
|
700
|
-
return rest;
|
|
701
|
-
}
|
|
702
|
-
function Discard(value, keys) {
|
|
703
|
-
return keys.reduce((acc, key) => DiscardKey(acc, key), value);
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/never/never.mjs
|
|
707
|
-
function Never(options) {
|
|
708
|
-
return CreateType({ [Kind]: "Never", not: {} }, options);
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs
|
|
712
|
-
function MappedResult(properties) {
|
|
713
|
-
return CreateType({
|
|
714
|
-
[Kind]: "MappedResult",
|
|
715
|
-
properties
|
|
716
|
-
});
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs
|
|
720
|
-
function Constructor(parameters, returns, options) {
|
|
721
|
-
return CreateType({ [Kind]: "Constructor", type: "Constructor", parameters, returns }, options);
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/function/function.mjs
|
|
725
|
-
function Function(parameters, returns, options) {
|
|
726
|
-
return CreateType({ [Kind]: "Function", type: "Function", parameters, returns }, options);
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs
|
|
730
|
-
function UnionCreate(T, options) {
|
|
731
|
-
return CreateType({ [Kind]: "Union", anyOf: T }, options);
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs
|
|
735
|
-
function IsUnionOptional(types) {
|
|
736
|
-
return types.some((type) => IsOptional(type));
|
|
737
|
-
}
|
|
738
|
-
function RemoveOptionalFromRest(types) {
|
|
739
|
-
return types.map((left) => IsOptional(left) ? RemoveOptionalFromType(left) : left);
|
|
740
|
-
}
|
|
741
|
-
function RemoveOptionalFromType(T) {
|
|
742
|
-
return Discard(T, [OptionalKind]);
|
|
743
|
-
}
|
|
744
|
-
function ResolveUnion(types, options) {
|
|
745
|
-
const isOptional = IsUnionOptional(types);
|
|
746
|
-
return isOptional ? Optional(UnionCreate(RemoveOptionalFromRest(types), options)) : UnionCreate(RemoveOptionalFromRest(types), options);
|
|
747
|
-
}
|
|
748
|
-
function UnionEvaluated(T, options) {
|
|
749
|
-
return T.length === 1 ? CreateType(T[0], options) : T.length === 0 ? Never(options) : ResolveUnion(T, options);
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union.mjs
|
|
753
|
-
function Union(types, options) {
|
|
754
|
-
return types.length === 0 ? Never(options) : types.length === 1 ? CreateType(types[0], options) : UnionCreate(types, options);
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs
|
|
758
|
-
var TemplateLiteralParserError = class extends TypeBoxError {
|
|
759
|
-
};
|
|
760
|
-
function Unescape(pattern) {
|
|
761
|
-
return pattern.replace(/\\\$/g, "$").replace(/\\\*/g, "*").replace(/\\\^/g, "^").replace(/\\\|/g, "|").replace(/\\\(/g, "(").replace(/\\\)/g, ")");
|
|
762
|
-
}
|
|
763
|
-
function IsNonEscaped(pattern, index, char) {
|
|
764
|
-
return pattern[index] === char && pattern.charCodeAt(index - 1) !== 92;
|
|
765
|
-
}
|
|
766
|
-
function IsOpenParen(pattern, index) {
|
|
767
|
-
return IsNonEscaped(pattern, index, "(");
|
|
768
|
-
}
|
|
769
|
-
function IsCloseParen(pattern, index) {
|
|
770
|
-
return IsNonEscaped(pattern, index, ")");
|
|
771
|
-
}
|
|
772
|
-
function IsSeparator(pattern, index) {
|
|
773
|
-
return IsNonEscaped(pattern, index, "|");
|
|
774
|
-
}
|
|
775
|
-
function IsGroup(pattern) {
|
|
776
|
-
if (!(IsOpenParen(pattern, 0) && IsCloseParen(pattern, pattern.length - 1)))
|
|
777
|
-
return false;
|
|
778
|
-
let count = 0;
|
|
779
|
-
for (let index = 0; index < pattern.length; index++) {
|
|
780
|
-
if (IsOpenParen(pattern, index))
|
|
781
|
-
count += 1;
|
|
782
|
-
if (IsCloseParen(pattern, index))
|
|
783
|
-
count -= 1;
|
|
784
|
-
if (count === 0 && index !== pattern.length - 1)
|
|
785
|
-
return false;
|
|
786
|
-
}
|
|
787
|
-
return true;
|
|
788
|
-
}
|
|
789
|
-
function InGroup(pattern) {
|
|
790
|
-
return pattern.slice(1, pattern.length - 1);
|
|
791
|
-
}
|
|
792
|
-
function IsPrecedenceOr(pattern) {
|
|
793
|
-
let count = 0;
|
|
794
|
-
for (let index = 0; index < pattern.length; index++) {
|
|
795
|
-
if (IsOpenParen(pattern, index))
|
|
796
|
-
count += 1;
|
|
797
|
-
if (IsCloseParen(pattern, index))
|
|
798
|
-
count -= 1;
|
|
799
|
-
if (IsSeparator(pattern, index) && count === 0)
|
|
800
|
-
return true;
|
|
801
|
-
}
|
|
802
|
-
return false;
|
|
803
|
-
}
|
|
804
|
-
function IsPrecedenceAnd(pattern) {
|
|
805
|
-
for (let index = 0; index < pattern.length; index++) {
|
|
806
|
-
if (IsOpenParen(pattern, index))
|
|
807
|
-
return true;
|
|
808
|
-
}
|
|
809
|
-
return false;
|
|
810
|
-
}
|
|
811
|
-
function Or(pattern) {
|
|
812
|
-
let [count, start] = [0, 0];
|
|
813
|
-
const expressions = [];
|
|
814
|
-
for (let index = 0; index < pattern.length; index++) {
|
|
815
|
-
if (IsOpenParen(pattern, index))
|
|
816
|
-
count += 1;
|
|
817
|
-
if (IsCloseParen(pattern, index))
|
|
818
|
-
count -= 1;
|
|
819
|
-
if (IsSeparator(pattern, index) && count === 0) {
|
|
820
|
-
const range2 = pattern.slice(start, index);
|
|
821
|
-
if (range2.length > 0)
|
|
822
|
-
expressions.push(TemplateLiteralParse(range2));
|
|
823
|
-
start = index + 1;
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
const range = pattern.slice(start);
|
|
827
|
-
if (range.length > 0)
|
|
828
|
-
expressions.push(TemplateLiteralParse(range));
|
|
829
|
-
if (expressions.length === 0)
|
|
830
|
-
return { type: "const", const: "" };
|
|
831
|
-
if (expressions.length === 1)
|
|
832
|
-
return expressions[0];
|
|
833
|
-
return { type: "or", expr: expressions };
|
|
834
|
-
}
|
|
835
|
-
function And(pattern) {
|
|
836
|
-
function Group(value, index) {
|
|
837
|
-
if (!IsOpenParen(value, index))
|
|
838
|
-
throw new TemplateLiteralParserError(`TemplateLiteralParser: Index must point to open parens`);
|
|
839
|
-
let count = 0;
|
|
840
|
-
for (let scan = index; scan < value.length; scan++) {
|
|
841
|
-
if (IsOpenParen(value, scan))
|
|
842
|
-
count += 1;
|
|
843
|
-
if (IsCloseParen(value, scan))
|
|
844
|
-
count -= 1;
|
|
845
|
-
if (count === 0)
|
|
846
|
-
return [index, scan];
|
|
847
|
-
}
|
|
848
|
-
throw new TemplateLiteralParserError(`TemplateLiteralParser: Unclosed group parens in expression`);
|
|
849
|
-
}
|
|
850
|
-
function Range(pattern2, index) {
|
|
851
|
-
for (let scan = index; scan < pattern2.length; scan++) {
|
|
852
|
-
if (IsOpenParen(pattern2, scan))
|
|
853
|
-
return [index, scan];
|
|
854
|
-
}
|
|
855
|
-
return [index, pattern2.length];
|
|
856
|
-
}
|
|
857
|
-
const expressions = [];
|
|
858
|
-
for (let index = 0; index < pattern.length; index++) {
|
|
859
|
-
if (IsOpenParen(pattern, index)) {
|
|
860
|
-
const [start, end] = Group(pattern, index);
|
|
861
|
-
const range = pattern.slice(start, end + 1);
|
|
862
|
-
expressions.push(TemplateLiteralParse(range));
|
|
863
|
-
index = end;
|
|
864
|
-
} else {
|
|
865
|
-
const [start, end] = Range(pattern, index);
|
|
866
|
-
const range = pattern.slice(start, end);
|
|
867
|
-
if (range.length > 0)
|
|
868
|
-
expressions.push(TemplateLiteralParse(range));
|
|
869
|
-
index = end - 1;
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
return expressions.length === 0 ? { type: "const", const: "" } : expressions.length === 1 ? expressions[0] : { type: "and", expr: expressions };
|
|
873
|
-
}
|
|
874
|
-
function TemplateLiteralParse(pattern) {
|
|
875
|
-
return IsGroup(pattern) ? TemplateLiteralParse(InGroup(pattern)) : IsPrecedenceOr(pattern) ? Or(pattern) : IsPrecedenceAnd(pattern) ? And(pattern) : { type: "const", const: Unescape(pattern) };
|
|
876
|
-
}
|
|
877
|
-
function TemplateLiteralParseExact(pattern) {
|
|
878
|
-
return TemplateLiteralParse(pattern.slice(1, pattern.length - 1));
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.mjs
|
|
882
|
-
var TemplateLiteralFiniteError = class extends TypeBoxError {
|
|
883
|
-
};
|
|
884
|
-
function IsNumberExpression(expression) {
|
|
885
|
-
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]*";
|
|
886
|
-
}
|
|
887
|
-
function IsBooleanExpression(expression) {
|
|
888
|
-
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";
|
|
889
|
-
}
|
|
890
|
-
function IsStringExpression(expression) {
|
|
891
|
-
return expression.type === "const" && expression.const === ".*";
|
|
892
|
-
}
|
|
893
|
-
function IsTemplateLiteralExpressionFinite(expression) {
|
|
894
|
-
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 : (() => {
|
|
895
|
-
throw new TemplateLiteralFiniteError(`Unknown expression type`);
|
|
896
|
-
})();
|
|
897
|
-
}
|
|
898
|
-
function IsTemplateLiteralFinite(schema) {
|
|
899
|
-
const expression = TemplateLiteralParseExact(schema.pattern);
|
|
900
|
-
return IsTemplateLiteralExpressionFinite(expression);
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.mjs
|
|
904
|
-
var TemplateLiteralGenerateError = class extends TypeBoxError {
|
|
905
|
-
};
|
|
906
|
-
function* GenerateReduce(buffer) {
|
|
907
|
-
if (buffer.length === 1)
|
|
908
|
-
return yield* buffer[0];
|
|
909
|
-
for (const left of buffer[0]) {
|
|
910
|
-
for (const right of GenerateReduce(buffer.slice(1))) {
|
|
911
|
-
yield `${left}${right}`;
|
|
912
|
-
}
|
|
913
|
-
}
|
|
914
|
-
}
|
|
915
|
-
function* GenerateAnd(expression) {
|
|
916
|
-
return yield* GenerateReduce(expression.expr.map((expr) => [...TemplateLiteralExpressionGenerate(expr)]));
|
|
917
|
-
}
|
|
918
|
-
function* GenerateOr(expression) {
|
|
919
|
-
for (const expr of expression.expr)
|
|
920
|
-
yield* TemplateLiteralExpressionGenerate(expr);
|
|
921
|
-
}
|
|
922
|
-
function* GenerateConst(expression) {
|
|
923
|
-
return yield expression.const;
|
|
924
|
-
}
|
|
925
|
-
function* TemplateLiteralExpressionGenerate(expression) {
|
|
926
|
-
return expression.type === "and" ? yield* GenerateAnd(expression) : expression.type === "or" ? yield* GenerateOr(expression) : expression.type === "const" ? yield* GenerateConst(expression) : (() => {
|
|
927
|
-
throw new TemplateLiteralGenerateError("Unknown expression");
|
|
928
|
-
})();
|
|
929
|
-
}
|
|
930
|
-
function TemplateLiteralGenerate(schema) {
|
|
931
|
-
const expression = TemplateLiteralParseExact(schema.pattern);
|
|
932
|
-
return IsTemplateLiteralExpressionFinite(expression) ? [...TemplateLiteralExpressionGenerate(expression)] : [];
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs
|
|
936
|
-
function Literal(value, options) {
|
|
937
|
-
return CreateType({
|
|
938
|
-
[Kind]: "Literal",
|
|
939
|
-
const: value,
|
|
940
|
-
type: typeof value
|
|
941
|
-
}, options);
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs
|
|
945
|
-
function Boolean(options) {
|
|
946
|
-
return CreateType({ [Kind]: "Boolean", type: "boolean" }, options);
|
|
947
|
-
}
|
|
948
|
-
|
|
949
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs
|
|
950
|
-
function BigInt(options) {
|
|
951
|
-
return CreateType({ [Kind]: "BigInt", type: "bigint" }, options);
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/number/number.mjs
|
|
955
|
-
function Number2(options) {
|
|
956
|
-
return CreateType({ [Kind]: "Number", type: "number" }, options);
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/string/string.mjs
|
|
960
|
-
function String(options) {
|
|
961
|
-
return CreateType({ [Kind]: "String", type: "string" }, options);
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs
|
|
965
|
-
function* FromUnion(syntax) {
|
|
966
|
-
const trim = syntax.trim().replace(/"|'/g, "");
|
|
967
|
-
return trim === "boolean" ? yield Boolean() : trim === "number" ? yield Number2() : trim === "bigint" ? yield BigInt() : trim === "string" ? yield String() : yield (() => {
|
|
968
|
-
const literals = trim.split("|").map((literal) => Literal(literal.trim()));
|
|
969
|
-
return literals.length === 0 ? Never() : literals.length === 1 ? literals[0] : UnionEvaluated(literals);
|
|
970
|
-
})();
|
|
971
|
-
}
|
|
972
|
-
function* FromTerminal(syntax) {
|
|
973
|
-
if (syntax[1] !== "{") {
|
|
974
|
-
const L = Literal("$");
|
|
975
|
-
const R = FromSyntax(syntax.slice(1));
|
|
976
|
-
return yield* [L, ...R];
|
|
977
|
-
}
|
|
978
|
-
for (let i = 2; i < syntax.length; i++) {
|
|
979
|
-
if (syntax[i] === "}") {
|
|
980
|
-
const L = FromUnion(syntax.slice(2, i));
|
|
981
|
-
const R = FromSyntax(syntax.slice(i + 1));
|
|
982
|
-
return yield* [...L, ...R];
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
yield Literal(syntax);
|
|
986
|
-
}
|
|
987
|
-
function* FromSyntax(syntax) {
|
|
988
|
-
for (let i = 0; i < syntax.length; i++) {
|
|
989
|
-
if (syntax[i] === "$") {
|
|
990
|
-
const L = Literal(syntax.slice(0, i));
|
|
991
|
-
const R = FromTerminal(syntax.slice(i));
|
|
992
|
-
return yield* [L, ...R];
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
yield Literal(syntax);
|
|
996
|
-
}
|
|
997
|
-
function TemplateLiteralSyntax(syntax) {
|
|
998
|
-
return [...FromSyntax(syntax)];
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.mjs
|
|
1002
|
-
var TemplateLiteralPatternError = class extends TypeBoxError {
|
|
1003
|
-
};
|
|
1004
|
-
function Escape(value) {
|
|
1005
|
-
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1006
|
-
}
|
|
1007
|
-
function Visit2(schema, acc) {
|
|
1008
|
-
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}` : IsInteger(schema) ? `${acc}${PatternNumber}` : IsBigInt2(schema) ? `${acc}${PatternNumber}` : IsString2(schema) ? `${acc}${PatternString}` : IsLiteral(schema) ? `${acc}${Escape(schema.const.toString())}` : IsBoolean2(schema) ? `${acc}${PatternBoolean}` : (() => {
|
|
1009
|
-
throw new TemplateLiteralPatternError(`Unexpected Kind '${schema[Kind]}'`);
|
|
1010
|
-
})();
|
|
1011
|
-
}
|
|
1012
|
-
function TemplateLiteralPattern(kinds) {
|
|
1013
|
-
return `^${kinds.map((schema) => Visit2(schema, "")).join("")}$`;
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/union.mjs
|
|
1017
|
-
function TemplateLiteralToUnion(schema) {
|
|
1018
|
-
const R = TemplateLiteralGenerate(schema);
|
|
1019
|
-
const L = R.map((S) => Literal(S));
|
|
1020
|
-
return UnionEvaluated(L);
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs
|
|
1024
|
-
function TemplateLiteral(unresolved, options) {
|
|
1025
|
-
const pattern = IsString(unresolved) ? TemplateLiteralPattern(TemplateLiteralSyntax(unresolved)) : TemplateLiteralPattern(unresolved);
|
|
1026
|
-
return CreateType({ [Kind]: "TemplateLiteral", type: "string", pattern }, options);
|
|
1027
|
-
}
|
|
1028
|
-
|
|
1029
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs
|
|
1030
|
-
function FromTemplateLiteral(templateLiteral) {
|
|
1031
|
-
const keys = TemplateLiteralGenerate(templateLiteral);
|
|
1032
|
-
return keys.map((key) => key.toString());
|
|
1033
|
-
}
|
|
1034
|
-
function FromUnion2(types) {
|
|
1035
|
-
const result = [];
|
|
1036
|
-
for (const type of types)
|
|
1037
|
-
result.push(...IndexPropertyKeys(type));
|
|
1038
|
-
return result;
|
|
1039
|
-
}
|
|
1040
|
-
function FromLiteral(literalValue) {
|
|
1041
|
-
return [literalValue.toString()];
|
|
1042
|
-
}
|
|
1043
|
-
function IndexPropertyKeys(type) {
|
|
1044
|
-
return [...new Set(IsTemplateLiteral(type) ? FromTemplateLiteral(type) : IsUnion(type) ? FromUnion2(type.anyOf) : IsLiteral(type) ? FromLiteral(type.const) : IsNumber3(type) ? ["[number]"] : IsInteger(type) ? ["[number]"] : [])];
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs
|
|
1048
|
-
function FromProperties(type, properties, options) {
|
|
1049
|
-
const result = {};
|
|
1050
|
-
for (const K2 of Object.getOwnPropertyNames(properties)) {
|
|
1051
|
-
result[K2] = Index(type, IndexPropertyKeys(properties[K2]), options);
|
|
1052
|
-
}
|
|
1053
|
-
return result;
|
|
1054
|
-
}
|
|
1055
|
-
function FromMappedResult(type, mappedResult, options) {
|
|
1056
|
-
return FromProperties(type, mappedResult.properties, options);
|
|
1057
|
-
}
|
|
1058
|
-
function IndexFromMappedResult(type, mappedResult, options) {
|
|
1059
|
-
const properties = FromMappedResult(type, mappedResult, options);
|
|
1060
|
-
return MappedResult(properties);
|
|
1061
|
-
}
|
|
1062
|
-
|
|
1063
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs
|
|
1064
|
-
function FromRest(types, key) {
|
|
1065
|
-
return types.map((type) => IndexFromPropertyKey(type, key));
|
|
1066
|
-
}
|
|
1067
|
-
function FromIntersectRest(types) {
|
|
1068
|
-
return types.filter((type) => !IsNever(type));
|
|
1069
|
-
}
|
|
1070
|
-
function FromIntersect(types, key) {
|
|
1071
|
-
return IntersectEvaluated(FromIntersectRest(FromRest(types, key)));
|
|
1072
|
-
}
|
|
1073
|
-
function FromUnionRest(types) {
|
|
1074
|
-
return types.some((L) => IsNever(L)) ? [] : types;
|
|
1075
|
-
}
|
|
1076
|
-
function FromUnion3(types, key) {
|
|
1077
|
-
return UnionEvaluated(FromUnionRest(FromRest(types, key)));
|
|
1078
|
-
}
|
|
1079
|
-
function FromTuple(types, key) {
|
|
1080
|
-
return key in types ? types[key] : key === "[number]" ? UnionEvaluated(types) : Never();
|
|
1081
|
-
}
|
|
1082
|
-
function FromArray(type, key) {
|
|
1083
|
-
return key === "[number]" ? type : Never();
|
|
1084
|
-
}
|
|
1085
|
-
function FromProperty(properties, propertyKey) {
|
|
1086
|
-
return propertyKey in properties ? properties[propertyKey] : Never();
|
|
1087
|
-
}
|
|
1088
|
-
function IndexFromPropertyKey(type, propertyKey) {
|
|
1089
|
-
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();
|
|
1090
|
-
}
|
|
1091
|
-
function IndexFromPropertyKeys(type, propertyKeys) {
|
|
1092
|
-
return propertyKeys.map((propertyKey) => IndexFromPropertyKey(type, propertyKey));
|
|
1093
|
-
}
|
|
1094
|
-
function FromSchema(type, propertyKeys) {
|
|
1095
|
-
return UnionEvaluated(IndexFromPropertyKeys(type, propertyKeys));
|
|
1096
|
-
}
|
|
1097
|
-
function Index(type, key, options) {
|
|
1098
|
-
if (IsRef(type) || IsRef(key)) {
|
|
1099
|
-
const error = `Index types using Ref parameters require both Type and Key to be of TSchema`;
|
|
1100
|
-
if (!IsSchema(type) || !IsSchema(key))
|
|
1101
|
-
throw new TypeBoxError(error);
|
|
1102
|
-
return Computed("Index", [type, key]);
|
|
1103
|
-
}
|
|
1104
|
-
if (IsMappedResult(key))
|
|
1105
|
-
return IndexFromMappedResult(type, key, options);
|
|
1106
|
-
if (IsMappedKey(key))
|
|
1107
|
-
return IndexFromMappedKey(type, key, options);
|
|
1108
|
-
return CreateType(IsSchema(key) ? FromSchema(type, IndexPropertyKeys(key)) : FromSchema(type, key), options);
|
|
1109
|
-
}
|
|
1110
|
-
|
|
1111
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs
|
|
1112
|
-
function MappedIndexPropertyKey(type, key, options) {
|
|
1113
|
-
return { [key]: Index(type, [key], Clone(options)) };
|
|
1114
|
-
}
|
|
1115
|
-
function MappedIndexPropertyKeys(type, propertyKeys, options) {
|
|
1116
|
-
return propertyKeys.reduce((result, left) => {
|
|
1117
|
-
return { ...result, ...MappedIndexPropertyKey(type, left, options) };
|
|
1118
|
-
}, {});
|
|
1119
|
-
}
|
|
1120
|
-
function MappedIndexProperties(type, mappedKey, options) {
|
|
1121
|
-
return MappedIndexPropertyKeys(type, mappedKey.keys, options);
|
|
1122
|
-
}
|
|
1123
|
-
function IndexFromMappedKey(type, mappedKey, options) {
|
|
1124
|
-
const properties = MappedIndexProperties(type, mappedKey, options);
|
|
1125
|
-
return MappedResult(properties);
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1128
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs
|
|
1129
|
-
function Iterator(items, options) {
|
|
1130
|
-
return CreateType({ [Kind]: "Iterator", type: "Iterator", items }, options);
|
|
1131
|
-
}
|
|
1132
|
-
|
|
1133
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/object/object.mjs
|
|
1134
|
-
function RequiredKeys(properties) {
|
|
1135
|
-
const keys = [];
|
|
1136
|
-
for (let key in properties) {
|
|
1137
|
-
if (!IsOptional(properties[key]))
|
|
1138
|
-
keys.push(key);
|
|
1139
|
-
}
|
|
1140
|
-
return keys;
|
|
1141
|
-
}
|
|
1142
|
-
function _Object(properties, options) {
|
|
1143
|
-
const required = RequiredKeys(properties);
|
|
1144
|
-
const schematic = required.length > 0 ? { [Kind]: "Object", type: "object", properties, required } : { [Kind]: "Object", type: "object", properties };
|
|
1145
|
-
return CreateType(schematic, options);
|
|
1146
|
-
}
|
|
1147
|
-
var Object2 = _Object;
|
|
1148
|
-
|
|
1149
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs
|
|
1150
|
-
function Promise2(item, options) {
|
|
1151
|
-
return CreateType({ [Kind]: "Promise", type: "Promise", item }, options);
|
|
1152
|
-
}
|
|
1153
|
-
|
|
1154
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs
|
|
1155
|
-
function RemoveReadonly(schema) {
|
|
1156
|
-
return CreateType(Discard(schema, [ReadonlyKind]));
|
|
1157
|
-
}
|
|
1158
|
-
function AddReadonly(schema) {
|
|
1159
|
-
return CreateType({ ...schema, [ReadonlyKind]: "Readonly" });
|
|
1160
|
-
}
|
|
1161
|
-
function ReadonlyWithFlag(schema, F) {
|
|
1162
|
-
return F === false ? RemoveReadonly(schema) : AddReadonly(schema);
|
|
1163
|
-
}
|
|
1164
|
-
function Readonly(schema, enable) {
|
|
1165
|
-
const F = enable ?? true;
|
|
1166
|
-
return IsMappedResult(schema) ? ReadonlyFromMappedResult(schema, F) : ReadonlyWithFlag(schema, F);
|
|
1167
|
-
}
|
|
1168
|
-
|
|
1169
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.mjs
|
|
1170
|
-
function FromProperties2(K, F) {
|
|
1171
|
-
const Acc = {};
|
|
1172
|
-
for (const K2 of globalThis.Object.getOwnPropertyNames(K))
|
|
1173
|
-
Acc[K2] = Readonly(K[K2], F);
|
|
1174
|
-
return Acc;
|
|
1175
|
-
}
|
|
1176
|
-
function FromMappedResult2(R, F) {
|
|
1177
|
-
return FromProperties2(R.properties, F);
|
|
1178
|
-
}
|
|
1179
|
-
function ReadonlyFromMappedResult(R, F) {
|
|
1180
|
-
const P = FromMappedResult2(R, F);
|
|
1181
|
-
return MappedResult(P);
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1184
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs
|
|
1185
|
-
function Tuple(types, options) {
|
|
1186
|
-
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);
|
|
1187
|
-
}
|
|
1188
|
-
|
|
1189
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs
|
|
1190
|
-
function FromMappedResult3(K, P) {
|
|
1191
|
-
return K in P ? FromSchemaType(K, P[K]) : MappedResult(P);
|
|
1192
|
-
}
|
|
1193
|
-
function MappedKeyToKnownMappedResultProperties(K) {
|
|
1194
|
-
return { [K]: Literal(K) };
|
|
1195
|
-
}
|
|
1196
|
-
function MappedKeyToUnknownMappedResultProperties(P) {
|
|
1197
|
-
const Acc = {};
|
|
1198
|
-
for (const L of P)
|
|
1199
|
-
Acc[L] = Literal(L);
|
|
1200
|
-
return Acc;
|
|
1201
|
-
}
|
|
1202
|
-
function MappedKeyToMappedResultProperties(K, P) {
|
|
1203
|
-
return SetIncludes(P, K) ? MappedKeyToKnownMappedResultProperties(K) : MappedKeyToUnknownMappedResultProperties(P);
|
|
1204
|
-
}
|
|
1205
|
-
function FromMappedKey(K, P) {
|
|
1206
|
-
const R = MappedKeyToMappedResultProperties(K, P);
|
|
1207
|
-
return FromMappedResult3(K, R);
|
|
1208
|
-
}
|
|
1209
|
-
function FromRest2(K, T) {
|
|
1210
|
-
return T.map((L) => FromSchemaType(K, L));
|
|
1211
|
-
}
|
|
1212
|
-
function FromProperties3(K, T) {
|
|
1213
|
-
const Acc = {};
|
|
1214
|
-
for (const K2 of globalThis.Object.getOwnPropertyNames(T))
|
|
1215
|
-
Acc[K2] = FromSchemaType(K, T[K2]);
|
|
1216
|
-
return Acc;
|
|
1217
|
-
}
|
|
1218
|
-
function FromSchemaType(K, T) {
|
|
1219
|
-
const options = { ...T };
|
|
1220
|
-
return (
|
|
1221
|
-
// unevaluated modifier types
|
|
1222
|
-
IsOptional(T) ? Optional(FromSchemaType(K, Discard(T, [OptionalKind]))) : IsReadonly(T) ? Readonly(FromSchemaType(K, Discard(T, [ReadonlyKind]))) : (
|
|
1223
|
-
// unevaluated mapped types
|
|
1224
|
-
IsMappedResult(T) ? FromMappedResult3(K, T.properties) : IsMappedKey(T) ? FromMappedKey(K, T.keys) : (
|
|
1225
|
-
// unevaluated types
|
|
1226
|
-
IsConstructor(T) ? Constructor(FromRest2(K, T.parameters), FromSchemaType(K, T.returns), options) : IsFunction2(T) ? Function(FromRest2(K, T.parameters), FromSchemaType(K, T.returns), options) : IsAsyncIterator2(T) ? AsyncIterator(FromSchemaType(K, T.items), options) : IsIterator2(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) : IsPromise(T) ? Promise2(FromSchemaType(K, T.item), options) : T
|
|
1227
|
-
)
|
|
1228
|
-
)
|
|
1229
|
-
);
|
|
1230
|
-
}
|
|
1231
|
-
function MappedFunctionReturnType(K, T) {
|
|
1232
|
-
const Acc = {};
|
|
1233
|
-
for (const L of K)
|
|
1234
|
-
Acc[L] = FromSchemaType(L, T);
|
|
1235
|
-
return Acc;
|
|
1236
|
-
}
|
|
1237
|
-
function Mapped(key, map, options) {
|
|
1238
|
-
const K = IsSchema(key) ? IndexPropertyKeys(key) : key;
|
|
1239
|
-
const RT = map({ [Kind]: "MappedKey", keys: K });
|
|
1240
|
-
const R = MappedFunctionReturnType(K, RT);
|
|
1241
|
-
return Object2(R, options);
|
|
1242
|
-
}
|
|
1243
|
-
|
|
1244
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs
|
|
1245
|
-
function RemoveOptional(schema) {
|
|
1246
|
-
return CreateType(Discard(schema, [OptionalKind]));
|
|
1247
|
-
}
|
|
1248
|
-
function AddOptional(schema) {
|
|
1249
|
-
return CreateType({ ...schema, [OptionalKind]: "Optional" });
|
|
1250
|
-
}
|
|
1251
|
-
function OptionalWithFlag(schema, F) {
|
|
1252
|
-
return F === false ? RemoveOptional(schema) : AddOptional(schema);
|
|
1253
|
-
}
|
|
1254
|
-
function Optional(schema, enable) {
|
|
1255
|
-
const F = enable ?? true;
|
|
1256
|
-
return IsMappedResult(schema) ? OptionalFromMappedResult(schema, F) : OptionalWithFlag(schema, F);
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.mjs
|
|
1260
|
-
function FromProperties4(P, F) {
|
|
1261
|
-
const Acc = {};
|
|
1262
|
-
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
1263
|
-
Acc[K2] = Optional(P[K2], F);
|
|
1264
|
-
return Acc;
|
|
1265
|
-
}
|
|
1266
|
-
function FromMappedResult4(R, F) {
|
|
1267
|
-
return FromProperties4(R.properties, F);
|
|
1268
|
-
}
|
|
1269
|
-
function OptionalFromMappedResult(R, F) {
|
|
1270
|
-
const P = FromMappedResult4(R, F);
|
|
1271
|
-
return MappedResult(P);
|
|
1272
|
-
}
|
|
1273
|
-
|
|
1274
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs
|
|
1275
|
-
function IntersectCreate(T, options = {}) {
|
|
1276
|
-
const allObjects = T.every((schema) => IsObject3(schema));
|
|
1277
|
-
const clonedUnevaluatedProperties = IsSchema(options.unevaluatedProperties) ? { unevaluatedProperties: options.unevaluatedProperties } : {};
|
|
1278
|
-
return CreateType(options.unevaluatedProperties === false || IsSchema(options.unevaluatedProperties) || allObjects ? { ...clonedUnevaluatedProperties, [Kind]: "Intersect", type: "object", allOf: T } : { ...clonedUnevaluatedProperties, [Kind]: "Intersect", allOf: T }, options);
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs
|
|
1282
|
-
function IsIntersectOptional(types) {
|
|
1283
|
-
return types.every((left) => IsOptional(left));
|
|
1284
|
-
}
|
|
1285
|
-
function RemoveOptionalFromType2(type) {
|
|
1286
|
-
return Discard(type, [OptionalKind]);
|
|
1287
|
-
}
|
|
1288
|
-
function RemoveOptionalFromRest2(types) {
|
|
1289
|
-
return types.map((left) => IsOptional(left) ? RemoveOptionalFromType2(left) : left);
|
|
1290
|
-
}
|
|
1291
|
-
function ResolveIntersect(types, options) {
|
|
1292
|
-
return IsIntersectOptional(types) ? Optional(IntersectCreate(RemoveOptionalFromRest2(types), options)) : IntersectCreate(RemoveOptionalFromRest2(types), options);
|
|
1293
|
-
}
|
|
1294
|
-
function IntersectEvaluated(types, options = {}) {
|
|
1295
|
-
if (types.length === 1)
|
|
1296
|
-
return CreateType(types[0], options);
|
|
1297
|
-
if (types.length === 0)
|
|
1298
|
-
return Never(options);
|
|
1299
|
-
if (types.some((schema) => IsTransform(schema)))
|
|
1300
|
-
throw new Error("Cannot intersect transform types");
|
|
1301
|
-
return ResolveIntersect(types, options);
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs
|
|
1305
|
-
function Intersect(types, options) {
|
|
1306
|
-
if (types.length === 1)
|
|
1307
|
-
return CreateType(types[0], options);
|
|
1308
|
-
if (types.length === 0)
|
|
1309
|
-
return Never(options);
|
|
1310
|
-
if (types.some((schema) => IsTransform(schema)))
|
|
1311
|
-
throw new Error("Cannot intersect transform types");
|
|
1312
|
-
return IntersectCreate(types, options);
|
|
1313
|
-
}
|
|
1314
|
-
|
|
1315
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs
|
|
1316
|
-
function Ref(...args) {
|
|
1317
|
-
const [$ref, options] = typeof args[0] === "string" ? [args[0], args[1]] : [args[0].$id, args[1]];
|
|
1318
|
-
if (typeof $ref !== "string")
|
|
1319
|
-
throw new TypeBoxError("Ref: $ref must be a string");
|
|
1320
|
-
return CreateType({ [Kind]: "Ref", $ref }, options);
|
|
1321
|
-
}
|
|
1322
|
-
|
|
1323
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs
|
|
1324
|
-
function FromComputed(target, parameters) {
|
|
1325
|
-
return Computed("Awaited", [Computed(target, parameters)]);
|
|
1326
|
-
}
|
|
1327
|
-
function FromRef($ref) {
|
|
1328
|
-
return Computed("Awaited", [Ref($ref)]);
|
|
1329
|
-
}
|
|
1330
|
-
function FromIntersect2(types) {
|
|
1331
|
-
return Intersect(FromRest3(types));
|
|
1332
|
-
}
|
|
1333
|
-
function FromUnion4(types) {
|
|
1334
|
-
return Union(FromRest3(types));
|
|
1335
|
-
}
|
|
1336
|
-
function FromPromise(type) {
|
|
1337
|
-
return Awaited(type);
|
|
1338
|
-
}
|
|
1339
|
-
function FromRest3(types) {
|
|
1340
|
-
return types.map((type) => Awaited(type));
|
|
1341
|
-
}
|
|
1342
|
-
function Awaited(type, options) {
|
|
1343
|
-
return CreateType(IsComputed(type) ? FromComputed(type.target, type.parameters) : IsIntersect(type) ? FromIntersect2(type.allOf) : IsUnion(type) ? FromUnion4(type.anyOf) : IsPromise(type) ? FromPromise(type.item) : IsRef(type) ? FromRef(type.$ref) : type, options);
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1346
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs
|
|
1347
|
-
function FromRest4(types) {
|
|
1348
|
-
const result = [];
|
|
1349
|
-
for (const L of types)
|
|
1350
|
-
result.push(KeyOfPropertyKeys(L));
|
|
1351
|
-
return result;
|
|
1352
|
-
}
|
|
1353
|
-
function FromIntersect3(types) {
|
|
1354
|
-
const propertyKeysArray = FromRest4(types);
|
|
1355
|
-
const propertyKeys = SetUnionMany(propertyKeysArray);
|
|
1356
|
-
return propertyKeys;
|
|
1357
|
-
}
|
|
1358
|
-
function FromUnion5(types) {
|
|
1359
|
-
const propertyKeysArray = FromRest4(types);
|
|
1360
|
-
const propertyKeys = SetIntersectMany(propertyKeysArray);
|
|
1361
|
-
return propertyKeys;
|
|
1362
|
-
}
|
|
1363
|
-
function FromTuple2(types) {
|
|
1364
|
-
return types.map((_, indexer) => indexer.toString());
|
|
1365
|
-
}
|
|
1366
|
-
function FromArray2(_) {
|
|
1367
|
-
return ["[number]"];
|
|
1368
|
-
}
|
|
1369
|
-
function FromProperties5(T) {
|
|
1370
|
-
return globalThis.Object.getOwnPropertyNames(T);
|
|
1371
|
-
}
|
|
1372
|
-
function FromPatternProperties(patternProperties) {
|
|
1373
|
-
if (!includePatternProperties)
|
|
1374
|
-
return [];
|
|
1375
|
-
const patternPropertyKeys = globalThis.Object.getOwnPropertyNames(patternProperties);
|
|
1376
|
-
return patternPropertyKeys.map((key) => {
|
|
1377
|
-
return key[0] === "^" && key[key.length - 1] === "$" ? key.slice(1, key.length - 1) : key;
|
|
1378
|
-
});
|
|
1379
|
-
}
|
|
1380
|
-
function KeyOfPropertyKeys(type) {
|
|
1381
|
-
return IsIntersect(type) ? FromIntersect3(type.allOf) : IsUnion(type) ? FromUnion5(type.anyOf) : IsTuple(type) ? FromTuple2(type.items ?? []) : IsArray3(type) ? FromArray2(type.items) : IsObject3(type) ? FromProperties5(type.properties) : IsRecord(type) ? FromPatternProperties(type.patternProperties) : [];
|
|
1382
|
-
}
|
|
1383
|
-
var includePatternProperties = false;
|
|
1384
|
-
|
|
1385
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs
|
|
1386
|
-
function FromComputed2(target, parameters) {
|
|
1387
|
-
return Computed("KeyOf", [Computed(target, parameters)]);
|
|
1388
|
-
}
|
|
1389
|
-
function FromRef2($ref) {
|
|
1390
|
-
return Computed("KeyOf", [Ref($ref)]);
|
|
1391
|
-
}
|
|
1392
|
-
function KeyOfFromType(type, options) {
|
|
1393
|
-
const propertyKeys = KeyOfPropertyKeys(type);
|
|
1394
|
-
const propertyKeyTypes = KeyOfPropertyKeysToRest(propertyKeys);
|
|
1395
|
-
const result = UnionEvaluated(propertyKeyTypes);
|
|
1396
|
-
return CreateType(result, options);
|
|
1397
|
-
}
|
|
1398
|
-
function KeyOfPropertyKeysToRest(propertyKeys) {
|
|
1399
|
-
return propertyKeys.map((L) => L === "[number]" ? Number2() : Literal(L));
|
|
1400
|
-
}
|
|
1401
|
-
function KeyOf(type, options) {
|
|
1402
|
-
return IsComputed(type) ? FromComputed2(type.target, type.parameters) : IsRef(type) ? FromRef2(type.$ref) : IsMappedResult(type) ? KeyOfFromMappedResult(type, options) : KeyOfFromType(type, options);
|
|
1403
|
-
}
|
|
1404
|
-
|
|
1405
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs
|
|
1406
|
-
function FromProperties6(properties, options) {
|
|
1407
|
-
const result = {};
|
|
1408
|
-
for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
|
|
1409
|
-
result[K2] = KeyOf(properties[K2], Clone(options));
|
|
1410
|
-
return result;
|
|
1411
|
-
}
|
|
1412
|
-
function FromMappedResult5(mappedResult, options) {
|
|
1413
|
-
return FromProperties6(mappedResult.properties, options);
|
|
1414
|
-
}
|
|
1415
|
-
function KeyOfFromMappedResult(mappedResult, options) {
|
|
1416
|
-
const properties = FromMappedResult5(mappedResult, options);
|
|
1417
|
-
return MappedResult(properties);
|
|
1418
|
-
}
|
|
1419
|
-
|
|
1420
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs
|
|
1421
|
-
function CompositeKeys(T) {
|
|
1422
|
-
const Acc = [];
|
|
1423
|
-
for (const L of T)
|
|
1424
|
-
Acc.push(...KeyOfPropertyKeys(L));
|
|
1425
|
-
return SetDistinct(Acc);
|
|
1426
|
-
}
|
|
1427
|
-
function FilterNever(T) {
|
|
1428
|
-
return T.filter((L) => !IsNever(L));
|
|
1429
|
-
}
|
|
1430
|
-
function CompositeProperty(T, K) {
|
|
1431
|
-
const Acc = [];
|
|
1432
|
-
for (const L of T)
|
|
1433
|
-
Acc.push(...IndexFromPropertyKeys(L, [K]));
|
|
1434
|
-
return FilterNever(Acc);
|
|
1435
|
-
}
|
|
1436
|
-
function CompositeProperties(T, K) {
|
|
1437
|
-
const Acc = {};
|
|
1438
|
-
for (const L of K) {
|
|
1439
|
-
Acc[L] = IntersectEvaluated(CompositeProperty(T, L));
|
|
1440
|
-
}
|
|
1441
|
-
return Acc;
|
|
1442
|
-
}
|
|
1443
|
-
function Composite(T, options) {
|
|
1444
|
-
const K = CompositeKeys(T);
|
|
1445
|
-
const P = CompositeProperties(T, K);
|
|
1446
|
-
const R = Object2(P, options);
|
|
1447
|
-
return R;
|
|
1448
|
-
}
|
|
1449
|
-
|
|
1450
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/date/date.mjs
|
|
1451
|
-
function Date2(options) {
|
|
1452
|
-
return CreateType({ [Kind]: "Date", type: "Date" }, options);
|
|
1453
|
-
}
|
|
1454
|
-
|
|
1455
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/null/null.mjs
|
|
1456
|
-
function Null(options) {
|
|
1457
|
-
return CreateType({ [Kind]: "Null", type: "null" }, options);
|
|
1458
|
-
}
|
|
1459
|
-
|
|
1460
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs
|
|
1461
|
-
function Symbol2(options) {
|
|
1462
|
-
return CreateType({ [Kind]: "Symbol", type: "symbol" }, options);
|
|
1463
|
-
}
|
|
1464
|
-
|
|
1465
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs
|
|
1466
|
-
function Undefined(options) {
|
|
1467
|
-
return CreateType({ [Kind]: "Undefined", type: "undefined" }, options);
|
|
1468
|
-
}
|
|
1469
|
-
|
|
1470
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs
|
|
1471
|
-
function Uint8Array2(options) {
|
|
1472
|
-
return CreateType({ [Kind]: "Uint8Array", type: "Uint8Array" }, options);
|
|
1473
|
-
}
|
|
1474
|
-
|
|
1475
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs
|
|
1476
|
-
function Unknown(options) {
|
|
1477
|
-
return CreateType({ [Kind]: "Unknown" }, options);
|
|
1478
|
-
}
|
|
1479
|
-
|
|
1480
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/const/const.mjs
|
|
1481
|
-
function FromArray3(T) {
|
|
1482
|
-
return T.map((L) => FromValue(L, false));
|
|
1483
|
-
}
|
|
1484
|
-
function FromProperties7(value) {
|
|
1485
|
-
const Acc = {};
|
|
1486
|
-
for (const K of globalThis.Object.getOwnPropertyNames(value))
|
|
1487
|
-
Acc[K] = Readonly(FromValue(value[K], false));
|
|
1488
|
-
return Acc;
|
|
1489
|
-
}
|
|
1490
|
-
function ConditionalReadonly(T, root) {
|
|
1491
|
-
return root === true ? T : Readonly(T);
|
|
1492
|
-
}
|
|
1493
|
-
function FromValue(value, root) {
|
|
1494
|
-
return IsAsyncIterator(value) ? ConditionalReadonly(Any(), root) : IsIterator(value) ? ConditionalReadonly(Any(), root) : IsArray(value) ? Readonly(Tuple(FromArray3(value))) : IsUint8Array(value) ? Uint8Array2() : IsDate(value) ? Date2() : IsObject(value) ? ConditionalReadonly(Object2(FromProperties7(value)), root) : IsFunction(value) ? ConditionalReadonly(Function([], Unknown()), root) : IsUndefined(value) ? Undefined() : IsNull(value) ? Null() : IsSymbol(value) ? Symbol2() : IsBigInt(value) ? BigInt() : IsNumber(value) ? Literal(value) : IsBoolean(value) ? Literal(value) : IsString(value) ? Literal(value) : Object2({});
|
|
1495
|
-
}
|
|
1496
|
-
function Const(T, options) {
|
|
1497
|
-
return CreateType(FromValue(T, true), options);
|
|
1498
|
-
}
|
|
1499
|
-
|
|
1500
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs
|
|
1501
|
-
function ConstructorParameters(schema, options) {
|
|
1502
|
-
return IsConstructor(schema) ? Tuple(schema.parameters, options) : Never(options);
|
|
1503
|
-
}
|
|
1504
|
-
|
|
1505
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs
|
|
1506
|
-
function Enum(item, options) {
|
|
1507
|
-
if (IsUndefined(item))
|
|
1508
|
-
throw new Error("Enum undefined or empty");
|
|
1509
|
-
const values1 = globalThis.Object.getOwnPropertyNames(item).filter((key) => isNaN(key)).map((key) => item[key]);
|
|
1510
|
-
const values2 = [...new Set(values1)];
|
|
1511
|
-
const anyOf = values2.map((value) => Literal(value));
|
|
1512
|
-
return Union(anyOf, { ...options, [Hint]: "Enum" });
|
|
1513
|
-
}
|
|
1514
|
-
|
|
1515
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.mjs
|
|
1516
|
-
var ExtendsResolverError = class extends TypeBoxError {
|
|
1517
|
-
};
|
|
1518
|
-
var ExtendsResult;
|
|
1519
|
-
(function(ExtendsResult2) {
|
|
1520
|
-
ExtendsResult2[ExtendsResult2["Union"] = 0] = "Union";
|
|
1521
|
-
ExtendsResult2[ExtendsResult2["True"] = 1] = "True";
|
|
1522
|
-
ExtendsResult2[ExtendsResult2["False"] = 2] = "False";
|
|
1523
|
-
})(ExtendsResult || (ExtendsResult = {}));
|
|
1524
|
-
function IntoBooleanResult(result) {
|
|
1525
|
-
return result === ExtendsResult.False ? result : ExtendsResult.True;
|
|
1526
|
-
}
|
|
1527
|
-
function Throw(message) {
|
|
1528
|
-
throw new ExtendsResolverError(message);
|
|
1529
|
-
}
|
|
1530
|
-
function IsStructuralRight(right) {
|
|
1531
|
-
return type_exports.IsNever(right) || type_exports.IsIntersect(right) || type_exports.IsUnion(right) || type_exports.IsUnknown(right) || type_exports.IsAny(right);
|
|
1532
|
-
}
|
|
1533
|
-
function StructuralRight(left, right) {
|
|
1534
|
-
return type_exports.IsNever(right) ? FromNeverRight(left, right) : type_exports.IsIntersect(right) ? FromIntersectRight(left, right) : type_exports.IsUnion(right) ? FromUnionRight(left, right) : type_exports.IsUnknown(right) ? FromUnknownRight(left, right) : type_exports.IsAny(right) ? FromAnyRight(left, right) : Throw("StructuralRight");
|
|
1535
|
-
}
|
|
1536
|
-
function FromAnyRight(left, right) {
|
|
1537
|
-
return ExtendsResult.True;
|
|
1538
|
-
}
|
|
1539
|
-
function FromAny(left, right) {
|
|
1540
|
-
return type_exports.IsIntersect(right) ? FromIntersectRight(left, right) : type_exports.IsUnion(right) && right.anyOf.some((schema) => type_exports.IsAny(schema) || type_exports.IsUnknown(schema)) ? ExtendsResult.True : type_exports.IsUnion(right) ? ExtendsResult.Union : type_exports.IsUnknown(right) ? ExtendsResult.True : type_exports.IsAny(right) ? ExtendsResult.True : ExtendsResult.Union;
|
|
1541
|
-
}
|
|
1542
|
-
function FromArrayRight(left, right) {
|
|
1543
|
-
return type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : type_exports.IsNever(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1544
|
-
}
|
|
1545
|
-
function FromArray4(left, right) {
|
|
1546
|
-
return type_exports.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsArray(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
|
|
1547
|
-
}
|
|
1548
|
-
function FromAsyncIterator(left, right) {
|
|
1549
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsAsyncIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
|
|
1550
|
-
}
|
|
1551
|
-
function FromBigInt(left, right) {
|
|
1552
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsBigInt(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1553
|
-
}
|
|
1554
|
-
function FromBooleanRight(left, right) {
|
|
1555
|
-
return type_exports.IsLiteralBoolean(left) ? ExtendsResult.True : type_exports.IsBoolean(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1556
|
-
}
|
|
1557
|
-
function FromBoolean(left, right) {
|
|
1558
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsBoolean(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1559
|
-
}
|
|
1560
|
-
function FromConstructor(left, right) {
|
|
1561
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : !type_exports.IsConstructor(right) ? ExtendsResult.False : left.parameters.length > right.parameters.length ? ExtendsResult.False : !left.parameters.every((schema, index) => IntoBooleanResult(Visit3(right.parameters[index], schema)) === ExtendsResult.True) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.returns, right.returns));
|
|
1562
|
-
}
|
|
1563
|
-
function FromDate(left, right) {
|
|
1564
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsDate(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1565
|
-
}
|
|
1566
|
-
function FromFunction(left, right) {
|
|
1567
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : !type_exports.IsFunction(right) ? ExtendsResult.False : left.parameters.length > right.parameters.length ? ExtendsResult.False : !left.parameters.every((schema, index) => IntoBooleanResult(Visit3(right.parameters[index], schema)) === ExtendsResult.True) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.returns, right.returns));
|
|
1568
|
-
}
|
|
1569
|
-
function FromIntegerRight(left, right) {
|
|
1570
|
-
return type_exports.IsLiteral(left) && value_exports.IsNumber(left.const) ? ExtendsResult.True : type_exports.IsNumber(left) || type_exports.IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1571
|
-
}
|
|
1572
|
-
function FromInteger(left, right) {
|
|
1573
|
-
return type_exports.IsInteger(right) || type_exports.IsNumber(right) ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : ExtendsResult.False;
|
|
1574
|
-
}
|
|
1575
|
-
function FromIntersectRight(left, right) {
|
|
1576
|
-
return right.allOf.every((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1577
|
-
}
|
|
1578
|
-
function FromIntersect4(left, right) {
|
|
1579
|
-
return left.allOf.some((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1580
|
-
}
|
|
1581
|
-
function FromIterator(left, right) {
|
|
1582
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
|
|
1583
|
-
}
|
|
1584
|
-
function FromLiteral2(left, right) {
|
|
1585
|
-
return type_exports.IsLiteral(right) && right.const === left.const ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsString(right) ? FromStringRight(left, right) : type_exports.IsNumber(right) ? FromNumberRight(left, right) : type_exports.IsInteger(right) ? FromIntegerRight(left, right) : type_exports.IsBoolean(right) ? FromBooleanRight(left, right) : ExtendsResult.False;
|
|
1586
|
-
}
|
|
1587
|
-
function FromNeverRight(left, right) {
|
|
1588
|
-
return ExtendsResult.False;
|
|
1589
|
-
}
|
|
1590
|
-
function FromNever(left, right) {
|
|
1591
|
-
return ExtendsResult.True;
|
|
1592
|
-
}
|
|
1593
|
-
function UnwrapTNot(schema) {
|
|
1594
|
-
let [current, depth] = [schema, 0];
|
|
1595
|
-
while (true) {
|
|
1596
|
-
if (!type_exports.IsNot(current))
|
|
1597
|
-
break;
|
|
1598
|
-
current = current.not;
|
|
1599
|
-
depth += 1;
|
|
1600
|
-
}
|
|
1601
|
-
return depth % 2 === 0 ? current : Unknown();
|
|
1602
|
-
}
|
|
1603
|
-
function FromNot(left, right) {
|
|
1604
|
-
return type_exports.IsNot(left) ? Visit3(UnwrapTNot(left), right) : type_exports.IsNot(right) ? Visit3(left, UnwrapTNot(right)) : Throw("Invalid fallthrough for Not");
|
|
1605
|
-
}
|
|
1606
|
-
function FromNull(left, right) {
|
|
1607
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsNull(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1608
|
-
}
|
|
1609
|
-
function FromNumberRight(left, right) {
|
|
1610
|
-
return type_exports.IsLiteralNumber(left) ? ExtendsResult.True : type_exports.IsNumber(left) || type_exports.IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1611
|
-
}
|
|
1612
|
-
function FromNumber(left, right) {
|
|
1613
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsInteger(right) || type_exports.IsNumber(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1614
|
-
}
|
|
1615
|
-
function IsObjectPropertyCount(schema, count) {
|
|
1616
|
-
return Object.getOwnPropertyNames(schema.properties).length === count;
|
|
1617
|
-
}
|
|
1618
|
-
function IsObjectStringLike(schema) {
|
|
1619
|
-
return IsObjectArrayLike(schema);
|
|
1620
|
-
}
|
|
1621
|
-
function IsObjectSymbolLike(schema) {
|
|
1622
|
-
return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "description" in schema.properties && type_exports.IsUnion(schema.properties.description) && schema.properties.description.anyOf.length === 2 && (type_exports.IsString(schema.properties.description.anyOf[0]) && type_exports.IsUndefined(schema.properties.description.anyOf[1]) || type_exports.IsString(schema.properties.description.anyOf[1]) && type_exports.IsUndefined(schema.properties.description.anyOf[0]));
|
|
1623
|
-
}
|
|
1624
|
-
function IsObjectNumberLike(schema) {
|
|
1625
|
-
return IsObjectPropertyCount(schema, 0);
|
|
1626
|
-
}
|
|
1627
|
-
function IsObjectBooleanLike(schema) {
|
|
1628
|
-
return IsObjectPropertyCount(schema, 0);
|
|
1629
|
-
}
|
|
1630
|
-
function IsObjectBigIntLike(schema) {
|
|
1631
|
-
return IsObjectPropertyCount(schema, 0);
|
|
1632
|
-
}
|
|
1633
|
-
function IsObjectDateLike(schema) {
|
|
1634
|
-
return IsObjectPropertyCount(schema, 0);
|
|
1635
|
-
}
|
|
1636
|
-
function IsObjectUint8ArrayLike(schema) {
|
|
1637
|
-
return IsObjectArrayLike(schema);
|
|
1638
|
-
}
|
|
1639
|
-
function IsObjectFunctionLike(schema) {
|
|
1640
|
-
const length = Number2();
|
|
1641
|
-
return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit3(schema.properties["length"], length)) === ExtendsResult.True;
|
|
1642
|
-
}
|
|
1643
|
-
function IsObjectConstructorLike(schema) {
|
|
1644
|
-
return IsObjectPropertyCount(schema, 0);
|
|
1645
|
-
}
|
|
1646
|
-
function IsObjectArrayLike(schema) {
|
|
1647
|
-
const length = Number2();
|
|
1648
|
-
return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit3(schema.properties["length"], length)) === ExtendsResult.True;
|
|
1649
|
-
}
|
|
1650
|
-
function IsObjectPromiseLike(schema) {
|
|
1651
|
-
const then = Function([Any()], Any());
|
|
1652
|
-
return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "then" in schema.properties && IntoBooleanResult(Visit3(schema.properties["then"], then)) === ExtendsResult.True;
|
|
1653
|
-
}
|
|
1654
|
-
function Property(left, right) {
|
|
1655
|
-
return Visit3(left, right) === ExtendsResult.False ? ExtendsResult.False : type_exports.IsOptional(left) && !type_exports.IsOptional(right) ? ExtendsResult.False : ExtendsResult.True;
|
|
1656
|
-
}
|
|
1657
|
-
function FromObjectRight(left, right) {
|
|
1658
|
-
return type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : type_exports.IsNever(left) || type_exports.IsLiteralString(left) && IsObjectStringLike(right) || type_exports.IsLiteralNumber(left) && IsObjectNumberLike(right) || type_exports.IsLiteralBoolean(left) && IsObjectBooleanLike(right) || type_exports.IsSymbol(left) && IsObjectSymbolLike(right) || type_exports.IsBigInt(left) && IsObjectBigIntLike(right) || type_exports.IsString(left) && IsObjectStringLike(right) || type_exports.IsSymbol(left) && IsObjectSymbolLike(right) || type_exports.IsNumber(left) && IsObjectNumberLike(right) || type_exports.IsInteger(left) && IsObjectNumberLike(right) || type_exports.IsBoolean(left) && IsObjectBooleanLike(right) || type_exports.IsUint8Array(left) && IsObjectUint8ArrayLike(right) || type_exports.IsDate(left) && IsObjectDateLike(right) || type_exports.IsConstructor(left) && IsObjectConstructorLike(right) || type_exports.IsFunction(left) && IsObjectFunctionLike(right) ? ExtendsResult.True : type_exports.IsRecord(left) && type_exports.IsString(RecordKey(left)) ? (() => {
|
|
1659
|
-
return right[Hint] === "Record" ? ExtendsResult.True : ExtendsResult.False;
|
|
1660
|
-
})() : type_exports.IsRecord(left) && type_exports.IsNumber(RecordKey(left)) ? (() => {
|
|
1661
|
-
return IsObjectPropertyCount(right, 0) ? ExtendsResult.True : ExtendsResult.False;
|
|
1662
|
-
})() : ExtendsResult.False;
|
|
1663
|
-
}
|
|
1664
|
-
function FromObject(left, right) {
|
|
1665
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : !type_exports.IsObject(right) ? ExtendsResult.False : (() => {
|
|
1666
|
-
for (const key of Object.getOwnPropertyNames(right.properties)) {
|
|
1667
|
-
if (!(key in left.properties) && !type_exports.IsOptional(right.properties[key])) {
|
|
1668
|
-
return ExtendsResult.False;
|
|
1669
|
-
}
|
|
1670
|
-
if (type_exports.IsOptional(right.properties[key])) {
|
|
1671
|
-
return ExtendsResult.True;
|
|
1672
|
-
}
|
|
1673
|
-
if (Property(left.properties[key], right.properties[key]) === ExtendsResult.False) {
|
|
1674
|
-
return ExtendsResult.False;
|
|
1675
|
-
}
|
|
1676
|
-
}
|
|
1677
|
-
return ExtendsResult.True;
|
|
1678
|
-
})();
|
|
1679
|
-
}
|
|
1680
|
-
function FromPromise2(left, right) {
|
|
1681
|
-
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));
|
|
1682
|
-
}
|
|
1683
|
-
function RecordKey(schema) {
|
|
1684
|
-
return PatternNumberExact in schema.patternProperties ? Number2() : PatternStringExact in schema.patternProperties ? String() : Throw("Unknown record key pattern");
|
|
1685
|
-
}
|
|
1686
|
-
function RecordValue(schema) {
|
|
1687
|
-
return PatternNumberExact in schema.patternProperties ? schema.patternProperties[PatternNumberExact] : PatternStringExact in schema.patternProperties ? schema.patternProperties[PatternStringExact] : Throw("Unable to get record value schema");
|
|
1688
|
-
}
|
|
1689
|
-
function FromRecordRight(left, right) {
|
|
1690
|
-
const [Key, Value] = [RecordKey(right), RecordValue(right)];
|
|
1691
|
-
return type_exports.IsLiteralString(left) && type_exports.IsNumber(Key) && IntoBooleanResult(Visit3(left, Value)) === ExtendsResult.True ? ExtendsResult.True : type_exports.IsUint8Array(left) && type_exports.IsNumber(Key) ? Visit3(left, Value) : type_exports.IsString(left) && type_exports.IsNumber(Key) ? Visit3(left, Value) : type_exports.IsArray(left) && type_exports.IsNumber(Key) ? Visit3(left, Value) : type_exports.IsObject(left) ? (() => {
|
|
1692
|
-
for (const key of Object.getOwnPropertyNames(left.properties)) {
|
|
1693
|
-
if (Property(Value, left.properties[key]) === ExtendsResult.False) {
|
|
1694
|
-
return ExtendsResult.False;
|
|
1695
|
-
}
|
|
1696
|
-
}
|
|
1697
|
-
return ExtendsResult.True;
|
|
1698
|
-
})() : ExtendsResult.False;
|
|
1699
|
-
}
|
|
1700
|
-
function FromRecord(left, right) {
|
|
1701
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : !type_exports.IsRecord(right) ? ExtendsResult.False : Visit3(RecordValue(left), RecordValue(right));
|
|
1702
|
-
}
|
|
1703
|
-
function FromRegExp(left, right) {
|
|
1704
|
-
const L = type_exports.IsRegExp(left) ? String() : left;
|
|
1705
|
-
const R = type_exports.IsRegExp(right) ? String() : right;
|
|
1706
|
-
return Visit3(L, R);
|
|
1707
|
-
}
|
|
1708
|
-
function FromStringRight(left, right) {
|
|
1709
|
-
return type_exports.IsLiteral(left) && value_exports.IsString(left.const) ? ExtendsResult.True : type_exports.IsString(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1710
|
-
}
|
|
1711
|
-
function FromString(left, right) {
|
|
1712
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsString(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1713
|
-
}
|
|
1714
|
-
function FromSymbol(left, right) {
|
|
1715
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsSymbol(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1716
|
-
}
|
|
1717
|
-
function FromTemplateLiteral2(left, right) {
|
|
1718
|
-
return type_exports.IsTemplateLiteral(left) ? Visit3(TemplateLiteralToUnion(left), right) : type_exports.IsTemplateLiteral(right) ? Visit3(left, TemplateLiteralToUnion(right)) : Throw("Invalid fallthrough for TemplateLiteral");
|
|
1719
|
-
}
|
|
1720
|
-
function IsArrayOfTuple(left, right) {
|
|
1721
|
-
return type_exports.IsArray(right) && left.items !== void 0 && left.items.every((schema) => Visit3(schema, right.items) === ExtendsResult.True);
|
|
1722
|
-
}
|
|
1723
|
-
function FromTupleRight(left, right) {
|
|
1724
|
-
return type_exports.IsNever(left) ? ExtendsResult.True : type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : ExtendsResult.False;
|
|
1725
|
-
}
|
|
1726
|
-
function FromTuple3(left, right) {
|
|
1727
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : type_exports.IsArray(right) && IsArrayOfTuple(left, right) ? ExtendsResult.True : !type_exports.IsTuple(right) ? ExtendsResult.False : value_exports.IsUndefined(left.items) && !value_exports.IsUndefined(right.items) || !value_exports.IsUndefined(left.items) && value_exports.IsUndefined(right.items) ? ExtendsResult.False : value_exports.IsUndefined(left.items) && !value_exports.IsUndefined(right.items) ? ExtendsResult.True : left.items.every((schema, index) => Visit3(schema, right.items[index]) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1728
|
-
}
|
|
1729
|
-
function FromUint8Array(left, right) {
|
|
1730
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsUint8Array(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1731
|
-
}
|
|
1732
|
-
function FromUndefined(left, right) {
|
|
1733
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsVoid(right) ? FromVoidRight(left, right) : type_exports.IsUndefined(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1734
|
-
}
|
|
1735
|
-
function FromUnionRight(left, right) {
|
|
1736
|
-
return right.anyOf.some((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1737
|
-
}
|
|
1738
|
-
function FromUnion6(left, right) {
|
|
1739
|
-
return left.anyOf.every((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1740
|
-
}
|
|
1741
|
-
function FromUnknownRight(left, right) {
|
|
1742
|
-
return ExtendsResult.True;
|
|
1743
|
-
}
|
|
1744
|
-
function FromUnknown(left, right) {
|
|
1745
|
-
return type_exports.IsNever(right) ? FromNeverRight(left, right) : type_exports.IsIntersect(right) ? FromIntersectRight(left, right) : type_exports.IsUnion(right) ? FromUnionRight(left, right) : type_exports.IsAny(right) ? FromAnyRight(left, right) : type_exports.IsString(right) ? FromStringRight(left, right) : type_exports.IsNumber(right) ? FromNumberRight(left, right) : type_exports.IsInteger(right) ? FromIntegerRight(left, right) : type_exports.IsBoolean(right) ? FromBooleanRight(left, right) : type_exports.IsArray(right) ? FromArrayRight(left, right) : type_exports.IsTuple(right) ? FromTupleRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsUnknown(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1746
|
-
}
|
|
1747
|
-
function FromVoidRight(left, right) {
|
|
1748
|
-
return type_exports.IsUndefined(left) ? ExtendsResult.True : type_exports.IsUndefined(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1749
|
-
}
|
|
1750
|
-
function FromVoid(left, right) {
|
|
1751
|
-
return type_exports.IsIntersect(right) ? FromIntersectRight(left, right) : type_exports.IsUnion(right) ? FromUnionRight(left, right) : type_exports.IsUnknown(right) ? FromUnknownRight(left, right) : type_exports.IsAny(right) ? FromAnyRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsVoid(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1752
|
-
}
|
|
1753
|
-
function Visit3(left, right) {
|
|
1754
|
-
return (
|
|
1755
|
-
// resolvable
|
|
1756
|
-
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) : (
|
|
1757
|
-
// standard
|
|
1758
|
-
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) ? FromIntersect4(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) ? FromPromise2(left, right) : type_exports.IsUint8Array(left) ? FromUint8Array(left, right) : type_exports.IsUndefined(left) ? FromUndefined(left, right) : type_exports.IsUnion(left) ? FromUnion6(left, right) : type_exports.IsUnknown(left) ? FromUnknown(left, right) : type_exports.IsVoid(left) ? FromVoid(left, right) : Throw(`Unknown left type operand '${left[Kind]}'`)
|
|
1759
|
-
)
|
|
1760
|
-
);
|
|
1761
|
-
}
|
|
1762
|
-
function ExtendsCheck(left, right) {
|
|
1763
|
-
return Visit3(left, right);
|
|
1764
|
-
}
|
|
1765
|
-
|
|
1766
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.mjs
|
|
1767
|
-
function FromProperties8(P, Right, True, False, options) {
|
|
1768
|
-
const Acc = {};
|
|
1769
|
-
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
1770
|
-
Acc[K2] = Extends(P[K2], Right, True, False, Clone(options));
|
|
1771
|
-
return Acc;
|
|
1772
|
-
}
|
|
1773
|
-
function FromMappedResult6(Left, Right, True, False, options) {
|
|
1774
|
-
return FromProperties8(Left.properties, Right, True, False, options);
|
|
1775
|
-
}
|
|
1776
|
-
function ExtendsFromMappedResult(Left, Right, True, False, options) {
|
|
1777
|
-
const P = FromMappedResult6(Left, Right, True, False, options);
|
|
1778
|
-
return MappedResult(P);
|
|
1779
|
-
}
|
|
1780
|
-
|
|
1781
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends.mjs
|
|
1782
|
-
function ExtendsResolve(left, right, trueType, falseType) {
|
|
1783
|
-
const R = ExtendsCheck(left, right);
|
|
1784
|
-
return R === ExtendsResult.Union ? Union([trueType, falseType]) : R === ExtendsResult.True ? trueType : falseType;
|
|
1785
|
-
}
|
|
1786
|
-
function Extends(L, R, T, F, options) {
|
|
1787
|
-
return IsMappedResult(L) ? ExtendsFromMappedResult(L, R, T, F, options) : IsMappedKey(L) ? CreateType(ExtendsFromMappedKey(L, R, T, F, options)) : CreateType(ExtendsResolve(L, R, T, F), options);
|
|
1788
|
-
}
|
|
1789
|
-
|
|
1790
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.mjs
|
|
1791
|
-
function FromPropertyKey(K, U, L, R, options) {
|
|
1792
|
-
return {
|
|
1793
|
-
[K]: Extends(Literal(K), U, L, R, Clone(options))
|
|
1794
|
-
};
|
|
1795
|
-
}
|
|
1796
|
-
function FromPropertyKeys(K, U, L, R, options) {
|
|
1797
|
-
return K.reduce((Acc, LK) => {
|
|
1798
|
-
return { ...Acc, ...FromPropertyKey(LK, U, L, R, options) };
|
|
1799
|
-
}, {});
|
|
1800
|
-
}
|
|
1801
|
-
function FromMappedKey2(K, U, L, R, options) {
|
|
1802
|
-
return FromPropertyKeys(K.keys, U, L, R, options);
|
|
1803
|
-
}
|
|
1804
|
-
function ExtendsFromMappedKey(T, U, L, R, options) {
|
|
1805
|
-
const P = FromMappedKey2(T, U, L, R, options);
|
|
1806
|
-
return MappedResult(P);
|
|
1807
|
-
}
|
|
1808
|
-
|
|
1809
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.mjs
|
|
1810
|
-
function ExcludeFromTemplateLiteral(L, R) {
|
|
1811
|
-
return Exclude(TemplateLiteralToUnion(L), R);
|
|
1812
|
-
}
|
|
1813
|
-
|
|
1814
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.mjs
|
|
1815
|
-
function ExcludeRest(L, R) {
|
|
1816
|
-
const excluded = L.filter((inner) => ExtendsCheck(inner, R) === ExtendsResult.False);
|
|
1817
|
-
return excluded.length === 1 ? excluded[0] : Union(excluded);
|
|
1818
|
-
}
|
|
1819
|
-
function Exclude(L, R, options = {}) {
|
|
1820
|
-
if (IsTemplateLiteral(L))
|
|
1821
|
-
return CreateType(ExcludeFromTemplateLiteral(L, R), options);
|
|
1822
|
-
if (IsMappedResult(L))
|
|
1823
|
-
return CreateType(ExcludeFromMappedResult(L, R), options);
|
|
1824
|
-
return CreateType(IsUnion(L) ? ExcludeRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? Never() : L, options);
|
|
1825
|
-
}
|
|
1826
|
-
|
|
1827
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs
|
|
1828
|
-
function FromProperties9(P, U) {
|
|
1829
|
-
const Acc = {};
|
|
1830
|
-
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
1831
|
-
Acc[K2] = Exclude(P[K2], U);
|
|
1832
|
-
return Acc;
|
|
1833
|
-
}
|
|
1834
|
-
function FromMappedResult7(R, T) {
|
|
1835
|
-
return FromProperties9(R.properties, T);
|
|
1836
|
-
}
|
|
1837
|
-
function ExcludeFromMappedResult(R, T) {
|
|
1838
|
-
const P = FromMappedResult7(R, T);
|
|
1839
|
-
return MappedResult(P);
|
|
1840
|
-
}
|
|
1841
|
-
|
|
1842
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.mjs
|
|
1843
|
-
function ExtractFromTemplateLiteral(L, R) {
|
|
1844
|
-
return Extract(TemplateLiteralToUnion(L), R);
|
|
1845
|
-
}
|
|
1846
|
-
|
|
1847
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/extract.mjs
|
|
1848
|
-
function ExtractRest(L, R) {
|
|
1849
|
-
const extracted = L.filter((inner) => ExtendsCheck(inner, R) !== ExtendsResult.False);
|
|
1850
|
-
return extracted.length === 1 ? extracted[0] : Union(extracted);
|
|
1851
|
-
}
|
|
1852
|
-
function Extract(L, R, options) {
|
|
1853
|
-
if (IsTemplateLiteral(L))
|
|
1854
|
-
return CreateType(ExtractFromTemplateLiteral(L, R), options);
|
|
1855
|
-
if (IsMappedResult(L))
|
|
1856
|
-
return CreateType(ExtractFromMappedResult(L, R), options);
|
|
1857
|
-
return CreateType(IsUnion(L) ? ExtractRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? L : Never(), options);
|
|
1858
|
-
}
|
|
1859
|
-
|
|
1860
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs
|
|
1861
|
-
function FromProperties10(P, T) {
|
|
1862
|
-
const Acc = {};
|
|
1863
|
-
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
1864
|
-
Acc[K2] = Extract(P[K2], T);
|
|
1865
|
-
return Acc;
|
|
1866
|
-
}
|
|
1867
|
-
function FromMappedResult8(R, T) {
|
|
1868
|
-
return FromProperties10(R.properties, T);
|
|
1869
|
-
}
|
|
1870
|
-
function ExtractFromMappedResult(R, T) {
|
|
1871
|
-
const P = FromMappedResult8(R, T);
|
|
1872
|
-
return MappedResult(P);
|
|
1873
|
-
}
|
|
1874
|
-
|
|
1875
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs
|
|
1876
|
-
function InstanceType(schema, options) {
|
|
1877
|
-
return IsConstructor(schema) ? CreateType(schema.returns, options) : Never(options);
|
|
1878
|
-
}
|
|
1879
|
-
|
|
1880
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs
|
|
1881
|
-
function ReadonlyOptional(schema) {
|
|
1882
|
-
return Readonly(Optional(schema));
|
|
1883
|
-
}
|
|
1884
|
-
|
|
1885
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/record/record.mjs
|
|
1886
|
-
function RecordCreateFromPattern(pattern, T, options) {
|
|
1887
|
-
return CreateType({ [Kind]: "Record", type: "object", patternProperties: { [pattern]: T } }, options);
|
|
1888
|
-
}
|
|
1889
|
-
function RecordCreateFromKeys(K, T, options) {
|
|
1890
|
-
const result = {};
|
|
1891
|
-
for (const K2 of K)
|
|
1892
|
-
result[K2] = T;
|
|
1893
|
-
return Object2(result, { ...options, [Hint]: "Record" });
|
|
1894
|
-
}
|
|
1895
|
-
function FromTemplateLiteralKey(K, T, options) {
|
|
1896
|
-
return IsTemplateLiteralFinite(K) ? RecordCreateFromKeys(IndexPropertyKeys(K), T, options) : RecordCreateFromPattern(K.pattern, T, options);
|
|
1897
|
-
}
|
|
1898
|
-
function FromUnionKey(key, type, options) {
|
|
1899
|
-
return RecordCreateFromKeys(IndexPropertyKeys(Union(key)), type, options);
|
|
1900
|
-
}
|
|
1901
|
-
function FromLiteralKey(key, type, options) {
|
|
1902
|
-
return RecordCreateFromKeys([key.toString()], type, options);
|
|
1903
|
-
}
|
|
1904
|
-
function FromRegExpKey(key, type, options) {
|
|
1905
|
-
return RecordCreateFromPattern(key.source, type, options);
|
|
1906
|
-
}
|
|
1907
|
-
function FromStringKey(key, type, options) {
|
|
1908
|
-
const pattern = IsUndefined(key.pattern) ? PatternStringExact : key.pattern;
|
|
1909
|
-
return RecordCreateFromPattern(pattern, type, options);
|
|
1910
|
-
}
|
|
1911
|
-
function FromAnyKey(_, type, options) {
|
|
1912
|
-
return RecordCreateFromPattern(PatternStringExact, type, options);
|
|
1913
|
-
}
|
|
1914
|
-
function FromNeverKey(_key, type, options) {
|
|
1915
|
-
return RecordCreateFromPattern(PatternNeverExact, type, options);
|
|
1916
|
-
}
|
|
1917
|
-
function FromBooleanKey(_key, type, options) {
|
|
1918
|
-
return Object2({ true: type, false: type }, options);
|
|
1919
|
-
}
|
|
1920
|
-
function FromIntegerKey(_key, type, options) {
|
|
1921
|
-
return RecordCreateFromPattern(PatternNumberExact, type, options);
|
|
1922
|
-
}
|
|
1923
|
-
function FromNumberKey(_, type, options) {
|
|
1924
|
-
return RecordCreateFromPattern(PatternNumberExact, type, options);
|
|
1925
|
-
}
|
|
1926
|
-
function Record(key, type, options = {}) {
|
|
1927
|
-
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);
|
|
1928
|
-
}
|
|
1929
|
-
function RecordPattern(record) {
|
|
1930
|
-
return globalThis.Object.getOwnPropertyNames(record.patternProperties)[0];
|
|
1931
|
-
}
|
|
1932
|
-
function RecordKey2(type) {
|
|
1933
|
-
const pattern = RecordPattern(type);
|
|
1934
|
-
return pattern === PatternStringExact ? String() : pattern === PatternNumberExact ? Number2() : String({ pattern });
|
|
1935
|
-
}
|
|
1936
|
-
function RecordValue2(type) {
|
|
1937
|
-
return type.patternProperties[RecordPattern(type)];
|
|
1938
|
-
}
|
|
1939
|
-
|
|
1940
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.mjs
|
|
1941
|
-
function FromConstructor2(args, type) {
|
|
1942
|
-
type.parameters = FromTypes(args, type.parameters);
|
|
1943
|
-
type.returns = FromType(args, type.returns);
|
|
1944
|
-
return type;
|
|
1945
|
-
}
|
|
1946
|
-
function FromFunction2(args, type) {
|
|
1947
|
-
type.parameters = FromTypes(args, type.parameters);
|
|
1948
|
-
type.returns = FromType(args, type.returns);
|
|
1949
|
-
return type;
|
|
1950
|
-
}
|
|
1951
|
-
function FromIntersect5(args, type) {
|
|
1952
|
-
type.allOf = FromTypes(args, type.allOf);
|
|
1953
|
-
return type;
|
|
1954
|
-
}
|
|
1955
|
-
function FromUnion7(args, type) {
|
|
1956
|
-
type.anyOf = FromTypes(args, type.anyOf);
|
|
1957
|
-
return type;
|
|
1958
|
-
}
|
|
1959
|
-
function FromTuple4(args, type) {
|
|
1960
|
-
if (IsUndefined(type.items))
|
|
1961
|
-
return type;
|
|
1962
|
-
type.items = FromTypes(args, type.items);
|
|
1963
|
-
return type;
|
|
1964
|
-
}
|
|
1965
|
-
function FromArray5(args, type) {
|
|
1966
|
-
type.items = FromType(args, type.items);
|
|
1967
|
-
return type;
|
|
1968
|
-
}
|
|
1969
|
-
function FromAsyncIterator2(args, type) {
|
|
1970
|
-
type.items = FromType(args, type.items);
|
|
1971
|
-
return type;
|
|
1972
|
-
}
|
|
1973
|
-
function FromIterator2(args, type) {
|
|
1974
|
-
type.items = FromType(args, type.items);
|
|
1975
|
-
return type;
|
|
1976
|
-
}
|
|
1977
|
-
function FromPromise3(args, type) {
|
|
1978
|
-
type.item = FromType(args, type.item);
|
|
1979
|
-
return type;
|
|
1980
|
-
}
|
|
1981
|
-
function FromObject2(args, type) {
|
|
1982
|
-
const mappedProperties = FromProperties11(args, type.properties);
|
|
1983
|
-
return { ...type, ...Object2(mappedProperties) };
|
|
1984
|
-
}
|
|
1985
|
-
function FromRecord2(args, type) {
|
|
1986
|
-
const mappedKey = FromType(args, RecordKey2(type));
|
|
1987
|
-
const mappedValue = FromType(args, RecordValue2(type));
|
|
1988
|
-
const result = Record(mappedKey, mappedValue);
|
|
1989
|
-
return { ...type, ...result };
|
|
1990
|
-
}
|
|
1991
|
-
function FromArgument(args, argument) {
|
|
1992
|
-
return argument.index in args ? args[argument.index] : Unknown();
|
|
1993
|
-
}
|
|
1994
|
-
function FromProperty2(args, type) {
|
|
1995
|
-
const isReadonly = IsReadonly(type);
|
|
1996
|
-
const isOptional = IsOptional(type);
|
|
1997
|
-
const mapped = FromType(args, type);
|
|
1998
|
-
return isReadonly && isOptional ? ReadonlyOptional(mapped) : isReadonly && !isOptional ? Readonly(mapped) : !isReadonly && isOptional ? Optional(mapped) : mapped;
|
|
1999
|
-
}
|
|
2000
|
-
function FromProperties11(args, properties) {
|
|
2001
|
-
return globalThis.Object.getOwnPropertyNames(properties).reduce((result, key) => {
|
|
2002
|
-
return { ...result, [key]: FromProperty2(args, properties[key]) };
|
|
2003
|
-
}, {});
|
|
2004
|
-
}
|
|
2005
|
-
function FromTypes(args, types) {
|
|
2006
|
-
return types.map((type) => FromType(args, type));
|
|
2007
|
-
}
|
|
2008
|
-
function FromType(args, type) {
|
|
2009
|
-
return IsConstructor(type) ? FromConstructor2(args, type) : IsFunction2(type) ? FromFunction2(args, type) : IsIntersect(type) ? FromIntersect5(args, type) : IsUnion(type) ? FromUnion7(args, type) : IsTuple(type) ? FromTuple4(args, type) : IsArray3(type) ? FromArray5(args, type) : IsAsyncIterator2(type) ? FromAsyncIterator2(args, type) : IsIterator2(type) ? FromIterator2(args, type) : IsPromise(type) ? FromPromise3(args, type) : IsObject3(type) ? FromObject2(args, type) : IsRecord(type) ? FromRecord2(args, type) : IsArgument(type) ? FromArgument(args, type) : type;
|
|
2010
|
-
}
|
|
2011
|
-
function Instantiate(type, args) {
|
|
2012
|
-
return FromType(args, CloneType(type));
|
|
2013
|
-
}
|
|
2014
|
-
|
|
2015
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs
|
|
2016
|
-
function Integer(options) {
|
|
2017
|
-
return CreateType({ [Kind]: "Integer", type: "integer" }, options);
|
|
2018
|
-
}
|
|
2019
|
-
|
|
2020
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.mjs
|
|
2021
|
-
function MappedIntrinsicPropertyKey(K, M, options) {
|
|
2022
|
-
return {
|
|
2023
|
-
[K]: Intrinsic(Literal(K), M, Clone(options))
|
|
2024
|
-
};
|
|
2025
|
-
}
|
|
2026
|
-
function MappedIntrinsicPropertyKeys(K, M, options) {
|
|
2027
|
-
const result = K.reduce((Acc, L) => {
|
|
2028
|
-
return { ...Acc, ...MappedIntrinsicPropertyKey(L, M, options) };
|
|
2029
|
-
}, {});
|
|
2030
|
-
return result;
|
|
2031
|
-
}
|
|
2032
|
-
function MappedIntrinsicProperties(T, M, options) {
|
|
2033
|
-
return MappedIntrinsicPropertyKeys(T["keys"], M, options);
|
|
2034
|
-
}
|
|
2035
|
-
function IntrinsicFromMappedKey(T, M, options) {
|
|
2036
|
-
const P = MappedIntrinsicProperties(T, M, options);
|
|
2037
|
-
return MappedResult(P);
|
|
2038
|
-
}
|
|
2039
|
-
|
|
2040
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.mjs
|
|
2041
|
-
function ApplyUncapitalize(value) {
|
|
2042
|
-
const [first, rest] = [value.slice(0, 1), value.slice(1)];
|
|
2043
|
-
return [first.toLowerCase(), rest].join("");
|
|
2044
|
-
}
|
|
2045
|
-
function ApplyCapitalize(value) {
|
|
2046
|
-
const [first, rest] = [value.slice(0, 1), value.slice(1)];
|
|
2047
|
-
return [first.toUpperCase(), rest].join("");
|
|
2048
|
-
}
|
|
2049
|
-
function ApplyUppercase(value) {
|
|
2050
|
-
return value.toUpperCase();
|
|
2051
|
-
}
|
|
2052
|
-
function ApplyLowercase(value) {
|
|
2053
|
-
return value.toLowerCase();
|
|
2054
|
-
}
|
|
2055
|
-
function FromTemplateLiteral3(schema, mode, options) {
|
|
2056
|
-
const expression = TemplateLiteralParseExact(schema.pattern);
|
|
2057
|
-
const finite = IsTemplateLiteralExpressionFinite(expression);
|
|
2058
|
-
if (!finite)
|
|
2059
|
-
return { ...schema, pattern: FromLiteralValue(schema.pattern, mode) };
|
|
2060
|
-
const strings = [...TemplateLiteralExpressionGenerate(expression)];
|
|
2061
|
-
const literals = strings.map((value) => Literal(value));
|
|
2062
|
-
const mapped = FromRest5(literals, mode);
|
|
2063
|
-
const union = Union(mapped);
|
|
2064
|
-
return TemplateLiteral([union], options);
|
|
2065
|
-
}
|
|
2066
|
-
function FromLiteralValue(value, mode) {
|
|
2067
|
-
return typeof value === "string" ? mode === "Uncapitalize" ? ApplyUncapitalize(value) : mode === "Capitalize" ? ApplyCapitalize(value) : mode === "Uppercase" ? ApplyUppercase(value) : mode === "Lowercase" ? ApplyLowercase(value) : value : value.toString();
|
|
2068
|
-
}
|
|
2069
|
-
function FromRest5(T, M) {
|
|
2070
|
-
return T.map((L) => Intrinsic(L, M));
|
|
2071
|
-
}
|
|
2072
|
-
function Intrinsic(schema, mode, options = {}) {
|
|
2073
|
-
return (
|
|
2074
|
-
// Intrinsic-Mapped-Inference
|
|
2075
|
-
IsMappedKey(schema) ? IntrinsicFromMappedKey(schema, mode, options) : (
|
|
2076
|
-
// Standard-Inference
|
|
2077
|
-
IsTemplateLiteral(schema) ? FromTemplateLiteral3(schema, mode, options) : IsUnion(schema) ? Union(FromRest5(schema.anyOf, mode), options) : IsLiteral(schema) ? Literal(FromLiteralValue(schema.const, mode), options) : (
|
|
2078
|
-
// Default Type
|
|
2079
|
-
CreateType(schema, options)
|
|
2080
|
-
)
|
|
2081
|
-
)
|
|
2082
|
-
);
|
|
2083
|
-
}
|
|
2084
|
-
|
|
2085
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.mjs
|
|
2086
|
-
function Capitalize(T, options = {}) {
|
|
2087
|
-
return Intrinsic(T, "Capitalize", options);
|
|
2088
|
-
}
|
|
2089
|
-
|
|
2090
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.mjs
|
|
2091
|
-
function Lowercase(T, options = {}) {
|
|
2092
|
-
return Intrinsic(T, "Lowercase", options);
|
|
2093
|
-
}
|
|
2094
|
-
|
|
2095
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.mjs
|
|
2096
|
-
function Uncapitalize(T, options = {}) {
|
|
2097
|
-
return Intrinsic(T, "Uncapitalize", options);
|
|
2098
|
-
}
|
|
2099
|
-
|
|
2100
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.mjs
|
|
2101
|
-
function Uppercase(T, options = {}) {
|
|
2102
|
-
return Intrinsic(T, "Uppercase", options);
|
|
2103
|
-
}
|
|
2104
|
-
|
|
2105
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs
|
|
2106
|
-
function FromProperties12(properties, propertyKeys, options) {
|
|
2107
|
-
const result = {};
|
|
2108
|
-
for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
|
|
2109
|
-
result[K2] = Omit(properties[K2], propertyKeys, Clone(options));
|
|
2110
|
-
return result;
|
|
2111
|
-
}
|
|
2112
|
-
function FromMappedResult9(mappedResult, propertyKeys, options) {
|
|
2113
|
-
return FromProperties12(mappedResult.properties, propertyKeys, options);
|
|
2114
|
-
}
|
|
2115
|
-
function OmitFromMappedResult(mappedResult, propertyKeys, options) {
|
|
2116
|
-
const properties = FromMappedResult9(mappedResult, propertyKeys, options);
|
|
2117
|
-
return MappedResult(properties);
|
|
2118
|
-
}
|
|
2119
|
-
|
|
2120
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs
|
|
2121
|
-
function FromIntersect6(types, propertyKeys) {
|
|
2122
|
-
return types.map((type) => OmitResolve(type, propertyKeys));
|
|
2123
|
-
}
|
|
2124
|
-
function FromUnion8(types, propertyKeys) {
|
|
2125
|
-
return types.map((type) => OmitResolve(type, propertyKeys));
|
|
2126
|
-
}
|
|
2127
|
-
function FromProperty3(properties, key) {
|
|
2128
|
-
const { [key]: _, ...R } = properties;
|
|
2129
|
-
return R;
|
|
2130
|
-
}
|
|
2131
|
-
function FromProperties13(properties, propertyKeys) {
|
|
2132
|
-
return propertyKeys.reduce((T, K2) => FromProperty3(T, K2), properties);
|
|
2133
|
-
}
|
|
2134
|
-
function FromObject3(properties, propertyKeys) {
|
|
2135
|
-
const options = Discard(properties, [TransformKind, "$id", "required", "properties"]);
|
|
2136
|
-
const omittedProperties = FromProperties13(properties["properties"], propertyKeys);
|
|
2137
|
-
return Object2(omittedProperties, options);
|
|
2138
|
-
}
|
|
2139
|
-
function UnionFromPropertyKeys(propertyKeys) {
|
|
2140
|
-
const result = propertyKeys.reduce((result2, key) => IsLiteralValue(key) ? [...result2, Literal(key)] : result2, []);
|
|
2141
|
-
return Union(result);
|
|
2142
|
-
}
|
|
2143
|
-
function OmitResolve(properties, propertyKeys) {
|
|
2144
|
-
return IsIntersect(properties) ? Intersect(FromIntersect6(properties.allOf, propertyKeys)) : IsUnion(properties) ? Union(FromUnion8(properties.anyOf, propertyKeys)) : IsObject3(properties) ? FromObject3(properties, propertyKeys) : Object2({});
|
|
2145
|
-
}
|
|
2146
|
-
function Omit(type, key, options) {
|
|
2147
|
-
const typeKey = IsArray(key) ? UnionFromPropertyKeys(key) : key;
|
|
2148
|
-
const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
|
|
2149
|
-
const isTypeRef = IsRef(type);
|
|
2150
|
-
const isKeyRef = IsRef(key);
|
|
2151
|
-
return IsMappedResult(type) ? OmitFromMappedResult(type, propertyKeys, options) : IsMappedKey(key) ? OmitFromMappedKey(type, key, options) : isTypeRef && isKeyRef ? Computed("Omit", [type, typeKey], options) : !isTypeRef && isKeyRef ? Computed("Omit", [type, typeKey], options) : isTypeRef && !isKeyRef ? Computed("Omit", [type, typeKey], options) : CreateType({ ...OmitResolve(type, propertyKeys), ...options });
|
|
2152
|
-
}
|
|
2153
|
-
|
|
2154
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.mjs
|
|
2155
|
-
function FromPropertyKey2(type, key, options) {
|
|
2156
|
-
return { [key]: Omit(type, [key], Clone(options)) };
|
|
2157
|
-
}
|
|
2158
|
-
function FromPropertyKeys2(type, propertyKeys, options) {
|
|
2159
|
-
return propertyKeys.reduce((Acc, LK) => {
|
|
2160
|
-
return { ...Acc, ...FromPropertyKey2(type, LK, options) };
|
|
2161
|
-
}, {});
|
|
2162
|
-
}
|
|
2163
|
-
function FromMappedKey3(type, mappedKey, options) {
|
|
2164
|
-
return FromPropertyKeys2(type, mappedKey.keys, options);
|
|
2165
|
-
}
|
|
2166
|
-
function OmitFromMappedKey(type, mappedKey, options) {
|
|
2167
|
-
const properties = FromMappedKey3(type, mappedKey, options);
|
|
2168
|
-
return MappedResult(properties);
|
|
2169
|
-
}
|
|
2170
|
-
|
|
2171
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs
|
|
2172
|
-
function FromProperties14(properties, propertyKeys, options) {
|
|
2173
|
-
const result = {};
|
|
2174
|
-
for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
|
|
2175
|
-
result[K2] = Pick(properties[K2], propertyKeys, Clone(options));
|
|
2176
|
-
return result;
|
|
2177
|
-
}
|
|
2178
|
-
function FromMappedResult10(mappedResult, propertyKeys, options) {
|
|
2179
|
-
return FromProperties14(mappedResult.properties, propertyKeys, options);
|
|
2180
|
-
}
|
|
2181
|
-
function PickFromMappedResult(mappedResult, propertyKeys, options) {
|
|
2182
|
-
const properties = FromMappedResult10(mappedResult, propertyKeys, options);
|
|
2183
|
-
return MappedResult(properties);
|
|
2184
|
-
}
|
|
2185
|
-
|
|
2186
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs
|
|
2187
|
-
function FromIntersect7(types, propertyKeys) {
|
|
2188
|
-
return types.map((type) => PickResolve(type, propertyKeys));
|
|
2189
|
-
}
|
|
2190
|
-
function FromUnion9(types, propertyKeys) {
|
|
2191
|
-
return types.map((type) => PickResolve(type, propertyKeys));
|
|
2192
|
-
}
|
|
2193
|
-
function FromProperties15(properties, propertyKeys) {
|
|
2194
|
-
const result = {};
|
|
2195
|
-
for (const K2 of propertyKeys)
|
|
2196
|
-
if (K2 in properties)
|
|
2197
|
-
result[K2] = properties[K2];
|
|
2198
|
-
return result;
|
|
2199
|
-
}
|
|
2200
|
-
function FromObject4(T, K) {
|
|
2201
|
-
const options = Discard(T, [TransformKind, "$id", "required", "properties"]);
|
|
2202
|
-
const properties = FromProperties15(T["properties"], K);
|
|
2203
|
-
return Object2(properties, options);
|
|
2204
|
-
}
|
|
2205
|
-
function UnionFromPropertyKeys2(propertyKeys) {
|
|
2206
|
-
const result = propertyKeys.reduce((result2, key) => IsLiteralValue(key) ? [...result2, Literal(key)] : result2, []);
|
|
2207
|
-
return Union(result);
|
|
2208
|
-
}
|
|
2209
|
-
function PickResolve(properties, propertyKeys) {
|
|
2210
|
-
return IsIntersect(properties) ? Intersect(FromIntersect7(properties.allOf, propertyKeys)) : IsUnion(properties) ? Union(FromUnion9(properties.anyOf, propertyKeys)) : IsObject3(properties) ? FromObject4(properties, propertyKeys) : Object2({});
|
|
2211
|
-
}
|
|
2212
|
-
function Pick(type, key, options) {
|
|
2213
|
-
const typeKey = IsArray(key) ? UnionFromPropertyKeys2(key) : key;
|
|
2214
|
-
const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
|
|
2215
|
-
const isTypeRef = IsRef(type);
|
|
2216
|
-
const isKeyRef = IsRef(key);
|
|
2217
|
-
return IsMappedResult(type) ? PickFromMappedResult(type, propertyKeys, options) : IsMappedKey(key) ? PickFromMappedKey(type, key, options) : isTypeRef && isKeyRef ? Computed("Pick", [type, typeKey], options) : !isTypeRef && isKeyRef ? Computed("Pick", [type, typeKey], options) : isTypeRef && !isKeyRef ? Computed("Pick", [type, typeKey], options) : CreateType({ ...PickResolve(type, propertyKeys), ...options });
|
|
2218
|
-
}
|
|
2219
|
-
|
|
2220
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.mjs
|
|
2221
|
-
function FromPropertyKey3(type, key, options) {
|
|
2222
|
-
return {
|
|
2223
|
-
[key]: Pick(type, [key], Clone(options))
|
|
2224
|
-
};
|
|
2225
|
-
}
|
|
2226
|
-
function FromPropertyKeys3(type, propertyKeys, options) {
|
|
2227
|
-
return propertyKeys.reduce((result, leftKey) => {
|
|
2228
|
-
return { ...result, ...FromPropertyKey3(type, leftKey, options) };
|
|
2229
|
-
}, {});
|
|
2230
|
-
}
|
|
2231
|
-
function FromMappedKey4(type, mappedKey, options) {
|
|
2232
|
-
return FromPropertyKeys3(type, mappedKey.keys, options);
|
|
2233
|
-
}
|
|
2234
|
-
function PickFromMappedKey(type, mappedKey, options) {
|
|
2235
|
-
const properties = FromMappedKey4(type, mappedKey, options);
|
|
2236
|
-
return MappedResult(properties);
|
|
2237
|
-
}
|
|
2238
|
-
|
|
2239
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/partial/partial.mjs
|
|
2240
|
-
function FromComputed3(target, parameters) {
|
|
2241
|
-
return Computed("Partial", [Computed(target, parameters)]);
|
|
2242
|
-
}
|
|
2243
|
-
function FromRef3($ref) {
|
|
2244
|
-
return Computed("Partial", [Ref($ref)]);
|
|
2245
|
-
}
|
|
2246
|
-
function FromProperties16(properties) {
|
|
2247
|
-
const partialProperties = {};
|
|
2248
|
-
for (const K of globalThis.Object.getOwnPropertyNames(properties))
|
|
2249
|
-
partialProperties[K] = Optional(properties[K]);
|
|
2250
|
-
return partialProperties;
|
|
2251
|
-
}
|
|
2252
|
-
function FromObject5(type) {
|
|
2253
|
-
const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
|
|
2254
|
-
const properties = FromProperties16(type["properties"]);
|
|
2255
|
-
return Object2(properties, options);
|
|
2256
|
-
}
|
|
2257
|
-
function FromRest6(types) {
|
|
2258
|
-
return types.map((type) => PartialResolve(type));
|
|
2259
|
-
}
|
|
2260
|
-
function PartialResolve(type) {
|
|
2261
|
-
return (
|
|
2262
|
-
// Mappable
|
|
2263
|
-
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) ? FromObject5(type) : (
|
|
2264
|
-
// Intrinsic
|
|
2265
|
-
IsBigInt2(type) ? type : IsBoolean2(type) ? type : IsInteger(type) ? type : IsLiteral(type) ? type : IsNull2(type) ? type : IsNumber3(type) ? type : IsString2(type) ? type : IsSymbol2(type) ? type : IsUndefined3(type) ? type : (
|
|
2266
|
-
// Passthrough
|
|
2267
|
-
Object2({})
|
|
2268
|
-
)
|
|
2269
|
-
)
|
|
2270
|
-
);
|
|
2271
|
-
}
|
|
2272
|
-
function Partial(type, options) {
|
|
2273
|
-
if (IsMappedResult(type)) {
|
|
2274
|
-
return PartialFromMappedResult(type, options);
|
|
2275
|
-
} else {
|
|
2276
|
-
return CreateType({ ...PartialResolve(type), ...options });
|
|
2277
|
-
}
|
|
2278
|
-
}
|
|
2279
|
-
|
|
2280
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs
|
|
2281
|
-
function FromProperties17(K, options) {
|
|
2282
|
-
const Acc = {};
|
|
2283
|
-
for (const K2 of globalThis.Object.getOwnPropertyNames(K))
|
|
2284
|
-
Acc[K2] = Partial(K[K2], Clone(options));
|
|
2285
|
-
return Acc;
|
|
2286
|
-
}
|
|
2287
|
-
function FromMappedResult11(R, options) {
|
|
2288
|
-
return FromProperties17(R.properties, options);
|
|
2289
|
-
}
|
|
2290
|
-
function PartialFromMappedResult(R, options) {
|
|
2291
|
-
const P = FromMappedResult11(R, options);
|
|
2292
|
-
return MappedResult(P);
|
|
2293
|
-
}
|
|
2294
|
-
|
|
2295
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/required/required.mjs
|
|
2296
|
-
function FromComputed4(target, parameters) {
|
|
2297
|
-
return Computed("Required", [Computed(target, parameters)]);
|
|
2298
|
-
}
|
|
2299
|
-
function FromRef4($ref) {
|
|
2300
|
-
return Computed("Required", [Ref($ref)]);
|
|
2301
|
-
}
|
|
2302
|
-
function FromProperties18(properties) {
|
|
2303
|
-
const requiredProperties = {};
|
|
2304
|
-
for (const K of globalThis.Object.getOwnPropertyNames(properties))
|
|
2305
|
-
requiredProperties[K] = Discard(properties[K], [OptionalKind]);
|
|
2306
|
-
return requiredProperties;
|
|
2307
|
-
}
|
|
2308
|
-
function FromObject6(type) {
|
|
2309
|
-
const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
|
|
2310
|
-
const properties = FromProperties18(type["properties"]);
|
|
2311
|
-
return Object2(properties, options);
|
|
2312
|
-
}
|
|
2313
|
-
function FromRest7(types) {
|
|
2314
|
-
return types.map((type) => RequiredResolve(type));
|
|
2315
|
-
}
|
|
2316
|
-
function RequiredResolve(type) {
|
|
2317
|
-
return (
|
|
2318
|
-
// Mappable
|
|
2319
|
-
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) ? FromObject6(type) : (
|
|
2320
|
-
// Intrinsic
|
|
2321
|
-
IsBigInt2(type) ? type : IsBoolean2(type) ? type : IsInteger(type) ? type : IsLiteral(type) ? type : IsNull2(type) ? type : IsNumber3(type) ? type : IsString2(type) ? type : IsSymbol2(type) ? type : IsUndefined3(type) ? type : (
|
|
2322
|
-
// Passthrough
|
|
2323
|
-
Object2({})
|
|
2324
|
-
)
|
|
2325
|
-
)
|
|
2326
|
-
);
|
|
2327
|
-
}
|
|
2328
|
-
function Required(type, options) {
|
|
2329
|
-
if (IsMappedResult(type)) {
|
|
2330
|
-
return RequiredFromMappedResult(type, options);
|
|
2331
|
-
} else {
|
|
2332
|
-
return CreateType({ ...RequiredResolve(type), ...options });
|
|
2333
|
-
}
|
|
2334
|
-
}
|
|
2335
|
-
|
|
2336
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs
|
|
2337
|
-
function FromProperties19(P, options) {
|
|
2338
|
-
const Acc = {};
|
|
2339
|
-
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
2340
|
-
Acc[K2] = Required(P[K2], options);
|
|
2341
|
-
return Acc;
|
|
2342
|
-
}
|
|
2343
|
-
function FromMappedResult12(R, options) {
|
|
2344
|
-
return FromProperties19(R.properties, options);
|
|
2345
|
-
}
|
|
2346
|
-
function RequiredFromMappedResult(R, options) {
|
|
2347
|
-
const P = FromMappedResult12(R, options);
|
|
2348
|
-
return MappedResult(P);
|
|
2349
|
-
}
|
|
2350
|
-
|
|
2351
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/module/compute.mjs
|
|
2352
|
-
function DereferenceParameters(moduleProperties, types) {
|
|
2353
|
-
return types.map((type) => {
|
|
2354
|
-
return IsRef(type) ? Dereference(moduleProperties, type.$ref) : FromType2(moduleProperties, type);
|
|
2355
|
-
});
|
|
2356
|
-
}
|
|
2357
|
-
function Dereference(moduleProperties, ref) {
|
|
2358
|
-
return ref in moduleProperties ? IsRef(moduleProperties[ref]) ? Dereference(moduleProperties, moduleProperties[ref].$ref) : FromType2(moduleProperties, moduleProperties[ref]) : Never();
|
|
2359
|
-
}
|
|
2360
|
-
function FromAwaited(parameters) {
|
|
2361
|
-
return Awaited(parameters[0]);
|
|
2362
|
-
}
|
|
2363
|
-
function FromIndex(parameters) {
|
|
2364
|
-
return Index(parameters[0], parameters[1]);
|
|
2365
|
-
}
|
|
2366
|
-
function FromKeyOf(parameters) {
|
|
2367
|
-
return KeyOf(parameters[0]);
|
|
2368
|
-
}
|
|
2369
|
-
function FromPartial(parameters) {
|
|
2370
|
-
return Partial(parameters[0]);
|
|
2371
|
-
}
|
|
2372
|
-
function FromOmit(parameters) {
|
|
2373
|
-
return Omit(parameters[0], parameters[1]);
|
|
2374
|
-
}
|
|
2375
|
-
function FromPick(parameters) {
|
|
2376
|
-
return Pick(parameters[0], parameters[1]);
|
|
2377
|
-
}
|
|
2378
|
-
function FromRequired(parameters) {
|
|
2379
|
-
return Required(parameters[0]);
|
|
2380
|
-
}
|
|
2381
|
-
function FromComputed5(moduleProperties, target, parameters) {
|
|
2382
|
-
const dereferenced = DereferenceParameters(moduleProperties, parameters);
|
|
2383
|
-
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();
|
|
2384
|
-
}
|
|
2385
|
-
function FromArray6(moduleProperties, type) {
|
|
2386
|
-
return Array2(FromType2(moduleProperties, type));
|
|
2387
|
-
}
|
|
2388
|
-
function FromAsyncIterator3(moduleProperties, type) {
|
|
2389
|
-
return AsyncIterator(FromType2(moduleProperties, type));
|
|
2390
|
-
}
|
|
2391
|
-
function FromConstructor3(moduleProperties, parameters, instanceType) {
|
|
2392
|
-
return Constructor(FromTypes2(moduleProperties, parameters), FromType2(moduleProperties, instanceType));
|
|
2393
|
-
}
|
|
2394
|
-
function FromFunction3(moduleProperties, parameters, returnType) {
|
|
2395
|
-
return Function(FromTypes2(moduleProperties, parameters), FromType2(moduleProperties, returnType));
|
|
2396
|
-
}
|
|
2397
|
-
function FromIntersect8(moduleProperties, types) {
|
|
2398
|
-
return Intersect(FromTypes2(moduleProperties, types));
|
|
2399
|
-
}
|
|
2400
|
-
function FromIterator3(moduleProperties, type) {
|
|
2401
|
-
return Iterator(FromType2(moduleProperties, type));
|
|
2402
|
-
}
|
|
2403
|
-
function FromObject7(moduleProperties, properties) {
|
|
2404
|
-
return Object2(globalThis.Object.keys(properties).reduce((result, key) => {
|
|
2405
|
-
return { ...result, [key]: FromType2(moduleProperties, properties[key]) };
|
|
2406
|
-
}, {}));
|
|
2407
|
-
}
|
|
2408
|
-
function FromRecord3(moduleProperties, type) {
|
|
2409
|
-
const [value, pattern] = [FromType2(moduleProperties, RecordValue2(type)), RecordPattern(type)];
|
|
2410
|
-
const result = CloneType(type);
|
|
2411
|
-
result.patternProperties[pattern] = value;
|
|
2412
|
-
return result;
|
|
2413
|
-
}
|
|
2414
|
-
function FromTransform(moduleProperties, transform) {
|
|
2415
|
-
return IsRef(transform) ? { ...Dereference(moduleProperties, transform.$ref), [TransformKind]: transform[TransformKind] } : transform;
|
|
2416
|
-
}
|
|
2417
|
-
function FromTuple5(moduleProperties, types) {
|
|
2418
|
-
return Tuple(FromTypes2(moduleProperties, types));
|
|
2419
|
-
}
|
|
2420
|
-
function FromUnion10(moduleProperties, types) {
|
|
2421
|
-
return Union(FromTypes2(moduleProperties, types));
|
|
2422
|
-
}
|
|
2423
|
-
function FromTypes2(moduleProperties, types) {
|
|
2424
|
-
return types.map((type) => FromType2(moduleProperties, type));
|
|
2425
|
-
}
|
|
2426
|
-
function FromType2(moduleProperties, type) {
|
|
2427
|
-
return (
|
|
2428
|
-
// Modifiers
|
|
2429
|
-
IsOptional(type) ? CreateType(FromType2(moduleProperties, Discard(type, [OptionalKind])), type) : IsReadonly(type) ? CreateType(FromType2(moduleProperties, Discard(type, [ReadonlyKind])), type) : (
|
|
2430
|
-
// Transform
|
|
2431
|
-
IsTransform(type) ? CreateType(FromTransform(moduleProperties, type), type) : (
|
|
2432
|
-
// Types
|
|
2433
|
-
IsArray3(type) ? CreateType(FromArray6(moduleProperties, type.items), type) : IsAsyncIterator2(type) ? CreateType(FromAsyncIterator3(moduleProperties, type.items), type) : IsComputed(type) ? CreateType(FromComputed5(moduleProperties, type.target, type.parameters)) : IsConstructor(type) ? CreateType(FromConstructor3(moduleProperties, type.parameters, type.returns), type) : IsFunction2(type) ? CreateType(FromFunction3(moduleProperties, type.parameters, type.returns), type) : IsIntersect(type) ? CreateType(FromIntersect8(moduleProperties, type.allOf), type) : IsIterator2(type) ? CreateType(FromIterator3(moduleProperties, type.items), type) : IsObject3(type) ? CreateType(FromObject7(moduleProperties, type.properties), type) : IsRecord(type) ? CreateType(FromRecord3(moduleProperties, type)) : IsTuple(type) ? CreateType(FromTuple5(moduleProperties, type.items || []), type) : IsUnion(type) ? CreateType(FromUnion10(moduleProperties, type.anyOf), type) : type
|
|
2434
|
-
)
|
|
2435
|
-
)
|
|
2436
|
-
);
|
|
2437
|
-
}
|
|
2438
|
-
function ComputeType(moduleProperties, key) {
|
|
2439
|
-
return key in moduleProperties ? FromType2(moduleProperties, moduleProperties[key]) : Never();
|
|
2440
|
-
}
|
|
2441
|
-
function ComputeModuleProperties(moduleProperties) {
|
|
2442
|
-
return globalThis.Object.getOwnPropertyNames(moduleProperties).reduce((result, key) => {
|
|
2443
|
-
return { ...result, [key]: ComputeType(moduleProperties, key) };
|
|
2444
|
-
}, {});
|
|
2445
|
-
}
|
|
2446
|
-
|
|
2447
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/module/module.mjs
|
|
2448
|
-
var TModule = class {
|
|
2449
|
-
constructor($defs) {
|
|
2450
|
-
const computed = ComputeModuleProperties($defs);
|
|
2451
|
-
const identified = this.WithIdentifiers(computed);
|
|
2452
|
-
this.$defs = identified;
|
|
2453
|
-
}
|
|
2454
|
-
/** `[Json]` Imports a Type by Key. */
|
|
2455
|
-
Import(key, options) {
|
|
2456
|
-
const $defs = { ...this.$defs, [key]: CreateType(this.$defs[key], options) };
|
|
2457
|
-
return CreateType({ [Kind]: "Import", $defs, $ref: key });
|
|
2458
|
-
}
|
|
2459
|
-
// prettier-ignore
|
|
2460
|
-
WithIdentifiers($defs) {
|
|
2461
|
-
return globalThis.Object.getOwnPropertyNames($defs).reduce((result, key) => {
|
|
2462
|
-
return { ...result, [key]: { ...$defs[key], $id: key } };
|
|
2463
|
-
}, {});
|
|
2464
|
-
}
|
|
2465
|
-
};
|
|
2466
|
-
function Module(properties) {
|
|
2467
|
-
return new TModule(properties);
|
|
2468
|
-
}
|
|
2469
|
-
|
|
2470
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/not/not.mjs
|
|
2471
|
-
function Not(type, options) {
|
|
2472
|
-
return CreateType({ [Kind]: "Not", not: type }, options);
|
|
2473
|
-
}
|
|
2474
|
-
|
|
2475
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs
|
|
2476
|
-
function Parameters(schema, options) {
|
|
2477
|
-
return IsFunction2(schema) ? Tuple(schema.parameters, options) : Never();
|
|
2478
|
-
}
|
|
2479
|
-
|
|
2480
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs
|
|
2481
|
-
var Ordinal = 0;
|
|
2482
|
-
function Recursive(callback, options = {}) {
|
|
2483
|
-
if (IsUndefined(options.$id))
|
|
2484
|
-
options.$id = `T${Ordinal++}`;
|
|
2485
|
-
const thisType = CloneType(callback({ [Kind]: "This", $ref: `${options.$id}` }));
|
|
2486
|
-
thisType.$id = options.$id;
|
|
2487
|
-
return CreateType({ [Hint]: "Recursive", ...thisType }, options);
|
|
2488
|
-
}
|
|
2489
|
-
|
|
2490
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs
|
|
2491
|
-
function RegExp2(unresolved, options) {
|
|
2492
|
-
const expr = IsString(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;
|
|
2493
|
-
return CreateType({ [Kind]: "RegExp", type: "RegExp", source: expr.source, flags: expr.flags }, options);
|
|
2494
|
-
}
|
|
2495
|
-
|
|
2496
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/rest/rest.mjs
|
|
2497
|
-
function RestResolve(T) {
|
|
2498
|
-
return IsIntersect(T) ? T.allOf : IsUnion(T) ? T.anyOf : IsTuple(T) ? T.items ?? [] : [];
|
|
2499
|
-
}
|
|
2500
|
-
function Rest(T) {
|
|
2501
|
-
return RestResolve(T);
|
|
2502
|
-
}
|
|
2503
|
-
|
|
2504
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs
|
|
2505
|
-
function ReturnType(schema, options) {
|
|
2506
|
-
return IsFunction2(schema) ? CreateType(schema.returns, options) : Never(options);
|
|
2507
|
-
}
|
|
2508
|
-
|
|
2509
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs
|
|
2510
|
-
var TransformDecodeBuilder = class {
|
|
2511
|
-
constructor(schema) {
|
|
2512
|
-
this.schema = schema;
|
|
2513
|
-
}
|
|
2514
|
-
Decode(decode) {
|
|
2515
|
-
return new TransformEncodeBuilder(this.schema, decode);
|
|
2516
|
-
}
|
|
2517
|
-
};
|
|
2518
|
-
var TransformEncodeBuilder = class {
|
|
2519
|
-
constructor(schema, decode) {
|
|
2520
|
-
this.schema = schema;
|
|
2521
|
-
this.decode = decode;
|
|
2522
|
-
}
|
|
2523
|
-
EncodeTransform(encode, schema) {
|
|
2524
|
-
const Encode = (value) => schema[TransformKind].Encode(encode(value));
|
|
2525
|
-
const Decode = (value) => this.decode(schema[TransformKind].Decode(value));
|
|
2526
|
-
const Codec = { Encode, Decode };
|
|
2527
|
-
return { ...schema, [TransformKind]: Codec };
|
|
2528
|
-
}
|
|
2529
|
-
EncodeSchema(encode, schema) {
|
|
2530
|
-
const Codec = { Decode: this.decode, Encode: encode };
|
|
2531
|
-
return { ...schema, [TransformKind]: Codec };
|
|
2532
|
-
}
|
|
2533
|
-
Encode(encode) {
|
|
2534
|
-
return IsTransform(this.schema) ? this.EncodeTransform(encode, this.schema) : this.EncodeSchema(encode, this.schema);
|
|
2535
|
-
}
|
|
2536
|
-
};
|
|
2537
|
-
function Transform(schema) {
|
|
2538
|
-
return new TransformDecodeBuilder(schema);
|
|
2539
|
-
}
|
|
2540
|
-
|
|
2541
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.mjs
|
|
2542
|
-
function Unsafe(options = {}) {
|
|
2543
|
-
return CreateType({ [Kind]: options[Kind] ?? "Unsafe" }, options);
|
|
2544
|
-
}
|
|
2545
|
-
|
|
2546
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/void/void.mjs
|
|
2547
|
-
function Void(options) {
|
|
2548
|
-
return CreateType({ [Kind]: "Void", type: "void" }, options);
|
|
2549
|
-
}
|
|
2550
|
-
|
|
2551
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/type.mjs
|
|
2552
|
-
var type_exports2 = {};
|
|
2553
|
-
__export(type_exports2, {
|
|
2554
|
-
Any: () => Any,
|
|
2555
|
-
Argument: () => Argument,
|
|
2556
|
-
Array: () => Array2,
|
|
2557
|
-
AsyncIterator: () => AsyncIterator,
|
|
2558
|
-
Awaited: () => Awaited,
|
|
2559
|
-
BigInt: () => BigInt,
|
|
2560
|
-
Boolean: () => Boolean,
|
|
2561
|
-
Capitalize: () => Capitalize,
|
|
2562
|
-
Composite: () => Composite,
|
|
2563
|
-
Const: () => Const,
|
|
2564
|
-
Constructor: () => Constructor,
|
|
2565
|
-
ConstructorParameters: () => ConstructorParameters,
|
|
2566
|
-
Date: () => Date2,
|
|
2567
|
-
Enum: () => Enum,
|
|
2568
|
-
Exclude: () => Exclude,
|
|
2569
|
-
Extends: () => Extends,
|
|
2570
|
-
Extract: () => Extract,
|
|
2571
|
-
Function: () => Function,
|
|
2572
|
-
Index: () => Index,
|
|
2573
|
-
InstanceType: () => InstanceType,
|
|
2574
|
-
Instantiate: () => Instantiate,
|
|
2575
|
-
Integer: () => Integer,
|
|
2576
|
-
Intersect: () => Intersect,
|
|
2577
|
-
Iterator: () => Iterator,
|
|
2578
|
-
KeyOf: () => KeyOf,
|
|
2579
|
-
Literal: () => Literal,
|
|
2580
|
-
Lowercase: () => Lowercase,
|
|
2581
|
-
Mapped: () => Mapped,
|
|
2582
|
-
Module: () => Module,
|
|
2583
|
-
Never: () => Never,
|
|
2584
|
-
Not: () => Not,
|
|
2585
|
-
Null: () => Null,
|
|
2586
|
-
Number: () => Number2,
|
|
2587
|
-
Object: () => Object2,
|
|
2588
|
-
Omit: () => Omit,
|
|
2589
|
-
Optional: () => Optional,
|
|
2590
|
-
Parameters: () => Parameters,
|
|
2591
|
-
Partial: () => Partial,
|
|
2592
|
-
Pick: () => Pick,
|
|
2593
|
-
Promise: () => Promise2,
|
|
2594
|
-
Readonly: () => Readonly,
|
|
2595
|
-
ReadonlyOptional: () => ReadonlyOptional,
|
|
2596
|
-
Record: () => Record,
|
|
2597
|
-
Recursive: () => Recursive,
|
|
2598
|
-
Ref: () => Ref,
|
|
2599
|
-
RegExp: () => RegExp2,
|
|
2600
|
-
Required: () => Required,
|
|
2601
|
-
Rest: () => Rest,
|
|
2602
|
-
ReturnType: () => ReturnType,
|
|
2603
|
-
String: () => String,
|
|
2604
|
-
Symbol: () => Symbol2,
|
|
2605
|
-
TemplateLiteral: () => TemplateLiteral,
|
|
2606
|
-
Transform: () => Transform,
|
|
2607
|
-
Tuple: () => Tuple,
|
|
2608
|
-
Uint8Array: () => Uint8Array2,
|
|
2609
|
-
Uncapitalize: () => Uncapitalize,
|
|
2610
|
-
Undefined: () => Undefined,
|
|
2611
|
-
Union: () => Union,
|
|
2612
|
-
Unknown: () => Unknown,
|
|
2613
|
-
Unsafe: () => Unsafe,
|
|
2614
|
-
Uppercase: () => Uppercase,
|
|
2615
|
-
Void: () => Void
|
|
2616
|
-
});
|
|
2617
|
-
|
|
2618
|
-
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/index.mjs
|
|
2619
|
-
var Type = type_exports2;
|
|
2620
|
-
|
|
2621
|
-
// src/lib/types/schemas.ts
|
|
2622
|
-
var SuccessResponseSchema = (dataSchema) => Type.Object(
|
|
2623
|
-
{
|
|
2624
|
-
success: Type.Literal(true),
|
|
2625
|
-
data: dataSchema,
|
|
2626
|
-
message: Type.Optional(Type.String())
|
|
2627
|
-
}
|
|
2628
|
-
);
|
|
2629
|
-
var ErrorResponseSchema = Type.Object(
|
|
2630
|
-
{
|
|
2631
|
-
success: Type.Literal(false),
|
|
2632
|
-
error: Type.Object(
|
|
2633
|
-
{
|
|
2634
|
-
code: Type.String(),
|
|
2635
|
-
message: Type.String(),
|
|
2636
|
-
details: Type.Optional(Type.Any())
|
|
2637
|
-
}
|
|
2638
|
-
)
|
|
2639
|
-
}
|
|
2640
|
-
);
|
|
2641
|
-
var ApiResponseSchema = (dataSchema) => Type.Union([
|
|
2642
|
-
SuccessResponseSchema(dataSchema),
|
|
2643
|
-
ErrorResponseSchema
|
|
2644
|
-
]);
|
|
2645
|
-
|
|
2646
|
-
// src/lib/contracts/auth.ts
|
|
2647
|
-
var EMAIL_PATTERN = "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$";
|
|
2648
|
-
var PHONE_PATTERN = "^\\+[1-9]\\d{1,14}$";
|
|
2649
|
-
var FINGERPRINT_PATTERN = "^[a-f0-9]{64}$";
|
|
2650
|
-
var UUID_PATTERN = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$";
|
|
2651
|
-
var BASE64_PATTERN = "^[A-Za-z0-9+/]+=*$";
|
|
2652
|
-
var sendVerificationCodeContract = {
|
|
2653
|
-
method: "POST",
|
|
2654
|
-
path: "/_auth/codes",
|
|
2655
|
-
body: Type.Object({
|
|
2656
|
-
target: Type.String({
|
|
2657
|
-
description: "Email address or phone number in E.164 format"
|
|
2658
|
-
}),
|
|
2659
|
-
targetType: Type.Union([
|
|
2660
|
-
Type.Literal("email"),
|
|
2661
|
-
Type.Literal("phone")
|
|
2662
|
-
], {
|
|
2663
|
-
description: "Type of target (email or phone)"
|
|
2664
|
-
}),
|
|
2665
|
-
purpose: Type.Union([
|
|
2666
|
-
Type.Literal("registration"),
|
|
2667
|
-
Type.Literal("login"),
|
|
2668
|
-
Type.Literal("password_reset")
|
|
2669
|
-
], {
|
|
2670
|
-
description: "Purpose of verification"
|
|
2671
|
-
})
|
|
2672
|
-
}),
|
|
2673
|
-
response: ApiResponseSchema(
|
|
2674
|
-
Type.Object({
|
|
2675
|
-
success: Type.Boolean(),
|
|
2676
|
-
expiresAt: Type.String({ description: "ISO 8601 expiry time" })
|
|
2677
|
-
})
|
|
2678
|
-
)
|
|
2679
|
-
};
|
|
2680
|
-
var verifyCodeContract = {
|
|
2681
|
-
method: "POST",
|
|
2682
|
-
path: "/_auth/codes/verify",
|
|
2683
|
-
body: Type.Object({
|
|
2684
|
-
target: Type.String({
|
|
2685
|
-
description: "Email address or phone number"
|
|
2686
|
-
}),
|
|
2687
|
-
targetType: Type.Union([
|
|
2688
|
-
Type.Literal("email"),
|
|
2689
|
-
Type.Literal("phone")
|
|
2690
|
-
]),
|
|
2691
|
-
code: Type.String({
|
|
2692
|
-
minLength: 6,
|
|
2693
|
-
maxLength: 6,
|
|
2694
|
-
pattern: "^[0-9]{6}$",
|
|
2695
|
-
description: "6-digit verification code"
|
|
2696
|
-
}),
|
|
2697
|
-
purpose: Type.Union([
|
|
2698
|
-
Type.Literal("registration"),
|
|
2699
|
-
Type.Literal("login"),
|
|
2700
|
-
Type.Literal("password_reset")
|
|
2701
|
-
])
|
|
2702
|
-
}),
|
|
2703
|
-
response: ApiResponseSchema(
|
|
2704
|
-
Type.Object({
|
|
2705
|
-
valid: Type.Boolean(),
|
|
2706
|
-
verificationToken: Type.Optional(Type.String({
|
|
2707
|
-
description: "Temporary token for completing registration (15min validity)"
|
|
2708
|
-
}))
|
|
2709
|
-
})
|
|
2710
|
-
)
|
|
2711
|
-
};
|
|
2712
|
-
var checkAccountExistsContract = {
|
|
2713
|
-
method: "POST",
|
|
2714
|
-
path: "/_auth/exists",
|
|
2715
|
-
body: Type.Object(
|
|
2716
|
-
{
|
|
2717
|
-
email: Type.Optional(Type.String({
|
|
2718
|
-
pattern: EMAIL_PATTERN,
|
|
2719
|
-
description: "Email address to check"
|
|
2720
|
-
})),
|
|
2721
|
-
phone: Type.Optional(Type.String({
|
|
2722
|
-
pattern: PHONE_PATTERN,
|
|
2723
|
-
description: "Phone number in E.164 format (e.g., +821012345678)"
|
|
2724
|
-
}))
|
|
2725
|
-
},
|
|
2726
|
-
{
|
|
2727
|
-
minProperties: 1,
|
|
2728
|
-
description: "At least one of email or phone must be provided"
|
|
2729
|
-
}
|
|
2730
|
-
),
|
|
2731
|
-
response: ApiResponseSchema(
|
|
2732
|
-
Type.Object(
|
|
2733
|
-
{
|
|
2734
|
-
exists: Type.Boolean({ description: "Whether the account exists" }),
|
|
2735
|
-
identifier: Type.String({ description: "The identifier that was checked" }),
|
|
2736
|
-
identifierType: Type.Union([
|
|
2737
|
-
Type.Literal("email"),
|
|
2738
|
-
Type.Literal("phone")
|
|
2739
|
-
], { description: "Type of identifier checked" })
|
|
2740
|
-
}
|
|
2741
|
-
)
|
|
2742
|
-
)
|
|
2743
|
-
};
|
|
2744
|
-
var registerContract = {
|
|
2745
|
-
method: "POST",
|
|
2746
|
-
path: "/_auth/register",
|
|
2747
|
-
body: Type.Object({
|
|
2748
|
-
email: Type.Optional(Type.String({
|
|
2749
|
-
pattern: EMAIL_PATTERN,
|
|
2750
|
-
description: "Email address"
|
|
2751
|
-
})),
|
|
2752
|
-
phone: Type.Optional(Type.String({
|
|
2753
|
-
pattern: PHONE_PATTERN,
|
|
2754
|
-
description: "Phone number in E.164 format"
|
|
2755
|
-
})),
|
|
2756
|
-
verificationToken: Type.String({
|
|
2757
|
-
description: "Verification token obtained from /verify-code endpoint"
|
|
2758
|
-
}),
|
|
2759
|
-
password: Type.String({
|
|
2760
|
-
minLength: 8,
|
|
2761
|
-
description: "User password (minimum 8 characters)"
|
|
2762
|
-
}),
|
|
2763
|
-
publicKey: Type.String({
|
|
2764
|
-
pattern: BASE64_PATTERN,
|
|
2765
|
-
description: "Base64 encoded DER public key (SPKI format)"
|
|
2766
|
-
}),
|
|
2767
|
-
keyId: Type.String({
|
|
2768
|
-
pattern: UUID_PATTERN,
|
|
2769
|
-
description: "Client-generated UUID v4 key identifier"
|
|
2770
|
-
}),
|
|
2771
|
-
fingerprint: Type.String({
|
|
2772
|
-
pattern: FINGERPRINT_PATTERN,
|
|
2773
|
-
description: "SHA-256 fingerprint of public key (64 hex characters)"
|
|
2774
|
-
}),
|
|
2775
|
-
algorithm: Type.Union([
|
|
2776
|
-
Type.Literal("ES256"),
|
|
2777
|
-
Type.Literal("RS256")
|
|
2778
|
-
], {
|
|
2779
|
-
description: "Signing algorithm (ES256 recommended, RS256 for compatibility)"
|
|
2780
|
-
}),
|
|
2781
|
-
keySize: Type.Optional(Type.Number({
|
|
2782
|
-
description: "Key size in bytes"
|
|
2783
|
-
}))
|
|
2784
|
-
}, {
|
|
2785
|
-
minProperties: 6,
|
|
2786
|
-
// email/phone + verificationToken + password + publicKey + keyId + fingerprint
|
|
2787
|
-
description: "Email or phone must be provided with verification token"
|
|
2788
|
-
}),
|
|
2789
|
-
response: ApiResponseSchema(
|
|
2790
|
-
Type.Object({
|
|
2791
|
-
userId: Type.String(),
|
|
2792
|
-
email: Type.Optional(Type.String()),
|
|
2793
|
-
phone: Type.Optional(Type.String())
|
|
2794
|
-
})
|
|
2795
|
-
)
|
|
2796
|
-
};
|
|
2797
|
-
var loginContract = {
|
|
2798
|
-
method: "POST",
|
|
2799
|
-
path: "/_auth/login",
|
|
2800
|
-
body: Type.Object({
|
|
2801
|
-
email: Type.Optional(Type.String({
|
|
2802
|
-
pattern: EMAIL_PATTERN,
|
|
2803
|
-
description: "Email address"
|
|
2804
|
-
})),
|
|
2805
|
-
phone: Type.Optional(Type.String({
|
|
2806
|
-
pattern: PHONE_PATTERN,
|
|
2807
|
-
description: "Phone number in E.164 format"
|
|
2808
|
-
})),
|
|
2809
|
-
password: Type.String({
|
|
2810
|
-
minLength: 1,
|
|
2811
|
-
description: "User password"
|
|
2812
|
-
}),
|
|
2813
|
-
publicKey: Type.String({
|
|
2814
|
-
pattern: BASE64_PATTERN,
|
|
2815
|
-
description: "Base64 encoded DER public key (SPKI format)"
|
|
2816
|
-
}),
|
|
2817
|
-
keyId: Type.String({
|
|
2818
|
-
pattern: UUID_PATTERN,
|
|
2819
|
-
description: "Client-generated UUID v4 key identifier"
|
|
2820
|
-
}),
|
|
2821
|
-
fingerprint: Type.String({
|
|
2822
|
-
pattern: FINGERPRINT_PATTERN,
|
|
2823
|
-
description: "SHA-256 fingerprint of public key (64 hex characters)"
|
|
2824
|
-
}),
|
|
2825
|
-
oldKeyId: Type.Optional(Type.String({
|
|
2826
|
-
pattern: UUID_PATTERN,
|
|
2827
|
-
description: "Previous key ID to revoke (server-side cleanup)"
|
|
2828
|
-
})),
|
|
2829
|
-
algorithm: Type.Union([
|
|
2830
|
-
Type.Literal("ES256"),
|
|
2831
|
-
Type.Literal("RS256")
|
|
2832
|
-
], {
|
|
2833
|
-
description: "Signing algorithm (ES256 recommended, RS256 for compatibility)"
|
|
2834
|
-
}),
|
|
2835
|
-
keySize: Type.Optional(Type.Number({
|
|
2836
|
-
description: "Key size in bytes"
|
|
2837
|
-
}))
|
|
2838
|
-
}, {
|
|
2839
|
-
minProperties: 5,
|
|
2840
|
-
// email/phone + password + publicKey + keyId + fingerprint
|
|
2841
|
-
description: "Email or phone must be provided along with key data"
|
|
2842
|
-
}),
|
|
2843
|
-
response: ApiResponseSchema(
|
|
2844
|
-
Type.Object({
|
|
2845
|
-
userId: Type.String(),
|
|
2846
|
-
email: Type.Optional(Type.String()),
|
|
2847
|
-
phone: Type.Optional(Type.String()),
|
|
2848
|
-
passwordChangeRequired: Type.Boolean({
|
|
2849
|
-
description: "Whether user must change password before proceeding"
|
|
2850
|
-
})
|
|
2851
|
-
})
|
|
2852
|
-
)
|
|
2853
|
-
};
|
|
2854
|
-
var logoutContract = {
|
|
2855
|
-
method: "POST",
|
|
2856
|
-
path: "/_auth/logout",
|
|
2857
|
-
body: Type.Object({}),
|
|
2858
|
-
response: ApiResponseSchema(
|
|
2859
|
-
Type.Object({
|
|
2860
|
-
success: Type.Boolean()
|
|
2861
|
-
})
|
|
2862
|
-
)
|
|
2863
|
-
};
|
|
2864
|
-
var rotateKeyContract = {
|
|
2865
|
-
method: "POST",
|
|
2866
|
-
path: "/_auth/keys/rotate",
|
|
2867
|
-
body: Type.Object({
|
|
2868
|
-
publicKey: Type.String({
|
|
2869
|
-
pattern: BASE64_PATTERN,
|
|
2870
|
-
description: "Base64 encoded DER public key (SPKI format)"
|
|
2871
|
-
}),
|
|
2872
|
-
keyId: Type.String({
|
|
2873
|
-
pattern: UUID_PATTERN,
|
|
2874
|
-
description: "Client-generated UUID v4 key identifier"
|
|
2875
|
-
}),
|
|
2876
|
-
fingerprint: Type.String({
|
|
2877
|
-
pattern: FINGERPRINT_PATTERN,
|
|
2878
|
-
description: "SHA-256 fingerprint of public key (64 hex characters)"
|
|
2879
|
-
}),
|
|
2880
|
-
algorithm: Type.Union([
|
|
2881
|
-
Type.Literal("ES256"),
|
|
2882
|
-
Type.Literal("RS256")
|
|
2883
|
-
], {
|
|
2884
|
-
description: "Signing algorithm (ES256 recommended, RS256 for compatibility)"
|
|
2885
|
-
}),
|
|
2886
|
-
keySize: Type.Optional(Type.Number({
|
|
2887
|
-
description: "Key size in bytes"
|
|
2888
|
-
}))
|
|
2889
|
-
}),
|
|
2890
|
-
response: ApiResponseSchema(
|
|
2891
|
-
Type.Object({
|
|
2892
|
-
success: Type.Boolean(),
|
|
2893
|
-
keyId: Type.String()
|
|
2894
|
-
})
|
|
2895
|
-
)
|
|
2896
|
-
};
|
|
2897
|
-
var changePasswordContract = {
|
|
2898
|
-
method: "PUT",
|
|
2899
|
-
path: "/_auth/password",
|
|
2900
|
-
body: Type.Object({
|
|
2901
|
-
currentPassword: Type.String({
|
|
2902
|
-
minLength: 1,
|
|
2903
|
-
description: "Current password for verification"
|
|
2904
|
-
}),
|
|
2905
|
-
newPassword: Type.String({
|
|
2906
|
-
minLength: 8,
|
|
2907
|
-
description: "New password (minimum 8 characters)"
|
|
2908
|
-
})
|
|
2909
|
-
}),
|
|
2910
|
-
response: ApiResponseSchema(
|
|
2911
|
-
Type.Object({
|
|
2912
|
-
success: Type.Boolean({ description: "Whether password was changed successfully" })
|
|
2913
|
-
})
|
|
2914
|
-
)
|
|
2915
|
-
};
|
|
2916
|
-
var getMeContract = {
|
|
2917
|
-
method: "GET",
|
|
2918
|
-
path: "/_auth/me",
|
|
2919
|
-
body: Type.Object({}),
|
|
2920
|
-
response: ApiResponseSchema(
|
|
2921
|
-
Type.Object({
|
|
2922
|
-
userId: Type.String({ description: "User ID" }),
|
|
2923
|
-
email: Type.Optional(Type.String({ description: "User email address" })),
|
|
2924
|
-
phone: Type.Optional(Type.String({ description: "User phone number" })),
|
|
2925
|
-
role: Type.Object({
|
|
2926
|
-
id: Type.Number({ description: "Role ID" }),
|
|
2927
|
-
name: Type.String({ description: "Role name (e.g., user, admin)" }),
|
|
2928
|
-
displayName: Type.String({ description: "Display name for UI" }),
|
|
2929
|
-
priority: Type.Number({ description: "Role priority level" })
|
|
2930
|
-
}, { description: "User role information" }),
|
|
2931
|
-
permissions: Type.Array(
|
|
2932
|
-
Type.Object({
|
|
2933
|
-
id: Type.Number({ description: "Permission ID" }),
|
|
2934
|
-
name: Type.String({ description: "Permission name (e.g., user:delete)" }),
|
|
2935
|
-
displayName: Type.String({ description: "Display name for UI" }),
|
|
2936
|
-
category: Type.Optional(Type.String({ description: "Permission category" }))
|
|
2937
|
-
}),
|
|
2938
|
-
{ description: "List of permissions granted through role" }
|
|
2939
|
-
)
|
|
2940
|
-
})
|
|
2941
|
-
)
|
|
2942
|
-
};
|
|
2943
|
-
|
|
2944
|
-
// src/lib/api/auth-codes-verify.ts
|
|
2945
|
-
var verifyCode = (options) => client.call(verifyCodeContract, options);
|
|
2946
|
-
export {
|
|
2947
|
-
verifyCode
|
|
2948
|
-
};
|
|
2949
|
-
//# sourceMappingURL=auth-codes-verify.js.map
|