@critical-path/svelte 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +34 -2
- package/dist/deliverable-summary-state.svelte.d.ts +14 -0
- package/dist/deliverable-summary-state.svelte.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +622 -455
- package/dist/kanban-state.svelte.d.ts +24 -0
- package/dist/kanban-state.svelte.d.ts.map +1 -0
- package/dist/task-transitions-state.svelte.d.ts +12 -0
- package/dist/task-transitions-state.svelte.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/deliverable-summary-state.svelte.ts +41 -0
- package/src/index.test.ts +114 -0
- package/src/index.ts +4 -0
- package/src/kanban-state.svelte.ts +112 -0
- package/src/task-transitions-state.svelte.ts +36 -0
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { CriticalPathClient as e } from "@critical-path/client";
|
|
2
2
|
import * as t from "svelte/internal/client";
|
|
3
|
+
import { resolveStatusDefinition as n } from "@critical-path/core";
|
|
3
4
|
//#region src/project-state.svelte.ts
|
|
4
|
-
var
|
|
5
|
+
var r = class {
|
|
5
6
|
client;
|
|
6
7
|
#e = t.state(t.proxy([]));
|
|
7
8
|
get data() {
|
|
@@ -55,12 +56,12 @@ var n = class {
|
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
};
|
|
58
|
-
function
|
|
59
|
-
return new
|
|
59
|
+
function i(e) {
|
|
60
|
+
return new r(e);
|
|
60
61
|
}
|
|
61
62
|
//#endregion
|
|
62
63
|
//#region src/task-state.svelte.ts
|
|
63
|
-
var
|
|
64
|
+
var a = class {
|
|
64
65
|
client;
|
|
65
66
|
projectId;
|
|
66
67
|
#e = t.state(t.proxy([]));
|
|
@@ -181,12 +182,12 @@ var i = class {
|
|
|
181
182
|
}
|
|
182
183
|
}
|
|
183
184
|
};
|
|
184
|
-
function
|
|
185
|
-
return new
|
|
185
|
+
function o(e, t) {
|
|
186
|
+
return new a(e, t);
|
|
186
187
|
}
|
|
187
188
|
//#endregion
|
|
188
189
|
//#region src/workflow-state.svelte.ts
|
|
189
|
-
var
|
|
190
|
+
var s = class {
|
|
190
191
|
client;
|
|
191
192
|
#e = t.state(t.proxy([]));
|
|
192
193
|
get data() {
|
|
@@ -249,12 +250,12 @@ var o = class {
|
|
|
249
250
|
}
|
|
250
251
|
}
|
|
251
252
|
};
|
|
252
|
-
function
|
|
253
|
-
return new
|
|
253
|
+
function c(e) {
|
|
254
|
+
return new s(e);
|
|
254
255
|
}
|
|
255
256
|
//#endregion
|
|
256
257
|
//#region src/comment-state.svelte.ts
|
|
257
|
-
var
|
|
258
|
+
var ee = class {
|
|
258
259
|
client;
|
|
259
260
|
taskId;
|
|
260
261
|
#e = t.state(t.proxy([]));
|
|
@@ -372,12 +373,12 @@ var c = class {
|
|
|
372
373
|
}
|
|
373
374
|
}
|
|
374
375
|
};
|
|
375
|
-
function
|
|
376
|
-
return new
|
|
376
|
+
function te(e, t) {
|
|
377
|
+
return new ee(e, t);
|
|
377
378
|
}
|
|
378
379
|
//#endregion
|
|
379
380
|
//#region src/attachment-state.svelte.ts
|
|
380
|
-
var
|
|
381
|
+
var ne = class {
|
|
381
382
|
client;
|
|
382
383
|
filter;
|
|
383
384
|
#e = t.state(t.proxy([]));
|
|
@@ -435,12 +436,12 @@ var te = class {
|
|
|
435
436
|
}
|
|
436
437
|
}
|
|
437
438
|
};
|
|
438
|
-
function
|
|
439
|
-
return new
|
|
439
|
+
function re(e, t) {
|
|
440
|
+
return new ne(e, t);
|
|
440
441
|
}
|
|
441
442
|
//#endregion
|
|
442
443
|
//#region src/activity-state.svelte.ts
|
|
443
|
-
var
|
|
444
|
+
var ie = class {
|
|
444
445
|
client;
|
|
445
446
|
taskId;
|
|
446
447
|
#e = t.state(t.proxy([]));
|
|
@@ -597,12 +598,12 @@ var re = class {
|
|
|
597
598
|
}
|
|
598
599
|
}
|
|
599
600
|
};
|
|
600
|
-
function
|
|
601
|
-
return new
|
|
601
|
+
function ae(e, t) {
|
|
602
|
+
return new ie(e, t);
|
|
602
603
|
}
|
|
603
604
|
//#endregion
|
|
604
605
|
//#region src/deliverable-state.svelte.ts
|
|
605
|
-
var
|
|
606
|
+
var oe = class {
|
|
606
607
|
client;
|
|
607
608
|
projectId;
|
|
608
609
|
#e = t.state(t.proxy([]));
|
|
@@ -680,8 +681,174 @@ var ae = class {
|
|
|
680
681
|
return this.client.getDeliverableSummary(e);
|
|
681
682
|
}
|
|
682
683
|
};
|
|
683
|
-
function
|
|
684
|
-
return new
|
|
684
|
+
function se(e, t) {
|
|
685
|
+
return new oe(e, t);
|
|
686
|
+
}
|
|
687
|
+
//#endregion
|
|
688
|
+
//#region src/deliverable-summary-state.svelte.ts
|
|
689
|
+
var ce = class {
|
|
690
|
+
client;
|
|
691
|
+
deliverableId;
|
|
692
|
+
#e = t.state(null);
|
|
693
|
+
get summary() {
|
|
694
|
+
return t.get(this.#e);
|
|
695
|
+
}
|
|
696
|
+
set summary(e) {
|
|
697
|
+
t.set(this.#e, e, !0);
|
|
698
|
+
}
|
|
699
|
+
#t = t.state(!1);
|
|
700
|
+
get loading() {
|
|
701
|
+
return t.get(this.#t);
|
|
702
|
+
}
|
|
703
|
+
set loading(e) {
|
|
704
|
+
t.set(this.#t, e, !0);
|
|
705
|
+
}
|
|
706
|
+
#n = t.state(null);
|
|
707
|
+
get error() {
|
|
708
|
+
return t.get(this.#n);
|
|
709
|
+
}
|
|
710
|
+
set error(e) {
|
|
711
|
+
t.set(this.#n, e, !0);
|
|
712
|
+
}
|
|
713
|
+
get data() {
|
|
714
|
+
return this.summary;
|
|
715
|
+
}
|
|
716
|
+
constructor(e, t) {
|
|
717
|
+
this.client = e, this.deliverableId = t;
|
|
718
|
+
}
|
|
719
|
+
async fetch(e) {
|
|
720
|
+
let t = e || this.deliverableId;
|
|
721
|
+
if (!t) {
|
|
722
|
+
this.summary = null, this.loading = !1;
|
|
723
|
+
return;
|
|
724
|
+
}
|
|
725
|
+
this.deliverableId = t, this.loading = !0, this.error = null;
|
|
726
|
+
try {
|
|
727
|
+
this.summary = await this.client.getDeliverableSummary(t);
|
|
728
|
+
} catch (e) {
|
|
729
|
+
this.error = e instanceof Error ? e : Error(String(e));
|
|
730
|
+
} finally {
|
|
731
|
+
this.loading = !1;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
};
|
|
735
|
+
function le(e, t) {
|
|
736
|
+
return new ce(e, t);
|
|
737
|
+
}
|
|
738
|
+
//#endregion
|
|
739
|
+
//#region src/kanban-state.svelte.ts
|
|
740
|
+
var ue = class {
|
|
741
|
+
projectId;
|
|
742
|
+
options;
|
|
743
|
+
taskState;
|
|
744
|
+
get data() {
|
|
745
|
+
return this.taskState.data;
|
|
746
|
+
}
|
|
747
|
+
get tasks() {
|
|
748
|
+
return this.taskState.data;
|
|
749
|
+
}
|
|
750
|
+
get loading() {
|
|
751
|
+
return this.taskState.loading;
|
|
752
|
+
}
|
|
753
|
+
get error() {
|
|
754
|
+
return this.taskState.error;
|
|
755
|
+
}
|
|
756
|
+
#e = t.derived(() => {
|
|
757
|
+
let e = this.taskState.data;
|
|
758
|
+
if (this.options?.groupBy === "semantic") {
|
|
759
|
+
let t = {
|
|
760
|
+
not_started: [],
|
|
761
|
+
in_progress: [],
|
|
762
|
+
completed: [],
|
|
763
|
+
canceled: []
|
|
764
|
+
};
|
|
765
|
+
for (let r of e) {
|
|
766
|
+
let e = r.semanticStatus || n(r.status, this.options?.customDefinitions).category;
|
|
767
|
+
t[e] ? t[e].push(r) : t.not_started.push(r);
|
|
768
|
+
}
|
|
769
|
+
return t;
|
|
770
|
+
}
|
|
771
|
+
let t = {};
|
|
772
|
+
if (this.options?.customDefinitions && this.options.customDefinitions.length > 0) for (let e of this.options.customDefinitions) t[e.key] = [];
|
|
773
|
+
else t.backlog = [], t.todo = [], t.in_progress = [], t.in_review = [], t.done = [], t.canceled = [];
|
|
774
|
+
for (let n of e) t[n.status] || (t[n.status] = []), t[n.status].push(n);
|
|
775
|
+
return t;
|
|
776
|
+
});
|
|
777
|
+
get columns() {
|
|
778
|
+
return t.get(this.#e);
|
|
779
|
+
}
|
|
780
|
+
set columns(e) {
|
|
781
|
+
t.set(this.#e, e);
|
|
782
|
+
}
|
|
783
|
+
constructor(e, t, n = {}) {
|
|
784
|
+
this.projectId = t, this.options = n, this.taskState = new a(e, t);
|
|
785
|
+
}
|
|
786
|
+
async fetch() {
|
|
787
|
+
return this.taskState.fetch();
|
|
788
|
+
}
|
|
789
|
+
async createTask(e) {
|
|
790
|
+
return this.taskState.createTask(e);
|
|
791
|
+
}
|
|
792
|
+
async moveTask(e, t) {
|
|
793
|
+
return this.taskState.updateTaskStatus(e, t);
|
|
794
|
+
}
|
|
795
|
+
async updateTaskStatus(e, t) {
|
|
796
|
+
return this.taskState.updateTaskStatus(e, t);
|
|
797
|
+
}
|
|
798
|
+
async deleteTask(e) {
|
|
799
|
+
return this.taskState.deleteTask(e);
|
|
800
|
+
}
|
|
801
|
+
};
|
|
802
|
+
function de(e, t, n) {
|
|
803
|
+
return new ue(e, t, n);
|
|
804
|
+
}
|
|
805
|
+
//#endregion
|
|
806
|
+
//#region src/task-transitions-state.svelte.ts
|
|
807
|
+
var fe = class {
|
|
808
|
+
client;
|
|
809
|
+
taskId;
|
|
810
|
+
#e = t.state(t.proxy([]));
|
|
811
|
+
get allowedTransitions() {
|
|
812
|
+
return t.get(this.#e);
|
|
813
|
+
}
|
|
814
|
+
set allowedTransitions(e) {
|
|
815
|
+
t.set(this.#e, e, !0);
|
|
816
|
+
}
|
|
817
|
+
#t = t.state(!1);
|
|
818
|
+
get loading() {
|
|
819
|
+
return t.get(this.#t);
|
|
820
|
+
}
|
|
821
|
+
set loading(e) {
|
|
822
|
+
t.set(this.#t, e, !0);
|
|
823
|
+
}
|
|
824
|
+
#n = t.state(null);
|
|
825
|
+
get error() {
|
|
826
|
+
return t.get(this.#n);
|
|
827
|
+
}
|
|
828
|
+
set error(e) {
|
|
829
|
+
t.set(this.#n, e, !0);
|
|
830
|
+
}
|
|
831
|
+
constructor(e, t) {
|
|
832
|
+
this.client = e, this.taskId = t;
|
|
833
|
+
}
|
|
834
|
+
async fetch(e) {
|
|
835
|
+
let t = e || this.taskId;
|
|
836
|
+
if (!t) {
|
|
837
|
+
this.allowedTransitions = [], this.loading = !1;
|
|
838
|
+
return;
|
|
839
|
+
}
|
|
840
|
+
this.taskId = t, this.loading = !0, this.error = null;
|
|
841
|
+
try {
|
|
842
|
+
this.allowedTransitions = await this.client.getAllowedTaskTransitions(t);
|
|
843
|
+
} catch (e) {
|
|
844
|
+
this.error = e instanceof Error ? e : Error(String(e));
|
|
845
|
+
} finally {
|
|
846
|
+
this.loading = !1;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
};
|
|
850
|
+
function pe(e, t) {
|
|
851
|
+
return new fe(e, t);
|
|
685
852
|
}
|
|
686
853
|
//#endregion
|
|
687
854
|
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js
|
|
@@ -715,13 +882,13 @@ var l;
|
|
|
715
882
|
}
|
|
716
883
|
e.joinValues = r, e.jsonStringifyReplacer = (e, t) => typeof t == "bigint" ? t.toString() : t;
|
|
717
884
|
})(l ||= {});
|
|
718
|
-
var
|
|
885
|
+
var me;
|
|
719
886
|
(function(e) {
|
|
720
887
|
e.mergeShapes = (e, t) => ({
|
|
721
888
|
...e,
|
|
722
889
|
...t
|
|
723
890
|
});
|
|
724
|
-
})(
|
|
891
|
+
})(me ||= {});
|
|
725
892
|
var u = l.arrayToEnum([
|
|
726
893
|
"string",
|
|
727
894
|
"nan",
|
|
@@ -887,13 +1054,13 @@ var m = (e, t) => {
|
|
|
887
1054
|
default: n = t.defaultError, l.assertNever(e);
|
|
888
1055
|
}
|
|
889
1056
|
return { message: n };
|
|
890
|
-
},
|
|
891
|
-
function
|
|
892
|
-
return
|
|
1057
|
+
}, he = m;
|
|
1058
|
+
function ge() {
|
|
1059
|
+
return he;
|
|
893
1060
|
}
|
|
894
1061
|
//#endregion
|
|
895
1062
|
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
896
|
-
var
|
|
1063
|
+
var h = (e) => {
|
|
897
1064
|
let { data: t, path: n, errorMaps: r, issueData: i } = e, a = [...n, ...i.path || []], o = {
|
|
898
1065
|
...i,
|
|
899
1066
|
path: a
|
|
@@ -914,8 +1081,8 @@ var ue = (e) => {
|
|
|
914
1081
|
message: s
|
|
915
1082
|
};
|
|
916
1083
|
};
|
|
917
|
-
function
|
|
918
|
-
let n =
|
|
1084
|
+
function g(e, t) {
|
|
1085
|
+
let n = ge(), r = h({
|
|
919
1086
|
issueData: t,
|
|
920
1087
|
data: e.data,
|
|
921
1088
|
path: e.path,
|
|
@@ -928,7 +1095,7 @@ function h(e, t) {
|
|
|
928
1095
|
});
|
|
929
1096
|
e.common.issues.push(r);
|
|
930
1097
|
}
|
|
931
|
-
var
|
|
1098
|
+
var _ = class e {
|
|
932
1099
|
constructor() {
|
|
933
1100
|
this.value = "valid";
|
|
934
1101
|
}
|
|
@@ -941,7 +1108,7 @@ var g = class e {
|
|
|
941
1108
|
static mergeArray(e, t) {
|
|
942
1109
|
let n = [];
|
|
943
1110
|
for (let r of t) {
|
|
944
|
-
if (r.status === "aborted") return
|
|
1111
|
+
if (r.status === "aborted") return v;
|
|
945
1112
|
r.status === "dirty" && e.dirty(), n.push(r.value);
|
|
946
1113
|
}
|
|
947
1114
|
return {
|
|
@@ -964,7 +1131,7 @@ var g = class e {
|
|
|
964
1131
|
let n = {};
|
|
965
1132
|
for (let r of t) {
|
|
966
1133
|
let { key: t, value: i } = r;
|
|
967
|
-
if (t.status === "aborted" || i.status === "aborted") return
|
|
1134
|
+
if (t.status === "aborted" || i.status === "aborted") return v;
|
|
968
1135
|
t.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), t.value !== "__proto__" && (i.value !== void 0 || r.alwaysSet) && (n[t.value] = i.value);
|
|
969
1136
|
}
|
|
970
1137
|
return {
|
|
@@ -972,27 +1139,27 @@ var g = class e {
|
|
|
972
1139
|
value: n
|
|
973
1140
|
};
|
|
974
1141
|
}
|
|
975
|
-
},
|
|
1142
|
+
}, v = Object.freeze({ status: "aborted" }), _e = (e) => ({
|
|
976
1143
|
status: "dirty",
|
|
977
1144
|
value: e
|
|
978
|
-
}),
|
|
1145
|
+
}), y = (e) => ({
|
|
979
1146
|
status: "valid",
|
|
980
1147
|
value: e
|
|
981
|
-
}),
|
|
1148
|
+
}), ve = (e) => e.status === "aborted", ye = (e) => e.status === "dirty", b = (e) => e.status === "valid", x = (e) => typeof Promise < "u" && e instanceof Promise, S;
|
|
982
1149
|
(function(e) {
|
|
983
1150
|
e.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, e.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
984
|
-
})(
|
|
1151
|
+
})(S ||= {});
|
|
985
1152
|
//#endregion
|
|
986
1153
|
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
|
|
987
|
-
var
|
|
1154
|
+
var C = class {
|
|
988
1155
|
constructor(e, t, n, r) {
|
|
989
1156
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = r;
|
|
990
1157
|
}
|
|
991
1158
|
get path() {
|
|
992
1159
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
993
1160
|
}
|
|
994
|
-
},
|
|
995
|
-
if (
|
|
1161
|
+
}, be = (e, t) => {
|
|
1162
|
+
if (b(t)) return {
|
|
996
1163
|
success: !0,
|
|
997
1164
|
data: t.value
|
|
998
1165
|
};
|
|
@@ -1006,7 +1173,7 @@ var S = class {
|
|
|
1006
1173
|
}
|
|
1007
1174
|
};
|
|
1008
1175
|
};
|
|
1009
|
-
function
|
|
1176
|
+
function w(e) {
|
|
1010
1177
|
if (!e) return {};
|
|
1011
1178
|
let { errorMap: t, invalid_type_error: n, required_error: r, description: i } = e;
|
|
1012
1179
|
if (t && (n || r)) throw Error("Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.");
|
|
@@ -1021,7 +1188,7 @@ function C(e) {
|
|
|
1021
1188
|
description: i
|
|
1022
1189
|
};
|
|
1023
1190
|
}
|
|
1024
|
-
var
|
|
1191
|
+
var T = class {
|
|
1025
1192
|
get description() {
|
|
1026
1193
|
return this._def.description;
|
|
1027
1194
|
}
|
|
@@ -1040,7 +1207,7 @@ var w = class {
|
|
|
1040
1207
|
}
|
|
1041
1208
|
_processInputParams(e) {
|
|
1042
1209
|
return {
|
|
1043
|
-
status: new
|
|
1210
|
+
status: new _(),
|
|
1044
1211
|
ctx: {
|
|
1045
1212
|
common: e.parent.common,
|
|
1046
1213
|
data: e.data,
|
|
@@ -1053,7 +1220,7 @@ var w = class {
|
|
|
1053
1220
|
}
|
|
1054
1221
|
_parseSync(e) {
|
|
1055
1222
|
let t = this._parse(e);
|
|
1056
|
-
if (
|
|
1223
|
+
if (x(t)) throw Error("Synchronous parse encountered promise.");
|
|
1057
1224
|
return t;
|
|
1058
1225
|
}
|
|
1059
1226
|
_parseAsync(e) {
|
|
@@ -1078,7 +1245,7 @@ var w = class {
|
|
|
1078
1245
|
data: e,
|
|
1079
1246
|
parsedType: d(e)
|
|
1080
1247
|
};
|
|
1081
|
-
return
|
|
1248
|
+
return be(n, this._parseSync({
|
|
1082
1249
|
data: e,
|
|
1083
1250
|
path: n.path,
|
|
1084
1251
|
parent: n
|
|
@@ -1102,7 +1269,7 @@ var w = class {
|
|
|
1102
1269
|
path: [],
|
|
1103
1270
|
parent: t
|
|
1104
1271
|
});
|
|
1105
|
-
return
|
|
1272
|
+
return b(n) ? { value: n.value } : { issues: t.common.issues };
|
|
1106
1273
|
} catch (e) {
|
|
1107
1274
|
e?.message?.toLowerCase()?.includes("encountered") && (this["~standard"].async = !0), t.common = {
|
|
1108
1275
|
issues: [],
|
|
@@ -1113,7 +1280,7 @@ var w = class {
|
|
|
1113
1280
|
data: e,
|
|
1114
1281
|
path: [],
|
|
1115
1282
|
parent: t
|
|
1116
|
-
}).then((e) =>
|
|
1283
|
+
}).then((e) => b(e) ? { value: e.value } : { issues: t.common.issues });
|
|
1117
1284
|
}
|
|
1118
1285
|
async parseAsync(e, t) {
|
|
1119
1286
|
let n = await this.safeParseAsync(e, t);
|
|
@@ -1137,7 +1304,7 @@ var w = class {
|
|
|
1137
1304
|
path: n.path,
|
|
1138
1305
|
parent: n
|
|
1139
1306
|
});
|
|
1140
|
-
return
|
|
1307
|
+
return be(n, await (x(r) ? r : Promise.resolve(r)));
|
|
1141
1308
|
}
|
|
1142
1309
|
refine(e, t) {
|
|
1143
1310
|
let n = (e) => typeof t == "string" || t === void 0 ? { message: t } : typeof t == "function" ? t(e) : t;
|
|
@@ -1153,7 +1320,7 @@ var w = class {
|
|
|
1153
1320
|
return this._refinement((n, r) => e(n) ? !0 : (r.addIssue(typeof t == "function" ? t(n, r) : t), !1));
|
|
1154
1321
|
}
|
|
1155
1322
|
_refinement(e) {
|
|
1156
|
-
return new
|
|
1323
|
+
return new G({
|
|
1157
1324
|
schema: this,
|
|
1158
1325
|
typeName: Z.ZodEffects,
|
|
1159
1326
|
effect: {
|
|
@@ -1173,29 +1340,29 @@ var w = class {
|
|
|
1173
1340
|
};
|
|
1174
1341
|
}
|
|
1175
1342
|
optional() {
|
|
1176
|
-
return
|
|
1343
|
+
return K.create(this, this._def);
|
|
1177
1344
|
}
|
|
1178
1345
|
nullable() {
|
|
1179
|
-
return
|
|
1346
|
+
return q.create(this, this._def);
|
|
1180
1347
|
}
|
|
1181
1348
|
nullish() {
|
|
1182
1349
|
return this.nullable().optional();
|
|
1183
1350
|
}
|
|
1184
1351
|
array() {
|
|
1185
|
-
return
|
|
1352
|
+
return N.create(this);
|
|
1186
1353
|
}
|
|
1187
1354
|
promise() {
|
|
1188
|
-
return
|
|
1355
|
+
return W.create(this, this._def);
|
|
1189
1356
|
}
|
|
1190
1357
|
or(e) {
|
|
1191
|
-
return
|
|
1358
|
+
return I.create([this, e], this._def);
|
|
1192
1359
|
}
|
|
1193
1360
|
and(e) {
|
|
1194
|
-
return
|
|
1361
|
+
return R.create(this, e, this._def);
|
|
1195
1362
|
}
|
|
1196
1363
|
transform(e) {
|
|
1197
|
-
return new
|
|
1198
|
-
...
|
|
1364
|
+
return new G({
|
|
1365
|
+
...w(this._def),
|
|
1199
1366
|
schema: this,
|
|
1200
1367
|
typeName: Z.ZodEffects,
|
|
1201
1368
|
effect: {
|
|
@@ -1206,24 +1373,24 @@ var w = class {
|
|
|
1206
1373
|
}
|
|
1207
1374
|
default(e) {
|
|
1208
1375
|
let t = typeof e == "function" ? e : () => e;
|
|
1209
|
-
return new
|
|
1210
|
-
...
|
|
1376
|
+
return new J({
|
|
1377
|
+
...w(this._def),
|
|
1211
1378
|
innerType: this,
|
|
1212
1379
|
defaultValue: t,
|
|
1213
1380
|
typeName: Z.ZodDefault
|
|
1214
1381
|
});
|
|
1215
1382
|
}
|
|
1216
1383
|
brand() {
|
|
1217
|
-
return new
|
|
1384
|
+
return new at({
|
|
1218
1385
|
typeName: Z.ZodBranded,
|
|
1219
1386
|
type: this,
|
|
1220
|
-
...
|
|
1387
|
+
...w(this._def)
|
|
1221
1388
|
});
|
|
1222
1389
|
}
|
|
1223
1390
|
catch(e) {
|
|
1224
1391
|
let t = typeof e == "function" ? e : () => e;
|
|
1225
|
-
return new
|
|
1226
|
-
...
|
|
1392
|
+
return new Y({
|
|
1393
|
+
...w(this._def),
|
|
1227
1394
|
innerType: this,
|
|
1228
1395
|
catchValue: t,
|
|
1229
1396
|
typeName: Z.ZodCatch
|
|
@@ -1237,7 +1404,7 @@ var w = class {
|
|
|
1237
1404
|
});
|
|
1238
1405
|
}
|
|
1239
1406
|
pipe(e) {
|
|
1240
|
-
return
|
|
1407
|
+
return ot.create(this, e);
|
|
1241
1408
|
}
|
|
1242
1409
|
readonly() {
|
|
1243
1410
|
return X.create(this);
|
|
@@ -1248,25 +1415,25 @@ var w = class {
|
|
|
1248
1415
|
isNullable() {
|
|
1249
1416
|
return this.safeParse(null).success;
|
|
1250
1417
|
}
|
|
1251
|
-
},
|
|
1252
|
-
function
|
|
1418
|
+
}, xe = /^c[^\s-]{8,}$/i, Se = /^[0-9a-z]+$/, Ce = /^[0-9A-HJKMNP-TV-Z]{26}$/i, we = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Te = /^[a-z0-9_-]{21}$/i, Ee = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, De = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Oe = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ke = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", Ae, je = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Me = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Ne = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Pe = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Fe = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Ie = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Le = "((\\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])))", Re = RegExp(`^${Le}$`);
|
|
1419
|
+
function ze(e) {
|
|
1253
1420
|
let t = "[0-5]\\d";
|
|
1254
1421
|
e.precision ? t = `${t}\\.\\d{${e.precision}}` : e.precision ?? (t = `${t}(\\.\\d+)?`);
|
|
1255
1422
|
let n = e.precision ? "+" : "?";
|
|
1256
1423
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`;
|
|
1257
1424
|
}
|
|
1258
|
-
function
|
|
1259
|
-
return RegExp(`^${
|
|
1425
|
+
function Be(e) {
|
|
1426
|
+
return RegExp(`^${ze(e)}$`);
|
|
1260
1427
|
}
|
|
1261
|
-
function
|
|
1262
|
-
let t = `${
|
|
1428
|
+
function Ve(e) {
|
|
1429
|
+
let t = `${Le}T${ze(e)}`, n = [];
|
|
1263
1430
|
return n.push(e.local ? "Z?" : "Z"), e.offset && n.push("([+-]\\d{2}:?\\d{2})"), t = `${t}(${n.join("|")})`, RegExp(`^${t}$`);
|
|
1264
1431
|
}
|
|
1265
|
-
function
|
|
1266
|
-
return !!((t === "v4" || !t) &&
|
|
1432
|
+
function He(e, t) {
|
|
1433
|
+
return !!((t === "v4" || !t) && je.test(e) || (t === "v6" || !t) && Ne.test(e));
|
|
1267
1434
|
}
|
|
1268
|
-
function
|
|
1269
|
-
if (!
|
|
1435
|
+
function Ue(e, t) {
|
|
1436
|
+
if (!Ee.test(e)) return !1;
|
|
1270
1437
|
try {
|
|
1271
1438
|
let [n] = e.split(".");
|
|
1272
1439
|
if (!n) return !1;
|
|
@@ -1276,21 +1443,21 @@ function Le(e, t) {
|
|
|
1276
1443
|
return !1;
|
|
1277
1444
|
}
|
|
1278
1445
|
}
|
|
1279
|
-
function
|
|
1280
|
-
return !!((t === "v4" || !t) &&
|
|
1446
|
+
function We(e, t) {
|
|
1447
|
+
return !!((t === "v4" || !t) && Me.test(e) || (t === "v6" || !t) && Pe.test(e));
|
|
1281
1448
|
}
|
|
1282
|
-
var
|
|
1449
|
+
var E = class e extends T {
|
|
1283
1450
|
_parse(e) {
|
|
1284
1451
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== u.string) {
|
|
1285
1452
|
let t = this._getOrReturnCtx(e);
|
|
1286
|
-
return
|
|
1453
|
+
return g(t, {
|
|
1287
1454
|
code: f.invalid_type,
|
|
1288
1455
|
expected: u.string,
|
|
1289
1456
|
received: t.parsedType
|
|
1290
|
-
}),
|
|
1457
|
+
}), v;
|
|
1291
1458
|
}
|
|
1292
|
-
let t = new
|
|
1293
|
-
for (let r of this._def.checks) if (r.kind === "min") e.data.length < r.value && (n = this._getOrReturnCtx(e, n),
|
|
1459
|
+
let t = new _(), n;
|
|
1460
|
+
for (let r of this._def.checks) if (r.kind === "min") e.data.length < r.value && (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1294
1461
|
code: f.too_small,
|
|
1295
1462
|
minimum: r.value,
|
|
1296
1463
|
type: "string",
|
|
@@ -1298,7 +1465,7 @@ var T = class e extends w {
|
|
|
1298
1465
|
exact: !1,
|
|
1299
1466
|
message: r.message
|
|
1300
1467
|
}), t.dirty());
|
|
1301
|
-
else if (r.kind === "max") e.data.length > r.value && (n = this._getOrReturnCtx(e, n),
|
|
1468
|
+
else if (r.kind === "max") e.data.length > r.value && (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1302
1469
|
code: f.too_big,
|
|
1303
1470
|
maximum: r.value,
|
|
1304
1471
|
type: "string",
|
|
@@ -1308,14 +1475,14 @@ var T = class e extends w {
|
|
|
1308
1475
|
}), t.dirty());
|
|
1309
1476
|
else if (r.kind === "length") {
|
|
1310
1477
|
let i = e.data.length > r.value, a = e.data.length < r.value;
|
|
1311
|
-
(i || a) && (n = this._getOrReturnCtx(e, n), i ?
|
|
1478
|
+
(i || a) && (n = this._getOrReturnCtx(e, n), i ? g(n, {
|
|
1312
1479
|
code: f.too_big,
|
|
1313
1480
|
maximum: r.value,
|
|
1314
1481
|
type: "string",
|
|
1315
1482
|
inclusive: !0,
|
|
1316
1483
|
exact: !0,
|
|
1317
1484
|
message: r.message
|
|
1318
|
-
}) : a &&
|
|
1485
|
+
}) : a && g(n, {
|
|
1319
1486
|
code: f.too_small,
|
|
1320
1487
|
minimum: r.value,
|
|
1321
1488
|
type: "string",
|
|
@@ -1323,37 +1490,37 @@ var T = class e extends w {
|
|
|
1323
1490
|
exact: !0,
|
|
1324
1491
|
message: r.message
|
|
1325
1492
|
}), t.dirty());
|
|
1326
|
-
} else if (r.kind === "email")
|
|
1493
|
+
} else if (r.kind === "email") Oe.test(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1327
1494
|
validation: "email",
|
|
1328
1495
|
code: f.invalid_string,
|
|
1329
1496
|
message: r.message
|
|
1330
1497
|
}), t.dirty());
|
|
1331
|
-
else if (r.kind === "emoji")
|
|
1498
|
+
else if (r.kind === "emoji") Ae ||= new RegExp(ke, "u"), Ae.test(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1332
1499
|
validation: "emoji",
|
|
1333
1500
|
code: f.invalid_string,
|
|
1334
1501
|
message: r.message
|
|
1335
1502
|
}), t.dirty());
|
|
1336
|
-
else if (r.kind === "uuid")
|
|
1503
|
+
else if (r.kind === "uuid") we.test(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1337
1504
|
validation: "uuid",
|
|
1338
1505
|
code: f.invalid_string,
|
|
1339
1506
|
message: r.message
|
|
1340
1507
|
}), t.dirty());
|
|
1341
|
-
else if (r.kind === "nanoid")
|
|
1508
|
+
else if (r.kind === "nanoid") Te.test(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1342
1509
|
validation: "nanoid",
|
|
1343
1510
|
code: f.invalid_string,
|
|
1344
1511
|
message: r.message
|
|
1345
1512
|
}), t.dirty());
|
|
1346
|
-
else if (r.kind === "cuid")
|
|
1513
|
+
else if (r.kind === "cuid") xe.test(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1347
1514
|
validation: "cuid",
|
|
1348
1515
|
code: f.invalid_string,
|
|
1349
1516
|
message: r.message
|
|
1350
1517
|
}), t.dirty());
|
|
1351
|
-
else if (r.kind === "cuid2")
|
|
1518
|
+
else if (r.kind === "cuid2") Se.test(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1352
1519
|
validation: "cuid2",
|
|
1353
1520
|
code: f.invalid_string,
|
|
1354
1521
|
message: r.message
|
|
1355
1522
|
}), t.dirty());
|
|
1356
|
-
else if (r.kind === "ulid")
|
|
1523
|
+
else if (r.kind === "ulid") Ce.test(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1357
1524
|
validation: "ulid",
|
|
1358
1525
|
code: f.invalid_string,
|
|
1359
1526
|
message: r.message
|
|
@@ -1361,64 +1528,64 @@ var T = class e extends w {
|
|
|
1361
1528
|
else if (r.kind === "url") try {
|
|
1362
1529
|
new URL(e.data);
|
|
1363
1530
|
} catch {
|
|
1364
|
-
n = this._getOrReturnCtx(e, n),
|
|
1531
|
+
n = this._getOrReturnCtx(e, n), g(n, {
|
|
1365
1532
|
validation: "url",
|
|
1366
1533
|
code: f.invalid_string,
|
|
1367
1534
|
message: r.message
|
|
1368
1535
|
}), t.dirty();
|
|
1369
1536
|
}
|
|
1370
|
-
else r.kind === "regex" ? (r.regex.lastIndex = 0, r.regex.test(e.data) || (n = this._getOrReturnCtx(e, n),
|
|
1537
|
+
else r.kind === "regex" ? (r.regex.lastIndex = 0, r.regex.test(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1371
1538
|
validation: "regex",
|
|
1372
1539
|
code: f.invalid_string,
|
|
1373
1540
|
message: r.message
|
|
1374
|
-
}), t.dirty())) : r.kind === "trim" ? e.data = e.data.trim() : r.kind === "includes" ? e.data.includes(r.value, r.position) || (n = this._getOrReturnCtx(e, n),
|
|
1541
|
+
}), t.dirty())) : r.kind === "trim" ? e.data = e.data.trim() : r.kind === "includes" ? e.data.includes(r.value, r.position) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1375
1542
|
code: f.invalid_string,
|
|
1376
1543
|
validation: {
|
|
1377
1544
|
includes: r.value,
|
|
1378
1545
|
position: r.position
|
|
1379
1546
|
},
|
|
1380
1547
|
message: r.message
|
|
1381
|
-
}), t.dirty()) : r.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : r.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : r.kind === "startsWith" ? e.data.startsWith(r.value) || (n = this._getOrReturnCtx(e, n),
|
|
1548
|
+
}), t.dirty()) : r.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : r.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : r.kind === "startsWith" ? e.data.startsWith(r.value) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1382
1549
|
code: f.invalid_string,
|
|
1383
1550
|
validation: { startsWith: r.value },
|
|
1384
1551
|
message: r.message
|
|
1385
|
-
}), t.dirty()) : r.kind === "endsWith" ? e.data.endsWith(r.value) || (n = this._getOrReturnCtx(e, n),
|
|
1552
|
+
}), t.dirty()) : r.kind === "endsWith" ? e.data.endsWith(r.value) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1386
1553
|
code: f.invalid_string,
|
|
1387
1554
|
validation: { endsWith: r.value },
|
|
1388
1555
|
message: r.message
|
|
1389
|
-
}), t.dirty()) : r.kind === "datetime" ?
|
|
1556
|
+
}), t.dirty()) : r.kind === "datetime" ? Ve(r).test(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1390
1557
|
code: f.invalid_string,
|
|
1391
1558
|
validation: "datetime",
|
|
1392
1559
|
message: r.message
|
|
1393
|
-
}), t.dirty()) : r.kind === "date" ?
|
|
1560
|
+
}), t.dirty()) : r.kind === "date" ? Re.test(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1394
1561
|
code: f.invalid_string,
|
|
1395
1562
|
validation: "date",
|
|
1396
1563
|
message: r.message
|
|
1397
|
-
}), t.dirty()) : r.kind === "time" ?
|
|
1564
|
+
}), t.dirty()) : r.kind === "time" ? Be(r).test(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1398
1565
|
code: f.invalid_string,
|
|
1399
1566
|
validation: "time",
|
|
1400
1567
|
message: r.message
|
|
1401
|
-
}), t.dirty()) : r.kind === "duration" ?
|
|
1568
|
+
}), t.dirty()) : r.kind === "duration" ? De.test(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1402
1569
|
validation: "duration",
|
|
1403
1570
|
code: f.invalid_string,
|
|
1404
1571
|
message: r.message
|
|
1405
|
-
}), t.dirty()) : r.kind === "ip" ?
|
|
1572
|
+
}), t.dirty()) : r.kind === "ip" ? He(e.data, r.version) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1406
1573
|
validation: "ip",
|
|
1407
1574
|
code: f.invalid_string,
|
|
1408
1575
|
message: r.message
|
|
1409
|
-
}), t.dirty()) : r.kind === "jwt" ?
|
|
1576
|
+
}), t.dirty()) : r.kind === "jwt" ? Ue(e.data, r.alg) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1410
1577
|
validation: "jwt",
|
|
1411
1578
|
code: f.invalid_string,
|
|
1412
1579
|
message: r.message
|
|
1413
|
-
}), t.dirty()) : r.kind === "cidr" ?
|
|
1580
|
+
}), t.dirty()) : r.kind === "cidr" ? We(e.data, r.version) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1414
1581
|
validation: "cidr",
|
|
1415
1582
|
code: f.invalid_string,
|
|
1416
1583
|
message: r.message
|
|
1417
|
-
}), t.dirty()) : r.kind === "base64" ?
|
|
1584
|
+
}), t.dirty()) : r.kind === "base64" ? Fe.test(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1418
1585
|
validation: "base64",
|
|
1419
1586
|
code: f.invalid_string,
|
|
1420
1587
|
message: r.message
|
|
1421
|
-
}), t.dirty()) : r.kind === "base64url" ?
|
|
1588
|
+
}), t.dirty()) : r.kind === "base64url" ? Ie.test(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1422
1589
|
validation: "base64url",
|
|
1423
1590
|
code: f.invalid_string,
|
|
1424
1591
|
message: r.message
|
|
@@ -1432,7 +1599,7 @@ var T = class e extends w {
|
|
|
1432
1599
|
return this.refinement((t) => e.test(t), {
|
|
1433
1600
|
validation: t,
|
|
1434
1601
|
code: f.invalid_string,
|
|
1435
|
-
...
|
|
1602
|
+
...S.errToObj(n)
|
|
1436
1603
|
});
|
|
1437
1604
|
}
|
|
1438
1605
|
_addCheck(t) {
|
|
@@ -1444,79 +1611,79 @@ var T = class e extends w {
|
|
|
1444
1611
|
email(e) {
|
|
1445
1612
|
return this._addCheck({
|
|
1446
1613
|
kind: "email",
|
|
1447
|
-
...
|
|
1614
|
+
...S.errToObj(e)
|
|
1448
1615
|
});
|
|
1449
1616
|
}
|
|
1450
1617
|
url(e) {
|
|
1451
1618
|
return this._addCheck({
|
|
1452
1619
|
kind: "url",
|
|
1453
|
-
...
|
|
1620
|
+
...S.errToObj(e)
|
|
1454
1621
|
});
|
|
1455
1622
|
}
|
|
1456
1623
|
emoji(e) {
|
|
1457
1624
|
return this._addCheck({
|
|
1458
1625
|
kind: "emoji",
|
|
1459
|
-
...
|
|
1626
|
+
...S.errToObj(e)
|
|
1460
1627
|
});
|
|
1461
1628
|
}
|
|
1462
1629
|
uuid(e) {
|
|
1463
1630
|
return this._addCheck({
|
|
1464
1631
|
kind: "uuid",
|
|
1465
|
-
...
|
|
1632
|
+
...S.errToObj(e)
|
|
1466
1633
|
});
|
|
1467
1634
|
}
|
|
1468
1635
|
nanoid(e) {
|
|
1469
1636
|
return this._addCheck({
|
|
1470
1637
|
kind: "nanoid",
|
|
1471
|
-
...
|
|
1638
|
+
...S.errToObj(e)
|
|
1472
1639
|
});
|
|
1473
1640
|
}
|
|
1474
1641
|
cuid(e) {
|
|
1475
1642
|
return this._addCheck({
|
|
1476
1643
|
kind: "cuid",
|
|
1477
|
-
...
|
|
1644
|
+
...S.errToObj(e)
|
|
1478
1645
|
});
|
|
1479
1646
|
}
|
|
1480
1647
|
cuid2(e) {
|
|
1481
1648
|
return this._addCheck({
|
|
1482
1649
|
kind: "cuid2",
|
|
1483
|
-
...
|
|
1650
|
+
...S.errToObj(e)
|
|
1484
1651
|
});
|
|
1485
1652
|
}
|
|
1486
1653
|
ulid(e) {
|
|
1487
1654
|
return this._addCheck({
|
|
1488
1655
|
kind: "ulid",
|
|
1489
|
-
...
|
|
1656
|
+
...S.errToObj(e)
|
|
1490
1657
|
});
|
|
1491
1658
|
}
|
|
1492
1659
|
base64(e) {
|
|
1493
1660
|
return this._addCheck({
|
|
1494
1661
|
kind: "base64",
|
|
1495
|
-
...
|
|
1662
|
+
...S.errToObj(e)
|
|
1496
1663
|
});
|
|
1497
1664
|
}
|
|
1498
1665
|
base64url(e) {
|
|
1499
1666
|
return this._addCheck({
|
|
1500
1667
|
kind: "base64url",
|
|
1501
|
-
...
|
|
1668
|
+
...S.errToObj(e)
|
|
1502
1669
|
});
|
|
1503
1670
|
}
|
|
1504
1671
|
jwt(e) {
|
|
1505
1672
|
return this._addCheck({
|
|
1506
1673
|
kind: "jwt",
|
|
1507
|
-
...
|
|
1674
|
+
...S.errToObj(e)
|
|
1508
1675
|
});
|
|
1509
1676
|
}
|
|
1510
1677
|
ip(e) {
|
|
1511
1678
|
return this._addCheck({
|
|
1512
1679
|
kind: "ip",
|
|
1513
|
-
...
|
|
1680
|
+
...S.errToObj(e)
|
|
1514
1681
|
});
|
|
1515
1682
|
}
|
|
1516
1683
|
cidr(e) {
|
|
1517
1684
|
return this._addCheck({
|
|
1518
1685
|
kind: "cidr",
|
|
1519
|
-
...
|
|
1686
|
+
...S.errToObj(e)
|
|
1520
1687
|
});
|
|
1521
1688
|
}
|
|
1522
1689
|
datetime(e) {
|
|
@@ -1531,7 +1698,7 @@ var T = class e extends w {
|
|
|
1531
1698
|
precision: e?.precision === void 0 ? null : e?.precision,
|
|
1532
1699
|
offset: e?.offset ?? !1,
|
|
1533
1700
|
local: e?.local ?? !1,
|
|
1534
|
-
...
|
|
1701
|
+
...S.errToObj(e?.message)
|
|
1535
1702
|
});
|
|
1536
1703
|
}
|
|
1537
1704
|
date(e) {
|
|
@@ -1548,20 +1715,20 @@ var T = class e extends w {
|
|
|
1548
1715
|
}) : this._addCheck({
|
|
1549
1716
|
kind: "time",
|
|
1550
1717
|
precision: e?.precision === void 0 ? null : e?.precision,
|
|
1551
|
-
...
|
|
1718
|
+
...S.errToObj(e?.message)
|
|
1552
1719
|
});
|
|
1553
1720
|
}
|
|
1554
1721
|
duration(e) {
|
|
1555
1722
|
return this._addCheck({
|
|
1556
1723
|
kind: "duration",
|
|
1557
|
-
...
|
|
1724
|
+
...S.errToObj(e)
|
|
1558
1725
|
});
|
|
1559
1726
|
}
|
|
1560
1727
|
regex(e, t) {
|
|
1561
1728
|
return this._addCheck({
|
|
1562
1729
|
kind: "regex",
|
|
1563
1730
|
regex: e,
|
|
1564
|
-
...
|
|
1731
|
+
...S.errToObj(t)
|
|
1565
1732
|
});
|
|
1566
1733
|
}
|
|
1567
1734
|
includes(e, t) {
|
|
@@ -1569,46 +1736,46 @@ var T = class e extends w {
|
|
|
1569
1736
|
kind: "includes",
|
|
1570
1737
|
value: e,
|
|
1571
1738
|
position: t?.position,
|
|
1572
|
-
...
|
|
1739
|
+
...S.errToObj(t?.message)
|
|
1573
1740
|
});
|
|
1574
1741
|
}
|
|
1575
1742
|
startsWith(e, t) {
|
|
1576
1743
|
return this._addCheck({
|
|
1577
1744
|
kind: "startsWith",
|
|
1578
1745
|
value: e,
|
|
1579
|
-
...
|
|
1746
|
+
...S.errToObj(t)
|
|
1580
1747
|
});
|
|
1581
1748
|
}
|
|
1582
1749
|
endsWith(e, t) {
|
|
1583
1750
|
return this._addCheck({
|
|
1584
1751
|
kind: "endsWith",
|
|
1585
1752
|
value: e,
|
|
1586
|
-
...
|
|
1753
|
+
...S.errToObj(t)
|
|
1587
1754
|
});
|
|
1588
1755
|
}
|
|
1589
1756
|
min(e, t) {
|
|
1590
1757
|
return this._addCheck({
|
|
1591
1758
|
kind: "min",
|
|
1592
1759
|
value: e,
|
|
1593
|
-
...
|
|
1760
|
+
...S.errToObj(t)
|
|
1594
1761
|
});
|
|
1595
1762
|
}
|
|
1596
1763
|
max(e, t) {
|
|
1597
1764
|
return this._addCheck({
|
|
1598
1765
|
kind: "max",
|
|
1599
1766
|
value: e,
|
|
1600
|
-
...
|
|
1767
|
+
...S.errToObj(t)
|
|
1601
1768
|
});
|
|
1602
1769
|
}
|
|
1603
1770
|
length(e, t) {
|
|
1604
1771
|
return this._addCheck({
|
|
1605
1772
|
kind: "length",
|
|
1606
1773
|
value: e,
|
|
1607
|
-
...
|
|
1774
|
+
...S.errToObj(t)
|
|
1608
1775
|
});
|
|
1609
1776
|
}
|
|
1610
1777
|
nonempty(e) {
|
|
1611
|
-
return this.min(1,
|
|
1778
|
+
return this.min(1, S.errToObj(e));
|
|
1612
1779
|
}
|
|
1613
1780
|
trim() {
|
|
1614
1781
|
return new e({
|
|
@@ -1687,54 +1854,54 @@ var T = class e extends w {
|
|
|
1687
1854
|
return e;
|
|
1688
1855
|
}
|
|
1689
1856
|
};
|
|
1690
|
-
|
|
1857
|
+
E.create = (e) => new E({
|
|
1691
1858
|
checks: [],
|
|
1692
1859
|
typeName: Z.ZodString,
|
|
1693
1860
|
coerce: e?.coerce ?? !1,
|
|
1694
|
-
...
|
|
1861
|
+
...w(e)
|
|
1695
1862
|
});
|
|
1696
|
-
function
|
|
1863
|
+
function Ge(e, t) {
|
|
1697
1864
|
let n = (e.toString().split(".")[1] || "").length, r = (t.toString().split(".")[1] || "").length, i = n > r ? n : r;
|
|
1698
1865
|
return Number.parseInt(e.toFixed(i).replace(".", "")) % Number.parseInt(t.toFixed(i).replace(".", "")) / 10 ** i;
|
|
1699
1866
|
}
|
|
1700
|
-
var
|
|
1867
|
+
var D = class e extends T {
|
|
1701
1868
|
constructor() {
|
|
1702
1869
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1703
1870
|
}
|
|
1704
1871
|
_parse(e) {
|
|
1705
1872
|
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== u.number) {
|
|
1706
1873
|
let t = this._getOrReturnCtx(e);
|
|
1707
|
-
return
|
|
1874
|
+
return g(t, {
|
|
1708
1875
|
code: f.invalid_type,
|
|
1709
1876
|
expected: u.number,
|
|
1710
1877
|
received: t.parsedType
|
|
1711
|
-
}),
|
|
1878
|
+
}), v;
|
|
1712
1879
|
}
|
|
1713
|
-
let t, n = new
|
|
1714
|
-
for (let r of this._def.checks) r.kind === "int" ? l.isInteger(e.data) || (t = this._getOrReturnCtx(e, t),
|
|
1880
|
+
let t, n = new _();
|
|
1881
|
+
for (let r of this._def.checks) r.kind === "int" ? l.isInteger(e.data) || (t = this._getOrReturnCtx(e, t), g(t, {
|
|
1715
1882
|
code: f.invalid_type,
|
|
1716
1883
|
expected: "integer",
|
|
1717
1884
|
received: "float",
|
|
1718
1885
|
message: r.message
|
|
1719
|
-
}), n.dirty()) : r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t),
|
|
1886
|
+
}), n.dirty()) : r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t), g(t, {
|
|
1720
1887
|
code: f.too_small,
|
|
1721
1888
|
minimum: r.value,
|
|
1722
1889
|
type: "number",
|
|
1723
1890
|
inclusive: r.inclusive,
|
|
1724
1891
|
exact: !1,
|
|
1725
1892
|
message: r.message
|
|
1726
|
-
}), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t),
|
|
1893
|
+
}), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t), g(t, {
|
|
1727
1894
|
code: f.too_big,
|
|
1728
1895
|
maximum: r.value,
|
|
1729
1896
|
type: "number",
|
|
1730
1897
|
inclusive: r.inclusive,
|
|
1731
1898
|
exact: !1,
|
|
1732
1899
|
message: r.message
|
|
1733
|
-
}), n.dirty()) : r.kind === "multipleOf" ?
|
|
1900
|
+
}), n.dirty()) : r.kind === "multipleOf" ? Ge(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), g(t, {
|
|
1734
1901
|
code: f.not_multiple_of,
|
|
1735
1902
|
multipleOf: r.value,
|
|
1736
1903
|
message: r.message
|
|
1737
|
-
}), n.dirty()) : r.kind === "finite" ? Number.isFinite(e.data) || (t = this._getOrReturnCtx(e, t),
|
|
1904
|
+
}), n.dirty()) : r.kind === "finite" ? Number.isFinite(e.data) || (t = this._getOrReturnCtx(e, t), g(t, {
|
|
1738
1905
|
code: f.not_finite,
|
|
1739
1906
|
message: r.message
|
|
1740
1907
|
}), n.dirty()) : l.assertNever(r);
|
|
@@ -1744,16 +1911,16 @@ var E = class e extends w {
|
|
|
1744
1911
|
};
|
|
1745
1912
|
}
|
|
1746
1913
|
gte(e, t) {
|
|
1747
|
-
return this.setLimit("min", e, !0,
|
|
1914
|
+
return this.setLimit("min", e, !0, S.toString(t));
|
|
1748
1915
|
}
|
|
1749
1916
|
gt(e, t) {
|
|
1750
|
-
return this.setLimit("min", e, !1,
|
|
1917
|
+
return this.setLimit("min", e, !1, S.toString(t));
|
|
1751
1918
|
}
|
|
1752
1919
|
lte(e, t) {
|
|
1753
|
-
return this.setLimit("max", e, !0,
|
|
1920
|
+
return this.setLimit("max", e, !0, S.toString(t));
|
|
1754
1921
|
}
|
|
1755
1922
|
lt(e, t) {
|
|
1756
|
-
return this.setLimit("max", e, !1,
|
|
1923
|
+
return this.setLimit("max", e, !1, S.toString(t));
|
|
1757
1924
|
}
|
|
1758
1925
|
setLimit(t, n, r, i) {
|
|
1759
1926
|
return new e({
|
|
@@ -1762,7 +1929,7 @@ var E = class e extends w {
|
|
|
1762
1929
|
kind: t,
|
|
1763
1930
|
value: n,
|
|
1764
1931
|
inclusive: r,
|
|
1765
|
-
message:
|
|
1932
|
+
message: S.toString(i)
|
|
1766
1933
|
}]
|
|
1767
1934
|
});
|
|
1768
1935
|
}
|
|
@@ -1775,7 +1942,7 @@ var E = class e extends w {
|
|
|
1775
1942
|
int(e) {
|
|
1776
1943
|
return this._addCheck({
|
|
1777
1944
|
kind: "int",
|
|
1778
|
-
message:
|
|
1945
|
+
message: S.toString(e)
|
|
1779
1946
|
});
|
|
1780
1947
|
}
|
|
1781
1948
|
positive(e) {
|
|
@@ -1783,7 +1950,7 @@ var E = class e extends w {
|
|
|
1783
1950
|
kind: "min",
|
|
1784
1951
|
value: 0,
|
|
1785
1952
|
inclusive: !1,
|
|
1786
|
-
message:
|
|
1953
|
+
message: S.toString(e)
|
|
1787
1954
|
});
|
|
1788
1955
|
}
|
|
1789
1956
|
negative(e) {
|
|
@@ -1791,7 +1958,7 @@ var E = class e extends w {
|
|
|
1791
1958
|
kind: "max",
|
|
1792
1959
|
value: 0,
|
|
1793
1960
|
inclusive: !1,
|
|
1794
|
-
message:
|
|
1961
|
+
message: S.toString(e)
|
|
1795
1962
|
});
|
|
1796
1963
|
}
|
|
1797
1964
|
nonpositive(e) {
|
|
@@ -1799,7 +1966,7 @@ var E = class e extends w {
|
|
|
1799
1966
|
kind: "max",
|
|
1800
1967
|
value: 0,
|
|
1801
1968
|
inclusive: !0,
|
|
1802
|
-
message:
|
|
1969
|
+
message: S.toString(e)
|
|
1803
1970
|
});
|
|
1804
1971
|
}
|
|
1805
1972
|
nonnegative(e) {
|
|
@@ -1807,20 +1974,20 @@ var E = class e extends w {
|
|
|
1807
1974
|
kind: "min",
|
|
1808
1975
|
value: 0,
|
|
1809
1976
|
inclusive: !0,
|
|
1810
|
-
message:
|
|
1977
|
+
message: S.toString(e)
|
|
1811
1978
|
});
|
|
1812
1979
|
}
|
|
1813
1980
|
multipleOf(e, t) {
|
|
1814
1981
|
return this._addCheck({
|
|
1815
1982
|
kind: "multipleOf",
|
|
1816
1983
|
value: e,
|
|
1817
|
-
message:
|
|
1984
|
+
message: S.toString(t)
|
|
1818
1985
|
});
|
|
1819
1986
|
}
|
|
1820
1987
|
finite(e) {
|
|
1821
1988
|
return this._addCheck({
|
|
1822
1989
|
kind: "finite",
|
|
1823
|
-
message:
|
|
1990
|
+
message: S.toString(e)
|
|
1824
1991
|
});
|
|
1825
1992
|
}
|
|
1826
1993
|
safe(e) {
|
|
@@ -1828,12 +1995,12 @@ var E = class e extends w {
|
|
|
1828
1995
|
kind: "min",
|
|
1829
1996
|
inclusive: !0,
|
|
1830
1997
|
value: -(2 ** 53 - 1),
|
|
1831
|
-
message:
|
|
1998
|
+
message: S.toString(e)
|
|
1832
1999
|
})._addCheck({
|
|
1833
2000
|
kind: "max",
|
|
1834
2001
|
inclusive: !0,
|
|
1835
2002
|
value: 2 ** 53 - 1,
|
|
1836
|
-
message:
|
|
2003
|
+
message: S.toString(e)
|
|
1837
2004
|
});
|
|
1838
2005
|
}
|
|
1839
2006
|
get minValue() {
|
|
@@ -1856,13 +2023,13 @@ var E = class e extends w {
|
|
|
1856
2023
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
1857
2024
|
}
|
|
1858
2025
|
};
|
|
1859
|
-
|
|
2026
|
+
D.create = (e) => new D({
|
|
1860
2027
|
checks: [],
|
|
1861
2028
|
typeName: Z.ZodNumber,
|
|
1862
2029
|
coerce: e?.coerce || !1,
|
|
1863
|
-
...
|
|
2030
|
+
...w(e)
|
|
1864
2031
|
});
|
|
1865
|
-
var
|
|
2032
|
+
var O = class e extends T {
|
|
1866
2033
|
constructor() {
|
|
1867
2034
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1868
2035
|
}
|
|
@@ -1873,20 +2040,20 @@ var D = class e extends w {
|
|
|
1873
2040
|
return this._getInvalidInput(e);
|
|
1874
2041
|
}
|
|
1875
2042
|
if (this._getType(e) !== u.bigint) return this._getInvalidInput(e);
|
|
1876
|
-
let t, n = new
|
|
1877
|
-
for (let r of this._def.checks) r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t),
|
|
2043
|
+
let t, n = new _();
|
|
2044
|
+
for (let r of this._def.checks) r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t), g(t, {
|
|
1878
2045
|
code: f.too_small,
|
|
1879
2046
|
type: "bigint",
|
|
1880
2047
|
minimum: r.value,
|
|
1881
2048
|
inclusive: r.inclusive,
|
|
1882
2049
|
message: r.message
|
|
1883
|
-
}), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t),
|
|
2050
|
+
}), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t), g(t, {
|
|
1884
2051
|
code: f.too_big,
|
|
1885
2052
|
type: "bigint",
|
|
1886
2053
|
maximum: r.value,
|
|
1887
2054
|
inclusive: r.inclusive,
|
|
1888
2055
|
message: r.message
|
|
1889
|
-
}), n.dirty()) : r.kind === "multipleOf" ? e.data % r.value !== BigInt(0) && (t = this._getOrReturnCtx(e, t),
|
|
2056
|
+
}), n.dirty()) : r.kind === "multipleOf" ? e.data % r.value !== BigInt(0) && (t = this._getOrReturnCtx(e, t), g(t, {
|
|
1890
2057
|
code: f.not_multiple_of,
|
|
1891
2058
|
multipleOf: r.value,
|
|
1892
2059
|
message: r.message
|
|
@@ -1898,23 +2065,23 @@ var D = class e extends w {
|
|
|
1898
2065
|
}
|
|
1899
2066
|
_getInvalidInput(e) {
|
|
1900
2067
|
let t = this._getOrReturnCtx(e);
|
|
1901
|
-
return
|
|
2068
|
+
return g(t, {
|
|
1902
2069
|
code: f.invalid_type,
|
|
1903
2070
|
expected: u.bigint,
|
|
1904
2071
|
received: t.parsedType
|
|
1905
|
-
}),
|
|
2072
|
+
}), v;
|
|
1906
2073
|
}
|
|
1907
2074
|
gte(e, t) {
|
|
1908
|
-
return this.setLimit("min", e, !0,
|
|
2075
|
+
return this.setLimit("min", e, !0, S.toString(t));
|
|
1909
2076
|
}
|
|
1910
2077
|
gt(e, t) {
|
|
1911
|
-
return this.setLimit("min", e, !1,
|
|
2078
|
+
return this.setLimit("min", e, !1, S.toString(t));
|
|
1912
2079
|
}
|
|
1913
2080
|
lte(e, t) {
|
|
1914
|
-
return this.setLimit("max", e, !0,
|
|
2081
|
+
return this.setLimit("max", e, !0, S.toString(t));
|
|
1915
2082
|
}
|
|
1916
2083
|
lt(e, t) {
|
|
1917
|
-
return this.setLimit("max", e, !1,
|
|
2084
|
+
return this.setLimit("max", e, !1, S.toString(t));
|
|
1918
2085
|
}
|
|
1919
2086
|
setLimit(t, n, r, i) {
|
|
1920
2087
|
return new e({
|
|
@@ -1923,7 +2090,7 @@ var D = class e extends w {
|
|
|
1923
2090
|
kind: t,
|
|
1924
2091
|
value: n,
|
|
1925
2092
|
inclusive: r,
|
|
1926
|
-
message:
|
|
2093
|
+
message: S.toString(i)
|
|
1927
2094
|
}]
|
|
1928
2095
|
});
|
|
1929
2096
|
}
|
|
@@ -1938,7 +2105,7 @@ var D = class e extends w {
|
|
|
1938
2105
|
kind: "min",
|
|
1939
2106
|
value: BigInt(0),
|
|
1940
2107
|
inclusive: !1,
|
|
1941
|
-
message:
|
|
2108
|
+
message: S.toString(e)
|
|
1942
2109
|
});
|
|
1943
2110
|
}
|
|
1944
2111
|
negative(e) {
|
|
@@ -1946,7 +2113,7 @@ var D = class e extends w {
|
|
|
1946
2113
|
kind: "max",
|
|
1947
2114
|
value: BigInt(0),
|
|
1948
2115
|
inclusive: !1,
|
|
1949
|
-
message:
|
|
2116
|
+
message: S.toString(e)
|
|
1950
2117
|
});
|
|
1951
2118
|
}
|
|
1952
2119
|
nonpositive(e) {
|
|
@@ -1954,7 +2121,7 @@ var D = class e extends w {
|
|
|
1954
2121
|
kind: "max",
|
|
1955
2122
|
value: BigInt(0),
|
|
1956
2123
|
inclusive: !0,
|
|
1957
|
-
message:
|
|
2124
|
+
message: S.toString(e)
|
|
1958
2125
|
});
|
|
1959
2126
|
}
|
|
1960
2127
|
nonnegative(e) {
|
|
@@ -1962,14 +2129,14 @@ var D = class e extends w {
|
|
|
1962
2129
|
kind: "min",
|
|
1963
2130
|
value: BigInt(0),
|
|
1964
2131
|
inclusive: !0,
|
|
1965
|
-
message:
|
|
2132
|
+
message: S.toString(e)
|
|
1966
2133
|
});
|
|
1967
2134
|
}
|
|
1968
2135
|
multipleOf(e, t) {
|
|
1969
2136
|
return this._addCheck({
|
|
1970
2137
|
kind: "multipleOf",
|
|
1971
2138
|
value: e,
|
|
1972
|
-
message:
|
|
2139
|
+
message: S.toString(t)
|
|
1973
2140
|
});
|
|
1974
2141
|
}
|
|
1975
2142
|
get minValue() {
|
|
@@ -1983,50 +2150,50 @@ var D = class e extends w {
|
|
|
1983
2150
|
return e;
|
|
1984
2151
|
}
|
|
1985
2152
|
};
|
|
1986
|
-
|
|
2153
|
+
O.create = (e) => new O({
|
|
1987
2154
|
checks: [],
|
|
1988
2155
|
typeName: Z.ZodBigInt,
|
|
1989
2156
|
coerce: e?.coerce ?? !1,
|
|
1990
|
-
...
|
|
2157
|
+
...w(e)
|
|
1991
2158
|
});
|
|
1992
|
-
var
|
|
2159
|
+
var Ke = class extends T {
|
|
1993
2160
|
_parse(e) {
|
|
1994
2161
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== u.boolean) {
|
|
1995
2162
|
let t = this._getOrReturnCtx(e);
|
|
1996
|
-
return
|
|
2163
|
+
return g(t, {
|
|
1997
2164
|
code: f.invalid_type,
|
|
1998
2165
|
expected: u.boolean,
|
|
1999
2166
|
received: t.parsedType
|
|
2000
|
-
}),
|
|
2167
|
+
}), v;
|
|
2001
2168
|
}
|
|
2002
|
-
return
|
|
2169
|
+
return y(e.data);
|
|
2003
2170
|
}
|
|
2004
2171
|
};
|
|
2005
|
-
|
|
2172
|
+
Ke.create = (e) => new Ke({
|
|
2006
2173
|
typeName: Z.ZodBoolean,
|
|
2007
2174
|
coerce: e?.coerce || !1,
|
|
2008
|
-
...
|
|
2175
|
+
...w(e)
|
|
2009
2176
|
});
|
|
2010
|
-
var
|
|
2177
|
+
var qe = class e extends T {
|
|
2011
2178
|
_parse(e) {
|
|
2012
2179
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== u.date) {
|
|
2013
2180
|
let t = this._getOrReturnCtx(e);
|
|
2014
|
-
return
|
|
2181
|
+
return g(t, {
|
|
2015
2182
|
code: f.invalid_type,
|
|
2016
2183
|
expected: u.date,
|
|
2017
2184
|
received: t.parsedType
|
|
2018
|
-
}),
|
|
2185
|
+
}), v;
|
|
2019
2186
|
}
|
|
2020
|
-
if (Number.isNaN(e.data.getTime())) return
|
|
2021
|
-
let t = new
|
|
2022
|
-
for (let r of this._def.checks) r.kind === "min" ? e.data.getTime() < r.value && (n = this._getOrReturnCtx(e, n),
|
|
2187
|
+
if (Number.isNaN(e.data.getTime())) return g(this._getOrReturnCtx(e), { code: f.invalid_date }), v;
|
|
2188
|
+
let t = new _(), n;
|
|
2189
|
+
for (let r of this._def.checks) r.kind === "min" ? e.data.getTime() < r.value && (n = this._getOrReturnCtx(e, n), g(n, {
|
|
2023
2190
|
code: f.too_small,
|
|
2024
2191
|
message: r.message,
|
|
2025
2192
|
inclusive: !0,
|
|
2026
2193
|
exact: !1,
|
|
2027
2194
|
minimum: r.value,
|
|
2028
2195
|
type: "date"
|
|
2029
|
-
}), t.dirty()) : r.kind === "max" ? e.data.getTime() > r.value && (n = this._getOrReturnCtx(e, n),
|
|
2196
|
+
}), t.dirty()) : r.kind === "max" ? e.data.getTime() > r.value && (n = this._getOrReturnCtx(e, n), g(n, {
|
|
2030
2197
|
code: f.too_big,
|
|
2031
2198
|
message: r.message,
|
|
2032
2199
|
inclusive: !0,
|
|
@@ -2049,14 +2216,14 @@ var Ve = class e extends w {
|
|
|
2049
2216
|
return this._addCheck({
|
|
2050
2217
|
kind: "min",
|
|
2051
2218
|
value: e.getTime(),
|
|
2052
|
-
message:
|
|
2219
|
+
message: S.toString(t)
|
|
2053
2220
|
});
|
|
2054
2221
|
}
|
|
2055
2222
|
max(e, t) {
|
|
2056
2223
|
return this._addCheck({
|
|
2057
2224
|
kind: "max",
|
|
2058
2225
|
value: e.getTime(),
|
|
2059
|
-
message:
|
|
2226
|
+
message: S.toString(t)
|
|
2060
2227
|
});
|
|
2061
2228
|
}
|
|
2062
2229
|
get minDate() {
|
|
@@ -2070,129 +2237,129 @@ var Ve = class e extends w {
|
|
|
2070
2237
|
return e == null ? null : new Date(e);
|
|
2071
2238
|
}
|
|
2072
2239
|
};
|
|
2073
|
-
|
|
2240
|
+
qe.create = (e) => new qe({
|
|
2074
2241
|
checks: [],
|
|
2075
2242
|
coerce: e?.coerce || !1,
|
|
2076
2243
|
typeName: Z.ZodDate,
|
|
2077
|
-
...
|
|
2244
|
+
...w(e)
|
|
2078
2245
|
});
|
|
2079
|
-
var
|
|
2246
|
+
var Je = class extends T {
|
|
2080
2247
|
_parse(e) {
|
|
2081
2248
|
if (this._getType(e) !== u.symbol) {
|
|
2082
2249
|
let t = this._getOrReturnCtx(e);
|
|
2083
|
-
return
|
|
2250
|
+
return g(t, {
|
|
2084
2251
|
code: f.invalid_type,
|
|
2085
2252
|
expected: u.symbol,
|
|
2086
2253
|
received: t.parsedType
|
|
2087
|
-
}),
|
|
2254
|
+
}), v;
|
|
2088
2255
|
}
|
|
2089
|
-
return
|
|
2256
|
+
return y(e.data);
|
|
2090
2257
|
}
|
|
2091
2258
|
};
|
|
2092
|
-
|
|
2259
|
+
Je.create = (e) => new Je({
|
|
2093
2260
|
typeName: Z.ZodSymbol,
|
|
2094
|
-
...
|
|
2261
|
+
...w(e)
|
|
2095
2262
|
});
|
|
2096
|
-
var
|
|
2263
|
+
var k = class extends T {
|
|
2097
2264
|
_parse(e) {
|
|
2098
2265
|
if (this._getType(e) !== u.undefined) {
|
|
2099
2266
|
let t = this._getOrReturnCtx(e);
|
|
2100
|
-
return
|
|
2267
|
+
return g(t, {
|
|
2101
2268
|
code: f.invalid_type,
|
|
2102
2269
|
expected: u.undefined,
|
|
2103
2270
|
received: t.parsedType
|
|
2104
|
-
}),
|
|
2271
|
+
}), v;
|
|
2105
2272
|
}
|
|
2106
|
-
return
|
|
2273
|
+
return y(e.data);
|
|
2107
2274
|
}
|
|
2108
2275
|
};
|
|
2109
|
-
|
|
2276
|
+
k.create = (e) => new k({
|
|
2110
2277
|
typeName: Z.ZodUndefined,
|
|
2111
|
-
...
|
|
2278
|
+
...w(e)
|
|
2112
2279
|
});
|
|
2113
|
-
var
|
|
2280
|
+
var A = class extends T {
|
|
2114
2281
|
_parse(e) {
|
|
2115
2282
|
if (this._getType(e) !== u.null) {
|
|
2116
2283
|
let t = this._getOrReturnCtx(e);
|
|
2117
|
-
return
|
|
2284
|
+
return g(t, {
|
|
2118
2285
|
code: f.invalid_type,
|
|
2119
2286
|
expected: u.null,
|
|
2120
2287
|
received: t.parsedType
|
|
2121
|
-
}),
|
|
2288
|
+
}), v;
|
|
2122
2289
|
}
|
|
2123
|
-
return
|
|
2290
|
+
return y(e.data);
|
|
2124
2291
|
}
|
|
2125
2292
|
};
|
|
2126
|
-
|
|
2293
|
+
A.create = (e) => new A({
|
|
2127
2294
|
typeName: Z.ZodNull,
|
|
2128
|
-
...
|
|
2295
|
+
...w(e)
|
|
2129
2296
|
});
|
|
2130
|
-
var
|
|
2297
|
+
var Ye = class extends T {
|
|
2131
2298
|
constructor() {
|
|
2132
2299
|
super(...arguments), this._any = !0;
|
|
2133
2300
|
}
|
|
2134
2301
|
_parse(e) {
|
|
2135
|
-
return
|
|
2302
|
+
return y(e.data);
|
|
2136
2303
|
}
|
|
2137
2304
|
};
|
|
2138
|
-
|
|
2305
|
+
Ye.create = (e) => new Ye({
|
|
2139
2306
|
typeName: Z.ZodAny,
|
|
2140
|
-
...
|
|
2307
|
+
...w(e)
|
|
2141
2308
|
});
|
|
2142
|
-
var
|
|
2309
|
+
var j = class extends T {
|
|
2143
2310
|
constructor() {
|
|
2144
2311
|
super(...arguments), this._unknown = !0;
|
|
2145
2312
|
}
|
|
2146
2313
|
_parse(e) {
|
|
2147
|
-
return
|
|
2314
|
+
return y(e.data);
|
|
2148
2315
|
}
|
|
2149
2316
|
};
|
|
2150
|
-
|
|
2317
|
+
j.create = (e) => new j({
|
|
2151
2318
|
typeName: Z.ZodUnknown,
|
|
2152
|
-
...
|
|
2319
|
+
...w(e)
|
|
2153
2320
|
});
|
|
2154
|
-
var
|
|
2321
|
+
var M = class extends T {
|
|
2155
2322
|
_parse(e) {
|
|
2156
2323
|
let t = this._getOrReturnCtx(e);
|
|
2157
|
-
return
|
|
2324
|
+
return g(t, {
|
|
2158
2325
|
code: f.invalid_type,
|
|
2159
2326
|
expected: u.never,
|
|
2160
2327
|
received: t.parsedType
|
|
2161
|
-
}),
|
|
2328
|
+
}), v;
|
|
2162
2329
|
}
|
|
2163
2330
|
};
|
|
2164
|
-
|
|
2331
|
+
M.create = (e) => new M({
|
|
2165
2332
|
typeName: Z.ZodNever,
|
|
2166
|
-
...
|
|
2333
|
+
...w(e)
|
|
2167
2334
|
});
|
|
2168
|
-
var
|
|
2335
|
+
var Xe = class extends T {
|
|
2169
2336
|
_parse(e) {
|
|
2170
2337
|
if (this._getType(e) !== u.undefined) {
|
|
2171
2338
|
let t = this._getOrReturnCtx(e);
|
|
2172
|
-
return
|
|
2339
|
+
return g(t, {
|
|
2173
2340
|
code: f.invalid_type,
|
|
2174
2341
|
expected: u.void,
|
|
2175
2342
|
received: t.parsedType
|
|
2176
|
-
}),
|
|
2343
|
+
}), v;
|
|
2177
2344
|
}
|
|
2178
|
-
return
|
|
2345
|
+
return y(e.data);
|
|
2179
2346
|
}
|
|
2180
2347
|
};
|
|
2181
|
-
|
|
2348
|
+
Xe.create = (e) => new Xe({
|
|
2182
2349
|
typeName: Z.ZodVoid,
|
|
2183
|
-
...
|
|
2350
|
+
...w(e)
|
|
2184
2351
|
});
|
|
2185
|
-
var
|
|
2352
|
+
var N = class e extends T {
|
|
2186
2353
|
_parse(e) {
|
|
2187
2354
|
let { ctx: t, status: n } = this._processInputParams(e), r = this._def;
|
|
2188
|
-
if (t.parsedType !== u.array) return
|
|
2355
|
+
if (t.parsedType !== u.array) return g(t, {
|
|
2189
2356
|
code: f.invalid_type,
|
|
2190
2357
|
expected: u.array,
|
|
2191
2358
|
received: t.parsedType
|
|
2192
|
-
}),
|
|
2359
|
+
}), v;
|
|
2193
2360
|
if (r.exactLength !== null) {
|
|
2194
2361
|
let e = t.data.length > r.exactLength.value, i = t.data.length < r.exactLength.value;
|
|
2195
|
-
(e || i) && (
|
|
2362
|
+
(e || i) && (g(t, {
|
|
2196
2363
|
code: e ? f.too_big : f.too_small,
|
|
2197
2364
|
minimum: i ? r.exactLength.value : void 0,
|
|
2198
2365
|
maximum: e ? r.exactLength.value : void 0,
|
|
@@ -2202,23 +2369,23 @@ var M = class e extends w {
|
|
|
2202
2369
|
message: r.exactLength.message
|
|
2203
2370
|
}), n.dirty());
|
|
2204
2371
|
}
|
|
2205
|
-
if (r.minLength !== null && t.data.length < r.minLength.value && (
|
|
2372
|
+
if (r.minLength !== null && t.data.length < r.minLength.value && (g(t, {
|
|
2206
2373
|
code: f.too_small,
|
|
2207
2374
|
minimum: r.minLength.value,
|
|
2208
2375
|
type: "array",
|
|
2209
2376
|
inclusive: !0,
|
|
2210
2377
|
exact: !1,
|
|
2211
2378
|
message: r.minLength.message
|
|
2212
|
-
}), n.dirty()), r.maxLength !== null && t.data.length > r.maxLength.value && (
|
|
2379
|
+
}), n.dirty()), r.maxLength !== null && t.data.length > r.maxLength.value && (g(t, {
|
|
2213
2380
|
code: f.too_big,
|
|
2214
2381
|
maximum: r.maxLength.value,
|
|
2215
2382
|
type: "array",
|
|
2216
2383
|
inclusive: !0,
|
|
2217
2384
|
exact: !1,
|
|
2218
2385
|
message: r.maxLength.message
|
|
2219
|
-
}), n.dirty()), t.common.async) return Promise.all([...t.data].map((e, n) => r.type._parseAsync(new
|
|
2220
|
-
let i = [...t.data].map((e, n) => r.type._parseSync(new
|
|
2221
|
-
return
|
|
2386
|
+
}), n.dirty()), t.common.async) return Promise.all([...t.data].map((e, n) => r.type._parseAsync(new C(t, e, t.path, n)))).then((e) => _.mergeArray(n, e));
|
|
2387
|
+
let i = [...t.data].map((e, n) => r.type._parseSync(new C(t, e, t.path, n)));
|
|
2388
|
+
return _.mergeArray(n, i);
|
|
2222
2389
|
}
|
|
2223
2390
|
get element() {
|
|
2224
2391
|
return this._def.type;
|
|
@@ -2228,7 +2395,7 @@ var M = class e extends w {
|
|
|
2228
2395
|
...this._def,
|
|
2229
2396
|
minLength: {
|
|
2230
2397
|
value: t,
|
|
2231
|
-
message:
|
|
2398
|
+
message: S.toString(n)
|
|
2232
2399
|
}
|
|
2233
2400
|
});
|
|
2234
2401
|
}
|
|
@@ -2237,7 +2404,7 @@ var M = class e extends w {
|
|
|
2237
2404
|
...this._def,
|
|
2238
2405
|
maxLength: {
|
|
2239
2406
|
value: t,
|
|
2240
|
-
message:
|
|
2407
|
+
message: S.toString(n)
|
|
2241
2408
|
}
|
|
2242
2409
|
});
|
|
2243
2410
|
}
|
|
@@ -2246,7 +2413,7 @@ var M = class e extends w {
|
|
|
2246
2413
|
...this._def,
|
|
2247
2414
|
exactLength: {
|
|
2248
2415
|
value: t,
|
|
2249
|
-
message:
|
|
2416
|
+
message: S.toString(n)
|
|
2250
2417
|
}
|
|
2251
2418
|
});
|
|
2252
2419
|
}
|
|
@@ -2254,32 +2421,32 @@ var M = class e extends w {
|
|
|
2254
2421
|
return this.min(1, e);
|
|
2255
2422
|
}
|
|
2256
2423
|
};
|
|
2257
|
-
|
|
2424
|
+
N.create = (e, t) => new N({
|
|
2258
2425
|
type: e,
|
|
2259
2426
|
minLength: null,
|
|
2260
2427
|
maxLength: null,
|
|
2261
2428
|
exactLength: null,
|
|
2262
2429
|
typeName: Z.ZodArray,
|
|
2263
|
-
...
|
|
2430
|
+
...w(t)
|
|
2264
2431
|
});
|
|
2265
|
-
function
|
|
2266
|
-
if (e instanceof
|
|
2432
|
+
function P(e) {
|
|
2433
|
+
if (e instanceof F) {
|
|
2267
2434
|
let t = {};
|
|
2268
2435
|
for (let n in e.shape) {
|
|
2269
2436
|
let r = e.shape[n];
|
|
2270
|
-
t[n] =
|
|
2437
|
+
t[n] = K.create(P(r));
|
|
2271
2438
|
}
|
|
2272
|
-
return new
|
|
2439
|
+
return new F({
|
|
2273
2440
|
...e._def,
|
|
2274
2441
|
shape: () => t
|
|
2275
2442
|
});
|
|
2276
2443
|
}
|
|
2277
|
-
return e instanceof
|
|
2444
|
+
return e instanceof N ? new N({
|
|
2278
2445
|
...e._def,
|
|
2279
|
-
type:
|
|
2280
|
-
}) : e instanceof
|
|
2446
|
+
type: P(e.element)
|
|
2447
|
+
}) : e instanceof K ? K.create(P(e.unwrap())) : e instanceof q ? q.create(P(e.unwrap())) : e instanceof z ? z.create(e.items.map((e) => P(e))) : e;
|
|
2281
2448
|
}
|
|
2282
|
-
var
|
|
2449
|
+
var F = class e extends T {
|
|
2283
2450
|
constructor() {
|
|
2284
2451
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
2285
2452
|
}
|
|
@@ -2294,14 +2461,14 @@ var P = class e extends w {
|
|
|
2294
2461
|
_parse(e) {
|
|
2295
2462
|
if (this._getType(e) !== u.object) {
|
|
2296
2463
|
let t = this._getOrReturnCtx(e);
|
|
2297
|
-
return
|
|
2464
|
+
return g(t, {
|
|
2298
2465
|
code: f.invalid_type,
|
|
2299
2466
|
expected: u.object,
|
|
2300
2467
|
received: t.parsedType
|
|
2301
|
-
}),
|
|
2468
|
+
}), v;
|
|
2302
2469
|
}
|
|
2303
2470
|
let { status: t, ctx: n } = this._processInputParams(e), { shape: r, keys: i } = this._getCached(), a = [];
|
|
2304
|
-
if (!(this._def.catchall instanceof
|
|
2471
|
+
if (!(this._def.catchall instanceof M && this._def.unknownKeys === "strip")) for (let e in n.data) i.includes(e) || a.push(e);
|
|
2305
2472
|
let o = [];
|
|
2306
2473
|
for (let e of i) {
|
|
2307
2474
|
let t = r[e], i = n.data[e];
|
|
@@ -2310,11 +2477,11 @@ var P = class e extends w {
|
|
|
2310
2477
|
status: "valid",
|
|
2311
2478
|
value: e
|
|
2312
2479
|
},
|
|
2313
|
-
value: t._parse(new
|
|
2480
|
+
value: t._parse(new C(n, i, n.path, e)),
|
|
2314
2481
|
alwaysSet: e in n.data
|
|
2315
2482
|
});
|
|
2316
2483
|
}
|
|
2317
|
-
if (this._def.catchall instanceof
|
|
2484
|
+
if (this._def.catchall instanceof M) {
|
|
2318
2485
|
let e = this._def.unknownKeys;
|
|
2319
2486
|
if (e === "passthrough") for (let e of a) o.push({
|
|
2320
2487
|
key: {
|
|
@@ -2326,7 +2493,7 @@ var P = class e extends w {
|
|
|
2326
2493
|
value: n.data[e]
|
|
2327
2494
|
}
|
|
2328
2495
|
});
|
|
2329
|
-
else if (e === "strict") a.length > 0 && (
|
|
2496
|
+
else if (e === "strict") a.length > 0 && (g(n, {
|
|
2330
2497
|
code: f.unrecognized_keys,
|
|
2331
2498
|
keys: a
|
|
2332
2499
|
}), t.dirty());
|
|
@@ -2340,7 +2507,7 @@ var P = class e extends w {
|
|
|
2340
2507
|
status: "valid",
|
|
2341
2508
|
value: t
|
|
2342
2509
|
},
|
|
2343
|
-
value: e._parse(new
|
|
2510
|
+
value: e._parse(new C(n, r, n.path, t)),
|
|
2344
2511
|
alwaysSet: t in n.data
|
|
2345
2512
|
});
|
|
2346
2513
|
}
|
|
@@ -2356,18 +2523,18 @@ var P = class e extends w {
|
|
|
2356
2523
|
});
|
|
2357
2524
|
}
|
|
2358
2525
|
return e;
|
|
2359
|
-
}).then((e) =>
|
|
2526
|
+
}).then((e) => _.mergeObjectSync(t, e)) : _.mergeObjectSync(t, o);
|
|
2360
2527
|
}
|
|
2361
2528
|
get shape() {
|
|
2362
2529
|
return this._def.shape();
|
|
2363
2530
|
}
|
|
2364
2531
|
strict(t) {
|
|
2365
|
-
return
|
|
2532
|
+
return S.errToObj, new e({
|
|
2366
2533
|
...this._def,
|
|
2367
2534
|
unknownKeys: "strict",
|
|
2368
2535
|
...t === void 0 ? {} : { errorMap: (e, n) => {
|
|
2369
2536
|
let r = this._def.errorMap?.(e, n).message ?? n.defaultError;
|
|
2370
|
-
return e.code === "unrecognized_keys" ? { message:
|
|
2537
|
+
return e.code === "unrecognized_keys" ? { message: S.errToObj(t).message ?? r } : { message: r };
|
|
2371
2538
|
} }
|
|
2372
2539
|
});
|
|
2373
2540
|
}
|
|
@@ -2429,7 +2596,7 @@ var P = class e extends w {
|
|
|
2429
2596
|
});
|
|
2430
2597
|
}
|
|
2431
2598
|
deepPartial() {
|
|
2432
|
-
return
|
|
2599
|
+
return P(this);
|
|
2433
2600
|
}
|
|
2434
2601
|
partial(t) {
|
|
2435
2602
|
let n = {};
|
|
@@ -2447,7 +2614,7 @@ var P = class e extends w {
|
|
|
2447
2614
|
for (let e of l.objectKeys(this.shape)) if (t && !t[e]) n[e] = this.shape[e];
|
|
2448
2615
|
else {
|
|
2449
2616
|
let t = this.shape[e];
|
|
2450
|
-
for (; t instanceof
|
|
2617
|
+
for (; t instanceof K;) t = t._def.innerType;
|
|
2451
2618
|
n[e] = t;
|
|
2452
2619
|
}
|
|
2453
2620
|
return new e({
|
|
@@ -2456,39 +2623,39 @@ var P = class e extends w {
|
|
|
2456
2623
|
});
|
|
2457
2624
|
}
|
|
2458
2625
|
keyof() {
|
|
2459
|
-
return
|
|
2626
|
+
return rt(l.objectKeys(this.shape));
|
|
2460
2627
|
}
|
|
2461
2628
|
};
|
|
2462
|
-
|
|
2629
|
+
F.create = (e, t) => new F({
|
|
2463
2630
|
shape: () => e,
|
|
2464
2631
|
unknownKeys: "strip",
|
|
2465
|
-
catchall:
|
|
2632
|
+
catchall: M.create(),
|
|
2466
2633
|
typeName: Z.ZodObject,
|
|
2467
|
-
...
|
|
2468
|
-
}),
|
|
2634
|
+
...w(t)
|
|
2635
|
+
}), F.strictCreate = (e, t) => new F({
|
|
2469
2636
|
shape: () => e,
|
|
2470
2637
|
unknownKeys: "strict",
|
|
2471
|
-
catchall:
|
|
2638
|
+
catchall: M.create(),
|
|
2472
2639
|
typeName: Z.ZodObject,
|
|
2473
|
-
...
|
|
2474
|
-
}),
|
|
2640
|
+
...w(t)
|
|
2641
|
+
}), F.lazycreate = (e, t) => new F({
|
|
2475
2642
|
shape: e,
|
|
2476
2643
|
unknownKeys: "strip",
|
|
2477
|
-
catchall:
|
|
2644
|
+
catchall: M.create(),
|
|
2478
2645
|
typeName: Z.ZodObject,
|
|
2479
|
-
...
|
|
2646
|
+
...w(t)
|
|
2480
2647
|
});
|
|
2481
|
-
var
|
|
2648
|
+
var I = class extends T {
|
|
2482
2649
|
_parse(e) {
|
|
2483
2650
|
let { ctx: t } = this._processInputParams(e), n = this._def.options;
|
|
2484
2651
|
function r(e) {
|
|
2485
2652
|
for (let t of e) if (t.result.status === "valid") return t.result;
|
|
2486
2653
|
for (let n of e) if (n.result.status === "dirty") return t.common.issues.push(...n.ctx.common.issues), n.result;
|
|
2487
2654
|
let n = e.map((e) => new p(e.ctx.common.issues));
|
|
2488
|
-
return
|
|
2655
|
+
return g(t, {
|
|
2489
2656
|
code: f.invalid_union,
|
|
2490
2657
|
unionErrors: n
|
|
2491
|
-
}),
|
|
2658
|
+
}), v;
|
|
2492
2659
|
}
|
|
2493
2660
|
if (t.common.async) return Promise.all(n.map(async (e) => {
|
|
2494
2661
|
let n = {
|
|
@@ -2531,29 +2698,29 @@ var F = class extends w {
|
|
|
2531
2698
|
}
|
|
2532
2699
|
if (e) return t.common.issues.push(...e.ctx.common.issues), e.result;
|
|
2533
2700
|
let i = r.map((e) => new p(e));
|
|
2534
|
-
return
|
|
2701
|
+
return g(t, {
|
|
2535
2702
|
code: f.invalid_union,
|
|
2536
2703
|
unionErrors: i
|
|
2537
|
-
}),
|
|
2704
|
+
}), v;
|
|
2538
2705
|
}
|
|
2539
2706
|
}
|
|
2540
2707
|
get options() {
|
|
2541
2708
|
return this._def.options;
|
|
2542
2709
|
}
|
|
2543
2710
|
};
|
|
2544
|
-
|
|
2711
|
+
I.create = (e, t) => new I({
|
|
2545
2712
|
options: e,
|
|
2546
2713
|
typeName: Z.ZodUnion,
|
|
2547
|
-
...
|
|
2714
|
+
...w(t)
|
|
2548
2715
|
});
|
|
2549
|
-
var
|
|
2716
|
+
var L = (e) => e instanceof B ? L(e.schema) : e instanceof G ? L(e.innerType()) : e instanceof V ? [e.value] : e instanceof H ? e.options : e instanceof U ? l.objectValues(e.enum) : e instanceof J ? L(e._def.innerType) : e instanceof k ? [void 0] : e instanceof A ? [null] : e instanceof K ? [void 0, ...L(e.unwrap())] : e instanceof q ? [null, ...L(e.unwrap())] : e instanceof at || e instanceof X ? L(e.unwrap()) : e instanceof Y ? L(e._def.innerType) : [], Ze = class e extends T {
|
|
2550
2717
|
_parse(e) {
|
|
2551
2718
|
let { ctx: t } = this._processInputParams(e);
|
|
2552
|
-
if (t.parsedType !== u.object) return
|
|
2719
|
+
if (t.parsedType !== u.object) return g(t, {
|
|
2553
2720
|
code: f.invalid_type,
|
|
2554
2721
|
expected: u.object,
|
|
2555
2722
|
received: t.parsedType
|
|
2556
|
-
}),
|
|
2723
|
+
}), v;
|
|
2557
2724
|
let n = this.discriminator, r = t.data[n], i = this.optionsMap.get(r);
|
|
2558
2725
|
return i ? t.common.async ? i._parseAsync({
|
|
2559
2726
|
data: t.data,
|
|
@@ -2563,11 +2730,11 @@ var I = (e) => e instanceof z ? I(e.schema) : e instanceof W ? I(e.innerType())
|
|
|
2563
2730
|
data: t.data,
|
|
2564
2731
|
path: t.path,
|
|
2565
2732
|
parent: t
|
|
2566
|
-
}) : (
|
|
2733
|
+
}) : (g(t, {
|
|
2567
2734
|
code: f.invalid_union_discriminator,
|
|
2568
2735
|
options: Array.from(this.optionsMap.keys()),
|
|
2569
2736
|
path: [n]
|
|
2570
|
-
}),
|
|
2737
|
+
}), v);
|
|
2571
2738
|
}
|
|
2572
2739
|
get discriminator() {
|
|
2573
2740
|
return this._def.discriminator;
|
|
@@ -2581,7 +2748,7 @@ var I = (e) => e instanceof z ? I(e.schema) : e instanceof W ? I(e.innerType())
|
|
|
2581
2748
|
static create(t, n, r) {
|
|
2582
2749
|
let i = /* @__PURE__ */ new Map();
|
|
2583
2750
|
for (let e of n) {
|
|
2584
|
-
let n =
|
|
2751
|
+
let n = L(e.shape[t]);
|
|
2585
2752
|
if (!n.length) throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);
|
|
2586
2753
|
for (let r of n) {
|
|
2587
2754
|
if (i.has(r)) throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);
|
|
@@ -2593,11 +2760,11 @@ var I = (e) => e instanceof z ? I(e.schema) : e instanceof W ? I(e.innerType())
|
|
|
2593
2760
|
discriminator: t,
|
|
2594
2761
|
options: n,
|
|
2595
2762
|
optionsMap: i,
|
|
2596
|
-
...
|
|
2763
|
+
...w(r)
|
|
2597
2764
|
});
|
|
2598
2765
|
}
|
|
2599
2766
|
};
|
|
2600
|
-
function
|
|
2767
|
+
function Qe(e, t) {
|
|
2601
2768
|
let n = d(e), r = d(t);
|
|
2602
2769
|
if (e === t) return {
|
|
2603
2770
|
valid: !0,
|
|
@@ -2609,7 +2776,7 @@ function Ke(e, t) {
|
|
|
2609
2776
|
...t
|
|
2610
2777
|
};
|
|
2611
2778
|
for (let n of r) {
|
|
2612
|
-
let r =
|
|
2779
|
+
let r = Qe(e[n], t[n]);
|
|
2613
2780
|
if (!r.valid) return { valid: !1 };
|
|
2614
2781
|
i[n] = r.data;
|
|
2615
2782
|
}
|
|
@@ -2622,7 +2789,7 @@ function Ke(e, t) {
|
|
|
2622
2789
|
if (e.length !== t.length) return { valid: !1 };
|
|
2623
2790
|
let n = [];
|
|
2624
2791
|
for (let r = 0; r < e.length; r++) {
|
|
2625
|
-
let i = e[r], a = t[r], o =
|
|
2792
|
+
let i = e[r], a = t[r], o = Qe(i, a);
|
|
2626
2793
|
if (!o.valid) return { valid: !1 };
|
|
2627
2794
|
n.push(o.data);
|
|
2628
2795
|
}
|
|
@@ -2636,15 +2803,15 @@ function Ke(e, t) {
|
|
|
2636
2803
|
data: e
|
|
2637
2804
|
} : { valid: !1 };
|
|
2638
2805
|
}
|
|
2639
|
-
var
|
|
2806
|
+
var R = class extends T {
|
|
2640
2807
|
_parse(e) {
|
|
2641
2808
|
let { status: t, ctx: n } = this._processInputParams(e), r = (e, r) => {
|
|
2642
|
-
if (
|
|
2643
|
-
let i =
|
|
2644
|
-
return i.valid ? ((
|
|
2809
|
+
if (ve(e) || ve(r)) return v;
|
|
2810
|
+
let i = Qe(e.value, r.value);
|
|
2811
|
+
return i.valid ? ((ye(e) || ye(r)) && t.dirty(), {
|
|
2645
2812
|
status: t.value,
|
|
2646
2813
|
value: i.data
|
|
2647
|
-
}) : (
|
|
2814
|
+
}) : (g(n, { code: f.invalid_intersection_types }), v);
|
|
2648
2815
|
};
|
|
2649
2816
|
return n.common.async ? Promise.all([this._def.left._parseAsync({
|
|
2650
2817
|
data: n.data,
|
|
@@ -2665,28 +2832,28 @@ var L = class extends w {
|
|
|
2665
2832
|
}));
|
|
2666
2833
|
}
|
|
2667
2834
|
};
|
|
2668
|
-
|
|
2835
|
+
R.create = (e, t, n) => new R({
|
|
2669
2836
|
left: e,
|
|
2670
2837
|
right: t,
|
|
2671
2838
|
typeName: Z.ZodIntersection,
|
|
2672
|
-
...
|
|
2839
|
+
...w(n)
|
|
2673
2840
|
});
|
|
2674
|
-
var
|
|
2841
|
+
var z = class e extends T {
|
|
2675
2842
|
_parse(e) {
|
|
2676
2843
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2677
|
-
if (n.parsedType !== u.array) return
|
|
2844
|
+
if (n.parsedType !== u.array) return g(n, {
|
|
2678
2845
|
code: f.invalid_type,
|
|
2679
2846
|
expected: u.array,
|
|
2680
2847
|
received: n.parsedType
|
|
2681
|
-
}),
|
|
2682
|
-
if (n.data.length < this._def.items.length) return
|
|
2848
|
+
}), v;
|
|
2849
|
+
if (n.data.length < this._def.items.length) return g(n, {
|
|
2683
2850
|
code: f.too_small,
|
|
2684
2851
|
minimum: this._def.items.length,
|
|
2685
2852
|
inclusive: !0,
|
|
2686
2853
|
exact: !1,
|
|
2687
2854
|
type: "array"
|
|
2688
|
-
}),
|
|
2689
|
-
!this._def.rest && n.data.length > this._def.items.length && (
|
|
2855
|
+
}), v;
|
|
2856
|
+
!this._def.rest && n.data.length > this._def.items.length && (g(n, {
|
|
2690
2857
|
code: f.too_big,
|
|
2691
2858
|
maximum: this._def.items.length,
|
|
2692
2859
|
inclusive: !0,
|
|
@@ -2695,9 +2862,9 @@ var R = class e extends w {
|
|
|
2695
2862
|
}), t.dirty());
|
|
2696
2863
|
let r = [...n.data].map((e, t) => {
|
|
2697
2864
|
let r = this._def.items[t] || this._def.rest;
|
|
2698
|
-
return r ? r._parse(new
|
|
2865
|
+
return r ? r._parse(new C(n, e, n.path, t)) : null;
|
|
2699
2866
|
}).filter((e) => !!e);
|
|
2700
|
-
return n.common.async ? Promise.all(r).then((e) =>
|
|
2867
|
+
return n.common.async ? Promise.all(r).then((e) => _.mergeArray(t, e)) : _.mergeArray(t, r);
|
|
2701
2868
|
}
|
|
2702
2869
|
get items() {
|
|
2703
2870
|
return this._def.items;
|
|
@@ -2709,16 +2876,16 @@ var R = class e extends w {
|
|
|
2709
2876
|
});
|
|
2710
2877
|
}
|
|
2711
2878
|
};
|
|
2712
|
-
|
|
2879
|
+
z.create = (e, t) => {
|
|
2713
2880
|
if (!Array.isArray(e)) throw Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2714
|
-
return new
|
|
2881
|
+
return new z({
|
|
2715
2882
|
items: e,
|
|
2716
2883
|
typeName: Z.ZodTuple,
|
|
2717
2884
|
rest: null,
|
|
2718
|
-
...
|
|
2885
|
+
...w(t)
|
|
2719
2886
|
});
|
|
2720
2887
|
};
|
|
2721
|
-
var
|
|
2888
|
+
var $e = class e extends T {
|
|
2722
2889
|
get keySchema() {
|
|
2723
2890
|
return this._def.keyType;
|
|
2724
2891
|
}
|
|
@@ -2727,36 +2894,36 @@ var qe = class e extends w {
|
|
|
2727
2894
|
}
|
|
2728
2895
|
_parse(e) {
|
|
2729
2896
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2730
|
-
if (n.parsedType !== u.object) return
|
|
2897
|
+
if (n.parsedType !== u.object) return g(n, {
|
|
2731
2898
|
code: f.invalid_type,
|
|
2732
2899
|
expected: u.object,
|
|
2733
2900
|
received: n.parsedType
|
|
2734
|
-
}),
|
|
2901
|
+
}), v;
|
|
2735
2902
|
let r = [], i = this._def.keyType, a = this._def.valueType;
|
|
2736
2903
|
for (let e in n.data) r.push({
|
|
2737
|
-
key: i._parse(new
|
|
2738
|
-
value: a._parse(new
|
|
2904
|
+
key: i._parse(new C(n, e, n.path, e)),
|
|
2905
|
+
value: a._parse(new C(n, n.data[e], n.path, e)),
|
|
2739
2906
|
alwaysSet: e in n.data
|
|
2740
2907
|
});
|
|
2741
|
-
return n.common.async ?
|
|
2908
|
+
return n.common.async ? _.mergeObjectAsync(t, r) : _.mergeObjectSync(t, r);
|
|
2742
2909
|
}
|
|
2743
2910
|
get element() {
|
|
2744
2911
|
return this._def.valueType;
|
|
2745
2912
|
}
|
|
2746
2913
|
static create(t, n, r) {
|
|
2747
|
-
return n instanceof
|
|
2914
|
+
return n instanceof T ? new e({
|
|
2748
2915
|
keyType: t,
|
|
2749
2916
|
valueType: n,
|
|
2750
2917
|
typeName: Z.ZodRecord,
|
|
2751
|
-
...
|
|
2918
|
+
...w(r)
|
|
2752
2919
|
}) : new e({
|
|
2753
|
-
keyType:
|
|
2920
|
+
keyType: E.create(),
|
|
2754
2921
|
valueType: t,
|
|
2755
2922
|
typeName: Z.ZodRecord,
|
|
2756
|
-
...
|
|
2923
|
+
...w(n)
|
|
2757
2924
|
});
|
|
2758
2925
|
}
|
|
2759
|
-
},
|
|
2926
|
+
}, et = class extends T {
|
|
2760
2927
|
get keySchema() {
|
|
2761
2928
|
return this._def.keyType;
|
|
2762
2929
|
}
|
|
@@ -2765,21 +2932,21 @@ var qe = class e extends w {
|
|
|
2765
2932
|
}
|
|
2766
2933
|
_parse(e) {
|
|
2767
2934
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2768
|
-
if (n.parsedType !== u.map) return
|
|
2935
|
+
if (n.parsedType !== u.map) return g(n, {
|
|
2769
2936
|
code: f.invalid_type,
|
|
2770
2937
|
expected: u.map,
|
|
2771
2938
|
received: n.parsedType
|
|
2772
|
-
}),
|
|
2939
|
+
}), v;
|
|
2773
2940
|
let r = this._def.keyType, i = this._def.valueType, a = [...n.data.entries()].map(([e, t], a) => ({
|
|
2774
|
-
key: r._parse(new
|
|
2775
|
-
value: i._parse(new
|
|
2941
|
+
key: r._parse(new C(n, e, n.path, [a, "key"])),
|
|
2942
|
+
value: i._parse(new C(n, t, n.path, [a, "value"]))
|
|
2776
2943
|
}));
|
|
2777
2944
|
if (n.common.async) {
|
|
2778
2945
|
let e = /* @__PURE__ */ new Map();
|
|
2779
2946
|
return Promise.resolve().then(async () => {
|
|
2780
2947
|
for (let n of a) {
|
|
2781
2948
|
let r = await n.key, i = await n.value;
|
|
2782
|
-
if (r.status === "aborted" || i.status === "aborted") return
|
|
2949
|
+
if (r.status === "aborted" || i.status === "aborted") return v;
|
|
2783
2950
|
(r.status === "dirty" || i.status === "dirty") && t.dirty(), e.set(r.value, i.value);
|
|
2784
2951
|
}
|
|
2785
2952
|
return {
|
|
@@ -2792,7 +2959,7 @@ var qe = class e extends w {
|
|
|
2792
2959
|
let e = /* @__PURE__ */ new Map();
|
|
2793
2960
|
for (let n of a) {
|
|
2794
2961
|
let r = n.key, i = n.value;
|
|
2795
|
-
if (r.status === "aborted" || i.status === "aborted") return
|
|
2962
|
+
if (r.status === "aborted" || i.status === "aborted") return v;
|
|
2796
2963
|
(r.status === "dirty" || i.status === "dirty") && t.dirty(), e.set(r.value, i.value);
|
|
2797
2964
|
}
|
|
2798
2965
|
return {
|
|
@@ -2802,29 +2969,29 @@ var qe = class e extends w {
|
|
|
2802
2969
|
}
|
|
2803
2970
|
}
|
|
2804
2971
|
};
|
|
2805
|
-
|
|
2972
|
+
et.create = (e, t, n) => new et({
|
|
2806
2973
|
valueType: t,
|
|
2807
2974
|
keyType: e,
|
|
2808
2975
|
typeName: Z.ZodMap,
|
|
2809
|
-
...
|
|
2976
|
+
...w(n)
|
|
2810
2977
|
});
|
|
2811
|
-
var
|
|
2978
|
+
var tt = class e extends T {
|
|
2812
2979
|
_parse(e) {
|
|
2813
2980
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2814
|
-
if (n.parsedType !== u.set) return
|
|
2981
|
+
if (n.parsedType !== u.set) return g(n, {
|
|
2815
2982
|
code: f.invalid_type,
|
|
2816
2983
|
expected: u.set,
|
|
2817
2984
|
received: n.parsedType
|
|
2818
|
-
}),
|
|
2985
|
+
}), v;
|
|
2819
2986
|
let r = this._def;
|
|
2820
|
-
r.minSize !== null && n.data.size < r.minSize.value && (
|
|
2987
|
+
r.minSize !== null && n.data.size < r.minSize.value && (g(n, {
|
|
2821
2988
|
code: f.too_small,
|
|
2822
2989
|
minimum: r.minSize.value,
|
|
2823
2990
|
type: "set",
|
|
2824
2991
|
inclusive: !0,
|
|
2825
2992
|
exact: !1,
|
|
2826
2993
|
message: r.minSize.message
|
|
2827
|
-
}), t.dirty()), r.maxSize !== null && n.data.size > r.maxSize.value && (
|
|
2994
|
+
}), t.dirty()), r.maxSize !== null && n.data.size > r.maxSize.value && (g(n, {
|
|
2828
2995
|
code: f.too_big,
|
|
2829
2996
|
maximum: r.maxSize.value,
|
|
2830
2997
|
type: "set",
|
|
@@ -2836,7 +3003,7 @@ var Ye = class e extends w {
|
|
|
2836
3003
|
function a(e) {
|
|
2837
3004
|
let n = /* @__PURE__ */ new Set();
|
|
2838
3005
|
for (let r of e) {
|
|
2839
|
-
if (r.status === "aborted") return
|
|
3006
|
+
if (r.status === "aborted") return v;
|
|
2840
3007
|
r.status === "dirty" && t.dirty(), n.add(r.value);
|
|
2841
3008
|
}
|
|
2842
3009
|
return {
|
|
@@ -2844,7 +3011,7 @@ var Ye = class e extends w {
|
|
|
2844
3011
|
value: n
|
|
2845
3012
|
};
|
|
2846
3013
|
}
|
|
2847
|
-
let o = [...n.data.values()].map((e, t) => i._parse(new
|
|
3014
|
+
let o = [...n.data.values()].map((e, t) => i._parse(new C(n, e, n.path, t)));
|
|
2848
3015
|
return n.common.async ? Promise.all(o).then((e) => a(e)) : a(o);
|
|
2849
3016
|
}
|
|
2850
3017
|
min(t, n) {
|
|
@@ -2852,7 +3019,7 @@ var Ye = class e extends w {
|
|
|
2852
3019
|
...this._def,
|
|
2853
3020
|
minSize: {
|
|
2854
3021
|
value: t,
|
|
2855
|
-
message:
|
|
3022
|
+
message: S.toString(n)
|
|
2856
3023
|
}
|
|
2857
3024
|
});
|
|
2858
3025
|
}
|
|
@@ -2861,7 +3028,7 @@ var Ye = class e extends w {
|
|
|
2861
3028
|
...this._def,
|
|
2862
3029
|
maxSize: {
|
|
2863
3030
|
value: t,
|
|
2864
|
-
message:
|
|
3031
|
+
message: S.toString(n)
|
|
2865
3032
|
}
|
|
2866
3033
|
});
|
|
2867
3034
|
}
|
|
@@ -2872,32 +3039,32 @@ var Ye = class e extends w {
|
|
|
2872
3039
|
return this.min(1, e);
|
|
2873
3040
|
}
|
|
2874
3041
|
};
|
|
2875
|
-
|
|
3042
|
+
tt.create = (e, t) => new tt({
|
|
2876
3043
|
valueType: e,
|
|
2877
3044
|
minSize: null,
|
|
2878
3045
|
maxSize: null,
|
|
2879
3046
|
typeName: Z.ZodSet,
|
|
2880
|
-
...
|
|
3047
|
+
...w(t)
|
|
2881
3048
|
});
|
|
2882
|
-
var
|
|
3049
|
+
var nt = class e extends T {
|
|
2883
3050
|
constructor() {
|
|
2884
3051
|
super(...arguments), this.validate = this.implement;
|
|
2885
3052
|
}
|
|
2886
3053
|
_parse(e) {
|
|
2887
3054
|
let { ctx: t } = this._processInputParams(e);
|
|
2888
|
-
if (t.parsedType !== u.function) return
|
|
3055
|
+
if (t.parsedType !== u.function) return g(t, {
|
|
2889
3056
|
code: f.invalid_type,
|
|
2890
3057
|
expected: u.function,
|
|
2891
3058
|
received: t.parsedType
|
|
2892
|
-
}),
|
|
3059
|
+
}), v;
|
|
2893
3060
|
function n(e, n) {
|
|
2894
|
-
return
|
|
3061
|
+
return h({
|
|
2895
3062
|
data: e,
|
|
2896
3063
|
path: t.path,
|
|
2897
3064
|
errorMaps: [
|
|
2898
3065
|
t.common.contextualErrorMap,
|
|
2899
3066
|
t.schemaErrorMap,
|
|
2900
|
-
|
|
3067
|
+
ge(),
|
|
2901
3068
|
m
|
|
2902
3069
|
].filter((e) => !!e),
|
|
2903
3070
|
issueData: {
|
|
@@ -2907,13 +3074,13 @@ var Xe = class e extends w {
|
|
|
2907
3074
|
});
|
|
2908
3075
|
}
|
|
2909
3076
|
function r(e, n) {
|
|
2910
|
-
return
|
|
3077
|
+
return h({
|
|
2911
3078
|
data: e,
|
|
2912
3079
|
path: t.path,
|
|
2913
3080
|
errorMaps: [
|
|
2914
3081
|
t.common.contextualErrorMap,
|
|
2915
3082
|
t.schemaErrorMap,
|
|
2916
|
-
|
|
3083
|
+
ge(),
|
|
2917
3084
|
m
|
|
2918
3085
|
].filter((e) => !!e),
|
|
2919
3086
|
issueData: {
|
|
@@ -2923,9 +3090,9 @@ var Xe = class e extends w {
|
|
|
2923
3090
|
});
|
|
2924
3091
|
}
|
|
2925
3092
|
let i = { errorMap: t.common.contextualErrorMap }, a = t.data;
|
|
2926
|
-
if (this._def.returns instanceof
|
|
3093
|
+
if (this._def.returns instanceof W) {
|
|
2927
3094
|
let e = this;
|
|
2928
|
-
return
|
|
3095
|
+
return y(async function(...t) {
|
|
2929
3096
|
let o = new p([]), s = await e._def.args.parseAsync(t, i).catch((e) => {
|
|
2930
3097
|
throw o.addIssue(n(t, e)), o;
|
|
2931
3098
|
}), c = await Reflect.apply(a, this, s);
|
|
@@ -2936,7 +3103,7 @@ var Xe = class e extends w {
|
|
|
2936
3103
|
}
|
|
2937
3104
|
{
|
|
2938
3105
|
let e = this;
|
|
2939
|
-
return
|
|
3106
|
+
return y(function(...t) {
|
|
2940
3107
|
let o = e._def.args.safeParse(t, i);
|
|
2941
3108
|
if (!o.success) throw new p([n(t, o.error)]);
|
|
2942
3109
|
let s = Reflect.apply(a, this, o.data), c = e._def.returns.safeParse(s, i);
|
|
@@ -2954,7 +3121,7 @@ var Xe = class e extends w {
|
|
|
2954
3121
|
args(...t) {
|
|
2955
3122
|
return new e({
|
|
2956
3123
|
...this._def,
|
|
2957
|
-
args:
|
|
3124
|
+
args: z.create(t).rest(j.create())
|
|
2958
3125
|
});
|
|
2959
3126
|
}
|
|
2960
3127
|
returns(t) {
|
|
@@ -2971,13 +3138,13 @@ var Xe = class e extends w {
|
|
|
2971
3138
|
}
|
|
2972
3139
|
static create(t, n, r) {
|
|
2973
3140
|
return new e({
|
|
2974
|
-
args: t ||
|
|
2975
|
-
returns: n ||
|
|
3141
|
+
args: t || z.create([]).rest(j.create()),
|
|
3142
|
+
returns: n || j.create(),
|
|
2976
3143
|
typeName: Z.ZodFunction,
|
|
2977
|
-
...
|
|
3144
|
+
...w(r)
|
|
2978
3145
|
});
|
|
2979
3146
|
}
|
|
2980
|
-
},
|
|
3147
|
+
}, B = class extends T {
|
|
2981
3148
|
get schema() {
|
|
2982
3149
|
return this._def.getter();
|
|
2983
3150
|
}
|
|
@@ -2990,20 +3157,20 @@ var Xe = class e extends w {
|
|
|
2990
3157
|
});
|
|
2991
3158
|
}
|
|
2992
3159
|
};
|
|
2993
|
-
|
|
3160
|
+
B.create = (e, t) => new B({
|
|
2994
3161
|
getter: e,
|
|
2995
3162
|
typeName: Z.ZodLazy,
|
|
2996
|
-
...
|
|
3163
|
+
...w(t)
|
|
2997
3164
|
});
|
|
2998
|
-
var
|
|
3165
|
+
var V = class extends T {
|
|
2999
3166
|
_parse(e) {
|
|
3000
3167
|
if (e.data !== this._def.value) {
|
|
3001
3168
|
let t = this._getOrReturnCtx(e);
|
|
3002
|
-
return
|
|
3169
|
+
return g(t, {
|
|
3003
3170
|
received: t.data,
|
|
3004
3171
|
code: f.invalid_literal,
|
|
3005
3172
|
expected: this._def.value
|
|
3006
|
-
}),
|
|
3173
|
+
}), v;
|
|
3007
3174
|
}
|
|
3008
3175
|
return {
|
|
3009
3176
|
status: "valid",
|
|
@@ -3014,37 +3181,37 @@ var B = class extends w {
|
|
|
3014
3181
|
return this._def.value;
|
|
3015
3182
|
}
|
|
3016
3183
|
};
|
|
3017
|
-
|
|
3184
|
+
V.create = (e, t) => new V({
|
|
3018
3185
|
value: e,
|
|
3019
3186
|
typeName: Z.ZodLiteral,
|
|
3020
|
-
...
|
|
3187
|
+
...w(t)
|
|
3021
3188
|
});
|
|
3022
|
-
function
|
|
3023
|
-
return new
|
|
3189
|
+
function rt(e, t) {
|
|
3190
|
+
return new H({
|
|
3024
3191
|
values: e,
|
|
3025
3192
|
typeName: Z.ZodEnum,
|
|
3026
|
-
...
|
|
3193
|
+
...w(t)
|
|
3027
3194
|
});
|
|
3028
3195
|
}
|
|
3029
|
-
var
|
|
3196
|
+
var H = class e extends T {
|
|
3030
3197
|
_parse(e) {
|
|
3031
3198
|
if (typeof e.data != "string") {
|
|
3032
3199
|
let t = this._getOrReturnCtx(e), n = this._def.values;
|
|
3033
|
-
return
|
|
3200
|
+
return g(t, {
|
|
3034
3201
|
expected: l.joinValues(n),
|
|
3035
3202
|
received: t.parsedType,
|
|
3036
3203
|
code: f.invalid_type
|
|
3037
|
-
}),
|
|
3204
|
+
}), v;
|
|
3038
3205
|
}
|
|
3039
3206
|
if (this._cache ||= new Set(this._def.values), !this._cache.has(e.data)) {
|
|
3040
3207
|
let t = this._getOrReturnCtx(e), n = this._def.values;
|
|
3041
|
-
return
|
|
3208
|
+
return g(t, {
|
|
3042
3209
|
received: t.data,
|
|
3043
3210
|
code: f.invalid_enum_value,
|
|
3044
3211
|
options: n
|
|
3045
|
-
}),
|
|
3212
|
+
}), v;
|
|
3046
3213
|
}
|
|
3047
|
-
return
|
|
3214
|
+
return y(e.data);
|
|
3048
3215
|
}
|
|
3049
3216
|
get options() {
|
|
3050
3217
|
return this._def.values;
|
|
@@ -3077,59 +3244,59 @@ var V = class e extends w {
|
|
|
3077
3244
|
});
|
|
3078
3245
|
}
|
|
3079
3246
|
};
|
|
3080
|
-
|
|
3081
|
-
var
|
|
3247
|
+
H.create = rt;
|
|
3248
|
+
var U = class extends T {
|
|
3082
3249
|
_parse(e) {
|
|
3083
3250
|
let t = l.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
3084
3251
|
if (n.parsedType !== u.string && n.parsedType !== u.number) {
|
|
3085
3252
|
let e = l.objectValues(t);
|
|
3086
|
-
return
|
|
3253
|
+
return g(n, {
|
|
3087
3254
|
expected: l.joinValues(e),
|
|
3088
3255
|
received: n.parsedType,
|
|
3089
3256
|
code: f.invalid_type
|
|
3090
|
-
}),
|
|
3257
|
+
}), v;
|
|
3091
3258
|
}
|
|
3092
3259
|
if (this._cache ||= new Set(l.getValidEnumValues(this._def.values)), !this._cache.has(e.data)) {
|
|
3093
3260
|
let e = l.objectValues(t);
|
|
3094
|
-
return
|
|
3261
|
+
return g(n, {
|
|
3095
3262
|
received: n.data,
|
|
3096
3263
|
code: f.invalid_enum_value,
|
|
3097
3264
|
options: e
|
|
3098
|
-
}),
|
|
3265
|
+
}), v;
|
|
3099
3266
|
}
|
|
3100
|
-
return
|
|
3267
|
+
return y(e.data);
|
|
3101
3268
|
}
|
|
3102
3269
|
get enum() {
|
|
3103
3270
|
return this._def.values;
|
|
3104
3271
|
}
|
|
3105
3272
|
};
|
|
3106
|
-
|
|
3273
|
+
U.create = (e, t) => new U({
|
|
3107
3274
|
values: e,
|
|
3108
3275
|
typeName: Z.ZodNativeEnum,
|
|
3109
|
-
...
|
|
3276
|
+
...w(t)
|
|
3110
3277
|
});
|
|
3111
|
-
var
|
|
3278
|
+
var W = class extends T {
|
|
3112
3279
|
unwrap() {
|
|
3113
3280
|
return this._def.type;
|
|
3114
3281
|
}
|
|
3115
3282
|
_parse(e) {
|
|
3116
3283
|
let { ctx: t } = this._processInputParams(e);
|
|
3117
|
-
return t.parsedType !== u.promise && t.common.async === !1 ? (
|
|
3284
|
+
return t.parsedType !== u.promise && t.common.async === !1 ? (g(t, {
|
|
3118
3285
|
code: f.invalid_type,
|
|
3119
3286
|
expected: u.promise,
|
|
3120
3287
|
received: t.parsedType
|
|
3121
|
-
}),
|
|
3288
|
+
}), v) : y((t.parsedType === u.promise ? t.data : Promise.resolve(t.data)).then((e) => this._def.type.parseAsync(e, {
|
|
3122
3289
|
path: t.path,
|
|
3123
3290
|
errorMap: t.common.contextualErrorMap
|
|
3124
3291
|
})));
|
|
3125
3292
|
}
|
|
3126
3293
|
};
|
|
3127
|
-
|
|
3294
|
+
W.create = (e, t) => new W({
|
|
3128
3295
|
type: e,
|
|
3129
3296
|
typeName: Z.ZodPromise,
|
|
3130
|
-
...
|
|
3297
|
+
...w(t)
|
|
3131
3298
|
});
|
|
3132
|
-
var
|
|
3299
|
+
var G = class extends T {
|
|
3133
3300
|
innerType() {
|
|
3134
3301
|
return this._def.schema;
|
|
3135
3302
|
}
|
|
@@ -3139,7 +3306,7 @@ var W = class extends w {
|
|
|
3139
3306
|
_parse(e) {
|
|
3140
3307
|
let { status: t, ctx: n } = this._processInputParams(e), r = this._def.effect || null, i = {
|
|
3141
3308
|
addIssue: (e) => {
|
|
3142
|
-
|
|
3309
|
+
g(n, e), e.fatal ? t.abort() : t.dirty();
|
|
3143
3310
|
},
|
|
3144
3311
|
get path() {
|
|
3145
3312
|
return n.path;
|
|
@@ -3148,22 +3315,22 @@ var W = class extends w {
|
|
|
3148
3315
|
if (i.addIssue = i.addIssue.bind(i), r.type === "preprocess") {
|
|
3149
3316
|
let e = r.transform(n.data, i);
|
|
3150
3317
|
if (n.common.async) return Promise.resolve(e).then(async (e) => {
|
|
3151
|
-
if (t.value === "aborted") return
|
|
3318
|
+
if (t.value === "aborted") return v;
|
|
3152
3319
|
let r = await this._def.schema._parseAsync({
|
|
3153
3320
|
data: e,
|
|
3154
3321
|
path: n.path,
|
|
3155
3322
|
parent: n
|
|
3156
3323
|
});
|
|
3157
|
-
return r.status === "aborted" ?
|
|
3324
|
+
return r.status === "aborted" ? v : r.status === "dirty" || t.value === "dirty" ? _e(r.value) : r;
|
|
3158
3325
|
});
|
|
3159
3326
|
{
|
|
3160
|
-
if (t.value === "aborted") return
|
|
3327
|
+
if (t.value === "aborted") return v;
|
|
3161
3328
|
let r = this._def.schema._parseSync({
|
|
3162
3329
|
data: e,
|
|
3163
3330
|
path: n.path,
|
|
3164
3331
|
parent: n
|
|
3165
3332
|
});
|
|
3166
|
-
return r.status === "aborted" ?
|
|
3333
|
+
return r.status === "aborted" ? v : r.status === "dirty" || t.value === "dirty" ? _e(r.value) : r;
|
|
3167
3334
|
}
|
|
3168
3335
|
}
|
|
3169
3336
|
if (r.type === "refinement") {
|
|
@@ -3179,7 +3346,7 @@ var W = class extends w {
|
|
|
3179
3346
|
path: n.path,
|
|
3180
3347
|
parent: n
|
|
3181
3348
|
});
|
|
3182
|
-
return r.status === "aborted" ?
|
|
3349
|
+
return r.status === "aborted" ? v : (r.status === "dirty" && t.dirty(), e(r.value), {
|
|
3183
3350
|
status: t.value,
|
|
3184
3351
|
value: r.value
|
|
3185
3352
|
});
|
|
@@ -3188,7 +3355,7 @@ var W = class extends w {
|
|
|
3188
3355
|
data: n.data,
|
|
3189
3356
|
path: n.path,
|
|
3190
3357
|
parent: n
|
|
3191
|
-
}).then((n) => n.status === "aborted" ?
|
|
3358
|
+
}).then((n) => n.status === "aborted" ? v : (n.status === "dirty" && t.dirty(), e(n.value).then(() => ({
|
|
3192
3359
|
status: t.value,
|
|
3193
3360
|
value: n.value
|
|
3194
3361
|
}))));
|
|
@@ -3200,7 +3367,7 @@ var W = class extends w {
|
|
|
3200
3367
|
path: n.path,
|
|
3201
3368
|
parent: n
|
|
3202
3369
|
});
|
|
3203
|
-
if (!
|
|
3370
|
+
if (!b(e)) return v;
|
|
3204
3371
|
let a = r.transform(e.value, i);
|
|
3205
3372
|
if (a instanceof Promise) throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
3206
3373
|
return {
|
|
@@ -3212,55 +3379,55 @@ var W = class extends w {
|
|
|
3212
3379
|
data: n.data,
|
|
3213
3380
|
path: n.path,
|
|
3214
3381
|
parent: n
|
|
3215
|
-
}).then((e) =>
|
|
3382
|
+
}).then((e) => b(e) ? Promise.resolve(r.transform(e.value, i)).then((e) => ({
|
|
3216
3383
|
status: t.value,
|
|
3217
3384
|
value: e
|
|
3218
|
-
})) :
|
|
3385
|
+
})) : v);
|
|
3219
3386
|
}
|
|
3220
3387
|
l.assertNever(r);
|
|
3221
3388
|
}
|
|
3222
3389
|
};
|
|
3223
|
-
|
|
3390
|
+
G.create = (e, t, n) => new G({
|
|
3224
3391
|
schema: e,
|
|
3225
3392
|
typeName: Z.ZodEffects,
|
|
3226
3393
|
effect: t,
|
|
3227
|
-
...
|
|
3228
|
-
}),
|
|
3394
|
+
...w(n)
|
|
3395
|
+
}), G.createWithPreprocess = (e, t, n) => new G({
|
|
3229
3396
|
schema: t,
|
|
3230
3397
|
effect: {
|
|
3231
3398
|
type: "preprocess",
|
|
3232
3399
|
transform: e
|
|
3233
3400
|
},
|
|
3234
3401
|
typeName: Z.ZodEffects,
|
|
3235
|
-
...
|
|
3402
|
+
...w(n)
|
|
3236
3403
|
});
|
|
3237
|
-
var
|
|
3404
|
+
var K = class extends T {
|
|
3238
3405
|
_parse(e) {
|
|
3239
|
-
return this._getType(e) === u.undefined ?
|
|
3406
|
+
return this._getType(e) === u.undefined ? y(void 0) : this._def.innerType._parse(e);
|
|
3240
3407
|
}
|
|
3241
3408
|
unwrap() {
|
|
3242
3409
|
return this._def.innerType;
|
|
3243
3410
|
}
|
|
3244
3411
|
};
|
|
3245
|
-
|
|
3412
|
+
K.create = (e, t) => new K({
|
|
3246
3413
|
innerType: e,
|
|
3247
3414
|
typeName: Z.ZodOptional,
|
|
3248
|
-
...
|
|
3415
|
+
...w(t)
|
|
3249
3416
|
});
|
|
3250
|
-
var
|
|
3417
|
+
var q = class extends T {
|
|
3251
3418
|
_parse(e) {
|
|
3252
|
-
return this._getType(e) === u.null ?
|
|
3419
|
+
return this._getType(e) === u.null ? y(null) : this._def.innerType._parse(e);
|
|
3253
3420
|
}
|
|
3254
3421
|
unwrap() {
|
|
3255
3422
|
return this._def.innerType;
|
|
3256
3423
|
}
|
|
3257
3424
|
};
|
|
3258
|
-
|
|
3425
|
+
q.create = (e, t) => new q({
|
|
3259
3426
|
innerType: e,
|
|
3260
3427
|
typeName: Z.ZodNullable,
|
|
3261
|
-
...
|
|
3428
|
+
...w(t)
|
|
3262
3429
|
});
|
|
3263
|
-
var
|
|
3430
|
+
var J = class extends T {
|
|
3264
3431
|
_parse(e) {
|
|
3265
3432
|
let { ctx: t } = this._processInputParams(e), n = t.data;
|
|
3266
3433
|
return t.parsedType === u.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
|
|
@@ -3273,13 +3440,13 @@ var q = class extends w {
|
|
|
3273
3440
|
return this._def.innerType;
|
|
3274
3441
|
}
|
|
3275
3442
|
};
|
|
3276
|
-
|
|
3443
|
+
J.create = (e, t) => new J({
|
|
3277
3444
|
innerType: e,
|
|
3278
3445
|
typeName: Z.ZodDefault,
|
|
3279
3446
|
defaultValue: typeof t.default == "function" ? t.default : () => t.default,
|
|
3280
|
-
...
|
|
3447
|
+
...w(t)
|
|
3281
3448
|
});
|
|
3282
|
-
var
|
|
3449
|
+
var Y = class extends T {
|
|
3283
3450
|
_parse(e) {
|
|
3284
3451
|
let { ctx: t } = this._processInputParams(e), n = {
|
|
3285
3452
|
...t,
|
|
@@ -3292,7 +3459,7 @@ var J = class extends w {
|
|
|
3292
3459
|
path: n.path,
|
|
3293
3460
|
parent: { ...n }
|
|
3294
3461
|
});
|
|
3295
|
-
return
|
|
3462
|
+
return x(r) ? r.then((e) => ({
|
|
3296
3463
|
status: "valid",
|
|
3297
3464
|
value: e.status === "valid" ? e.value : this._def.catchValue({
|
|
3298
3465
|
get error() {
|
|
@@ -3314,21 +3481,21 @@ var J = class extends w {
|
|
|
3314
3481
|
return this._def.innerType;
|
|
3315
3482
|
}
|
|
3316
3483
|
};
|
|
3317
|
-
|
|
3484
|
+
Y.create = (e, t) => new Y({
|
|
3318
3485
|
innerType: e,
|
|
3319
3486
|
typeName: Z.ZodCatch,
|
|
3320
3487
|
catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
|
|
3321
|
-
...
|
|
3488
|
+
...w(t)
|
|
3322
3489
|
});
|
|
3323
|
-
var
|
|
3490
|
+
var it = class extends T {
|
|
3324
3491
|
_parse(e) {
|
|
3325
3492
|
if (this._getType(e) !== u.nan) {
|
|
3326
3493
|
let t = this._getOrReturnCtx(e);
|
|
3327
|
-
return
|
|
3494
|
+
return g(t, {
|
|
3328
3495
|
code: f.invalid_type,
|
|
3329
3496
|
expected: u.nan,
|
|
3330
3497
|
received: t.parsedType
|
|
3331
|
-
}),
|
|
3498
|
+
}), v;
|
|
3332
3499
|
}
|
|
3333
3500
|
return {
|
|
3334
3501
|
status: "valid",
|
|
@@ -3336,11 +3503,11 @@ var Y = class extends w {
|
|
|
3336
3503
|
};
|
|
3337
3504
|
}
|
|
3338
3505
|
};
|
|
3339
|
-
|
|
3506
|
+
it.create = (e) => new it({
|
|
3340
3507
|
typeName: Z.ZodNaN,
|
|
3341
|
-
...
|
|
3508
|
+
...w(e)
|
|
3342
3509
|
});
|
|
3343
|
-
var
|
|
3510
|
+
var at = class extends T {
|
|
3344
3511
|
_parse(e) {
|
|
3345
3512
|
let { ctx: t } = this._processInputParams(e), n = t.data;
|
|
3346
3513
|
return this._def.type._parse({
|
|
@@ -3352,7 +3519,7 @@ var Qe = class extends w {
|
|
|
3352
3519
|
unwrap() {
|
|
3353
3520
|
return this._def.type;
|
|
3354
3521
|
}
|
|
3355
|
-
},
|
|
3522
|
+
}, ot = class e extends T {
|
|
3356
3523
|
_parse(e) {
|
|
3357
3524
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
3358
3525
|
if (n.common.async) return (async () => {
|
|
@@ -3361,7 +3528,7 @@ var Qe = class extends w {
|
|
|
3361
3528
|
path: n.path,
|
|
3362
3529
|
parent: n
|
|
3363
3530
|
});
|
|
3364
|
-
return e.status === "aborted" ?
|
|
3531
|
+
return e.status === "aborted" ? v : e.status === "dirty" ? (t.dirty(), _e(e.value)) : this._def.out._parseAsync({
|
|
3365
3532
|
data: e.value,
|
|
3366
3533
|
path: n.path,
|
|
3367
3534
|
parent: n
|
|
@@ -3373,7 +3540,7 @@ var Qe = class extends w {
|
|
|
3373
3540
|
path: n.path,
|
|
3374
3541
|
parent: n
|
|
3375
3542
|
});
|
|
3376
|
-
return e.status === "aborted" ?
|
|
3543
|
+
return e.status === "aborted" ? v : e.status === "dirty" ? (t.dirty(), {
|
|
3377
3544
|
status: "dirty",
|
|
3378
3545
|
value: e.value
|
|
3379
3546
|
}) : this._def.out._parseSync({
|
|
@@ -3390,10 +3557,10 @@ var Qe = class extends w {
|
|
|
3390
3557
|
typeName: Z.ZodPipeline
|
|
3391
3558
|
});
|
|
3392
3559
|
}
|
|
3393
|
-
}, X = class extends
|
|
3560
|
+
}, X = class extends T {
|
|
3394
3561
|
_parse(e) {
|
|
3395
|
-
let t = this._def.innerType._parse(e), n = (e) => (
|
|
3396
|
-
return
|
|
3562
|
+
let t = this._def.innerType._parse(e), n = (e) => (b(e) && (e.value = Object.freeze(e.value)), e);
|
|
3563
|
+
return x(t) ? t.then((e) => n(e)) : n(t);
|
|
3397
3564
|
}
|
|
3398
3565
|
unwrap() {
|
|
3399
3566
|
return this._def.innerType;
|
|
@@ -3402,19 +3569,19 @@ var Qe = class extends w {
|
|
|
3402
3569
|
X.create = (e, t) => new X({
|
|
3403
3570
|
innerType: e,
|
|
3404
3571
|
typeName: Z.ZodReadonly,
|
|
3405
|
-
...
|
|
3406
|
-
}),
|
|
3572
|
+
...w(t)
|
|
3573
|
+
}), F.lazycreate;
|
|
3407
3574
|
var Z;
|
|
3408
3575
|
(function(e) {
|
|
3409
3576
|
e.ZodString = "ZodString", e.ZodNumber = "ZodNumber", e.ZodNaN = "ZodNaN", e.ZodBigInt = "ZodBigInt", e.ZodBoolean = "ZodBoolean", e.ZodDate = "ZodDate", e.ZodSymbol = "ZodSymbol", e.ZodUndefined = "ZodUndefined", e.ZodNull = "ZodNull", e.ZodAny = "ZodAny", e.ZodUnknown = "ZodUnknown", e.ZodNever = "ZodNever", e.ZodVoid = "ZodVoid", e.ZodArray = "ZodArray", e.ZodObject = "ZodObject", e.ZodUnion = "ZodUnion", e.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", e.ZodIntersection = "ZodIntersection", e.ZodTuple = "ZodTuple", e.ZodRecord = "ZodRecord", e.ZodMap = "ZodMap", e.ZodSet = "ZodSet", e.ZodFunction = "ZodFunction", e.ZodLazy = "ZodLazy", e.ZodLiteral = "ZodLiteral", e.ZodEnum = "ZodEnum", e.ZodEffects = "ZodEffects", e.ZodNativeEnum = "ZodNativeEnum", e.ZodOptional = "ZodOptional", e.ZodNullable = "ZodNullable", e.ZodDefault = "ZodDefault", e.ZodCatch = "ZodCatch", e.ZodPromise = "ZodPromise", e.ZodBranded = "ZodBranded", e.ZodPipeline = "ZodPipeline", e.ZodReadonly = "ZodReadonly";
|
|
3410
3577
|
})(Z ||= {});
|
|
3411
|
-
var Q =
|
|
3412
|
-
|
|
3413
|
-
var
|
|
3414
|
-
|
|
3415
|
-
var
|
|
3416
|
-
|
|
3417
|
-
var
|
|
3578
|
+
var Q = E.create, st = D.create;
|
|
3579
|
+
it.create, O.create, Ke.create, qe.create, Je.create, k.create, A.create, Ye.create, j.create, M.create, Xe.create;
|
|
3580
|
+
var ct = N.create, $ = F.create;
|
|
3581
|
+
F.strictCreate, I.create, Ze.create, R.create, z.create, $e.create, et.create, tt.create, nt.create, B.create, V.create;
|
|
3582
|
+
var lt = H.create;
|
|
3583
|
+
U.create, W.create, G.create, K.create, q.create, G.createWithPreprocess, ot.create;
|
|
3584
|
+
var ut = [
|
|
3418
3585
|
{
|
|
3419
3586
|
name: "list_projects",
|
|
3420
3587
|
title: "List Projects",
|
|
@@ -3482,7 +3649,7 @@ var rt = [
|
|
|
3482
3649
|
zodSchema: $({
|
|
3483
3650
|
projectId: Q().optional().describe("Filter by project ID"),
|
|
3484
3651
|
status: Q().optional().describe("Filter by task status key"),
|
|
3485
|
-
priority:
|
|
3652
|
+
priority: lt([
|
|
3486
3653
|
"urgent",
|
|
3487
3654
|
"high",
|
|
3488
3655
|
"medium",
|
|
@@ -3552,7 +3719,7 @@ var rt = [
|
|
|
3552
3719
|
title: Q().describe("Title of the task"),
|
|
3553
3720
|
description: Q().optional().describe("Detailed description / markdown"),
|
|
3554
3721
|
status: Q().optional().describe("Status (defaults to \"todo\" or first workflow status)"),
|
|
3555
|
-
priority:
|
|
3722
|
+
priority: lt([
|
|
3556
3723
|
"urgent",
|
|
3557
3724
|
"high",
|
|
3558
3725
|
"medium",
|
|
@@ -3561,8 +3728,8 @@ var rt = [
|
|
|
3561
3728
|
]).optional().default("none").describe("Task priority"),
|
|
3562
3729
|
assigneeId: Q().optional().describe("User ID to assign task to"),
|
|
3563
3730
|
dueDate: Q().optional().describe("Due date (ISO string)"),
|
|
3564
|
-
tags:
|
|
3565
|
-
estimatedHours:
|
|
3731
|
+
tags: ct(Q()).optional().describe("Tags for categorization"),
|
|
3732
|
+
estimatedHours: st().optional().describe("Estimated hours to complete")
|
|
3566
3733
|
}),
|
|
3567
3734
|
inputSchema: {
|
|
3568
3735
|
type: "object",
|
|
@@ -3636,7 +3803,7 @@ var rt = [
|
|
|
3636
3803
|
title: Q().optional(),
|
|
3637
3804
|
description: Q().optional(),
|
|
3638
3805
|
status: Q().optional(),
|
|
3639
|
-
priority:
|
|
3806
|
+
priority: lt([
|
|
3640
3807
|
"urgent",
|
|
3641
3808
|
"high",
|
|
3642
3809
|
"medium",
|
|
@@ -3645,9 +3812,9 @@ var rt = [
|
|
|
3645
3812
|
]).optional(),
|
|
3646
3813
|
assigneeId: Q().optional(),
|
|
3647
3814
|
dueDate: Q().optional(),
|
|
3648
|
-
tags:
|
|
3649
|
-
estimatedHours:
|
|
3650
|
-
loggedHours:
|
|
3815
|
+
tags: ct(Q()).optional(),
|
|
3816
|
+
estimatedHours: st().optional(),
|
|
3817
|
+
loggedHours: st().optional()
|
|
3651
3818
|
}),
|
|
3652
3819
|
inputSchema: {
|
|
3653
3820
|
type: "object",
|
|
@@ -3732,7 +3899,7 @@ var rt = [
|
|
|
3732
3899
|
title: Q(),
|
|
3733
3900
|
description: Q().optional(),
|
|
3734
3901
|
dueDate: Q().optional(),
|
|
3735
|
-
taskIds:
|
|
3902
|
+
taskIds: ct(Q()).optional()
|
|
3736
3903
|
}),
|
|
3737
3904
|
inputSchema: {
|
|
3738
3905
|
type: "object",
|
|
@@ -3815,10 +3982,10 @@ var rt = [
|
|
|
3815
3982
|
})
|
|
3816
3983
|
}
|
|
3817
3984
|
];
|
|
3818
|
-
new Map(
|
|
3985
|
+
new Map(ut.map((e) => [e.name, e]));
|
|
3819
3986
|
//#endregion
|
|
3820
3987
|
//#region ../mcp/dist/web/index.js
|
|
3821
|
-
function
|
|
3988
|
+
function dt(e = typeof document < "u" ? document : null) {
|
|
3822
3989
|
if (!e) return null;
|
|
3823
3990
|
if (!e.modelContext) {
|
|
3824
3991
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -3843,10 +4010,10 @@ function it(e = typeof document < "u" ? document : null) {
|
|
|
3843
4010
|
}
|
|
3844
4011
|
return e.modelContext;
|
|
3845
4012
|
}
|
|
3846
|
-
function
|
|
4013
|
+
function ft(e) {
|
|
3847
4014
|
let t = e.document ?? (typeof document < "u" ? document : null), n = e.navigator ?? (typeof navigator < "u" ? navigator : null), r = e.window ?? (typeof window < "u" ? window : null), i;
|
|
3848
|
-
t?.modelContext ? i = t.modelContext : n?.modelContext ? i = n.modelContext : t && (i =
|
|
3849
|
-
let a = e.tools ?
|
|
4015
|
+
t?.modelContext ? i = t.modelContext : n?.modelContext ? i = n.modelContext : t && (i = dt(t) ?? void 0);
|
|
4016
|
+
let a = e.tools ? ut.filter((t) => e.tools.includes(t.name)) : ut, o = [], s = new AbortController();
|
|
3850
4017
|
e.signal && e.signal.addEventListener("abort", () => s.abort(), { once: !0 });
|
|
3851
4018
|
for (let t of a) {
|
|
3852
4019
|
let n = {
|
|
@@ -3884,7 +4051,7 @@ function at(e) {
|
|
|
3884
4051
|
}
|
|
3885
4052
|
//#endregion
|
|
3886
4053
|
//#region src/webmcp-state.svelte.ts
|
|
3887
|
-
var
|
|
4054
|
+
var pt = class {
|
|
3888
4055
|
client;
|
|
3889
4056
|
options;
|
|
3890
4057
|
#e = t.state(!1);
|
|
@@ -3924,7 +4091,7 @@ var ot = class {
|
|
|
3924
4091
|
if (!this.registered) {
|
|
3925
4092
|
this.error = null;
|
|
3926
4093
|
try {
|
|
3927
|
-
this.abortController = new AbortController(), this.handle =
|
|
4094
|
+
this.abortController = new AbortController(), this.handle = ft({
|
|
3928
4095
|
client: this.client,
|
|
3929
4096
|
projectId: this.activeProjectId,
|
|
3930
4097
|
tools: this.options.tools,
|
|
@@ -3948,13 +4115,13 @@ var ot = class {
|
|
|
3948
4115
|
this.activeProjectId !== e && (this.activeProjectId = e, this.registered && (this.unregister(), this.register()));
|
|
3949
4116
|
}
|
|
3950
4117
|
};
|
|
3951
|
-
function
|
|
3952
|
-
return new
|
|
4118
|
+
function mt(e, t) {
|
|
4119
|
+
return new pt(e, t);
|
|
3953
4120
|
}
|
|
3954
4121
|
//#endregion
|
|
3955
4122
|
//#region src/index.ts
|
|
3956
|
-
function
|
|
4123
|
+
function ht(t) {
|
|
3957
4124
|
return new e(t);
|
|
3958
4125
|
}
|
|
3959
4126
|
//#endregion
|
|
3960
|
-
export {
|
|
4127
|
+
export { ne as AttachmentState, ee as CommentState, oe as DeliverableState, ce as DeliverableSummaryState, ue as KanbanState, r as ProjectState, ie as TaskActivityState, a as TaskState, fe as TaskTransitionsState, pt as WebMcpState, s as WorkflowState, re as createAttachmentState, te as createCommentState, ht as createCriticalPathClient, se as createDeliverableState, le as createDeliverableSummaryState, de as createKanbanState, i as createProjectState, ae as createTaskActivityState, o as createTaskState, pe as createTaskTransitionsState, mt as createWebMcpState, c as createWorkflowState };
|