twenty-sdk 2.35.1 → 2.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billing/index.cjs +3 -3
- package/dist/billing/index.cjs.map +1 -1
- package/dist/billing/index.d.ts +25 -4
- package/dist/billing/index.mjs +495 -464
- package/dist/billing/index.mjs.map +1 -1
- package/dist/catalog-sync-DB_oIbry.js +1 -0
- package/dist/{catalog-sync-C82Xfr2f.mjs → catalog-sync-TFrxc_Y6.mjs} +4 -4
- package/dist/cli/commands/dev/dev-once.d.ts +1 -0
- package/dist/cli/commands/dev/dev.d.ts +1 -0
- package/dist/cli/operations/dev-once.d.ts +1 -0
- package/dist/cli/utilities/api/api-service.d.ts +3 -0
- package/dist/cli/utilities/api/application-api.d.ts +1 -0
- package/dist/cli/utilities/api/file-api.d.ts +41 -0
- package/dist/cli/utilities/dev/orchestrator/dev-mode-orchestrator.d.ts +1 -0
- package/dist/cli/utilities/dev/orchestrator/steps/format-sync-actions-plan.d.ts +8 -1
- package/dist/cli/utilities/dev/orchestrator/steps/sync-application-orchestrator-step.d.ts +3 -1
- package/dist/cli/utilities/dev/orchestrator/steps/upload-files-orchestrator-step.d.ts +1 -0
- package/dist/cli/utilities/entity/entity-view-template.d.ts +1 -1
- package/dist/cli/utilities/error/parse-server-error.d.ts +1 -0
- package/dist/cli/utilities/file/file-uploader.d.ts +13 -4
- package/dist/cli/utilities/file/put-file-to-upload-url.d.ts +5 -0
- package/dist/cli.cjs +30 -30
- package/dist/cli.mjs +5455 -5421
- package/dist/define/index.cjs +14 -14
- package/dist/define/index.cjs.map +1 -1
- package/dist/define/index.d.ts +340 -26
- package/dist/define/index.mjs +6104 -5955
- package/dist/define/index.mjs.map +1 -1
- package/dist/front-component/index.cjs +1 -1
- package/dist/front-component/index.cjs.map +1 -1
- package/dist/front-component/index.d.ts +23 -6
- package/dist/front-component/index.mjs +2 -2
- package/dist/front-component/index.mjs.map +1 -1
- package/dist/front-component-renderer/build.cjs +1 -1
- package/dist/front-component-renderer/build.mjs +1 -1
- package/dist/{get-front-component-build-plugins-D9VJQHw7.mjs → get-front-component-build-plugins-Bed7hCGi.mjs} +105 -91
- package/dist/{get-front-component-build-plugins-CcV3Cown.js → get-front-component-build-plugins-o8cM1FFZ.js} +8 -8
- package/dist/{get-function-input-schema-GNk3NRLJ-Byssjp8I.js → get-function-input-schema-GNk3NRLJ-A3CmF1qq.js} +1 -1
- package/dist/{get-function-input-schema-GNk3NRLJ-Dm0Ljlg4.mjs → get-function-input-schema-GNk3NRLJ-BPeB4a-_.mjs} +1 -1
- package/dist/logic-function/index.cjs +6 -4
- package/dist/logic-function/index.cjs.map +1 -1
- package/dist/logic-function/index.d.ts +24 -3
- package/dist/logic-function/index.mjs +28 -14
- package/dist/logic-function/index.mjs.map +1 -1
- package/dist/{login-cG7hCrTK.js → login-2yrPIORt.js} +89 -66
- package/dist/{login-BsiMC4oB.mjs → login-QYv7vAbh.mjs} +5011 -4705
- package/dist/operations.cjs +1 -1
- package/dist/operations.mjs +4 -4
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/catalog-sync-Bs-X2ChV.js +0 -1
package/dist/billing/index.mjs
CHANGED
|
@@ -392,28 +392,28 @@ function Le() {
|
|
|
392
392
|
return new RegExp(Ie, "u");
|
|
393
393
|
}
|
|
394
394
|
var Re = /^(?:(?: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])$/, ze = /^(([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}|:))$/, Be = /^((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])$/, Ve = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, He = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, M = /^[A-Za-z0-9_-]*$/, Ue = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, We = /^\+(?:[0-9]){6,14}[0-9]$/, N = "(?:(?:\\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])))", Ge = /*@__PURE__*/ RegExp(`^${N}$`);
|
|
395
|
-
function
|
|
395
|
+
function Ke(e) {
|
|
396
396
|
let t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
397
397
|
return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
398
398
|
}
|
|
399
|
-
function Ke(e) {
|
|
400
|
-
return RegExp(`^${P(e)}$`);
|
|
401
|
-
}
|
|
402
399
|
function qe(e) {
|
|
403
|
-
|
|
400
|
+
return RegExp(`^${Ke(e)}$`);
|
|
401
|
+
}
|
|
402
|
+
function Je(e) {
|
|
403
|
+
let t = Ke({ precision: e.precision }), n = ["Z"];
|
|
404
404
|
e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
405
405
|
let r = `${t}(?:${n.join("|")})`;
|
|
406
406
|
return RegExp(`^${N}T(?:${r})$`);
|
|
407
407
|
}
|
|
408
|
-
var
|
|
408
|
+
var Ye = (e) => {
|
|
409
409
|
let t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
410
410
|
return RegExp(`^${t}$`);
|
|
411
|
-
},
|
|
411
|
+
}, Xe = /^[^A-Z]*$/, Ze = /^[^a-z]*$/, P = /*@__PURE__*/ t("$ZodCheck", (e, t) => {
|
|
412
412
|
var n;
|
|
413
413
|
e._zod ??= {}, e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
|
|
414
|
-
}),
|
|
414
|
+
}), Qe = /*@__PURE__*/ t("$ZodCheckMaxLength", (e, t) => {
|
|
415
415
|
var n;
|
|
416
|
-
|
|
416
|
+
P.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
|
|
417
417
|
let t = e.value;
|
|
418
418
|
return !l(t) && t.length !== void 0;
|
|
419
419
|
}), e._zod.onattach.push((e) => {
|
|
@@ -433,9 +433,9 @@ var Je = (e) => {
|
|
|
433
433
|
continue: !t.abort
|
|
434
434
|
});
|
|
435
435
|
};
|
|
436
|
-
}),
|
|
436
|
+
}), $e = /*@__PURE__*/ t("$ZodCheckMinLength", (e, t) => {
|
|
437
437
|
var n;
|
|
438
|
-
|
|
438
|
+
P.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
|
|
439
439
|
let t = e.value;
|
|
440
440
|
return !l(t) && t.length !== void 0;
|
|
441
441
|
}), e._zod.onattach.push((e) => {
|
|
@@ -455,9 +455,9 @@ var Je = (e) => {
|
|
|
455
455
|
continue: !t.abort
|
|
456
456
|
});
|
|
457
457
|
};
|
|
458
|
-
}),
|
|
458
|
+
}), et = /*@__PURE__*/ t("$ZodCheckLengthEquals", (e, t) => {
|
|
459
459
|
var n;
|
|
460
|
-
|
|
460
|
+
P.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
|
|
461
461
|
let t = e.value;
|
|
462
462
|
return !l(t) && t.length !== void 0;
|
|
463
463
|
}), e._zod.onattach.push((e) => {
|
|
@@ -483,9 +483,9 @@ var Je = (e) => {
|
|
|
483
483
|
continue: !t.abort
|
|
484
484
|
});
|
|
485
485
|
};
|
|
486
|
-
}),
|
|
486
|
+
}), F = /*@__PURE__*/ t("$ZodCheckStringFormat", (e, t) => {
|
|
487
487
|
var n, r;
|
|
488
|
-
|
|
488
|
+
P.init(e, t), e._zod.onattach.push((e) => {
|
|
489
489
|
let n = e._zod.bag;
|
|
490
490
|
n.format = t.format, t.pattern && (n.patterns ??= /* @__PURE__ */ new Set(), n.patterns.add(t.pattern));
|
|
491
491
|
}), t.pattern ? (n = e._zod).check ?? (n.check = (n) => {
|
|
@@ -499,8 +499,8 @@ var Je = (e) => {
|
|
|
499
499
|
continue: !t.abort
|
|
500
500
|
});
|
|
501
501
|
}) : (r = e._zod).check ?? (r.check = () => {});
|
|
502
|
-
}),
|
|
503
|
-
|
|
502
|
+
}), tt = /*@__PURE__*/ t("$ZodCheckRegex", (e, t) => {
|
|
503
|
+
F.init(e, t), e._zod.check = (n) => {
|
|
504
504
|
t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
|
|
505
505
|
origin: "string",
|
|
506
506
|
code: "invalid_format",
|
|
@@ -511,12 +511,12 @@ var Je = (e) => {
|
|
|
511
511
|
continue: !t.abort
|
|
512
512
|
});
|
|
513
513
|
};
|
|
514
|
-
}),
|
|
515
|
-
t.pattern ??=
|
|
516
|
-
}),
|
|
517
|
-
t.pattern ??=
|
|
518
|
-
}),
|
|
519
|
-
|
|
514
|
+
}), nt = /*@__PURE__*/ t("$ZodCheckLowerCase", (e, t) => {
|
|
515
|
+
t.pattern ??= Xe, F.init(e, t);
|
|
516
|
+
}), rt = /*@__PURE__*/ t("$ZodCheckUpperCase", (e, t) => {
|
|
517
|
+
t.pattern ??= Ze, F.init(e, t);
|
|
518
|
+
}), it = /*@__PURE__*/ t("$ZodCheckIncludes", (e, t) => {
|
|
519
|
+
P.init(e, t);
|
|
520
520
|
let n = y(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
521
521
|
t.pattern = r, e._zod.onattach.push((e) => {
|
|
522
522
|
let t = e._zod.bag;
|
|
@@ -532,8 +532,8 @@ var Je = (e) => {
|
|
|
532
532
|
continue: !t.abort
|
|
533
533
|
});
|
|
534
534
|
};
|
|
535
|
-
}),
|
|
536
|
-
|
|
535
|
+
}), at = /*@__PURE__*/ t("$ZodCheckStartsWith", (e, t) => {
|
|
536
|
+
P.init(e, t);
|
|
537
537
|
let n = RegExp(`^${y(t.prefix)}.*`);
|
|
538
538
|
t.pattern ??= n, e._zod.onattach.push((e) => {
|
|
539
539
|
let t = e._zod.bag;
|
|
@@ -549,8 +549,8 @@ var Je = (e) => {
|
|
|
549
549
|
continue: !t.abort
|
|
550
550
|
});
|
|
551
551
|
};
|
|
552
|
-
}),
|
|
553
|
-
|
|
552
|
+
}), ot = /*@__PURE__*/ t("$ZodCheckEndsWith", (e, t) => {
|
|
553
|
+
P.init(e, t);
|
|
554
554
|
let n = RegExp(`.*${y(t.suffix)}$`);
|
|
555
555
|
t.pattern ??= n, e._zod.onattach.push((e) => {
|
|
556
556
|
let t = e._zod.bag;
|
|
@@ -566,11 +566,11 @@ var Je = (e) => {
|
|
|
566
566
|
continue: !t.abort
|
|
567
567
|
});
|
|
568
568
|
};
|
|
569
|
-
}),
|
|
570
|
-
|
|
569
|
+
}), st = /*@__PURE__*/ t("$ZodCheckOverwrite", (e, t) => {
|
|
570
|
+
P.init(e, t), e._zod.check = (e) => {
|
|
571
571
|
e.value = t.tx(e.value);
|
|
572
572
|
};
|
|
573
|
-
}),
|
|
573
|
+
}), ct = class {
|
|
574
574
|
constructor(e = []) {
|
|
575
575
|
this.content = [], this.indent = 0, this && (this.args = e);
|
|
576
576
|
}
|
|
@@ -589,13 +589,13 @@ var Je = (e) => {
|
|
|
589
589
|
let e = Function, t = this?.args, n = [...(this?.content ?? [""]).map((e) => ` ${e}`)];
|
|
590
590
|
return new e(...t, n.join("\n"));
|
|
591
591
|
}
|
|
592
|
-
},
|
|
592
|
+
}, lt = {
|
|
593
593
|
major: 4,
|
|
594
594
|
minor: 1,
|
|
595
595
|
patch: 11
|
|
596
|
-
},
|
|
596
|
+
}, I = /*@__PURE__*/ t("$ZodType", (e, t) => {
|
|
597
597
|
var r;
|
|
598
|
-
e ??= {}, e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version =
|
|
598
|
+
e ??= {}, e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = lt;
|
|
599
599
|
let i = [...e._zod.def.checks ?? []];
|
|
600
600
|
e._zod.traits.has("$ZodCheck") && i.unshift(e);
|
|
601
601
|
for (let t of i) for (let n of t._zod.onattach) n(e);
|
|
@@ -661,8 +661,8 @@ var Je = (e) => {
|
|
|
661
661
|
vendor: "zod",
|
|
662
662
|
version: 1
|
|
663
663
|
};
|
|
664
|
-
}),
|
|
665
|
-
|
|
664
|
+
}), L = /*@__PURE__*/ t("$ZodString", (e, t) => {
|
|
665
|
+
I.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? Ye(e._zod.bag), e._zod.parse = (n, r) => {
|
|
666
666
|
if (t.coerce) try {
|
|
667
667
|
n.value = String(n.value);
|
|
668
668
|
} catch {}
|
|
@@ -673,11 +673,11 @@ var Je = (e) => {
|
|
|
673
673
|
inst: e
|
|
674
674
|
}), n;
|
|
675
675
|
};
|
|
676
|
-
}),
|
|
677
|
-
|
|
678
|
-
}),
|
|
679
|
-
t.pattern ??= Pe,
|
|
680
|
-
}),
|
|
676
|
+
}), R = /*@__PURE__*/ t("$ZodStringFormat", (e, t) => {
|
|
677
|
+
F.init(e, t), L.init(e, t);
|
|
678
|
+
}), ut = /*@__PURE__*/ t("$ZodGUID", (e, t) => {
|
|
679
|
+
t.pattern ??= Pe, R.init(e, t);
|
|
680
|
+
}), dt = /*@__PURE__*/ t("$ZodUUID", (e, t) => {
|
|
681
681
|
if (t.version) {
|
|
682
682
|
let e = {
|
|
683
683
|
v1: 1,
|
|
@@ -692,11 +692,11 @@ var Je = (e) => {
|
|
|
692
692
|
if (e === void 0) throw Error(`Invalid UUID version: "${t.version}"`);
|
|
693
693
|
t.pattern ??= j(e);
|
|
694
694
|
} else t.pattern ??= j();
|
|
695
|
-
|
|
696
|
-
}),
|
|
697
|
-
t.pattern ??= Fe,
|
|
698
|
-
}),
|
|
699
|
-
|
|
695
|
+
R.init(e, t);
|
|
696
|
+
}), ft = /*@__PURE__*/ t("$ZodEmail", (e, t) => {
|
|
697
|
+
t.pattern ??= Fe, R.init(e, t);
|
|
698
|
+
}), pt = /*@__PURE__*/ t("$ZodURL", (e, t) => {
|
|
699
|
+
R.init(e, t), e._zod.check = (n) => {
|
|
700
700
|
try {
|
|
701
701
|
let r = n.value.trim(), i = new URL(r);
|
|
702
702
|
t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(i.hostname) || n.issues.push({
|
|
@@ -727,35 +727,35 @@ var Je = (e) => {
|
|
|
727
727
|
});
|
|
728
728
|
}
|
|
729
729
|
};
|
|
730
|
-
}),
|
|
731
|
-
t.pattern ??= Le(),
|
|
732
|
-
}),
|
|
733
|
-
t.pattern ??= Me,
|
|
734
|
-
}),
|
|
735
|
-
t.pattern ??= De,
|
|
736
|
-
}),
|
|
737
|
-
t.pattern ??= Oe,
|
|
738
|
-
}),
|
|
739
|
-
t.pattern ??= ke,
|
|
740
|
-
}),
|
|
741
|
-
t.pattern ??= Ae,
|
|
742
|
-
}),
|
|
743
|
-
t.pattern ??= je,
|
|
744
|
-
}),
|
|
745
|
-
t.pattern ??=
|
|
746
|
-
}),
|
|
747
|
-
t.pattern ??= Ge,
|
|
748
|
-
}),
|
|
749
|
-
t.pattern ??=
|
|
750
|
-
}),
|
|
751
|
-
t.pattern ??= Ne,
|
|
752
|
-
}),
|
|
753
|
-
t.pattern ??= Re,
|
|
730
|
+
}), mt = /*@__PURE__*/ t("$ZodEmoji", (e, t) => {
|
|
731
|
+
t.pattern ??= Le(), R.init(e, t);
|
|
732
|
+
}), ht = /*@__PURE__*/ t("$ZodNanoID", (e, t) => {
|
|
733
|
+
t.pattern ??= Me, R.init(e, t);
|
|
734
|
+
}), gt = /*@__PURE__*/ t("$ZodCUID", (e, t) => {
|
|
735
|
+
t.pattern ??= De, R.init(e, t);
|
|
736
|
+
}), _t = /*@__PURE__*/ t("$ZodCUID2", (e, t) => {
|
|
737
|
+
t.pattern ??= Oe, R.init(e, t);
|
|
738
|
+
}), vt = /*@__PURE__*/ t("$ZodULID", (e, t) => {
|
|
739
|
+
t.pattern ??= ke, R.init(e, t);
|
|
740
|
+
}), yt = /*@__PURE__*/ t("$ZodXID", (e, t) => {
|
|
741
|
+
t.pattern ??= Ae, R.init(e, t);
|
|
742
|
+
}), bt = /*@__PURE__*/ t("$ZodKSUID", (e, t) => {
|
|
743
|
+
t.pattern ??= je, R.init(e, t);
|
|
744
|
+
}), xt = /*@__PURE__*/ t("$ZodISODateTime", (e, t) => {
|
|
745
|
+
t.pattern ??= Je(t), R.init(e, t);
|
|
746
|
+
}), St = /*@__PURE__*/ t("$ZodISODate", (e, t) => {
|
|
747
|
+
t.pattern ??= Ge, R.init(e, t);
|
|
748
|
+
}), Ct = /*@__PURE__*/ t("$ZodISOTime", (e, t) => {
|
|
749
|
+
t.pattern ??= qe(t), R.init(e, t);
|
|
750
|
+
}), wt = /*@__PURE__*/ t("$ZodISODuration", (e, t) => {
|
|
751
|
+
t.pattern ??= Ne, R.init(e, t);
|
|
752
|
+
}), Tt = /*@__PURE__*/ t("$ZodIPv4", (e, t) => {
|
|
753
|
+
t.pattern ??= Re, R.init(e, t), e._zod.onattach.push((e) => {
|
|
754
754
|
let t = e._zod.bag;
|
|
755
755
|
t.format = "ipv4";
|
|
756
756
|
});
|
|
757
|
-
}),
|
|
758
|
-
t.pattern ??= ze,
|
|
757
|
+
}), Et = /*@__PURE__*/ t("$ZodIPv6", (e, t) => {
|
|
758
|
+
t.pattern ??= ze, R.init(e, t), e._zod.onattach.push((e) => {
|
|
759
759
|
let t = e._zod.bag;
|
|
760
760
|
t.format = "ipv6";
|
|
761
761
|
}), e._zod.check = (n) => {
|
|
@@ -771,10 +771,10 @@ var Je = (e) => {
|
|
|
771
771
|
});
|
|
772
772
|
}
|
|
773
773
|
};
|
|
774
|
-
}),
|
|
775
|
-
t.pattern ??= Be,
|
|
776
|
-
}),
|
|
777
|
-
t.pattern ??= Ve,
|
|
774
|
+
}), Dt = /*@__PURE__*/ t("$ZodCIDRv4", (e, t) => {
|
|
775
|
+
t.pattern ??= Be, R.init(e, t);
|
|
776
|
+
}), Ot = /*@__PURE__*/ t("$ZodCIDRv6", (e, t) => {
|
|
777
|
+
t.pattern ??= Ve, R.init(e, t), e._zod.check = (n) => {
|
|
778
778
|
let r = n.value.split("/");
|
|
779
779
|
try {
|
|
780
780
|
if (r.length !== 2) throw Error();
|
|
@@ -794,7 +794,7 @@ var Je = (e) => {
|
|
|
794
794
|
}
|
|
795
795
|
};
|
|
796
796
|
});
|
|
797
|
-
function
|
|
797
|
+
function kt(e) {
|
|
798
798
|
if (e === "") return !0;
|
|
799
799
|
if (e.length % 4 != 0) return !1;
|
|
800
800
|
try {
|
|
@@ -803,11 +803,11 @@ function Ot(e) {
|
|
|
803
803
|
return !1;
|
|
804
804
|
}
|
|
805
805
|
}
|
|
806
|
-
var
|
|
807
|
-
t.pattern ??= He,
|
|
806
|
+
var At = /*@__PURE__*/ t("$ZodBase64", (e, t) => {
|
|
807
|
+
t.pattern ??= He, R.init(e, t), e._zod.onattach.push((e) => {
|
|
808
808
|
e._zod.bag.contentEncoding = "base64";
|
|
809
809
|
}), e._zod.check = (n) => {
|
|
810
|
-
|
|
810
|
+
kt(n.value) || n.issues.push({
|
|
811
811
|
code: "invalid_format",
|
|
812
812
|
format: "base64",
|
|
813
813
|
input: n.value,
|
|
@@ -816,16 +816,16 @@ var kt = /*@__PURE__*/ t("$ZodBase64", (e, t) => {
|
|
|
816
816
|
});
|
|
817
817
|
};
|
|
818
818
|
});
|
|
819
|
-
function
|
|
819
|
+
function jt(e) {
|
|
820
820
|
if (!M.test(e)) return !1;
|
|
821
821
|
let t = e.replace(/[-_]/g, (e) => e === "-" ? "+" : "/");
|
|
822
|
-
return
|
|
822
|
+
return kt(t.padEnd(Math.ceil(t.length / 4) * 4, "="));
|
|
823
823
|
}
|
|
824
|
-
var
|
|
825
|
-
t.pattern ??= M,
|
|
824
|
+
var Mt = /*@__PURE__*/ t("$ZodBase64URL", (e, t) => {
|
|
825
|
+
t.pattern ??= M, R.init(e, t), e._zod.onattach.push((e) => {
|
|
826
826
|
e._zod.bag.contentEncoding = "base64url";
|
|
827
827
|
}), e._zod.check = (n) => {
|
|
828
|
-
|
|
828
|
+
jt(n.value) || n.issues.push({
|
|
829
829
|
code: "invalid_format",
|
|
830
830
|
format: "base64url",
|
|
831
831
|
input: n.value,
|
|
@@ -833,10 +833,10 @@ var jt = /*@__PURE__*/ t("$ZodBase64URL", (e, t) => {
|
|
|
833
833
|
continue: !t.abort
|
|
834
834
|
});
|
|
835
835
|
};
|
|
836
|
-
}),
|
|
837
|
-
t.pattern ??= We,
|
|
836
|
+
}), Nt = /*@__PURE__*/ t("$ZodE164", (e, t) => {
|
|
837
|
+
t.pattern ??= We, R.init(e, t);
|
|
838
838
|
});
|
|
839
|
-
function
|
|
839
|
+
function Pt(e, t = null) {
|
|
840
840
|
try {
|
|
841
841
|
let n = e.split(".");
|
|
842
842
|
if (n.length !== 3) return !1;
|
|
@@ -848,9 +848,9 @@ function Nt(e, t = null) {
|
|
|
848
848
|
return !1;
|
|
849
849
|
}
|
|
850
850
|
}
|
|
851
|
-
var
|
|
852
|
-
|
|
853
|
-
|
|
851
|
+
var Ft = /*@__PURE__*/ t("$ZodJWT", (e, t) => {
|
|
852
|
+
R.init(e, t), e._zod.check = (n) => {
|
|
853
|
+
Pt(n.value, t.alg) || n.issues.push({
|
|
854
854
|
code: "invalid_format",
|
|
855
855
|
format: "jwt",
|
|
856
856
|
input: n.value,
|
|
@@ -858,21 +858,21 @@ var Pt = /*@__PURE__*/ t("$ZodJWT", (e, t) => {
|
|
|
858
858
|
continue: !t.abort
|
|
859
859
|
});
|
|
860
860
|
};
|
|
861
|
-
}),
|
|
862
|
-
|
|
863
|
-
}),
|
|
864
|
-
|
|
861
|
+
}), It = /*@__PURE__*/ t("$ZodUnknown", (e, t) => {
|
|
862
|
+
I.init(e, t), e._zod.parse = (e) => e;
|
|
863
|
+
}), Lt = /*@__PURE__*/ t("$ZodNever", (e, t) => {
|
|
864
|
+
I.init(e, t), e._zod.parse = (t, n) => (t.issues.push({
|
|
865
865
|
expected: "never",
|
|
866
866
|
code: "invalid_type",
|
|
867
867
|
input: t.value,
|
|
868
868
|
inst: e
|
|
869
869
|
}), t);
|
|
870
870
|
});
|
|
871
|
-
function
|
|
871
|
+
function Rt(e, t, n) {
|
|
872
872
|
e.issues.length && t.issues.push(...de(n, e.issues)), t.value[n] = e.value;
|
|
873
873
|
}
|
|
874
|
-
var
|
|
875
|
-
|
|
874
|
+
var zt = /*@__PURE__*/ t("$ZodArray", (e, t) => {
|
|
875
|
+
I.init(e, t), e._zod.parse = (n, r) => {
|
|
876
876
|
let i = n.value;
|
|
877
877
|
if (!Array.isArray(i)) return n.issues.push({
|
|
878
878
|
expected: "array",
|
|
@@ -887,15 +887,15 @@ var Rt = /*@__PURE__*/ t("$ZodArray", (e, t) => {
|
|
|
887
887
|
value: o,
|
|
888
888
|
issues: []
|
|
889
889
|
}, r);
|
|
890
|
-
s instanceof Promise ? a.push(s.then((t) =>
|
|
890
|
+
s instanceof Promise ? a.push(s.then((t) => Rt(t, n, e))) : Rt(s, n, e);
|
|
891
891
|
}
|
|
892
892
|
return a.length ? Promise.all(a).then(() => n) : n;
|
|
893
893
|
};
|
|
894
894
|
});
|
|
895
|
-
function
|
|
895
|
+
function z(e, t, n, r) {
|
|
896
896
|
e.issues.length && t.issues.push(...de(n, e.issues)), e.value === void 0 ? n in r && (t.value[n] = void 0) : t.value[n] = e.value;
|
|
897
897
|
}
|
|
898
|
-
function
|
|
898
|
+
function Bt(e) {
|
|
899
899
|
let t = Object.keys(e.shape);
|
|
900
900
|
for (let n of t) if (!e.shape?.[n]?._zod?.traits?.has("$ZodType")) throw Error(`Invalid element at key "${n}": expected a Zod schema`);
|
|
901
901
|
let n = re(e.shape);
|
|
@@ -907,7 +907,7 @@ function zt(e) {
|
|
|
907
907
|
optionalKeys: new Set(n)
|
|
908
908
|
};
|
|
909
909
|
}
|
|
910
|
-
function
|
|
910
|
+
function Vt(e, t, n, r, i, a) {
|
|
911
911
|
let o = [], s = i.keySet, c = i.catchall._zod, l = c.def.type;
|
|
912
912
|
for (let i of Object.keys(t)) {
|
|
913
913
|
if (s.has(i)) continue;
|
|
@@ -919,7 +919,7 @@ function Bt(e, t, n, r, i, a) {
|
|
|
919
919
|
value: t[i],
|
|
920
920
|
issues: []
|
|
921
921
|
}, r);
|
|
922
|
-
a instanceof Promise ? e.push(a.then((e) =>
|
|
922
|
+
a instanceof Promise ? e.push(a.then((e) => z(e, n, i, t))) : z(a, n, i, t);
|
|
923
923
|
}
|
|
924
924
|
return o.length && n.issues.push({
|
|
925
925
|
code: "unrecognized_keys",
|
|
@@ -928,15 +928,15 @@ function Bt(e, t, n, r, i, a) {
|
|
|
928
928
|
inst: a
|
|
929
929
|
}), e.length ? Promise.all(e).then(() => n) : n;
|
|
930
930
|
}
|
|
931
|
-
var
|
|
932
|
-
if (
|
|
931
|
+
var Ht = /*@__PURE__*/ t("$ZodObject", (e, t) => {
|
|
932
|
+
if (I.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
|
|
933
933
|
let e = t.shape;
|
|
934
934
|
Object.defineProperty(t, "shape", { get: () => {
|
|
935
935
|
let n = { ...e };
|
|
936
936
|
return Object.defineProperty(t, "shape", { value: n }), n;
|
|
937
937
|
} });
|
|
938
938
|
}
|
|
939
|
-
let n = c(() =>
|
|
939
|
+
let n = c(() => Bt(t));
|
|
940
940
|
f(e._zod, "propValues", () => {
|
|
941
941
|
let e = t.shape, n = {};
|
|
942
942
|
for (let t in e) {
|
|
@@ -965,14 +965,14 @@ var Vt = /*@__PURE__*/ t("$ZodObject", (e, t) => {
|
|
|
965
965
|
value: s[e],
|
|
966
966
|
issues: []
|
|
967
967
|
}, o);
|
|
968
|
-
n instanceof Promise ? c.push(n.then((n) =>
|
|
968
|
+
n instanceof Promise ? c.push(n.then((n) => z(n, t, e, s))) : z(n, t, e, s);
|
|
969
969
|
}
|
|
970
|
-
return i ?
|
|
970
|
+
return i ? Vt(c, s, t, o, n.value, e) : c.length ? Promise.all(c).then(() => t) : t;
|
|
971
971
|
};
|
|
972
|
-
}),
|
|
973
|
-
|
|
974
|
-
let n = e._zod.parse, r = c(() =>
|
|
975
|
-
let t = new
|
|
972
|
+
}), Ut = /*@__PURE__*/ t("$ZodObjectJIT", (e, t) => {
|
|
973
|
+
Ht.init(e, t);
|
|
974
|
+
let n = e._zod.parse, r = c(() => Bt(t)), a = (e) => {
|
|
975
|
+
let t = new ct([
|
|
976
976
|
"shape",
|
|
977
977
|
"payload",
|
|
978
978
|
"ctx"
|
|
@@ -1012,7 +1012,7 @@ var Vt = /*@__PURE__*/ t("$ZodObject", (e, t) => {
|
|
|
1012
1012
|
e._zod.parse = (i, c) => {
|
|
1013
1013
|
f ??= r.value;
|
|
1014
1014
|
let p = i.value;
|
|
1015
|
-
return s(p) ? l && u && c?.async === !1 && c.jitless !== !0 ? (o ||= a(t.shape), i = o(i, c), d ?
|
|
1015
|
+
return s(p) ? l && u && c?.async === !1 && c.jitless !== !0 ? (o ||= a(t.shape), i = o(i, c), d ? Vt([], p, i, c, f, e) : i) : n(i, c) : (i.issues.push({
|
|
1016
1016
|
expected: "object",
|
|
1017
1017
|
code: "invalid_type",
|
|
1018
1018
|
input: p,
|
|
@@ -1020,7 +1020,7 @@ var Vt = /*@__PURE__*/ t("$ZodObject", (e, t) => {
|
|
|
1020
1020
|
}), i);
|
|
1021
1021
|
};
|
|
1022
1022
|
});
|
|
1023
|
-
function
|
|
1023
|
+
function Wt(e, t, n, r) {
|
|
1024
1024
|
for (let n of e) if (n.issues.length === 0) return t.value = n.value, t;
|
|
1025
1025
|
let i = e.filter((e) => !S(e));
|
|
1026
1026
|
return i.length === 1 ? (t.value = i[0].value, i[0]) : (t.issues.push({
|
|
@@ -1030,8 +1030,8 @@ function Ut(e, t, n, r) {
|
|
|
1030
1030
|
errors: e.map((e) => e.issues.map((e) => w(e, r, a())))
|
|
1031
1031
|
}), t);
|
|
1032
1032
|
}
|
|
1033
|
-
var
|
|
1034
|
-
|
|
1033
|
+
var Gt = /*@__PURE__*/ t("$ZodUnion", (e, t) => {
|
|
1034
|
+
I.init(e, t), f(e._zod, "optin", () => t.options.some((e) => e._zod.optin === "optional") ? "optional" : void 0), f(e._zod, "optout", () => t.options.some((e) => e._zod.optout === "optional") ? "optional" : void 0), f(e._zod, "values", () => {
|
|
1035
1035
|
if (t.options.every((e) => e._zod.values)) return new Set(t.options.flatMap((e) => Array.from(e._zod.values)));
|
|
1036
1036
|
}), f(e._zod, "pattern", () => {
|
|
1037
1037
|
if (t.options.every((e) => e._zod.pattern)) {
|
|
@@ -1054,10 +1054,10 @@ var Wt = /*@__PURE__*/ t("$ZodUnion", (e, t) => {
|
|
|
1054
1054
|
s.push(t);
|
|
1055
1055
|
}
|
|
1056
1056
|
}
|
|
1057
|
-
return o ? Promise.all(s).then((t) =>
|
|
1057
|
+
return o ? Promise.all(s).then((t) => Wt(t, i, e, a)) : Wt(s, i, e, a);
|
|
1058
1058
|
};
|
|
1059
|
-
}),
|
|
1060
|
-
|
|
1059
|
+
}), Kt = /*@__PURE__*/ t("$ZodIntersection", (e, t) => {
|
|
1060
|
+
I.init(e, t), e._zod.parse = (e, n) => {
|
|
1061
1061
|
let r = e.value, i = t.left._zod.run({
|
|
1062
1062
|
value: r,
|
|
1063
1063
|
issues: []
|
|
@@ -1065,10 +1065,10 @@ var Wt = /*@__PURE__*/ t("$ZodUnion", (e, t) => {
|
|
|
1065
1065
|
value: r,
|
|
1066
1066
|
issues: []
|
|
1067
1067
|
}, n);
|
|
1068
|
-
return i instanceof Promise || a instanceof Promise ? Promise.all([i, a]).then(([t, n]) =>
|
|
1068
|
+
return i instanceof Promise || a instanceof Promise ? Promise.all([i, a]).then(([t, n]) => qt(e, t, n)) : qt(e, i, a);
|
|
1069
1069
|
};
|
|
1070
1070
|
});
|
|
1071
|
-
function
|
|
1071
|
+
function B(e, t) {
|
|
1072
1072
|
if (e === t || e instanceof Date && t instanceof Date && +e == +t) return {
|
|
1073
1073
|
valid: !0,
|
|
1074
1074
|
data: e
|
|
@@ -1079,7 +1079,7 @@ function V(e, t) {
|
|
|
1079
1079
|
...t
|
|
1080
1080
|
};
|
|
1081
1081
|
for (let n of r) {
|
|
1082
|
-
let r =
|
|
1082
|
+
let r = B(e[n], t[n]);
|
|
1083
1083
|
if (!r.valid) return {
|
|
1084
1084
|
valid: !1,
|
|
1085
1085
|
mergeErrorPath: [n, ...r.mergeErrorPath]
|
|
@@ -1098,7 +1098,7 @@ function V(e, t) {
|
|
|
1098
1098
|
};
|
|
1099
1099
|
let n = [];
|
|
1100
1100
|
for (let r = 0; r < e.length; r++) {
|
|
1101
|
-
let i = e[r], a = t[r], o =
|
|
1101
|
+
let i = e[r], a = t[r], o = B(i, a);
|
|
1102
1102
|
if (!o.valid) return {
|
|
1103
1103
|
valid: !1,
|
|
1104
1104
|
mergeErrorPath: [r, ...o.mergeErrorPath]
|
|
@@ -1115,14 +1115,14 @@ function V(e, t) {
|
|
|
1115
1115
|
mergeErrorPath: []
|
|
1116
1116
|
};
|
|
1117
1117
|
}
|
|
1118
|
-
function
|
|
1118
|
+
function qt(e, t, n) {
|
|
1119
1119
|
if (t.issues.length && e.issues.push(...t.issues), n.issues.length && e.issues.push(...n.issues), S(e)) return e;
|
|
1120
|
-
let r =
|
|
1120
|
+
let r = B(t.value, n.value);
|
|
1121
1121
|
if (!r.valid) throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
|
|
1122
1122
|
return e.value = r.data, e;
|
|
1123
1123
|
}
|
|
1124
|
-
var
|
|
1125
|
-
|
|
1124
|
+
var Jt = /*@__PURE__*/ t("$ZodEnum", (e, t) => {
|
|
1125
|
+
I.init(e, t);
|
|
1126
1126
|
let n = o(t.entries), r = new Set(n);
|
|
1127
1127
|
e._zod.values = r, e._zod.pattern = RegExp(`^(${n.filter((e) => ne.has(typeof e)).map((e) => typeof e == "string" ? y(e) : e.toString()).join("|")})$`), e._zod.parse = (t, i) => {
|
|
1128
1128
|
let a = t.value;
|
|
@@ -1133,8 +1133,8 @@ var qt = /*@__PURE__*/ t("$ZodEnum", (e, t) => {
|
|
|
1133
1133
|
inst: e
|
|
1134
1134
|
}), t;
|
|
1135
1135
|
};
|
|
1136
|
-
}),
|
|
1137
|
-
|
|
1136
|
+
}), Yt = /*@__PURE__*/ t("$ZodTransform", (e, t) => {
|
|
1137
|
+
I.init(e, t), e._zod.parse = (i, a) => {
|
|
1138
1138
|
if (a.direction === "backward") throw new r(e.constructor.name);
|
|
1139
1139
|
let o = t.transform(i.value, i);
|
|
1140
1140
|
if (a.async) return (o instanceof Promise ? o : Promise.resolve(o)).then((e) => (i.value = e, i));
|
|
@@ -1142,51 +1142,51 @@ var qt = /*@__PURE__*/ t("$ZodEnum", (e, t) => {
|
|
|
1142
1142
|
return i.value = o, i;
|
|
1143
1143
|
};
|
|
1144
1144
|
});
|
|
1145
|
-
function
|
|
1145
|
+
function Xt(e, t) {
|
|
1146
1146
|
return e.issues.length && t === void 0 ? {
|
|
1147
1147
|
issues: [],
|
|
1148
1148
|
value: void 0
|
|
1149
1149
|
} : e;
|
|
1150
1150
|
}
|
|
1151
|
-
var
|
|
1152
|
-
|
|
1151
|
+
var Zt = /*@__PURE__*/ t("$ZodOptional", (e, t) => {
|
|
1152
|
+
I.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", f(e._zod, "values", () => t.innerType._zod.values ? new Set([...t.innerType._zod.values, void 0]) : void 0), f(e._zod, "pattern", () => {
|
|
1153
1153
|
let e = t.innerType._zod.pattern;
|
|
1154
1154
|
return e ? RegExp(`^(${u(e.source)})?$`) : void 0;
|
|
1155
1155
|
}), e._zod.parse = (e, n) => {
|
|
1156
1156
|
if (t.innerType._zod.optin === "optional") {
|
|
1157
1157
|
let r = t.innerType._zod.run(e, n);
|
|
1158
|
-
return r instanceof Promise ? r.then((t) =>
|
|
1158
|
+
return r instanceof Promise ? r.then((t) => Xt(t, e.value)) : Xt(r, e.value);
|
|
1159
1159
|
}
|
|
1160
1160
|
return e.value === void 0 ? e : t.innerType._zod.run(e, n);
|
|
1161
1161
|
};
|
|
1162
|
-
}),
|
|
1163
|
-
|
|
1162
|
+
}), Qt = /*@__PURE__*/ t("$ZodNullable", (e, t) => {
|
|
1163
|
+
I.init(e, t), f(e._zod, "optin", () => t.innerType._zod.optin), f(e._zod, "optout", () => t.innerType._zod.optout), f(e._zod, "pattern", () => {
|
|
1164
1164
|
let e = t.innerType._zod.pattern;
|
|
1165
1165
|
return e ? RegExp(`^(${u(e.source)}|null)$`) : void 0;
|
|
1166
1166
|
}), f(e._zod, "values", () => t.innerType._zod.values ? new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (e, n) => e.value === null ? e : t.innerType._zod.run(e, n);
|
|
1167
|
-
}),
|
|
1168
|
-
|
|
1167
|
+
}), $t = /*@__PURE__*/ t("$ZodDefault", (e, t) => {
|
|
1168
|
+
I.init(e, t), e._zod.optin = "optional", f(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => {
|
|
1169
1169
|
if (n.direction === "backward") return t.innerType._zod.run(e, n);
|
|
1170
1170
|
if (e.value === void 0) return e.value = t.defaultValue, e;
|
|
1171
1171
|
let r = t.innerType._zod.run(e, n);
|
|
1172
|
-
return r instanceof Promise ? r.then((e) =>
|
|
1172
|
+
return r instanceof Promise ? r.then((e) => en(e, t)) : en(r, t);
|
|
1173
1173
|
};
|
|
1174
1174
|
});
|
|
1175
|
-
function
|
|
1175
|
+
function en(e, t) {
|
|
1176
1176
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
1177
1177
|
}
|
|
1178
|
-
var
|
|
1179
|
-
|
|
1180
|
-
}),
|
|
1181
|
-
|
|
1178
|
+
var tn = /*@__PURE__*/ t("$ZodPrefault", (e, t) => {
|
|
1179
|
+
I.init(e, t), e._zod.optin = "optional", f(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => (n.direction === "backward" || e.value === void 0 && (e.value = t.defaultValue), t.innerType._zod.run(e, n));
|
|
1180
|
+
}), nn = /*@__PURE__*/ t("$ZodNonOptional", (e, t) => {
|
|
1181
|
+
I.init(e, t), f(e._zod, "values", () => {
|
|
1182
1182
|
let e = t.innerType._zod.values;
|
|
1183
1183
|
return e ? new Set([...e].filter((e) => e !== void 0)) : void 0;
|
|
1184
1184
|
}), e._zod.parse = (n, r) => {
|
|
1185
1185
|
let i = t.innerType._zod.run(n, r);
|
|
1186
|
-
return i instanceof Promise ? i.then((t) =>
|
|
1186
|
+
return i instanceof Promise ? i.then((t) => rn(t, e)) : rn(i, e);
|
|
1187
1187
|
};
|
|
1188
1188
|
});
|
|
1189
|
-
function
|
|
1189
|
+
function rn(e, t) {
|
|
1190
1190
|
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
1191
1191
|
code: "invalid_type",
|
|
1192
1192
|
expected: "nonoptional",
|
|
@@ -1194,8 +1194,8 @@ function nn(e, t) {
|
|
|
1194
1194
|
inst: t
|
|
1195
1195
|
}), e;
|
|
1196
1196
|
}
|
|
1197
|
-
var
|
|
1198
|
-
|
|
1197
|
+
var an = /*@__PURE__*/ t("$ZodCatch", (e, t) => {
|
|
1198
|
+
I.init(e, t), f(e._zod, "optin", () => t.innerType._zod.optin), f(e._zod, "optout", () => t.innerType._zod.optout), f(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => {
|
|
1199
1199
|
if (n.direction === "backward") return t.innerType._zod.run(e, n);
|
|
1200
1200
|
let r = t.innerType._zod.run(e, n);
|
|
1201
1201
|
return r instanceof Promise ? r.then((r) => (e.value = r.value, r.issues.length && (e.value = t.catchValue({
|
|
@@ -1208,40 +1208,40 @@ var rn = /*@__PURE__*/ t("$ZodCatch", (e, t) => {
|
|
|
1208
1208
|
input: e.value
|
|
1209
1209
|
}), e.issues = []), e);
|
|
1210
1210
|
};
|
|
1211
|
-
}),
|
|
1212
|
-
|
|
1211
|
+
}), on = /*@__PURE__*/ t("$ZodPipe", (e, t) => {
|
|
1212
|
+
I.init(e, t), f(e._zod, "values", () => t.in._zod.values), f(e._zod, "optin", () => t.in._zod.optin), f(e._zod, "optout", () => t.out._zod.optout), f(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (e, n) => {
|
|
1213
1213
|
if (n.direction === "backward") {
|
|
1214
1214
|
let r = t.out._zod.run(e, n);
|
|
1215
|
-
return r instanceof Promise ? r.then((e) =>
|
|
1215
|
+
return r instanceof Promise ? r.then((e) => V(e, t.in, n)) : V(r, t.in, n);
|
|
1216
1216
|
}
|
|
1217
1217
|
let r = t.in._zod.run(e, n);
|
|
1218
|
-
return r instanceof Promise ? r.then((e) =>
|
|
1218
|
+
return r instanceof Promise ? r.then((e) => V(e, t.out, n)) : V(r, t.out, n);
|
|
1219
1219
|
};
|
|
1220
1220
|
});
|
|
1221
|
-
function
|
|
1221
|
+
function V(e, t, n) {
|
|
1222
1222
|
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({
|
|
1223
1223
|
value: e.value,
|
|
1224
1224
|
issues: e.issues
|
|
1225
1225
|
}, n);
|
|
1226
1226
|
}
|
|
1227
|
-
var
|
|
1228
|
-
|
|
1227
|
+
var sn = /*@__PURE__*/ t("$ZodReadonly", (e, t) => {
|
|
1228
|
+
I.init(e, t), f(e._zod, "propValues", () => t.innerType._zod.propValues), f(e._zod, "values", () => t.innerType._zod.values), f(e._zod, "optin", () => t.innerType._zod.optin), f(e._zod, "optout", () => t.innerType._zod.optout), e._zod.parse = (e, n) => {
|
|
1229
1229
|
if (n.direction === "backward") return t.innerType._zod.run(e, n);
|
|
1230
1230
|
let r = t.innerType._zod.run(e, n);
|
|
1231
|
-
return r instanceof Promise ? r.then(
|
|
1231
|
+
return r instanceof Promise ? r.then(cn) : cn(r);
|
|
1232
1232
|
};
|
|
1233
1233
|
});
|
|
1234
|
-
function
|
|
1234
|
+
function cn(e) {
|
|
1235
1235
|
return e.value = Object.freeze(e.value), e;
|
|
1236
1236
|
}
|
|
1237
|
-
var
|
|
1238
|
-
|
|
1237
|
+
var ln = /*@__PURE__*/ t("$ZodCustom", (e, t) => {
|
|
1238
|
+
P.init(e, t), I.init(e, t), e._zod.parse = (e, t) => e, e._zod.check = (n) => {
|
|
1239
1239
|
let r = n.value, i = t.fn(r);
|
|
1240
|
-
if (i instanceof Promise) return i.then((t) =>
|
|
1241
|
-
|
|
1240
|
+
if (i instanceof Promise) return i.then((t) => un(t, n, r, e));
|
|
1241
|
+
un(i, n, r, e);
|
|
1242
1242
|
};
|
|
1243
1243
|
});
|
|
1244
|
-
function
|
|
1244
|
+
function un(e, t, n, r) {
|
|
1245
1245
|
if (!e) {
|
|
1246
1246
|
let e = {
|
|
1247
1247
|
code: "custom",
|
|
@@ -1255,7 +1255,7 @@ function ln(e, t, n, r) {
|
|
|
1255
1255
|
}
|
|
1256
1256
|
//#endregion
|
|
1257
1257
|
//#region ../../node_modules/zod/v4/core/registries.js
|
|
1258
|
-
var
|
|
1258
|
+
var dn = class {
|
|
1259
1259
|
constructor() {
|
|
1260
1260
|
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
1261
1261
|
}
|
|
@@ -1291,19 +1291,19 @@ var un = class {
|
|
|
1291
1291
|
return this._map.has(e);
|
|
1292
1292
|
}
|
|
1293
1293
|
};
|
|
1294
|
-
function
|
|
1295
|
-
return new
|
|
1294
|
+
function fn() {
|
|
1295
|
+
return new dn();
|
|
1296
1296
|
}
|
|
1297
|
-
var
|
|
1297
|
+
var H = /*@__PURE__*/ fn();
|
|
1298
1298
|
//#endregion
|
|
1299
1299
|
//#region ../../node_modules/zod/v4/core/api.js
|
|
1300
|
-
function
|
|
1300
|
+
function pn(e, t) {
|
|
1301
1301
|
return new e({
|
|
1302
1302
|
type: "string",
|
|
1303
1303
|
...x(t)
|
|
1304
1304
|
});
|
|
1305
1305
|
}
|
|
1306
|
-
function
|
|
1306
|
+
function mn(e, t) {
|
|
1307
1307
|
return new e({
|
|
1308
1308
|
type: "string",
|
|
1309
1309
|
format: "email",
|
|
@@ -1312,7 +1312,7 @@ function pn(e, t) {
|
|
|
1312
1312
|
...x(t)
|
|
1313
1313
|
});
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1315
|
+
function hn(e, t) {
|
|
1316
1316
|
return new e({
|
|
1317
1317
|
type: "string",
|
|
1318
1318
|
format: "guid",
|
|
@@ -1321,7 +1321,7 @@ function mn(e, t) {
|
|
|
1321
1321
|
...x(t)
|
|
1322
1322
|
});
|
|
1323
1323
|
}
|
|
1324
|
-
function
|
|
1324
|
+
function gn(e, t) {
|
|
1325
1325
|
return new e({
|
|
1326
1326
|
type: "string",
|
|
1327
1327
|
format: "uuid",
|
|
@@ -1330,7 +1330,7 @@ function hn(e, t) {
|
|
|
1330
1330
|
...x(t)
|
|
1331
1331
|
});
|
|
1332
1332
|
}
|
|
1333
|
-
function
|
|
1333
|
+
function _n(e, t) {
|
|
1334
1334
|
return new e({
|
|
1335
1335
|
type: "string",
|
|
1336
1336
|
format: "uuid",
|
|
@@ -1340,7 +1340,7 @@ function gn(e, t) {
|
|
|
1340
1340
|
...x(t)
|
|
1341
1341
|
});
|
|
1342
1342
|
}
|
|
1343
|
-
function
|
|
1343
|
+
function vn(e, t) {
|
|
1344
1344
|
return new e({
|
|
1345
1345
|
type: "string",
|
|
1346
1346
|
format: "uuid",
|
|
@@ -1350,7 +1350,7 @@ function _n(e, t) {
|
|
|
1350
1350
|
...x(t)
|
|
1351
1351
|
});
|
|
1352
1352
|
}
|
|
1353
|
-
function
|
|
1353
|
+
function yn(e, t) {
|
|
1354
1354
|
return new e({
|
|
1355
1355
|
type: "string",
|
|
1356
1356
|
format: "uuid",
|
|
@@ -1360,7 +1360,7 @@ function vn(e, t) {
|
|
|
1360
1360
|
...x(t)
|
|
1361
1361
|
});
|
|
1362
1362
|
}
|
|
1363
|
-
function
|
|
1363
|
+
function bn(e, t) {
|
|
1364
1364
|
return new e({
|
|
1365
1365
|
type: "string",
|
|
1366
1366
|
format: "url",
|
|
@@ -1369,7 +1369,7 @@ function yn(e, t) {
|
|
|
1369
1369
|
...x(t)
|
|
1370
1370
|
});
|
|
1371
1371
|
}
|
|
1372
|
-
function
|
|
1372
|
+
function xn(e, t) {
|
|
1373
1373
|
return new e({
|
|
1374
1374
|
type: "string",
|
|
1375
1375
|
format: "emoji",
|
|
@@ -1378,7 +1378,7 @@ function bn(e, t) {
|
|
|
1378
1378
|
...x(t)
|
|
1379
1379
|
});
|
|
1380
1380
|
}
|
|
1381
|
-
function
|
|
1381
|
+
function Sn(e, t) {
|
|
1382
1382
|
return new e({
|
|
1383
1383
|
type: "string",
|
|
1384
1384
|
format: "nanoid",
|
|
@@ -1387,7 +1387,7 @@ function xn(e, t) {
|
|
|
1387
1387
|
...x(t)
|
|
1388
1388
|
});
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1390
|
+
function Cn(e, t) {
|
|
1391
1391
|
return new e({
|
|
1392
1392
|
type: "string",
|
|
1393
1393
|
format: "cuid",
|
|
@@ -1396,7 +1396,7 @@ function Sn(e, t) {
|
|
|
1396
1396
|
...x(t)
|
|
1397
1397
|
});
|
|
1398
1398
|
}
|
|
1399
|
-
function
|
|
1399
|
+
function wn(e, t) {
|
|
1400
1400
|
return new e({
|
|
1401
1401
|
type: "string",
|
|
1402
1402
|
format: "cuid2",
|
|
@@ -1405,7 +1405,7 @@ function Cn(e, t) {
|
|
|
1405
1405
|
...x(t)
|
|
1406
1406
|
});
|
|
1407
1407
|
}
|
|
1408
|
-
function
|
|
1408
|
+
function Tn(e, t) {
|
|
1409
1409
|
return new e({
|
|
1410
1410
|
type: "string",
|
|
1411
1411
|
format: "ulid",
|
|
@@ -1414,7 +1414,7 @@ function wn(e, t) {
|
|
|
1414
1414
|
...x(t)
|
|
1415
1415
|
});
|
|
1416
1416
|
}
|
|
1417
|
-
function
|
|
1417
|
+
function En(e, t) {
|
|
1418
1418
|
return new e({
|
|
1419
1419
|
type: "string",
|
|
1420
1420
|
format: "xid",
|
|
@@ -1423,7 +1423,7 @@ function Tn(e, t) {
|
|
|
1423
1423
|
...x(t)
|
|
1424
1424
|
});
|
|
1425
1425
|
}
|
|
1426
|
-
function
|
|
1426
|
+
function Dn(e, t) {
|
|
1427
1427
|
return new e({
|
|
1428
1428
|
type: "string",
|
|
1429
1429
|
format: "ksuid",
|
|
@@ -1432,7 +1432,7 @@ function En(e, t) {
|
|
|
1432
1432
|
...x(t)
|
|
1433
1433
|
});
|
|
1434
1434
|
}
|
|
1435
|
-
function
|
|
1435
|
+
function On(e, t) {
|
|
1436
1436
|
return new e({
|
|
1437
1437
|
type: "string",
|
|
1438
1438
|
format: "ipv4",
|
|
@@ -1441,7 +1441,7 @@ function Dn(e, t) {
|
|
|
1441
1441
|
...x(t)
|
|
1442
1442
|
});
|
|
1443
1443
|
}
|
|
1444
|
-
function
|
|
1444
|
+
function kn(e, t) {
|
|
1445
1445
|
return new e({
|
|
1446
1446
|
type: "string",
|
|
1447
1447
|
format: "ipv6",
|
|
@@ -1450,7 +1450,7 @@ function On(e, t) {
|
|
|
1450
1450
|
...x(t)
|
|
1451
1451
|
});
|
|
1452
1452
|
}
|
|
1453
|
-
function
|
|
1453
|
+
function An(e, t) {
|
|
1454
1454
|
return new e({
|
|
1455
1455
|
type: "string",
|
|
1456
1456
|
format: "cidrv4",
|
|
@@ -1459,7 +1459,7 @@ function kn(e, t) {
|
|
|
1459
1459
|
...x(t)
|
|
1460
1460
|
});
|
|
1461
1461
|
}
|
|
1462
|
-
function
|
|
1462
|
+
function jn(e, t) {
|
|
1463
1463
|
return new e({
|
|
1464
1464
|
type: "string",
|
|
1465
1465
|
format: "cidrv6",
|
|
@@ -1468,7 +1468,7 @@ function An(e, t) {
|
|
|
1468
1468
|
...x(t)
|
|
1469
1469
|
});
|
|
1470
1470
|
}
|
|
1471
|
-
function
|
|
1471
|
+
function Mn(e, t) {
|
|
1472
1472
|
return new e({
|
|
1473
1473
|
type: "string",
|
|
1474
1474
|
format: "base64",
|
|
@@ -1477,7 +1477,7 @@ function jn(e, t) {
|
|
|
1477
1477
|
...x(t)
|
|
1478
1478
|
});
|
|
1479
1479
|
}
|
|
1480
|
-
function
|
|
1480
|
+
function Nn(e, t) {
|
|
1481
1481
|
return new e({
|
|
1482
1482
|
type: "string",
|
|
1483
1483
|
format: "base64url",
|
|
@@ -1486,7 +1486,7 @@ function Mn(e, t) {
|
|
|
1486
1486
|
...x(t)
|
|
1487
1487
|
});
|
|
1488
1488
|
}
|
|
1489
|
-
function
|
|
1489
|
+
function Pn(e, t) {
|
|
1490
1490
|
return new e({
|
|
1491
1491
|
type: "string",
|
|
1492
1492
|
format: "e164",
|
|
@@ -1495,7 +1495,7 @@ function Nn(e, t) {
|
|
|
1495
1495
|
...x(t)
|
|
1496
1496
|
});
|
|
1497
1497
|
}
|
|
1498
|
-
function
|
|
1498
|
+
function Fn(e, t) {
|
|
1499
1499
|
return new e({
|
|
1500
1500
|
type: "string",
|
|
1501
1501
|
format: "jwt",
|
|
@@ -1504,7 +1504,7 @@ function Pn(e, t) {
|
|
|
1504
1504
|
...x(t)
|
|
1505
1505
|
});
|
|
1506
1506
|
}
|
|
1507
|
-
function
|
|
1507
|
+
function In(e, t) {
|
|
1508
1508
|
return new e({
|
|
1509
1509
|
type: "string",
|
|
1510
1510
|
format: "datetime",
|
|
@@ -1515,7 +1515,7 @@ function Fn(e, t) {
|
|
|
1515
1515
|
...x(t)
|
|
1516
1516
|
});
|
|
1517
1517
|
}
|
|
1518
|
-
function
|
|
1518
|
+
function Ln(e, t) {
|
|
1519
1519
|
return new e({
|
|
1520
1520
|
type: "string",
|
|
1521
1521
|
format: "date",
|
|
@@ -1523,7 +1523,7 @@ function In(e, t) {
|
|
|
1523
1523
|
...x(t)
|
|
1524
1524
|
});
|
|
1525
1525
|
}
|
|
1526
|
-
function
|
|
1526
|
+
function Rn(e, t) {
|
|
1527
1527
|
return new e({
|
|
1528
1528
|
type: "string",
|
|
1529
1529
|
format: "time",
|
|
@@ -1532,7 +1532,7 @@ function Ln(e, t) {
|
|
|
1532
1532
|
...x(t)
|
|
1533
1533
|
});
|
|
1534
1534
|
}
|
|
1535
|
-
function
|
|
1535
|
+
function zn(e, t) {
|
|
1536
1536
|
return new e({
|
|
1537
1537
|
type: "string",
|
|
1538
1538
|
format: "duration",
|
|
@@ -1540,108 +1540,108 @@ function Rn(e, t) {
|
|
|
1540
1540
|
...x(t)
|
|
1541
1541
|
});
|
|
1542
1542
|
}
|
|
1543
|
-
function
|
|
1543
|
+
function Bn(e) {
|
|
1544
1544
|
return new e({ type: "unknown" });
|
|
1545
1545
|
}
|
|
1546
|
-
function
|
|
1546
|
+
function Vn(e, t) {
|
|
1547
1547
|
return new e({
|
|
1548
1548
|
type: "never",
|
|
1549
1549
|
...x(t)
|
|
1550
1550
|
});
|
|
1551
1551
|
}
|
|
1552
|
-
function
|
|
1553
|
-
return new
|
|
1552
|
+
function Hn(e, t) {
|
|
1553
|
+
return new Qe({
|
|
1554
1554
|
check: "max_length",
|
|
1555
1555
|
...x(t),
|
|
1556
1556
|
maximum: e
|
|
1557
1557
|
});
|
|
1558
1558
|
}
|
|
1559
|
-
function
|
|
1560
|
-
return new
|
|
1559
|
+
function U(e, t) {
|
|
1560
|
+
return new $e({
|
|
1561
1561
|
check: "min_length",
|
|
1562
1562
|
...x(t),
|
|
1563
1563
|
minimum: e
|
|
1564
1564
|
});
|
|
1565
1565
|
}
|
|
1566
|
-
function
|
|
1567
|
-
return new
|
|
1566
|
+
function Un(e, t) {
|
|
1567
|
+
return new et({
|
|
1568
1568
|
check: "length_equals",
|
|
1569
1569
|
...x(t),
|
|
1570
1570
|
length: e
|
|
1571
1571
|
});
|
|
1572
1572
|
}
|
|
1573
|
-
function
|
|
1574
|
-
return new
|
|
1573
|
+
function Wn(e, t) {
|
|
1574
|
+
return new tt({
|
|
1575
1575
|
check: "string_format",
|
|
1576
1576
|
format: "regex",
|
|
1577
1577
|
...x(t),
|
|
1578
1578
|
pattern: e
|
|
1579
1579
|
});
|
|
1580
1580
|
}
|
|
1581
|
-
function
|
|
1582
|
-
return new
|
|
1581
|
+
function Gn(e) {
|
|
1582
|
+
return new nt({
|
|
1583
1583
|
check: "string_format",
|
|
1584
1584
|
format: "lowercase",
|
|
1585
1585
|
...x(e)
|
|
1586
1586
|
});
|
|
1587
1587
|
}
|
|
1588
|
-
function
|
|
1589
|
-
return new
|
|
1588
|
+
function Kn(e) {
|
|
1589
|
+
return new rt({
|
|
1590
1590
|
check: "string_format",
|
|
1591
1591
|
format: "uppercase",
|
|
1592
1592
|
...x(e)
|
|
1593
1593
|
});
|
|
1594
1594
|
}
|
|
1595
|
-
function
|
|
1596
|
-
return new
|
|
1595
|
+
function qn(e, t) {
|
|
1596
|
+
return new it({
|
|
1597
1597
|
check: "string_format",
|
|
1598
1598
|
format: "includes",
|
|
1599
1599
|
...x(t),
|
|
1600
1600
|
includes: e
|
|
1601
1601
|
});
|
|
1602
1602
|
}
|
|
1603
|
-
function
|
|
1604
|
-
return new
|
|
1603
|
+
function Jn(e, t) {
|
|
1604
|
+
return new at({
|
|
1605
1605
|
check: "string_format",
|
|
1606
1606
|
format: "starts_with",
|
|
1607
1607
|
...x(t),
|
|
1608
1608
|
prefix: e
|
|
1609
1609
|
});
|
|
1610
1610
|
}
|
|
1611
|
-
function
|
|
1612
|
-
return new
|
|
1611
|
+
function Yn(e, t) {
|
|
1612
|
+
return new ot({
|
|
1613
1613
|
check: "string_format",
|
|
1614
1614
|
format: "ends_with",
|
|
1615
1615
|
...x(t),
|
|
1616
1616
|
suffix: e
|
|
1617
1617
|
});
|
|
1618
1618
|
}
|
|
1619
|
-
function
|
|
1620
|
-
return new
|
|
1619
|
+
function W(e) {
|
|
1620
|
+
return new st({
|
|
1621
1621
|
check: "overwrite",
|
|
1622
1622
|
tx: e
|
|
1623
1623
|
});
|
|
1624
1624
|
}
|
|
1625
|
-
function
|
|
1626
|
-
return
|
|
1627
|
-
}
|
|
1628
|
-
function Xn() {
|
|
1629
|
-
return G((e) => e.trim());
|
|
1625
|
+
function Xn(e) {
|
|
1626
|
+
return W((t) => t.normalize(e));
|
|
1630
1627
|
}
|
|
1631
1628
|
function Zn() {
|
|
1632
|
-
return
|
|
1629
|
+
return W((e) => e.trim());
|
|
1633
1630
|
}
|
|
1634
1631
|
function Qn() {
|
|
1635
|
-
return
|
|
1632
|
+
return W((e) => e.toLowerCase());
|
|
1633
|
+
}
|
|
1634
|
+
function $n() {
|
|
1635
|
+
return W((e) => e.toUpperCase());
|
|
1636
1636
|
}
|
|
1637
|
-
function
|
|
1637
|
+
function er(e, t, n) {
|
|
1638
1638
|
return new e({
|
|
1639
1639
|
type: "array",
|
|
1640
1640
|
element: t,
|
|
1641
1641
|
...x(n)
|
|
1642
1642
|
});
|
|
1643
1643
|
}
|
|
1644
|
-
function
|
|
1644
|
+
function tr(e, t, n) {
|
|
1645
1645
|
return new e({
|
|
1646
1646
|
type: "custom",
|
|
1647
1647
|
check: "custom",
|
|
@@ -1649,8 +1649,8 @@ function er(e, t, n) {
|
|
|
1649
1649
|
...x(n)
|
|
1650
1650
|
});
|
|
1651
1651
|
}
|
|
1652
|
-
function
|
|
1653
|
-
let t =
|
|
1652
|
+
function nr(e) {
|
|
1653
|
+
let t = rr((n) => (n.addIssue = (e) => {
|
|
1654
1654
|
if (typeof e == "string") n.issues.push(E(e, n.value, t._zod.def));
|
|
1655
1655
|
else {
|
|
1656
1656
|
let r = e;
|
|
@@ -1659,8 +1659,8 @@ function tr(e) {
|
|
|
1659
1659
|
}, e(n.value, n)));
|
|
1660
1660
|
return t;
|
|
1661
1661
|
}
|
|
1662
|
-
function
|
|
1663
|
-
let n = new
|
|
1662
|
+
function rr(e, t) {
|
|
1663
|
+
let n = new P({
|
|
1664
1664
|
check: "custom",
|
|
1665
1665
|
...x(t)
|
|
1666
1666
|
});
|
|
@@ -1668,33 +1668,33 @@ function nr(e, t) {
|
|
|
1668
1668
|
}
|
|
1669
1669
|
//#endregion
|
|
1670
1670
|
//#region ../../node_modules/zod/v4/classic/iso.js
|
|
1671
|
-
var
|
|
1672
|
-
|
|
1671
|
+
var ir = /*@__PURE__*/ t("ZodISODateTime", (e, t) => {
|
|
1672
|
+
xt.init(e, t), q.init(e, t);
|
|
1673
1673
|
});
|
|
1674
|
-
function
|
|
1675
|
-
return
|
|
1674
|
+
function ar(e) {
|
|
1675
|
+
return In(ir, e);
|
|
1676
1676
|
}
|
|
1677
|
-
var
|
|
1678
|
-
|
|
1677
|
+
var or = /*@__PURE__*/ t("ZodISODate", (e, t) => {
|
|
1678
|
+
St.init(e, t), q.init(e, t);
|
|
1679
1679
|
});
|
|
1680
|
-
function
|
|
1681
|
-
return
|
|
1680
|
+
function sr(e) {
|
|
1681
|
+
return Ln(or, e);
|
|
1682
1682
|
}
|
|
1683
|
-
var
|
|
1684
|
-
|
|
1683
|
+
var cr = /*@__PURE__*/ t("ZodISOTime", (e, t) => {
|
|
1684
|
+
Ct.init(e, t), q.init(e, t);
|
|
1685
1685
|
});
|
|
1686
|
-
function
|
|
1687
|
-
return
|
|
1686
|
+
function lr(e) {
|
|
1687
|
+
return Rn(cr, e);
|
|
1688
1688
|
}
|
|
1689
|
-
var
|
|
1690
|
-
|
|
1689
|
+
var ur = /*@__PURE__*/ t("ZodISODuration", (e, t) => {
|
|
1690
|
+
wt.init(e, t), q.init(e, t);
|
|
1691
1691
|
});
|
|
1692
|
-
function
|
|
1693
|
-
return
|
|
1692
|
+
function dr(e) {
|
|
1693
|
+
return zn(ur, e);
|
|
1694
1694
|
}
|
|
1695
1695
|
//#endregion
|
|
1696
1696
|
//#region ../../node_modules/zod/v4/classic/errors.js
|
|
1697
|
-
var
|
|
1697
|
+
var fr = (e, t) => {
|
|
1698
1698
|
pe.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
1699
1699
|
format: { value: (t) => ge(e, t) },
|
|
1700
1700
|
flatten: { value: (t) => he(e, t) },
|
|
@@ -1709,144 +1709,144 @@ var dr = (e, t) => {
|
|
|
1709
1709
|
} }
|
|
1710
1710
|
});
|
|
1711
1711
|
};
|
|
1712
|
-
t("ZodError",
|
|
1713
|
-
var
|
|
1712
|
+
t("ZodError", fr);
|
|
1713
|
+
var G = t("ZodError", fr, { Parent: Error }), pr = /* @__PURE__ */ D(G), mr = /* @__PURE__ */ O(G), hr = /* @__PURE__ */ k(G), gr = /* @__PURE__ */ A(G), _r = /* @__PURE__ */ ye(G), vr = /* @__PURE__ */ be(G), yr = /* @__PURE__ */ xe(G), br = /* @__PURE__ */ Se(G), xr = /* @__PURE__ */ Ce(G), Sr = /* @__PURE__ */ we(G), Cr = /* @__PURE__ */ Te(G), wr = /* @__PURE__ */ Ee(G), K = /*@__PURE__*/ t("ZodType", (e, t) => (I.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(m(t, { checks: [...t.checks ?? [], ...n.map((e) => typeof e == "function" ? { _zod: {
|
|
1714
1714
|
check: e,
|
|
1715
1715
|
def: { check: "custom" },
|
|
1716
1716
|
onattach: []
|
|
1717
|
-
} } : e)] })), e.clone = (t, n) => b(e, t, n), e.brand = () => e, e.register = ((t, n) => (t.add(e, n), e)), e.parse = (t, n) =>
|
|
1717
|
+
} } : e)] })), e.clone = (t, n) => b(e, t, n), e.brand = () => e, e.register = ((t, n) => (t.add(e, n), e)), e.parse = (t, n) => pr(e, t, n, { callee: e.parse }), e.safeParse = (t, n) => hr(e, t, n), e.parseAsync = async (t, n) => mr(e, t, n, { callee: e.parseAsync }), e.safeParseAsync = async (t, n) => gr(e, t, n), e.spa = e.safeParseAsync, e.encode = (t, n) => _r(e, t, n), e.decode = (t, n) => vr(e, t, n), e.encodeAsync = async (t, n) => yr(e, t, n), e.decodeAsync = async (t, n) => br(e, t, n), e.safeEncode = (t, n) => xr(e, t, n), e.safeDecode = (t, n) => Sr(e, t, n), e.safeEncodeAsync = async (t, n) => Cr(e, t, n), e.safeDecodeAsync = async (t, n) => wr(e, t, n), e.refine = (t, n) => e.check(Ci(t, n)), e.superRefine = (t) => e.check(wi(t)), e.overwrite = (t) => e.check(W(t)), e.optional = () => X(e), e.nullable = () => li(e), e.nullish = () => X(li(e)), e.nonoptional = (t) => hi(e, t), e.array = () => Zr(e), e.or = (t) => ti([e, t]), e.and = (t) => ri(e, t), e.transform = (t) => yi(e, oi(t)), e.default = (t) => di(e, t), e.prefault = (t) => pi(e, t), e.catch = (t) => _i(e, t), e.pipe = (t) => yi(e, t), e.readonly = () => xi(e), e.describe = (t) => {
|
|
1718
1718
|
let n = e.clone();
|
|
1719
|
-
return
|
|
1719
|
+
return H.add(n, { description: t }), n;
|
|
1720
1720
|
}, Object.defineProperty(e, "description", {
|
|
1721
1721
|
get() {
|
|
1722
|
-
return
|
|
1722
|
+
return H.get(e)?.description;
|
|
1723
1723
|
},
|
|
1724
1724
|
configurable: !0
|
|
1725
1725
|
}), e.meta = (...t) => {
|
|
1726
|
-
if (t.length === 0) return
|
|
1726
|
+
if (t.length === 0) return H.get(e);
|
|
1727
1727
|
let n = e.clone();
|
|
1728
|
-
return
|
|
1729
|
-
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)),
|
|
1730
|
-
|
|
1728
|
+
return H.add(n, t[0]), n;
|
|
1729
|
+
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Tr = /*@__PURE__*/ t("_ZodString", (e, t) => {
|
|
1730
|
+
L.init(e, t), K.init(e, t);
|
|
1731
1731
|
let n = e._zod.bag;
|
|
1732
|
-
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...t) => e.check(
|
|
1733
|
-
}),
|
|
1734
|
-
|
|
1732
|
+
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...t) => e.check(Wn(...t)), e.includes = (...t) => e.check(qn(...t)), e.startsWith = (...t) => e.check(Jn(...t)), e.endsWith = (...t) => e.check(Yn(...t)), e.min = (...t) => e.check(U(...t)), e.max = (...t) => e.check(Hn(...t)), e.length = (...t) => e.check(Un(...t)), e.nonempty = (...t) => e.check(U(1, ...t)), e.lowercase = (t) => e.check(Gn(t)), e.uppercase = (t) => e.check(Kn(t)), e.trim = () => e.check(Zn()), e.normalize = (...t) => e.check(Xn(...t)), e.toLowerCase = () => e.check(Qn()), e.toUpperCase = () => e.check($n());
|
|
1733
|
+
}), Er = /*@__PURE__*/ t("ZodString", (e, t) => {
|
|
1734
|
+
L.init(e, t), Tr.init(e, t), e.email = (t) => e.check(mn(Or, t)), e.url = (t) => e.check(bn(Ar, t)), e.jwt = (t) => e.check(Fn(Gr, t)), e.emoji = (t) => e.check(xn(jr, t)), e.guid = (t) => e.check(hn(kr, t)), e.uuid = (t) => e.check(gn(J, t)), e.uuidv4 = (t) => e.check(_n(J, t)), e.uuidv6 = (t) => e.check(vn(J, t)), e.uuidv7 = (t) => e.check(yn(J, t)), e.nanoid = (t) => e.check(Sn(Mr, t)), e.guid = (t) => e.check(hn(kr, t)), e.cuid = (t) => e.check(Cn(Nr, t)), e.cuid2 = (t) => e.check(wn(Pr, t)), e.ulid = (t) => e.check(Tn(Fr, t)), e.base64 = (t) => e.check(Mn(Hr, t)), e.base64url = (t) => e.check(Nn(Ur, t)), e.xid = (t) => e.check(En(Ir, t)), e.ksuid = (t) => e.check(Dn(Lr, t)), e.ipv4 = (t) => e.check(On(Rr, t)), e.ipv6 = (t) => e.check(kn(zr, t)), e.cidrv4 = (t) => e.check(An(Br, t)), e.cidrv6 = (t) => e.check(jn(Vr, t)), e.e164 = (t) => e.check(Pn(Wr, t)), e.datetime = (t) => e.check(ar(t)), e.date = (t) => e.check(sr(t)), e.time = (t) => e.check(lr(t)), e.duration = (t) => e.check(dr(t));
|
|
1735
1735
|
});
|
|
1736
|
-
function
|
|
1737
|
-
return
|
|
1738
|
-
}
|
|
1739
|
-
var
|
|
1740
|
-
|
|
1741
|
-
}),
|
|
1742
|
-
|
|
1743
|
-
}),
|
|
1744
|
-
|
|
1745
|
-
}),
|
|
1746
|
-
|
|
1747
|
-
}),
|
|
1748
|
-
|
|
1749
|
-
}),
|
|
1750
|
-
|
|
1751
|
-
}),
|
|
1752
|
-
|
|
1753
|
-
}),
|
|
1754
|
-
|
|
1755
|
-
}),
|
|
1756
|
-
|
|
1757
|
-
}),
|
|
1758
|
-
|
|
1759
|
-
}),
|
|
1760
|
-
|
|
1761
|
-
}),
|
|
1762
|
-
|
|
1763
|
-
}),
|
|
1764
|
-
|
|
1765
|
-
}),
|
|
1766
|
-
|
|
1767
|
-
}),
|
|
1768
|
-
|
|
1769
|
-
}),
|
|
1770
|
-
|
|
1771
|
-
}),
|
|
1772
|
-
|
|
1773
|
-
}),
|
|
1774
|
-
|
|
1775
|
-
}),
|
|
1776
|
-
|
|
1777
|
-
}),
|
|
1778
|
-
Pt.init(e, t), J.init(e, t);
|
|
1779
|
-
}), Gr = /*@__PURE__*/ t("ZodUnknown", (e, t) => {
|
|
1736
|
+
function Dr(e) {
|
|
1737
|
+
return pn(Er, e);
|
|
1738
|
+
}
|
|
1739
|
+
var q = /*@__PURE__*/ t("ZodStringFormat", (e, t) => {
|
|
1740
|
+
R.init(e, t), Tr.init(e, t);
|
|
1741
|
+
}), Or = /*@__PURE__*/ t("ZodEmail", (e, t) => {
|
|
1742
|
+
ft.init(e, t), q.init(e, t);
|
|
1743
|
+
}), kr = /*@__PURE__*/ t("ZodGUID", (e, t) => {
|
|
1744
|
+
ut.init(e, t), q.init(e, t);
|
|
1745
|
+
}), J = /*@__PURE__*/ t("ZodUUID", (e, t) => {
|
|
1746
|
+
dt.init(e, t), q.init(e, t);
|
|
1747
|
+
}), Ar = /*@__PURE__*/ t("ZodURL", (e, t) => {
|
|
1748
|
+
pt.init(e, t), q.init(e, t);
|
|
1749
|
+
}), jr = /*@__PURE__*/ t("ZodEmoji", (e, t) => {
|
|
1750
|
+
mt.init(e, t), q.init(e, t);
|
|
1751
|
+
}), Mr = /*@__PURE__*/ t("ZodNanoID", (e, t) => {
|
|
1752
|
+
ht.init(e, t), q.init(e, t);
|
|
1753
|
+
}), Nr = /*@__PURE__*/ t("ZodCUID", (e, t) => {
|
|
1754
|
+
gt.init(e, t), q.init(e, t);
|
|
1755
|
+
}), Pr = /*@__PURE__*/ t("ZodCUID2", (e, t) => {
|
|
1756
|
+
_t.init(e, t), q.init(e, t);
|
|
1757
|
+
}), Fr = /*@__PURE__*/ t("ZodULID", (e, t) => {
|
|
1758
|
+
vt.init(e, t), q.init(e, t);
|
|
1759
|
+
}), Ir = /*@__PURE__*/ t("ZodXID", (e, t) => {
|
|
1760
|
+
yt.init(e, t), q.init(e, t);
|
|
1761
|
+
}), Lr = /*@__PURE__*/ t("ZodKSUID", (e, t) => {
|
|
1762
|
+
bt.init(e, t), q.init(e, t);
|
|
1763
|
+
}), Rr = /*@__PURE__*/ t("ZodIPv4", (e, t) => {
|
|
1764
|
+
Tt.init(e, t), q.init(e, t);
|
|
1765
|
+
}), zr = /*@__PURE__*/ t("ZodIPv6", (e, t) => {
|
|
1766
|
+
Et.init(e, t), q.init(e, t);
|
|
1767
|
+
}), Br = /*@__PURE__*/ t("ZodCIDRv4", (e, t) => {
|
|
1768
|
+
Dt.init(e, t), q.init(e, t);
|
|
1769
|
+
}), Vr = /*@__PURE__*/ t("ZodCIDRv6", (e, t) => {
|
|
1770
|
+
Ot.init(e, t), q.init(e, t);
|
|
1771
|
+
}), Hr = /*@__PURE__*/ t("ZodBase64", (e, t) => {
|
|
1772
|
+
At.init(e, t), q.init(e, t);
|
|
1773
|
+
}), Ur = /*@__PURE__*/ t("ZodBase64URL", (e, t) => {
|
|
1774
|
+
Mt.init(e, t), q.init(e, t);
|
|
1775
|
+
}), Wr = /*@__PURE__*/ t("ZodE164", (e, t) => {
|
|
1776
|
+
Nt.init(e, t), q.init(e, t);
|
|
1777
|
+
}), Gr = /*@__PURE__*/ t("ZodJWT", (e, t) => {
|
|
1780
1778
|
Ft.init(e, t), q.init(e, t);
|
|
1779
|
+
}), Kr = /*@__PURE__*/ t("ZodUnknown", (e, t) => {
|
|
1780
|
+
It.init(e, t), K.init(e, t);
|
|
1781
1781
|
});
|
|
1782
|
-
function
|
|
1783
|
-
return
|
|
1782
|
+
function qr() {
|
|
1783
|
+
return Bn(Kr);
|
|
1784
1784
|
}
|
|
1785
|
-
var
|
|
1786
|
-
|
|
1785
|
+
var Jr = /*@__PURE__*/ t("ZodNever", (e, t) => {
|
|
1786
|
+
Lt.init(e, t), K.init(e, t);
|
|
1787
1787
|
});
|
|
1788
|
-
function
|
|
1789
|
-
return
|
|
1788
|
+
function Yr(e) {
|
|
1789
|
+
return Vn(Jr, e);
|
|
1790
1790
|
}
|
|
1791
|
-
var
|
|
1792
|
-
|
|
1791
|
+
var Xr = /*@__PURE__*/ t("ZodArray", (e, t) => {
|
|
1792
|
+
zt.init(e, t), K.init(e, t), e.element = t.element, e.min = (t, n) => e.check(U(t, n)), e.nonempty = (t) => e.check(U(1, t)), e.max = (t, n) => e.check(Hn(t, n)), e.length = (t, n) => e.check(Un(t, n)), e.unwrap = () => e.element;
|
|
1793
1793
|
});
|
|
1794
|
-
function
|
|
1795
|
-
return
|
|
1794
|
+
function Zr(e, t) {
|
|
1795
|
+
return er(Xr, e, t);
|
|
1796
1796
|
}
|
|
1797
|
-
var
|
|
1798
|
-
|
|
1797
|
+
var Qr = /*@__PURE__*/ t("ZodObject", (e, t) => {
|
|
1798
|
+
Ut.init(e, t), K.init(e, t), f(e, "shape", () => t.shape), e.keyof = () => ii(Object.keys(e._zod.def.shape)), e.catchall = (t) => e.clone({
|
|
1799
1799
|
...e._zod.def,
|
|
1800
1800
|
catchall: t
|
|
1801
1801
|
}), e.passthrough = () => e.clone({
|
|
1802
1802
|
...e._zod.def,
|
|
1803
|
-
catchall:
|
|
1803
|
+
catchall: qr()
|
|
1804
1804
|
}), e.loose = () => e.clone({
|
|
1805
1805
|
...e._zod.def,
|
|
1806
|
-
catchall:
|
|
1806
|
+
catchall: qr()
|
|
1807
1807
|
}), e.strict = () => e.clone({
|
|
1808
1808
|
...e._zod.def,
|
|
1809
|
-
catchall:
|
|
1809
|
+
catchall: Yr()
|
|
1810
1810
|
}), e.strip = () => e.clone({
|
|
1811
1811
|
...e._zod.def,
|
|
1812
1812
|
catchall: void 0
|
|
1813
|
-
}), e.extend = (t) => oe(e, t), e.safeExtend = (t) => se(e, t), e.merge = (t) => ce(e, t), e.pick = (t) => ie(e, t), e.omit = (t) => ae(e, t), e.partial = (...t) => le(
|
|
1813
|
+
}), e.extend = (t) => oe(e, t), e.safeExtend = (t) => se(e, t), e.merge = (t) => ce(e, t), e.pick = (t) => ie(e, t), e.omit = (t) => ae(e, t), e.partial = (...t) => le(si, e, t[0]), e.required = (...t) => ue(mi, e, t[0]);
|
|
1814
1814
|
});
|
|
1815
|
-
function
|
|
1816
|
-
return new
|
|
1815
|
+
function $r(e, t) {
|
|
1816
|
+
return new Qr({
|
|
1817
1817
|
type: "object",
|
|
1818
1818
|
shape: e ?? {},
|
|
1819
1819
|
...x(t)
|
|
1820
1820
|
});
|
|
1821
1821
|
}
|
|
1822
|
-
var
|
|
1823
|
-
|
|
1822
|
+
var ei = /*@__PURE__*/ t("ZodUnion", (e, t) => {
|
|
1823
|
+
Gt.init(e, t), K.init(e, t), e.options = t.options;
|
|
1824
1824
|
});
|
|
1825
|
-
function
|
|
1826
|
-
return new
|
|
1825
|
+
function ti(e, t) {
|
|
1826
|
+
return new ei({
|
|
1827
1827
|
type: "union",
|
|
1828
1828
|
options: e,
|
|
1829
1829
|
...x(t)
|
|
1830
1830
|
});
|
|
1831
1831
|
}
|
|
1832
|
-
var
|
|
1833
|
-
|
|
1832
|
+
var ni = /*@__PURE__*/ t("ZodIntersection", (e, t) => {
|
|
1833
|
+
Kt.init(e, t), K.init(e, t);
|
|
1834
1834
|
});
|
|
1835
|
-
function
|
|
1836
|
-
return new
|
|
1835
|
+
function ri(e, t) {
|
|
1836
|
+
return new ni({
|
|
1837
1837
|
type: "intersection",
|
|
1838
1838
|
left: e,
|
|
1839
1839
|
right: t
|
|
1840
1840
|
});
|
|
1841
1841
|
}
|
|
1842
|
-
var
|
|
1843
|
-
|
|
1842
|
+
var Y = /*@__PURE__*/ t("ZodEnum", (e, t) => {
|
|
1843
|
+
Jt.init(e, t), K.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
1844
1844
|
let n = new Set(Object.keys(t.entries));
|
|
1845
1845
|
e.extract = (e, r) => {
|
|
1846
1846
|
let i = {};
|
|
1847
1847
|
for (let r of e) if (n.has(r)) i[r] = t.entries[r];
|
|
1848
1848
|
else throw Error(`Key ${r} not found in enum`);
|
|
1849
|
-
return new
|
|
1849
|
+
return new Y({
|
|
1850
1850
|
...t,
|
|
1851
1851
|
checks: [],
|
|
1852
1852
|
...x(r),
|
|
@@ -1856,7 +1856,7 @@ var X = /*@__PURE__*/ t("ZodEnum", (e, t) => {
|
|
|
1856
1856
|
let i = { ...t.entries };
|
|
1857
1857
|
for (let t of e) if (n.has(t)) delete i[t];
|
|
1858
1858
|
else throw Error(`Key ${t} not found in enum`);
|
|
1859
|
-
return new
|
|
1859
|
+
return new Y({
|
|
1860
1860
|
...t,
|
|
1861
1861
|
checks: [],
|
|
1862
1862
|
...x(r),
|
|
@@ -1864,15 +1864,15 @@ var X = /*@__PURE__*/ t("ZodEnum", (e, t) => {
|
|
|
1864
1864
|
});
|
|
1865
1865
|
};
|
|
1866
1866
|
});
|
|
1867
|
-
function
|
|
1868
|
-
return new
|
|
1867
|
+
function ii(e, t) {
|
|
1868
|
+
return new Y({
|
|
1869
1869
|
type: "enum",
|
|
1870
1870
|
entries: Array.isArray(e) ? Object.fromEntries(e.map((e) => [e, e])) : e,
|
|
1871
1871
|
...x(t)
|
|
1872
1872
|
});
|
|
1873
1873
|
}
|
|
1874
|
-
var
|
|
1875
|
-
|
|
1874
|
+
var ai = /*@__PURE__*/ t("ZodTransform", (e, t) => {
|
|
1875
|
+
Yt.init(e, t), K.init(e, t), e._zod.parse = (n, i) => {
|
|
1876
1876
|
if (i.direction === "backward") throw new r(e.constructor.name);
|
|
1877
1877
|
n.addIssue = (r) => {
|
|
1878
1878
|
if (typeof r == "string") n.issues.push(E(r, n.value, t));
|
|
@@ -1885,35 +1885,35 @@ var ii = /*@__PURE__*/ t("ZodTransform", (e, t) => {
|
|
|
1885
1885
|
return a instanceof Promise ? a.then((e) => (n.value = e, n)) : (n.value = a, n);
|
|
1886
1886
|
};
|
|
1887
1887
|
});
|
|
1888
|
-
function
|
|
1889
|
-
return new
|
|
1888
|
+
function oi(e) {
|
|
1889
|
+
return new ai({
|
|
1890
1890
|
type: "transform",
|
|
1891
1891
|
transform: e
|
|
1892
1892
|
});
|
|
1893
1893
|
}
|
|
1894
|
-
var
|
|
1895
|
-
|
|
1894
|
+
var si = /*@__PURE__*/ t("ZodOptional", (e, t) => {
|
|
1895
|
+
Zt.init(e, t), K.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
1896
1896
|
});
|
|
1897
|
-
function
|
|
1898
|
-
return new
|
|
1897
|
+
function X(e) {
|
|
1898
|
+
return new si({
|
|
1899
1899
|
type: "optional",
|
|
1900
1900
|
innerType: e
|
|
1901
1901
|
});
|
|
1902
1902
|
}
|
|
1903
|
-
var
|
|
1904
|
-
|
|
1903
|
+
var ci = /*@__PURE__*/ t("ZodNullable", (e, t) => {
|
|
1904
|
+
Qt.init(e, t), K.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
1905
1905
|
});
|
|
1906
|
-
function
|
|
1907
|
-
return new
|
|
1906
|
+
function li(e) {
|
|
1907
|
+
return new ci({
|
|
1908
1908
|
type: "nullable",
|
|
1909
1909
|
innerType: e
|
|
1910
1910
|
});
|
|
1911
1911
|
}
|
|
1912
|
-
var
|
|
1913
|
-
|
|
1912
|
+
var ui = /*@__PURE__*/ t("ZodDefault", (e, t) => {
|
|
1913
|
+
$t.init(e, t), K.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
1914
1914
|
});
|
|
1915
|
-
function
|
|
1916
|
-
return new
|
|
1915
|
+
function di(e, t) {
|
|
1916
|
+
return new ui({
|
|
1917
1917
|
type: "default",
|
|
1918
1918
|
innerType: e,
|
|
1919
1919
|
get defaultValue() {
|
|
@@ -1921,11 +1921,11 @@ function ui(e, t) {
|
|
|
1921
1921
|
}
|
|
1922
1922
|
});
|
|
1923
1923
|
}
|
|
1924
|
-
var
|
|
1925
|
-
|
|
1924
|
+
var fi = /*@__PURE__*/ t("ZodPrefault", (e, t) => {
|
|
1925
|
+
tn.init(e, t), K.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
1926
1926
|
});
|
|
1927
|
-
function
|
|
1928
|
-
return new
|
|
1927
|
+
function pi(e, t) {
|
|
1928
|
+
return new fi({
|
|
1929
1929
|
type: "prefault",
|
|
1930
1930
|
innerType: e,
|
|
1931
1931
|
get defaultValue() {
|
|
@@ -1933,62 +1933,62 @@ function fi(e, t) {
|
|
|
1933
1933
|
}
|
|
1934
1934
|
});
|
|
1935
1935
|
}
|
|
1936
|
-
var
|
|
1937
|
-
|
|
1936
|
+
var mi = /*@__PURE__*/ t("ZodNonOptional", (e, t) => {
|
|
1937
|
+
nn.init(e, t), K.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
1938
1938
|
});
|
|
1939
|
-
function
|
|
1940
|
-
return new
|
|
1939
|
+
function hi(e, t) {
|
|
1940
|
+
return new mi({
|
|
1941
1941
|
type: "nonoptional",
|
|
1942
1942
|
innerType: e,
|
|
1943
1943
|
...x(t)
|
|
1944
1944
|
});
|
|
1945
1945
|
}
|
|
1946
|
-
var
|
|
1947
|
-
|
|
1946
|
+
var gi = /*@__PURE__*/ t("ZodCatch", (e, t) => {
|
|
1947
|
+
an.init(e, t), K.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
1948
1948
|
});
|
|
1949
|
-
function
|
|
1950
|
-
return new
|
|
1949
|
+
function _i(e, t) {
|
|
1950
|
+
return new gi({
|
|
1951
1951
|
type: "catch",
|
|
1952
1952
|
innerType: e,
|
|
1953
1953
|
catchValue: typeof t == "function" ? t : () => t
|
|
1954
1954
|
});
|
|
1955
1955
|
}
|
|
1956
|
-
var
|
|
1957
|
-
|
|
1956
|
+
var vi = /*@__PURE__*/ t("ZodPipe", (e, t) => {
|
|
1957
|
+
on.init(e, t), K.init(e, t), e.in = t.in, e.out = t.out;
|
|
1958
1958
|
});
|
|
1959
|
-
function
|
|
1960
|
-
return new
|
|
1959
|
+
function yi(e, t) {
|
|
1960
|
+
return new vi({
|
|
1961
1961
|
type: "pipe",
|
|
1962
1962
|
in: e,
|
|
1963
1963
|
out: t
|
|
1964
1964
|
});
|
|
1965
1965
|
}
|
|
1966
|
-
var
|
|
1967
|
-
|
|
1966
|
+
var bi = /*@__PURE__*/ t("ZodReadonly", (e, t) => {
|
|
1967
|
+
sn.init(e, t), K.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
1968
1968
|
});
|
|
1969
|
-
function
|
|
1970
|
-
return new
|
|
1969
|
+
function xi(e) {
|
|
1970
|
+
return new bi({
|
|
1971
1971
|
type: "readonly",
|
|
1972
1972
|
innerType: e
|
|
1973
1973
|
});
|
|
1974
1974
|
}
|
|
1975
|
-
var
|
|
1976
|
-
|
|
1975
|
+
var Si = /*@__PURE__*/ t("ZodCustom", (e, t) => {
|
|
1976
|
+
ln.init(e, t), K.init(e, t);
|
|
1977
1977
|
});
|
|
1978
|
-
function
|
|
1979
|
-
return
|
|
1978
|
+
function Ci(e, t = {}) {
|
|
1979
|
+
return tr(Si, e, t);
|
|
1980
1980
|
}
|
|
1981
|
-
function
|
|
1982
|
-
return
|
|
1981
|
+
function wi(e) {
|
|
1982
|
+
return nr(e);
|
|
1983
1983
|
}
|
|
1984
1984
|
//#endregion
|
|
1985
1985
|
//#region ../twenty-shared/node_modules/class-validator/esm5/metadata/ValidationMetadata.js
|
|
1986
|
-
var
|
|
1986
|
+
var Ti = function() {
|
|
1987
1987
|
function e(e) {
|
|
1988
1988
|
this.groups = [], this.each = !1, this.context = void 0, this.type = e.type, this.name = e.name, this.target = e.target, this.propertyName = e.propertyName, this.constraints = e?.constraints, this.constraintCls = e.constraintCls, this.validationTypeOptions = e.validationTypeOptions, e.validationOptions && (this.message = e.validationOptions.message, this.groups = e.validationOptions.groups, this.always = e.validationOptions.always, this.each = e.validationOptions.each, this.context = e.validationOptions.context);
|
|
1989
1989
|
}
|
|
1990
1990
|
return e;
|
|
1991
|
-
}(),
|
|
1991
|
+
}(), Ei = function() {
|
|
1992
1992
|
function e() {}
|
|
1993
1993
|
return e.prototype.transform = function(e) {
|
|
1994
1994
|
var t = [];
|
|
@@ -2008,11 +2008,11 @@ var wi = function() {
|
|
|
2008
2008
|
validationTypeOptions: r.options,
|
|
2009
2009
|
validationOptions: i
|
|
2010
2010
|
};
|
|
2011
|
-
t.push(new
|
|
2011
|
+
t.push(new Ti(a));
|
|
2012
2012
|
});
|
|
2013
2013
|
}), t;
|
|
2014
2014
|
}, e;
|
|
2015
|
-
}(),
|
|
2015
|
+
}(), Di = function(e) {
|
|
2016
2016
|
var t = typeof Symbol == "function" && Symbol.iterator, n = t && e[t], r = 0;
|
|
2017
2017
|
if (n) return n.call(e);
|
|
2018
2018
|
if (e && typeof e.length == "number") return { next: function() {
|
|
@@ -2022,7 +2022,7 @@ var wi = function() {
|
|
|
2022
2022
|
};
|
|
2023
2023
|
} };
|
|
2024
2024
|
throw TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
2025
|
-
},
|
|
2025
|
+
}, Oi = function(e, t) {
|
|
2026
2026
|
var n = typeof Symbol == "function" && e[Symbol.iterator];
|
|
2027
2027
|
if (!n) return e;
|
|
2028
2028
|
var r = n.call(e), i, a = [], o;
|
|
@@ -2038,7 +2038,7 @@ var wi = function() {
|
|
|
2038
2038
|
}
|
|
2039
2039
|
}
|
|
2040
2040
|
return a;
|
|
2041
|
-
},
|
|
2041
|
+
}, ki = function(e, t, n) {
|
|
2042
2042
|
if (n || arguments.length === 2) for (var r = 0, i = t.length, a; r < i; r++) (a || !(r in t)) && (a ||= Array.prototype.slice.call(t, 0, r), a[r] = t[r]);
|
|
2043
2043
|
return e.concat(a || Array.prototype.slice.call(t));
|
|
2044
2044
|
};
|
|
@@ -2054,7 +2054,7 @@ var wi = function() {
|
|
|
2054
2054
|
configurable: !0
|
|
2055
2055
|
}), e.prototype.addValidationSchema = function(e) {
|
|
2056
2056
|
var t = this;
|
|
2057
|
-
new
|
|
2057
|
+
new Ei().transform(e).forEach(function(e) {
|
|
2058
2058
|
return t.addValidationMetadata(e);
|
|
2059
2059
|
});
|
|
2060
2060
|
}, e.prototype.addValidationMetadata = function(e) {
|
|
@@ -2079,9 +2079,9 @@ var wi = function() {
|
|
|
2079
2079
|
}) : !0;
|
|
2080
2080
|
}), u = [];
|
|
2081
2081
|
try {
|
|
2082
|
-
for (var d =
|
|
2083
|
-
var p =
|
|
2084
|
-
e.prototype instanceof m && u.push.apply(u,
|
|
2082
|
+
for (var d = Di(this.validationMetadatas.entries()), f = d.next(); !f.done; f = d.next()) {
|
|
2083
|
+
var p = Oi(f.value, 2), m = p[0], h = p[1];
|
|
2084
|
+
e.prototype instanceof m && u.push.apply(u, ki([], Oi(h), !1));
|
|
2085
2085
|
}
|
|
2086
2086
|
} catch (e) {
|
|
2087
2087
|
a = { error: e };
|
|
@@ -2116,7 +2116,7 @@ var wi = function() {
|
|
|
2116
2116
|
}();
|
|
2117
2117
|
//#endregion
|
|
2118
2118
|
//#region ../twenty-shared/node_modules/class-validator/esm5/validation/ValidationTypes.js
|
|
2119
|
-
var
|
|
2119
|
+
var Ai = new (function() {
|
|
2120
2120
|
function e() {
|
|
2121
2121
|
this.instances = [];
|
|
2122
2122
|
}
|
|
@@ -2129,15 +2129,15 @@ var ki = new (function() {
|
|
|
2129
2129
|
object: new e()
|
|
2130
2130
|
}, this.instances.push(t)), t.object;
|
|
2131
2131
|
}, e;
|
|
2132
|
-
}())(),
|
|
2133
|
-
function
|
|
2134
|
-
if (
|
|
2135
|
-
var t =
|
|
2136
|
-
if (t || !
|
|
2132
|
+
}())(), ji, Z;
|
|
2133
|
+
function Mi(e) {
|
|
2134
|
+
if (ji) try {
|
|
2135
|
+
var t = ji.get(e);
|
|
2136
|
+
if (t || !Z || !Z.fallback) return t;
|
|
2137
2137
|
} catch (e) {
|
|
2138
|
-
if (!
|
|
2138
|
+
if (!Z || !Z.fallbackOnErrors) throw e;
|
|
2139
2139
|
}
|
|
2140
|
-
return
|
|
2140
|
+
return Ai.get(e);
|
|
2141
2141
|
}
|
|
2142
2142
|
(function() {
|
|
2143
2143
|
function e(e, t, n) {
|
|
@@ -2145,7 +2145,7 @@ function ji(e) {
|
|
|
2145
2145
|
}
|
|
2146
2146
|
return Object.defineProperty(e.prototype, "instance", {
|
|
2147
2147
|
get: function() {
|
|
2148
|
-
return
|
|
2148
|
+
return Mi(this.target);
|
|
2149
2149
|
},
|
|
2150
2150
|
enumerable: !1,
|
|
2151
2151
|
configurable: !0
|
|
@@ -2153,247 +2153,278 @@ function ji(e) {
|
|
|
2153
2153
|
})();
|
|
2154
2154
|
//#endregion
|
|
2155
2155
|
//#region ../twenty-shared/node_modules/class-validator/esm5/metadata/ConstraintMetadata.js
|
|
2156
|
-
var
|
|
2156
|
+
var Q = /* @__PURE__ */ function(e) {
|
|
2157
2157
|
return e.ACTOR = "ACTOR", e.ADDRESS = "ADDRESS", e.ARRAY = "ARRAY", e.BOOLEAN = "BOOLEAN", e.CURRENCY = "CURRENCY", e.DATE = "DATE", e.DATE_TIME = "DATE_TIME", e.EMAILS = "EMAILS", e.FILES = "FILES", e.FULL_NAME = "FULL_NAME", e.LINKS = "LINKS", e.MORPH_RELATION = "MORPH_RELATION", e.MULTI_SELECT = "MULTI_SELECT", e.NUMBER = "NUMBER", e.NUMERIC = "NUMERIC", e.PHONES = "PHONES", e.POSITION = "POSITION", e.RATING = "RATING", e.RAW_JSON = "RAW_JSON", e.RELATION = "RELATION", e.RICH_TEXT = "RICH_TEXT", e.SELECT = "SELECT", e.TEXT = "TEXT", e.TS_VECTOR = "TS_VECTOR", e.UUID = "UUID", e;
|
|
2158
|
-
}({}),
|
|
2158
|
+
}({}), Ni = /* @__PURE__ */ function(e) {
|
|
2159
2159
|
return e.EMAIL = "EMAIL", e.CALENDAR = "CALENDAR", e.WORKFLOW = "WORKFLOW", e.AGENT = "AGENT", e.API = "API", e.IMPORT = "IMPORT", e.MANUAL = "MANUAL", e.SYSTEM = "SYSTEM", e.WEBHOOK = "WEBHOOK", e.APPLICATION = "APPLICATION", e;
|
|
2160
|
-
}({}),
|
|
2161
|
-
type:
|
|
2160
|
+
}({}), Pi = {
|
|
2161
|
+
type: Q.ACTOR,
|
|
2162
2162
|
properties: [
|
|
2163
2163
|
{
|
|
2164
2164
|
name: "source",
|
|
2165
|
-
type:
|
|
2165
|
+
type: Q.SELECT,
|
|
2166
2166
|
hidden: !1,
|
|
2167
2167
|
isRequired: !0,
|
|
2168
|
-
options: Object.keys(
|
|
2168
|
+
options: Object.keys(Ni).map((t, n) => ({
|
|
2169
2169
|
id: e(),
|
|
2170
|
-
label: `${
|
|
2170
|
+
label: `${Ni[t].toLowerCase()}`,
|
|
2171
2171
|
value: t,
|
|
2172
2172
|
position: n
|
|
2173
2173
|
}))
|
|
2174
2174
|
},
|
|
2175
2175
|
{
|
|
2176
2176
|
name: "workspaceMemberId",
|
|
2177
|
-
type:
|
|
2177
|
+
type: Q.UUID,
|
|
2178
2178
|
hidden: "input",
|
|
2179
2179
|
isRequired: !1
|
|
2180
2180
|
},
|
|
2181
2181
|
{
|
|
2182
2182
|
name: "name",
|
|
2183
|
-
type:
|
|
2183
|
+
type: Q.TEXT,
|
|
2184
2184
|
hidden: "input",
|
|
2185
2185
|
isRequired: !0
|
|
2186
2186
|
},
|
|
2187
2187
|
{
|
|
2188
2188
|
name: "context",
|
|
2189
|
-
type:
|
|
2189
|
+
type: Q.RAW_JSON,
|
|
2190
2190
|
hidden: !1,
|
|
2191
2191
|
isRequired: !1
|
|
2192
2192
|
}
|
|
2193
2193
|
]
|
|
2194
|
-
},
|
|
2195
|
-
type:
|
|
2194
|
+
}, Fi = {
|
|
2195
|
+
type: Q.ADDRESS,
|
|
2196
2196
|
properties: [
|
|
2197
2197
|
{
|
|
2198
2198
|
name: "addressStreet1",
|
|
2199
|
-
type:
|
|
2199
|
+
type: Q.TEXT,
|
|
2200
2200
|
hidden: !1,
|
|
2201
2201
|
isRequired: !1
|
|
2202
2202
|
},
|
|
2203
2203
|
{
|
|
2204
2204
|
name: "addressStreet2",
|
|
2205
|
-
type:
|
|
2205
|
+
type: Q.TEXT,
|
|
2206
2206
|
hidden: !1,
|
|
2207
2207
|
isRequired: !1
|
|
2208
2208
|
},
|
|
2209
2209
|
{
|
|
2210
2210
|
name: "addressCity",
|
|
2211
|
-
type:
|
|
2211
|
+
type: Q.TEXT,
|
|
2212
2212
|
hidden: !1,
|
|
2213
2213
|
isRequired: !1
|
|
2214
2214
|
},
|
|
2215
2215
|
{
|
|
2216
2216
|
name: "addressPostcode",
|
|
2217
|
-
type:
|
|
2217
|
+
type: Q.TEXT,
|
|
2218
2218
|
hidden: !1,
|
|
2219
2219
|
isRequired: !1
|
|
2220
2220
|
},
|
|
2221
2221
|
{
|
|
2222
2222
|
name: "addressState",
|
|
2223
|
-
type:
|
|
2223
|
+
type: Q.TEXT,
|
|
2224
2224
|
hidden: !1,
|
|
2225
2225
|
isRequired: !1
|
|
2226
2226
|
},
|
|
2227
2227
|
{
|
|
2228
2228
|
name: "addressCountry",
|
|
2229
|
-
type:
|
|
2229
|
+
type: Q.TEXT,
|
|
2230
2230
|
hidden: !1,
|
|
2231
2231
|
isRequired: !1
|
|
2232
2232
|
},
|
|
2233
2233
|
{
|
|
2234
2234
|
name: "addressLat",
|
|
2235
|
-
type:
|
|
2235
|
+
type: Q.NUMERIC,
|
|
2236
2236
|
hidden: !1,
|
|
2237
2237
|
isRequired: !1
|
|
2238
2238
|
},
|
|
2239
2239
|
{
|
|
2240
2240
|
name: "addressLng",
|
|
2241
|
-
type:
|
|
2241
|
+
type: Q.NUMERIC,
|
|
2242
2242
|
hidden: !1,
|
|
2243
2243
|
isRequired: !1
|
|
2244
2244
|
}
|
|
2245
2245
|
]
|
|
2246
|
-
},
|
|
2247
|
-
type:
|
|
2246
|
+
}, Ii = {
|
|
2247
|
+
type: Q.CURRENCY,
|
|
2248
2248
|
properties: [{
|
|
2249
2249
|
name: "amountMicros",
|
|
2250
|
-
type:
|
|
2250
|
+
type: Q.NUMERIC,
|
|
2251
2251
|
hidden: !1,
|
|
2252
2252
|
isRequired: !1
|
|
2253
2253
|
}, {
|
|
2254
2254
|
name: "currencyCode",
|
|
2255
|
-
type:
|
|
2255
|
+
type: Q.TEXT,
|
|
2256
2256
|
hidden: !1,
|
|
2257
2257
|
isRequired: !1
|
|
2258
2258
|
}]
|
|
2259
|
-
},
|
|
2260
|
-
type:
|
|
2259
|
+
}, Li = {
|
|
2260
|
+
type: Q.EMAILS,
|
|
2261
2261
|
properties: [{
|
|
2262
2262
|
name: "primaryEmail",
|
|
2263
|
-
type:
|
|
2263
|
+
type: Q.TEXT,
|
|
2264
2264
|
hidden: !1,
|
|
2265
2265
|
isRequired: !1,
|
|
2266
2266
|
isIncludedInUniqueConstraint: !0
|
|
2267
2267
|
}, {
|
|
2268
2268
|
name: "additionalEmails",
|
|
2269
|
-
type:
|
|
2269
|
+
type: Q.RAW_JSON,
|
|
2270
2270
|
hidden: !1,
|
|
2271
2271
|
isRequired: !1
|
|
2272
2272
|
}]
|
|
2273
|
-
},
|
|
2274
|
-
type:
|
|
2273
|
+
}, Ri = {
|
|
2274
|
+
type: Q.FULL_NAME,
|
|
2275
2275
|
properties: [{
|
|
2276
2276
|
name: "firstName",
|
|
2277
|
-
type:
|
|
2277
|
+
type: Q.TEXT,
|
|
2278
2278
|
hidden: !1,
|
|
2279
2279
|
isRequired: !1,
|
|
2280
2280
|
isIncludedInUniqueConstraint: !1
|
|
2281
2281
|
}, {
|
|
2282
2282
|
name: "lastName",
|
|
2283
|
-
type:
|
|
2283
|
+
type: Q.TEXT,
|
|
2284
2284
|
hidden: !1,
|
|
2285
2285
|
isRequired: !1,
|
|
2286
2286
|
isIncludedInUniqueConstraint: !1
|
|
2287
2287
|
}]
|
|
2288
|
-
},
|
|
2289
|
-
type:
|
|
2288
|
+
}, zi = {
|
|
2289
|
+
type: Q.LINKS,
|
|
2290
2290
|
properties: [
|
|
2291
2291
|
{
|
|
2292
2292
|
name: "primaryLinkLabel",
|
|
2293
|
-
type:
|
|
2293
|
+
type: Q.TEXT,
|
|
2294
2294
|
hidden: !1,
|
|
2295
2295
|
isRequired: !1
|
|
2296
2296
|
},
|
|
2297
2297
|
{
|
|
2298
2298
|
name: "primaryLinkUrl",
|
|
2299
|
-
type:
|
|
2299
|
+
type: Q.TEXT,
|
|
2300
2300
|
hidden: !1,
|
|
2301
2301
|
isRequired: !1,
|
|
2302
2302
|
isIncludedInUniqueConstraint: !0
|
|
2303
2303
|
},
|
|
2304
2304
|
{
|
|
2305
2305
|
name: "secondaryLinks",
|
|
2306
|
-
type:
|
|
2306
|
+
type: Q.RAW_JSON,
|
|
2307
2307
|
hidden: !1,
|
|
2308
2308
|
isRequired: !1
|
|
2309
2309
|
}
|
|
2310
2310
|
]
|
|
2311
|
-
},
|
|
2312
|
-
type:
|
|
2311
|
+
}, Bi = {
|
|
2312
|
+
type: Q.PHONES,
|
|
2313
2313
|
properties: [
|
|
2314
2314
|
{
|
|
2315
2315
|
name: "primaryPhoneNumber",
|
|
2316
|
-
type:
|
|
2316
|
+
type: Q.TEXT,
|
|
2317
2317
|
hidden: !1,
|
|
2318
2318
|
isRequired: !1,
|
|
2319
2319
|
isIncludedInUniqueConstraint: !0
|
|
2320
2320
|
},
|
|
2321
2321
|
{
|
|
2322
2322
|
name: "primaryPhoneCountryCode",
|
|
2323
|
-
type:
|
|
2323
|
+
type: Q.TEXT,
|
|
2324
2324
|
hidden: !1,
|
|
2325
2325
|
isRequired: !1,
|
|
2326
2326
|
isIncludedInUniqueConstraint: !0
|
|
2327
2327
|
},
|
|
2328
2328
|
{
|
|
2329
2329
|
name: "primaryPhoneCallingCode",
|
|
2330
|
-
type:
|
|
2330
|
+
type: Q.TEXT,
|
|
2331
2331
|
hidden: !1,
|
|
2332
2332
|
isRequired: !1,
|
|
2333
2333
|
isIncludedInUniqueConstraint: !0
|
|
2334
2334
|
},
|
|
2335
2335
|
{
|
|
2336
2336
|
name: "additionalPhones",
|
|
2337
|
-
type:
|
|
2337
|
+
type: Q.RAW_JSON,
|
|
2338
2338
|
hidden: !1,
|
|
2339
2339
|
isRequired: !1
|
|
2340
2340
|
}
|
|
2341
2341
|
]
|
|
2342
|
-
},
|
|
2343
|
-
type:
|
|
2342
|
+
}, Vi = {
|
|
2343
|
+
type: Q.RICH_TEXT,
|
|
2344
2344
|
properties: [{
|
|
2345
2345
|
name: "blocknote",
|
|
2346
|
-
type:
|
|
2346
|
+
type: Q.TEXT,
|
|
2347
2347
|
hidden: !1,
|
|
2348
2348
|
isRequired: !1
|
|
2349
2349
|
}, {
|
|
2350
2350
|
name: "markdown",
|
|
2351
|
-
type:
|
|
2351
|
+
type: Q.TEXT,
|
|
2352
2352
|
hidden: !1,
|
|
2353
2353
|
isRequired: !1
|
|
2354
2354
|
}]
|
|
2355
2355
|
};
|
|
2356
|
-
|
|
2357
|
-
blocknote:
|
|
2358
|
-
markdown:
|
|
2356
|
+
$r({
|
|
2357
|
+
blocknote: Dr().nullable().optional(),
|
|
2358
|
+
markdown: Dr().nullable()
|
|
2359
2359
|
}), new Map([
|
|
2360
|
-
[
|
|
2361
|
-
[
|
|
2362
|
-
[
|
|
2363
|
-
[
|
|
2364
|
-
[
|
|
2365
|
-
[
|
|
2366
|
-
[
|
|
2367
|
-
[
|
|
2368
|
-
]),
|
|
2360
|
+
[Q.LINKS, zi],
|
|
2361
|
+
[Q.CURRENCY, Ii],
|
|
2362
|
+
[Q.FULL_NAME, Ri],
|
|
2363
|
+
[Q.ADDRESS, Fi],
|
|
2364
|
+
[Q.ACTOR, Pi],
|
|
2365
|
+
[Q.EMAILS, Li],
|
|
2366
|
+
[Q.PHONES, Bi],
|
|
2367
|
+
[Q.RICH_TEXT, Vi]
|
|
2368
|
+
]), Q.RELATION, Q.MORPH_RELATION, Q.FILES, Q.TS_VECTOR, Q.TEXT, Q.ARRAY, Q.BOOLEAN, Q.DATE, Q.DATE_TIME, Q.NUMBER, Q.NUMERIC, Q.RAW_JSON, Q.RICH_TEXT, Q.SELECT, Q.MULTI_SELECT;
|
|
2369
2369
|
//#endregion
|
|
2370
2370
|
//#region ../twenty-shared/dist/application.mjs
|
|
2371
|
-
var
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2371
|
+
var Hi = "TWENTY_API_URL", Ui = [
|
|
2372
|
+
"workspace-suspended",
|
|
2373
|
+
"no-subscription",
|
|
2374
|
+
"no-credits"
|
|
2375
|
+
], Wi = () => process.env.TWENTY_APP_APPLICATION_ACCESS_TOKEN ?? process.env.TWENTY_APP_ACCESS_TOKEN, Gi = 5e3, Ki = async ({ creditsUsedMicro: e, quantity: t = 1, operation: n, operationType: r, resourceContext: i, userWorkspaceId: a }) => {
|
|
2376
|
+
let o = process.env[Hi], s = Wi();
|
|
2377
|
+
if (!(!o || !s)) try {
|
|
2378
|
+
let c = await fetch(`${o.replace(/\/$/, "")}/app/billing/charge`, {
|
|
2375
2379
|
method: "POST",
|
|
2376
2380
|
headers: {
|
|
2377
|
-
Authorization: `Bearer ${
|
|
2381
|
+
Authorization: `Bearer ${s}`,
|
|
2378
2382
|
"Content-Type": "application/json"
|
|
2379
2383
|
},
|
|
2380
2384
|
body: JSON.stringify({
|
|
2381
2385
|
creditsUsedMicro: e,
|
|
2382
|
-
quantity:
|
|
2383
|
-
|
|
2384
|
-
|
|
2386
|
+
quantity: t,
|
|
2387
|
+
operation: n,
|
|
2388
|
+
operationType: r,
|
|
2389
|
+
resourceContext: i,
|
|
2390
|
+
userWorkspaceId: a
|
|
2385
2391
|
}),
|
|
2386
|
-
signal: AbortSignal.timeout(
|
|
2392
|
+
signal: AbortSignal.timeout(Gi)
|
|
2387
2393
|
});
|
|
2388
|
-
if (!
|
|
2389
|
-
let e = await
|
|
2390
|
-
console.error(`chargeCredits: ${
|
|
2394
|
+
if (!c.ok) {
|
|
2395
|
+
let e = await c.text().catch(() => "");
|
|
2396
|
+
console.error(`chargeCredits: ${c.status} ${c.statusText}: ${e}`);
|
|
2391
2397
|
}
|
|
2392
2398
|
} catch (e) {
|
|
2393
2399
|
console.error(`chargeCredits: ${e instanceof Error ? e.message : String(e)}`);
|
|
2394
2400
|
}
|
|
2401
|
+
}, qi = 5e3, $ = () => ({ hasAvailableCredits: !0 }), Ji = (e) => {
|
|
2402
|
+
if (typeof e != "object" || !e) return null;
|
|
2403
|
+
let { hasAvailableCredits: t, reason: n } = e;
|
|
2404
|
+
return t === !0 ? { hasAvailableCredits: !0 } : t === !1 && Ui.includes(n) ? {
|
|
2405
|
+
hasAvailableCredits: !1,
|
|
2406
|
+
reason: n
|
|
2407
|
+
} : null;
|
|
2408
|
+
}, Yi = async () => {
|
|
2409
|
+
let e = process.env[Hi], t = Wi();
|
|
2410
|
+
if (!e || !t) return $();
|
|
2411
|
+
try {
|
|
2412
|
+
let n = await fetch(`${e.replace(/\/$/, "")}/app/billing/credits`, {
|
|
2413
|
+
method: "GET",
|
|
2414
|
+
headers: {
|
|
2415
|
+
Authorization: `Bearer ${t}`,
|
|
2416
|
+
Accept: "application/json"
|
|
2417
|
+
},
|
|
2418
|
+
signal: AbortSignal.timeout(qi)
|
|
2419
|
+
});
|
|
2420
|
+
if (!n.ok) return console.error(`getCreditAvailability: ${n.status} ${n.statusText}`), $();
|
|
2421
|
+
let r = Ji(await n.json());
|
|
2422
|
+
return r === null ? (console.error("getCreditAvailability: unexpected response shape"), $()) : r;
|
|
2423
|
+
} catch (e) {
|
|
2424
|
+
return console.error(`getCreditAvailability: ${e instanceof Error ? e.message : String(e)}`), $();
|
|
2425
|
+
}
|
|
2395
2426
|
};
|
|
2396
2427
|
//#endregion
|
|
2397
|
-
export {
|
|
2428
|
+
export { Ki as chargeCredits, Yi as getCreditAvailability };
|
|
2398
2429
|
|
|
2399
2430
|
//# sourceMappingURL=index.mjs.map
|