@critical-path/svelte 0.11.0 → 0.13.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 +27 -0
- package/README.md +96 -2
- package/dist/critical-path-state.svelte.d.ts +13 -0
- package/dist/critical-path-state.svelte.d.ts.map +1 -0
- 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 +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +813 -435
- 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/dist/timeline-ladder-state.svelte.d.ts +23 -0
- package/dist/timeline-ladder-state.svelte.d.ts.map +1 -0
- package/package.json +4 -4
- package/src/critical-path-state.svelte.ts +33 -0
- package/src/deliverable-summary-state.svelte.ts +41 -0
- package/src/index.test.ts +208 -2
- package/src/index.ts +6 -0
- package/src/kanban-state.svelte.ts +112 -0
- package/src/task-transitions-state.svelte.ts +36 -0
- package/src/timeline-ladder-state.svelte.ts +58 -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 _e = (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
|
|
@@ -915,7 +1082,7 @@ var ue = (e) => {
|
|
|
915
1082
|
};
|
|
916
1083
|
};
|
|
917
1084
|
function h(e, t) {
|
|
918
|
-
let n =
|
|
1085
|
+
let n = ge(), r = _e({
|
|
919
1086
|
issueData: t,
|
|
920
1087
|
data: e.data,
|
|
921
1088
|
path: e.path,
|
|
@@ -972,27 +1139,27 @@ var g = class e {
|
|
|
972
1139
|
value: n
|
|
973
1140
|
};
|
|
974
1141
|
}
|
|
975
|
-
}, _ = Object.freeze({ status: "aborted" }),
|
|
1142
|
+
}, _ = Object.freeze({ status: "aborted" }), v = (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
|
}
|
|
@@ -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,9 +1320,9 @@ 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 U({
|
|
1157
1324
|
schema: this,
|
|
1158
|
-
typeName:
|
|
1325
|
+
typeName: Y.ZodEffects,
|
|
1159
1326
|
effect: {
|
|
1160
1327
|
type: "refinement",
|
|
1161
1328
|
refinement: e
|
|
@@ -1173,31 +1340,31 @@ var w = class {
|
|
|
1173
1340
|
};
|
|
1174
1341
|
}
|
|
1175
1342
|
optional() {
|
|
1176
|
-
return
|
|
1343
|
+
return W.create(this, this._def);
|
|
1177
1344
|
}
|
|
1178
1345
|
nullable() {
|
|
1179
|
-
return
|
|
1346
|
+
return G.create(this, this._def);
|
|
1180
1347
|
}
|
|
1181
1348
|
nullish() {
|
|
1182
1349
|
return this.nullable().optional();
|
|
1183
1350
|
}
|
|
1184
1351
|
array() {
|
|
1185
|
-
return
|
|
1352
|
+
return j.create(this);
|
|
1186
1353
|
}
|
|
1187
1354
|
promise() {
|
|
1188
|
-
return
|
|
1355
|
+
return H.create(this, this._def);
|
|
1189
1356
|
}
|
|
1190
1357
|
or(e) {
|
|
1191
|
-
return
|
|
1358
|
+
return P.create([this, e], this._def);
|
|
1192
1359
|
}
|
|
1193
1360
|
and(e) {
|
|
1194
|
-
return
|
|
1361
|
+
return I.create(this, e, this._def);
|
|
1195
1362
|
}
|
|
1196
1363
|
transform(e) {
|
|
1197
|
-
return new
|
|
1198
|
-
...
|
|
1364
|
+
return new U({
|
|
1365
|
+
...w(this._def),
|
|
1199
1366
|
schema: this,
|
|
1200
|
-
typeName:
|
|
1367
|
+
typeName: Y.ZodEffects,
|
|
1201
1368
|
effect: {
|
|
1202
1369
|
type: "transform",
|
|
1203
1370
|
transform: e
|
|
@@ -1206,27 +1373,27 @@ 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 K({
|
|
1377
|
+
...w(this._def),
|
|
1211
1378
|
innerType: this,
|
|
1212
1379
|
defaultValue: t,
|
|
1213
|
-
typeName:
|
|
1380
|
+
typeName: Y.ZodDefault
|
|
1214
1381
|
});
|
|
1215
1382
|
}
|
|
1216
1383
|
brand() {
|
|
1217
|
-
return new
|
|
1218
|
-
typeName:
|
|
1384
|
+
return new st({
|
|
1385
|
+
typeName: Y.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 q({
|
|
1393
|
+
...w(this._def),
|
|
1227
1394
|
innerType: this,
|
|
1228
1395
|
catchValue: t,
|
|
1229
|
-
typeName:
|
|
1396
|
+
typeName: Y.ZodCatch
|
|
1230
1397
|
});
|
|
1231
1398
|
}
|
|
1232
1399
|
describe(e) {
|
|
@@ -1237,10 +1404,10 @@ var w = class {
|
|
|
1237
1404
|
});
|
|
1238
1405
|
}
|
|
1239
1406
|
pipe(e) {
|
|
1240
|
-
return
|
|
1407
|
+
return ct.create(this, e);
|
|
1241
1408
|
}
|
|
1242
1409
|
readonly() {
|
|
1243
|
-
return
|
|
1410
|
+
return J.create(this);
|
|
1244
1411
|
}
|
|
1245
1412
|
isOptional() {
|
|
1246
1413
|
return this.safeParse(void 0).success;
|
|
@@ -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,10 +1443,10 @@ 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);
|
|
@@ -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), h(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), h(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), h(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), h(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), h(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), h(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), h(n, {
|
|
1357
1524
|
validation: "ulid",
|
|
1358
1525
|
code: f.invalid_string,
|
|
1359
1526
|
message: r.message
|
|
@@ -1386,39 +1553,39 @@ var T = class e extends w {
|
|
|
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), h(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), h(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), h(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), h(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), h(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), h(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), h(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), h(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), h(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,17 +1854,17 @@ 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
|
-
typeName:
|
|
1859
|
+
typeName: Y.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 Ke = 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
|
}
|
|
@@ -1730,7 +1897,7 @@ var E = class e extends w {
|
|
|
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), h(t, {
|
|
1734
1901
|
code: f.not_multiple_of,
|
|
1735
1902
|
multipleOf: r.value,
|
|
1736
1903
|
message: r.message
|
|
@@ -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
|
+
Ke.create = (e) => new Ke({
|
|
1860
2027
|
checks: [],
|
|
1861
|
-
typeName:
|
|
2028
|
+
typeName: Y.ZodNumber,
|
|
1862
2029
|
coerce: e?.coerce || !1,
|
|
1863
|
-
...
|
|
2030
|
+
...w(e)
|
|
1864
2031
|
});
|
|
1865
|
-
var
|
|
2032
|
+
var qe = class e extends T {
|
|
1866
2033
|
constructor() {
|
|
1867
2034
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1868
2035
|
}
|
|
@@ -1905,16 +2072,16 @@ var D = class e extends w {
|
|
|
1905
2072
|
}), _;
|
|
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,13 +2150,13 @@ var D = class e extends w {
|
|
|
1983
2150
|
return e;
|
|
1984
2151
|
}
|
|
1985
2152
|
};
|
|
1986
|
-
|
|
2153
|
+
qe.create = (e) => new qe({
|
|
1987
2154
|
checks: [],
|
|
1988
|
-
typeName:
|
|
2155
|
+
typeName: Y.ZodBigInt,
|
|
1989
2156
|
coerce: e?.coerce ?? !1,
|
|
1990
|
-
...
|
|
2157
|
+
...w(e)
|
|
1991
2158
|
});
|
|
1992
|
-
var
|
|
2159
|
+
var Je = 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);
|
|
@@ -1999,15 +2166,15 @@ var Be = class extends w {
|
|
|
1999
2166
|
received: t.parsedType
|
|
2000
2167
|
}), _;
|
|
2001
2168
|
}
|
|
2002
|
-
return
|
|
2169
|
+
return y(e.data);
|
|
2003
2170
|
}
|
|
2004
2171
|
};
|
|
2005
|
-
|
|
2006
|
-
typeName:
|
|
2172
|
+
Je.create = (e) => new Je({
|
|
2173
|
+
typeName: Y.ZodBoolean,
|
|
2007
2174
|
coerce: e?.coerce || !1,
|
|
2008
|
-
...
|
|
2175
|
+
...w(e)
|
|
2009
2176
|
});
|
|
2010
|
-
var
|
|
2177
|
+
var Ye = 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);
|
|
@@ -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,13 +2237,13 @@ var Ve = class e extends w {
|
|
|
2070
2237
|
return e == null ? null : new Date(e);
|
|
2071
2238
|
}
|
|
2072
2239
|
};
|
|
2073
|
-
|
|
2240
|
+
Ye.create = (e) => new Ye({
|
|
2074
2241
|
checks: [],
|
|
2075
2242
|
coerce: e?.coerce || !1,
|
|
2076
|
-
typeName:
|
|
2077
|
-
...
|
|
2243
|
+
typeName: Y.ZodDate,
|
|
2244
|
+
...w(e)
|
|
2078
2245
|
});
|
|
2079
|
-
var
|
|
2246
|
+
var Xe = class extends T {
|
|
2080
2247
|
_parse(e) {
|
|
2081
2248
|
if (this._getType(e) !== u.symbol) {
|
|
2082
2249
|
let t = this._getOrReturnCtx(e);
|
|
@@ -2086,14 +2253,14 @@ var He = class extends w {
|
|
|
2086
2253
|
received: t.parsedType
|
|
2087
2254
|
}), _;
|
|
2088
2255
|
}
|
|
2089
|
-
return
|
|
2256
|
+
return y(e.data);
|
|
2090
2257
|
}
|
|
2091
2258
|
};
|
|
2092
|
-
|
|
2093
|
-
typeName:
|
|
2094
|
-
...
|
|
2259
|
+
Xe.create = (e) => new Xe({
|
|
2260
|
+
typeName: Y.ZodSymbol,
|
|
2261
|
+
...w(e)
|
|
2095
2262
|
});
|
|
2096
|
-
var
|
|
2263
|
+
var D = class extends T {
|
|
2097
2264
|
_parse(e) {
|
|
2098
2265
|
if (this._getType(e) !== u.undefined) {
|
|
2099
2266
|
let t = this._getOrReturnCtx(e);
|
|
@@ -2103,14 +2270,14 @@ var O = class extends w {
|
|
|
2103
2270
|
received: t.parsedType
|
|
2104
2271
|
}), _;
|
|
2105
2272
|
}
|
|
2106
|
-
return
|
|
2273
|
+
return y(e.data);
|
|
2107
2274
|
}
|
|
2108
2275
|
};
|
|
2109
|
-
|
|
2110
|
-
typeName:
|
|
2111
|
-
...
|
|
2276
|
+
D.create = (e) => new D({
|
|
2277
|
+
typeName: Y.ZodUndefined,
|
|
2278
|
+
...w(e)
|
|
2112
2279
|
});
|
|
2113
|
-
var
|
|
2280
|
+
var O = class extends T {
|
|
2114
2281
|
_parse(e) {
|
|
2115
2282
|
if (this._getType(e) !== u.null) {
|
|
2116
2283
|
let t = this._getOrReturnCtx(e);
|
|
@@ -2120,38 +2287,38 @@ var k = class extends w {
|
|
|
2120
2287
|
received: t.parsedType
|
|
2121
2288
|
}), _;
|
|
2122
2289
|
}
|
|
2123
|
-
return
|
|
2290
|
+
return y(e.data);
|
|
2124
2291
|
}
|
|
2125
2292
|
};
|
|
2126
|
-
|
|
2127
|
-
typeName:
|
|
2128
|
-
...
|
|
2293
|
+
O.create = (e) => new O({
|
|
2294
|
+
typeName: Y.ZodNull,
|
|
2295
|
+
...w(e)
|
|
2129
2296
|
});
|
|
2130
|
-
var
|
|
2297
|
+
var Ze = 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
|
-
|
|
2139
|
-
typeName:
|
|
2140
|
-
...
|
|
2305
|
+
Ze.create = (e) => new Ze({
|
|
2306
|
+
typeName: Y.ZodAny,
|
|
2307
|
+
...w(e)
|
|
2141
2308
|
});
|
|
2142
|
-
var
|
|
2309
|
+
var k = 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
|
-
|
|
2151
|
-
typeName:
|
|
2152
|
-
...
|
|
2317
|
+
k.create = (e) => new k({
|
|
2318
|
+
typeName: Y.ZodUnknown,
|
|
2319
|
+
...w(e)
|
|
2153
2320
|
});
|
|
2154
|
-
var
|
|
2321
|
+
var A = class extends T {
|
|
2155
2322
|
_parse(e) {
|
|
2156
2323
|
let t = this._getOrReturnCtx(e);
|
|
2157
2324
|
return h(t, {
|
|
@@ -2161,11 +2328,11 @@ var j = class extends w {
|
|
|
2161
2328
|
}), _;
|
|
2162
2329
|
}
|
|
2163
2330
|
};
|
|
2164
|
-
|
|
2165
|
-
typeName:
|
|
2166
|
-
...
|
|
2331
|
+
A.create = (e) => new A({
|
|
2332
|
+
typeName: Y.ZodNever,
|
|
2333
|
+
...w(e)
|
|
2167
2334
|
});
|
|
2168
|
-
var
|
|
2335
|
+
var Qe = class extends T {
|
|
2169
2336
|
_parse(e) {
|
|
2170
2337
|
if (this._getType(e) !== u.undefined) {
|
|
2171
2338
|
let t = this._getOrReturnCtx(e);
|
|
@@ -2175,14 +2342,14 @@ var We = class extends w {
|
|
|
2175
2342
|
received: t.parsedType
|
|
2176
2343
|
}), _;
|
|
2177
2344
|
}
|
|
2178
|
-
return
|
|
2345
|
+
return y(e.data);
|
|
2179
2346
|
}
|
|
2180
2347
|
};
|
|
2181
|
-
|
|
2182
|
-
typeName:
|
|
2183
|
-
...
|
|
2348
|
+
Qe.create = (e) => new Qe({
|
|
2349
|
+
typeName: Y.ZodVoid,
|
|
2350
|
+
...w(e)
|
|
2184
2351
|
});
|
|
2185
|
-
var
|
|
2352
|
+
var j = class e extends T {
|
|
2186
2353
|
_parse(e) {
|
|
2187
2354
|
let { ctx: t, status: n } = this._processInputParams(e), r = this._def;
|
|
2188
2355
|
if (t.parsedType !== u.array) return h(t, {
|
|
@@ -2216,8 +2383,8 @@ var M = class e extends w {
|
|
|
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
|
|
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) => g.mergeArray(n, e));
|
|
2387
|
+
let i = [...t.data].map((e, n) => r.type._parseSync(new C(t, e, t.path, n)));
|
|
2221
2388
|
return g.mergeArray(n, i);
|
|
2222
2389
|
}
|
|
2223
2390
|
get element() {
|
|
@@ -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
|
+
j.create = (e, t) => new j({
|
|
2258
2425
|
type: e,
|
|
2259
2426
|
minLength: null,
|
|
2260
2427
|
maxLength: null,
|
|
2261
2428
|
exactLength: null,
|
|
2262
|
-
typeName:
|
|
2263
|
-
...
|
|
2429
|
+
typeName: Y.ZodArray,
|
|
2430
|
+
...w(t)
|
|
2264
2431
|
});
|
|
2265
|
-
function
|
|
2266
|
-
if (e instanceof
|
|
2432
|
+
function M(e) {
|
|
2433
|
+
if (e instanceof N) {
|
|
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] = W.create(M(r));
|
|
2271
2438
|
}
|
|
2272
|
-
return new
|
|
2439
|
+
return new N({
|
|
2273
2440
|
...e._def,
|
|
2274
2441
|
shape: () => t
|
|
2275
2442
|
});
|
|
2276
2443
|
}
|
|
2277
|
-
return e instanceof
|
|
2444
|
+
return e instanceof j ? new j({
|
|
2278
2445
|
...e._def,
|
|
2279
|
-
type:
|
|
2280
|
-
}) : e instanceof
|
|
2446
|
+
type: M(e.element)
|
|
2447
|
+
}) : e instanceof W ? W.create(M(e.unwrap())) : e instanceof G ? G.create(M(e.unwrap())) : e instanceof L ? L.create(e.items.map((e) => M(e))) : e;
|
|
2281
2448
|
}
|
|
2282
|
-
var
|
|
2449
|
+
var N = class e extends T {
|
|
2283
2450
|
constructor() {
|
|
2284
2451
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
2285
2452
|
}
|
|
@@ -2301,7 +2468,7 @@ var P = class e extends w {
|
|
|
2301
2468
|
}), _;
|
|
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 A && 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 A) {
|
|
2318
2485
|
let e = this._def.unknownKeys;
|
|
2319
2486
|
if (e === "passthrough") for (let e of a) o.push({
|
|
2320
2487
|
key: {
|
|
@@ -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
|
}
|
|
@@ -2362,12 +2529,12 @@ var P = class e extends w {
|
|
|
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
|
}
|
|
@@ -2400,7 +2567,7 @@ var P = class e extends w {
|
|
|
2400
2567
|
...this._def.shape(),
|
|
2401
2568
|
...t._def.shape()
|
|
2402
2569
|
}),
|
|
2403
|
-
typeName:
|
|
2570
|
+
typeName: Y.ZodObject
|
|
2404
2571
|
});
|
|
2405
2572
|
}
|
|
2406
2573
|
setKey(e, t) {
|
|
@@ -2429,7 +2596,7 @@ var P = class e extends w {
|
|
|
2429
2596
|
});
|
|
2430
2597
|
}
|
|
2431
2598
|
deepPartial() {
|
|
2432
|
-
return
|
|
2599
|
+
return M(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 W;) t = t._def.innerType;
|
|
2451
2618
|
n[e] = t;
|
|
2452
2619
|
}
|
|
2453
2620
|
return new e({
|
|
@@ -2456,29 +2623,29 @@ var P = class e extends w {
|
|
|
2456
2623
|
});
|
|
2457
2624
|
}
|
|
2458
2625
|
keyof() {
|
|
2459
|
-
return
|
|
2626
|
+
return at(l.objectKeys(this.shape));
|
|
2460
2627
|
}
|
|
2461
2628
|
};
|
|
2462
|
-
|
|
2629
|
+
N.create = (e, t) => new N({
|
|
2463
2630
|
shape: () => e,
|
|
2464
2631
|
unknownKeys: "strip",
|
|
2465
|
-
catchall:
|
|
2466
|
-
typeName:
|
|
2467
|
-
...
|
|
2468
|
-
}),
|
|
2632
|
+
catchall: A.create(),
|
|
2633
|
+
typeName: Y.ZodObject,
|
|
2634
|
+
...w(t)
|
|
2635
|
+
}), N.strictCreate = (e, t) => new N({
|
|
2469
2636
|
shape: () => e,
|
|
2470
2637
|
unknownKeys: "strict",
|
|
2471
|
-
catchall:
|
|
2472
|
-
typeName:
|
|
2473
|
-
...
|
|
2474
|
-
}),
|
|
2638
|
+
catchall: A.create(),
|
|
2639
|
+
typeName: Y.ZodObject,
|
|
2640
|
+
...w(t)
|
|
2641
|
+
}), N.lazycreate = (e, t) => new N({
|
|
2475
2642
|
shape: e,
|
|
2476
2643
|
unknownKeys: "strip",
|
|
2477
|
-
catchall:
|
|
2478
|
-
typeName:
|
|
2479
|
-
...
|
|
2644
|
+
catchall: A.create(),
|
|
2645
|
+
typeName: Y.ZodObject,
|
|
2646
|
+
...w(t)
|
|
2480
2647
|
});
|
|
2481
|
-
var
|
|
2648
|
+
var P = class extends T {
|
|
2482
2649
|
_parse(e) {
|
|
2483
2650
|
let { ctx: t } = this._processInputParams(e), n = this._def.options;
|
|
2484
2651
|
function r(e) {
|
|
@@ -2541,12 +2708,12 @@ var F = class extends w {
|
|
|
2541
2708
|
return this._def.options;
|
|
2542
2709
|
}
|
|
2543
2710
|
};
|
|
2544
|
-
|
|
2711
|
+
P.create = (e, t) => new P({
|
|
2545
2712
|
options: e,
|
|
2546
|
-
typeName:
|
|
2547
|
-
...
|
|
2713
|
+
typeName: Y.ZodUnion,
|
|
2714
|
+
...w(t)
|
|
2548
2715
|
});
|
|
2549
|
-
var
|
|
2716
|
+
var F = (e) => e instanceof R ? F(e.schema) : e instanceof U ? F(e.innerType()) : e instanceof z ? [e.value] : e instanceof B ? e.options : e instanceof V ? l.objectValues(e.enum) : e instanceof K ? F(e._def.innerType) : e instanceof D ? [void 0] : e instanceof O ? [null] : e instanceof W ? [void 0, ...F(e.unwrap())] : e instanceof G ? [null, ...F(e.unwrap())] : e instanceof st || e instanceof J ? F(e.unwrap()) : e instanceof q ? F(e._def.innerType) : [], $e = class e extends T {
|
|
2550
2717
|
_parse(e) {
|
|
2551
2718
|
let { ctx: t } = this._processInputParams(e);
|
|
2552
2719
|
if (t.parsedType !== u.object) return h(t, {
|
|
@@ -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 = F(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)}`);
|
|
@@ -2589,15 +2756,15 @@ var I = (e) => e instanceof z ? I(e.schema) : e instanceof W ? I(e.innerType())
|
|
|
2589
2756
|
}
|
|
2590
2757
|
}
|
|
2591
2758
|
return new e({
|
|
2592
|
-
typeName:
|
|
2759
|
+
typeName: Y.ZodDiscriminatedUnion,
|
|
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 et(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 = et(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 = et(i, a);
|
|
2626
2793
|
if (!o.valid) return { valid: !1 };
|
|
2627
2794
|
n.push(o.data);
|
|
2628
2795
|
}
|
|
@@ -2636,12 +2803,12 @@ function Ke(e, t) {
|
|
|
2636
2803
|
data: e
|
|
2637
2804
|
} : { valid: !1 };
|
|
2638
2805
|
}
|
|
2639
|
-
var
|
|
2806
|
+
var I = 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 _;
|
|
2810
|
+
let i = et(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
|
}) : (h(n, { code: f.invalid_intersection_types }), _);
|
|
@@ -2665,13 +2832,13 @@ var L = class extends w {
|
|
|
2665
2832
|
}));
|
|
2666
2833
|
}
|
|
2667
2834
|
};
|
|
2668
|
-
|
|
2835
|
+
I.create = (e, t, n) => new I({
|
|
2669
2836
|
left: e,
|
|
2670
2837
|
right: t,
|
|
2671
|
-
typeName:
|
|
2672
|
-
...
|
|
2838
|
+
typeName: Y.ZodIntersection,
|
|
2839
|
+
...w(n)
|
|
2673
2840
|
});
|
|
2674
|
-
var
|
|
2841
|
+
var L = class e extends T {
|
|
2675
2842
|
_parse(e) {
|
|
2676
2843
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2677
2844
|
if (n.parsedType !== u.array) return h(n, {
|
|
@@ -2695,7 +2862,7 @@ 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
2867
|
return n.common.async ? Promise.all(r).then((e) => g.mergeArray(t, e)) : g.mergeArray(t, r);
|
|
2701
2868
|
}
|
|
@@ -2709,16 +2876,16 @@ var R = class e extends w {
|
|
|
2709
2876
|
});
|
|
2710
2877
|
}
|
|
2711
2878
|
};
|
|
2712
|
-
|
|
2879
|
+
L.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 L({
|
|
2715
2882
|
items: e,
|
|
2716
|
-
typeName:
|
|
2883
|
+
typeName: Y.ZodTuple,
|
|
2717
2884
|
rest: null,
|
|
2718
|
-
...
|
|
2885
|
+
...w(t)
|
|
2719
2886
|
});
|
|
2720
2887
|
};
|
|
2721
|
-
var
|
|
2888
|
+
var tt = class e extends T {
|
|
2722
2889
|
get keySchema() {
|
|
2723
2890
|
return this._def.keyType;
|
|
2724
2891
|
}
|
|
@@ -2734,8 +2901,8 @@ var qe = class e extends w {
|
|
|
2734
2901
|
}), _;
|
|
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
2908
|
return n.common.async ? g.mergeObjectAsync(t, r) : g.mergeObjectSync(t, r);
|
|
@@ -2744,19 +2911,19 @@ var qe = class e extends w {
|
|
|
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
|
-
typeName:
|
|
2751
|
-
...
|
|
2917
|
+
typeName: Y.ZodRecord,
|
|
2918
|
+
...w(r)
|
|
2752
2919
|
}) : new e({
|
|
2753
|
-
keyType:
|
|
2920
|
+
keyType: E.create(),
|
|
2754
2921
|
valueType: t,
|
|
2755
|
-
typeName:
|
|
2756
|
-
...
|
|
2922
|
+
typeName: Y.ZodRecord,
|
|
2923
|
+
...w(n)
|
|
2757
2924
|
});
|
|
2758
2925
|
}
|
|
2759
|
-
},
|
|
2926
|
+
}, nt = class extends T {
|
|
2760
2927
|
get keySchema() {
|
|
2761
2928
|
return this._def.keyType;
|
|
2762
2929
|
}
|
|
@@ -2771,8 +2938,8 @@ var qe = class e extends w {
|
|
|
2771
2938
|
received: n.parsedType
|
|
2772
2939
|
}), _;
|
|
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();
|
|
@@ -2802,13 +2969,13 @@ var qe = class e extends w {
|
|
|
2802
2969
|
}
|
|
2803
2970
|
}
|
|
2804
2971
|
};
|
|
2805
|
-
|
|
2972
|
+
nt.create = (e, t, n) => new nt({
|
|
2806
2973
|
valueType: t,
|
|
2807
2974
|
keyType: e,
|
|
2808
|
-
typeName:
|
|
2809
|
-
...
|
|
2975
|
+
typeName: Y.ZodMap,
|
|
2976
|
+
...w(n)
|
|
2810
2977
|
});
|
|
2811
|
-
var
|
|
2978
|
+
var rt = class e extends T {
|
|
2812
2979
|
_parse(e) {
|
|
2813
2980
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2814
2981
|
if (n.parsedType !== u.set) return h(n, {
|
|
@@ -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,14 +3039,14 @@ var Ye = class e extends w {
|
|
|
2872
3039
|
return this.min(1, e);
|
|
2873
3040
|
}
|
|
2874
3041
|
};
|
|
2875
|
-
|
|
3042
|
+
rt.create = (e, t) => new rt({
|
|
2876
3043
|
valueType: e,
|
|
2877
3044
|
minSize: null,
|
|
2878
3045
|
maxSize: null,
|
|
2879
|
-
typeName:
|
|
2880
|
-
...
|
|
3046
|
+
typeName: Y.ZodSet,
|
|
3047
|
+
...w(t)
|
|
2881
3048
|
});
|
|
2882
|
-
var
|
|
3049
|
+
var it = class e extends T {
|
|
2883
3050
|
constructor() {
|
|
2884
3051
|
super(...arguments), this.validate = this.implement;
|
|
2885
3052
|
}
|
|
@@ -2891,13 +3058,13 @@ var Xe = class e extends w {
|
|
|
2891
3058
|
received: t.parsedType
|
|
2892
3059
|
}), _;
|
|
2893
3060
|
function n(e, n) {
|
|
2894
|
-
return
|
|
3061
|
+
return _e({
|
|
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 _e({
|
|
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 H) {
|
|
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: L.create(t).rest(k.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 ||
|
|
2976
|
-
typeName:
|
|
2977
|
-
...
|
|
3141
|
+
args: t || L.create([]).rest(k.create()),
|
|
3142
|
+
returns: n || k.create(),
|
|
3143
|
+
typeName: Y.ZodFunction,
|
|
3144
|
+
...w(r)
|
|
2978
3145
|
});
|
|
2979
3146
|
}
|
|
2980
|
-
},
|
|
3147
|
+
}, R = class extends T {
|
|
2981
3148
|
get schema() {
|
|
2982
3149
|
return this._def.getter();
|
|
2983
3150
|
}
|
|
@@ -2990,12 +3157,12 @@ var Xe = class e extends w {
|
|
|
2990
3157
|
});
|
|
2991
3158
|
}
|
|
2992
3159
|
};
|
|
2993
|
-
|
|
3160
|
+
R.create = (e, t) => new R({
|
|
2994
3161
|
getter: e,
|
|
2995
|
-
typeName:
|
|
2996
|
-
...
|
|
3162
|
+
typeName: Y.ZodLazy,
|
|
3163
|
+
...w(t)
|
|
2997
3164
|
});
|
|
2998
|
-
var
|
|
3165
|
+
var z = class extends T {
|
|
2999
3166
|
_parse(e) {
|
|
3000
3167
|
if (e.data !== this._def.value) {
|
|
3001
3168
|
let t = this._getOrReturnCtx(e);
|
|
@@ -3014,19 +3181,19 @@ var B = class extends w {
|
|
|
3014
3181
|
return this._def.value;
|
|
3015
3182
|
}
|
|
3016
3183
|
};
|
|
3017
|
-
|
|
3184
|
+
z.create = (e, t) => new z({
|
|
3018
3185
|
value: e,
|
|
3019
|
-
typeName:
|
|
3020
|
-
...
|
|
3186
|
+
typeName: Y.ZodLiteral,
|
|
3187
|
+
...w(t)
|
|
3021
3188
|
});
|
|
3022
|
-
function
|
|
3023
|
-
return new
|
|
3189
|
+
function at(e, t) {
|
|
3190
|
+
return new B({
|
|
3024
3191
|
values: e,
|
|
3025
|
-
typeName:
|
|
3026
|
-
...
|
|
3192
|
+
typeName: Y.ZodEnum,
|
|
3193
|
+
...w(t)
|
|
3027
3194
|
});
|
|
3028
3195
|
}
|
|
3029
|
-
var
|
|
3196
|
+
var B = 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;
|
|
@@ -3044,7 +3211,7 @@ var V = class e extends w {
|
|
|
3044
3211
|
options: n
|
|
3045
3212
|
}), _;
|
|
3046
3213
|
}
|
|
3047
|
-
return
|
|
3214
|
+
return y(e.data);
|
|
3048
3215
|
}
|
|
3049
3216
|
get options() {
|
|
3050
3217
|
return this._def.values;
|
|
@@ -3077,8 +3244,8 @@ var V = class e extends w {
|
|
|
3077
3244
|
});
|
|
3078
3245
|
}
|
|
3079
3246
|
};
|
|
3080
|
-
|
|
3081
|
-
var
|
|
3247
|
+
B.create = at;
|
|
3248
|
+
var V = 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) {
|
|
@@ -3097,18 +3264,18 @@ var H = class extends w {
|
|
|
3097
3264
|
options: e
|
|
3098
3265
|
}), _;
|
|
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
|
+
V.create = (e, t) => new V({
|
|
3107
3274
|
values: e,
|
|
3108
|
-
typeName:
|
|
3109
|
-
...
|
|
3275
|
+
typeName: Y.ZodNativeEnum,
|
|
3276
|
+
...w(t)
|
|
3110
3277
|
});
|
|
3111
|
-
var
|
|
3278
|
+
var H = class extends T {
|
|
3112
3279
|
unwrap() {
|
|
3113
3280
|
return this._def.type;
|
|
3114
3281
|
}
|
|
@@ -3118,23 +3285,23 @@ var U = class extends w {
|
|
|
3118
3285
|
code: f.invalid_type,
|
|
3119
3286
|
expected: u.promise,
|
|
3120
3287
|
received: t.parsedType
|
|
3121
|
-
}), _) :
|
|
3288
|
+
}), _) : 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
|
+
H.create = (e, t) => new H({
|
|
3128
3295
|
type: e,
|
|
3129
|
-
typeName:
|
|
3130
|
-
...
|
|
3296
|
+
typeName: Y.ZodPromise,
|
|
3297
|
+
...w(t)
|
|
3131
3298
|
});
|
|
3132
|
-
var
|
|
3299
|
+
var U = class extends T {
|
|
3133
3300
|
innerType() {
|
|
3134
3301
|
return this._def.schema;
|
|
3135
3302
|
}
|
|
3136
3303
|
sourceType() {
|
|
3137
|
-
return this._def.schema._def.typeName ===
|
|
3304
|
+
return this._def.schema._def.typeName === Y.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
3138
3305
|
}
|
|
3139
3306
|
_parse(e) {
|
|
3140
3307
|
let { status: t, ctx: n } = this._processInputParams(e), r = this._def.effect || null, i = {
|
|
@@ -3154,7 +3321,7 @@ var W = class extends w {
|
|
|
3154
3321
|
path: n.path,
|
|
3155
3322
|
parent: n
|
|
3156
3323
|
});
|
|
3157
|
-
return r.status === "aborted" ? _ : r.status === "dirty" || t.value === "dirty" ?
|
|
3324
|
+
return r.status === "aborted" ? _ : r.status === "dirty" || t.value === "dirty" ? v(r.value) : r;
|
|
3158
3325
|
});
|
|
3159
3326
|
{
|
|
3160
3327
|
if (t.value === "aborted") return _;
|
|
@@ -3163,7 +3330,7 @@ var W = class extends w {
|
|
|
3163
3330
|
path: n.path,
|
|
3164
3331
|
parent: n
|
|
3165
3332
|
});
|
|
3166
|
-
return r.status === "aborted" ? _ : r.status === "dirty" || t.value === "dirty" ?
|
|
3333
|
+
return r.status === "aborted" ? _ : r.status === "dirty" || t.value === "dirty" ? v(r.value) : r;
|
|
3167
3334
|
}
|
|
3168
3335
|
}
|
|
3169
3336
|
if (r.type === "refinement") {
|
|
@@ -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 _;
|
|
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,7 +3379,7 @@ 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
|
})) : _);
|
|
@@ -3220,47 +3387,47 @@ var W = class extends w {
|
|
|
3220
3387
|
l.assertNever(r);
|
|
3221
3388
|
}
|
|
3222
3389
|
};
|
|
3223
|
-
|
|
3390
|
+
U.create = (e, t, n) => new U({
|
|
3224
3391
|
schema: e,
|
|
3225
|
-
typeName:
|
|
3392
|
+
typeName: Y.ZodEffects,
|
|
3226
3393
|
effect: t,
|
|
3227
|
-
...
|
|
3228
|
-
}),
|
|
3394
|
+
...w(n)
|
|
3395
|
+
}), U.createWithPreprocess = (e, t, n) => new U({
|
|
3229
3396
|
schema: t,
|
|
3230
3397
|
effect: {
|
|
3231
3398
|
type: "preprocess",
|
|
3232
3399
|
transform: e
|
|
3233
3400
|
},
|
|
3234
|
-
typeName:
|
|
3235
|
-
...
|
|
3401
|
+
typeName: Y.ZodEffects,
|
|
3402
|
+
...w(n)
|
|
3236
3403
|
});
|
|
3237
|
-
var
|
|
3404
|
+
var W = 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
|
+
W.create = (e, t) => new W({
|
|
3246
3413
|
innerType: e,
|
|
3247
|
-
typeName:
|
|
3248
|
-
...
|
|
3414
|
+
typeName: Y.ZodOptional,
|
|
3415
|
+
...w(t)
|
|
3249
3416
|
});
|
|
3250
|
-
var
|
|
3417
|
+
var G = 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
|
+
G.create = (e, t) => new G({
|
|
3259
3426
|
innerType: e,
|
|
3260
|
-
typeName:
|
|
3261
|
-
...
|
|
3427
|
+
typeName: Y.ZodNullable,
|
|
3428
|
+
...w(t)
|
|
3262
3429
|
});
|
|
3263
|
-
var
|
|
3430
|
+
var K = 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
|
+
K.create = (e, t) => new K({
|
|
3277
3444
|
innerType: e,
|
|
3278
|
-
typeName:
|
|
3445
|
+
typeName: Y.ZodDefault,
|
|
3279
3446
|
defaultValue: typeof t.default == "function" ? t.default : () => t.default,
|
|
3280
|
-
...
|
|
3447
|
+
...w(t)
|
|
3281
3448
|
});
|
|
3282
|
-
var
|
|
3449
|
+
var q = 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,13 +3481,13 @@ var J = class extends w {
|
|
|
3314
3481
|
return this._def.innerType;
|
|
3315
3482
|
}
|
|
3316
3483
|
};
|
|
3317
|
-
|
|
3484
|
+
q.create = (e, t) => new q({
|
|
3318
3485
|
innerType: e,
|
|
3319
|
-
typeName:
|
|
3486
|
+
typeName: Y.ZodCatch,
|
|
3320
3487
|
catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
|
|
3321
|
-
...
|
|
3488
|
+
...w(t)
|
|
3322
3489
|
});
|
|
3323
|
-
var
|
|
3490
|
+
var ot = class extends T {
|
|
3324
3491
|
_parse(e) {
|
|
3325
3492
|
if (this._getType(e) !== u.nan) {
|
|
3326
3493
|
let t = this._getOrReturnCtx(e);
|
|
@@ -3336,11 +3503,11 @@ var Y = class extends w {
|
|
|
3336
3503
|
};
|
|
3337
3504
|
}
|
|
3338
3505
|
};
|
|
3339
|
-
|
|
3340
|
-
typeName:
|
|
3341
|
-
...
|
|
3506
|
+
ot.create = (e) => new ot({
|
|
3507
|
+
typeName: Y.ZodNaN,
|
|
3508
|
+
...w(e)
|
|
3342
3509
|
});
|
|
3343
|
-
var
|
|
3510
|
+
var st = 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
|
+
}, ct = 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" ? _ : e.status === "dirty" ? (t.dirty(),
|
|
3531
|
+
return e.status === "aborted" ? _ : e.status === "dirty" ? (t.dirty(), v(e.value)) : this._def.out._parseAsync({
|
|
3365
3532
|
data: e.value,
|
|
3366
3533
|
path: n.path,
|
|
3367
3534
|
parent: n
|
|
@@ -3387,39 +3554,39 @@ var Qe = class extends w {
|
|
|
3387
3554
|
return new e({
|
|
3388
3555
|
in: t,
|
|
3389
3556
|
out: n,
|
|
3390
|
-
typeName:
|
|
3557
|
+
typeName: Y.ZodPipeline
|
|
3391
3558
|
});
|
|
3392
3559
|
}
|
|
3393
|
-
},
|
|
3560
|
+
}, J = 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;
|
|
3400
3567
|
}
|
|
3401
3568
|
};
|
|
3402
|
-
|
|
3569
|
+
J.create = (e, t) => new J({
|
|
3403
3570
|
innerType: e,
|
|
3404
|
-
typeName:
|
|
3405
|
-
...
|
|
3406
|
-
}),
|
|
3407
|
-
var
|
|
3571
|
+
typeName: Y.ZodReadonly,
|
|
3572
|
+
...w(t)
|
|
3573
|
+
}), N.lazycreate;
|
|
3574
|
+
var Y;
|
|
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
|
-
})(
|
|
3411
|
-
var
|
|
3412
|
-
|
|
3413
|
-
var
|
|
3414
|
-
|
|
3415
|
-
var
|
|
3416
|
-
H.create, U.create, W.create, G.create,
|
|
3417
|
-
var
|
|
3577
|
+
})(Y ||= {});
|
|
3578
|
+
var X = E.create, lt = Ke.create;
|
|
3579
|
+
ot.create, qe.create, Je.create, Ye.create, Xe.create, D.create, O.create, Ze.create, k.create, A.create, Qe.create;
|
|
3580
|
+
var ut = j.create, Z = N.create;
|
|
3581
|
+
N.strictCreate, P.create, $e.create, I.create, L.create, tt.create, nt.create, rt.create, it.create, R.create, z.create;
|
|
3582
|
+
var Q = B.create;
|
|
3583
|
+
V.create, H.create, U.create, W.create, G.create, U.createWithPreprocess, ct.create;
|
|
3584
|
+
var $ = [
|
|
3418
3585
|
{
|
|
3419
3586
|
name: "list_projects",
|
|
3420
3587
|
title: "List Projects",
|
|
3421
3588
|
description: "Retrieve all projects in the workspace.",
|
|
3422
|
-
zodSchema:
|
|
3589
|
+
zodSchema: Z({}),
|
|
3423
3590
|
inputSchema: {
|
|
3424
3591
|
type: "object",
|
|
3425
3592
|
properties: {},
|
|
@@ -3432,7 +3599,7 @@ var rt = [
|
|
|
3432
3599
|
name: "get_project",
|
|
3433
3600
|
title: "Get Project",
|
|
3434
3601
|
description: "Get details of a specific project by its ID.",
|
|
3435
|
-
zodSchema:
|
|
3602
|
+
zodSchema: Z({ id: X().describe("The project ID") }),
|
|
3436
3603
|
inputSchema: {
|
|
3437
3604
|
type: "object",
|
|
3438
3605
|
properties: { id: {
|
|
@@ -3449,10 +3616,10 @@ var rt = [
|
|
|
3449
3616
|
name: "create_project",
|
|
3450
3617
|
title: "Create Project",
|
|
3451
3618
|
description: "Create a new project workspace.",
|
|
3452
|
-
zodSchema:
|
|
3453
|
-
name:
|
|
3454
|
-
description:
|
|
3455
|
-
key:
|
|
3619
|
+
zodSchema: Z({
|
|
3620
|
+
name: X().describe("Name of the project"),
|
|
3621
|
+
description: X().optional().describe("Description of the project"),
|
|
3622
|
+
key: X().optional().describe("Short project key/prefix (e.g. \"PROJ\")")
|
|
3456
3623
|
}),
|
|
3457
3624
|
inputSchema: {
|
|
3458
3625
|
type: "object",
|
|
@@ -3479,17 +3646,17 @@ var rt = [
|
|
|
3479
3646
|
name: "list_tasks",
|
|
3480
3647
|
title: "List Tasks",
|
|
3481
3648
|
description: "List tasks, optionally filtered by project, status, priority, or assignee.",
|
|
3482
|
-
zodSchema:
|
|
3483
|
-
projectId:
|
|
3484
|
-
status:
|
|
3485
|
-
priority:
|
|
3649
|
+
zodSchema: Z({
|
|
3650
|
+
projectId: X().optional().describe("Filter by project ID"),
|
|
3651
|
+
status: X().optional().describe("Filter by task status key"),
|
|
3652
|
+
priority: Q([
|
|
3486
3653
|
"urgent",
|
|
3487
3654
|
"high",
|
|
3488
3655
|
"medium",
|
|
3489
3656
|
"low",
|
|
3490
3657
|
"none"
|
|
3491
3658
|
]).optional().describe("Filter by priority"),
|
|
3492
|
-
assigneeId:
|
|
3659
|
+
assigneeId: X().optional().describe("Filter by assignee ID")
|
|
3493
3660
|
}),
|
|
3494
3661
|
inputSchema: {
|
|
3495
3662
|
type: "object",
|
|
@@ -3530,7 +3697,7 @@ var rt = [
|
|
|
3530
3697
|
name: "get_task",
|
|
3531
3698
|
title: "Get Task",
|
|
3532
3699
|
description: "Get task details by ID.",
|
|
3533
|
-
zodSchema:
|
|
3700
|
+
zodSchema: Z({ id: X().describe("The task ID") }),
|
|
3534
3701
|
inputSchema: {
|
|
3535
3702
|
type: "object",
|
|
3536
3703
|
properties: { id: {
|
|
@@ -3547,22 +3714,22 @@ var rt = [
|
|
|
3547
3714
|
name: "create_task",
|
|
3548
3715
|
title: "Create Task",
|
|
3549
3716
|
description: "Create a new task within a project.",
|
|
3550
|
-
zodSchema:
|
|
3551
|
-
projectId:
|
|
3552
|
-
title:
|
|
3553
|
-
description:
|
|
3554
|
-
status:
|
|
3555
|
-
priority:
|
|
3717
|
+
zodSchema: Z({
|
|
3718
|
+
projectId: X().optional().describe("Project ID (inferred from active view in browser if omitted)"),
|
|
3719
|
+
title: X().describe("Title of the task"),
|
|
3720
|
+
description: X().optional().describe("Detailed description / markdown"),
|
|
3721
|
+
status: X().optional().describe("Status (defaults to \"todo\" or first workflow status)"),
|
|
3722
|
+
priority: Q([
|
|
3556
3723
|
"urgent",
|
|
3557
3724
|
"high",
|
|
3558
3725
|
"medium",
|
|
3559
3726
|
"low",
|
|
3560
3727
|
"none"
|
|
3561
3728
|
]).optional().default("none").describe("Task priority"),
|
|
3562
|
-
assigneeId:
|
|
3563
|
-
dueDate:
|
|
3564
|
-
tags:
|
|
3565
|
-
estimatedHours:
|
|
3729
|
+
assigneeId: X().optional().describe("User ID to assign task to"),
|
|
3730
|
+
dueDate: X().optional().describe("Due date (ISO string)"),
|
|
3731
|
+
tags: ut(X()).optional().describe("Tags for categorization"),
|
|
3732
|
+
estimatedHours: lt().optional().describe("Estimated hours to complete")
|
|
3566
3733
|
}),
|
|
3567
3734
|
inputSchema: {
|
|
3568
3735
|
type: "object",
|
|
@@ -3631,23 +3798,23 @@ var rt = [
|
|
|
3631
3798
|
name: "update_task",
|
|
3632
3799
|
title: "Update Task",
|
|
3633
3800
|
description: "Update fields of an existing task (e.g. title, status, priority, assignee).",
|
|
3634
|
-
zodSchema:
|
|
3635
|
-
id:
|
|
3636
|
-
title:
|
|
3637
|
-
description:
|
|
3638
|
-
status:
|
|
3639
|
-
priority:
|
|
3801
|
+
zodSchema: Z({
|
|
3802
|
+
id: X().describe("The task ID"),
|
|
3803
|
+
title: X().optional(),
|
|
3804
|
+
description: X().optional(),
|
|
3805
|
+
status: X().optional(),
|
|
3806
|
+
priority: Q([
|
|
3640
3807
|
"urgent",
|
|
3641
3808
|
"high",
|
|
3642
3809
|
"medium",
|
|
3643
3810
|
"low",
|
|
3644
3811
|
"none"
|
|
3645
3812
|
]).optional(),
|
|
3646
|
-
assigneeId:
|
|
3647
|
-
dueDate:
|
|
3648
|
-
tags:
|
|
3649
|
-
estimatedHours:
|
|
3650
|
-
loggedHours:
|
|
3813
|
+
assigneeId: X().optional(),
|
|
3814
|
+
dueDate: X().optional(),
|
|
3815
|
+
tags: ut(X()).optional(),
|
|
3816
|
+
estimatedHours: lt().optional(),
|
|
3817
|
+
loggedHours: lt().optional()
|
|
3651
3818
|
}),
|
|
3652
3819
|
inputSchema: {
|
|
3653
3820
|
type: "object",
|
|
@@ -3690,7 +3857,7 @@ var rt = [
|
|
|
3690
3857
|
name: "delete_task",
|
|
3691
3858
|
title: "Delete Task",
|
|
3692
3859
|
description: "Delete a task by ID.",
|
|
3693
|
-
zodSchema:
|
|
3860
|
+
zodSchema: Z({ id: X().describe("The task ID to delete") }),
|
|
3694
3861
|
inputSchema: {
|
|
3695
3862
|
type: "object",
|
|
3696
3863
|
properties: { id: {
|
|
@@ -3707,7 +3874,7 @@ var rt = [
|
|
|
3707
3874
|
name: "list_deliverables",
|
|
3708
3875
|
title: "List Deliverables",
|
|
3709
3876
|
description: "List deliverables/milestones for a project.",
|
|
3710
|
-
zodSchema:
|
|
3877
|
+
zodSchema: Z({ projectId: X().optional().describe("Project ID") }),
|
|
3711
3878
|
inputSchema: {
|
|
3712
3879
|
type: "object",
|
|
3713
3880
|
properties: { projectId: {
|
|
@@ -3727,12 +3894,12 @@ var rt = [
|
|
|
3727
3894
|
name: "create_deliverable",
|
|
3728
3895
|
title: "Create Deliverable",
|
|
3729
3896
|
description: "Create a milestone deliverable within a project.",
|
|
3730
|
-
zodSchema:
|
|
3731
|
-
projectId:
|
|
3732
|
-
title:
|
|
3733
|
-
description:
|
|
3734
|
-
dueDate:
|
|
3735
|
-
taskIds:
|
|
3897
|
+
zodSchema: Z({
|
|
3898
|
+
projectId: X().optional(),
|
|
3899
|
+
title: X(),
|
|
3900
|
+
description: X().optional(),
|
|
3901
|
+
dueDate: X().optional(),
|
|
3902
|
+
taskIds: ut(X()).optional()
|
|
3736
3903
|
}),
|
|
3737
3904
|
inputSchema: {
|
|
3738
3905
|
type: "object",
|
|
@@ -3763,7 +3930,7 @@ var rt = [
|
|
|
3763
3930
|
name: "list_comments",
|
|
3764
3931
|
title: "List Comments",
|
|
3765
3932
|
description: "List comments associated with a task.",
|
|
3766
|
-
zodSchema:
|
|
3933
|
+
zodSchema: Z({ taskId: X().describe("The task ID") }),
|
|
3767
3934
|
inputSchema: {
|
|
3768
3935
|
type: "object",
|
|
3769
3936
|
properties: { taskId: {
|
|
@@ -3780,10 +3947,10 @@ var rt = [
|
|
|
3780
3947
|
name: "add_comment",
|
|
3781
3948
|
title: "Add Comment",
|
|
3782
3949
|
description: "Add a comment to a task.",
|
|
3783
|
-
zodSchema:
|
|
3784
|
-
taskId:
|
|
3785
|
-
content:
|
|
3786
|
-
authorId:
|
|
3950
|
+
zodSchema: Z({
|
|
3951
|
+
taskId: X().describe("The task ID"),
|
|
3952
|
+
content: X().describe("Comment body/markdown"),
|
|
3953
|
+
authorId: X().describe("Author user ID")
|
|
3787
3954
|
}),
|
|
3788
3955
|
inputSchema: {
|
|
3789
3956
|
type: "object",
|
|
@@ -3813,12 +3980,103 @@ var rt = [
|
|
|
3813
3980
|
content: e.content,
|
|
3814
3981
|
authorId: e.authorId
|
|
3815
3982
|
})
|
|
3983
|
+
},
|
|
3984
|
+
{
|
|
3985
|
+
name: "calculate_critical_path",
|
|
3986
|
+
title: "Calculate Critical Path",
|
|
3987
|
+
description: "Calculate Critical Path Method (CPM) schedule, early/late start and finish, total slack, and critical bottlenecks for a project.",
|
|
3988
|
+
zodSchema: Z({ projectId: X().optional().describe("Project ID (falls back to ambient context if omitted)") }),
|
|
3989
|
+
inputSchema: {
|
|
3990
|
+
type: "object",
|
|
3991
|
+
properties: { projectId: {
|
|
3992
|
+
type: "string",
|
|
3993
|
+
description: "Project ID (falls back to ambient context if omitted)"
|
|
3994
|
+
} },
|
|
3995
|
+
additionalProperties: !1
|
|
3996
|
+
},
|
|
3997
|
+
annotations: { readOnlyHint: !0 },
|
|
3998
|
+
execute: async (e, t, n) => {
|
|
3999
|
+
let r = e.projectId || n?.projectId;
|
|
4000
|
+
if (!r) throw Error("projectId is required to calculate critical path.");
|
|
4001
|
+
return t.calculateCriticalPath(r);
|
|
4002
|
+
}
|
|
4003
|
+
},
|
|
4004
|
+
{
|
|
4005
|
+
name: "get_timeline_ladder",
|
|
4006
|
+
title: "Get Timeline Ladder of Abstraction",
|
|
4007
|
+
description: "Retrieve Bret Victor Ladder of Abstraction for a project timeline across macro phase envelopes, standard Gantt tasks & CPM, and concrete deliverables/time/attachments.",
|
|
4008
|
+
zodSchema: Z({
|
|
4009
|
+
projectId: X().optional().describe("Project ID (falls back to ambient context if omitted)"),
|
|
4010
|
+
level: Q([
|
|
4011
|
+
"macro",
|
|
4012
|
+
"standard",
|
|
4013
|
+
"concrete",
|
|
4014
|
+
"all"
|
|
4015
|
+
]).optional().describe("Abstraction level (macro, standard, concrete, or all)"),
|
|
4016
|
+
containerId: X().optional().describe("Optional container ID filter"),
|
|
4017
|
+
iterationId: X().optional().describe("Optional iteration/sprint ID filter")
|
|
4018
|
+
}),
|
|
4019
|
+
inputSchema: {
|
|
4020
|
+
type: "object",
|
|
4021
|
+
properties: {
|
|
4022
|
+
projectId: {
|
|
4023
|
+
type: "string",
|
|
4024
|
+
description: "Project ID (falls back to ambient context if omitted)"
|
|
4025
|
+
},
|
|
4026
|
+
level: {
|
|
4027
|
+
type: "string",
|
|
4028
|
+
enum: [
|
|
4029
|
+
"macro",
|
|
4030
|
+
"standard",
|
|
4031
|
+
"concrete",
|
|
4032
|
+
"all"
|
|
4033
|
+
],
|
|
4034
|
+
description: "Abstraction level"
|
|
4035
|
+
},
|
|
4036
|
+
containerId: {
|
|
4037
|
+
type: "string",
|
|
4038
|
+
description: "Optional container ID filter"
|
|
4039
|
+
},
|
|
4040
|
+
iterationId: {
|
|
4041
|
+
type: "string",
|
|
4042
|
+
description: "Optional iteration/sprint ID filter"
|
|
4043
|
+
}
|
|
4044
|
+
},
|
|
4045
|
+
additionalProperties: !1
|
|
4046
|
+
},
|
|
4047
|
+
annotations: { readOnlyHint: !0 },
|
|
4048
|
+
execute: async (e, t, n) => {
|
|
4049
|
+
let r = e.projectId || n?.projectId;
|
|
4050
|
+
if (!r) throw Error("projectId is required to get timeline ladder.");
|
|
4051
|
+
return t.getTimelineLadder(r, {
|
|
4052
|
+
level: e.level,
|
|
4053
|
+
containerId: e.containerId,
|
|
4054
|
+
iterationId: e.iterationId
|
|
4055
|
+
});
|
|
4056
|
+
}
|
|
4057
|
+
},
|
|
4058
|
+
{
|
|
4059
|
+
name: "get_task_ladder",
|
|
4060
|
+
title: "Get Task Ladder View",
|
|
4061
|
+
description: "Retrieve multi-scale Bret Victor ladder view for a single task, connecting its macro phase, standard CPM timeline position, and concrete work evidence.",
|
|
4062
|
+
zodSchema: Z({ taskId: X().describe("The task ID") }),
|
|
4063
|
+
inputSchema: {
|
|
4064
|
+
type: "object",
|
|
4065
|
+
properties: { taskId: {
|
|
4066
|
+
type: "string",
|
|
4067
|
+
description: "The task ID"
|
|
4068
|
+
} },
|
|
4069
|
+
required: ["taskId"],
|
|
4070
|
+
additionalProperties: !1
|
|
4071
|
+
},
|
|
4072
|
+
annotations: { readOnlyHint: !0 },
|
|
4073
|
+
execute: async (e, t) => t.getTaskLadder(e.taskId)
|
|
3816
4074
|
}
|
|
3817
4075
|
];
|
|
3818
|
-
new Map(
|
|
4076
|
+
new Map($.map((e) => [e.name, e]));
|
|
3819
4077
|
//#endregion
|
|
3820
4078
|
//#region ../mcp/dist/web/index.js
|
|
3821
|
-
function
|
|
4079
|
+
function dt(e = typeof document < "u" ? document : null) {
|
|
3822
4080
|
if (!e) return null;
|
|
3823
4081
|
if (!e.modelContext) {
|
|
3824
4082
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -3843,10 +4101,10 @@ function it(e = typeof document < "u" ? document : null) {
|
|
|
3843
4101
|
}
|
|
3844
4102
|
return e.modelContext;
|
|
3845
4103
|
}
|
|
3846
|
-
function
|
|
4104
|
+
function ft(e) {
|
|
3847
4105
|
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 ?
|
|
4106
|
+
t?.modelContext ? i = t.modelContext : n?.modelContext ? i = n.modelContext : t && (i = dt(t) ?? void 0);
|
|
4107
|
+
let a = e.tools ? $.filter((t) => e.tools.includes(t.name)) : $, o = [], s = new AbortController();
|
|
3850
4108
|
e.signal && e.signal.addEventListener("abort", () => s.abort(), { once: !0 });
|
|
3851
4109
|
for (let t of a) {
|
|
3852
4110
|
let n = {
|
|
@@ -3884,7 +4142,7 @@ function at(e) {
|
|
|
3884
4142
|
}
|
|
3885
4143
|
//#endregion
|
|
3886
4144
|
//#region src/webmcp-state.svelte.ts
|
|
3887
|
-
var
|
|
4145
|
+
var pt = class {
|
|
3888
4146
|
client;
|
|
3889
4147
|
options;
|
|
3890
4148
|
#e = t.state(!1);
|
|
@@ -3924,7 +4182,7 @@ var ot = class {
|
|
|
3924
4182
|
if (!this.registered) {
|
|
3925
4183
|
this.error = null;
|
|
3926
4184
|
try {
|
|
3927
|
-
this.abortController = new AbortController(), this.handle =
|
|
4185
|
+
this.abortController = new AbortController(), this.handle = ft({
|
|
3928
4186
|
client: this.client,
|
|
3929
4187
|
projectId: this.activeProjectId,
|
|
3930
4188
|
tools: this.options.tools,
|
|
@@ -3948,13 +4206,133 @@ var ot = class {
|
|
|
3948
4206
|
this.activeProjectId !== e && (this.activeProjectId = e, this.registered && (this.unregister(), this.register()));
|
|
3949
4207
|
}
|
|
3950
4208
|
};
|
|
3951
|
-
function
|
|
3952
|
-
return new
|
|
4209
|
+
function mt(e, t) {
|
|
4210
|
+
return new pt(e, t);
|
|
4211
|
+
}
|
|
4212
|
+
//#endregion
|
|
4213
|
+
//#region src/critical-path-state.svelte.ts
|
|
4214
|
+
var ht = class {
|
|
4215
|
+
client;
|
|
4216
|
+
projectId;
|
|
4217
|
+
#e = t.state(null);
|
|
4218
|
+
get data() {
|
|
4219
|
+
return t.get(this.#e);
|
|
4220
|
+
}
|
|
4221
|
+
set data(e) {
|
|
4222
|
+
t.set(this.#e, e, !0);
|
|
4223
|
+
}
|
|
4224
|
+
#t = t.state(!1);
|
|
4225
|
+
get loading() {
|
|
4226
|
+
return t.get(this.#t);
|
|
4227
|
+
}
|
|
4228
|
+
set loading(e) {
|
|
4229
|
+
t.set(this.#t, e, !0);
|
|
4230
|
+
}
|
|
4231
|
+
#n = t.state(null);
|
|
4232
|
+
get error() {
|
|
4233
|
+
return t.get(this.#n);
|
|
4234
|
+
}
|
|
4235
|
+
set error(e) {
|
|
4236
|
+
t.set(this.#n, e, !0);
|
|
4237
|
+
}
|
|
4238
|
+
constructor(e, t) {
|
|
4239
|
+
this.client = e, this.projectId = t;
|
|
4240
|
+
}
|
|
4241
|
+
async fetch() {
|
|
4242
|
+
this.loading = !0, this.error = null;
|
|
4243
|
+
try {
|
|
4244
|
+
this.data = await this.client.calculateCriticalPath(this.projectId);
|
|
4245
|
+
} catch (e) {
|
|
4246
|
+
this.error = e instanceof Error ? e : Error(String(e));
|
|
4247
|
+
} finally {
|
|
4248
|
+
this.loading = !1;
|
|
4249
|
+
}
|
|
4250
|
+
}
|
|
4251
|
+
};
|
|
4252
|
+
function gt(e, t) {
|
|
4253
|
+
return new ht(e, t);
|
|
4254
|
+
}
|
|
4255
|
+
//#endregion
|
|
4256
|
+
//#region src/timeline-ladder-state.svelte.ts
|
|
4257
|
+
var _t = class {
|
|
4258
|
+
client;
|
|
4259
|
+
projectId;
|
|
4260
|
+
#e = t.state(null);
|
|
4261
|
+
get data() {
|
|
4262
|
+
return t.get(this.#e);
|
|
4263
|
+
}
|
|
4264
|
+
set data(e) {
|
|
4265
|
+
t.set(this.#e, e, !0);
|
|
4266
|
+
}
|
|
4267
|
+
#t = t.state("all");
|
|
4268
|
+
get level() {
|
|
4269
|
+
return t.get(this.#t);
|
|
4270
|
+
}
|
|
4271
|
+
set level(e) {
|
|
4272
|
+
t.set(this.#t, e, !0);
|
|
4273
|
+
}
|
|
4274
|
+
#n = t.state(!1);
|
|
4275
|
+
get loading() {
|
|
4276
|
+
return t.get(this.#n);
|
|
4277
|
+
}
|
|
4278
|
+
set loading(e) {
|
|
4279
|
+
t.set(this.#n, e, !0);
|
|
4280
|
+
}
|
|
4281
|
+
#r = t.state(null);
|
|
4282
|
+
get error() {
|
|
4283
|
+
return t.get(this.#r);
|
|
4284
|
+
}
|
|
4285
|
+
set error(e) {
|
|
4286
|
+
t.set(this.#r, e, !0);
|
|
4287
|
+
}
|
|
4288
|
+
#i = t.derived(() => this.data?.macro ?? null);
|
|
4289
|
+
get macro() {
|
|
4290
|
+
return t.get(this.#i);
|
|
4291
|
+
}
|
|
4292
|
+
set macro(e) {
|
|
4293
|
+
t.set(this.#i, e);
|
|
4294
|
+
}
|
|
4295
|
+
#a = t.derived(() => this.data?.standard ?? null);
|
|
4296
|
+
get standard() {
|
|
4297
|
+
return t.get(this.#a);
|
|
4298
|
+
}
|
|
4299
|
+
set standard(e) {
|
|
4300
|
+
t.set(this.#a, e);
|
|
4301
|
+
}
|
|
4302
|
+
#o = t.derived(() => this.data?.concrete ?? null);
|
|
4303
|
+
get concrete() {
|
|
4304
|
+
return t.get(this.#o);
|
|
4305
|
+
}
|
|
4306
|
+
set concrete(e) {
|
|
4307
|
+
t.set(this.#o, e);
|
|
4308
|
+
}
|
|
4309
|
+
constructor(e, t, n) {
|
|
4310
|
+
this.client = e, this.projectId = t, n?.level && (this.level = n.level);
|
|
4311
|
+
}
|
|
4312
|
+
async setLevel(e) {
|
|
4313
|
+
this.level = e, await this.fetch();
|
|
4314
|
+
}
|
|
4315
|
+
async fetch(e) {
|
|
4316
|
+
this.loading = !0, this.error = null;
|
|
4317
|
+
try {
|
|
4318
|
+
this.data = await this.client.getTimelineLadder(this.projectId, {
|
|
4319
|
+
level: this.level,
|
|
4320
|
+
...e
|
|
4321
|
+
});
|
|
4322
|
+
} catch (e) {
|
|
4323
|
+
this.error = e instanceof Error ? e : Error(String(e));
|
|
4324
|
+
} finally {
|
|
4325
|
+
this.loading = !1;
|
|
4326
|
+
}
|
|
4327
|
+
}
|
|
4328
|
+
};
|
|
4329
|
+
function vt(e, t, n) {
|
|
4330
|
+
return new _t(e, t, n);
|
|
3953
4331
|
}
|
|
3954
4332
|
//#endregion
|
|
3955
4333
|
//#region src/index.ts
|
|
3956
|
-
function
|
|
4334
|
+
function yt(t) {
|
|
3957
4335
|
return new e(t);
|
|
3958
4336
|
}
|
|
3959
4337
|
//#endregion
|
|
3960
|
-
export {
|
|
4338
|
+
export { ne as AttachmentState, ee as CommentState, ht as CriticalPathState, oe as DeliverableState, ce as DeliverableSummaryState, ue as KanbanState, r as ProjectState, ie as TaskActivityState, a as TaskState, fe as TaskTransitionsState, _t as TimelineLadderState, pt as WebMcpState, s as WorkflowState, re as createAttachmentState, te as createCommentState, yt as createCriticalPathClient, gt as createCriticalPathState, se as createDeliverableState, le as createDeliverableSummaryState, de as createKanbanState, i as createProjectState, ae as createTaskActivityState, o as createTaskState, pe as createTaskTransitionsState, vt as createTimelineLadderState, mt as createWebMcpState, c as createWorkflowState };
|