@effect-uai/ai-sdk 0.12.0 → 0.12.1
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/Messages.d.mts +0 -2
- package/dist/Messages.d.mts.map +1 -1
- package/dist/Messages.mjs +1 -1
- package/dist/Messages.mjs.map +1 -1
- package/dist/UIMessageStream.d.mts +0 -2
- package/dist/UIMessageStream.d.mts.map +1 -1
- package/dist/UIMessageStream.mjs +1 -1
- package/dist/UIMessageStream.mjs.map +1 -1
- package/dist/UIMessageStream.test.d.mts +1 -1
- package/dist/UIMessageStream.test.mjs +13 -9
- package/dist/UIMessageStream.test.mjs.map +1 -1
- package/dist/conformance.test.d.mts +1 -1
- package/dist/conformance.test.mjs +316 -1093
- package/dist/conformance.test.mjs.map +1 -1
- package/dist/{dist-DDciKZ0w.mjs → dist-CGDqr3r6.mjs} +799 -265
- package/dist/dist-CGDqr3r6.mjs.map +1 -0
- package/dist/{magic-string.es-CaWgF-3p.mjs → magic-string.es-CUAnjKYC.mjs} +14 -13
- package/dist/{magic-string.es-CaWgF-3p.mjs.map → magic-string.es-CUAnjKYC.mjs.map} +1 -1
- package/package.json +5 -5
- package/src/UIMessageStream.ts +14 -19
- package/dist/dist-DDciKZ0w.mjs.map +0 -1
- /package/dist/{chunk-CfYAbeIz.mjs → rolldown-runtime-D7D4PA-g.mjs} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as globalExpect, r as describe, t as it } from "./dist-
|
|
1
|
+
import { n as globalExpect, r as describe, t as it } from "./dist-CGDqr3r6.mjs";
|
|
2
2
|
import { toUIMessageStream } from "./UIMessageStream.mjs";
|
|
3
3
|
import * as Items from "@effect-uai/core/Items";
|
|
4
4
|
import { Array as Array$1, Effect, Option, Stream } from "effect";
|
|
@@ -6,7 +6,8 @@ import * as Turn from "@effect-uai/core/Turn";
|
|
|
6
6
|
//#region ../../../node_modules/.pnpm/@ai-sdk+provider@4.0.0/node_modules/@ai-sdk/provider/dist/index.js
|
|
7
7
|
var marker$2 = "vercel.ai.error";
|
|
8
8
|
var symbol$2 = Symbol.for(marker$2);
|
|
9
|
-
var _a$3
|
|
9
|
+
var _a$3;
|
|
10
|
+
var _b$1;
|
|
10
11
|
var AISDKError = class _AISDKError extends (_b$1 = Error, _a$3 = symbol$2, _b$1) {
|
|
11
12
|
/**
|
|
12
13
|
* Creates an AI SDK Error.
|
|
@@ -44,7 +45,8 @@ function getErrorMessage(error) {
|
|
|
44
45
|
var name3$1 = "AI_InvalidArgumentError";
|
|
45
46
|
var marker4$1 = `vercel.ai.error.${name3$1}`;
|
|
46
47
|
var symbol4$1 = Symbol.for(marker4$1);
|
|
47
|
-
var _a4$1
|
|
48
|
+
var _a4$1;
|
|
49
|
+
var _b4;
|
|
48
50
|
var InvalidArgumentError = class extends (_b4 = AISDKError, _a4$1 = symbol4$1, _b4) {
|
|
49
51
|
constructor({ message, cause, argument }) {
|
|
50
52
|
super({
|
|
@@ -62,7 +64,8 @@ var InvalidArgumentError = class extends (_b4 = AISDKError, _a4$1 = symbol4$1, _
|
|
|
62
64
|
var name6$1 = "AI_JSONParseError";
|
|
63
65
|
var marker7$1 = `vercel.ai.error.${name6$1}`;
|
|
64
66
|
var symbol7$1 = Symbol.for(marker7$1);
|
|
65
|
-
var _a7$1
|
|
67
|
+
var _a7$1;
|
|
68
|
+
var _b7;
|
|
66
69
|
var JSONParseError = class extends (_b7 = AISDKError, _a7$1 = symbol7$1, _b7) {
|
|
67
70
|
constructor({ text, cause }) {
|
|
68
71
|
super({
|
|
@@ -81,7 +84,8 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
81
84
|
var name13$1 = "AI_TypeValidationError";
|
|
82
85
|
var marker14$1 = `vercel.ai.error.${name13$1}`;
|
|
83
86
|
var symbol14$1 = Symbol.for(marker14$1);
|
|
84
|
-
var _a14$1
|
|
87
|
+
var _a14$1;
|
|
88
|
+
var _b14;
|
|
85
89
|
var TypeValidationError = class _TypeValidationError extends (_b14 = AISDKError, _a14$1 = symbol14$1, _b14) {
|
|
86
90
|
constructor({ value, cause, context }) {
|
|
87
91
|
let contextPrefix = "Type validation failed";
|
|
@@ -201,7 +205,6 @@ function cached(getter) {
|
|
|
201
205
|
Object.defineProperty(this, "value", { value });
|
|
202
206
|
return value;
|
|
203
207
|
}
|
|
204
|
-
throw new Error("cached value already set");
|
|
205
208
|
} };
|
|
206
209
|
}
|
|
207
210
|
function nullish(input) {
|
|
@@ -251,7 +254,10 @@ function assignProp(target, prop, value) {
|
|
|
251
254
|
}
|
|
252
255
|
function mergeDefs(...defs) {
|
|
253
256
|
const mergedDescriptors = {};
|
|
254
|
-
for (const def of defs)
|
|
257
|
+
for (const def of defs) {
|
|
258
|
+
const descriptors = Object.getOwnPropertyDescriptors(def);
|
|
259
|
+
Object.assign(mergedDescriptors, descriptors);
|
|
260
|
+
}
|
|
255
261
|
return Object.defineProperties({}, mergedDescriptors);
|
|
256
262
|
}
|
|
257
263
|
function esc(str) {
|
|
@@ -288,7 +294,7 @@ function shallowClone(o) {
|
|
|
288
294
|
if (Array.isArray(o)) return [...o];
|
|
289
295
|
return o;
|
|
290
296
|
}
|
|
291
|
-
const propertyKeyTypes = new Set([
|
|
297
|
+
const propertyKeyTypes = /* @__PURE__ */ new Set([
|
|
292
298
|
"string",
|
|
293
299
|
"number",
|
|
294
300
|
"symbol"
|
|
@@ -561,7 +567,7 @@ const _parse$1 = (_Err) => (schema, value, _ctx, _params) => {
|
|
|
561
567
|
}, ctx);
|
|
562
568
|
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
563
569
|
if (result.issues.length) {
|
|
564
|
-
const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
570
|
+
const e = new ((_params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
565
571
|
captureStackTrace(e, _params?.callee);
|
|
566
572
|
throw e;
|
|
567
573
|
}
|
|
@@ -575,7 +581,7 @@ const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
|
|
575
581
|
}, ctx);
|
|
576
582
|
if (result instanceof Promise) result = await result;
|
|
577
583
|
if (result.issues.length) {
|
|
578
|
-
const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
584
|
+
const e = new ((params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
579
585
|
captureStackTrace(e, params?.callee);
|
|
580
586
|
throw e;
|
|
581
587
|
}
|
|
@@ -599,7 +605,7 @@ const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
|
599
605
|
data: result.value
|
|
600
606
|
};
|
|
601
607
|
};
|
|
602
|
-
const safeParse$1 = /* @__PURE__
|
|
608
|
+
const safeParse$1 = /* @__PURE__*/ _safeParse($ZodRealError);
|
|
603
609
|
const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
604
610
|
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
605
611
|
let result = schema._zod.run({
|
|
@@ -615,7 +621,7 @@ const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
615
621
|
data: result.value
|
|
616
622
|
};
|
|
617
623
|
};
|
|
618
|
-
const safeParseAsync$1 = /* @__PURE__
|
|
624
|
+
const safeParseAsync$1 = /* @__PURE__*/ _safeParseAsync($ZodRealError);
|
|
619
625
|
const _encode = (_Err) => (schema, value, _ctx) => {
|
|
620
626
|
const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
|
|
621
627
|
return _parse$1(_Err)(schema, value, ctx);
|
|
@@ -677,7 +683,7 @@ const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z
|
|
|
677
683
|
const base64url = /^[A-Za-z0-9_-]*$/;
|
|
678
684
|
const e164 = /^\+[1-9]\d{6,14}$/;
|
|
679
685
|
const 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])))`;
|
|
680
|
-
const date$1 =
|
|
686
|
+
const date$1 = /*@__PURE__*/ new RegExp(`^${dateSource}$`);
|
|
681
687
|
function timeSource(args) {
|
|
682
688
|
const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
|
|
683
689
|
return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
@@ -705,7 +711,7 @@ const lowercase = /^[^A-Z]*$/;
|
|
|
705
711
|
const uppercase = /^[^a-z]*$/;
|
|
706
712
|
//#endregion
|
|
707
713
|
//#region ../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.js
|
|
708
|
-
const $ZodCheck =
|
|
714
|
+
const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
|
|
709
715
|
var _a;
|
|
710
716
|
inst._zod ?? (inst._zod = {});
|
|
711
717
|
inst._zod.def = def;
|
|
@@ -716,14 +722,16 @@ const numericOriginMap = {
|
|
|
716
722
|
bigint: "bigint",
|
|
717
723
|
object: "date"
|
|
718
724
|
};
|
|
719
|
-
const $ZodCheckLessThan =
|
|
725
|
+
const $ZodCheckLessThan = /*@__PURE__*/ $constructor("$ZodCheckLessThan", (inst, def) => {
|
|
720
726
|
$ZodCheck.init(inst, def);
|
|
721
727
|
const origin = numericOriginMap[typeof def.value];
|
|
722
728
|
inst._zod.onattach.push((inst) => {
|
|
723
729
|
const bag = inst._zod.bag;
|
|
724
730
|
const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
725
|
-
if (def.value < curr)
|
|
726
|
-
|
|
731
|
+
if (def.value < curr) {
|
|
732
|
+
if (def.inclusive) bag.maximum = def.value;
|
|
733
|
+
else bag.exclusiveMaximum = def.value;
|
|
734
|
+
}
|
|
727
735
|
});
|
|
728
736
|
inst._zod.check = (payload) => {
|
|
729
737
|
if (def.inclusive ? payload.value <= def.value : payload.value < def.value) return;
|
|
@@ -738,14 +746,16 @@ const $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (ins
|
|
|
738
746
|
});
|
|
739
747
|
};
|
|
740
748
|
});
|
|
741
|
-
const $ZodCheckGreaterThan =
|
|
749
|
+
const $ZodCheckGreaterThan = /*@__PURE__*/ $constructor("$ZodCheckGreaterThan", (inst, def) => {
|
|
742
750
|
$ZodCheck.init(inst, def);
|
|
743
751
|
const origin = numericOriginMap[typeof def.value];
|
|
744
752
|
inst._zod.onattach.push((inst) => {
|
|
745
753
|
const bag = inst._zod.bag;
|
|
746
754
|
const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
747
|
-
if (def.value > curr)
|
|
748
|
-
|
|
755
|
+
if (def.value > curr) {
|
|
756
|
+
if (def.inclusive) bag.minimum = def.value;
|
|
757
|
+
else bag.exclusiveMinimum = def.value;
|
|
758
|
+
}
|
|
749
759
|
});
|
|
750
760
|
inst._zod.check = (payload) => {
|
|
751
761
|
if (def.inclusive ? payload.value >= def.value : payload.value > def.value) return;
|
|
@@ -760,7 +770,7 @@ const $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan"
|
|
|
760
770
|
});
|
|
761
771
|
};
|
|
762
772
|
});
|
|
763
|
-
const $ZodCheckMultipleOf =
|
|
773
|
+
const $ZodCheckMultipleOf = /*@__PURE__*/ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
764
774
|
$ZodCheck.init(inst, def);
|
|
765
775
|
inst._zod.onattach.push((inst) => {
|
|
766
776
|
var _a;
|
|
@@ -779,7 +789,7 @@ const $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf",
|
|
|
779
789
|
});
|
|
780
790
|
};
|
|
781
791
|
});
|
|
782
|
-
const $ZodCheckNumberFormat =
|
|
792
|
+
const $ZodCheckNumberFormat = /*@__PURE__*/ $constructor("$ZodCheckNumberFormat", (inst, def) => {
|
|
783
793
|
$ZodCheck.init(inst, def);
|
|
784
794
|
def.format = def.format || "float64";
|
|
785
795
|
const isInt = def.format?.includes("int");
|
|
@@ -850,7 +860,7 @@ const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberForma
|
|
|
850
860
|
});
|
|
851
861
|
};
|
|
852
862
|
});
|
|
853
|
-
const $ZodCheckMaxLength =
|
|
863
|
+
const $ZodCheckMaxLength = /*@__PURE__*/ $constructor("$ZodCheckMaxLength", (inst, def) => {
|
|
854
864
|
var _a;
|
|
855
865
|
$ZodCheck.init(inst, def);
|
|
856
866
|
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
@@ -876,7 +886,7 @@ const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (i
|
|
|
876
886
|
});
|
|
877
887
|
};
|
|
878
888
|
});
|
|
879
|
-
const $ZodCheckMinLength =
|
|
889
|
+
const $ZodCheckMinLength = /*@__PURE__*/ $constructor("$ZodCheckMinLength", (inst, def) => {
|
|
880
890
|
var _a;
|
|
881
891
|
$ZodCheck.init(inst, def);
|
|
882
892
|
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
@@ -902,7 +912,7 @@ const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (i
|
|
|
902
912
|
});
|
|
903
913
|
};
|
|
904
914
|
});
|
|
905
|
-
const $ZodCheckLengthEquals =
|
|
915
|
+
const $ZodCheckLengthEquals = /*@__PURE__*/ $constructor("$ZodCheckLengthEquals", (inst, def) => {
|
|
906
916
|
var _a;
|
|
907
917
|
$ZodCheck.init(inst, def);
|
|
908
918
|
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
@@ -938,7 +948,7 @@ const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEqual
|
|
|
938
948
|
});
|
|
939
949
|
};
|
|
940
950
|
});
|
|
941
|
-
const $ZodCheckStringFormat =
|
|
951
|
+
const $ZodCheckStringFormat = /*@__PURE__*/ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
942
952
|
var _a, _b;
|
|
943
953
|
$ZodCheck.init(inst, def);
|
|
944
954
|
inst._zod.onattach.push((inst) => {
|
|
@@ -964,7 +974,7 @@ const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringForma
|
|
|
964
974
|
});
|
|
965
975
|
else (_b = inst._zod).check ?? (_b.check = () => {});
|
|
966
976
|
});
|
|
967
|
-
const $ZodCheckRegex =
|
|
977
|
+
const $ZodCheckRegex = /*@__PURE__*/ $constructor("$ZodCheckRegex", (inst, def) => {
|
|
968
978
|
$ZodCheckStringFormat.init(inst, def);
|
|
969
979
|
inst._zod.check = (payload) => {
|
|
970
980
|
def.pattern.lastIndex = 0;
|
|
@@ -980,15 +990,15 @@ const $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def
|
|
|
980
990
|
});
|
|
981
991
|
};
|
|
982
992
|
});
|
|
983
|
-
const $ZodCheckLowerCase =
|
|
993
|
+
const $ZodCheckLowerCase = /*@__PURE__*/ $constructor("$ZodCheckLowerCase", (inst, def) => {
|
|
984
994
|
def.pattern ?? (def.pattern = lowercase);
|
|
985
995
|
$ZodCheckStringFormat.init(inst, def);
|
|
986
996
|
});
|
|
987
|
-
const $ZodCheckUpperCase =
|
|
997
|
+
const $ZodCheckUpperCase = /*@__PURE__*/ $constructor("$ZodCheckUpperCase", (inst, def) => {
|
|
988
998
|
def.pattern ?? (def.pattern = uppercase);
|
|
989
999
|
$ZodCheckStringFormat.init(inst, def);
|
|
990
1000
|
});
|
|
991
|
-
const $ZodCheckIncludes =
|
|
1001
|
+
const $ZodCheckIncludes = /*@__PURE__*/ $constructor("$ZodCheckIncludes", (inst, def) => {
|
|
992
1002
|
$ZodCheck.init(inst, def);
|
|
993
1003
|
const escapedRegex = escapeRegex(def.includes);
|
|
994
1004
|
const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
|
|
@@ -1011,7 +1021,7 @@ const $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (ins
|
|
|
1011
1021
|
});
|
|
1012
1022
|
};
|
|
1013
1023
|
});
|
|
1014
|
-
const $ZodCheckStartsWith =
|
|
1024
|
+
const $ZodCheckStartsWith = /*@__PURE__*/ $constructor("$ZodCheckStartsWith", (inst, def) => {
|
|
1015
1025
|
$ZodCheck.init(inst, def);
|
|
1016
1026
|
const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
|
|
1017
1027
|
def.pattern ?? (def.pattern = pattern);
|
|
@@ -1033,7 +1043,7 @@ const $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith",
|
|
|
1033
1043
|
});
|
|
1034
1044
|
};
|
|
1035
1045
|
});
|
|
1036
|
-
const $ZodCheckEndsWith =
|
|
1046
|
+
const $ZodCheckEndsWith = /*@__PURE__*/ $constructor("$ZodCheckEndsWith", (inst, def) => {
|
|
1037
1047
|
$ZodCheck.init(inst, def);
|
|
1038
1048
|
const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
|
|
1039
1049
|
def.pattern ?? (def.pattern = pattern);
|
|
@@ -1055,7 +1065,7 @@ const $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (ins
|
|
|
1055
1065
|
});
|
|
1056
1066
|
};
|
|
1057
1067
|
});
|
|
1058
|
-
const $ZodCheckOverwrite =
|
|
1068
|
+
const $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (inst, def) => {
|
|
1059
1069
|
$ZodCheck.init(inst, def);
|
|
1060
1070
|
inst._zod.check = (payload) => {
|
|
1061
1071
|
payload.value = def.tx(payload.value);
|
|
@@ -1101,7 +1111,7 @@ const version = {
|
|
|
1101
1111
|
};
|
|
1102
1112
|
//#endregion
|
|
1103
1113
|
//#region ../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.js
|
|
1104
|
-
const $ZodType =
|
|
1114
|
+
const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
1105
1115
|
var _a;
|
|
1106
1116
|
inst ?? (inst = {});
|
|
1107
1117
|
inst._zod.def = def;
|
|
@@ -1189,7 +1199,7 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
1189
1199
|
version: 1
|
|
1190
1200
|
}));
|
|
1191
1201
|
});
|
|
1192
|
-
const $ZodString =
|
|
1202
|
+
const $ZodString = /*@__PURE__*/ $constructor("$ZodString", (inst, def) => {
|
|
1193
1203
|
$ZodType.init(inst, def);
|
|
1194
1204
|
inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$1(inst._zod.bag);
|
|
1195
1205
|
inst._zod.parse = (payload, _) => {
|
|
@@ -1206,15 +1216,15 @@ const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
|
1206
1216
|
return payload;
|
|
1207
1217
|
};
|
|
1208
1218
|
});
|
|
1209
|
-
const $ZodStringFormat =
|
|
1219
|
+
const $ZodStringFormat = /*@__PURE__*/ $constructor("$ZodStringFormat", (inst, def) => {
|
|
1210
1220
|
$ZodCheckStringFormat.init(inst, def);
|
|
1211
1221
|
$ZodString.init(inst, def);
|
|
1212
1222
|
});
|
|
1213
|
-
const $ZodGUID =
|
|
1223
|
+
const $ZodGUID = /*@__PURE__*/ $constructor("$ZodGUID", (inst, def) => {
|
|
1214
1224
|
def.pattern ?? (def.pattern = guid);
|
|
1215
1225
|
$ZodStringFormat.init(inst, def);
|
|
1216
1226
|
});
|
|
1217
|
-
const $ZodUUID =
|
|
1227
|
+
const $ZodUUID = /*@__PURE__*/ $constructor("$ZodUUID", (inst, def) => {
|
|
1218
1228
|
if (def.version) {
|
|
1219
1229
|
const v = {
|
|
1220
1230
|
v1: 1,
|
|
@@ -1231,11 +1241,11 @@ const $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => {
|
|
|
1231
1241
|
} else def.pattern ?? (def.pattern = uuid());
|
|
1232
1242
|
$ZodStringFormat.init(inst, def);
|
|
1233
1243
|
});
|
|
1234
|
-
const $ZodEmail =
|
|
1244
|
+
const $ZodEmail = /*@__PURE__*/ $constructor("$ZodEmail", (inst, def) => {
|
|
1235
1245
|
def.pattern ?? (def.pattern = email);
|
|
1236
1246
|
$ZodStringFormat.init(inst, def);
|
|
1237
1247
|
});
|
|
1238
|
-
const $ZodURL =
|
|
1248
|
+
const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => {
|
|
1239
1249
|
$ZodStringFormat.init(inst, def);
|
|
1240
1250
|
inst._zod.check = (payload) => {
|
|
1241
1251
|
try {
|
|
@@ -1279,56 +1289,56 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
1279
1289
|
}
|
|
1280
1290
|
};
|
|
1281
1291
|
});
|
|
1282
|
-
const $ZodEmoji =
|
|
1292
|
+
const $ZodEmoji = /*@__PURE__*/ $constructor("$ZodEmoji", (inst, def) => {
|
|
1283
1293
|
def.pattern ?? (def.pattern = emoji());
|
|
1284
1294
|
$ZodStringFormat.init(inst, def);
|
|
1285
1295
|
});
|
|
1286
|
-
const $ZodNanoID =
|
|
1296
|
+
const $ZodNanoID = /*@__PURE__*/ $constructor("$ZodNanoID", (inst, def) => {
|
|
1287
1297
|
def.pattern ?? (def.pattern = nanoid);
|
|
1288
1298
|
$ZodStringFormat.init(inst, def);
|
|
1289
1299
|
});
|
|
1290
|
-
const $ZodCUID =
|
|
1300
|
+
const $ZodCUID = /*@__PURE__*/ $constructor("$ZodCUID", (inst, def) => {
|
|
1291
1301
|
def.pattern ?? (def.pattern = cuid);
|
|
1292
1302
|
$ZodStringFormat.init(inst, def);
|
|
1293
1303
|
});
|
|
1294
|
-
const $ZodCUID2 =
|
|
1304
|
+
const $ZodCUID2 = /*@__PURE__*/ $constructor("$ZodCUID2", (inst, def) => {
|
|
1295
1305
|
def.pattern ?? (def.pattern = cuid2);
|
|
1296
1306
|
$ZodStringFormat.init(inst, def);
|
|
1297
1307
|
});
|
|
1298
|
-
const $ZodULID =
|
|
1308
|
+
const $ZodULID = /*@__PURE__*/ $constructor("$ZodULID", (inst, def) => {
|
|
1299
1309
|
def.pattern ?? (def.pattern = ulid);
|
|
1300
1310
|
$ZodStringFormat.init(inst, def);
|
|
1301
1311
|
});
|
|
1302
|
-
const $ZodXID =
|
|
1312
|
+
const $ZodXID = /*@__PURE__*/ $constructor("$ZodXID", (inst, def) => {
|
|
1303
1313
|
def.pattern ?? (def.pattern = xid);
|
|
1304
1314
|
$ZodStringFormat.init(inst, def);
|
|
1305
1315
|
});
|
|
1306
|
-
const $ZodKSUID =
|
|
1316
|
+
const $ZodKSUID = /*@__PURE__*/ $constructor("$ZodKSUID", (inst, def) => {
|
|
1307
1317
|
def.pattern ?? (def.pattern = ksuid);
|
|
1308
1318
|
$ZodStringFormat.init(inst, def);
|
|
1309
1319
|
});
|
|
1310
|
-
const $ZodISODateTime =
|
|
1320
|
+
const $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => {
|
|
1311
1321
|
def.pattern ?? (def.pattern = datetime$1(def));
|
|
1312
1322
|
$ZodStringFormat.init(inst, def);
|
|
1313
1323
|
});
|
|
1314
|
-
const $ZodISODate =
|
|
1324
|
+
const $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
|
|
1315
1325
|
def.pattern ?? (def.pattern = date$1);
|
|
1316
1326
|
$ZodStringFormat.init(inst, def);
|
|
1317
1327
|
});
|
|
1318
|
-
const $ZodISOTime =
|
|
1328
|
+
const $ZodISOTime = /*@__PURE__*/ $constructor("$ZodISOTime", (inst, def) => {
|
|
1319
1329
|
def.pattern ?? (def.pattern = time$1(def));
|
|
1320
1330
|
$ZodStringFormat.init(inst, def);
|
|
1321
1331
|
});
|
|
1322
|
-
const $ZodISODuration =
|
|
1332
|
+
const $ZodISODuration = /*@__PURE__*/ $constructor("$ZodISODuration", (inst, def) => {
|
|
1323
1333
|
def.pattern ?? (def.pattern = duration$1);
|
|
1324
1334
|
$ZodStringFormat.init(inst, def);
|
|
1325
1335
|
});
|
|
1326
|
-
const $ZodIPv4 =
|
|
1336
|
+
const $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
|
|
1327
1337
|
def.pattern ?? (def.pattern = ipv4);
|
|
1328
1338
|
$ZodStringFormat.init(inst, def);
|
|
1329
1339
|
inst._zod.bag.format = `ipv4`;
|
|
1330
1340
|
});
|
|
1331
|
-
const $ZodIPv6 =
|
|
1341
|
+
const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
|
|
1332
1342
|
def.pattern ?? (def.pattern = ipv6);
|
|
1333
1343
|
$ZodStringFormat.init(inst, def);
|
|
1334
1344
|
inst._zod.bag.format = `ipv6`;
|
|
@@ -1346,11 +1356,11 @@ const $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
|
|
|
1346
1356
|
}
|
|
1347
1357
|
};
|
|
1348
1358
|
});
|
|
1349
|
-
const $ZodCIDRv4 =
|
|
1359
|
+
const $ZodCIDRv4 = /*@__PURE__*/ $constructor("$ZodCIDRv4", (inst, def) => {
|
|
1350
1360
|
def.pattern ?? (def.pattern = cidrv4);
|
|
1351
1361
|
$ZodStringFormat.init(inst, def);
|
|
1352
1362
|
});
|
|
1353
|
-
const $ZodCIDRv6 =
|
|
1363
|
+
const $ZodCIDRv6 = /*@__PURE__*/ $constructor("$ZodCIDRv6", (inst, def) => {
|
|
1354
1364
|
def.pattern ?? (def.pattern = cidrv6);
|
|
1355
1365
|
$ZodStringFormat.init(inst, def);
|
|
1356
1366
|
inst._zod.check = (payload) => {
|
|
@@ -1384,7 +1394,7 @@ function isValidBase64(data) {
|
|
|
1384
1394
|
return false;
|
|
1385
1395
|
}
|
|
1386
1396
|
}
|
|
1387
|
-
const $ZodBase64 =
|
|
1397
|
+
const $ZodBase64 = /*@__PURE__*/ $constructor("$ZodBase64", (inst, def) => {
|
|
1388
1398
|
def.pattern ?? (def.pattern = base64);
|
|
1389
1399
|
$ZodStringFormat.init(inst, def);
|
|
1390
1400
|
inst._zod.bag.contentEncoding = "base64";
|
|
@@ -1404,7 +1414,7 @@ function isValidBase64URL(data) {
|
|
|
1404
1414
|
const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
1405
1415
|
return isValidBase64(base64.padEnd(Math.ceil(base64.length / 4) * 4, "="));
|
|
1406
1416
|
}
|
|
1407
|
-
const $ZodBase64URL =
|
|
1417
|
+
const $ZodBase64URL = /*@__PURE__*/ $constructor("$ZodBase64URL", (inst, def) => {
|
|
1408
1418
|
def.pattern ?? (def.pattern = base64url);
|
|
1409
1419
|
$ZodStringFormat.init(inst, def);
|
|
1410
1420
|
inst._zod.bag.contentEncoding = "base64url";
|
|
@@ -1419,7 +1429,7 @@ const $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def)
|
|
|
1419
1429
|
});
|
|
1420
1430
|
};
|
|
1421
1431
|
});
|
|
1422
|
-
const $ZodE164 =
|
|
1432
|
+
const $ZodE164 = /*@__PURE__*/ $constructor("$ZodE164", (inst, def) => {
|
|
1423
1433
|
def.pattern ?? (def.pattern = e164);
|
|
1424
1434
|
$ZodStringFormat.init(inst, def);
|
|
1425
1435
|
});
|
|
@@ -1438,7 +1448,7 @@ function isValidJWT$1(token, algorithm = null) {
|
|
|
1438
1448
|
return false;
|
|
1439
1449
|
}
|
|
1440
1450
|
}
|
|
1441
|
-
const $ZodJWT =
|
|
1451
|
+
const $ZodJWT = /*@__PURE__*/ $constructor("$ZodJWT", (inst, def) => {
|
|
1442
1452
|
$ZodStringFormat.init(inst, def);
|
|
1443
1453
|
inst._zod.check = (payload) => {
|
|
1444
1454
|
if (isValidJWT$1(payload.value, def.alg)) return;
|
|
@@ -1451,7 +1461,7 @@ const $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
|
|
|
1451
1461
|
});
|
|
1452
1462
|
};
|
|
1453
1463
|
});
|
|
1454
|
-
const $ZodNumber =
|
|
1464
|
+
const $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
|
|
1455
1465
|
$ZodType.init(inst, def);
|
|
1456
1466
|
inst._zod.pattern = inst._zod.bag.pattern ?? number$1;
|
|
1457
1467
|
inst._zod.parse = (payload, _ctx) => {
|
|
@@ -1471,11 +1481,11 @@ const $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
|
1471
1481
|
return payload;
|
|
1472
1482
|
};
|
|
1473
1483
|
});
|
|
1474
|
-
const $ZodNumberFormat =
|
|
1484
|
+
const $ZodNumberFormat = /*@__PURE__*/ $constructor("$ZodNumberFormat", (inst, def) => {
|
|
1475
1485
|
$ZodCheckNumberFormat.init(inst, def);
|
|
1476
1486
|
$ZodNumber.init(inst, def);
|
|
1477
1487
|
});
|
|
1478
|
-
const $ZodBoolean =
|
|
1488
|
+
const $ZodBoolean = /*@__PURE__*/ $constructor("$ZodBoolean", (inst, def) => {
|
|
1479
1489
|
$ZodType.init(inst, def);
|
|
1480
1490
|
inst._zod.pattern = boolean$1;
|
|
1481
1491
|
inst._zod.parse = (payload, _ctx) => {
|
|
@@ -1493,10 +1503,10 @@ const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
|
|
|
1493
1503
|
return payload;
|
|
1494
1504
|
};
|
|
1495
1505
|
});
|
|
1496
|
-
const $ZodNull =
|
|
1506
|
+
const $ZodNull = /*@__PURE__*/ $constructor("$ZodNull", (inst, def) => {
|
|
1497
1507
|
$ZodType.init(inst, def);
|
|
1498
1508
|
inst._zod.pattern = _null$2;
|
|
1499
|
-
inst._zod.values = new Set([null]);
|
|
1509
|
+
inst._zod.values = /* @__PURE__ */ new Set([null]);
|
|
1500
1510
|
inst._zod.parse = (payload, _ctx) => {
|
|
1501
1511
|
const input = payload.value;
|
|
1502
1512
|
if (input === null) return payload;
|
|
@@ -1509,11 +1519,11 @@ const $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
|
|
|
1509
1519
|
return payload;
|
|
1510
1520
|
};
|
|
1511
1521
|
});
|
|
1512
|
-
const $ZodUnknown =
|
|
1522
|
+
const $ZodUnknown = /*@__PURE__*/ $constructor("$ZodUnknown", (inst, def) => {
|
|
1513
1523
|
$ZodType.init(inst, def);
|
|
1514
1524
|
inst._zod.parse = (payload) => payload;
|
|
1515
1525
|
});
|
|
1516
|
-
const $ZodNever =
|
|
1526
|
+
const $ZodNever = /*@__PURE__*/ $constructor("$ZodNever", (inst, def) => {
|
|
1517
1527
|
$ZodType.init(inst, def);
|
|
1518
1528
|
inst._zod.parse = (payload, _ctx) => {
|
|
1519
1529
|
payload.issues.push({
|
|
@@ -1529,7 +1539,7 @@ function handleArrayResult(result, final, index) {
|
|
|
1529
1539
|
if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
|
|
1530
1540
|
final.value[index] = result.value;
|
|
1531
1541
|
}
|
|
1532
|
-
const $ZodArray =
|
|
1542
|
+
const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
|
|
1533
1543
|
$ZodType.init(inst, def);
|
|
1534
1544
|
inst._zod.parse = (payload, ctx) => {
|
|
1535
1545
|
const input = payload.value;
|
|
@@ -1608,7 +1618,7 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
1608
1618
|
return payload;
|
|
1609
1619
|
});
|
|
1610
1620
|
}
|
|
1611
|
-
const $ZodObject =
|
|
1621
|
+
const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
|
|
1612
1622
|
$ZodType.init(inst, def);
|
|
1613
1623
|
if (!Object.getOwnPropertyDescriptor(def, "shape")?.get) {
|
|
1614
1624
|
const sh = def.shape;
|
|
@@ -1663,7 +1673,7 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
1663
1673
|
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
1664
1674
|
};
|
|
1665
1675
|
});
|
|
1666
|
-
const $ZodObjectJIT =
|
|
1676
|
+
const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
1667
1677
|
$ZodObject.init(inst, def);
|
|
1668
1678
|
const superParse = inst._zod.parse;
|
|
1669
1679
|
const _normalized = cached(() => normalizeDef(def));
|
|
@@ -1775,7 +1785,7 @@ function handleUnionResults(results, final, inst, ctx) {
|
|
|
1775
1785
|
});
|
|
1776
1786
|
return final;
|
|
1777
1787
|
}
|
|
1778
|
-
const $ZodUnion =
|
|
1788
|
+
const $ZodUnion = /*@__PURE__*/ $constructor("$ZodUnion", (inst, def) => {
|
|
1779
1789
|
$ZodType.init(inst, def);
|
|
1780
1790
|
defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0);
|
|
1781
1791
|
defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
|
|
@@ -1813,7 +1823,7 @@ const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
|
|
|
1813
1823
|
});
|
|
1814
1824
|
};
|
|
1815
1825
|
});
|
|
1816
|
-
const $ZodDiscriminatedUnion =
|
|
1826
|
+
const $ZodDiscriminatedUnion = /*@__PURE__*/ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
|
|
1817
1827
|
def.inclusive = false;
|
|
1818
1828
|
$ZodUnion.init(inst, def);
|
|
1819
1829
|
const _super = inst._zod.parse;
|
|
@@ -1868,7 +1878,7 @@ const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUn
|
|
|
1868
1878
|
return payload;
|
|
1869
1879
|
};
|
|
1870
1880
|
});
|
|
1871
|
-
const $ZodIntersection =
|
|
1881
|
+
const $ZodIntersection = /*@__PURE__*/ $constructor("$ZodIntersection", (inst, def) => {
|
|
1872
1882
|
$ZodType.init(inst, def);
|
|
1873
1883
|
inst._zod.parse = (payload, ctx) => {
|
|
1874
1884
|
const input = payload.value;
|
|
@@ -1967,7 +1977,7 @@ function handleIntersectionResults(result, left, right) {
|
|
|
1967
1977
|
result.value = merged.data;
|
|
1968
1978
|
return result;
|
|
1969
1979
|
}
|
|
1970
|
-
const $ZodRecord =
|
|
1980
|
+
const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
1971
1981
|
$ZodType.init(inst, def);
|
|
1972
1982
|
inst._zod.parse = (payload, ctx) => {
|
|
1973
1983
|
const input = payload.value;
|
|
@@ -2058,7 +2068,7 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
2058
2068
|
return payload;
|
|
2059
2069
|
};
|
|
2060
2070
|
});
|
|
2061
|
-
const $ZodEnum =
|
|
2071
|
+
const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => {
|
|
2062
2072
|
$ZodType.init(inst, def);
|
|
2063
2073
|
const values = getEnumValues(def.entries);
|
|
2064
2074
|
const valuesSet = new Set(values);
|
|
@@ -2076,7 +2086,7 @@ const $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
2076
2086
|
return payload;
|
|
2077
2087
|
};
|
|
2078
2088
|
});
|
|
2079
|
-
const $ZodLiteral =
|
|
2089
|
+
const $ZodLiteral = /*@__PURE__*/ $constructor("$ZodLiteral", (inst, def) => {
|
|
2080
2090
|
$ZodType.init(inst, def);
|
|
2081
2091
|
if (def.values.length === 0) throw new Error("Cannot create literal schema with no valid values");
|
|
2082
2092
|
const values = new Set(def.values);
|
|
@@ -2094,7 +2104,7 @@ const $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
2094
2104
|
return payload;
|
|
2095
2105
|
};
|
|
2096
2106
|
});
|
|
2097
|
-
const $ZodTransform =
|
|
2107
|
+
const $ZodTransform = /*@__PURE__*/ $constructor("$ZodTransform", (inst, def) => {
|
|
2098
2108
|
$ZodType.init(inst, def);
|
|
2099
2109
|
inst._zod.parse = (payload, ctx) => {
|
|
2100
2110
|
if (ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
|
|
@@ -2115,12 +2125,12 @@ function handleOptionalResult(result, input) {
|
|
|
2115
2125
|
};
|
|
2116
2126
|
return result;
|
|
2117
2127
|
}
|
|
2118
|
-
const $ZodOptional =
|
|
2128
|
+
const $ZodOptional = /*@__PURE__*/ $constructor("$ZodOptional", (inst, def) => {
|
|
2119
2129
|
$ZodType.init(inst, def);
|
|
2120
2130
|
inst._zod.optin = "optional";
|
|
2121
2131
|
inst._zod.optout = "optional";
|
|
2122
2132
|
defineLazy(inst._zod, "values", () => {
|
|
2123
|
-
return def.innerType._zod.values ? new Set([...def.innerType._zod.values, void 0]) : void 0;
|
|
2133
|
+
return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, void 0]) : void 0;
|
|
2124
2134
|
});
|
|
2125
2135
|
defineLazy(inst._zod, "pattern", () => {
|
|
2126
2136
|
const pattern = def.innerType._zod.pattern;
|
|
@@ -2136,7 +2146,7 @@ const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) =>
|
|
|
2136
2146
|
return def.innerType._zod.run(payload, ctx);
|
|
2137
2147
|
};
|
|
2138
2148
|
});
|
|
2139
|
-
const $ZodExactOptional =
|
|
2149
|
+
const $ZodExactOptional = /*@__PURE__*/ $constructor("$ZodExactOptional", (inst, def) => {
|
|
2140
2150
|
$ZodOptional.init(inst, def);
|
|
2141
2151
|
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
2142
2152
|
defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern);
|
|
@@ -2144,7 +2154,7 @@ const $ZodExactOptional = /* @__PURE__ */ $constructor("$ZodExactOptional", (ins
|
|
|
2144
2154
|
return def.innerType._zod.run(payload, ctx);
|
|
2145
2155
|
};
|
|
2146
2156
|
});
|
|
2147
|
-
const $ZodNullable =
|
|
2157
|
+
const $ZodNullable = /*@__PURE__*/ $constructor("$ZodNullable", (inst, def) => {
|
|
2148
2158
|
$ZodType.init(inst, def);
|
|
2149
2159
|
defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
|
|
2150
2160
|
defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
|
|
@@ -2153,14 +2163,14 @@ const $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) =>
|
|
|
2153
2163
|
return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
|
|
2154
2164
|
});
|
|
2155
2165
|
defineLazy(inst._zod, "values", () => {
|
|
2156
|
-
return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : void 0;
|
|
2166
|
+
return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, null]) : void 0;
|
|
2157
2167
|
});
|
|
2158
2168
|
inst._zod.parse = (payload, ctx) => {
|
|
2159
2169
|
if (payload.value === null) return payload;
|
|
2160
2170
|
return def.innerType._zod.run(payload, ctx);
|
|
2161
2171
|
};
|
|
2162
2172
|
});
|
|
2163
|
-
const $ZodDefault =
|
|
2173
|
+
const $ZodDefault = /*@__PURE__*/ $constructor("$ZodDefault", (inst, def) => {
|
|
2164
2174
|
$ZodType.init(inst, def);
|
|
2165
2175
|
inst._zod.optin = "optional";
|
|
2166
2176
|
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
@@ -2182,7 +2192,7 @@ function handleDefaultResult(payload, def) {
|
|
|
2182
2192
|
if (payload.value === void 0) payload.value = def.defaultValue;
|
|
2183
2193
|
return payload;
|
|
2184
2194
|
}
|
|
2185
|
-
const $ZodPrefault =
|
|
2195
|
+
const $ZodPrefault = /*@__PURE__*/ $constructor("$ZodPrefault", (inst, def) => {
|
|
2186
2196
|
$ZodType.init(inst, def);
|
|
2187
2197
|
inst._zod.optin = "optional";
|
|
2188
2198
|
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
@@ -2192,7 +2202,7 @@ const $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) =>
|
|
|
2192
2202
|
return def.innerType._zod.run(payload, ctx);
|
|
2193
2203
|
};
|
|
2194
2204
|
});
|
|
2195
|
-
const $ZodNonOptional =
|
|
2205
|
+
const $ZodNonOptional = /*@__PURE__*/ $constructor("$ZodNonOptional", (inst, def) => {
|
|
2196
2206
|
$ZodType.init(inst, def);
|
|
2197
2207
|
defineLazy(inst._zod, "values", () => {
|
|
2198
2208
|
const v = def.innerType._zod.values;
|
|
@@ -2213,7 +2223,7 @@ function handleNonOptionalResult(payload, inst) {
|
|
|
2213
2223
|
});
|
|
2214
2224
|
return payload;
|
|
2215
2225
|
}
|
|
2216
|
-
const $ZodCatch =
|
|
2226
|
+
const $ZodCatch = /*@__PURE__*/ $constructor("$ZodCatch", (inst, def) => {
|
|
2217
2227
|
$ZodType.init(inst, def);
|
|
2218
2228
|
defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
|
|
2219
2229
|
defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
|
|
@@ -2245,7 +2255,7 @@ const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
|
|
|
2245
2255
|
return payload;
|
|
2246
2256
|
};
|
|
2247
2257
|
});
|
|
2248
|
-
const $ZodPipe =
|
|
2258
|
+
const $ZodPipe = /*@__PURE__*/ $constructor("$ZodPipe", (inst, def) => {
|
|
2249
2259
|
$ZodType.init(inst, def);
|
|
2250
2260
|
defineLazy(inst._zod, "values", () => def.in._zod.values);
|
|
2251
2261
|
defineLazy(inst._zod, "optin", () => def.in._zod.optin);
|
|
@@ -2272,7 +2282,7 @@ function handlePipeResult(left, next, ctx) {
|
|
|
2272
2282
|
issues: left.issues
|
|
2273
2283
|
}, ctx);
|
|
2274
2284
|
}
|
|
2275
|
-
const $ZodReadonly =
|
|
2285
|
+
const $ZodReadonly = /*@__PURE__*/ $constructor("$ZodReadonly", (inst, def) => {
|
|
2276
2286
|
$ZodType.init(inst, def);
|
|
2277
2287
|
defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
|
|
2278
2288
|
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
@@ -2289,7 +2299,7 @@ function handleReadonlyResult(payload) {
|
|
|
2289
2299
|
payload.value = Object.freeze(payload.value);
|
|
2290
2300
|
return payload;
|
|
2291
2301
|
}
|
|
2292
|
-
const $ZodLazy =
|
|
2302
|
+
const $ZodLazy = /*@__PURE__*/ $constructor("$ZodLazy", (inst, def) => {
|
|
2293
2303
|
$ZodType.init(inst, def);
|
|
2294
2304
|
defineLazy(inst._zod, "innerType", () => def.getter());
|
|
2295
2305
|
defineLazy(inst._zod, "pattern", () => inst._zod.innerType?._zod?.pattern);
|
|
@@ -2300,7 +2310,7 @@ const $ZodLazy = /* @__PURE__ */ $constructor("$ZodLazy", (inst, def) => {
|
|
|
2300
2310
|
return inst._zod.innerType._zod.run(payload, ctx);
|
|
2301
2311
|
};
|
|
2302
2312
|
});
|
|
2303
|
-
const $ZodCustom =
|
|
2313
|
+
const $ZodCustom = /*@__PURE__*/ $constructor("$ZodCustom", (inst, def) => {
|
|
2304
2314
|
$ZodCheck.init(inst, def);
|
|
2305
2315
|
$ZodType.init(inst, def);
|
|
2306
2316
|
inst._zod.parse = (payload, _) => {
|
|
@@ -2375,14 +2385,14 @@ function registry() {
|
|
|
2375
2385
|
const globalRegistry = globalThis.__zod_globalRegistry;
|
|
2376
2386
|
//#endregion
|
|
2377
2387
|
//#region ../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.js
|
|
2378
|
-
|
|
2388
|
+
// @__NO_SIDE_EFFECTS__
|
|
2379
2389
|
function _string(Class, params) {
|
|
2380
2390
|
return new Class({
|
|
2381
2391
|
type: "string",
|
|
2382
2392
|
...normalizeParams(params)
|
|
2383
2393
|
});
|
|
2384
2394
|
}
|
|
2385
|
-
|
|
2395
|
+
// @__NO_SIDE_EFFECTS__
|
|
2386
2396
|
function _email(Class, params) {
|
|
2387
2397
|
return new Class({
|
|
2388
2398
|
type: "string",
|
|
@@ -2392,7 +2402,7 @@ function _email(Class, params) {
|
|
|
2392
2402
|
...normalizeParams(params)
|
|
2393
2403
|
});
|
|
2394
2404
|
}
|
|
2395
|
-
|
|
2405
|
+
// @__NO_SIDE_EFFECTS__
|
|
2396
2406
|
function _guid(Class, params) {
|
|
2397
2407
|
return new Class({
|
|
2398
2408
|
type: "string",
|
|
@@ -2402,7 +2412,7 @@ function _guid(Class, params) {
|
|
|
2402
2412
|
...normalizeParams(params)
|
|
2403
2413
|
});
|
|
2404
2414
|
}
|
|
2405
|
-
|
|
2415
|
+
// @__NO_SIDE_EFFECTS__
|
|
2406
2416
|
function _uuid(Class, params) {
|
|
2407
2417
|
return new Class({
|
|
2408
2418
|
type: "string",
|
|
@@ -2412,7 +2422,7 @@ function _uuid(Class, params) {
|
|
|
2412
2422
|
...normalizeParams(params)
|
|
2413
2423
|
});
|
|
2414
2424
|
}
|
|
2415
|
-
|
|
2425
|
+
// @__NO_SIDE_EFFECTS__
|
|
2416
2426
|
function _uuidv4(Class, params) {
|
|
2417
2427
|
return new Class({
|
|
2418
2428
|
type: "string",
|
|
@@ -2423,7 +2433,7 @@ function _uuidv4(Class, params) {
|
|
|
2423
2433
|
...normalizeParams(params)
|
|
2424
2434
|
});
|
|
2425
2435
|
}
|
|
2426
|
-
|
|
2436
|
+
// @__NO_SIDE_EFFECTS__
|
|
2427
2437
|
function _uuidv6(Class, params) {
|
|
2428
2438
|
return new Class({
|
|
2429
2439
|
type: "string",
|
|
@@ -2434,7 +2444,7 @@ function _uuidv6(Class, params) {
|
|
|
2434
2444
|
...normalizeParams(params)
|
|
2435
2445
|
});
|
|
2436
2446
|
}
|
|
2437
|
-
|
|
2447
|
+
// @__NO_SIDE_EFFECTS__
|
|
2438
2448
|
function _uuidv7(Class, params) {
|
|
2439
2449
|
return new Class({
|
|
2440
2450
|
type: "string",
|
|
@@ -2445,7 +2455,7 @@ function _uuidv7(Class, params) {
|
|
|
2445
2455
|
...normalizeParams(params)
|
|
2446
2456
|
});
|
|
2447
2457
|
}
|
|
2448
|
-
|
|
2458
|
+
// @__NO_SIDE_EFFECTS__
|
|
2449
2459
|
function _url(Class, params) {
|
|
2450
2460
|
return new Class({
|
|
2451
2461
|
type: "string",
|
|
@@ -2455,7 +2465,7 @@ function _url(Class, params) {
|
|
|
2455
2465
|
...normalizeParams(params)
|
|
2456
2466
|
});
|
|
2457
2467
|
}
|
|
2458
|
-
|
|
2468
|
+
// @__NO_SIDE_EFFECTS__
|
|
2459
2469
|
function _emoji(Class, params) {
|
|
2460
2470
|
return new Class({
|
|
2461
2471
|
type: "string",
|
|
@@ -2465,7 +2475,7 @@ function _emoji(Class, params) {
|
|
|
2465
2475
|
...normalizeParams(params)
|
|
2466
2476
|
});
|
|
2467
2477
|
}
|
|
2468
|
-
|
|
2478
|
+
// @__NO_SIDE_EFFECTS__
|
|
2469
2479
|
function _nanoid(Class, params) {
|
|
2470
2480
|
return new Class({
|
|
2471
2481
|
type: "string",
|
|
@@ -2475,7 +2485,7 @@ function _nanoid(Class, params) {
|
|
|
2475
2485
|
...normalizeParams(params)
|
|
2476
2486
|
});
|
|
2477
2487
|
}
|
|
2478
|
-
|
|
2488
|
+
// @__NO_SIDE_EFFECTS__
|
|
2479
2489
|
function _cuid(Class, params) {
|
|
2480
2490
|
return new Class({
|
|
2481
2491
|
type: "string",
|
|
@@ -2485,7 +2495,7 @@ function _cuid(Class, params) {
|
|
|
2485
2495
|
...normalizeParams(params)
|
|
2486
2496
|
});
|
|
2487
2497
|
}
|
|
2488
|
-
|
|
2498
|
+
// @__NO_SIDE_EFFECTS__
|
|
2489
2499
|
function _cuid2(Class, params) {
|
|
2490
2500
|
return new Class({
|
|
2491
2501
|
type: "string",
|
|
@@ -2495,7 +2505,7 @@ function _cuid2(Class, params) {
|
|
|
2495
2505
|
...normalizeParams(params)
|
|
2496
2506
|
});
|
|
2497
2507
|
}
|
|
2498
|
-
|
|
2508
|
+
// @__NO_SIDE_EFFECTS__
|
|
2499
2509
|
function _ulid(Class, params) {
|
|
2500
2510
|
return new Class({
|
|
2501
2511
|
type: "string",
|
|
@@ -2505,7 +2515,7 @@ function _ulid(Class, params) {
|
|
|
2505
2515
|
...normalizeParams(params)
|
|
2506
2516
|
});
|
|
2507
2517
|
}
|
|
2508
|
-
|
|
2518
|
+
// @__NO_SIDE_EFFECTS__
|
|
2509
2519
|
function _xid(Class, params) {
|
|
2510
2520
|
return new Class({
|
|
2511
2521
|
type: "string",
|
|
@@ -2515,7 +2525,7 @@ function _xid(Class, params) {
|
|
|
2515
2525
|
...normalizeParams(params)
|
|
2516
2526
|
});
|
|
2517
2527
|
}
|
|
2518
|
-
|
|
2528
|
+
// @__NO_SIDE_EFFECTS__
|
|
2519
2529
|
function _ksuid(Class, params) {
|
|
2520
2530
|
return new Class({
|
|
2521
2531
|
type: "string",
|
|
@@ -2525,7 +2535,7 @@ function _ksuid(Class, params) {
|
|
|
2525
2535
|
...normalizeParams(params)
|
|
2526
2536
|
});
|
|
2527
2537
|
}
|
|
2528
|
-
|
|
2538
|
+
// @__NO_SIDE_EFFECTS__
|
|
2529
2539
|
function _ipv4(Class, params) {
|
|
2530
2540
|
return new Class({
|
|
2531
2541
|
type: "string",
|
|
@@ -2535,7 +2545,7 @@ function _ipv4(Class, params) {
|
|
|
2535
2545
|
...normalizeParams(params)
|
|
2536
2546
|
});
|
|
2537
2547
|
}
|
|
2538
|
-
|
|
2548
|
+
// @__NO_SIDE_EFFECTS__
|
|
2539
2549
|
function _ipv6(Class, params) {
|
|
2540
2550
|
return new Class({
|
|
2541
2551
|
type: "string",
|
|
@@ -2545,7 +2555,7 @@ function _ipv6(Class, params) {
|
|
|
2545
2555
|
...normalizeParams(params)
|
|
2546
2556
|
});
|
|
2547
2557
|
}
|
|
2548
|
-
|
|
2558
|
+
// @__NO_SIDE_EFFECTS__
|
|
2549
2559
|
function _cidrv4(Class, params) {
|
|
2550
2560
|
return new Class({
|
|
2551
2561
|
type: "string",
|
|
@@ -2555,7 +2565,7 @@ function _cidrv4(Class, params) {
|
|
|
2555
2565
|
...normalizeParams(params)
|
|
2556
2566
|
});
|
|
2557
2567
|
}
|
|
2558
|
-
|
|
2568
|
+
// @__NO_SIDE_EFFECTS__
|
|
2559
2569
|
function _cidrv6(Class, params) {
|
|
2560
2570
|
return new Class({
|
|
2561
2571
|
type: "string",
|
|
@@ -2565,7 +2575,7 @@ function _cidrv6(Class, params) {
|
|
|
2565
2575
|
...normalizeParams(params)
|
|
2566
2576
|
});
|
|
2567
2577
|
}
|
|
2568
|
-
|
|
2578
|
+
// @__NO_SIDE_EFFECTS__
|
|
2569
2579
|
function _base64(Class, params) {
|
|
2570
2580
|
return new Class({
|
|
2571
2581
|
type: "string",
|
|
@@ -2575,7 +2585,7 @@ function _base64(Class, params) {
|
|
|
2575
2585
|
...normalizeParams(params)
|
|
2576
2586
|
});
|
|
2577
2587
|
}
|
|
2578
|
-
|
|
2588
|
+
// @__NO_SIDE_EFFECTS__
|
|
2579
2589
|
function _base64url(Class, params) {
|
|
2580
2590
|
return new Class({
|
|
2581
2591
|
type: "string",
|
|
@@ -2585,7 +2595,7 @@ function _base64url(Class, params) {
|
|
|
2585
2595
|
...normalizeParams(params)
|
|
2586
2596
|
});
|
|
2587
2597
|
}
|
|
2588
|
-
|
|
2598
|
+
// @__NO_SIDE_EFFECTS__
|
|
2589
2599
|
function _e164(Class, params) {
|
|
2590
2600
|
return new Class({
|
|
2591
2601
|
type: "string",
|
|
@@ -2595,7 +2605,7 @@ function _e164(Class, params) {
|
|
|
2595
2605
|
...normalizeParams(params)
|
|
2596
2606
|
});
|
|
2597
2607
|
}
|
|
2598
|
-
|
|
2608
|
+
// @__NO_SIDE_EFFECTS__
|
|
2599
2609
|
function _jwt(Class, params) {
|
|
2600
2610
|
return new Class({
|
|
2601
2611
|
type: "string",
|
|
@@ -2605,7 +2615,7 @@ function _jwt(Class, params) {
|
|
|
2605
2615
|
...normalizeParams(params)
|
|
2606
2616
|
});
|
|
2607
2617
|
}
|
|
2608
|
-
|
|
2618
|
+
// @__NO_SIDE_EFFECTS__
|
|
2609
2619
|
function _isoDateTime(Class, params) {
|
|
2610
2620
|
return new Class({
|
|
2611
2621
|
type: "string",
|
|
@@ -2617,7 +2627,7 @@ function _isoDateTime(Class, params) {
|
|
|
2617
2627
|
...normalizeParams(params)
|
|
2618
2628
|
});
|
|
2619
2629
|
}
|
|
2620
|
-
|
|
2630
|
+
// @__NO_SIDE_EFFECTS__
|
|
2621
2631
|
function _isoDate(Class, params) {
|
|
2622
2632
|
return new Class({
|
|
2623
2633
|
type: "string",
|
|
@@ -2626,7 +2636,7 @@ function _isoDate(Class, params) {
|
|
|
2626
2636
|
...normalizeParams(params)
|
|
2627
2637
|
});
|
|
2628
2638
|
}
|
|
2629
|
-
|
|
2639
|
+
// @__NO_SIDE_EFFECTS__
|
|
2630
2640
|
function _isoTime(Class, params) {
|
|
2631
2641
|
return new Class({
|
|
2632
2642
|
type: "string",
|
|
@@ -2636,7 +2646,7 @@ function _isoTime(Class, params) {
|
|
|
2636
2646
|
...normalizeParams(params)
|
|
2637
2647
|
});
|
|
2638
2648
|
}
|
|
2639
|
-
|
|
2649
|
+
// @__NO_SIDE_EFFECTS__
|
|
2640
2650
|
function _isoDuration(Class, params) {
|
|
2641
2651
|
return new Class({
|
|
2642
2652
|
type: "string",
|
|
@@ -2645,7 +2655,7 @@ function _isoDuration(Class, params) {
|
|
|
2645
2655
|
...normalizeParams(params)
|
|
2646
2656
|
});
|
|
2647
2657
|
}
|
|
2648
|
-
|
|
2658
|
+
// @__NO_SIDE_EFFECTS__
|
|
2649
2659
|
function _number(Class, params) {
|
|
2650
2660
|
return new Class({
|
|
2651
2661
|
type: "number",
|
|
@@ -2653,7 +2663,7 @@ function _number(Class, params) {
|
|
|
2653
2663
|
...normalizeParams(params)
|
|
2654
2664
|
});
|
|
2655
2665
|
}
|
|
2656
|
-
|
|
2666
|
+
// @__NO_SIDE_EFFECTS__
|
|
2657
2667
|
function _int(Class, params) {
|
|
2658
2668
|
return new Class({
|
|
2659
2669
|
type: "number",
|
|
@@ -2663,32 +2673,32 @@ function _int(Class, params) {
|
|
|
2663
2673
|
...normalizeParams(params)
|
|
2664
2674
|
});
|
|
2665
2675
|
}
|
|
2666
|
-
|
|
2676
|
+
// @__NO_SIDE_EFFECTS__
|
|
2667
2677
|
function _boolean(Class, params) {
|
|
2668
2678
|
return new Class({
|
|
2669
2679
|
type: "boolean",
|
|
2670
2680
|
...normalizeParams(params)
|
|
2671
2681
|
});
|
|
2672
2682
|
}
|
|
2673
|
-
|
|
2683
|
+
// @__NO_SIDE_EFFECTS__
|
|
2674
2684
|
function _null$1(Class, params) {
|
|
2675
2685
|
return new Class({
|
|
2676
2686
|
type: "null",
|
|
2677
2687
|
...normalizeParams(params)
|
|
2678
2688
|
});
|
|
2679
2689
|
}
|
|
2680
|
-
|
|
2690
|
+
// @__NO_SIDE_EFFECTS__
|
|
2681
2691
|
function _unknown(Class) {
|
|
2682
2692
|
return new Class({ type: "unknown" });
|
|
2683
2693
|
}
|
|
2684
|
-
|
|
2694
|
+
// @__NO_SIDE_EFFECTS__
|
|
2685
2695
|
function _never(Class, params) {
|
|
2686
2696
|
return new Class({
|
|
2687
2697
|
type: "never",
|
|
2688
2698
|
...normalizeParams(params)
|
|
2689
2699
|
});
|
|
2690
2700
|
}
|
|
2691
|
-
|
|
2701
|
+
// @__NO_SIDE_EFFECTS__
|
|
2692
2702
|
function _lt(value, params) {
|
|
2693
2703
|
return new $ZodCheckLessThan({
|
|
2694
2704
|
check: "less_than",
|
|
@@ -2697,7 +2707,7 @@ function _lt(value, params) {
|
|
|
2697
2707
|
inclusive: false
|
|
2698
2708
|
});
|
|
2699
2709
|
}
|
|
2700
|
-
|
|
2710
|
+
// @__NO_SIDE_EFFECTS__
|
|
2701
2711
|
function _lte(value, params) {
|
|
2702
2712
|
return new $ZodCheckLessThan({
|
|
2703
2713
|
check: "less_than",
|
|
@@ -2706,7 +2716,7 @@ function _lte(value, params) {
|
|
|
2706
2716
|
inclusive: true
|
|
2707
2717
|
});
|
|
2708
2718
|
}
|
|
2709
|
-
|
|
2719
|
+
// @__NO_SIDE_EFFECTS__
|
|
2710
2720
|
function _gt(value, params) {
|
|
2711
2721
|
return new $ZodCheckGreaterThan({
|
|
2712
2722
|
check: "greater_than",
|
|
@@ -2715,7 +2725,7 @@ function _gt(value, params) {
|
|
|
2715
2725
|
inclusive: false
|
|
2716
2726
|
});
|
|
2717
2727
|
}
|
|
2718
|
-
|
|
2728
|
+
// @__NO_SIDE_EFFECTS__
|
|
2719
2729
|
function _gte(value, params) {
|
|
2720
2730
|
return new $ZodCheckGreaterThan({
|
|
2721
2731
|
check: "greater_than",
|
|
@@ -2724,7 +2734,7 @@ function _gte(value, params) {
|
|
|
2724
2734
|
inclusive: true
|
|
2725
2735
|
});
|
|
2726
2736
|
}
|
|
2727
|
-
|
|
2737
|
+
// @__NO_SIDE_EFFECTS__
|
|
2728
2738
|
function _multipleOf(value, params) {
|
|
2729
2739
|
return new $ZodCheckMultipleOf({
|
|
2730
2740
|
check: "multiple_of",
|
|
@@ -2732,7 +2742,7 @@ function _multipleOf(value, params) {
|
|
|
2732
2742
|
value
|
|
2733
2743
|
});
|
|
2734
2744
|
}
|
|
2735
|
-
|
|
2745
|
+
// @__NO_SIDE_EFFECTS__
|
|
2736
2746
|
function _maxLength(maximum, params) {
|
|
2737
2747
|
return new $ZodCheckMaxLength({
|
|
2738
2748
|
check: "max_length",
|
|
@@ -2740,7 +2750,7 @@ function _maxLength(maximum, params) {
|
|
|
2740
2750
|
maximum
|
|
2741
2751
|
});
|
|
2742
2752
|
}
|
|
2743
|
-
|
|
2753
|
+
// @__NO_SIDE_EFFECTS__
|
|
2744
2754
|
function _minLength(minimum, params) {
|
|
2745
2755
|
return new $ZodCheckMinLength({
|
|
2746
2756
|
check: "min_length",
|
|
@@ -2748,7 +2758,7 @@ function _minLength(minimum, params) {
|
|
|
2748
2758
|
minimum
|
|
2749
2759
|
});
|
|
2750
2760
|
}
|
|
2751
|
-
|
|
2761
|
+
// @__NO_SIDE_EFFECTS__
|
|
2752
2762
|
function _length(length, params) {
|
|
2753
2763
|
return new $ZodCheckLengthEquals({
|
|
2754
2764
|
check: "length_equals",
|
|
@@ -2756,7 +2766,7 @@ function _length(length, params) {
|
|
|
2756
2766
|
length
|
|
2757
2767
|
});
|
|
2758
2768
|
}
|
|
2759
|
-
|
|
2769
|
+
// @__NO_SIDE_EFFECTS__
|
|
2760
2770
|
function _regex(pattern, params) {
|
|
2761
2771
|
return new $ZodCheckRegex({
|
|
2762
2772
|
check: "string_format",
|
|
@@ -2765,7 +2775,7 @@ function _regex(pattern, params) {
|
|
|
2765
2775
|
pattern
|
|
2766
2776
|
});
|
|
2767
2777
|
}
|
|
2768
|
-
|
|
2778
|
+
// @__NO_SIDE_EFFECTS__
|
|
2769
2779
|
function _lowercase(params) {
|
|
2770
2780
|
return new $ZodCheckLowerCase({
|
|
2771
2781
|
check: "string_format",
|
|
@@ -2773,7 +2783,7 @@ function _lowercase(params) {
|
|
|
2773
2783
|
...normalizeParams(params)
|
|
2774
2784
|
});
|
|
2775
2785
|
}
|
|
2776
|
-
|
|
2786
|
+
// @__NO_SIDE_EFFECTS__
|
|
2777
2787
|
function _uppercase(params) {
|
|
2778
2788
|
return new $ZodCheckUpperCase({
|
|
2779
2789
|
check: "string_format",
|
|
@@ -2781,7 +2791,7 @@ function _uppercase(params) {
|
|
|
2781
2791
|
...normalizeParams(params)
|
|
2782
2792
|
});
|
|
2783
2793
|
}
|
|
2784
|
-
|
|
2794
|
+
// @__NO_SIDE_EFFECTS__
|
|
2785
2795
|
function _includes(includes, params) {
|
|
2786
2796
|
return new $ZodCheckIncludes({
|
|
2787
2797
|
check: "string_format",
|
|
@@ -2790,7 +2800,7 @@ function _includes(includes, params) {
|
|
|
2790
2800
|
includes
|
|
2791
2801
|
});
|
|
2792
2802
|
}
|
|
2793
|
-
|
|
2803
|
+
// @__NO_SIDE_EFFECTS__
|
|
2794
2804
|
function _startsWith(prefix, params) {
|
|
2795
2805
|
return new $ZodCheckStartsWith({
|
|
2796
2806
|
check: "string_format",
|
|
@@ -2799,7 +2809,7 @@ function _startsWith(prefix, params) {
|
|
|
2799
2809
|
prefix
|
|
2800
2810
|
});
|
|
2801
2811
|
}
|
|
2802
|
-
|
|
2812
|
+
// @__NO_SIDE_EFFECTS__
|
|
2803
2813
|
function _endsWith(suffix, params) {
|
|
2804
2814
|
return new $ZodCheckEndsWith({
|
|
2805
2815
|
check: "string_format",
|
|
@@ -2808,34 +2818,34 @@ function _endsWith(suffix, params) {
|
|
|
2808
2818
|
suffix
|
|
2809
2819
|
});
|
|
2810
2820
|
}
|
|
2811
|
-
|
|
2821
|
+
// @__NO_SIDE_EFFECTS__
|
|
2812
2822
|
function _overwrite(tx) {
|
|
2813
2823
|
return new $ZodCheckOverwrite({
|
|
2814
2824
|
check: "overwrite",
|
|
2815
2825
|
tx
|
|
2816
2826
|
});
|
|
2817
2827
|
}
|
|
2818
|
-
|
|
2828
|
+
// @__NO_SIDE_EFFECTS__
|
|
2819
2829
|
function _normalize(form) {
|
|
2820
2830
|
return /* @__PURE__ */ _overwrite((input) => input.normalize(form));
|
|
2821
2831
|
}
|
|
2822
|
-
|
|
2832
|
+
// @__NO_SIDE_EFFECTS__
|
|
2823
2833
|
function _trim() {
|
|
2824
2834
|
return /* @__PURE__ */ _overwrite((input) => input.trim());
|
|
2825
2835
|
}
|
|
2826
|
-
|
|
2836
|
+
// @__NO_SIDE_EFFECTS__
|
|
2827
2837
|
function _toLowerCase() {
|
|
2828
2838
|
return /* @__PURE__ */ _overwrite((input) => input.toLowerCase());
|
|
2829
2839
|
}
|
|
2830
|
-
|
|
2840
|
+
// @__NO_SIDE_EFFECTS__
|
|
2831
2841
|
function _toUpperCase() {
|
|
2832
2842
|
return /* @__PURE__ */ _overwrite((input) => input.toUpperCase());
|
|
2833
2843
|
}
|
|
2834
|
-
|
|
2844
|
+
// @__NO_SIDE_EFFECTS__
|
|
2835
2845
|
function _slugify() {
|
|
2836
2846
|
return /* @__PURE__ */ _overwrite((input) => slugify(input));
|
|
2837
2847
|
}
|
|
2838
|
-
|
|
2848
|
+
// @__NO_SIDE_EFFECTS__
|
|
2839
2849
|
function _array(Class, element, params) {
|
|
2840
2850
|
return new Class({
|
|
2841
2851
|
type: "array",
|
|
@@ -2843,7 +2853,7 @@ function _array(Class, element, params) {
|
|
|
2843
2853
|
...normalizeParams(params)
|
|
2844
2854
|
});
|
|
2845
2855
|
}
|
|
2846
|
-
|
|
2856
|
+
// @__NO_SIDE_EFFECTS__
|
|
2847
2857
|
function _custom(Class, fn, _params) {
|
|
2848
2858
|
const norm = normalizeParams(_params);
|
|
2849
2859
|
norm.abort ?? (norm.abort = true);
|
|
@@ -2854,7 +2864,7 @@ function _custom(Class, fn, _params) {
|
|
|
2854
2864
|
...norm
|
|
2855
2865
|
});
|
|
2856
2866
|
}
|
|
2857
|
-
|
|
2867
|
+
// @__NO_SIDE_EFFECTS__
|
|
2858
2868
|
function _refine(Class, fn, _params) {
|
|
2859
2869
|
return new Class({
|
|
2860
2870
|
type: "custom",
|
|
@@ -2863,7 +2873,7 @@ function _refine(Class, fn, _params) {
|
|
|
2863
2873
|
...normalizeParams(_params)
|
|
2864
2874
|
});
|
|
2865
2875
|
}
|
|
2866
|
-
|
|
2876
|
+
// @__NO_SIDE_EFFECTS__
|
|
2867
2877
|
function _superRefine(fn) {
|
|
2868
2878
|
const ch = /* @__PURE__ */ _check((payload) => {
|
|
2869
2879
|
payload.addIssue = (issue$2) => {
|
|
@@ -2882,7 +2892,7 @@ function _superRefine(fn) {
|
|
|
2882
2892
|
});
|
|
2883
2893
|
return ch;
|
|
2884
2894
|
}
|
|
2885
|
-
|
|
2895
|
+
// @__NO_SIDE_EFFECTS__
|
|
2886
2896
|
function _check(fn, params) {
|
|
2887
2897
|
const ch = new $ZodCheck({
|
|
2888
2898
|
check: "custom",
|
|
@@ -3103,8 +3113,10 @@ function finalize(ctx, schema) {
|
|
|
3103
3113
|
const seen = entry[1];
|
|
3104
3114
|
if (seen.def && seen.defId) defs[seen.defId] = seen.def;
|
|
3105
3115
|
}
|
|
3106
|
-
if (ctx.external) {} else if (Object.keys(defs).length > 0)
|
|
3107
|
-
|
|
3116
|
+
if (ctx.external) {} else if (Object.keys(defs).length > 0) {
|
|
3117
|
+
if (ctx.target === "draft-2020-12") result.$defs = defs;
|
|
3118
|
+
else result.definitions = defs;
|
|
3119
|
+
}
|
|
3108
3120
|
try {
|
|
3109
3121
|
const finalized = JSON.parse(JSON.stringify(result));
|
|
3110
3122
|
Object.defineProperty(finalized, "~standard", {
|
|
@@ -3211,23 +3223,31 @@ const numberProcessor = (schema, ctx, _json, _params) => {
|
|
|
3211
3223
|
const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
|
|
3212
3224
|
if (typeof format === "string" && format.includes("int")) json.type = "integer";
|
|
3213
3225
|
else json.type = "number";
|
|
3214
|
-
if (typeof exclusiveMinimum === "number")
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3226
|
+
if (typeof exclusiveMinimum === "number") {
|
|
3227
|
+
if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
|
|
3228
|
+
json.minimum = exclusiveMinimum;
|
|
3229
|
+
json.exclusiveMinimum = true;
|
|
3230
|
+
} else json.exclusiveMinimum = exclusiveMinimum;
|
|
3231
|
+
}
|
|
3218
3232
|
if (typeof minimum === "number") {
|
|
3219
3233
|
json.minimum = minimum;
|
|
3220
|
-
if (typeof exclusiveMinimum === "number" && ctx.target !== "draft-04")
|
|
3221
|
-
|
|
3234
|
+
if (typeof exclusiveMinimum === "number" && ctx.target !== "draft-04") {
|
|
3235
|
+
if (exclusiveMinimum >= minimum) delete json.minimum;
|
|
3236
|
+
else delete json.exclusiveMinimum;
|
|
3237
|
+
}
|
|
3238
|
+
}
|
|
3239
|
+
if (typeof exclusiveMaximum === "number") {
|
|
3240
|
+
if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
|
|
3241
|
+
json.maximum = exclusiveMaximum;
|
|
3242
|
+
json.exclusiveMaximum = true;
|
|
3243
|
+
} else json.exclusiveMaximum = exclusiveMaximum;
|
|
3222
3244
|
}
|
|
3223
|
-
if (typeof exclusiveMaximum === "number") if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
|
|
3224
|
-
json.maximum = exclusiveMaximum;
|
|
3225
|
-
json.exclusiveMaximum = true;
|
|
3226
|
-
} else json.exclusiveMaximum = exclusiveMaximum;
|
|
3227
3245
|
if (typeof maximum === "number") {
|
|
3228
3246
|
json.maximum = maximum;
|
|
3229
|
-
if (typeof exclusiveMaximum === "number" && ctx.target !== "draft-04")
|
|
3230
|
-
|
|
3247
|
+
if (typeof exclusiveMaximum === "number" && ctx.target !== "draft-04") {
|
|
3248
|
+
if (exclusiveMaximum <= maximum) delete json.maximum;
|
|
3249
|
+
else delete json.exclusiveMaximum;
|
|
3250
|
+
}
|
|
3231
3251
|
}
|
|
3232
3252
|
if (typeof multipleOf === "number") json.multipleOf = multipleOf;
|
|
3233
3253
|
};
|
|
@@ -3273,9 +3293,10 @@ const literalProcessor = (schema, ctx, json, _params) => {
|
|
|
3273
3293
|
const vals = [];
|
|
3274
3294
|
for (const val of def.values) if (val === void 0) {
|
|
3275
3295
|
if (ctx.unrepresentable === "throw") throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
3276
|
-
} else if (typeof val === "bigint")
|
|
3277
|
-
|
|
3278
|
-
|
|
3296
|
+
} else if (typeof val === "bigint") {
|
|
3297
|
+
if (ctx.unrepresentable === "throw") throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
3298
|
+
else vals.push(Number(val));
|
|
3299
|
+
} else vals.push(val);
|
|
3279
3300
|
if (vals.length === 0) {} else if (vals.length === 1) {
|
|
3280
3301
|
const val = vals[0];
|
|
3281
3302
|
json.type = val === null ? "null" : typeof val;
|
|
@@ -3309,14 +3330,15 @@ const fileProcessor = (schema, _ctx, json, _params) => {
|
|
|
3309
3330
|
const { minimum, maximum, mime } = schema._zod.bag;
|
|
3310
3331
|
if (minimum !== void 0) file.minLength = minimum;
|
|
3311
3332
|
if (maximum !== void 0) file.maxLength = maximum;
|
|
3312
|
-
if (mime)
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3333
|
+
if (mime) {
|
|
3334
|
+
if (mime.length === 1) {
|
|
3335
|
+
file.contentMediaType = mime[0];
|
|
3336
|
+
Object.assign(_json, file);
|
|
3337
|
+
} else {
|
|
3338
|
+
Object.assign(_json, file);
|
|
3339
|
+
_json.anyOf = mime.map((m) => ({ contentMediaType: m }));
|
|
3340
|
+
}
|
|
3341
|
+
} else Object.assign(_json, file);
|
|
3320
3342
|
};
|
|
3321
3343
|
const successProcessor = (_schema, _ctx, json, _params) => {
|
|
3322
3344
|
json.type = "boolean";
|
|
@@ -3634,28 +3656,28 @@ function toJSONSchema(input, params) {
|
|
|
3634
3656
|
}
|
|
3635
3657
|
//#endregion
|
|
3636
3658
|
//#region ../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/iso.js
|
|
3637
|
-
const ZodISODateTime =
|
|
3659
|
+
const ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => {
|
|
3638
3660
|
$ZodISODateTime.init(inst, def);
|
|
3639
3661
|
ZodStringFormat.init(inst, def);
|
|
3640
3662
|
});
|
|
3641
3663
|
function datetime(params) {
|
|
3642
3664
|
return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
|
|
3643
3665
|
}
|
|
3644
|
-
const ZodISODate =
|
|
3666
|
+
const ZodISODate = /*@__PURE__*/ $constructor("ZodISODate", (inst, def) => {
|
|
3645
3667
|
$ZodISODate.init(inst, def);
|
|
3646
3668
|
ZodStringFormat.init(inst, def);
|
|
3647
3669
|
});
|
|
3648
3670
|
function date(params) {
|
|
3649
3671
|
return /* @__PURE__ */ _isoDate(ZodISODate, params);
|
|
3650
3672
|
}
|
|
3651
|
-
const ZodISOTime =
|
|
3673
|
+
const ZodISOTime = /*@__PURE__*/ $constructor("ZodISOTime", (inst, def) => {
|
|
3652
3674
|
$ZodISOTime.init(inst, def);
|
|
3653
3675
|
ZodStringFormat.init(inst, def);
|
|
3654
3676
|
});
|
|
3655
3677
|
function time(params) {
|
|
3656
3678
|
return /* @__PURE__ */ _isoTime(ZodISOTime, params);
|
|
3657
3679
|
}
|
|
3658
|
-
const ZodISODuration =
|
|
3680
|
+
const ZodISODuration = /*@__PURE__*/ $constructor("ZodISODuration", (inst, def) => {
|
|
3659
3681
|
$ZodISODuration.init(inst, def);
|
|
3660
3682
|
ZodStringFormat.init(inst, def);
|
|
3661
3683
|
});
|
|
@@ -3701,7 +3723,7 @@ const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
|
3701
3723
|
const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
3702
3724
|
//#endregion
|
|
3703
3725
|
//#region ../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.js
|
|
3704
|
-
const ZodType$1 =
|
|
3726
|
+
const ZodType$1 = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
|
|
3705
3727
|
$ZodType.init(inst, def);
|
|
3706
3728
|
Object.assign(inst["~standard"], { jsonSchema: {
|
|
3707
3729
|
input: createStandardJSONSchemaMethod(inst, "input"),
|
|
@@ -3778,7 +3800,7 @@ const ZodType$1 = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
3778
3800
|
return inst;
|
|
3779
3801
|
});
|
|
3780
3802
|
/** @internal */
|
|
3781
|
-
const _ZodString =
|
|
3803
|
+
const _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => {
|
|
3782
3804
|
$ZodString.init(inst, def);
|
|
3783
3805
|
ZodType$1.init(inst, def);
|
|
3784
3806
|
inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
|
|
@@ -3802,7 +3824,7 @@ const _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
|
|
|
3802
3824
|
inst.toUpperCase = () => inst.check(/* @__PURE__ */ _toUpperCase());
|
|
3803
3825
|
inst.slugify = () => inst.check(/* @__PURE__ */ _slugify());
|
|
3804
3826
|
});
|
|
3805
|
-
const ZodString$1 =
|
|
3827
|
+
const ZodString$1 = /*@__PURE__*/ $constructor("ZodString", (inst, def) => {
|
|
3806
3828
|
$ZodString.init(inst, def);
|
|
3807
3829
|
_ZodString.init(inst, def);
|
|
3808
3830
|
inst.email = (params) => inst.check(/* @__PURE__ */ _email(ZodEmail, params));
|
|
@@ -3836,87 +3858,87 @@ const ZodString$1 = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
|
|
|
3836
3858
|
function string(params) {
|
|
3837
3859
|
return /* @__PURE__ */ _string(ZodString$1, params);
|
|
3838
3860
|
}
|
|
3839
|
-
const ZodStringFormat =
|
|
3861
|
+
const ZodStringFormat = /*@__PURE__*/ $constructor("ZodStringFormat", (inst, def) => {
|
|
3840
3862
|
$ZodStringFormat.init(inst, def);
|
|
3841
3863
|
_ZodString.init(inst, def);
|
|
3842
3864
|
});
|
|
3843
|
-
const ZodEmail =
|
|
3865
|
+
const ZodEmail = /*@__PURE__*/ $constructor("ZodEmail", (inst, def) => {
|
|
3844
3866
|
$ZodEmail.init(inst, def);
|
|
3845
3867
|
ZodStringFormat.init(inst, def);
|
|
3846
3868
|
});
|
|
3847
|
-
const ZodGUID =
|
|
3869
|
+
const ZodGUID = /*@__PURE__*/ $constructor("ZodGUID", (inst, def) => {
|
|
3848
3870
|
$ZodGUID.init(inst, def);
|
|
3849
3871
|
ZodStringFormat.init(inst, def);
|
|
3850
3872
|
});
|
|
3851
|
-
const ZodUUID =
|
|
3873
|
+
const ZodUUID = /*@__PURE__*/ $constructor("ZodUUID", (inst, def) => {
|
|
3852
3874
|
$ZodUUID.init(inst, def);
|
|
3853
3875
|
ZodStringFormat.init(inst, def);
|
|
3854
3876
|
});
|
|
3855
|
-
const ZodURL =
|
|
3877
|
+
const ZodURL = /*@__PURE__*/ $constructor("ZodURL", (inst, def) => {
|
|
3856
3878
|
$ZodURL.init(inst, def);
|
|
3857
3879
|
ZodStringFormat.init(inst, def);
|
|
3858
3880
|
});
|
|
3859
|
-
const ZodEmoji =
|
|
3881
|
+
const ZodEmoji = /*@__PURE__*/ $constructor("ZodEmoji", (inst, def) => {
|
|
3860
3882
|
$ZodEmoji.init(inst, def);
|
|
3861
3883
|
ZodStringFormat.init(inst, def);
|
|
3862
3884
|
});
|
|
3863
|
-
const ZodNanoID =
|
|
3885
|
+
const ZodNanoID = /*@__PURE__*/ $constructor("ZodNanoID", (inst, def) => {
|
|
3864
3886
|
$ZodNanoID.init(inst, def);
|
|
3865
3887
|
ZodStringFormat.init(inst, def);
|
|
3866
3888
|
});
|
|
3867
|
-
const ZodCUID =
|
|
3889
|
+
const ZodCUID = /*@__PURE__*/ $constructor("ZodCUID", (inst, def) => {
|
|
3868
3890
|
$ZodCUID.init(inst, def);
|
|
3869
3891
|
ZodStringFormat.init(inst, def);
|
|
3870
3892
|
});
|
|
3871
|
-
const ZodCUID2 =
|
|
3893
|
+
const ZodCUID2 = /*@__PURE__*/ $constructor("ZodCUID2", (inst, def) => {
|
|
3872
3894
|
$ZodCUID2.init(inst, def);
|
|
3873
3895
|
ZodStringFormat.init(inst, def);
|
|
3874
3896
|
});
|
|
3875
|
-
const ZodULID =
|
|
3897
|
+
const ZodULID = /*@__PURE__*/ $constructor("ZodULID", (inst, def) => {
|
|
3876
3898
|
$ZodULID.init(inst, def);
|
|
3877
3899
|
ZodStringFormat.init(inst, def);
|
|
3878
3900
|
});
|
|
3879
|
-
const ZodXID =
|
|
3901
|
+
const ZodXID = /*@__PURE__*/ $constructor("ZodXID", (inst, def) => {
|
|
3880
3902
|
$ZodXID.init(inst, def);
|
|
3881
3903
|
ZodStringFormat.init(inst, def);
|
|
3882
3904
|
});
|
|
3883
|
-
const ZodKSUID =
|
|
3905
|
+
const ZodKSUID = /*@__PURE__*/ $constructor("ZodKSUID", (inst, def) => {
|
|
3884
3906
|
$ZodKSUID.init(inst, def);
|
|
3885
3907
|
ZodStringFormat.init(inst, def);
|
|
3886
3908
|
});
|
|
3887
|
-
const ZodIPv4 =
|
|
3909
|
+
const ZodIPv4 = /*@__PURE__*/ $constructor("ZodIPv4", (inst, def) => {
|
|
3888
3910
|
$ZodIPv4.init(inst, def);
|
|
3889
3911
|
ZodStringFormat.init(inst, def);
|
|
3890
3912
|
});
|
|
3891
|
-
const ZodIPv6 =
|
|
3913
|
+
const ZodIPv6 = /*@__PURE__*/ $constructor("ZodIPv6", (inst, def) => {
|
|
3892
3914
|
$ZodIPv6.init(inst, def);
|
|
3893
3915
|
ZodStringFormat.init(inst, def);
|
|
3894
3916
|
});
|
|
3895
|
-
const ZodCIDRv4 =
|
|
3917
|
+
const ZodCIDRv4 = /*@__PURE__*/ $constructor("ZodCIDRv4", (inst, def) => {
|
|
3896
3918
|
$ZodCIDRv4.init(inst, def);
|
|
3897
3919
|
ZodStringFormat.init(inst, def);
|
|
3898
3920
|
});
|
|
3899
|
-
const ZodCIDRv6 =
|
|
3921
|
+
const ZodCIDRv6 = /*@__PURE__*/ $constructor("ZodCIDRv6", (inst, def) => {
|
|
3900
3922
|
$ZodCIDRv6.init(inst, def);
|
|
3901
3923
|
ZodStringFormat.init(inst, def);
|
|
3902
3924
|
});
|
|
3903
|
-
const ZodBase64 =
|
|
3925
|
+
const ZodBase64 = /*@__PURE__*/ $constructor("ZodBase64", (inst, def) => {
|
|
3904
3926
|
$ZodBase64.init(inst, def);
|
|
3905
3927
|
ZodStringFormat.init(inst, def);
|
|
3906
3928
|
});
|
|
3907
|
-
const ZodBase64URL =
|
|
3929
|
+
const ZodBase64URL = /*@__PURE__*/ $constructor("ZodBase64URL", (inst, def) => {
|
|
3908
3930
|
$ZodBase64URL.init(inst, def);
|
|
3909
3931
|
ZodStringFormat.init(inst, def);
|
|
3910
3932
|
});
|
|
3911
|
-
const ZodE164 =
|
|
3933
|
+
const ZodE164 = /*@__PURE__*/ $constructor("ZodE164", (inst, def) => {
|
|
3912
3934
|
$ZodE164.init(inst, def);
|
|
3913
3935
|
ZodStringFormat.init(inst, def);
|
|
3914
3936
|
});
|
|
3915
|
-
const ZodJWT =
|
|
3937
|
+
const ZodJWT = /*@__PURE__*/ $constructor("ZodJWT", (inst, def) => {
|
|
3916
3938
|
$ZodJWT.init(inst, def);
|
|
3917
3939
|
ZodStringFormat.init(inst, def);
|
|
3918
3940
|
});
|
|
3919
|
-
const ZodNumber$1 =
|
|
3941
|
+
const ZodNumber$1 = /*@__PURE__*/ $constructor("ZodNumber", (inst, def) => {
|
|
3920
3942
|
$ZodNumber.init(inst, def);
|
|
3921
3943
|
ZodType$1.init(inst, def);
|
|
3922
3944
|
inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
|
|
@@ -3945,14 +3967,14 @@ const ZodNumber$1 = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
|
|
|
3945
3967
|
function number(params) {
|
|
3946
3968
|
return /* @__PURE__ */ _number(ZodNumber$1, params);
|
|
3947
3969
|
}
|
|
3948
|
-
const ZodNumberFormat =
|
|
3970
|
+
const ZodNumberFormat = /*@__PURE__*/ $constructor("ZodNumberFormat", (inst, def) => {
|
|
3949
3971
|
$ZodNumberFormat.init(inst, def);
|
|
3950
3972
|
ZodNumber$1.init(inst, def);
|
|
3951
3973
|
});
|
|
3952
3974
|
function int(params) {
|
|
3953
3975
|
return /* @__PURE__ */ _int(ZodNumberFormat, params);
|
|
3954
3976
|
}
|
|
3955
|
-
const ZodBoolean$1 =
|
|
3977
|
+
const ZodBoolean$1 = /*@__PURE__*/ $constructor("ZodBoolean", (inst, def) => {
|
|
3956
3978
|
$ZodBoolean.init(inst, def);
|
|
3957
3979
|
ZodType$1.init(inst, def);
|
|
3958
3980
|
inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
|
|
@@ -3960,7 +3982,7 @@ const ZodBoolean$1 = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
|
|
|
3960
3982
|
function boolean(params) {
|
|
3961
3983
|
return /* @__PURE__ */ _boolean(ZodBoolean$1, params);
|
|
3962
3984
|
}
|
|
3963
|
-
const ZodNull$1 =
|
|
3985
|
+
const ZodNull$1 = /*@__PURE__*/ $constructor("ZodNull", (inst, def) => {
|
|
3964
3986
|
$ZodNull.init(inst, def);
|
|
3965
3987
|
ZodType$1.init(inst, def);
|
|
3966
3988
|
inst._zod.processJSONSchema = (ctx, json, params) => nullProcessor(inst, ctx, json, params);
|
|
@@ -3968,15 +3990,15 @@ const ZodNull$1 = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
|
|
|
3968
3990
|
function _null(params) {
|
|
3969
3991
|
return /* @__PURE__ */ _null$1(ZodNull$1, params);
|
|
3970
3992
|
}
|
|
3971
|
-
const ZodUnknown$1 =
|
|
3993
|
+
const ZodUnknown$1 = /*@__PURE__*/ $constructor("ZodUnknown", (inst, def) => {
|
|
3972
3994
|
$ZodUnknown.init(inst, def);
|
|
3973
3995
|
ZodType$1.init(inst, def);
|
|
3974
|
-
inst._zod.processJSONSchema = (ctx, json, params) =>
|
|
3996
|
+
inst._zod.processJSONSchema = (ctx, json, params) => void 0;
|
|
3975
3997
|
});
|
|
3976
3998
|
function unknown() {
|
|
3977
3999
|
return /* @__PURE__ */ _unknown(ZodUnknown$1);
|
|
3978
4000
|
}
|
|
3979
|
-
const ZodNever$1 =
|
|
4001
|
+
const ZodNever$1 = /*@__PURE__*/ $constructor("ZodNever", (inst, def) => {
|
|
3980
4002
|
$ZodNever.init(inst, def);
|
|
3981
4003
|
ZodType$1.init(inst, def);
|
|
3982
4004
|
inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params);
|
|
@@ -3984,7 +4006,7 @@ const ZodNever$1 = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
|
|
|
3984
4006
|
function never(params) {
|
|
3985
4007
|
return /* @__PURE__ */ _never(ZodNever$1, params);
|
|
3986
4008
|
}
|
|
3987
|
-
const ZodArray$1 =
|
|
4009
|
+
const ZodArray$1 = /*@__PURE__*/ $constructor("ZodArray", (inst, def) => {
|
|
3988
4010
|
$ZodArray.init(inst, def);
|
|
3989
4011
|
ZodType$1.init(inst, def);
|
|
3990
4012
|
inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
|
|
@@ -3998,7 +4020,7 @@ const ZodArray$1 = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
|
|
|
3998
4020
|
function array$1(element, params) {
|
|
3999
4021
|
return /* @__PURE__ */ _array(ZodArray$1, element, params);
|
|
4000
4022
|
}
|
|
4001
|
-
const ZodObject$1 =
|
|
4023
|
+
const ZodObject$1 = /*@__PURE__*/ $constructor("ZodObject", (inst, def) => {
|
|
4002
4024
|
$ZodObjectJIT.init(inst, def);
|
|
4003
4025
|
ZodType$1.init(inst, def);
|
|
4004
4026
|
inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params);
|
|
@@ -4039,21 +4061,14 @@ const ZodObject$1 = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
|
4039
4061
|
inst.required = (...args) => required(ZodNonOptional, inst, args[0]);
|
|
4040
4062
|
});
|
|
4041
4063
|
function object$1(shape, params) {
|
|
4042
|
-
|
|
4064
|
+
const def = {
|
|
4043
4065
|
type: "object",
|
|
4044
4066
|
shape: shape ?? {},
|
|
4045
4067
|
...normalizeParams(params)
|
|
4046
|
-
}
|
|
4047
|
-
|
|
4048
|
-
function strictObject(shape, params) {
|
|
4049
|
-
return new ZodObject$1({
|
|
4050
|
-
type: "object",
|
|
4051
|
-
shape,
|
|
4052
|
-
catchall: never(),
|
|
4053
|
-
...normalizeParams(params)
|
|
4054
|
-
});
|
|
4068
|
+
};
|
|
4069
|
+
return new ZodObject$1(def);
|
|
4055
4070
|
}
|
|
4056
|
-
const ZodUnion$1 =
|
|
4071
|
+
const ZodUnion$1 = /*@__PURE__*/ $constructor("ZodUnion", (inst, def) => {
|
|
4057
4072
|
$ZodUnion.init(inst, def);
|
|
4058
4073
|
ZodType$1.init(inst, def);
|
|
4059
4074
|
inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
|
|
@@ -4066,7 +4081,7 @@ function union(options, params) {
|
|
|
4066
4081
|
...normalizeParams(params)
|
|
4067
4082
|
});
|
|
4068
4083
|
}
|
|
4069
|
-
const ZodDiscriminatedUnion$1 =
|
|
4084
|
+
const ZodDiscriminatedUnion$1 = /*@__PURE__*/ $constructor("ZodDiscriminatedUnion", (inst, def) => {
|
|
4070
4085
|
ZodUnion$1.init(inst, def);
|
|
4071
4086
|
$ZodDiscriminatedUnion.init(inst, def);
|
|
4072
4087
|
});
|
|
@@ -4078,7 +4093,7 @@ function discriminatedUnion(discriminator, options, params) {
|
|
|
4078
4093
|
...normalizeParams(params)
|
|
4079
4094
|
});
|
|
4080
4095
|
}
|
|
4081
|
-
const ZodIntersection$1 =
|
|
4096
|
+
const ZodIntersection$1 = /*@__PURE__*/ $constructor("ZodIntersection", (inst, def) => {
|
|
4082
4097
|
$ZodIntersection.init(inst, def);
|
|
4083
4098
|
ZodType$1.init(inst, def);
|
|
4084
4099
|
inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
|
|
@@ -4090,7 +4105,7 @@ function intersection(left, right) {
|
|
|
4090
4105
|
right
|
|
4091
4106
|
});
|
|
4092
4107
|
}
|
|
4093
|
-
const ZodRecord$1 =
|
|
4108
|
+
const ZodRecord$1 = /*@__PURE__*/ $constructor("ZodRecord", (inst, def) => {
|
|
4094
4109
|
$ZodRecord.init(inst, def);
|
|
4095
4110
|
ZodType$1.init(inst, def);
|
|
4096
4111
|
inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
|
|
@@ -4105,7 +4120,7 @@ function record(keyType, valueType, params) {
|
|
|
4105
4120
|
...normalizeParams(params)
|
|
4106
4121
|
});
|
|
4107
4122
|
}
|
|
4108
|
-
const ZodEnum$1 =
|
|
4123
|
+
const ZodEnum$1 = /*@__PURE__*/ $constructor("ZodEnum", (inst, def) => {
|
|
4109
4124
|
$ZodEnum.init(inst, def);
|
|
4110
4125
|
ZodType$1.init(inst, def);
|
|
4111
4126
|
inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
|
|
@@ -4136,13 +4151,14 @@ const ZodEnum$1 = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
|
4136
4151
|
};
|
|
4137
4152
|
});
|
|
4138
4153
|
function _enum(values, params) {
|
|
4154
|
+
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
|
4139
4155
|
return new ZodEnum$1({
|
|
4140
4156
|
type: "enum",
|
|
4141
|
-
entries
|
|
4157
|
+
entries,
|
|
4142
4158
|
...normalizeParams(params)
|
|
4143
4159
|
});
|
|
4144
4160
|
}
|
|
4145
|
-
const ZodLiteral$1 =
|
|
4161
|
+
const ZodLiteral$1 = /*@__PURE__*/ $constructor("ZodLiteral", (inst, def) => {
|
|
4146
4162
|
$ZodLiteral.init(inst, def);
|
|
4147
4163
|
ZodType$1.init(inst, def);
|
|
4148
4164
|
inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json, params);
|
|
@@ -4159,7 +4175,7 @@ function literal(value, params) {
|
|
|
4159
4175
|
...normalizeParams(params)
|
|
4160
4176
|
});
|
|
4161
4177
|
}
|
|
4162
|
-
const ZodTransform =
|
|
4178
|
+
const ZodTransform = /*@__PURE__*/ $constructor("ZodTransform", (inst, def) => {
|
|
4163
4179
|
$ZodTransform.init(inst, def);
|
|
4164
4180
|
ZodType$1.init(inst, def);
|
|
4165
4181
|
inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params);
|
|
@@ -4191,7 +4207,7 @@ function transform(fn) {
|
|
|
4191
4207
|
transform: fn
|
|
4192
4208
|
});
|
|
4193
4209
|
}
|
|
4194
|
-
const ZodOptional$1 =
|
|
4210
|
+
const ZodOptional$1 = /*@__PURE__*/ $constructor("ZodOptional", (inst, def) => {
|
|
4195
4211
|
$ZodOptional.init(inst, def);
|
|
4196
4212
|
ZodType$1.init(inst, def);
|
|
4197
4213
|
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
@@ -4203,7 +4219,7 @@ function optional(innerType) {
|
|
|
4203
4219
|
innerType
|
|
4204
4220
|
});
|
|
4205
4221
|
}
|
|
4206
|
-
const ZodExactOptional =
|
|
4222
|
+
const ZodExactOptional = /*@__PURE__*/ $constructor("ZodExactOptional", (inst, def) => {
|
|
4207
4223
|
$ZodExactOptional.init(inst, def);
|
|
4208
4224
|
ZodType$1.init(inst, def);
|
|
4209
4225
|
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
@@ -4215,7 +4231,7 @@ function exactOptional(innerType) {
|
|
|
4215
4231
|
innerType
|
|
4216
4232
|
});
|
|
4217
4233
|
}
|
|
4218
|
-
const ZodNullable$1 =
|
|
4234
|
+
const ZodNullable$1 = /*@__PURE__*/ $constructor("ZodNullable", (inst, def) => {
|
|
4219
4235
|
$ZodNullable.init(inst, def);
|
|
4220
4236
|
ZodType$1.init(inst, def);
|
|
4221
4237
|
inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
|
|
@@ -4227,7 +4243,7 @@ function nullable(innerType) {
|
|
|
4227
4243
|
innerType
|
|
4228
4244
|
});
|
|
4229
4245
|
}
|
|
4230
|
-
const ZodDefault$1 =
|
|
4246
|
+
const ZodDefault$1 = /*@__PURE__*/ $constructor("ZodDefault", (inst, def) => {
|
|
4231
4247
|
$ZodDefault.init(inst, def);
|
|
4232
4248
|
ZodType$1.init(inst, def);
|
|
4233
4249
|
inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params);
|
|
@@ -4243,7 +4259,7 @@ function _default(innerType, defaultValue) {
|
|
|
4243
4259
|
}
|
|
4244
4260
|
});
|
|
4245
4261
|
}
|
|
4246
|
-
const ZodPrefault =
|
|
4262
|
+
const ZodPrefault = /*@__PURE__*/ $constructor("ZodPrefault", (inst, def) => {
|
|
4247
4263
|
$ZodPrefault.init(inst, def);
|
|
4248
4264
|
ZodType$1.init(inst, def);
|
|
4249
4265
|
inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params);
|
|
@@ -4258,7 +4274,7 @@ function prefault(innerType, defaultValue) {
|
|
|
4258
4274
|
}
|
|
4259
4275
|
});
|
|
4260
4276
|
}
|
|
4261
|
-
const ZodNonOptional =
|
|
4277
|
+
const ZodNonOptional = /*@__PURE__*/ $constructor("ZodNonOptional", (inst, def) => {
|
|
4262
4278
|
$ZodNonOptional.init(inst, def);
|
|
4263
4279
|
ZodType$1.init(inst, def);
|
|
4264
4280
|
inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
|
|
@@ -4271,7 +4287,7 @@ function nonoptional(innerType, params) {
|
|
|
4271
4287
|
...normalizeParams(params)
|
|
4272
4288
|
});
|
|
4273
4289
|
}
|
|
4274
|
-
const ZodCatch$1 =
|
|
4290
|
+
const ZodCatch$1 = /*@__PURE__*/ $constructor("ZodCatch", (inst, def) => {
|
|
4275
4291
|
$ZodCatch.init(inst, def);
|
|
4276
4292
|
ZodType$1.init(inst, def);
|
|
4277
4293
|
inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
|
|
@@ -4285,7 +4301,7 @@ function _catch(innerType, catchValue) {
|
|
|
4285
4301
|
catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
|
|
4286
4302
|
});
|
|
4287
4303
|
}
|
|
4288
|
-
const ZodPipe =
|
|
4304
|
+
const ZodPipe = /*@__PURE__*/ $constructor("ZodPipe", (inst, def) => {
|
|
4289
4305
|
$ZodPipe.init(inst, def);
|
|
4290
4306
|
ZodType$1.init(inst, def);
|
|
4291
4307
|
inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
|
|
@@ -4299,7 +4315,7 @@ function pipe(in_, out) {
|
|
|
4299
4315
|
out
|
|
4300
4316
|
});
|
|
4301
4317
|
}
|
|
4302
|
-
const ZodReadonly$1 =
|
|
4318
|
+
const ZodReadonly$1 = /*@__PURE__*/ $constructor("ZodReadonly", (inst, def) => {
|
|
4303
4319
|
$ZodReadonly.init(inst, def);
|
|
4304
4320
|
ZodType$1.init(inst, def);
|
|
4305
4321
|
inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
|
|
@@ -4311,7 +4327,7 @@ function readonly(innerType) {
|
|
|
4311
4327
|
innerType
|
|
4312
4328
|
});
|
|
4313
4329
|
}
|
|
4314
|
-
const ZodLazy$1 =
|
|
4330
|
+
const ZodLazy$1 = /*@__PURE__*/ $constructor("ZodLazy", (inst, def) => {
|
|
4315
4331
|
$ZodLazy.init(inst, def);
|
|
4316
4332
|
ZodType$1.init(inst, def);
|
|
4317
4333
|
inst._zod.processJSONSchema = (ctx, json, params) => lazyProcessor(inst, ctx, json, params);
|
|
@@ -4323,7 +4339,7 @@ function lazy(getter) {
|
|
|
4323
4339
|
getter
|
|
4324
4340
|
});
|
|
4325
4341
|
}
|
|
4326
|
-
const ZodCustom =
|
|
4342
|
+
const ZodCustom = /*@__PURE__*/ $constructor("ZodCustom", (inst, def) => {
|
|
4327
4343
|
$ZodCustom.init(inst, def);
|
|
4328
4344
|
ZodType$1.init(inst, def);
|
|
4329
4345
|
inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
|
|
@@ -4586,13 +4602,14 @@ const errorMap = (issue, _ctx) => {
|
|
|
4586
4602
|
message = `Invalid date`;
|
|
4587
4603
|
break;
|
|
4588
4604
|
case ZodIssueCode.invalid_string:
|
|
4589
|
-
if (typeof issue.validation === "object")
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4605
|
+
if (typeof issue.validation === "object") {
|
|
4606
|
+
if ("includes" in issue.validation) {
|
|
4607
|
+
message = `Invalid input: must include "${issue.validation.includes}"`;
|
|
4608
|
+
if (typeof issue.validation.position === "number") message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
|
|
4609
|
+
} else if ("startsWith" in issue.validation) message = `Invalid input: must start with "${issue.validation.startsWith}"`;
|
|
4610
|
+
else if ("endsWith" in issue.validation) message = `Invalid input: must end with "${issue.validation.endsWith}"`;
|
|
4611
|
+
else util.assertNever(issue.validation);
|
|
4612
|
+
} else if (issue.validation !== "regex") message = `Invalid ${issue.validation}`;
|
|
4596
4613
|
else message = "Invalid";
|
|
4597
4614
|
break;
|
|
4598
4615
|
case ZodIssueCode.too_small:
|
|
@@ -4757,8 +4774,10 @@ var ParseInputLazyPath = class {
|
|
|
4757
4774
|
this._key = key;
|
|
4758
4775
|
}
|
|
4759
4776
|
get path() {
|
|
4760
|
-
if (!this._cachedPath.length)
|
|
4761
|
-
|
|
4777
|
+
if (!this._cachedPath.length) {
|
|
4778
|
+
if (Array.isArray(this._key)) this._cachedPath.push(...this._path, ...this._key);
|
|
4779
|
+
else this._cachedPath.push(...this._path, this._key);
|
|
4780
|
+
}
|
|
4762
4781
|
return this._cachedPath;
|
|
4763
4782
|
}
|
|
4764
4783
|
};
|
|
@@ -4857,11 +4876,12 @@ var ZodType = class {
|
|
|
4857
4876
|
data,
|
|
4858
4877
|
parsedType: getParsedType(data)
|
|
4859
4878
|
};
|
|
4860
|
-
|
|
4879
|
+
const result = this._parseSync({
|
|
4861
4880
|
data,
|
|
4862
4881
|
path: ctx.path,
|
|
4863
4882
|
parent: ctx
|
|
4864
|
-
})
|
|
4883
|
+
});
|
|
4884
|
+
return handleResult(ctx, result);
|
|
4865
4885
|
}
|
|
4866
4886
|
"~validate"(data) {
|
|
4867
4887
|
const ctx = {
|
|
@@ -4918,7 +4938,8 @@ var ZodType = class {
|
|
|
4918
4938
|
path: ctx.path,
|
|
4919
4939
|
parent: ctx
|
|
4920
4940
|
});
|
|
4921
|
-
|
|
4941
|
+
const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));
|
|
4942
|
+
return handleResult(ctx, result);
|
|
4922
4943
|
}
|
|
4923
4944
|
refine(check, message) {
|
|
4924
4945
|
const getIssueProperties = (val) => {
|
|
@@ -7471,7 +7492,8 @@ var ZodPromise = class extends ZodType {
|
|
|
7471
7492
|
});
|
|
7472
7493
|
return INVALID;
|
|
7473
7494
|
}
|
|
7474
|
-
|
|
7495
|
+
const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);
|
|
7496
|
+
return OK(promisified.then((data) => {
|
|
7475
7497
|
return this._def.type.parseAsync(data, {
|
|
7476
7498
|
path: ctx.path,
|
|
7477
7499
|
errorMap: ctx.common.contextualErrorMap
|
|
@@ -7569,30 +7591,32 @@ var ZodEffects = class extends ZodType {
|
|
|
7569
7591
|
});
|
|
7570
7592
|
});
|
|
7571
7593
|
}
|
|
7572
|
-
if (effect.type === "transform")
|
|
7573
|
-
|
|
7594
|
+
if (effect.type === "transform") {
|
|
7595
|
+
if (ctx.common.async === false) {
|
|
7596
|
+
const base = this._def.schema._parseSync({
|
|
7597
|
+
data: ctx.data,
|
|
7598
|
+
path: ctx.path,
|
|
7599
|
+
parent: ctx
|
|
7600
|
+
});
|
|
7601
|
+
if (!isValid(base)) return INVALID;
|
|
7602
|
+
const result = effect.transform(base.value, checkCtx);
|
|
7603
|
+
if (result instanceof Promise) throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
|
|
7604
|
+
return {
|
|
7605
|
+
status: status.value,
|
|
7606
|
+
value: result
|
|
7607
|
+
};
|
|
7608
|
+
} else return this._def.schema._parseAsync({
|
|
7574
7609
|
data: ctx.data,
|
|
7575
7610
|
path: ctx.path,
|
|
7576
7611
|
parent: ctx
|
|
7612
|
+
}).then((base) => {
|
|
7613
|
+
if (!isValid(base)) return INVALID;
|
|
7614
|
+
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
7615
|
+
status: status.value,
|
|
7616
|
+
value: result
|
|
7617
|
+
}));
|
|
7577
7618
|
});
|
|
7578
|
-
|
|
7579
|
-
const result = effect.transform(base.value, checkCtx);
|
|
7580
|
-
if (result instanceof Promise) throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
|
|
7581
|
-
return {
|
|
7582
|
-
status: status.value,
|
|
7583
|
-
value: result
|
|
7584
|
-
};
|
|
7585
|
-
} else return this._def.schema._parseAsync({
|
|
7586
|
-
data: ctx.data,
|
|
7587
|
-
path: ctx.path,
|
|
7588
|
-
parent: ctx
|
|
7589
|
-
}).then((base) => {
|
|
7590
|
-
if (!isValid(base)) return INVALID;
|
|
7591
|
-
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
7592
|
-
status: status.value,
|
|
7593
|
-
value: result
|
|
7594
|
-
}));
|
|
7595
|
-
});
|
|
7619
|
+
}
|
|
7596
7620
|
util.assertNever(effect);
|
|
7597
7621
|
}
|
|
7598
7622
|
};
|
|
@@ -7901,224 +7925,6 @@ ZodPipeline.create;
|
|
|
7901
7925
|
//#endregion
|
|
7902
7926
|
//#region ../../../node_modules/.pnpm/@ai-sdk+provider-utils@5.0.1_zod@4.3.6/node_modules/@ai-sdk/provider-utils/dist/index.js
|
|
7903
7927
|
var { btoa: btoa$1, atob: atob$1 } = globalThis;
|
|
7904
|
-
async function cancelResponseBody(response) {
|
|
7905
|
-
var _a2;
|
|
7906
|
-
try {
|
|
7907
|
-
await ((_a2 = response.body) == null ? void 0 : _a2.cancel());
|
|
7908
|
-
} catch (e) {}
|
|
7909
|
-
}
|
|
7910
|
-
var name$1 = "AI_DownloadError";
|
|
7911
|
-
var marker$1 = `vercel.ai.error.${name$1}`;
|
|
7912
|
-
var symbol$1 = Symbol.for(marker$1);
|
|
7913
|
-
var _a$1, _b;
|
|
7914
|
-
var DownloadError = class extends (_b = AISDKError, _a$1 = symbol$1, _b) {
|
|
7915
|
-
constructor({ url, statusCode, statusText, cause, message = cause == null ? `Failed to download ${url}: ${statusCode} ${statusText}` : `Failed to download ${url}: ${cause}` }) {
|
|
7916
|
-
super({
|
|
7917
|
-
name: name$1,
|
|
7918
|
-
message,
|
|
7919
|
-
cause
|
|
7920
|
-
});
|
|
7921
|
-
this[_a$1] = true;
|
|
7922
|
-
this.url = url;
|
|
7923
|
-
this.statusCode = statusCode;
|
|
7924
|
-
this.statusText = statusText;
|
|
7925
|
-
}
|
|
7926
|
-
static isInstance(error) {
|
|
7927
|
-
return AISDKError.hasMarker(error, marker$1);
|
|
7928
|
-
}
|
|
7929
|
-
};
|
|
7930
|
-
function isBrowserRuntime(globalThisAny = globalThis) {
|
|
7931
|
-
return globalThisAny.window != null;
|
|
7932
|
-
}
|
|
7933
|
-
function validateDownloadUrl(url) {
|
|
7934
|
-
let parsed;
|
|
7935
|
-
try {
|
|
7936
|
-
parsed = new URL(url);
|
|
7937
|
-
} catch (e) {
|
|
7938
|
-
throw new DownloadError({
|
|
7939
|
-
url,
|
|
7940
|
-
message: `Invalid URL: ${url}`
|
|
7941
|
-
});
|
|
7942
|
-
}
|
|
7943
|
-
if (parsed.protocol === "data:") return;
|
|
7944
|
-
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") throw new DownloadError({
|
|
7945
|
-
url,
|
|
7946
|
-
message: `URL scheme must be http, https, or data, got ${parsed.protocol}`
|
|
7947
|
-
});
|
|
7948
|
-
const hostname = parsed.hostname.toLowerCase().replace(/\.+$/, "");
|
|
7949
|
-
if (!hostname) throw new DownloadError({
|
|
7950
|
-
url,
|
|
7951
|
-
message: `URL must have a hostname`
|
|
7952
|
-
});
|
|
7953
|
-
if (hostname === "localhost" || hostname.endsWith(".local") || hostname.endsWith(".localhost")) throw new DownloadError({
|
|
7954
|
-
url,
|
|
7955
|
-
message: `URL with hostname ${hostname} is not allowed`
|
|
7956
|
-
});
|
|
7957
|
-
if (hostname.startsWith("[") && hostname.endsWith("]")) {
|
|
7958
|
-
if (isPrivateIPv6(hostname.slice(1, -1))) throw new DownloadError({
|
|
7959
|
-
url,
|
|
7960
|
-
message: `URL with IPv6 address ${hostname} is not allowed`
|
|
7961
|
-
});
|
|
7962
|
-
return;
|
|
7963
|
-
}
|
|
7964
|
-
if (isIPv4(hostname)) {
|
|
7965
|
-
if (isPrivateIPv4(hostname)) throw new DownloadError({
|
|
7966
|
-
url,
|
|
7967
|
-
message: `URL with IP address ${hostname} is not allowed`
|
|
7968
|
-
});
|
|
7969
|
-
return;
|
|
7970
|
-
}
|
|
7971
|
-
}
|
|
7972
|
-
function isIPv4(hostname) {
|
|
7973
|
-
const parts = hostname.split(".");
|
|
7974
|
-
if (parts.length !== 4) return false;
|
|
7975
|
-
return parts.every((part) => {
|
|
7976
|
-
const num = Number(part);
|
|
7977
|
-
return Number.isInteger(num) && num >= 0 && num <= 255 && String(num) === part;
|
|
7978
|
-
});
|
|
7979
|
-
}
|
|
7980
|
-
function isPrivateIPv4(ip) {
|
|
7981
|
-
const [a, b, c] = ip.split(".").map(Number);
|
|
7982
|
-
if (a === 0) return true;
|
|
7983
|
-
if (a === 10) return true;
|
|
7984
|
-
if (a === 100 && b >= 64 && b <= 127) return true;
|
|
7985
|
-
if (a === 127) return true;
|
|
7986
|
-
if (a === 169 && b === 254) return true;
|
|
7987
|
-
if (a === 172 && b >= 16 && b <= 31) return true;
|
|
7988
|
-
if (a === 192 && b === 0 && c === 0) return true;
|
|
7989
|
-
if (a === 192 && b === 168) return true;
|
|
7990
|
-
if (a === 198 && (b === 18 || b === 19)) return true;
|
|
7991
|
-
if (a >= 240) return true;
|
|
7992
|
-
return false;
|
|
7993
|
-
}
|
|
7994
|
-
function parseIPv6(ip) {
|
|
7995
|
-
let address = ip.toLowerCase();
|
|
7996
|
-
const zoneIndex = address.indexOf("%");
|
|
7997
|
-
if (zoneIndex !== -1) address = address.slice(0, zoneIndex);
|
|
7998
|
-
const halves = address.split("::");
|
|
7999
|
-
if (halves.length > 2) return null;
|
|
8000
|
-
const toGroups = (segment) => {
|
|
8001
|
-
if (segment === "") return [];
|
|
8002
|
-
const groups = [];
|
|
8003
|
-
const parts = segment.split(":");
|
|
8004
|
-
for (let i = 0; i < parts.length; i++) {
|
|
8005
|
-
const part = parts[i];
|
|
8006
|
-
if (part.includes(".")) {
|
|
8007
|
-
if (i !== parts.length - 1 || !isIPv4(part)) return null;
|
|
8008
|
-
const [a, b, c, d] = part.split(".").map(Number);
|
|
8009
|
-
groups.push(a << 8 | b, c << 8 | d);
|
|
8010
|
-
continue;
|
|
8011
|
-
}
|
|
8012
|
-
if (!/^[0-9a-f]{1,4}$/.test(part)) return null;
|
|
8013
|
-
groups.push(parseInt(part, 16));
|
|
8014
|
-
}
|
|
8015
|
-
return groups;
|
|
8016
|
-
};
|
|
8017
|
-
const head = toGroups(halves[0]);
|
|
8018
|
-
if (head === null) return null;
|
|
8019
|
-
if (halves.length === 2) {
|
|
8020
|
-
const tail = toGroups(halves[1]);
|
|
8021
|
-
if (tail === null) return null;
|
|
8022
|
-
const fill = 8 - head.length - tail.length;
|
|
8023
|
-
if (fill < 0) return null;
|
|
8024
|
-
return [
|
|
8025
|
-
...head,
|
|
8026
|
-
...new Array(fill).fill(0),
|
|
8027
|
-
...tail
|
|
8028
|
-
];
|
|
8029
|
-
}
|
|
8030
|
-
return head.length === 8 ? head : null;
|
|
8031
|
-
}
|
|
8032
|
-
function isPrivateIPv6(ip) {
|
|
8033
|
-
const groups = parseIPv6(ip);
|
|
8034
|
-
if (groups === null) return true;
|
|
8035
|
-
const topZero = (count) => groups.slice(0, count).every((group) => group === 0);
|
|
8036
|
-
if (topZero(7) && (groups[7] === 0 || groups[7] === 1)) return true;
|
|
8037
|
-
if ((groups[0] & 65024) === 64512) return true;
|
|
8038
|
-
if ((groups[0] & 65472) === 65152) return true;
|
|
8039
|
-
if ((groups[0] & 65472) === 65216) return true;
|
|
8040
|
-
if ((groups[0] & 65280) === 65280) return true;
|
|
8041
|
-
if (topZero(6) || topZero(5) && groups[5] === 65535 || topZero(4) && groups[4] === 65535 && groups[5] === 0 || groups[0] === 100 && groups[1] === 65435 && groups[2] === 0 && groups[3] === 0 && groups[4] === 0 && groups[5] === 0 || groups[0] === 100 && groups[1] === 65435 && groups[2] === 1) return isPrivateIPv4(`${groups[6] >> 8 & 255}.${groups[6] & 255}.${groups[7] >> 8 & 255}.${groups[7] & 255}`);
|
|
8042
|
-
return false;
|
|
8043
|
-
}
|
|
8044
|
-
var MAX_DOWNLOAD_REDIRECTS = 10;
|
|
8045
|
-
async function fetchWithValidatedRedirects({ url, headers, abortSignal, maxRedirects = MAX_DOWNLOAD_REDIRECTS }) {
|
|
8046
|
-
const baseInit = { signal: abortSignal };
|
|
8047
|
-
if (headers !== void 0) baseInit.headers = headers;
|
|
8048
|
-
let currentUrl = url;
|
|
8049
|
-
for (let redirectCount = 0; redirectCount <= maxRedirects; redirectCount++) {
|
|
8050
|
-
validateDownloadUrl(currentUrl);
|
|
8051
|
-
const response = await fetch(currentUrl, {
|
|
8052
|
-
...baseInit,
|
|
8053
|
-
redirect: "manual"
|
|
8054
|
-
});
|
|
8055
|
-
if (response.type === "opaqueredirect") {
|
|
8056
|
-
if (!isBrowserRuntime()) throw new DownloadError({
|
|
8057
|
-
url,
|
|
8058
|
-
message: `Redirect from ${currentUrl} could not be validated and was blocked`
|
|
8059
|
-
});
|
|
8060
|
-
return await fetch(currentUrl, {
|
|
8061
|
-
...baseInit,
|
|
8062
|
-
redirect: "follow"
|
|
8063
|
-
});
|
|
8064
|
-
}
|
|
8065
|
-
const location = response.headers.get("location");
|
|
8066
|
-
if (response.status >= 300 && response.status < 400 && location) {
|
|
8067
|
-
await cancelResponseBody(response);
|
|
8068
|
-
currentUrl = new URL(location, currentUrl).toString();
|
|
8069
|
-
continue;
|
|
8070
|
-
}
|
|
8071
|
-
return response;
|
|
8072
|
-
}
|
|
8073
|
-
throw new DownloadError({
|
|
8074
|
-
url,
|
|
8075
|
-
message: `Too many redirects (max ${maxRedirects})`
|
|
8076
|
-
});
|
|
8077
|
-
}
|
|
8078
|
-
var DEFAULT_MAX_DOWNLOAD_SIZE = 2 * 1024 * 1024 * 1024;
|
|
8079
|
-
async function readResponseWithSizeLimit({ response, url, maxBytes = DEFAULT_MAX_DOWNLOAD_SIZE }) {
|
|
8080
|
-
const contentLength = response.headers.get("content-length");
|
|
8081
|
-
if (contentLength != null) {
|
|
8082
|
-
const length = parseInt(contentLength, 10);
|
|
8083
|
-
if (!isNaN(length) && length > maxBytes) {
|
|
8084
|
-
await cancelResponseBody(response);
|
|
8085
|
-
throw new DownloadError({
|
|
8086
|
-
url,
|
|
8087
|
-
message: `Download of ${url} exceeded maximum size of ${maxBytes} bytes (Content-Length: ${length}).`
|
|
8088
|
-
});
|
|
8089
|
-
}
|
|
8090
|
-
}
|
|
8091
|
-
const body = response.body;
|
|
8092
|
-
if (body == null) return new Uint8Array(0);
|
|
8093
|
-
const reader = body.getReader();
|
|
8094
|
-
const chunks = [];
|
|
8095
|
-
let totalBytes = 0;
|
|
8096
|
-
try {
|
|
8097
|
-
while (true) {
|
|
8098
|
-
const { done, value } = await reader.read();
|
|
8099
|
-
if (done) break;
|
|
8100
|
-
totalBytes += value.length;
|
|
8101
|
-
if (totalBytes > maxBytes) throw new DownloadError({
|
|
8102
|
-
url,
|
|
8103
|
-
message: `Download of ${url} exceeded maximum size of ${maxBytes} bytes.`
|
|
8104
|
-
});
|
|
8105
|
-
chunks.push(value);
|
|
8106
|
-
}
|
|
8107
|
-
} finally {
|
|
8108
|
-
try {
|
|
8109
|
-
await reader.cancel();
|
|
8110
|
-
} finally {
|
|
8111
|
-
reader.releaseLock();
|
|
8112
|
-
}
|
|
8113
|
-
}
|
|
8114
|
-
const result = new Uint8Array(totalBytes);
|
|
8115
|
-
let offset = 0;
|
|
8116
|
-
for (const chunk of chunks) {
|
|
8117
|
-
result.set(chunk, offset);
|
|
8118
|
-
offset += chunk.length;
|
|
8119
|
-
}
|
|
8120
|
-
return result;
|
|
8121
|
-
}
|
|
8122
7928
|
var createIdGenerator = ({ prefix, size = 16, alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator = "-" } = {}) => {
|
|
8123
7929
|
const generator = () => {
|
|
8124
7930
|
const alphabetLength = alphabet.length;
|
|
@@ -8134,32 +7940,6 @@ var createIdGenerator = ({ prefix, size = 16, alphabet = "0123456789ABCDEFGHIJKL
|
|
|
8134
7940
|
return () => `${prefix}${separator}${generator()}`;
|
|
8135
7941
|
};
|
|
8136
7942
|
createIdGenerator();
|
|
8137
|
-
function getRuntimeEnvironmentUserAgent(globalThisAny = globalThis) {
|
|
8138
|
-
var _a2, _b2, _c;
|
|
8139
|
-
if (globalThisAny.window) return `runtime/browser`;
|
|
8140
|
-
if ((_a2 = globalThisAny.navigator) == null ? void 0 : _a2.userAgent) return `runtime/${globalThisAny.navigator.userAgent.toLowerCase()}`;
|
|
8141
|
-
if ((_c = (_b2 = globalThisAny.process) == null ? void 0 : _b2.versions) == null ? void 0 : _c.node) return `runtime/node.js/${globalThisAny.process.version.substring(0)}`;
|
|
8142
|
-
if (globalThisAny.EdgeRuntime) return `runtime/vercel-edge`;
|
|
8143
|
-
return "runtime/unknown";
|
|
8144
|
-
}
|
|
8145
|
-
function normalizeHeaders(headers) {
|
|
8146
|
-
if (headers == null) return {};
|
|
8147
|
-
const normalized = {};
|
|
8148
|
-
if (headers instanceof Headers) headers.forEach((value, key) => {
|
|
8149
|
-
normalized[key.toLowerCase()] = value;
|
|
8150
|
-
});
|
|
8151
|
-
else {
|
|
8152
|
-
if (!Array.isArray(headers)) headers = Object.entries(headers);
|
|
8153
|
-
for (const [key, value] of headers) if (value != null) normalized[key.toLowerCase()] = value;
|
|
8154
|
-
}
|
|
8155
|
-
return normalized;
|
|
8156
|
-
}
|
|
8157
|
-
function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
|
|
8158
|
-
const normalizedHeaders = new Headers(normalizeHeaders(headers));
|
|
8159
|
-
const currentUserAgentHeader = normalizedHeaders.get("user-agent") || "";
|
|
8160
|
-
normalizedHeaders.set("user-agent", [currentUserAgentHeader, ...userAgentSuffixParts].filter(Boolean).join(" "));
|
|
8161
|
-
return Object.fromEntries(normalizedHeaders.entries());
|
|
8162
|
-
}
|
|
8163
7943
|
function isBuffer(value) {
|
|
8164
7944
|
var _a2, _b2;
|
|
8165
7945
|
return (_b2 = (_a2 = globalThis.Buffer) == null ? void 0 : _a2.isBuffer(value)) != null ? _b2 : false;
|
|
@@ -8281,9 +8061,7 @@ function parseBigintDef(def) {
|
|
|
8281
8061
|
if (check.inclusive) res.maximum = check.value;
|
|
8282
8062
|
else res.exclusiveMaximum = check.value;
|
|
8283
8063
|
break;
|
|
8284
|
-
case "multipleOf":
|
|
8285
|
-
res.multipleOf = check.value;
|
|
8286
|
-
break;
|
|
8064
|
+
case "multipleOf": res.multipleOf = check.value;
|
|
8287
8065
|
}
|
|
8288
8066
|
return res;
|
|
8289
8067
|
}
|
|
@@ -8321,9 +8099,7 @@ var integerDateParser = (def) => {
|
|
|
8321
8099
|
case "min":
|
|
8322
8100
|
res.minimum = check.value;
|
|
8323
8101
|
break;
|
|
8324
|
-
case "max":
|
|
8325
|
-
res.maximum = check.value;
|
|
8326
|
-
break;
|
|
8102
|
+
case "max": res.maximum = check.value;
|
|
8327
8103
|
}
|
|
8328
8104
|
return res;
|
|
8329
8105
|
};
|
|
@@ -8447,9 +8223,7 @@ function parseStringDef(def, refs) {
|
|
|
8447
8223
|
case "format:idn-email":
|
|
8448
8224
|
addFormat(res, "idn-email", check.message, refs);
|
|
8449
8225
|
break;
|
|
8450
|
-
case "pattern:zod":
|
|
8451
|
-
addPattern(res, zodPatterns.email, check.message, refs);
|
|
8452
|
-
break;
|
|
8226
|
+
case "pattern:zod": addPattern(res, zodPatterns.email, check.message, refs);
|
|
8453
8227
|
}
|
|
8454
8228
|
break;
|
|
8455
8229
|
case "url":
|
|
@@ -8520,16 +8294,10 @@ function parseStringDef(def, refs) {
|
|
|
8520
8294
|
case "contentEncoding:base64":
|
|
8521
8295
|
res.contentEncoding = "base64";
|
|
8522
8296
|
break;
|
|
8523
|
-
case "pattern:zod":
|
|
8524
|
-
addPattern(res, zodPatterns.base64, check.message, refs);
|
|
8525
|
-
break;
|
|
8297
|
+
case "pattern:zod": addPattern(res, zodPatterns.base64, check.message, refs);
|
|
8526
8298
|
}
|
|
8527
8299
|
break;
|
|
8528
8300
|
case "nanoid": addPattern(res, zodPatterns.nanoid, check.message, refs);
|
|
8529
|
-
case "toLowerCase":
|
|
8530
|
-
case "toUpperCase":
|
|
8531
|
-
case "trim": break;
|
|
8532
|
-
default:
|
|
8533
8301
|
}
|
|
8534
8302
|
return res;
|
|
8535
8303
|
}
|
|
@@ -8800,9 +8568,7 @@ function parseNumberDef(def) {
|
|
|
8800
8568
|
if (check.inclusive) res.maximum = check.value;
|
|
8801
8569
|
else res.exclusiveMaximum = check.value;
|
|
8802
8570
|
break;
|
|
8803
|
-
case "multipleOf":
|
|
8804
|
-
res.multipleOf = check.value;
|
|
8805
|
-
break;
|
|
8571
|
+
case "multipleOf": res.multipleOf = check.value;
|
|
8806
8572
|
}
|
|
8807
8573
|
return res;
|
|
8808
8574
|
}
|
|
@@ -9105,13 +8871,6 @@ var zod3ToJsonSchema = (schema, options) => {
|
|
|
9105
8871
|
return combined;
|
|
9106
8872
|
};
|
|
9107
8873
|
var schemaSymbol = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
|
|
9108
|
-
function lazySchema(createSchema) {
|
|
9109
|
-
let schema;
|
|
9110
|
-
return () => {
|
|
9111
|
-
if (schema == null) schema = createSchema();
|
|
9112
|
-
return schema;
|
|
9113
|
-
};
|
|
9114
|
-
}
|
|
9115
8874
|
function jsonSchema(jsonSchema2, { validate } = {}) {
|
|
9116
8875
|
return {
|
|
9117
8876
|
[schemaSymbol]: true,
|
|
@@ -9313,40 +9072,6 @@ var UIMessageStreamError = class extends AISDKError {
|
|
|
9313
9072
|
}
|
|
9314
9073
|
};
|
|
9315
9074
|
_a16 = symbol16;
|
|
9316
|
-
var VERSION = "7.0.4";
|
|
9317
|
-
var download = async ({ url, maxBytes, abortSignal }) => {
|
|
9318
|
-
var _a22;
|
|
9319
|
-
const urlText = url.toString();
|
|
9320
|
-
try {
|
|
9321
|
-
const response = await fetchWithValidatedRedirects({
|
|
9322
|
-
url: urlText,
|
|
9323
|
-
headers: withUserAgentSuffix({}, `ai-sdk/${VERSION}`, getRuntimeEnvironmentUserAgent()),
|
|
9324
|
-
abortSignal
|
|
9325
|
-
});
|
|
9326
|
-
if (!response.ok) {
|
|
9327
|
-
await cancelResponseBody(response);
|
|
9328
|
-
throw new DownloadError({
|
|
9329
|
-
url: urlText,
|
|
9330
|
-
statusCode: response.status,
|
|
9331
|
-
statusText: response.statusText
|
|
9332
|
-
});
|
|
9333
|
-
}
|
|
9334
|
-
return {
|
|
9335
|
-
data: await readResponseWithSizeLimit({
|
|
9336
|
-
response,
|
|
9337
|
-
url: urlText,
|
|
9338
|
-
maxBytes: maxBytes != null ? maxBytes : DEFAULT_MAX_DOWNLOAD_SIZE
|
|
9339
|
-
}),
|
|
9340
|
-
mediaType: (_a22 = response.headers.get("content-type")) != null ? _a22 : void 0
|
|
9341
|
-
};
|
|
9342
|
-
} catch (error) {
|
|
9343
|
-
if (DownloadError.isInstance(error)) throw error;
|
|
9344
|
-
throw new DownloadError({
|
|
9345
|
-
url: urlText,
|
|
9346
|
-
cause: error
|
|
9347
|
-
});
|
|
9348
|
-
}
|
|
9349
|
-
};
|
|
9350
9075
|
var jsonValueSchema = lazy(() => union([
|
|
9351
9076
|
_null(),
|
|
9352
9077
|
string(),
|
|
@@ -9670,7 +9395,6 @@ function fixJson(input) {
|
|
|
9670
9395
|
stack.pop();
|
|
9671
9396
|
stack.push(swapState);
|
|
9672
9397
|
stack.push("INSIDE_ARRAY_START");
|
|
9673
|
-
break;
|
|
9674
9398
|
}
|
|
9675
9399
|
}
|
|
9676
9400
|
function processAfterObjectValue(char, i) {
|
|
@@ -9682,7 +9406,6 @@ function fixJson(input) {
|
|
|
9682
9406
|
case "}":
|
|
9683
9407
|
lastValidIndex = i;
|
|
9684
9408
|
stack.pop();
|
|
9685
|
-
break;
|
|
9686
9409
|
}
|
|
9687
9410
|
}
|
|
9688
9411
|
function processAfterArrayValue(char, i) {
|
|
@@ -9694,7 +9417,6 @@ function fixJson(input) {
|
|
|
9694
9417
|
case "]":
|
|
9695
9418
|
lastValidIndex = i;
|
|
9696
9419
|
stack.pop();
|
|
9697
|
-
break;
|
|
9698
9420
|
}
|
|
9699
9421
|
}
|
|
9700
9422
|
for (let i = 0; i < input.length; i++) {
|
|
@@ -9712,7 +9434,6 @@ function fixJson(input) {
|
|
|
9712
9434
|
case "}":
|
|
9713
9435
|
lastValidIndex = i;
|
|
9714
9436
|
stack.pop();
|
|
9715
|
-
break;
|
|
9716
9437
|
}
|
|
9717
9438
|
break;
|
|
9718
9439
|
case "INSIDE_OBJECT_AFTER_COMMA":
|
|
@@ -9720,7 +9441,6 @@ function fixJson(input) {
|
|
|
9720
9441
|
case "\"":
|
|
9721
9442
|
stack.pop();
|
|
9722
9443
|
stack.push("INSIDE_OBJECT_KEY");
|
|
9723
|
-
break;
|
|
9724
9444
|
}
|
|
9725
9445
|
break;
|
|
9726
9446
|
case "INSIDE_OBJECT_KEY":
|
|
@@ -9728,7 +9448,6 @@ function fixJson(input) {
|
|
|
9728
9448
|
case "\"":
|
|
9729
9449
|
stack.pop();
|
|
9730
9450
|
stack.push("INSIDE_OBJECT_AFTER_KEY");
|
|
9731
|
-
break;
|
|
9732
9451
|
}
|
|
9733
9452
|
break;
|
|
9734
9453
|
case "INSIDE_OBJECT_AFTER_KEY":
|
|
@@ -9736,7 +9455,6 @@ function fixJson(input) {
|
|
|
9736
9455
|
case ":":
|
|
9737
9456
|
stack.pop();
|
|
9738
9457
|
stack.push("INSIDE_OBJECT_BEFORE_VALUE");
|
|
9739
|
-
break;
|
|
9740
9458
|
}
|
|
9741
9459
|
break;
|
|
9742
9460
|
case "INSIDE_OBJECT_BEFORE_VALUE":
|
|
@@ -9766,7 +9484,6 @@ function fixJson(input) {
|
|
|
9766
9484
|
default:
|
|
9767
9485
|
lastValidIndex = i;
|
|
9768
9486
|
processValueStart(char, i, "INSIDE_ARRAY_AFTER_VALUE");
|
|
9769
|
-
break;
|
|
9770
9487
|
}
|
|
9771
9488
|
break;
|
|
9772
9489
|
case "INSIDE_ARRAY_AFTER_VALUE":
|
|
@@ -9779,9 +9496,7 @@ function fixJson(input) {
|
|
|
9779
9496
|
lastValidIndex = i;
|
|
9780
9497
|
stack.pop();
|
|
9781
9498
|
break;
|
|
9782
|
-
default:
|
|
9783
|
-
lastValidIndex = i;
|
|
9784
|
-
break;
|
|
9499
|
+
default: lastValidIndex = i;
|
|
9785
9500
|
}
|
|
9786
9501
|
break;
|
|
9787
9502
|
case "INSIDE_ARRAY_AFTER_COMMA":
|
|
@@ -9834,9 +9549,7 @@ function fixJson(input) {
|
|
|
9834
9549
|
stack.pop();
|
|
9835
9550
|
if (stack[stack.length - 1] === "INSIDE_ARRAY_AFTER_VALUE") processAfterArrayValue(char, i);
|
|
9836
9551
|
break;
|
|
9837
|
-
default:
|
|
9838
|
-
stack.pop();
|
|
9839
|
-
break;
|
|
9552
|
+
default: stack.pop();
|
|
9840
9553
|
}
|
|
9841
9554
|
break;
|
|
9842
9555
|
case "INSIDE_LITERAL": {
|
|
@@ -10148,186 +9861,7 @@ createIdGenerator({
|
|
|
10148
9861
|
size: 24
|
|
10149
9862
|
});
|
|
10150
9863
|
TransformStream;
|
|
10151
|
-
|
|
10152
|
-
lazySchema(() => zodSchema(union([
|
|
10153
|
-
strictObject({
|
|
10154
|
-
type: literal("text-start"),
|
|
10155
|
-
id: string(),
|
|
10156
|
-
providerMetadata: providerMetadataSchema.optional()
|
|
10157
|
-
}),
|
|
10158
|
-
strictObject({
|
|
10159
|
-
type: literal("text-delta"),
|
|
10160
|
-
id: string(),
|
|
10161
|
-
delta: string(),
|
|
10162
|
-
providerMetadata: providerMetadataSchema.optional()
|
|
10163
|
-
}),
|
|
10164
|
-
strictObject({
|
|
10165
|
-
type: literal("text-end"),
|
|
10166
|
-
id: string(),
|
|
10167
|
-
providerMetadata: providerMetadataSchema.optional()
|
|
10168
|
-
}),
|
|
10169
|
-
strictObject({
|
|
10170
|
-
type: literal("error"),
|
|
10171
|
-
errorText: string()
|
|
10172
|
-
}),
|
|
10173
|
-
strictObject({
|
|
10174
|
-
type: literal("tool-input-start"),
|
|
10175
|
-
toolCallId: string(),
|
|
10176
|
-
toolName: string(),
|
|
10177
|
-
providerExecuted: boolean().optional(),
|
|
10178
|
-
providerMetadata: providerMetadataSchema.optional(),
|
|
10179
|
-
toolMetadata: toolMetadataSchema.optional(),
|
|
10180
|
-
dynamic: boolean().optional(),
|
|
10181
|
-
title: string().optional()
|
|
10182
|
-
}),
|
|
10183
|
-
strictObject({
|
|
10184
|
-
type: literal("tool-input-delta"),
|
|
10185
|
-
toolCallId: string(),
|
|
10186
|
-
inputTextDelta: string()
|
|
10187
|
-
}),
|
|
10188
|
-
strictObject({
|
|
10189
|
-
type: literal("tool-input-available"),
|
|
10190
|
-
toolCallId: string(),
|
|
10191
|
-
toolName: string(),
|
|
10192
|
-
input: unknown(),
|
|
10193
|
-
providerExecuted: boolean().optional(),
|
|
10194
|
-
providerMetadata: providerMetadataSchema.optional(),
|
|
10195
|
-
toolMetadata: toolMetadataSchema.optional(),
|
|
10196
|
-
dynamic: boolean().optional(),
|
|
10197
|
-
title: string().optional()
|
|
10198
|
-
}),
|
|
10199
|
-
strictObject({
|
|
10200
|
-
type: literal("tool-input-error"),
|
|
10201
|
-
toolCallId: string(),
|
|
10202
|
-
toolName: string(),
|
|
10203
|
-
input: unknown(),
|
|
10204
|
-
providerExecuted: boolean().optional(),
|
|
10205
|
-
providerMetadata: providerMetadataSchema.optional(),
|
|
10206
|
-
toolMetadata: toolMetadataSchema.optional(),
|
|
10207
|
-
dynamic: boolean().optional(),
|
|
10208
|
-
errorText: string(),
|
|
10209
|
-
title: string().optional()
|
|
10210
|
-
}),
|
|
10211
|
-
strictObject({
|
|
10212
|
-
type: literal("tool-approval-request"),
|
|
10213
|
-
approvalId: string(),
|
|
10214
|
-
toolCallId: string(),
|
|
10215
|
-
isAutomatic: boolean().optional(),
|
|
10216
|
-
signature: string().optional()
|
|
10217
|
-
}),
|
|
10218
|
-
strictObject({
|
|
10219
|
-
type: literal("tool-approval-response"),
|
|
10220
|
-
approvalId: string(),
|
|
10221
|
-
approved: boolean(),
|
|
10222
|
-
reason: string().optional(),
|
|
10223
|
-
providerExecuted: boolean().optional(),
|
|
10224
|
-
providerMetadata: providerMetadataSchema.optional()
|
|
10225
|
-
}),
|
|
10226
|
-
strictObject({
|
|
10227
|
-
type: literal("tool-output-available"),
|
|
10228
|
-
toolCallId: string(),
|
|
10229
|
-
output: unknown(),
|
|
10230
|
-
providerExecuted: boolean().optional(),
|
|
10231
|
-
providerMetadata: providerMetadataSchema.optional(),
|
|
10232
|
-
toolMetadata: toolMetadataSchema.optional(),
|
|
10233
|
-
dynamic: boolean().optional(),
|
|
10234
|
-
preliminary: boolean().optional()
|
|
10235
|
-
}),
|
|
10236
|
-
strictObject({
|
|
10237
|
-
type: literal("tool-output-error"),
|
|
10238
|
-
toolCallId: string(),
|
|
10239
|
-
errorText: string(),
|
|
10240
|
-
providerExecuted: boolean().optional(),
|
|
10241
|
-
providerMetadata: providerMetadataSchema.optional(),
|
|
10242
|
-
toolMetadata: toolMetadataSchema.optional(),
|
|
10243
|
-
dynamic: boolean().optional()
|
|
10244
|
-
}),
|
|
10245
|
-
strictObject({
|
|
10246
|
-
type: literal("tool-output-denied"),
|
|
10247
|
-
toolCallId: string()
|
|
10248
|
-
}),
|
|
10249
|
-
strictObject({
|
|
10250
|
-
type: literal("reasoning-start"),
|
|
10251
|
-
id: string(),
|
|
10252
|
-
providerMetadata: providerMetadataSchema.optional()
|
|
10253
|
-
}),
|
|
10254
|
-
strictObject({
|
|
10255
|
-
type: literal("reasoning-delta"),
|
|
10256
|
-
id: string(),
|
|
10257
|
-
delta: string(),
|
|
10258
|
-
providerMetadata: providerMetadataSchema.optional()
|
|
10259
|
-
}),
|
|
10260
|
-
strictObject({
|
|
10261
|
-
type: literal("reasoning-end"),
|
|
10262
|
-
id: string(),
|
|
10263
|
-
providerMetadata: providerMetadataSchema.optional()
|
|
10264
|
-
}),
|
|
10265
|
-
strictObject({
|
|
10266
|
-
type: literal("custom"),
|
|
10267
|
-
kind: string().transform((value) => value),
|
|
10268
|
-
providerMetadata: providerMetadataSchema.optional()
|
|
10269
|
-
}),
|
|
10270
|
-
strictObject({
|
|
10271
|
-
type: literal("source-url"),
|
|
10272
|
-
sourceId: string(),
|
|
10273
|
-
url: string(),
|
|
10274
|
-
title: string().optional(),
|
|
10275
|
-
providerMetadata: providerMetadataSchema.optional()
|
|
10276
|
-
}),
|
|
10277
|
-
strictObject({
|
|
10278
|
-
type: literal("source-document"),
|
|
10279
|
-
sourceId: string(),
|
|
10280
|
-
mediaType: string(),
|
|
10281
|
-
title: string(),
|
|
10282
|
-
filename: string().optional(),
|
|
10283
|
-
providerMetadata: providerMetadataSchema.optional()
|
|
10284
|
-
}),
|
|
10285
|
-
strictObject({
|
|
10286
|
-
type: literal("file"),
|
|
10287
|
-
url: string(),
|
|
10288
|
-
mediaType: string(),
|
|
10289
|
-
providerMetadata: providerMetadataSchema.optional()
|
|
10290
|
-
}),
|
|
10291
|
-
strictObject({
|
|
10292
|
-
type: literal("reasoning-file"),
|
|
10293
|
-
url: string(),
|
|
10294
|
-
mediaType: string(),
|
|
10295
|
-
providerMetadata: providerMetadataSchema.optional()
|
|
10296
|
-
}),
|
|
10297
|
-
strictObject({
|
|
10298
|
-
type: custom((value) => typeof value === "string" && value.startsWith("data-"), { message: "Type must start with \"data-\"" }),
|
|
10299
|
-
id: string().optional(),
|
|
10300
|
-
data: unknown(),
|
|
10301
|
-
transient: boolean().optional()
|
|
10302
|
-
}),
|
|
10303
|
-
strictObject({ type: literal("start-step") }),
|
|
10304
|
-
strictObject({ type: literal("finish-step") }),
|
|
10305
|
-
strictObject({
|
|
10306
|
-
type: literal("start"),
|
|
10307
|
-
messageId: string().optional(),
|
|
10308
|
-
messageMetadata: unknown().optional()
|
|
10309
|
-
}),
|
|
10310
|
-
strictObject({
|
|
10311
|
-
type: literal("finish"),
|
|
10312
|
-
finishReason: _enum([
|
|
10313
|
-
"stop",
|
|
10314
|
-
"length",
|
|
10315
|
-
"content-filter",
|
|
10316
|
-
"tool-calls",
|
|
10317
|
-
"error",
|
|
10318
|
-
"other"
|
|
10319
|
-
]).optional(),
|
|
10320
|
-
messageMetadata: unknown().optional()
|
|
10321
|
-
}),
|
|
10322
|
-
strictObject({
|
|
10323
|
-
type: literal("abort"),
|
|
10324
|
-
reason: string().optional()
|
|
10325
|
-
}),
|
|
10326
|
-
strictObject({
|
|
10327
|
-
type: literal("message-metadata"),
|
|
10328
|
-
messageMetadata: unknown()
|
|
10329
|
-
})
|
|
10330
|
-
])));
|
|
9864
|
+
record(string(), jsonValueSchema.optional());
|
|
10331
9865
|
function isDataUIMessageChunk(chunk) {
|
|
10332
9866
|
return chunk.type.startsWith("data-");
|
|
10333
9867
|
}
|
|
@@ -10403,10 +9937,12 @@ function processUIMessageStream({ stream, messageMetadataSchema, dataPartSchemas
|
|
|
10403
9937
|
if (options.toolMetadata !== void 0) anyPart.toolMetadata = options.toolMetadata;
|
|
10404
9938
|
anyPart.providerExecuted = (_a23 = anyOptions.providerExecuted) != null ? _a23 : part.providerExecuted;
|
|
10405
9939
|
const providerMetadata = anyOptions.providerMetadata;
|
|
10406
|
-
if (providerMetadata != null)
|
|
10407
|
-
|
|
10408
|
-
|
|
10409
|
-
|
|
9940
|
+
if (providerMetadata != null) {
|
|
9941
|
+
if (options.state === "output-available" || options.state === "output-error") {
|
|
9942
|
+
const resultPart = part;
|
|
9943
|
+
resultPart.resultProviderMetadata = providerMetadata;
|
|
9944
|
+
} else part.callProviderMetadata = providerMetadata;
|
|
9945
|
+
}
|
|
10410
9946
|
} else state.message.parts.push({
|
|
10411
9947
|
type: `tool-${options.toolName}`,
|
|
10412
9948
|
toolCallId: options.toolCallId,
|
|
@@ -10440,10 +9976,12 @@ function processUIMessageStream({ stream, messageMetadataSchema, dataPartSchemas
|
|
|
10440
9976
|
if (options.toolMetadata !== void 0) anyPart.toolMetadata = options.toolMetadata;
|
|
10441
9977
|
anyPart.providerExecuted = (_b2 = anyOptions.providerExecuted) != null ? _b2 : part.providerExecuted;
|
|
10442
9978
|
const providerMetadata = anyOptions.providerMetadata;
|
|
10443
|
-
if (providerMetadata != null)
|
|
10444
|
-
|
|
10445
|
-
|
|
10446
|
-
|
|
9979
|
+
if (providerMetadata != null) {
|
|
9980
|
+
if (options.state === "output-available" || options.state === "output-error") {
|
|
9981
|
+
const resultPart = part;
|
|
9982
|
+
resultPart.resultProviderMetadata = providerMetadata;
|
|
9983
|
+
} else part.callProviderMetadata = providerMetadata;
|
|
9984
|
+
}
|
|
10447
9985
|
} else state.message.parts.push({
|
|
10448
9986
|
type: "dynamic-tool",
|
|
10449
9987
|
toolName: options.toolName,
|
|
@@ -10976,314 +10514,8 @@ function readUIMessageStream({ message, stream, onError, terminateOnError = fals
|
|
|
10976
10514
|
});
|
|
10977
10515
|
return createAsyncIterableStream(outputStream);
|
|
10978
10516
|
}
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
lazySchema(() => zodSchema(array$1(object$1({
|
|
10982
|
-
id: string(),
|
|
10983
|
-
role: _enum([
|
|
10984
|
-
"system",
|
|
10985
|
-
"user",
|
|
10986
|
-
"assistant"
|
|
10987
|
-
]),
|
|
10988
|
-
metadata: unknown().optional(),
|
|
10989
|
-
parts: array$1(union([
|
|
10990
|
-
object$1({
|
|
10991
|
-
type: literal("text"),
|
|
10992
|
-
text: string(),
|
|
10993
|
-
state: _enum(["streaming", "done"]).optional(),
|
|
10994
|
-
providerMetadata: providerMetadataSchema.optional()
|
|
10995
|
-
}),
|
|
10996
|
-
object$1({
|
|
10997
|
-
type: literal("reasoning"),
|
|
10998
|
-
text: string(),
|
|
10999
|
-
state: _enum(["streaming", "done"]).optional(),
|
|
11000
|
-
providerMetadata: providerMetadataSchema.optional()
|
|
11001
|
-
}),
|
|
11002
|
-
object$1({
|
|
11003
|
-
type: literal("custom"),
|
|
11004
|
-
kind: string(),
|
|
11005
|
-
providerMetadata: providerMetadataSchema.optional()
|
|
11006
|
-
}),
|
|
11007
|
-
object$1({
|
|
11008
|
-
type: literal("source-url"),
|
|
11009
|
-
sourceId: string(),
|
|
11010
|
-
url: string(),
|
|
11011
|
-
title: string().optional(),
|
|
11012
|
-
providerMetadata: providerMetadataSchema.optional()
|
|
11013
|
-
}),
|
|
11014
|
-
object$1({
|
|
11015
|
-
type: literal("source-document"),
|
|
11016
|
-
sourceId: string(),
|
|
11017
|
-
mediaType: string(),
|
|
11018
|
-
title: string(),
|
|
11019
|
-
filename: string().optional(),
|
|
11020
|
-
providerMetadata: providerMetadataSchema.optional()
|
|
11021
|
-
}),
|
|
11022
|
-
object$1({
|
|
11023
|
-
type: literal("file"),
|
|
11024
|
-
mediaType: string(),
|
|
11025
|
-
filename: string().optional(),
|
|
11026
|
-
url: string(),
|
|
11027
|
-
providerReference: providerReferenceSchema2.optional(),
|
|
11028
|
-
providerMetadata: providerMetadataSchema.optional()
|
|
11029
|
-
}),
|
|
11030
|
-
object$1({
|
|
11031
|
-
type: literal("reasoning-file"),
|
|
11032
|
-
mediaType: string(),
|
|
11033
|
-
url: string(),
|
|
11034
|
-
providerMetadata: providerMetadataSchema.optional()
|
|
11035
|
-
}),
|
|
11036
|
-
object$1({ type: literal("step-start") }),
|
|
11037
|
-
object$1({
|
|
11038
|
-
type: string().startsWith("data-"),
|
|
11039
|
-
id: string().optional(),
|
|
11040
|
-
data: unknown()
|
|
11041
|
-
}),
|
|
11042
|
-
object$1({
|
|
11043
|
-
type: literal("dynamic-tool"),
|
|
11044
|
-
toolName: string(),
|
|
11045
|
-
toolCallId: string(),
|
|
11046
|
-
toolMetadata: toolMetadataSchema2.optional(),
|
|
11047
|
-
state: literal("input-streaming"),
|
|
11048
|
-
input: unknown().optional(),
|
|
11049
|
-
providerExecuted: boolean().optional(),
|
|
11050
|
-
callProviderMetadata: providerMetadataSchema.optional(),
|
|
11051
|
-
output: never().optional(),
|
|
11052
|
-
errorText: never().optional(),
|
|
11053
|
-
approval: never().optional()
|
|
11054
|
-
}),
|
|
11055
|
-
object$1({
|
|
11056
|
-
type: literal("dynamic-tool"),
|
|
11057
|
-
toolName: string(),
|
|
11058
|
-
toolCallId: string(),
|
|
11059
|
-
toolMetadata: toolMetadataSchema2.optional(),
|
|
11060
|
-
state: literal("input-available"),
|
|
11061
|
-
input: unknown(),
|
|
11062
|
-
providerExecuted: boolean().optional(),
|
|
11063
|
-
output: never().optional(),
|
|
11064
|
-
errorText: never().optional(),
|
|
11065
|
-
callProviderMetadata: providerMetadataSchema.optional(),
|
|
11066
|
-
approval: never().optional()
|
|
11067
|
-
}),
|
|
11068
|
-
object$1({
|
|
11069
|
-
type: literal("dynamic-tool"),
|
|
11070
|
-
toolName: string(),
|
|
11071
|
-
toolCallId: string(),
|
|
11072
|
-
toolMetadata: toolMetadataSchema2.optional(),
|
|
11073
|
-
state: literal("approval-requested"),
|
|
11074
|
-
input: unknown(),
|
|
11075
|
-
providerExecuted: boolean().optional(),
|
|
11076
|
-
output: never().optional(),
|
|
11077
|
-
errorText: never().optional(),
|
|
11078
|
-
callProviderMetadata: providerMetadataSchema.optional(),
|
|
11079
|
-
approval: object$1({
|
|
11080
|
-
id: string(),
|
|
11081
|
-
approved: never().optional(),
|
|
11082
|
-
reason: never().optional(),
|
|
11083
|
-
isAutomatic: boolean().optional(),
|
|
11084
|
-
signature: string().optional()
|
|
11085
|
-
})
|
|
11086
|
-
}),
|
|
11087
|
-
object$1({
|
|
11088
|
-
type: literal("dynamic-tool"),
|
|
11089
|
-
toolName: string(),
|
|
11090
|
-
toolCallId: string(),
|
|
11091
|
-
toolMetadata: toolMetadataSchema2.optional(),
|
|
11092
|
-
state: literal("approval-responded"),
|
|
11093
|
-
input: unknown(),
|
|
11094
|
-
providerExecuted: boolean().optional(),
|
|
11095
|
-
output: never().optional(),
|
|
11096
|
-
errorText: never().optional(),
|
|
11097
|
-
callProviderMetadata: providerMetadataSchema.optional(),
|
|
11098
|
-
approval: object$1({
|
|
11099
|
-
id: string(),
|
|
11100
|
-
approved: boolean(),
|
|
11101
|
-
reason: string().optional(),
|
|
11102
|
-
isAutomatic: boolean().optional(),
|
|
11103
|
-
signature: string().optional()
|
|
11104
|
-
})
|
|
11105
|
-
}),
|
|
11106
|
-
object$1({
|
|
11107
|
-
type: literal("dynamic-tool"),
|
|
11108
|
-
toolName: string(),
|
|
11109
|
-
toolCallId: string(),
|
|
11110
|
-
toolMetadata: toolMetadataSchema2.optional(),
|
|
11111
|
-
state: literal("output-available"),
|
|
11112
|
-
input: unknown(),
|
|
11113
|
-
providerExecuted: boolean().optional(),
|
|
11114
|
-
output: unknown(),
|
|
11115
|
-
errorText: never().optional(),
|
|
11116
|
-
callProviderMetadata: providerMetadataSchema.optional(),
|
|
11117
|
-
resultProviderMetadata: providerMetadataSchema.optional(),
|
|
11118
|
-
preliminary: boolean().optional(),
|
|
11119
|
-
approval: object$1({
|
|
11120
|
-
id: string(),
|
|
11121
|
-
approved: literal(true),
|
|
11122
|
-
reason: string().optional(),
|
|
11123
|
-
isAutomatic: boolean().optional(),
|
|
11124
|
-
signature: string().optional()
|
|
11125
|
-
}).optional()
|
|
11126
|
-
}),
|
|
11127
|
-
object$1({
|
|
11128
|
-
type: literal("dynamic-tool"),
|
|
11129
|
-
toolName: string(),
|
|
11130
|
-
toolCallId: string(),
|
|
11131
|
-
toolMetadata: toolMetadataSchema2.optional(),
|
|
11132
|
-
state: literal("output-error"),
|
|
11133
|
-
input: unknown().optional(),
|
|
11134
|
-
rawInput: unknown().optional(),
|
|
11135
|
-
providerExecuted: boolean().optional(),
|
|
11136
|
-
output: never().optional(),
|
|
11137
|
-
errorText: string(),
|
|
11138
|
-
callProviderMetadata: providerMetadataSchema.optional(),
|
|
11139
|
-
resultProviderMetadata: providerMetadataSchema.optional(),
|
|
11140
|
-
approval: object$1({
|
|
11141
|
-
id: string(),
|
|
11142
|
-
approved: literal(true),
|
|
11143
|
-
reason: string().optional(),
|
|
11144
|
-
isAutomatic: boolean().optional(),
|
|
11145
|
-
signature: string().optional()
|
|
11146
|
-
}).optional()
|
|
11147
|
-
}),
|
|
11148
|
-
object$1({
|
|
11149
|
-
type: literal("dynamic-tool"),
|
|
11150
|
-
toolName: string(),
|
|
11151
|
-
toolCallId: string(),
|
|
11152
|
-
toolMetadata: toolMetadataSchema2.optional(),
|
|
11153
|
-
state: literal("output-denied"),
|
|
11154
|
-
input: unknown(),
|
|
11155
|
-
providerExecuted: boolean().optional(),
|
|
11156
|
-
output: never().optional(),
|
|
11157
|
-
errorText: never().optional(),
|
|
11158
|
-
callProviderMetadata: providerMetadataSchema.optional(),
|
|
11159
|
-
approval: object$1({
|
|
11160
|
-
id: string(),
|
|
11161
|
-
approved: literal(false),
|
|
11162
|
-
reason: string().optional(),
|
|
11163
|
-
isAutomatic: boolean().optional(),
|
|
11164
|
-
signature: string().optional()
|
|
11165
|
-
})
|
|
11166
|
-
}),
|
|
11167
|
-
object$1({
|
|
11168
|
-
type: string().startsWith("tool-"),
|
|
11169
|
-
toolCallId: string(),
|
|
11170
|
-
toolMetadata: toolMetadataSchema2.optional(),
|
|
11171
|
-
state: literal("input-streaming"),
|
|
11172
|
-
providerExecuted: boolean().optional(),
|
|
11173
|
-
callProviderMetadata: providerMetadataSchema.optional(),
|
|
11174
|
-
input: unknown().optional(),
|
|
11175
|
-
output: never().optional(),
|
|
11176
|
-
errorText: never().optional(),
|
|
11177
|
-
approval: never().optional()
|
|
11178
|
-
}),
|
|
11179
|
-
object$1({
|
|
11180
|
-
type: string().startsWith("tool-"),
|
|
11181
|
-
toolCallId: string(),
|
|
11182
|
-
toolMetadata: toolMetadataSchema2.optional(),
|
|
11183
|
-
state: literal("input-available"),
|
|
11184
|
-
providerExecuted: boolean().optional(),
|
|
11185
|
-
input: unknown(),
|
|
11186
|
-
output: never().optional(),
|
|
11187
|
-
errorText: never().optional(),
|
|
11188
|
-
callProviderMetadata: providerMetadataSchema.optional(),
|
|
11189
|
-
approval: never().optional()
|
|
11190
|
-
}),
|
|
11191
|
-
object$1({
|
|
11192
|
-
type: string().startsWith("tool-"),
|
|
11193
|
-
toolCallId: string(),
|
|
11194
|
-
toolMetadata: toolMetadataSchema2.optional(),
|
|
11195
|
-
state: literal("approval-requested"),
|
|
11196
|
-
input: unknown(),
|
|
11197
|
-
providerExecuted: boolean().optional(),
|
|
11198
|
-
output: never().optional(),
|
|
11199
|
-
errorText: never().optional(),
|
|
11200
|
-
callProviderMetadata: providerMetadataSchema.optional(),
|
|
11201
|
-
approval: object$1({
|
|
11202
|
-
id: string(),
|
|
11203
|
-
approved: never().optional(),
|
|
11204
|
-
reason: never().optional(),
|
|
11205
|
-
isAutomatic: boolean().optional(),
|
|
11206
|
-
signature: string().optional()
|
|
11207
|
-
})
|
|
11208
|
-
}),
|
|
11209
|
-
object$1({
|
|
11210
|
-
type: string().startsWith("tool-"),
|
|
11211
|
-
toolCallId: string(),
|
|
11212
|
-
toolMetadata: toolMetadataSchema2.optional(),
|
|
11213
|
-
state: literal("approval-responded"),
|
|
11214
|
-
input: unknown(),
|
|
11215
|
-
providerExecuted: boolean().optional(),
|
|
11216
|
-
output: never().optional(),
|
|
11217
|
-
errorText: never().optional(),
|
|
11218
|
-
callProviderMetadata: providerMetadataSchema.optional(),
|
|
11219
|
-
approval: object$1({
|
|
11220
|
-
id: string(),
|
|
11221
|
-
approved: boolean(),
|
|
11222
|
-
reason: string().optional(),
|
|
11223
|
-
isAutomatic: boolean().optional(),
|
|
11224
|
-
signature: string().optional()
|
|
11225
|
-
})
|
|
11226
|
-
}),
|
|
11227
|
-
object$1({
|
|
11228
|
-
type: string().startsWith("tool-"),
|
|
11229
|
-
toolCallId: string(),
|
|
11230
|
-
toolMetadata: toolMetadataSchema2.optional(),
|
|
11231
|
-
state: literal("output-available"),
|
|
11232
|
-
providerExecuted: boolean().optional(),
|
|
11233
|
-
input: unknown(),
|
|
11234
|
-
output: unknown(),
|
|
11235
|
-
errorText: never().optional(),
|
|
11236
|
-
callProviderMetadata: providerMetadataSchema.optional(),
|
|
11237
|
-
resultProviderMetadata: providerMetadataSchema.optional(),
|
|
11238
|
-
preliminary: boolean().optional(),
|
|
11239
|
-
approval: object$1({
|
|
11240
|
-
id: string(),
|
|
11241
|
-
approved: literal(true),
|
|
11242
|
-
reason: string().optional(),
|
|
11243
|
-
isAutomatic: boolean().optional(),
|
|
11244
|
-
signature: string().optional()
|
|
11245
|
-
}).optional()
|
|
11246
|
-
}),
|
|
11247
|
-
object$1({
|
|
11248
|
-
type: string().startsWith("tool-"),
|
|
11249
|
-
toolCallId: string(),
|
|
11250
|
-
toolMetadata: toolMetadataSchema2.optional(),
|
|
11251
|
-
state: literal("output-error"),
|
|
11252
|
-
providerExecuted: boolean().optional(),
|
|
11253
|
-
input: unknown().optional(),
|
|
11254
|
-
rawInput: unknown().optional(),
|
|
11255
|
-
output: never().optional(),
|
|
11256
|
-
errorText: string(),
|
|
11257
|
-
callProviderMetadata: providerMetadataSchema.optional(),
|
|
11258
|
-
resultProviderMetadata: providerMetadataSchema.optional(),
|
|
11259
|
-
approval: object$1({
|
|
11260
|
-
id: string(),
|
|
11261
|
-
approved: literal(true),
|
|
11262
|
-
reason: string().optional(),
|
|
11263
|
-
isAutomatic: boolean().optional(),
|
|
11264
|
-
signature: string().optional()
|
|
11265
|
-
}).optional()
|
|
11266
|
-
}),
|
|
11267
|
-
object$1({
|
|
11268
|
-
type: string().startsWith("tool-"),
|
|
11269
|
-
toolCallId: string(),
|
|
11270
|
-
toolMetadata: toolMetadataSchema2.optional(),
|
|
11271
|
-
state: literal("output-denied"),
|
|
11272
|
-
providerExecuted: boolean().optional(),
|
|
11273
|
-
input: unknown(),
|
|
11274
|
-
output: never().optional(),
|
|
11275
|
-
errorText: never().optional(),
|
|
11276
|
-
callProviderMetadata: providerMetadataSchema.optional(),
|
|
11277
|
-
approval: object$1({
|
|
11278
|
-
id: string(),
|
|
11279
|
-
approved: literal(false),
|
|
11280
|
-
reason: string().optional(),
|
|
11281
|
-
isAutomatic: boolean().optional(),
|
|
11282
|
-
signature: string().optional()
|
|
11283
|
-
})
|
|
11284
|
-
})
|
|
11285
|
-
])).nonempty("Message must contain at least one part")
|
|
11286
|
-
})).nonempty("Messages array must not be empty")));
|
|
10517
|
+
record(string(), jsonValueSchema.optional());
|
|
10518
|
+
record(string(), string());
|
|
11287
10519
|
createIdGenerator({
|
|
11288
10520
|
prefix: "call",
|
|
11289
10521
|
size: 24
|
|
@@ -11296,23 +10528,14 @@ createIdGenerator({
|
|
|
11296
10528
|
prefix: "aiobj",
|
|
11297
10529
|
size: 24
|
|
11298
10530
|
});
|
|
11299
|
-
function createDownload(options) {
|
|
11300
|
-
return ({ url, abortSignal }) => download({
|
|
11301
|
-
url,
|
|
11302
|
-
maxBytes: options == null ? void 0 : options.maxBytes,
|
|
11303
|
-
abortSignal
|
|
11304
|
-
});
|
|
11305
|
-
}
|
|
11306
10531
|
createIdGenerator({
|
|
11307
10532
|
prefix: "aiobj",
|
|
11308
10533
|
size: 24
|
|
11309
10534
|
});
|
|
11310
|
-
createDownload();
|
|
11311
10535
|
createIdGenerator({
|
|
11312
10536
|
prefix: "call",
|
|
11313
10537
|
size: 24
|
|
11314
10538
|
});
|
|
11315
|
-
createDownload();
|
|
11316
10539
|
//#endregion
|
|
11317
10540
|
//#region src/conformance.test.ts
|
|
11318
10541
|
/**
|