@modelcontextprotocol/server 2.0.0-alpha.1 → 2.0.0-alpha.3
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 +6 -2
- package/dist/{src-IKPjmxu7.mjs → ajvProvider-Birb50r-.mjs} +21 -3421
- package/dist/ajvProvider-Birb50r-.mjs.map +1 -0
- package/dist/ajvProvider-DZ_siXcF.d.mts +983 -0
- package/dist/ajvProvider-DZ_siXcF.d.mts.map +1 -0
- package/dist/cfWorkerProvider-BrJKpSFH.mjs +954 -0
- package/dist/cfWorkerProvider-BrJKpSFH.mjs.map +1 -0
- package/dist/cfWorkerProvider-DUhk5Ewx.d.mts +52 -0
- package/dist/cfWorkerProvider-DUhk5Ewx.d.mts.map +1 -0
- package/dist/chunk-BRhqBsOc.mjs +42 -0
- package/dist/index.d.mts +1526 -334
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +91 -766
- package/dist/index.mjs.map +1 -1
- package/dist/shimsNode.d.mts +1 -1
- package/dist/shimsNode.mjs +1 -1
- package/dist/shimsWorkerd.d.mts +1 -1
- package/dist/shimsWorkerd.mjs +1 -1
- package/dist/shimsWorkerd.mjs.map +1 -1
- package/dist/src-Pa1iAvsj.mjs +3386 -0
- package/dist/src-Pa1iAvsj.mjs.map +1 -0
- package/dist/stdio.d.mts +49 -0
- package/dist/stdio.d.mts.map +1 -0
- package/dist/stdio.mjs +106 -0
- package/dist/stdio.mjs.map +1 -0
- package/dist/transport-DMKhEchd.d.mts +8657 -0
- package/dist/transport-DMKhEchd.d.mts.map +1 -0
- package/dist/types-R2RTIcjk.d.mts +66 -0
- package/dist/types-R2RTIcjk.d.mts.map +1 -0
- package/dist/validators/ajv.d.mts +2 -0
- package/dist/validators/ajv.mjs +4 -0
- package/dist/validators/cfWorker.d.mts +2 -0
- package/dist/validators/cfWorker.mjs +3 -0
- package/package.json +37 -18
- package/dist/index-DbrUKkja.d.mts +0 -5153
- package/dist/index-DbrUKkja.d.mts.map +0 -1
- package/dist/src-IKPjmxu7.mjs.map +0 -1
|
@@ -0,0 +1,983 @@
|
|
|
1
|
+
import { i as jsonSchemaValidator, n as JsonSchemaValidator, t as JsonSchemaType } from "./types-R2RTIcjk.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.d.ts
|
|
4
|
+
declare abstract class _CodeOrName {
|
|
5
|
+
abstract readonly str: string;
|
|
6
|
+
abstract readonly names: UsedNames;
|
|
7
|
+
abstract toString(): string;
|
|
8
|
+
abstract emptyStr(): boolean;
|
|
9
|
+
}
|
|
10
|
+
declare class Name extends _CodeOrName {
|
|
11
|
+
readonly str: string;
|
|
12
|
+
constructor(s: string);
|
|
13
|
+
toString(): string;
|
|
14
|
+
emptyStr(): boolean;
|
|
15
|
+
get names(): UsedNames;
|
|
16
|
+
}
|
|
17
|
+
declare class _Code extends _CodeOrName {
|
|
18
|
+
readonly _items: readonly CodeItem[];
|
|
19
|
+
private _str?;
|
|
20
|
+
private _names?;
|
|
21
|
+
constructor(code: string | readonly CodeItem[]);
|
|
22
|
+
toString(): string;
|
|
23
|
+
emptyStr(): boolean;
|
|
24
|
+
get str(): string;
|
|
25
|
+
get names(): UsedNames;
|
|
26
|
+
}
|
|
27
|
+
type CodeItem = Name | string | number | boolean | null;
|
|
28
|
+
type UsedNames = Record<string, number | undefined>;
|
|
29
|
+
type Code = _Code | Name;
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/scope.d.ts
|
|
32
|
+
interface NameGroup {
|
|
33
|
+
prefix: string;
|
|
34
|
+
index: number;
|
|
35
|
+
}
|
|
36
|
+
interface NameValue {
|
|
37
|
+
ref: ValueReference;
|
|
38
|
+
key?: unknown;
|
|
39
|
+
code?: Code;
|
|
40
|
+
}
|
|
41
|
+
type ValueReference = unknown;
|
|
42
|
+
interface ScopeOptions {
|
|
43
|
+
prefixes?: Set<string>;
|
|
44
|
+
parent?: Scope;
|
|
45
|
+
}
|
|
46
|
+
interface ValueScopeOptions extends ScopeOptions {
|
|
47
|
+
scope: ScopeStore;
|
|
48
|
+
es5?: boolean;
|
|
49
|
+
lines?: boolean;
|
|
50
|
+
}
|
|
51
|
+
type ScopeStore = Record<string, ValueReference[] | undefined>;
|
|
52
|
+
type ScopeValues = { [Prefix in string]?: Map<unknown, ValueScopeName> };
|
|
53
|
+
type ScopeValueSets = { [Prefix in string]?: Set<ValueScopeName> };
|
|
54
|
+
declare enum UsedValueState {
|
|
55
|
+
Started = 0,
|
|
56
|
+
Completed = 1,
|
|
57
|
+
}
|
|
58
|
+
type UsedScopeValues = { [Prefix in string]?: Map<ValueScopeName, UsedValueState | undefined> };
|
|
59
|
+
declare class Scope {
|
|
60
|
+
protected readonly _names: { [Prefix in string]?: NameGroup };
|
|
61
|
+
protected readonly _prefixes?: Set<string>;
|
|
62
|
+
protected readonly _parent?: Scope;
|
|
63
|
+
constructor({
|
|
64
|
+
prefixes,
|
|
65
|
+
parent
|
|
66
|
+
}?: ScopeOptions);
|
|
67
|
+
toName(nameOrPrefix: Name | string): Name;
|
|
68
|
+
name(prefix: string): Name;
|
|
69
|
+
protected _newName(prefix: string): string;
|
|
70
|
+
private _nameGroup;
|
|
71
|
+
}
|
|
72
|
+
interface ScopePath {
|
|
73
|
+
property: string;
|
|
74
|
+
itemIndex: number;
|
|
75
|
+
}
|
|
76
|
+
declare class ValueScopeName extends Name {
|
|
77
|
+
readonly prefix: string;
|
|
78
|
+
value?: NameValue;
|
|
79
|
+
scopePath?: Code;
|
|
80
|
+
constructor(prefix: string, nameStr: string);
|
|
81
|
+
setValue(value: NameValue, {
|
|
82
|
+
property,
|
|
83
|
+
itemIndex
|
|
84
|
+
}: ScopePath): void;
|
|
85
|
+
}
|
|
86
|
+
interface VSOptions extends ValueScopeOptions {
|
|
87
|
+
_n: Code;
|
|
88
|
+
}
|
|
89
|
+
declare class ValueScope extends Scope {
|
|
90
|
+
protected readonly _values: ScopeValues;
|
|
91
|
+
protected readonly _scope: ScopeStore;
|
|
92
|
+
readonly opts: VSOptions;
|
|
93
|
+
constructor(opts: ValueScopeOptions);
|
|
94
|
+
get(): ScopeStore;
|
|
95
|
+
name(prefix: string): ValueScopeName;
|
|
96
|
+
value(nameOrPrefix: ValueScopeName | string, value: NameValue): ValueScopeName;
|
|
97
|
+
getValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined;
|
|
98
|
+
scopeRefs(scopeName: Name, values?: ScopeValues | ScopeValueSets): Code;
|
|
99
|
+
scopeCode(values?: ScopeValues | ScopeValueSets, usedValues?: UsedScopeValues, getCode?: (n: ValueScopeName) => Code | undefined): Code;
|
|
100
|
+
private _reduceValues;
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/index.d.ts
|
|
104
|
+
type SafeExpr = Code | number | boolean | null;
|
|
105
|
+
type Block = Code | (() => void);
|
|
106
|
+
interface CodeGenOptions {
|
|
107
|
+
es5?: boolean;
|
|
108
|
+
lines?: boolean;
|
|
109
|
+
ownProperties?: boolean;
|
|
110
|
+
}
|
|
111
|
+
declare class CodeGen {
|
|
112
|
+
readonly _scope: Scope;
|
|
113
|
+
readonly _extScope: ValueScope;
|
|
114
|
+
readonly _values: ScopeValueSets;
|
|
115
|
+
private readonly _nodes;
|
|
116
|
+
private readonly _blockStarts;
|
|
117
|
+
private readonly _constants;
|
|
118
|
+
private readonly opts;
|
|
119
|
+
constructor(extScope: ValueScope, opts?: CodeGenOptions);
|
|
120
|
+
toString(): string;
|
|
121
|
+
name(prefix: string): Name;
|
|
122
|
+
scopeName(prefix: string): ValueScopeName;
|
|
123
|
+
scopeValue(prefixOrName: ValueScopeName | string, value: NameValue): Name;
|
|
124
|
+
getScopeValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined;
|
|
125
|
+
scopeRefs(scopeName: Name): Code;
|
|
126
|
+
scopeCode(): Code;
|
|
127
|
+
private _def;
|
|
128
|
+
const(nameOrPrefix: Name | string, rhs: SafeExpr, _constant?: boolean): Name;
|
|
129
|
+
let(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name;
|
|
130
|
+
var(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name;
|
|
131
|
+
assign(lhs: Code, rhs: SafeExpr, sideEffects?: boolean): CodeGen;
|
|
132
|
+
add(lhs: Code, rhs: SafeExpr): CodeGen;
|
|
133
|
+
code(c: Block | SafeExpr): CodeGen;
|
|
134
|
+
object(...keyValues: [Name | string, SafeExpr | string][]): _Code;
|
|
135
|
+
if(condition: Code | boolean, thenBody?: Block, elseBody?: Block): CodeGen;
|
|
136
|
+
elseIf(condition: Code | boolean): CodeGen;
|
|
137
|
+
else(): CodeGen;
|
|
138
|
+
endIf(): CodeGen;
|
|
139
|
+
private _for;
|
|
140
|
+
for(iteration: Code, forBody?: Block): CodeGen;
|
|
141
|
+
forRange(nameOrPrefix: Name | string, from: SafeExpr, to: SafeExpr, forBody: (index: Name) => void, varKind?: Code): CodeGen;
|
|
142
|
+
forOf(nameOrPrefix: Name | string, iterable: Code, forBody: (item: Name) => void, varKind?: Code): CodeGen;
|
|
143
|
+
forIn(nameOrPrefix: Name | string, obj: Code, forBody: (item: Name) => void, varKind?: Code): CodeGen;
|
|
144
|
+
endFor(): CodeGen;
|
|
145
|
+
label(label: Name): CodeGen;
|
|
146
|
+
break(label?: Code): CodeGen;
|
|
147
|
+
return(value: Block | SafeExpr): CodeGen;
|
|
148
|
+
try(tryBody: Block, catchCode?: (e: Name) => void, finallyCode?: Block): CodeGen;
|
|
149
|
+
throw(error: Code): CodeGen;
|
|
150
|
+
block(body?: Block, nodeCount?: number): CodeGen;
|
|
151
|
+
endBlock(nodeCount?: number): CodeGen;
|
|
152
|
+
func(name: Name, args?: Code, async?: boolean, funcBody?: Block): CodeGen;
|
|
153
|
+
endFunc(): CodeGen;
|
|
154
|
+
optimize(n?: number): void;
|
|
155
|
+
private _leafNode;
|
|
156
|
+
private _blockNode;
|
|
157
|
+
private _endBlockNode;
|
|
158
|
+
private _elseNode;
|
|
159
|
+
private get _root();
|
|
160
|
+
private get _currNode();
|
|
161
|
+
private set _currNode(value);
|
|
162
|
+
}
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/rules.d.ts
|
|
165
|
+
declare const _jsonTypes: readonly ["string", "number", "integer", "boolean", "null", "object", "array"];
|
|
166
|
+
type JSONType$1 = (typeof _jsonTypes)[number];
|
|
167
|
+
type ValidationTypes = { [K in JSONType$1]: boolean | RuleGroup | undefined };
|
|
168
|
+
interface ValidationRules {
|
|
169
|
+
rules: RuleGroup[];
|
|
170
|
+
post: RuleGroup;
|
|
171
|
+
all: { [Key in string]?: boolean | Rule };
|
|
172
|
+
keywords: { [Key in string]?: boolean };
|
|
173
|
+
types: ValidationTypes;
|
|
174
|
+
}
|
|
175
|
+
interface RuleGroup {
|
|
176
|
+
type?: JSONType$1;
|
|
177
|
+
rules: Rule[];
|
|
178
|
+
}
|
|
179
|
+
interface Rule {
|
|
180
|
+
keyword: string;
|
|
181
|
+
definition: AddedKeywordDefinition;
|
|
182
|
+
}
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/util.d.ts
|
|
185
|
+
declare enum Type {
|
|
186
|
+
Num = 0,
|
|
187
|
+
Str = 1,
|
|
188
|
+
}
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/subschema.d.ts
|
|
191
|
+
type SubschemaArgs = Partial<{
|
|
192
|
+
keyword: string;
|
|
193
|
+
schemaProp: string | number;
|
|
194
|
+
schema: AnySchema;
|
|
195
|
+
schemaPath: Code;
|
|
196
|
+
errSchemaPath: string;
|
|
197
|
+
topSchemaRef: Code;
|
|
198
|
+
data: Name | Code;
|
|
199
|
+
dataProp: Code | string | number;
|
|
200
|
+
dataTypes: JSONType$1[];
|
|
201
|
+
definedProperties: Set<string>;
|
|
202
|
+
propertyName: Name;
|
|
203
|
+
dataPropType: Type;
|
|
204
|
+
jtdDiscriminator: string;
|
|
205
|
+
jtdMetadata: boolean;
|
|
206
|
+
compositeRule: true;
|
|
207
|
+
createErrors: boolean;
|
|
208
|
+
allErrors: boolean;
|
|
209
|
+
}>;
|
|
210
|
+
//#endregion
|
|
211
|
+
//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/errors.d.ts
|
|
212
|
+
interface ErrorPaths {
|
|
213
|
+
instancePath?: Code;
|
|
214
|
+
schemaPath?: string;
|
|
215
|
+
parentSchema?: boolean;
|
|
216
|
+
}
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/index.d.ts
|
|
219
|
+
declare class KeywordCxt implements KeywordErrorCxt {
|
|
220
|
+
readonly gen: CodeGen;
|
|
221
|
+
readonly allErrors?: boolean;
|
|
222
|
+
readonly keyword: string;
|
|
223
|
+
readonly data: Name;
|
|
224
|
+
readonly $data?: string | false;
|
|
225
|
+
schema: any;
|
|
226
|
+
readonly schemaValue: Code | number | boolean;
|
|
227
|
+
readonly schemaCode: Code | number | boolean;
|
|
228
|
+
readonly schemaType: JSONType$1[];
|
|
229
|
+
readonly parentSchema: AnySchemaObject;
|
|
230
|
+
readonly errsCount?: Name;
|
|
231
|
+
params: KeywordCxtParams;
|
|
232
|
+
readonly it: SchemaObjCxt;
|
|
233
|
+
readonly def: AddedKeywordDefinition;
|
|
234
|
+
constructor(it: SchemaObjCxt, def: AddedKeywordDefinition, keyword: string);
|
|
235
|
+
result(condition: Code, successAction?: () => void, failAction?: () => void): void;
|
|
236
|
+
failResult(condition: Code, successAction?: () => void, failAction?: () => void): void;
|
|
237
|
+
pass(condition: Code, failAction?: () => void): void;
|
|
238
|
+
fail(condition?: Code): void;
|
|
239
|
+
fail$data(condition: Code): void;
|
|
240
|
+
error(append?: boolean, errorParams?: KeywordCxtParams, errorPaths?: ErrorPaths): void;
|
|
241
|
+
private _error;
|
|
242
|
+
$dataError(): void;
|
|
243
|
+
reset(): void;
|
|
244
|
+
ok(cond: Code | boolean): void;
|
|
245
|
+
setParams(obj: KeywordCxtParams, assign?: true): void;
|
|
246
|
+
block$data(valid: Name, codeBlock: () => void, $dataValid?: Code): void;
|
|
247
|
+
check$data(valid?: Name, $dataValid?: Code): void;
|
|
248
|
+
invalid$data(): Code;
|
|
249
|
+
subschema(appl: SubschemaArgs, valid: Name): SchemaCxt;
|
|
250
|
+
mergeEvaluated(schemaCxt: SchemaCxt, toName?: typeof Name): void;
|
|
251
|
+
mergeValidEvaluated(schemaCxt: SchemaCxt, valid: Name): boolean | void;
|
|
252
|
+
}
|
|
253
|
+
//#endregion
|
|
254
|
+
//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/types/json-schema.d.ts
|
|
255
|
+
type StrictNullChecksWrapper<Name$1 extends string, Type$1> = undefined extends null ? `strictNullChecks must be true in tsconfig to use ${Name$1}` : Type$1;
|
|
256
|
+
type UnionToIntersection<U> = (U extends any ? (_: U) => void : never) extends ((_: infer I) => void) ? I : never;
|
|
257
|
+
type UncheckedPartialSchema<T> = Partial<UncheckedJSONSchemaType<T, true>>;
|
|
258
|
+
type JSONType<T extends string, IsPartial extends boolean> = IsPartial extends true ? T | undefined : T;
|
|
259
|
+
interface NumberKeywords {
|
|
260
|
+
minimum?: number;
|
|
261
|
+
maximum?: number;
|
|
262
|
+
exclusiveMinimum?: number;
|
|
263
|
+
exclusiveMaximum?: number;
|
|
264
|
+
multipleOf?: number;
|
|
265
|
+
format?: string;
|
|
266
|
+
}
|
|
267
|
+
interface StringKeywords {
|
|
268
|
+
minLength?: number;
|
|
269
|
+
maxLength?: number;
|
|
270
|
+
pattern?: string;
|
|
271
|
+
format?: string;
|
|
272
|
+
}
|
|
273
|
+
type UncheckedJSONSchemaType<T, IsPartial extends boolean> = (
|
|
274
|
+
// these two unions allow arbitrary unions of types
|
|
275
|
+
{
|
|
276
|
+
anyOf: readonly UncheckedJSONSchemaType<T, IsPartial>[];
|
|
277
|
+
} | {
|
|
278
|
+
oneOf: readonly UncheckedJSONSchemaType<T, IsPartial>[];
|
|
279
|
+
} | ({
|
|
280
|
+
type: readonly (T extends number ? JSONType<"number" | "integer", IsPartial> : T extends string ? JSONType<"string", IsPartial> : T extends boolean ? JSONType<"boolean", IsPartial> : never)[];
|
|
281
|
+
} & UnionToIntersection<T extends number ? NumberKeywords : T extends string ? StringKeywords : T extends boolean ? {} : never>) | ((T extends number ? {
|
|
282
|
+
type: JSONType<"number" | "integer", IsPartial>;
|
|
283
|
+
} & NumberKeywords : T extends string ? {
|
|
284
|
+
type: JSONType<"string", IsPartial>;
|
|
285
|
+
} & StringKeywords : T extends boolean ? {
|
|
286
|
+
type: JSONType<"boolean", IsPartial>;
|
|
287
|
+
} : T extends readonly [any, ...any[]] ? {
|
|
288
|
+
type: JSONType<"array", IsPartial>;
|
|
289
|
+
items: { readonly [K in keyof T]-?: UncheckedJSONSchemaType<T[K], false> & Nullable<T[K]> } & {
|
|
290
|
+
length: T["length"];
|
|
291
|
+
};
|
|
292
|
+
minItems: T["length"];
|
|
293
|
+
} & ({
|
|
294
|
+
maxItems: T["length"];
|
|
295
|
+
} | {
|
|
296
|
+
additionalItems: false;
|
|
297
|
+
}) : T extends readonly any[] ? {
|
|
298
|
+
type: JSONType<"array", IsPartial>;
|
|
299
|
+
items: UncheckedJSONSchemaType<T[0], false>;
|
|
300
|
+
contains?: UncheckedPartialSchema<T[0]>;
|
|
301
|
+
minItems?: number;
|
|
302
|
+
maxItems?: number;
|
|
303
|
+
minContains?: number;
|
|
304
|
+
maxContains?: number;
|
|
305
|
+
uniqueItems?: true;
|
|
306
|
+
additionalItems?: never;
|
|
307
|
+
} : T extends Record<string, any> ? {
|
|
308
|
+
type: JSONType<"object", IsPartial>;
|
|
309
|
+
additionalProperties?: boolean | UncheckedJSONSchemaType<T[string], false>;
|
|
310
|
+
unevaluatedProperties?: boolean | UncheckedJSONSchemaType<T[string], false>;
|
|
311
|
+
properties?: IsPartial extends true ? Partial<UncheckedPropertiesSchema<T>> : UncheckedPropertiesSchema<T>;
|
|
312
|
+
patternProperties?: Record<string, UncheckedJSONSchemaType<T[string], false>>;
|
|
313
|
+
propertyNames?: Omit<UncheckedJSONSchemaType<string, false>, "type"> & {
|
|
314
|
+
type?: "string";
|
|
315
|
+
};
|
|
316
|
+
dependencies?: { [K in keyof T]?: readonly (keyof T)[] | UncheckedPartialSchema<T> };
|
|
317
|
+
dependentRequired?: { [K in keyof T]?: readonly (keyof T)[] };
|
|
318
|
+
dependentSchemas?: { [K in keyof T]?: UncheckedPartialSchema<T> };
|
|
319
|
+
minProperties?: number;
|
|
320
|
+
maxProperties?: number;
|
|
321
|
+
} & (IsPartial extends true ? {
|
|
322
|
+
required: readonly (keyof T)[];
|
|
323
|
+
} : [UncheckedRequiredMembers<T>] extends [never] ? {
|
|
324
|
+
required?: readonly UncheckedRequiredMembers<T>[];
|
|
325
|
+
} : {
|
|
326
|
+
required: readonly UncheckedRequiredMembers<T>[];
|
|
327
|
+
}) : T extends null ? {
|
|
328
|
+
type: JSONType<"null", IsPartial>;
|
|
329
|
+
nullable: true;
|
|
330
|
+
} : never) & {
|
|
331
|
+
allOf?: readonly UncheckedPartialSchema<T>[];
|
|
332
|
+
anyOf?: readonly UncheckedPartialSchema<T>[];
|
|
333
|
+
oneOf?: readonly UncheckedPartialSchema<T>[];
|
|
334
|
+
if?: UncheckedPartialSchema<T>;
|
|
335
|
+
then?: UncheckedPartialSchema<T>;
|
|
336
|
+
else?: UncheckedPartialSchema<T>;
|
|
337
|
+
not?: UncheckedPartialSchema<T>;
|
|
338
|
+
})) & {
|
|
339
|
+
[keyword: string]: any;
|
|
340
|
+
$id?: string;
|
|
341
|
+
$ref?: string;
|
|
342
|
+
$defs?: Record<string, UncheckedJSONSchemaType<Known, true>>;
|
|
343
|
+
definitions?: Record<string, UncheckedJSONSchemaType<Known, true>>;
|
|
344
|
+
};
|
|
345
|
+
type JSONSchemaType<T> = StrictNullChecksWrapper<"JSONSchemaType", UncheckedJSONSchemaType<T, false>>;
|
|
346
|
+
type Known = {
|
|
347
|
+
[key: string]: Known;
|
|
348
|
+
} | [Known, ...Known[]] | Known[] | number | string | boolean | null;
|
|
349
|
+
type UncheckedPropertiesSchema<T> = { [K in keyof T]-?: (UncheckedJSONSchemaType<T[K], false> & Nullable<T[K]>) | {
|
|
350
|
+
$ref: string;
|
|
351
|
+
} };
|
|
352
|
+
type UncheckedRequiredMembers<T> = { [K in keyof T]-?: undefined extends T[K] ? never : K }[keyof T];
|
|
353
|
+
type Nullable<T> = undefined extends T ? {
|
|
354
|
+
nullable: true;
|
|
355
|
+
const?: null;
|
|
356
|
+
enum?: readonly (T | null)[];
|
|
357
|
+
default?: T | null;
|
|
358
|
+
} : {
|
|
359
|
+
nullable?: false;
|
|
360
|
+
const?: T;
|
|
361
|
+
enum?: readonly T[];
|
|
362
|
+
default?: T;
|
|
363
|
+
};
|
|
364
|
+
//#endregion
|
|
365
|
+
//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/types/jtd-schema.d.ts
|
|
366
|
+
/** numeric strings */
|
|
367
|
+
type NumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32";
|
|
368
|
+
/** string strings */
|
|
369
|
+
type StringType = "string" | "timestamp";
|
|
370
|
+
/** Generic JTD Schema without inference of the represented type */
|
|
371
|
+
type SomeJTDSchemaType = (
|
|
372
|
+
// ref
|
|
373
|
+
{
|
|
374
|
+
ref: string;
|
|
375
|
+
} | {
|
|
376
|
+
type: NumberType | StringType | "boolean";
|
|
377
|
+
} | {
|
|
378
|
+
enum: string[];
|
|
379
|
+
} | {
|
|
380
|
+
elements: SomeJTDSchemaType;
|
|
381
|
+
} | {
|
|
382
|
+
values: SomeJTDSchemaType;
|
|
383
|
+
} | {
|
|
384
|
+
properties: Record<string, SomeJTDSchemaType>;
|
|
385
|
+
optionalProperties?: Record<string, SomeJTDSchemaType>;
|
|
386
|
+
additionalProperties?: boolean;
|
|
387
|
+
} | {
|
|
388
|
+
properties?: Record<string, SomeJTDSchemaType>;
|
|
389
|
+
optionalProperties: Record<string, SomeJTDSchemaType>;
|
|
390
|
+
additionalProperties?: boolean;
|
|
391
|
+
} | {
|
|
392
|
+
discriminator: string;
|
|
393
|
+
mapping: Record<string, SomeJTDSchemaType>;
|
|
394
|
+
} | {}) & {
|
|
395
|
+
nullable?: boolean;
|
|
396
|
+
metadata?: Record<string, unknown>;
|
|
397
|
+
definitions?: Record<string, SomeJTDSchemaType>;
|
|
398
|
+
};
|
|
399
|
+
/** required keys of an object, not undefined */
|
|
400
|
+
type RequiredKeys<T> = { [K in keyof T]-?: undefined extends T[K] ? never : K }[keyof T];
|
|
401
|
+
/** optional or undifined-able keys of an object */
|
|
402
|
+
type OptionalKeys<T> = { [K in keyof T]-?: undefined extends T[K] ? K : never }[keyof T];
|
|
403
|
+
/** type is true if T is a union type */
|
|
404
|
+
type IsUnion_<T, U extends T = T> = false extends (T extends unknown ? ([U] extends [T] ? false : true) : never) ? false : true;
|
|
405
|
+
type IsUnion<T> = IsUnion_<T>;
|
|
406
|
+
/** type is true if T is identically E */
|
|
407
|
+
type TypeEquality<T, E$1> = [T] extends [E$1] ? ([E$1] extends [T] ? true : false) : false;
|
|
408
|
+
/** type is true if T or null is identically E or null*/
|
|
409
|
+
type NullTypeEquality<T, E$1> = TypeEquality<T | null, E$1 | null>;
|
|
410
|
+
/** gets only the string literals of a type or null if a type isn't a string literal */
|
|
411
|
+
type EnumString<T> = [T] extends [never] ? null : T extends string ? string extends T ? null : T : null;
|
|
412
|
+
/** true if type is a union of string literals */
|
|
413
|
+
type IsEnum<T> = null extends EnumString<T> ? false : true;
|
|
414
|
+
/** true only if all types are array types (not tuples) */
|
|
415
|
+
type IsElements<T> = false extends IsUnion<T> ? [T] extends [readonly unknown[]] ? undefined extends T[0.5] ? false : true : false : false;
|
|
416
|
+
/** true if the the type is a values type */
|
|
417
|
+
type IsValues<T> = false extends IsUnion<T> ? TypeEquality<keyof T, string> : false;
|
|
418
|
+
/** true if type is a properties type and Union is false, or type is a discriminator type and Union is true */
|
|
419
|
+
type IsRecord<T, Union extends boolean> = Union extends IsUnion<T> ? null extends EnumString<keyof T> ? false : true : false;
|
|
420
|
+
/** true if type represents an empty record */
|
|
421
|
+
type IsEmptyRecord<T> = [T] extends [Record<string, never>] ? [T] extends [never] ? false : true : false;
|
|
422
|
+
/** actual schema */
|
|
423
|
+
type JTDSchemaType<T, D extends Record<string, unknown> = Record<string, never>> = (
|
|
424
|
+
// refs - where null wasn't specified, must match exactly
|
|
425
|
+
(null extends EnumString<keyof D> ? never : ({ [K in keyof D]: [T] extends [D[K]] ? {
|
|
426
|
+
ref: K;
|
|
427
|
+
} : never }[keyof D] & {
|
|
428
|
+
nullable?: false;
|
|
429
|
+
}) | (null extends T ? { [K in keyof D]: [Exclude<T, null>] extends [Exclude<D[K], null>] ? {
|
|
430
|
+
ref: K;
|
|
431
|
+
} : never }[keyof D] & {
|
|
432
|
+
nullable: true;
|
|
433
|
+
} : never)) | (unknown extends T ? {
|
|
434
|
+
nullable?: boolean;
|
|
435
|
+
} : never) | ((true extends NullTypeEquality<T, number> ? {
|
|
436
|
+
type: NumberType;
|
|
437
|
+
} : true extends NullTypeEquality<T, boolean> ? {
|
|
438
|
+
type: "boolean";
|
|
439
|
+
} : true extends NullTypeEquality<T, string> ? {
|
|
440
|
+
type: StringType;
|
|
441
|
+
} : true extends NullTypeEquality<T, Date> ? {
|
|
442
|
+
type: "timestamp";
|
|
443
|
+
} : true extends IsEnum<Exclude<T, null>> ? {
|
|
444
|
+
enum: EnumString<Exclude<T, null>>[];
|
|
445
|
+
} : true extends IsElements<Exclude<T, null>> ? T extends readonly (infer E)[] ? {
|
|
446
|
+
elements: JTDSchemaType<E, D>;
|
|
447
|
+
} : never : true extends IsEmptyRecord<Exclude<T, null>> ? {
|
|
448
|
+
properties: Record<string, never>;
|
|
449
|
+
optionalProperties?: Record<string, never>;
|
|
450
|
+
} | {
|
|
451
|
+
optionalProperties: Record<string, never>;
|
|
452
|
+
} : true extends IsValues<Exclude<T, null>> ? T extends Record<string, infer V> ? {
|
|
453
|
+
values: JTDSchemaType<V, D>;
|
|
454
|
+
} : never : true extends IsRecord<Exclude<T, null>, false> ? ([RequiredKeys<Exclude<T, null>>] extends [never] ? {
|
|
455
|
+
properties?: Record<string, never>;
|
|
456
|
+
} : {
|
|
457
|
+
properties: { [K in RequiredKeys<T>]: JTDSchemaType<T[K], D> };
|
|
458
|
+
}) & ([OptionalKeys<Exclude<T, null>>] extends [never] ? {
|
|
459
|
+
optionalProperties?: Record<string, never>;
|
|
460
|
+
} : {
|
|
461
|
+
optionalProperties: { [K in OptionalKeys<T>]: JTDSchemaType<Exclude<T[K], undefined>, D> };
|
|
462
|
+
}) & {
|
|
463
|
+
additionalProperties?: boolean;
|
|
464
|
+
} : true extends IsRecord<Exclude<T, null>, true> ? { [K in keyof Exclude<T, null>]-?: Exclude<T, null>[K] extends string ? {
|
|
465
|
+
discriminator: K;
|
|
466
|
+
mapping: { [M in Exclude<T, null>[K]]: JTDSchemaType<Omit<T extends Record<K, M> ? T : never, K>, D> };
|
|
467
|
+
} : never }[keyof Exclude<T, null>] : never) & (null extends T ? {
|
|
468
|
+
nullable: true;
|
|
469
|
+
} : {
|
|
470
|
+
nullable?: false;
|
|
471
|
+
}))) & {
|
|
472
|
+
metadata?: Record<string, unknown>;
|
|
473
|
+
definitions?: { [K in keyof D]: JTDSchemaType<D[K], D> };
|
|
474
|
+
};
|
|
475
|
+
type JTDDataDef<S, D extends Record<string, unknown>> =
|
|
476
|
+
// ref
|
|
477
|
+
(S extends {
|
|
478
|
+
ref: string;
|
|
479
|
+
} ? D extends { [K in S["ref"]]: infer V } ? JTDDataDef<V, D> : never : S extends {
|
|
480
|
+
type: NumberType;
|
|
481
|
+
} ? number : S extends {
|
|
482
|
+
type: "boolean";
|
|
483
|
+
} ? boolean : S extends {
|
|
484
|
+
type: "string";
|
|
485
|
+
} ? string : S extends {
|
|
486
|
+
type: "timestamp";
|
|
487
|
+
} ? string | Date : S extends {
|
|
488
|
+
enum: readonly (infer E)[];
|
|
489
|
+
} ? string extends E ? never : [E] extends [string] ? E : never : S extends {
|
|
490
|
+
elements: infer E;
|
|
491
|
+
} ? JTDDataDef<E, D>[] : S extends {
|
|
492
|
+
properties: Record<string, unknown>;
|
|
493
|
+
optionalProperties?: Record<string, unknown>;
|
|
494
|
+
additionalProperties?: boolean;
|
|
495
|
+
} ? { -readonly [K in keyof S["properties"]]-?: JTDDataDef<S["properties"][K], D> } & { -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef<S["optionalProperties"][K], D> } & ([S["additionalProperties"]] extends [true] ? Record<string, unknown> : unknown) : S extends {
|
|
496
|
+
properties?: Record<string, unknown>;
|
|
497
|
+
optionalProperties: Record<string, unknown>;
|
|
498
|
+
additionalProperties?: boolean;
|
|
499
|
+
} ? { -readonly [K in keyof S["properties"]]-?: JTDDataDef<S["properties"][K], D> } & { -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef<S["optionalProperties"][K], D> } & ([S["additionalProperties"]] extends [true] ? Record<string, unknown> : unknown) : S extends {
|
|
500
|
+
values: infer V;
|
|
501
|
+
} ? Record<string, JTDDataDef<V, D>> : S extends {
|
|
502
|
+
discriminator: infer M;
|
|
503
|
+
mapping: Record<string, unknown>;
|
|
504
|
+
} ? [M] extends [string] ? { [K in keyof S["mapping"]]: JTDDataDef<S["mapping"][K], D> & { [KM in M]: K } }[keyof S["mapping"]] : never : unknown) | (S extends {
|
|
505
|
+
nullable: true;
|
|
506
|
+
} ? null : never);
|
|
507
|
+
type JTDDataType<S> = S extends {
|
|
508
|
+
definitions: Record<string, unknown>;
|
|
509
|
+
} ? JTDDataDef<S, S["definitions"]> : JTDDataDef<S, Record<string, never>>;
|
|
510
|
+
//#endregion
|
|
511
|
+
//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/validation_error.d.ts
|
|
512
|
+
declare class ValidationError extends Error {
|
|
513
|
+
readonly errors: Partial<ErrorObject>[];
|
|
514
|
+
readonly ajv: true;
|
|
515
|
+
readonly validation: true;
|
|
516
|
+
constructor(errors: Partial<ErrorObject>[]);
|
|
517
|
+
}
|
|
518
|
+
//#endregion
|
|
519
|
+
//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/ref_error.d.ts
|
|
520
|
+
declare class MissingRefError extends Error {
|
|
521
|
+
readonly missingRef: string;
|
|
522
|
+
readonly missingSchema: string;
|
|
523
|
+
constructor(resolver: UriResolver, baseId: string, ref: string, msg?: string);
|
|
524
|
+
}
|
|
525
|
+
//#endregion
|
|
526
|
+
//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/core.d.ts
|
|
527
|
+
interface Plugin<Opts> {
|
|
528
|
+
(ajv: Ajv$1, options?: Opts): Ajv$1;
|
|
529
|
+
[prop: string]: any;
|
|
530
|
+
}
|
|
531
|
+
type Options = CurrentOptions & DeprecatedOptions;
|
|
532
|
+
interface CurrentOptions {
|
|
533
|
+
strict?: boolean | "log";
|
|
534
|
+
strictSchema?: boolean | "log";
|
|
535
|
+
strictNumbers?: boolean | "log";
|
|
536
|
+
strictTypes?: boolean | "log";
|
|
537
|
+
strictTuples?: boolean | "log";
|
|
538
|
+
strictRequired?: boolean | "log";
|
|
539
|
+
allowMatchingProperties?: boolean;
|
|
540
|
+
allowUnionTypes?: boolean;
|
|
541
|
+
validateFormats?: boolean;
|
|
542
|
+
$data?: boolean;
|
|
543
|
+
allErrors?: boolean;
|
|
544
|
+
verbose?: boolean;
|
|
545
|
+
discriminator?: boolean;
|
|
546
|
+
unicodeRegExp?: boolean;
|
|
547
|
+
timestamp?: "string" | "date";
|
|
548
|
+
parseDate?: boolean;
|
|
549
|
+
allowDate?: boolean;
|
|
550
|
+
specialNumbers?: "fast" | "null";
|
|
551
|
+
$comment?: true | ((comment: string, schemaPath?: string, rootSchema?: AnySchemaObject) => unknown);
|
|
552
|
+
formats?: { [Name in string]?: Format };
|
|
553
|
+
keywords?: Vocabulary;
|
|
554
|
+
schemas?: AnySchema[] | { [Key in string]?: AnySchema };
|
|
555
|
+
logger?: Logger | false;
|
|
556
|
+
loadSchema?: (uri: string) => Promise<AnySchemaObject>;
|
|
557
|
+
removeAdditional?: boolean | "all" | "failing";
|
|
558
|
+
useDefaults?: boolean | "empty";
|
|
559
|
+
coerceTypes?: boolean | "array";
|
|
560
|
+
next?: boolean;
|
|
561
|
+
unevaluated?: boolean;
|
|
562
|
+
dynamicRef?: boolean;
|
|
563
|
+
schemaId?: "id" | "$id";
|
|
564
|
+
jtd?: boolean;
|
|
565
|
+
meta?: SchemaObject | boolean;
|
|
566
|
+
defaultMeta?: string | AnySchemaObject;
|
|
567
|
+
validateSchema?: boolean | "log";
|
|
568
|
+
addUsedSchema?: boolean;
|
|
569
|
+
inlineRefs?: boolean | number;
|
|
570
|
+
passContext?: boolean;
|
|
571
|
+
loopRequired?: number;
|
|
572
|
+
loopEnum?: number;
|
|
573
|
+
ownProperties?: boolean;
|
|
574
|
+
multipleOfPrecision?: number;
|
|
575
|
+
int32range?: boolean;
|
|
576
|
+
messages?: boolean;
|
|
577
|
+
code?: CodeOptions;
|
|
578
|
+
uriResolver?: UriResolver;
|
|
579
|
+
}
|
|
580
|
+
interface CodeOptions {
|
|
581
|
+
es5?: boolean;
|
|
582
|
+
esm?: boolean;
|
|
583
|
+
lines?: boolean;
|
|
584
|
+
optimize?: boolean | number;
|
|
585
|
+
formats?: Code;
|
|
586
|
+
source?: boolean;
|
|
587
|
+
process?: (code: string, schema?: SchemaEnv) => string;
|
|
588
|
+
regExp?: RegExpEngine;
|
|
589
|
+
}
|
|
590
|
+
interface InstanceCodeOptions extends CodeOptions {
|
|
591
|
+
regExp: RegExpEngine;
|
|
592
|
+
optimize: number;
|
|
593
|
+
}
|
|
594
|
+
interface DeprecatedOptions {
|
|
595
|
+
/** @deprecated */
|
|
596
|
+
ignoreKeywordsWithRef?: boolean;
|
|
597
|
+
/** @deprecated */
|
|
598
|
+
jsPropertySyntax?: boolean;
|
|
599
|
+
/** @deprecated */
|
|
600
|
+
unicode?: boolean;
|
|
601
|
+
}
|
|
602
|
+
type RequiredInstanceOptions = { [K in "strictSchema" | "strictNumbers" | "strictTypes" | "strictTuples" | "strictRequired" | "inlineRefs" | "loopRequired" | "loopEnum" | "meta" | "messages" | "schemaId" | "addUsedSchema" | "validateSchema" | "validateFormats" | "int32range" | "unicodeRegExp" | "uriResolver"]: NonNullable<Options[K]> } & {
|
|
603
|
+
code: InstanceCodeOptions;
|
|
604
|
+
};
|
|
605
|
+
type InstanceOptions = Options & RequiredInstanceOptions;
|
|
606
|
+
interface Logger {
|
|
607
|
+
log(...args: unknown[]): unknown;
|
|
608
|
+
warn(...args: unknown[]): unknown;
|
|
609
|
+
error(...args: unknown[]): unknown;
|
|
610
|
+
}
|
|
611
|
+
declare class Ajv$1 {
|
|
612
|
+
opts: InstanceOptions;
|
|
613
|
+
errors?: ErrorObject[] | null;
|
|
614
|
+
logger: Logger;
|
|
615
|
+
readonly scope: ValueScope;
|
|
616
|
+
readonly schemas: { [Key in string]?: SchemaEnv };
|
|
617
|
+
readonly refs: { [Ref in string]?: SchemaEnv | string };
|
|
618
|
+
readonly formats: { [Name in string]?: AddedFormat };
|
|
619
|
+
readonly RULES: ValidationRules;
|
|
620
|
+
readonly _compilations: Set<SchemaEnv>;
|
|
621
|
+
private readonly _loading;
|
|
622
|
+
private readonly _cache;
|
|
623
|
+
private readonly _metaOpts;
|
|
624
|
+
static ValidationError: typeof ValidationError;
|
|
625
|
+
static MissingRefError: typeof MissingRefError;
|
|
626
|
+
constructor(opts?: Options);
|
|
627
|
+
_addVocabularies(): void;
|
|
628
|
+
_addDefaultMetaSchema(): void;
|
|
629
|
+
defaultMeta(): string | AnySchemaObject | undefined;
|
|
630
|
+
validate(schema: Schema | string, data: unknown): boolean;
|
|
631
|
+
validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise<unknown>;
|
|
632
|
+
validate<T>(schema: Schema | JSONSchemaType<T> | string, data: unknown): data is T;
|
|
633
|
+
validate<T>(schema: JTDSchemaType<T>, data: unknown): data is T;
|
|
634
|
+
validate<N extends never, T extends SomeJTDSchemaType>(schema: T, data: unknown): data is JTDDataType<T>;
|
|
635
|
+
validate<T>(schema: AsyncSchema, data: unknown | T): Promise<T>;
|
|
636
|
+
validate<T>(schemaKeyRef: AnySchema | string, data: unknown): data is T | Promise<T>;
|
|
637
|
+
compile<T = unknown>(schema: Schema | JSONSchemaType<T>, _meta?: boolean): ValidateFunction<T>;
|
|
638
|
+
compile<T = unknown>(schema: JTDSchemaType<T>, _meta?: boolean): ValidateFunction<T>;
|
|
639
|
+
compile<N extends never, T extends SomeJTDSchemaType>(schema: T, _meta?: boolean): ValidateFunction<JTDDataType<T>>;
|
|
640
|
+
compile<T = unknown>(schema: AsyncSchema, _meta?: boolean): AsyncValidateFunction<T>;
|
|
641
|
+
compile<T = unknown>(schema: AnySchema, _meta?: boolean): AnyValidateFunction<T>;
|
|
642
|
+
compileAsync<T = unknown>(schema: SchemaObject | JSONSchemaType<T>, _meta?: boolean): Promise<ValidateFunction<T>>;
|
|
643
|
+
compileAsync<T = unknown>(schema: JTDSchemaType<T>, _meta?: boolean): Promise<ValidateFunction<T>>;
|
|
644
|
+
compileAsync<T = unknown>(schema: AsyncSchema, meta?: boolean): Promise<AsyncValidateFunction<T>>;
|
|
645
|
+
compileAsync<T = unknown>(schema: AnySchemaObject, meta?: boolean): Promise<AnyValidateFunction<T>>;
|
|
646
|
+
addSchema(schema: AnySchema | AnySchema[],
|
|
647
|
+
// If array is passed, `key` will be ignored
|
|
648
|
+
key?: string,
|
|
649
|
+
// Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.
|
|
650
|
+
_meta?: boolean,
|
|
651
|
+
// true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.
|
|
652
|
+
_validateSchema?: boolean | "log"): Ajv$1;
|
|
653
|
+
addMetaSchema(schema: AnySchemaObject, key?: string,
|
|
654
|
+
// schema key
|
|
655
|
+
_validateSchema?: boolean | "log"): Ajv$1;
|
|
656
|
+
validateSchema(schema: AnySchema, throwOrLogError?: boolean): boolean | Promise<unknown>;
|
|
657
|
+
getSchema<T = unknown>(keyRef: string): AnyValidateFunction<T> | undefined;
|
|
658
|
+
removeSchema(schemaKeyRef?: AnySchema | string | RegExp): Ajv$1;
|
|
659
|
+
addVocabulary(definitions: Vocabulary): Ajv$1;
|
|
660
|
+
addKeyword(kwdOrDef: string | KeywordDefinition, def?: KeywordDefinition): Ajv$1;
|
|
661
|
+
getKeyword(keyword: string): AddedKeywordDefinition | boolean;
|
|
662
|
+
removeKeyword(keyword: string): Ajv$1;
|
|
663
|
+
addFormat(name: string, format: Format): Ajv$1;
|
|
664
|
+
errorsText(errors?: ErrorObject[] | null | undefined,
|
|
665
|
+
// optional array of validation errors
|
|
666
|
+
{
|
|
667
|
+
separator,
|
|
668
|
+
dataVar
|
|
669
|
+
}?: ErrorsTextOptions): string;
|
|
670
|
+
$dataMetaSchema(metaSchema: AnySchemaObject, keywordsJsonPointers: string[]): AnySchemaObject;
|
|
671
|
+
private _removeAllSchemas;
|
|
672
|
+
_addSchema(schema: AnySchema, meta?: boolean, baseId?: string, validateSchema?: boolean | "log", addSchema?: boolean): SchemaEnv;
|
|
673
|
+
private _checkUnique;
|
|
674
|
+
private _compileSchemaEnv;
|
|
675
|
+
private _compileMetaSchema;
|
|
676
|
+
}
|
|
677
|
+
interface ErrorsTextOptions {
|
|
678
|
+
separator?: string;
|
|
679
|
+
dataVar?: string;
|
|
680
|
+
}
|
|
681
|
+
//#endregion
|
|
682
|
+
//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/resolve.d.ts
|
|
683
|
+
type LocalRefs = { [Ref in string]?: AnySchemaObject };
|
|
684
|
+
//#endregion
|
|
685
|
+
//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/index.d.ts
|
|
686
|
+
type SchemaRefs = { [Ref in string]?: SchemaEnv | AnySchema };
|
|
687
|
+
interface SchemaCxt {
|
|
688
|
+
readonly gen: CodeGen;
|
|
689
|
+
readonly allErrors?: boolean;
|
|
690
|
+
readonly data: Name;
|
|
691
|
+
readonly parentData: Name;
|
|
692
|
+
readonly parentDataProperty: Code | number;
|
|
693
|
+
readonly dataNames: Name[];
|
|
694
|
+
readonly dataPathArr: (Code | number)[];
|
|
695
|
+
readonly dataLevel: number;
|
|
696
|
+
dataTypes: JSONType$1[];
|
|
697
|
+
definedProperties: Set<string>;
|
|
698
|
+
readonly topSchemaRef: Code;
|
|
699
|
+
readonly validateName: Name;
|
|
700
|
+
evaluated?: Name;
|
|
701
|
+
readonly ValidationError?: Name;
|
|
702
|
+
readonly schema: AnySchema;
|
|
703
|
+
readonly schemaEnv: SchemaEnv;
|
|
704
|
+
readonly rootId: string;
|
|
705
|
+
baseId: string;
|
|
706
|
+
readonly schemaPath: Code;
|
|
707
|
+
readonly errSchemaPath: string;
|
|
708
|
+
readonly errorPath: Code;
|
|
709
|
+
readonly propertyName?: Name;
|
|
710
|
+
readonly compositeRule?: boolean;
|
|
711
|
+
props?: EvaluatedProperties | Name;
|
|
712
|
+
items?: EvaluatedItems | Name;
|
|
713
|
+
jtdDiscriminator?: string;
|
|
714
|
+
jtdMetadata?: boolean;
|
|
715
|
+
readonly createErrors?: boolean;
|
|
716
|
+
readonly opts: InstanceOptions;
|
|
717
|
+
readonly self: Ajv$1;
|
|
718
|
+
}
|
|
719
|
+
interface SchemaObjCxt extends SchemaCxt {
|
|
720
|
+
readonly schema: AnySchemaObject;
|
|
721
|
+
}
|
|
722
|
+
interface SchemaEnvArgs {
|
|
723
|
+
readonly schema: AnySchema;
|
|
724
|
+
readonly schemaId?: "$id" | "id";
|
|
725
|
+
readonly root?: SchemaEnv;
|
|
726
|
+
readonly baseId?: string;
|
|
727
|
+
readonly schemaPath?: string;
|
|
728
|
+
readonly localRefs?: LocalRefs;
|
|
729
|
+
readonly meta?: boolean;
|
|
730
|
+
}
|
|
731
|
+
declare class SchemaEnv implements SchemaEnvArgs {
|
|
732
|
+
readonly schema: AnySchema;
|
|
733
|
+
readonly schemaId?: "$id" | "id";
|
|
734
|
+
readonly root: SchemaEnv;
|
|
735
|
+
baseId: string;
|
|
736
|
+
schemaPath?: string;
|
|
737
|
+
localRefs?: LocalRefs;
|
|
738
|
+
readonly meta?: boolean;
|
|
739
|
+
readonly $async?: boolean;
|
|
740
|
+
readonly refs: SchemaRefs;
|
|
741
|
+
readonly dynamicAnchors: { [Ref in string]?: true };
|
|
742
|
+
validate?: AnyValidateFunction;
|
|
743
|
+
validateName?: ValueScopeName;
|
|
744
|
+
serialize?: (data: unknown) => string;
|
|
745
|
+
serializeName?: ValueScopeName;
|
|
746
|
+
parse?: (data: string) => unknown;
|
|
747
|
+
parseName?: ValueScopeName;
|
|
748
|
+
constructor(env: SchemaEnvArgs);
|
|
749
|
+
}
|
|
750
|
+
//#endregion
|
|
751
|
+
//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/types/index.d.ts
|
|
752
|
+
interface _SchemaObject {
|
|
753
|
+
id?: string;
|
|
754
|
+
$id?: string;
|
|
755
|
+
$schema?: string;
|
|
756
|
+
[x: string]: any;
|
|
757
|
+
}
|
|
758
|
+
interface SchemaObject extends _SchemaObject {
|
|
759
|
+
id?: string;
|
|
760
|
+
$id?: string;
|
|
761
|
+
$schema?: string;
|
|
762
|
+
$async?: false;
|
|
763
|
+
[x: string]: any;
|
|
764
|
+
}
|
|
765
|
+
interface AsyncSchema extends _SchemaObject {
|
|
766
|
+
$async: true;
|
|
767
|
+
}
|
|
768
|
+
type AnySchemaObject = SchemaObject | AsyncSchema;
|
|
769
|
+
type Schema = SchemaObject | boolean;
|
|
770
|
+
type AnySchema = Schema | AsyncSchema;
|
|
771
|
+
interface SourceCode {
|
|
772
|
+
validateName: ValueScopeName;
|
|
773
|
+
validateCode: string;
|
|
774
|
+
scopeValues: ScopeValueSets;
|
|
775
|
+
evaluated?: Code;
|
|
776
|
+
}
|
|
777
|
+
interface DataValidationCxt<T extends string | number = string | number> {
|
|
778
|
+
instancePath: string;
|
|
779
|
+
parentData: { [K in T]: any };
|
|
780
|
+
parentDataProperty: T;
|
|
781
|
+
rootData: Record<string, any> | any[];
|
|
782
|
+
dynamicAnchors: { [Ref in string]?: ValidateFunction };
|
|
783
|
+
}
|
|
784
|
+
interface ValidateFunction<T = unknown> {
|
|
785
|
+
(this: Ajv$1 | any, data: any, dataCxt?: DataValidationCxt): data is T;
|
|
786
|
+
errors?: null | ErrorObject[];
|
|
787
|
+
evaluated?: Evaluated;
|
|
788
|
+
schema: AnySchema;
|
|
789
|
+
schemaEnv: SchemaEnv;
|
|
790
|
+
source?: SourceCode;
|
|
791
|
+
}
|
|
792
|
+
type EvaluatedProperties = { [K in string]?: true } | true;
|
|
793
|
+
type EvaluatedItems = number | true;
|
|
794
|
+
interface Evaluated {
|
|
795
|
+
props?: EvaluatedProperties;
|
|
796
|
+
items?: EvaluatedItems;
|
|
797
|
+
dynamicProps: boolean;
|
|
798
|
+
dynamicItems: boolean;
|
|
799
|
+
}
|
|
800
|
+
interface AsyncValidateFunction<T = unknown> extends ValidateFunction<T> {
|
|
801
|
+
(...args: Parameters<ValidateFunction<T>>): Promise<T>;
|
|
802
|
+
$async: true;
|
|
803
|
+
}
|
|
804
|
+
type AnyValidateFunction<T = any> = ValidateFunction<T> | AsyncValidateFunction<T>;
|
|
805
|
+
interface ErrorObject<K$1 extends string = string, P = Record<string, any>, S = unknown> {
|
|
806
|
+
keyword: K$1;
|
|
807
|
+
instancePath: string;
|
|
808
|
+
schemaPath: string;
|
|
809
|
+
params: P;
|
|
810
|
+
propertyName?: string;
|
|
811
|
+
message?: string;
|
|
812
|
+
schema?: S;
|
|
813
|
+
parentSchema?: AnySchemaObject;
|
|
814
|
+
data?: unknown;
|
|
815
|
+
}
|
|
816
|
+
interface _KeywordDef {
|
|
817
|
+
keyword: string | string[];
|
|
818
|
+
type?: JSONType$1 | JSONType$1[];
|
|
819
|
+
schemaType?: JSONType$1 | JSONType$1[];
|
|
820
|
+
allowUndefined?: boolean;
|
|
821
|
+
$data?: boolean;
|
|
822
|
+
implements?: string[];
|
|
823
|
+
before?: string;
|
|
824
|
+
post?: boolean;
|
|
825
|
+
metaSchema?: AnySchemaObject;
|
|
826
|
+
validateSchema?: AnyValidateFunction;
|
|
827
|
+
dependencies?: string[];
|
|
828
|
+
error?: KeywordErrorDefinition;
|
|
829
|
+
$dataError?: KeywordErrorDefinition;
|
|
830
|
+
}
|
|
831
|
+
interface CodeKeywordDefinition extends _KeywordDef {
|
|
832
|
+
code: (cxt: KeywordCxt, ruleType?: string) => void;
|
|
833
|
+
trackErrors?: boolean;
|
|
834
|
+
}
|
|
835
|
+
type MacroKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaCxt) => AnySchema;
|
|
836
|
+
type CompileKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaObjCxt) => DataValidateFunction;
|
|
837
|
+
interface DataValidateFunction {
|
|
838
|
+
(...args: Parameters<ValidateFunction>): boolean | Promise<any>;
|
|
839
|
+
errors?: Partial<ErrorObject>[];
|
|
840
|
+
}
|
|
841
|
+
interface SchemaValidateFunction {
|
|
842
|
+
(schema: any, data: any, parentSchema?: AnySchemaObject, dataCxt?: DataValidationCxt): boolean | Promise<any>;
|
|
843
|
+
errors?: Partial<ErrorObject>[];
|
|
844
|
+
}
|
|
845
|
+
interface FuncKeywordDefinition extends _KeywordDef {
|
|
846
|
+
validate?: SchemaValidateFunction | DataValidateFunction;
|
|
847
|
+
compile?: CompileKeywordFunc;
|
|
848
|
+
schema?: boolean;
|
|
849
|
+
modifying?: boolean;
|
|
850
|
+
async?: boolean;
|
|
851
|
+
valid?: boolean;
|
|
852
|
+
errors?: boolean | "full";
|
|
853
|
+
}
|
|
854
|
+
interface MacroKeywordDefinition extends FuncKeywordDefinition {
|
|
855
|
+
macro: MacroKeywordFunc;
|
|
856
|
+
}
|
|
857
|
+
type KeywordDefinition = CodeKeywordDefinition | FuncKeywordDefinition | MacroKeywordDefinition;
|
|
858
|
+
type AddedKeywordDefinition = KeywordDefinition & {
|
|
859
|
+
type: JSONType$1[];
|
|
860
|
+
schemaType: JSONType$1[];
|
|
861
|
+
};
|
|
862
|
+
interface KeywordErrorDefinition {
|
|
863
|
+
message: string | Code | ((cxt: KeywordErrorCxt) => string | Code);
|
|
864
|
+
params?: Code | ((cxt: KeywordErrorCxt) => Code);
|
|
865
|
+
}
|
|
866
|
+
type Vocabulary = (KeywordDefinition | string)[];
|
|
867
|
+
interface KeywordErrorCxt {
|
|
868
|
+
gen: CodeGen;
|
|
869
|
+
keyword: string;
|
|
870
|
+
data: Name;
|
|
871
|
+
$data?: string | false;
|
|
872
|
+
schema: any;
|
|
873
|
+
parentSchema?: AnySchemaObject;
|
|
874
|
+
schemaCode: Code | number | boolean;
|
|
875
|
+
schemaValue: Code | number | boolean;
|
|
876
|
+
schemaType?: JSONType$1[];
|
|
877
|
+
errsCount?: Name;
|
|
878
|
+
params: KeywordCxtParams;
|
|
879
|
+
it: SchemaCxt;
|
|
880
|
+
}
|
|
881
|
+
type KeywordCxtParams = { [P in string]?: Code | string | number };
|
|
882
|
+
type FormatValidator<T extends string | number> = (data: T) => boolean;
|
|
883
|
+
type FormatCompare<T extends string | number> = (data1: T, data2: T) => number | undefined;
|
|
884
|
+
type AsyncFormatValidator<T extends string | number> = (data: T) => Promise<boolean>;
|
|
885
|
+
interface FormatDefinition<T extends string | number> {
|
|
886
|
+
type?: T extends string ? "string" | undefined : "number";
|
|
887
|
+
validate: FormatValidator<T> | (T extends string ? string | RegExp : never);
|
|
888
|
+
async?: false | undefined;
|
|
889
|
+
compare?: FormatCompare<T>;
|
|
890
|
+
}
|
|
891
|
+
interface AsyncFormatDefinition<T extends string | number> {
|
|
892
|
+
type?: T extends string ? "string" | undefined : "number";
|
|
893
|
+
validate: AsyncFormatValidator<T>;
|
|
894
|
+
async: true;
|
|
895
|
+
compare?: FormatCompare<T>;
|
|
896
|
+
}
|
|
897
|
+
type AddedFormat = true | RegExp | FormatValidator<string> | FormatDefinition<string> | FormatDefinition<number> | AsyncFormatDefinition<string> | AsyncFormatDefinition<number>;
|
|
898
|
+
type Format = AddedFormat | string;
|
|
899
|
+
interface RegExpEngine {
|
|
900
|
+
(pattern: string, u: string): RegExpLike;
|
|
901
|
+
code: string;
|
|
902
|
+
}
|
|
903
|
+
interface RegExpLike {
|
|
904
|
+
test: (s: string) => boolean;
|
|
905
|
+
}
|
|
906
|
+
interface UriResolver {
|
|
907
|
+
parse(uri: string): URIComponent;
|
|
908
|
+
resolve(base: string, path: string): string;
|
|
909
|
+
serialize(component: URIComponent): string;
|
|
910
|
+
}
|
|
911
|
+
//#endregion
|
|
912
|
+
//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/ajv.d.ts
|
|
913
|
+
declare class Ajv extends Ajv$1 {
|
|
914
|
+
_addVocabularies(): void;
|
|
915
|
+
_addDefaultMetaSchema(): void;
|
|
916
|
+
defaultMeta(): string | AnySchemaObject | undefined;
|
|
917
|
+
}
|
|
918
|
+
//#endregion
|
|
919
|
+
//#region ../../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/formats.d.ts
|
|
920
|
+
type FormatMode = "fast" | "full";
|
|
921
|
+
type FormatName = "date" | "time" | "date-time" | "iso-time" | "iso-date-time" | "duration" | "uri" | "uri-reference" | "uri-template" | "url" | "email" | "hostname" | "ipv4" | "ipv6" | "regex" | "uuid" | "json-pointer" | "json-pointer-uri-fragment" | "relative-json-pointer" | "byte" | "int32" | "int64" | "float" | "double" | "password" | "binary";
|
|
922
|
+
//#endregion
|
|
923
|
+
//#region ../../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/index.d.ts
|
|
924
|
+
interface FormatOptions {
|
|
925
|
+
mode?: FormatMode;
|
|
926
|
+
formats?: FormatName[];
|
|
927
|
+
keywords?: boolean;
|
|
928
|
+
}
|
|
929
|
+
type FormatsPluginOptions = FormatName[] | FormatOptions;
|
|
930
|
+
interface FormatsPlugin extends Plugin<FormatsPluginOptions> {
|
|
931
|
+
get: (format: FormatName, mode?: FormatMode) => Format;
|
|
932
|
+
}
|
|
933
|
+
declare const formatsPlugin: FormatsPlugin;
|
|
934
|
+
//#endregion
|
|
935
|
+
//#region ../core-internal/src/validators/ajvProvider.d.ts
|
|
936
|
+
/** Structural subset of the AJV interface used by {@link AjvJsonSchemaValidator}. */
|
|
937
|
+
interface AjvLike {
|
|
938
|
+
compile: (schema: unknown) => AjvValidateFunction;
|
|
939
|
+
getSchema: (keyRef: string) => AjvValidateFunction | undefined;
|
|
940
|
+
errorsText: (errors?: any) => string;
|
|
941
|
+
}
|
|
942
|
+
interface AjvValidateFunction {
|
|
943
|
+
(input: unknown): boolean;
|
|
944
|
+
errors?: any;
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* AJV-backed JSON Schema validator. See `@modelcontextprotocol/{client,server}/validators/ajv`
|
|
948
|
+
* for the customisation entry point (re-exports `Ajv` and `addFormats` from the bundled copy).
|
|
949
|
+
*
|
|
950
|
+
* @example Use with default configuration
|
|
951
|
+
* ```ts source="./ajvProvider.examples.ts#AjvJsonSchemaValidator_default"
|
|
952
|
+
* const validator = new AjvJsonSchemaValidator();
|
|
953
|
+
* ```
|
|
954
|
+
*
|
|
955
|
+
* @example Use with a custom AJV instance
|
|
956
|
+
* ```ts source="./ajvProvider.examples.ts#AjvJsonSchemaValidator_customInstance"
|
|
957
|
+
* const ajv = new Ajv({ strict: true, allErrors: true });
|
|
958
|
+
* const validator = new AjvJsonSchemaValidator(ajv);
|
|
959
|
+
* ```
|
|
960
|
+
*
|
|
961
|
+
* @example Register ajv-formats
|
|
962
|
+
* ```ts source="./ajvProvider.examples.ts#AjvJsonSchemaValidator_withFormats"
|
|
963
|
+
* const ajv = new Ajv({ strict: true, allErrors: true });
|
|
964
|
+
* addFormats(ajv);
|
|
965
|
+
* const validator = new AjvJsonSchemaValidator(ajv);
|
|
966
|
+
* ```
|
|
967
|
+
*/
|
|
968
|
+
declare class AjvJsonSchemaValidator implements jsonSchemaValidator {
|
|
969
|
+
private _ajv;
|
|
970
|
+
/**
|
|
971
|
+
* @param ajv - Optional pre-configured AJV-compatible instance. If omitted, a default instance is
|
|
972
|
+
* created with `strict: false`, `validateFormats: true`, `validateSchema: false`, `allErrors: true`,
|
|
973
|
+
* and `ajv-formats` registered. The parameter is typed structurally so consumers who don't pass
|
|
974
|
+
* an instance need not have `ajv` installed.
|
|
975
|
+
*/
|
|
976
|
+
constructor(ajv?: AjvLike);
|
|
977
|
+
getValidator<T>(schema: JsonSchemaType): JsonSchemaValidator<T>;
|
|
978
|
+
}
|
|
979
|
+
/** `ajv-formats` default export, normalised through the CJS/ESM interop wrapper. */
|
|
980
|
+
declare const addFormats: typeof formatsPlugin.default;
|
|
981
|
+
//#endregion
|
|
982
|
+
export { addFormats as n, Ajv as r, AjvJsonSchemaValidator as t };
|
|
983
|
+
//# sourceMappingURL=ajvProvider-DZ_siXcF.d.mts.map
|