vanta-auditor-api-sdk 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FUNCTIONS.md +5 -22
- package/README.md +36 -51
- package/bin/mcp-server.js +1159 -1023
- package/bin/mcp-server.js.map +39 -29
- package/docs/sdks/auditors/README.md +7 -11
- package/docs/sdks/audits/README.md +67 -101
- package/examples/README.md +31 -0
- package/examples/auditsList.example.ts +26 -0
- package/examples/package-lock.json +626 -0
- package/examples/package.json +18 -0
- package/funcs/auditorsCreate.d.ts +3 -2
- package/funcs/auditorsCreate.d.ts.map +1 -1
- package/funcs/auditorsCreate.js +3 -1
- package/funcs/auditorsCreate.js.map +1 -1
- package/funcs/auditsCreateCommentForEvidence.d.ts +3 -2
- package/funcs/auditsCreateCommentForEvidence.d.ts.map +1 -1
- package/funcs/auditsCreateCommentForEvidence.js +3 -1
- package/funcs/auditsCreateCommentForEvidence.js.map +1 -1
- package/funcs/auditsCreateCustomControl.d.ts +3 -2
- package/funcs/auditsCreateCustomControl.d.ts.map +1 -1
- package/funcs/auditsCreateCustomControl.js +3 -1
- package/funcs/auditsCreateCustomControl.js.map +1 -1
- package/funcs/auditsCreateCustomEvidenceRequest.d.ts +3 -2
- package/funcs/auditsCreateCustomEvidenceRequest.d.ts.map +1 -1
- package/funcs/auditsCreateCustomEvidenceRequest.js +3 -1
- package/funcs/auditsCreateCustomEvidenceRequest.js.map +1 -1
- package/funcs/auditsGetEvidenceUrls.d.ts +3 -2
- package/funcs/auditsGetEvidenceUrls.d.ts.map +1 -1
- package/funcs/auditsGetEvidenceUrls.js +3 -1
- package/funcs/auditsGetEvidenceUrls.js.map +1 -1
- package/funcs/auditsList.d.ts +3 -2
- package/funcs/auditsList.d.ts.map +1 -1
- package/funcs/auditsList.js +4 -1
- package/funcs/auditsList.js.map +1 -1
- package/funcs/auditsListComments.d.ts +3 -2
- package/funcs/auditsListComments.d.ts.map +1 -1
- package/funcs/auditsListComments.js +3 -1
- package/funcs/auditsListComments.js.map +1 -1
- package/funcs/auditsListControls.d.ts +3 -2
- package/funcs/auditsListControls.d.ts.map +1 -1
- package/funcs/auditsListControls.js +3 -1
- package/funcs/auditsListControls.js.map +1 -1
- package/funcs/auditsListEvidence.d.ts +3 -2
- package/funcs/auditsListEvidence.d.ts.map +1 -1
- package/funcs/auditsListEvidence.js +3 -1
- package/funcs/auditsListEvidence.js.map +1 -1
- package/funcs/auditsUpdateEvidence.d.ts +3 -2
- package/funcs/auditsUpdateEvidence.d.ts.map +1 -1
- package/funcs/auditsUpdateEvidence.js +3 -1
- package/funcs/auditsUpdateEvidence.js.map +1 -1
- package/hooks/types.d.ts +2 -0
- package/hooks/types.d.ts.map +1 -1
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +7 -3
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/lib/files.d.ts +5 -0
- package/lib/files.d.ts.map +1 -1
- package/lib/files.js +41 -0
- package/lib/files.js.map +1 -1
- package/lib/matchers.d.ts +3 -10
- package/lib/matchers.d.ts.map +1 -1
- package/lib/matchers.js +33 -31
- package/lib/matchers.js.map +1 -1
- package/lib/sdks.d.ts +4 -1
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +9 -14
- package/lib/sdks.js.map +1 -1
- package/lib/security.d.ts +2 -2
- package/lib/security.d.ts.map +1 -1
- package/mcp-server/cli/start/command.d.ts.map +1 -1
- package/mcp-server/cli/start/command.js +0 -12
- package/mcp-server/cli/start/command.js.map +1 -1
- package/mcp-server/cli/start/impl.d.ts +0 -2
- package/mcp-server/cli/start/impl.d.ts.map +1 -1
- package/mcp-server/cli/start/impl.js +2 -4
- package/mcp-server/cli/start/impl.js.map +1 -1
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.js +1 -1
- package/models/components/audit.d.ts +5 -2
- package/models/components/audit.d.ts.map +1 -1
- package/models/components/audit.js +5 -2
- package/models/components/audit.js.map +1 -1
- package/models/components/auditfocus.d.ts +28 -0
- package/models/components/auditfocus.d.ts.map +1 -0
- package/models/components/auditfocus.js +61 -0
- package/models/components/auditfocus.js.map +1 -0
- package/models/components/index.d.ts +1 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +1 -0
- package/models/components/index.js.map +1 -1
- package/models/errors/apierror.d.ts +8 -6
- package/models/errors/apierror.d.ts.map +1 -1
- package/models/errors/apierror.js +23 -10
- package/models/errors/apierror.js.map +1 -1
- package/models/errors/index.d.ts +1 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +1 -0
- package/models/errors/index.js.map +1 -1
- package/models/errors/responsevalidationerror.d.ts +26 -0
- package/models/errors/responsevalidationerror.d.ts.map +1 -0
- package/models/errors/responsevalidationerror.js +66 -0
- package/models/errors/responsevalidationerror.js.map +1 -0
- package/models/errors/sdkvalidationerror.d.ts +1 -0
- package/models/errors/sdkvalidationerror.d.ts.map +1 -1
- package/models/errors/sdkvalidationerror.js +14 -0
- package/models/errors/sdkvalidationerror.js.map +1 -1
- package/models/errors/vantaerror.d.ts +19 -0
- package/models/errors/vantaerror.d.ts.map +1 -0
- package/models/errors/vantaerror.js +20 -0
- package/models/errors/vantaerror.js.map +1 -0
- package/models/operations/listaudits.d.ts +5 -0
- package/models/operations/listaudits.d.ts.map +1 -1
- package/models/operations/listaudits.js +2 -0
- package/models/operations/listaudits.js.map +1 -1
- package/package.json +7 -7
- package/src/funcs/auditorsCreate.ts +23 -17
- package/src/funcs/auditsCreateCommentForEvidence.ts +23 -17
- package/src/funcs/auditsCreateCustomControl.ts +23 -17
- package/src/funcs/auditsCreateCustomEvidenceRequest.ts +23 -17
- package/src/funcs/auditsGetEvidenceUrls.ts +23 -17
- package/src/funcs/auditsList.ts +24 -17
- package/src/funcs/auditsListComments.ts +23 -17
- package/src/funcs/auditsListControls.ts +23 -17
- package/src/funcs/auditsListEvidence.ts +23 -17
- package/src/funcs/auditsUpdateEvidence.ts +23 -17
- package/src/hooks/types.ts +2 -0
- package/src/index.ts +2 -0
- package/src/lib/config.ts +7 -3
- package/src/lib/files.ts +42 -0
- package/src/lib/matchers.ts +44 -41
- package/src/lib/sdks.ts +21 -15
- package/src/lib/security.ts +2 -2
- package/src/mcp-server/cli/start/command.ts +0 -13
- package/src/mcp-server/cli/start/impl.ts +2 -6
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/components/audit.ts +13 -4
- package/src/models/components/auditfocus.ts +31 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/errors/apierror.ts +29 -16
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/responsevalidationerror.ts +50 -0
- package/src/models/errors/sdkvalidationerror.ts +12 -0
- package/src/models/errors/vantaerror.ts +35 -0
- package/src/models/operations/listaudits.ts +7 -0
- package/src/types/constdatetime.ts +1 -1
- package/types/constdatetime.js +1 -1
package/bin/mcp-server.js
CHANGED
|
@@ -29,13 +29,379 @@ var __export = (target, all) => {
|
|
|
29
29
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
30
30
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
31
31
|
|
|
32
|
-
// node_modules/zod/
|
|
32
|
+
// node_modules/zod/v3/helpers/util.js
|
|
33
|
+
var util, objectUtil, ZodParsedType, getParsedType = (data) => {
|
|
34
|
+
const t = typeof data;
|
|
35
|
+
switch (t) {
|
|
36
|
+
case "undefined":
|
|
37
|
+
return ZodParsedType.undefined;
|
|
38
|
+
case "string":
|
|
39
|
+
return ZodParsedType.string;
|
|
40
|
+
case "number":
|
|
41
|
+
return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
42
|
+
case "boolean":
|
|
43
|
+
return ZodParsedType.boolean;
|
|
44
|
+
case "function":
|
|
45
|
+
return ZodParsedType.function;
|
|
46
|
+
case "bigint":
|
|
47
|
+
return ZodParsedType.bigint;
|
|
48
|
+
case "symbol":
|
|
49
|
+
return ZodParsedType.symbol;
|
|
50
|
+
case "object":
|
|
51
|
+
if (Array.isArray(data)) {
|
|
52
|
+
return ZodParsedType.array;
|
|
53
|
+
}
|
|
54
|
+
if (data === null) {
|
|
55
|
+
return ZodParsedType.null;
|
|
56
|
+
}
|
|
57
|
+
if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
|
|
58
|
+
return ZodParsedType.promise;
|
|
59
|
+
}
|
|
60
|
+
if (typeof Map !== "undefined" && data instanceof Map) {
|
|
61
|
+
return ZodParsedType.map;
|
|
62
|
+
}
|
|
63
|
+
if (typeof Set !== "undefined" && data instanceof Set) {
|
|
64
|
+
return ZodParsedType.set;
|
|
65
|
+
}
|
|
66
|
+
if (typeof Date !== "undefined" && data instanceof Date) {
|
|
67
|
+
return ZodParsedType.date;
|
|
68
|
+
}
|
|
69
|
+
return ZodParsedType.object;
|
|
70
|
+
default:
|
|
71
|
+
return ZodParsedType.unknown;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var init_util = __esm(() => {
|
|
75
|
+
(function(util2) {
|
|
76
|
+
util2.assertEqual = (_2) => {};
|
|
77
|
+
function assertIs(_arg) {}
|
|
78
|
+
util2.assertIs = assertIs;
|
|
79
|
+
function assertNever(_x) {
|
|
80
|
+
throw new Error;
|
|
81
|
+
}
|
|
82
|
+
util2.assertNever = assertNever;
|
|
83
|
+
util2.arrayToEnum = (items) => {
|
|
84
|
+
const obj = {};
|
|
85
|
+
for (const item of items) {
|
|
86
|
+
obj[item] = item;
|
|
87
|
+
}
|
|
88
|
+
return obj;
|
|
89
|
+
};
|
|
90
|
+
util2.getValidEnumValues = (obj) => {
|
|
91
|
+
const validKeys = util2.objectKeys(obj).filter((k2) => typeof obj[obj[k2]] !== "number");
|
|
92
|
+
const filtered = {};
|
|
93
|
+
for (const k2 of validKeys) {
|
|
94
|
+
filtered[k2] = obj[k2];
|
|
95
|
+
}
|
|
96
|
+
return util2.objectValues(filtered);
|
|
97
|
+
};
|
|
98
|
+
util2.objectValues = (obj) => {
|
|
99
|
+
return util2.objectKeys(obj).map(function(e) {
|
|
100
|
+
return obj[e];
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
|
|
104
|
+
const keys = [];
|
|
105
|
+
for (const key in object) {
|
|
106
|
+
if (Object.prototype.hasOwnProperty.call(object, key)) {
|
|
107
|
+
keys.push(key);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return keys;
|
|
111
|
+
};
|
|
112
|
+
util2.find = (arr, checker) => {
|
|
113
|
+
for (const item of arr) {
|
|
114
|
+
if (checker(item))
|
|
115
|
+
return item;
|
|
116
|
+
}
|
|
117
|
+
return;
|
|
118
|
+
};
|
|
119
|
+
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
|
|
120
|
+
function joinValues(array, separator = " | ") {
|
|
121
|
+
return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
122
|
+
}
|
|
123
|
+
util2.joinValues = joinValues;
|
|
124
|
+
util2.jsonStringifyReplacer = (_2, value) => {
|
|
125
|
+
if (typeof value === "bigint") {
|
|
126
|
+
return value.toString();
|
|
127
|
+
}
|
|
128
|
+
return value;
|
|
129
|
+
};
|
|
130
|
+
})(util || (util = {}));
|
|
131
|
+
(function(objectUtil2) {
|
|
132
|
+
objectUtil2.mergeShapes = (first, second) => {
|
|
133
|
+
return {
|
|
134
|
+
...first,
|
|
135
|
+
...second
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
})(objectUtil || (objectUtil = {}));
|
|
139
|
+
ZodParsedType = util.arrayToEnum([
|
|
140
|
+
"string",
|
|
141
|
+
"nan",
|
|
142
|
+
"number",
|
|
143
|
+
"integer",
|
|
144
|
+
"float",
|
|
145
|
+
"boolean",
|
|
146
|
+
"date",
|
|
147
|
+
"bigint",
|
|
148
|
+
"symbol",
|
|
149
|
+
"function",
|
|
150
|
+
"undefined",
|
|
151
|
+
"null",
|
|
152
|
+
"array",
|
|
153
|
+
"object",
|
|
154
|
+
"unknown",
|
|
155
|
+
"promise",
|
|
156
|
+
"void",
|
|
157
|
+
"never",
|
|
158
|
+
"map",
|
|
159
|
+
"set"
|
|
160
|
+
]);
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
// node_modules/zod/v3/ZodError.js
|
|
164
|
+
var ZodIssueCode, quotelessJson = (obj) => {
|
|
165
|
+
const json = JSON.stringify(obj, null, 2);
|
|
166
|
+
return json.replace(/"([^"]+)":/g, "$1:");
|
|
167
|
+
}, ZodError;
|
|
168
|
+
var init_ZodError = __esm(() => {
|
|
169
|
+
init_util();
|
|
170
|
+
ZodIssueCode = util.arrayToEnum([
|
|
171
|
+
"invalid_type",
|
|
172
|
+
"invalid_literal",
|
|
173
|
+
"custom",
|
|
174
|
+
"invalid_union",
|
|
175
|
+
"invalid_union_discriminator",
|
|
176
|
+
"invalid_enum_value",
|
|
177
|
+
"unrecognized_keys",
|
|
178
|
+
"invalid_arguments",
|
|
179
|
+
"invalid_return_type",
|
|
180
|
+
"invalid_date",
|
|
181
|
+
"invalid_string",
|
|
182
|
+
"too_small",
|
|
183
|
+
"too_big",
|
|
184
|
+
"invalid_intersection_types",
|
|
185
|
+
"not_multiple_of",
|
|
186
|
+
"not_finite"
|
|
187
|
+
]);
|
|
188
|
+
ZodError = class ZodError extends Error {
|
|
189
|
+
get errors() {
|
|
190
|
+
return this.issues;
|
|
191
|
+
}
|
|
192
|
+
constructor(issues) {
|
|
193
|
+
super();
|
|
194
|
+
this.issues = [];
|
|
195
|
+
this.addIssue = (sub) => {
|
|
196
|
+
this.issues = [...this.issues, sub];
|
|
197
|
+
};
|
|
198
|
+
this.addIssues = (subs = []) => {
|
|
199
|
+
this.issues = [...this.issues, ...subs];
|
|
200
|
+
};
|
|
201
|
+
const actualProto = new.target.prototype;
|
|
202
|
+
if (Object.setPrototypeOf) {
|
|
203
|
+
Object.setPrototypeOf(this, actualProto);
|
|
204
|
+
} else {
|
|
205
|
+
this.__proto__ = actualProto;
|
|
206
|
+
}
|
|
207
|
+
this.name = "ZodError";
|
|
208
|
+
this.issues = issues;
|
|
209
|
+
}
|
|
210
|
+
format(_mapper) {
|
|
211
|
+
const mapper = _mapper || function(issue) {
|
|
212
|
+
return issue.message;
|
|
213
|
+
};
|
|
214
|
+
const fieldErrors = { _errors: [] };
|
|
215
|
+
const processError = (error) => {
|
|
216
|
+
for (const issue of error.issues) {
|
|
217
|
+
if (issue.code === "invalid_union") {
|
|
218
|
+
issue.unionErrors.map(processError);
|
|
219
|
+
} else if (issue.code === "invalid_return_type") {
|
|
220
|
+
processError(issue.returnTypeError);
|
|
221
|
+
} else if (issue.code === "invalid_arguments") {
|
|
222
|
+
processError(issue.argumentsError);
|
|
223
|
+
} else if (issue.path.length === 0) {
|
|
224
|
+
fieldErrors._errors.push(mapper(issue));
|
|
225
|
+
} else {
|
|
226
|
+
let curr = fieldErrors;
|
|
227
|
+
let i = 0;
|
|
228
|
+
while (i < issue.path.length) {
|
|
229
|
+
const el = issue.path[i];
|
|
230
|
+
const terminal = i === issue.path.length - 1;
|
|
231
|
+
if (!terminal) {
|
|
232
|
+
curr[el] = curr[el] || { _errors: [] };
|
|
233
|
+
} else {
|
|
234
|
+
curr[el] = curr[el] || { _errors: [] };
|
|
235
|
+
curr[el]._errors.push(mapper(issue));
|
|
236
|
+
}
|
|
237
|
+
curr = curr[el];
|
|
238
|
+
i++;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
processError(this);
|
|
244
|
+
return fieldErrors;
|
|
245
|
+
}
|
|
246
|
+
static assert(value) {
|
|
247
|
+
if (!(value instanceof ZodError)) {
|
|
248
|
+
throw new Error(`Not a ZodError: ${value}`);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
toString() {
|
|
252
|
+
return this.message;
|
|
253
|
+
}
|
|
254
|
+
get message() {
|
|
255
|
+
return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
|
|
256
|
+
}
|
|
257
|
+
get isEmpty() {
|
|
258
|
+
return this.issues.length === 0;
|
|
259
|
+
}
|
|
260
|
+
flatten(mapper = (issue) => issue.message) {
|
|
261
|
+
const fieldErrors = {};
|
|
262
|
+
const formErrors = [];
|
|
263
|
+
for (const sub of this.issues) {
|
|
264
|
+
if (sub.path.length > 0) {
|
|
265
|
+
const firstEl = sub.path[0];
|
|
266
|
+
fieldErrors[firstEl] = fieldErrors[firstEl] || [];
|
|
267
|
+
fieldErrors[firstEl].push(mapper(sub));
|
|
268
|
+
} else {
|
|
269
|
+
formErrors.push(mapper(sub));
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return { formErrors, fieldErrors };
|
|
273
|
+
}
|
|
274
|
+
get formErrors() {
|
|
275
|
+
return this.flatten();
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
ZodError.create = (issues) => {
|
|
279
|
+
const error = new ZodError(issues);
|
|
280
|
+
return error;
|
|
281
|
+
};
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
// node_modules/zod/v3/locales/en.js
|
|
285
|
+
var errorMap = (issue, _ctx) => {
|
|
286
|
+
let message;
|
|
287
|
+
switch (issue.code) {
|
|
288
|
+
case ZodIssueCode.invalid_type:
|
|
289
|
+
if (issue.received === ZodParsedType.undefined) {
|
|
290
|
+
message = "Required";
|
|
291
|
+
} else {
|
|
292
|
+
message = `Expected ${issue.expected}, received ${issue.received}`;
|
|
293
|
+
}
|
|
294
|
+
break;
|
|
295
|
+
case ZodIssueCode.invalid_literal:
|
|
296
|
+
message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
|
|
297
|
+
break;
|
|
298
|
+
case ZodIssueCode.unrecognized_keys:
|
|
299
|
+
message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
|
|
300
|
+
break;
|
|
301
|
+
case ZodIssueCode.invalid_union:
|
|
302
|
+
message = `Invalid input`;
|
|
303
|
+
break;
|
|
304
|
+
case ZodIssueCode.invalid_union_discriminator:
|
|
305
|
+
message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
|
|
306
|
+
break;
|
|
307
|
+
case ZodIssueCode.invalid_enum_value:
|
|
308
|
+
message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
|
|
309
|
+
break;
|
|
310
|
+
case ZodIssueCode.invalid_arguments:
|
|
311
|
+
message = `Invalid function arguments`;
|
|
312
|
+
break;
|
|
313
|
+
case ZodIssueCode.invalid_return_type:
|
|
314
|
+
message = `Invalid function return type`;
|
|
315
|
+
break;
|
|
316
|
+
case ZodIssueCode.invalid_date:
|
|
317
|
+
message = `Invalid date`;
|
|
318
|
+
break;
|
|
319
|
+
case ZodIssueCode.invalid_string:
|
|
320
|
+
if (typeof issue.validation === "object") {
|
|
321
|
+
if ("includes" in issue.validation) {
|
|
322
|
+
message = `Invalid input: must include "${issue.validation.includes}"`;
|
|
323
|
+
if (typeof issue.validation.position === "number") {
|
|
324
|
+
message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
|
|
325
|
+
}
|
|
326
|
+
} else if ("startsWith" in issue.validation) {
|
|
327
|
+
message = `Invalid input: must start with "${issue.validation.startsWith}"`;
|
|
328
|
+
} else if ("endsWith" in issue.validation) {
|
|
329
|
+
message = `Invalid input: must end with "${issue.validation.endsWith}"`;
|
|
330
|
+
} else {
|
|
331
|
+
util.assertNever(issue.validation);
|
|
332
|
+
}
|
|
333
|
+
} else if (issue.validation !== "regex") {
|
|
334
|
+
message = `Invalid ${issue.validation}`;
|
|
335
|
+
} else {
|
|
336
|
+
message = "Invalid";
|
|
337
|
+
}
|
|
338
|
+
break;
|
|
339
|
+
case ZodIssueCode.too_small:
|
|
340
|
+
if (issue.type === "array")
|
|
341
|
+
message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
|
|
342
|
+
else if (issue.type === "string")
|
|
343
|
+
message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
|
344
|
+
else if (issue.type === "number")
|
|
345
|
+
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
346
|
+
else if (issue.type === "bigint")
|
|
347
|
+
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
348
|
+
else if (issue.type === "date")
|
|
349
|
+
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
|
|
350
|
+
else
|
|
351
|
+
message = "Invalid input";
|
|
352
|
+
break;
|
|
353
|
+
case ZodIssueCode.too_big:
|
|
354
|
+
if (issue.type === "array")
|
|
355
|
+
message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
|
|
356
|
+
else if (issue.type === "string")
|
|
357
|
+
message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
|
|
358
|
+
else if (issue.type === "number")
|
|
359
|
+
message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
|
360
|
+
else if (issue.type === "bigint")
|
|
361
|
+
message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
|
362
|
+
else if (issue.type === "date")
|
|
363
|
+
message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
|
|
364
|
+
else
|
|
365
|
+
message = "Invalid input";
|
|
366
|
+
break;
|
|
367
|
+
case ZodIssueCode.custom:
|
|
368
|
+
message = `Invalid input`;
|
|
369
|
+
break;
|
|
370
|
+
case ZodIssueCode.invalid_intersection_types:
|
|
371
|
+
message = `Intersection results could not be merged`;
|
|
372
|
+
break;
|
|
373
|
+
case ZodIssueCode.not_multiple_of:
|
|
374
|
+
message = `Number must be a multiple of ${issue.multipleOf}`;
|
|
375
|
+
break;
|
|
376
|
+
case ZodIssueCode.not_finite:
|
|
377
|
+
message = "Number must be finite";
|
|
378
|
+
break;
|
|
379
|
+
default:
|
|
380
|
+
message = _ctx.defaultError;
|
|
381
|
+
util.assertNever(issue);
|
|
382
|
+
}
|
|
383
|
+
return { message };
|
|
384
|
+
}, en_default;
|
|
385
|
+
var init_en = __esm(() => {
|
|
386
|
+
init_ZodError();
|
|
387
|
+
init_util();
|
|
388
|
+
en_default = errorMap;
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
// node_modules/zod/v3/errors.js
|
|
33
392
|
function setErrorMap(map) {
|
|
34
393
|
overrideErrorMap = map;
|
|
35
394
|
}
|
|
36
395
|
function getErrorMap() {
|
|
37
396
|
return overrideErrorMap;
|
|
38
397
|
}
|
|
398
|
+
var overrideErrorMap;
|
|
399
|
+
var init_errors = __esm(() => {
|
|
400
|
+
init_en();
|
|
401
|
+
overrideErrorMap = en_default;
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
// node_modules/zod/v3/helpers/parseUtil.js
|
|
39
405
|
function addIssueToContext(ctx, issueData) {
|
|
40
406
|
const overrideMap = getErrorMap();
|
|
41
407
|
const issue = makeIssue({
|
|
@@ -46,7 +412,7 @@ function addIssueToContext(ctx, issueData) {
|
|
|
46
412
|
ctx.common.contextualErrorMap,
|
|
47
413
|
ctx.schemaErrorMap,
|
|
48
414
|
overrideMap,
|
|
49
|
-
overrideMap ===
|
|
415
|
+
overrideMap === en_default ? undefined : en_default
|
|
50
416
|
].filter((x2) => !!x2)
|
|
51
417
|
});
|
|
52
418
|
ctx.common.issues.push(issue);
|
|
@@ -106,23 +472,53 @@ class ParseStatus {
|
|
|
106
472
|
return { status: status.value, value: finalObject };
|
|
107
473
|
}
|
|
108
474
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
475
|
+
var makeIssue = (params) => {
|
|
476
|
+
const { data, path, errorMaps, issueData } = params;
|
|
477
|
+
const fullPath = [...path, ...issueData.path || []];
|
|
478
|
+
const fullIssue = {
|
|
479
|
+
...issueData,
|
|
480
|
+
path: fullPath
|
|
481
|
+
};
|
|
482
|
+
if (issueData.message !== undefined) {
|
|
483
|
+
return {
|
|
484
|
+
...issueData,
|
|
485
|
+
path: fullPath,
|
|
486
|
+
message: issueData.message
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
let errorMessage = "";
|
|
490
|
+
const maps = errorMaps.filter((m) => !!m).slice().reverse();
|
|
491
|
+
for (const map of maps) {
|
|
492
|
+
errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
|
|
493
|
+
}
|
|
494
|
+
return {
|
|
495
|
+
...issueData,
|
|
496
|
+
path: fullPath,
|
|
497
|
+
message: errorMessage
|
|
498
|
+
};
|
|
499
|
+
}, EMPTY_PATH, INVALID, DIRTY = (value) => ({ status: "dirty", value }), OK = (value) => ({ status: "valid", value }), isAborted = (x2) => x2.status === "aborted", isDirty = (x2) => x2.status === "dirty", isValid = (x2) => x2.status === "valid", isAsync = (x2) => typeof Promise !== "undefined" && x2 instanceof Promise;
|
|
500
|
+
var init_parseUtil = __esm(() => {
|
|
501
|
+
init_errors();
|
|
502
|
+
init_en();
|
|
503
|
+
EMPTY_PATH = [];
|
|
504
|
+
INVALID = Object.freeze({
|
|
505
|
+
status: "aborted"
|
|
506
|
+
});
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
// node_modules/zod/v3/helpers/typeAliases.js
|
|
510
|
+
var init_typeAliases = () => {};
|
|
125
511
|
|
|
512
|
+
// node_modules/zod/v3/helpers/errorUtil.js
|
|
513
|
+
var errorUtil;
|
|
514
|
+
var init_errorUtil = __esm(() => {
|
|
515
|
+
(function(errorUtil2) {
|
|
516
|
+
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
517
|
+
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
518
|
+
})(errorUtil || (errorUtil = {}));
|
|
519
|
+
});
|
|
520
|
+
|
|
521
|
+
// node_modules/zod/v3/types.js
|
|
126
522
|
class ParseInputLazyPath {
|
|
127
523
|
constructor(parent, value, path, key) {
|
|
128
524
|
this._cachedPath = [];
|
|
@@ -133,7 +529,7 @@ class ParseInputLazyPath {
|
|
|
133
529
|
}
|
|
134
530
|
get path() {
|
|
135
531
|
if (!this._cachedPath.length) {
|
|
136
|
-
if (this._key
|
|
532
|
+
if (Array.isArray(this._key)) {
|
|
137
533
|
this._cachedPath.push(...this._path, ...this._key);
|
|
138
534
|
} else {
|
|
139
535
|
this._cachedPath.push(...this._path, this._key);
|
|
@@ -152,17 +548,16 @@ function processCreateParams(params) {
|
|
|
152
548
|
if (errorMap2)
|
|
153
549
|
return { errorMap: errorMap2, description };
|
|
154
550
|
const customMap = (iss, ctx) => {
|
|
155
|
-
var _a, _b;
|
|
156
551
|
const { message } = params;
|
|
157
552
|
if (iss.code === "invalid_enum_value") {
|
|
158
|
-
return { message: message
|
|
553
|
+
return { message: message ?? ctx.defaultError };
|
|
159
554
|
}
|
|
160
555
|
if (typeof ctx.data === "undefined") {
|
|
161
|
-
return { message:
|
|
556
|
+
return { message: message ?? required_error ?? ctx.defaultError };
|
|
162
557
|
}
|
|
163
558
|
if (iss.code !== "invalid_type")
|
|
164
559
|
return { message: ctx.defaultError };
|
|
165
|
-
return { message:
|
|
560
|
+
return { message: message ?? invalid_type_error ?? ctx.defaultError };
|
|
166
561
|
};
|
|
167
562
|
return { errorMap: customMap, description };
|
|
168
563
|
}
|
|
@@ -215,14 +610,13 @@ class ZodType {
|
|
|
215
610
|
throw result.error;
|
|
216
611
|
}
|
|
217
612
|
safeParse(data, params) {
|
|
218
|
-
var _a;
|
|
219
613
|
const ctx = {
|
|
220
614
|
common: {
|
|
221
615
|
issues: [],
|
|
222
|
-
async:
|
|
223
|
-
contextualErrorMap: params
|
|
616
|
+
async: params?.async ?? false,
|
|
617
|
+
contextualErrorMap: params?.errorMap
|
|
224
618
|
},
|
|
225
|
-
path:
|
|
619
|
+
path: params?.path || [],
|
|
226
620
|
schemaErrorMap: this._def.errorMap,
|
|
227
621
|
parent: null,
|
|
228
622
|
data,
|
|
@@ -232,7 +626,6 @@ class ZodType {
|
|
|
232
626
|
return handleResult(ctx, result);
|
|
233
627
|
}
|
|
234
628
|
"~validate"(data) {
|
|
235
|
-
var _a, _b;
|
|
236
629
|
const ctx = {
|
|
237
630
|
common: {
|
|
238
631
|
issues: [],
|
|
@@ -253,7 +646,7 @@ class ZodType {
|
|
|
253
646
|
issues: ctx.common.issues
|
|
254
647
|
};
|
|
255
648
|
} catch (err) {
|
|
256
|
-
if (
|
|
649
|
+
if (err?.message?.toLowerCase()?.includes("encountered")) {
|
|
257
650
|
this["~standard"].async = true;
|
|
258
651
|
}
|
|
259
652
|
ctx.common = {
|
|
@@ -278,10 +671,10 @@ class ZodType {
|
|
|
278
671
|
const ctx = {
|
|
279
672
|
common: {
|
|
280
673
|
issues: [],
|
|
281
|
-
contextualErrorMap: params
|
|
674
|
+
contextualErrorMap: params?.errorMap,
|
|
282
675
|
async: true
|
|
283
676
|
},
|
|
284
|
-
path:
|
|
677
|
+
path: params?.path || [],
|
|
285
678
|
schemaErrorMap: this._def.errorMap,
|
|
286
679
|
parent: null,
|
|
287
680
|
data,
|
|
@@ -453,13 +846,14 @@ class ZodType {
|
|
|
453
846
|
}
|
|
454
847
|
}
|
|
455
848
|
function timeRegexSource(args) {
|
|
456
|
-
let
|
|
849
|
+
let secondsRegexSource = `[0-5]\\d`;
|
|
457
850
|
if (args.precision) {
|
|
458
|
-
|
|
851
|
+
secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
|
|
459
852
|
} else if (args.precision == null) {
|
|
460
|
-
|
|
853
|
+
secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
|
|
461
854
|
}
|
|
462
|
-
|
|
855
|
+
const secondsQuantifier = args.precision ? "+" : "?";
|
|
856
|
+
return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
|
|
463
857
|
}
|
|
464
858
|
function timeRegex(args) {
|
|
465
859
|
return new RegExp(`^${timeRegexSource(args)}$`);
|
|
@@ -487,16 +881,20 @@ function isValidJWT(jwt, alg) {
|
|
|
487
881
|
return false;
|
|
488
882
|
try {
|
|
489
883
|
const [header] = jwt.split(".");
|
|
884
|
+
if (!header)
|
|
885
|
+
return false;
|
|
490
886
|
const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
|
|
491
887
|
const decoded = JSON.parse(atob(base64));
|
|
492
888
|
if (typeof decoded !== "object" || decoded === null)
|
|
493
889
|
return false;
|
|
494
|
-
if (
|
|
890
|
+
if ("typ" in decoded && decoded?.typ !== "JWT")
|
|
891
|
+
return false;
|
|
892
|
+
if (!decoded.alg)
|
|
495
893
|
return false;
|
|
496
894
|
if (alg && decoded.alg !== alg)
|
|
497
895
|
return false;
|
|
498
896
|
return true;
|
|
499
|
-
} catch
|
|
897
|
+
} catch {
|
|
500
898
|
return false;
|
|
501
899
|
}
|
|
502
900
|
}
|
|
@@ -513,9 +911,9 @@ function floatSafeRemainder(val, step) {
|
|
|
513
911
|
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
514
912
|
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
|
515
913
|
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
|
516
|
-
const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
|
|
517
|
-
const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
|
|
518
|
-
return valInt % stepInt /
|
|
914
|
+
const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
|
|
915
|
+
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
|
916
|
+
return valInt % stepInt / 10 ** decCount;
|
|
519
917
|
}
|
|
520
918
|
function deepPartialify(schema) {
|
|
521
919
|
if (schema instanceof ZodObject) {
|
|
@@ -588,184 +986,34 @@ function createZodEnum(values, params) {
|
|
|
588
986
|
...processCreateParams(params)
|
|
589
987
|
});
|
|
590
988
|
}
|
|
591
|
-
function
|
|
989
|
+
function cleanParams(params, data) {
|
|
990
|
+
const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
|
|
991
|
+
const p2 = typeof p === "string" ? { message: p } : p;
|
|
992
|
+
return p2;
|
|
993
|
+
}
|
|
994
|
+
function custom(check, _params = {}, fatal) {
|
|
592
995
|
if (check)
|
|
593
996
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
594
|
-
|
|
595
|
-
if (
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
997
|
+
const r = check(data);
|
|
998
|
+
if (r instanceof Promise) {
|
|
999
|
+
return r.then((r2) => {
|
|
1000
|
+
if (!r2) {
|
|
1001
|
+
const params = cleanParams(_params, data);
|
|
1002
|
+
const _fatal = params.fatal ?? fatal ?? true;
|
|
1003
|
+
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
1004
|
+
}
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
if (!r) {
|
|
1008
|
+
const params = cleanParams(_params, data);
|
|
1009
|
+
const _fatal = params.fatal ?? fatal ?? true;
|
|
1010
|
+
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
600
1011
|
}
|
|
1012
|
+
return;
|
|
601
1013
|
});
|
|
602
1014
|
return ZodAny.create();
|
|
603
1015
|
}
|
|
604
|
-
var
|
|
605
|
-
const t = typeof data;
|
|
606
|
-
switch (t) {
|
|
607
|
-
case "undefined":
|
|
608
|
-
return ZodParsedType.undefined;
|
|
609
|
-
case "string":
|
|
610
|
-
return ZodParsedType.string;
|
|
611
|
-
case "number":
|
|
612
|
-
return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
613
|
-
case "boolean":
|
|
614
|
-
return ZodParsedType.boolean;
|
|
615
|
-
case "function":
|
|
616
|
-
return ZodParsedType.function;
|
|
617
|
-
case "bigint":
|
|
618
|
-
return ZodParsedType.bigint;
|
|
619
|
-
case "symbol":
|
|
620
|
-
return ZodParsedType.symbol;
|
|
621
|
-
case "object":
|
|
622
|
-
if (Array.isArray(data)) {
|
|
623
|
-
return ZodParsedType.array;
|
|
624
|
-
}
|
|
625
|
-
if (data === null) {
|
|
626
|
-
return ZodParsedType.null;
|
|
627
|
-
}
|
|
628
|
-
if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
|
|
629
|
-
return ZodParsedType.promise;
|
|
630
|
-
}
|
|
631
|
-
if (typeof Map !== "undefined" && data instanceof Map) {
|
|
632
|
-
return ZodParsedType.map;
|
|
633
|
-
}
|
|
634
|
-
if (typeof Set !== "undefined" && data instanceof Set) {
|
|
635
|
-
return ZodParsedType.set;
|
|
636
|
-
}
|
|
637
|
-
if (typeof Date !== "undefined" && data instanceof Date) {
|
|
638
|
-
return ZodParsedType.date;
|
|
639
|
-
}
|
|
640
|
-
return ZodParsedType.object;
|
|
641
|
-
default:
|
|
642
|
-
return ZodParsedType.unknown;
|
|
643
|
-
}
|
|
644
|
-
}, ZodIssueCode, quotelessJson = (obj) => {
|
|
645
|
-
const json = JSON.stringify(obj, null, 2);
|
|
646
|
-
return json.replace(/"([^"]+)":/g, "$1:");
|
|
647
|
-
}, ZodError, errorMap = (issue, _ctx) => {
|
|
648
|
-
let message;
|
|
649
|
-
switch (issue.code) {
|
|
650
|
-
case ZodIssueCode.invalid_type:
|
|
651
|
-
if (issue.received === ZodParsedType.undefined) {
|
|
652
|
-
message = "Required";
|
|
653
|
-
} else {
|
|
654
|
-
message = `Expected ${issue.expected}, received ${issue.received}`;
|
|
655
|
-
}
|
|
656
|
-
break;
|
|
657
|
-
case ZodIssueCode.invalid_literal:
|
|
658
|
-
message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
|
|
659
|
-
break;
|
|
660
|
-
case ZodIssueCode.unrecognized_keys:
|
|
661
|
-
message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
|
|
662
|
-
break;
|
|
663
|
-
case ZodIssueCode.invalid_union:
|
|
664
|
-
message = `Invalid input`;
|
|
665
|
-
break;
|
|
666
|
-
case ZodIssueCode.invalid_union_discriminator:
|
|
667
|
-
message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
|
|
668
|
-
break;
|
|
669
|
-
case ZodIssueCode.invalid_enum_value:
|
|
670
|
-
message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
|
|
671
|
-
break;
|
|
672
|
-
case ZodIssueCode.invalid_arguments:
|
|
673
|
-
message = `Invalid function arguments`;
|
|
674
|
-
break;
|
|
675
|
-
case ZodIssueCode.invalid_return_type:
|
|
676
|
-
message = `Invalid function return type`;
|
|
677
|
-
break;
|
|
678
|
-
case ZodIssueCode.invalid_date:
|
|
679
|
-
message = `Invalid date`;
|
|
680
|
-
break;
|
|
681
|
-
case ZodIssueCode.invalid_string:
|
|
682
|
-
if (typeof issue.validation === "object") {
|
|
683
|
-
if ("includes" in issue.validation) {
|
|
684
|
-
message = `Invalid input: must include "${issue.validation.includes}"`;
|
|
685
|
-
if (typeof issue.validation.position === "number") {
|
|
686
|
-
message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
|
|
687
|
-
}
|
|
688
|
-
} else if ("startsWith" in issue.validation) {
|
|
689
|
-
message = `Invalid input: must start with "${issue.validation.startsWith}"`;
|
|
690
|
-
} else if ("endsWith" in issue.validation) {
|
|
691
|
-
message = `Invalid input: must end with "${issue.validation.endsWith}"`;
|
|
692
|
-
} else {
|
|
693
|
-
util.assertNever(issue.validation);
|
|
694
|
-
}
|
|
695
|
-
} else if (issue.validation !== "regex") {
|
|
696
|
-
message = `Invalid ${issue.validation}`;
|
|
697
|
-
} else {
|
|
698
|
-
message = "Invalid";
|
|
699
|
-
}
|
|
700
|
-
break;
|
|
701
|
-
case ZodIssueCode.too_small:
|
|
702
|
-
if (issue.type === "array")
|
|
703
|
-
message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
|
|
704
|
-
else if (issue.type === "string")
|
|
705
|
-
message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
|
706
|
-
else if (issue.type === "number")
|
|
707
|
-
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
708
|
-
else if (issue.type === "date")
|
|
709
|
-
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
|
|
710
|
-
else
|
|
711
|
-
message = "Invalid input";
|
|
712
|
-
break;
|
|
713
|
-
case ZodIssueCode.too_big:
|
|
714
|
-
if (issue.type === "array")
|
|
715
|
-
message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
|
|
716
|
-
else if (issue.type === "string")
|
|
717
|
-
message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
|
|
718
|
-
else if (issue.type === "number")
|
|
719
|
-
message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
|
720
|
-
else if (issue.type === "bigint")
|
|
721
|
-
message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
|
722
|
-
else if (issue.type === "date")
|
|
723
|
-
message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
|
|
724
|
-
else
|
|
725
|
-
message = "Invalid input";
|
|
726
|
-
break;
|
|
727
|
-
case ZodIssueCode.custom:
|
|
728
|
-
message = `Invalid input`;
|
|
729
|
-
break;
|
|
730
|
-
case ZodIssueCode.invalid_intersection_types:
|
|
731
|
-
message = `Intersection results could not be merged`;
|
|
732
|
-
break;
|
|
733
|
-
case ZodIssueCode.not_multiple_of:
|
|
734
|
-
message = `Number must be a multiple of ${issue.multipleOf}`;
|
|
735
|
-
break;
|
|
736
|
-
case ZodIssueCode.not_finite:
|
|
737
|
-
message = "Number must be finite";
|
|
738
|
-
break;
|
|
739
|
-
default:
|
|
740
|
-
message = _ctx.defaultError;
|
|
741
|
-
util.assertNever(issue);
|
|
742
|
-
}
|
|
743
|
-
return { message };
|
|
744
|
-
}, overrideErrorMap, makeIssue = (params) => {
|
|
745
|
-
const { data, path, errorMaps, issueData } = params;
|
|
746
|
-
const fullPath = [...path, ...issueData.path || []];
|
|
747
|
-
const fullIssue = {
|
|
748
|
-
...issueData,
|
|
749
|
-
path: fullPath
|
|
750
|
-
};
|
|
751
|
-
if (issueData.message !== undefined) {
|
|
752
|
-
return {
|
|
753
|
-
...issueData,
|
|
754
|
-
path: fullPath,
|
|
755
|
-
message: issueData.message
|
|
756
|
-
};
|
|
757
|
-
}
|
|
758
|
-
let errorMessage = "";
|
|
759
|
-
const maps = errorMaps.filter((m) => !!m).slice().reverse();
|
|
760
|
-
for (const map of maps) {
|
|
761
|
-
errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
|
|
762
|
-
}
|
|
763
|
-
return {
|
|
764
|
-
...issueData,
|
|
765
|
-
path: fullPath,
|
|
766
|
-
message: errorMessage
|
|
767
|
-
};
|
|
768
|
-
}, EMPTY_PATH, INVALID, DIRTY = (value) => ({ status: "dirty", value }), OK = (value) => ({ status: "valid", value }), isAborted = (x2) => x2.status === "aborted", isDirty = (x2) => x2.status === "dirty", isValid = (x2) => x2.status === "valid", isAsync = (x2) => typeof Promise !== "undefined" && x2 instanceof Promise, errorUtil, _ZodEnum_cache, _ZodNativeEnum_cache, handleResult = (ctx, result) => {
|
|
1016
|
+
var handleResult = (ctx, result) => {
|
|
769
1017
|
if (isValid(result)) {
|
|
770
1018
|
return { success: true, data: result.value };
|
|
771
1019
|
} else {
|
|
@@ -815,214 +1063,13 @@ var util, objectUtil, ZodParsedType, getParsedType = (data) => {
|
|
|
815
1063
|
}
|
|
816
1064
|
}, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, BRAND, ZodBranded, ZodPipeline, ZodReadonly, late, ZodFirstPartyTypeKind, instanceOfType = (cls, params = {
|
|
817
1065
|
message: `Input not instance of ${cls.name}`
|
|
818
|
-
}) => custom((data) => data instanceof cls, params), stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType, ostring = () => stringType().optional(), onumber = () => numberType().optional(), oboolean = () => booleanType().optional(), coerce, NEVER
|
|
819
|
-
var
|
|
820
|
-
(
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
throw new Error;
|
|
826
|
-
}
|
|
827
|
-
util2.assertNever = assertNever;
|
|
828
|
-
util2.arrayToEnum = (items) => {
|
|
829
|
-
const obj = {};
|
|
830
|
-
for (const item of items) {
|
|
831
|
-
obj[item] = item;
|
|
832
|
-
}
|
|
833
|
-
return obj;
|
|
834
|
-
};
|
|
835
|
-
util2.getValidEnumValues = (obj) => {
|
|
836
|
-
const validKeys = util2.objectKeys(obj).filter((k2) => typeof obj[obj[k2]] !== "number");
|
|
837
|
-
const filtered = {};
|
|
838
|
-
for (const k2 of validKeys) {
|
|
839
|
-
filtered[k2] = obj[k2];
|
|
840
|
-
}
|
|
841
|
-
return util2.objectValues(filtered);
|
|
842
|
-
};
|
|
843
|
-
util2.objectValues = (obj) => {
|
|
844
|
-
return util2.objectKeys(obj).map(function(e) {
|
|
845
|
-
return obj[e];
|
|
846
|
-
});
|
|
847
|
-
};
|
|
848
|
-
util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
|
|
849
|
-
const keys = [];
|
|
850
|
-
for (const key in object) {
|
|
851
|
-
if (Object.prototype.hasOwnProperty.call(object, key)) {
|
|
852
|
-
keys.push(key);
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
|
-
return keys;
|
|
856
|
-
};
|
|
857
|
-
util2.find = (arr, checker) => {
|
|
858
|
-
for (const item of arr) {
|
|
859
|
-
if (checker(item))
|
|
860
|
-
return item;
|
|
861
|
-
}
|
|
862
|
-
return;
|
|
863
|
-
};
|
|
864
|
-
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
|
|
865
|
-
function joinValues(array, separator = " | ") {
|
|
866
|
-
return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
867
|
-
}
|
|
868
|
-
util2.joinValues = joinValues;
|
|
869
|
-
util2.jsonStringifyReplacer = (_2, value) => {
|
|
870
|
-
if (typeof value === "bigint") {
|
|
871
|
-
return value.toString();
|
|
872
|
-
}
|
|
873
|
-
return value;
|
|
874
|
-
};
|
|
875
|
-
})(util || (util = {}));
|
|
876
|
-
(function(objectUtil2) {
|
|
877
|
-
objectUtil2.mergeShapes = (first, second) => {
|
|
878
|
-
return {
|
|
879
|
-
...first,
|
|
880
|
-
...second
|
|
881
|
-
};
|
|
882
|
-
};
|
|
883
|
-
})(objectUtil || (objectUtil = {}));
|
|
884
|
-
ZodParsedType = util.arrayToEnum([
|
|
885
|
-
"string",
|
|
886
|
-
"nan",
|
|
887
|
-
"number",
|
|
888
|
-
"integer",
|
|
889
|
-
"float",
|
|
890
|
-
"boolean",
|
|
891
|
-
"date",
|
|
892
|
-
"bigint",
|
|
893
|
-
"symbol",
|
|
894
|
-
"function",
|
|
895
|
-
"undefined",
|
|
896
|
-
"null",
|
|
897
|
-
"array",
|
|
898
|
-
"object",
|
|
899
|
-
"unknown",
|
|
900
|
-
"promise",
|
|
901
|
-
"void",
|
|
902
|
-
"never",
|
|
903
|
-
"map",
|
|
904
|
-
"set"
|
|
905
|
-
]);
|
|
906
|
-
ZodIssueCode = util.arrayToEnum([
|
|
907
|
-
"invalid_type",
|
|
908
|
-
"invalid_literal",
|
|
909
|
-
"custom",
|
|
910
|
-
"invalid_union",
|
|
911
|
-
"invalid_union_discriminator",
|
|
912
|
-
"invalid_enum_value",
|
|
913
|
-
"unrecognized_keys",
|
|
914
|
-
"invalid_arguments",
|
|
915
|
-
"invalid_return_type",
|
|
916
|
-
"invalid_date",
|
|
917
|
-
"invalid_string",
|
|
918
|
-
"too_small",
|
|
919
|
-
"too_big",
|
|
920
|
-
"invalid_intersection_types",
|
|
921
|
-
"not_multiple_of",
|
|
922
|
-
"not_finite"
|
|
923
|
-
]);
|
|
924
|
-
ZodError = class ZodError extends Error {
|
|
925
|
-
get errors() {
|
|
926
|
-
return this.issues;
|
|
927
|
-
}
|
|
928
|
-
constructor(issues) {
|
|
929
|
-
super();
|
|
930
|
-
this.issues = [];
|
|
931
|
-
this.addIssue = (sub) => {
|
|
932
|
-
this.issues = [...this.issues, sub];
|
|
933
|
-
};
|
|
934
|
-
this.addIssues = (subs = []) => {
|
|
935
|
-
this.issues = [...this.issues, ...subs];
|
|
936
|
-
};
|
|
937
|
-
const actualProto = new.target.prototype;
|
|
938
|
-
if (Object.setPrototypeOf) {
|
|
939
|
-
Object.setPrototypeOf(this, actualProto);
|
|
940
|
-
} else {
|
|
941
|
-
this.__proto__ = actualProto;
|
|
942
|
-
}
|
|
943
|
-
this.name = "ZodError";
|
|
944
|
-
this.issues = issues;
|
|
945
|
-
}
|
|
946
|
-
format(_mapper) {
|
|
947
|
-
const mapper = _mapper || function(issue) {
|
|
948
|
-
return issue.message;
|
|
949
|
-
};
|
|
950
|
-
const fieldErrors = { _errors: [] };
|
|
951
|
-
const processError = (error) => {
|
|
952
|
-
for (const issue of error.issues) {
|
|
953
|
-
if (issue.code === "invalid_union") {
|
|
954
|
-
issue.unionErrors.map(processError);
|
|
955
|
-
} else if (issue.code === "invalid_return_type") {
|
|
956
|
-
processError(issue.returnTypeError);
|
|
957
|
-
} else if (issue.code === "invalid_arguments") {
|
|
958
|
-
processError(issue.argumentsError);
|
|
959
|
-
} else if (issue.path.length === 0) {
|
|
960
|
-
fieldErrors._errors.push(mapper(issue));
|
|
961
|
-
} else {
|
|
962
|
-
let curr = fieldErrors;
|
|
963
|
-
let i = 0;
|
|
964
|
-
while (i < issue.path.length) {
|
|
965
|
-
const el = issue.path[i];
|
|
966
|
-
const terminal = i === issue.path.length - 1;
|
|
967
|
-
if (!terminal) {
|
|
968
|
-
curr[el] = curr[el] || { _errors: [] };
|
|
969
|
-
} else {
|
|
970
|
-
curr[el] = curr[el] || { _errors: [] };
|
|
971
|
-
curr[el]._errors.push(mapper(issue));
|
|
972
|
-
}
|
|
973
|
-
curr = curr[el];
|
|
974
|
-
i++;
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
};
|
|
979
|
-
processError(this);
|
|
980
|
-
return fieldErrors;
|
|
981
|
-
}
|
|
982
|
-
static assert(value) {
|
|
983
|
-
if (!(value instanceof ZodError)) {
|
|
984
|
-
throw new Error(`Not a ZodError: ${value}`);
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
toString() {
|
|
988
|
-
return this.message;
|
|
989
|
-
}
|
|
990
|
-
get message() {
|
|
991
|
-
return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
|
|
992
|
-
}
|
|
993
|
-
get isEmpty() {
|
|
994
|
-
return this.issues.length === 0;
|
|
995
|
-
}
|
|
996
|
-
flatten(mapper = (issue) => issue.message) {
|
|
997
|
-
const fieldErrors = {};
|
|
998
|
-
const formErrors = [];
|
|
999
|
-
for (const sub of this.issues) {
|
|
1000
|
-
if (sub.path.length > 0) {
|
|
1001
|
-
fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
|
|
1002
|
-
fieldErrors[sub.path[0]].push(mapper(sub));
|
|
1003
|
-
} else {
|
|
1004
|
-
formErrors.push(mapper(sub));
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
return { formErrors, fieldErrors };
|
|
1008
|
-
}
|
|
1009
|
-
get formErrors() {
|
|
1010
|
-
return this.flatten();
|
|
1011
|
-
}
|
|
1012
|
-
};
|
|
1013
|
-
ZodError.create = (issues) => {
|
|
1014
|
-
const error = new ZodError(issues);
|
|
1015
|
-
return error;
|
|
1016
|
-
};
|
|
1017
|
-
overrideErrorMap = errorMap;
|
|
1018
|
-
EMPTY_PATH = [];
|
|
1019
|
-
INVALID = Object.freeze({
|
|
1020
|
-
status: "aborted"
|
|
1021
|
-
});
|
|
1022
|
-
(function(errorUtil2) {
|
|
1023
|
-
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
1024
|
-
errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === undefined ? undefined : message.message;
|
|
1025
|
-
})(errorUtil || (errorUtil = {}));
|
|
1066
|
+
}) => custom((data) => data instanceof cls, params), stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType, ostring = () => stringType().optional(), onumber = () => numberType().optional(), oboolean = () => booleanType().optional(), coerce, NEVER;
|
|
1067
|
+
var init_types = __esm(() => {
|
|
1068
|
+
init_ZodError();
|
|
1069
|
+
init_errors();
|
|
1070
|
+
init_errorUtil();
|
|
1071
|
+
init_parseUtil();
|
|
1072
|
+
init_util();
|
|
1026
1073
|
cuidRegex = /^c[^\s-]{8,}$/i;
|
|
1027
1074
|
cuid2Regex = /^[0-9a-z]+$/;
|
|
1028
1075
|
ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
|
|
@@ -1184,7 +1231,7 @@ var init_lib = __esm(() => {
|
|
|
1184
1231
|
} else if (check.kind === "url") {
|
|
1185
1232
|
try {
|
|
1186
1233
|
new URL(input.data);
|
|
1187
|
-
} catch
|
|
1234
|
+
} catch {
|
|
1188
1235
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
1189
1236
|
addIssueToContext(ctx, {
|
|
1190
1237
|
validation: "url",
|
|
@@ -1396,7 +1443,6 @@ var init_lib = __esm(() => {
|
|
|
1396
1443
|
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
|
|
1397
1444
|
}
|
|
1398
1445
|
datetime(options) {
|
|
1399
|
-
var _a, _b;
|
|
1400
1446
|
if (typeof options === "string") {
|
|
1401
1447
|
return this._addCheck({
|
|
1402
1448
|
kind: "datetime",
|
|
@@ -1408,10 +1454,10 @@ var init_lib = __esm(() => {
|
|
|
1408
1454
|
}
|
|
1409
1455
|
return this._addCheck({
|
|
1410
1456
|
kind: "datetime",
|
|
1411
|
-
precision: typeof
|
|
1412
|
-
offset:
|
|
1413
|
-
local:
|
|
1414
|
-
...errorUtil.errToObj(options
|
|
1457
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
|
1458
|
+
offset: options?.offset ?? false,
|
|
1459
|
+
local: options?.local ?? false,
|
|
1460
|
+
...errorUtil.errToObj(options?.message)
|
|
1415
1461
|
});
|
|
1416
1462
|
}
|
|
1417
1463
|
date(message) {
|
|
@@ -1427,8 +1473,8 @@ var init_lib = __esm(() => {
|
|
|
1427
1473
|
}
|
|
1428
1474
|
return this._addCheck({
|
|
1429
1475
|
kind: "time",
|
|
1430
|
-
precision: typeof
|
|
1431
|
-
...errorUtil.errToObj(options
|
|
1476
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
|
1477
|
+
...errorUtil.errToObj(options?.message)
|
|
1432
1478
|
});
|
|
1433
1479
|
}
|
|
1434
1480
|
duration(message) {
|
|
@@ -1445,8 +1491,8 @@ var init_lib = __esm(() => {
|
|
|
1445
1491
|
return this._addCheck({
|
|
1446
1492
|
kind: "includes",
|
|
1447
1493
|
value,
|
|
1448
|
-
position: options
|
|
1449
|
-
...errorUtil.errToObj(options
|
|
1494
|
+
position: options?.position,
|
|
1495
|
+
...errorUtil.errToObj(options?.message)
|
|
1450
1496
|
});
|
|
1451
1497
|
}
|
|
1452
1498
|
startsWith(value, message) {
|
|
@@ -1575,11 +1621,10 @@ var init_lib = __esm(() => {
|
|
|
1575
1621
|
}
|
|
1576
1622
|
};
|
|
1577
1623
|
ZodString.create = (params) => {
|
|
1578
|
-
var _a;
|
|
1579
1624
|
return new ZodString({
|
|
1580
1625
|
checks: [],
|
|
1581
1626
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
1582
|
-
coerce:
|
|
1627
|
+
coerce: params?.coerce ?? false,
|
|
1583
1628
|
...processCreateParams(params)
|
|
1584
1629
|
});
|
|
1585
1630
|
};
|
|
@@ -1791,7 +1836,8 @@ var init_lib = __esm(() => {
|
|
|
1791
1836
|
return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
|
|
1792
1837
|
}
|
|
1793
1838
|
get isFinite() {
|
|
1794
|
-
let max = null
|
|
1839
|
+
let max = null;
|
|
1840
|
+
let min = null;
|
|
1795
1841
|
for (const ch of this._def.checks) {
|
|
1796
1842
|
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
|
1797
1843
|
return true;
|
|
@@ -1810,7 +1856,7 @@ var init_lib = __esm(() => {
|
|
|
1810
1856
|
return new ZodNumber({
|
|
1811
1857
|
checks: [],
|
|
1812
1858
|
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
1813
|
-
coerce:
|
|
1859
|
+
coerce: params?.coerce || false,
|
|
1814
1860
|
...processCreateParams(params)
|
|
1815
1861
|
});
|
|
1816
1862
|
};
|
|
@@ -1824,7 +1870,7 @@ var init_lib = __esm(() => {
|
|
|
1824
1870
|
if (this._def.coerce) {
|
|
1825
1871
|
try {
|
|
1826
1872
|
input.data = BigInt(input.data);
|
|
1827
|
-
} catch
|
|
1873
|
+
} catch {
|
|
1828
1874
|
return this._getInvalidInput(input);
|
|
1829
1875
|
}
|
|
1830
1876
|
}
|
|
@@ -1979,11 +2025,10 @@ var init_lib = __esm(() => {
|
|
|
1979
2025
|
}
|
|
1980
2026
|
};
|
|
1981
2027
|
ZodBigInt.create = (params) => {
|
|
1982
|
-
var _a;
|
|
1983
2028
|
return new ZodBigInt({
|
|
1984
2029
|
checks: [],
|
|
1985
2030
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
1986
|
-
coerce:
|
|
2031
|
+
coerce: params?.coerce ?? false,
|
|
1987
2032
|
...processCreateParams(params)
|
|
1988
2033
|
});
|
|
1989
2034
|
};
|
|
@@ -2008,7 +2053,7 @@ var init_lib = __esm(() => {
|
|
|
2008
2053
|
ZodBoolean.create = (params) => {
|
|
2009
2054
|
return new ZodBoolean({
|
|
2010
2055
|
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
|
2011
|
-
coerce:
|
|
2056
|
+
coerce: params?.coerce || false,
|
|
2012
2057
|
...processCreateParams(params)
|
|
2013
2058
|
});
|
|
2014
2059
|
};
|
|
@@ -2027,7 +2072,7 @@ var init_lib = __esm(() => {
|
|
|
2027
2072
|
});
|
|
2028
2073
|
return INVALID;
|
|
2029
2074
|
}
|
|
2030
|
-
if (isNaN(input.data.getTime())) {
|
|
2075
|
+
if (Number.isNaN(input.data.getTime())) {
|
|
2031
2076
|
const ctx2 = this._getOrReturnCtx(input);
|
|
2032
2077
|
addIssueToContext(ctx2, {
|
|
2033
2078
|
code: ZodIssueCode.invalid_date
|
|
@@ -2116,7 +2161,7 @@ var init_lib = __esm(() => {
|
|
|
2116
2161
|
ZodDate.create = (params) => {
|
|
2117
2162
|
return new ZodDate({
|
|
2118
2163
|
checks: [],
|
|
2119
|
-
coerce:
|
|
2164
|
+
coerce: params?.coerce || false,
|
|
2120
2165
|
typeName: ZodFirstPartyTypeKind.ZodDate,
|
|
2121
2166
|
...processCreateParams(params)
|
|
2122
2167
|
});
|
|
@@ -2365,7 +2410,8 @@ var init_lib = __esm(() => {
|
|
|
2365
2410
|
return this._cached;
|
|
2366
2411
|
const shape = this._def.shape();
|
|
2367
2412
|
const keys = util.objectKeys(shape);
|
|
2368
|
-
|
|
2413
|
+
this._cached = { shape, keys };
|
|
2414
|
+
return this._cached;
|
|
2369
2415
|
}
|
|
2370
2416
|
_parse(input) {
|
|
2371
2417
|
const parsedType = this._getType(input);
|
|
@@ -2415,9 +2461,7 @@ var init_lib = __esm(() => {
|
|
|
2415
2461
|
});
|
|
2416
2462
|
status.dirty();
|
|
2417
2463
|
}
|
|
2418
|
-
} else if (unknownKeys === "strip")
|
|
2419
|
-
;
|
|
2420
|
-
else {
|
|
2464
|
+
} else if (unknownKeys === "strip") {} else {
|
|
2421
2465
|
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
|
|
2422
2466
|
}
|
|
2423
2467
|
} else {
|
|
@@ -2461,11 +2505,10 @@ var init_lib = __esm(() => {
|
|
|
2461
2505
|
unknownKeys: "strict",
|
|
2462
2506
|
...message !== undefined ? {
|
|
2463
2507
|
errorMap: (issue, ctx) => {
|
|
2464
|
-
|
|
2465
|
-
const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === undefined ? undefined : _b.call(_a, issue, ctx).message) !== null && _c !== undefined ? _c : ctx.defaultError;
|
|
2508
|
+
const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
|
|
2466
2509
|
if (issue.code === "unrecognized_keys")
|
|
2467
2510
|
return {
|
|
2468
|
-
message:
|
|
2511
|
+
message: errorUtil.errToObj(message).message ?? defaultError
|
|
2469
2512
|
};
|
|
2470
2513
|
return {
|
|
2471
2514
|
message: defaultError
|
|
@@ -2518,11 +2561,11 @@ var init_lib = __esm(() => {
|
|
|
2518
2561
|
}
|
|
2519
2562
|
pick(mask) {
|
|
2520
2563
|
const shape = {};
|
|
2521
|
-
util.objectKeys(mask)
|
|
2564
|
+
for (const key of util.objectKeys(mask)) {
|
|
2522
2565
|
if (mask[key] && this.shape[key]) {
|
|
2523
2566
|
shape[key] = this.shape[key];
|
|
2524
2567
|
}
|
|
2525
|
-
}
|
|
2568
|
+
}
|
|
2526
2569
|
return new ZodObject({
|
|
2527
2570
|
...this._def,
|
|
2528
2571
|
shape: () => shape
|
|
@@ -2530,11 +2573,11 @@ var init_lib = __esm(() => {
|
|
|
2530
2573
|
}
|
|
2531
2574
|
omit(mask) {
|
|
2532
2575
|
const shape = {};
|
|
2533
|
-
util.objectKeys(this.shape)
|
|
2576
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
2534
2577
|
if (!mask[key]) {
|
|
2535
2578
|
shape[key] = this.shape[key];
|
|
2536
2579
|
}
|
|
2537
|
-
}
|
|
2580
|
+
}
|
|
2538
2581
|
return new ZodObject({
|
|
2539
2582
|
...this._def,
|
|
2540
2583
|
shape: () => shape
|
|
@@ -2545,14 +2588,14 @@ var init_lib = __esm(() => {
|
|
|
2545
2588
|
}
|
|
2546
2589
|
partial(mask) {
|
|
2547
2590
|
const newShape = {};
|
|
2548
|
-
util.objectKeys(this.shape)
|
|
2591
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
2549
2592
|
const fieldSchema = this.shape[key];
|
|
2550
2593
|
if (mask && !mask[key]) {
|
|
2551
2594
|
newShape[key] = fieldSchema;
|
|
2552
2595
|
} else {
|
|
2553
2596
|
newShape[key] = fieldSchema.optional();
|
|
2554
2597
|
}
|
|
2555
|
-
}
|
|
2598
|
+
}
|
|
2556
2599
|
return new ZodObject({
|
|
2557
2600
|
...this._def,
|
|
2558
2601
|
shape: () => newShape
|
|
@@ -2560,7 +2603,7 @@ var init_lib = __esm(() => {
|
|
|
2560
2603
|
}
|
|
2561
2604
|
required(mask) {
|
|
2562
2605
|
const newShape = {};
|
|
2563
|
-
util.objectKeys(this.shape)
|
|
2606
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
2564
2607
|
if (mask && !mask[key]) {
|
|
2565
2608
|
newShape[key] = this.shape[key];
|
|
2566
2609
|
} else {
|
|
@@ -2571,7 +2614,7 @@ var init_lib = __esm(() => {
|
|
|
2571
2614
|
}
|
|
2572
2615
|
newShape[key] = newField;
|
|
2573
2616
|
}
|
|
2574
|
-
}
|
|
2617
|
+
}
|
|
2575
2618
|
return new ZodObject({
|
|
2576
2619
|
...this._def,
|
|
2577
2620
|
shape: () => newShape
|
|
@@ -3110,12 +3153,7 @@ var init_lib = __esm(() => {
|
|
|
3110
3153
|
return makeIssue({
|
|
3111
3154
|
data: args,
|
|
3112
3155
|
path: ctx.path,
|
|
3113
|
-
errorMaps: [
|
|
3114
|
-
ctx.common.contextualErrorMap,
|
|
3115
|
-
ctx.schemaErrorMap,
|
|
3116
|
-
getErrorMap(),
|
|
3117
|
-
errorMap
|
|
3118
|
-
].filter((x2) => !!x2),
|
|
3156
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x2) => !!x2),
|
|
3119
3157
|
issueData: {
|
|
3120
3158
|
code: ZodIssueCode.invalid_arguments,
|
|
3121
3159
|
argumentsError: error
|
|
@@ -3126,12 +3164,7 @@ var init_lib = __esm(() => {
|
|
|
3126
3164
|
return makeIssue({
|
|
3127
3165
|
data: returns,
|
|
3128
3166
|
path: ctx.path,
|
|
3129
|
-
errorMaps: [
|
|
3130
|
-
ctx.common.contextualErrorMap,
|
|
3131
|
-
ctx.schemaErrorMap,
|
|
3132
|
-
getErrorMap(),
|
|
3133
|
-
errorMap
|
|
3134
|
-
].filter((x2) => !!x2),
|
|
3167
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x2) => !!x2),
|
|
3135
3168
|
issueData: {
|
|
3136
3169
|
code: ZodIssueCode.invalid_return_type,
|
|
3137
3170
|
returnTypeError: error
|
|
@@ -3248,10 +3281,6 @@ var init_lib = __esm(() => {
|
|
|
3248
3281
|
});
|
|
3249
3282
|
};
|
|
3250
3283
|
ZodEnum = class ZodEnum extends ZodType {
|
|
3251
|
-
constructor() {
|
|
3252
|
-
super(...arguments);
|
|
3253
|
-
_ZodEnum_cache.set(this, undefined);
|
|
3254
|
-
}
|
|
3255
3284
|
_parse(input) {
|
|
3256
3285
|
if (typeof input.data !== "string") {
|
|
3257
3286
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -3263,10 +3292,10 @@ var init_lib = __esm(() => {
|
|
|
3263
3292
|
});
|
|
3264
3293
|
return INVALID;
|
|
3265
3294
|
}
|
|
3266
|
-
if (!
|
|
3267
|
-
|
|
3295
|
+
if (!this._cache) {
|
|
3296
|
+
this._cache = new Set(this._def.values);
|
|
3268
3297
|
}
|
|
3269
|
-
if (!
|
|
3298
|
+
if (!this._cache.has(input.data)) {
|
|
3270
3299
|
const ctx = this._getOrReturnCtx(input);
|
|
3271
3300
|
const expectedValues = this._def.values;
|
|
3272
3301
|
addIssueToContext(ctx, {
|
|
@@ -3315,13 +3344,8 @@ var init_lib = __esm(() => {
|
|
|
3315
3344
|
});
|
|
3316
3345
|
}
|
|
3317
3346
|
};
|
|
3318
|
-
_ZodEnum_cache = new WeakMap;
|
|
3319
3347
|
ZodEnum.create = createZodEnum;
|
|
3320
3348
|
ZodNativeEnum = class ZodNativeEnum extends ZodType {
|
|
3321
|
-
constructor() {
|
|
3322
|
-
super(...arguments);
|
|
3323
|
-
_ZodNativeEnum_cache.set(this, undefined);
|
|
3324
|
-
}
|
|
3325
3349
|
_parse(input) {
|
|
3326
3350
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
|
3327
3351
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -3334,10 +3358,10 @@ var init_lib = __esm(() => {
|
|
|
3334
3358
|
});
|
|
3335
3359
|
return INVALID;
|
|
3336
3360
|
}
|
|
3337
|
-
if (!
|
|
3338
|
-
|
|
3361
|
+
if (!this._cache) {
|
|
3362
|
+
this._cache = new Set(util.getValidEnumValues(this._def.values));
|
|
3339
3363
|
}
|
|
3340
|
-
if (!
|
|
3364
|
+
if (!this._cache.has(input.data)) {
|
|
3341
3365
|
const expectedValues = util.objectValues(nativeEnumValues);
|
|
3342
3366
|
addIssueToContext(ctx, {
|
|
3343
3367
|
received: ctx.data,
|
|
@@ -3352,7 +3376,6 @@ var init_lib = __esm(() => {
|
|
|
3352
3376
|
return this._def.values;
|
|
3353
3377
|
}
|
|
3354
3378
|
};
|
|
3355
|
-
_ZodNativeEnum_cache = new WeakMap;
|
|
3356
3379
|
ZodNativeEnum.create = (values, params) => {
|
|
3357
3380
|
return new ZodNativeEnum({
|
|
3358
3381
|
values,
|
|
@@ -3493,7 +3516,7 @@ var init_lib = __esm(() => {
|
|
|
3493
3516
|
parent: ctx
|
|
3494
3517
|
});
|
|
3495
3518
|
if (!isValid(base))
|
|
3496
|
-
return
|
|
3519
|
+
return INVALID;
|
|
3497
3520
|
const result = effect.transform(base.value, checkCtx);
|
|
3498
3521
|
if (result instanceof Promise) {
|
|
3499
3522
|
throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
|
|
@@ -3502,8 +3525,11 @@ var init_lib = __esm(() => {
|
|
|
3502
3525
|
} else {
|
|
3503
3526
|
return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
|
|
3504
3527
|
if (!isValid(base))
|
|
3505
|
-
return
|
|
3506
|
-
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
3528
|
+
return INVALID;
|
|
3529
|
+
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
3530
|
+
status: status.value,
|
|
3531
|
+
value: result
|
|
3532
|
+
}));
|
|
3507
3533
|
});
|
|
3508
3534
|
}
|
|
3509
3535
|
}
|
|
@@ -3841,122 +3867,132 @@ var init_lib = __esm(() => {
|
|
|
3841
3867
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
3842
3868
|
};
|
|
3843
3869
|
NEVER = INVALID;
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3870
|
+
});
|
|
3871
|
+
|
|
3872
|
+
// node_modules/zod/v3/external.js
|
|
3873
|
+
var exports_external = {};
|
|
3874
|
+
__export(exports_external, {
|
|
3875
|
+
void: () => voidType,
|
|
3876
|
+
util: () => util,
|
|
3877
|
+
unknown: () => unknownType,
|
|
3878
|
+
union: () => unionType,
|
|
3879
|
+
undefined: () => undefinedType,
|
|
3880
|
+
tuple: () => tupleType,
|
|
3881
|
+
transformer: () => effectsType,
|
|
3882
|
+
symbol: () => symbolType,
|
|
3883
|
+
string: () => stringType,
|
|
3884
|
+
strictObject: () => strictObjectType,
|
|
3885
|
+
setErrorMap: () => setErrorMap,
|
|
3886
|
+
set: () => setType,
|
|
3887
|
+
record: () => recordType,
|
|
3888
|
+
quotelessJson: () => quotelessJson,
|
|
3889
|
+
promise: () => promiseType,
|
|
3890
|
+
preprocess: () => preprocessType,
|
|
3891
|
+
pipeline: () => pipelineType,
|
|
3892
|
+
ostring: () => ostring,
|
|
3893
|
+
optional: () => optionalType,
|
|
3894
|
+
onumber: () => onumber,
|
|
3895
|
+
oboolean: () => oboolean,
|
|
3896
|
+
objectUtil: () => objectUtil,
|
|
3897
|
+
object: () => objectType,
|
|
3898
|
+
number: () => numberType,
|
|
3899
|
+
nullable: () => nullableType,
|
|
3900
|
+
null: () => nullType,
|
|
3901
|
+
never: () => neverType,
|
|
3902
|
+
nativeEnum: () => nativeEnumType,
|
|
3903
|
+
nan: () => nanType,
|
|
3904
|
+
map: () => mapType,
|
|
3905
|
+
makeIssue: () => makeIssue,
|
|
3906
|
+
literal: () => literalType,
|
|
3907
|
+
lazy: () => lazyType,
|
|
3908
|
+
late: () => late,
|
|
3909
|
+
isValid: () => isValid,
|
|
3910
|
+
isDirty: () => isDirty,
|
|
3911
|
+
isAsync: () => isAsync,
|
|
3912
|
+
isAborted: () => isAborted,
|
|
3913
|
+
intersection: () => intersectionType,
|
|
3914
|
+
instanceof: () => instanceOfType,
|
|
3915
|
+
getParsedType: () => getParsedType,
|
|
3916
|
+
getErrorMap: () => getErrorMap,
|
|
3917
|
+
function: () => functionType,
|
|
3918
|
+
enum: () => enumType,
|
|
3919
|
+
effect: () => effectsType,
|
|
3920
|
+
discriminatedUnion: () => discriminatedUnionType,
|
|
3921
|
+
defaultErrorMap: () => en_default,
|
|
3922
|
+
datetimeRegex: () => datetimeRegex,
|
|
3923
|
+
date: () => dateType,
|
|
3924
|
+
custom: () => custom,
|
|
3925
|
+
coerce: () => coerce,
|
|
3926
|
+
boolean: () => booleanType,
|
|
3927
|
+
bigint: () => bigIntType,
|
|
3928
|
+
array: () => arrayType,
|
|
3929
|
+
any: () => anyType,
|
|
3930
|
+
addIssueToContext: () => addIssueToContext,
|
|
3931
|
+
ZodVoid: () => ZodVoid,
|
|
3932
|
+
ZodUnknown: () => ZodUnknown,
|
|
3933
|
+
ZodUnion: () => ZodUnion,
|
|
3934
|
+
ZodUndefined: () => ZodUndefined,
|
|
3935
|
+
ZodType: () => ZodType,
|
|
3936
|
+
ZodTuple: () => ZodTuple,
|
|
3937
|
+
ZodTransformer: () => ZodEffects,
|
|
3938
|
+
ZodSymbol: () => ZodSymbol,
|
|
3939
|
+
ZodString: () => ZodString,
|
|
3940
|
+
ZodSet: () => ZodSet,
|
|
3941
|
+
ZodSchema: () => ZodType,
|
|
3942
|
+
ZodRecord: () => ZodRecord,
|
|
3943
|
+
ZodReadonly: () => ZodReadonly,
|
|
3944
|
+
ZodPromise: () => ZodPromise,
|
|
3945
|
+
ZodPipeline: () => ZodPipeline,
|
|
3946
|
+
ZodParsedType: () => ZodParsedType,
|
|
3947
|
+
ZodOptional: () => ZodOptional,
|
|
3948
|
+
ZodObject: () => ZodObject,
|
|
3949
|
+
ZodNumber: () => ZodNumber,
|
|
3950
|
+
ZodNullable: () => ZodNullable,
|
|
3951
|
+
ZodNull: () => ZodNull,
|
|
3952
|
+
ZodNever: () => ZodNever,
|
|
3953
|
+
ZodNativeEnum: () => ZodNativeEnum,
|
|
3954
|
+
ZodNaN: () => ZodNaN,
|
|
3955
|
+
ZodMap: () => ZodMap,
|
|
3956
|
+
ZodLiteral: () => ZodLiteral,
|
|
3957
|
+
ZodLazy: () => ZodLazy,
|
|
3958
|
+
ZodIssueCode: () => ZodIssueCode,
|
|
3959
|
+
ZodIntersection: () => ZodIntersection,
|
|
3960
|
+
ZodFunction: () => ZodFunction,
|
|
3961
|
+
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
3962
|
+
ZodError: () => ZodError,
|
|
3963
|
+
ZodEnum: () => ZodEnum,
|
|
3964
|
+
ZodEffects: () => ZodEffects,
|
|
3965
|
+
ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
|
|
3966
|
+
ZodDefault: () => ZodDefault,
|
|
3967
|
+
ZodDate: () => ZodDate,
|
|
3968
|
+
ZodCatch: () => ZodCatch,
|
|
3969
|
+
ZodBranded: () => ZodBranded,
|
|
3970
|
+
ZodBoolean: () => ZodBoolean,
|
|
3971
|
+
ZodBigInt: () => ZodBigInt,
|
|
3972
|
+
ZodArray: () => ZodArray,
|
|
3973
|
+
ZodAny: () => ZodAny,
|
|
3974
|
+
Schema: () => ZodType,
|
|
3975
|
+
ParseStatus: () => ParseStatus,
|
|
3976
|
+
OK: () => OK,
|
|
3977
|
+
NEVER: () => NEVER,
|
|
3978
|
+
INVALID: () => INVALID,
|
|
3979
|
+
EMPTY_PATH: () => EMPTY_PATH,
|
|
3980
|
+
DIRTY: () => DIRTY,
|
|
3981
|
+
BRAND: () => BRAND
|
|
3982
|
+
});
|
|
3983
|
+
var init_external = __esm(() => {
|
|
3984
|
+
init_errors();
|
|
3985
|
+
init_parseUtil();
|
|
3986
|
+
init_typeAliases();
|
|
3987
|
+
init_util();
|
|
3988
|
+
init_types();
|
|
3989
|
+
init_ZodError();
|
|
3990
|
+
});
|
|
3991
|
+
|
|
3992
|
+
// node_modules/zod/index.js
|
|
3993
|
+
var init_zod = __esm(() => {
|
|
3994
|
+
init_external();
|
|
3995
|
+
init_external();
|
|
3960
3996
|
});
|
|
3961
3997
|
|
|
3962
3998
|
// src/mcp-server/console-logger.ts
|
|
@@ -4012,43 +4048,43 @@ var init_console_logger = __esm(() => {
|
|
|
4012
4048
|
|
|
4013
4049
|
// node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
4014
4050
|
var LATEST_PROTOCOL_VERSION = "2024-11-05", SUPPORTED_PROTOCOL_VERSIONS, JSONRPC_VERSION = "2.0", ProgressTokenSchema, CursorSchema, BaseRequestParamsSchema, RequestSchema, BaseNotificationParamsSchema, NotificationSchema, ResultSchema, RequestIdSchema, JSONRPCRequestSchema, JSONRPCNotificationSchema, JSONRPCResponseSchema, ErrorCode, JSONRPCErrorSchema, JSONRPCMessageSchema, EmptyResultSchema, CancelledNotificationSchema, ImplementationSchema, ClientCapabilitiesSchema, InitializeRequestSchema, ServerCapabilitiesSchema, InitializeResultSchema, InitializedNotificationSchema, PingRequestSchema, ProgressSchema, ProgressNotificationSchema, PaginatedRequestSchema, PaginatedResultSchema, ResourceContentsSchema, TextResourceContentsSchema, BlobResourceContentsSchema, ResourceSchema, ResourceTemplateSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ReadResourceRequestSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, SubscribeRequestSchema, UnsubscribeRequestSchema, ResourceUpdatedNotificationSchema, PromptArgumentSchema, PromptSchema, ListPromptsRequestSchema, ListPromptsResultSchema, GetPromptRequestSchema, TextContentSchema, ImageContentSchema, AudioContentSchema, EmbeddedResourceSchema, PromptMessageSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolSchema, ListToolsRequestSchema, ListToolsResultSchema, CallToolResultSchema, CompatibilityCallToolResultSchema, CallToolRequestSchema, ToolListChangedNotificationSchema, LoggingLevelSchema, SetLevelRequestSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, SamplingMessageSchema, CreateMessageRequestSchema, CreateMessageResultSchema, ResourceReferenceSchema, PromptReferenceSchema, CompleteRequestSchema, CompleteResultSchema, RootSchema, ListRootsRequestSchema, ListRootsResultSchema, RootsListChangedNotificationSchema, ClientRequestSchema, ClientNotificationSchema, ClientResultSchema, ServerRequestSchema, ServerNotificationSchema, ServerResultSchema, McpError;
|
|
4015
|
-
var
|
|
4016
|
-
|
|
4051
|
+
var init_types2 = __esm(() => {
|
|
4052
|
+
init_zod();
|
|
4017
4053
|
SUPPORTED_PROTOCOL_VERSIONS = [
|
|
4018
4054
|
LATEST_PROTOCOL_VERSION,
|
|
4019
4055
|
"2024-10-07"
|
|
4020
4056
|
];
|
|
4021
|
-
ProgressTokenSchema =
|
|
4022
|
-
CursorSchema =
|
|
4023
|
-
BaseRequestParamsSchema =
|
|
4024
|
-
_meta:
|
|
4025
|
-
progressToken:
|
|
4057
|
+
ProgressTokenSchema = exports_external.union([exports_external.string(), exports_external.number().int()]);
|
|
4058
|
+
CursorSchema = exports_external.string();
|
|
4059
|
+
BaseRequestParamsSchema = exports_external.object({
|
|
4060
|
+
_meta: exports_external.optional(exports_external.object({
|
|
4061
|
+
progressToken: exports_external.optional(ProgressTokenSchema)
|
|
4026
4062
|
}).passthrough())
|
|
4027
4063
|
}).passthrough();
|
|
4028
|
-
RequestSchema =
|
|
4029
|
-
method:
|
|
4030
|
-
params:
|
|
4064
|
+
RequestSchema = exports_external.object({
|
|
4065
|
+
method: exports_external.string(),
|
|
4066
|
+
params: exports_external.optional(BaseRequestParamsSchema)
|
|
4031
4067
|
});
|
|
4032
|
-
BaseNotificationParamsSchema =
|
|
4033
|
-
_meta:
|
|
4068
|
+
BaseNotificationParamsSchema = exports_external.object({
|
|
4069
|
+
_meta: exports_external.optional(exports_external.object({}).passthrough())
|
|
4034
4070
|
}).passthrough();
|
|
4035
|
-
NotificationSchema =
|
|
4036
|
-
method:
|
|
4037
|
-
params:
|
|
4071
|
+
NotificationSchema = exports_external.object({
|
|
4072
|
+
method: exports_external.string(),
|
|
4073
|
+
params: exports_external.optional(BaseNotificationParamsSchema)
|
|
4038
4074
|
});
|
|
4039
|
-
ResultSchema =
|
|
4040
|
-
_meta:
|
|
4075
|
+
ResultSchema = exports_external.object({
|
|
4076
|
+
_meta: exports_external.optional(exports_external.object({}).passthrough())
|
|
4041
4077
|
}).passthrough();
|
|
4042
|
-
RequestIdSchema =
|
|
4043
|
-
JSONRPCRequestSchema =
|
|
4044
|
-
jsonrpc:
|
|
4078
|
+
RequestIdSchema = exports_external.union([exports_external.string(), exports_external.number().int()]);
|
|
4079
|
+
JSONRPCRequestSchema = exports_external.object({
|
|
4080
|
+
jsonrpc: exports_external.literal(JSONRPC_VERSION),
|
|
4045
4081
|
id: RequestIdSchema
|
|
4046
4082
|
}).merge(RequestSchema).strict();
|
|
4047
|
-
JSONRPCNotificationSchema =
|
|
4048
|
-
jsonrpc:
|
|
4083
|
+
JSONRPCNotificationSchema = exports_external.object({
|
|
4084
|
+
jsonrpc: exports_external.literal(JSONRPC_VERSION)
|
|
4049
4085
|
}).merge(NotificationSchema).strict();
|
|
4050
|
-
JSONRPCResponseSchema =
|
|
4051
|
-
jsonrpc:
|
|
4086
|
+
JSONRPCResponseSchema = exports_external.object({
|
|
4087
|
+
jsonrpc: exports_external.literal(JSONRPC_VERSION),
|
|
4052
4088
|
id: RequestIdSchema,
|
|
4053
4089
|
result: ResultSchema
|
|
4054
4090
|
}).strict();
|
|
@@ -4061,16 +4097,16 @@ var init_types = __esm(() => {
|
|
|
4061
4097
|
ErrorCode2[ErrorCode2["InvalidParams"] = -32602] = "InvalidParams";
|
|
4062
4098
|
ErrorCode2[ErrorCode2["InternalError"] = -32603] = "InternalError";
|
|
4063
4099
|
})(ErrorCode || (ErrorCode = {}));
|
|
4064
|
-
JSONRPCErrorSchema =
|
|
4065
|
-
jsonrpc:
|
|
4100
|
+
JSONRPCErrorSchema = exports_external.object({
|
|
4101
|
+
jsonrpc: exports_external.literal(JSONRPC_VERSION),
|
|
4066
4102
|
id: RequestIdSchema,
|
|
4067
|
-
error:
|
|
4068
|
-
code:
|
|
4069
|
-
message:
|
|
4070
|
-
data:
|
|
4103
|
+
error: exports_external.object({
|
|
4104
|
+
code: exports_external.number().int(),
|
|
4105
|
+
message: exports_external.string(),
|
|
4106
|
+
data: exports_external.optional(exports_external.unknown())
|
|
4071
4107
|
})
|
|
4072
4108
|
}).strict();
|
|
4073
|
-
JSONRPCMessageSchema =
|
|
4109
|
+
JSONRPCMessageSchema = exports_external.union([
|
|
4074
4110
|
JSONRPCRequestSchema,
|
|
4075
4111
|
JSONRPCNotificationSchema,
|
|
4076
4112
|
JSONRPCResponseSchema,
|
|
@@ -4078,184 +4114,184 @@ var init_types = __esm(() => {
|
|
|
4078
4114
|
]);
|
|
4079
4115
|
EmptyResultSchema = ResultSchema.strict();
|
|
4080
4116
|
CancelledNotificationSchema = NotificationSchema.extend({
|
|
4081
|
-
method:
|
|
4117
|
+
method: exports_external.literal("notifications/cancelled"),
|
|
4082
4118
|
params: BaseNotificationParamsSchema.extend({
|
|
4083
4119
|
requestId: RequestIdSchema,
|
|
4084
|
-
reason:
|
|
4120
|
+
reason: exports_external.string().optional()
|
|
4085
4121
|
})
|
|
4086
4122
|
});
|
|
4087
|
-
ImplementationSchema =
|
|
4088
|
-
name:
|
|
4089
|
-
version:
|
|
4123
|
+
ImplementationSchema = exports_external.object({
|
|
4124
|
+
name: exports_external.string(),
|
|
4125
|
+
version: exports_external.string()
|
|
4090
4126
|
}).passthrough();
|
|
4091
|
-
ClientCapabilitiesSchema =
|
|
4092
|
-
experimental:
|
|
4093
|
-
sampling:
|
|
4094
|
-
roots:
|
|
4095
|
-
listChanged:
|
|
4127
|
+
ClientCapabilitiesSchema = exports_external.object({
|
|
4128
|
+
experimental: exports_external.optional(exports_external.object({}).passthrough()),
|
|
4129
|
+
sampling: exports_external.optional(exports_external.object({}).passthrough()),
|
|
4130
|
+
roots: exports_external.optional(exports_external.object({
|
|
4131
|
+
listChanged: exports_external.optional(exports_external.boolean())
|
|
4096
4132
|
}).passthrough())
|
|
4097
4133
|
}).passthrough();
|
|
4098
4134
|
InitializeRequestSchema = RequestSchema.extend({
|
|
4099
|
-
method:
|
|
4135
|
+
method: exports_external.literal("initialize"),
|
|
4100
4136
|
params: BaseRequestParamsSchema.extend({
|
|
4101
|
-
protocolVersion:
|
|
4137
|
+
protocolVersion: exports_external.string(),
|
|
4102
4138
|
capabilities: ClientCapabilitiesSchema,
|
|
4103
4139
|
clientInfo: ImplementationSchema
|
|
4104
4140
|
})
|
|
4105
4141
|
});
|
|
4106
|
-
ServerCapabilitiesSchema =
|
|
4107
|
-
experimental:
|
|
4108
|
-
logging:
|
|
4109
|
-
completions:
|
|
4110
|
-
prompts:
|
|
4111
|
-
listChanged:
|
|
4142
|
+
ServerCapabilitiesSchema = exports_external.object({
|
|
4143
|
+
experimental: exports_external.optional(exports_external.object({}).passthrough()),
|
|
4144
|
+
logging: exports_external.optional(exports_external.object({}).passthrough()),
|
|
4145
|
+
completions: exports_external.optional(exports_external.object({}).passthrough()),
|
|
4146
|
+
prompts: exports_external.optional(exports_external.object({
|
|
4147
|
+
listChanged: exports_external.optional(exports_external.boolean())
|
|
4112
4148
|
}).passthrough()),
|
|
4113
|
-
resources:
|
|
4114
|
-
subscribe:
|
|
4115
|
-
listChanged:
|
|
4149
|
+
resources: exports_external.optional(exports_external.object({
|
|
4150
|
+
subscribe: exports_external.optional(exports_external.boolean()),
|
|
4151
|
+
listChanged: exports_external.optional(exports_external.boolean())
|
|
4116
4152
|
}).passthrough()),
|
|
4117
|
-
tools:
|
|
4118
|
-
listChanged:
|
|
4153
|
+
tools: exports_external.optional(exports_external.object({
|
|
4154
|
+
listChanged: exports_external.optional(exports_external.boolean())
|
|
4119
4155
|
}).passthrough())
|
|
4120
4156
|
}).passthrough();
|
|
4121
4157
|
InitializeResultSchema = ResultSchema.extend({
|
|
4122
|
-
protocolVersion:
|
|
4158
|
+
protocolVersion: exports_external.string(),
|
|
4123
4159
|
capabilities: ServerCapabilitiesSchema,
|
|
4124
4160
|
serverInfo: ImplementationSchema,
|
|
4125
|
-
instructions:
|
|
4161
|
+
instructions: exports_external.optional(exports_external.string())
|
|
4126
4162
|
});
|
|
4127
4163
|
InitializedNotificationSchema = NotificationSchema.extend({
|
|
4128
|
-
method:
|
|
4164
|
+
method: exports_external.literal("notifications/initialized")
|
|
4129
4165
|
});
|
|
4130
4166
|
PingRequestSchema = RequestSchema.extend({
|
|
4131
|
-
method:
|
|
4167
|
+
method: exports_external.literal("ping")
|
|
4132
4168
|
});
|
|
4133
|
-
ProgressSchema =
|
|
4134
|
-
progress:
|
|
4135
|
-
total:
|
|
4169
|
+
ProgressSchema = exports_external.object({
|
|
4170
|
+
progress: exports_external.number(),
|
|
4171
|
+
total: exports_external.optional(exports_external.number())
|
|
4136
4172
|
}).passthrough();
|
|
4137
4173
|
ProgressNotificationSchema = NotificationSchema.extend({
|
|
4138
|
-
method:
|
|
4174
|
+
method: exports_external.literal("notifications/progress"),
|
|
4139
4175
|
params: BaseNotificationParamsSchema.merge(ProgressSchema).extend({
|
|
4140
4176
|
progressToken: ProgressTokenSchema
|
|
4141
4177
|
})
|
|
4142
4178
|
});
|
|
4143
4179
|
PaginatedRequestSchema = RequestSchema.extend({
|
|
4144
4180
|
params: BaseRequestParamsSchema.extend({
|
|
4145
|
-
cursor:
|
|
4181
|
+
cursor: exports_external.optional(CursorSchema)
|
|
4146
4182
|
}).optional()
|
|
4147
4183
|
});
|
|
4148
4184
|
PaginatedResultSchema = ResultSchema.extend({
|
|
4149
|
-
nextCursor:
|
|
4185
|
+
nextCursor: exports_external.optional(CursorSchema)
|
|
4150
4186
|
});
|
|
4151
|
-
ResourceContentsSchema =
|
|
4152
|
-
uri:
|
|
4153
|
-
mimeType:
|
|
4187
|
+
ResourceContentsSchema = exports_external.object({
|
|
4188
|
+
uri: exports_external.string(),
|
|
4189
|
+
mimeType: exports_external.optional(exports_external.string())
|
|
4154
4190
|
}).passthrough();
|
|
4155
4191
|
TextResourceContentsSchema = ResourceContentsSchema.extend({
|
|
4156
|
-
text:
|
|
4192
|
+
text: exports_external.string()
|
|
4157
4193
|
});
|
|
4158
4194
|
BlobResourceContentsSchema = ResourceContentsSchema.extend({
|
|
4159
|
-
blob:
|
|
4195
|
+
blob: exports_external.string().base64()
|
|
4160
4196
|
});
|
|
4161
|
-
ResourceSchema =
|
|
4162
|
-
uri:
|
|
4163
|
-
name:
|
|
4164
|
-
description:
|
|
4165
|
-
mimeType:
|
|
4197
|
+
ResourceSchema = exports_external.object({
|
|
4198
|
+
uri: exports_external.string(),
|
|
4199
|
+
name: exports_external.string(),
|
|
4200
|
+
description: exports_external.optional(exports_external.string()),
|
|
4201
|
+
mimeType: exports_external.optional(exports_external.string())
|
|
4166
4202
|
}).passthrough();
|
|
4167
|
-
ResourceTemplateSchema =
|
|
4168
|
-
uriTemplate:
|
|
4169
|
-
name:
|
|
4170
|
-
description:
|
|
4171
|
-
mimeType:
|
|
4203
|
+
ResourceTemplateSchema = exports_external.object({
|
|
4204
|
+
uriTemplate: exports_external.string(),
|
|
4205
|
+
name: exports_external.string(),
|
|
4206
|
+
description: exports_external.optional(exports_external.string()),
|
|
4207
|
+
mimeType: exports_external.optional(exports_external.string())
|
|
4172
4208
|
}).passthrough();
|
|
4173
4209
|
ListResourcesRequestSchema = PaginatedRequestSchema.extend({
|
|
4174
|
-
method:
|
|
4210
|
+
method: exports_external.literal("resources/list")
|
|
4175
4211
|
});
|
|
4176
4212
|
ListResourcesResultSchema = PaginatedResultSchema.extend({
|
|
4177
|
-
resources:
|
|
4213
|
+
resources: exports_external.array(ResourceSchema)
|
|
4178
4214
|
});
|
|
4179
4215
|
ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
|
|
4180
|
-
method:
|
|
4216
|
+
method: exports_external.literal("resources/templates/list")
|
|
4181
4217
|
});
|
|
4182
4218
|
ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
|
|
4183
|
-
resourceTemplates:
|
|
4219
|
+
resourceTemplates: exports_external.array(ResourceTemplateSchema)
|
|
4184
4220
|
});
|
|
4185
4221
|
ReadResourceRequestSchema = RequestSchema.extend({
|
|
4186
|
-
method:
|
|
4222
|
+
method: exports_external.literal("resources/read"),
|
|
4187
4223
|
params: BaseRequestParamsSchema.extend({
|
|
4188
|
-
uri:
|
|
4224
|
+
uri: exports_external.string()
|
|
4189
4225
|
})
|
|
4190
4226
|
});
|
|
4191
4227
|
ReadResourceResultSchema = ResultSchema.extend({
|
|
4192
|
-
contents:
|
|
4228
|
+
contents: exports_external.array(exports_external.union([TextResourceContentsSchema, BlobResourceContentsSchema]))
|
|
4193
4229
|
});
|
|
4194
4230
|
ResourceListChangedNotificationSchema = NotificationSchema.extend({
|
|
4195
|
-
method:
|
|
4231
|
+
method: exports_external.literal("notifications/resources/list_changed")
|
|
4196
4232
|
});
|
|
4197
4233
|
SubscribeRequestSchema = RequestSchema.extend({
|
|
4198
|
-
method:
|
|
4234
|
+
method: exports_external.literal("resources/subscribe"),
|
|
4199
4235
|
params: BaseRequestParamsSchema.extend({
|
|
4200
|
-
uri:
|
|
4236
|
+
uri: exports_external.string()
|
|
4201
4237
|
})
|
|
4202
4238
|
});
|
|
4203
4239
|
UnsubscribeRequestSchema = RequestSchema.extend({
|
|
4204
|
-
method:
|
|
4240
|
+
method: exports_external.literal("resources/unsubscribe"),
|
|
4205
4241
|
params: BaseRequestParamsSchema.extend({
|
|
4206
|
-
uri:
|
|
4242
|
+
uri: exports_external.string()
|
|
4207
4243
|
})
|
|
4208
4244
|
});
|
|
4209
4245
|
ResourceUpdatedNotificationSchema = NotificationSchema.extend({
|
|
4210
|
-
method:
|
|
4246
|
+
method: exports_external.literal("notifications/resources/updated"),
|
|
4211
4247
|
params: BaseNotificationParamsSchema.extend({
|
|
4212
|
-
uri:
|
|
4248
|
+
uri: exports_external.string()
|
|
4213
4249
|
})
|
|
4214
4250
|
});
|
|
4215
|
-
PromptArgumentSchema =
|
|
4216
|
-
name:
|
|
4217
|
-
description:
|
|
4218
|
-
required:
|
|
4251
|
+
PromptArgumentSchema = exports_external.object({
|
|
4252
|
+
name: exports_external.string(),
|
|
4253
|
+
description: exports_external.optional(exports_external.string()),
|
|
4254
|
+
required: exports_external.optional(exports_external.boolean())
|
|
4219
4255
|
}).passthrough();
|
|
4220
|
-
PromptSchema =
|
|
4221
|
-
name:
|
|
4222
|
-
description:
|
|
4223
|
-
arguments:
|
|
4256
|
+
PromptSchema = exports_external.object({
|
|
4257
|
+
name: exports_external.string(),
|
|
4258
|
+
description: exports_external.optional(exports_external.string()),
|
|
4259
|
+
arguments: exports_external.optional(exports_external.array(PromptArgumentSchema))
|
|
4224
4260
|
}).passthrough();
|
|
4225
4261
|
ListPromptsRequestSchema = PaginatedRequestSchema.extend({
|
|
4226
|
-
method:
|
|
4262
|
+
method: exports_external.literal("prompts/list")
|
|
4227
4263
|
});
|
|
4228
4264
|
ListPromptsResultSchema = PaginatedResultSchema.extend({
|
|
4229
|
-
prompts:
|
|
4265
|
+
prompts: exports_external.array(PromptSchema)
|
|
4230
4266
|
});
|
|
4231
4267
|
GetPromptRequestSchema = RequestSchema.extend({
|
|
4232
|
-
method:
|
|
4268
|
+
method: exports_external.literal("prompts/get"),
|
|
4233
4269
|
params: BaseRequestParamsSchema.extend({
|
|
4234
|
-
name:
|
|
4235
|
-
arguments:
|
|
4270
|
+
name: exports_external.string(),
|
|
4271
|
+
arguments: exports_external.optional(exports_external.record(exports_external.string()))
|
|
4236
4272
|
})
|
|
4237
4273
|
});
|
|
4238
|
-
TextContentSchema =
|
|
4239
|
-
type:
|
|
4240
|
-
text:
|
|
4274
|
+
TextContentSchema = exports_external.object({
|
|
4275
|
+
type: exports_external.literal("text"),
|
|
4276
|
+
text: exports_external.string()
|
|
4241
4277
|
}).passthrough();
|
|
4242
|
-
ImageContentSchema =
|
|
4243
|
-
type:
|
|
4244
|
-
data:
|
|
4245
|
-
mimeType:
|
|
4278
|
+
ImageContentSchema = exports_external.object({
|
|
4279
|
+
type: exports_external.literal("image"),
|
|
4280
|
+
data: exports_external.string().base64(),
|
|
4281
|
+
mimeType: exports_external.string()
|
|
4246
4282
|
}).passthrough();
|
|
4247
|
-
AudioContentSchema =
|
|
4248
|
-
type:
|
|
4249
|
-
data:
|
|
4250
|
-
mimeType:
|
|
4283
|
+
AudioContentSchema = exports_external.object({
|
|
4284
|
+
type: exports_external.literal("audio"),
|
|
4285
|
+
data: exports_external.string().base64(),
|
|
4286
|
+
mimeType: exports_external.string()
|
|
4251
4287
|
}).passthrough();
|
|
4252
|
-
EmbeddedResourceSchema =
|
|
4253
|
-
type:
|
|
4254
|
-
resource:
|
|
4288
|
+
EmbeddedResourceSchema = exports_external.object({
|
|
4289
|
+
type: exports_external.literal("resource"),
|
|
4290
|
+
resource: exports_external.union([TextResourceContentsSchema, BlobResourceContentsSchema])
|
|
4255
4291
|
}).passthrough();
|
|
4256
|
-
PromptMessageSchema =
|
|
4257
|
-
role:
|
|
4258
|
-
content:
|
|
4292
|
+
PromptMessageSchema = exports_external.object({
|
|
4293
|
+
role: exports_external.enum(["user", "assistant"]),
|
|
4294
|
+
content: exports_external.union([
|
|
4259
4295
|
TextContentSchema,
|
|
4260
4296
|
ImageContentSchema,
|
|
4261
4297
|
AudioContentSchema,
|
|
@@ -4263,44 +4299,44 @@ var init_types = __esm(() => {
|
|
|
4263
4299
|
])
|
|
4264
4300
|
}).passthrough();
|
|
4265
4301
|
GetPromptResultSchema = ResultSchema.extend({
|
|
4266
|
-
description:
|
|
4267
|
-
messages:
|
|
4302
|
+
description: exports_external.optional(exports_external.string()),
|
|
4303
|
+
messages: exports_external.array(PromptMessageSchema)
|
|
4268
4304
|
});
|
|
4269
4305
|
PromptListChangedNotificationSchema = NotificationSchema.extend({
|
|
4270
|
-
method:
|
|
4306
|
+
method: exports_external.literal("notifications/prompts/list_changed")
|
|
4271
4307
|
});
|
|
4272
|
-
ToolSchema =
|
|
4273
|
-
name:
|
|
4274
|
-
description:
|
|
4275
|
-
inputSchema:
|
|
4276
|
-
type:
|
|
4277
|
-
properties:
|
|
4308
|
+
ToolSchema = exports_external.object({
|
|
4309
|
+
name: exports_external.string(),
|
|
4310
|
+
description: exports_external.optional(exports_external.string()),
|
|
4311
|
+
inputSchema: exports_external.object({
|
|
4312
|
+
type: exports_external.literal("object"),
|
|
4313
|
+
properties: exports_external.optional(exports_external.object({}).passthrough())
|
|
4278
4314
|
}).passthrough()
|
|
4279
4315
|
}).passthrough();
|
|
4280
4316
|
ListToolsRequestSchema = PaginatedRequestSchema.extend({
|
|
4281
|
-
method:
|
|
4317
|
+
method: exports_external.literal("tools/list")
|
|
4282
4318
|
});
|
|
4283
4319
|
ListToolsResultSchema = PaginatedResultSchema.extend({
|
|
4284
|
-
tools:
|
|
4320
|
+
tools: exports_external.array(ToolSchema)
|
|
4285
4321
|
});
|
|
4286
4322
|
CallToolResultSchema = ResultSchema.extend({
|
|
4287
|
-
content:
|
|
4288
|
-
isError:
|
|
4323
|
+
content: exports_external.array(exports_external.union([TextContentSchema, ImageContentSchema, AudioContentSchema, EmbeddedResourceSchema])),
|
|
4324
|
+
isError: exports_external.boolean().default(false).optional()
|
|
4289
4325
|
});
|
|
4290
4326
|
CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
|
|
4291
|
-
toolResult:
|
|
4327
|
+
toolResult: exports_external.unknown()
|
|
4292
4328
|
}));
|
|
4293
4329
|
CallToolRequestSchema = RequestSchema.extend({
|
|
4294
|
-
method:
|
|
4330
|
+
method: exports_external.literal("tools/call"),
|
|
4295
4331
|
params: BaseRequestParamsSchema.extend({
|
|
4296
|
-
name:
|
|
4297
|
-
arguments:
|
|
4332
|
+
name: exports_external.string(),
|
|
4333
|
+
arguments: exports_external.optional(exports_external.record(exports_external.unknown()))
|
|
4298
4334
|
})
|
|
4299
4335
|
});
|
|
4300
4336
|
ToolListChangedNotificationSchema = NotificationSchema.extend({
|
|
4301
|
-
method:
|
|
4337
|
+
method: exports_external.literal("notifications/tools/list_changed")
|
|
4302
4338
|
});
|
|
4303
|
-
LoggingLevelSchema =
|
|
4339
|
+
LoggingLevelSchema = exports_external.enum([
|
|
4304
4340
|
"debug",
|
|
4305
4341
|
"info",
|
|
4306
4342
|
"notice",
|
|
@@ -4311,94 +4347,94 @@ var init_types = __esm(() => {
|
|
|
4311
4347
|
"emergency"
|
|
4312
4348
|
]);
|
|
4313
4349
|
SetLevelRequestSchema = RequestSchema.extend({
|
|
4314
|
-
method:
|
|
4350
|
+
method: exports_external.literal("logging/setLevel"),
|
|
4315
4351
|
params: BaseRequestParamsSchema.extend({
|
|
4316
4352
|
level: LoggingLevelSchema
|
|
4317
4353
|
})
|
|
4318
4354
|
});
|
|
4319
4355
|
LoggingMessageNotificationSchema = NotificationSchema.extend({
|
|
4320
|
-
method:
|
|
4356
|
+
method: exports_external.literal("notifications/message"),
|
|
4321
4357
|
params: BaseNotificationParamsSchema.extend({
|
|
4322
4358
|
level: LoggingLevelSchema,
|
|
4323
|
-
logger:
|
|
4324
|
-
data:
|
|
4359
|
+
logger: exports_external.optional(exports_external.string()),
|
|
4360
|
+
data: exports_external.unknown()
|
|
4325
4361
|
})
|
|
4326
4362
|
});
|
|
4327
|
-
ModelHintSchema =
|
|
4328
|
-
name:
|
|
4363
|
+
ModelHintSchema = exports_external.object({
|
|
4364
|
+
name: exports_external.string().optional()
|
|
4329
4365
|
}).passthrough();
|
|
4330
|
-
ModelPreferencesSchema =
|
|
4331
|
-
hints:
|
|
4332
|
-
costPriority:
|
|
4333
|
-
speedPriority:
|
|
4334
|
-
intelligencePriority:
|
|
4366
|
+
ModelPreferencesSchema = exports_external.object({
|
|
4367
|
+
hints: exports_external.optional(exports_external.array(ModelHintSchema)),
|
|
4368
|
+
costPriority: exports_external.optional(exports_external.number().min(0).max(1)),
|
|
4369
|
+
speedPriority: exports_external.optional(exports_external.number().min(0).max(1)),
|
|
4370
|
+
intelligencePriority: exports_external.optional(exports_external.number().min(0).max(1))
|
|
4335
4371
|
}).passthrough();
|
|
4336
|
-
SamplingMessageSchema =
|
|
4337
|
-
role:
|
|
4338
|
-
content:
|
|
4372
|
+
SamplingMessageSchema = exports_external.object({
|
|
4373
|
+
role: exports_external.enum(["user", "assistant"]),
|
|
4374
|
+
content: exports_external.union([TextContentSchema, ImageContentSchema, AudioContentSchema])
|
|
4339
4375
|
}).passthrough();
|
|
4340
4376
|
CreateMessageRequestSchema = RequestSchema.extend({
|
|
4341
|
-
method:
|
|
4377
|
+
method: exports_external.literal("sampling/createMessage"),
|
|
4342
4378
|
params: BaseRequestParamsSchema.extend({
|
|
4343
|
-
messages:
|
|
4344
|
-
systemPrompt:
|
|
4345
|
-
includeContext:
|
|
4346
|
-
temperature:
|
|
4347
|
-
maxTokens:
|
|
4348
|
-
stopSequences:
|
|
4349
|
-
metadata:
|
|
4350
|
-
modelPreferences:
|
|
4379
|
+
messages: exports_external.array(SamplingMessageSchema),
|
|
4380
|
+
systemPrompt: exports_external.optional(exports_external.string()),
|
|
4381
|
+
includeContext: exports_external.optional(exports_external.enum(["none", "thisServer", "allServers"])),
|
|
4382
|
+
temperature: exports_external.optional(exports_external.number()),
|
|
4383
|
+
maxTokens: exports_external.number().int(),
|
|
4384
|
+
stopSequences: exports_external.optional(exports_external.array(exports_external.string())),
|
|
4385
|
+
metadata: exports_external.optional(exports_external.object({}).passthrough()),
|
|
4386
|
+
modelPreferences: exports_external.optional(ModelPreferencesSchema)
|
|
4351
4387
|
})
|
|
4352
4388
|
});
|
|
4353
4389
|
CreateMessageResultSchema = ResultSchema.extend({
|
|
4354
|
-
model:
|
|
4355
|
-
stopReason:
|
|
4356
|
-
role:
|
|
4357
|
-
content:
|
|
4390
|
+
model: exports_external.string(),
|
|
4391
|
+
stopReason: exports_external.optional(exports_external.enum(["endTurn", "stopSequence", "maxTokens"]).or(exports_external.string())),
|
|
4392
|
+
role: exports_external.enum(["user", "assistant"]),
|
|
4393
|
+
content: exports_external.discriminatedUnion("type", [
|
|
4358
4394
|
TextContentSchema,
|
|
4359
4395
|
ImageContentSchema,
|
|
4360
4396
|
AudioContentSchema
|
|
4361
4397
|
])
|
|
4362
4398
|
});
|
|
4363
|
-
ResourceReferenceSchema =
|
|
4364
|
-
type:
|
|
4365
|
-
uri:
|
|
4399
|
+
ResourceReferenceSchema = exports_external.object({
|
|
4400
|
+
type: exports_external.literal("ref/resource"),
|
|
4401
|
+
uri: exports_external.string()
|
|
4366
4402
|
}).passthrough();
|
|
4367
|
-
PromptReferenceSchema =
|
|
4368
|
-
type:
|
|
4369
|
-
name:
|
|
4403
|
+
PromptReferenceSchema = exports_external.object({
|
|
4404
|
+
type: exports_external.literal("ref/prompt"),
|
|
4405
|
+
name: exports_external.string()
|
|
4370
4406
|
}).passthrough();
|
|
4371
4407
|
CompleteRequestSchema = RequestSchema.extend({
|
|
4372
|
-
method:
|
|
4408
|
+
method: exports_external.literal("completion/complete"),
|
|
4373
4409
|
params: BaseRequestParamsSchema.extend({
|
|
4374
|
-
ref:
|
|
4375
|
-
argument:
|
|
4376
|
-
name:
|
|
4377
|
-
value:
|
|
4410
|
+
ref: exports_external.union([PromptReferenceSchema, ResourceReferenceSchema]),
|
|
4411
|
+
argument: exports_external.object({
|
|
4412
|
+
name: exports_external.string(),
|
|
4413
|
+
value: exports_external.string()
|
|
4378
4414
|
}).passthrough()
|
|
4379
4415
|
})
|
|
4380
4416
|
});
|
|
4381
4417
|
CompleteResultSchema = ResultSchema.extend({
|
|
4382
|
-
completion:
|
|
4383
|
-
values:
|
|
4384
|
-
total:
|
|
4385
|
-
hasMore:
|
|
4418
|
+
completion: exports_external.object({
|
|
4419
|
+
values: exports_external.array(exports_external.string()).max(100),
|
|
4420
|
+
total: exports_external.optional(exports_external.number().int()),
|
|
4421
|
+
hasMore: exports_external.optional(exports_external.boolean())
|
|
4386
4422
|
}).passthrough()
|
|
4387
4423
|
});
|
|
4388
|
-
RootSchema =
|
|
4389
|
-
uri:
|
|
4390
|
-
name:
|
|
4424
|
+
RootSchema = exports_external.object({
|
|
4425
|
+
uri: exports_external.string().startsWith("file://"),
|
|
4426
|
+
name: exports_external.optional(exports_external.string())
|
|
4391
4427
|
}).passthrough();
|
|
4392
4428
|
ListRootsRequestSchema = RequestSchema.extend({
|
|
4393
|
-
method:
|
|
4429
|
+
method: exports_external.literal("roots/list")
|
|
4394
4430
|
});
|
|
4395
4431
|
ListRootsResultSchema = ResultSchema.extend({
|
|
4396
|
-
roots:
|
|
4432
|
+
roots: exports_external.array(RootSchema)
|
|
4397
4433
|
});
|
|
4398
4434
|
RootsListChangedNotificationSchema = NotificationSchema.extend({
|
|
4399
|
-
method:
|
|
4435
|
+
method: exports_external.literal("notifications/roots/list_changed")
|
|
4400
4436
|
});
|
|
4401
|
-
ClientRequestSchema =
|
|
4437
|
+
ClientRequestSchema = exports_external.union([
|
|
4402
4438
|
PingRequestSchema,
|
|
4403
4439
|
InitializeRequestSchema,
|
|
4404
4440
|
CompleteRequestSchema,
|
|
@@ -4413,23 +4449,23 @@ var init_types = __esm(() => {
|
|
|
4413
4449
|
CallToolRequestSchema,
|
|
4414
4450
|
ListToolsRequestSchema
|
|
4415
4451
|
]);
|
|
4416
|
-
ClientNotificationSchema =
|
|
4452
|
+
ClientNotificationSchema = exports_external.union([
|
|
4417
4453
|
CancelledNotificationSchema,
|
|
4418
4454
|
ProgressNotificationSchema,
|
|
4419
4455
|
InitializedNotificationSchema,
|
|
4420
4456
|
RootsListChangedNotificationSchema
|
|
4421
4457
|
]);
|
|
4422
|
-
ClientResultSchema =
|
|
4458
|
+
ClientResultSchema = exports_external.union([
|
|
4423
4459
|
EmptyResultSchema,
|
|
4424
4460
|
CreateMessageResultSchema,
|
|
4425
4461
|
ListRootsResultSchema
|
|
4426
4462
|
]);
|
|
4427
|
-
ServerRequestSchema =
|
|
4463
|
+
ServerRequestSchema = exports_external.union([
|
|
4428
4464
|
PingRequestSchema,
|
|
4429
4465
|
CreateMessageRequestSchema,
|
|
4430
4466
|
ListRootsRequestSchema
|
|
4431
4467
|
]);
|
|
4432
|
-
ServerNotificationSchema =
|
|
4468
|
+
ServerNotificationSchema = exports_external.union([
|
|
4433
4469
|
CancelledNotificationSchema,
|
|
4434
4470
|
ProgressNotificationSchema,
|
|
4435
4471
|
LoggingMessageNotificationSchema,
|
|
@@ -4438,7 +4474,7 @@ var init_types = __esm(() => {
|
|
|
4438
4474
|
ToolListChangedNotificationSchema,
|
|
4439
4475
|
PromptListChangedNotificationSchema
|
|
4440
4476
|
]);
|
|
4441
|
-
ServerResultSchema =
|
|
4477
|
+
ServerResultSchema = exports_external.union([
|
|
4442
4478
|
EmptyResultSchema,
|
|
4443
4479
|
InitializeResultSchema,
|
|
4444
4480
|
CompleteResultSchema,
|
|
@@ -5053,14 +5089,14 @@ var require_inherits_browser = __commonJS((exports, module) => {
|
|
|
5053
5089
|
// node_modules/inherits/inherits.js
|
|
5054
5090
|
var require_inherits = __commonJS((exports, module) => {
|
|
5055
5091
|
try {
|
|
5056
|
-
|
|
5057
|
-
if (typeof
|
|
5092
|
+
util3 = __require("util");
|
|
5093
|
+
if (typeof util3.inherits !== "function")
|
|
5058
5094
|
throw "";
|
|
5059
|
-
module.exports =
|
|
5095
|
+
module.exports = util3.inherits;
|
|
5060
5096
|
} catch (e) {
|
|
5061
5097
|
module.exports = require_inherits_browser();
|
|
5062
5098
|
}
|
|
5063
|
-
var
|
|
5099
|
+
var util3;
|
|
5064
5100
|
});
|
|
5065
5101
|
|
|
5066
5102
|
// node_modules/toidentifier/index.js
|
|
@@ -9194,7 +9230,7 @@ data: ${JSON.stringify(message)}
|
|
|
9194
9230
|
}
|
|
9195
9231
|
var import_raw_body, import_content_type, MAXIMUM_MESSAGE_SIZE = "4mb";
|
|
9196
9232
|
var init_sse = __esm(() => {
|
|
9197
|
-
|
|
9233
|
+
init_types2();
|
|
9198
9234
|
import_raw_body = __toESM(require_raw_body(), 1);
|
|
9199
9235
|
import_content_type = __toESM(require_content_type(), 1);
|
|
9200
9236
|
});
|
|
@@ -9229,7 +9265,7 @@ function serializeMessage(message) {
|
|
|
9229
9265
|
`;
|
|
9230
9266
|
}
|
|
9231
9267
|
var init_stdio = __esm(() => {
|
|
9232
|
-
|
|
9268
|
+
init_types2();
|
|
9233
9269
|
});
|
|
9234
9270
|
|
|
9235
9271
|
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
@@ -9583,7 +9619,7 @@ var require_browser = __commonJS((exports, module) => {
|
|
|
9583
9619
|
// node_modules/body-parser/node_modules/debug/src/node.js
|
|
9584
9620
|
var require_node = __commonJS((exports, module) => {
|
|
9585
9621
|
var tty = __require("tty");
|
|
9586
|
-
var
|
|
9622
|
+
var util3 = __require("util");
|
|
9587
9623
|
exports = module.exports = require_debug();
|
|
9588
9624
|
exports.init = init;
|
|
9589
9625
|
exports.log = log2;
|
|
@@ -9612,7 +9648,7 @@ var require_node = __commonJS((exports, module) => {
|
|
|
9612
9648
|
}, {});
|
|
9613
9649
|
var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
|
|
9614
9650
|
if (fd !== 1 && fd !== 2) {
|
|
9615
|
-
|
|
9651
|
+
util3.deprecate(function() {}, "except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)")();
|
|
9616
9652
|
}
|
|
9617
9653
|
var stream = fd === 1 ? process.stdout : fd === 2 ? process.stderr : createWritableStdioStream(fd);
|
|
9618
9654
|
function useColors() {
|
|
@@ -9620,14 +9656,14 @@ var require_node = __commonJS((exports, module) => {
|
|
|
9620
9656
|
}
|
|
9621
9657
|
exports.formatters.o = function(v2) {
|
|
9622
9658
|
this.inspectOpts.colors = this.useColors;
|
|
9623
|
-
return
|
|
9659
|
+
return util3.inspect(v2, this.inspectOpts).split(`
|
|
9624
9660
|
`).map(function(str) {
|
|
9625
9661
|
return str.trim();
|
|
9626
9662
|
}).join(" ");
|
|
9627
9663
|
};
|
|
9628
9664
|
exports.formatters.O = function(v2) {
|
|
9629
9665
|
this.inspectOpts.colors = this.useColors;
|
|
9630
|
-
return
|
|
9666
|
+
return util3.inspect(v2, this.inspectOpts);
|
|
9631
9667
|
};
|
|
9632
9668
|
function formatArgs(args) {
|
|
9633
9669
|
var name = this.namespace;
|
|
@@ -9644,7 +9680,7 @@ var require_node = __commonJS((exports, module) => {
|
|
|
9644
9680
|
}
|
|
9645
9681
|
}
|
|
9646
9682
|
function log2() {
|
|
9647
|
-
return stream.write(
|
|
9683
|
+
return stream.write(util3.format.apply(util3, arguments) + `
|
|
9648
9684
|
`);
|
|
9649
9685
|
}
|
|
9650
9686
|
function save(namespaces) {
|
|
@@ -22270,7 +22306,7 @@ var require_mime_types = __commonJS((exports) => {
|
|
|
22270
22306
|
}
|
|
22271
22307
|
return exports.types[extension2] || false;
|
|
22272
22308
|
}
|
|
22273
|
-
function populateMaps(extensions,
|
|
22309
|
+
function populateMaps(extensions, types2) {
|
|
22274
22310
|
var preference = ["nginx", "apache", undefined, "iana"];
|
|
22275
22311
|
Object.keys(db).forEach(function forEachMimeType(type) {
|
|
22276
22312
|
var mime = db[type];
|
|
@@ -22281,14 +22317,14 @@ var require_mime_types = __commonJS((exports) => {
|
|
|
22281
22317
|
extensions[type] = exts;
|
|
22282
22318
|
for (var i = 0;i < exts.length; i++) {
|
|
22283
22319
|
var extension2 = exts[i];
|
|
22284
|
-
if (
|
|
22285
|
-
var from = preference.indexOf(db[
|
|
22320
|
+
if (types2[extension2]) {
|
|
22321
|
+
var from = preference.indexOf(db[types2[extension2]].source);
|
|
22286
22322
|
var to = preference.indexOf(mime.source);
|
|
22287
|
-
if (
|
|
22323
|
+
if (types2[extension2] !== "application/octet-stream" && (from > to || from === to && types2[extension2].substr(0, 12) === "application/")) {
|
|
22288
22324
|
continue;
|
|
22289
22325
|
}
|
|
22290
22326
|
}
|
|
22291
|
-
|
|
22327
|
+
types2[extension2] = type;
|
|
22292
22328
|
}
|
|
22293
22329
|
});
|
|
22294
22330
|
}
|
|
@@ -22311,23 +22347,23 @@ var require_type_is = __commonJS((exports, module) => {
|
|
|
22311
22347
|
module.exports.match = mimeMatch;
|
|
22312
22348
|
function typeis(value, types_) {
|
|
22313
22349
|
var i;
|
|
22314
|
-
var
|
|
22350
|
+
var types2 = types_;
|
|
22315
22351
|
var val = tryNormalizeType(value);
|
|
22316
22352
|
if (!val) {
|
|
22317
22353
|
return false;
|
|
22318
22354
|
}
|
|
22319
|
-
if (
|
|
22320
|
-
|
|
22321
|
-
for (i = 0;i <
|
|
22322
|
-
|
|
22355
|
+
if (types2 && !Array.isArray(types2)) {
|
|
22356
|
+
types2 = new Array(arguments.length - 1);
|
|
22357
|
+
for (i = 0;i < types2.length; i++) {
|
|
22358
|
+
types2[i] = arguments[i + 1];
|
|
22323
22359
|
}
|
|
22324
22360
|
}
|
|
22325
|
-
if (!
|
|
22361
|
+
if (!types2 || !types2.length) {
|
|
22326
22362
|
return val;
|
|
22327
22363
|
}
|
|
22328
22364
|
var type;
|
|
22329
|
-
for (i = 0;i <
|
|
22330
|
-
if (mimeMatch(normalize(type =
|
|
22365
|
+
for (i = 0;i < types2.length; i++) {
|
|
22366
|
+
if (mimeMatch(normalize(type = types2[i]), val)) {
|
|
22331
22367
|
return type[0] === "+" || type.indexOf("*") !== -1 ? val : type;
|
|
22332
22368
|
}
|
|
22333
22369
|
}
|
|
@@ -22337,18 +22373,18 @@ var require_type_is = __commonJS((exports, module) => {
|
|
|
22337
22373
|
return req.headers["transfer-encoding"] !== undefined || !isNaN(req.headers["content-length"]);
|
|
22338
22374
|
}
|
|
22339
22375
|
function typeofrequest(req, types_) {
|
|
22340
|
-
var
|
|
22376
|
+
var types2 = types_;
|
|
22341
22377
|
if (!hasbody(req)) {
|
|
22342
22378
|
return null;
|
|
22343
22379
|
}
|
|
22344
22380
|
if (arguments.length > 2) {
|
|
22345
|
-
|
|
22346
|
-
for (var i = 0;i <
|
|
22347
|
-
|
|
22381
|
+
types2 = new Array(arguments.length - 1);
|
|
22382
|
+
for (var i = 0;i < types2.length; i++) {
|
|
22383
|
+
types2[i] = arguments[i + 1];
|
|
22348
22384
|
}
|
|
22349
22385
|
}
|
|
22350
22386
|
var value = req.headers["content-type"];
|
|
22351
|
-
return typeis(value,
|
|
22387
|
+
return typeis(value, types2);
|
|
22352
22388
|
}
|
|
22353
22389
|
function normalize(type) {
|
|
22354
22390
|
if (typeof type !== "string") {
|
|
@@ -25390,7 +25426,7 @@ var require_browser2 = __commonJS((exports, module) => {
|
|
|
25390
25426
|
// node_modules/finalhandler/node_modules/debug/src/node.js
|
|
25391
25427
|
var require_node2 = __commonJS((exports, module) => {
|
|
25392
25428
|
var tty = __require("tty");
|
|
25393
|
-
var
|
|
25429
|
+
var util3 = __require("util");
|
|
25394
25430
|
exports = module.exports = require_debug2();
|
|
25395
25431
|
exports.init = init;
|
|
25396
25432
|
exports.log = log2;
|
|
@@ -25419,7 +25455,7 @@ var require_node2 = __commonJS((exports, module) => {
|
|
|
25419
25455
|
}, {});
|
|
25420
25456
|
var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
|
|
25421
25457
|
if (fd !== 1 && fd !== 2) {
|
|
25422
|
-
|
|
25458
|
+
util3.deprecate(function() {}, "except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)")();
|
|
25423
25459
|
}
|
|
25424
25460
|
var stream = fd === 1 ? process.stdout : fd === 2 ? process.stderr : createWritableStdioStream(fd);
|
|
25425
25461
|
function useColors() {
|
|
@@ -25427,14 +25463,14 @@ var require_node2 = __commonJS((exports, module) => {
|
|
|
25427
25463
|
}
|
|
25428
25464
|
exports.formatters.o = function(v2) {
|
|
25429
25465
|
this.inspectOpts.colors = this.useColors;
|
|
25430
|
-
return
|
|
25466
|
+
return util3.inspect(v2, this.inspectOpts).split(`
|
|
25431
25467
|
`).map(function(str) {
|
|
25432
25468
|
return str.trim();
|
|
25433
25469
|
}).join(" ");
|
|
25434
25470
|
};
|
|
25435
25471
|
exports.formatters.O = function(v2) {
|
|
25436
25472
|
this.inspectOpts.colors = this.useColors;
|
|
25437
|
-
return
|
|
25473
|
+
return util3.inspect(v2, this.inspectOpts);
|
|
25438
25474
|
};
|
|
25439
25475
|
function formatArgs(args) {
|
|
25440
25476
|
var name = this.namespace;
|
|
@@ -25451,7 +25487,7 @@ var require_node2 = __commonJS((exports, module) => {
|
|
|
25451
25487
|
}
|
|
25452
25488
|
}
|
|
25453
25489
|
function log2() {
|
|
25454
|
-
return stream.write(
|
|
25490
|
+
return stream.write(util3.format.apply(util3, arguments) + `
|
|
25455
25491
|
`);
|
|
25456
25492
|
}
|
|
25457
25493
|
function save(namespaces) {
|
|
@@ -26116,7 +26152,7 @@ var require_browser3 = __commonJS((exports, module) => {
|
|
|
26116
26152
|
// node_modules/express/node_modules/debug/src/node.js
|
|
26117
26153
|
var require_node3 = __commonJS((exports, module) => {
|
|
26118
26154
|
var tty = __require("tty");
|
|
26119
|
-
var
|
|
26155
|
+
var util3 = __require("util");
|
|
26120
26156
|
exports = module.exports = require_debug3();
|
|
26121
26157
|
exports.init = init;
|
|
26122
26158
|
exports.log = log2;
|
|
@@ -26145,7 +26181,7 @@ var require_node3 = __commonJS((exports, module) => {
|
|
|
26145
26181
|
}, {});
|
|
26146
26182
|
var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
|
|
26147
26183
|
if (fd !== 1 && fd !== 2) {
|
|
26148
|
-
|
|
26184
|
+
util3.deprecate(function() {}, "except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)")();
|
|
26149
26185
|
}
|
|
26150
26186
|
var stream = fd === 1 ? process.stdout : fd === 2 ? process.stderr : createWritableStdioStream(fd);
|
|
26151
26187
|
function useColors() {
|
|
@@ -26153,14 +26189,14 @@ var require_node3 = __commonJS((exports, module) => {
|
|
|
26153
26189
|
}
|
|
26154
26190
|
exports.formatters.o = function(v2) {
|
|
26155
26191
|
this.inspectOpts.colors = this.useColors;
|
|
26156
|
-
return
|
|
26192
|
+
return util3.inspect(v2, this.inspectOpts).split(`
|
|
26157
26193
|
`).map(function(str) {
|
|
26158
26194
|
return str.trim();
|
|
26159
26195
|
}).join(" ");
|
|
26160
26196
|
};
|
|
26161
26197
|
exports.formatters.O = function(v2) {
|
|
26162
26198
|
this.inspectOpts.colors = this.useColors;
|
|
26163
|
-
return
|
|
26199
|
+
return util3.inspect(v2, this.inspectOpts);
|
|
26164
26200
|
};
|
|
26165
26201
|
function formatArgs(args) {
|
|
26166
26202
|
var name = this.namespace;
|
|
@@ -26177,7 +26213,7 @@ var require_node3 = __commonJS((exports, module) => {
|
|
|
26177
26213
|
}
|
|
26178
26214
|
}
|
|
26179
26215
|
function log2() {
|
|
26180
|
-
return stream.write(
|
|
26216
|
+
return stream.write(util3.format.apply(util3, arguments) + `
|
|
26181
26217
|
`);
|
|
26182
26218
|
}
|
|
26183
26219
|
function save(namespaces) {
|
|
@@ -27695,7 +27731,7 @@ var require_browser4 = __commonJS((exports, module) => {
|
|
|
27695
27731
|
// node_modules/send/node_modules/debug/src/node.js
|
|
27696
27732
|
var require_node4 = __commonJS((exports, module) => {
|
|
27697
27733
|
var tty = __require("tty");
|
|
27698
|
-
var
|
|
27734
|
+
var util3 = __require("util");
|
|
27699
27735
|
exports = module.exports = require_debug4();
|
|
27700
27736
|
exports.init = init;
|
|
27701
27737
|
exports.log = log2;
|
|
@@ -27724,7 +27760,7 @@ var require_node4 = __commonJS((exports, module) => {
|
|
|
27724
27760
|
}, {});
|
|
27725
27761
|
var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
|
|
27726
27762
|
if (fd !== 1 && fd !== 2) {
|
|
27727
|
-
|
|
27763
|
+
util3.deprecate(function() {}, "except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)")();
|
|
27728
27764
|
}
|
|
27729
27765
|
var stream = fd === 1 ? process.stdout : fd === 2 ? process.stderr : createWritableStdioStream(fd);
|
|
27730
27766
|
function useColors() {
|
|
@@ -27732,14 +27768,14 @@ var require_node4 = __commonJS((exports, module) => {
|
|
|
27732
27768
|
}
|
|
27733
27769
|
exports.formatters.o = function(v2) {
|
|
27734
27770
|
this.inspectOpts.colors = this.useColors;
|
|
27735
|
-
return
|
|
27771
|
+
return util3.inspect(v2, this.inspectOpts).split(`
|
|
27736
27772
|
`).map(function(str) {
|
|
27737
27773
|
return str.trim();
|
|
27738
27774
|
}).join(" ");
|
|
27739
27775
|
};
|
|
27740
27776
|
exports.formatters.O = function(v2) {
|
|
27741
27777
|
this.inspectOpts.colors = this.useColors;
|
|
27742
|
-
return
|
|
27778
|
+
return util3.inspect(v2, this.inspectOpts);
|
|
27743
27779
|
};
|
|
27744
27780
|
function formatArgs(args) {
|
|
27745
27781
|
var name = this.namespace;
|
|
@@ -27756,7 +27792,7 @@ var require_node4 = __commonJS((exports, module) => {
|
|
|
27756
27792
|
}
|
|
27757
27793
|
}
|
|
27758
27794
|
function log2() {
|
|
27759
|
-
return stream.write(
|
|
27795
|
+
return stream.write(util3.format.apply(util3, arguments) + `
|
|
27760
27796
|
`);
|
|
27761
27797
|
}
|
|
27762
27798
|
function save(namespaces) {
|
|
@@ -28237,7 +28273,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
28237
28273
|
var path = __require("path");
|
|
28238
28274
|
var statuses = require_statuses();
|
|
28239
28275
|
var Stream = __require("stream");
|
|
28240
|
-
var
|
|
28276
|
+
var util3 = __require("util");
|
|
28241
28277
|
var extname = path.extname;
|
|
28242
28278
|
var join = path.join;
|
|
28243
28279
|
var normalize = path.normalize;
|
|
@@ -28283,7 +28319,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
28283
28319
|
this.from(opts.from);
|
|
28284
28320
|
}
|
|
28285
28321
|
}
|
|
28286
|
-
|
|
28322
|
+
util3.inherits(SendStream, Stream);
|
|
28287
28323
|
SendStream.prototype.etag = deprecate.function(function etag(val) {
|
|
28288
28324
|
this._etag = Boolean(val);
|
|
28289
28325
|
debug("etag %s", this._etag);
|
|
@@ -29639,10 +29675,10 @@ var require_utils2 = __commonJS((exports) => {
|
|
|
29639
29675
|
exports.normalizeType = function(type) {
|
|
29640
29676
|
return ~type.indexOf("/") ? acceptParams(type) : { value: mime.lookup(type), params: {} };
|
|
29641
29677
|
};
|
|
29642
|
-
exports.normalizeTypes = function(
|
|
29678
|
+
exports.normalizeTypes = function(types2) {
|
|
29643
29679
|
var ret = [];
|
|
29644
|
-
for (var i = 0;i <
|
|
29645
|
-
ret.push(exports.normalizeType(
|
|
29680
|
+
for (var i = 0;i < types2.length; ++i) {
|
|
29681
|
+
ret.push(exports.normalizeType(types2[i]));
|
|
29646
29682
|
}
|
|
29647
29683
|
return ret;
|
|
29648
29684
|
};
|
|
@@ -30542,23 +30578,23 @@ var require_accepts = __commonJS((exports, module) => {
|
|
|
30542
30578
|
this.negotiator = new Negotiator(req);
|
|
30543
30579
|
}
|
|
30544
30580
|
Accepts.prototype.type = Accepts.prototype.types = function(types_) {
|
|
30545
|
-
var
|
|
30546
|
-
if (
|
|
30547
|
-
|
|
30548
|
-
for (var i = 0;i <
|
|
30549
|
-
|
|
30581
|
+
var types2 = types_;
|
|
30582
|
+
if (types2 && !Array.isArray(types2)) {
|
|
30583
|
+
types2 = new Array(arguments.length);
|
|
30584
|
+
for (var i = 0;i < types2.length; i++) {
|
|
30585
|
+
types2[i] = arguments[i];
|
|
30550
30586
|
}
|
|
30551
30587
|
}
|
|
30552
|
-
if (!
|
|
30588
|
+
if (!types2 || types2.length === 0) {
|
|
30553
30589
|
return this.negotiator.mediaTypes();
|
|
30554
30590
|
}
|
|
30555
30591
|
if (!this.headers.accept) {
|
|
30556
|
-
return
|
|
30592
|
+
return types2[0];
|
|
30557
30593
|
}
|
|
30558
|
-
var mimes =
|
|
30594
|
+
var mimes = types2.map(extToMime);
|
|
30559
30595
|
var accepts = this.negotiator.mediaTypes(mimes.filter(validMime));
|
|
30560
30596
|
var first = accepts[0];
|
|
30561
|
-
return first ?
|
|
30597
|
+
return first ? types2[mimes.indexOf(first)] : false;
|
|
30562
30598
|
};
|
|
30563
30599
|
Accepts.prototype.encoding = Accepts.prototype.encodings = function(encodings_) {
|
|
30564
30600
|
var encodings = encodings_;
|
|
@@ -30682,9 +30718,9 @@ var require_request = __commonJS((exports, module) => {
|
|
|
30682
30718
|
return query[name];
|
|
30683
30719
|
return defaultValue;
|
|
30684
30720
|
};
|
|
30685
|
-
req.is = function is(
|
|
30686
|
-
var arr =
|
|
30687
|
-
if (!Array.isArray(
|
|
30721
|
+
req.is = function is(types2) {
|
|
30722
|
+
var arr = types2;
|
|
30723
|
+
if (!Array.isArray(types2)) {
|
|
30688
30724
|
arr = new Array(arguments.length);
|
|
30689
30725
|
for (var i = 0;i < arr.length; i++) {
|
|
30690
30726
|
arr[i] = arguments[i];
|
|
@@ -32098,14 +32134,14 @@ function mergeCapabilities(base, additional) {
|
|
|
32098
32134
|
}
|
|
32099
32135
|
var DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
|
|
32100
32136
|
var init_protocol = __esm(() => {
|
|
32101
|
-
|
|
32137
|
+
init_types2();
|
|
32102
32138
|
});
|
|
32103
32139
|
|
|
32104
32140
|
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
|
|
32105
32141
|
var Server;
|
|
32106
32142
|
var init_server = __esm(() => {
|
|
32107
32143
|
init_protocol();
|
|
32108
|
-
|
|
32144
|
+
init_types2();
|
|
32109
32145
|
Server = class Server extends Protocol {
|
|
32110
32146
|
constructor(_serverInfo, options) {
|
|
32111
32147
|
var _a;
|
|
@@ -32361,7 +32397,7 @@ function parseArrayDef(def, refs) {
|
|
|
32361
32397
|
return res;
|
|
32362
32398
|
}
|
|
32363
32399
|
var init_array = __esm(() => {
|
|
32364
|
-
|
|
32400
|
+
init_zod();
|
|
32365
32401
|
init_parseDef();
|
|
32366
32402
|
});
|
|
32367
32403
|
|
|
@@ -32924,7 +32960,7 @@ function parseRecordDef(def, refs) {
|
|
|
32924
32960
|
return schema;
|
|
32925
32961
|
}
|
|
32926
32962
|
var init_record = __esm(() => {
|
|
32927
|
-
|
|
32963
|
+
init_zod();
|
|
32928
32964
|
init_parseDef();
|
|
32929
32965
|
init_string();
|
|
32930
32966
|
init_branded();
|
|
@@ -32996,15 +33032,15 @@ function parseUnionDef(def, refs) {
|
|
|
32996
33032
|
return asAnyOf(def, refs);
|
|
32997
33033
|
const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
|
|
32998
33034
|
if (options.every((x2) => (x2._def.typeName in primitiveMappings) && (!x2._def.checks || !x2._def.checks.length))) {
|
|
32999
|
-
const
|
|
33035
|
+
const types2 = options.reduce((types3, x2) => {
|
|
33000
33036
|
const type = primitiveMappings[x2._def.typeName];
|
|
33001
|
-
return type && !
|
|
33037
|
+
return type && !types3.includes(type) ? [...types3, type] : types3;
|
|
33002
33038
|
}, []);
|
|
33003
33039
|
return {
|
|
33004
|
-
type:
|
|
33040
|
+
type: types2.length > 1 ? types2 : types2[0]
|
|
33005
33041
|
};
|
|
33006
33042
|
} else if (options.every((x2) => x2._def.typeName === "ZodLiteral" && !x2.description)) {
|
|
33007
|
-
const
|
|
33043
|
+
const types2 = options.reduce((acc, x2) => {
|
|
33008
33044
|
const type = typeof x2._def.value;
|
|
33009
33045
|
switch (type) {
|
|
33010
33046
|
case "string":
|
|
@@ -33023,8 +33059,8 @@ function parseUnionDef(def, refs) {
|
|
|
33023
33059
|
return acc;
|
|
33024
33060
|
}
|
|
33025
33061
|
}, []);
|
|
33026
|
-
if (
|
|
33027
|
-
const uniqueTypes =
|
|
33062
|
+
if (types2.length === options.length) {
|
|
33063
|
+
const uniqueTypes = types2.filter((x2, i, a) => a.indexOf(x2) === i);
|
|
33028
33064
|
return {
|
|
33029
33065
|
type: uniqueTypes.length > 1 ? uniqueTypes : uniqueTypes[0],
|
|
33030
33066
|
enum: options.reduce((acc, x2) => {
|
|
@@ -33217,7 +33253,7 @@ function safeIsOptional(schema) {
|
|
|
33217
33253
|
}
|
|
33218
33254
|
}
|
|
33219
33255
|
var init_object = __esm(() => {
|
|
33220
|
-
|
|
33256
|
+
init_zod();
|
|
33221
33257
|
init_parseDef();
|
|
33222
33258
|
});
|
|
33223
33259
|
|
|
@@ -33426,7 +33462,7 @@ var selectParser = (def, typeName, refs) => {
|
|
|
33426
33462
|
}
|
|
33427
33463
|
};
|
|
33428
33464
|
var init_selectParser = __esm(() => {
|
|
33429
|
-
|
|
33465
|
+
init_zod();
|
|
33430
33466
|
init_array();
|
|
33431
33467
|
init_bigint();
|
|
33432
33468
|
init_branded();
|
|
@@ -33626,7 +33662,7 @@ function processCreateParams2(params) {
|
|
|
33626
33662
|
}
|
|
33627
33663
|
var McpZodTypeKind, Completable;
|
|
33628
33664
|
var init_completable = __esm(() => {
|
|
33629
|
-
|
|
33665
|
+
init_zod();
|
|
33630
33666
|
(function(McpZodTypeKind2) {
|
|
33631
33667
|
McpZodTypeKind2["Completable"] = "McpCompletable";
|
|
33632
33668
|
})(McpZodTypeKind || (McpZodTypeKind = {}));
|
|
@@ -33921,7 +33957,7 @@ class McpServer {
|
|
|
33921
33957
|
const cb = rest[0];
|
|
33922
33958
|
this._registeredTools[name] = {
|
|
33923
33959
|
description,
|
|
33924
|
-
inputSchema: paramsSchema === undefined ? undefined :
|
|
33960
|
+
inputSchema: paramsSchema === undefined ? undefined : exports_external.object(paramsSchema),
|
|
33925
33961
|
callback: cb
|
|
33926
33962
|
};
|
|
33927
33963
|
this.setToolRequestHandlers();
|
|
@@ -33941,7 +33977,7 @@ class McpServer {
|
|
|
33941
33977
|
const cb = rest[0];
|
|
33942
33978
|
this._registeredPrompts[name] = {
|
|
33943
33979
|
description,
|
|
33944
|
-
argsSchema: argsSchema === undefined ? undefined :
|
|
33980
|
+
argsSchema: argsSchema === undefined ? undefined : exports_external.object(argsSchema),
|
|
33945
33981
|
callback: cb
|
|
33946
33982
|
};
|
|
33947
33983
|
this.setPromptRequestHandlers();
|
|
@@ -33967,8 +34003,8 @@ var EMPTY_OBJECT_JSON_SCHEMA, EMPTY_COMPLETION_RESULT;
|
|
|
33967
34003
|
var init_mcp = __esm(() => {
|
|
33968
34004
|
init_server();
|
|
33969
34005
|
init_esm();
|
|
33970
|
-
|
|
33971
|
-
|
|
34006
|
+
init_zod();
|
|
34007
|
+
init_types2();
|
|
33972
34008
|
init_completable();
|
|
33973
34009
|
EMPTY_OBJECT_JSON_SCHEMA = {
|
|
33974
34010
|
type: "object"
|
|
@@ -34121,7 +34157,7 @@ function stringToBase64(str) {
|
|
|
34121
34157
|
}
|
|
34122
34158
|
var zodOutbound, zodInbound;
|
|
34123
34159
|
var init_base64 = __esm(() => {
|
|
34124
|
-
|
|
34160
|
+
init_zod();
|
|
34125
34161
|
zodOutbound = instanceOfType(Uint8Array).or(stringType().transform(stringToBytes));
|
|
34126
34162
|
zodInbound = instanceOfType(Uint8Array).or(stringType().transform(bytesFromBase64));
|
|
34127
34163
|
});
|
|
@@ -34172,9 +34208,9 @@ var init_config = __esm(() => {
|
|
|
34172
34208
|
SDK_METADATA = {
|
|
34173
34209
|
language: "typescript",
|
|
34174
34210
|
openapiDocVersion: "1.0.0",
|
|
34175
|
-
sdkVersion: "0.
|
|
34176
|
-
genVersion: "2.
|
|
34177
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
34211
|
+
sdkVersion: "0.3.0",
|
|
34212
|
+
genVersion: "2.658.3",
|
|
34213
|
+
userAgent: "speakeasy-sdk/typescript 0.3.0 2.658.3 1.0.0 vanta-auditor-api-sdk"
|
|
34178
34214
|
};
|
|
34179
34215
|
});
|
|
34180
34216
|
|
|
@@ -34415,7 +34451,7 @@ function env() {
|
|
|
34415
34451
|
}
|
|
34416
34452
|
var envSchema, envMemo = undefined;
|
|
34417
34453
|
var init_env = __esm(() => {
|
|
34418
|
-
|
|
34454
|
+
init_zod();
|
|
34419
34455
|
envSchema = objectType({
|
|
34420
34456
|
VANTA_BEARER_AUTH: stringType().optional(),
|
|
34421
34457
|
VANTA_DEBUG: coerce.boolean().optional()
|
|
@@ -34739,7 +34775,6 @@ class ClientSDK {
|
|
|
34739
34775
|
} else {
|
|
34740
34776
|
this.#hooks = new SDKHooks;
|
|
34741
34777
|
}
|
|
34742
|
-
this._options = { ...options, hooks: this.#hooks };
|
|
34743
34778
|
const url = serverURLFromOptions(options);
|
|
34744
34779
|
if (url) {
|
|
34745
34780
|
url.pathname = url.pathname.replace(/\/+$/, "") + "/";
|
|
@@ -34750,7 +34785,8 @@ class ClientSDK {
|
|
|
34750
34785
|
});
|
|
34751
34786
|
this._baseURL = baseURL;
|
|
34752
34787
|
this.#httpClient = client;
|
|
34753
|
-
this
|
|
34788
|
+
this._options = { ...options, hooks: this.#hooks };
|
|
34789
|
+
this.#logger = this._options.debugLogger;
|
|
34754
34790
|
if (!this.#logger && env().VANTA_DEBUG) {
|
|
34755
34791
|
this.#logger = console;
|
|
34756
34792
|
}
|
|
@@ -34799,26 +34835,22 @@ class ClientSDK {
|
|
|
34799
34835
|
}
|
|
34800
34836
|
cookie = cookie.startsWith("; ") ? cookie.slice(2) : cookie;
|
|
34801
34837
|
headers.set("cookie", cookie);
|
|
34802
|
-
const userHeaders = new Headers(options?.fetchOptions?.headers);
|
|
34838
|
+
const userHeaders = new Headers(options?.headers ?? options?.fetchOptions?.headers);
|
|
34803
34839
|
for (const [k2, v2] of userHeaders) {
|
|
34804
34840
|
headers.set(k2, v2);
|
|
34805
34841
|
}
|
|
34806
34842
|
if (!isBrowserLike) {
|
|
34807
|
-
headers.set(conf.uaHeader ?? "user-agent", SDK_METADATA.userAgent);
|
|
34843
|
+
headers.set(conf.uaHeader ?? "user-agent", conf.userAgent ?? SDK_METADATA.userAgent);
|
|
34808
34844
|
}
|
|
34809
|
-
|
|
34845
|
+
const fetchOptions = {
|
|
34846
|
+
...options?.fetchOptions,
|
|
34847
|
+
...options
|
|
34848
|
+
};
|
|
34810
34849
|
if (!fetchOptions?.signal && conf.timeoutMs && conf.timeoutMs > 0) {
|
|
34811
34850
|
const timeoutSignal = AbortSignal.timeout(conf.timeoutMs);
|
|
34812
|
-
|
|
34813
|
-
fetchOptions = { signal: timeoutSignal };
|
|
34814
|
-
} else {
|
|
34815
|
-
fetchOptions.signal = timeoutSignal;
|
|
34816
|
-
}
|
|
34851
|
+
fetchOptions.signal = timeoutSignal;
|
|
34817
34852
|
}
|
|
34818
34853
|
if (conf.body instanceof ReadableStream) {
|
|
34819
|
-
if (!fetchOptions) {
|
|
34820
|
-
fetchOptions = {};
|
|
34821
|
-
}
|
|
34822
34854
|
Object.assign(fetchOptions, { duplex: "half" });
|
|
34823
34855
|
}
|
|
34824
34856
|
let input;
|
|
@@ -35048,7 +35080,7 @@ async function valueToBase64(value) {
|
|
|
35048
35080
|
}
|
|
35049
35081
|
var base64Schema;
|
|
35050
35082
|
var init_shared = __esm(() => {
|
|
35051
|
-
|
|
35083
|
+
init_zod();
|
|
35052
35084
|
init_base64();
|
|
35053
35085
|
base64Schema = stringType().base64();
|
|
35054
35086
|
});
|
|
@@ -35157,24 +35189,53 @@ var init_tools = __esm(() => {
|
|
|
35157
35189
|
init_shared();
|
|
35158
35190
|
});
|
|
35159
35191
|
|
|
35192
|
+
// src/models/errors/vantaerror.ts
|
|
35193
|
+
var VantaError;
|
|
35194
|
+
var init_vantaerror = __esm(() => {
|
|
35195
|
+
VantaError = class VantaError extends Error {
|
|
35196
|
+
statusCode;
|
|
35197
|
+
body;
|
|
35198
|
+
headers;
|
|
35199
|
+
contentType;
|
|
35200
|
+
rawResponse;
|
|
35201
|
+
constructor(message, httpMeta) {
|
|
35202
|
+
super(message);
|
|
35203
|
+
this.statusCode = httpMeta.response.status;
|
|
35204
|
+
this.body = httpMeta.body;
|
|
35205
|
+
this.headers = httpMeta.response.headers;
|
|
35206
|
+
this.contentType = httpMeta.response.headers.get("content-type") || "";
|
|
35207
|
+
this.rawResponse = httpMeta.response;
|
|
35208
|
+
this.name = "VantaError";
|
|
35209
|
+
}
|
|
35210
|
+
};
|
|
35211
|
+
});
|
|
35212
|
+
|
|
35160
35213
|
// src/models/errors/apierror.ts
|
|
35161
35214
|
var APIError;
|
|
35162
35215
|
var init_apierror = __esm(() => {
|
|
35163
|
-
|
|
35164
|
-
|
|
35165
|
-
|
|
35166
|
-
|
|
35167
|
-
|
|
35168
|
-
|
|
35169
|
-
|
|
35170
|
-
const contentType2 =
|
|
35171
|
-
|
|
35172
|
-
${
|
|
35173
|
-
|
|
35174
|
-
|
|
35175
|
-
|
|
35176
|
-
|
|
35177
|
-
|
|
35216
|
+
init_vantaerror();
|
|
35217
|
+
APIError = class APIError extends VantaError {
|
|
35218
|
+
constructor(message, httpMeta) {
|
|
35219
|
+
if (message) {
|
|
35220
|
+
message += `: `;
|
|
35221
|
+
}
|
|
35222
|
+
message += `Status ${httpMeta.response.status}`;
|
|
35223
|
+
const contentType2 = httpMeta.response.headers.get("content-type") || `""`;
|
|
35224
|
+
if (contentType2 !== "application/json") {
|
|
35225
|
+
message += ` Content-Type ${contentType2.includes(" ") ? `"${contentType2}"` : contentType2}`;
|
|
35226
|
+
}
|
|
35227
|
+
const body = httpMeta.body || `""`;
|
|
35228
|
+
message += body.length > 100 ? `
|
|
35229
|
+
` : ". ";
|
|
35230
|
+
let bodyDisplay = body;
|
|
35231
|
+
if (body.length > 1e4) {
|
|
35232
|
+
const truncated = body.substring(0, 1e4);
|
|
35233
|
+
const remaining = body.length - 1e4;
|
|
35234
|
+
bodyDisplay = `${truncated}...and ${remaining} more chars`;
|
|
35235
|
+
}
|
|
35236
|
+
message += `Body: ${bodyDisplay}`;
|
|
35237
|
+
message = message.trim();
|
|
35238
|
+
super(message, httpMeta);
|
|
35178
35239
|
this.name = "APIError";
|
|
35179
35240
|
}
|
|
35180
35241
|
};
|
|
@@ -35234,10 +35295,23 @@ ${pre}${str}`;
|
|
|
35234
35295
|
}
|
|
35235
35296
|
var SDKValidationError;
|
|
35236
35297
|
var init_sdkvalidationerror = __esm(() => {
|
|
35237
|
-
|
|
35298
|
+
init_zod();
|
|
35238
35299
|
SDKValidationError = class SDKValidationError extends Error {
|
|
35239
35300
|
rawValue;
|
|
35240
35301
|
rawMessage;
|
|
35302
|
+
static [Symbol.hasInstance](instance) {
|
|
35303
|
+
if (!(instance instanceof Error))
|
|
35304
|
+
return false;
|
|
35305
|
+
if (!("rawValue" in instance))
|
|
35306
|
+
return false;
|
|
35307
|
+
if (!("rawMessage" in instance))
|
|
35308
|
+
return false;
|
|
35309
|
+
if (!("pretty" in instance))
|
|
35310
|
+
return false;
|
|
35311
|
+
if (typeof instance.pretty !== "function")
|
|
35312
|
+
return false;
|
|
35313
|
+
return true;
|
|
35314
|
+
}
|
|
35241
35315
|
constructor(message, cause, rawValue) {
|
|
35242
35316
|
super(`${message}: ${cause}`);
|
|
35243
35317
|
this.name = "SDKValidationError";
|
|
@@ -35256,16 +35330,31 @@ ${formatZodError(this.cause)}`;
|
|
|
35256
35330
|
};
|
|
35257
35331
|
});
|
|
35258
35332
|
|
|
35259
|
-
// src/
|
|
35260
|
-
|
|
35261
|
-
|
|
35262
|
-
|
|
35263
|
-
} catch (err) {
|
|
35264
|
-
return ERR(new SDKValidationError(errorMessage, err, rawValue));
|
|
35265
|
-
}
|
|
35266
|
-
}
|
|
35267
|
-
var init_schemas = __esm(() => {
|
|
35333
|
+
// src/models/errors/responsevalidationerror.ts
|
|
35334
|
+
var ResponseValidationError;
|
|
35335
|
+
var init_responsevalidationerror = __esm(() => {
|
|
35336
|
+
init_zod();
|
|
35268
35337
|
init_sdkvalidationerror();
|
|
35338
|
+
init_vantaerror();
|
|
35339
|
+
ResponseValidationError = class ResponseValidationError extends VantaError {
|
|
35340
|
+
rawValue;
|
|
35341
|
+
rawMessage;
|
|
35342
|
+
constructor(message, extra) {
|
|
35343
|
+
super(message, extra);
|
|
35344
|
+
this.name = "ResponseValidationError";
|
|
35345
|
+
this.cause = extra.cause;
|
|
35346
|
+
this.rawValue = extra.rawValue;
|
|
35347
|
+
this.rawMessage = extra.rawMessage;
|
|
35348
|
+
}
|
|
35349
|
+
pretty() {
|
|
35350
|
+
if (this.cause instanceof ZodError) {
|
|
35351
|
+
return `${this.rawMessage}
|
|
35352
|
+
${formatZodError(this.cause)}`;
|
|
35353
|
+
} else {
|
|
35354
|
+
return this.toString();
|
|
35355
|
+
}
|
|
35356
|
+
}
|
|
35357
|
+
};
|
|
35269
35358
|
});
|
|
35270
35359
|
|
|
35271
35360
|
// src/lib/matchers.ts
|
|
@@ -35276,7 +35365,7 @@ function fail(codes) {
|
|
|
35276
35365
|
return { enc: "fail", codes };
|
|
35277
35366
|
}
|
|
35278
35367
|
function match(...matchers) {
|
|
35279
|
-
return async function matchFunc(response, options) {
|
|
35368
|
+
return async function matchFunc(response, request, options) {
|
|
35280
35369
|
let raw;
|
|
35281
35370
|
let matcher;
|
|
35282
35371
|
for (const match2 of matchers) {
|
|
@@ -35291,16 +35380,21 @@ function match(...matchers) {
|
|
|
35291
35380
|
}
|
|
35292
35381
|
}
|
|
35293
35382
|
if (!matcher) {
|
|
35294
|
-
const responseBody = await response.text();
|
|
35295
35383
|
return [{
|
|
35296
35384
|
ok: false,
|
|
35297
|
-
error: new APIError("Unexpected
|
|
35298
|
-
|
|
35385
|
+
error: new APIError("Unexpected Status or Content-Type", {
|
|
35386
|
+
response,
|
|
35387
|
+
request,
|
|
35388
|
+
body: await response.text().catch(() => "")
|
|
35389
|
+
})
|
|
35390
|
+
}, raw];
|
|
35299
35391
|
}
|
|
35300
35392
|
const encoding = matcher.enc;
|
|
35393
|
+
let body = "";
|
|
35301
35394
|
switch (encoding) {
|
|
35302
35395
|
case "json":
|
|
35303
|
-
|
|
35396
|
+
body = await response.text();
|
|
35397
|
+
raw = JSON.parse(body);
|
|
35304
35398
|
break;
|
|
35305
35399
|
case "jsonl":
|
|
35306
35400
|
raw = response.body;
|
|
@@ -35312,16 +35406,19 @@ function match(...matchers) {
|
|
|
35312
35406
|
raw = response.body;
|
|
35313
35407
|
break;
|
|
35314
35408
|
case "text":
|
|
35315
|
-
|
|
35409
|
+
body = await response.text();
|
|
35410
|
+
raw = body;
|
|
35316
35411
|
break;
|
|
35317
35412
|
case "sse":
|
|
35318
35413
|
raw = response.body;
|
|
35319
35414
|
break;
|
|
35320
35415
|
case "nil":
|
|
35321
|
-
|
|
35416
|
+
body = await response.text();
|
|
35417
|
+
raw = undefined;
|
|
35322
35418
|
break;
|
|
35323
35419
|
case "fail":
|
|
35324
|
-
|
|
35420
|
+
body = await response.text();
|
|
35421
|
+
raw = body;
|
|
35325
35422
|
break;
|
|
35326
35423
|
default:
|
|
35327
35424
|
throw new Error(`Unsupported response type: ${encoding}`);
|
|
@@ -35329,7 +35426,7 @@ function match(...matchers) {
|
|
|
35329
35426
|
if (matcher.enc === "fail") {
|
|
35330
35427
|
return [{
|
|
35331
35428
|
ok: false,
|
|
35332
|
-
error: new APIError("API error occurred", response,
|
|
35429
|
+
error: new APIError("API error occurred", { request, response, body })
|
|
35333
35430
|
}, raw];
|
|
35334
35431
|
}
|
|
35335
35432
|
const resultKey = matcher.key || options?.resultKey;
|
|
@@ -35338,7 +35435,10 @@ function match(...matchers) {
|
|
|
35338
35435
|
data = {
|
|
35339
35436
|
...options?.extraFields,
|
|
35340
35437
|
...matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null,
|
|
35341
|
-
...isPlainObject(raw) ? raw : null
|
|
35438
|
+
...isPlainObject(raw) ? raw : null,
|
|
35439
|
+
request$: request,
|
|
35440
|
+
response$: response,
|
|
35441
|
+
body$: body
|
|
35342
35442
|
};
|
|
35343
35443
|
} else if (resultKey) {
|
|
35344
35444
|
data = {
|
|
@@ -35356,11 +35456,11 @@ function match(...matchers) {
|
|
|
35356
35456
|
data = raw;
|
|
35357
35457
|
}
|
|
35358
35458
|
if ("err" in matcher) {
|
|
35359
|
-
const result =
|
|
35459
|
+
const result = safeParseResponse(data, (v2) => matcher.schema.parse(v2), "Response validation failed", { request, response, body });
|
|
35360
35460
|
return [result.ok ? { ok: false, error: result.value } : result, raw];
|
|
35361
35461
|
} else {
|
|
35362
35462
|
return [
|
|
35363
|
-
|
|
35463
|
+
safeParseResponse(data, (v2) => matcher.schema.parse(v2), "Response validation failed", { request, response, body }),
|
|
35364
35464
|
raw
|
|
35365
35465
|
];
|
|
35366
35466
|
}
|
|
@@ -35373,26 +35473,23 @@ function unpackHeaders(headers) {
|
|
|
35373
35473
|
}
|
|
35374
35474
|
return out;
|
|
35375
35475
|
}
|
|
35376
|
-
|
|
35377
|
-
const reader = res.body?.getReader();
|
|
35378
|
-
if (reader == null) {
|
|
35379
|
-
return;
|
|
35380
|
-
}
|
|
35476
|
+
function safeParseResponse(rawValue, fn, errorMessage, httpMeta) {
|
|
35381
35477
|
try {
|
|
35382
|
-
|
|
35383
|
-
|
|
35384
|
-
|
|
35385
|
-
|
|
35386
|
-
|
|
35387
|
-
|
|
35388
|
-
|
|
35478
|
+
return OK2(fn(rawValue));
|
|
35479
|
+
} catch (err) {
|
|
35480
|
+
return ERR(new ResponseValidationError(errorMessage, {
|
|
35481
|
+
cause: err,
|
|
35482
|
+
rawValue,
|
|
35483
|
+
rawMessage: errorMessage,
|
|
35484
|
+
...httpMeta
|
|
35485
|
+
}));
|
|
35389
35486
|
}
|
|
35390
35487
|
}
|
|
35391
35488
|
var DEFAULT_CONTENT_TYPES, headerValRE;
|
|
35392
35489
|
var init_matchers = __esm(() => {
|
|
35393
35490
|
init_apierror();
|
|
35491
|
+
init_responsevalidationerror();
|
|
35394
35492
|
init_http();
|
|
35395
|
-
init_schemas();
|
|
35396
35493
|
DEFAULT_CONTENT_TYPES = {
|
|
35397
35494
|
jsonl: "application/jsonl",
|
|
35398
35495
|
json: "application/json",
|
|
@@ -35433,6 +35530,18 @@ function compactMap(values) {
|
|
|
35433
35530
|
}
|
|
35434
35531
|
var init_primitives = () => {};
|
|
35435
35532
|
|
|
35533
|
+
// src/lib/schemas.ts
|
|
35534
|
+
function safeParse(rawValue, fn, errorMessage) {
|
|
35535
|
+
try {
|
|
35536
|
+
return OK2(fn(rawValue));
|
|
35537
|
+
} catch (err) {
|
|
35538
|
+
return ERR(new SDKValidationError(errorMessage, err, rawValue));
|
|
35539
|
+
}
|
|
35540
|
+
}
|
|
35541
|
+
var init_schemas = __esm(() => {
|
|
35542
|
+
init_sdkvalidationerror();
|
|
35543
|
+
});
|
|
35544
|
+
|
|
35436
35545
|
// src/lib/security.ts
|
|
35437
35546
|
function resolveSecurity(...options) {
|
|
35438
35547
|
const state = {
|
|
@@ -35562,7 +35671,7 @@ var init_security = __esm(() => {
|
|
|
35562
35671
|
// src/models/components/addauditorinput.ts
|
|
35563
35672
|
var AddAuditorInput$inboundSchema, AddAuditorInput$outboundSchema, AddAuditorInput$;
|
|
35564
35673
|
var init_addauditorinput = __esm(() => {
|
|
35565
|
-
|
|
35674
|
+
init_zod();
|
|
35566
35675
|
AddAuditorInput$inboundSchema = objectType({
|
|
35567
35676
|
email: stringType(),
|
|
35568
35677
|
givenName: stringType(),
|
|
@@ -35582,7 +35691,7 @@ var init_addauditorinput = __esm(() => {
|
|
|
35582
35691
|
// src/models/components/addcommentinput.ts
|
|
35583
35692
|
var AddCommentInput$inboundSchema, AddCommentInput$outboundSchema, AddCommentInput$;
|
|
35584
35693
|
var init_addcommentinput = __esm(() => {
|
|
35585
|
-
|
|
35694
|
+
init_zod();
|
|
35586
35695
|
AddCommentInput$inboundSchema = objectType({
|
|
35587
35696
|
text: stringType(),
|
|
35588
35697
|
email: stringType(),
|
|
@@ -35599,10 +35708,27 @@ var init_addcommentinput = __esm(() => {
|
|
|
35599
35708
|
})(AddCommentInput$ ||= {});
|
|
35600
35709
|
});
|
|
35601
35710
|
|
|
35711
|
+
// src/models/components/auditfocus.ts
|
|
35712
|
+
var AuditFocus, AuditFocus$inboundSchema, AuditFocus$outboundSchema, AuditFocus$;
|
|
35713
|
+
var init_auditfocus = __esm(() => {
|
|
35714
|
+
init_zod();
|
|
35715
|
+
AuditFocus = {
|
|
35716
|
+
External: "EXTERNAL",
|
|
35717
|
+
Internal: "INTERNAL"
|
|
35718
|
+
};
|
|
35719
|
+
AuditFocus$inboundSchema = nativeEnumType(AuditFocus);
|
|
35720
|
+
AuditFocus$outboundSchema = AuditFocus$inboundSchema;
|
|
35721
|
+
((AuditFocus$) => {
|
|
35722
|
+
AuditFocus$.inboundSchema = AuditFocus$inboundSchema;
|
|
35723
|
+
AuditFocus$.outboundSchema = AuditFocus$outboundSchema;
|
|
35724
|
+
})(AuditFocus$ ||= {});
|
|
35725
|
+
});
|
|
35726
|
+
|
|
35602
35727
|
// src/models/components/audit.ts
|
|
35603
35728
|
var Audit$inboundSchema, Audit$outboundSchema, Audit$;
|
|
35604
35729
|
var init_audit = __esm(() => {
|
|
35605
|
-
|
|
35730
|
+
init_zod();
|
|
35731
|
+
init_auditfocus();
|
|
35606
35732
|
Audit$inboundSchema = objectType({
|
|
35607
35733
|
id: stringType(),
|
|
35608
35734
|
customerOrganizationName: stringType(),
|
|
@@ -35610,14 +35736,15 @@ var init_audit = __esm(() => {
|
|
|
35610
35736
|
customerOrganizationId: stringType(),
|
|
35611
35737
|
auditStartDate: stringType().datetime({ offset: true }).transform((v2) => new Date(v2)),
|
|
35612
35738
|
auditEndDate: stringType().datetime({ offset: true }).transform((v2) => new Date(v2)),
|
|
35613
|
-
|
|
35739
|
+
earlyAccessStartsAt: nullableType(stringType().datetime({ offset: true }).transform((v2) => new Date(v2))),
|
|
35614
35740
|
framework: stringType(),
|
|
35615
35741
|
allowAuditorEmails: arrayType(stringType()),
|
|
35616
35742
|
allowAllAuditors: booleanType(),
|
|
35617
35743
|
deletionDate: nullableType(stringType().datetime({ offset: true }).transform((v2) => new Date(v2))),
|
|
35618
35744
|
creationDate: stringType().datetime({ offset: true }).transform((v2) => new Date(v2)),
|
|
35619
35745
|
modificationDate: nullableType(stringType().datetime({ offset: true }).transform((v2) => new Date(v2))),
|
|
35620
|
-
completionDate: nullableType(stringType().datetime({ offset: true }).transform((v2) => new Date(v2)))
|
|
35746
|
+
completionDate: nullableType(stringType().datetime({ offset: true }).transform((v2) => new Date(v2))),
|
|
35747
|
+
auditFocus: AuditFocus$inboundSchema
|
|
35621
35748
|
});
|
|
35622
35749
|
Audit$outboundSchema = objectType({
|
|
35623
35750
|
id: stringType(),
|
|
@@ -35626,14 +35753,15 @@ var init_audit = __esm(() => {
|
|
|
35626
35753
|
customerOrganizationId: stringType(),
|
|
35627
35754
|
auditStartDate: dateType().transform((v2) => v2.toISOString()),
|
|
35628
35755
|
auditEndDate: dateType().transform((v2) => v2.toISOString()),
|
|
35629
|
-
|
|
35756
|
+
earlyAccessStartsAt: nullableType(dateType().transform((v2) => v2.toISOString())),
|
|
35630
35757
|
framework: stringType(),
|
|
35631
35758
|
allowAuditorEmails: arrayType(stringType()),
|
|
35632
35759
|
allowAllAuditors: booleanType(),
|
|
35633
35760
|
deletionDate: nullableType(dateType().transform((v2) => v2.toISOString())),
|
|
35634
35761
|
creationDate: dateType().transform((v2) => v2.toISOString()),
|
|
35635
35762
|
modificationDate: nullableType(dateType().transform((v2) => v2.toISOString())),
|
|
35636
|
-
completionDate: nullableType(dateType().transform((v2) => v2.toISOString()))
|
|
35763
|
+
completionDate: nullableType(dateType().transform((v2) => v2.toISOString())),
|
|
35764
|
+
auditFocus: AuditFocus$outboundSchema
|
|
35637
35765
|
});
|
|
35638
35766
|
((Audit$) => {
|
|
35639
35767
|
Audit$.inboundSchema = Audit$inboundSchema;
|
|
@@ -35644,7 +35772,7 @@ var init_audit = __esm(() => {
|
|
|
35644
35772
|
// src/models/components/auditevidencestate.ts
|
|
35645
35773
|
var AuditEvidenceState, AuditEvidenceState$inboundSchema, AuditEvidenceState$outboundSchema, AuditEvidenceState$;
|
|
35646
35774
|
var init_auditevidencestate = __esm(() => {
|
|
35647
|
-
|
|
35775
|
+
init_zod();
|
|
35648
35776
|
AuditEvidenceState = {
|
|
35649
35777
|
Accepted: "Accepted",
|
|
35650
35778
|
Flagged: "Flagged",
|
|
@@ -35664,7 +35792,7 @@ var init_auditevidencestate = __esm(() => {
|
|
|
35664
35792
|
// src/models/components/auditevidencetype.ts
|
|
35665
35793
|
var AuditEvidenceType, AuditEvidenceType$inboundSchema, AuditEvidenceType$outboundSchema, AuditEvidenceType$;
|
|
35666
35794
|
var init_auditevidencetype = __esm(() => {
|
|
35667
|
-
|
|
35795
|
+
init_zod();
|
|
35668
35796
|
AuditEvidenceType = {
|
|
35669
35797
|
EvidenceRequest: "Evidence Request",
|
|
35670
35798
|
Policy: "Policy",
|
|
@@ -35681,7 +35809,7 @@ var init_auditevidencetype = __esm(() => {
|
|
|
35681
35809
|
// src/models/components/auditorenabledstatetransition.ts
|
|
35682
35810
|
var AuditorEnabledStateTransition, AuditorEnabledStateTransition$inboundSchema, AuditorEnabledStateTransition$outboundSchema, AuditorEnabledStateTransition$;
|
|
35683
35811
|
var init_auditorenabledstatetransition = __esm(() => {
|
|
35684
|
-
|
|
35812
|
+
init_zod();
|
|
35685
35813
|
AuditorEnabledStateTransition = {
|
|
35686
35814
|
Accept: "ACCEPT",
|
|
35687
35815
|
MarkApplicable: "MARK_APPLICABLE",
|
|
@@ -35700,7 +35828,7 @@ var init_auditorenabledstatetransition = __esm(() => {
|
|
|
35700
35828
|
// src/models/components/auditevidenceupdateinput.ts
|
|
35701
35829
|
var StatusUpdate$inboundSchema, StatusUpdate$outboundSchema, StatusUpdate$, AuditEvidenceUpdateInput$inboundSchema, AuditEvidenceUpdateInput$outboundSchema, AuditEvidenceUpdateInput$;
|
|
35702
35830
|
var init_auditevidenceupdateinput = __esm(() => {
|
|
35703
|
-
|
|
35831
|
+
init_zod();
|
|
35704
35832
|
init_auditorenabledstatetransition();
|
|
35705
35833
|
StatusUpdate$inboundSchema = objectType({
|
|
35706
35834
|
auditorEmail: stringType(),
|
|
@@ -35729,7 +35857,7 @@ var init_auditevidenceupdateinput = __esm(() => {
|
|
|
35729
35857
|
// src/models/components/auditor.ts
|
|
35730
35858
|
var Auditor$inboundSchema, Auditor$outboundSchema, Auditor$;
|
|
35731
35859
|
var init_auditor = __esm(() => {
|
|
35732
|
-
|
|
35860
|
+
init_zod();
|
|
35733
35861
|
Auditor$inboundSchema = objectType({
|
|
35734
35862
|
id: stringType(),
|
|
35735
35863
|
organizationId: stringType(),
|
|
@@ -35753,7 +35881,7 @@ var init_auditor = __esm(() => {
|
|
|
35753
35881
|
// src/models/components/controlsource.ts
|
|
35754
35882
|
var ControlSource, ControlSource$inboundSchema, ControlSource$outboundSchema, ControlSource$;
|
|
35755
35883
|
var init_controlsource = __esm(() => {
|
|
35756
|
-
|
|
35884
|
+
init_zod();
|
|
35757
35885
|
ControlSource = {
|
|
35758
35886
|
Vanta: "Vanta",
|
|
35759
35887
|
Custom: "Custom"
|
|
@@ -35769,7 +35897,7 @@ var init_controlsource = __esm(() => {
|
|
|
35769
35897
|
// src/models/components/customfield.ts
|
|
35770
35898
|
var Value$inboundSchema, Value$outboundSchema, Value$, CustomField$inboundSchema, CustomField$outboundSchema, CustomField$;
|
|
35771
35899
|
var init_customfield = __esm(() => {
|
|
35772
|
-
|
|
35900
|
+
init_zod();
|
|
35773
35901
|
Value$inboundSchema = unionType([stringType(), arrayType(stringType())]);
|
|
35774
35902
|
Value$outboundSchema = unionType([stringType(), arrayType(stringType())]);
|
|
35775
35903
|
((Value$) => {
|
|
@@ -35793,7 +35921,7 @@ var init_customfield = __esm(() => {
|
|
|
35793
35921
|
// src/models/components/section.ts
|
|
35794
35922
|
var Section$inboundSchema, Section$outboundSchema, Section$;
|
|
35795
35923
|
var init_section = __esm(() => {
|
|
35796
|
-
|
|
35924
|
+
init_zod();
|
|
35797
35925
|
Section$inboundSchema = objectType({
|
|
35798
35926
|
name: stringType(),
|
|
35799
35927
|
framework: stringType()
|
|
@@ -35811,7 +35939,7 @@ var init_section = __esm(() => {
|
|
|
35811
35939
|
// src/models/components/auditorcontrol.ts
|
|
35812
35940
|
var Owner$inboundSchema, Owner$outboundSchema, Owner$, AuditorControl$inboundSchema, AuditorControl$outboundSchema, AuditorControl$;
|
|
35813
35941
|
var init_auditorcontrol = __esm(() => {
|
|
35814
|
-
|
|
35942
|
+
init_zod();
|
|
35815
35943
|
init_controlsource();
|
|
35816
35944
|
init_customfield();
|
|
35817
35945
|
init_section();
|
|
@@ -35864,7 +35992,7 @@ var init_auditorcontrol = __esm(() => {
|
|
|
35864
35992
|
// src/models/components/comment.ts
|
|
35865
35993
|
var Comment$inboundSchema, Comment$outboundSchema, Comment$;
|
|
35866
35994
|
var init_comment = __esm(() => {
|
|
35867
|
-
|
|
35995
|
+
init_zod();
|
|
35868
35996
|
Comment$inboundSchema = objectType({
|
|
35869
35997
|
id: stringType(),
|
|
35870
35998
|
auditEvidenceId: stringType(),
|
|
@@ -35892,7 +36020,7 @@ var init_comment = __esm(() => {
|
|
|
35892
36020
|
// src/models/components/control.ts
|
|
35893
36021
|
var ControlOwner$inboundSchema, ControlOwner$outboundSchema, ControlOwner$, Control$inboundSchema, Control$outboundSchema, Control$;
|
|
35894
36022
|
var init_control = __esm(() => {
|
|
35895
|
-
|
|
36023
|
+
init_zod();
|
|
35896
36024
|
init_controlsource();
|
|
35897
36025
|
init_customfield();
|
|
35898
36026
|
ControlOwner$inboundSchema = objectType({
|
|
@@ -35940,7 +36068,7 @@ var init_control = __esm(() => {
|
|
|
35940
36068
|
// src/models/components/controldomain.ts
|
|
35941
36069
|
var ControlDomain, ControlDomain$inboundSchema, ControlDomain$outboundSchema, ControlDomain$;
|
|
35942
36070
|
var init_controldomain = __esm(() => {
|
|
35943
|
-
|
|
36071
|
+
init_zod();
|
|
35944
36072
|
ControlDomain = {
|
|
35945
36073
|
ARTIFICIALAndAUTONOMOUSTECHNOLOGY: "ARTIFICIAL_&_AUTONOMOUS_TECHNOLOGY",
|
|
35946
36074
|
AssetManagement: "ASSET_MANAGEMENT",
|
|
@@ -35992,7 +36120,7 @@ var init_controldomain = __esm(() => {
|
|
|
35992
36120
|
// src/models/components/frameworkid.ts
|
|
35993
36121
|
var FrameworkId, FrameworkId$inboundSchema, FrameworkId$outboundSchema, FrameworkId$;
|
|
35994
36122
|
var init_frameworkid = __esm(() => {
|
|
35995
|
-
|
|
36123
|
+
init_zod();
|
|
35996
36124
|
FrameworkId = {
|
|
35997
36125
|
AuE8: "AU_E_8",
|
|
35998
36126
|
AwsFtr: "AWS_FTR",
|
|
@@ -36041,7 +36169,7 @@ var init_frameworkid = __esm(() => {
|
|
|
36041
36169
|
// src/models/components/frameworksection.ts
|
|
36042
36170
|
var FrameworkSectionFrameworkId$inboundSchema, FrameworkSectionFrameworkId$outboundSchema, FrameworkSectionFrameworkId$, FrameworkSection$inboundSchema, FrameworkSection$outboundSchema, FrameworkSection$;
|
|
36043
36171
|
var init_frameworksection = __esm(() => {
|
|
36044
|
-
|
|
36172
|
+
init_zod();
|
|
36045
36173
|
init_frameworkid();
|
|
36046
36174
|
FrameworkSectionFrameworkId$inboundSchema = unionType([FrameworkId$inboundSchema, stringType()]);
|
|
36047
36175
|
FrameworkSectionFrameworkId$outboundSchema = unionType([FrameworkId$outboundSchema, stringType()]);
|
|
@@ -36066,7 +36194,7 @@ var init_frameworksection = __esm(() => {
|
|
|
36066
36194
|
// src/models/components/createcustomcontrolinput.ts
|
|
36067
36195
|
var Role, Role$inboundSchema, Role$outboundSchema, Role$, CreateCustomControlInput$inboundSchema, CreateCustomControlInput$outboundSchema, CreateCustomControlInput$;
|
|
36068
36196
|
var init_createcustomcontrolinput = __esm(() => {
|
|
36069
|
-
|
|
36197
|
+
init_zod();
|
|
36070
36198
|
init_controldomain();
|
|
36071
36199
|
init_frameworksection();
|
|
36072
36200
|
Role = {
|
|
@@ -36107,7 +36235,7 @@ var init_createcustomcontrolinput = __esm(() => {
|
|
|
36107
36235
|
// src/models/components/recurrenceduration.ts
|
|
36108
36236
|
var RecurrenceDuration, RecurrenceDuration$inboundSchema, RecurrenceDuration$outboundSchema, RecurrenceDuration$;
|
|
36109
36237
|
var init_recurrenceduration = __esm(() => {
|
|
36110
|
-
|
|
36238
|
+
init_zod();
|
|
36111
36239
|
RecurrenceDuration = {
|
|
36112
36240
|
P0D: "P0D",
|
|
36113
36241
|
P1D: "P1D",
|
|
@@ -36128,7 +36256,7 @@ var init_recurrenceduration = __esm(() => {
|
|
|
36128
36256
|
// src/models/components/createcustomevidencerequestinput.ts
|
|
36129
36257
|
var CreateCustomEvidenceRequestInput$inboundSchema, CreateCustomEvidenceRequestInput$outboundSchema, CreateCustomEvidenceRequestInput$;
|
|
36130
36258
|
var init_createcustomevidencerequestinput = __esm(() => {
|
|
36131
|
-
|
|
36259
|
+
init_zod();
|
|
36132
36260
|
init_recurrenceduration();
|
|
36133
36261
|
CreateCustomEvidenceRequestInput$inboundSchema = objectType({
|
|
36134
36262
|
controlIds: arrayType(stringType()),
|
|
@@ -36157,7 +36285,7 @@ var init_createcustomevidencerequestinput = __esm(() => {
|
|
|
36157
36285
|
// src/models/components/customevidencerequest.ts
|
|
36158
36286
|
var CustomEvidenceRequest$inboundSchema, CustomEvidenceRequest$outboundSchema, CustomEvidenceRequest$;
|
|
36159
36287
|
var init_customevidencerequest = __esm(() => {
|
|
36160
|
-
|
|
36288
|
+
init_zod();
|
|
36161
36289
|
init_recurrenceduration();
|
|
36162
36290
|
CustomEvidenceRequest$inboundSchema = objectType({
|
|
36163
36291
|
id: stringType(),
|
|
@@ -36186,7 +36314,7 @@ var init_customevidencerequest = __esm(() => {
|
|
|
36186
36314
|
// src/models/components/evidencecontrol.ts
|
|
36187
36315
|
var EvidenceControl$inboundSchema, EvidenceControl$outboundSchema, EvidenceControl$;
|
|
36188
36316
|
var init_evidencecontrol = __esm(() => {
|
|
36189
|
-
|
|
36317
|
+
init_zod();
|
|
36190
36318
|
EvidenceControl$inboundSchema = objectType({
|
|
36191
36319
|
name: stringType(),
|
|
36192
36320
|
sectionNames: arrayType(stringType())
|
|
@@ -36204,7 +36332,7 @@ var init_evidencecontrol = __esm(() => {
|
|
|
36204
36332
|
// src/models/components/evidence.ts
|
|
36205
36333
|
var Evidence$inboundSchema, Evidence$outboundSchema, Evidence$;
|
|
36206
36334
|
var init_evidence = __esm(() => {
|
|
36207
|
-
|
|
36335
|
+
init_zod();
|
|
36208
36336
|
init_auditevidencestate();
|
|
36209
36337
|
init_auditevidencetype();
|
|
36210
36338
|
init_evidencecontrol();
|
|
@@ -36245,7 +36373,7 @@ var init_evidence = __esm(() => {
|
|
|
36245
36373
|
// src/models/components/evidenceurl.ts
|
|
36246
36374
|
var EvidenceUrl$inboundSchema, EvidenceUrl$outboundSchema, EvidenceUrl$;
|
|
36247
36375
|
var init_evidenceurl = __esm(() => {
|
|
36248
|
-
|
|
36376
|
+
init_zod();
|
|
36249
36377
|
EvidenceUrl$inboundSchema = objectType({
|
|
36250
36378
|
id: stringType(),
|
|
36251
36379
|
url: stringType(),
|
|
@@ -36267,7 +36395,7 @@ var init_evidenceurl = __esm(() => {
|
|
|
36267
36395
|
// src/models/components/pageinfo.ts
|
|
36268
36396
|
var PageInfo$inboundSchema, PageInfo$outboundSchema, PageInfo$;
|
|
36269
36397
|
var init_pageinfo = __esm(() => {
|
|
36270
|
-
|
|
36398
|
+
init_zod();
|
|
36271
36399
|
PageInfo$inboundSchema = objectType({
|
|
36272
36400
|
endCursor: nullableType(stringType()),
|
|
36273
36401
|
hasNextPage: booleanType(),
|
|
@@ -36289,7 +36417,7 @@ var init_pageinfo = __esm(() => {
|
|
|
36289
36417
|
// src/models/components/paginatedresponseaudit.ts
|
|
36290
36418
|
var Results$inboundSchema, Results$outboundSchema, Results$, PaginatedResponseAudit$inboundSchema, PaginatedResponseAudit$outboundSchema, PaginatedResponseAudit$;
|
|
36291
36419
|
var init_paginatedresponseaudit = __esm(() => {
|
|
36292
|
-
|
|
36420
|
+
init_zod();
|
|
36293
36421
|
init_audit();
|
|
36294
36422
|
init_pageinfo();
|
|
36295
36423
|
Results$inboundSchema = objectType({
|
|
@@ -36319,7 +36447,7 @@ var init_paginatedresponseaudit = __esm(() => {
|
|
|
36319
36447
|
// src/models/components/paginatedresponseauditorcontrol.ts
|
|
36320
36448
|
var PaginatedResponseAuditorControlResults$inboundSchema, PaginatedResponseAuditorControlResults$outboundSchema, PaginatedResponseAuditorControlResults$, PaginatedResponseAuditorControl$inboundSchema, PaginatedResponseAuditorControl$outboundSchema, PaginatedResponseAuditorControl$;
|
|
36321
36449
|
var init_paginatedresponseauditorcontrol = __esm(() => {
|
|
36322
|
-
|
|
36450
|
+
init_zod();
|
|
36323
36451
|
init_auditorcontrol();
|
|
36324
36452
|
init_pageinfo();
|
|
36325
36453
|
PaginatedResponseAuditorControlResults$inboundSchema = objectType({
|
|
@@ -36349,7 +36477,7 @@ var init_paginatedresponseauditorcontrol = __esm(() => {
|
|
|
36349
36477
|
// src/models/components/paginatedresponsecomment.ts
|
|
36350
36478
|
var PaginatedResponseCommentResults$inboundSchema, PaginatedResponseCommentResults$outboundSchema, PaginatedResponseCommentResults$, PaginatedResponseComment$inboundSchema, PaginatedResponseComment$outboundSchema, PaginatedResponseComment$;
|
|
36351
36479
|
var init_paginatedresponsecomment = __esm(() => {
|
|
36352
|
-
|
|
36480
|
+
init_zod();
|
|
36353
36481
|
init_comment();
|
|
36354
36482
|
init_pageinfo();
|
|
36355
36483
|
PaginatedResponseCommentResults$inboundSchema = objectType({
|
|
@@ -36379,7 +36507,7 @@ var init_paginatedresponsecomment = __esm(() => {
|
|
|
36379
36507
|
// src/models/components/paginatedresponseevidence.ts
|
|
36380
36508
|
var PaginatedResponseEvidenceResults$inboundSchema, PaginatedResponseEvidenceResults$outboundSchema, PaginatedResponseEvidenceResults$, PaginatedResponseEvidence$inboundSchema, PaginatedResponseEvidence$outboundSchema, PaginatedResponseEvidence$;
|
|
36381
36509
|
var init_paginatedresponseevidence = __esm(() => {
|
|
36382
|
-
|
|
36510
|
+
init_zod();
|
|
36383
36511
|
init_evidence();
|
|
36384
36512
|
init_pageinfo();
|
|
36385
36513
|
PaginatedResponseEvidenceResults$inboundSchema = objectType({
|
|
@@ -36409,7 +36537,7 @@ var init_paginatedresponseevidence = __esm(() => {
|
|
|
36409
36537
|
// src/models/components/paginatedresponseevidenceurl.ts
|
|
36410
36538
|
var PaginatedResponseEvidenceUrlResults$inboundSchema, PaginatedResponseEvidenceUrlResults$outboundSchema, PaginatedResponseEvidenceUrlResults$, PaginatedResponseEvidenceUrl$inboundSchema, PaginatedResponseEvidenceUrl$outboundSchema, PaginatedResponseEvidenceUrl$;
|
|
36411
36539
|
var init_paginatedresponseevidenceurl = __esm(() => {
|
|
36412
|
-
|
|
36540
|
+
init_zod();
|
|
36413
36541
|
init_evidenceurl();
|
|
36414
36542
|
init_pageinfo();
|
|
36415
36543
|
PaginatedResponseEvidenceUrlResults$inboundSchema = objectType({
|
|
@@ -36439,7 +36567,7 @@ var init_paginatedresponseevidenceurl = __esm(() => {
|
|
|
36439
36567
|
// src/models/components/security.ts
|
|
36440
36568
|
var Security$inboundSchema, Security$outboundSchema, Security$;
|
|
36441
36569
|
var init_security2 = __esm(() => {
|
|
36442
|
-
|
|
36570
|
+
init_zod();
|
|
36443
36571
|
Security$inboundSchema = objectType({
|
|
36444
36572
|
bearerAuth: stringType().optional()
|
|
36445
36573
|
});
|
|
@@ -36460,6 +36588,7 @@ var init_components = __esm(() => {
|
|
|
36460
36588
|
init_auditevidencestate();
|
|
36461
36589
|
init_auditevidencetype();
|
|
36462
36590
|
init_auditevidenceupdateinput();
|
|
36591
|
+
init_auditfocus();
|
|
36463
36592
|
init_auditor();
|
|
36464
36593
|
init_auditorcontrol();
|
|
36465
36594
|
init_auditorenabledstatetransition();
|
|
@@ -36533,6 +36662,7 @@ async function $do(client, request, options) {
|
|
|
36533
36662
|
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
36534
36663
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
36535
36664
|
const context = {
|
|
36665
|
+
options: client._options,
|
|
36536
36666
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
36537
36667
|
operationID: "CreateAuditor",
|
|
36538
36668
|
oAuth2Scopes: [],
|
|
@@ -36548,6 +36678,7 @@ async function $do(client, request, options) {
|
|
|
36548
36678
|
path,
|
|
36549
36679
|
headers,
|
|
36550
36680
|
body,
|
|
36681
|
+
userAgent: client._options.userAgent,
|
|
36551
36682
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
|
|
36552
36683
|
}, options);
|
|
36553
36684
|
if (!requestRes.ok) {
|
|
@@ -36564,7 +36695,7 @@ async function $do(client, request, options) {
|
|
|
36564
36695
|
return [doResult, { status: "request-error", request: req }];
|
|
36565
36696
|
}
|
|
36566
36697
|
const response = doResult.value;
|
|
36567
|
-
const [result] = await match(json(200, Auditor$inboundSchema), fail("4XX"), fail("5XX"))(response);
|
|
36698
|
+
const [result] = await match(json(200, Auditor$inboundSchema), fail("4XX"), fail("5XX"))(response, req);
|
|
36568
36699
|
if (!result.ok) {
|
|
36569
36700
|
return [result, { status: "complete", request: req, response }];
|
|
36570
36701
|
}
|
|
@@ -36613,7 +36744,7 @@ Create an auditor in Vanta.`,
|
|
|
36613
36744
|
// src/models/operations/createcommentforauditevidence.ts
|
|
36614
36745
|
var CreateCommentForAuditEvidenceRequest$inboundSchema, CreateCommentForAuditEvidenceRequest$outboundSchema, CreateCommentForAuditEvidenceRequest$;
|
|
36615
36746
|
var init_createcommentforauditevidence = __esm(() => {
|
|
36616
|
-
|
|
36747
|
+
init_zod();
|
|
36617
36748
|
init_primitives();
|
|
36618
36749
|
init_components();
|
|
36619
36750
|
CreateCommentForAuditEvidenceRequest$inboundSchema = objectType({
|
|
@@ -36643,7 +36774,7 @@ var init_createcommentforauditevidence = __esm(() => {
|
|
|
36643
36774
|
// src/models/operations/createcustomcontrol.ts
|
|
36644
36775
|
var CreateCustomControlRequest$inboundSchema, CreateCustomControlRequest$outboundSchema, CreateCustomControlRequest$;
|
|
36645
36776
|
var init_createcustomcontrol = __esm(() => {
|
|
36646
|
-
|
|
36777
|
+
init_zod();
|
|
36647
36778
|
init_primitives();
|
|
36648
36779
|
init_components();
|
|
36649
36780
|
CreateCustomControlRequest$inboundSchema = objectType({
|
|
@@ -36671,7 +36802,7 @@ var init_createcustomcontrol = __esm(() => {
|
|
|
36671
36802
|
// src/models/operations/createcustomevidencerequest.ts
|
|
36672
36803
|
var CreateCustomEvidenceRequestRequest$inboundSchema, CreateCustomEvidenceRequestRequest$outboundSchema, CreateCustomEvidenceRequestRequest$;
|
|
36673
36804
|
var init_createcustomevidencerequest = __esm(() => {
|
|
36674
|
-
|
|
36805
|
+
init_zod();
|
|
36675
36806
|
init_primitives();
|
|
36676
36807
|
init_components();
|
|
36677
36808
|
CreateCustomEvidenceRequestRequest$inboundSchema = objectType({
|
|
@@ -36699,7 +36830,7 @@ var init_createcustomevidencerequest = __esm(() => {
|
|
|
36699
36830
|
// src/models/operations/listauditcomments.ts
|
|
36700
36831
|
var ListAuditCommentsRequest$inboundSchema, ListAuditCommentsRequest$outboundSchema, ListAuditCommentsRequest$;
|
|
36701
36832
|
var init_listauditcomments = __esm(() => {
|
|
36702
|
-
|
|
36833
|
+
init_zod();
|
|
36703
36834
|
ListAuditCommentsRequest$inboundSchema = objectType({
|
|
36704
36835
|
auditId: stringType(),
|
|
36705
36836
|
pageSize: numberType().int().default(10),
|
|
@@ -36721,7 +36852,7 @@ var init_listauditcomments = __esm(() => {
|
|
|
36721
36852
|
// src/models/operations/listauditcontrols.ts
|
|
36722
36853
|
var ListAuditControlsRequest$inboundSchema, ListAuditControlsRequest$outboundSchema, ListAuditControlsRequest$;
|
|
36723
36854
|
var init_listauditcontrols = __esm(() => {
|
|
36724
|
-
|
|
36855
|
+
init_zod();
|
|
36725
36856
|
ListAuditControlsRequest$inboundSchema = objectType({
|
|
36726
36857
|
auditId: stringType(),
|
|
36727
36858
|
pageSize: numberType().int().default(10),
|
|
@@ -36741,7 +36872,7 @@ var init_listauditcontrols = __esm(() => {
|
|
|
36741
36872
|
// src/models/operations/listauditevidence.ts
|
|
36742
36873
|
var ListAuditEvidenceRequest$inboundSchema, ListAuditEvidenceRequest$outboundSchema, ListAuditEvidenceRequest$;
|
|
36743
36874
|
var init_listauditevidence = __esm(() => {
|
|
36744
|
-
|
|
36875
|
+
init_zod();
|
|
36745
36876
|
ListAuditEvidenceRequest$inboundSchema = objectType({
|
|
36746
36877
|
auditId: stringType(),
|
|
36747
36878
|
pageSize: numberType().int().default(10),
|
|
@@ -36763,7 +36894,7 @@ var init_listauditevidence = __esm(() => {
|
|
|
36763
36894
|
// src/models/operations/listauditevidenceurls.ts
|
|
36764
36895
|
var ListAuditEvidenceUrlsRequest$inboundSchema, ListAuditEvidenceUrlsRequest$outboundSchema, ListAuditEvidenceUrlsRequest$;
|
|
36765
36896
|
var init_listauditevidenceurls = __esm(() => {
|
|
36766
|
-
|
|
36897
|
+
init_zod();
|
|
36767
36898
|
ListAuditEvidenceUrlsRequest$inboundSchema = objectType({
|
|
36768
36899
|
auditId: stringType(),
|
|
36769
36900
|
auditEvidenceId: stringType(),
|
|
@@ -36785,16 +36916,18 @@ var init_listauditevidenceurls = __esm(() => {
|
|
|
36785
36916
|
// src/models/operations/listaudits.ts
|
|
36786
36917
|
var ListAuditsRequest$inboundSchema, ListAuditsRequest$outboundSchema, ListAuditsRequest$;
|
|
36787
36918
|
var init_listaudits = __esm(() => {
|
|
36788
|
-
|
|
36919
|
+
init_zod();
|
|
36789
36920
|
ListAuditsRequest$inboundSchema = objectType({
|
|
36790
36921
|
pageSize: numberType().int().default(10),
|
|
36791
36922
|
pageCursor: stringType().optional(),
|
|
36792
|
-
changedSinceDate: stringType().datetime({ offset: true }).transform((v2) => new Date(v2)).optional()
|
|
36923
|
+
changedSinceDate: stringType().datetime({ offset: true }).transform((v2) => new Date(v2)).optional(),
|
|
36924
|
+
isActiveAudit: booleanType().optional()
|
|
36793
36925
|
});
|
|
36794
36926
|
ListAuditsRequest$outboundSchema = objectType({
|
|
36795
36927
|
pageSize: numberType().int().default(10),
|
|
36796
36928
|
pageCursor: stringType().optional(),
|
|
36797
|
-
changedSinceDate: dateType().transform((v2) => v2.toISOString()).optional()
|
|
36929
|
+
changedSinceDate: dateType().transform((v2) => v2.toISOString()).optional(),
|
|
36930
|
+
isActiveAudit: booleanType().optional()
|
|
36798
36931
|
});
|
|
36799
36932
|
((ListAuditsRequest$) => {
|
|
36800
36933
|
ListAuditsRequest$.inboundSchema = ListAuditsRequest$inboundSchema;
|
|
@@ -36805,7 +36938,7 @@ var init_listaudits = __esm(() => {
|
|
|
36805
36938
|
// src/models/operations/updateauditevidence.ts
|
|
36806
36939
|
var UpdateAuditEvidenceRequest$inboundSchema, UpdateAuditEvidenceRequest$outboundSchema, UpdateAuditEvidenceRequest$;
|
|
36807
36940
|
var init_updateauditevidence = __esm(() => {
|
|
36808
|
-
|
|
36941
|
+
init_zod();
|
|
36809
36942
|
init_primitives();
|
|
36810
36943
|
init_components();
|
|
36811
36944
|
UpdateAuditEvidenceRequest$inboundSchema = objectType({
|
|
@@ -36875,6 +37008,7 @@ async function $do2(client, request, options) {
|
|
|
36875
37008
|
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
36876
37009
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
36877
37010
|
const context = {
|
|
37011
|
+
options: client._options,
|
|
36878
37012
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
36879
37013
|
operationID: "CreateCommentForAuditEvidence",
|
|
36880
37014
|
oAuth2Scopes: [],
|
|
@@ -36890,6 +37024,7 @@ async function $do2(client, request, options) {
|
|
|
36890
37024
|
path,
|
|
36891
37025
|
headers,
|
|
36892
37026
|
body,
|
|
37027
|
+
userAgent: client._options.userAgent,
|
|
36893
37028
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
|
|
36894
37029
|
}, options);
|
|
36895
37030
|
if (!requestRes.ok) {
|
|
@@ -36906,7 +37041,7 @@ async function $do2(client, request, options) {
|
|
|
36906
37041
|
return [doResult, { status: "request-error", request: req }];
|
|
36907
37042
|
}
|
|
36908
37043
|
const response = doResult.value;
|
|
36909
|
-
const [result] = await match(json(200, Comment$inboundSchema), fail("4XX"), fail("5XX"))(response);
|
|
37044
|
+
const [result] = await match(json(200, Comment$inboundSchema), fail("4XX"), fail("5XX"))(response, req);
|
|
36910
37045
|
if (!result.ok) {
|
|
36911
37046
|
return [result, { status: "complete", request: req, response }];
|
|
36912
37047
|
}
|
|
@@ -36981,6 +37116,7 @@ async function $do3(client, request, options) {
|
|
|
36981
37116
|
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
36982
37117
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
36983
37118
|
const context = {
|
|
37119
|
+
options: client._options,
|
|
36984
37120
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
36985
37121
|
operationID: "CreateCustomControl",
|
|
36986
37122
|
oAuth2Scopes: [],
|
|
@@ -36996,6 +37132,7 @@ async function $do3(client, request, options) {
|
|
|
36996
37132
|
path,
|
|
36997
37133
|
headers,
|
|
36998
37134
|
body,
|
|
37135
|
+
userAgent: client._options.userAgent,
|
|
36999
37136
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
|
|
37000
37137
|
}, options);
|
|
37001
37138
|
if (!requestRes.ok) {
|
|
@@ -37012,7 +37149,7 @@ async function $do3(client, request, options) {
|
|
|
37012
37149
|
return [doResult, { status: "request-error", request: req }];
|
|
37013
37150
|
}
|
|
37014
37151
|
const response = doResult.value;
|
|
37015
|
-
const [result] = await match(json(201, Control$inboundSchema), fail("4XX"), fail("5XX"))(response);
|
|
37152
|
+
const [result] = await match(json(201, Control$inboundSchema), fail("4XX"), fail("5XX"))(response, req);
|
|
37016
37153
|
if (!result.ok) {
|
|
37017
37154
|
return [result, { status: "complete", request: req, response }];
|
|
37018
37155
|
}
|
|
@@ -37087,6 +37224,7 @@ async function $do4(client, request, options) {
|
|
|
37087
37224
|
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
37088
37225
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
37089
37226
|
const context = {
|
|
37227
|
+
options: client._options,
|
|
37090
37228
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
37091
37229
|
operationID: "CreateCustomEvidenceRequest",
|
|
37092
37230
|
oAuth2Scopes: [],
|
|
@@ -37102,6 +37240,7 @@ async function $do4(client, request, options) {
|
|
|
37102
37240
|
path,
|
|
37103
37241
|
headers,
|
|
37104
37242
|
body,
|
|
37243
|
+
userAgent: client._options.userAgent,
|
|
37105
37244
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
|
|
37106
37245
|
}, options);
|
|
37107
37246
|
if (!requestRes.ok) {
|
|
@@ -37118,7 +37257,7 @@ async function $do4(client, request, options) {
|
|
|
37118
37257
|
return [doResult, { status: "request-error", request: req }];
|
|
37119
37258
|
}
|
|
37120
37259
|
const response = doResult.value;
|
|
37121
|
-
const [result] = await match(json(200, CustomEvidenceRequest$inboundSchema), fail("4XX"), fail("5XX"))(response);
|
|
37260
|
+
const [result] = await match(json(200, CustomEvidenceRequest$inboundSchema), fail("4XX"), fail("5XX"))(response, req);
|
|
37122
37261
|
if (!result.ok) {
|
|
37123
37262
|
return [result, { status: "complete", request: req, response }];
|
|
37124
37263
|
}
|
|
@@ -37198,6 +37337,7 @@ async function $do5(client, request, options) {
|
|
|
37198
37337
|
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
37199
37338
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
37200
37339
|
const context = {
|
|
37340
|
+
options: client._options,
|
|
37201
37341
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
37202
37342
|
operationID: "ListAuditEvidenceUrls",
|
|
37203
37343
|
oAuth2Scopes: [],
|
|
@@ -37214,6 +37354,7 @@ async function $do5(client, request, options) {
|
|
|
37214
37354
|
headers,
|
|
37215
37355
|
query,
|
|
37216
37356
|
body,
|
|
37357
|
+
userAgent: client._options.userAgent,
|
|
37217
37358
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
|
|
37218
37359
|
}, options);
|
|
37219
37360
|
if (!requestRes.ok) {
|
|
@@ -37230,7 +37371,7 @@ async function $do5(client, request, options) {
|
|
|
37230
37371
|
return [doResult, { status: "request-error", request: req }];
|
|
37231
37372
|
}
|
|
37232
37373
|
const response = doResult.value;
|
|
37233
|
-
const [result] = await match(json(200, PaginatedResponseEvidenceUrl$inboundSchema), fail("4XX"), fail("5XX"))(response);
|
|
37374
|
+
const [result] = await match(json(200, PaginatedResponseEvidenceUrl$inboundSchema), fail("4XX"), fail("5XX"))(response, req);
|
|
37234
37375
|
if (!result.ok) {
|
|
37235
37376
|
return [result, { status: "complete", request: req, response }];
|
|
37236
37377
|
}
|
|
@@ -37292,6 +37433,7 @@ async function $do6(client, request, options) {
|
|
|
37292
37433
|
const path = pathToFunc("/audits")();
|
|
37293
37434
|
const query = encodeFormQuery({
|
|
37294
37435
|
changedSinceDate: payload.changedSinceDate,
|
|
37436
|
+
isActiveAudit: payload.isActiveAudit,
|
|
37295
37437
|
pageCursor: payload.pageCursor,
|
|
37296
37438
|
pageSize: payload.pageSize
|
|
37297
37439
|
});
|
|
@@ -37302,6 +37444,7 @@ async function $do6(client, request, options) {
|
|
|
37302
37444
|
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
37303
37445
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
37304
37446
|
const context = {
|
|
37447
|
+
options: client._options,
|
|
37305
37448
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
37306
37449
|
operationID: "ListAudits",
|
|
37307
37450
|
oAuth2Scopes: [],
|
|
@@ -37318,6 +37461,7 @@ async function $do6(client, request, options) {
|
|
|
37318
37461
|
headers,
|
|
37319
37462
|
query,
|
|
37320
37463
|
body,
|
|
37464
|
+
userAgent: client._options.userAgent,
|
|
37321
37465
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
|
|
37322
37466
|
}, options);
|
|
37323
37467
|
if (!requestRes.ok) {
|
|
@@ -37334,7 +37478,7 @@ async function $do6(client, request, options) {
|
|
|
37334
37478
|
return [doResult, { status: "request-error", request: req }];
|
|
37335
37479
|
}
|
|
37336
37480
|
const response = doResult.value;
|
|
37337
|
-
const [result] = await match(json(200, PaginatedResponseAudit$inboundSchema), fail("4XX"), fail("5XX"))(response);
|
|
37481
|
+
const [result] = await match(json(200, PaginatedResponseAudit$inboundSchema), fail("4XX"), fail("5XX"))(response, req);
|
|
37338
37482
|
if (!result.ok) {
|
|
37339
37483
|
return [result, { status: "complete", request: req, response }];
|
|
37340
37484
|
}
|
|
@@ -37411,6 +37555,7 @@ async function $do7(client, request, options) {
|
|
|
37411
37555
|
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
37412
37556
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
37413
37557
|
const context = {
|
|
37558
|
+
options: client._options,
|
|
37414
37559
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
37415
37560
|
operationID: "ListAuditComments",
|
|
37416
37561
|
oAuth2Scopes: [],
|
|
@@ -37427,6 +37572,7 @@ async function $do7(client, request, options) {
|
|
|
37427
37572
|
headers,
|
|
37428
37573
|
query,
|
|
37429
37574
|
body,
|
|
37575
|
+
userAgent: client._options.userAgent,
|
|
37430
37576
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
|
|
37431
37577
|
}, options);
|
|
37432
37578
|
if (!requestRes.ok) {
|
|
@@ -37443,7 +37589,7 @@ async function $do7(client, request, options) {
|
|
|
37443
37589
|
return [doResult, { status: "request-error", request: req }];
|
|
37444
37590
|
}
|
|
37445
37591
|
const response = doResult.value;
|
|
37446
|
-
const [result] = await match(json(200, PaginatedResponseComment$inboundSchema), fail("4XX"), fail("5XX"))(response);
|
|
37592
|
+
const [result] = await match(json(200, PaginatedResponseComment$inboundSchema), fail("4XX"), fail("5XX"))(response, req);
|
|
37447
37593
|
if (!result.ok) {
|
|
37448
37594
|
return [result, { status: "complete", request: req, response }];
|
|
37449
37595
|
}
|
|
@@ -37519,6 +37665,7 @@ async function $do8(client, request, options) {
|
|
|
37519
37665
|
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
37520
37666
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
37521
37667
|
const context = {
|
|
37668
|
+
options: client._options,
|
|
37522
37669
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
37523
37670
|
operationID: "ListAuditControls",
|
|
37524
37671
|
oAuth2Scopes: [],
|
|
@@ -37535,6 +37682,7 @@ async function $do8(client, request, options) {
|
|
|
37535
37682
|
headers,
|
|
37536
37683
|
query,
|
|
37537
37684
|
body,
|
|
37685
|
+
userAgent: client._options.userAgent,
|
|
37538
37686
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
|
|
37539
37687
|
}, options);
|
|
37540
37688
|
if (!requestRes.ok) {
|
|
@@ -37551,7 +37699,7 @@ async function $do8(client, request, options) {
|
|
|
37551
37699
|
return [doResult, { status: "request-error", request: req }];
|
|
37552
37700
|
}
|
|
37553
37701
|
const response = doResult.value;
|
|
37554
|
-
const [result] = await match(json(200, PaginatedResponseAuditorControl$inboundSchema), fail("4XX"), fail("5XX"))(response);
|
|
37702
|
+
const [result] = await match(json(200, PaginatedResponseAuditorControl$inboundSchema), fail("4XX"), fail("5XX"))(response, req);
|
|
37555
37703
|
if (!result.ok) {
|
|
37556
37704
|
return [result, { status: "complete", request: req, response }];
|
|
37557
37705
|
}
|
|
@@ -37628,6 +37776,7 @@ async function $do9(client, request, options) {
|
|
|
37628
37776
|
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
37629
37777
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
37630
37778
|
const context = {
|
|
37779
|
+
options: client._options,
|
|
37631
37780
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
37632
37781
|
operationID: "ListAuditEvidence",
|
|
37633
37782
|
oAuth2Scopes: [],
|
|
@@ -37644,6 +37793,7 @@ async function $do9(client, request, options) {
|
|
|
37644
37793
|
headers,
|
|
37645
37794
|
query,
|
|
37646
37795
|
body,
|
|
37796
|
+
userAgent: client._options.userAgent,
|
|
37647
37797
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
|
|
37648
37798
|
}, options);
|
|
37649
37799
|
if (!requestRes.ok) {
|
|
@@ -37660,7 +37810,7 @@ async function $do9(client, request, options) {
|
|
|
37660
37810
|
return [doResult, { status: "request-error", request: req }];
|
|
37661
37811
|
}
|
|
37662
37812
|
const response = doResult.value;
|
|
37663
|
-
const [result] = await match(json(200, PaginatedResponseEvidence$inboundSchema), fail("4XX"), fail("5XX"))(response);
|
|
37813
|
+
const [result] = await match(json(200, PaginatedResponseEvidence$inboundSchema), fail("4XX"), fail("5XX"))(response, req);
|
|
37664
37814
|
if (!result.ok) {
|
|
37665
37815
|
return [result, { status: "complete", request: req, response }];
|
|
37666
37816
|
}
|
|
@@ -37739,6 +37889,7 @@ async function $do10(client, request, options) {
|
|
|
37739
37889
|
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
37740
37890
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
37741
37891
|
const context = {
|
|
37892
|
+
options: client._options,
|
|
37742
37893
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
37743
37894
|
operationID: "UpdateAuditEvidence",
|
|
37744
37895
|
oAuth2Scopes: [],
|
|
@@ -37754,6 +37905,7 @@ async function $do10(client, request, options) {
|
|
|
37754
37905
|
path,
|
|
37755
37906
|
headers,
|
|
37756
37907
|
body,
|
|
37908
|
+
userAgent: client._options.userAgent,
|
|
37757
37909
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
|
|
37758
37910
|
}, options);
|
|
37759
37911
|
if (!requestRes.ok) {
|
|
@@ -37770,7 +37922,7 @@ async function $do10(client, request, options) {
|
|
|
37770
37922
|
return [doResult, { status: "request-error", request: req }];
|
|
37771
37923
|
}
|
|
37772
37924
|
const response = doResult.value;
|
|
37773
|
-
const [result] = await match(json(200, Evidence$inboundSchema), fail("4XX"), fail("5XX"))(response);
|
|
37925
|
+
const [result] = await match(json(200, Evidence$inboundSchema), fail("4XX"), fail("5XX"))(response, req);
|
|
37774
37926
|
if (!result.ok) {
|
|
37775
37927
|
return [result, { status: "complete", request: req, response }];
|
|
37776
37928
|
}
|
|
@@ -37821,7 +37973,7 @@ Update audit evidence.`,
|
|
|
37821
37973
|
function createMCPServer(deps) {
|
|
37822
37974
|
const server = new McpServer({
|
|
37823
37975
|
name: "Vanta",
|
|
37824
|
-
version: "0.
|
|
37976
|
+
version: "0.3.0"
|
|
37825
37977
|
});
|
|
37826
37978
|
const client = new VantaCore({
|
|
37827
37979
|
bearerAuth: deps.bearerAuth,
|
|
@@ -37890,8 +38042,7 @@ async function startStdio(flags) {
|
|
|
37890
38042
|
const server = createMCPServer({
|
|
37891
38043
|
logger,
|
|
37892
38044
|
allowedTools: flags.tool,
|
|
37893
|
-
|
|
37894
|
-
...{ bearerAuth: flags["bearer-auth"] },
|
|
38045
|
+
...{ bearerAuth: flags["bearer-auth"] ?? "" },
|
|
37895
38046
|
serverURL: flags["server-url"],
|
|
37896
38047
|
serverIdx: flags["server-index"]
|
|
37897
38048
|
});
|
|
@@ -37909,8 +38060,7 @@ async function startSSE(flags) {
|
|
|
37909
38060
|
const mcpServer = createMCPServer({
|
|
37910
38061
|
logger,
|
|
37911
38062
|
allowedTools: flags.tool,
|
|
37912
|
-
|
|
37913
|
-
...{ bearerAuth: flags["bearer-auth"] },
|
|
38063
|
+
...{ bearerAuth: flags["bearer-auth"] ?? "" },
|
|
37914
38064
|
serverURL: flags["server-url"],
|
|
37915
38065
|
serverIdx: flags["server-index"]
|
|
37916
38066
|
});
|
|
@@ -38941,13 +39091,8 @@ function buildContext(process2) {
|
|
|
38941
39091
|
}
|
|
38942
39092
|
|
|
38943
39093
|
// src/mcp-server/cli/start/command.ts
|
|
38944
|
-
|
|
39094
|
+
init_zod();
|
|
38945
39095
|
init_console_logger();
|
|
38946
|
-
|
|
38947
|
-
// src/mcp-server/scopes.ts
|
|
38948
|
-
var mcpScopes = [];
|
|
38949
|
-
|
|
38950
|
-
// src/mcp-server/cli/start/command.ts
|
|
38951
39096
|
var startCommand = on({
|
|
38952
39097
|
loader: async () => {
|
|
38953
39098
|
const { main: main2 } = await Promise.resolve().then(() => (init_impl(), exports_impl));
|
|
@@ -38976,15 +39121,6 @@ var startCommand = on({
|
|
|
38976
39121
|
return stringType().parse(value);
|
|
38977
39122
|
}
|
|
38978
39123
|
},
|
|
38979
|
-
...mcpScopes.length ? {
|
|
38980
|
-
scope: {
|
|
38981
|
-
kind: "enum",
|
|
38982
|
-
brief: "Mount tools/resources that match given scope (repeatable flag)",
|
|
38983
|
-
values: mcpScopes,
|
|
38984
|
-
variadic: true,
|
|
38985
|
-
optional: true
|
|
38986
|
-
}
|
|
38987
|
-
} : {},
|
|
38988
39124
|
"bearer-auth": {
|
|
38989
39125
|
kind: "parsed",
|
|
38990
39126
|
brief: "Sets the bearerAuth auth field for the API",
|
|
@@ -39052,7 +39188,7 @@ var routes = an({
|
|
|
39052
39188
|
var app = He(routes, {
|
|
39053
39189
|
name: "mcp",
|
|
39054
39190
|
versionInfo: {
|
|
39055
|
-
currentVersion: "0.
|
|
39191
|
+
currentVersion: "0.3.0"
|
|
39056
39192
|
}
|
|
39057
39193
|
});
|
|
39058
39194
|
zt(app, process3.argv.slice(2), buildContext(process3));
|
|
@@ -39060,5 +39196,5 @@ export {
|
|
|
39060
39196
|
app
|
|
39061
39197
|
};
|
|
39062
39198
|
|
|
39063
|
-
//# debugId=
|
|
39199
|
+
//# debugId=608BF55B7F66D11F64756E2164756E21
|
|
39064
39200
|
//# sourceMappingURL=mcp-server.js.map
|