@flexprice/mcp-server 2.1.30 → 2.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/mcp-server.js +899 -563
- package/bin/mcp-server.js.map +64 -56
- package/bun.lock +20 -20
- package/esm/funcs/invoicesCreateInvoice.d.ts +1 -0
- package/esm/funcs/invoicesCreateInvoice.d.ts.map +1 -1
- package/esm/funcs/invoicesCreateInvoice.js +1 -0
- package/esm/funcs/invoicesCreateInvoice.js.map +1 -1
- package/esm/funcs/subscriptionsExecuteSubscriptionModify.d.ts +1 -1
- package/esm/funcs/subscriptionsExecuteSubscriptionModify.js +1 -1
- package/esm/funcs/subscriptionsPreviewSubscriptionModify.d.ts +1 -1
- package/esm/funcs/subscriptionsPreviewSubscriptionModify.js +1 -1
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/mcp-server/mcp-server.js +1 -1
- package/esm/mcp-server/server.js +1 -1
- package/esm/mcp-server/tools/invoicesCreateInvoice.d.ts.map +1 -1
- package/esm/mcp-server/tools/invoicesCreateInvoice.js +2 -1
- package/esm/mcp-server/tools/invoicesCreateInvoice.js.map +1 -1
- package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionModify.js +1 -1
- package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionModify.js.map +1 -1
- package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.js +1 -1
- package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.js.map +1 -1
- package/esm/models/addaddonrequest.d.ts +2 -0
- package/esm/models/addaddonrequest.d.ts.map +1 -1
- package/esm/models/addaddonrequest.js +2 -0
- package/esm/models/addaddonrequest.js.map +1 -1
- package/esm/models/addaddontosubscriptionrequest.d.ts +2 -0
- package/esm/models/addaddontosubscriptionrequest.d.ts.map +1 -1
- package/esm/models/addaddontosubscriptionrequest.js +2 -0
- package/esm/models/addaddontosubscriptionrequest.js.map +1 -1
- package/esm/models/checkoutaction.d.ts +2 -0
- package/esm/models/checkoutaction.d.ts.map +1 -1
- package/esm/models/checkoutaction.js +2 -0
- package/esm/models/checkoutaction.js.map +1 -1
- package/esm/models/checkoutparams.d.ts +2 -0
- package/esm/models/checkoutparams.d.ts.map +1 -1
- package/esm/models/checkoutparams.js +2 -0
- package/esm/models/checkoutparams.js.map +1 -1
- package/esm/models/checkoutsessionresponse.d.ts +2 -0
- package/esm/models/checkoutsessionresponse.d.ts.map +1 -1
- package/esm/models/checkoutsessionresponse.js +2 -0
- package/esm/models/checkoutsessionresponse.js.map +1 -1
- package/esm/models/createinvoicerequest.d.ts +2 -0
- package/esm/models/createinvoicerequest.d.ts.map +1 -1
- package/esm/models/createinvoicerequest.js +2 -0
- package/esm/models/createinvoicerequest.js.map +1 -1
- package/esm/models/createsubscriptionrequest.d.ts +2 -0
- package/esm/models/createsubscriptionrequest.d.ts.map +1 -1
- package/esm/models/createsubscriptionrequest.js +2 -0
- package/esm/models/createsubscriptionrequest.js.map +1 -1
- package/esm/models/entitycreationconflictpolicies.d.ts +7 -0
- package/esm/models/entitycreationconflictpolicies.d.ts.map +1 -0
- package/esm/models/entitycreationconflictpolicies.js +9 -0
- package/esm/models/entitycreationconflictpolicies.js.map +1 -0
- package/esm/models/entitycreationoptions.d.ts +7 -0
- package/esm/models/entitycreationoptions.d.ts.map +1 -0
- package/esm/models/entitycreationoptions.js +10 -0
- package/esm/models/entitycreationoptions.js.map +1 -0
- package/esm/models/entitycreationresult.d.ts +8 -0
- package/esm/models/entitycreationresult.d.ts.map +1 -0
- package/esm/models/entitycreationresult.js +11 -0
- package/esm/models/entitycreationresult.js.map +1 -0
- package/esm/models/entitycreationstatus.d.ts +14 -0
- package/esm/models/entitycreationstatus.d.ts.map +1 -0
- package/esm/models/entitycreationstatus.js +15 -0
- package/esm/models/entitycreationstatus.js.map +1 -0
- package/esm/models/event.d.ts +1 -0
- package/esm/models/event.d.ts.map +1 -1
- package/esm/models/event.js +1 -0
- package/esm/models/event.js.map +1 -1
- package/esm/models/executesubscriptionmodifyrequest.d.ts +2 -0
- package/esm/models/executesubscriptionmodifyrequest.d.ts.map +1 -1
- package/esm/models/executesubscriptionmodifyrequest.js +2 -0
- package/esm/models/executesubscriptionmodifyrequest.js.map +1 -1
- package/esm/models/geteventbyidresponse.d.ts +1 -0
- package/esm/models/geteventbyidresponse.d.ts.map +1 -1
- package/esm/models/geteventbyidresponse.js +1 -0
- package/esm/models/geteventbyidresponse.js.map +1 -1
- package/esm/models/invoiceresponse.d.ts +4 -0
- package/esm/models/invoiceresponse.d.ts.map +1 -1
- package/esm/models/invoiceresponse.js +4 -0
- package/esm/models/invoiceresponse.js.map +1 -1
- package/esm/models/invoicesourcetype.d.ts +10 -0
- package/esm/models/invoicesourcetype.d.ts.map +1 -0
- package/esm/models/invoicesourcetype.js +11 -0
- package/esm/models/invoicesourcetype.js.map +1 -0
- package/esm/models/lineitemgrouping.d.ts +12 -0
- package/esm/models/lineitemgrouping.d.ts.map +1 -0
- package/esm/models/lineitemgrouping.js +13 -0
- package/esm/models/lineitemgrouping.js.map +1 -0
- package/esm/models/onexistingentitypolicy.d.ts +12 -0
- package/esm/models/onexistingentitypolicy.d.ts.map +1 -0
- package/esm/models/onexistingentitypolicy.js +13 -0
- package/esm/models/onexistingentitypolicy.js.map +1 -0
- package/esm/models/removeaddonrequest.d.ts +2 -0
- package/esm/models/removeaddonrequest.d.ts.map +1 -1
- package/esm/models/removeaddonrequest.js +2 -0
- package/esm/models/removeaddonrequest.js.map +1 -1
- package/esm/models/submodifybulkaddonparams.d.ts +9 -0
- package/esm/models/submodifybulkaddonparams.d.ts.map +1 -0
- package/esm/models/submodifybulkaddonparams.js +11 -0
- package/esm/models/submodifybulkaddonparams.js.map +1 -0
- package/esm/models/subscriptionchangeentitytype.d.ts +2 -2
- package/esm/models/subscriptionchangeentitytype.js +2 -2
- package/esm/models/subscriptionchangeentitytype.js.map +1 -1
- package/esm/models/subscriptionresponse.d.ts +2 -0
- package/esm/models/subscriptionresponse.d.ts.map +1 -1
- package/esm/models/subscriptionresponse.js +2 -0
- package/esm/models/subscriptionresponse.js.map +1 -1
- package/esm/models/subscriptionresponsev2.d.ts +2 -0
- package/esm/models/subscriptionresponsev2.d.ts.map +1 -1
- package/esm/models/subscriptionresponsev2.js +2 -0
- package/esm/models/subscriptionresponsev2.js.map +1 -1
- package/esm/models/subscriptionscheduleresponse.d.ts +6 -12
- package/esm/models/subscriptionscheduleresponse.d.ts.map +1 -1
- package/esm/models/subscriptionscheduleresponse.js +2 -5
- package/esm/models/subscriptionscheduleresponse.js.map +1 -1
- package/esm/models/usageanalyticitem.d.ts +1 -0
- package/esm/models/usageanalyticitem.d.ts.map +1 -1
- package/esm/models/usageanalyticitem.js +1 -0
- package/esm/models/usageanalyticitem.js.map +1 -1
- package/esm/tool-names.js +3 -3
- package/esm/tool-names.js.map +1 -1
- package/esm/tsconfig.tsbuildinfo +1 -1
- package/manifest.json +4 -4
- package/package.json +1 -1
- package/src/funcs/invoicesCreateInvoice.ts +1 -0
- package/src/funcs/subscriptionsExecuteSubscriptionModify.ts +1 -1
- package/src/funcs/subscriptionsPreviewSubscriptionModify.ts +1 -1
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/mcp-server/tools/invoicesCreateInvoice.ts +2 -1
- package/src/mcp-server/tools/subscriptionsExecuteSubscriptionModify.ts +1 -1
- package/src/mcp-server/tools/subscriptionsPreviewSubscriptionModify.ts +1 -1
- package/src/models/addaddonrequest.ts +3 -0
- package/src/models/addaddontosubscriptionrequest.ts +3 -0
- package/src/models/checkoutaction.ts +2 -0
- package/src/models/checkoutparams.ts +6 -0
- package/src/models/checkoutsessionresponse.ts +6 -0
- package/src/models/createinvoicerequest.ts +3 -0
- package/src/models/createsubscriptionrequest.ts +6 -0
- package/src/models/entitycreationconflictpolicies.ts +19 -0
- package/src/models/entitycreationoptions.ts +21 -0
- package/src/models/entitycreationresult.ts +20 -0
- package/src/models/entitycreationstatus.ts +19 -0
- package/src/models/event.ts +2 -0
- package/src/models/executesubscriptionmodifyrequest.ts +6 -0
- package/src/models/geteventbyidresponse.ts +2 -0
- package/src/models/invoiceresponse.ts +12 -0
- package/src/models/invoicesourcetype.ts +15 -0
- package/src/models/lineitemgrouping.ts +17 -0
- package/src/models/onexistingentitypolicy.ts +17 -0
- package/src/models/removeaddonrequest.ts +3 -0
- package/src/models/submodifybulkaddonparams.ts +25 -0
- package/src/models/subscriptionchangeentitytype.ts +2 -2
- package/src/models/subscriptionresponse.ts +6 -0
- package/src/models/subscriptionresponsev2.ts +6 -0
- package/src/models/subscriptionscheduleresponse.ts +4 -23
- package/src/models/usageanalyticitem.ts +4 -0
- package/src/tool-names.ts +3 -3
package/bin/mcp-server.js
CHANGED
|
@@ -60,18 +60,23 @@ function jsonStringifyReplacer(_, value) {
|
|
|
60
60
|
return value.toString();
|
|
61
61
|
return value;
|
|
62
62
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
63
|
+
|
|
64
|
+
class Cached {
|
|
65
|
+
constructor(getter) {
|
|
66
|
+
this._getter = getter;
|
|
67
|
+
this._value = undefined;
|
|
68
|
+
}
|
|
69
|
+
get value() {
|
|
70
|
+
const getter = this._getter;
|
|
71
|
+
if (getter !== undefined) {
|
|
72
|
+
this._value = getter();
|
|
73
|
+
this._getter = undefined;
|
|
73
74
|
}
|
|
74
|
-
|
|
75
|
+
return this._value;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function cached(getter) {
|
|
79
|
+
return new Cached(getter);
|
|
75
80
|
}
|
|
76
81
|
function nullish(input) {
|
|
77
82
|
return input === null || input === undefined;
|
|
@@ -118,6 +123,56 @@ function assignProp(target, prop, value) {
|
|
|
118
123
|
configurable: true
|
|
119
124
|
});
|
|
120
125
|
}
|
|
126
|
+
function rawShape(def) {
|
|
127
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
128
|
+
return desc?.get ? desc.get.raw : desc?.value;
|
|
129
|
+
}
|
|
130
|
+
function sourceShape(schema) {
|
|
131
|
+
return rawShape(schema._zod.def) ?? schema._zod.def.shape;
|
|
132
|
+
}
|
|
133
|
+
function deferProp(target, key, getter) {
|
|
134
|
+
Object.defineProperty(target, key, {
|
|
135
|
+
get() {
|
|
136
|
+
const value = getter();
|
|
137
|
+
assignProp(this, key, value);
|
|
138
|
+
return value;
|
|
139
|
+
},
|
|
140
|
+
enumerable: true,
|
|
141
|
+
configurable: true
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
function putProp(target, key, value) {
|
|
145
|
+
if (key in target)
|
|
146
|
+
assignProp(target, key, value);
|
|
147
|
+
else
|
|
148
|
+
target[key] = value;
|
|
149
|
+
}
|
|
150
|
+
function mirrorShape(target, source, keys, wrap) {
|
|
151
|
+
const raw = sourceShape(source);
|
|
152
|
+
for (const key of keys) {
|
|
153
|
+
const desc = Object.getOwnPropertyDescriptor(raw, key);
|
|
154
|
+
if (!desc.enumerable)
|
|
155
|
+
continue;
|
|
156
|
+
if (desc.get) {
|
|
157
|
+
deferProp(target, key, () => {
|
|
158
|
+
const value = source._zod.def.shape[key];
|
|
159
|
+
return wrap ? wrap(value, key) : value;
|
|
160
|
+
});
|
|
161
|
+
} else
|
|
162
|
+
putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
function mirrorProps(target, source) {
|
|
166
|
+
for (const key of Reflect.ownKeys(source)) {
|
|
167
|
+
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
168
|
+
if (!desc.enumerable)
|
|
169
|
+
continue;
|
|
170
|
+
if (desc.get)
|
|
171
|
+
deferProp(target, key, () => source[key]);
|
|
172
|
+
else
|
|
173
|
+
putProp(target, key, desc.value);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
121
176
|
function mergeDefs(...defs) {
|
|
122
177
|
const mergedDescriptors = {};
|
|
123
178
|
for (const def of defs) {
|
|
@@ -206,23 +261,21 @@ function pick(schema, mask) {
|
|
|
206
261
|
if (hasChecks) {
|
|
207
262
|
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
208
263
|
}
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
});
|
|
225
|
-
return clone(schema, def);
|
|
264
|
+
const newShape = {};
|
|
265
|
+
mirrorShape(newShape, schema, maskedKeys(schema, mask));
|
|
266
|
+
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
|
|
267
|
+
}
|
|
268
|
+
function maskedKeys(schema, mask) {
|
|
269
|
+
const raw = sourceShape(schema);
|
|
270
|
+
const keys = [];
|
|
271
|
+
for (const key of Reflect.ownKeys(mask)) {
|
|
272
|
+
if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) {
|
|
273
|
+
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
274
|
+
}
|
|
275
|
+
if (mask[key])
|
|
276
|
+
keys.push(key);
|
|
277
|
+
}
|
|
278
|
+
return keys;
|
|
226
279
|
}
|
|
227
280
|
function omit(schema, mask) {
|
|
228
281
|
const currDef = schema._zod.def;
|
|
@@ -231,23 +284,10 @@ function omit(schema, mask) {
|
|
|
231
284
|
if (hasChecks) {
|
|
232
285
|
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
233
286
|
}
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
|
|
239
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
240
|
-
}
|
|
241
|
-
if (!mask[key])
|
|
242
|
-
continue;
|
|
243
|
-
delete newShape[key];
|
|
244
|
-
}
|
|
245
|
-
assignProp(this, "shape", newShape);
|
|
246
|
-
return newShape;
|
|
247
|
-
},
|
|
248
|
-
checks: []
|
|
249
|
-
});
|
|
250
|
-
return clone(schema, def);
|
|
287
|
+
const omitted = new Set(maskedKeys(schema, mask));
|
|
288
|
+
const newShape = {};
|
|
289
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
|
|
290
|
+
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
|
|
251
291
|
}
|
|
252
292
|
function extend(schema, shape) {
|
|
253
293
|
if (!isPlainObject(shape)) {
|
|
@@ -256,34 +296,26 @@ function extend(schema, shape) {
|
|
|
256
296
|
const checks = schema._zod.def.checks;
|
|
257
297
|
const hasChecks = checks && checks.length > 0;
|
|
258
298
|
if (hasChecks) {
|
|
259
|
-
const existingShape = schema
|
|
299
|
+
const existingShape = sourceShape(schema);
|
|
260
300
|
for (const key of Reflect.ownKeys(shape)) {
|
|
261
301
|
if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {
|
|
262
302
|
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
263
303
|
}
|
|
264
304
|
}
|
|
265
305
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
return clone(schema, def);
|
|
306
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
307
|
+
}
|
|
308
|
+
function extended(schema, shape) {
|
|
309
|
+
const newShape = {};
|
|
310
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
|
|
311
|
+
mirrorProps(newShape, shape);
|
|
312
|
+
return newShape;
|
|
274
313
|
}
|
|
275
314
|
function safeExtend(schema, shape) {
|
|
276
315
|
if (!isPlainObject(shape)) {
|
|
277
316
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
278
317
|
}
|
|
279
|
-
|
|
280
|
-
get shape() {
|
|
281
|
-
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
282
|
-
assignProp(this, "shape", _shape);
|
|
283
|
-
return _shape;
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
return clone(schema, def);
|
|
318
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
287
319
|
}
|
|
288
320
|
function merge(a, b) {
|
|
289
321
|
if (!b?._zod?.def) {
|
|
@@ -292,12 +324,11 @@ function merge(a, b) {
|
|
|
292
324
|
if (a._zod.def.checks?.length) {
|
|
293
325
|
throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
294
326
|
}
|
|
327
|
+
const newShape = {};
|
|
328
|
+
mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
|
|
329
|
+
mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
|
|
295
330
|
const def = mergeDefs(a._zod.def, {
|
|
296
|
-
|
|
297
|
-
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
298
|
-
assignProp(this, "shape", _shape);
|
|
299
|
-
return _shape;
|
|
300
|
-
},
|
|
331
|
+
shape: newShape,
|
|
301
332
|
get catchall() {
|
|
302
333
|
return b._zod.def.catchall;
|
|
303
334
|
},
|
|
@@ -312,67 +343,16 @@ function partial(Class, schema, mask, name = "partial") {
|
|
|
312
343
|
if (hasChecks) {
|
|
313
344
|
throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
|
|
314
345
|
}
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
if (mask) {
|
|
320
|
-
for (const key of Reflect.ownKeys(mask)) {
|
|
321
|
-
if (!Object.prototype.hasOwnProperty.call(oldShape, key)) {
|
|
322
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
323
|
-
}
|
|
324
|
-
if (!mask[key])
|
|
325
|
-
continue;
|
|
326
|
-
shape[key] = Class ? new Class({
|
|
327
|
-
type: "optional",
|
|
328
|
-
innerType: oldShape[key]
|
|
329
|
-
}) : oldShape[key];
|
|
330
|
-
}
|
|
331
|
-
} else {
|
|
332
|
-
for (const key of Reflect.ownKeys(oldShape)) {
|
|
333
|
-
shape[key] = Class ? new Class({
|
|
334
|
-
type: "optional",
|
|
335
|
-
innerType: oldShape[key]
|
|
336
|
-
}) : oldShape[key];
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
assignProp(this, "shape", shape);
|
|
340
|
-
return shape;
|
|
341
|
-
},
|
|
342
|
-
checks: []
|
|
343
|
-
});
|
|
344
|
-
return clone(schema, def);
|
|
346
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
|
|
347
|
+
const newShape = {};
|
|
348
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class && ((value, key) => selected && !selected.has(key) ? value : new Class({ type: "optional", innerType: value })));
|
|
349
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));
|
|
345
350
|
}
|
|
346
351
|
function required(Class, schema, mask) {
|
|
347
|
-
const
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
if (mask) {
|
|
352
|
-
for (const key of Reflect.ownKeys(mask)) {
|
|
353
|
-
if (!Object.prototype.hasOwnProperty.call(shape, key)) {
|
|
354
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
355
|
-
}
|
|
356
|
-
if (!mask[key])
|
|
357
|
-
continue;
|
|
358
|
-
shape[key] = new Class({
|
|
359
|
-
type: "nonoptional",
|
|
360
|
-
innerType: oldShape[key]
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
} else {
|
|
364
|
-
for (const key of Reflect.ownKeys(oldShape)) {
|
|
365
|
-
shape[key] = new Class({
|
|
366
|
-
type: "nonoptional",
|
|
367
|
-
innerType: oldShape[key]
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
assignProp(this, "shape", shape);
|
|
372
|
-
return shape;
|
|
373
|
-
}
|
|
374
|
-
});
|
|
375
|
-
return clone(schema, def);
|
|
352
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
|
|
353
|
+
const newShape = {};
|
|
354
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => selected && !selected.has(key) ? value : new Class({ type: "nonoptional", innerType: value }));
|
|
355
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
|
|
376
356
|
}
|
|
377
357
|
function aborted(x, startIndex = 0) {
|
|
378
358
|
if (x.aborted === true)
|
|
@@ -422,13 +402,18 @@ function finalizeIssue(iss, ctx, config) {
|
|
|
422
402
|
}
|
|
423
403
|
const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : undefined;
|
|
424
404
|
const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(schemaError?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
|
|
425
|
-
const
|
|
426
|
-
|
|
427
|
-
|
|
405
|
+
const full = {};
|
|
406
|
+
for (const k of Object.keys(iss)) {
|
|
407
|
+
if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__")
|
|
408
|
+
continue;
|
|
409
|
+
full[k] = iss[k];
|
|
410
|
+
}
|
|
411
|
+
full.path ?? (full.path = []);
|
|
412
|
+
full.message = message;
|
|
428
413
|
if (ctx?.reportInput) {
|
|
429
|
-
|
|
414
|
+
full.input = iss.input;
|
|
430
415
|
}
|
|
431
|
-
return
|
|
416
|
+
return full;
|
|
432
417
|
}
|
|
433
418
|
function codePointLength(str) {
|
|
434
419
|
const units = str.length;
|
|
@@ -499,6 +484,22 @@ function own(inst, key, value, enumerable = true) {
|
|
|
499
484
|
function hide(inst, key, value) {
|
|
500
485
|
return own(inst, key, value, false);
|
|
501
486
|
}
|
|
487
|
+
function derived(computes, table) {
|
|
488
|
+
for (const key in computes) {
|
|
489
|
+
const compute = computes[key];
|
|
490
|
+
Object.defineProperty(table, key, {
|
|
491
|
+
configurable: true,
|
|
492
|
+
enumerable: true,
|
|
493
|
+
get() {
|
|
494
|
+
return own(this, key, compute(this));
|
|
495
|
+
},
|
|
496
|
+
set(value) {
|
|
497
|
+
own(this, key, value);
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
return table;
|
|
502
|
+
}
|
|
502
503
|
function defineBound(proto, key, fn) {
|
|
503
504
|
Object.defineProperty(proto, key, {
|
|
504
505
|
configurable: true,
|
|
@@ -569,7 +570,7 @@ function constantCatch(value) {
|
|
|
569
570
|
fn[CONSTANT_CATCH] = true;
|
|
570
571
|
return fn;
|
|
571
572
|
}
|
|
572
|
-
var EVALUATING, captureStackTrace, allowsEval, propertyKeyTypes, NUMBER_FORMAT_RANGES, highSurrogate, installing, broke = false, breaker, CONSTANT_CATCH = "~constantCatch";
|
|
573
|
+
var EVALUATING, captureStackTrace, allowsEval, propertyKeyTypes, NUMBER_FORMAT_RANGES, BIGINT_FORMAT_RANGES, highSurrogate, installing, broke = false, breaker, CONSTANT_CATCH = "~constantCatch";
|
|
573
574
|
var init_util = __esm(() => {
|
|
574
575
|
init_core();
|
|
575
576
|
EVALUATING = /* @__PURE__ */ Symbol("evaluating");
|
|
@@ -597,6 +598,10 @@ var init_util = __esm(() => {
|
|
|
597
598
|
float32: [-340282346638528860000000000000000000000, 340282346638528860000000000000000000000],
|
|
598
599
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
599
600
|
}))();
|
|
601
|
+
BIGINT_FORMAT_RANGES = {
|
|
602
|
+
int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")],
|
|
603
|
+
uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
|
|
604
|
+
};
|
|
600
605
|
highSurrogate = /[\uD800-\uDBFF]/;
|
|
601
606
|
breaker = {
|
|
602
607
|
configurable: true,
|
|
@@ -646,8 +651,7 @@ function $constructor(name, initializer, proto, params) {
|
|
|
646
651
|
} finally {
|
|
647
652
|
_zodDesc.value = undefined;
|
|
648
653
|
}
|
|
649
|
-
}
|
|
650
|
-
if (inst._zod.traits.has(name)) {
|
|
654
|
+
} else if (inst._zod.traits.has(name)) {
|
|
651
655
|
return;
|
|
652
656
|
}
|
|
653
657
|
inst._zod.traits.add(name);
|
|
@@ -837,13 +841,10 @@ function prettifyError(error) {
|
|
|
837
841
|
return lines.join(`
|
|
838
842
|
`);
|
|
839
843
|
}
|
|
840
|
-
var _messageDesc,
|
|
844
|
+
var _messageDesc, _issuesDesc, _installedToString, initializer = (inst, def) => {
|
|
841
845
|
inst.name = "$ZodError";
|
|
842
|
-
_zodDesc2.value = inst._zod;
|
|
843
|
-
Object.defineProperty(inst, "_zod", _zodDesc2);
|
|
844
846
|
_issuesDesc.value = def;
|
|
845
847
|
Object.defineProperty(inst, "issues", _issuesDesc);
|
|
846
|
-
_zodDesc2.value = undefined;
|
|
847
848
|
_issuesDesc.value = undefined;
|
|
848
849
|
Object.defineProperty(inst, "message", _messageDesc);
|
|
849
850
|
const proto = Object.getPrototypeOf(inst);
|
|
@@ -872,7 +873,6 @@ var init_errors = __esm(() => {
|
|
|
872
873
|
enumerable: true,
|
|
873
874
|
configurable: true
|
|
874
875
|
};
|
|
875
|
-
_zodDesc2 = { value: undefined, enumerable: false };
|
|
876
876
|
_issuesDesc = { value: undefined, enumerable: false };
|
|
877
877
|
_installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
878
878
|
$ZodError = $constructor("$ZodError", initializer);
|
|
@@ -885,6 +885,40 @@ var init_errors = __esm(() => {
|
|
|
885
885
|
function finalizeParams(callee, params) {
|
|
886
886
|
return { callee: params?.callee ?? callee, Err: params?.Err };
|
|
887
887
|
}
|
|
888
|
+
function failure(Err, issues, ctx) {
|
|
889
|
+
let error;
|
|
890
|
+
return {
|
|
891
|
+
success: false,
|
|
892
|
+
get error() {
|
|
893
|
+
if (!error) {
|
|
894
|
+
error = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
895
|
+
issues = undefined;
|
|
896
|
+
ctx = undefined;
|
|
897
|
+
}
|
|
898
|
+
return error;
|
|
899
|
+
},
|
|
900
|
+
set error(e) {
|
|
901
|
+
error = e;
|
|
902
|
+
issues = undefined;
|
|
903
|
+
ctx = undefined;
|
|
904
|
+
}
|
|
905
|
+
};
|
|
906
|
+
}
|
|
907
|
+
function validateFallback(schema, value, _ctx) {
|
|
908
|
+
const ctx = _ctx ? { ..._ctx, async: false, abortEarly: true } : { async: false, abortEarly: true };
|
|
909
|
+
const fallbackRun = schema._zod.bag.fallbackRun;
|
|
910
|
+
let result;
|
|
911
|
+
if (fallbackRun) {
|
|
912
|
+
ctx[COMPILE_FALLBACK] = true;
|
|
913
|
+
result = fallbackRun({ value, issues: [] }, ctx);
|
|
914
|
+
} else {
|
|
915
|
+
result = schema._zod.run({ value, issues: [] }, ctx);
|
|
916
|
+
}
|
|
917
|
+
if (result instanceof Promise) {
|
|
918
|
+
throw new $ZodAsyncError;
|
|
919
|
+
}
|
|
920
|
+
return result.issues.length === 0;
|
|
921
|
+
}
|
|
888
922
|
var _parse = (_Err) => {
|
|
889
923
|
const fn = (schema, value, _ctx, _params) => {
|
|
890
924
|
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
@@ -920,20 +954,29 @@ var _parse = (_Err) => {
|
|
|
920
954
|
if (result instanceof Promise) {
|
|
921
955
|
throw new $ZodAsyncError;
|
|
922
956
|
}
|
|
923
|
-
return result.issues.length ? {
|
|
924
|
-
success: false,
|
|
925
|
-
error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
926
|
-
} : { success: true, data: result.value };
|
|
957
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
927
958
|
}, safeParse, _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
928
959
|
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
929
960
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
930
961
|
if (result instanceof Promise)
|
|
931
962
|
result = await result;
|
|
932
|
-
return result.issues.length ? {
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
963
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
964
|
+
}, safeParseAsync, COMPILE_INVALID, COMPILE_FALLBACK, validate = (schema, value, _ctx) => {
|
|
965
|
+
const validator = schema._zod.bag.validator;
|
|
966
|
+
if (validator !== undefined) {
|
|
967
|
+
if (validator(value) !== COMPILE_INVALID)
|
|
968
|
+
return true;
|
|
969
|
+
if (validator.definite === true && _ctx === undefined)
|
|
970
|
+
return false;
|
|
971
|
+
}
|
|
972
|
+
return validateFallback(schema, value, _ctx);
|
|
973
|
+
}, validateAsync = async (schema, value, _ctx) => {
|
|
974
|
+
const ctx = _ctx ? { ..._ctx, async: true, abortEarly: true } : { async: true, abortEarly: true };
|
|
975
|
+
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
976
|
+
if (result instanceof Promise)
|
|
977
|
+
result = await result;
|
|
978
|
+
return result.issues.length === 0;
|
|
979
|
+
}, _encode = (_Err) => {
|
|
937
980
|
const parse = _parse(_Err);
|
|
938
981
|
const fn = (schema, value, _ctx, _params) => {
|
|
939
982
|
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
|
@@ -978,6 +1021,8 @@ var init_parse = __esm(() => {
|
|
|
978
1021
|
parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
|
|
979
1022
|
safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
980
1023
|
safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
1024
|
+
COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
1025
|
+
COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
981
1026
|
});
|
|
982
1027
|
|
|
983
1028
|
// node_modules/zod/v4/core/regexes.js
|
|
@@ -1010,10 +1055,7 @@ var cuid, cuid2, ulid, xid, ksuid, nanoid, duration, guid, uuid = (version) => {
|
|
|
1010
1055
|
if (!version)
|
|
1011
1056
|
return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
|
|
1012
1057
|
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
1013
|
-
}, email, _emoji = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`, ipv4, ipv6, cidrv4, cidrv6, base64, base64url, httpProtocol, e164, dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`, date,
|
|
1014
|
-
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
1015
|
-
return new RegExp(`^${regex}$`);
|
|
1016
|
-
}, integer, number, boolean, _null, lowercase, uppercase;
|
|
1058
|
+
}, email, _emoji = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`, ipv4, ipv6, cidrv4, cidrv6, base64, base64url, httpProtocol, e164, dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`, date, anyString, integer, number, boolean, _null, lowercase, uppercase;
|
|
1017
1059
|
var init_regexes = __esm(() => {
|
|
1018
1060
|
cuid = /^[cC][0-9a-z]{6,}$/;
|
|
1019
1061
|
cuid2 = /^[0-9a-z]+$/;
|
|
@@ -1023,16 +1065,17 @@ var init_regexes = __esm(() => {
|
|
|
1023
1065
|
nanoid = /^[a-zA-Z0-9_-]{21}$/;
|
|
1024
1066
|
duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
|
|
1025
1067
|
guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
1026
|
-
email = /^(
|
|
1068
|
+
email = /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
1027
1069
|
ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
|
|
1028
1070
|
ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
|
|
1029
1071
|
cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
|
|
1030
1072
|
cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
1031
1073
|
base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
1032
|
-
base64url = /^[A-Za-z0-9_-]
|
|
1074
|
+
base64url = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;
|
|
1033
1075
|
httpProtocol = /^https?$/;
|
|
1034
1076
|
e164 = /^\+[1-9]\d{6,14}$/;
|
|
1035
1077
|
date = /* @__PURE__ */ anchor(dateSource);
|
|
1078
|
+
anyString = /^[\s\S]{0,}$/;
|
|
1036
1079
|
integer = /^-?\d+$/;
|
|
1037
1080
|
number = /^-?\d+(?:\.\d+)?$/;
|
|
1038
1081
|
boolean = /^(?:true|false)$/i;
|
|
@@ -1064,16 +1107,6 @@ var init_checks = __esm(() => {
|
|
|
1064
1107
|
$ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
|
|
1065
1108
|
$ZodCheck.init(inst, def);
|
|
1066
1109
|
const origin = numericOriginMap[typeof def.value];
|
|
1067
|
-
inst._zod.onattach.push((inst) => {
|
|
1068
|
-
const bag = inst._zod.bag;
|
|
1069
|
-
const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
1070
|
-
if (def.value < curr) {
|
|
1071
|
-
if (def.inclusive)
|
|
1072
|
-
bag.maximum = def.value;
|
|
1073
|
-
else
|
|
1074
|
-
bag.exclusiveMaximum = def.value;
|
|
1075
|
-
}
|
|
1076
|
-
});
|
|
1077
1110
|
inst._zod.check = (payload) => {
|
|
1078
1111
|
if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
|
|
1079
1112
|
return;
|
|
@@ -1092,16 +1125,6 @@ var init_checks = __esm(() => {
|
|
|
1092
1125
|
$ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
|
|
1093
1126
|
$ZodCheck.init(inst, def);
|
|
1094
1127
|
const origin = numericOriginMap[typeof def.value];
|
|
1095
|
-
inst._zod.onattach.push((inst) => {
|
|
1096
|
-
const bag = inst._zod.bag;
|
|
1097
|
-
const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
1098
|
-
if (def.value > curr) {
|
|
1099
|
-
if (def.inclusive)
|
|
1100
|
-
bag.minimum = def.value;
|
|
1101
|
-
else
|
|
1102
|
-
bag.exclusiveMinimum = def.value;
|
|
1103
|
-
}
|
|
1104
|
-
});
|
|
1105
1128
|
inst._zod.check = (payload) => {
|
|
1106
1129
|
if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
|
|
1107
1130
|
return;
|
|
@@ -1119,10 +1142,6 @@ var init_checks = __esm(() => {
|
|
|
1119
1142
|
});
|
|
1120
1143
|
$ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
1121
1144
|
$ZodCheck.init(inst, def);
|
|
1122
|
-
inst._zod.onattach.push((inst) => {
|
|
1123
|
-
var _a;
|
|
1124
|
-
(_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
|
|
1125
|
-
});
|
|
1126
1145
|
inst._zod.check = (payload) => {
|
|
1127
1146
|
if (typeof payload.value !== typeof def.value)
|
|
1128
1147
|
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
@@ -1145,14 +1164,6 @@ var init_checks = __esm(() => {
|
|
|
1145
1164
|
const isInt = def.format?.includes("int");
|
|
1146
1165
|
const origin = isInt ? "int" : "number";
|
|
1147
1166
|
const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
|
|
1148
|
-
inst._zod.onattach.push((inst) => {
|
|
1149
|
-
const bag = inst._zod.bag;
|
|
1150
|
-
bag.format = def.format;
|
|
1151
|
-
bag.minimum = minimum;
|
|
1152
|
-
bag.maximum = maximum;
|
|
1153
|
-
if (isInt)
|
|
1154
|
-
bag.pattern = integer;
|
|
1155
|
-
});
|
|
1156
1167
|
inst._zod.check = (payload) => {
|
|
1157
1168
|
const input = payload.value;
|
|
1158
1169
|
if (isInt) {
|
|
@@ -1222,11 +1233,6 @@ var init_checks = __esm(() => {
|
|
|
1222
1233
|
var _a;
|
|
1223
1234
|
$ZodCheck.init(inst, def);
|
|
1224
1235
|
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
1225
|
-
inst._zod.onattach.push((inst) => {
|
|
1226
|
-
const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
1227
|
-
if (def.maximum < curr)
|
|
1228
|
-
inst._zod.bag.maximum = def.maximum;
|
|
1229
|
-
});
|
|
1230
1236
|
inst._zod.check = (payload) => {
|
|
1231
1237
|
const input = payload.value;
|
|
1232
1238
|
const units = input.length;
|
|
@@ -1249,11 +1255,6 @@ var init_checks = __esm(() => {
|
|
|
1249
1255
|
var _a;
|
|
1250
1256
|
$ZodCheck.init(inst, def);
|
|
1251
1257
|
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
1252
|
-
inst._zod.onattach.push((inst) => {
|
|
1253
|
-
const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
1254
|
-
if (def.minimum > curr)
|
|
1255
|
-
inst._zod.bag.minimum = def.minimum;
|
|
1256
|
-
});
|
|
1257
1258
|
inst._zod.check = (payload) => {
|
|
1258
1259
|
const input = payload.value;
|
|
1259
1260
|
const units = input.length;
|
|
@@ -1276,12 +1277,6 @@ var init_checks = __esm(() => {
|
|
|
1276
1277
|
var _a;
|
|
1277
1278
|
$ZodCheck.init(inst, def);
|
|
1278
1279
|
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
1279
|
-
inst._zod.onattach.push((inst) => {
|
|
1280
|
-
const bag = inst._zod.bag;
|
|
1281
|
-
bag.minimum = def.length;
|
|
1282
|
-
bag.maximum = def.length;
|
|
1283
|
-
bag.length = def.length;
|
|
1284
|
-
});
|
|
1285
1280
|
inst._zod.check = (payload) => {
|
|
1286
1281
|
const input = payload.value;
|
|
1287
1282
|
const units = input.length;
|
|
@@ -1304,14 +1299,6 @@ var init_checks = __esm(() => {
|
|
|
1304
1299
|
$ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
1305
1300
|
var _a, _b;
|
|
1306
1301
|
$ZodCheck.init(inst, def);
|
|
1307
|
-
inst._zod.onattach.push((inst) => {
|
|
1308
|
-
const bag = inst._zod.bag;
|
|
1309
|
-
bag.format = def.format;
|
|
1310
|
-
if (def.pattern) {
|
|
1311
|
-
bag.patterns ?? (bag.patterns = new Set);
|
|
1312
|
-
bag.patterns.add(def.pattern);
|
|
1313
|
-
}
|
|
1314
|
-
});
|
|
1315
1302
|
if (def.pattern)
|
|
1316
1303
|
(_a = inst._zod).check ?? (_a.check = (payload) => {
|
|
1317
1304
|
def.pattern.lastIndex = 0;
|
|
@@ -1360,11 +1347,6 @@ var init_checks = __esm(() => {
|
|
|
1360
1347
|
const escapedRegex = escapeRegex(def.includes);
|
|
1361
1348
|
const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
|
|
1362
1349
|
def.pattern = pattern;
|
|
1363
|
-
inst._zod.onattach.push((inst) => {
|
|
1364
|
-
const bag = inst._zod.bag;
|
|
1365
|
-
bag.patterns ?? (bag.patterns = new Set);
|
|
1366
|
-
bag.patterns.add(pattern);
|
|
1367
|
-
});
|
|
1368
1350
|
inst._zod.check = (payload) => {
|
|
1369
1351
|
if (payload.value.includes(def.includes, def.position))
|
|
1370
1352
|
return;
|
|
@@ -1383,11 +1365,6 @@ var init_checks = __esm(() => {
|
|
|
1383
1365
|
$ZodCheck.init(inst, def);
|
|
1384
1366
|
const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
|
|
1385
1367
|
def.pattern ?? (def.pattern = pattern);
|
|
1386
|
-
inst._zod.onattach.push((inst) => {
|
|
1387
|
-
const bag = inst._zod.bag;
|
|
1388
|
-
bag.patterns ?? (bag.patterns = new Set);
|
|
1389
|
-
bag.patterns.add(pattern);
|
|
1390
|
-
});
|
|
1391
1368
|
inst._zod.check = (payload) => {
|
|
1392
1369
|
if (payload.value.startsWith(def.prefix))
|
|
1393
1370
|
return;
|
|
@@ -1406,11 +1383,6 @@ var init_checks = __esm(() => {
|
|
|
1406
1383
|
$ZodCheck.init(inst, def);
|
|
1407
1384
|
const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
|
|
1408
1385
|
def.pattern ?? (def.pattern = pattern);
|
|
1409
|
-
inst._zod.onattach.push((inst) => {
|
|
1410
|
-
const bag = inst._zod.bag;
|
|
1411
|
-
bag.patterns ?? (bag.patterns = new Set);
|
|
1412
|
-
bag.patterns.add(pattern);
|
|
1413
|
-
});
|
|
1414
1386
|
inst._zod.check = (payload) => {
|
|
1415
1387
|
if (payload.value.endsWith(def.suffix))
|
|
1416
1388
|
return;
|
|
@@ -1443,8 +1415,11 @@ class Doc {
|
|
|
1443
1415
|
}
|
|
1444
1416
|
indented(fn) {
|
|
1445
1417
|
this.indent += 1;
|
|
1446
|
-
|
|
1447
|
-
|
|
1418
|
+
try {
|
|
1419
|
+
fn(this);
|
|
1420
|
+
} finally {
|
|
1421
|
+
this.indent -= 1;
|
|
1422
|
+
}
|
|
1448
1423
|
}
|
|
1449
1424
|
write(arg) {
|
|
1450
1425
|
if (typeof arg === "function") {
|
|
@@ -1477,30 +1452,57 @@ var version2;
|
|
|
1477
1452
|
var init_versions = __esm(() => {
|
|
1478
1453
|
version2 = {
|
|
1479
1454
|
major: 4,
|
|
1480
|
-
minor:
|
|
1481
|
-
patch:
|
|
1455
|
+
minor: 6,
|
|
1456
|
+
patch: 5
|
|
1482
1457
|
};
|
|
1483
1458
|
});
|
|
1484
1459
|
|
|
1485
1460
|
// node_modules/zod/v4/core/schemas.js
|
|
1461
|
+
async function validateAsync2(inst, value) {
|
|
1462
|
+
const ctx = { async: true };
|
|
1463
|
+
return toStandardResult(await inst._zod.run({ value, issues: [] }, ctx), ctx);
|
|
1464
|
+
}
|
|
1486
1465
|
function standardProps(inst) {
|
|
1487
1466
|
return {
|
|
1488
1467
|
validate: (value) => {
|
|
1468
|
+
const ctx = { async: false };
|
|
1489
1469
|
try {
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
}
|
|
1470
|
+
const r = inst._zod.run({ value, issues: [] }, ctx);
|
|
1471
|
+
if (!(r instanceof Promise))
|
|
1472
|
+
return toStandardResult(r, ctx);
|
|
1473
|
+
} catch (_) {}
|
|
1474
|
+
return validateAsync2(inst, value);
|
|
1494
1475
|
},
|
|
1495
1476
|
vendor: "zod",
|
|
1496
1477
|
version: 1
|
|
1497
1478
|
};
|
|
1498
1479
|
}
|
|
1480
|
+
function canParseURL(input) {
|
|
1481
|
+
try {
|
|
1482
|
+
if (typeof URL !== "undefined" && typeof URL.canParse === "function")
|
|
1483
|
+
return URL.canParse(input);
|
|
1484
|
+
new URL(input);
|
|
1485
|
+
return true;
|
|
1486
|
+
} catch {
|
|
1487
|
+
return false;
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
function validateURL(trimmed, def) {
|
|
1491
|
+
if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) {
|
|
1492
|
+
return canParseURL(trimmed) || URL_UNPARSEABLE;
|
|
1493
|
+
}
|
|
1494
|
+
return parseURLObject(trimmed, def);
|
|
1495
|
+
}
|
|
1499
1496
|
function parseURLObject(trimmed, def) {
|
|
1500
1497
|
if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) {
|
|
1501
1498
|
return URL_BAD_FORMAT;
|
|
1502
1499
|
}
|
|
1503
1500
|
try {
|
|
1501
|
+
if (typeof URL !== "undefined") {
|
|
1502
|
+
const URLStatic = URL;
|
|
1503
|
+
if (typeof URLStatic.parse === "function")
|
|
1504
|
+
return URLStatic.parse(trimmed) ?? URL_UNPARSEABLE;
|
|
1505
|
+
}
|
|
1504
1506
|
return new URL(trimmed);
|
|
1505
1507
|
} catch {
|
|
1506
1508
|
return URL_UNPARSEABLE;
|
|
@@ -1520,12 +1522,7 @@ function urlProtocolOk(url, protocol) {
|
|
|
1520
1522
|
function isValidIPv6(value) {
|
|
1521
1523
|
if (!ipv6Alphabet.test(value))
|
|
1522
1524
|
return false;
|
|
1523
|
-
|
|
1524
|
-
new URL(`http://[${value}]`);
|
|
1525
|
-
return true;
|
|
1526
|
-
} catch {
|
|
1527
|
-
return false;
|
|
1528
|
-
}
|
|
1525
|
+
return canParseURL(`http://[${value}]`);
|
|
1529
1526
|
}
|
|
1530
1527
|
function isValidCIDRv6(value) {
|
|
1531
1528
|
const parts = value.split("/");
|
|
@@ -1556,7 +1553,7 @@ function isValidBase64(data) {
|
|
|
1556
1553
|
}
|
|
1557
1554
|
}
|
|
1558
1555
|
function isValidBase64URL(data) {
|
|
1559
|
-
if (!
|
|
1556
|
+
if (!base64urlCharset.test(data))
|
|
1560
1557
|
return false;
|
|
1561
1558
|
const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
1562
1559
|
const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "=");
|
|
@@ -1612,7 +1609,7 @@ function handlePropertyResult(result, final, key, input, optin, optout) {
|
|
|
1612
1609
|
return;
|
|
1613
1610
|
}
|
|
1614
1611
|
if (result.value === undefined) {
|
|
1615
|
-
if (isPresent) {
|
|
1612
|
+
if (isPresent || optin === "defaulted" && !isOptionalOut) {
|
|
1616
1613
|
final.value[key] = undefined;
|
|
1617
1614
|
}
|
|
1618
1615
|
} else {
|
|
@@ -1639,14 +1636,20 @@ function normalizeDef(def) {
|
|
|
1639
1636
|
optionalKeys: new Set(okeys)
|
|
1640
1637
|
};
|
|
1641
1638
|
}
|
|
1642
|
-
function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
1639
|
+
function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
|
|
1643
1640
|
const unrecognized = [];
|
|
1644
1641
|
const keySet = def.keySet;
|
|
1645
1642
|
const _catchall = def.catchall._zod;
|
|
1646
1643
|
const t = _catchall.def.type;
|
|
1647
1644
|
const optin = _catchall.optin;
|
|
1648
1645
|
const optout = _catchall.optout;
|
|
1646
|
+
let seen = 0;
|
|
1649
1647
|
for (const key in input) {
|
|
1648
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
1649
|
+
if (aborted(payload, seen))
|
|
1650
|
+
break;
|
|
1651
|
+
seen = payload.issues.length;
|
|
1652
|
+
}
|
|
1650
1653
|
if (keySet.has(key))
|
|
1651
1654
|
continue;
|
|
1652
1655
|
if (key === "__proto__") {
|
|
@@ -1700,6 +1703,24 @@ function handleUnionResults(results, final, inst, ctx) {
|
|
|
1700
1703
|
});
|
|
1701
1704
|
return final;
|
|
1702
1705
|
}
|
|
1706
|
+
function discriminatorMap(def) {
|
|
1707
|
+
const map = new Map;
|
|
1708
|
+
for (const option of def.options) {
|
|
1709
|
+
const values = option._zod.propValues?.[def.discriminator];
|
|
1710
|
+
if (!values || values.size === 0)
|
|
1711
|
+
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
1712
|
+
for (const value of values) {
|
|
1713
|
+
if (map.has(value)) {
|
|
1714
|
+
if (value !== undefined)
|
|
1715
|
+
throw new Error(`Duplicate discriminator value "${String(value)}"`);
|
|
1716
|
+
map.set(value, null);
|
|
1717
|
+
} else {
|
|
1718
|
+
map.set(value, option);
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
return map;
|
|
1723
|
+
}
|
|
1703
1724
|
function mergeValues(a, b) {
|
|
1704
1725
|
if (a === b) {
|
|
1705
1726
|
return { valid: true, data: a };
|
|
@@ -1863,11 +1884,10 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
1863
1884
|
payload.issues.push(issue(_iss));
|
|
1864
1885
|
}
|
|
1865
1886
|
}
|
|
1866
|
-
var $ZodType, toStandardResult = (r) => r.
|
|
1887
|
+
var $ZodType, toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => finalizeIssue(iss, ctx, config())) } : { value: r.value }, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, URL_BAD_FORMAT = 1, URL_UNPARSEABLE = 2, asciiTabOrNewline, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, ipv6Alphabet, $ZodIPv6, $ZodCIDRv4, $ZodCIDRv6, base64Charset, $ZodBase64, base64urlCharset, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodNull, $ZodAny, $ZodUnknown, $ZodNever, $ZodArray, NO_SYMBOL_KEYS, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodDiscriminatedUnion, $ZodIntersection, $ZodRecord, $ZodEnum, $ZodLiteral, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodCatch, $ZodPipe, $ZodPreprocess, $ZodReadonly, $ZodLazy, $ZodCustom;
|
|
1867
1888
|
var init_schemas = __esm(() => {
|
|
1868
1889
|
init_checks();
|
|
1869
1890
|
init_core();
|
|
1870
|
-
init_parse();
|
|
1871
1891
|
init_regexes();
|
|
1872
1892
|
init_util();
|
|
1873
1893
|
init_versions();
|
|
@@ -1982,7 +2002,7 @@ var init_schemas = __esm(() => {
|
|
|
1982
2002
|
});
|
|
1983
2003
|
$ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
1984
2004
|
$ZodType.init(inst, def);
|
|
1985
|
-
inst._zod.pattern =
|
|
2005
|
+
inst._zod.pattern = def.pattern ?? anyString;
|
|
1986
2006
|
inst._zod.parse = (payload, _) => {
|
|
1987
2007
|
if (def.coerce)
|
|
1988
2008
|
try {
|
|
@@ -2037,7 +2057,7 @@ var init_schemas = __esm(() => {
|
|
|
2037
2057
|
inst._zod.check = (payload) => {
|
|
2038
2058
|
try {
|
|
2039
2059
|
const trimmed = payload.value.trim();
|
|
2040
|
-
const url =
|
|
2060
|
+
const url = validateURL(trimmed, def);
|
|
2041
2061
|
if (url === URL_BAD_FORMAT) {
|
|
2042
2062
|
payload.issues.push({
|
|
2043
2063
|
code: "invalid_format",
|
|
@@ -2059,6 +2079,10 @@ var init_schemas = __esm(() => {
|
|
|
2059
2079
|
});
|
|
2060
2080
|
return;
|
|
2061
2081
|
}
|
|
2082
|
+
if (url === true) {
|
|
2083
|
+
payload.value = stripTabAndNewline(trimmed);
|
|
2084
|
+
return;
|
|
2085
|
+
}
|
|
2062
2086
|
if (def.hostname && !urlHostnameOk(url, def.hostname)) {
|
|
2063
2087
|
payload.issues.push({
|
|
2064
2088
|
code: "invalid_format",
|
|
@@ -2127,12 +2151,6 @@ var init_schemas = __esm(() => {
|
|
|
2127
2151
|
$ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
|
|
2128
2152
|
def.pattern ?? (def.pattern = datetime(def));
|
|
2129
2153
|
$ZodStringFormat.init(inst, def);
|
|
2130
|
-
if (def.local || def.precision === -1) {
|
|
2131
|
-
inst._zod.bag.laxFormat = true;
|
|
2132
|
-
inst._zod.onattach.push((s) => {
|
|
2133
|
-
s._zod.bag.laxFormat = true;
|
|
2134
|
-
});
|
|
2135
|
-
}
|
|
2136
2154
|
});
|
|
2137
2155
|
$ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
|
|
2138
2156
|
def.pattern ?? (def.pattern = date);
|
|
@@ -2149,13 +2167,11 @@ var init_schemas = __esm(() => {
|
|
|
2149
2167
|
$ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
|
|
2150
2168
|
def.pattern ?? (def.pattern = ipv4);
|
|
2151
2169
|
$ZodStringFormat.init(inst, def);
|
|
2152
|
-
inst._zod.bag.format = `ipv4`;
|
|
2153
2170
|
});
|
|
2154
2171
|
ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
|
|
2155
2172
|
$ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
|
|
2156
2173
|
def.pattern ?? (def.pattern = ipv6);
|
|
2157
2174
|
$ZodStringFormat.init(inst, def);
|
|
2158
|
-
inst._zod.bag.format = `ipv6`;
|
|
2159
2175
|
inst._zod.check = (payload) => {
|
|
2160
2176
|
if (!isValidIPv6(payload.value)) {
|
|
2161
2177
|
payload.issues.push({
|
|
@@ -2187,10 +2203,10 @@ var init_schemas = __esm(() => {
|
|
|
2187
2203
|
}
|
|
2188
2204
|
};
|
|
2189
2205
|
});
|
|
2206
|
+
base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
|
|
2190
2207
|
$ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
2191
|
-
def.pattern ?? (def.pattern =
|
|
2208
|
+
def.pattern ?? (def.pattern = base64Charset);
|
|
2192
2209
|
$ZodStringFormat.init(inst, def);
|
|
2193
|
-
inst._zod.bag.contentEncoding = "base64";
|
|
2194
2210
|
inst._zod.check = (payload) => {
|
|
2195
2211
|
if (isValidBase64(payload.value))
|
|
2196
2212
|
return;
|
|
@@ -2203,10 +2219,10 @@ var init_schemas = __esm(() => {
|
|
|
2203
2219
|
});
|
|
2204
2220
|
};
|
|
2205
2221
|
});
|
|
2222
|
+
base64urlCharset = /^[A-Za-z0-9_-]*$/;
|
|
2206
2223
|
$ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
|
|
2207
|
-
def.pattern ?? (def.pattern =
|
|
2224
|
+
def.pattern ?? (def.pattern = base64urlCharset);
|
|
2208
2225
|
$ZodStringFormat.init(inst, def);
|
|
2209
|
-
inst._zod.bag.contentEncoding = "base64url";
|
|
2210
2226
|
inst._zod.check = (payload) => {
|
|
2211
2227
|
if (isValidBase64URL(payload.value))
|
|
2212
2228
|
return;
|
|
@@ -2239,7 +2255,7 @@ var init_schemas = __esm(() => {
|
|
|
2239
2255
|
});
|
|
2240
2256
|
$ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
2241
2257
|
$ZodType.init(inst, def);
|
|
2242
|
-
inst._zod.pattern =
|
|
2258
|
+
inst._zod.pattern = number;
|
|
2243
2259
|
inst._zod.parse = (payload, _ctx) => {
|
|
2244
2260
|
if (def.coerce)
|
|
2245
2261
|
try {
|
|
@@ -2338,6 +2354,7 @@ var init_schemas = __esm(() => {
|
|
|
2338
2354
|
}
|
|
2339
2355
|
payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
|
|
2340
2356
|
const proms = [];
|
|
2357
|
+
const abortEarly = ctx?.abortEarly;
|
|
2341
2358
|
for (let i = 0;i < input.length; i++) {
|
|
2342
2359
|
const item = input[i];
|
|
2343
2360
|
const result = def.element._zod.run({
|
|
@@ -2348,6 +2365,8 @@ var init_schemas = __esm(() => {
|
|
|
2348
2365
|
proms.push(result.then((result) => handleArrayResult(result, payload, i)));
|
|
2349
2366
|
} else {
|
|
2350
2367
|
handleArrayResult(result, payload, i);
|
|
2368
|
+
if (abortEarly && result.issues.length !== 0 && aborted(result))
|
|
2369
|
+
break;
|
|
2351
2370
|
}
|
|
2352
2371
|
}
|
|
2353
2372
|
if (proms.length) {
|
|
@@ -2357,23 +2376,19 @@ var init_schemas = __esm(() => {
|
|
|
2357
2376
|
};
|
|
2358
2377
|
});
|
|
2359
2378
|
NO_SYMBOL_KEYS = [];
|
|
2360
|
-
propShapes = new WeakMap;
|
|
2361
2379
|
$ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
2362
2380
|
$ZodType.init(inst, def);
|
|
2363
2381
|
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
return newSh;
|
|
2375
|
-
}
|
|
2376
|
-
});
|
|
2382
|
+
const sh = desc?.get ? desc.get.raw : def.shape ?? {};
|
|
2383
|
+
if (sh) {
|
|
2384
|
+
const get = () => {
|
|
2385
|
+
const newSh = { ...sh };
|
|
2386
|
+
Object.defineProperty(def, "shape", { value: newSh });
|
|
2387
|
+
get.raw = newSh;
|
|
2388
|
+
return newSh;
|
|
2389
|
+
};
|
|
2390
|
+
get.raw = sh;
|
|
2391
|
+
Object.defineProperty(def, "shape", { get });
|
|
2377
2392
|
}
|
|
2378
2393
|
const _normalized = cached(() => normalizeDef(def));
|
|
2379
2394
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
@@ -2413,7 +2428,14 @@ var init_schemas = __esm(() => {
|
|
|
2413
2428
|
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
2414
2429
|
const proms = [];
|
|
2415
2430
|
const shape = value.shape;
|
|
2431
|
+
const abortEarly = ctx?.abortEarly;
|
|
2432
|
+
let seen = payload.issues.length;
|
|
2416
2433
|
for (const key of value.allKeys) {
|
|
2434
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
2435
|
+
if (aborted(payload, seen))
|
|
2436
|
+
break;
|
|
2437
|
+
seen = payload.issues.length;
|
|
2438
|
+
}
|
|
2417
2439
|
if (key === "__proto__")
|
|
2418
2440
|
continue;
|
|
2419
2441
|
const el = shape[key];
|
|
@@ -2429,7 +2451,7 @@ var init_schemas = __esm(() => {
|
|
|
2429
2451
|
if (!catchall) {
|
|
2430
2452
|
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
2431
2453
|
}
|
|
2432
|
-
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
2454
|
+
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst, abortEarly === true);
|
|
2433
2455
|
};
|
|
2434
2456
|
});
|
|
2435
2457
|
$ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
@@ -2443,10 +2465,16 @@ var init_schemas = __esm(() => {
|
|
|
2443
2465
|
const doc = new Doc(["payload", "ctx"], { shape, inst, memo, syms });
|
|
2444
2466
|
const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
2445
2467
|
const prefixStr = (id, k) => `
|
|
2468
|
+
let ${id}_ab = false;
|
|
2446
2469
|
for (let i = 0; i < ${id}.issues.length; i++) {
|
|
2447
2470
|
const iss = ${id}.issues[i];
|
|
2448
2471
|
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
2449
2472
|
payload.issues.push(iss);
|
|
2473
|
+
if (iss.continue !== true) ${id}_ab = true;
|
|
2474
|
+
}
|
|
2475
|
+
if (${id}_ab && ctx && ctx.abortEarly) {
|
|
2476
|
+
payload.value = newResult;
|
|
2477
|
+
return payload;
|
|
2450
2478
|
}`;
|
|
2451
2479
|
doc.write(`const input = payload.value;`);
|
|
2452
2480
|
const ids = Object.create(null);
|
|
@@ -2492,6 +2520,10 @@ var init_schemas = __esm(() => {
|
|
|
2492
2520
|
input: undefined,
|
|
2493
2521
|
path: [${k}]
|
|
2494
2522
|
});
|
|
2523
|
+
if (ctx && ctx.abortEarly) {
|
|
2524
|
+
payload.value = newResult;
|
|
2525
|
+
return payload;
|
|
2526
|
+
}
|
|
2495
2527
|
}
|
|
2496
2528
|
|
|
2497
2529
|
if (${id}_present) {
|
|
@@ -2503,16 +2535,16 @@ var init_schemas = __esm(() => {
|
|
|
2503
2535
|
doc.write(`
|
|
2504
2536
|
if (${id}.issues.length) {${prefixStr(id, k)}
|
|
2505
2537
|
}
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
}
|
|
2538
|
+
`);
|
|
2539
|
+
if (optin === "defaulted") {
|
|
2540
|
+
doc.write(`newResult[${k}] = ${id}.value;`);
|
|
2541
|
+
} else {
|
|
2542
|
+
doc.write(`
|
|
2543
|
+
if (${id}.value !== undefined || ${isPresent}) {
|
|
2512
2544
|
newResult[${k}] = ${id}.value;
|
|
2513
2545
|
}
|
|
2514
|
-
|
|
2515
2546
|
`);
|
|
2547
|
+
}
|
|
2516
2548
|
}
|
|
2517
2549
|
}
|
|
2518
2550
|
doc.write(`payload.value = newResult;`);
|
|
@@ -2544,7 +2576,7 @@ var init_schemas = __esm(() => {
|
|
|
2544
2576
|
payload = fastpass(payload, ctx);
|
|
2545
2577
|
if (!catchall)
|
|
2546
2578
|
return payload;
|
|
2547
|
-
return handleCatchall([], input, payload, ctx, value, inst);
|
|
2579
|
+
return handleCatchall([], input, payload, ctx, value, inst, ctx?.abortEarly === true);
|
|
2548
2580
|
}
|
|
2549
2581
|
return superParse(payload, ctx);
|
|
2550
2582
|
};
|
|
@@ -2600,10 +2632,13 @@ var init_schemas = __esm(() => {
|
|
|
2600
2632
|
const _super = inst._zod.parse;
|
|
2601
2633
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
2602
2634
|
const propValues = {};
|
|
2635
|
+
let undefinedCount = 0;
|
|
2603
2636
|
for (const option of zod.def.options) {
|
|
2604
2637
|
const pv = option._zod.propValues;
|
|
2605
2638
|
if (!pv || Object.keys(pv).length === 0)
|
|
2606
2639
|
throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
|
|
2640
|
+
if (pv[zod.def.discriminator]?.has(undefined))
|
|
2641
|
+
undefinedCount++;
|
|
2607
2642
|
for (const [k, v] of Object.entries(pv)) {
|
|
2608
2643
|
if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
|
|
2609
2644
|
assignProp(propValues, k, new Set);
|
|
@@ -2613,30 +2648,17 @@ var init_schemas = __esm(() => {
|
|
|
2613
2648
|
}
|
|
2614
2649
|
}
|
|
2615
2650
|
}
|
|
2651
|
+
if (!zod.def.unionFallback && undefinedCount > 1)
|
|
2652
|
+
propValues[zod.def.discriminator]?.delete(undefined);
|
|
2616
2653
|
return propValues;
|
|
2617
2654
|
});
|
|
2618
2655
|
def.options.forEach((option, i) => {
|
|
2619
|
-
const propShape =
|
|
2656
|
+
const propShape = rawShape(option._zod.def);
|
|
2620
2657
|
if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {
|
|
2621
2658
|
throw new Error(`Invalid discriminated union option at index "${i}"`);
|
|
2622
2659
|
}
|
|
2623
2660
|
});
|
|
2624
|
-
const disc = cached(() =>
|
|
2625
|
-
const opts = def.options;
|
|
2626
|
-
const map = new Map;
|
|
2627
|
-
for (const o of opts) {
|
|
2628
|
-
const values = o._zod.propValues?.[def.discriminator];
|
|
2629
|
-
if (!values || values.size === 0)
|
|
2630
|
-
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
|
|
2631
|
-
for (const v of values) {
|
|
2632
|
-
if (map.has(v)) {
|
|
2633
|
-
throw new Error(`Duplicate discriminator value "${String(v)}"`);
|
|
2634
|
-
}
|
|
2635
|
-
map.set(v, o);
|
|
2636
|
-
}
|
|
2637
|
-
}
|
|
2638
|
-
return map;
|
|
2639
|
-
});
|
|
2661
|
+
const disc = cached(() => discriminatorMap(def));
|
|
2640
2662
|
inst._zod.parse = (payload, ctx) => {
|
|
2641
2663
|
const input = payload.value;
|
|
2642
2664
|
if (!isObject(input)) {
|
|
@@ -2648,8 +2670,9 @@ var init_schemas = __esm(() => {
|
|
|
2648
2670
|
});
|
|
2649
2671
|
return payload;
|
|
2650
2672
|
}
|
|
2651
|
-
const
|
|
2652
|
-
|
|
2673
|
+
const value = input?.[def.discriminator];
|
|
2674
|
+
const opt = disc.value.get(value);
|
|
2675
|
+
if (opt && (value !== undefined || ctx.direction !== "backward")) {
|
|
2653
2676
|
return opt._zod.run(payload, ctx);
|
|
2654
2677
|
}
|
|
2655
2678
|
if (def.unionFallback || ctx.direction === "backward") {
|
|
@@ -2660,7 +2683,7 @@ var init_schemas = __esm(() => {
|
|
|
2660
2683
|
errors: [],
|
|
2661
2684
|
note: "No matching discriminator",
|
|
2662
2685
|
discriminator: def.discriminator,
|
|
2663
|
-
options: Array.from(disc.value.keys()),
|
|
2686
|
+
options: Array.from(disc.value.keys()).filter((value) => disc.value.get(value) !== null),
|
|
2664
2687
|
input,
|
|
2665
2688
|
path: [def.discriminator],
|
|
2666
2689
|
inst
|
|
@@ -2843,8 +2866,10 @@ var init_schemas = __esm(() => {
|
|
|
2843
2866
|
const values = getEnumValues(def.entries);
|
|
2844
2867
|
const valuesSet = new Set(values);
|
|
2845
2868
|
inst._zod.values = valuesSet;
|
|
2846
|
-
|
|
2847
|
-
|
|
2869
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
2870
|
+
const patternValues = getEnumValues(zod.def.entries).filter((k) => propertyKeyTypes.has(typeof k));
|
|
2871
|
+
return new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
|
|
2872
|
+
});
|
|
2848
2873
|
inst._zod.parse = (payload, _ctx) => {
|
|
2849
2874
|
const input = payload.value;
|
|
2850
2875
|
if (valuesSet.has(input)) {
|
|
@@ -2863,7 +2888,10 @@ var init_schemas = __esm(() => {
|
|
|
2863
2888
|
$ZodType.init(inst, def);
|
|
2864
2889
|
const values = new Set(def.values);
|
|
2865
2890
|
inst._zod.values = values;
|
|
2866
|
-
inst
|
|
2891
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
2892
|
+
const vals = zod.def.values;
|
|
2893
|
+
return new RegExp(vals.length ? `^(${vals.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
|
|
2894
|
+
});
|
|
2867
2895
|
inst._zod.parse = (payload, _ctx) => {
|
|
2868
2896
|
const input = payload.value;
|
|
2869
2897
|
if (values.has(input)) {
|
|
@@ -3090,27 +3118,49 @@ var init_schemas = __esm(() => {
|
|
|
3090
3118
|
});
|
|
3091
3119
|
|
|
3092
3120
|
// node_modules/zod/v4/core/memoizer.js
|
|
3121
|
+
function isRef(value) {
|
|
3122
|
+
return value !== null && typeof value === "object";
|
|
3123
|
+
}
|
|
3093
3124
|
function cloneIssues(issues) {
|
|
3094
3125
|
return issues.map((iss) => iss.path ? { ...iss, path: iss.path.slice() } : { ...iss });
|
|
3095
3126
|
}
|
|
3096
|
-
function isRecursive(inst, stack) {
|
|
3127
|
+
function isRecursive(inst, stack, resolve) {
|
|
3097
3128
|
const cached = recursive.get(inst);
|
|
3098
3129
|
if (cached !== undefined)
|
|
3099
|
-
return cached;
|
|
3130
|
+
return cached ? PROVEN : NONE;
|
|
3100
3131
|
if (stack.has(inst))
|
|
3101
|
-
return
|
|
3132
|
+
return PROVEN;
|
|
3102
3133
|
stack.add(inst);
|
|
3103
|
-
let result =
|
|
3134
|
+
let result = NONE;
|
|
3104
3135
|
const check = (child) => {
|
|
3105
|
-
if (
|
|
3106
|
-
|
|
3136
|
+
if (result !== PROVEN && child?._zod) {
|
|
3137
|
+
const answer = isRecursive(child, stack, resolve);
|
|
3138
|
+
if (answer > result)
|
|
3139
|
+
result = answer;
|
|
3140
|
+
}
|
|
3141
|
+
};
|
|
3142
|
+
const shape = (sh, spread) => {
|
|
3143
|
+
let answer = NONE;
|
|
3144
|
+
for (const key of Reflect.ownKeys(sh)) {
|
|
3145
|
+
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
3146
|
+
if (spread && !desc.enumerable)
|
|
3147
|
+
continue;
|
|
3148
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;
|
|
3149
|
+
if (child > answer)
|
|
3150
|
+
answer = child;
|
|
3151
|
+
}
|
|
3152
|
+
return answer;
|
|
3153
|
+
};
|
|
3154
|
+
const merge = (answer) => {
|
|
3155
|
+
if (answer > result)
|
|
3156
|
+
result = answer;
|
|
3107
3157
|
};
|
|
3108
3158
|
const def = inst._zod.def;
|
|
3109
3159
|
const kind = def.type;
|
|
3110
3160
|
switch (kind) {
|
|
3111
3161
|
case "object": {
|
|
3112
|
-
|
|
3113
|
-
|
|
3162
|
+
const raw = rawShape(def);
|
|
3163
|
+
merge(raw ? shape(raw, true) : ASSUMED);
|
|
3114
3164
|
check(def.catchall);
|
|
3115
3165
|
break;
|
|
3116
3166
|
}
|
|
@@ -3157,9 +3207,11 @@ function isRecursive(inst, stack) {
|
|
|
3157
3207
|
check(def.input);
|
|
3158
3208
|
check(def.output);
|
|
3159
3209
|
break;
|
|
3160
|
-
case "lazy":
|
|
3161
|
-
|
|
3210
|
+
case "lazy": {
|
|
3211
|
+
const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : undefined);
|
|
3212
|
+
merge(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
3162
3213
|
break;
|
|
3214
|
+
}
|
|
3163
3215
|
case "template_literal":
|
|
3164
3216
|
case "string":
|
|
3165
3217
|
case "number":
|
|
@@ -3198,13 +3250,17 @@ function isRecursive(inst, stack) {
|
|
|
3198
3250
|
}
|
|
3199
3251
|
}
|
|
3200
3252
|
stack.delete(inst);
|
|
3201
|
-
|
|
3202
|
-
|
|
3253
|
+
return settle(inst, result);
|
|
3254
|
+
}
|
|
3255
|
+
function settle(inst, answer) {
|
|
3256
|
+
if (answer !== ASSUMED)
|
|
3257
|
+
recursive.set(inst, answer === PROVEN);
|
|
3258
|
+
return answer;
|
|
3203
3259
|
}
|
|
3204
3260
|
function bucketFor(state, inst) {
|
|
3205
3261
|
let bucket = state.buckets.get(inst);
|
|
3206
3262
|
if (!bucket) {
|
|
3207
|
-
bucket = new
|
|
3263
|
+
bucket = new WeakMap;
|
|
3208
3264
|
state.buckets.set(inst, bucket);
|
|
3209
3265
|
}
|
|
3210
3266
|
return bucket;
|
|
@@ -3214,10 +3270,11 @@ function memoizer() {
|
|
|
3214
3270
|
}
|
|
3215
3271
|
function isBackEdge(ctx, value) {
|
|
3216
3272
|
const backEdges = ctx[STATE]?.backEdges;
|
|
3217
|
-
return backEdges !== undefined && value
|
|
3273
|
+
return backEdges !== undefined && isRef(value) && backEdges.has(value);
|
|
3218
3274
|
}
|
|
3219
|
-
var $ZodCyclicError, STATE = "~memo", NO_ISSUES, recursive, handoff, open, memo;
|
|
3275
|
+
var $ZodCyclicError, STATE = "~memo", NO_ISSUES, recursive, NONE = 0, ASSUMED = 1, PROVEN = 2, handoff, open, memo;
|
|
3220
3276
|
var init_memoizer = __esm(() => {
|
|
3277
|
+
init_util();
|
|
3221
3278
|
$ZodCyclicError = class $ZodCyclicError extends Error {
|
|
3222
3279
|
constructor() {
|
|
3223
3280
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -3256,6 +3313,7 @@ var init_memoizer = __esm(() => {
|
|
|
3256
3313
|
attach(inst) {
|
|
3257
3314
|
var _a;
|
|
3258
3315
|
let isRecursiveInst;
|
|
3316
|
+
let rechecked = false;
|
|
3259
3317
|
let lastCtx;
|
|
3260
3318
|
let lastBucket;
|
|
3261
3319
|
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
@@ -3263,20 +3321,24 @@ var init_memoizer = __esm(() => {
|
|
|
3263
3321
|
const base = inst._zod.parse;
|
|
3264
3322
|
const wrapped = (payload, ctx) => {
|
|
3265
3323
|
if (isRecursiveInst === undefined) {
|
|
3266
|
-
|
|
3267
|
-
if (
|
|
3324
|
+
const walked = isRecursive(inst, new Set, false);
|
|
3325
|
+
if (walked === NONE) {
|
|
3268
3326
|
inst._zod.parse = base;
|
|
3269
3327
|
if (inst._zod.run === wrapped)
|
|
3270
3328
|
inst._zod.run = base;
|
|
3271
3329
|
return base(payload, ctx);
|
|
3272
3330
|
}
|
|
3331
|
+
if (walked === PROVEN || rechecked)
|
|
3332
|
+
isRecursiveInst = true;
|
|
3333
|
+
else
|
|
3334
|
+
rechecked = true;
|
|
3273
3335
|
}
|
|
3274
3336
|
const input = payload.value;
|
|
3275
|
-
if (input
|
|
3337
|
+
if (!isRef(input))
|
|
3276
3338
|
return base(payload, ctx);
|
|
3277
3339
|
let state = ctx[STATE];
|
|
3278
3340
|
if (!state) {
|
|
3279
|
-
state = { buckets: new
|
|
3341
|
+
state = { buckets: new WeakMap, backEdges: undefined };
|
|
3280
3342
|
ctx[STATE] = state;
|
|
3281
3343
|
}
|
|
3282
3344
|
let bucket;
|
|
@@ -3295,7 +3357,7 @@ var init_memoizer = __esm(() => {
|
|
|
3295
3357
|
payload.issues.push(...cloneIssues(hit.issues));
|
|
3296
3358
|
} else {
|
|
3297
3359
|
payload.memo = true;
|
|
3298
|
-
state.backEdges ?? (state.backEdges = new
|
|
3360
|
+
state.backEdges ?? (state.backEdges = new WeakSet);
|
|
3299
3361
|
state.backEdges.add(hit.value);
|
|
3300
3362
|
}
|
|
3301
3363
|
return payload;
|
|
@@ -3369,7 +3431,9 @@ var error = () => {
|
|
|
3369
3431
|
base64url: "base64url-encoded string",
|
|
3370
3432
|
json_string: "JSON string",
|
|
3371
3433
|
e164: "E.164 number",
|
|
3434
|
+
currency_code: "currency code",
|
|
3372
3435
|
credit_card: "credit card number",
|
|
3436
|
+
iban: "IBAN",
|
|
3373
3437
|
jwt: "JWT",
|
|
3374
3438
|
template_literal: "input"
|
|
3375
3439
|
};
|
|
@@ -3543,11 +3607,13 @@ var init_compile = __esm(() => {
|
|
|
3543
3607
|
});
|
|
3544
3608
|
|
|
3545
3609
|
// node_modules/zod/v4/core/api.js
|
|
3610
|
+
function snapshotChecks(def) {
|
|
3611
|
+
if (def.checks)
|
|
3612
|
+
def.checks = [...def.checks];
|
|
3613
|
+
return def;
|
|
3614
|
+
}
|
|
3546
3615
|
function _string(Class, params) {
|
|
3547
|
-
return new Class({
|
|
3548
|
-
type: "string",
|
|
3549
|
-
...normalizeParams(params)
|
|
3550
|
-
});
|
|
3616
|
+
return new Class(snapshotChecks({ type: "string", ...normalizeParams(params) }));
|
|
3551
3617
|
}
|
|
3552
3618
|
function _email(Class, params) {
|
|
3553
3619
|
return new Class({
|
|
@@ -3787,19 +3853,10 @@ function _isoDuration(Class, params) {
|
|
|
3787
3853
|
});
|
|
3788
3854
|
}
|
|
3789
3855
|
function _number(Class, params) {
|
|
3790
|
-
return new Class({
|
|
3791
|
-
type: "number",
|
|
3792
|
-
checks: [],
|
|
3793
|
-
...normalizeParams(params)
|
|
3794
|
-
});
|
|
3856
|
+
return new Class(snapshotChecks({ type: "number", checks: [], ...normalizeParams(params) }));
|
|
3795
3857
|
}
|
|
3796
3858
|
function _coercedNumber(Class, params) {
|
|
3797
|
-
return new Class({
|
|
3798
|
-
type: "number",
|
|
3799
|
-
coerce: true,
|
|
3800
|
-
checks: [],
|
|
3801
|
-
...normalizeParams(params)
|
|
3802
|
-
});
|
|
3859
|
+
return new Class(snapshotChecks({ type: "number", coerce: true, checks: [], ...normalizeParams(params) }));
|
|
3803
3860
|
}
|
|
3804
3861
|
function _int(Class, params) {
|
|
3805
3862
|
return new Class({
|
|
@@ -4071,7 +4128,7 @@ function handleUnrepresentable(schema, ctx, json, params, message) {
|
|
|
4071
4128
|
Object.assign(json, result);
|
|
4072
4129
|
return true;
|
|
4073
4130
|
}
|
|
4074
|
-
function
|
|
4131
|
+
function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
4075
4132
|
var _a;
|
|
4076
4133
|
const def = schema._zod.def;
|
|
4077
4134
|
const seen = ctx.seen.get(schema);
|
|
@@ -4110,7 +4167,7 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
4110
4167
|
if (parent) {
|
|
4111
4168
|
if (!result.ref)
|
|
4112
4169
|
result.ref = parent;
|
|
4113
|
-
|
|
4170
|
+
processSchema(parent, ctx, params);
|
|
4114
4171
|
ctx.seen.get(parent).isParent = true;
|
|
4115
4172
|
}
|
|
4116
4173
|
}
|
|
@@ -4215,7 +4272,6 @@ function extractDefs(ctx, schema) {
|
|
|
4215
4272
|
if (seen.count > 1) {
|
|
4216
4273
|
if (ctx.reused === "ref") {
|
|
4217
4274
|
extractToDef(entry);
|
|
4218
|
-
continue;
|
|
4219
4275
|
}
|
|
4220
4276
|
}
|
|
4221
4277
|
}
|
|
@@ -4538,13 +4594,13 @@ function isTransforming(_schema, _ctx) {
|
|
|
4538
4594
|
}
|
|
4539
4595
|
var FOLDABLE_KEYS, UNION_KEYS, createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
4540
4596
|
const ctx = initializeContext({ ...params, processors });
|
|
4541
|
-
|
|
4597
|
+
processSchema(schema, ctx);
|
|
4542
4598
|
extractDefs(ctx, schema);
|
|
4543
4599
|
return finalize(ctx, schema);
|
|
4544
4600
|
}, createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
4545
4601
|
const { libraryOptions, target } = params ?? {};
|
|
4546
4602
|
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
4547
|
-
|
|
4603
|
+
processSchema(schema, ctx);
|
|
4548
4604
|
extractDefs(ctx, schema);
|
|
4549
4605
|
return finalize(ctx, schema);
|
|
4550
4606
|
};
|
|
@@ -4556,6 +4612,34 @@ var init_to_json_schema = __esm(() => {
|
|
|
4556
4612
|
});
|
|
4557
4613
|
|
|
4558
4614
|
// node_modules/zod/v4/core/json-schema-processors.js
|
|
4615
|
+
function aggregateChecks(schema) {
|
|
4616
|
+
const agg = {};
|
|
4617
|
+
const def = schema._zod.def;
|
|
4618
|
+
const list = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
|
|
4619
|
+
for (const ch of list)
|
|
4620
|
+
contributors[ch._zod.def.check]?.(agg, ch._zod.def);
|
|
4621
|
+
const bag = schema._zod.bag;
|
|
4622
|
+
if (bag.minimum !== undefined)
|
|
4623
|
+
narrowMin(agg, "minimum", bag.minimum);
|
|
4624
|
+
if (bag.exclusiveMinimum !== undefined)
|
|
4625
|
+
narrowMin(agg, "exclusiveMinimum", bag.exclusiveMinimum);
|
|
4626
|
+
if (bag.maximum !== undefined)
|
|
4627
|
+
narrowMax(agg, "maximum", bag.maximum);
|
|
4628
|
+
if (bag.exclusiveMaximum !== undefined)
|
|
4629
|
+
narrowMax(agg, "exclusiveMaximum", bag.exclusiveMaximum);
|
|
4630
|
+
if (bag.multipleOf !== undefined)
|
|
4631
|
+
addDivisor(agg, bag.multipleOf);
|
|
4632
|
+
if (bag.format !== undefined) {
|
|
4633
|
+
agg.format ?? (agg.format = bag.format);
|
|
4634
|
+
if (bag.format.includes("int"))
|
|
4635
|
+
agg.isInt = true;
|
|
4636
|
+
}
|
|
4637
|
+
if (bag.mime)
|
|
4638
|
+
intersectMime(agg, bag.mime);
|
|
4639
|
+
for (const pattern of bag.patterns ?? [])
|
|
4640
|
+
addPattern(agg, pattern);
|
|
4641
|
+
return agg;
|
|
4642
|
+
}
|
|
4559
4643
|
function inputOptin(schema) {
|
|
4560
4644
|
const def = schema._zod.def;
|
|
4561
4645
|
if (def.type === "pipe" && def.in._zod.traits.has("$ZodTransform")) {
|
|
@@ -4648,7 +4732,7 @@ function toJSONSchema(input, params) {
|
|
|
4648
4732
|
const defs = {};
|
|
4649
4733
|
for (const entry of registry._idmap.entries()) {
|
|
4650
4734
|
const [_, schema] = entry;
|
|
4651
|
-
|
|
4735
|
+
processSchema(schema, ctx);
|
|
4652
4736
|
}
|
|
4653
4737
|
const schemas = {};
|
|
4654
4738
|
const external = {
|
|
@@ -4671,14 +4755,41 @@ function toJSONSchema(input, params) {
|
|
|
4671
4755
|
return { schemas };
|
|
4672
4756
|
}
|
|
4673
4757
|
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
4674
|
-
|
|
4758
|
+
processSchema(input, ctx);
|
|
4675
4759
|
extractDefs(ctx, input);
|
|
4676
4760
|
return finalize(ctx, input);
|
|
4677
4761
|
}
|
|
4678
|
-
var
|
|
4762
|
+
var narrowMin = (agg, key, value) => {
|
|
4763
|
+
if (agg[key] === undefined || value > agg[key])
|
|
4764
|
+
agg[key] = value;
|
|
4765
|
+
}, narrowMax = (agg, key, value) => {
|
|
4766
|
+
if (agg[key] === undefined || value < agg[key])
|
|
4767
|
+
agg[key] = value;
|
|
4768
|
+
}, narrowBoth = (agg, value) => {
|
|
4769
|
+
narrowMin(agg, "minimum", value);
|
|
4770
|
+
narrowMax(agg, "maximum", value);
|
|
4771
|
+
}, addDivisor = (agg, value) => {
|
|
4772
|
+
agg.multipleOf ?? (agg.multipleOf = []);
|
|
4773
|
+
if (!agg.multipleOf.includes(value))
|
|
4774
|
+
agg.multipleOf.push(value);
|
|
4775
|
+
}, addPattern = (agg, pattern) => {
|
|
4776
|
+
agg.patterns ?? (agg.patterns = new Set);
|
|
4777
|
+
agg.patterns.add(pattern);
|
|
4778
|
+
}, intersectMime = (agg, mime) => {
|
|
4779
|
+
agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];
|
|
4780
|
+
}, setFormat = (agg, format) => {
|
|
4781
|
+
agg.format = format;
|
|
4782
|
+
if (format.includes("int"))
|
|
4783
|
+
agg.isInt = true;
|
|
4784
|
+
}, minContributor = (agg, def) => narrowMin(agg, "minimum", def.minimum), maxContributor = (agg, def) => narrowMax(agg, "maximum", def.maximum), formatContributor = (ranges) => (agg, def) => {
|
|
4785
|
+
setFormat(agg, def.format);
|
|
4786
|
+
const [minimum, maximum] = ranges[def.format];
|
|
4787
|
+
narrowMin(agg, "minimum", minimum);
|
|
4788
|
+
narrowMax(agg, "maximum", maximum);
|
|
4789
|
+
}, contributors, formatMap, exactPatterns, exactPattern = (p) => exactPatterns.get(p) ?? p, stringProcessor = (schema, ctx, _json, _params) => {
|
|
4679
4790
|
const json = _json;
|
|
4680
4791
|
json.type = "string";
|
|
4681
|
-
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema
|
|
4792
|
+
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
|
|
4682
4793
|
if (typeof minimum === "number")
|
|
4683
4794
|
json.minLength = minimum;
|
|
4684
4795
|
if (typeof maximum === "number")
|
|
@@ -4694,7 +4805,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
4694
4805
|
if (contentEncoding)
|
|
4695
4806
|
json.contentEncoding = contentEncoding;
|
|
4696
4807
|
if (patterns && patterns.size > 0) {
|
|
4697
|
-
const patternList = [...patterns];
|
|
4808
|
+
const patternList = [...patterns].map(exactPattern);
|
|
4698
4809
|
if (patternList.length === 1)
|
|
4699
4810
|
json.pattern = patternList[0].source;
|
|
4700
4811
|
else if (patternList.length > 1) {
|
|
@@ -4708,11 +4819,8 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
4708
4819
|
}
|
|
4709
4820
|
}, numberProcessor = (schema, ctx, _json, params) => {
|
|
4710
4821
|
const json = _json;
|
|
4711
|
-
const { minimum, maximum,
|
|
4712
|
-
|
|
4713
|
-
json.type = "integer";
|
|
4714
|
-
else
|
|
4715
|
-
json.type = "number";
|
|
4822
|
+
const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);
|
|
4823
|
+
json.type = isInt ? "integer" : "number";
|
|
4716
4824
|
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
4717
4825
|
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
4718
4826
|
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
@@ -4736,11 +4844,19 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
4736
4844
|
} else if (typeof maximum === "number") {
|
|
4737
4845
|
json.maximum = maximum;
|
|
4738
4846
|
}
|
|
4739
|
-
if (
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4847
|
+
if (multipleOf) {
|
|
4848
|
+
const divisors = new Set;
|
|
4849
|
+
for (const divisor of multipleOf) {
|
|
4850
|
+
if (Number.isFinite(divisor) && divisor !== 0)
|
|
4851
|
+
divisors.add(Math.abs(divisor));
|
|
4852
|
+
else
|
|
4853
|
+
handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);
|
|
4854
|
+
}
|
|
4855
|
+
const [first, ...rest] = divisors;
|
|
4856
|
+
if (first !== undefined)
|
|
4857
|
+
json.multipleOf = first;
|
|
4858
|
+
if (rest.length)
|
|
4859
|
+
json.allOf = [...json.allOf ?? [], ...rest.map((m) => ({ multipleOf: m }))];
|
|
4744
4860
|
}
|
|
4745
4861
|
}, booleanProcessor = (_schema, _ctx, json, _params) => {
|
|
4746
4862
|
json.type = "boolean";
|
|
@@ -4825,27 +4941,22 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
4825
4941
|
_json.pattern = pattern.source;
|
|
4826
4942
|
}, fileProcessor = (schema, _ctx, json, _params) => {
|
|
4827
4943
|
const _json = json;
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
};
|
|
4833
|
-
const { minimum, maximum, mime } = schema._zod.bag;
|
|
4944
|
+
_json.type = "string";
|
|
4945
|
+
_json.format = "binary";
|
|
4946
|
+
_json.contentEncoding = "binary";
|
|
4947
|
+
const { minimum, maximum, mime } = aggregateChecks(schema);
|
|
4834
4948
|
if (minimum !== undefined)
|
|
4835
|
-
|
|
4949
|
+
_json.minLength = minimum;
|
|
4836
4950
|
if (maximum !== undefined)
|
|
4837
|
-
|
|
4838
|
-
if (mime)
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
}
|
|
4846
|
-
} else {
|
|
4847
|
-
Object.assign(_json, file);
|
|
4848
|
-
}
|
|
4951
|
+
_json.maxLength = maximum;
|
|
4952
|
+
if (!mime)
|
|
4953
|
+
return;
|
|
4954
|
+
if (mime.length === 0)
|
|
4955
|
+
_json.not = {};
|
|
4956
|
+
else if (mime.length === 1)
|
|
4957
|
+
_json.contentMediaType = mime[0];
|
|
4958
|
+
else
|
|
4959
|
+
_json.anyOf = mime.map((m) => ({ contentMediaType: m }));
|
|
4849
4960
|
}, successProcessor = (_schema, _ctx, json, _params) => {
|
|
4850
4961
|
json.type = "boolean";
|
|
4851
4962
|
}, customProcessor = (schema, ctx, json, params) => {
|
|
@@ -4861,13 +4972,13 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
4861
4972
|
}, arrayProcessor = (schema, ctx, _json, params) => {
|
|
4862
4973
|
const json = _json;
|
|
4863
4974
|
const def = schema._zod.def;
|
|
4864
|
-
const { minimum, maximum } = schema
|
|
4975
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
4865
4976
|
if (typeof minimum === "number")
|
|
4866
4977
|
json.minItems = minimum;
|
|
4867
4978
|
if (typeof maximum === "number")
|
|
4868
4979
|
json.maxItems = maximum;
|
|
4869
4980
|
json.type = "array";
|
|
4870
|
-
json.items =
|
|
4981
|
+
json.items = processSchema(def.element, ctx, {
|
|
4871
4982
|
...params,
|
|
4872
4983
|
path: [...params.path, "items"]
|
|
4873
4984
|
});
|
|
@@ -4882,22 +4993,20 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
4882
4993
|
json.type = "object";
|
|
4883
4994
|
json.properties = {};
|
|
4884
4995
|
for (const key in shape) {
|
|
4885
|
-
assignProp(json.properties, key,
|
|
4996
|
+
assignProp(json.properties, key, processSchema(shape[key], ctx, {
|
|
4886
4997
|
...params,
|
|
4887
4998
|
path: [...params.path, "properties", key]
|
|
4888
4999
|
}));
|
|
4889
5000
|
}
|
|
4890
|
-
const
|
|
4891
|
-
const
|
|
5001
|
+
const requiredKeys = [];
|
|
5002
|
+
for (const key of Object.keys(shape)) {
|
|
4892
5003
|
const field = def.shape[key];
|
|
4893
|
-
if (ctx.io === "input") {
|
|
4894
|
-
|
|
4895
|
-
} else {
|
|
4896
|
-
return field._zod.optout === undefined;
|
|
5004
|
+
if (ctx.io === "input" ? inputOptin(field) === undefined : field._zod.optout === undefined) {
|
|
5005
|
+
requiredKeys.push(key);
|
|
4897
5006
|
}
|
|
4898
|
-
}
|
|
4899
|
-
if (requiredKeys.
|
|
4900
|
-
json.required =
|
|
5007
|
+
}
|
|
5008
|
+
if (requiredKeys.length > 0) {
|
|
5009
|
+
json.required = requiredKeys;
|
|
4901
5010
|
}
|
|
4902
5011
|
if (def.catchall?._zod.def.type === "never") {
|
|
4903
5012
|
json.additionalProperties = false;
|
|
@@ -4905,7 +5014,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
4905
5014
|
if (ctx.io === "output")
|
|
4906
5015
|
json.additionalProperties = false;
|
|
4907
5016
|
} else if (def.catchall) {
|
|
4908
|
-
json.additionalProperties =
|
|
5017
|
+
json.additionalProperties = processSchema(def.catchall, ctx, {
|
|
4909
5018
|
...params,
|
|
4910
5019
|
path: [...params.path, "additionalProperties"]
|
|
4911
5020
|
});
|
|
@@ -4913,7 +5022,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
4913
5022
|
}, unionProcessor = (schema, ctx, json, params) => {
|
|
4914
5023
|
const def = schema._zod.def;
|
|
4915
5024
|
const isExclusive = def.inclusive === false;
|
|
4916
|
-
const options = def.options.map((x, i) =>
|
|
5025
|
+
const options = def.options.map((x, i) => processSchema(x, ctx, {
|
|
4917
5026
|
...params,
|
|
4918
5027
|
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
4919
5028
|
}));
|
|
@@ -4924,11 +5033,11 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
4924
5033
|
}
|
|
4925
5034
|
}, intersectionProcessor = (schema, ctx, json, params) => {
|
|
4926
5035
|
const def = schema._zod.def;
|
|
4927
|
-
const a =
|
|
5036
|
+
const a = processSchema(def.left, ctx, {
|
|
4928
5037
|
...params,
|
|
4929
5038
|
path: [...params.path, "allOf", 0]
|
|
4930
5039
|
});
|
|
4931
|
-
const b =
|
|
5040
|
+
const b = processSchema(def.right, ctx, {
|
|
4932
5041
|
...params,
|
|
4933
5042
|
path: [...params.path, "allOf", 1]
|
|
4934
5043
|
});
|
|
@@ -4945,11 +5054,11 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
4945
5054
|
json.type = "array";
|
|
4946
5055
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
4947
5056
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
4948
|
-
const prefixItems = def.items.map((x, i) =>
|
|
5057
|
+
const prefixItems = def.items.map((x, i) => processSchema(x, ctx, {
|
|
4949
5058
|
...params,
|
|
4950
5059
|
path: [...params.path, prefixPath, i]
|
|
4951
5060
|
}));
|
|
4952
|
-
const rest = def.rest ?
|
|
5061
|
+
const rest = def.rest ? processSchema(def.rest, ctx, {
|
|
4953
5062
|
...params,
|
|
4954
5063
|
path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
|
|
4955
5064
|
}) : null;
|
|
@@ -4997,7 +5106,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
4997
5106
|
if (isClosed)
|
|
4998
5107
|
json.maxItems = maxItems;
|
|
4999
5108
|
}
|
|
5000
|
-
const { minimum, maximum } = schema
|
|
5109
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
5001
5110
|
if (typeof minimum === "number")
|
|
5002
5111
|
json.minItems = minimum;
|
|
5003
5112
|
if (typeof maximum === "number")
|
|
@@ -5007,20 +5116,19 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
5007
5116
|
const def = schema._zod.def;
|
|
5008
5117
|
json.type = "object";
|
|
5009
5118
|
const keyType = def.keyType;
|
|
5010
|
-
const
|
|
5011
|
-
const patterns = keyBag?.patterns;
|
|
5119
|
+
const patterns = aggregateChecks(keyType).patterns;
|
|
5012
5120
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
5013
|
-
const valueSchema =
|
|
5121
|
+
const valueSchema = processSchema(def.valueType, ctx, {
|
|
5014
5122
|
...params,
|
|
5015
5123
|
path: [...params.path, "patternProperties", "*"]
|
|
5016
5124
|
});
|
|
5017
5125
|
json.patternProperties = {};
|
|
5018
5126
|
for (const pattern of patterns) {
|
|
5019
|
-
assignProp(json.patternProperties, pattern.source, valueSchema);
|
|
5127
|
+
assignProp(json.patternProperties, exactPattern(pattern).source, valueSchema);
|
|
5020
5128
|
}
|
|
5021
5129
|
} else {
|
|
5022
5130
|
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
5023
|
-
json.propertyNames =
|
|
5131
|
+
json.propertyNames = processSchema(def.keyType, ctx, {
|
|
5024
5132
|
...params,
|
|
5025
5133
|
path: [...params.path, "propertyNames"]
|
|
5026
5134
|
});
|
|
@@ -5032,7 +5140,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
5032
5140
|
}
|
|
5033
5141
|
pending.push(schema);
|
|
5034
5142
|
}
|
|
5035
|
-
json.additionalProperties =
|
|
5143
|
+
json.additionalProperties = processSchema(def.valueType, ctx, {
|
|
5036
5144
|
...params,
|
|
5037
5145
|
path: [...params.path, "additionalProperties"]
|
|
5038
5146
|
});
|
|
@@ -5047,7 +5155,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
5047
5155
|
}
|
|
5048
5156
|
}, nullableProcessor = (schema, ctx, json, params) => {
|
|
5049
5157
|
const def = schema._zod.def;
|
|
5050
|
-
const inner =
|
|
5158
|
+
const inner = processSchema(def.innerType, ctx, params);
|
|
5051
5159
|
const seen = ctx.seen.get(schema);
|
|
5052
5160
|
if (ctx.target === "openapi-3.0") {
|
|
5053
5161
|
seen.ref = def.innerType;
|
|
@@ -5057,12 +5165,12 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
5057
5165
|
}
|
|
5058
5166
|
}, nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
5059
5167
|
const def = schema._zod.def;
|
|
5060
|
-
|
|
5168
|
+
processSchema(def.innerType, ctx, params);
|
|
5061
5169
|
const seen = ctx.seen.get(schema);
|
|
5062
5170
|
seen.ref = def.innerType;
|
|
5063
5171
|
}, UNREPRESENTABLE_DEFAULT, defaultProcessor = (schema, ctx, json, params) => {
|
|
5064
5172
|
const def = schema._zod.def;
|
|
5065
|
-
|
|
5173
|
+
processSchema(def.innerType, ctx, params);
|
|
5066
5174
|
const seen = ctx.seen.get(schema);
|
|
5067
5175
|
seen.ref = def.innerType;
|
|
5068
5176
|
const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
|
|
@@ -5070,7 +5178,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
5070
5178
|
json.default = value;
|
|
5071
5179
|
}, prefaultProcessor = (schema, ctx, json, params) => {
|
|
5072
5180
|
const def = schema._zod.def;
|
|
5073
|
-
|
|
5181
|
+
processSchema(def.innerType, ctx, params);
|
|
5074
5182
|
const seen = ctx.seen.get(schema);
|
|
5075
5183
|
seen.ref = def.innerType;
|
|
5076
5184
|
if (ctx.io !== "input")
|
|
@@ -5080,7 +5188,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
5080
5188
|
json._prefault = value;
|
|
5081
5189
|
}, catchProcessor = (schema, ctx, json, params) => {
|
|
5082
5190
|
const def = schema._zod.def;
|
|
5083
|
-
|
|
5191
|
+
processSchema(def.innerType, ctx, params);
|
|
5084
5192
|
const seen = ctx.seen.get(schema);
|
|
5085
5193
|
seen.ref = def.innerType;
|
|
5086
5194
|
let catchValue;
|
|
@@ -5095,35 +5203,59 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
5095
5203
|
const def = schema._zod.def;
|
|
5096
5204
|
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
5097
5205
|
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
5098
|
-
|
|
5206
|
+
processSchema(innerType, ctx, params);
|
|
5099
5207
|
const seen = ctx.seen.get(schema);
|
|
5100
5208
|
seen.ref = innerType;
|
|
5101
5209
|
}, readonlyProcessor = (schema, ctx, json, params) => {
|
|
5102
5210
|
const def = schema._zod.def;
|
|
5103
|
-
|
|
5211
|
+
processSchema(def.innerType, ctx, params);
|
|
5104
5212
|
const seen = ctx.seen.get(schema);
|
|
5105
5213
|
seen.ref = def.innerType;
|
|
5106
5214
|
json.readOnly = true;
|
|
5107
5215
|
}, promiseProcessor = (schema, ctx, _json, params) => {
|
|
5108
5216
|
const def = schema._zod.def;
|
|
5109
|
-
|
|
5217
|
+
processSchema(def.innerType, ctx, params);
|
|
5110
5218
|
const seen = ctx.seen.get(schema);
|
|
5111
5219
|
seen.ref = def.innerType;
|
|
5112
5220
|
}, optionalProcessor = (schema, ctx, _json, params) => {
|
|
5113
5221
|
const def = schema._zod.def;
|
|
5114
|
-
|
|
5222
|
+
processSchema(def.innerType, ctx, params);
|
|
5115
5223
|
const seen = ctx.seen.get(schema);
|
|
5116
5224
|
seen.ref = def.innerType;
|
|
5117
5225
|
}, lazyProcessor = (schema, ctx, _json, params) => {
|
|
5118
5226
|
const innerType = schema._zod.innerType;
|
|
5119
|
-
|
|
5227
|
+
processSchema(innerType, ctx, params);
|
|
5120
5228
|
const seen = ctx.seen.get(schema);
|
|
5121
5229
|
seen.ref = innerType;
|
|
5122
5230
|
}, allProcessors;
|
|
5123
5231
|
var init_json_schema_processors = __esm(() => {
|
|
5124
5232
|
init_regexes();
|
|
5233
|
+
init_schemas();
|
|
5125
5234
|
init_to_json_schema();
|
|
5126
5235
|
init_util();
|
|
5236
|
+
contributors = {
|
|
5237
|
+
greater_than: (agg, def) => narrowMin(agg, def.inclusive ? "minimum" : "exclusiveMinimum", def.value),
|
|
5238
|
+
less_than: (agg, def) => narrowMax(agg, def.inclusive ? "maximum" : "exclusiveMaximum", def.value),
|
|
5239
|
+
multiple_of: (agg, def) => addDivisor(agg, def.value),
|
|
5240
|
+
number_format: formatContributor(NUMBER_FORMAT_RANGES),
|
|
5241
|
+
bigint_format: formatContributor(BIGINT_FORMAT_RANGES),
|
|
5242
|
+
min_length: minContributor,
|
|
5243
|
+
max_length: maxContributor,
|
|
5244
|
+
length_equals: (agg, def) => narrowBoth(agg, def.length),
|
|
5245
|
+
min_size: minContributor,
|
|
5246
|
+
max_size: maxContributor,
|
|
5247
|
+
size_equals: (agg, def) => narrowBoth(agg, def.size),
|
|
5248
|
+
string_format: (agg, def) => {
|
|
5249
|
+
setFormat(agg, def.format);
|
|
5250
|
+
if (def.pattern)
|
|
5251
|
+
addPattern(agg, def.pattern);
|
|
5252
|
+
if (def.format === "base64" || def.format === "base64url")
|
|
5253
|
+
agg.contentEncoding = def.format;
|
|
5254
|
+
if (def.local || def.precision === -1)
|
|
5255
|
+
agg.laxFormat = true;
|
|
5256
|
+
},
|
|
5257
|
+
mime_type: (agg, def) => intersectMime(agg, def.mime)
|
|
5258
|
+
};
|
|
5127
5259
|
formatMap = {
|
|
5128
5260
|
guid: "uuid",
|
|
5129
5261
|
url: "uri",
|
|
@@ -5131,6 +5263,10 @@ var init_json_schema_processors = __esm(() => {
|
|
|
5131
5263
|
json_string: "json-string",
|
|
5132
5264
|
regex: ""
|
|
5133
5265
|
};
|
|
5266
|
+
exactPatterns = new Map([
|
|
5267
|
+
[base64Charset, base64],
|
|
5268
|
+
[base64urlCharset, base64url]
|
|
5269
|
+
]);
|
|
5134
5270
|
pendingRecords = new WeakMap;
|
|
5135
5271
|
UNREPRESENTABLE_DEFAULT = Symbol();
|
|
5136
5272
|
allProcessors = {
|
|
@@ -5259,6 +5395,7 @@ var parse3, parseAsync2, safeParse2, safeParseAsync2, encode, decode, encodeAsyn
|
|
|
5259
5395
|
var init_parse2 = __esm(() => {
|
|
5260
5396
|
init_core2();
|
|
5261
5397
|
init_errors2();
|
|
5398
|
+
init_core2();
|
|
5262
5399
|
parse3 = /* @__PURE__ */ _parse(ZodRealError);
|
|
5263
5400
|
parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
5264
5401
|
safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -5609,6 +5746,12 @@ var init_schemas2 = __esm(() => {
|
|
|
5609
5746
|
set spa(value) {
|
|
5610
5747
|
own(this, "spa", value);
|
|
5611
5748
|
},
|
|
5749
|
+
validate(data, params) {
|
|
5750
|
+
return validate(this, data, params);
|
|
5751
|
+
},
|
|
5752
|
+
validateAsync(data, params) {
|
|
5753
|
+
return validateAsync(this, data, params);
|
|
5754
|
+
},
|
|
5612
5755
|
encode: function _encode(data, params) {
|
|
5613
5756
|
return encode(this, data, params, { callee: _encode });
|
|
5614
5757
|
},
|
|
@@ -5647,10 +5790,10 @@ var init_schemas2 = __esm(() => {
|
|
|
5647
5790
|
$ZodString.init(inst, def);
|
|
5648
5791
|
ZodType.init(inst, def);
|
|
5649
5792
|
inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5793
|
+
}, /* @__PURE__ */ derived({
|
|
5794
|
+
format: (inst) => aggregateChecks(inst).format ?? null,
|
|
5795
|
+
minLength: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
5796
|
+
maxLength: (inst) => aggregateChecks(inst).maximum ?? null
|
|
5654
5797
|
}, {
|
|
5655
5798
|
regex(...args) {
|
|
5656
5799
|
return this.check(_regex(...args));
|
|
@@ -5697,7 +5840,7 @@ var init_schemas2 = __esm(() => {
|
|
|
5697
5840
|
slugify() {
|
|
5698
5841
|
return this.check(_slugify());
|
|
5699
5842
|
}
|
|
5700
|
-
});
|
|
5843
|
+
}));
|
|
5701
5844
|
ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
|
|
5702
5845
|
$ZodString.init(inst, def);
|
|
5703
5846
|
_ZodString.init(inst, def);
|
|
@@ -5881,12 +6024,21 @@ var init_schemas2 = __esm(() => {
|
|
|
5881
6024
|
$ZodNumber.init(inst, def);
|
|
5882
6025
|
ZodType.init(inst, def);
|
|
5883
6026
|
inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
|
|
5884
|
-
const bag = inst._zod.bag;
|
|
5885
|
-
inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
|
|
5886
|
-
inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
|
|
5887
|
-
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
|
|
5888
6027
|
inst.isFinite = true;
|
|
5889
|
-
|
|
6028
|
+
}, /* @__PURE__ */ derived({
|
|
6029
|
+
minValue: (inst) => {
|
|
6030
|
+
const { minimum, exclusiveMinimum } = aggregateChecks(inst);
|
|
6031
|
+
return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
|
|
6032
|
+
},
|
|
6033
|
+
maxValue: (inst) => {
|
|
6034
|
+
const { maximum, exclusiveMaximum } = aggregateChecks(inst);
|
|
6035
|
+
return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
|
|
6036
|
+
},
|
|
6037
|
+
isInt: (inst) => {
|
|
6038
|
+
const { isInt, multipleOf } = aggregateChecks(inst);
|
|
6039
|
+
return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
|
|
6040
|
+
},
|
|
6041
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
5890
6042
|
}, {
|
|
5891
6043
|
gt(value, params) {
|
|
5892
6044
|
return this.check(_gt(value, params));
|
|
@@ -5933,7 +6085,7 @@ var init_schemas2 = __esm(() => {
|
|
|
5933
6085
|
finite() {
|
|
5934
6086
|
return this;
|
|
5935
6087
|
}
|
|
5936
|
-
});
|
|
6088
|
+
}));
|
|
5937
6089
|
ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => {
|
|
5938
6090
|
$ZodNumberFormat.init(inst, def);
|
|
5939
6091
|
ZodNumber.init(inst, def);
|
|
@@ -5997,19 +6149,19 @@ var init_schemas2 = __esm(() => {
|
|
|
5997
6149
|
return _enum(Object.keys(this._zod.def.shape));
|
|
5998
6150
|
},
|
|
5999
6151
|
catchall(catchall) {
|
|
6000
|
-
return this.clone(
|
|
6152
|
+
return this.clone(mergeDefs(this._zod.def, { catchall }));
|
|
6001
6153
|
},
|
|
6002
6154
|
passthrough() {
|
|
6003
|
-
return this.clone(
|
|
6155
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
6004
6156
|
},
|
|
6005
6157
|
loose() {
|
|
6006
|
-
return this.clone(
|
|
6158
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
6007
6159
|
},
|
|
6008
6160
|
strict() {
|
|
6009
|
-
return this.clone(
|
|
6161
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: never() }));
|
|
6010
6162
|
},
|
|
6011
6163
|
strip() {
|
|
6012
|
-
return this.clone(
|
|
6164
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: undefined }));
|
|
6013
6165
|
},
|
|
6014
6166
|
extend(incoming) {
|
|
6015
6167
|
return extend(this, incoming);
|
|
@@ -6064,7 +6216,7 @@ var init_schemas2 = __esm(() => {
|
|
|
6064
6216
|
ZodType.init(inst, def);
|
|
6065
6217
|
inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
|
|
6066
6218
|
inst.enum = def.entries;
|
|
6067
|
-
inst.options =
|
|
6219
|
+
inst.options = [...inst._zod.values];
|
|
6068
6220
|
const keys = new Set(Object.keys(def.entries));
|
|
6069
6221
|
inst.extract = (values, params) => {
|
|
6070
6222
|
const newEntries = {};
|
|
@@ -28019,6 +28171,9 @@ var require_proxy_addr = __commonJS(function(exports, module) {
|
|
|
28019
28171
|
if (!isip(addr))
|
|
28020
28172
|
return false;
|
|
28021
28173
|
var ip = parseip(addr);
|
|
28174
|
+
if (ip.kind() === "ipv6" && ip.isIPv4MappedAddress()) {
|
|
28175
|
+
ip = ip.toIPv4Address();
|
|
28176
|
+
}
|
|
28022
28177
|
var ipconv;
|
|
28023
28178
|
var kind = ip.kind();
|
|
28024
28179
|
for (var i = 0;i < subnets.length; i++) {
|
|
@@ -28031,10 +28186,15 @@ var require_proxy_addr = __commonJS(function(exports, module) {
|
|
|
28031
28186
|
if (subnetkind === "ipv4" && !ip.isIPv4MappedAddress()) {
|
|
28032
28187
|
continue;
|
|
28033
28188
|
}
|
|
28189
|
+
if (subnetkind !== "ipv4" && !(subnetrange >= 96 && subnetip.isIPv4MappedAddress())) {
|
|
28190
|
+
continue;
|
|
28191
|
+
}
|
|
28034
28192
|
if (!ipconv) {
|
|
28035
28193
|
ipconv = subnetkind === "ipv4" ? ip.toIPv4Address() : ip.toIPv4MappedAddress();
|
|
28036
28194
|
}
|
|
28037
28195
|
trusted = ipconv;
|
|
28196
|
+
} else if (kind === "ipv6" && subnetip.isIPv4MappedAddress()) {
|
|
28197
|
+
continue;
|
|
28038
28198
|
}
|
|
28039
28199
|
if (trusted.match(subnetip, subnetrange)) {
|
|
28040
28200
|
return true;
|
|
@@ -28052,12 +28212,20 @@ var require_proxy_addr = __commonJS(function(exports, module) {
|
|
|
28052
28212
|
if (!isip(addr))
|
|
28053
28213
|
return false;
|
|
28054
28214
|
var ip = parseip(addr);
|
|
28215
|
+
if (ip.kind() === "ipv6" && ip.isIPv4MappedAddress()) {
|
|
28216
|
+
ip = ip.toIPv4Address();
|
|
28217
|
+
}
|
|
28055
28218
|
var kind = ip.kind();
|
|
28056
28219
|
if (kind !== subnetkind) {
|
|
28057
28220
|
if (subnetisipv4 && !ip.isIPv4MappedAddress()) {
|
|
28058
28221
|
return false;
|
|
28059
28222
|
}
|
|
28223
|
+
if (!subnetisipv4 && !(subnetrange >= 96 && subnetip.isIPv4MappedAddress())) {
|
|
28224
|
+
return false;
|
|
28225
|
+
}
|
|
28060
28226
|
ip = subnetisipv4 ? ip.toIPv4Address() : ip.toIPv4MappedAddress();
|
|
28227
|
+
} else if (kind === "ipv6" && subnetip.isIPv4MappedAddress()) {
|
|
28228
|
+
return false;
|
|
28061
28229
|
}
|
|
28062
28230
|
return ip.match(subnetip, subnetrange);
|
|
28063
28231
|
};
|
|
@@ -36654,7 +36822,7 @@ function parseStringDef(def, refs) {
|
|
|
36654
36822
|
addFormat(res, "idn-email", check.message, refs);
|
|
36655
36823
|
break;
|
|
36656
36824
|
case "pattern:zod":
|
|
36657
|
-
|
|
36825
|
+
addPattern2(res, zodPatterns.email, check.message, refs);
|
|
36658
36826
|
break;
|
|
36659
36827
|
}
|
|
36660
36828
|
break;
|
|
@@ -36665,19 +36833,19 @@ function parseStringDef(def, refs) {
|
|
|
36665
36833
|
addFormat(res, "uuid", check.message, refs);
|
|
36666
36834
|
break;
|
|
36667
36835
|
case "regex":
|
|
36668
|
-
|
|
36836
|
+
addPattern2(res, check.regex, check.message, refs);
|
|
36669
36837
|
break;
|
|
36670
36838
|
case "cuid":
|
|
36671
|
-
|
|
36839
|
+
addPattern2(res, zodPatterns.cuid, check.message, refs);
|
|
36672
36840
|
break;
|
|
36673
36841
|
case "cuid2":
|
|
36674
|
-
|
|
36842
|
+
addPattern2(res, zodPatterns.cuid2, check.message, refs);
|
|
36675
36843
|
break;
|
|
36676
36844
|
case "startsWith":
|
|
36677
|
-
|
|
36845
|
+
addPattern2(res, RegExp(`^${escapeLiteralCheckValue(check.value, refs)}`), check.message, refs);
|
|
36678
36846
|
break;
|
|
36679
36847
|
case "endsWith":
|
|
36680
|
-
|
|
36848
|
+
addPattern2(res, RegExp(`${escapeLiteralCheckValue(check.value, refs)}$`), check.message, refs);
|
|
36681
36849
|
break;
|
|
36682
36850
|
case "datetime":
|
|
36683
36851
|
addFormat(res, "date-time", check.message, refs);
|
|
@@ -36696,7 +36864,7 @@ function parseStringDef(def, refs) {
|
|
|
36696
36864
|
setResponseValueAndErrors(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check.value) : check.value, check.message, refs);
|
|
36697
36865
|
break;
|
|
36698
36866
|
case "includes": {
|
|
36699
|
-
|
|
36867
|
+
addPattern2(res, RegExp(escapeLiteralCheckValue(check.value, refs)), check.message, refs);
|
|
36700
36868
|
break;
|
|
36701
36869
|
}
|
|
36702
36870
|
case "ip": {
|
|
@@ -36709,25 +36877,25 @@ function parseStringDef(def, refs) {
|
|
|
36709
36877
|
break;
|
|
36710
36878
|
}
|
|
36711
36879
|
case "base64url":
|
|
36712
|
-
|
|
36880
|
+
addPattern2(res, zodPatterns.base64url, check.message, refs);
|
|
36713
36881
|
break;
|
|
36714
36882
|
case "jwt":
|
|
36715
|
-
|
|
36883
|
+
addPattern2(res, zodPatterns.jwt, check.message, refs);
|
|
36716
36884
|
break;
|
|
36717
36885
|
case "cidr": {
|
|
36718
36886
|
if (check.version !== "v6") {
|
|
36719
|
-
|
|
36887
|
+
addPattern2(res, zodPatterns.ipv4Cidr, check.message, refs);
|
|
36720
36888
|
}
|
|
36721
36889
|
if (check.version !== "v4") {
|
|
36722
|
-
|
|
36890
|
+
addPattern2(res, zodPatterns.ipv6Cidr, check.message, refs);
|
|
36723
36891
|
}
|
|
36724
36892
|
break;
|
|
36725
36893
|
}
|
|
36726
36894
|
case "emoji":
|
|
36727
|
-
|
|
36895
|
+
addPattern2(res, zodPatterns.emoji(), check.message, refs);
|
|
36728
36896
|
break;
|
|
36729
36897
|
case "ulid": {
|
|
36730
|
-
|
|
36898
|
+
addPattern2(res, zodPatterns.ulid, check.message, refs);
|
|
36731
36899
|
break;
|
|
36732
36900
|
}
|
|
36733
36901
|
case "base64": {
|
|
@@ -36741,14 +36909,14 @@ function parseStringDef(def, refs) {
|
|
|
36741
36909
|
break;
|
|
36742
36910
|
}
|
|
36743
36911
|
case "pattern:zod": {
|
|
36744
|
-
|
|
36912
|
+
addPattern2(res, zodPatterns.base64, check.message, refs);
|
|
36745
36913
|
break;
|
|
36746
36914
|
}
|
|
36747
36915
|
}
|
|
36748
36916
|
break;
|
|
36749
36917
|
}
|
|
36750
36918
|
case "nanoid": {
|
|
36751
|
-
|
|
36919
|
+
addPattern2(res, zodPatterns.nanoid, check.message, refs);
|
|
36752
36920
|
}
|
|
36753
36921
|
case "toLowerCase":
|
|
36754
36922
|
case "toUpperCase":
|
|
@@ -36802,7 +36970,7 @@ function addFormat(schema, value, message, refs) {
|
|
|
36802
36970
|
setResponseValueAndErrors(schema, "format", value, message, refs);
|
|
36803
36971
|
}
|
|
36804
36972
|
}
|
|
36805
|
-
function
|
|
36973
|
+
function addPattern2(schema, regex, message, refs) {
|
|
36806
36974
|
if (schema.pattern || schema.allOf?.some((x) => x.pattern)) {
|
|
36807
36975
|
if (!schema.allOf) {
|
|
36808
36976
|
schema.allOf = [];
|
|
@@ -42065,6 +42233,22 @@ var require_utils4 = __commonJS(function(exports, module) {
|
|
|
42065
42233
|
}
|
|
42066
42234
|
return output;
|
|
42067
42235
|
}
|
|
42236
|
+
function recomposeZonedIPv6Host(component) {
|
|
42237
|
+
const zone = component.ipv6Zone;
|
|
42238
|
+
if (zone === undefined)
|
|
42239
|
+
return;
|
|
42240
|
+
const host = component.host;
|
|
42241
|
+
const separator = host.indexOf("%");
|
|
42242
|
+
if (separator === -1)
|
|
42243
|
+
return;
|
|
42244
|
+
const address = host.slice(0, separator);
|
|
42245
|
+
const escaped = address + "%25" + zone;
|
|
42246
|
+
const derived = normalizeIPv6("[" + escaped + "]");
|
|
42247
|
+
if (derived.isIPV6 === true && derived.host === host) {
|
|
42248
|
+
return "[" + escaped + "]";
|
|
42249
|
+
}
|
|
42250
|
+
return;
|
|
42251
|
+
}
|
|
42068
42252
|
function recomposeAuthority(component) {
|
|
42069
42253
|
const uriTokens = [];
|
|
42070
42254
|
if (component.userinfo !== undefined) {
|
|
@@ -42074,15 +42258,20 @@ var require_utils4 = __commonJS(function(exports, module) {
|
|
|
42074
42258
|
if (component.host !== undefined) {
|
|
42075
42259
|
let host = component.host;
|
|
42076
42260
|
if (!isIPv4(host)) {
|
|
42077
|
-
|
|
42078
|
-
if (
|
|
42079
|
-
host =
|
|
42080
|
-
ipV6res = normalizeIPv6(host);
|
|
42081
|
-
}
|
|
42082
|
-
if (ipV6res.isIPV6 === true || ipV6res.isIPVFuture === true) {
|
|
42083
|
-
host = `[${ipV6res.escapedHost}]`;
|
|
42261
|
+
const zonedHost = recomposeZonedIPv6Host(component);
|
|
42262
|
+
if (zonedHost !== undefined) {
|
|
42263
|
+
host = zonedHost;
|
|
42084
42264
|
} else {
|
|
42085
|
-
|
|
42265
|
+
let ipV6res = normalizeIPv6(host);
|
|
42266
|
+
if (ipV6res.isIPV6 !== true && ipV6res.isIPVFuture !== true) {
|
|
42267
|
+
host = normalizePercentEncoding(host, true);
|
|
42268
|
+
ipV6res = normalizeIPv6(host);
|
|
42269
|
+
}
|
|
42270
|
+
if (ipV6res.isIPV6 === true || ipV6res.isIPVFuture === true) {
|
|
42271
|
+
host = `[${ipV6res.escapedHost}]`;
|
|
42272
|
+
} else {
|
|
42273
|
+
host = reescapeHostDelimiters(host, false);
|
|
42274
|
+
}
|
|
42086
42275
|
}
|
|
42087
42276
|
}
|
|
42088
42277
|
uriTokens.push(host);
|
|
@@ -42295,6 +42484,7 @@ var require_schemes = __commonJS(function(exports, module) {
|
|
|
42295
42484
|
var HEX_PAIR = /^[\da-f]{2}$/iu;
|
|
42296
42485
|
var MAILTO_DOMAIN_LITERAL = /^\[[\x21-\x5A\x5E-\x7E]*\]$/u;
|
|
42297
42486
|
var MAILTO_DOMAIN_ERROR = "URI mailto has an invalid recipient domain.";
|
|
42487
|
+
var MAILTO_AUTHORITY_ERROR = "URI mailto must not have an authority component.";
|
|
42298
42488
|
var HAS_SURROGATE = /[\uD800-\uDFFF]/u;
|
|
42299
42489
|
function decodeHex(str) {
|
|
42300
42490
|
if (typeof str !== "string" || str.indexOf("%") === -1) {
|
|
@@ -42409,30 +42599,37 @@ var require_schemes = __commonJS(function(exports, module) {
|
|
|
42409
42599
|
mailtoComponent.error = mailtoComponent.error || "URI mailto has malformed header fields.";
|
|
42410
42600
|
continue;
|
|
42411
42601
|
}
|
|
42412
|
-
const name = eqIdx === -1 ? token : token.slice(0, eqIdx);
|
|
42602
|
+
const name = decodeHex(eqIdx === -1 ? token : token.slice(0, eqIdx));
|
|
42603
|
+
const normalizedName = name.toLowerCase();
|
|
42413
42604
|
const value = eqIdx === -1 ? "" : token.slice(eqIdx + 1);
|
|
42414
|
-
if (
|
|
42605
|
+
if (normalizedName === "to") {
|
|
42415
42606
|
const addrs = value.split(",");
|
|
42416
42607
|
for (let j = 0;j < addrs.length; j++)
|
|
42417
42608
|
to.push(addrs[j]);
|
|
42418
42609
|
continue;
|
|
42419
42610
|
}
|
|
42420
|
-
if (
|
|
42611
|
+
if (normalizedName === "subject") {
|
|
42421
42612
|
mailtoComponent.subject = decodeHex(value);
|
|
42422
42613
|
continue;
|
|
42423
42614
|
}
|
|
42424
|
-
if (
|
|
42615
|
+
if (normalizedName === "body") {
|
|
42425
42616
|
mailtoComponent.body = decodeHex(value);
|
|
42426
42617
|
continue;
|
|
42427
42618
|
}
|
|
42428
42619
|
if (headers === null)
|
|
42429
42620
|
headers = Object.create(null);
|
|
42430
|
-
headers[
|
|
42621
|
+
headers[name] = decodeHex(value);
|
|
42431
42622
|
}
|
|
42432
42623
|
if (headers !== null)
|
|
42433
42624
|
mailtoComponent.headers = headers;
|
|
42434
42625
|
}
|
|
42435
42626
|
mailtoComponent.query = undefined;
|
|
42627
|
+
if (to.length > 0 && (mailtoComponent.userinfo !== undefined || mailtoComponent.host !== undefined || mailtoComponent.port !== undefined)) {
|
|
42628
|
+
mailtoComponent.userinfo = undefined;
|
|
42629
|
+
mailtoComponent.host = undefined;
|
|
42630
|
+
mailtoComponent.port = undefined;
|
|
42631
|
+
mailtoComponent.error = mailtoComponent.error || MAILTO_AUTHORITY_ERROR;
|
|
42632
|
+
}
|
|
42436
42633
|
for (let i = 0;i < to.length; i++) {
|
|
42437
42634
|
const rawAddr = to[i];
|
|
42438
42635
|
const atIdx = rawAddr.lastIndexOf("@");
|
|
@@ -42449,10 +42646,35 @@ var require_schemes = __commonJS(function(exports, module) {
|
|
|
42449
42646
|
mailtoComponent.to = to;
|
|
42450
42647
|
return mailtoComponent;
|
|
42451
42648
|
}
|
|
42649
|
+
function mailtoEncodeHeaderName(name) {
|
|
42650
|
+
return encodeWithAllow(name.replace(/%/gu, "%25"), HFNAME);
|
|
42651
|
+
}
|
|
42452
42652
|
function mailtoSerialize(component, options) {
|
|
42453
42653
|
const mailtoComponent = component;
|
|
42454
42654
|
const to = Array.isArray(mailtoComponent.to) ? mailtoComponent.to.slice() : [];
|
|
42655
|
+
const sourceHeaders = mailtoComponent.headers && typeof mailtoComponent.headers === "object" ? Object.assign(Object.create(null), mailtoComponent.headers) : Object.create(null);
|
|
42656
|
+
const headers = Object.create(null);
|
|
42657
|
+
for (const name in sourceHeaders) {
|
|
42658
|
+
const normalizedName = name.toLowerCase();
|
|
42659
|
+
if (normalizedName === "to") {
|
|
42660
|
+
const addrs = String(sourceHeaders[name]).split(",");
|
|
42661
|
+
for (let i = 0;i < addrs.length; i++)
|
|
42662
|
+
to.push(addrs[i]);
|
|
42663
|
+
} else if (normalizedName === "subject" || normalizedName === "body") {
|
|
42664
|
+
headers[normalizedName] = sourceHeaders[name];
|
|
42665
|
+
} else {
|
|
42666
|
+
headers[name] = sourceHeaders[name];
|
|
42667
|
+
}
|
|
42668
|
+
}
|
|
42669
|
+
if (mailtoComponent.subject !== undefined)
|
|
42670
|
+
headers.subject = mailtoComponent.subject;
|
|
42671
|
+
if (mailtoComponent.body !== undefined)
|
|
42672
|
+
headers.body = mailtoComponent.body;
|
|
42673
|
+
mailtoComponent.headers = headers;
|
|
42455
42674
|
if (to.length) {
|
|
42675
|
+
mailtoComponent.userinfo = undefined;
|
|
42676
|
+
mailtoComponent.host = undefined;
|
|
42677
|
+
mailtoComponent.port = undefined;
|
|
42456
42678
|
for (let i = 0;i < to.length; i++) {
|
|
42457
42679
|
const addr = String(to[i]);
|
|
42458
42680
|
const atIdx = addr.lastIndexOf("@");
|
|
@@ -42468,18 +42690,12 @@ var require_schemes = __commonJS(function(exports, module) {
|
|
|
42468
42690
|
} else {
|
|
42469
42691
|
mailtoComponent.path = undefined;
|
|
42470
42692
|
}
|
|
42471
|
-
const headers = mailtoComponent.headers && typeof mailtoComponent.headers === "object" ? Object.assign(Object.create(null), mailtoComponent.headers) : Object.create(null);
|
|
42472
|
-
if (mailtoComponent.subject)
|
|
42473
|
-
headers.subject = mailtoComponent.subject;
|
|
42474
|
-
if (mailtoComponent.body)
|
|
42475
|
-
headers.body = mailtoComponent.body;
|
|
42476
|
-
mailtoComponent.headers = headers;
|
|
42477
42693
|
let query = "";
|
|
42478
42694
|
let count = 0;
|
|
42479
42695
|
for (const name in headers) {
|
|
42480
42696
|
if (count++ !== 0)
|
|
42481
42697
|
query += "&";
|
|
42482
|
-
query +=
|
|
42698
|
+
query += mailtoEncodeHeaderName(name) + "=" + encodeWithAllow(String(headers[name]), HFNAME);
|
|
42483
42699
|
}
|
|
42484
42700
|
if (count !== 0) {
|
|
42485
42701
|
mailtoComponent.query = query;
|
|
@@ -42572,6 +42788,12 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
42572
42788
|
schemelessOptions.skipEscape = true;
|
|
42573
42789
|
return serialize(resolved, schemelessOptions);
|
|
42574
42790
|
}
|
|
42791
|
+
function copyHost(target, source) {
|
|
42792
|
+
target.host = source.host;
|
|
42793
|
+
if (source.ipv6Zone !== undefined) {
|
|
42794
|
+
target.ipv6Zone = source.ipv6Zone;
|
|
42795
|
+
}
|
|
42796
|
+
}
|
|
42575
42797
|
function resolveComponent(base, relative, options, skipNormalization) {
|
|
42576
42798
|
const target = {};
|
|
42577
42799
|
if (!skipNormalization) {
|
|
@@ -42582,14 +42804,14 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
42582
42804
|
if (!options.tolerant && relative.scheme) {
|
|
42583
42805
|
target.scheme = relative.scheme;
|
|
42584
42806
|
target.userinfo = relative.userinfo;
|
|
42585
|
-
target
|
|
42807
|
+
copyHost(target, relative);
|
|
42586
42808
|
target.port = relative.port;
|
|
42587
42809
|
target.path = removeDotSegments(relative.path || "");
|
|
42588
42810
|
target.query = relative.query;
|
|
42589
42811
|
} else {
|
|
42590
42812
|
if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {
|
|
42591
42813
|
target.userinfo = relative.userinfo;
|
|
42592
|
-
target
|
|
42814
|
+
copyHost(target, relative);
|
|
42593
42815
|
target.port = relative.port;
|
|
42594
42816
|
target.path = removeDotSegments(relative.path || "");
|
|
42595
42817
|
target.query = relative.query;
|
|
@@ -42617,7 +42839,7 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
42617
42839
|
target.query = relative.query;
|
|
42618
42840
|
}
|
|
42619
42841
|
target.userinfo = base.userinfo;
|
|
42620
|
-
target
|
|
42842
|
+
copyHost(target, base);
|
|
42621
42843
|
target.port = base.port;
|
|
42622
42844
|
}
|
|
42623
42845
|
target.scheme = base.scheme;
|
|
@@ -42633,6 +42855,7 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
42633
42855
|
function serialize(cmpts, opts) {
|
|
42634
42856
|
const component = {
|
|
42635
42857
|
host: cmpts.host,
|
|
42858
|
+
ipv6Zone: cmpts.ipv6Zone,
|
|
42636
42859
|
scheme: cmpts.scheme,
|
|
42637
42860
|
userinfo: cmpts.userinfo,
|
|
42638
42861
|
port: cmpts.port,
|
|
@@ -42829,6 +43052,9 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
42829
43052
|
isIP = ipv6result.isIPV6 || ipv6result.isIPVFuture === true;
|
|
42830
43053
|
malformedIPLiteral = hasIPLiteralBracket && (!bracketedIPLiteral || ipv6result.error === true);
|
|
42831
43054
|
parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase();
|
|
43055
|
+
if (isIP && ipv6result.isIPV6 === true && parsed.host.indexOf("%") !== -1) {
|
|
43056
|
+
parsed.ipv6Zone = parsed.host.slice(parsed.host.indexOf("%") + 1);
|
|
43057
|
+
}
|
|
42832
43058
|
if (malformedIPLiteral) {
|
|
42833
43059
|
parsed.error = parsed.error || "URI host is malformed.";
|
|
42834
43060
|
malformedAuthorityOrPort = true;
|
|
@@ -42853,13 +43079,14 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
42853
43079
|
if (!malformedIPLiteral) {
|
|
42854
43080
|
malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP);
|
|
42855
43081
|
}
|
|
42856
|
-
if (
|
|
42857
|
-
|
|
42858
|
-
|
|
42859
|
-
|
|
42860
|
-
parsed.host = reescapeHostDelimiters(host, isIP);
|
|
42861
|
-
}
|
|
43082
|
+
if (uri.indexOf("%") !== -1 && parsed.host !== undefined && !malformedIPLiteral) {
|
|
43083
|
+
let host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true);
|
|
43084
|
+
if (!isIP) {
|
|
43085
|
+
host = normalizePercentEncoding(host.toLowerCase());
|
|
42862
43086
|
}
|
|
43087
|
+
parsed.host = reescapeHostDelimiters(host, isIP);
|
|
43088
|
+
}
|
|
43089
|
+
if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
|
|
42863
43090
|
if (parsed.path) {
|
|
42864
43091
|
parsed.path = normalizePathEncoding(parsed.path);
|
|
42865
43092
|
}
|
|
@@ -52623,9 +52850,9 @@ var init_config = __esm(() => {
|
|
|
52623
52850
|
SDK_METADATA = {
|
|
52624
52851
|
language: "typescript",
|
|
52625
52852
|
openapiDocVersion: "1.0",
|
|
52626
|
-
sdkVersion: "2.1.
|
|
52627
|
-
genVersion: "2.
|
|
52628
|
-
userAgent: "speakeasy-sdk/mcp-typescript 2.1.
|
|
52853
|
+
sdkVersion: "2.1.32",
|
|
52854
|
+
genVersion: "2.938.0",
|
|
52855
|
+
userAgent: "speakeasy-sdk/mcp-typescript 2.1.32 2.938.0 1.0 @flexprice/mcp-server"
|
|
52629
52856
|
};
|
|
52630
52857
|
});
|
|
52631
52858
|
|
|
@@ -55147,7 +55374,8 @@ var init_checkoutaction = __esm(() => {
|
|
|
55147
55374
|
"create_subscription",
|
|
55148
55375
|
"modify_subscription",
|
|
55149
55376
|
"wallet_topup",
|
|
55150
|
-
"add_addon"
|
|
55377
|
+
"add_addon",
|
|
55378
|
+
"pay_invoice"
|
|
55151
55379
|
]);
|
|
55152
55380
|
});
|
|
55153
55381
|
|
|
@@ -55203,6 +55431,28 @@ var init_checkoutstatus = __esm(() => {
|
|
|
55203
55431
|
]);
|
|
55204
55432
|
});
|
|
55205
55433
|
|
|
55434
|
+
// src/models/entitycreationstatus.ts
|
|
55435
|
+
var EntityCreationStatus$zodSchema;
|
|
55436
|
+
var init_entitycreationstatus = __esm(() => {
|
|
55437
|
+
init_zod();
|
|
55438
|
+
EntityCreationStatus$zodSchema = _enum([
|
|
55439
|
+
"created",
|
|
55440
|
+
"superseded",
|
|
55441
|
+
"failed_already_exists"
|
|
55442
|
+
]);
|
|
55443
|
+
});
|
|
55444
|
+
|
|
55445
|
+
// src/models/entitycreationresult.ts
|
|
55446
|
+
var EntityCreationResult$zodSchema;
|
|
55447
|
+
var init_entitycreationresult = __esm(() => {
|
|
55448
|
+
init_zod();
|
|
55449
|
+
init_entitycreationstatus();
|
|
55450
|
+
EntityCreationResult$zodSchema = object({
|
|
55451
|
+
entity_id: string2().optional(),
|
|
55452
|
+
status: EntityCreationStatus$zodSchema.optional()
|
|
55453
|
+
});
|
|
55454
|
+
});
|
|
55455
|
+
|
|
55206
55456
|
// src/models/paymentactiontype.ts
|
|
55207
55457
|
var PaymentActionType$zodSchema;
|
|
55208
55458
|
var init_paymentactiontype = __esm(() => {
|
|
@@ -55232,6 +55482,7 @@ var init_checkoutsessionresponse = __esm(() => {
|
|
|
55232
55482
|
init_checkoutpaymentblock();
|
|
55233
55483
|
init_checkoutpaymentprovider();
|
|
55234
55484
|
init_checkoutstatus();
|
|
55485
|
+
init_entitycreationresult();
|
|
55235
55486
|
init_paymentaction();
|
|
55236
55487
|
CheckoutSessionResponse$zodSchema = object({
|
|
55237
55488
|
action: CheckoutAction$zodSchema.optional(),
|
|
@@ -55243,6 +55494,7 @@ var init_checkoutsessionresponse = __esm(() => {
|
|
|
55243
55494
|
completed_at: datetime2({ offset: true }).optional(),
|
|
55244
55495
|
created_at: datetime2({ offset: true }).optional(),
|
|
55245
55496
|
customer_id: string2().optional(),
|
|
55497
|
+
entity_creation_result: EntityCreationResult$zodSchema.optional(),
|
|
55246
55498
|
expires_at: datetime2({ offset: true }).optional(),
|
|
55247
55499
|
failure_reason: string2().optional(),
|
|
55248
55500
|
failure_url: string2().optional(),
|
|
@@ -56102,6 +56354,15 @@ an existing line item. Forms a linked-list chain across edits; nil for line item
|
|
|
56102
56354
|
});
|
|
56103
56355
|
});
|
|
56104
56356
|
|
|
56357
|
+
// src/models/invoicesourcetype.ts
|
|
56358
|
+
var InvoiceSourceType$zodSchema;
|
|
56359
|
+
var init_invoicesourcetype = __esm(() => {
|
|
56360
|
+
init_zod();
|
|
56361
|
+
InvoiceSourceType$zodSchema = _enum([
|
|
56362
|
+
"checkout"
|
|
56363
|
+
]);
|
|
56364
|
+
});
|
|
56365
|
+
|
|
56105
56366
|
// src/models/invoicestatus.ts
|
|
56106
56367
|
var InvoiceStatus$zodSchema;
|
|
56107
56368
|
var init_invoicestatus = __esm(() => {
|
|
@@ -56265,10 +56526,12 @@ var init_taxsummary = __esm(() => {
|
|
|
56265
56526
|
var InvoiceResponse$zodSchema;
|
|
56266
56527
|
var init_invoiceresponse = __esm(() => {
|
|
56267
56528
|
init_zod();
|
|
56529
|
+
init_checkoutsessionresponse();
|
|
56268
56530
|
init_couponapplicationresponse();
|
|
56269
56531
|
init_customcurrency();
|
|
56270
56532
|
init_customerresponse();
|
|
56271
56533
|
init_invoicelineitemresponse();
|
|
56534
|
+
init_invoicesourcetype();
|
|
56272
56535
|
init_invoicestatus();
|
|
56273
56536
|
init_invoicetype();
|
|
56274
56537
|
init_paymentstatus();
|
|
@@ -56286,6 +56549,7 @@ These are non-cash reductions applied to the invoice (e.g. goodwill credit, bill
|
|
|
56286
56549
|
billing_period: string2().optional().describe('billing_period describes the billing period this invoice covers (e.g., "January 2024", "Q1 2024")'),
|
|
56287
56550
|
billing_reason: string2().optional().describe('billing_reason indicates why this invoice was generated (e.g., "subscription_billing", "manual_charge")'),
|
|
56288
56551
|
billing_sequence: int().optional().describe("billing_sequence is the sequential number indicating the billing cycle for subscription invoices"),
|
|
56552
|
+
checkout_session: CheckoutSessionResponse$zodSchema.optional(),
|
|
56289
56553
|
coupon_applications: array(CouponApplicationResponse$zodSchema).optional().describe("coupon_applications contains the coupon applications associated with this invoice (overrides embedded field)"),
|
|
56290
56554
|
created_at: datetime2({ offset: true }).optional(),
|
|
56291
56555
|
created_by: string2().optional(),
|
|
@@ -56318,6 +56582,7 @@ Once set, automated recomputation of this invoice's line items must no-op rather
|
|
|
56318
56582
|
When set, it forms a parent→child link from this (voided) invoice to the new replacement invoice.`),
|
|
56319
56583
|
refunded_amount: string2().optional().describe(`refunded_amount is the total sum of credit notes of type "refund".
|
|
56320
56584
|
These are actual refunds issued to the customer.`),
|
|
56585
|
+
source_type: InvoiceSourceType$zodSchema.optional(),
|
|
56321
56586
|
status: Status$zodSchema.optional(),
|
|
56322
56587
|
subscription: lazy(() => SubscriptionResponse$zodSchema).optional(),
|
|
56323
56588
|
subscription_customer_id: string2().optional().describe(`subscription_customer_id is the subscription owner's customer ID (Subscription.CustomerID).
|
|
@@ -56339,6 +56604,16 @@ It may differ from customer_id when the subscription uses an invoicing customer.
|
|
|
56339
56604
|
});
|
|
56340
56605
|
});
|
|
56341
56606
|
|
|
56607
|
+
// src/models/lineitemgrouping.ts
|
|
56608
|
+
var LineItemGrouping$zodSchema;
|
|
56609
|
+
var init_lineitemgrouping = __esm(() => {
|
|
56610
|
+
init_zod();
|
|
56611
|
+
LineItemGrouping$zodSchema = _enum([
|
|
56612
|
+
"per_charge_period",
|
|
56613
|
+
"per_billing_period"
|
|
56614
|
+
]);
|
|
56615
|
+
});
|
|
56616
|
+
|
|
56342
56617
|
// src/models/pausestatus.ts
|
|
56343
56618
|
var PauseStatus$zodSchema;
|
|
56344
56619
|
var init_pausestatus = __esm(() => {
|
|
@@ -56615,6 +56890,7 @@ var init_subscriptionresponse = __esm(() => {
|
|
|
56615
56890
|
init_creditgrantresponse();
|
|
56616
56891
|
init_customerresponse();
|
|
56617
56892
|
init_invoiceresponse();
|
|
56893
|
+
init_lineitemgrouping();
|
|
56618
56894
|
init_pausestatus();
|
|
56619
56895
|
init_paymentterms();
|
|
56620
56896
|
init_planresponse();
|
|
@@ -56667,6 +56943,7 @@ aggregated entitlement info (same shape as CustomerEntitlementsResponse.Features
|
|
|
56667
56943
|
invoicing_customer_id: string2().optional().describe(`InvoicingCustomerID is the customer ID to use for invoicing
|
|
56668
56944
|
This can differ from the subscription customer (e.g., parent company invoicing for child company)`),
|
|
56669
56945
|
latest_invoice: lazy(() => InvoiceResponse$zodSchema).optional(),
|
|
56946
|
+
line_item_grouping: LineItemGrouping$zodSchema.optional(),
|
|
56670
56947
|
line_items: array(SubscriptionSubscriptionLineItem$zodSchema).optional(),
|
|
56671
56948
|
lookup_key: string2().optional().describe("LookupKey is the key used to lookup the subscription in our system"),
|
|
56672
56949
|
metadata: record(string2(), string2()).optional(),
|
|
@@ -58102,6 +58379,7 @@ var init_event = __esm(() => {
|
|
|
58102
58379
|
event_name: string2().optional(),
|
|
58103
58380
|
external_customer_id: string2().optional(),
|
|
58104
58381
|
id: string2().optional(),
|
|
58382
|
+
ingested_at: datetime2({ offset: true }).optional(),
|
|
58105
58383
|
properties: record(string2(), any()).optional(),
|
|
58106
58384
|
source: string2().optional(),
|
|
58107
58385
|
timestamp: string2().optional()
|
|
@@ -58146,6 +58424,7 @@ var init_geteventbyidresponse = __esm(() => {
|
|
|
58146
58424
|
GetEventByIDResponse$zodSchema = object({
|
|
58147
58425
|
debug_tracker: DebugTracker$zodSchema.optional(),
|
|
58148
58426
|
event: Event$zodSchema.optional(),
|
|
58427
|
+
events: array(Event$zodSchema).optional(),
|
|
58149
58428
|
processed_events: array(FeatureUsageInfo$zodSchema).optional(),
|
|
58150
58429
|
status: EventProcessingStatusType$zodSchema.optional()
|
|
58151
58430
|
});
|
|
@@ -59342,6 +59621,95 @@ Use when paying an invoice with the customer's wallet balance (e.g. prepaid cred
|
|
|
59342
59621
|
};
|
|
59343
59622
|
});
|
|
59344
59623
|
|
|
59624
|
+
// src/models/collectionmethod.ts
|
|
59625
|
+
var CollectionMethod$zodSchema;
|
|
59626
|
+
var init_collectionmethod = __esm(() => {
|
|
59627
|
+
init_zod();
|
|
59628
|
+
CollectionMethod$zodSchema = _enum([
|
|
59629
|
+
"charge_automatically",
|
|
59630
|
+
"send_invoice"
|
|
59631
|
+
]);
|
|
59632
|
+
});
|
|
59633
|
+
|
|
59634
|
+
// src/models/paymentmethodtype.ts
|
|
59635
|
+
var PaymentMethodType$zodSchema;
|
|
59636
|
+
var init_paymentmethodtype = __esm(() => {
|
|
59637
|
+
init_zod();
|
|
59638
|
+
PaymentMethodType$zodSchema = _enum([
|
|
59639
|
+
"CARD",
|
|
59640
|
+
"ACH",
|
|
59641
|
+
"OFFLINE",
|
|
59642
|
+
"CREDITS",
|
|
59643
|
+
"PAYMENT_LINK",
|
|
59644
|
+
"UPI"
|
|
59645
|
+
]);
|
|
59646
|
+
});
|
|
59647
|
+
|
|
59648
|
+
// src/models/checkoutpaymentproviderconfig.ts
|
|
59649
|
+
var CheckoutPaymentProviderConfig$zodSchema;
|
|
59650
|
+
var init_checkoutpaymentproviderconfig = __esm(() => {
|
|
59651
|
+
init_zod();
|
|
59652
|
+
init_collectionmethod();
|
|
59653
|
+
init_paymentmethodtype();
|
|
59654
|
+
CheckoutPaymentProviderConfig$zodSchema = object({
|
|
59655
|
+
collection_method: CollectionMethod$zodSchema.optional(),
|
|
59656
|
+
customer_not_present: boolean2().optional().describe(`CustomerNotPresent is the unattended/MIT opt-in. Zero value (omitted) means
|
|
59657
|
+
the customer is present, so a missed auto-charge may fall back to a hosted
|
|
59658
|
+
authorization link. Set true only from merchant-initiated paths (auto top-up).`),
|
|
59659
|
+
max_mandate_limit: string2().optional(),
|
|
59660
|
+
payment_method: PaymentMethodType$zodSchema.optional()
|
|
59661
|
+
});
|
|
59662
|
+
});
|
|
59663
|
+
|
|
59664
|
+
// src/models/onexistingentitypolicy.ts
|
|
59665
|
+
var OnExistingEntityPolicy$zodSchema;
|
|
59666
|
+
var init_onexistingentitypolicy = __esm(() => {
|
|
59667
|
+
init_zod();
|
|
59668
|
+
OnExistingEntityPolicy$zodSchema = _enum([
|
|
59669
|
+
"reject",
|
|
59670
|
+
"supersede"
|
|
59671
|
+
]);
|
|
59672
|
+
});
|
|
59673
|
+
|
|
59674
|
+
// src/models/entitycreationconflictpolicies.ts
|
|
59675
|
+
var EntityCreationConflictPolicies$zodSchema;
|
|
59676
|
+
var init_entitycreationconflictpolicies = __esm(() => {
|
|
59677
|
+
init_zod();
|
|
59678
|
+
init_onexistingentitypolicy();
|
|
59679
|
+
EntityCreationConflictPolicies$zodSchema = object({
|
|
59680
|
+
on_existing_entity: OnExistingEntityPolicy$zodSchema.optional()
|
|
59681
|
+
});
|
|
59682
|
+
});
|
|
59683
|
+
|
|
59684
|
+
// src/models/entitycreationoptions.ts
|
|
59685
|
+
var EntityCreationOptions$zodSchema;
|
|
59686
|
+
var init_entitycreationoptions = __esm(() => {
|
|
59687
|
+
init_zod();
|
|
59688
|
+
init_entitycreationconflictpolicies();
|
|
59689
|
+
EntityCreationOptions$zodSchema = object({
|
|
59690
|
+
entity_creation_conflict_policies: EntityCreationConflictPolicies$zodSchema.optional()
|
|
59691
|
+
});
|
|
59692
|
+
});
|
|
59693
|
+
|
|
59694
|
+
// src/models/checkoutparams.ts
|
|
59695
|
+
var CheckoutParams$zodSchema;
|
|
59696
|
+
var init_checkoutparams = __esm(() => {
|
|
59697
|
+
init_zod();
|
|
59698
|
+
init_checkoutpaymentprovider();
|
|
59699
|
+
init_checkoutpaymentproviderconfig();
|
|
59700
|
+
init_entitycreationoptions();
|
|
59701
|
+
CheckoutParams$zodSchema = object({
|
|
59702
|
+
cancel_url: string2().optional(),
|
|
59703
|
+
entity_creation_options: EntityCreationOptions$zodSchema.optional(),
|
|
59704
|
+
failure_url: string2().optional(),
|
|
59705
|
+
idempotency_key: string2().optional(),
|
|
59706
|
+
metadata: record(string2(), string2()).optional(),
|
|
59707
|
+
payment_provider: CheckoutPaymentProvider$zodSchema,
|
|
59708
|
+
payment_provider_config: CheckoutPaymentProviderConfig$zodSchema.optional(),
|
|
59709
|
+
success_url: string2().optional()
|
|
59710
|
+
});
|
|
59711
|
+
});
|
|
59712
|
+
|
|
59345
59713
|
// src/models/createinvoicelineitemrequest.ts
|
|
59346
59714
|
var CreateInvoiceLineItemRequest$zodSchema;
|
|
59347
59715
|
var init_createinvoicelineitemrequest = __esm(() => {
|
|
@@ -59419,6 +59787,7 @@ var init_invoicelineitemcoupon = __esm(() => {
|
|
|
59419
59787
|
var CreateInvoiceRequest$zodSchema;
|
|
59420
59788
|
var init_createinvoicerequest = __esm(() => {
|
|
59421
59789
|
init_zod();
|
|
59790
|
+
init_checkoutparams();
|
|
59422
59791
|
init_createinvoicelineitemrequest();
|
|
59423
59792
|
init_invoicebillingreason();
|
|
59424
59793
|
init_invoicecoupon();
|
|
@@ -59432,6 +59801,7 @@ var init_createinvoicerequest = __esm(() => {
|
|
|
59432
59801
|
amount_paid: string2().optional().describe("amount_paid is the amount that has been paid towards this invoice"),
|
|
59433
59802
|
billing_period: string2().optional().describe('billing_period is the period this invoice covers (e.g., "monthly", "yearly")'),
|
|
59434
59803
|
billing_reason: InvoiceBillingReason$zodSchema.optional(),
|
|
59804
|
+
checkout: CheckoutParams$zodSchema.optional(),
|
|
59435
59805
|
coupons: array(string2()).optional().describe("coupons"),
|
|
59436
59806
|
currency: string2().describe("currency is the three-letter ISO currency code (e.g., USD, EUR) for the invoice"),
|
|
59437
59807
|
customer_id: string2().describe("customer_id is the unique identifier of the customer this invoice belongs to"),
|
|
@@ -59550,7 +59920,8 @@ var init_invoicesCreateInvoice2 = __esm(() => {
|
|
|
59550
59920
|
name: "create-invoice",
|
|
59551
59921
|
description: `Create one-off invoice
|
|
59552
59922
|
|
|
59553
|
-
Use when creating a manual or one-off invoice (e.g. custom charge or non-recurring billing). Invoice is created in draft; finalize when ready
|
|
59923
|
+
Use when creating a manual or one-off invoice (e.g. custom charge or non-recurring billing). Invoice is created in draft; finalize when ready.
|
|
59924
|
+
Pass a \`checkout\` object to gate the invoice behind a hosted payment session: the invoice stays DRAFT with no invoice number, and the response carries \`checkout_session.payment_action.url\` for the customer to pay. It finalizes only when the payment webhook lands; if the session expires the invoice is voided and archived. Poll \`GET /checkout/sessions/{id}\` until \`terminal\` is true. One-off invoices only.`,
|
|
59554
59925
|
scopes: ["write"],
|
|
59555
59926
|
annotations: {
|
|
59556
59927
|
title: "",
|
|
@@ -63559,63 +63930,6 @@ var init_addoncadence = __esm(() => {
|
|
|
63559
63930
|
]);
|
|
63560
63931
|
});
|
|
63561
63932
|
|
|
63562
|
-
// src/models/collectionmethod.ts
|
|
63563
|
-
var CollectionMethod$zodSchema;
|
|
63564
|
-
var init_collectionmethod = __esm(() => {
|
|
63565
|
-
init_zod();
|
|
63566
|
-
CollectionMethod$zodSchema = _enum([
|
|
63567
|
-
"charge_automatically",
|
|
63568
|
-
"send_invoice"
|
|
63569
|
-
]);
|
|
63570
|
-
});
|
|
63571
|
-
|
|
63572
|
-
// src/models/paymentmethodtype.ts
|
|
63573
|
-
var PaymentMethodType$zodSchema;
|
|
63574
|
-
var init_paymentmethodtype = __esm(() => {
|
|
63575
|
-
init_zod();
|
|
63576
|
-
PaymentMethodType$zodSchema = _enum([
|
|
63577
|
-
"CARD",
|
|
63578
|
-
"ACH",
|
|
63579
|
-
"OFFLINE",
|
|
63580
|
-
"CREDITS",
|
|
63581
|
-
"PAYMENT_LINK",
|
|
63582
|
-
"UPI"
|
|
63583
|
-
]);
|
|
63584
|
-
});
|
|
63585
|
-
|
|
63586
|
-
// src/models/checkoutpaymentproviderconfig.ts
|
|
63587
|
-
var CheckoutPaymentProviderConfig$zodSchema;
|
|
63588
|
-
var init_checkoutpaymentproviderconfig = __esm(() => {
|
|
63589
|
-
init_zod();
|
|
63590
|
-
init_collectionmethod();
|
|
63591
|
-
init_paymentmethodtype();
|
|
63592
|
-
CheckoutPaymentProviderConfig$zodSchema = object({
|
|
63593
|
-
collection_method: CollectionMethod$zodSchema.optional(),
|
|
63594
|
-
customer_not_present: boolean2().optional().describe(`CustomerNotPresent is the unattended/MIT opt-in. Zero value (omitted) means
|
|
63595
|
-
the customer is present, so a missed auto-charge may fall back to a hosted
|
|
63596
|
-
authorization link. Set true only from merchant-initiated paths (auto top-up).`),
|
|
63597
|
-
max_mandate_limit: string2().optional(),
|
|
63598
|
-
payment_method: PaymentMethodType$zodSchema.optional()
|
|
63599
|
-
});
|
|
63600
|
-
});
|
|
63601
|
-
|
|
63602
|
-
// src/models/checkoutparams.ts
|
|
63603
|
-
var CheckoutParams$zodSchema;
|
|
63604
|
-
var init_checkoutparams = __esm(() => {
|
|
63605
|
-
init_zod();
|
|
63606
|
-
init_checkoutpaymentprovider();
|
|
63607
|
-
init_checkoutpaymentproviderconfig();
|
|
63608
|
-
CheckoutParams$zodSchema = object({
|
|
63609
|
-
cancel_url: string2().optional(),
|
|
63610
|
-
failure_url: string2().optional(),
|
|
63611
|
-
idempotency_key: string2().optional(),
|
|
63612
|
-
metadata: record(string2(), string2()).optional(),
|
|
63613
|
-
payment_provider: CheckoutPaymentProvider$zodSchema,
|
|
63614
|
-
payment_provider_config: CheckoutPaymentProviderConfig$zodSchema.optional(),
|
|
63615
|
-
success_url: string2().optional()
|
|
63616
|
-
});
|
|
63617
|
-
});
|
|
63618
|
-
|
|
63619
63933
|
// src/models/commitmentbucketrequest.ts
|
|
63620
63934
|
var CommitmentBucketRequest$zodSchema;
|
|
63621
63935
|
var init_commitmentbucketrequest = __esm(() => {
|
|
@@ -63677,6 +63991,16 @@ var init_overridelineitemrequest = __esm(() => {
|
|
|
63677
63991
|
});
|
|
63678
63992
|
});
|
|
63679
63993
|
|
|
63994
|
+
// src/models/scheduletype.ts
|
|
63995
|
+
var ScheduleType$zodSchema;
|
|
63996
|
+
var init_scheduletype = __esm(() => {
|
|
63997
|
+
init_zod();
|
|
63998
|
+
ScheduleType$zodSchema = _enum([
|
|
63999
|
+
"immediate",
|
|
64000
|
+
"end_of_period"
|
|
64001
|
+
]);
|
|
64002
|
+
});
|
|
64003
|
+
|
|
63680
64004
|
// src/models/addaddonrequest.ts
|
|
63681
64005
|
var AddAddonRequest$zodSchema;
|
|
63682
64006
|
var init_addaddonrequest = __esm(() => {
|
|
@@ -63686,9 +64010,11 @@ var init_addaddonrequest = __esm(() => {
|
|
|
63686
64010
|
init_lineitemcommitmentconfig();
|
|
63687
64011
|
init_overridelineitemrequest();
|
|
63688
64012
|
init_prorationbehavior();
|
|
64013
|
+
init_scheduletype();
|
|
63689
64014
|
AddAddonRequest$zodSchema = object({
|
|
63690
64015
|
addon_id: string2(),
|
|
63691
64016
|
cadence: AddonCadence$zodSchema.optional(),
|
|
64017
|
+
change_at: ScheduleType$zodSchema.optional(),
|
|
63692
64018
|
checkout: CheckoutParams$zodSchema.optional(),
|
|
63693
64019
|
line_item_commitments: record(string2(), LineItemCommitmentConfig$zodSchema).optional().describe("LineItemCommitments allows setting commitment configuration per addon line item (keyed by price_id)"),
|
|
63694
64020
|
metadata: record(string2(), any()).optional(),
|
|
@@ -64175,9 +64501,11 @@ var init_addaddontosubscriptionrequest = __esm(() => {
|
|
|
64175
64501
|
init_lineitemcommitmentconfig();
|
|
64176
64502
|
init_overridelineitemrequest();
|
|
64177
64503
|
init_prorationbehavior();
|
|
64504
|
+
init_scheduletype();
|
|
64178
64505
|
AddAddonToSubscriptionRequest$zodSchema = object({
|
|
64179
64506
|
addon_id: string2(),
|
|
64180
64507
|
cadence: AddonCadence$zodSchema.optional(),
|
|
64508
|
+
change_at: ScheduleType$zodSchema.optional(),
|
|
64181
64509
|
line_item_commitments: record(string2(), LineItemCommitmentConfig$zodSchema).optional().describe("LineItemCommitments allows setting commitment configuration per addon line item (keyed by price_id)"),
|
|
64182
64510
|
metadata: record(string2(), any()).optional(),
|
|
64183
64511
|
override_line_items: array(OverrideLineItemRequest$zodSchema).optional().describe("OverrideLineItems allows overriding price/quantity/billing model for specific addon prices"),
|
|
@@ -64413,6 +64741,7 @@ var init_createsubscriptionrequest = __esm(() => {
|
|
|
64413
64741
|
init_createcreditgrantrequest();
|
|
64414
64742
|
init_createsubscriptionlineitemrequest();
|
|
64415
64743
|
init_lineitemcommitmentconfig();
|
|
64744
|
+
init_lineitemgrouping();
|
|
64416
64745
|
init_overrideentitlementrequest();
|
|
64417
64746
|
init_overridelineitemrequest();
|
|
64418
64747
|
init_paymentbehavior();
|
|
@@ -64456,6 +64785,7 @@ non-emptiness is enforced explicitly in Validate() below.`),
|
|
|
64456
64785
|
inheritance: SubscriptionInheritanceConfig$zodSchema.optional(),
|
|
64457
64786
|
line_item_commitments: record(string2(), LineItemCommitmentConfig$zodSchema).optional().describe("LineItemCommitments sets per-line-item commitment config, keyed by price_id."),
|
|
64458
64787
|
line_item_coupons: record(string2(), array(string2())).optional().describe("Deprecated: use SubscriptionCoupons instead."),
|
|
64788
|
+
line_item_grouping: LineItemGrouping$zodSchema.optional(),
|
|
64459
64789
|
line_items: array(CreateSubscriptionLineItemRequest$zodSchema).optional().describe("LineItems are extra (non-plan) line items added at creation."),
|
|
64460
64790
|
lookup_key: string2().optional(),
|
|
64461
64791
|
metadata: record(string2(), string2()).optional(),
|
|
@@ -64932,16 +65262,6 @@ var init_subscriptionchangeexecuteresponse = __esm(() => {
|
|
|
64932
65262
|
}).describe("Response after successfully executing a subscription plan change");
|
|
64933
65263
|
});
|
|
64934
65264
|
|
|
64935
|
-
// src/models/scheduletype.ts
|
|
64936
|
-
var ScheduleType$zodSchema;
|
|
64937
|
-
var init_scheduletype = __esm(() => {
|
|
64938
|
-
init_zod();
|
|
64939
|
-
ScheduleType$zodSchema = _enum([
|
|
64940
|
-
"immediate",
|
|
64941
|
-
"end_of_period"
|
|
64942
|
-
]);
|
|
64943
|
-
});
|
|
64944
|
-
|
|
64945
65265
|
// src/models/subscriptionchangerequest.ts
|
|
64946
65266
|
var SubscriptionChangeRequest$zodSchema;
|
|
64947
65267
|
var init_subscriptionchangerequest = __esm(() => {
|
|
@@ -65100,8 +65420,10 @@ var RemoveAddonRequest$zodSchema;
|
|
|
65100
65420
|
var init_removeaddonrequest = __esm(() => {
|
|
65101
65421
|
init_zod();
|
|
65102
65422
|
init_prorationbehavior();
|
|
65423
|
+
init_scheduletype();
|
|
65103
65424
|
RemoveAddonRequest$zodSchema = object({
|
|
65104
65425
|
addon_association_id: string2(),
|
|
65426
|
+
change_at: ScheduleType$zodSchema.optional(),
|
|
65105
65427
|
effective_date: datetime2({ offset: true }).optional().describe("EffectiveDate defaults to period end when nil; mid-period with create_prorations issues a wallet credit."),
|
|
65106
65428
|
proration_behavior: ProrationBehavior$zodSchema.optional(),
|
|
65107
65429
|
reason: string2().optional()
|
|
@@ -65132,6 +65454,18 @@ var init_submodifyaddonparams = __esm(() => {
|
|
|
65132
65454
|
});
|
|
65133
65455
|
});
|
|
65134
65456
|
|
|
65457
|
+
// src/models/submodifybulkaddonparams.ts
|
|
65458
|
+
var SubModifyBulkAddonParams$zodSchema;
|
|
65459
|
+
var init_submodifybulkaddonparams = __esm(() => {
|
|
65460
|
+
init_zod();
|
|
65461
|
+
init_addaddontosubscriptionrequest();
|
|
65462
|
+
init_removeaddonrequest();
|
|
65463
|
+
SubModifyBulkAddonParams$zodSchema = object({
|
|
65464
|
+
adds: array(AddAddonToSubscriptionRequest$zodSchema).optional(),
|
|
65465
|
+
removes: array(RemoveAddonRequest$zodSchema).optional()
|
|
65466
|
+
});
|
|
65467
|
+
});
|
|
65468
|
+
|
|
65135
65469
|
// src/models/submodifycouponaction.ts
|
|
65136
65470
|
var SubModifyCouponAction$zodSchema;
|
|
65137
65471
|
var init_submodifycouponaction = __esm(() => {
|
|
@@ -65289,6 +65623,7 @@ var init_executesubscriptionmodifyrequest = __esm(() => {
|
|
|
65289
65623
|
init_zod();
|
|
65290
65624
|
init_checkoutparams();
|
|
65291
65625
|
init_submodifyaddonparams();
|
|
65626
|
+
init_submodifybulkaddonparams();
|
|
65292
65627
|
init_submodifycouponparams();
|
|
65293
65628
|
init_submodifygroupedinvoicingparams();
|
|
65294
65629
|
init_submodifyinheritancerequest();
|
|
@@ -65297,6 +65632,7 @@ var init_executesubscriptionmodifyrequest = __esm(() => {
|
|
|
65297
65632
|
init_submodifytrialendrequest();
|
|
65298
65633
|
init_subscriptionmodifytype();
|
|
65299
65634
|
ExecuteSubscriptionModifyRequest$zodSchema = object({
|
|
65635
|
+
addon_bulk_params: SubModifyBulkAddonParams$zodSchema.optional(),
|
|
65300
65636
|
addon_params: SubModifyAddonParams$zodSchema.optional(),
|
|
65301
65637
|
checkout: CheckoutParams$zodSchema.optional(),
|
|
65302
65638
|
coupon_params: SubModifyCouponParams$zodSchema.optional(),
|
|
@@ -65849,7 +66185,7 @@ var init_subscriptionsExecuteSubscriptionModify2 = __esm(() => {
|
|
|
65849
66185
|
name: "execute-subscription-modify",
|
|
65850
66186
|
description: `Execute subscription modification
|
|
65851
66187
|
|
|
65852
|
-
Execute a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, tax,
|
|
66188
|
+
Execute a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, tax, a single addon add/remove, or a batch of addon adds and removes settled as one netted document).`,
|
|
65853
66189
|
scopes: ["write"],
|
|
65854
66190
|
annotations: {
|
|
65855
66191
|
title: "",
|
|
@@ -65979,7 +66315,7 @@ var init_subscriptionchangeentitytype = __esm(() => {
|
|
|
65979
66315
|
init_zod();
|
|
65980
66316
|
SubscriptionChangeEntityType$zodSchema = _enum([
|
|
65981
66317
|
"plan",
|
|
65982
|
-
"
|
|
66318
|
+
"addon_association",
|
|
65983
66319
|
"credit_grant",
|
|
65984
66320
|
"entitlement",
|
|
65985
66321
|
"entitlement_grant"
|
|
@@ -67048,6 +67384,7 @@ var init_subscriptionresponsev2 = __esm(() => {
|
|
|
67048
67384
|
init_couponassociationresponse();
|
|
67049
67385
|
init_creditgrantresponse();
|
|
67050
67386
|
init_customerresponse();
|
|
67387
|
+
init_lineitemgrouping();
|
|
67051
67388
|
init_pausestatus();
|
|
67052
67389
|
init_paymentterms();
|
|
67053
67390
|
init_planresponse();
|
|
@@ -67095,6 +67432,7 @@ At the end of this period, a new invoice will be created.`),
|
|
|
67095
67432
|
id: string2().optional().describe("ID is the unique identifier for the subscription"),
|
|
67096
67433
|
invoicing_customer_id: string2().optional().describe(`InvoicingCustomerID is the customer ID to use for invoicing
|
|
67097
67434
|
This can differ from the subscription customer (e.g., parent company invoicing for child company)`),
|
|
67435
|
+
line_item_grouping: LineItemGrouping$zodSchema.optional(),
|
|
67098
67436
|
line_items: array(SubscriptionLineItemResponse$zodSchema).optional().describe(`LineItems is expanded only if "subscription_line_items" is in expand parameter
|
|
67099
67437
|
Each line item can optionally include expanded price data`),
|
|
67100
67438
|
lookup_key: string2().optional().describe("LookupKey is the key used to lookup the subscription in our system"),
|
|
@@ -67823,7 +68161,7 @@ var init_subscriptionsPreviewSubscriptionModify2 = __esm(() => {
|
|
|
67823
68161
|
name: "preview-subscription-modify",
|
|
67824
68162
|
description: `Preview subscription modification
|
|
67825
68163
|
|
|
67826
|
-
Preview the impact of a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, tax,
|
|
68164
|
+
Preview the impact of a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, tax, a single addon add/remove, or a batch of addon adds and removes) without committing changes.`,
|
|
67827
68165
|
scopes: ["read"],
|
|
67828
68166
|
annotations: {
|
|
67829
68167
|
title: "",
|
|
@@ -68713,7 +69051,7 @@ Use when changing a subscription line item (e.g. quantity or price). Implemented
|
|
|
68713
69051
|
function createMCPServer(deps) {
|
|
68714
69052
|
const server = new McpServer({
|
|
68715
69053
|
name: "Flexprice",
|
|
68716
|
-
version: "2.1.
|
|
69054
|
+
version: "2.1.32"
|
|
68717
69055
|
});
|
|
68718
69056
|
const getClient = deps.getSDK || (() => new FlexpriceCore({
|
|
68719
69057
|
security: deps.security,
|
|
@@ -68972,9 +69310,7 @@ Use when showing a customer's invoice overview (e.g. billing portal or balance s
|
|
|
68972
69310
|
},
|
|
68973
69311
|
{
|
|
68974
69312
|
name: "create-invoice",
|
|
68975
|
-
description:
|
|
68976
|
-
|
|
68977
|
-
Use when creating a manual or one-off invoice (e.g. custom charge or non-recurring billing). Invoice is created in draft; finalize when ready.`
|
|
69313
|
+
description: "Create one-off invoice\n\nUse when creating a manual or one-off invoice (e.g. custom charge or non-recurring billing). Invoice is created in draft; finalize when ready.\nPass a `checkout` object to gate the invoice behind a hosted payment session: the invoice stays DRAFT with no invoice number, and the response carries `checkout_session.payment_action.url` for the customer to pay. It finalizes only when the payment webhook lands; if the session expires the invoice is voided and archived. Poll `GET /checkout/sessions/{id}` until `terminal` is true. One-off invoices only."
|
|
68978
69314
|
},
|
|
68979
69315
|
{
|
|
68980
69316
|
name: "get-invoice-preview",
|
|
@@ -69338,13 +69674,13 @@ Use when adding a new charge or seat to a subscription (e.g. extra seat or one-t
|
|
|
69338
69674
|
name: "execute-subscription-modify",
|
|
69339
69675
|
description: `Execute subscription modification
|
|
69340
69676
|
|
|
69341
|
-
Execute a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, tax,
|
|
69677
|
+
Execute a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, tax, a single addon add/remove, or a batch of addon adds and removes settled as one netted document).`
|
|
69342
69678
|
},
|
|
69343
69679
|
{
|
|
69344
69680
|
name: "preview-subscription-modify",
|
|
69345
69681
|
description: `Preview subscription modification
|
|
69346
69682
|
|
|
69347
|
-
Preview the impact of a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, tax,
|
|
69683
|
+
Preview the impact of a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, tax, a single addon add/remove, or a batch of addon adds and removes) without committing changes.`
|
|
69348
69684
|
},
|
|
69349
69685
|
{
|
|
69350
69686
|
name: "list-subscription-schedules",
|
|
@@ -70655,10 +70991,10 @@ var init_stdio = __esm(() => {
|
|
|
70655
70991
|
});
|
|
70656
70992
|
|
|
70657
70993
|
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
70658
|
-
import
|
|
70994
|
+
import process2 from "node:process";
|
|
70659
70995
|
|
|
70660
70996
|
class StdioServerTransport {
|
|
70661
|
-
constructor(_stdin =
|
|
70997
|
+
constructor(_stdin = process2.stdin, _stdout = process2.stdout) {
|
|
70662
70998
|
this._stdin = _stdin;
|
|
70663
70999
|
this._stdout = _stdout;
|
|
70664
71000
|
this._readBuffer = new ReadBuffer;
|
|
@@ -72922,7 +73258,7 @@ async function run(app, inputs, context) {
|
|
|
72922
73258
|
}
|
|
72923
73259
|
|
|
72924
73260
|
// src/mcp-server/mcp-server.ts
|
|
72925
|
-
import
|
|
73261
|
+
import process3 from "node:process";
|
|
72926
73262
|
|
|
72927
73263
|
// src/mcp-server/cli.ts
|
|
72928
73264
|
function buildContext(process2) {
|
|
@@ -73153,13 +73489,13 @@ var routes = buildRouteMap({
|
|
|
73153
73489
|
var app = buildApplication(routes, {
|
|
73154
73490
|
name: "mcp",
|
|
73155
73491
|
versionInfo: {
|
|
73156
|
-
currentVersion: "2.1.
|
|
73492
|
+
currentVersion: "2.1.32"
|
|
73157
73493
|
}
|
|
73158
73494
|
});
|
|
73159
|
-
run(app,
|
|
73495
|
+
run(app, process3.argv.slice(2), buildContext(process3));
|
|
73160
73496
|
export {
|
|
73161
73497
|
app
|
|
73162
73498
|
};
|
|
73163
73499
|
|
|
73164
|
-
//# debugId=
|
|
73500
|
+
//# debugId=6335945964C9515A64756E2164756E21
|
|
73165
73501
|
//# sourceMappingURL=mcp-server.js.map
|