@financeable/lenders 0.0.2 → 0.1.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.
Files changed (126) hide show
  1. package/FUNCTIONS.md +14 -37
  2. package/README.md +87 -135
  3. package/bin/mcp-server.js +1147 -1003
  4. package/bin/mcp-server.js.map +27 -16
  5. package/dist/commonjs/funcs/consumersCreatePepper.d.ts +3 -2
  6. package/dist/commonjs/funcs/consumersCreatePepper.d.ts.map +1 -1
  7. package/dist/commonjs/funcs/consumersCreatePepper.js +3 -1
  8. package/dist/commonjs/funcs/consumersCreatePepper.js.map +1 -1
  9. package/dist/commonjs/hooks/types.d.ts +2 -0
  10. package/dist/commonjs/hooks/types.d.ts.map +1 -1
  11. package/dist/commonjs/index.d.ts +2 -0
  12. package/dist/commonjs/index.d.ts.map +1 -1
  13. package/dist/commonjs/index.js +3 -1
  14. package/dist/commonjs/index.js.map +1 -1
  15. package/dist/commonjs/lib/config.d.ts +7 -3
  16. package/dist/commonjs/lib/config.d.ts.map +1 -1
  17. package/dist/commonjs/lib/config.js +3 -3
  18. package/dist/commonjs/lib/config.js.map +1 -1
  19. package/dist/commonjs/lib/matchers.d.ts +6 -11
  20. package/dist/commonjs/lib/matchers.d.ts.map +1 -1
  21. package/dist/commonjs/lib/matchers.js +45 -31
  22. package/dist/commonjs/lib/matchers.js.map +1 -1
  23. package/dist/commonjs/lib/sdks.d.ts +4 -1
  24. package/dist/commonjs/lib/sdks.d.ts.map +1 -1
  25. package/dist/commonjs/lib/sdks.js +16 -16
  26. package/dist/commonjs/lib/sdks.js.map +1 -1
  27. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  28. package/dist/commonjs/mcp-server/server.js +1 -1
  29. package/dist/commonjs/models/components/apierrorcodes.d.ts +21 -0
  30. package/dist/commonjs/models/components/apierrorcodes.d.ts.map +1 -1
  31. package/dist/commonjs/models/components/apierrorcodes.js +7 -0
  32. package/dist/commonjs/models/components/apierrorcodes.js.map +1 -1
  33. package/dist/commonjs/models/errors/apierror.d.ts +8 -6
  34. package/dist/commonjs/models/errors/apierror.d.ts.map +1 -1
  35. package/dist/commonjs/models/errors/apierror.js +17 -10
  36. package/dist/commonjs/models/errors/apierror.js.map +1 -1
  37. package/dist/commonjs/models/errors/createpepperconsumer.d.ts +31 -10
  38. package/dist/commonjs/models/errors/createpepperconsumer.d.ts.map +1 -1
  39. package/dist/commonjs/models/errors/createpepperconsumer.js +56 -20
  40. package/dist/commonjs/models/errors/createpepperconsumer.js.map +1 -1
  41. package/dist/commonjs/models/errors/financeablelenderserror.d.ts +19 -0
  42. package/dist/commonjs/models/errors/financeablelenderserror.d.ts.map +1 -0
  43. package/dist/commonjs/models/errors/financeablelenderserror.js +20 -0
  44. package/dist/commonjs/models/errors/financeablelenderserror.js.map +1 -0
  45. package/dist/commonjs/models/errors/index.d.ts +1 -0
  46. package/dist/commonjs/models/errors/index.d.ts.map +1 -1
  47. package/dist/commonjs/models/errors/index.js +1 -0
  48. package/dist/commonjs/models/errors/index.js.map +1 -1
  49. package/dist/commonjs/models/errors/responsevalidationerror.d.ts +26 -0
  50. package/dist/commonjs/models/errors/responsevalidationerror.d.ts.map +1 -0
  51. package/dist/commonjs/models/errors/responsevalidationerror.js +66 -0
  52. package/dist/commonjs/models/errors/responsevalidationerror.js.map +1 -0
  53. package/dist/commonjs/models/errors/sdkvalidationerror.d.ts +1 -0
  54. package/dist/commonjs/models/errors/sdkvalidationerror.d.ts.map +1 -1
  55. package/dist/commonjs/models/errors/sdkvalidationerror.js +14 -0
  56. package/dist/commonjs/models/errors/sdkvalidationerror.js.map +1 -1
  57. package/dist/esm/funcs/consumersCreatePepper.d.ts +3 -2
  58. package/dist/esm/funcs/consumersCreatePepper.d.ts.map +1 -1
  59. package/dist/esm/funcs/consumersCreatePepper.js +3 -1
  60. package/dist/esm/funcs/consumersCreatePepper.js.map +1 -1
  61. package/dist/esm/hooks/types.d.ts +2 -0
  62. package/dist/esm/hooks/types.d.ts.map +1 -1
  63. package/dist/esm/index.d.ts +2 -0
  64. package/dist/esm/index.d.ts.map +1 -1
  65. package/dist/esm/index.js +1 -0
  66. package/dist/esm/index.js.map +1 -1
  67. package/dist/esm/lib/config.d.ts +7 -3
  68. package/dist/esm/lib/config.d.ts.map +1 -1
  69. package/dist/esm/lib/config.js +3 -3
  70. package/dist/esm/lib/config.js.map +1 -1
  71. package/dist/esm/lib/matchers.d.ts +6 -11
  72. package/dist/esm/lib/matchers.d.ts.map +1 -1
  73. package/dist/esm/lib/matchers.js +43 -30
  74. package/dist/esm/lib/matchers.js.map +1 -1
  75. package/dist/esm/lib/sdks.d.ts +4 -1
  76. package/dist/esm/lib/sdks.d.ts.map +1 -1
  77. package/dist/esm/lib/sdks.js +16 -16
  78. package/dist/esm/lib/sdks.js.map +1 -1
  79. package/dist/esm/mcp-server/mcp-server.js +1 -1
  80. package/dist/esm/mcp-server/server.js +1 -1
  81. package/dist/esm/models/components/apierrorcodes.d.ts +21 -0
  82. package/dist/esm/models/components/apierrorcodes.d.ts.map +1 -1
  83. package/dist/esm/models/components/apierrorcodes.js +7 -0
  84. package/dist/esm/models/components/apierrorcodes.js.map +1 -1
  85. package/dist/esm/models/errors/apierror.d.ts +8 -6
  86. package/dist/esm/models/errors/apierror.d.ts.map +1 -1
  87. package/dist/esm/models/errors/apierror.js +17 -10
  88. package/dist/esm/models/errors/apierror.js.map +1 -1
  89. package/dist/esm/models/errors/createpepperconsumer.d.ts +31 -10
  90. package/dist/esm/models/errors/createpepperconsumer.d.ts.map +1 -1
  91. package/dist/esm/models/errors/createpepperconsumer.js +56 -20
  92. package/dist/esm/models/errors/createpepperconsumer.js.map +1 -1
  93. package/dist/esm/models/errors/financeablelenderserror.d.ts +19 -0
  94. package/dist/esm/models/errors/financeablelenderserror.d.ts.map +1 -0
  95. package/dist/esm/models/errors/financeablelenderserror.js +16 -0
  96. package/dist/esm/models/errors/financeablelenderserror.js.map +1 -0
  97. package/dist/esm/models/errors/index.d.ts +1 -0
  98. package/dist/esm/models/errors/index.d.ts.map +1 -1
  99. package/dist/esm/models/errors/index.js +1 -0
  100. package/dist/esm/models/errors/index.js.map +1 -1
  101. package/dist/esm/models/errors/responsevalidationerror.d.ts +26 -0
  102. package/dist/esm/models/errors/responsevalidationerror.d.ts.map +1 -0
  103. package/dist/esm/models/errors/responsevalidationerror.js +29 -0
  104. package/dist/esm/models/errors/responsevalidationerror.js.map +1 -0
  105. package/dist/esm/models/errors/sdkvalidationerror.d.ts +1 -0
  106. package/dist/esm/models/errors/sdkvalidationerror.d.ts.map +1 -1
  107. package/dist/esm/models/errors/sdkvalidationerror.js +14 -0
  108. package/dist/esm/models/errors/sdkvalidationerror.js.map +1 -1
  109. package/docs/sdks/consumers/README.md +23 -39
  110. package/jsr.json +1 -1
  111. package/package.json +4 -4
  112. package/src/funcs/consumersCreatePepper.ts +23 -17
  113. package/src/hooks/types.ts +2 -0
  114. package/src/index.ts +2 -0
  115. package/src/lib/config.ts +7 -3
  116. package/src/lib/matchers.ts +64 -41
  117. package/src/lib/sdks.ts +29 -17
  118. package/src/mcp-server/mcp-server.ts +1 -1
  119. package/src/mcp-server/server.ts +1 -1
  120. package/src/models/components/apierrorcodes.ts +7 -0
  121. package/src/models/errors/apierror.ts +23 -16
  122. package/src/models/errors/createpepperconsumer.ts +75 -25
  123. package/src/models/errors/financeablelenderserror.ts +35 -0
  124. package/src/models/errors/index.ts +1 -0
  125. package/src/models/errors/responsevalidationerror.ts +50 -0
  126. package/src/models/errors/sdkvalidationerror.ts +12 -0
package/bin/mcp-server.js CHANGED
@@ -29,13 +29,378 @@ 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/lib/index.mjs
32
+ // node_modules/zod/dist/esm/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
+ };
78
+ function assertIs(_arg) {
79
+ }
80
+ util2.assertIs = assertIs;
81
+ function assertNever(_x) {
82
+ throw new Error;
83
+ }
84
+ util2.assertNever = assertNever;
85
+ util2.arrayToEnum = (items) => {
86
+ const obj = {};
87
+ for (const item of items) {
88
+ obj[item] = item;
89
+ }
90
+ return obj;
91
+ };
92
+ util2.getValidEnumValues = (obj) => {
93
+ const validKeys = util2.objectKeys(obj).filter((k2) => typeof obj[obj[k2]] !== "number");
94
+ const filtered = {};
95
+ for (const k2 of validKeys) {
96
+ filtered[k2] = obj[k2];
97
+ }
98
+ return util2.objectValues(filtered);
99
+ };
100
+ util2.objectValues = (obj) => {
101
+ return util2.objectKeys(obj).map(function(e) {
102
+ return obj[e];
103
+ });
104
+ };
105
+ util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
106
+ const keys = [];
107
+ for (const key in object) {
108
+ if (Object.prototype.hasOwnProperty.call(object, key)) {
109
+ keys.push(key);
110
+ }
111
+ }
112
+ return keys;
113
+ };
114
+ util2.find = (arr, checker) => {
115
+ for (const item of arr) {
116
+ if (checker(item))
117
+ return item;
118
+ }
119
+ return;
120
+ };
121
+ util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
122
+ function joinValues(array, separator = " | ") {
123
+ return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
124
+ }
125
+ util2.joinValues = joinValues;
126
+ util2.jsonStringifyReplacer = (_2, value) => {
127
+ if (typeof value === "bigint") {
128
+ return value.toString();
129
+ }
130
+ return value;
131
+ };
132
+ })(util || (util = {}));
133
+ (function(objectUtil2) {
134
+ objectUtil2.mergeShapes = (first, second) => {
135
+ return {
136
+ ...first,
137
+ ...second
138
+ };
139
+ };
140
+ })(objectUtil || (objectUtil = {}));
141
+ ZodParsedType = util.arrayToEnum([
142
+ "string",
143
+ "nan",
144
+ "number",
145
+ "integer",
146
+ "float",
147
+ "boolean",
148
+ "date",
149
+ "bigint",
150
+ "symbol",
151
+ "function",
152
+ "undefined",
153
+ "null",
154
+ "array",
155
+ "object",
156
+ "unknown",
157
+ "promise",
158
+ "void",
159
+ "never",
160
+ "map",
161
+ "set"
162
+ ]);
163
+ });
164
+
165
+ // node_modules/zod/dist/esm/v3/ZodError.js
166
+ var ZodIssueCode, quotelessJson = (obj) => {
167
+ const json = JSON.stringify(obj, null, 2);
168
+ return json.replace(/"([^"]+)":/g, "$1:");
169
+ }, ZodError;
170
+ var init_ZodError = __esm(() => {
171
+ init_util();
172
+ ZodIssueCode = util.arrayToEnum([
173
+ "invalid_type",
174
+ "invalid_literal",
175
+ "custom",
176
+ "invalid_union",
177
+ "invalid_union_discriminator",
178
+ "invalid_enum_value",
179
+ "unrecognized_keys",
180
+ "invalid_arguments",
181
+ "invalid_return_type",
182
+ "invalid_date",
183
+ "invalid_string",
184
+ "too_small",
185
+ "too_big",
186
+ "invalid_intersection_types",
187
+ "not_multiple_of",
188
+ "not_finite"
189
+ ]);
190
+ ZodError = class ZodError extends Error {
191
+ get errors() {
192
+ return this.issues;
193
+ }
194
+ constructor(issues) {
195
+ super();
196
+ this.issues = [];
197
+ this.addIssue = (sub) => {
198
+ this.issues = [...this.issues, sub];
199
+ };
200
+ this.addIssues = (subs = []) => {
201
+ this.issues = [...this.issues, ...subs];
202
+ };
203
+ const actualProto = new.target.prototype;
204
+ if (Object.setPrototypeOf) {
205
+ Object.setPrototypeOf(this, actualProto);
206
+ } else {
207
+ this.__proto__ = actualProto;
208
+ }
209
+ this.name = "ZodError";
210
+ this.issues = issues;
211
+ }
212
+ format(_mapper) {
213
+ const mapper = _mapper || function(issue) {
214
+ return issue.message;
215
+ };
216
+ const fieldErrors = { _errors: [] };
217
+ const processError = (error) => {
218
+ for (const issue of error.issues) {
219
+ if (issue.code === "invalid_union") {
220
+ issue.unionErrors.map(processError);
221
+ } else if (issue.code === "invalid_return_type") {
222
+ processError(issue.returnTypeError);
223
+ } else if (issue.code === "invalid_arguments") {
224
+ processError(issue.argumentsError);
225
+ } else if (issue.path.length === 0) {
226
+ fieldErrors._errors.push(mapper(issue));
227
+ } else {
228
+ let curr = fieldErrors;
229
+ let i = 0;
230
+ while (i < issue.path.length) {
231
+ const el = issue.path[i];
232
+ const terminal = i === issue.path.length - 1;
233
+ if (!terminal) {
234
+ curr[el] = curr[el] || { _errors: [] };
235
+ } else {
236
+ curr[el] = curr[el] || { _errors: [] };
237
+ curr[el]._errors.push(mapper(issue));
238
+ }
239
+ curr = curr[el];
240
+ i++;
241
+ }
242
+ }
243
+ }
244
+ };
245
+ processError(this);
246
+ return fieldErrors;
247
+ }
248
+ static assert(value) {
249
+ if (!(value instanceof ZodError)) {
250
+ throw new Error(`Not a ZodError: ${value}`);
251
+ }
252
+ }
253
+ toString() {
254
+ return this.message;
255
+ }
256
+ get message() {
257
+ return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
258
+ }
259
+ get isEmpty() {
260
+ return this.issues.length === 0;
261
+ }
262
+ flatten(mapper = (issue) => issue.message) {
263
+ const fieldErrors = {};
264
+ const formErrors = [];
265
+ for (const sub of this.issues) {
266
+ if (sub.path.length > 0) {
267
+ fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
268
+ fieldErrors[sub.path[0]].push(mapper(sub));
269
+ } else {
270
+ formErrors.push(mapper(sub));
271
+ }
272
+ }
273
+ return { formErrors, fieldErrors };
274
+ }
275
+ get formErrors() {
276
+ return this.flatten();
277
+ }
278
+ };
279
+ ZodError.create = (issues) => {
280
+ const error = new ZodError(issues);
281
+ return error;
282
+ };
283
+ });
284
+
285
+ // node_modules/zod/dist/esm/v3/locales/en.js
286
+ var errorMap = (issue, _ctx) => {
287
+ let message;
288
+ switch (issue.code) {
289
+ case ZodIssueCode.invalid_type:
290
+ if (issue.received === ZodParsedType.undefined) {
291
+ message = "Required";
292
+ } else {
293
+ message = `Expected ${issue.expected}, received ${issue.received}`;
294
+ }
295
+ break;
296
+ case ZodIssueCode.invalid_literal:
297
+ message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
298
+ break;
299
+ case ZodIssueCode.unrecognized_keys:
300
+ message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
301
+ break;
302
+ case ZodIssueCode.invalid_union:
303
+ message = `Invalid input`;
304
+ break;
305
+ case ZodIssueCode.invalid_union_discriminator:
306
+ message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
307
+ break;
308
+ case ZodIssueCode.invalid_enum_value:
309
+ message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
310
+ break;
311
+ case ZodIssueCode.invalid_arguments:
312
+ message = `Invalid function arguments`;
313
+ break;
314
+ case ZodIssueCode.invalid_return_type:
315
+ message = `Invalid function return type`;
316
+ break;
317
+ case ZodIssueCode.invalid_date:
318
+ message = `Invalid date`;
319
+ break;
320
+ case ZodIssueCode.invalid_string:
321
+ if (typeof issue.validation === "object") {
322
+ if ("includes" in issue.validation) {
323
+ message = `Invalid input: must include "${issue.validation.includes}"`;
324
+ if (typeof issue.validation.position === "number") {
325
+ message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
326
+ }
327
+ } else if ("startsWith" in issue.validation) {
328
+ message = `Invalid input: must start with "${issue.validation.startsWith}"`;
329
+ } else if ("endsWith" in issue.validation) {
330
+ message = `Invalid input: must end with "${issue.validation.endsWith}"`;
331
+ } else {
332
+ util.assertNever(issue.validation);
333
+ }
334
+ } else if (issue.validation !== "regex") {
335
+ message = `Invalid ${issue.validation}`;
336
+ } else {
337
+ message = "Invalid";
338
+ }
339
+ break;
340
+ case ZodIssueCode.too_small:
341
+ if (issue.type === "array")
342
+ message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
343
+ else if (issue.type === "string")
344
+ message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
345
+ else if (issue.type === "number")
346
+ message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
347
+ else if (issue.type === "date")
348
+ message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
349
+ else
350
+ message = "Invalid input";
351
+ break;
352
+ case ZodIssueCode.too_big:
353
+ if (issue.type === "array")
354
+ message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
355
+ else if (issue.type === "string")
356
+ message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
357
+ else if (issue.type === "number")
358
+ message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
359
+ else if (issue.type === "bigint")
360
+ message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
361
+ else if (issue.type === "date")
362
+ message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
363
+ else
364
+ message = "Invalid input";
365
+ break;
366
+ case ZodIssueCode.custom:
367
+ message = `Invalid input`;
368
+ break;
369
+ case ZodIssueCode.invalid_intersection_types:
370
+ message = `Intersection results could not be merged`;
371
+ break;
372
+ case ZodIssueCode.not_multiple_of:
373
+ message = `Number must be a multiple of ${issue.multipleOf}`;
374
+ break;
375
+ case ZodIssueCode.not_finite:
376
+ message = "Number must be finite";
377
+ break;
378
+ default:
379
+ message = _ctx.defaultError;
380
+ util.assertNever(issue);
381
+ }
382
+ return { message };
383
+ }, en_default;
384
+ var init_en = __esm(() => {
385
+ init_ZodError();
386
+ init_util();
387
+ en_default = errorMap;
388
+ });
389
+
390
+ // node_modules/zod/dist/esm/v3/errors.js
33
391
  function setErrorMap(map) {
34
392
  overrideErrorMap = map;
35
393
  }
36
394
  function getErrorMap() {
37
395
  return overrideErrorMap;
38
396
  }
397
+ var overrideErrorMap;
398
+ var init_errors = __esm(() => {
399
+ init_en();
400
+ overrideErrorMap = en_default;
401
+ });
402
+
403
+ // node_modules/zod/dist/esm/v3/helpers/parseUtil.js
39
404
  function addIssueToContext(ctx, issueData) {
40
405
  const overrideMap = getErrorMap();
41
406
  const issue = makeIssue({
@@ -46,7 +411,7 @@ function addIssueToContext(ctx, issueData) {
46
411
  ctx.common.contextualErrorMap,
47
412
  ctx.schemaErrorMap,
48
413
  overrideMap,
49
- overrideMap === errorMap ? undefined : errorMap
414
+ overrideMap === en_default ? undefined : en_default
50
415
  ].filter((x2) => !!x2)
51
416
  });
52
417
  ctx.common.issues.push(issue);
@@ -106,23 +471,54 @@ class ParseStatus {
106
471
  return { status: status.value, value: finalObject };
107
472
  }
108
473
  }
109
- function __classPrivateFieldGet(receiver, state, kind, f) {
110
- if (kind === "a" && !f)
111
- throw new TypeError("Private accessor was defined without a getter");
112
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
113
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
114
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
115
- }
116
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
117
- if (kind === "m")
118
- throw new TypeError("Private method is not writable");
119
- if (kind === "a" && !f)
120
- throw new TypeError("Private accessor was defined without a setter");
121
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
122
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
123
- return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
124
- }
474
+ var makeIssue = (params) => {
475
+ const { data, path, errorMaps, issueData } = params;
476
+ const fullPath = [...path, ...issueData.path || []];
477
+ const fullIssue = {
478
+ ...issueData,
479
+ path: fullPath
480
+ };
481
+ if (issueData.message !== undefined) {
482
+ return {
483
+ ...issueData,
484
+ path: fullPath,
485
+ message: issueData.message
486
+ };
487
+ }
488
+ let errorMessage = "";
489
+ const maps = errorMaps.filter((m) => !!m).slice().reverse();
490
+ for (const map of maps) {
491
+ errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
492
+ }
493
+ return {
494
+ ...issueData,
495
+ path: fullPath,
496
+ message: errorMessage
497
+ };
498
+ }, 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;
499
+ var init_parseUtil = __esm(() => {
500
+ init_errors();
501
+ init_en();
502
+ EMPTY_PATH = [];
503
+ INVALID = Object.freeze({
504
+ status: "aborted"
505
+ });
506
+ });
507
+
508
+ // node_modules/zod/dist/esm/v3/helpers/typeAliases.js
509
+ var init_typeAliases = () => {
510
+ };
125
511
 
512
+ // node_modules/zod/dist/esm/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/dist/esm/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 instanceof Array) {
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 !== null && message !== undefined ? message : ctx.defaultError };
553
+ return { message: message ?? ctx.defaultError };
159
554
  }
160
555
  if (typeof ctx.data === "undefined") {
161
- return { message: (_a = message !== null && message !== undefined ? message : required_error) !== null && _a !== undefined ? _a : ctx.defaultError };
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: (_b = message !== null && message !== undefined ? message : invalid_type_error) !== null && _b !== undefined ? _b : ctx.defaultError };
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: (_a = params === null || params === undefined ? undefined : params.async) !== null && _a !== undefined ? _a : false,
223
- contextualErrorMap: params === null || params === undefined ? undefined : params.errorMap
616
+ async: params?.async ?? false,
617
+ contextualErrorMap: params?.errorMap
224
618
  },
225
- path: (params === null || params === undefined ? undefined : params.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 ((_b = (_a = err === null || err === undefined ? undefined : err.message) === null || _a === undefined ? undefined : _a.toLowerCase()) === null || _b === undefined ? undefined : _b.includes("encountered")) {
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 === null || params === undefined ? undefined : params.errorMap,
674
+ contextualErrorMap: params?.errorMap,
282
675
  async: true
283
676
  },
284
- path: (params === null || params === undefined ? undefined : params.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 regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
849
+ let secondsRegexSource = `[0-5]\\d`;
457
850
  if (args.precision) {
458
- regex = `${regex}\\.\\d{${args.precision}}`;
851
+ secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
459
852
  } else if (args.precision == null) {
460
- regex = `${regex}(\\.\\d+)?`;
853
+ secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
461
854
  }
462
- return regex;
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)}$`);
@@ -491,12 +885,14 @@ function isValidJWT(jwt, alg) {
491
885
  const decoded = JSON.parse(atob(base64));
492
886
  if (typeof decoded !== "object" || decoded === null)
493
887
  return false;
494
- if (!decoded.typ || !decoded.alg)
888
+ if ("typ" in decoded && decoded?.typ !== "JWT")
889
+ return false;
890
+ if (!decoded.alg)
495
891
  return false;
496
892
  if (alg && decoded.alg !== alg)
497
893
  return false;
498
894
  return true;
499
- } catch (_a) {
895
+ } catch {
500
896
  return false;
501
897
  }
502
898
  }
@@ -513,9 +909,9 @@ function floatSafeRemainder(val, step) {
513
909
  const valDecCount = (val.toString().split(".")[1] || "").length;
514
910
  const stepDecCount = (step.toString().split(".")[1] || "").length;
515
911
  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 / Math.pow(10, decCount);
912
+ const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
913
+ const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
914
+ return valInt % stepInt / 10 ** decCount;
519
915
  }
520
916
  function deepPartialify(schema) {
521
917
  if (schema instanceof ZodObject) {
@@ -596,192 +992,26 @@ function cleanParams(params, data) {
596
992
  function custom(check, _params = {}, fatal) {
597
993
  if (check)
598
994
  return ZodAny.create().superRefine((data, ctx) => {
599
- var _a, _b;
600
995
  const r = check(data);
601
996
  if (r instanceof Promise) {
602
997
  return r.then((r2) => {
603
- var _a2, _b2;
604
998
  if (!r2) {
605
999
  const params = cleanParams(_params, data);
606
- const _fatal = (_b2 = (_a2 = params.fatal) !== null && _a2 !== undefined ? _a2 : fatal) !== null && _b2 !== undefined ? _b2 : true;
1000
+ const _fatal = params.fatal ?? fatal ?? true;
607
1001
  ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
608
1002
  }
609
1003
  });
610
1004
  }
611
1005
  if (!r) {
612
1006
  const params = cleanParams(_params, data);
613
- const _fatal = (_b = (_a = params.fatal) !== null && _a !== undefined ? _a : fatal) !== null && _b !== undefined ? _b : true;
1007
+ const _fatal = params.fatal ?? fatal ?? true;
614
1008
  ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
615
1009
  }
616
1010
  return;
617
1011
  });
618
1012
  return ZodAny.create();
619
1013
  }
620
- var util, objectUtil, ZodParsedType, getParsedType = (data) => {
621
- const t = typeof data;
622
- switch (t) {
623
- case "undefined":
624
- return ZodParsedType.undefined;
625
- case "string":
626
- return ZodParsedType.string;
627
- case "number":
628
- return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
629
- case "boolean":
630
- return ZodParsedType.boolean;
631
- case "function":
632
- return ZodParsedType.function;
633
- case "bigint":
634
- return ZodParsedType.bigint;
635
- case "symbol":
636
- return ZodParsedType.symbol;
637
- case "object":
638
- if (Array.isArray(data)) {
639
- return ZodParsedType.array;
640
- }
641
- if (data === null) {
642
- return ZodParsedType.null;
643
- }
644
- if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
645
- return ZodParsedType.promise;
646
- }
647
- if (typeof Map !== "undefined" && data instanceof Map) {
648
- return ZodParsedType.map;
649
- }
650
- if (typeof Set !== "undefined" && data instanceof Set) {
651
- return ZodParsedType.set;
652
- }
653
- if (typeof Date !== "undefined" && data instanceof Date) {
654
- return ZodParsedType.date;
655
- }
656
- return ZodParsedType.object;
657
- default:
658
- return ZodParsedType.unknown;
659
- }
660
- }, ZodIssueCode, quotelessJson = (obj) => {
661
- const json = JSON.stringify(obj, null, 2);
662
- return json.replace(/"([^"]+)":/g, "$1:");
663
- }, ZodError, errorMap = (issue, _ctx) => {
664
- let message;
665
- switch (issue.code) {
666
- case ZodIssueCode.invalid_type:
667
- if (issue.received === ZodParsedType.undefined) {
668
- message = "Required";
669
- } else {
670
- message = `Expected ${issue.expected}, received ${issue.received}`;
671
- }
672
- break;
673
- case ZodIssueCode.invalid_literal:
674
- message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
675
- break;
676
- case ZodIssueCode.unrecognized_keys:
677
- message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
678
- break;
679
- case ZodIssueCode.invalid_union:
680
- message = `Invalid input`;
681
- break;
682
- case ZodIssueCode.invalid_union_discriminator:
683
- message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
684
- break;
685
- case ZodIssueCode.invalid_enum_value:
686
- message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
687
- break;
688
- case ZodIssueCode.invalid_arguments:
689
- message = `Invalid function arguments`;
690
- break;
691
- case ZodIssueCode.invalid_return_type:
692
- message = `Invalid function return type`;
693
- break;
694
- case ZodIssueCode.invalid_date:
695
- message = `Invalid date`;
696
- break;
697
- case ZodIssueCode.invalid_string:
698
- if (typeof issue.validation === "object") {
699
- if ("includes" in issue.validation) {
700
- message = `Invalid input: must include "${issue.validation.includes}"`;
701
- if (typeof issue.validation.position === "number") {
702
- message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
703
- }
704
- } else if ("startsWith" in issue.validation) {
705
- message = `Invalid input: must start with "${issue.validation.startsWith}"`;
706
- } else if ("endsWith" in issue.validation) {
707
- message = `Invalid input: must end with "${issue.validation.endsWith}"`;
708
- } else {
709
- util.assertNever(issue.validation);
710
- }
711
- } else if (issue.validation !== "regex") {
712
- message = `Invalid ${issue.validation}`;
713
- } else {
714
- message = "Invalid";
715
- }
716
- break;
717
- case ZodIssueCode.too_small:
718
- if (issue.type === "array")
719
- message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
720
- else if (issue.type === "string")
721
- message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
722
- else if (issue.type === "number")
723
- message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
724
- else if (issue.type === "date")
725
- message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
726
- else
727
- message = "Invalid input";
728
- break;
729
- case ZodIssueCode.too_big:
730
- if (issue.type === "array")
731
- message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
732
- else if (issue.type === "string")
733
- message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
734
- else if (issue.type === "number")
735
- message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
736
- else if (issue.type === "bigint")
737
- message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
738
- else if (issue.type === "date")
739
- message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
740
- else
741
- message = "Invalid input";
742
- break;
743
- case ZodIssueCode.custom:
744
- message = `Invalid input`;
745
- break;
746
- case ZodIssueCode.invalid_intersection_types:
747
- message = `Intersection results could not be merged`;
748
- break;
749
- case ZodIssueCode.not_multiple_of:
750
- message = `Number must be a multiple of ${issue.multipleOf}`;
751
- break;
752
- case ZodIssueCode.not_finite:
753
- message = "Number must be finite";
754
- break;
755
- default:
756
- message = _ctx.defaultError;
757
- util.assertNever(issue);
758
- }
759
- return { message };
760
- }, overrideErrorMap, makeIssue = (params) => {
761
- const { data, path, errorMaps, issueData } = params;
762
- const fullPath = [...path, ...issueData.path || []];
763
- const fullIssue = {
764
- ...issueData,
765
- path: fullPath
766
- };
767
- if (issueData.message !== undefined) {
768
- return {
769
- ...issueData,
770
- path: fullPath,
771
- message: issueData.message
772
- };
773
- }
774
- let errorMessage = "";
775
- const maps = errorMaps.filter((m) => !!m).slice().reverse();
776
- for (const map of maps) {
777
- errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
778
- }
779
- return {
780
- ...issueData,
781
- path: fullPath,
782
- message: errorMessage
783
- };
784
- }, 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) => {
1014
+ var handleResult = (ctx, result) => {
785
1015
  if (isValid(result)) {
786
1016
  return { success: true, data: result.value };
787
1017
  } else {
@@ -831,215 +1061,13 @@ var util, objectUtil, ZodParsedType, getParsedType = (data) => {
831
1061
  }
832
1062
  }, 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 = {
833
1063
  message: `Input not instance of ${cls.name}`
834
- }) => 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, z2;
835
- var init_lib = __esm(() => {
836
- (function(util2) {
837
- util2.assertEqual = (val) => val;
838
- function assertIs(_arg) {
839
- }
840
- util2.assertIs = assertIs;
841
- function assertNever(_x) {
842
- throw new Error;
843
- }
844
- util2.assertNever = assertNever;
845
- util2.arrayToEnum = (items) => {
846
- const obj = {};
847
- for (const item of items) {
848
- obj[item] = item;
849
- }
850
- return obj;
851
- };
852
- util2.getValidEnumValues = (obj) => {
853
- const validKeys = util2.objectKeys(obj).filter((k2) => typeof obj[obj[k2]] !== "number");
854
- const filtered = {};
855
- for (const k2 of validKeys) {
856
- filtered[k2] = obj[k2];
857
- }
858
- return util2.objectValues(filtered);
859
- };
860
- util2.objectValues = (obj) => {
861
- return util2.objectKeys(obj).map(function(e) {
862
- return obj[e];
863
- });
864
- };
865
- util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
866
- const keys = [];
867
- for (const key in object) {
868
- if (Object.prototype.hasOwnProperty.call(object, key)) {
869
- keys.push(key);
870
- }
871
- }
872
- return keys;
873
- };
874
- util2.find = (arr, checker) => {
875
- for (const item of arr) {
876
- if (checker(item))
877
- return item;
878
- }
879
- return;
880
- };
881
- util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
882
- function joinValues(array, separator = " | ") {
883
- return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
884
- }
885
- util2.joinValues = joinValues;
886
- util2.jsonStringifyReplacer = (_2, value) => {
887
- if (typeof value === "bigint") {
888
- return value.toString();
889
- }
890
- return value;
891
- };
892
- })(util || (util = {}));
893
- (function(objectUtil2) {
894
- objectUtil2.mergeShapes = (first, second) => {
895
- return {
896
- ...first,
897
- ...second
898
- };
899
- };
900
- })(objectUtil || (objectUtil = {}));
901
- ZodParsedType = util.arrayToEnum([
902
- "string",
903
- "nan",
904
- "number",
905
- "integer",
906
- "float",
907
- "boolean",
908
- "date",
909
- "bigint",
910
- "symbol",
911
- "function",
912
- "undefined",
913
- "null",
914
- "array",
915
- "object",
916
- "unknown",
917
- "promise",
918
- "void",
919
- "never",
920
- "map",
921
- "set"
922
- ]);
923
- ZodIssueCode = util.arrayToEnum([
924
- "invalid_type",
925
- "invalid_literal",
926
- "custom",
927
- "invalid_union",
928
- "invalid_union_discriminator",
929
- "invalid_enum_value",
930
- "unrecognized_keys",
931
- "invalid_arguments",
932
- "invalid_return_type",
933
- "invalid_date",
934
- "invalid_string",
935
- "too_small",
936
- "too_big",
937
- "invalid_intersection_types",
938
- "not_multiple_of",
939
- "not_finite"
940
- ]);
941
- ZodError = class ZodError extends Error {
942
- get errors() {
943
- return this.issues;
944
- }
945
- constructor(issues) {
946
- super();
947
- this.issues = [];
948
- this.addIssue = (sub) => {
949
- this.issues = [...this.issues, sub];
950
- };
951
- this.addIssues = (subs = []) => {
952
- this.issues = [...this.issues, ...subs];
953
- };
954
- const actualProto = new.target.prototype;
955
- if (Object.setPrototypeOf) {
956
- Object.setPrototypeOf(this, actualProto);
957
- } else {
958
- this.__proto__ = actualProto;
959
- }
960
- this.name = "ZodError";
961
- this.issues = issues;
962
- }
963
- format(_mapper) {
964
- const mapper = _mapper || function(issue) {
965
- return issue.message;
966
- };
967
- const fieldErrors = { _errors: [] };
968
- const processError = (error) => {
969
- for (const issue of error.issues) {
970
- if (issue.code === "invalid_union") {
971
- issue.unionErrors.map(processError);
972
- } else if (issue.code === "invalid_return_type") {
973
- processError(issue.returnTypeError);
974
- } else if (issue.code === "invalid_arguments") {
975
- processError(issue.argumentsError);
976
- } else if (issue.path.length === 0) {
977
- fieldErrors._errors.push(mapper(issue));
978
- } else {
979
- let curr = fieldErrors;
980
- let i = 0;
981
- while (i < issue.path.length) {
982
- const el = issue.path[i];
983
- const terminal = i === issue.path.length - 1;
984
- if (!terminal) {
985
- curr[el] = curr[el] || { _errors: [] };
986
- } else {
987
- curr[el] = curr[el] || { _errors: [] };
988
- curr[el]._errors.push(mapper(issue));
989
- }
990
- curr = curr[el];
991
- i++;
992
- }
993
- }
994
- }
995
- };
996
- processError(this);
997
- return fieldErrors;
998
- }
999
- static assert(value) {
1000
- if (!(value instanceof ZodError)) {
1001
- throw new Error(`Not a ZodError: ${value}`);
1002
- }
1003
- }
1004
- toString() {
1005
- return this.message;
1006
- }
1007
- get message() {
1008
- return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
1009
- }
1010
- get isEmpty() {
1011
- return this.issues.length === 0;
1012
- }
1013
- flatten(mapper = (issue) => issue.message) {
1014
- const fieldErrors = {};
1015
- const formErrors = [];
1016
- for (const sub of this.issues) {
1017
- if (sub.path.length > 0) {
1018
- fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
1019
- fieldErrors[sub.path[0]].push(mapper(sub));
1020
- } else {
1021
- formErrors.push(mapper(sub));
1022
- }
1023
- }
1024
- return { formErrors, fieldErrors };
1025
- }
1026
- get formErrors() {
1027
- return this.flatten();
1028
- }
1029
- };
1030
- ZodError.create = (issues) => {
1031
- const error = new ZodError(issues);
1032
- return error;
1033
- };
1034
- overrideErrorMap = errorMap;
1035
- EMPTY_PATH = [];
1036
- INVALID = Object.freeze({
1037
- status: "aborted"
1038
- });
1039
- (function(errorUtil2) {
1040
- errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
1041
- errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === undefined ? undefined : message.message;
1042
- })(errorUtil || (errorUtil = {}));
1064
+ }) => 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;
1065
+ var init_types = __esm(() => {
1066
+ init_ZodError();
1067
+ init_errors();
1068
+ init_errorUtil();
1069
+ init_parseUtil();
1070
+ init_util();
1043
1071
  cuidRegex = /^c[^\s-]{8,}$/i;
1044
1072
  cuid2Regex = /^[0-9a-z]+$/;
1045
1073
  ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
@@ -1201,7 +1229,7 @@ var init_lib = __esm(() => {
1201
1229
  } else if (check.kind === "url") {
1202
1230
  try {
1203
1231
  new URL(input.data);
1204
- } catch (_a) {
1232
+ } catch {
1205
1233
  ctx = this._getOrReturnCtx(input, ctx);
1206
1234
  addIssueToContext(ctx, {
1207
1235
  validation: "url",
@@ -1413,7 +1441,6 @@ var init_lib = __esm(() => {
1413
1441
  return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
1414
1442
  }
1415
1443
  datetime(options) {
1416
- var _a, _b;
1417
1444
  if (typeof options === "string") {
1418
1445
  return this._addCheck({
1419
1446
  kind: "datetime",
@@ -1425,10 +1452,10 @@ var init_lib = __esm(() => {
1425
1452
  }
1426
1453
  return this._addCheck({
1427
1454
  kind: "datetime",
1428
- precision: typeof (options === null || options === undefined ? undefined : options.precision) === "undefined" ? null : options === null || options === undefined ? undefined : options.precision,
1429
- offset: (_a = options === null || options === undefined ? undefined : options.offset) !== null && _a !== undefined ? _a : false,
1430
- local: (_b = options === null || options === undefined ? undefined : options.local) !== null && _b !== undefined ? _b : false,
1431
- ...errorUtil.errToObj(options === null || options === undefined ? undefined : options.message)
1455
+ precision: typeof options?.precision === "undefined" ? null : options?.precision,
1456
+ offset: options?.offset ?? false,
1457
+ local: options?.local ?? false,
1458
+ ...errorUtil.errToObj(options?.message)
1432
1459
  });
1433
1460
  }
1434
1461
  date(message) {
@@ -1444,8 +1471,8 @@ var init_lib = __esm(() => {
1444
1471
  }
1445
1472
  return this._addCheck({
1446
1473
  kind: "time",
1447
- precision: typeof (options === null || options === undefined ? undefined : options.precision) === "undefined" ? null : options === null || options === undefined ? undefined : options.precision,
1448
- ...errorUtil.errToObj(options === null || options === undefined ? undefined : options.message)
1474
+ precision: typeof options?.precision === "undefined" ? null : options?.precision,
1475
+ ...errorUtil.errToObj(options?.message)
1449
1476
  });
1450
1477
  }
1451
1478
  duration(message) {
@@ -1462,8 +1489,8 @@ var init_lib = __esm(() => {
1462
1489
  return this._addCheck({
1463
1490
  kind: "includes",
1464
1491
  value,
1465
- position: options === null || options === undefined ? undefined : options.position,
1466
- ...errorUtil.errToObj(options === null || options === undefined ? undefined : options.message)
1492
+ position: options?.position,
1493
+ ...errorUtil.errToObj(options?.message)
1467
1494
  });
1468
1495
  }
1469
1496
  startsWith(value, message) {
@@ -1592,11 +1619,10 @@ var init_lib = __esm(() => {
1592
1619
  }
1593
1620
  };
1594
1621
  ZodString.create = (params) => {
1595
- var _a;
1596
1622
  return new ZodString({
1597
1623
  checks: [],
1598
1624
  typeName: ZodFirstPartyTypeKind.ZodString,
1599
- coerce: (_a = params === null || params === undefined ? undefined : params.coerce) !== null && _a !== undefined ? _a : false,
1625
+ coerce: params?.coerce ?? false,
1600
1626
  ...processCreateParams(params)
1601
1627
  });
1602
1628
  };
@@ -1808,7 +1834,8 @@ var init_lib = __esm(() => {
1808
1834
  return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
1809
1835
  }
1810
1836
  get isFinite() {
1811
- let max = null, min = null;
1837
+ let max = null;
1838
+ let min = null;
1812
1839
  for (const ch of this._def.checks) {
1813
1840
  if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
1814
1841
  return true;
@@ -1827,7 +1854,7 @@ var init_lib = __esm(() => {
1827
1854
  return new ZodNumber({
1828
1855
  checks: [],
1829
1856
  typeName: ZodFirstPartyTypeKind.ZodNumber,
1830
- coerce: (params === null || params === undefined ? undefined : params.coerce) || false,
1857
+ coerce: params?.coerce || false,
1831
1858
  ...processCreateParams(params)
1832
1859
  });
1833
1860
  };
@@ -1841,7 +1868,7 @@ var init_lib = __esm(() => {
1841
1868
  if (this._def.coerce) {
1842
1869
  try {
1843
1870
  input.data = BigInt(input.data);
1844
- } catch (_a) {
1871
+ } catch {
1845
1872
  return this._getInvalidInput(input);
1846
1873
  }
1847
1874
  }
@@ -1996,11 +2023,10 @@ var init_lib = __esm(() => {
1996
2023
  }
1997
2024
  };
1998
2025
  ZodBigInt.create = (params) => {
1999
- var _a;
2000
2026
  return new ZodBigInt({
2001
2027
  checks: [],
2002
2028
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
2003
- coerce: (_a = params === null || params === undefined ? undefined : params.coerce) !== null && _a !== undefined ? _a : false,
2029
+ coerce: params?.coerce ?? false,
2004
2030
  ...processCreateParams(params)
2005
2031
  });
2006
2032
  };
@@ -2025,7 +2051,7 @@ var init_lib = __esm(() => {
2025
2051
  ZodBoolean.create = (params) => {
2026
2052
  return new ZodBoolean({
2027
2053
  typeName: ZodFirstPartyTypeKind.ZodBoolean,
2028
- coerce: (params === null || params === undefined ? undefined : params.coerce) || false,
2054
+ coerce: params?.coerce || false,
2029
2055
  ...processCreateParams(params)
2030
2056
  });
2031
2057
  };
@@ -2044,7 +2070,7 @@ var init_lib = __esm(() => {
2044
2070
  });
2045
2071
  return INVALID;
2046
2072
  }
2047
- if (isNaN(input.data.getTime())) {
2073
+ if (Number.isNaN(input.data.getTime())) {
2048
2074
  const ctx2 = this._getOrReturnCtx(input);
2049
2075
  addIssueToContext(ctx2, {
2050
2076
  code: ZodIssueCode.invalid_date
@@ -2133,7 +2159,7 @@ var init_lib = __esm(() => {
2133
2159
  ZodDate.create = (params) => {
2134
2160
  return new ZodDate({
2135
2161
  checks: [],
2136
- coerce: (params === null || params === undefined ? undefined : params.coerce) || false,
2162
+ coerce: params?.coerce || false,
2137
2163
  typeName: ZodFirstPartyTypeKind.ZodDate,
2138
2164
  ...processCreateParams(params)
2139
2165
  });
@@ -2382,7 +2408,8 @@ var init_lib = __esm(() => {
2382
2408
  return this._cached;
2383
2409
  const shape = this._def.shape();
2384
2410
  const keys = util.objectKeys(shape);
2385
- return this._cached = { shape, keys };
2411
+ this._cached = { shape, keys };
2412
+ return this._cached;
2386
2413
  }
2387
2414
  _parse(input) {
2388
2415
  const parsedType = this._getType(input);
@@ -2432,9 +2459,8 @@ var init_lib = __esm(() => {
2432
2459
  });
2433
2460
  status.dirty();
2434
2461
  }
2435
- } else if (unknownKeys === "strip")
2436
- ;
2437
- else {
2462
+ } else if (unknownKeys === "strip") {
2463
+ } else {
2438
2464
  throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
2439
2465
  }
2440
2466
  } else {
@@ -2478,11 +2504,10 @@ var init_lib = __esm(() => {
2478
2504
  unknownKeys: "strict",
2479
2505
  ...message !== undefined ? {
2480
2506
  errorMap: (issue, ctx) => {
2481
- var _a, _b, _c, _d;
2482
- const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === undefined ? undefined : _b.call(_a, issue, ctx).message) !== null && _c !== undefined ? _c : ctx.defaultError;
2507
+ const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
2483
2508
  if (issue.code === "unrecognized_keys")
2484
2509
  return {
2485
- message: (_d = errorUtil.errToObj(message).message) !== null && _d !== undefined ? _d : defaultError
2510
+ message: errorUtil.errToObj(message).message ?? defaultError
2486
2511
  };
2487
2512
  return {
2488
2513
  message: defaultError
@@ -2535,11 +2560,11 @@ var init_lib = __esm(() => {
2535
2560
  }
2536
2561
  pick(mask) {
2537
2562
  const shape = {};
2538
- util.objectKeys(mask).forEach((key) => {
2563
+ for (const key of util.objectKeys(mask)) {
2539
2564
  if (mask[key] && this.shape[key]) {
2540
2565
  shape[key] = this.shape[key];
2541
2566
  }
2542
- });
2567
+ }
2543
2568
  return new ZodObject({
2544
2569
  ...this._def,
2545
2570
  shape: () => shape
@@ -2547,11 +2572,11 @@ var init_lib = __esm(() => {
2547
2572
  }
2548
2573
  omit(mask) {
2549
2574
  const shape = {};
2550
- util.objectKeys(this.shape).forEach((key) => {
2575
+ for (const key of util.objectKeys(this.shape)) {
2551
2576
  if (!mask[key]) {
2552
2577
  shape[key] = this.shape[key];
2553
2578
  }
2554
- });
2579
+ }
2555
2580
  return new ZodObject({
2556
2581
  ...this._def,
2557
2582
  shape: () => shape
@@ -2562,14 +2587,14 @@ var init_lib = __esm(() => {
2562
2587
  }
2563
2588
  partial(mask) {
2564
2589
  const newShape = {};
2565
- util.objectKeys(this.shape).forEach((key) => {
2590
+ for (const key of util.objectKeys(this.shape)) {
2566
2591
  const fieldSchema = this.shape[key];
2567
2592
  if (mask && !mask[key]) {
2568
2593
  newShape[key] = fieldSchema;
2569
2594
  } else {
2570
2595
  newShape[key] = fieldSchema.optional();
2571
2596
  }
2572
- });
2597
+ }
2573
2598
  return new ZodObject({
2574
2599
  ...this._def,
2575
2600
  shape: () => newShape
@@ -2577,7 +2602,7 @@ var init_lib = __esm(() => {
2577
2602
  }
2578
2603
  required(mask) {
2579
2604
  const newShape = {};
2580
- util.objectKeys(this.shape).forEach((key) => {
2605
+ for (const key of util.objectKeys(this.shape)) {
2581
2606
  if (mask && !mask[key]) {
2582
2607
  newShape[key] = this.shape[key];
2583
2608
  } else {
@@ -2588,7 +2613,7 @@ var init_lib = __esm(() => {
2588
2613
  }
2589
2614
  newShape[key] = newField;
2590
2615
  }
2591
- });
2616
+ }
2592
2617
  return new ZodObject({
2593
2618
  ...this._def,
2594
2619
  shape: () => newShape
@@ -3127,12 +3152,7 @@ var init_lib = __esm(() => {
3127
3152
  return makeIssue({
3128
3153
  data: args,
3129
3154
  path: ctx.path,
3130
- errorMaps: [
3131
- ctx.common.contextualErrorMap,
3132
- ctx.schemaErrorMap,
3133
- getErrorMap(),
3134
- errorMap
3135
- ].filter((x2) => !!x2),
3155
+ errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x2) => !!x2),
3136
3156
  issueData: {
3137
3157
  code: ZodIssueCode.invalid_arguments,
3138
3158
  argumentsError: error
@@ -3143,12 +3163,7 @@ var init_lib = __esm(() => {
3143
3163
  return makeIssue({
3144
3164
  data: returns,
3145
3165
  path: ctx.path,
3146
- errorMaps: [
3147
- ctx.common.contextualErrorMap,
3148
- ctx.schemaErrorMap,
3149
- getErrorMap(),
3150
- errorMap
3151
- ].filter((x2) => !!x2),
3166
+ errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x2) => !!x2),
3152
3167
  issueData: {
3153
3168
  code: ZodIssueCode.invalid_return_type,
3154
3169
  returnTypeError: error
@@ -3265,10 +3280,6 @@ var init_lib = __esm(() => {
3265
3280
  });
3266
3281
  };
3267
3282
  ZodEnum = class ZodEnum extends ZodType {
3268
- constructor() {
3269
- super(...arguments);
3270
- _ZodEnum_cache.set(this, undefined);
3271
- }
3272
3283
  _parse(input) {
3273
3284
  if (typeof input.data !== "string") {
3274
3285
  const ctx = this._getOrReturnCtx(input);
@@ -3280,10 +3291,10 @@ var init_lib = __esm(() => {
3280
3291
  });
3281
3292
  return INVALID;
3282
3293
  }
3283
- if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
3284
- __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
3294
+ if (!this._cache) {
3295
+ this._cache = new Set(this._def.values);
3285
3296
  }
3286
- if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
3297
+ if (!this._cache.has(input.data)) {
3287
3298
  const ctx = this._getOrReturnCtx(input);
3288
3299
  const expectedValues = this._def.values;
3289
3300
  addIssueToContext(ctx, {
@@ -3332,13 +3343,8 @@ var init_lib = __esm(() => {
3332
3343
  });
3333
3344
  }
3334
3345
  };
3335
- _ZodEnum_cache = new WeakMap;
3336
3346
  ZodEnum.create = createZodEnum;
3337
3347
  ZodNativeEnum = class ZodNativeEnum extends ZodType {
3338
- constructor() {
3339
- super(...arguments);
3340
- _ZodNativeEnum_cache.set(this, undefined);
3341
- }
3342
3348
  _parse(input) {
3343
3349
  const nativeEnumValues = util.getValidEnumValues(this._def.values);
3344
3350
  const ctx = this._getOrReturnCtx(input);
@@ -3351,10 +3357,10 @@ var init_lib = __esm(() => {
3351
3357
  });
3352
3358
  return INVALID;
3353
3359
  }
3354
- if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
3355
- __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
3360
+ if (!this._cache) {
3361
+ this._cache = new Set(util.getValidEnumValues(this._def.values));
3356
3362
  }
3357
- if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
3363
+ if (!this._cache.has(input.data)) {
3358
3364
  const expectedValues = util.objectValues(nativeEnumValues);
3359
3365
  addIssueToContext(ctx, {
3360
3366
  received: ctx.data,
@@ -3369,7 +3375,6 @@ var init_lib = __esm(() => {
3369
3375
  return this._def.values;
3370
3376
  }
3371
3377
  };
3372
- _ZodNativeEnum_cache = new WeakMap;
3373
3378
  ZodNativeEnum.create = (values, params) => {
3374
3379
  return new ZodNativeEnum({
3375
3380
  values,
@@ -3510,7 +3515,7 @@ var init_lib = __esm(() => {
3510
3515
  parent: ctx
3511
3516
  });
3512
3517
  if (!isValid(base))
3513
- return base;
3518
+ return INVALID;
3514
3519
  const result = effect.transform(base.value, checkCtx);
3515
3520
  if (result instanceof Promise) {
3516
3521
  throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
@@ -3519,8 +3524,11 @@ var init_lib = __esm(() => {
3519
3524
  } else {
3520
3525
  return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
3521
3526
  if (!isValid(base))
3522
- return base;
3523
- return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));
3527
+ return INVALID;
3528
+ return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
3529
+ status: status.value,
3530
+ value: result
3531
+ }));
3524
3532
  });
3525
3533
  }
3526
3534
  }
@@ -3858,122 +3866,137 @@ var init_lib = __esm(() => {
3858
3866
  date: (arg) => ZodDate.create({ ...arg, coerce: true })
3859
3867
  };
3860
3868
  NEVER = INVALID;
3861
- z2 = /* @__PURE__ */ Object.freeze({
3862
- __proto__: null,
3863
- defaultErrorMap: errorMap,
3864
- setErrorMap,
3865
- getErrorMap,
3866
- makeIssue,
3867
- EMPTY_PATH,
3868
- addIssueToContext,
3869
- ParseStatus,
3870
- INVALID,
3871
- DIRTY,
3872
- OK,
3873
- isAborted,
3874
- isDirty,
3875
- isValid,
3876
- isAsync,
3877
- get util() {
3878
- return util;
3879
- },
3880
- get objectUtil() {
3881
- return objectUtil;
3882
- },
3883
- ZodParsedType,
3884
- getParsedType,
3885
- ZodType,
3886
- datetimeRegex,
3887
- ZodString,
3888
- ZodNumber,
3889
- ZodBigInt,
3890
- ZodBoolean,
3891
- ZodDate,
3892
- ZodSymbol,
3893
- ZodUndefined,
3894
- ZodNull,
3895
- ZodAny,
3896
- ZodUnknown,
3897
- ZodNever,
3898
- ZodVoid,
3899
- ZodArray,
3900
- ZodObject,
3901
- ZodUnion,
3902
- ZodDiscriminatedUnion,
3903
- ZodIntersection,
3904
- ZodTuple,
3905
- ZodRecord,
3906
- ZodMap,
3907
- ZodSet,
3908
- ZodFunction,
3909
- ZodLazy,
3910
- ZodLiteral,
3911
- ZodEnum,
3912
- ZodNativeEnum,
3913
- ZodPromise,
3914
- ZodEffects,
3915
- ZodTransformer: ZodEffects,
3916
- ZodOptional,
3917
- ZodNullable,
3918
- ZodDefault,
3919
- ZodCatch,
3920
- ZodNaN,
3921
- BRAND,
3922
- ZodBranded,
3923
- ZodPipeline,
3924
- ZodReadonly,
3925
- custom,
3926
- Schema: ZodType,
3927
- ZodSchema: ZodType,
3928
- late,
3929
- get ZodFirstPartyTypeKind() {
3930
- return ZodFirstPartyTypeKind;
3931
- },
3932
- coerce,
3933
- any: anyType,
3934
- array: arrayType,
3935
- bigint: bigIntType,
3936
- boolean: booleanType,
3937
- date: dateType,
3938
- discriminatedUnion: discriminatedUnionType,
3939
- effect: effectsType,
3940
- enum: enumType,
3941
- function: functionType,
3942
- instanceof: instanceOfType,
3943
- intersection: intersectionType,
3944
- lazy: lazyType,
3945
- literal: literalType,
3946
- map: mapType,
3947
- nan: nanType,
3948
- nativeEnum: nativeEnumType,
3949
- never: neverType,
3950
- null: nullType,
3951
- nullable: nullableType,
3952
- number: numberType,
3953
- object: objectType,
3954
- oboolean,
3955
- onumber,
3956
- optional: optionalType,
3957
- ostring,
3958
- pipeline: pipelineType,
3959
- preprocess: preprocessType,
3960
- promise: promiseType,
3961
- record: recordType,
3962
- set: setType,
3963
- strictObject: strictObjectType,
3964
- string: stringType,
3965
- symbol: symbolType,
3966
- transformer: effectsType,
3967
- tuple: tupleType,
3968
- undefined: undefinedType,
3969
- union: unionType,
3970
- unknown: unknownType,
3971
- void: voidType,
3972
- NEVER,
3973
- ZodIssueCode,
3974
- quotelessJson,
3975
- ZodError
3976
- });
3869
+ });
3870
+
3871
+ // node_modules/zod/dist/esm/v3/external.js
3872
+ var exports_external = {};
3873
+ __export(exports_external, {
3874
+ void: () => voidType,
3875
+ util: () => util,
3876
+ unknown: () => unknownType,
3877
+ union: () => unionType,
3878
+ undefined: () => undefinedType,
3879
+ tuple: () => tupleType,
3880
+ transformer: () => effectsType,
3881
+ symbol: () => symbolType,
3882
+ string: () => stringType,
3883
+ strictObject: () => strictObjectType,
3884
+ setErrorMap: () => setErrorMap,
3885
+ set: () => setType,
3886
+ record: () => recordType,
3887
+ quotelessJson: () => quotelessJson,
3888
+ promise: () => promiseType,
3889
+ preprocess: () => preprocessType,
3890
+ pipeline: () => pipelineType,
3891
+ ostring: () => ostring,
3892
+ optional: () => optionalType,
3893
+ onumber: () => onumber,
3894
+ oboolean: () => oboolean,
3895
+ objectUtil: () => objectUtil,
3896
+ object: () => objectType,
3897
+ number: () => numberType,
3898
+ nullable: () => nullableType,
3899
+ null: () => nullType,
3900
+ never: () => neverType,
3901
+ nativeEnum: () => nativeEnumType,
3902
+ nan: () => nanType,
3903
+ map: () => mapType,
3904
+ makeIssue: () => makeIssue,
3905
+ literal: () => literalType,
3906
+ lazy: () => lazyType,
3907
+ late: () => late,
3908
+ isValid: () => isValid,
3909
+ isDirty: () => isDirty,
3910
+ isAsync: () => isAsync,
3911
+ isAborted: () => isAborted,
3912
+ intersection: () => intersectionType,
3913
+ instanceof: () => instanceOfType,
3914
+ getParsedType: () => getParsedType,
3915
+ getErrorMap: () => getErrorMap,
3916
+ function: () => functionType,
3917
+ enum: () => enumType,
3918
+ effect: () => effectsType,
3919
+ discriminatedUnion: () => discriminatedUnionType,
3920
+ defaultErrorMap: () => en_default,
3921
+ datetimeRegex: () => datetimeRegex,
3922
+ date: () => dateType,
3923
+ custom: () => custom,
3924
+ coerce: () => coerce,
3925
+ boolean: () => booleanType,
3926
+ bigint: () => bigIntType,
3927
+ array: () => arrayType,
3928
+ any: () => anyType,
3929
+ addIssueToContext: () => addIssueToContext,
3930
+ ZodVoid: () => ZodVoid,
3931
+ ZodUnknown: () => ZodUnknown,
3932
+ ZodUnion: () => ZodUnion,
3933
+ ZodUndefined: () => ZodUndefined,
3934
+ ZodType: () => ZodType,
3935
+ ZodTuple: () => ZodTuple,
3936
+ ZodTransformer: () => ZodEffects,
3937
+ ZodSymbol: () => ZodSymbol,
3938
+ ZodString: () => ZodString,
3939
+ ZodSet: () => ZodSet,
3940
+ ZodSchema: () => ZodType,
3941
+ ZodRecord: () => ZodRecord,
3942
+ ZodReadonly: () => ZodReadonly,
3943
+ ZodPromise: () => ZodPromise,
3944
+ ZodPipeline: () => ZodPipeline,
3945
+ ZodParsedType: () => ZodParsedType,
3946
+ ZodOptional: () => ZodOptional,
3947
+ ZodObject: () => ZodObject,
3948
+ ZodNumber: () => ZodNumber,
3949
+ ZodNullable: () => ZodNullable,
3950
+ ZodNull: () => ZodNull,
3951
+ ZodNever: () => ZodNever,
3952
+ ZodNativeEnum: () => ZodNativeEnum,
3953
+ ZodNaN: () => ZodNaN,
3954
+ ZodMap: () => ZodMap,
3955
+ ZodLiteral: () => ZodLiteral,
3956
+ ZodLazy: () => ZodLazy,
3957
+ ZodIssueCode: () => ZodIssueCode,
3958
+ ZodIntersection: () => ZodIntersection,
3959
+ ZodFunction: () => ZodFunction,
3960
+ ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
3961
+ ZodError: () => ZodError,
3962
+ ZodEnum: () => ZodEnum,
3963
+ ZodEffects: () => ZodEffects,
3964
+ ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
3965
+ ZodDefault: () => ZodDefault,
3966
+ ZodDate: () => ZodDate,
3967
+ ZodCatch: () => ZodCatch,
3968
+ ZodBranded: () => ZodBranded,
3969
+ ZodBoolean: () => ZodBoolean,
3970
+ ZodBigInt: () => ZodBigInt,
3971
+ ZodArray: () => ZodArray,
3972
+ ZodAny: () => ZodAny,
3973
+ Schema: () => ZodType,
3974
+ ParseStatus: () => ParseStatus,
3975
+ OK: () => OK,
3976
+ NEVER: () => NEVER,
3977
+ INVALID: () => INVALID,
3978
+ EMPTY_PATH: () => EMPTY_PATH,
3979
+ DIRTY: () => DIRTY,
3980
+ BRAND: () => BRAND
3981
+ });
3982
+ var init_external = __esm(() => {
3983
+ init_errors();
3984
+ init_parseUtil();
3985
+ init_typeAliases();
3986
+ init_util();
3987
+ init_types();
3988
+ init_ZodError();
3989
+ });
3990
+
3991
+ // node_modules/zod/dist/esm/v3/index.js
3992
+ var init_v3 = __esm(() => {
3993
+ init_external();
3994
+ init_external();
3995
+ });
3996
+
3997
+ // node_modules/zod/dist/esm/index.js
3998
+ var init_esm = __esm(() => {
3999
+ init_v3();
3977
4000
  });
3978
4001
 
3979
4002
  // src/mcp-server/console-logger.ts
@@ -4030,43 +4053,43 @@ var init_console_logger = __esm(() => {
4030
4053
 
4031
4054
  // node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
4032
4055
  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, 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;
4033
- var init_types = __esm(() => {
4034
- init_lib();
4056
+ var init_types2 = __esm(() => {
4057
+ init_esm();
4035
4058
  SUPPORTED_PROTOCOL_VERSIONS = [
4036
4059
  LATEST_PROTOCOL_VERSION,
4037
4060
  "2024-10-07"
4038
4061
  ];
4039
- ProgressTokenSchema = z2.union([z2.string(), z2.number().int()]);
4040
- CursorSchema = z2.string();
4041
- BaseRequestParamsSchema = z2.object({
4042
- _meta: z2.optional(z2.object({
4043
- progressToken: z2.optional(ProgressTokenSchema)
4062
+ ProgressTokenSchema = exports_external.union([exports_external.string(), exports_external.number().int()]);
4063
+ CursorSchema = exports_external.string();
4064
+ BaseRequestParamsSchema = exports_external.object({
4065
+ _meta: exports_external.optional(exports_external.object({
4066
+ progressToken: exports_external.optional(ProgressTokenSchema)
4044
4067
  }).passthrough())
4045
4068
  }).passthrough();
4046
- RequestSchema = z2.object({
4047
- method: z2.string(),
4048
- params: z2.optional(BaseRequestParamsSchema)
4069
+ RequestSchema = exports_external.object({
4070
+ method: exports_external.string(),
4071
+ params: exports_external.optional(BaseRequestParamsSchema)
4049
4072
  });
4050
- BaseNotificationParamsSchema = z2.object({
4051
- _meta: z2.optional(z2.object({}).passthrough())
4073
+ BaseNotificationParamsSchema = exports_external.object({
4074
+ _meta: exports_external.optional(exports_external.object({}).passthrough())
4052
4075
  }).passthrough();
4053
- NotificationSchema = z2.object({
4054
- method: z2.string(),
4055
- params: z2.optional(BaseNotificationParamsSchema)
4076
+ NotificationSchema = exports_external.object({
4077
+ method: exports_external.string(),
4078
+ params: exports_external.optional(BaseNotificationParamsSchema)
4056
4079
  });
4057
- ResultSchema = z2.object({
4058
- _meta: z2.optional(z2.object({}).passthrough())
4080
+ ResultSchema = exports_external.object({
4081
+ _meta: exports_external.optional(exports_external.object({}).passthrough())
4059
4082
  }).passthrough();
4060
- RequestIdSchema = z2.union([z2.string(), z2.number().int()]);
4061
- JSONRPCRequestSchema = z2.object({
4062
- jsonrpc: z2.literal(JSONRPC_VERSION),
4083
+ RequestIdSchema = exports_external.union([exports_external.string(), exports_external.number().int()]);
4084
+ JSONRPCRequestSchema = exports_external.object({
4085
+ jsonrpc: exports_external.literal(JSONRPC_VERSION),
4063
4086
  id: RequestIdSchema
4064
4087
  }).merge(RequestSchema).strict();
4065
- JSONRPCNotificationSchema = z2.object({
4066
- jsonrpc: z2.literal(JSONRPC_VERSION)
4088
+ JSONRPCNotificationSchema = exports_external.object({
4089
+ jsonrpc: exports_external.literal(JSONRPC_VERSION)
4067
4090
  }).merge(NotificationSchema).strict();
4068
- JSONRPCResponseSchema = z2.object({
4069
- jsonrpc: z2.literal(JSONRPC_VERSION),
4091
+ JSONRPCResponseSchema = exports_external.object({
4092
+ jsonrpc: exports_external.literal(JSONRPC_VERSION),
4070
4093
  id: RequestIdSchema,
4071
4094
  result: ResultSchema
4072
4095
  }).strict();
@@ -4079,16 +4102,16 @@ var init_types = __esm(() => {
4079
4102
  ErrorCode2[ErrorCode2["InvalidParams"] = -32602] = "InvalidParams";
4080
4103
  ErrorCode2[ErrorCode2["InternalError"] = -32603] = "InternalError";
4081
4104
  })(ErrorCode || (ErrorCode = {}));
4082
- JSONRPCErrorSchema = z2.object({
4083
- jsonrpc: z2.literal(JSONRPC_VERSION),
4105
+ JSONRPCErrorSchema = exports_external.object({
4106
+ jsonrpc: exports_external.literal(JSONRPC_VERSION),
4084
4107
  id: RequestIdSchema,
4085
- error: z2.object({
4086
- code: z2.number().int(),
4087
- message: z2.string(),
4088
- data: z2.optional(z2.unknown())
4108
+ error: exports_external.object({
4109
+ code: exports_external.number().int(),
4110
+ message: exports_external.string(),
4111
+ data: exports_external.optional(exports_external.unknown())
4089
4112
  })
4090
4113
  }).strict();
4091
- JSONRPCMessageSchema = z2.union([
4114
+ JSONRPCMessageSchema = exports_external.union([
4092
4115
  JSONRPCRequestSchema,
4093
4116
  JSONRPCNotificationSchema,
4094
4117
  JSONRPCResponseSchema,
@@ -4096,222 +4119,222 @@ var init_types = __esm(() => {
4096
4119
  ]);
4097
4120
  EmptyResultSchema = ResultSchema.strict();
4098
4121
  CancelledNotificationSchema = NotificationSchema.extend({
4099
- method: z2.literal("notifications/cancelled"),
4122
+ method: exports_external.literal("notifications/cancelled"),
4100
4123
  params: BaseNotificationParamsSchema.extend({
4101
4124
  requestId: RequestIdSchema,
4102
- reason: z2.string().optional()
4125
+ reason: exports_external.string().optional()
4103
4126
  })
4104
4127
  });
4105
- ImplementationSchema = z2.object({
4106
- name: z2.string(),
4107
- version: z2.string()
4128
+ ImplementationSchema = exports_external.object({
4129
+ name: exports_external.string(),
4130
+ version: exports_external.string()
4108
4131
  }).passthrough();
4109
- ClientCapabilitiesSchema = z2.object({
4110
- experimental: z2.optional(z2.object({}).passthrough()),
4111
- sampling: z2.optional(z2.object({}).passthrough()),
4112
- roots: z2.optional(z2.object({
4113
- listChanged: z2.optional(z2.boolean())
4132
+ ClientCapabilitiesSchema = exports_external.object({
4133
+ experimental: exports_external.optional(exports_external.object({}).passthrough()),
4134
+ sampling: exports_external.optional(exports_external.object({}).passthrough()),
4135
+ roots: exports_external.optional(exports_external.object({
4136
+ listChanged: exports_external.optional(exports_external.boolean())
4114
4137
  }).passthrough())
4115
4138
  }).passthrough();
4116
4139
  InitializeRequestSchema = RequestSchema.extend({
4117
- method: z2.literal("initialize"),
4140
+ method: exports_external.literal("initialize"),
4118
4141
  params: BaseRequestParamsSchema.extend({
4119
- protocolVersion: z2.string(),
4142
+ protocolVersion: exports_external.string(),
4120
4143
  capabilities: ClientCapabilitiesSchema,
4121
4144
  clientInfo: ImplementationSchema
4122
4145
  })
4123
4146
  });
4124
- ServerCapabilitiesSchema = z2.object({
4125
- experimental: z2.optional(z2.object({}).passthrough()),
4126
- logging: z2.optional(z2.object({}).passthrough()),
4127
- prompts: z2.optional(z2.object({
4128
- listChanged: z2.optional(z2.boolean())
4147
+ ServerCapabilitiesSchema = exports_external.object({
4148
+ experimental: exports_external.optional(exports_external.object({}).passthrough()),
4149
+ logging: exports_external.optional(exports_external.object({}).passthrough()),
4150
+ prompts: exports_external.optional(exports_external.object({
4151
+ listChanged: exports_external.optional(exports_external.boolean())
4129
4152
  }).passthrough()),
4130
- resources: z2.optional(z2.object({
4131
- subscribe: z2.optional(z2.boolean()),
4132
- listChanged: z2.optional(z2.boolean())
4153
+ resources: exports_external.optional(exports_external.object({
4154
+ subscribe: exports_external.optional(exports_external.boolean()),
4155
+ listChanged: exports_external.optional(exports_external.boolean())
4133
4156
  }).passthrough()),
4134
- tools: z2.optional(z2.object({
4135
- listChanged: z2.optional(z2.boolean())
4157
+ tools: exports_external.optional(exports_external.object({
4158
+ listChanged: exports_external.optional(exports_external.boolean())
4136
4159
  }).passthrough())
4137
4160
  }).passthrough();
4138
4161
  InitializeResultSchema = ResultSchema.extend({
4139
- protocolVersion: z2.string(),
4162
+ protocolVersion: exports_external.string(),
4140
4163
  capabilities: ServerCapabilitiesSchema,
4141
4164
  serverInfo: ImplementationSchema,
4142
- instructions: z2.optional(z2.string())
4165
+ instructions: exports_external.optional(exports_external.string())
4143
4166
  });
4144
4167
  InitializedNotificationSchema = NotificationSchema.extend({
4145
- method: z2.literal("notifications/initialized")
4168
+ method: exports_external.literal("notifications/initialized")
4146
4169
  });
4147
4170
  PingRequestSchema = RequestSchema.extend({
4148
- method: z2.literal("ping")
4171
+ method: exports_external.literal("ping")
4149
4172
  });
4150
- ProgressSchema = z2.object({
4151
- progress: z2.number(),
4152
- total: z2.optional(z2.number())
4173
+ ProgressSchema = exports_external.object({
4174
+ progress: exports_external.number(),
4175
+ total: exports_external.optional(exports_external.number())
4153
4176
  }).passthrough();
4154
4177
  ProgressNotificationSchema = NotificationSchema.extend({
4155
- method: z2.literal("notifications/progress"),
4178
+ method: exports_external.literal("notifications/progress"),
4156
4179
  params: BaseNotificationParamsSchema.merge(ProgressSchema).extend({
4157
4180
  progressToken: ProgressTokenSchema
4158
4181
  })
4159
4182
  });
4160
4183
  PaginatedRequestSchema = RequestSchema.extend({
4161
4184
  params: BaseRequestParamsSchema.extend({
4162
- cursor: z2.optional(CursorSchema)
4185
+ cursor: exports_external.optional(CursorSchema)
4163
4186
  }).optional()
4164
4187
  });
4165
4188
  PaginatedResultSchema = ResultSchema.extend({
4166
- nextCursor: z2.optional(CursorSchema)
4189
+ nextCursor: exports_external.optional(CursorSchema)
4167
4190
  });
4168
- ResourceContentsSchema = z2.object({
4169
- uri: z2.string(),
4170
- mimeType: z2.optional(z2.string())
4191
+ ResourceContentsSchema = exports_external.object({
4192
+ uri: exports_external.string(),
4193
+ mimeType: exports_external.optional(exports_external.string())
4171
4194
  }).passthrough();
4172
4195
  TextResourceContentsSchema = ResourceContentsSchema.extend({
4173
- text: z2.string()
4196
+ text: exports_external.string()
4174
4197
  });
4175
4198
  BlobResourceContentsSchema = ResourceContentsSchema.extend({
4176
- blob: z2.string().base64()
4199
+ blob: exports_external.string().base64()
4177
4200
  });
4178
- ResourceSchema = z2.object({
4179
- uri: z2.string(),
4180
- name: z2.string(),
4181
- description: z2.optional(z2.string()),
4182
- mimeType: z2.optional(z2.string())
4201
+ ResourceSchema = exports_external.object({
4202
+ uri: exports_external.string(),
4203
+ name: exports_external.string(),
4204
+ description: exports_external.optional(exports_external.string()),
4205
+ mimeType: exports_external.optional(exports_external.string())
4183
4206
  }).passthrough();
4184
- ResourceTemplateSchema = z2.object({
4185
- uriTemplate: z2.string(),
4186
- name: z2.string(),
4187
- description: z2.optional(z2.string()),
4188
- mimeType: z2.optional(z2.string())
4207
+ ResourceTemplateSchema = exports_external.object({
4208
+ uriTemplate: exports_external.string(),
4209
+ name: exports_external.string(),
4210
+ description: exports_external.optional(exports_external.string()),
4211
+ mimeType: exports_external.optional(exports_external.string())
4189
4212
  }).passthrough();
4190
4213
  ListResourcesRequestSchema = PaginatedRequestSchema.extend({
4191
- method: z2.literal("resources/list")
4214
+ method: exports_external.literal("resources/list")
4192
4215
  });
4193
4216
  ListResourcesResultSchema = PaginatedResultSchema.extend({
4194
- resources: z2.array(ResourceSchema)
4217
+ resources: exports_external.array(ResourceSchema)
4195
4218
  });
4196
4219
  ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
4197
- method: z2.literal("resources/templates/list")
4220
+ method: exports_external.literal("resources/templates/list")
4198
4221
  });
4199
4222
  ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
4200
- resourceTemplates: z2.array(ResourceTemplateSchema)
4223
+ resourceTemplates: exports_external.array(ResourceTemplateSchema)
4201
4224
  });
4202
4225
  ReadResourceRequestSchema = RequestSchema.extend({
4203
- method: z2.literal("resources/read"),
4226
+ method: exports_external.literal("resources/read"),
4204
4227
  params: BaseRequestParamsSchema.extend({
4205
- uri: z2.string()
4228
+ uri: exports_external.string()
4206
4229
  })
4207
4230
  });
4208
4231
  ReadResourceResultSchema = ResultSchema.extend({
4209
- contents: z2.array(z2.union([TextResourceContentsSchema, BlobResourceContentsSchema]))
4232
+ contents: exports_external.array(exports_external.union([TextResourceContentsSchema, BlobResourceContentsSchema]))
4210
4233
  });
4211
4234
  ResourceListChangedNotificationSchema = NotificationSchema.extend({
4212
- method: z2.literal("notifications/resources/list_changed")
4235
+ method: exports_external.literal("notifications/resources/list_changed")
4213
4236
  });
4214
4237
  SubscribeRequestSchema = RequestSchema.extend({
4215
- method: z2.literal("resources/subscribe"),
4238
+ method: exports_external.literal("resources/subscribe"),
4216
4239
  params: BaseRequestParamsSchema.extend({
4217
- uri: z2.string()
4240
+ uri: exports_external.string()
4218
4241
  })
4219
4242
  });
4220
4243
  UnsubscribeRequestSchema = RequestSchema.extend({
4221
- method: z2.literal("resources/unsubscribe"),
4244
+ method: exports_external.literal("resources/unsubscribe"),
4222
4245
  params: BaseRequestParamsSchema.extend({
4223
- uri: z2.string()
4246
+ uri: exports_external.string()
4224
4247
  })
4225
4248
  });
4226
4249
  ResourceUpdatedNotificationSchema = NotificationSchema.extend({
4227
- method: z2.literal("notifications/resources/updated"),
4250
+ method: exports_external.literal("notifications/resources/updated"),
4228
4251
  params: BaseNotificationParamsSchema.extend({
4229
- uri: z2.string()
4252
+ uri: exports_external.string()
4230
4253
  })
4231
4254
  });
4232
- PromptArgumentSchema = z2.object({
4233
- name: z2.string(),
4234
- description: z2.optional(z2.string()),
4235
- required: z2.optional(z2.boolean())
4255
+ PromptArgumentSchema = exports_external.object({
4256
+ name: exports_external.string(),
4257
+ description: exports_external.optional(exports_external.string()),
4258
+ required: exports_external.optional(exports_external.boolean())
4236
4259
  }).passthrough();
4237
- PromptSchema = z2.object({
4238
- name: z2.string(),
4239
- description: z2.optional(z2.string()),
4240
- arguments: z2.optional(z2.array(PromptArgumentSchema))
4260
+ PromptSchema = exports_external.object({
4261
+ name: exports_external.string(),
4262
+ description: exports_external.optional(exports_external.string()),
4263
+ arguments: exports_external.optional(exports_external.array(PromptArgumentSchema))
4241
4264
  }).passthrough();
4242
4265
  ListPromptsRequestSchema = PaginatedRequestSchema.extend({
4243
- method: z2.literal("prompts/list")
4266
+ method: exports_external.literal("prompts/list")
4244
4267
  });
4245
4268
  ListPromptsResultSchema = PaginatedResultSchema.extend({
4246
- prompts: z2.array(PromptSchema)
4269
+ prompts: exports_external.array(PromptSchema)
4247
4270
  });
4248
4271
  GetPromptRequestSchema = RequestSchema.extend({
4249
- method: z2.literal("prompts/get"),
4272
+ method: exports_external.literal("prompts/get"),
4250
4273
  params: BaseRequestParamsSchema.extend({
4251
- name: z2.string(),
4252
- arguments: z2.optional(z2.record(z2.string()))
4274
+ name: exports_external.string(),
4275
+ arguments: exports_external.optional(exports_external.record(exports_external.string()))
4253
4276
  })
4254
4277
  });
4255
- TextContentSchema = z2.object({
4256
- type: z2.literal("text"),
4257
- text: z2.string()
4278
+ TextContentSchema = exports_external.object({
4279
+ type: exports_external.literal("text"),
4280
+ text: exports_external.string()
4258
4281
  }).passthrough();
4259
- ImageContentSchema = z2.object({
4260
- type: z2.literal("image"),
4261
- data: z2.string().base64(),
4262
- mimeType: z2.string()
4282
+ ImageContentSchema = exports_external.object({
4283
+ type: exports_external.literal("image"),
4284
+ data: exports_external.string().base64(),
4285
+ mimeType: exports_external.string()
4263
4286
  }).passthrough();
4264
- EmbeddedResourceSchema = z2.object({
4265
- type: z2.literal("resource"),
4266
- resource: z2.union([TextResourceContentsSchema, BlobResourceContentsSchema])
4287
+ EmbeddedResourceSchema = exports_external.object({
4288
+ type: exports_external.literal("resource"),
4289
+ resource: exports_external.union([TextResourceContentsSchema, BlobResourceContentsSchema])
4267
4290
  }).passthrough();
4268
- PromptMessageSchema = z2.object({
4269
- role: z2.enum(["user", "assistant"]),
4270
- content: z2.union([
4291
+ PromptMessageSchema = exports_external.object({
4292
+ role: exports_external.enum(["user", "assistant"]),
4293
+ content: exports_external.union([
4271
4294
  TextContentSchema,
4272
4295
  ImageContentSchema,
4273
4296
  EmbeddedResourceSchema
4274
4297
  ])
4275
4298
  }).passthrough();
4276
4299
  GetPromptResultSchema = ResultSchema.extend({
4277
- description: z2.optional(z2.string()),
4278
- messages: z2.array(PromptMessageSchema)
4300
+ description: exports_external.optional(exports_external.string()),
4301
+ messages: exports_external.array(PromptMessageSchema)
4279
4302
  });
4280
4303
  PromptListChangedNotificationSchema = NotificationSchema.extend({
4281
- method: z2.literal("notifications/prompts/list_changed")
4304
+ method: exports_external.literal("notifications/prompts/list_changed")
4282
4305
  });
4283
- ToolSchema = z2.object({
4284
- name: z2.string(),
4285
- description: z2.optional(z2.string()),
4286
- inputSchema: z2.object({
4287
- type: z2.literal("object"),
4288
- properties: z2.optional(z2.object({}).passthrough())
4306
+ ToolSchema = exports_external.object({
4307
+ name: exports_external.string(),
4308
+ description: exports_external.optional(exports_external.string()),
4309
+ inputSchema: exports_external.object({
4310
+ type: exports_external.literal("object"),
4311
+ properties: exports_external.optional(exports_external.object({}).passthrough())
4289
4312
  }).passthrough()
4290
4313
  }).passthrough();
4291
4314
  ListToolsRequestSchema = PaginatedRequestSchema.extend({
4292
- method: z2.literal("tools/list")
4315
+ method: exports_external.literal("tools/list")
4293
4316
  });
4294
4317
  ListToolsResultSchema = PaginatedResultSchema.extend({
4295
- tools: z2.array(ToolSchema)
4318
+ tools: exports_external.array(ToolSchema)
4296
4319
  });
4297
4320
  CallToolResultSchema = ResultSchema.extend({
4298
- content: z2.array(z2.union([TextContentSchema, ImageContentSchema, EmbeddedResourceSchema])),
4299
- isError: z2.boolean().default(false).optional()
4321
+ content: exports_external.array(exports_external.union([TextContentSchema, ImageContentSchema, EmbeddedResourceSchema])),
4322
+ isError: exports_external.boolean().default(false).optional()
4300
4323
  });
4301
4324
  CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
4302
- toolResult: z2.unknown()
4325
+ toolResult: exports_external.unknown()
4303
4326
  }));
4304
4327
  CallToolRequestSchema = RequestSchema.extend({
4305
- method: z2.literal("tools/call"),
4328
+ method: exports_external.literal("tools/call"),
4306
4329
  params: BaseRequestParamsSchema.extend({
4307
- name: z2.string(),
4308
- arguments: z2.optional(z2.record(z2.unknown()))
4330
+ name: exports_external.string(),
4331
+ arguments: exports_external.optional(exports_external.record(exports_external.unknown()))
4309
4332
  })
4310
4333
  });
4311
4334
  ToolListChangedNotificationSchema = NotificationSchema.extend({
4312
- method: z2.literal("notifications/tools/list_changed")
4335
+ method: exports_external.literal("notifications/tools/list_changed")
4313
4336
  });
4314
- LoggingLevelSchema = z2.enum([
4337
+ LoggingLevelSchema = exports_external.enum([
4315
4338
  "debug",
4316
4339
  "info",
4317
4340
  "notice",
@@ -4322,93 +4345,93 @@ var init_types = __esm(() => {
4322
4345
  "emergency"
4323
4346
  ]);
4324
4347
  SetLevelRequestSchema = RequestSchema.extend({
4325
- method: z2.literal("logging/setLevel"),
4348
+ method: exports_external.literal("logging/setLevel"),
4326
4349
  params: BaseRequestParamsSchema.extend({
4327
4350
  level: LoggingLevelSchema
4328
4351
  })
4329
4352
  });
4330
4353
  LoggingMessageNotificationSchema = NotificationSchema.extend({
4331
- method: z2.literal("notifications/message"),
4354
+ method: exports_external.literal("notifications/message"),
4332
4355
  params: BaseNotificationParamsSchema.extend({
4333
4356
  level: LoggingLevelSchema,
4334
- logger: z2.optional(z2.string()),
4335
- data: z2.unknown()
4357
+ logger: exports_external.optional(exports_external.string()),
4358
+ data: exports_external.unknown()
4336
4359
  })
4337
4360
  });
4338
- ModelHintSchema = z2.object({
4339
- name: z2.string().optional()
4361
+ ModelHintSchema = exports_external.object({
4362
+ name: exports_external.string().optional()
4340
4363
  }).passthrough();
4341
- ModelPreferencesSchema = z2.object({
4342
- hints: z2.optional(z2.array(ModelHintSchema)),
4343
- costPriority: z2.optional(z2.number().min(0).max(1)),
4344
- speedPriority: z2.optional(z2.number().min(0).max(1)),
4345
- intelligencePriority: z2.optional(z2.number().min(0).max(1))
4364
+ ModelPreferencesSchema = exports_external.object({
4365
+ hints: exports_external.optional(exports_external.array(ModelHintSchema)),
4366
+ costPriority: exports_external.optional(exports_external.number().min(0).max(1)),
4367
+ speedPriority: exports_external.optional(exports_external.number().min(0).max(1)),
4368
+ intelligencePriority: exports_external.optional(exports_external.number().min(0).max(1))
4346
4369
  }).passthrough();
4347
- SamplingMessageSchema = z2.object({
4348
- role: z2.enum(["user", "assistant"]),
4349
- content: z2.union([TextContentSchema, ImageContentSchema])
4370
+ SamplingMessageSchema = exports_external.object({
4371
+ role: exports_external.enum(["user", "assistant"]),
4372
+ content: exports_external.union([TextContentSchema, ImageContentSchema])
4350
4373
  }).passthrough();
4351
4374
  CreateMessageRequestSchema = RequestSchema.extend({
4352
- method: z2.literal("sampling/createMessage"),
4375
+ method: exports_external.literal("sampling/createMessage"),
4353
4376
  params: BaseRequestParamsSchema.extend({
4354
- messages: z2.array(SamplingMessageSchema),
4355
- systemPrompt: z2.optional(z2.string()),
4356
- includeContext: z2.optional(z2.enum(["none", "thisServer", "allServers"])),
4357
- temperature: z2.optional(z2.number()),
4358
- maxTokens: z2.number().int(),
4359
- stopSequences: z2.optional(z2.array(z2.string())),
4360
- metadata: z2.optional(z2.object({}).passthrough()),
4361
- modelPreferences: z2.optional(ModelPreferencesSchema)
4377
+ messages: exports_external.array(SamplingMessageSchema),
4378
+ systemPrompt: exports_external.optional(exports_external.string()),
4379
+ includeContext: exports_external.optional(exports_external.enum(["none", "thisServer", "allServers"])),
4380
+ temperature: exports_external.optional(exports_external.number()),
4381
+ maxTokens: exports_external.number().int(),
4382
+ stopSequences: exports_external.optional(exports_external.array(exports_external.string())),
4383
+ metadata: exports_external.optional(exports_external.object({}).passthrough()),
4384
+ modelPreferences: exports_external.optional(ModelPreferencesSchema)
4362
4385
  })
4363
4386
  });
4364
4387
  CreateMessageResultSchema = ResultSchema.extend({
4365
- model: z2.string(),
4366
- stopReason: z2.optional(z2.enum(["endTurn", "stopSequence", "maxTokens"]).or(z2.string())),
4367
- role: z2.enum(["user", "assistant"]),
4368
- content: z2.discriminatedUnion("type", [
4388
+ model: exports_external.string(),
4389
+ stopReason: exports_external.optional(exports_external.enum(["endTurn", "stopSequence", "maxTokens"]).or(exports_external.string())),
4390
+ role: exports_external.enum(["user", "assistant"]),
4391
+ content: exports_external.discriminatedUnion("type", [
4369
4392
  TextContentSchema,
4370
4393
  ImageContentSchema
4371
4394
  ])
4372
4395
  });
4373
- ResourceReferenceSchema = z2.object({
4374
- type: z2.literal("ref/resource"),
4375
- uri: z2.string()
4396
+ ResourceReferenceSchema = exports_external.object({
4397
+ type: exports_external.literal("ref/resource"),
4398
+ uri: exports_external.string()
4376
4399
  }).passthrough();
4377
- PromptReferenceSchema = z2.object({
4378
- type: z2.literal("ref/prompt"),
4379
- name: z2.string()
4400
+ PromptReferenceSchema = exports_external.object({
4401
+ type: exports_external.literal("ref/prompt"),
4402
+ name: exports_external.string()
4380
4403
  }).passthrough();
4381
4404
  CompleteRequestSchema = RequestSchema.extend({
4382
- method: z2.literal("completion/complete"),
4405
+ method: exports_external.literal("completion/complete"),
4383
4406
  params: BaseRequestParamsSchema.extend({
4384
- ref: z2.union([PromptReferenceSchema, ResourceReferenceSchema]),
4385
- argument: z2.object({
4386
- name: z2.string(),
4387
- value: z2.string()
4407
+ ref: exports_external.union([PromptReferenceSchema, ResourceReferenceSchema]),
4408
+ argument: exports_external.object({
4409
+ name: exports_external.string(),
4410
+ value: exports_external.string()
4388
4411
  }).passthrough()
4389
4412
  })
4390
4413
  });
4391
4414
  CompleteResultSchema = ResultSchema.extend({
4392
- completion: z2.object({
4393
- values: z2.array(z2.string()).max(100),
4394
- total: z2.optional(z2.number().int()),
4395
- hasMore: z2.optional(z2.boolean())
4415
+ completion: exports_external.object({
4416
+ values: exports_external.array(exports_external.string()).max(100),
4417
+ total: exports_external.optional(exports_external.number().int()),
4418
+ hasMore: exports_external.optional(exports_external.boolean())
4396
4419
  }).passthrough()
4397
4420
  });
4398
- RootSchema = z2.object({
4399
- uri: z2.string().startsWith("file://"),
4400
- name: z2.optional(z2.string())
4421
+ RootSchema = exports_external.object({
4422
+ uri: exports_external.string().startsWith("file://"),
4423
+ name: exports_external.optional(exports_external.string())
4401
4424
  }).passthrough();
4402
4425
  ListRootsRequestSchema = RequestSchema.extend({
4403
- method: z2.literal("roots/list")
4426
+ method: exports_external.literal("roots/list")
4404
4427
  });
4405
4428
  ListRootsResultSchema = ResultSchema.extend({
4406
- roots: z2.array(RootSchema)
4429
+ roots: exports_external.array(RootSchema)
4407
4430
  });
4408
4431
  RootsListChangedNotificationSchema = NotificationSchema.extend({
4409
- method: z2.literal("notifications/roots/list_changed")
4432
+ method: exports_external.literal("notifications/roots/list_changed")
4410
4433
  });
4411
- ClientRequestSchema = z2.union([
4434
+ ClientRequestSchema = exports_external.union([
4412
4435
  PingRequestSchema,
4413
4436
  InitializeRequestSchema,
4414
4437
  CompleteRequestSchema,
@@ -4423,23 +4446,23 @@ var init_types = __esm(() => {
4423
4446
  CallToolRequestSchema,
4424
4447
  ListToolsRequestSchema
4425
4448
  ]);
4426
- ClientNotificationSchema = z2.union([
4449
+ ClientNotificationSchema = exports_external.union([
4427
4450
  CancelledNotificationSchema,
4428
4451
  ProgressNotificationSchema,
4429
4452
  InitializedNotificationSchema,
4430
4453
  RootsListChangedNotificationSchema
4431
4454
  ]);
4432
- ClientResultSchema = z2.union([
4455
+ ClientResultSchema = exports_external.union([
4433
4456
  EmptyResultSchema,
4434
4457
  CreateMessageResultSchema,
4435
4458
  ListRootsResultSchema
4436
4459
  ]);
4437
- ServerRequestSchema = z2.union([
4460
+ ServerRequestSchema = exports_external.union([
4438
4461
  PingRequestSchema,
4439
4462
  CreateMessageRequestSchema,
4440
4463
  ListRootsRequestSchema
4441
4464
  ]);
4442
- ServerNotificationSchema = z2.union([
4465
+ ServerNotificationSchema = exports_external.union([
4443
4466
  CancelledNotificationSchema,
4444
4467
  ProgressNotificationSchema,
4445
4468
  LoggingMessageNotificationSchema,
@@ -4448,7 +4471,7 @@ var init_types = __esm(() => {
4448
4471
  ToolListChangedNotificationSchema,
4449
4472
  PromptListChangedNotificationSchema
4450
4473
  ]);
4451
- ServerResultSchema = z2.union([
4474
+ ServerResultSchema = exports_external.union([
4452
4475
  EmptyResultSchema,
4453
4476
  InitializeResultSchema,
4454
4477
  CompleteResultSchema,
@@ -5064,14 +5087,14 @@ var require_inherits_browser = __commonJS((exports, module) => {
5064
5087
  // node_modules/inherits/inherits.js
5065
5088
  var require_inherits = __commonJS((exports, module) => {
5066
5089
  try {
5067
- util2 = __require("util");
5068
- if (typeof util2.inherits !== "function")
5090
+ util3 = __require("util");
5091
+ if (typeof util3.inherits !== "function")
5069
5092
  throw "";
5070
- module.exports = util2.inherits;
5093
+ module.exports = util3.inherits;
5071
5094
  } catch (e) {
5072
5095
  module.exports = require_inherits_browser();
5073
5096
  }
5074
- var util2;
5097
+ var util3;
5075
5098
  });
5076
5099
 
5077
5100
  // node_modules/toidentifier/index.js
@@ -9221,7 +9244,7 @@ data: ${JSON.stringify(message)}
9221
9244
  }
9222
9245
  var import_raw_body, import_content_type, MAXIMUM_MESSAGE_SIZE = "4mb";
9223
9246
  var init_sse = __esm(() => {
9224
- init_types();
9247
+ init_types2();
9225
9248
  import_raw_body = __toESM(require_raw_body(), 1);
9226
9249
  import_content_type = __toESM(require_content_type(), 1);
9227
9250
  });
@@ -9256,7 +9279,7 @@ function serializeMessage(message) {
9256
9279
  `;
9257
9280
  }
9258
9281
  var init_stdio = __esm(() => {
9259
- init_types();
9282
+ init_types2();
9260
9283
  });
9261
9284
 
9262
9285
  // node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
@@ -9613,7 +9636,7 @@ var require_browser = __commonJS((exports, module) => {
9613
9636
  // node_modules/body-parser/node_modules/debug/src/node.js
9614
9637
  var require_node = __commonJS((exports, module) => {
9615
9638
  var tty = __require("tty");
9616
- var util2 = __require("util");
9639
+ var util3 = __require("util");
9617
9640
  exports = module.exports = require_debug();
9618
9641
  exports.init = init;
9619
9642
  exports.log = log2;
@@ -9642,7 +9665,7 @@ var require_node = __commonJS((exports, module) => {
9642
9665
  }, {});
9643
9666
  var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
9644
9667
  if (fd !== 1 && fd !== 2) {
9645
- util2.deprecate(function() {
9668
+ util3.deprecate(function() {
9646
9669
  }, "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)")();
9647
9670
  }
9648
9671
  var stream = fd === 1 ? process.stdout : fd === 2 ? process.stderr : createWritableStdioStream(fd);
@@ -9651,14 +9674,14 @@ var require_node = __commonJS((exports, module) => {
9651
9674
  }
9652
9675
  exports.formatters.o = function(v2) {
9653
9676
  this.inspectOpts.colors = this.useColors;
9654
- return util2.inspect(v2, this.inspectOpts).split(`
9677
+ return util3.inspect(v2, this.inspectOpts).split(`
9655
9678
  `).map(function(str) {
9656
9679
  return str.trim();
9657
9680
  }).join(" ");
9658
9681
  };
9659
9682
  exports.formatters.O = function(v2) {
9660
9683
  this.inspectOpts.colors = this.useColors;
9661
- return util2.inspect(v2, this.inspectOpts);
9684
+ return util3.inspect(v2, this.inspectOpts);
9662
9685
  };
9663
9686
  function formatArgs(args) {
9664
9687
  var name = this.namespace;
@@ -9675,7 +9698,7 @@ var require_node = __commonJS((exports, module) => {
9675
9698
  }
9676
9699
  }
9677
9700
  function log2() {
9678
- return stream.write(util2.format.apply(util2, arguments) + `
9701
+ return stream.write(util3.format.apply(util3, arguments) + `
9679
9702
  `);
9680
9703
  }
9681
9704
  function save(namespaces) {
@@ -22317,7 +22340,7 @@ var require_mime_types = __commonJS((exports) => {
22317
22340
  }
22318
22341
  return exports.types[extension2] || false;
22319
22342
  }
22320
- function populateMaps(extensions, types) {
22343
+ function populateMaps(extensions, types2) {
22321
22344
  var preference = ["nginx", "apache", undefined, "iana"];
22322
22345
  Object.keys(db).forEach(function forEachMimeType(type) {
22323
22346
  var mime = db[type];
@@ -22328,14 +22351,14 @@ var require_mime_types = __commonJS((exports) => {
22328
22351
  extensions[type] = exts;
22329
22352
  for (var i = 0;i < exts.length; i++) {
22330
22353
  var extension2 = exts[i];
22331
- if (types[extension2]) {
22332
- var from = preference.indexOf(db[types[extension2]].source);
22354
+ if (types2[extension2]) {
22355
+ var from = preference.indexOf(db[types2[extension2]].source);
22333
22356
  var to = preference.indexOf(mime.source);
22334
- if (types[extension2] !== "application/octet-stream" && (from > to || from === to && types[extension2].substr(0, 12) === "application/")) {
22357
+ if (types2[extension2] !== "application/octet-stream" && (from > to || from === to && types2[extension2].substr(0, 12) === "application/")) {
22335
22358
  continue;
22336
22359
  }
22337
22360
  }
22338
- types[extension2] = type;
22361
+ types2[extension2] = type;
22339
22362
  }
22340
22363
  });
22341
22364
  }
@@ -22358,23 +22381,23 @@ var require_type_is = __commonJS((exports, module) => {
22358
22381
  module.exports.match = mimeMatch;
22359
22382
  function typeis(value, types_) {
22360
22383
  var i;
22361
- var types = types_;
22384
+ var types2 = types_;
22362
22385
  var val = tryNormalizeType(value);
22363
22386
  if (!val) {
22364
22387
  return false;
22365
22388
  }
22366
- if (types && !Array.isArray(types)) {
22367
- types = new Array(arguments.length - 1);
22368
- for (i = 0;i < types.length; i++) {
22369
- types[i] = arguments[i + 1];
22389
+ if (types2 && !Array.isArray(types2)) {
22390
+ types2 = new Array(arguments.length - 1);
22391
+ for (i = 0;i < types2.length; i++) {
22392
+ types2[i] = arguments[i + 1];
22370
22393
  }
22371
22394
  }
22372
- if (!types || !types.length) {
22395
+ if (!types2 || !types2.length) {
22373
22396
  return val;
22374
22397
  }
22375
22398
  var type;
22376
- for (i = 0;i < types.length; i++) {
22377
- if (mimeMatch(normalize(type = types[i]), val)) {
22399
+ for (i = 0;i < types2.length; i++) {
22400
+ if (mimeMatch(normalize(type = types2[i]), val)) {
22378
22401
  return type[0] === "+" || type.indexOf("*") !== -1 ? val : type;
22379
22402
  }
22380
22403
  }
@@ -22384,18 +22407,18 @@ var require_type_is = __commonJS((exports, module) => {
22384
22407
  return req.headers["transfer-encoding"] !== undefined || !isNaN(req.headers["content-length"]);
22385
22408
  }
22386
22409
  function typeofrequest(req, types_) {
22387
- var types = types_;
22410
+ var types2 = types_;
22388
22411
  if (!hasbody(req)) {
22389
22412
  return null;
22390
22413
  }
22391
22414
  if (arguments.length > 2) {
22392
- types = new Array(arguments.length - 1);
22393
- for (var i = 0;i < types.length; i++) {
22394
- types[i] = arguments[i + 1];
22415
+ types2 = new Array(arguments.length - 1);
22416
+ for (var i = 0;i < types2.length; i++) {
22417
+ types2[i] = arguments[i + 1];
22395
22418
  }
22396
22419
  }
22397
22420
  var value = req.headers["content-type"];
22398
- return typeis(value, types);
22421
+ return typeis(value, types2);
22399
22422
  }
22400
22423
  function normalize(type) {
22401
22424
  if (typeof type !== "string") {
@@ -25453,7 +25476,7 @@ var require_browser2 = __commonJS((exports, module) => {
25453
25476
  // node_modules/finalhandler/node_modules/debug/src/node.js
25454
25477
  var require_node2 = __commonJS((exports, module) => {
25455
25478
  var tty = __require("tty");
25456
- var util2 = __require("util");
25479
+ var util3 = __require("util");
25457
25480
  exports = module.exports = require_debug2();
25458
25481
  exports.init = init;
25459
25482
  exports.log = log2;
@@ -25482,7 +25505,7 @@ var require_node2 = __commonJS((exports, module) => {
25482
25505
  }, {});
25483
25506
  var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
25484
25507
  if (fd !== 1 && fd !== 2) {
25485
- util2.deprecate(function() {
25508
+ util3.deprecate(function() {
25486
25509
  }, "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)")();
25487
25510
  }
25488
25511
  var stream = fd === 1 ? process.stdout : fd === 2 ? process.stderr : createWritableStdioStream(fd);
@@ -25491,14 +25514,14 @@ var require_node2 = __commonJS((exports, module) => {
25491
25514
  }
25492
25515
  exports.formatters.o = function(v2) {
25493
25516
  this.inspectOpts.colors = this.useColors;
25494
- return util2.inspect(v2, this.inspectOpts).split(`
25517
+ return util3.inspect(v2, this.inspectOpts).split(`
25495
25518
  `).map(function(str) {
25496
25519
  return str.trim();
25497
25520
  }).join(" ");
25498
25521
  };
25499
25522
  exports.formatters.O = function(v2) {
25500
25523
  this.inspectOpts.colors = this.useColors;
25501
- return util2.inspect(v2, this.inspectOpts);
25524
+ return util3.inspect(v2, this.inspectOpts);
25502
25525
  };
25503
25526
  function formatArgs(args) {
25504
25527
  var name = this.namespace;
@@ -25515,7 +25538,7 @@ var require_node2 = __commonJS((exports, module) => {
25515
25538
  }
25516
25539
  }
25517
25540
  function log2() {
25518
- return stream.write(util2.format.apply(util2, arguments) + `
25541
+ return stream.write(util3.format.apply(util3, arguments) + `
25519
25542
  `);
25520
25543
  }
25521
25544
  function save(namespaces) {
@@ -26183,7 +26206,7 @@ var require_browser3 = __commonJS((exports, module) => {
26183
26206
  // node_modules/express/node_modules/debug/src/node.js
26184
26207
  var require_node3 = __commonJS((exports, module) => {
26185
26208
  var tty = __require("tty");
26186
- var util2 = __require("util");
26209
+ var util3 = __require("util");
26187
26210
  exports = module.exports = require_debug3();
26188
26211
  exports.init = init;
26189
26212
  exports.log = log2;
@@ -26212,7 +26235,7 @@ var require_node3 = __commonJS((exports, module) => {
26212
26235
  }, {});
26213
26236
  var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
26214
26237
  if (fd !== 1 && fd !== 2) {
26215
- util2.deprecate(function() {
26238
+ util3.deprecate(function() {
26216
26239
  }, "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)")();
26217
26240
  }
26218
26241
  var stream = fd === 1 ? process.stdout : fd === 2 ? process.stderr : createWritableStdioStream(fd);
@@ -26221,14 +26244,14 @@ var require_node3 = __commonJS((exports, module) => {
26221
26244
  }
26222
26245
  exports.formatters.o = function(v2) {
26223
26246
  this.inspectOpts.colors = this.useColors;
26224
- return util2.inspect(v2, this.inspectOpts).split(`
26247
+ return util3.inspect(v2, this.inspectOpts).split(`
26225
26248
  `).map(function(str) {
26226
26249
  return str.trim();
26227
26250
  }).join(" ");
26228
26251
  };
26229
26252
  exports.formatters.O = function(v2) {
26230
26253
  this.inspectOpts.colors = this.useColors;
26231
- return util2.inspect(v2, this.inspectOpts);
26254
+ return util3.inspect(v2, this.inspectOpts);
26232
26255
  };
26233
26256
  function formatArgs(args) {
26234
26257
  var name = this.namespace;
@@ -26245,7 +26268,7 @@ var require_node3 = __commonJS((exports, module) => {
26245
26268
  }
26246
26269
  }
26247
26270
  function log2() {
26248
- return stream.write(util2.format.apply(util2, arguments) + `
26271
+ return stream.write(util3.format.apply(util3, arguments) + `
26249
26272
  `);
26250
26273
  }
26251
26274
  function save(namespaces) {
@@ -27766,7 +27789,7 @@ var require_browser4 = __commonJS((exports, module) => {
27766
27789
  // node_modules/send/node_modules/debug/src/node.js
27767
27790
  var require_node4 = __commonJS((exports, module) => {
27768
27791
  var tty = __require("tty");
27769
- var util2 = __require("util");
27792
+ var util3 = __require("util");
27770
27793
  exports = module.exports = require_debug4();
27771
27794
  exports.init = init;
27772
27795
  exports.log = log2;
@@ -27795,7 +27818,7 @@ var require_node4 = __commonJS((exports, module) => {
27795
27818
  }, {});
27796
27819
  var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
27797
27820
  if (fd !== 1 && fd !== 2) {
27798
- util2.deprecate(function() {
27821
+ util3.deprecate(function() {
27799
27822
  }, "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)")();
27800
27823
  }
27801
27824
  var stream = fd === 1 ? process.stdout : fd === 2 ? process.stderr : createWritableStdioStream(fd);
@@ -27804,14 +27827,14 @@ var require_node4 = __commonJS((exports, module) => {
27804
27827
  }
27805
27828
  exports.formatters.o = function(v2) {
27806
27829
  this.inspectOpts.colors = this.useColors;
27807
- return util2.inspect(v2, this.inspectOpts).split(`
27830
+ return util3.inspect(v2, this.inspectOpts).split(`
27808
27831
  `).map(function(str) {
27809
27832
  return str.trim();
27810
27833
  }).join(" ");
27811
27834
  };
27812
27835
  exports.formatters.O = function(v2) {
27813
27836
  this.inspectOpts.colors = this.useColors;
27814
- return util2.inspect(v2, this.inspectOpts);
27837
+ return util3.inspect(v2, this.inspectOpts);
27815
27838
  };
27816
27839
  function formatArgs(args) {
27817
27840
  var name = this.namespace;
@@ -27828,7 +27851,7 @@ var require_node4 = __commonJS((exports, module) => {
27828
27851
  }
27829
27852
  }
27830
27853
  function log2() {
27831
- return stream.write(util2.format.apply(util2, arguments) + `
27854
+ return stream.write(util3.format.apply(util3, arguments) + `
27832
27855
  `);
27833
27856
  }
27834
27857
  function save(namespaces) {
@@ -28309,7 +28332,7 @@ var require_send = __commonJS((exports, module) => {
28309
28332
  var path = __require("path");
28310
28333
  var statuses = require_statuses();
28311
28334
  var Stream = __require("stream");
28312
- var util2 = __require("util");
28335
+ var util3 = __require("util");
28313
28336
  var extname = path.extname;
28314
28337
  var join = path.join;
28315
28338
  var normalize = path.normalize;
@@ -28355,7 +28378,7 @@ var require_send = __commonJS((exports, module) => {
28355
28378
  this.from(opts.from);
28356
28379
  }
28357
28380
  }
28358
- util2.inherits(SendStream, Stream);
28381
+ util3.inherits(SendStream, Stream);
28359
28382
  SendStream.prototype.etag = deprecate.function(function etag(val) {
28360
28383
  this._etag = Boolean(val);
28361
28384
  debug("etag %s", this._etag);
@@ -29711,10 +29734,10 @@ var require_utils2 = __commonJS((exports) => {
29711
29734
  exports.normalizeType = function(type) {
29712
29735
  return ~type.indexOf("/") ? acceptParams(type) : { value: mime.lookup(type), params: {} };
29713
29736
  };
29714
- exports.normalizeTypes = function(types) {
29737
+ exports.normalizeTypes = function(types2) {
29715
29738
  var ret = [];
29716
- for (var i = 0;i < types.length; ++i) {
29717
- ret.push(exports.normalizeType(types[i]));
29739
+ for (var i = 0;i < types2.length; ++i) {
29740
+ ret.push(exports.normalizeType(types2[i]));
29718
29741
  }
29719
29742
  return ret;
29720
29743
  };
@@ -30614,23 +30637,23 @@ var require_accepts = __commonJS((exports, module) => {
30614
30637
  this.negotiator = new Negotiator(req);
30615
30638
  }
30616
30639
  Accepts.prototype.type = Accepts.prototype.types = function(types_) {
30617
- var types = types_;
30618
- if (types && !Array.isArray(types)) {
30619
- types = new Array(arguments.length);
30620
- for (var i = 0;i < types.length; i++) {
30621
- types[i] = arguments[i];
30640
+ var types2 = types_;
30641
+ if (types2 && !Array.isArray(types2)) {
30642
+ types2 = new Array(arguments.length);
30643
+ for (var i = 0;i < types2.length; i++) {
30644
+ types2[i] = arguments[i];
30622
30645
  }
30623
30646
  }
30624
- if (!types || types.length === 0) {
30647
+ if (!types2 || types2.length === 0) {
30625
30648
  return this.negotiator.mediaTypes();
30626
30649
  }
30627
30650
  if (!this.headers.accept) {
30628
- return types[0];
30651
+ return types2[0];
30629
30652
  }
30630
- var mimes = types.map(extToMime);
30653
+ var mimes = types2.map(extToMime);
30631
30654
  var accepts = this.negotiator.mediaTypes(mimes.filter(validMime));
30632
30655
  var first = accepts[0];
30633
- return first ? types[mimes.indexOf(first)] : false;
30656
+ return first ? types2[mimes.indexOf(first)] : false;
30634
30657
  };
30635
30658
  Accepts.prototype.encoding = Accepts.prototype.encodings = function(encodings_) {
30636
30659
  var encodings = encodings_;
@@ -30754,9 +30777,9 @@ var require_request = __commonJS((exports, module) => {
30754
30777
  return query[name];
30755
30778
  return defaultValue;
30756
30779
  };
30757
- req.is = function is(types) {
30758
- var arr = types;
30759
- if (!Array.isArray(types)) {
30780
+ req.is = function is(types2) {
30781
+ var arr = types2;
30782
+ if (!Array.isArray(types2)) {
30760
30783
  arr = new Array(arguments.length);
30761
30784
  for (var i = 0;i < arr.length; i++) {
30762
30785
  arr[i] = arguments[i];
@@ -32164,14 +32187,14 @@ function mergeCapabilities(base, additional) {
32164
32187
  }
32165
32188
  var DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
32166
32189
  var init_protocol = __esm(() => {
32167
- init_types();
32190
+ init_types2();
32168
32191
  });
32169
32192
 
32170
32193
  // node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
32171
32194
  var Server;
32172
32195
  var init_server = __esm(() => {
32173
32196
  init_protocol();
32174
- init_types();
32197
+ init_types2();
32175
32198
  Server = class Server extends Protocol {
32176
32199
  constructor(_serverInfo, options) {
32177
32200
  var _a;
@@ -32425,7 +32448,7 @@ function parseArrayDef(def, refs) {
32425
32448
  return res;
32426
32449
  }
32427
32450
  var init_array = __esm(() => {
32428
- init_lib();
32451
+ init_esm();
32429
32452
  init_parseDef();
32430
32453
  });
32431
32454
 
@@ -32991,7 +33014,7 @@ function parseRecordDef(def, refs) {
32991
33014
  return schema;
32992
33015
  }
32993
33016
  var init_record = __esm(() => {
32994
- init_lib();
33017
+ init_esm();
32995
33018
  init_parseDef();
32996
33019
  init_string();
32997
33020
  init_branded();
@@ -33063,15 +33086,15 @@ function parseUnionDef(def, refs) {
33063
33086
  return asAnyOf(def, refs);
33064
33087
  const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
33065
33088
  if (options.every((x2) => (x2._def.typeName in primitiveMappings) && (!x2._def.checks || !x2._def.checks.length))) {
33066
- const types = options.reduce((types2, x2) => {
33089
+ const types2 = options.reduce((types3, x2) => {
33067
33090
  const type = primitiveMappings[x2._def.typeName];
33068
- return type && !types2.includes(type) ? [...types2, type] : types2;
33091
+ return type && !types3.includes(type) ? [...types3, type] : types3;
33069
33092
  }, []);
33070
33093
  return {
33071
- type: types.length > 1 ? types : types[0]
33094
+ type: types2.length > 1 ? types2 : types2[0]
33072
33095
  };
33073
33096
  } else if (options.every((x2) => x2._def.typeName === "ZodLiteral" && !x2.description)) {
33074
- const types = options.reduce((acc, x2) => {
33097
+ const types2 = options.reduce((acc, x2) => {
33075
33098
  const type = typeof x2._def.value;
33076
33099
  switch (type) {
33077
33100
  case "string":
@@ -33090,8 +33113,8 @@ function parseUnionDef(def, refs) {
33090
33113
  return acc;
33091
33114
  }
33092
33115
  }, []);
33093
- if (types.length === options.length) {
33094
- const uniqueTypes = types.filter((x2, i, a) => a.indexOf(x2) === i);
33116
+ if (types2.length === options.length) {
33117
+ const uniqueTypes = types2.filter((x2, i, a) => a.indexOf(x2) === i);
33095
33118
  return {
33096
33119
  type: uniqueTypes.length > 1 ? uniqueTypes : uniqueTypes[0],
33097
33120
  enum: options.reduce((acc, x2) => {
@@ -33265,7 +33288,7 @@ function parseObjectDef(def, refs) {
33265
33288
  return result;
33266
33289
  }
33267
33290
  var init_object = __esm(() => {
33268
- init_lib();
33291
+ init_esm();
33269
33292
  init_parseDef();
33270
33293
  });
33271
33294
 
@@ -33474,7 +33497,7 @@ var selectParser = (def, typeName, refs) => {
33474
33497
  }
33475
33498
  };
33476
33499
  var init_selectParser = __esm(() => {
33477
- init_lib();
33500
+ init_esm();
33478
33501
  init_array();
33479
33502
  init_bigint();
33480
33503
  init_branded();
@@ -33617,7 +33640,7 @@ var init_zodToJsonSchema = __esm(() => {
33617
33640
  });
33618
33641
 
33619
33642
  // node_modules/zod-to-json-schema/dist/esm/index.js
33620
- var init_esm = __esm(() => {
33643
+ var init_esm2 = __esm(() => {
33621
33644
  init_Options();
33622
33645
  init_Refs();
33623
33646
  init_parseDef();
@@ -33675,7 +33698,7 @@ function processCreateParams2(params) {
33675
33698
  }
33676
33699
  var McpZodTypeKind, Completable;
33677
33700
  var init_completable = __esm(() => {
33678
- init_lib();
33701
+ init_esm();
33679
33702
  (function(McpZodTypeKind2) {
33680
33703
  McpZodTypeKind2["Completable"] = "McpCompletable";
33681
33704
  })(McpZodTypeKind || (McpZodTypeKind = {}));
@@ -33970,7 +33993,7 @@ class McpServer {
33970
33993
  const cb = rest[0];
33971
33994
  this._registeredTools[name] = {
33972
33995
  description,
33973
- inputSchema: paramsSchema === undefined ? undefined : z2.object(paramsSchema),
33996
+ inputSchema: paramsSchema === undefined ? undefined : exports_external.object(paramsSchema),
33974
33997
  callback: cb
33975
33998
  };
33976
33999
  this.setToolRequestHandlers();
@@ -33990,7 +34013,7 @@ class McpServer {
33990
34013
  const cb = rest[0];
33991
34014
  this._registeredPrompts[name] = {
33992
34015
  description,
33993
- argsSchema: argsSchema === undefined ? undefined : z2.object(argsSchema),
34016
+ argsSchema: argsSchema === undefined ? undefined : exports_external.object(argsSchema),
33994
34017
  callback: cb
33995
34018
  };
33996
34019
  this.setPromptRequestHandlers();
@@ -34015,9 +34038,9 @@ function createCompletionResult(suggestions) {
34015
34038
  var EMPTY_OBJECT_JSON_SCHEMA, EMPTY_COMPLETION_RESULT;
34016
34039
  var init_mcp = __esm(() => {
34017
34040
  init_server();
34041
+ init_esm2();
34018
34042
  init_esm();
34019
- init_lib();
34020
- init_types();
34043
+ init_types2();
34021
34044
  init_completable();
34022
34045
  EMPTY_OBJECT_JSON_SCHEMA = {
34023
34046
  type: "object"
@@ -34165,7 +34188,7 @@ function stringToBase64(str) {
34165
34188
  }
34166
34189
  var zodOutbound, zodInbound;
34167
34190
  var init_base64 = __esm(() => {
34168
- init_lib();
34191
+ init_esm();
34169
34192
  zodOutbound = instanceOfType(Uint8Array).or(stringType().transform(stringToBytes));
34170
34193
  zodInbound = instanceOfType(Uint8Array).or(stringType().transform(bytesFromBase64));
34171
34194
  });
@@ -34214,9 +34237,9 @@ var init_config = __esm(() => {
34214
34237
  SDK_METADATA = {
34215
34238
  language: "typescript",
34216
34239
  openapiDocVersion: "0.1.0",
34217
- sdkVersion: "0.0.2",
34218
- genVersion: "2.568.2",
34219
- userAgent: "speakeasy-sdk/typescript 0.0.2 2.568.2 0.1.0 @financeable/lenders"
34240
+ sdkVersion: "0.1.0",
34241
+ genVersion: "2.624.0",
34242
+ userAgent: "speakeasy-sdk/typescript 0.1.0 2.624.0 0.1.0 @financeable/lenders"
34220
34243
  };
34221
34244
  });
34222
34245
 
@@ -34429,7 +34452,7 @@ function env() {
34429
34452
  }
34430
34453
  var envSchema, envMemo = undefined;
34431
34454
  var init_env = __esm(() => {
34432
- init_lib();
34455
+ init_esm();
34433
34456
  envSchema = objectType({
34434
34457
  FINACEABLELENDERS_DEBUG: coerce.boolean().optional()
34435
34458
  });
@@ -34752,7 +34775,6 @@ class ClientSDK {
34752
34775
  } else {
34753
34776
  this.#hooks = new SDKHooks;
34754
34777
  }
34755
- this._options = { ...options, hooks: this.#hooks };
34756
34778
  const url = serverURLFromOptions(options);
34757
34779
  if (url) {
34758
34780
  url.pathname = url.pathname.replace(/\/+$/, "") + "/";
@@ -34763,7 +34785,8 @@ class ClientSDK {
34763
34785
  });
34764
34786
  this._baseURL = baseURL;
34765
34787
  this.#httpClient = client;
34766
- this.#logger = options.debugLogger;
34788
+ this._options = { ...options, hooks: this.#hooks };
34789
+ this.#logger = this._options.debugLogger;
34767
34790
  if (!this.#logger && env().FINACEABLELENDERS_DEBUG) {
34768
34791
  this.#logger = console;
34769
34792
  }
@@ -34812,26 +34835,22 @@ class ClientSDK {
34812
34835
  }
34813
34836
  cookie = cookie.startsWith("; ") ? cookie.slice(2) : cookie;
34814
34837
  headers.set("cookie", cookie);
34815
- const userHeaders = new Headers(options?.fetchOptions?.headers);
34838
+ const userHeaders = new Headers(options?.headers ?? options?.fetchOptions?.headers);
34816
34839
  for (const [k2, v2] of userHeaders) {
34817
34840
  headers.set(k2, v2);
34818
34841
  }
34819
34842
  if (!isBrowserLike) {
34820
- headers.set(conf.uaHeader ?? "user-agent", SDK_METADATA.userAgent);
34843
+ headers.set(conf.uaHeader ?? "user-agent", conf.userAgent ?? SDK_METADATA.userAgent);
34821
34844
  }
34822
- let fetchOptions = options?.fetchOptions;
34845
+ const fetchOptions = {
34846
+ ...options?.fetchOptions,
34847
+ ...options
34848
+ };
34823
34849
  if (!fetchOptions?.signal && conf.timeoutMs && conf.timeoutMs > 0) {
34824
34850
  const timeoutSignal = AbortSignal.timeout(conf.timeoutMs);
34825
- if (!fetchOptions) {
34826
- fetchOptions = { signal: timeoutSignal };
34827
- } else {
34828
- fetchOptions.signal = timeoutSignal;
34829
- }
34851
+ fetchOptions.signal = timeoutSignal;
34830
34852
  }
34831
34853
  if (conf.body instanceof ReadableStream) {
34832
- if (!fetchOptions) {
34833
- fetchOptions = {};
34834
- }
34835
34854
  Object.assign(fetchOptions, { duplex: "half" });
34836
34855
  }
34837
34856
  let input;
@@ -34940,9 +34959,12 @@ async function logResponse(logger, res, req) {
34940
34959
  logger.groupEnd();
34941
34960
  logger.group("Body:");
34942
34961
  switch (true) {
34943
- case (matchContentType(res, "application/json") || jsonLikeContentTypeRE.test(ct)):
34962
+ case (matchContentType(res, "application/json") || jsonLikeContentTypeRE.test(ct) && !jsonlLikeContentTypeRE.test(ct)):
34944
34963
  logger.log(await res.clone().json());
34945
34964
  break;
34965
+ case (matchContentType(res, "application/jsonl") || jsonlLikeContentTypeRE.test(ct)):
34966
+ logger.log(await res.clone().text());
34967
+ break;
34946
34968
  case matchContentType(res, "text/event-stream"):
34947
34969
  logger.log(`<${contentType2}>`);
34948
34970
  break;
@@ -34964,7 +34986,7 @@ async function logResponse(logger, res, req) {
34964
34986
  logger.groupEnd();
34965
34987
  logger.groupEnd();
34966
34988
  }
34967
- var gt, webWorkerLike, isBrowserLike, jsonLikeContentTypeRE;
34989
+ var gt, webWorkerLike, isBrowserLike, jsonLikeContentTypeRE, jsonlLikeContentTypeRE;
34968
34990
  var init_sdks = __esm(() => {
34969
34991
  init_httpclienterrors();
34970
34992
  init_base64();
@@ -34976,7 +34998,8 @@ var init_sdks = __esm(() => {
34976
34998
  gt = typeof globalThis === "undefined" ? null : globalThis;
34977
34999
  webWorkerLike = typeof gt === "object" && gt != null && "importScripts" in gt && typeof gt["importScripts"] === "function";
34978
35000
  isBrowserLike = webWorkerLike || typeof navigator !== "undefined" && "serviceWorker" in navigator || typeof window === "object" && typeof window.document !== "undefined";
34979
- jsonLikeContentTypeRE = /^application\/(?:.{0,100}\+)?json/;
35001
+ jsonLikeContentTypeRE = /(application|text)\/.*?\+*json.*/;
35002
+ jsonlLikeContentTypeRE = /(application|text)\/(.*?\+*\bjsonl\b.*|.*?\+*\bx-ndjson\b.*)/;
34980
35003
  });
34981
35004
 
34982
35005
  // src/core.ts
@@ -35056,7 +35079,7 @@ async function valueToBase64(value) {
35056
35079
  }
35057
35080
  var base64Schema;
35058
35081
  var init_shared = __esm(() => {
35059
- init_lib();
35082
+ init_esm();
35060
35083
  init_base64();
35061
35084
  base64Schema = stringType().base64();
35062
35085
  });
@@ -35166,24 +35189,47 @@ var init_tools = __esm(() => {
35166
35189
  init_shared();
35167
35190
  });
35168
35191
 
35192
+ // src/models/errors/financeablelenderserror.ts
35193
+ var FinanceableLendersError;
35194
+ var init_financeablelenderserror = __esm(() => {
35195
+ FinanceableLendersError = class FinanceableLendersError 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 = "FinanceableLendersError";
35209
+ }
35210
+ };
35211
+ });
35212
+
35169
35213
  // src/models/errors/apierror.ts
35170
35214
  var APIError;
35171
35215
  var init_apierror = __esm(() => {
35172
- APIError = class APIError extends Error {
35173
- rawResponse;
35174
- body;
35175
- statusCode;
35176
- contentType;
35177
- constructor(message, rawResponse, body = "") {
35178
- const statusCode = rawResponse.status;
35179
- const contentType2 = rawResponse.headers.get("content-type") || "";
35180
- const bodyString = body.length > 0 ? `
35181
- ${body}` : "";
35182
- super(`${message}: Status ${statusCode} Content-Type ${contentType2} Body ${bodyString}`);
35183
- this.rawResponse = rawResponse;
35184
- this.body = body;
35185
- this.statusCode = statusCode;
35186
- this.contentType = contentType2;
35216
+ init_financeablelenderserror();
35217
+ APIError = class APIError extends FinanceableLendersError {
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
+ message += `Body ${body}`;
35231
+ message = message.trim();
35232
+ super(message, httpMeta);
35187
35233
  this.name = "APIError";
35188
35234
  }
35189
35235
  };
@@ -35243,10 +35289,23 @@ ${pre}${str}`;
35243
35289
  }
35244
35290
  var SDKValidationError;
35245
35291
  var init_sdkvalidationerror = __esm(() => {
35246
- init_lib();
35292
+ init_esm();
35247
35293
  SDKValidationError = class SDKValidationError extends Error {
35248
35294
  rawValue;
35249
35295
  rawMessage;
35296
+ static [Symbol.hasInstance](instance) {
35297
+ if (!(instance instanceof Error))
35298
+ return false;
35299
+ if (!("rawValue" in instance))
35300
+ return false;
35301
+ if (!("rawMessage" in instance))
35302
+ return false;
35303
+ if (!("pretty" in instance))
35304
+ return false;
35305
+ if (typeof instance.pretty !== "function")
35306
+ return false;
35307
+ return true;
35308
+ }
35250
35309
  constructor(message, cause, rawValue) {
35251
35310
  super(`${message}: ${cause}`);
35252
35311
  this.name = "SDKValidationError";
@@ -35265,16 +35324,31 @@ ${formatZodError(this.cause)}`;
35265
35324
  };
35266
35325
  });
35267
35326
 
35268
- // src/lib/schemas.ts
35269
- function safeParse(rawValue, fn, errorMessage) {
35270
- try {
35271
- return OK2(fn(rawValue));
35272
- } catch (err) {
35273
- return ERR(new SDKValidationError(errorMessage, err, rawValue));
35274
- }
35275
- }
35276
- var init_schemas = __esm(() => {
35327
+ // src/models/errors/responsevalidationerror.ts
35328
+ var ResponseValidationError;
35329
+ var init_responsevalidationerror = __esm(() => {
35330
+ init_esm();
35331
+ init_financeablelenderserror();
35277
35332
  init_sdkvalidationerror();
35333
+ ResponseValidationError = class ResponseValidationError extends FinanceableLendersError {
35334
+ rawValue;
35335
+ rawMessage;
35336
+ constructor(message, extra) {
35337
+ super(message, extra);
35338
+ this.name = "ResponseValidationError";
35339
+ this.cause = extra.cause;
35340
+ this.rawValue = extra.rawValue;
35341
+ this.rawMessage = extra.rawMessage;
35342
+ }
35343
+ pretty() {
35344
+ if (this.cause instanceof ZodError) {
35345
+ return `${this.rawMessage}
35346
+ ${formatZodError(this.cause)}`;
35347
+ } else {
35348
+ return this.toString();
35349
+ }
35350
+ }
35351
+ };
35278
35352
  });
35279
35353
 
35280
35354
  // src/lib/matchers.ts
@@ -35288,7 +35362,7 @@ function fail(codes) {
35288
35362
  return { enc: "fail", codes };
35289
35363
  }
35290
35364
  function match(...matchers) {
35291
- return async function matchFunc(response, options) {
35365
+ return async function matchFunc(response, request, options) {
35292
35366
  let raw;
35293
35367
  let matcher;
35294
35368
  for (const match2 of matchers) {
@@ -35303,16 +35377,24 @@ function match(...matchers) {
35303
35377
  }
35304
35378
  }
35305
35379
  if (!matcher) {
35306
- const responseBody = await response.text();
35307
35380
  return [{
35308
35381
  ok: false,
35309
- error: new APIError("Unexpected API response status or content-type", response, responseBody)
35310
- }, responseBody];
35382
+ error: new APIError("Unexpected Status or Content-Type", {
35383
+ response,
35384
+ request,
35385
+ body: await response.text().catch(() => "")
35386
+ })
35387
+ }, raw];
35311
35388
  }
35312
35389
  const encoding = matcher.enc;
35390
+ let body = "";
35313
35391
  switch (encoding) {
35314
35392
  case "json":
35315
- raw = await response.json();
35393
+ body = await response.text();
35394
+ raw = JSON.parse(body);
35395
+ break;
35396
+ case "jsonl":
35397
+ raw = response.body;
35316
35398
  break;
35317
35399
  case "bytes":
35318
35400
  raw = new Uint8Array(await response.arrayBuffer());
@@ -35321,16 +35403,19 @@ function match(...matchers) {
35321
35403
  raw = response.body;
35322
35404
  break;
35323
35405
  case "text":
35324
- raw = await response.text();
35406
+ body = await response.text();
35407
+ raw = body;
35325
35408
  break;
35326
35409
  case "sse":
35327
35410
  raw = response.body;
35328
35411
  break;
35329
35412
  case "nil":
35330
- raw = await discardResponseBody(response);
35413
+ body = await response.text();
35414
+ raw = undefined;
35331
35415
  break;
35332
35416
  case "fail":
35333
- raw = await response.text();
35417
+ body = await response.text();
35418
+ raw = body;
35334
35419
  break;
35335
35420
  default:
35336
35421
  throw new Error(`Unsupported response type: ${encoding}`);
@@ -35338,7 +35423,7 @@ function match(...matchers) {
35338
35423
  if (matcher.enc === "fail") {
35339
35424
  return [{
35340
35425
  ok: false,
35341
- error: new APIError("API error occurred", response, typeof raw === "string" ? raw : "")
35426
+ error: new APIError("API error occurred", { request, response, body })
35342
35427
  }, raw];
35343
35428
  }
35344
35429
  const resultKey = matcher.key || options?.resultKey;
@@ -35347,7 +35432,10 @@ function match(...matchers) {
35347
35432
  data = {
35348
35433
  ...options?.extraFields,
35349
35434
  ...matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null,
35350
- ...isPlainObject(raw) ? raw : null
35435
+ ...isPlainObject(raw) ? raw : null,
35436
+ request$: request,
35437
+ response$: response,
35438
+ body$: body
35351
35439
  };
35352
35440
  } else if (resultKey) {
35353
35441
  data = {
@@ -35365,11 +35453,11 @@ function match(...matchers) {
35365
35453
  data = raw;
35366
35454
  }
35367
35455
  if ("err" in matcher) {
35368
- const result = safeParse(data, (v2) => matcher.schema.parse(v2), "Response validation failed");
35456
+ const result = safeParseResponse(data, (v2) => matcher.schema.parse(v2), "Response validation failed", { request, response, body });
35369
35457
  return [result.ok ? { ok: false, error: result.value } : result, raw];
35370
35458
  } else {
35371
35459
  return [
35372
- safeParse(data, (v2) => matcher.schema.parse(v2), "Response validation failed"),
35460
+ safeParseResponse(data, (v2) => matcher.schema.parse(v2), "Response validation failed", { request, response, body }),
35373
35461
  raw
35374
35462
  ];
35375
35463
  }
@@ -35382,27 +35470,25 @@ function unpackHeaders(headers) {
35382
35470
  }
35383
35471
  return out;
35384
35472
  }
35385
- async function discardResponseBody(res) {
35386
- const reader = res.body?.getReader();
35387
- if (reader == null) {
35388
- return;
35389
- }
35473
+ function safeParseResponse(rawValue, fn, errorMessage, httpMeta) {
35390
35474
  try {
35391
- let done = false;
35392
- while (!done) {
35393
- const res2 = await reader.read();
35394
- done = res2.done;
35395
- }
35396
- } finally {
35397
- reader.releaseLock();
35475
+ return OK2(fn(rawValue));
35476
+ } catch (err) {
35477
+ return ERR(new ResponseValidationError(errorMessage, {
35478
+ cause: err,
35479
+ rawValue,
35480
+ rawMessage: errorMessage,
35481
+ ...httpMeta
35482
+ }));
35398
35483
  }
35399
35484
  }
35400
35485
  var DEFAULT_CONTENT_TYPES, headerValRE;
35401
35486
  var init_matchers = __esm(() => {
35402
35487
  init_apierror();
35488
+ init_responsevalidationerror();
35403
35489
  init_http();
35404
- init_schemas();
35405
35490
  DEFAULT_CONTENT_TYPES = {
35491
+ jsonl: "application/jsonl",
35406
35492
  json: "application/json",
35407
35493
  text: "text/plain",
35408
35494
  bytes: "application/octet-stream",
@@ -35442,10 +35528,22 @@ function compactMap(values) {
35442
35528
  var init_primitives = () => {
35443
35529
  };
35444
35530
 
35531
+ // src/lib/schemas.ts
35532
+ function safeParse(rawValue, fn, errorMessage) {
35533
+ try {
35534
+ return OK2(fn(rawValue));
35535
+ } catch (err) {
35536
+ return ERR(new SDKValidationError(errorMessage, err, rawValue));
35537
+ }
35538
+ }
35539
+ var init_schemas = __esm(() => {
35540
+ init_sdkvalidationerror();
35541
+ });
35542
+
35445
35543
  // src/models/components/address.ts
35446
35544
  var Address$inboundSchema, Address$outboundSchema, Address$;
35447
35545
  var init_address = __esm(() => {
35448
- init_lib();
35546
+ init_esm();
35449
35547
  init_primitives();
35450
35548
  Address$inboundSchema = objectType({
35451
35549
  _id: stringType().optional(),
@@ -35502,7 +35600,7 @@ var init_address = __esm(() => {
35502
35600
  // src/models/components/apierrorcodes.ts
35503
35601
  var ApiErrorCodes, ApiErrorCodes$inboundSchema, ApiErrorCodes$outboundSchema, ApiErrorCodes$;
35504
35602
  var init_apierrorcodes = __esm(() => {
35505
- init_lib();
35603
+ init_esm();
35506
35604
  ApiErrorCodes = {
35507
35605
  BadRequest: "BAD_REQUEST",
35508
35606
  ValidationError: "VALIDATION_ERROR",
@@ -35515,7 +35613,14 @@ var init_apierrorcodes = __esm(() => {
35515
35613
  AuthorizationError: "AUTHORIZATION_ERROR",
35516
35614
  NotFound: "NOT_FOUND",
35517
35615
  MethodNotAllowed: "METHOD_NOT_ALLOWED",
35518
- Conflict: "CONFLICT"
35616
+ Conflict: "CONFLICT",
35617
+ MissingDocumentError: "MISSING_DOCUMENT_ERROR",
35618
+ MaxRetriesExceededError: "MAX_RETRIES_EXCEEDED_ERROR",
35619
+ DocumentFileTransferError: "DOCUMENT_FILE_TRANSFER_ERROR",
35620
+ DocumentProcessingError: "DOCUMENT_PROCESSING_ERROR",
35621
+ DocumentValidationError: "DOCUMENT_VALIDATION_ERROR",
35622
+ DocumentExpiredError: "DOCUMENT_EXPIRED_ERROR",
35623
+ DocumentInvalidError: "DOCUMENT_INVALID_ERROR"
35519
35624
  };
35520
35625
  ApiErrorCodes$inboundSchema = nativeEnumType(ApiErrorCodes);
35521
35626
  ApiErrorCodes$outboundSchema = ApiErrorCodes$inboundSchema;
@@ -35528,7 +35633,7 @@ var init_apierrorcodes = __esm(() => {
35528
35633
  // src/models/components/apierrorlinks.ts
35529
35634
  var APIErrorLinks$inboundSchema, APIErrorLinks$outboundSchema, APIErrorLinks$;
35530
35635
  var init_apierrorlinks = __esm(() => {
35531
- init_lib();
35636
+ init_esm();
35532
35637
  APIErrorLinks$inboundSchema = objectType({
35533
35638
  about: stringType().optional()
35534
35639
  });
@@ -35544,7 +35649,7 @@ var init_apierrorlinks = __esm(() => {
35544
35649
  // src/models/components/errorsource.ts
35545
35650
  var ErrorSource$inboundSchema, ErrorSource$outboundSchema, ErrorSource$;
35546
35651
  var init_errorsource = __esm(() => {
35547
- init_lib();
35652
+ init_esm();
35548
35653
  ErrorSource$inboundSchema = objectType({
35549
35654
  pointer: stringType().optional(),
35550
35655
  parameter: stringType().optional(),
@@ -35564,7 +35669,7 @@ var init_errorsource = __esm(() => {
35564
35669
  // src/models/components/apierror.ts
35565
35670
  var Code$inboundSchema, Code$outboundSchema, Code$, ApiError$inboundSchema, ApiError$outboundSchema, ApiError$;
35566
35671
  var init_apierror2 = __esm(() => {
35567
- init_lib();
35672
+ init_esm();
35568
35673
  init_apierrorcodes();
35569
35674
  init_apierrorlinks();
35570
35675
  init_errorsource();
@@ -35601,7 +35706,7 @@ var init_apierror2 = __esm(() => {
35601
35706
  // src/models/components/applicantasset.ts
35602
35707
  var ApplicantAsset$inboundSchema, ApplicantAsset$outboundSchema, ApplicantAsset$;
35603
35708
  var init_applicantasset = __esm(() => {
35604
- init_lib();
35709
+ init_esm();
35605
35710
  init_primitives();
35606
35711
  ApplicantAsset$inboundSchema = objectType({
35607
35712
  _id: stringType(),
@@ -35632,7 +35737,7 @@ var init_applicantasset = __esm(() => {
35632
35737
  // src/models/components/email.ts
35633
35738
  var Email$inboundSchema, Email$outboundSchema, Email$;
35634
35739
  var init_email = __esm(() => {
35635
- init_lib();
35740
+ init_esm();
35636
35741
  Email$inboundSchema = objectType({
35637
35742
  status: stringType(),
35638
35743
  address: stringType()
@@ -35650,7 +35755,7 @@ var init_email = __esm(() => {
35650
35755
  // src/models/components/employer.ts
35651
35756
  var EmployerAddress$inboundSchema, EmployerAddress$outboundSchema, EmployerAddress$, Employer$inboundSchema, Employer$outboundSchema, Employer$;
35652
35757
  var init_employer = __esm(() => {
35653
- init_lib();
35758
+ init_esm();
35654
35759
  EmployerAddress$inboundSchema = objectType({
35655
35760
  postcode: stringType().optional()
35656
35761
  });
@@ -35690,7 +35795,7 @@ var init_employer = __esm(() => {
35690
35795
  // src/models/components/fee.ts
35691
35796
  var Fee$inboundSchema, Fee$outboundSchema, Fee$;
35692
35797
  var init_fee = __esm(() => {
35693
- init_lib();
35798
+ init_esm();
35694
35799
  Fee$inboundSchema = objectType({
35695
35800
  name: stringType(),
35696
35801
  value: stringType()
@@ -35708,7 +35813,7 @@ var init_fee = __esm(() => {
35708
35813
  // src/models/components/forbiddenerror.ts
35709
35814
  var ForbiddenErrorCode, ForbiddenErrorTitle, ForbiddenErrorStatus, ForbiddenErrorDetail, ForbiddenErrorCode$inboundSchema, ForbiddenErrorCode$outboundSchema, ForbiddenErrorCode$, ForbiddenErrorTitle$inboundSchema, ForbiddenErrorTitle$outboundSchema, ForbiddenErrorTitle$, ForbiddenErrorStatus$inboundSchema, ForbiddenErrorStatus$outboundSchema, ForbiddenErrorStatus$, ForbiddenErrorDetail$inboundSchema, ForbiddenErrorDetail$outboundSchema, ForbiddenErrorDetail$, ForbiddenError$inboundSchema, ForbiddenError$outboundSchema, ForbiddenError$;
35710
35815
  var init_forbiddenerror = __esm(() => {
35711
- init_lib();
35816
+ init_esm();
35712
35817
  init_apierrorlinks();
35713
35818
  init_errorsource();
35714
35819
  ForbiddenErrorCode = {
@@ -35774,7 +35879,7 @@ var init_forbiddenerror = __esm(() => {
35774
35879
  // src/models/components/internalservererror.ts
35775
35880
  var InternalServerErrorCode, InternalServerErrorTitle, InternalServerErrorStatus, InternalServerErrorDetail, InternalServerErrorCode$inboundSchema, InternalServerErrorCode$outboundSchema, InternalServerErrorCode$, InternalServerErrorTitle$inboundSchema, InternalServerErrorTitle$outboundSchema, InternalServerErrorTitle$, InternalServerErrorStatus$inboundSchema, InternalServerErrorStatus$outboundSchema, InternalServerErrorStatus$, InternalServerErrorDetail$inboundSchema, InternalServerErrorDetail$outboundSchema, InternalServerErrorDetail$, InternalServerError$inboundSchema, InternalServerError$outboundSchema, InternalServerError$;
35776
35881
  var init_internalservererror = __esm(() => {
35777
- init_lib();
35882
+ init_esm();
35778
35883
  init_apierrorlinks();
35779
35884
  init_errorsource();
35780
35885
  InternalServerErrorCode = {
@@ -35840,7 +35945,7 @@ var init_internalservererror = __esm(() => {
35840
35945
  // src/models/components/label.ts
35841
35946
  var Label$inboundSchema, Label$outboundSchema, Label$;
35842
35947
  var init_label = __esm(() => {
35843
- init_lib();
35948
+ init_esm();
35844
35949
  Label$inboundSchema = objectType({
35845
35950
  label: stringType()
35846
35951
  });
@@ -35856,7 +35961,7 @@ var init_label = __esm(() => {
35856
35961
  // src/models/components/lenders.ts
35857
35962
  var Lenders, Lenders$inboundSchema, Lenders$outboundSchema, Lenders$;
35858
35963
  var init_lenders = __esm(() => {
35859
- init_lib();
35964
+ init_esm();
35860
35965
  Lenders = {
35861
35966
  Pepper: "Pepper",
35862
35967
  Lendi: "Lendi",
@@ -35881,7 +35986,7 @@ var init_lenders = __esm(() => {
35881
35986
  // src/models/components/notfounderror.ts
35882
35987
  var NotFoundErrorCode, NotFoundErrorTitle, NotFoundErrorStatus, NotFoundErrorDetail, NotFoundErrorCode$inboundSchema, NotFoundErrorCode$outboundSchema, NotFoundErrorCode$, NotFoundErrorTitle$inboundSchema, NotFoundErrorTitle$outboundSchema, NotFoundErrorTitle$, NotFoundErrorStatus$inboundSchema, NotFoundErrorStatus$outboundSchema, NotFoundErrorStatus$, NotFoundErrorDetail$inboundSchema, NotFoundErrorDetail$outboundSchema, NotFoundErrorDetail$, NotFoundError$inboundSchema, NotFoundError$outboundSchema, NotFoundError$;
35883
35988
  var init_notfounderror = __esm(() => {
35884
- init_lib();
35989
+ init_esm();
35885
35990
  init_apierrorlinks();
35886
35991
  init_errorsource();
35887
35992
  NotFoundErrorCode = {
@@ -35947,7 +36052,7 @@ var init_notfounderror = __esm(() => {
35947
36052
  // src/models/components/pepperconsumerasset.ts
35948
36053
  var PepperConsumerAsset$inboundSchema, PepperConsumerAsset$outboundSchema, PepperConsumerAsset$;
35949
36054
  var init_pepperconsumerasset = __esm(() => {
35950
- init_lib();
36055
+ init_esm();
35951
36056
  init_label();
35952
36057
  PepperConsumerAsset$inboundSchema = objectType({
35953
36058
  ageOfAsset: stringType().optional(),
@@ -36008,7 +36113,7 @@ var init_pepperconsumerasset = __esm(() => {
36008
36113
  // src/models/components/pepperconsumercustomerprofile.ts
36009
36114
  var PepperConsumerCustomerProfile$inboundSchema, PepperConsumerCustomerProfile$outboundSchema, PepperConsumerCustomerProfile$;
36010
36115
  var init_pepperconsumercustomerprofile = __esm(() => {
36011
- init_lib();
36116
+ init_esm();
36012
36117
  PepperConsumerCustomerProfile$inboundSchema = objectType({
36013
36118
  maritalStatus: stringType().optional(),
36014
36119
  numberOfDependants: numberType().int().optional(),
@@ -36034,7 +36139,7 @@ var init_pepperconsumercustomerprofile = __esm(() => {
36034
36139
  // src/models/components/pepperconsumerincome.ts
36035
36140
  var PepperConsumerIncome$inboundSchema, PepperConsumerIncome$outboundSchema, PepperConsumerIncome$;
36036
36141
  var init_pepperconsumerincome = __esm(() => {
36037
- init_lib();
36142
+ init_esm();
36038
36143
  init_primitives();
36039
36144
  PepperConsumerIncome$inboundSchema = objectType({
36040
36145
  _id: stringType().optional(),
@@ -36065,7 +36170,7 @@ var init_pepperconsumerincome = __esm(() => {
36065
36170
  // src/models/components/pepperconsumerliability.ts
36066
36171
  var PepperConsumerLiability$inboundSchema, PepperConsumerLiability$outboundSchema, PepperConsumerLiability$;
36067
36172
  var init_pepperconsumerliability = __esm(() => {
36068
- init_lib();
36173
+ init_esm();
36069
36174
  init_primitives();
36070
36175
  PepperConsumerLiability$inboundSchema = objectType({
36071
36176
  _id: stringType().optional(),
@@ -36104,7 +36209,7 @@ var init_pepperconsumerliability = __esm(() => {
36104
36209
  // src/models/components/phonenumber.ts
36105
36210
  var PhoneNumber$inboundSchema, PhoneNumber$outboundSchema, PhoneNumber$;
36106
36211
  var init_phonenumber = __esm(() => {
36107
- init_lib();
36212
+ init_esm();
36108
36213
  PhoneNumber$inboundSchema = objectType({
36109
36214
  status: stringType(),
36110
36215
  number: stringType()
@@ -36122,7 +36227,7 @@ var init_phonenumber = __esm(() => {
36122
36227
  // src/models/components/pepperconsumercustomer.ts
36123
36228
  var CreditProfile$inboundSchema, CreditProfile$outboundSchema, CreditProfile$, PepperConsumerCustomer$inboundSchema, PepperConsumerCustomer$outboundSchema, PepperConsumerCustomer$;
36124
36229
  var init_pepperconsumercustomer = __esm(() => {
36125
- init_lib();
36230
+ init_esm();
36126
36231
  init_primitives();
36127
36232
  init_address();
36128
36233
  init_applicantasset();
@@ -36213,7 +36318,7 @@ var init_pepperconsumercustomer = __esm(() => {
36213
36318
  // src/models/components/pepperconsumerentity.ts
36214
36319
  var PepperConsumerEntity$inboundSchema, PepperConsumerEntity$outboundSchema, PepperConsumerEntity$;
36215
36320
  var init_pepperconsumerentity = __esm(() => {
36216
- init_lib();
36321
+ init_esm();
36217
36322
  init_primitives();
36218
36323
  init_address();
36219
36324
  PepperConsumerEntity$inboundSchema = objectType({
@@ -36269,7 +36374,7 @@ var init_pepperconsumerentity = __esm(() => {
36269
36374
  // src/models/components/pepperconsumerloandetails.ts
36270
36375
  var PepperConsumerLoanDetails$inboundSchema, PepperConsumerLoanDetails$outboundSchema, PepperConsumerLoanDetails$;
36271
36376
  var init_pepperconsumerloandetails = __esm(() => {
36272
- init_lib();
36377
+ init_esm();
36273
36378
  init_fee();
36274
36379
  init_label();
36275
36380
  PepperConsumerLoanDetails$inboundSchema = objectType({
@@ -36349,7 +36454,7 @@ var init_pepperconsumerloandetails = __esm(() => {
36349
36454
  // src/models/components/pepperlendercredentials.ts
36350
36455
  var PepperLenderCredentials$inboundSchema, PepperLenderCredentials$outboundSchema, PepperLenderCredentials$;
36351
36456
  var init_pepperlendercredentials = __esm(() => {
36352
- init_lib();
36457
+ init_esm();
36353
36458
  init_primitives();
36354
36459
  PepperLenderCredentials$inboundSchema = objectType({
36355
36460
  PEPPER_MERCHANT_ID: stringType(),
@@ -36390,7 +36495,7 @@ var init_pepperlendercredentials = __esm(() => {
36390
36495
  // src/models/components/pepperconsumerrequest.ts
36391
36496
  var User$inboundSchema, User$outboundSchema, User$, PepperConsumerRequest$inboundSchema, PepperConsumerRequest$outboundSchema, PepperConsumerRequest$;
36392
36497
  var init_pepperconsumerrequest = __esm(() => {
36393
- init_lib();
36498
+ init_esm();
36394
36499
  init_primitives();
36395
36500
  init_email();
36396
36501
  init_pepperconsumerasset();
@@ -36447,7 +36552,7 @@ var init_pepperconsumerrequest = __esm(() => {
36447
36552
  // src/models/components/peppersuccessresource.ts
36448
36553
  var Application$inboundSchema, Application$outboundSchema, Application$, PepperSuccessResource$inboundSchema, PepperSuccessResource$outboundSchema, PepperSuccessResource$;
36449
36554
  var init_peppersuccessresource = __esm(() => {
36450
- init_lib();
36555
+ init_esm();
36451
36556
  Application$inboundSchema = objectType({
36452
36557
  applicationNo: stringType()
36453
36558
  });
@@ -36475,7 +36580,7 @@ var init_peppersuccessresource = __esm(() => {
36475
36580
  // src/models/components/unauthorizederror.ts
36476
36581
  var UnauthorizedErrorCode, Title, Status, Detail, UnauthorizedErrorCode$inboundSchema, UnauthorizedErrorCode$outboundSchema, UnauthorizedErrorCode$, Title$inboundSchema, Title$outboundSchema, Title$, Status$inboundSchema, Status$outboundSchema, Status$, Detail$inboundSchema, Detail$outboundSchema, Detail$, UnauthorizedError$inboundSchema, UnauthorizedError$outboundSchema, UnauthorizedError$;
36477
36582
  var init_unauthorizederror = __esm(() => {
36478
- init_lib();
36583
+ init_esm();
36479
36584
  init_apierrorlinks();
36480
36585
  init_errorsource();
36481
36586
  UnauthorizedErrorCode = {
@@ -36571,67 +36676,68 @@ var init_components = __esm(() => {
36571
36676
  // src/models/errors/createpepperconsumer.ts
36572
36677
  var CreatePepperConsumerConsumersResponse500ResponseBody, CreatePepperConsumerConsumersResponse404ResponseBody, CreatePepperConsumerConsumersResponseResponseBody, CreatePepperConsumerConsumersResponseBody, CreatePepperConsumerResponseBody, CreatePepperConsumerConsumersResponse500ResponseBody$inboundSchema, CreatePepperConsumerConsumersResponse500ResponseBody$outboundSchema, CreatePepperConsumerConsumersResponse500ResponseBody$, CreatePepperConsumerConsumersResponse404ResponseBody$inboundSchema, CreatePepperConsumerConsumersResponse404ResponseBody$outboundSchema, CreatePepperConsumerConsumersResponse404ResponseBody$, CreatePepperConsumerConsumersResponseResponseBody$inboundSchema, CreatePepperConsumerConsumersResponseResponseBody$outboundSchema, CreatePepperConsumerConsumersResponseResponseBody$, CreatePepperConsumerConsumersResponseBody$inboundSchema, CreatePepperConsumerConsumersResponseBody$outboundSchema, CreatePepperConsumerConsumersResponseBody$, CreatePepperConsumerResponseBody$inboundSchema, CreatePepperConsumerResponseBody$outboundSchema, CreatePepperConsumerResponseBody$;
36573
36678
  var init_createpepperconsumer = __esm(() => {
36574
- init_lib();
36679
+ init_esm();
36575
36680
  init_components();
36576
- CreatePepperConsumerConsumersResponse500ResponseBody = class CreatePepperConsumerConsumersResponse500ResponseBody extends Error {
36681
+ init_financeablelenderserror();
36682
+ CreatePepperConsumerConsumersResponse500ResponseBody = class CreatePepperConsumerConsumersResponse500ResponseBody extends FinanceableLendersError {
36577
36683
  lender;
36578
36684
  errors;
36579
36685
  data$;
36580
- constructor(err) {
36686
+ constructor(err, httpMeta) {
36581
36687
  const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`;
36582
- super(message);
36688
+ super(message, httpMeta);
36583
36689
  this.data$ = err;
36584
36690
  this.lender = err.lender;
36585
36691
  this.errors = err.errors;
36586
36692
  this.name = "CreatePepperConsumerConsumersResponse500ResponseBody";
36587
36693
  }
36588
36694
  };
36589
- CreatePepperConsumerConsumersResponse404ResponseBody = class CreatePepperConsumerConsumersResponse404ResponseBody extends Error {
36695
+ CreatePepperConsumerConsumersResponse404ResponseBody = class CreatePepperConsumerConsumersResponse404ResponseBody extends FinanceableLendersError {
36590
36696
  lender;
36591
36697
  errors;
36592
36698
  data$;
36593
- constructor(err) {
36699
+ constructor(err, httpMeta) {
36594
36700
  const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`;
36595
- super(message);
36701
+ super(message, httpMeta);
36596
36702
  this.data$ = err;
36597
36703
  this.lender = err.lender;
36598
36704
  this.errors = err.errors;
36599
36705
  this.name = "CreatePepperConsumerConsumersResponse404ResponseBody";
36600
36706
  }
36601
36707
  };
36602
- CreatePepperConsumerConsumersResponseResponseBody = class CreatePepperConsumerConsumersResponseResponseBody extends Error {
36708
+ CreatePepperConsumerConsumersResponseResponseBody = class CreatePepperConsumerConsumersResponseResponseBody extends FinanceableLendersError {
36603
36709
  lender;
36604
36710
  errors;
36605
36711
  data$;
36606
- constructor(err) {
36712
+ constructor(err, httpMeta) {
36607
36713
  const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`;
36608
- super(message);
36714
+ super(message, httpMeta);
36609
36715
  this.data$ = err;
36610
36716
  this.lender = err.lender;
36611
36717
  this.errors = err.errors;
36612
36718
  this.name = "CreatePepperConsumerConsumersResponseResponseBody";
36613
36719
  }
36614
36720
  };
36615
- CreatePepperConsumerConsumersResponseBody = class CreatePepperConsumerConsumersResponseBody extends Error {
36721
+ CreatePepperConsumerConsumersResponseBody = class CreatePepperConsumerConsumersResponseBody extends FinanceableLendersError {
36616
36722
  lender;
36617
36723
  errors;
36618
36724
  data$;
36619
- constructor(err) {
36725
+ constructor(err, httpMeta) {
36620
36726
  const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`;
36621
- super(message);
36727
+ super(message, httpMeta);
36622
36728
  this.data$ = err;
36623
36729
  this.lender = err.lender;
36624
36730
  this.errors = err.errors;
36625
36731
  this.name = "CreatePepperConsumerConsumersResponseBody";
36626
36732
  }
36627
36733
  };
36628
- CreatePepperConsumerResponseBody = class CreatePepperConsumerResponseBody extends Error {
36734
+ CreatePepperConsumerResponseBody = class CreatePepperConsumerResponseBody extends FinanceableLendersError {
36629
36735
  lender;
36630
36736
  errors;
36631
36737
  data$;
36632
- constructor(err) {
36738
+ constructor(err, httpMeta) {
36633
36739
  const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`;
36634
- super(message);
36740
+ super(message, httpMeta);
36635
36741
  this.data$ = err;
36636
36742
  this.lender = err.lender;
36637
36743
  this.errors = err.errors;
@@ -36640,9 +36746,16 @@ var init_createpepperconsumer = __esm(() => {
36640
36746
  };
36641
36747
  CreatePepperConsumerConsumersResponse500ResponseBody$inboundSchema = objectType({
36642
36748
  lender: Lenders$inboundSchema,
36643
- errors: arrayType(InternalServerError$inboundSchema)
36749
+ errors: arrayType(InternalServerError$inboundSchema),
36750
+ request$: instanceOfType(Request),
36751
+ response$: instanceOfType(Response),
36752
+ body$: stringType()
36644
36753
  }).transform((v2) => {
36645
- return new CreatePepperConsumerConsumersResponse500ResponseBody(v2);
36754
+ return new CreatePepperConsumerConsumersResponse500ResponseBody(v2, {
36755
+ request: v2.request$,
36756
+ response: v2.response$,
36757
+ body: v2.body$
36758
+ });
36646
36759
  });
36647
36760
  CreatePepperConsumerConsumersResponse500ResponseBody$outboundSchema = instanceOfType(CreatePepperConsumerConsumersResponse500ResponseBody).transform((v2) => v2.data$).pipe(objectType({
36648
36761
  lender: Lenders$outboundSchema,
@@ -36654,9 +36767,16 @@ var init_createpepperconsumer = __esm(() => {
36654
36767
  })(CreatePepperConsumerConsumersResponse500ResponseBody$ ||= {});
36655
36768
  CreatePepperConsumerConsumersResponse404ResponseBody$inboundSchema = objectType({
36656
36769
  lender: Lenders$inboundSchema,
36657
- errors: arrayType(NotFoundError$inboundSchema)
36770
+ errors: arrayType(NotFoundError$inboundSchema),
36771
+ request$: instanceOfType(Request),
36772
+ response$: instanceOfType(Response),
36773
+ body$: stringType()
36658
36774
  }).transform((v2) => {
36659
- return new CreatePepperConsumerConsumersResponse404ResponseBody(v2);
36775
+ return new CreatePepperConsumerConsumersResponse404ResponseBody(v2, {
36776
+ request: v2.request$,
36777
+ response: v2.response$,
36778
+ body: v2.body$
36779
+ });
36660
36780
  });
36661
36781
  CreatePepperConsumerConsumersResponse404ResponseBody$outboundSchema = instanceOfType(CreatePepperConsumerConsumersResponse404ResponseBody).transform((v2) => v2.data$).pipe(objectType({
36662
36782
  lender: Lenders$outboundSchema,
@@ -36668,9 +36788,16 @@ var init_createpepperconsumer = __esm(() => {
36668
36788
  })(CreatePepperConsumerConsumersResponse404ResponseBody$ ||= {});
36669
36789
  CreatePepperConsumerConsumersResponseResponseBody$inboundSchema = objectType({
36670
36790
  lender: Lenders$inboundSchema,
36671
- errors: arrayType(ForbiddenError$inboundSchema)
36791
+ errors: arrayType(ForbiddenError$inboundSchema),
36792
+ request$: instanceOfType(Request),
36793
+ response$: instanceOfType(Response),
36794
+ body$: stringType()
36672
36795
  }).transform((v2) => {
36673
- return new CreatePepperConsumerConsumersResponseResponseBody(v2);
36796
+ return new CreatePepperConsumerConsumersResponseResponseBody(v2, {
36797
+ request: v2.request$,
36798
+ response: v2.response$,
36799
+ body: v2.body$
36800
+ });
36674
36801
  });
36675
36802
  CreatePepperConsumerConsumersResponseResponseBody$outboundSchema = instanceOfType(CreatePepperConsumerConsumersResponseResponseBody).transform((v2) => v2.data$).pipe(objectType({
36676
36803
  lender: Lenders$outboundSchema,
@@ -36682,9 +36809,16 @@ var init_createpepperconsumer = __esm(() => {
36682
36809
  })(CreatePepperConsumerConsumersResponseResponseBody$ ||= {});
36683
36810
  CreatePepperConsumerConsumersResponseBody$inboundSchema = objectType({
36684
36811
  lender: Lenders$inboundSchema,
36685
- errors: arrayType(UnauthorizedError$inboundSchema)
36812
+ errors: arrayType(UnauthorizedError$inboundSchema),
36813
+ request$: instanceOfType(Request),
36814
+ response$: instanceOfType(Response),
36815
+ body$: stringType()
36686
36816
  }).transform((v2) => {
36687
- return new CreatePepperConsumerConsumersResponseBody(v2);
36817
+ return new CreatePepperConsumerConsumersResponseBody(v2, {
36818
+ request: v2.request$,
36819
+ response: v2.response$,
36820
+ body: v2.body$
36821
+ });
36688
36822
  });
36689
36823
  CreatePepperConsumerConsumersResponseBody$outboundSchema = instanceOfType(CreatePepperConsumerConsumersResponseBody).transform((v2) => v2.data$).pipe(objectType({
36690
36824
  lender: Lenders$outboundSchema,
@@ -36696,9 +36830,16 @@ var init_createpepperconsumer = __esm(() => {
36696
36830
  })(CreatePepperConsumerConsumersResponseBody$ ||= {});
36697
36831
  CreatePepperConsumerResponseBody$inboundSchema = objectType({
36698
36832
  lender: Lenders$inboundSchema,
36699
- errors: arrayType(arrayType(ApiError$inboundSchema))
36833
+ errors: arrayType(arrayType(ApiError$inboundSchema)),
36834
+ request$: instanceOfType(Request),
36835
+ response$: instanceOfType(Response),
36836
+ body$: stringType()
36700
36837
  }).transform((v2) => {
36701
- return new CreatePepperConsumerResponseBody(v2);
36838
+ return new CreatePepperConsumerResponseBody(v2, {
36839
+ request: v2.request$,
36840
+ response: v2.response$,
36841
+ body: v2.body$
36842
+ });
36702
36843
  });
36703
36844
  CreatePepperConsumerResponseBody$outboundSchema = instanceOfType(CreatePepperConsumerResponseBody).transform((v2) => v2.data$).pipe(objectType({
36704
36845
  lender: Lenders$outboundSchema,
@@ -36711,17 +36852,18 @@ var init_createpepperconsumer = __esm(() => {
36711
36852
  });
36712
36853
 
36713
36854
  // src/models/errors/index.ts
36714
- var init_errors = __esm(() => {
36855
+ var init_errors2 = __esm(() => {
36715
36856
  init_apierror();
36716
36857
  init_createpepperconsumer();
36717
36858
  init_httpclienterrors();
36859
+ init_responsevalidationerror();
36718
36860
  init_sdkvalidationerror();
36719
36861
  });
36720
36862
 
36721
36863
  // src/models/operations/createpepperconsumer.ts
36722
36864
  var Lender, Lender$inboundSchema, Lender$outboundSchema, Lender$, CreatePepperConsumerResponseBody$inboundSchema2, CreatePepperConsumerResponseBody$outboundSchema2, CreatePepperConsumerResponseBody$2;
36723
36865
  var init_createpepperconsumer2 = __esm(() => {
36724
- init_lib();
36866
+ init_esm();
36725
36867
  init_components();
36726
36868
  Lender = {
36727
36869
  Pepper: "Pepper"
@@ -36796,6 +36938,7 @@ async function $do(client, request, options) {
36796
36938
  Accept: "application/json"
36797
36939
  }));
36798
36940
  const context = {
36941
+ options: client._options,
36799
36942
  baseURL: options?.serverURL ?? client._baseURL ?? "",
36800
36943
  operationID: "createPepperConsumer",
36801
36944
  oAuth2Scopes: [],
@@ -36810,6 +36953,7 @@ async function $do(client, request, options) {
36810
36953
  path,
36811
36954
  headers,
36812
36955
  body,
36956
+ userAgent: client._options.userAgent,
36813
36957
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
36814
36958
  }, options);
36815
36959
  if (!requestRes.ok) {
@@ -36829,7 +36973,7 @@ async function $do(client, request, options) {
36829
36973
  const responseFields = {
36830
36974
  HttpMeta: { Response: response, Request: req }
36831
36975
  };
36832
- const [result] = await match(json(201, CreatePepperConsumerResponseBody$inboundSchema2), jsonErr(400, CreatePepperConsumerResponseBody$inboundSchema), jsonErr(401, CreatePepperConsumerConsumersResponseBody$inboundSchema), jsonErr(403, CreatePepperConsumerConsumersResponseResponseBody$inboundSchema), jsonErr(404, CreatePepperConsumerConsumersResponse404ResponseBody$inboundSchema), jsonErr(500, CreatePepperConsumerConsumersResponse500ResponseBody$inboundSchema), fail("4XX"), fail("5XX"))(response, { extraFields: responseFields });
36976
+ const [result] = await match(json(201, CreatePepperConsumerResponseBody$inboundSchema2), jsonErr(400, CreatePepperConsumerResponseBody$inboundSchema), jsonErr(401, CreatePepperConsumerConsumersResponseBody$inboundSchema), jsonErr(403, CreatePepperConsumerConsumersResponseResponseBody$inboundSchema), jsonErr(404, CreatePepperConsumerConsumersResponse404ResponseBody$inboundSchema), jsonErr(500, CreatePepperConsumerConsumersResponse500ResponseBody$inboundSchema), fail("4XX"), fail("5XX"))(response, req, { extraFields: responseFields });
36833
36977
  if (!result.ok) {
36834
36978
  return [result, { status: "complete", request: req, response }];
36835
36979
  }
@@ -36842,7 +36986,7 @@ var init_consumersCreatePepper = __esm(() => {
36842
36986
  init_schemas();
36843
36987
  init_url();
36844
36988
  init_components();
36845
- init_errors();
36989
+ init_errors2();
36846
36990
  init_operations();
36847
36991
  init_async();
36848
36992
  });
@@ -36878,7 +37022,7 @@ var init_consumersCreatePepper2 = __esm(() => {
36878
37022
  function createMCPServer(deps) {
36879
37023
  const server = new McpServer({
36880
37024
  name: "FinanceableLenders",
36881
- version: "0.0.2"
37025
+ version: "0.1.0"
36882
37026
  });
36883
37027
  const client = new FinanceableLendersCore({
36884
37028
  serverURL: deps.serverURL,
@@ -37980,7 +38124,7 @@ function buildContext(process2) {
37980
38124
  }
37981
38125
 
37982
38126
  // src/mcp-server/cli/start/command.ts
37983
- init_lib();
38127
+ init_esm();
37984
38128
  init_console_logger();
37985
38129
 
37986
38130
  // src/mcp-server/scopes.ts
@@ -38083,7 +38227,7 @@ var routes = rn({
38083
38227
  var app = Ve(routes, {
38084
38228
  name: "mcp",
38085
38229
  versionInfo: {
38086
- currentVersion: "0.0.2"
38230
+ currentVersion: "0.1.0"
38087
38231
  }
38088
38232
  });
38089
38233
  _t(app, process3.argv.slice(2), buildContext(process3));
@@ -38091,5 +38235,5 @@ export {
38091
38235
  app
38092
38236
  };
38093
38237
 
38094
- //# debugId=8E5620EF38F489CF64756E2164756E21
38238
+ //# debugId=EE9408EA7E12B73464756E2164756E21
38095
38239
  //# sourceMappingURL=mcp-server.js.map