@critical-path/svelte 0.19.1 → 0.19.3
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 +18 -0
- package/dist/index.js +1007 -979
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CriticalPathClient as e } from "@critical-path/client";
|
|
2
2
|
import * as t from "svelte/internal/client";
|
|
3
|
-
import { isTempTaskId as n,
|
|
3
|
+
import { isTempTaskId as n, precedenceOf as r, resolveStatusDefinition as i } from "@critical-path/core";
|
|
4
4
|
//#region src/latest-request.ts
|
|
5
|
-
var
|
|
5
|
+
var a = class {
|
|
6
6
|
controller;
|
|
7
7
|
begin(e) {
|
|
8
8
|
this.controller?.abort(), this.controller = new AbortController();
|
|
@@ -15,9 +15,9 @@ var i = class {
|
|
|
15
15
|
cancel() {
|
|
16
16
|
this.controller?.abort(), this.controller = void 0;
|
|
17
17
|
}
|
|
18
|
-
},
|
|
18
|
+
}, o = class {
|
|
19
19
|
client;
|
|
20
|
-
#e = new
|
|
20
|
+
#e = new a();
|
|
21
21
|
#t = t.state(t.proxy([]));
|
|
22
22
|
get data() {
|
|
23
23
|
return t.get(this.#t);
|
|
@@ -75,15 +75,15 @@ var i = class {
|
|
|
75
75
|
this.#e.cancel();
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
|
-
function
|
|
79
|
-
return new
|
|
78
|
+
function s(e) {
|
|
79
|
+
return new o(e);
|
|
80
80
|
}
|
|
81
81
|
//#endregion
|
|
82
82
|
//#region src/task-state.svelte.ts
|
|
83
|
-
var
|
|
83
|
+
var c = class {
|
|
84
84
|
client;
|
|
85
85
|
projectId;
|
|
86
|
-
#e = new
|
|
86
|
+
#e = new a();
|
|
87
87
|
#t = t.state(t.proxy([]));
|
|
88
88
|
get data() {
|
|
89
89
|
return t.get(this.#t);
|
|
@@ -218,14 +218,14 @@ var s = class {
|
|
|
218
218
|
this.#e.cancel();
|
|
219
219
|
}
|
|
220
220
|
};
|
|
221
|
-
function
|
|
222
|
-
return new
|
|
221
|
+
function ee(e, t) {
|
|
222
|
+
return new c(e, t);
|
|
223
223
|
}
|
|
224
224
|
//#endregion
|
|
225
225
|
//#region src/workflow-state.svelte.ts
|
|
226
|
-
var
|
|
226
|
+
var te = class {
|
|
227
227
|
client;
|
|
228
|
-
#e = new
|
|
228
|
+
#e = new a();
|
|
229
229
|
#t = t.state(t.proxy([]));
|
|
230
230
|
get data() {
|
|
231
231
|
return t.get(this.#t);
|
|
@@ -292,15 +292,15 @@ var ee = class {
|
|
|
292
292
|
this.#e.cancel();
|
|
293
293
|
}
|
|
294
294
|
};
|
|
295
|
-
function
|
|
296
|
-
return new
|
|
295
|
+
function ne(e) {
|
|
296
|
+
return new te(e);
|
|
297
297
|
}
|
|
298
298
|
//#endregion
|
|
299
299
|
//#region src/comment-state.svelte.ts
|
|
300
|
-
var
|
|
300
|
+
var re = class {
|
|
301
301
|
client;
|
|
302
302
|
taskId;
|
|
303
|
-
#e = new
|
|
303
|
+
#e = new a();
|
|
304
304
|
#t = t.state(t.proxy([]));
|
|
305
305
|
get data() {
|
|
306
306
|
return t.get(this.#t);
|
|
@@ -413,15 +413,15 @@ var ne = class {
|
|
|
413
413
|
this.#e.cancel();
|
|
414
414
|
}
|
|
415
415
|
};
|
|
416
|
-
function
|
|
417
|
-
return new
|
|
416
|
+
function ie(e, t) {
|
|
417
|
+
return new re(e, t);
|
|
418
418
|
}
|
|
419
419
|
//#endregion
|
|
420
420
|
//#region src/attachment-state.svelte.ts
|
|
421
|
-
var
|
|
421
|
+
var ae = class {
|
|
422
422
|
client;
|
|
423
423
|
filter;
|
|
424
|
-
#e = new
|
|
424
|
+
#e = new a();
|
|
425
425
|
#t = t.state(t.proxy([]));
|
|
426
426
|
get data() {
|
|
427
427
|
return t.get(this.#t);
|
|
@@ -482,15 +482,15 @@ var ie = class {
|
|
|
482
482
|
this.#e.cancel();
|
|
483
483
|
}
|
|
484
484
|
};
|
|
485
|
-
function
|
|
486
|
-
return new
|
|
485
|
+
function oe(e, t) {
|
|
486
|
+
return new ae(e, t);
|
|
487
487
|
}
|
|
488
488
|
//#endregion
|
|
489
489
|
//#region src/activity-state.svelte.ts
|
|
490
|
-
var
|
|
490
|
+
var se = class {
|
|
491
491
|
client;
|
|
492
492
|
taskId;
|
|
493
|
-
#e = new
|
|
493
|
+
#e = new a();
|
|
494
494
|
#t = t.state(t.proxy([]));
|
|
495
495
|
get comments() {
|
|
496
496
|
return t.get(this.#t);
|
|
@@ -643,15 +643,15 @@ var oe = class {
|
|
|
643
643
|
this.#e.cancel();
|
|
644
644
|
}
|
|
645
645
|
};
|
|
646
|
-
function
|
|
647
|
-
return new
|
|
646
|
+
function ce(e, t) {
|
|
647
|
+
return new se(e, t);
|
|
648
648
|
}
|
|
649
649
|
//#endregion
|
|
650
650
|
//#region src/deliverable-state.svelte.ts
|
|
651
|
-
var
|
|
651
|
+
var le = class {
|
|
652
652
|
client;
|
|
653
653
|
projectId;
|
|
654
|
-
#e = new
|
|
654
|
+
#e = new a();
|
|
655
655
|
#t = t.state(t.proxy([]));
|
|
656
656
|
get data() {
|
|
657
657
|
return t.get(this.#t);
|
|
@@ -732,15 +732,15 @@ var ce = class {
|
|
|
732
732
|
this.#e.cancel();
|
|
733
733
|
}
|
|
734
734
|
};
|
|
735
|
-
function
|
|
736
|
-
return new
|
|
735
|
+
function ue(e, t) {
|
|
736
|
+
return new le(e, t);
|
|
737
737
|
}
|
|
738
738
|
//#endregion
|
|
739
739
|
//#region src/deliverable-summary-state.svelte.ts
|
|
740
|
-
var
|
|
740
|
+
var de = class {
|
|
741
741
|
client;
|
|
742
742
|
deliverableId;
|
|
743
|
-
#e = new
|
|
743
|
+
#e = new a();
|
|
744
744
|
#t = t.state(null);
|
|
745
745
|
get summary() {
|
|
746
746
|
return t.get(this.#t);
|
|
@@ -787,12 +787,12 @@ var ue = class {
|
|
|
787
787
|
this.#e.cancel();
|
|
788
788
|
}
|
|
789
789
|
};
|
|
790
|
-
function
|
|
791
|
-
return new
|
|
790
|
+
function fe(e, t) {
|
|
791
|
+
return new de(e, t);
|
|
792
792
|
}
|
|
793
793
|
//#endregion
|
|
794
794
|
//#region src/kanban-state.svelte.ts
|
|
795
|
-
var
|
|
795
|
+
var pe = class {
|
|
796
796
|
projectId;
|
|
797
797
|
options;
|
|
798
798
|
taskState;
|
|
@@ -818,7 +818,7 @@ var fe = class {
|
|
|
818
818
|
canceled: []
|
|
819
819
|
};
|
|
820
820
|
for (let n of e) {
|
|
821
|
-
let e = n.semanticStatus ||
|
|
821
|
+
let e = n.semanticStatus || i(n.status, this.options?.customDefinitions).category;
|
|
822
822
|
t[e] ? t[e].push(n) : t.not_started.push(n);
|
|
823
823
|
}
|
|
824
824
|
return t;
|
|
@@ -836,7 +836,7 @@ var fe = class {
|
|
|
836
836
|
t.set(this.#e, e);
|
|
837
837
|
}
|
|
838
838
|
constructor(e, t, n = {}) {
|
|
839
|
-
this.projectId = t, this.options = n, this.taskState = new
|
|
839
|
+
this.projectId = t, this.options = n, this.taskState = new c(e, t);
|
|
840
840
|
}
|
|
841
841
|
async fetch() {
|
|
842
842
|
return this.taskState.fetch();
|
|
@@ -854,15 +854,15 @@ var fe = class {
|
|
|
854
854
|
return this.taskState.deleteTask(e);
|
|
855
855
|
}
|
|
856
856
|
};
|
|
857
|
-
function
|
|
858
|
-
return new
|
|
857
|
+
function me(e, t, n) {
|
|
858
|
+
return new pe(e, t, n);
|
|
859
859
|
}
|
|
860
860
|
//#endregion
|
|
861
861
|
//#region src/task-transitions-state.svelte.ts
|
|
862
|
-
var
|
|
862
|
+
var he = class {
|
|
863
863
|
client;
|
|
864
864
|
taskId;
|
|
865
|
-
#e = new
|
|
865
|
+
#e = new a();
|
|
866
866
|
#t = t.state(t.proxy([]));
|
|
867
867
|
get allowedTransitions() {
|
|
868
868
|
return t.get(this.#t);
|
|
@@ -906,8 +906,8 @@ var me = class {
|
|
|
906
906
|
this.#e.cancel();
|
|
907
907
|
}
|
|
908
908
|
};
|
|
909
|
-
function
|
|
910
|
-
return new
|
|
909
|
+
function ge(e, t) {
|
|
910
|
+
return new he(e, t);
|
|
911
911
|
}
|
|
912
912
|
//#endregion
|
|
913
913
|
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js
|
|
@@ -941,13 +941,13 @@ var l;
|
|
|
941
941
|
}
|
|
942
942
|
e.joinValues = r, e.jsonStringifyReplacer = (e, t) => typeof t == "bigint" ? t.toString() : t;
|
|
943
943
|
})(l ||= {});
|
|
944
|
-
var
|
|
944
|
+
var _e;
|
|
945
945
|
(function(e) {
|
|
946
946
|
e.mergeShapes = (e, t) => ({
|
|
947
947
|
...e,
|
|
948
948
|
...t
|
|
949
949
|
});
|
|
950
|
-
})(
|
|
950
|
+
})(_e ||= {});
|
|
951
951
|
var u = l.arrayToEnum([
|
|
952
952
|
"string",
|
|
953
953
|
"nan",
|
|
@@ -1059,7 +1059,7 @@ var u = l.arrayToEnum([
|
|
|
1059
1059
|
p.create = (e) => new p(e);
|
|
1060
1060
|
//#endregion
|
|
1061
1061
|
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js
|
|
1062
|
-
var
|
|
1062
|
+
var ve = (e, t) => {
|
|
1063
1063
|
let n;
|
|
1064
1064
|
switch (e.code) {
|
|
1065
1065
|
case f.invalid_type:
|
|
@@ -1113,13 +1113,13 @@ var m = (e, t) => {
|
|
|
1113
1113
|
default: n = t.defaultError, l.assertNever(e);
|
|
1114
1114
|
}
|
|
1115
1115
|
return { message: n };
|
|
1116
|
-
},
|
|
1117
|
-
function
|
|
1118
|
-
return
|
|
1116
|
+
}, ye = ve;
|
|
1117
|
+
function be() {
|
|
1118
|
+
return ye;
|
|
1119
1119
|
}
|
|
1120
1120
|
//#endregion
|
|
1121
1121
|
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
1122
|
-
var
|
|
1122
|
+
var xe = (e) => {
|
|
1123
1123
|
let { data: t, path: n, errorMaps: r, issueData: i } = e, a = [...n, ...i.path || []], o = {
|
|
1124
1124
|
...i,
|
|
1125
1125
|
path: a
|
|
@@ -1140,8 +1140,8 @@ var ye = (e) => {
|
|
|
1140
1140
|
message: s
|
|
1141
1141
|
};
|
|
1142
1142
|
};
|
|
1143
|
-
function
|
|
1144
|
-
let n =
|
|
1143
|
+
function m(e, t) {
|
|
1144
|
+
let n = be(), r = xe({
|
|
1145
1145
|
issueData: t,
|
|
1146
1146
|
data: e.data,
|
|
1147
1147
|
path: e.path,
|
|
@@ -1149,12 +1149,12 @@ function h(e, t) {
|
|
|
1149
1149
|
e.common.contextualErrorMap,
|
|
1150
1150
|
e.schemaErrorMap,
|
|
1151
1151
|
n,
|
|
1152
|
-
n ===
|
|
1152
|
+
n === ve ? void 0 : ve
|
|
1153
1153
|
].filter((e) => !!e)
|
|
1154
1154
|
});
|
|
1155
1155
|
e.common.issues.push(r);
|
|
1156
1156
|
}
|
|
1157
|
-
var
|
|
1157
|
+
var h = class e {
|
|
1158
1158
|
constructor() {
|
|
1159
1159
|
this.value = "valid";
|
|
1160
1160
|
}
|
|
@@ -1167,7 +1167,7 @@ var g = class e {
|
|
|
1167
1167
|
static mergeArray(e, t) {
|
|
1168
1168
|
let n = [];
|
|
1169
1169
|
for (let r of t) {
|
|
1170
|
-
if (r.status === "aborted") return
|
|
1170
|
+
if (r.status === "aborted") return g;
|
|
1171
1171
|
r.status === "dirty" && e.dirty(), n.push(r.value);
|
|
1172
1172
|
}
|
|
1173
1173
|
return {
|
|
@@ -1190,7 +1190,7 @@ var g = class e {
|
|
|
1190
1190
|
let n = {};
|
|
1191
1191
|
for (let r of t) {
|
|
1192
1192
|
let { key: t, value: i } = r;
|
|
1193
|
-
if (t.status === "aborted" || i.status === "aborted") return
|
|
1193
|
+
if (t.status === "aborted" || i.status === "aborted") return g;
|
|
1194
1194
|
t.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), t.value !== "__proto__" && (i.value !== void 0 || r.alwaysSet) && (n[t.value] = i.value);
|
|
1195
1195
|
}
|
|
1196
1196
|
return {
|
|
@@ -1198,27 +1198,27 @@ var g = class e {
|
|
|
1198
1198
|
value: n
|
|
1199
1199
|
};
|
|
1200
1200
|
}
|
|
1201
|
-
},
|
|
1201
|
+
}, g = Object.freeze({ status: "aborted" }), Se = (e) => ({
|
|
1202
1202
|
status: "dirty",
|
|
1203
1203
|
value: e
|
|
1204
|
-
}),
|
|
1204
|
+
}), _ = (e) => ({
|
|
1205
1205
|
status: "valid",
|
|
1206
1206
|
value: e
|
|
1207
|
-
}),
|
|
1207
|
+
}), Ce = (e) => e.status === "aborted", we = (e) => e.status === "dirty", v = (e) => e.status === "valid", Te = (e) => typeof Promise < "u" && e instanceof Promise, y;
|
|
1208
1208
|
(function(e) {
|
|
1209
1209
|
e.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, e.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
1210
|
-
})(
|
|
1210
|
+
})(y ||= {});
|
|
1211
1211
|
//#endregion
|
|
1212
1212
|
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
|
|
1213
|
-
var
|
|
1213
|
+
var b = class {
|
|
1214
1214
|
constructor(e, t, n, r) {
|
|
1215
1215
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = r;
|
|
1216
1216
|
}
|
|
1217
1217
|
get path() {
|
|
1218
1218
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
1219
1219
|
}
|
|
1220
|
-
},
|
|
1221
|
-
if (
|
|
1220
|
+
}, Ee = (e, t) => {
|
|
1221
|
+
if (v(t)) return {
|
|
1222
1222
|
success: !0,
|
|
1223
1223
|
data: t.value
|
|
1224
1224
|
};
|
|
@@ -1232,7 +1232,7 @@ var x = class {
|
|
|
1232
1232
|
}
|
|
1233
1233
|
};
|
|
1234
1234
|
};
|
|
1235
|
-
function
|
|
1235
|
+
function x(e) {
|
|
1236
1236
|
if (!e) return {};
|
|
1237
1237
|
let { errorMap: t, invalid_type_error: n, required_error: r, description: i } = e;
|
|
1238
1238
|
if (t && (n || r)) throw Error("Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.");
|
|
@@ -1247,7 +1247,7 @@ function S(e) {
|
|
|
1247
1247
|
description: i
|
|
1248
1248
|
};
|
|
1249
1249
|
}
|
|
1250
|
-
var
|
|
1250
|
+
var S = class {
|
|
1251
1251
|
get description() {
|
|
1252
1252
|
return this._def.description;
|
|
1253
1253
|
}
|
|
@@ -1266,7 +1266,7 @@ var C = class {
|
|
|
1266
1266
|
}
|
|
1267
1267
|
_processInputParams(e) {
|
|
1268
1268
|
return {
|
|
1269
|
-
status: new
|
|
1269
|
+
status: new h(),
|
|
1270
1270
|
ctx: {
|
|
1271
1271
|
common: e.parent.common,
|
|
1272
1272
|
data: e.data,
|
|
@@ -1279,7 +1279,7 @@ var C = class {
|
|
|
1279
1279
|
}
|
|
1280
1280
|
_parseSync(e) {
|
|
1281
1281
|
let t = this._parse(e);
|
|
1282
|
-
if (
|
|
1282
|
+
if (Te(t)) throw Error("Synchronous parse encountered promise.");
|
|
1283
1283
|
return t;
|
|
1284
1284
|
}
|
|
1285
1285
|
_parseAsync(e) {
|
|
@@ -1304,7 +1304,7 @@ var C = class {
|
|
|
1304
1304
|
data: e,
|
|
1305
1305
|
parsedType: d(e)
|
|
1306
1306
|
};
|
|
1307
|
-
return
|
|
1307
|
+
return Ee(n, this._parseSync({
|
|
1308
1308
|
data: e,
|
|
1309
1309
|
path: n.path,
|
|
1310
1310
|
parent: n
|
|
@@ -1328,7 +1328,7 @@ var C = class {
|
|
|
1328
1328
|
path: [],
|
|
1329
1329
|
parent: t
|
|
1330
1330
|
});
|
|
1331
|
-
return
|
|
1331
|
+
return v(n) ? { value: n.value } : { issues: t.common.issues };
|
|
1332
1332
|
} catch (e) {
|
|
1333
1333
|
e?.message?.toLowerCase()?.includes("encountered") && (this["~standard"].async = !0), t.common = {
|
|
1334
1334
|
issues: [],
|
|
@@ -1339,7 +1339,7 @@ var C = class {
|
|
|
1339
1339
|
data: e,
|
|
1340
1340
|
path: [],
|
|
1341
1341
|
parent: t
|
|
1342
|
-
}).then((e) =>
|
|
1342
|
+
}).then((e) => v(e) ? { value: e.value } : { issues: t.common.issues });
|
|
1343
1343
|
}
|
|
1344
1344
|
async parseAsync(e, t) {
|
|
1345
1345
|
let n = await this.safeParseAsync(e, t);
|
|
@@ -1363,7 +1363,7 @@ var C = class {
|
|
|
1363
1363
|
path: n.path,
|
|
1364
1364
|
parent: n
|
|
1365
1365
|
});
|
|
1366
|
-
return
|
|
1366
|
+
return Ee(n, await (Te(r) ? r : Promise.resolve(r)));
|
|
1367
1367
|
}
|
|
1368
1368
|
refine(e, t) {
|
|
1369
1369
|
let n = (e) => typeof t == "string" || t === void 0 ? { message: t } : typeof t == "function" ? t(e) : t;
|
|
@@ -1379,9 +1379,9 @@ var C = class {
|
|
|
1379
1379
|
return this._refinement((n, r) => e(n) ? !0 : (r.addIssue(typeof t == "function" ? t(n, r) : t), !1));
|
|
1380
1380
|
}
|
|
1381
1381
|
_refinement(e) {
|
|
1382
|
-
return new
|
|
1382
|
+
return new j({
|
|
1383
1383
|
schema: this,
|
|
1384
|
-
typeName:
|
|
1384
|
+
typeName: P.ZodEffects,
|
|
1385
1385
|
effect: {
|
|
1386
1386
|
type: "refinement",
|
|
1387
1387
|
refinement: e
|
|
@@ -1399,31 +1399,31 @@ var C = class {
|
|
|
1399
1399
|
};
|
|
1400
1400
|
}
|
|
1401
1401
|
optional() {
|
|
1402
|
-
return
|
|
1402
|
+
return M.create(this, this._def);
|
|
1403
1403
|
}
|
|
1404
1404
|
nullable() {
|
|
1405
|
-
return
|
|
1405
|
+
return N.create(this, this._def);
|
|
1406
1406
|
}
|
|
1407
1407
|
nullish() {
|
|
1408
1408
|
return this.nullable().optional();
|
|
1409
1409
|
}
|
|
1410
1410
|
array() {
|
|
1411
|
-
return
|
|
1411
|
+
return T.create(this);
|
|
1412
1412
|
}
|
|
1413
1413
|
promise() {
|
|
1414
|
-
return
|
|
1414
|
+
return A.create(this, this._def);
|
|
1415
1415
|
}
|
|
1416
1416
|
or(e) {
|
|
1417
|
-
return
|
|
1417
|
+
return ct.create([this, e], this._def);
|
|
1418
1418
|
}
|
|
1419
1419
|
and(e) {
|
|
1420
|
-
return
|
|
1420
|
+
return dt.create(this, e, this._def);
|
|
1421
1421
|
}
|
|
1422
1422
|
transform(e) {
|
|
1423
|
-
return new
|
|
1424
|
-
...
|
|
1423
|
+
return new j({
|
|
1424
|
+
...x(this._def),
|
|
1425
1425
|
schema: this,
|
|
1426
|
-
typeName:
|
|
1426
|
+
typeName: P.ZodEffects,
|
|
1427
1427
|
effect: {
|
|
1428
1428
|
type: "transform",
|
|
1429
1429
|
transform: e
|
|
@@ -1432,27 +1432,27 @@ var C = class {
|
|
|
1432
1432
|
}
|
|
1433
1433
|
default(e) {
|
|
1434
1434
|
let t = typeof e == "function" ? e : () => e;
|
|
1435
|
-
return new
|
|
1436
|
-
...
|
|
1435
|
+
return new xt({
|
|
1436
|
+
...x(this._def),
|
|
1437
1437
|
innerType: this,
|
|
1438
1438
|
defaultValue: t,
|
|
1439
|
-
typeName:
|
|
1439
|
+
typeName: P.ZodDefault
|
|
1440
1440
|
});
|
|
1441
1441
|
}
|
|
1442
1442
|
brand() {
|
|
1443
|
-
return new
|
|
1444
|
-
typeName:
|
|
1443
|
+
return new wt({
|
|
1444
|
+
typeName: P.ZodBranded,
|
|
1445
1445
|
type: this,
|
|
1446
|
-
...
|
|
1446
|
+
...x(this._def)
|
|
1447
1447
|
});
|
|
1448
1448
|
}
|
|
1449
1449
|
catch(e) {
|
|
1450
1450
|
let t = typeof e == "function" ? e : () => e;
|
|
1451
|
-
return new
|
|
1452
|
-
...
|
|
1451
|
+
return new St({
|
|
1452
|
+
...x(this._def),
|
|
1453
1453
|
innerType: this,
|
|
1454
1454
|
catchValue: t,
|
|
1455
|
-
typeName:
|
|
1455
|
+
typeName: P.ZodCatch
|
|
1456
1456
|
});
|
|
1457
1457
|
}
|
|
1458
1458
|
describe(e) {
|
|
@@ -1463,10 +1463,10 @@ var C = class {
|
|
|
1463
1463
|
});
|
|
1464
1464
|
}
|
|
1465
1465
|
pipe(e) {
|
|
1466
|
-
return
|
|
1466
|
+
return Tt.create(this, e);
|
|
1467
1467
|
}
|
|
1468
1468
|
readonly() {
|
|
1469
|
-
return
|
|
1469
|
+
return Et.create(this);
|
|
1470
1470
|
}
|
|
1471
1471
|
isOptional() {
|
|
1472
1472
|
return this.safeParse(void 0).success;
|
|
@@ -1474,25 +1474,25 @@ var C = class {
|
|
|
1474
1474
|
isNullable() {
|
|
1475
1475
|
return this.safeParse(null).success;
|
|
1476
1476
|
}
|
|
1477
|
-
},
|
|
1478
|
-
function
|
|
1477
|
+
}, De = /^c[^\s-]{8,}$/i, Oe = /^[0-9a-z]+$/, ke = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Ae = /^[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, je = /^[a-z0-9_-]{21}$/i, Me = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Ne = /^[-+]?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)?)??$/, Pe = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Fe = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", Ie, Le = /^(?:(?: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])$/, Re = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, ze = /^(([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]))$/, Be = /^(([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])$/, Ve = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, He = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Ue = "((\\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])))", We = RegExp(`^${Ue}$`);
|
|
1478
|
+
function Ge(e) {
|
|
1479
1479
|
let t = "[0-5]\\d";
|
|
1480
1480
|
e.precision ? t = `${t}\\.\\d{${e.precision}}` : e.precision ?? (t = `${t}(\\.\\d+)?`);
|
|
1481
1481
|
let n = e.precision ? "+" : "?";
|
|
1482
1482
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`;
|
|
1483
1483
|
}
|
|
1484
|
-
function
|
|
1485
|
-
return RegExp(`^${
|
|
1484
|
+
function Ke(e) {
|
|
1485
|
+
return RegExp(`^${Ge(e)}$`);
|
|
1486
1486
|
}
|
|
1487
|
-
function
|
|
1488
|
-
let t = `${
|
|
1487
|
+
function qe(e) {
|
|
1488
|
+
let t = `${Ue}T${Ge(e)}`, n = [];
|
|
1489
1489
|
return n.push(e.local ? "Z?" : "Z"), e.offset && n.push("([+-]\\d{2}:?\\d{2})"), t = `${t}(${n.join("|")})`, RegExp(`^${t}$`);
|
|
1490
1490
|
}
|
|
1491
|
-
function
|
|
1492
|
-
return !((t !== "v4" && t || !
|
|
1491
|
+
function Je(e, t) {
|
|
1492
|
+
return !((t !== "v4" && t || !Le.test(e)) && (t !== "v6" && t || !ze.test(e)));
|
|
1493
1493
|
}
|
|
1494
|
-
function
|
|
1495
|
-
if (!
|
|
1494
|
+
function Ye(e, t) {
|
|
1495
|
+
if (!Me.test(e)) return !1;
|
|
1496
1496
|
try {
|
|
1497
1497
|
let [n] = e.split(".");
|
|
1498
1498
|
if (!n) return !1;
|
|
@@ -1502,21 +1502,21 @@ function qe(e, t) {
|
|
|
1502
1502
|
return !1;
|
|
1503
1503
|
}
|
|
1504
1504
|
}
|
|
1505
|
-
function
|
|
1506
|
-
return !((t !== "v4" && t || !
|
|
1505
|
+
function Xe(e, t) {
|
|
1506
|
+
return !((t !== "v4" && t || !Re.test(e)) && (t !== "v6" && t || !Be.test(e)));
|
|
1507
1507
|
}
|
|
1508
|
-
var
|
|
1508
|
+
var Ze = class e extends S {
|
|
1509
1509
|
_parse(e) {
|
|
1510
1510
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== u.string) {
|
|
1511
1511
|
let t = this._getOrReturnCtx(e);
|
|
1512
|
-
return
|
|
1512
|
+
return m(t, {
|
|
1513
1513
|
code: f.invalid_type,
|
|
1514
1514
|
expected: u.string,
|
|
1515
1515
|
received: t.parsedType
|
|
1516
|
-
}),
|
|
1516
|
+
}), g;
|
|
1517
1517
|
}
|
|
1518
|
-
let t = new
|
|
1519
|
-
for (let r of this._def.checks) if (r.kind === "min") e.data.length < r.value && (n = this._getOrReturnCtx(e, n),
|
|
1518
|
+
let t = new h(), n;
|
|
1519
|
+
for (let r of this._def.checks) if (r.kind === "min") e.data.length < r.value && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1520
1520
|
code: f.too_small,
|
|
1521
1521
|
minimum: r.value,
|
|
1522
1522
|
type: "string",
|
|
@@ -1524,7 +1524,7 @@ var Ye = class e extends C {
|
|
|
1524
1524
|
exact: !1,
|
|
1525
1525
|
message: r.message
|
|
1526
1526
|
}), t.dirty());
|
|
1527
|
-
else if (r.kind === "max") e.data.length > r.value && (n = this._getOrReturnCtx(e, n),
|
|
1527
|
+
else if (r.kind === "max") e.data.length > r.value && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1528
1528
|
code: f.too_big,
|
|
1529
1529
|
maximum: r.value,
|
|
1530
1530
|
type: "string",
|
|
@@ -1534,14 +1534,14 @@ var Ye = class e extends C {
|
|
|
1534
1534
|
}), t.dirty());
|
|
1535
1535
|
else if (r.kind === "length") {
|
|
1536
1536
|
let i = e.data.length > r.value, a = e.data.length < r.value;
|
|
1537
|
-
(i || a) && (n = this._getOrReturnCtx(e, n), i ?
|
|
1537
|
+
(i || a) && (n = this._getOrReturnCtx(e, n), i ? m(n, {
|
|
1538
1538
|
code: f.too_big,
|
|
1539
1539
|
maximum: r.value,
|
|
1540
1540
|
type: "string",
|
|
1541
1541
|
inclusive: !0,
|
|
1542
1542
|
exact: !0,
|
|
1543
1543
|
message: r.message
|
|
1544
|
-
}) : a &&
|
|
1544
|
+
}) : a && m(n, {
|
|
1545
1545
|
code: f.too_small,
|
|
1546
1546
|
minimum: r.value,
|
|
1547
1547
|
type: "string",
|
|
@@ -1549,37 +1549,37 @@ var Ye = class e extends C {
|
|
|
1549
1549
|
exact: !0,
|
|
1550
1550
|
message: r.message
|
|
1551
1551
|
}), t.dirty());
|
|
1552
|
-
} else if (r.kind === "email")
|
|
1552
|
+
} else if (r.kind === "email") Pe.test(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1553
1553
|
validation: "email",
|
|
1554
1554
|
code: f.invalid_string,
|
|
1555
1555
|
message: r.message
|
|
1556
1556
|
}), t.dirty());
|
|
1557
|
-
else if (r.kind === "emoji")
|
|
1557
|
+
else if (r.kind === "emoji") Ie ||= new RegExp(Fe, "u"), Ie.test(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1558
1558
|
validation: "emoji",
|
|
1559
1559
|
code: f.invalid_string,
|
|
1560
1560
|
message: r.message
|
|
1561
1561
|
}), t.dirty());
|
|
1562
|
-
else if (r.kind === "uuid")
|
|
1562
|
+
else if (r.kind === "uuid") Ae.test(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1563
1563
|
validation: "uuid",
|
|
1564
1564
|
code: f.invalid_string,
|
|
1565
1565
|
message: r.message
|
|
1566
1566
|
}), t.dirty());
|
|
1567
|
-
else if (r.kind === "nanoid")
|
|
1567
|
+
else if (r.kind === "nanoid") je.test(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1568
1568
|
validation: "nanoid",
|
|
1569
1569
|
code: f.invalid_string,
|
|
1570
1570
|
message: r.message
|
|
1571
1571
|
}), t.dirty());
|
|
1572
|
-
else if (r.kind === "cuid")
|
|
1572
|
+
else if (r.kind === "cuid") De.test(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1573
1573
|
validation: "cuid",
|
|
1574
1574
|
code: f.invalid_string,
|
|
1575
1575
|
message: r.message
|
|
1576
1576
|
}), t.dirty());
|
|
1577
|
-
else if (r.kind === "cuid2")
|
|
1577
|
+
else if (r.kind === "cuid2") Oe.test(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1578
1578
|
validation: "cuid2",
|
|
1579
1579
|
code: f.invalid_string,
|
|
1580
1580
|
message: r.message
|
|
1581
1581
|
}), t.dirty());
|
|
1582
|
-
else if (r.kind === "ulid")
|
|
1582
|
+
else if (r.kind === "ulid") ke.test(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1583
1583
|
validation: "ulid",
|
|
1584
1584
|
code: f.invalid_string,
|
|
1585
1585
|
message: r.message
|
|
@@ -1587,64 +1587,64 @@ var Ye = class e extends C {
|
|
|
1587
1587
|
else if (r.kind === "url") try {
|
|
1588
1588
|
new URL(e.data);
|
|
1589
1589
|
} catch {
|
|
1590
|
-
n = this._getOrReturnCtx(e, n),
|
|
1590
|
+
n = this._getOrReturnCtx(e, n), m(n, {
|
|
1591
1591
|
validation: "url",
|
|
1592
1592
|
code: f.invalid_string,
|
|
1593
1593
|
message: r.message
|
|
1594
1594
|
}), t.dirty();
|
|
1595
1595
|
}
|
|
1596
|
-
else r.kind === "regex" ? (r.regex.lastIndex = 0, r.regex.test(e.data) || (n = this._getOrReturnCtx(e, n),
|
|
1596
|
+
else r.kind === "regex" ? (r.regex.lastIndex = 0, r.regex.test(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1597
1597
|
validation: "regex",
|
|
1598
1598
|
code: f.invalid_string,
|
|
1599
1599
|
message: r.message
|
|
1600
|
-
}), t.dirty())) : r.kind === "trim" ? e.data = e.data.trim() : r.kind === "includes" ? e.data.includes(r.value, r.position) || (n = this._getOrReturnCtx(e, n),
|
|
1600
|
+
}), t.dirty())) : r.kind === "trim" ? e.data = e.data.trim() : r.kind === "includes" ? e.data.includes(r.value, r.position) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1601
1601
|
code: f.invalid_string,
|
|
1602
1602
|
validation: {
|
|
1603
1603
|
includes: r.value,
|
|
1604
1604
|
position: r.position
|
|
1605
1605
|
},
|
|
1606
1606
|
message: r.message
|
|
1607
|
-
}), t.dirty()) : r.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : r.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : r.kind === "startsWith" ? e.data.startsWith(r.value) || (n = this._getOrReturnCtx(e, n),
|
|
1607
|
+
}), t.dirty()) : r.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : r.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : r.kind === "startsWith" ? e.data.startsWith(r.value) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1608
1608
|
code: f.invalid_string,
|
|
1609
1609
|
validation: { startsWith: r.value },
|
|
1610
1610
|
message: r.message
|
|
1611
|
-
}), t.dirty()) : r.kind === "endsWith" ? e.data.endsWith(r.value) || (n = this._getOrReturnCtx(e, n),
|
|
1611
|
+
}), t.dirty()) : r.kind === "endsWith" ? e.data.endsWith(r.value) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1612
1612
|
code: f.invalid_string,
|
|
1613
1613
|
validation: { endsWith: r.value },
|
|
1614
1614
|
message: r.message
|
|
1615
|
-
}), t.dirty()) : r.kind === "datetime" ?
|
|
1615
|
+
}), t.dirty()) : r.kind === "datetime" ? qe(r).test(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1616
1616
|
code: f.invalid_string,
|
|
1617
1617
|
validation: "datetime",
|
|
1618
1618
|
message: r.message
|
|
1619
|
-
}), t.dirty()) : r.kind === "date" ?
|
|
1619
|
+
}), t.dirty()) : r.kind === "date" ? We.test(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1620
1620
|
code: f.invalid_string,
|
|
1621
1621
|
validation: "date",
|
|
1622
1622
|
message: r.message
|
|
1623
|
-
}), t.dirty()) : r.kind === "time" ?
|
|
1623
|
+
}), t.dirty()) : r.kind === "time" ? Ke(r).test(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1624
1624
|
code: f.invalid_string,
|
|
1625
1625
|
validation: "time",
|
|
1626
1626
|
message: r.message
|
|
1627
|
-
}), t.dirty()) : r.kind === "duration" ?
|
|
1627
|
+
}), t.dirty()) : r.kind === "duration" ? Ne.test(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1628
1628
|
validation: "duration",
|
|
1629
1629
|
code: f.invalid_string,
|
|
1630
1630
|
message: r.message
|
|
1631
|
-
}), t.dirty()) : r.kind === "ip" ?
|
|
1631
|
+
}), t.dirty()) : r.kind === "ip" ? Je(e.data, r.version) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1632
1632
|
validation: "ip",
|
|
1633
1633
|
code: f.invalid_string,
|
|
1634
1634
|
message: r.message
|
|
1635
|
-
}), t.dirty()) : r.kind === "jwt" ?
|
|
1635
|
+
}), t.dirty()) : r.kind === "jwt" ? Ye(e.data, r.alg) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1636
1636
|
validation: "jwt",
|
|
1637
1637
|
code: f.invalid_string,
|
|
1638
1638
|
message: r.message
|
|
1639
|
-
}), t.dirty()) : r.kind === "cidr" ?
|
|
1639
|
+
}), t.dirty()) : r.kind === "cidr" ? Xe(e.data, r.version) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1640
1640
|
validation: "cidr",
|
|
1641
1641
|
code: f.invalid_string,
|
|
1642
1642
|
message: r.message
|
|
1643
|
-
}), t.dirty()) : r.kind === "base64" ?
|
|
1643
|
+
}), t.dirty()) : r.kind === "base64" ? Ve.test(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1644
1644
|
validation: "base64",
|
|
1645
1645
|
code: f.invalid_string,
|
|
1646
1646
|
message: r.message
|
|
1647
|
-
}), t.dirty()) : r.kind === "base64url" ?
|
|
1647
|
+
}), t.dirty()) : r.kind === "base64url" ? He.test(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
1648
1648
|
validation: "base64url",
|
|
1649
1649
|
code: f.invalid_string,
|
|
1650
1650
|
message: r.message
|
|
@@ -1658,7 +1658,7 @@ var Ye = class e extends C {
|
|
|
1658
1658
|
return this.refinement((t) => e.test(t), {
|
|
1659
1659
|
validation: t,
|
|
1660
1660
|
code: f.invalid_string,
|
|
1661
|
-
...
|
|
1661
|
+
...y.errToObj(n)
|
|
1662
1662
|
});
|
|
1663
1663
|
}
|
|
1664
1664
|
_addCheck(t) {
|
|
@@ -1670,79 +1670,79 @@ var Ye = class e extends C {
|
|
|
1670
1670
|
email(e) {
|
|
1671
1671
|
return this._addCheck({
|
|
1672
1672
|
kind: "email",
|
|
1673
|
-
...
|
|
1673
|
+
...y.errToObj(e)
|
|
1674
1674
|
});
|
|
1675
1675
|
}
|
|
1676
1676
|
url(e) {
|
|
1677
1677
|
return this._addCheck({
|
|
1678
1678
|
kind: "url",
|
|
1679
|
-
...
|
|
1679
|
+
...y.errToObj(e)
|
|
1680
1680
|
});
|
|
1681
1681
|
}
|
|
1682
1682
|
emoji(e) {
|
|
1683
1683
|
return this._addCheck({
|
|
1684
1684
|
kind: "emoji",
|
|
1685
|
-
...
|
|
1685
|
+
...y.errToObj(e)
|
|
1686
1686
|
});
|
|
1687
1687
|
}
|
|
1688
1688
|
uuid(e) {
|
|
1689
1689
|
return this._addCheck({
|
|
1690
1690
|
kind: "uuid",
|
|
1691
|
-
...
|
|
1691
|
+
...y.errToObj(e)
|
|
1692
1692
|
});
|
|
1693
1693
|
}
|
|
1694
1694
|
nanoid(e) {
|
|
1695
1695
|
return this._addCheck({
|
|
1696
1696
|
kind: "nanoid",
|
|
1697
|
-
...
|
|
1697
|
+
...y.errToObj(e)
|
|
1698
1698
|
});
|
|
1699
1699
|
}
|
|
1700
1700
|
cuid(e) {
|
|
1701
1701
|
return this._addCheck({
|
|
1702
1702
|
kind: "cuid",
|
|
1703
|
-
...
|
|
1703
|
+
...y.errToObj(e)
|
|
1704
1704
|
});
|
|
1705
1705
|
}
|
|
1706
1706
|
cuid2(e) {
|
|
1707
1707
|
return this._addCheck({
|
|
1708
1708
|
kind: "cuid2",
|
|
1709
|
-
...
|
|
1709
|
+
...y.errToObj(e)
|
|
1710
1710
|
});
|
|
1711
1711
|
}
|
|
1712
1712
|
ulid(e) {
|
|
1713
1713
|
return this._addCheck({
|
|
1714
1714
|
kind: "ulid",
|
|
1715
|
-
...
|
|
1715
|
+
...y.errToObj(e)
|
|
1716
1716
|
});
|
|
1717
1717
|
}
|
|
1718
1718
|
base64(e) {
|
|
1719
1719
|
return this._addCheck({
|
|
1720
1720
|
kind: "base64",
|
|
1721
|
-
...
|
|
1721
|
+
...y.errToObj(e)
|
|
1722
1722
|
});
|
|
1723
1723
|
}
|
|
1724
1724
|
base64url(e) {
|
|
1725
1725
|
return this._addCheck({
|
|
1726
1726
|
kind: "base64url",
|
|
1727
|
-
...
|
|
1727
|
+
...y.errToObj(e)
|
|
1728
1728
|
});
|
|
1729
1729
|
}
|
|
1730
1730
|
jwt(e) {
|
|
1731
1731
|
return this._addCheck({
|
|
1732
1732
|
kind: "jwt",
|
|
1733
|
-
...
|
|
1733
|
+
...y.errToObj(e)
|
|
1734
1734
|
});
|
|
1735
1735
|
}
|
|
1736
1736
|
ip(e) {
|
|
1737
1737
|
return this._addCheck({
|
|
1738
1738
|
kind: "ip",
|
|
1739
|
-
...
|
|
1739
|
+
...y.errToObj(e)
|
|
1740
1740
|
});
|
|
1741
1741
|
}
|
|
1742
1742
|
cidr(e) {
|
|
1743
1743
|
return this._addCheck({
|
|
1744
1744
|
kind: "cidr",
|
|
1745
|
-
...
|
|
1745
|
+
...y.errToObj(e)
|
|
1746
1746
|
});
|
|
1747
1747
|
}
|
|
1748
1748
|
datetime(e) {
|
|
@@ -1757,7 +1757,7 @@ var Ye = class e extends C {
|
|
|
1757
1757
|
precision: e?.precision === void 0 ? null : e?.precision,
|
|
1758
1758
|
offset: e?.offset ?? !1,
|
|
1759
1759
|
local: e?.local ?? !1,
|
|
1760
|
-
...
|
|
1760
|
+
...y.errToObj(e?.message)
|
|
1761
1761
|
});
|
|
1762
1762
|
}
|
|
1763
1763
|
date(e) {
|
|
@@ -1774,20 +1774,20 @@ var Ye = class e extends C {
|
|
|
1774
1774
|
}) : this._addCheck({
|
|
1775
1775
|
kind: "time",
|
|
1776
1776
|
precision: e?.precision === void 0 ? null : e?.precision,
|
|
1777
|
-
...
|
|
1777
|
+
...y.errToObj(e?.message)
|
|
1778
1778
|
});
|
|
1779
1779
|
}
|
|
1780
1780
|
duration(e) {
|
|
1781
1781
|
return this._addCheck({
|
|
1782
1782
|
kind: "duration",
|
|
1783
|
-
...
|
|
1783
|
+
...y.errToObj(e)
|
|
1784
1784
|
});
|
|
1785
1785
|
}
|
|
1786
1786
|
regex(e, t) {
|
|
1787
1787
|
return this._addCheck({
|
|
1788
1788
|
kind: "regex",
|
|
1789
1789
|
regex: e,
|
|
1790
|
-
...
|
|
1790
|
+
...y.errToObj(t)
|
|
1791
1791
|
});
|
|
1792
1792
|
}
|
|
1793
1793
|
includes(e, t) {
|
|
@@ -1795,46 +1795,46 @@ var Ye = class e extends C {
|
|
|
1795
1795
|
kind: "includes",
|
|
1796
1796
|
value: e,
|
|
1797
1797
|
position: t?.position,
|
|
1798
|
-
...
|
|
1798
|
+
...y.errToObj(t?.message)
|
|
1799
1799
|
});
|
|
1800
1800
|
}
|
|
1801
1801
|
startsWith(e, t) {
|
|
1802
1802
|
return this._addCheck({
|
|
1803
1803
|
kind: "startsWith",
|
|
1804
1804
|
value: e,
|
|
1805
|
-
...
|
|
1805
|
+
...y.errToObj(t)
|
|
1806
1806
|
});
|
|
1807
1807
|
}
|
|
1808
1808
|
endsWith(e, t) {
|
|
1809
1809
|
return this._addCheck({
|
|
1810
1810
|
kind: "endsWith",
|
|
1811
1811
|
value: e,
|
|
1812
|
-
...
|
|
1812
|
+
...y.errToObj(t)
|
|
1813
1813
|
});
|
|
1814
1814
|
}
|
|
1815
1815
|
min(e, t) {
|
|
1816
1816
|
return this._addCheck({
|
|
1817
1817
|
kind: "min",
|
|
1818
1818
|
value: e,
|
|
1819
|
-
...
|
|
1819
|
+
...y.errToObj(t)
|
|
1820
1820
|
});
|
|
1821
1821
|
}
|
|
1822
1822
|
max(e, t) {
|
|
1823
1823
|
return this._addCheck({
|
|
1824
1824
|
kind: "max",
|
|
1825
1825
|
value: e,
|
|
1826
|
-
...
|
|
1826
|
+
...y.errToObj(t)
|
|
1827
1827
|
});
|
|
1828
1828
|
}
|
|
1829
1829
|
length(e, t) {
|
|
1830
1830
|
return this._addCheck({
|
|
1831
1831
|
kind: "length",
|
|
1832
1832
|
value: e,
|
|
1833
|
-
...
|
|
1833
|
+
...y.errToObj(t)
|
|
1834
1834
|
});
|
|
1835
1835
|
}
|
|
1836
1836
|
nonempty(e) {
|
|
1837
|
-
return this.min(1,
|
|
1837
|
+
return this.min(1, y.errToObj(e));
|
|
1838
1838
|
}
|
|
1839
1839
|
trim() {
|
|
1840
1840
|
return new e({
|
|
@@ -1913,54 +1913,54 @@ var Ye = class e extends C {
|
|
|
1913
1913
|
return e;
|
|
1914
1914
|
}
|
|
1915
1915
|
};
|
|
1916
|
-
|
|
1916
|
+
Ze.create = (e) => new Ze({
|
|
1917
1917
|
checks: [],
|
|
1918
|
-
typeName:
|
|
1918
|
+
typeName: P.ZodString,
|
|
1919
1919
|
coerce: e?.coerce ?? !1,
|
|
1920
|
-
...
|
|
1920
|
+
...x(e)
|
|
1921
1921
|
});
|
|
1922
|
-
function
|
|
1922
|
+
function Qe(e, t) {
|
|
1923
1923
|
let n = (e.toString().split(".")[1] || "").length, r = (t.toString().split(".")[1] || "").length, i = n > r ? n : r;
|
|
1924
1924
|
return Number.parseInt(e.toFixed(i).replace(".", "")) % Number.parseInt(t.toFixed(i).replace(".", "")) / 10 ** i;
|
|
1925
1925
|
}
|
|
1926
|
-
var
|
|
1926
|
+
var $e = class e extends S {
|
|
1927
1927
|
constructor() {
|
|
1928
1928
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1929
1929
|
}
|
|
1930
1930
|
_parse(e) {
|
|
1931
1931
|
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== u.number) {
|
|
1932
1932
|
let t = this._getOrReturnCtx(e);
|
|
1933
|
-
return
|
|
1933
|
+
return m(t, {
|
|
1934
1934
|
code: f.invalid_type,
|
|
1935
1935
|
expected: u.number,
|
|
1936
1936
|
received: t.parsedType
|
|
1937
|
-
}),
|
|
1937
|
+
}), g;
|
|
1938
1938
|
}
|
|
1939
|
-
let t, n = new
|
|
1940
|
-
for (let r of this._def.checks) r.kind === "int" ? l.isInteger(e.data) || (t = this._getOrReturnCtx(e, t),
|
|
1939
|
+
let t, n = new h();
|
|
1940
|
+
for (let r of this._def.checks) r.kind === "int" ? l.isInteger(e.data) || (t = this._getOrReturnCtx(e, t), m(t, {
|
|
1941
1941
|
code: f.invalid_type,
|
|
1942
1942
|
expected: "integer",
|
|
1943
1943
|
received: "float",
|
|
1944
1944
|
message: r.message
|
|
1945
|
-
}), n.dirty()) : r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t),
|
|
1945
|
+
}), n.dirty()) : r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t), m(t, {
|
|
1946
1946
|
code: f.too_small,
|
|
1947
1947
|
minimum: r.value,
|
|
1948
1948
|
type: "number",
|
|
1949
1949
|
inclusive: r.inclusive,
|
|
1950
1950
|
exact: !1,
|
|
1951
1951
|
message: r.message
|
|
1952
|
-
}), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t),
|
|
1952
|
+
}), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t), m(t, {
|
|
1953
1953
|
code: f.too_big,
|
|
1954
1954
|
maximum: r.value,
|
|
1955
1955
|
type: "number",
|
|
1956
1956
|
inclusive: r.inclusive,
|
|
1957
1957
|
exact: !1,
|
|
1958
1958
|
message: r.message
|
|
1959
|
-
}), n.dirty()) : r.kind === "multipleOf" ?
|
|
1959
|
+
}), n.dirty()) : r.kind === "multipleOf" ? Qe(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), m(t, {
|
|
1960
1960
|
code: f.not_multiple_of,
|
|
1961
1961
|
multipleOf: r.value,
|
|
1962
1962
|
message: r.message
|
|
1963
|
-
}), n.dirty()) : r.kind === "finite" ? Number.isFinite(e.data) || (t = this._getOrReturnCtx(e, t),
|
|
1963
|
+
}), n.dirty()) : r.kind === "finite" ? Number.isFinite(e.data) || (t = this._getOrReturnCtx(e, t), m(t, {
|
|
1964
1964
|
code: f.not_finite,
|
|
1965
1965
|
message: r.message
|
|
1966
1966
|
}), n.dirty()) : l.assertNever(r);
|
|
@@ -1970,16 +1970,16 @@ var Ze = class e extends C {
|
|
|
1970
1970
|
};
|
|
1971
1971
|
}
|
|
1972
1972
|
gte(e, t) {
|
|
1973
|
-
return this.setLimit("min", e, !0,
|
|
1973
|
+
return this.setLimit("min", e, !0, y.toString(t));
|
|
1974
1974
|
}
|
|
1975
1975
|
gt(e, t) {
|
|
1976
|
-
return this.setLimit("min", e, !1,
|
|
1976
|
+
return this.setLimit("min", e, !1, y.toString(t));
|
|
1977
1977
|
}
|
|
1978
1978
|
lte(e, t) {
|
|
1979
|
-
return this.setLimit("max", e, !0,
|
|
1979
|
+
return this.setLimit("max", e, !0, y.toString(t));
|
|
1980
1980
|
}
|
|
1981
1981
|
lt(e, t) {
|
|
1982
|
-
return this.setLimit("max", e, !1,
|
|
1982
|
+
return this.setLimit("max", e, !1, y.toString(t));
|
|
1983
1983
|
}
|
|
1984
1984
|
setLimit(t, n, r, i) {
|
|
1985
1985
|
return new e({
|
|
@@ -1988,7 +1988,7 @@ var Ze = class e extends C {
|
|
|
1988
1988
|
kind: t,
|
|
1989
1989
|
value: n,
|
|
1990
1990
|
inclusive: r,
|
|
1991
|
-
message:
|
|
1991
|
+
message: y.toString(i)
|
|
1992
1992
|
}]
|
|
1993
1993
|
});
|
|
1994
1994
|
}
|
|
@@ -2001,7 +2001,7 @@ var Ze = class e extends C {
|
|
|
2001
2001
|
int(e) {
|
|
2002
2002
|
return this._addCheck({
|
|
2003
2003
|
kind: "int",
|
|
2004
|
-
message:
|
|
2004
|
+
message: y.toString(e)
|
|
2005
2005
|
});
|
|
2006
2006
|
}
|
|
2007
2007
|
positive(e) {
|
|
@@ -2009,7 +2009,7 @@ var Ze = class e extends C {
|
|
|
2009
2009
|
kind: "min",
|
|
2010
2010
|
value: 0,
|
|
2011
2011
|
inclusive: !1,
|
|
2012
|
-
message:
|
|
2012
|
+
message: y.toString(e)
|
|
2013
2013
|
});
|
|
2014
2014
|
}
|
|
2015
2015
|
negative(e) {
|
|
@@ -2017,7 +2017,7 @@ var Ze = class e extends C {
|
|
|
2017
2017
|
kind: "max",
|
|
2018
2018
|
value: 0,
|
|
2019
2019
|
inclusive: !1,
|
|
2020
|
-
message:
|
|
2020
|
+
message: y.toString(e)
|
|
2021
2021
|
});
|
|
2022
2022
|
}
|
|
2023
2023
|
nonpositive(e) {
|
|
@@ -2025,7 +2025,7 @@ var Ze = class e extends C {
|
|
|
2025
2025
|
kind: "max",
|
|
2026
2026
|
value: 0,
|
|
2027
2027
|
inclusive: !0,
|
|
2028
|
-
message:
|
|
2028
|
+
message: y.toString(e)
|
|
2029
2029
|
});
|
|
2030
2030
|
}
|
|
2031
2031
|
nonnegative(e) {
|
|
@@ -2033,20 +2033,20 @@ var Ze = class e extends C {
|
|
|
2033
2033
|
kind: "min",
|
|
2034
2034
|
value: 0,
|
|
2035
2035
|
inclusive: !0,
|
|
2036
|
-
message:
|
|
2036
|
+
message: y.toString(e)
|
|
2037
2037
|
});
|
|
2038
2038
|
}
|
|
2039
2039
|
multipleOf(e, t) {
|
|
2040
2040
|
return this._addCheck({
|
|
2041
2041
|
kind: "multipleOf",
|
|
2042
2042
|
value: e,
|
|
2043
|
-
message:
|
|
2043
|
+
message: y.toString(t)
|
|
2044
2044
|
});
|
|
2045
2045
|
}
|
|
2046
2046
|
finite(e) {
|
|
2047
2047
|
return this._addCheck({
|
|
2048
2048
|
kind: "finite",
|
|
2049
|
-
message:
|
|
2049
|
+
message: y.toString(e)
|
|
2050
2050
|
});
|
|
2051
2051
|
}
|
|
2052
2052
|
safe(e) {
|
|
@@ -2054,12 +2054,12 @@ var Ze = class e extends C {
|
|
|
2054
2054
|
kind: "min",
|
|
2055
2055
|
inclusive: !0,
|
|
2056
2056
|
value: -(2 ** 53 - 1),
|
|
2057
|
-
message:
|
|
2057
|
+
message: y.toString(e)
|
|
2058
2058
|
})._addCheck({
|
|
2059
2059
|
kind: "max",
|
|
2060
2060
|
inclusive: !0,
|
|
2061
2061
|
value: 2 ** 53 - 1,
|
|
2062
|
-
message:
|
|
2062
|
+
message: y.toString(e)
|
|
2063
2063
|
});
|
|
2064
2064
|
}
|
|
2065
2065
|
get minValue() {
|
|
@@ -2082,13 +2082,13 @@ var Ze = class e extends C {
|
|
|
2082
2082
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
2083
2083
|
}
|
|
2084
2084
|
};
|
|
2085
|
-
|
|
2085
|
+
$e.create = (e) => new $e({
|
|
2086
2086
|
checks: [],
|
|
2087
|
-
typeName:
|
|
2087
|
+
typeName: P.ZodNumber,
|
|
2088
2088
|
coerce: e?.coerce || !1,
|
|
2089
|
-
...
|
|
2089
|
+
...x(e)
|
|
2090
2090
|
});
|
|
2091
|
-
var
|
|
2091
|
+
var et = class e extends S {
|
|
2092
2092
|
constructor() {
|
|
2093
2093
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
2094
2094
|
}
|
|
@@ -2099,20 +2099,20 @@ var Qe = class e extends C {
|
|
|
2099
2099
|
return this._getInvalidInput(e);
|
|
2100
2100
|
}
|
|
2101
2101
|
if (this._getType(e) !== u.bigint) return this._getInvalidInput(e);
|
|
2102
|
-
let t, n = new
|
|
2103
|
-
for (let r of this._def.checks) r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t),
|
|
2102
|
+
let t, n = new h();
|
|
2103
|
+
for (let r of this._def.checks) r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t), m(t, {
|
|
2104
2104
|
code: f.too_small,
|
|
2105
2105
|
type: "bigint",
|
|
2106
2106
|
minimum: r.value,
|
|
2107
2107
|
inclusive: r.inclusive,
|
|
2108
2108
|
message: r.message
|
|
2109
|
-
}), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t),
|
|
2109
|
+
}), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t), m(t, {
|
|
2110
2110
|
code: f.too_big,
|
|
2111
2111
|
type: "bigint",
|
|
2112
2112
|
maximum: r.value,
|
|
2113
2113
|
inclusive: r.inclusive,
|
|
2114
2114
|
message: r.message
|
|
2115
|
-
}), n.dirty()) : r.kind === "multipleOf" ? e.data % r.value !== BigInt(0) && (t = this._getOrReturnCtx(e, t),
|
|
2115
|
+
}), n.dirty()) : r.kind === "multipleOf" ? e.data % r.value !== BigInt(0) && (t = this._getOrReturnCtx(e, t), m(t, {
|
|
2116
2116
|
code: f.not_multiple_of,
|
|
2117
2117
|
multipleOf: r.value,
|
|
2118
2118
|
message: r.message
|
|
@@ -2124,23 +2124,23 @@ var Qe = class e extends C {
|
|
|
2124
2124
|
}
|
|
2125
2125
|
_getInvalidInput(e) {
|
|
2126
2126
|
let t = this._getOrReturnCtx(e);
|
|
2127
|
-
return
|
|
2127
|
+
return m(t, {
|
|
2128
2128
|
code: f.invalid_type,
|
|
2129
2129
|
expected: u.bigint,
|
|
2130
2130
|
received: t.parsedType
|
|
2131
|
-
}),
|
|
2131
|
+
}), g;
|
|
2132
2132
|
}
|
|
2133
2133
|
gte(e, t) {
|
|
2134
|
-
return this.setLimit("min", e, !0,
|
|
2134
|
+
return this.setLimit("min", e, !0, y.toString(t));
|
|
2135
2135
|
}
|
|
2136
2136
|
gt(e, t) {
|
|
2137
|
-
return this.setLimit("min", e, !1,
|
|
2137
|
+
return this.setLimit("min", e, !1, y.toString(t));
|
|
2138
2138
|
}
|
|
2139
2139
|
lte(e, t) {
|
|
2140
|
-
return this.setLimit("max", e, !0,
|
|
2140
|
+
return this.setLimit("max", e, !0, y.toString(t));
|
|
2141
2141
|
}
|
|
2142
2142
|
lt(e, t) {
|
|
2143
|
-
return this.setLimit("max", e, !1,
|
|
2143
|
+
return this.setLimit("max", e, !1, y.toString(t));
|
|
2144
2144
|
}
|
|
2145
2145
|
setLimit(t, n, r, i) {
|
|
2146
2146
|
return new e({
|
|
@@ -2149,7 +2149,7 @@ var Qe = class e extends C {
|
|
|
2149
2149
|
kind: t,
|
|
2150
2150
|
value: n,
|
|
2151
2151
|
inclusive: r,
|
|
2152
|
-
message:
|
|
2152
|
+
message: y.toString(i)
|
|
2153
2153
|
}]
|
|
2154
2154
|
});
|
|
2155
2155
|
}
|
|
@@ -2164,7 +2164,7 @@ var Qe = class e extends C {
|
|
|
2164
2164
|
kind: "min",
|
|
2165
2165
|
value: BigInt(0),
|
|
2166
2166
|
inclusive: !1,
|
|
2167
|
-
message:
|
|
2167
|
+
message: y.toString(e)
|
|
2168
2168
|
});
|
|
2169
2169
|
}
|
|
2170
2170
|
negative(e) {
|
|
@@ -2172,7 +2172,7 @@ var Qe = class e extends C {
|
|
|
2172
2172
|
kind: "max",
|
|
2173
2173
|
value: BigInt(0),
|
|
2174
2174
|
inclusive: !1,
|
|
2175
|
-
message:
|
|
2175
|
+
message: y.toString(e)
|
|
2176
2176
|
});
|
|
2177
2177
|
}
|
|
2178
2178
|
nonpositive(e) {
|
|
@@ -2180,7 +2180,7 @@ var Qe = class e extends C {
|
|
|
2180
2180
|
kind: "max",
|
|
2181
2181
|
value: BigInt(0),
|
|
2182
2182
|
inclusive: !0,
|
|
2183
|
-
message:
|
|
2183
|
+
message: y.toString(e)
|
|
2184
2184
|
});
|
|
2185
2185
|
}
|
|
2186
2186
|
nonnegative(e) {
|
|
@@ -2188,14 +2188,14 @@ var Qe = class e extends C {
|
|
|
2188
2188
|
kind: "min",
|
|
2189
2189
|
value: BigInt(0),
|
|
2190
2190
|
inclusive: !0,
|
|
2191
|
-
message:
|
|
2191
|
+
message: y.toString(e)
|
|
2192
2192
|
});
|
|
2193
2193
|
}
|
|
2194
2194
|
multipleOf(e, t) {
|
|
2195
2195
|
return this._addCheck({
|
|
2196
2196
|
kind: "multipleOf",
|
|
2197
2197
|
value: e,
|
|
2198
|
-
message:
|
|
2198
|
+
message: y.toString(t)
|
|
2199
2199
|
});
|
|
2200
2200
|
}
|
|
2201
2201
|
get minValue() {
|
|
@@ -2209,50 +2209,50 @@ var Qe = class e extends C {
|
|
|
2209
2209
|
return e;
|
|
2210
2210
|
}
|
|
2211
2211
|
};
|
|
2212
|
-
|
|
2212
|
+
et.create = (e) => new et({
|
|
2213
2213
|
checks: [],
|
|
2214
|
-
typeName:
|
|
2214
|
+
typeName: P.ZodBigInt,
|
|
2215
2215
|
coerce: e?.coerce ?? !1,
|
|
2216
|
-
...
|
|
2216
|
+
...x(e)
|
|
2217
2217
|
});
|
|
2218
|
-
var
|
|
2218
|
+
var tt = class extends S {
|
|
2219
2219
|
_parse(e) {
|
|
2220
2220
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== u.boolean) {
|
|
2221
2221
|
let t = this._getOrReturnCtx(e);
|
|
2222
|
-
return
|
|
2222
|
+
return m(t, {
|
|
2223
2223
|
code: f.invalid_type,
|
|
2224
2224
|
expected: u.boolean,
|
|
2225
2225
|
received: t.parsedType
|
|
2226
|
-
}),
|
|
2226
|
+
}), g;
|
|
2227
2227
|
}
|
|
2228
|
-
return
|
|
2228
|
+
return _(e.data);
|
|
2229
2229
|
}
|
|
2230
2230
|
};
|
|
2231
|
-
|
|
2232
|
-
typeName:
|
|
2231
|
+
tt.create = (e) => new tt({
|
|
2232
|
+
typeName: P.ZodBoolean,
|
|
2233
2233
|
coerce: e?.coerce || !1,
|
|
2234
|
-
...
|
|
2234
|
+
...x(e)
|
|
2235
2235
|
});
|
|
2236
|
-
var
|
|
2236
|
+
var nt = class e extends S {
|
|
2237
2237
|
_parse(e) {
|
|
2238
2238
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== u.date) {
|
|
2239
2239
|
let t = this._getOrReturnCtx(e);
|
|
2240
|
-
return
|
|
2240
|
+
return m(t, {
|
|
2241
2241
|
code: f.invalid_type,
|
|
2242
2242
|
expected: u.date,
|
|
2243
2243
|
received: t.parsedType
|
|
2244
|
-
}),
|
|
2244
|
+
}), g;
|
|
2245
2245
|
}
|
|
2246
|
-
if (Number.isNaN(e.data.getTime())) return
|
|
2247
|
-
let t = new
|
|
2248
|
-
for (let r of this._def.checks) r.kind === "min" ? e.data.getTime() < r.value && (n = this._getOrReturnCtx(e, n),
|
|
2246
|
+
if (Number.isNaN(e.data.getTime())) return m(this._getOrReturnCtx(e), { code: f.invalid_date }), g;
|
|
2247
|
+
let t = new h(), n;
|
|
2248
|
+
for (let r of this._def.checks) r.kind === "min" ? e.data.getTime() < r.value && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2249
2249
|
code: f.too_small,
|
|
2250
2250
|
message: r.message,
|
|
2251
2251
|
inclusive: !0,
|
|
2252
2252
|
exact: !1,
|
|
2253
2253
|
minimum: r.value,
|
|
2254
2254
|
type: "date"
|
|
2255
|
-
}), t.dirty()) : r.kind === "max" ? e.data.getTime() > r.value && (n = this._getOrReturnCtx(e, n),
|
|
2255
|
+
}), t.dirty()) : r.kind === "max" ? e.data.getTime() > r.value && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2256
2256
|
code: f.too_big,
|
|
2257
2257
|
message: r.message,
|
|
2258
2258
|
inclusive: !0,
|
|
@@ -2275,14 +2275,14 @@ var et = class e extends C {
|
|
|
2275
2275
|
return this._addCheck({
|
|
2276
2276
|
kind: "min",
|
|
2277
2277
|
value: e.getTime(),
|
|
2278
|
-
message:
|
|
2278
|
+
message: y.toString(t)
|
|
2279
2279
|
});
|
|
2280
2280
|
}
|
|
2281
2281
|
max(e, t) {
|
|
2282
2282
|
return this._addCheck({
|
|
2283
2283
|
kind: "max",
|
|
2284
2284
|
value: e.getTime(),
|
|
2285
|
-
message:
|
|
2285
|
+
message: y.toString(t)
|
|
2286
2286
|
});
|
|
2287
2287
|
}
|
|
2288
2288
|
get minDate() {
|
|
@@ -2296,129 +2296,129 @@ var et = class e extends C {
|
|
|
2296
2296
|
return e == null ? null : new Date(e);
|
|
2297
2297
|
}
|
|
2298
2298
|
};
|
|
2299
|
-
|
|
2299
|
+
nt.create = (e) => new nt({
|
|
2300
2300
|
checks: [],
|
|
2301
2301
|
coerce: e?.coerce || !1,
|
|
2302
|
-
typeName:
|
|
2303
|
-
...
|
|
2302
|
+
typeName: P.ZodDate,
|
|
2303
|
+
...x(e)
|
|
2304
2304
|
});
|
|
2305
|
-
var
|
|
2305
|
+
var rt = class extends S {
|
|
2306
2306
|
_parse(e) {
|
|
2307
2307
|
if (this._getType(e) !== u.symbol) {
|
|
2308
2308
|
let t = this._getOrReturnCtx(e);
|
|
2309
|
-
return
|
|
2309
|
+
return m(t, {
|
|
2310
2310
|
code: f.invalid_type,
|
|
2311
2311
|
expected: u.symbol,
|
|
2312
2312
|
received: t.parsedType
|
|
2313
|
-
}),
|
|
2313
|
+
}), g;
|
|
2314
2314
|
}
|
|
2315
|
-
return
|
|
2315
|
+
return _(e.data);
|
|
2316
2316
|
}
|
|
2317
2317
|
};
|
|
2318
|
-
|
|
2319
|
-
typeName:
|
|
2320
|
-
...
|
|
2318
|
+
rt.create = (e) => new rt({
|
|
2319
|
+
typeName: P.ZodSymbol,
|
|
2320
|
+
...x(e)
|
|
2321
2321
|
});
|
|
2322
|
-
var
|
|
2322
|
+
var it = class extends S {
|
|
2323
2323
|
_parse(e) {
|
|
2324
2324
|
if (this._getType(e) !== u.undefined) {
|
|
2325
2325
|
let t = this._getOrReturnCtx(e);
|
|
2326
|
-
return
|
|
2326
|
+
return m(t, {
|
|
2327
2327
|
code: f.invalid_type,
|
|
2328
2328
|
expected: u.undefined,
|
|
2329
2329
|
received: t.parsedType
|
|
2330
|
-
}),
|
|
2330
|
+
}), g;
|
|
2331
2331
|
}
|
|
2332
|
-
return
|
|
2332
|
+
return _(e.data);
|
|
2333
2333
|
}
|
|
2334
2334
|
};
|
|
2335
|
-
|
|
2336
|
-
typeName:
|
|
2337
|
-
...
|
|
2335
|
+
it.create = (e) => new it({
|
|
2336
|
+
typeName: P.ZodUndefined,
|
|
2337
|
+
...x(e)
|
|
2338
2338
|
});
|
|
2339
|
-
var
|
|
2339
|
+
var at = class extends S {
|
|
2340
2340
|
_parse(e) {
|
|
2341
2341
|
if (this._getType(e) !== u.null) {
|
|
2342
2342
|
let t = this._getOrReturnCtx(e);
|
|
2343
|
-
return
|
|
2343
|
+
return m(t, {
|
|
2344
2344
|
code: f.invalid_type,
|
|
2345
2345
|
expected: u.null,
|
|
2346
2346
|
received: t.parsedType
|
|
2347
|
-
}),
|
|
2347
|
+
}), g;
|
|
2348
2348
|
}
|
|
2349
|
-
return
|
|
2349
|
+
return _(e.data);
|
|
2350
2350
|
}
|
|
2351
2351
|
};
|
|
2352
|
-
|
|
2353
|
-
typeName:
|
|
2354
|
-
...
|
|
2352
|
+
at.create = (e) => new at({
|
|
2353
|
+
typeName: P.ZodNull,
|
|
2354
|
+
...x(e)
|
|
2355
2355
|
});
|
|
2356
|
-
var
|
|
2356
|
+
var ot = class extends S {
|
|
2357
2357
|
constructor() {
|
|
2358
2358
|
super(...arguments), this._any = !0;
|
|
2359
2359
|
}
|
|
2360
2360
|
_parse(e) {
|
|
2361
|
-
return
|
|
2361
|
+
return _(e.data);
|
|
2362
2362
|
}
|
|
2363
2363
|
};
|
|
2364
|
-
|
|
2365
|
-
typeName:
|
|
2366
|
-
...
|
|
2364
|
+
ot.create = (e) => new ot({
|
|
2365
|
+
typeName: P.ZodAny,
|
|
2366
|
+
...x(e)
|
|
2367
2367
|
});
|
|
2368
|
-
var
|
|
2368
|
+
var C = class extends S {
|
|
2369
2369
|
constructor() {
|
|
2370
2370
|
super(...arguments), this._unknown = !0;
|
|
2371
2371
|
}
|
|
2372
2372
|
_parse(e) {
|
|
2373
|
-
return
|
|
2373
|
+
return _(e.data);
|
|
2374
2374
|
}
|
|
2375
2375
|
};
|
|
2376
|
-
|
|
2377
|
-
typeName:
|
|
2378
|
-
...
|
|
2376
|
+
C.create = (e) => new C({
|
|
2377
|
+
typeName: P.ZodUnknown,
|
|
2378
|
+
...x(e)
|
|
2379
2379
|
});
|
|
2380
|
-
var
|
|
2380
|
+
var w = class extends S {
|
|
2381
2381
|
_parse(e) {
|
|
2382
2382
|
let t = this._getOrReturnCtx(e);
|
|
2383
|
-
return
|
|
2383
|
+
return m(t, {
|
|
2384
2384
|
code: f.invalid_type,
|
|
2385
2385
|
expected: u.never,
|
|
2386
2386
|
received: t.parsedType
|
|
2387
|
-
}),
|
|
2387
|
+
}), g;
|
|
2388
2388
|
}
|
|
2389
2389
|
};
|
|
2390
|
-
|
|
2391
|
-
typeName:
|
|
2392
|
-
...
|
|
2390
|
+
w.create = (e) => new w({
|
|
2391
|
+
typeName: P.ZodNever,
|
|
2392
|
+
...x(e)
|
|
2393
2393
|
});
|
|
2394
|
-
var
|
|
2394
|
+
var st = class extends S {
|
|
2395
2395
|
_parse(e) {
|
|
2396
2396
|
if (this._getType(e) !== u.undefined) {
|
|
2397
2397
|
let t = this._getOrReturnCtx(e);
|
|
2398
|
-
return
|
|
2398
|
+
return m(t, {
|
|
2399
2399
|
code: f.invalid_type,
|
|
2400
2400
|
expected: u.void,
|
|
2401
2401
|
received: t.parsedType
|
|
2402
|
-
}),
|
|
2402
|
+
}), g;
|
|
2403
2403
|
}
|
|
2404
|
-
return
|
|
2404
|
+
return _(e.data);
|
|
2405
2405
|
}
|
|
2406
2406
|
};
|
|
2407
|
-
|
|
2408
|
-
typeName:
|
|
2409
|
-
...
|
|
2407
|
+
st.create = (e) => new st({
|
|
2408
|
+
typeName: P.ZodVoid,
|
|
2409
|
+
...x(e)
|
|
2410
2410
|
});
|
|
2411
|
-
var
|
|
2411
|
+
var T = class e extends S {
|
|
2412
2412
|
_parse(e) {
|
|
2413
2413
|
let { ctx: t, status: n } = this._processInputParams(e), r = this._def;
|
|
2414
|
-
if (t.parsedType !== u.array) return
|
|
2414
|
+
if (t.parsedType !== u.array) return m(t, {
|
|
2415
2415
|
code: f.invalid_type,
|
|
2416
2416
|
expected: u.array,
|
|
2417
2417
|
received: t.parsedType
|
|
2418
|
-
}),
|
|
2418
|
+
}), g;
|
|
2419
2419
|
if (r.exactLength !== null) {
|
|
2420
2420
|
let e = t.data.length > r.exactLength.value, i = t.data.length < r.exactLength.value;
|
|
2421
|
-
(e || i) && (
|
|
2421
|
+
(e || i) && (m(t, {
|
|
2422
2422
|
code: e ? f.too_big : f.too_small,
|
|
2423
2423
|
minimum: i ? r.exactLength.value : void 0,
|
|
2424
2424
|
maximum: e ? r.exactLength.value : void 0,
|
|
@@ -2428,23 +2428,23 @@ var E = class e extends C {
|
|
|
2428
2428
|
message: r.exactLength.message
|
|
2429
2429
|
}), n.dirty());
|
|
2430
2430
|
}
|
|
2431
|
-
if (r.minLength !== null && t.data.length < r.minLength.value && (
|
|
2431
|
+
if (r.minLength !== null && t.data.length < r.minLength.value && (m(t, {
|
|
2432
2432
|
code: f.too_small,
|
|
2433
2433
|
minimum: r.minLength.value,
|
|
2434
2434
|
type: "array",
|
|
2435
2435
|
inclusive: !0,
|
|
2436
2436
|
exact: !1,
|
|
2437
2437
|
message: r.minLength.message
|
|
2438
|
-
}), n.dirty()), r.maxLength !== null && t.data.length > r.maxLength.value && (
|
|
2438
|
+
}), n.dirty()), r.maxLength !== null && t.data.length > r.maxLength.value && (m(t, {
|
|
2439
2439
|
code: f.too_big,
|
|
2440
2440
|
maximum: r.maxLength.value,
|
|
2441
2441
|
type: "array",
|
|
2442
2442
|
inclusive: !0,
|
|
2443
2443
|
exact: !1,
|
|
2444
2444
|
message: r.maxLength.message
|
|
2445
|
-
}), n.dirty()), t.common.async) return Promise.all([...t.data].map((e, n) => r.type._parseAsync(new
|
|
2446
|
-
let i = [...t.data].map((e, n) => r.type._parseSync(new
|
|
2447
|
-
return
|
|
2445
|
+
}), n.dirty()), t.common.async) return Promise.all([...t.data].map((e, n) => r.type._parseAsync(new b(t, e, t.path, n)))).then((e) => h.mergeArray(n, e));
|
|
2446
|
+
let i = [...t.data].map((e, n) => r.type._parseSync(new b(t, e, t.path, n)));
|
|
2447
|
+
return h.mergeArray(n, i);
|
|
2448
2448
|
}
|
|
2449
2449
|
get element() {
|
|
2450
2450
|
return this._def.type;
|
|
@@ -2454,7 +2454,7 @@ var E = class e extends C {
|
|
|
2454
2454
|
...this._def,
|
|
2455
2455
|
minLength: {
|
|
2456
2456
|
value: t,
|
|
2457
|
-
message:
|
|
2457
|
+
message: y.toString(n)
|
|
2458
2458
|
}
|
|
2459
2459
|
});
|
|
2460
2460
|
}
|
|
@@ -2463,7 +2463,7 @@ var E = class e extends C {
|
|
|
2463
2463
|
...this._def,
|
|
2464
2464
|
maxLength: {
|
|
2465
2465
|
value: t,
|
|
2466
|
-
message:
|
|
2466
|
+
message: y.toString(n)
|
|
2467
2467
|
}
|
|
2468
2468
|
});
|
|
2469
2469
|
}
|
|
@@ -2472,7 +2472,7 @@ var E = class e extends C {
|
|
|
2472
2472
|
...this._def,
|
|
2473
2473
|
exactLength: {
|
|
2474
2474
|
value: t,
|
|
2475
|
-
message:
|
|
2475
|
+
message: y.toString(n)
|
|
2476
2476
|
}
|
|
2477
2477
|
});
|
|
2478
2478
|
}
|
|
@@ -2480,32 +2480,32 @@ var E = class e extends C {
|
|
|
2480
2480
|
return this.min(1, e);
|
|
2481
2481
|
}
|
|
2482
2482
|
};
|
|
2483
|
-
|
|
2483
|
+
T.create = (e, t) => new T({
|
|
2484
2484
|
type: e,
|
|
2485
2485
|
minLength: null,
|
|
2486
2486
|
maxLength: null,
|
|
2487
2487
|
exactLength: null,
|
|
2488
|
-
typeName:
|
|
2489
|
-
...
|
|
2488
|
+
typeName: P.ZodArray,
|
|
2489
|
+
...x(t)
|
|
2490
2490
|
});
|
|
2491
|
-
function
|
|
2492
|
-
if (e instanceof
|
|
2491
|
+
function E(e) {
|
|
2492
|
+
if (e instanceof D) {
|
|
2493
2493
|
let t = {};
|
|
2494
2494
|
for (let n in e.shape) {
|
|
2495
2495
|
let r = e.shape[n];
|
|
2496
|
-
t[n] =
|
|
2496
|
+
t[n] = M.create(E(r));
|
|
2497
2497
|
}
|
|
2498
|
-
return new
|
|
2498
|
+
return new D({
|
|
2499
2499
|
...e._def,
|
|
2500
2500
|
shape: () => t
|
|
2501
2501
|
});
|
|
2502
2502
|
}
|
|
2503
|
-
return e instanceof
|
|
2503
|
+
return e instanceof T ? new T({
|
|
2504
2504
|
...e._def,
|
|
2505
|
-
type:
|
|
2506
|
-
}) : e instanceof
|
|
2505
|
+
type: E(e.element)
|
|
2506
|
+
}) : e instanceof M ? M.create(E(e.unwrap())) : e instanceof N ? N.create(E(e.unwrap())) : e instanceof k ? k.create(e.items.map((e) => E(e))) : e;
|
|
2507
2507
|
}
|
|
2508
|
-
var
|
|
2508
|
+
var D = class e extends S {
|
|
2509
2509
|
constructor() {
|
|
2510
2510
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
2511
2511
|
}
|
|
@@ -2520,14 +2520,14 @@ var O = class e extends C {
|
|
|
2520
2520
|
_parse(e) {
|
|
2521
2521
|
if (this._getType(e) !== u.object) {
|
|
2522
2522
|
let t = this._getOrReturnCtx(e);
|
|
2523
|
-
return
|
|
2523
|
+
return m(t, {
|
|
2524
2524
|
code: f.invalid_type,
|
|
2525
2525
|
expected: u.object,
|
|
2526
2526
|
received: t.parsedType
|
|
2527
|
-
}),
|
|
2527
|
+
}), g;
|
|
2528
2528
|
}
|
|
2529
2529
|
let { status: t, ctx: n } = this._processInputParams(e), { shape: r, keys: i } = this._getCached(), a = [];
|
|
2530
|
-
if (!(this._def.catchall instanceof
|
|
2530
|
+
if (!(this._def.catchall instanceof w && this._def.unknownKeys === "strip")) for (let e in n.data) i.includes(e) || a.push(e);
|
|
2531
2531
|
let o = [];
|
|
2532
2532
|
for (let e of i) {
|
|
2533
2533
|
let t = r[e], i = n.data[e];
|
|
@@ -2536,11 +2536,11 @@ var O = class e extends C {
|
|
|
2536
2536
|
status: "valid",
|
|
2537
2537
|
value: e
|
|
2538
2538
|
},
|
|
2539
|
-
value: t._parse(new
|
|
2539
|
+
value: t._parse(new b(n, i, n.path, e)),
|
|
2540
2540
|
alwaysSet: e in n.data
|
|
2541
2541
|
});
|
|
2542
2542
|
}
|
|
2543
|
-
if (this._def.catchall instanceof
|
|
2543
|
+
if (this._def.catchall instanceof w) {
|
|
2544
2544
|
let e = this._def.unknownKeys;
|
|
2545
2545
|
if (e === "passthrough") for (let e of a) o.push({
|
|
2546
2546
|
key: {
|
|
@@ -2552,7 +2552,7 @@ var O = class e extends C {
|
|
|
2552
2552
|
value: n.data[e]
|
|
2553
2553
|
}
|
|
2554
2554
|
});
|
|
2555
|
-
else if (e === "strict") a.length > 0 && (
|
|
2555
|
+
else if (e === "strict") a.length > 0 && (m(n, {
|
|
2556
2556
|
code: f.unrecognized_keys,
|
|
2557
2557
|
keys: a
|
|
2558
2558
|
}), t.dirty());
|
|
@@ -2566,7 +2566,7 @@ var O = class e extends C {
|
|
|
2566
2566
|
status: "valid",
|
|
2567
2567
|
value: t
|
|
2568
2568
|
},
|
|
2569
|
-
value: e._parse(new
|
|
2569
|
+
value: e._parse(new b(n, r, n.path, t)),
|
|
2570
2570
|
alwaysSet: t in n.data
|
|
2571
2571
|
});
|
|
2572
2572
|
}
|
|
@@ -2582,18 +2582,18 @@ var O = class e extends C {
|
|
|
2582
2582
|
});
|
|
2583
2583
|
}
|
|
2584
2584
|
return e;
|
|
2585
|
-
}).then((e) =>
|
|
2585
|
+
}).then((e) => h.mergeObjectSync(t, e)) : h.mergeObjectSync(t, o);
|
|
2586
2586
|
}
|
|
2587
2587
|
get shape() {
|
|
2588
2588
|
return this._def.shape();
|
|
2589
2589
|
}
|
|
2590
2590
|
strict(t) {
|
|
2591
|
-
return
|
|
2591
|
+
return y.errToObj, new e({
|
|
2592
2592
|
...this._def,
|
|
2593
2593
|
unknownKeys: "strict",
|
|
2594
2594
|
...t === void 0 ? {} : { errorMap: (e, n) => {
|
|
2595
2595
|
let r = this._def.errorMap?.(e, n).message ?? n.defaultError;
|
|
2596
|
-
return e.code === "unrecognized_keys" ? { message:
|
|
2596
|
+
return e.code === "unrecognized_keys" ? { message: y.errToObj(t).message ?? r } : { message: r };
|
|
2597
2597
|
} }
|
|
2598
2598
|
});
|
|
2599
2599
|
}
|
|
@@ -2626,7 +2626,7 @@ var O = class e extends C {
|
|
|
2626
2626
|
...this._def.shape(),
|
|
2627
2627
|
...t._def.shape()
|
|
2628
2628
|
}),
|
|
2629
|
-
typeName:
|
|
2629
|
+
typeName: P.ZodObject
|
|
2630
2630
|
});
|
|
2631
2631
|
}
|
|
2632
2632
|
setKey(e, t) {
|
|
@@ -2655,7 +2655,7 @@ var O = class e extends C {
|
|
|
2655
2655
|
});
|
|
2656
2656
|
}
|
|
2657
2657
|
deepPartial() {
|
|
2658
|
-
return
|
|
2658
|
+
return E(this);
|
|
2659
2659
|
}
|
|
2660
2660
|
partial(t) {
|
|
2661
2661
|
let n = {};
|
|
@@ -2673,7 +2673,7 @@ var O = class e extends C {
|
|
|
2673
2673
|
for (let e of l.objectKeys(this.shape)) if (t && !t[e]) n[e] = this.shape[e];
|
|
2674
2674
|
else {
|
|
2675
2675
|
let t = this.shape[e];
|
|
2676
|
-
for (; t instanceof
|
|
2676
|
+
for (; t instanceof M;) t = t._def.innerType;
|
|
2677
2677
|
n[e] = t;
|
|
2678
2678
|
}
|
|
2679
2679
|
return new e({
|
|
@@ -2682,39 +2682,39 @@ var O = class e extends C {
|
|
|
2682
2682
|
});
|
|
2683
2683
|
}
|
|
2684
2684
|
keyof() {
|
|
2685
|
-
return
|
|
2685
|
+
return vt(l.objectKeys(this.shape));
|
|
2686
2686
|
}
|
|
2687
2687
|
};
|
|
2688
|
-
|
|
2688
|
+
D.create = (e, t) => new D({
|
|
2689
2689
|
shape: () => e,
|
|
2690
2690
|
unknownKeys: "strip",
|
|
2691
|
-
catchall:
|
|
2692
|
-
typeName:
|
|
2693
|
-
...
|
|
2694
|
-
}),
|
|
2691
|
+
catchall: w.create(),
|
|
2692
|
+
typeName: P.ZodObject,
|
|
2693
|
+
...x(t)
|
|
2694
|
+
}), D.strictCreate = (e, t) => new D({
|
|
2695
2695
|
shape: () => e,
|
|
2696
2696
|
unknownKeys: "strict",
|
|
2697
|
-
catchall:
|
|
2698
|
-
typeName:
|
|
2699
|
-
...
|
|
2700
|
-
}),
|
|
2697
|
+
catchall: w.create(),
|
|
2698
|
+
typeName: P.ZodObject,
|
|
2699
|
+
...x(t)
|
|
2700
|
+
}), D.lazycreate = (e, t) => new D({
|
|
2701
2701
|
shape: e,
|
|
2702
2702
|
unknownKeys: "strip",
|
|
2703
|
-
catchall:
|
|
2704
|
-
typeName:
|
|
2705
|
-
...
|
|
2703
|
+
catchall: w.create(),
|
|
2704
|
+
typeName: P.ZodObject,
|
|
2705
|
+
...x(t)
|
|
2706
2706
|
});
|
|
2707
|
-
var
|
|
2707
|
+
var ct = class extends S {
|
|
2708
2708
|
_parse(e) {
|
|
2709
2709
|
let { ctx: t } = this._processInputParams(e), n = this._def.options;
|
|
2710
2710
|
function r(e) {
|
|
2711
2711
|
for (let t of e) if (t.result.status === "valid") return t.result;
|
|
2712
2712
|
for (let n of e) if (n.result.status === "dirty") return t.common.issues.push(...n.ctx.common.issues), n.result;
|
|
2713
2713
|
let n = e.map((e) => new p(e.ctx.common.issues));
|
|
2714
|
-
return
|
|
2714
|
+
return m(t, {
|
|
2715
2715
|
code: f.invalid_union,
|
|
2716
2716
|
unionErrors: n
|
|
2717
|
-
}),
|
|
2717
|
+
}), g;
|
|
2718
2718
|
}
|
|
2719
2719
|
if (t.common.async) return Promise.all(n.map(async (e) => {
|
|
2720
2720
|
let n = {
|
|
@@ -2757,29 +2757,29 @@ var ot = class extends C {
|
|
|
2757
2757
|
}
|
|
2758
2758
|
if (e) return t.common.issues.push(...e.ctx.common.issues), e.result;
|
|
2759
2759
|
let i = r.map((e) => new p(e));
|
|
2760
|
-
return
|
|
2760
|
+
return m(t, {
|
|
2761
2761
|
code: f.invalid_union,
|
|
2762
2762
|
unionErrors: i
|
|
2763
|
-
}),
|
|
2763
|
+
}), g;
|
|
2764
2764
|
}
|
|
2765
2765
|
}
|
|
2766
2766
|
get options() {
|
|
2767
2767
|
return this._def.options;
|
|
2768
2768
|
}
|
|
2769
2769
|
};
|
|
2770
|
-
|
|
2770
|
+
ct.create = (e, t) => new ct({
|
|
2771
2771
|
options: e,
|
|
2772
|
-
typeName:
|
|
2773
|
-
...
|
|
2772
|
+
typeName: P.ZodUnion,
|
|
2773
|
+
...x(t)
|
|
2774
2774
|
});
|
|
2775
|
-
var
|
|
2775
|
+
var O = (e) => e instanceof gt ? O(e.schema) : e instanceof j ? O(e.innerType()) : e instanceof _t ? [e.value] : e instanceof yt ? e.options : e instanceof bt ? l.objectValues(e.enum) : e instanceof xt ? O(e._def.innerType) : e instanceof it ? [void 0] : e instanceof at ? [null] : e instanceof M ? [void 0, ...O(e.unwrap())] : e instanceof N ? [null, ...O(e.unwrap())] : e instanceof wt || e instanceof Et ? O(e.unwrap()) : e instanceof St ? O(e._def.innerType) : [], lt = class e extends S {
|
|
2776
2776
|
_parse(e) {
|
|
2777
2777
|
let { ctx: t } = this._processInputParams(e);
|
|
2778
|
-
if (t.parsedType !== u.object) return
|
|
2778
|
+
if (t.parsedType !== u.object) return m(t, {
|
|
2779
2779
|
code: f.invalid_type,
|
|
2780
2780
|
expected: u.object,
|
|
2781
2781
|
received: t.parsedType
|
|
2782
|
-
}),
|
|
2782
|
+
}), g;
|
|
2783
2783
|
let n = this.discriminator, r = t.data[n], i = this.optionsMap.get(r);
|
|
2784
2784
|
return i ? t.common.async ? i._parseAsync({
|
|
2785
2785
|
data: t.data,
|
|
@@ -2789,11 +2789,11 @@ var k = (e) => e instanceof mt ? k(e.schema) : e instanceof M ? k(e.innerType())
|
|
|
2789
2789
|
data: t.data,
|
|
2790
2790
|
path: t.path,
|
|
2791
2791
|
parent: t
|
|
2792
|
-
}) : (
|
|
2792
|
+
}) : (m(t, {
|
|
2793
2793
|
code: f.invalid_union_discriminator,
|
|
2794
2794
|
options: Array.from(this.optionsMap.keys()),
|
|
2795
2795
|
path: [n]
|
|
2796
|
-
}),
|
|
2796
|
+
}), g);
|
|
2797
2797
|
}
|
|
2798
2798
|
get discriminator() {
|
|
2799
2799
|
return this._def.discriminator;
|
|
@@ -2807,7 +2807,7 @@ var k = (e) => e instanceof mt ? k(e.schema) : e instanceof M ? k(e.innerType())
|
|
|
2807
2807
|
static create(t, n, r) {
|
|
2808
2808
|
let i = /* @__PURE__ */ new Map();
|
|
2809
2809
|
for (let e of n) {
|
|
2810
|
-
let n =
|
|
2810
|
+
let n = O(e.shape[t]);
|
|
2811
2811
|
if (!n.length) throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);
|
|
2812
2812
|
for (let r of n) {
|
|
2813
2813
|
if (i.has(r)) throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);
|
|
@@ -2815,15 +2815,15 @@ var k = (e) => e instanceof mt ? k(e.schema) : e instanceof M ? k(e.innerType())
|
|
|
2815
2815
|
}
|
|
2816
2816
|
}
|
|
2817
2817
|
return new e({
|
|
2818
|
-
typeName:
|
|
2818
|
+
typeName: P.ZodDiscriminatedUnion,
|
|
2819
2819
|
discriminator: t,
|
|
2820
2820
|
options: n,
|
|
2821
2821
|
optionsMap: i,
|
|
2822
|
-
...
|
|
2822
|
+
...x(r)
|
|
2823
2823
|
});
|
|
2824
2824
|
}
|
|
2825
2825
|
};
|
|
2826
|
-
function
|
|
2826
|
+
function ut(e, t) {
|
|
2827
2827
|
let n = d(e), r = d(t);
|
|
2828
2828
|
if (e === t) return {
|
|
2829
2829
|
valid: !0,
|
|
@@ -2835,7 +2835,7 @@ function ct(e, t) {
|
|
|
2835
2835
|
...t
|
|
2836
2836
|
};
|
|
2837
2837
|
for (let n of r) {
|
|
2838
|
-
let r =
|
|
2838
|
+
let r = ut(e[n], t[n]);
|
|
2839
2839
|
if (!r.valid) return { valid: !1 };
|
|
2840
2840
|
i[n] = r.data;
|
|
2841
2841
|
}
|
|
@@ -2848,7 +2848,7 @@ function ct(e, t) {
|
|
|
2848
2848
|
if (e.length !== t.length) return { valid: !1 };
|
|
2849
2849
|
let n = [];
|
|
2850
2850
|
for (let r = 0; r < e.length; r++) {
|
|
2851
|
-
let i = e[r], a = t[r], o =
|
|
2851
|
+
let i = e[r], a = t[r], o = ut(i, a);
|
|
2852
2852
|
if (!o.valid) return { valid: !1 };
|
|
2853
2853
|
n.push(o.data);
|
|
2854
2854
|
}
|
|
@@ -2862,15 +2862,15 @@ function ct(e, t) {
|
|
|
2862
2862
|
data: e
|
|
2863
2863
|
} : { valid: !1 };
|
|
2864
2864
|
}
|
|
2865
|
-
var
|
|
2865
|
+
var dt = class extends S {
|
|
2866
2866
|
_parse(e) {
|
|
2867
2867
|
let { status: t, ctx: n } = this._processInputParams(e), r = (e, r) => {
|
|
2868
|
-
if (
|
|
2869
|
-
let i =
|
|
2870
|
-
return i.valid ? ((
|
|
2868
|
+
if (Ce(e) || Ce(r)) return g;
|
|
2869
|
+
let i = ut(e.value, r.value);
|
|
2870
|
+
return i.valid ? ((we(e) || we(r)) && t.dirty(), {
|
|
2871
2871
|
status: t.value,
|
|
2872
2872
|
value: i.data
|
|
2873
|
-
}) : (
|
|
2873
|
+
}) : (m(n, { code: f.invalid_intersection_types }), g);
|
|
2874
2874
|
};
|
|
2875
2875
|
return n.common.async ? Promise.all([this._def.left._parseAsync({
|
|
2876
2876
|
data: n.data,
|
|
@@ -2891,28 +2891,28 @@ var lt = class extends C {
|
|
|
2891
2891
|
}));
|
|
2892
2892
|
}
|
|
2893
2893
|
};
|
|
2894
|
-
|
|
2894
|
+
dt.create = (e, t, n) => new dt({
|
|
2895
2895
|
left: e,
|
|
2896
2896
|
right: t,
|
|
2897
|
-
typeName:
|
|
2898
|
-
...
|
|
2897
|
+
typeName: P.ZodIntersection,
|
|
2898
|
+
...x(n)
|
|
2899
2899
|
});
|
|
2900
|
-
var
|
|
2900
|
+
var k = class e extends S {
|
|
2901
2901
|
_parse(e) {
|
|
2902
2902
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2903
|
-
if (n.parsedType !== u.array) return
|
|
2903
|
+
if (n.parsedType !== u.array) return m(n, {
|
|
2904
2904
|
code: f.invalid_type,
|
|
2905
2905
|
expected: u.array,
|
|
2906
2906
|
received: n.parsedType
|
|
2907
|
-
}),
|
|
2908
|
-
if (n.data.length < this._def.items.length) return
|
|
2907
|
+
}), g;
|
|
2908
|
+
if (n.data.length < this._def.items.length) return m(n, {
|
|
2909
2909
|
code: f.too_small,
|
|
2910
2910
|
minimum: this._def.items.length,
|
|
2911
2911
|
inclusive: !0,
|
|
2912
2912
|
exact: !1,
|
|
2913
2913
|
type: "array"
|
|
2914
|
-
}),
|
|
2915
|
-
!this._def.rest && n.data.length > this._def.items.length && (
|
|
2914
|
+
}), g;
|
|
2915
|
+
!this._def.rest && n.data.length > this._def.items.length && (m(n, {
|
|
2916
2916
|
code: f.too_big,
|
|
2917
2917
|
maximum: this._def.items.length,
|
|
2918
2918
|
inclusive: !0,
|
|
@@ -2921,9 +2921,9 @@ var A = class e extends C {
|
|
|
2921
2921
|
}), t.dirty());
|
|
2922
2922
|
let r = [...n.data].map((e, t) => {
|
|
2923
2923
|
let r = this._def.items[t] || this._def.rest;
|
|
2924
|
-
return r ? r._parse(new
|
|
2924
|
+
return r ? r._parse(new b(n, e, n.path, t)) : null;
|
|
2925
2925
|
}).filter((e) => !!e);
|
|
2926
|
-
return n.common.async ? Promise.all(r).then((e) =>
|
|
2926
|
+
return n.common.async ? Promise.all(r).then((e) => h.mergeArray(t, e)) : h.mergeArray(t, r);
|
|
2927
2927
|
}
|
|
2928
2928
|
get items() {
|
|
2929
2929
|
return this._def.items;
|
|
@@ -2935,16 +2935,16 @@ var A = class e extends C {
|
|
|
2935
2935
|
});
|
|
2936
2936
|
}
|
|
2937
2937
|
};
|
|
2938
|
-
|
|
2938
|
+
k.create = (e, t) => {
|
|
2939
2939
|
if (!Array.isArray(e)) throw Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2940
|
-
return new
|
|
2940
|
+
return new k({
|
|
2941
2941
|
items: e,
|
|
2942
|
-
typeName:
|
|
2942
|
+
typeName: P.ZodTuple,
|
|
2943
2943
|
rest: null,
|
|
2944
|
-
...
|
|
2944
|
+
...x(t)
|
|
2945
2945
|
});
|
|
2946
2946
|
};
|
|
2947
|
-
var
|
|
2947
|
+
var ft = class e extends S {
|
|
2948
2948
|
get keySchema() {
|
|
2949
2949
|
return this._def.keyType;
|
|
2950
2950
|
}
|
|
@@ -2953,36 +2953,36 @@ var ut = class e extends C {
|
|
|
2953
2953
|
}
|
|
2954
2954
|
_parse(e) {
|
|
2955
2955
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2956
|
-
if (n.parsedType !== u.object) return
|
|
2956
|
+
if (n.parsedType !== u.object) return m(n, {
|
|
2957
2957
|
code: f.invalid_type,
|
|
2958
2958
|
expected: u.object,
|
|
2959
2959
|
received: n.parsedType
|
|
2960
|
-
}),
|
|
2960
|
+
}), g;
|
|
2961
2961
|
let r = [], i = this._def.keyType, a = this._def.valueType;
|
|
2962
2962
|
for (let e in n.data) r.push({
|
|
2963
|
-
key: i._parse(new
|
|
2964
|
-
value: a._parse(new
|
|
2963
|
+
key: i._parse(new b(n, e, n.path, e)),
|
|
2964
|
+
value: a._parse(new b(n, n.data[e], n.path, e)),
|
|
2965
2965
|
alwaysSet: e in n.data
|
|
2966
2966
|
});
|
|
2967
|
-
return n.common.async ?
|
|
2967
|
+
return n.common.async ? h.mergeObjectAsync(t, r) : h.mergeObjectSync(t, r);
|
|
2968
2968
|
}
|
|
2969
2969
|
get element() {
|
|
2970
2970
|
return this._def.valueType;
|
|
2971
2971
|
}
|
|
2972
2972
|
static create(t, n, r) {
|
|
2973
|
-
return n instanceof
|
|
2973
|
+
return n instanceof S ? new e({
|
|
2974
2974
|
keyType: t,
|
|
2975
2975
|
valueType: n,
|
|
2976
|
-
typeName:
|
|
2977
|
-
...
|
|
2976
|
+
typeName: P.ZodRecord,
|
|
2977
|
+
...x(r)
|
|
2978
2978
|
}) : new e({
|
|
2979
|
-
keyType:
|
|
2979
|
+
keyType: Ze.create(),
|
|
2980
2980
|
valueType: t,
|
|
2981
|
-
typeName:
|
|
2982
|
-
...
|
|
2981
|
+
typeName: P.ZodRecord,
|
|
2982
|
+
...x(n)
|
|
2983
2983
|
});
|
|
2984
2984
|
}
|
|
2985
|
-
},
|
|
2985
|
+
}, pt = class extends S {
|
|
2986
2986
|
get keySchema() {
|
|
2987
2987
|
return this._def.keyType;
|
|
2988
2988
|
}
|
|
@@ -2991,21 +2991,21 @@ var ut = class e extends C {
|
|
|
2991
2991
|
}
|
|
2992
2992
|
_parse(e) {
|
|
2993
2993
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2994
|
-
if (n.parsedType !== u.map) return
|
|
2994
|
+
if (n.parsedType !== u.map) return m(n, {
|
|
2995
2995
|
code: f.invalid_type,
|
|
2996
2996
|
expected: u.map,
|
|
2997
2997
|
received: n.parsedType
|
|
2998
|
-
}),
|
|
2998
|
+
}), g;
|
|
2999
2999
|
let r = this._def.keyType, i = this._def.valueType, a = [...n.data.entries()].map(([e, t], a) => ({
|
|
3000
|
-
key: r._parse(new
|
|
3001
|
-
value: i._parse(new
|
|
3000
|
+
key: r._parse(new b(n, e, n.path, [a, "key"])),
|
|
3001
|
+
value: i._parse(new b(n, t, n.path, [a, "value"]))
|
|
3002
3002
|
}));
|
|
3003
3003
|
if (n.common.async) {
|
|
3004
3004
|
let e = /* @__PURE__ */ new Map();
|
|
3005
3005
|
return Promise.resolve().then(async () => {
|
|
3006
3006
|
for (let n of a) {
|
|
3007
3007
|
let r = await n.key, i = await n.value;
|
|
3008
|
-
if (r.status === "aborted" || i.status === "aborted") return
|
|
3008
|
+
if (r.status === "aborted" || i.status === "aborted") return g;
|
|
3009
3009
|
(r.status === "dirty" || i.status === "dirty") && t.dirty(), e.set(r.value, i.value);
|
|
3010
3010
|
}
|
|
3011
3011
|
return {
|
|
@@ -3018,7 +3018,7 @@ var ut = class e extends C {
|
|
|
3018
3018
|
let e = /* @__PURE__ */ new Map();
|
|
3019
3019
|
for (let n of a) {
|
|
3020
3020
|
let r = n.key, i = n.value;
|
|
3021
|
-
if (r.status === "aborted" || i.status === "aborted") return
|
|
3021
|
+
if (r.status === "aborted" || i.status === "aborted") return g;
|
|
3022
3022
|
(r.status === "dirty" || i.status === "dirty") && t.dirty(), e.set(r.value, i.value);
|
|
3023
3023
|
}
|
|
3024
3024
|
return {
|
|
@@ -3028,29 +3028,29 @@ var ut = class e extends C {
|
|
|
3028
3028
|
}
|
|
3029
3029
|
}
|
|
3030
3030
|
};
|
|
3031
|
-
|
|
3031
|
+
pt.create = (e, t, n) => new pt({
|
|
3032
3032
|
valueType: t,
|
|
3033
3033
|
keyType: e,
|
|
3034
|
-
typeName:
|
|
3035
|
-
...
|
|
3034
|
+
typeName: P.ZodMap,
|
|
3035
|
+
...x(n)
|
|
3036
3036
|
});
|
|
3037
|
-
var
|
|
3037
|
+
var mt = class e extends S {
|
|
3038
3038
|
_parse(e) {
|
|
3039
3039
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
3040
|
-
if (n.parsedType !== u.set) return
|
|
3040
|
+
if (n.parsedType !== u.set) return m(n, {
|
|
3041
3041
|
code: f.invalid_type,
|
|
3042
3042
|
expected: u.set,
|
|
3043
3043
|
received: n.parsedType
|
|
3044
|
-
}),
|
|
3044
|
+
}), g;
|
|
3045
3045
|
let r = this._def;
|
|
3046
|
-
r.minSize !== null && n.data.size < r.minSize.value && (
|
|
3046
|
+
r.minSize !== null && n.data.size < r.minSize.value && (m(n, {
|
|
3047
3047
|
code: f.too_small,
|
|
3048
3048
|
minimum: r.minSize.value,
|
|
3049
3049
|
type: "set",
|
|
3050
3050
|
inclusive: !0,
|
|
3051
3051
|
exact: !1,
|
|
3052
3052
|
message: r.minSize.message
|
|
3053
|
-
}), t.dirty()), r.maxSize !== null && n.data.size > r.maxSize.value && (
|
|
3053
|
+
}), t.dirty()), r.maxSize !== null && n.data.size > r.maxSize.value && (m(n, {
|
|
3054
3054
|
code: f.too_big,
|
|
3055
3055
|
maximum: r.maxSize.value,
|
|
3056
3056
|
type: "set",
|
|
@@ -3062,7 +3062,7 @@ var ft = class e extends C {
|
|
|
3062
3062
|
function a(e) {
|
|
3063
3063
|
let n = /* @__PURE__ */ new Set();
|
|
3064
3064
|
for (let r of e) {
|
|
3065
|
-
if (r.status === "aborted") return
|
|
3065
|
+
if (r.status === "aborted") return g;
|
|
3066
3066
|
r.status === "dirty" && t.dirty(), n.add(r.value);
|
|
3067
3067
|
}
|
|
3068
3068
|
return {
|
|
@@ -3070,7 +3070,7 @@ var ft = class e extends C {
|
|
|
3070
3070
|
value: n
|
|
3071
3071
|
};
|
|
3072
3072
|
}
|
|
3073
|
-
let o = [...n.data.values()].map((e, t) => i._parse(new
|
|
3073
|
+
let o = [...n.data.values()].map((e, t) => i._parse(new b(n, e, n.path, t)));
|
|
3074
3074
|
return n.common.async ? Promise.all(o).then((e) => a(e)) : a(o);
|
|
3075
3075
|
}
|
|
3076
3076
|
min(t, n) {
|
|
@@ -3078,7 +3078,7 @@ var ft = class e extends C {
|
|
|
3078
3078
|
...this._def,
|
|
3079
3079
|
minSize: {
|
|
3080
3080
|
value: t,
|
|
3081
|
-
message:
|
|
3081
|
+
message: y.toString(n)
|
|
3082
3082
|
}
|
|
3083
3083
|
});
|
|
3084
3084
|
}
|
|
@@ -3087,7 +3087,7 @@ var ft = class e extends C {
|
|
|
3087
3087
|
...this._def,
|
|
3088
3088
|
maxSize: {
|
|
3089
3089
|
value: t,
|
|
3090
|
-
message:
|
|
3090
|
+
message: y.toString(n)
|
|
3091
3091
|
}
|
|
3092
3092
|
});
|
|
3093
3093
|
}
|
|
@@ -3098,33 +3098,33 @@ var ft = class e extends C {
|
|
|
3098
3098
|
return this.min(1, e);
|
|
3099
3099
|
}
|
|
3100
3100
|
};
|
|
3101
|
-
|
|
3101
|
+
mt.create = (e, t) => new mt({
|
|
3102
3102
|
valueType: e,
|
|
3103
3103
|
minSize: null,
|
|
3104
3104
|
maxSize: null,
|
|
3105
|
-
typeName:
|
|
3106
|
-
...
|
|
3105
|
+
typeName: P.ZodSet,
|
|
3106
|
+
...x(t)
|
|
3107
3107
|
});
|
|
3108
|
-
var
|
|
3108
|
+
var ht = class e extends S {
|
|
3109
3109
|
constructor() {
|
|
3110
3110
|
super(...arguments), this.validate = this.implement;
|
|
3111
3111
|
}
|
|
3112
3112
|
_parse(e) {
|
|
3113
3113
|
let { ctx: t } = this._processInputParams(e);
|
|
3114
|
-
if (t.parsedType !== u.function) return
|
|
3114
|
+
if (t.parsedType !== u.function) return m(t, {
|
|
3115
3115
|
code: f.invalid_type,
|
|
3116
3116
|
expected: u.function,
|
|
3117
3117
|
received: t.parsedType
|
|
3118
|
-
}),
|
|
3118
|
+
}), g;
|
|
3119
3119
|
function n(e, n) {
|
|
3120
|
-
return
|
|
3120
|
+
return xe({
|
|
3121
3121
|
data: e,
|
|
3122
3122
|
path: t.path,
|
|
3123
3123
|
errorMaps: [
|
|
3124
3124
|
t.common.contextualErrorMap,
|
|
3125
3125
|
t.schemaErrorMap,
|
|
3126
|
-
|
|
3127
|
-
|
|
3126
|
+
be(),
|
|
3127
|
+
ve
|
|
3128
3128
|
].filter((e) => !!e),
|
|
3129
3129
|
issueData: {
|
|
3130
3130
|
code: f.invalid_arguments,
|
|
@@ -3133,14 +3133,14 @@ var pt = class e extends C {
|
|
|
3133
3133
|
});
|
|
3134
3134
|
}
|
|
3135
3135
|
function r(e, n) {
|
|
3136
|
-
return
|
|
3136
|
+
return xe({
|
|
3137
3137
|
data: e,
|
|
3138
3138
|
path: t.path,
|
|
3139
3139
|
errorMaps: [
|
|
3140
3140
|
t.common.contextualErrorMap,
|
|
3141
3141
|
t.schemaErrorMap,
|
|
3142
|
-
|
|
3143
|
-
|
|
3142
|
+
be(),
|
|
3143
|
+
ve
|
|
3144
3144
|
].filter((e) => !!e),
|
|
3145
3145
|
issueData: {
|
|
3146
3146
|
code: f.invalid_return_type,
|
|
@@ -3149,9 +3149,9 @@ var pt = class e extends C {
|
|
|
3149
3149
|
});
|
|
3150
3150
|
}
|
|
3151
3151
|
let i = { errorMap: t.common.contextualErrorMap }, a = t.data;
|
|
3152
|
-
if (this._def.returns instanceof
|
|
3152
|
+
if (this._def.returns instanceof A) {
|
|
3153
3153
|
let e = this;
|
|
3154
|
-
return
|
|
3154
|
+
return _(async function(...t) {
|
|
3155
3155
|
let o = new p([]), s = await e._def.args.parseAsync(t, i).catch((e) => {
|
|
3156
3156
|
throw o.addIssue(n(t, e)), o;
|
|
3157
3157
|
}), c = await Reflect.apply(a, this, s);
|
|
@@ -3162,7 +3162,7 @@ var pt = class e extends C {
|
|
|
3162
3162
|
}
|
|
3163
3163
|
{
|
|
3164
3164
|
let e = this;
|
|
3165
|
-
return
|
|
3165
|
+
return _(function(...t) {
|
|
3166
3166
|
let o = e._def.args.safeParse(t, i);
|
|
3167
3167
|
if (!o.success) throw new p([n(t, o.error)]);
|
|
3168
3168
|
let s = Reflect.apply(a, this, o.data), c = e._def.returns.safeParse(s, i);
|
|
@@ -3180,7 +3180,7 @@ var pt = class e extends C {
|
|
|
3180
3180
|
args(...t) {
|
|
3181
3181
|
return new e({
|
|
3182
3182
|
...this._def,
|
|
3183
|
-
args:
|
|
3183
|
+
args: k.create(t).rest(C.create())
|
|
3184
3184
|
});
|
|
3185
3185
|
}
|
|
3186
3186
|
returns(t) {
|
|
@@ -3197,13 +3197,13 @@ var pt = class e extends C {
|
|
|
3197
3197
|
}
|
|
3198
3198
|
static create(t, n, r) {
|
|
3199
3199
|
return new e({
|
|
3200
|
-
args: t ||
|
|
3201
|
-
returns: n ||
|
|
3202
|
-
typeName:
|
|
3203
|
-
...
|
|
3200
|
+
args: t || k.create([]).rest(C.create()),
|
|
3201
|
+
returns: n || C.create(),
|
|
3202
|
+
typeName: P.ZodFunction,
|
|
3203
|
+
...x(r)
|
|
3204
3204
|
});
|
|
3205
3205
|
}
|
|
3206
|
-
},
|
|
3206
|
+
}, gt = class extends S {
|
|
3207
3207
|
get schema() {
|
|
3208
3208
|
return this._def.getter();
|
|
3209
3209
|
}
|
|
@@ -3216,20 +3216,20 @@ var pt = class e extends C {
|
|
|
3216
3216
|
});
|
|
3217
3217
|
}
|
|
3218
3218
|
};
|
|
3219
|
-
|
|
3219
|
+
gt.create = (e, t) => new gt({
|
|
3220
3220
|
getter: e,
|
|
3221
|
-
typeName:
|
|
3222
|
-
...
|
|
3221
|
+
typeName: P.ZodLazy,
|
|
3222
|
+
...x(t)
|
|
3223
3223
|
});
|
|
3224
|
-
var
|
|
3224
|
+
var _t = class extends S {
|
|
3225
3225
|
_parse(e) {
|
|
3226
3226
|
if (e.data !== this._def.value) {
|
|
3227
3227
|
let t = this._getOrReturnCtx(e);
|
|
3228
|
-
return
|
|
3228
|
+
return m(t, {
|
|
3229
3229
|
received: t.data,
|
|
3230
3230
|
code: f.invalid_literal,
|
|
3231
3231
|
expected: this._def.value
|
|
3232
|
-
}),
|
|
3232
|
+
}), g;
|
|
3233
3233
|
}
|
|
3234
3234
|
return {
|
|
3235
3235
|
status: "valid",
|
|
@@ -3240,37 +3240,37 @@ var ht = class extends C {
|
|
|
3240
3240
|
return this._def.value;
|
|
3241
3241
|
}
|
|
3242
3242
|
};
|
|
3243
|
-
|
|
3243
|
+
_t.create = (e, t) => new _t({
|
|
3244
3244
|
value: e,
|
|
3245
|
-
typeName:
|
|
3246
|
-
...
|
|
3245
|
+
typeName: P.ZodLiteral,
|
|
3246
|
+
...x(t)
|
|
3247
3247
|
});
|
|
3248
|
-
function
|
|
3249
|
-
return new
|
|
3248
|
+
function vt(e, t) {
|
|
3249
|
+
return new yt({
|
|
3250
3250
|
values: e,
|
|
3251
|
-
typeName:
|
|
3252
|
-
...
|
|
3251
|
+
typeName: P.ZodEnum,
|
|
3252
|
+
...x(t)
|
|
3253
3253
|
});
|
|
3254
3254
|
}
|
|
3255
|
-
var
|
|
3255
|
+
var yt = class e extends S {
|
|
3256
3256
|
_parse(e) {
|
|
3257
3257
|
if (typeof e.data != "string") {
|
|
3258
3258
|
let t = this._getOrReturnCtx(e), n = this._def.values;
|
|
3259
|
-
return
|
|
3259
|
+
return m(t, {
|
|
3260
3260
|
expected: l.joinValues(n),
|
|
3261
3261
|
received: t.parsedType,
|
|
3262
3262
|
code: f.invalid_type
|
|
3263
|
-
}),
|
|
3263
|
+
}), g;
|
|
3264
3264
|
}
|
|
3265
3265
|
if (this._cache ||= new Set(this._def.values), !this._cache.has(e.data)) {
|
|
3266
3266
|
let t = this._getOrReturnCtx(e), n = this._def.values;
|
|
3267
|
-
return
|
|
3267
|
+
return m(t, {
|
|
3268
3268
|
received: t.data,
|
|
3269
3269
|
code: f.invalid_enum_value,
|
|
3270
3270
|
options: n
|
|
3271
|
-
}),
|
|
3271
|
+
}), g;
|
|
3272
3272
|
}
|
|
3273
|
-
return
|
|
3273
|
+
return _(e.data);
|
|
3274
3274
|
}
|
|
3275
3275
|
get options() {
|
|
3276
3276
|
return this._def.values;
|
|
@@ -3303,69 +3303,69 @@ var _t = class e extends C {
|
|
|
3303
3303
|
});
|
|
3304
3304
|
}
|
|
3305
3305
|
};
|
|
3306
|
-
|
|
3307
|
-
var
|
|
3306
|
+
yt.create = vt;
|
|
3307
|
+
var bt = class extends S {
|
|
3308
3308
|
_parse(e) {
|
|
3309
3309
|
let t = l.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
3310
3310
|
if (n.parsedType !== u.string && n.parsedType !== u.number) {
|
|
3311
3311
|
let e = l.objectValues(t);
|
|
3312
|
-
return
|
|
3312
|
+
return m(n, {
|
|
3313
3313
|
expected: l.joinValues(e),
|
|
3314
3314
|
received: n.parsedType,
|
|
3315
3315
|
code: f.invalid_type
|
|
3316
|
-
}),
|
|
3316
|
+
}), g;
|
|
3317
3317
|
}
|
|
3318
3318
|
if (this._cache ||= new Set(l.getValidEnumValues(this._def.values)), !this._cache.has(e.data)) {
|
|
3319
3319
|
let e = l.objectValues(t);
|
|
3320
|
-
return
|
|
3320
|
+
return m(n, {
|
|
3321
3321
|
received: n.data,
|
|
3322
3322
|
code: f.invalid_enum_value,
|
|
3323
3323
|
options: e
|
|
3324
|
-
}),
|
|
3324
|
+
}), g;
|
|
3325
3325
|
}
|
|
3326
|
-
return
|
|
3326
|
+
return _(e.data);
|
|
3327
3327
|
}
|
|
3328
3328
|
get enum() {
|
|
3329
3329
|
return this._def.values;
|
|
3330
3330
|
}
|
|
3331
3331
|
};
|
|
3332
|
-
|
|
3332
|
+
bt.create = (e, t) => new bt({
|
|
3333
3333
|
values: e,
|
|
3334
|
-
typeName:
|
|
3335
|
-
...
|
|
3334
|
+
typeName: P.ZodNativeEnum,
|
|
3335
|
+
...x(t)
|
|
3336
3336
|
});
|
|
3337
|
-
var
|
|
3337
|
+
var A = class extends S {
|
|
3338
3338
|
unwrap() {
|
|
3339
3339
|
return this._def.type;
|
|
3340
3340
|
}
|
|
3341
3341
|
_parse(e) {
|
|
3342
3342
|
let { ctx: t } = this._processInputParams(e);
|
|
3343
|
-
return t.parsedType !== u.promise && t.common.async === !1 ? (
|
|
3343
|
+
return t.parsedType !== u.promise && t.common.async === !1 ? (m(t, {
|
|
3344
3344
|
code: f.invalid_type,
|
|
3345
3345
|
expected: u.promise,
|
|
3346
3346
|
received: t.parsedType
|
|
3347
|
-
}),
|
|
3347
|
+
}), g) : _((t.parsedType === u.promise ? t.data : Promise.resolve(t.data)).then((e) => this._def.type.parseAsync(e, {
|
|
3348
3348
|
path: t.path,
|
|
3349
3349
|
errorMap: t.common.contextualErrorMap
|
|
3350
3350
|
})));
|
|
3351
3351
|
}
|
|
3352
3352
|
};
|
|
3353
|
-
|
|
3353
|
+
A.create = (e, t) => new A({
|
|
3354
3354
|
type: e,
|
|
3355
|
-
typeName:
|
|
3356
|
-
...
|
|
3355
|
+
typeName: P.ZodPromise,
|
|
3356
|
+
...x(t)
|
|
3357
3357
|
});
|
|
3358
|
-
var
|
|
3358
|
+
var j = class extends S {
|
|
3359
3359
|
innerType() {
|
|
3360
3360
|
return this._def.schema;
|
|
3361
3361
|
}
|
|
3362
3362
|
sourceType() {
|
|
3363
|
-
return this._def.schema._def.typeName ===
|
|
3363
|
+
return this._def.schema._def.typeName === P.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
3364
3364
|
}
|
|
3365
3365
|
_parse(e) {
|
|
3366
3366
|
let { status: t, ctx: n } = this._processInputParams(e), r = this._def.effect || null, i = {
|
|
3367
3367
|
addIssue: (e) => {
|
|
3368
|
-
|
|
3368
|
+
m(n, e), e.fatal ? t.abort() : t.dirty();
|
|
3369
3369
|
},
|
|
3370
3370
|
get path() {
|
|
3371
3371
|
return n.path;
|
|
@@ -3374,22 +3374,22 @@ var M = class extends C {
|
|
|
3374
3374
|
if (i.addIssue = i.addIssue.bind(i), r.type === "preprocess") {
|
|
3375
3375
|
let e = r.transform(n.data, i);
|
|
3376
3376
|
if (n.common.async) return Promise.resolve(e).then(async (e) => {
|
|
3377
|
-
if (t.value === "aborted") return
|
|
3377
|
+
if (t.value === "aborted") return g;
|
|
3378
3378
|
let r = await this._def.schema._parseAsync({
|
|
3379
3379
|
data: e,
|
|
3380
3380
|
path: n.path,
|
|
3381
3381
|
parent: n
|
|
3382
3382
|
});
|
|
3383
|
-
return r.status === "aborted" ?
|
|
3383
|
+
return r.status === "aborted" ? g : r.status === "dirty" || t.value === "dirty" ? Se(r.value) : r;
|
|
3384
3384
|
});
|
|
3385
3385
|
{
|
|
3386
|
-
if (t.value === "aborted") return
|
|
3386
|
+
if (t.value === "aborted") return g;
|
|
3387
3387
|
let r = this._def.schema._parseSync({
|
|
3388
3388
|
data: e,
|
|
3389
3389
|
path: n.path,
|
|
3390
3390
|
parent: n
|
|
3391
3391
|
});
|
|
3392
|
-
return r.status === "aborted" ?
|
|
3392
|
+
return r.status === "aborted" ? g : r.status === "dirty" || t.value === "dirty" ? Se(r.value) : r;
|
|
3393
3393
|
}
|
|
3394
3394
|
}
|
|
3395
3395
|
if (r.type === "refinement") {
|
|
@@ -3405,7 +3405,7 @@ var M = class extends C {
|
|
|
3405
3405
|
path: n.path,
|
|
3406
3406
|
parent: n
|
|
3407
3407
|
});
|
|
3408
|
-
return r.status === "aborted" ?
|
|
3408
|
+
return r.status === "aborted" ? g : (r.status === "dirty" && t.dirty(), e(r.value), {
|
|
3409
3409
|
status: t.value,
|
|
3410
3410
|
value: r.value
|
|
3411
3411
|
});
|
|
@@ -3414,7 +3414,7 @@ var M = class extends C {
|
|
|
3414
3414
|
data: n.data,
|
|
3415
3415
|
path: n.path,
|
|
3416
3416
|
parent: n
|
|
3417
|
-
}).then((n) => n.status === "aborted" ?
|
|
3417
|
+
}).then((n) => n.status === "aborted" ? g : (n.status === "dirty" && t.dirty(), e(n.value).then(() => ({
|
|
3418
3418
|
status: t.value,
|
|
3419
3419
|
value: n.value
|
|
3420
3420
|
}))));
|
|
@@ -3426,7 +3426,7 @@ var M = class extends C {
|
|
|
3426
3426
|
path: n.path,
|
|
3427
3427
|
parent: n
|
|
3428
3428
|
});
|
|
3429
|
-
if (!
|
|
3429
|
+
if (!v(e)) return g;
|
|
3430
3430
|
let a = r.transform(e.value, i);
|
|
3431
3431
|
if (a instanceof Promise) throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
3432
3432
|
return {
|
|
@@ -3438,55 +3438,55 @@ var M = class extends C {
|
|
|
3438
3438
|
data: n.data,
|
|
3439
3439
|
path: n.path,
|
|
3440
3440
|
parent: n
|
|
3441
|
-
}).then((e) =>
|
|
3441
|
+
}).then((e) => v(e) ? Promise.resolve(r.transform(e.value, i)).then((e) => ({
|
|
3442
3442
|
status: t.value,
|
|
3443
3443
|
value: e
|
|
3444
|
-
})) :
|
|
3444
|
+
})) : g);
|
|
3445
3445
|
}
|
|
3446
3446
|
l.assertNever(r);
|
|
3447
3447
|
}
|
|
3448
3448
|
};
|
|
3449
|
-
|
|
3449
|
+
j.create = (e, t, n) => new j({
|
|
3450
3450
|
schema: e,
|
|
3451
|
-
typeName:
|
|
3451
|
+
typeName: P.ZodEffects,
|
|
3452
3452
|
effect: t,
|
|
3453
|
-
...
|
|
3454
|
-
}),
|
|
3453
|
+
...x(n)
|
|
3454
|
+
}), j.createWithPreprocess = (e, t, n) => new j({
|
|
3455
3455
|
schema: t,
|
|
3456
3456
|
effect: {
|
|
3457
3457
|
type: "preprocess",
|
|
3458
3458
|
transform: e
|
|
3459
3459
|
},
|
|
3460
|
-
typeName:
|
|
3461
|
-
...
|
|
3460
|
+
typeName: P.ZodEffects,
|
|
3461
|
+
...x(n)
|
|
3462
3462
|
});
|
|
3463
|
-
var
|
|
3463
|
+
var M = class extends S {
|
|
3464
3464
|
_parse(e) {
|
|
3465
|
-
return this._getType(e) === u.undefined ?
|
|
3465
|
+
return this._getType(e) === u.undefined ? _(void 0) : this._def.innerType._parse(e);
|
|
3466
3466
|
}
|
|
3467
3467
|
unwrap() {
|
|
3468
3468
|
return this._def.innerType;
|
|
3469
3469
|
}
|
|
3470
3470
|
};
|
|
3471
|
-
|
|
3471
|
+
M.create = (e, t) => new M({
|
|
3472
3472
|
innerType: e,
|
|
3473
|
-
typeName:
|
|
3474
|
-
...
|
|
3473
|
+
typeName: P.ZodOptional,
|
|
3474
|
+
...x(t)
|
|
3475
3475
|
});
|
|
3476
|
-
var
|
|
3476
|
+
var N = class extends S {
|
|
3477
3477
|
_parse(e) {
|
|
3478
|
-
return this._getType(e) === u.null ?
|
|
3478
|
+
return this._getType(e) === u.null ? _(null) : this._def.innerType._parse(e);
|
|
3479
3479
|
}
|
|
3480
3480
|
unwrap() {
|
|
3481
3481
|
return this._def.innerType;
|
|
3482
3482
|
}
|
|
3483
3483
|
};
|
|
3484
|
-
|
|
3484
|
+
N.create = (e, t) => new N({
|
|
3485
3485
|
innerType: e,
|
|
3486
|
-
typeName:
|
|
3487
|
-
...
|
|
3486
|
+
typeName: P.ZodNullable,
|
|
3487
|
+
...x(t)
|
|
3488
3488
|
});
|
|
3489
|
-
var
|
|
3489
|
+
var xt = class extends S {
|
|
3490
3490
|
_parse(e) {
|
|
3491
3491
|
let { ctx: t } = this._processInputParams(e), n = t.data;
|
|
3492
3492
|
return t.parsedType === u.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
|
|
@@ -3499,13 +3499,13 @@ var yt = class extends C {
|
|
|
3499
3499
|
return this._def.innerType;
|
|
3500
3500
|
}
|
|
3501
3501
|
};
|
|
3502
|
-
|
|
3502
|
+
xt.create = (e, t) => new xt({
|
|
3503
3503
|
innerType: e,
|
|
3504
|
-
typeName:
|
|
3504
|
+
typeName: P.ZodDefault,
|
|
3505
3505
|
defaultValue: typeof t.default == "function" ? t.default : () => t.default,
|
|
3506
|
-
...
|
|
3506
|
+
...x(t)
|
|
3507
3507
|
});
|
|
3508
|
-
var
|
|
3508
|
+
var St = class extends S {
|
|
3509
3509
|
_parse(e) {
|
|
3510
3510
|
let { ctx: t } = this._processInputParams(e), n = {
|
|
3511
3511
|
...t,
|
|
@@ -3518,7 +3518,7 @@ var bt = class extends C {
|
|
|
3518
3518
|
path: n.path,
|
|
3519
3519
|
parent: { ...n }
|
|
3520
3520
|
});
|
|
3521
|
-
return
|
|
3521
|
+
return Te(r) ? r.then((e) => ({
|
|
3522
3522
|
status: "valid",
|
|
3523
3523
|
value: e.status === "valid" ? e.value : this._def.catchValue({
|
|
3524
3524
|
get error() {
|
|
@@ -3540,21 +3540,21 @@ var bt = class extends C {
|
|
|
3540
3540
|
return this._def.innerType;
|
|
3541
3541
|
}
|
|
3542
3542
|
};
|
|
3543
|
-
|
|
3543
|
+
St.create = (e, t) => new St({
|
|
3544
3544
|
innerType: e,
|
|
3545
|
-
typeName:
|
|
3545
|
+
typeName: P.ZodCatch,
|
|
3546
3546
|
catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
|
|
3547
|
-
...
|
|
3547
|
+
...x(t)
|
|
3548
3548
|
});
|
|
3549
|
-
var
|
|
3549
|
+
var Ct = class extends S {
|
|
3550
3550
|
_parse(e) {
|
|
3551
3551
|
if (this._getType(e) !== u.nan) {
|
|
3552
3552
|
let t = this._getOrReturnCtx(e);
|
|
3553
|
-
return
|
|
3553
|
+
return m(t, {
|
|
3554
3554
|
code: f.invalid_type,
|
|
3555
3555
|
expected: u.nan,
|
|
3556
3556
|
received: t.parsedType
|
|
3557
|
-
}),
|
|
3557
|
+
}), g;
|
|
3558
3558
|
}
|
|
3559
3559
|
return {
|
|
3560
3560
|
status: "valid",
|
|
@@ -3562,11 +3562,11 @@ var xt = class extends C {
|
|
|
3562
3562
|
};
|
|
3563
3563
|
}
|
|
3564
3564
|
};
|
|
3565
|
-
|
|
3566
|
-
typeName:
|
|
3567
|
-
...
|
|
3565
|
+
Ct.create = (e) => new Ct({
|
|
3566
|
+
typeName: P.ZodNaN,
|
|
3567
|
+
...x(e)
|
|
3568
3568
|
});
|
|
3569
|
-
var
|
|
3569
|
+
var wt = class extends S {
|
|
3570
3570
|
_parse(e) {
|
|
3571
3571
|
let { ctx: t } = this._processInputParams(e), n = t.data;
|
|
3572
3572
|
return this._def.type._parse({
|
|
@@ -3578,7 +3578,7 @@ var St = class extends C {
|
|
|
3578
3578
|
unwrap() {
|
|
3579
3579
|
return this._def.type;
|
|
3580
3580
|
}
|
|
3581
|
-
},
|
|
3581
|
+
}, Tt = class e extends S {
|
|
3582
3582
|
_parse(e) {
|
|
3583
3583
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
3584
3584
|
if (n.common.async) return (async () => {
|
|
@@ -3587,7 +3587,7 @@ var St = class extends C {
|
|
|
3587
3587
|
path: n.path,
|
|
3588
3588
|
parent: n
|
|
3589
3589
|
});
|
|
3590
|
-
return e.status === "aborted" ?
|
|
3590
|
+
return e.status === "aborted" ? g : e.status === "dirty" ? (t.dirty(), Se(e.value)) : this._def.out._parseAsync({
|
|
3591
3591
|
data: e.value,
|
|
3592
3592
|
path: n.path,
|
|
3593
3593
|
parent: n
|
|
@@ -3599,7 +3599,7 @@ var St = class extends C {
|
|
|
3599
3599
|
path: n.path,
|
|
3600
3600
|
parent: n
|
|
3601
3601
|
});
|
|
3602
|
-
return e.status === "aborted" ?
|
|
3602
|
+
return e.status === "aborted" ? g : e.status === "dirty" ? (t.dirty(), {
|
|
3603
3603
|
status: "dirty",
|
|
3604
3604
|
value: e.value
|
|
3605
3605
|
}) : this._def.out._parseSync({
|
|
@@ -3613,42 +3613,42 @@ var St = class extends C {
|
|
|
3613
3613
|
return new e({
|
|
3614
3614
|
in: t,
|
|
3615
3615
|
out: n,
|
|
3616
|
-
typeName:
|
|
3616
|
+
typeName: P.ZodPipeline
|
|
3617
3617
|
});
|
|
3618
3618
|
}
|
|
3619
|
-
},
|
|
3619
|
+
}, Et = class extends S {
|
|
3620
3620
|
_parse(e) {
|
|
3621
|
-
let t = this._def.innerType._parse(e), n = (e) => (
|
|
3622
|
-
return
|
|
3621
|
+
let t = this._def.innerType._parse(e), n = (e) => (v(e) && (e.value = Object.freeze(e.value)), e);
|
|
3622
|
+
return Te(t) ? t.then((e) => n(e)) : n(t);
|
|
3623
3623
|
}
|
|
3624
3624
|
unwrap() {
|
|
3625
3625
|
return this._def.innerType;
|
|
3626
3626
|
}
|
|
3627
3627
|
};
|
|
3628
|
-
|
|
3628
|
+
Et.create = (e, t) => new Et({
|
|
3629
3629
|
innerType: e,
|
|
3630
|
-
typeName:
|
|
3631
|
-
...
|
|
3632
|
-
}),
|
|
3633
|
-
var
|
|
3630
|
+
typeName: P.ZodReadonly,
|
|
3631
|
+
...x(t)
|
|
3632
|
+
}), D.lazycreate;
|
|
3633
|
+
var P;
|
|
3634
3634
|
(function(e) {
|
|
3635
3635
|
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";
|
|
3636
|
-
})(
|
|
3637
|
-
var
|
|
3638
|
-
|
|
3639
|
-
var
|
|
3640
|
-
|
|
3641
|
-
var
|
|
3642
|
-
|
|
3643
|
-
var z =
|
|
3644
|
-
|
|
3645
|
-
var V =
|
|
3646
|
-
|
|
3647
|
-
var H =
|
|
3648
|
-
|
|
3636
|
+
})(P ||= {});
|
|
3637
|
+
var F = Ze.create, I = $e.create;
|
|
3638
|
+
Ct.create, et.create;
|
|
3639
|
+
var L = tt.create;
|
|
3640
|
+
nt.create, rt.create, it.create, at.create, ot.create;
|
|
3641
|
+
var R = C.create;
|
|
3642
|
+
w.create, st.create;
|
|
3643
|
+
var z = T.create, B = D.create;
|
|
3644
|
+
D.strictCreate, ct.create, lt.create, dt.create, k.create;
|
|
3645
|
+
var V = ft.create;
|
|
3646
|
+
pt.create, mt.create, ht.create, gt.create, _t.create;
|
|
3647
|
+
var H = yt.create;
|
|
3648
|
+
bt.create, A.create, j.create, M.create, N.create, j.createWithPreprocess, Tt.create;
|
|
3649
3649
|
//#endregion
|
|
3650
3650
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js
|
|
3651
|
-
var
|
|
3651
|
+
var Dt = Symbol("Let zodToJsonSchema decide on which parser to use"), Ot = {
|
|
3652
3652
|
name: void 0,
|
|
3653
3653
|
$refStrategy: "root",
|
|
3654
3654
|
basePath: ["#"],
|
|
@@ -3671,14 +3671,14 @@ var Et = Symbol("Let zodToJsonSchema decide on which parser to use"), Dt = {
|
|
|
3671
3671
|
base64Strategy: "contentEncoding:base64",
|
|
3672
3672
|
nameStrategy: "ref",
|
|
3673
3673
|
openAiAnyTypeName: "OpenAiAnyType"
|
|
3674
|
-
},
|
|
3675
|
-
...
|
|
3674
|
+
}, kt = (e) => typeof e == "string" ? {
|
|
3675
|
+
...Ot,
|
|
3676
3676
|
name: e
|
|
3677
3677
|
} : {
|
|
3678
|
-
...
|
|
3678
|
+
...Ot,
|
|
3679
3679
|
...e
|
|
3680
|
-
},
|
|
3681
|
-
let t =
|
|
3680
|
+
}, At = (e) => {
|
|
3681
|
+
let t = kt(e), n = t.name === void 0 ? t.basePath : [
|
|
3682
3682
|
...t.basePath,
|
|
3683
3683
|
t.definitionPath,
|
|
3684
3684
|
t.name
|
|
@@ -3701,18 +3701,18 @@ var Et = Symbol("Let zodToJsonSchema decide on which parser to use"), Dt = {
|
|
|
3701
3701
|
};
|
|
3702
3702
|
//#endregion
|
|
3703
3703
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
|
|
3704
|
-
function
|
|
3704
|
+
function jt(e, t, n, r) {
|
|
3705
3705
|
r?.errorMessages && n && (e.errorMessage = {
|
|
3706
3706
|
...e.errorMessage,
|
|
3707
3707
|
[t]: n
|
|
3708
3708
|
});
|
|
3709
3709
|
}
|
|
3710
3710
|
function U(e, t, n, r, i) {
|
|
3711
|
-
e[t] = n,
|
|
3711
|
+
e[t] = n, jt(e, t, r, i);
|
|
3712
3712
|
}
|
|
3713
3713
|
//#endregion
|
|
3714
3714
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
|
|
3715
|
-
var
|
|
3715
|
+
var Mt = (e, t) => {
|
|
3716
3716
|
let n = 0;
|
|
3717
3717
|
for (; n < e.length && n < t.length && e[n] === t[n]; n++);
|
|
3718
3718
|
return [(e.length - n).toString(), ...t.slice(n)].join("/");
|
|
@@ -3726,20 +3726,20 @@ function W(e) {
|
|
|
3726
3726
|
e.definitionPath,
|
|
3727
3727
|
e.openAiAnyTypeName
|
|
3728
3728
|
];
|
|
3729
|
-
return e.flags.hasReferencedOpenAiAnyType = !0, { $ref: e.$refStrategy === "relative" ?
|
|
3729
|
+
return e.flags.hasReferencedOpenAiAnyType = !0, { $ref: e.$refStrategy === "relative" ? Mt(t, e.currentPath) : t.join("/") };
|
|
3730
3730
|
}
|
|
3731
3731
|
//#endregion
|
|
3732
3732
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/array.js
|
|
3733
|
-
function
|
|
3733
|
+
function Nt(e, t) {
|
|
3734
3734
|
let n = { type: "array" };
|
|
3735
|
-
return e.type?._def && e.type?._def?.typeName !==
|
|
3735
|
+
return e.type?._def && e.type?._def?.typeName !== P.ZodAny && (n.items = J(e.type._def, {
|
|
3736
3736
|
...t,
|
|
3737
3737
|
currentPath: [...t.currentPath, "items"]
|
|
3738
3738
|
})), e.minLength && U(n, "minItems", e.minLength.value, e.minLength.message, t), e.maxLength && U(n, "maxItems", e.maxLength.value, e.maxLength.message, t), e.exactLength && (U(n, "minItems", e.exactLength.value, e.exactLength.message, t), U(n, "maxItems", e.exactLength.value, e.exactLength.message, t)), n;
|
|
3739
3739
|
}
|
|
3740
3740
|
//#endregion
|
|
3741
3741
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
|
|
3742
|
-
function
|
|
3742
|
+
function Pt(e, t) {
|
|
3743
3743
|
let n = {
|
|
3744
3744
|
type: "integer",
|
|
3745
3745
|
format: "int64"
|
|
@@ -3758,22 +3758,22 @@ function Nt(e, t) {
|
|
|
3758
3758
|
}
|
|
3759
3759
|
//#endregion
|
|
3760
3760
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
|
|
3761
|
-
function
|
|
3761
|
+
function Ft() {
|
|
3762
3762
|
return { type: "boolean" };
|
|
3763
3763
|
}
|
|
3764
3764
|
//#endregion
|
|
3765
3765
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
|
|
3766
|
-
function
|
|
3766
|
+
function It(e, t) {
|
|
3767
3767
|
return J(e.type._def, t);
|
|
3768
3768
|
}
|
|
3769
3769
|
//#endregion
|
|
3770
3770
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
|
|
3771
|
-
var
|
|
3771
|
+
var Lt = (e, t) => J(e.innerType._def, t);
|
|
3772
3772
|
//#endregion
|
|
3773
3773
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/date.js
|
|
3774
|
-
function
|
|
3774
|
+
function Rt(e, t, n) {
|
|
3775
3775
|
let r = n ?? t.dateStrategy;
|
|
3776
|
-
if (Array.isArray(r)) return { anyOf: r.map((n, r) =>
|
|
3776
|
+
if (Array.isArray(r)) return { anyOf: r.map((n, r) => Rt(e, t, n)) };
|
|
3777
3777
|
switch (r) {
|
|
3778
3778
|
case "string":
|
|
3779
3779
|
case "format:date-time": return {
|
|
@@ -3784,10 +3784,10 @@ function Lt(e, t, n) {
|
|
|
3784
3784
|
type: "string",
|
|
3785
3785
|
format: "date"
|
|
3786
3786
|
};
|
|
3787
|
-
case "integer": return
|
|
3787
|
+
case "integer": return zt(e, t);
|
|
3788
3788
|
}
|
|
3789
3789
|
}
|
|
3790
|
-
var
|
|
3790
|
+
var zt = (e, t) => {
|
|
3791
3791
|
let n = {
|
|
3792
3792
|
type: "integer",
|
|
3793
3793
|
format: "unix-time"
|
|
@@ -3803,7 +3803,7 @@ var Rt = (e, t) => {
|
|
|
3803
3803
|
};
|
|
3804
3804
|
//#endregion
|
|
3805
3805
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/default.js
|
|
3806
|
-
function
|
|
3806
|
+
function Bt(e, t) {
|
|
3807
3807
|
return {
|
|
3808
3808
|
...J(e.innerType._def, t),
|
|
3809
3809
|
default: e.defaultValue()
|
|
@@ -3811,12 +3811,12 @@ function zt(e, t) {
|
|
|
3811
3811
|
}
|
|
3812
3812
|
//#endregion
|
|
3813
3813
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
|
|
3814
|
-
function
|
|
3814
|
+
function Vt(e, t) {
|
|
3815
3815
|
return t.effectStrategy === "input" ? J(e.schema._def, t) : W(t);
|
|
3816
3816
|
}
|
|
3817
3817
|
//#endregion
|
|
3818
3818
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
|
|
3819
|
-
function
|
|
3819
|
+
function Ht(e) {
|
|
3820
3820
|
return {
|
|
3821
3821
|
type: "string",
|
|
3822
3822
|
enum: Array.from(e.values)
|
|
@@ -3824,8 +3824,8 @@ function Vt(e) {
|
|
|
3824
3824
|
}
|
|
3825
3825
|
//#endregion
|
|
3826
3826
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
|
|
3827
|
-
var
|
|
3828
|
-
function
|
|
3827
|
+
var Ut = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
|
|
3828
|
+
function Wt(e, t) {
|
|
3829
3829
|
let n = [J(e.left._def, {
|
|
3830
3830
|
...t,
|
|
3831
3831
|
currentPath: [
|
|
@@ -3842,7 +3842,7 @@ function Ut(e, t) {
|
|
|
3842
3842
|
]
|
|
3843
3843
|
})].filter((e) => !!e), r = t.target === "jsonSchema2019-09" ? { unevaluatedProperties: !1 } : void 0, i = [];
|
|
3844
3844
|
return n.forEach((e) => {
|
|
3845
|
-
if (
|
|
3845
|
+
if (Ut(e)) i.push(...e.allOf), e.unevaluatedProperties === void 0 && (r = void 0);
|
|
3846
3846
|
else {
|
|
3847
3847
|
let t = e;
|
|
3848
3848
|
if ("additionalProperties" in e && e.additionalProperties === !1) {
|
|
@@ -3858,7 +3858,7 @@ function Ut(e, t) {
|
|
|
3858
3858
|
}
|
|
3859
3859
|
//#endregion
|
|
3860
3860
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
|
|
3861
|
-
function
|
|
3861
|
+
function Gt(e, t) {
|
|
3862
3862
|
let n = typeof e.value;
|
|
3863
3863
|
return n !== "bigint" && n !== "number" && n !== "boolean" && n !== "string" ? { type: Array.isArray(e.value) ? "array" : "object" } : t.target === "openApi3" ? {
|
|
3864
3864
|
type: n === "bigint" ? "integer" : n,
|
|
@@ -3870,12 +3870,12 @@ function Wt(e, t) {
|
|
|
3870
3870
|
}
|
|
3871
3871
|
//#endregion
|
|
3872
3872
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
|
|
3873
|
-
var
|
|
3873
|
+
var Kt = void 0, G = {
|
|
3874
3874
|
cuid: /^[cC][^\s-]{8,}$/,
|
|
3875
3875
|
cuid2: /^[0-9a-z]+$/,
|
|
3876
3876
|
ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
|
|
3877
3877
|
email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
|
|
3878
|
-
emoji: () => (
|
|
3878
|
+
emoji: () => (Kt === void 0 && (Kt = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), Kt),
|
|
3879
3879
|
uuid: /^[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}$/,
|
|
3880
3880
|
ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
|
|
3881
3881
|
ipv4Cidr: /^(?:(?: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])$/,
|
|
@@ -3886,7 +3886,7 @@ var Gt = void 0, G = {
|
|
|
3886
3886
|
nanoid: /^[a-zA-Z0-9_-]{21}$/,
|
|
3887
3887
|
jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
|
|
3888
3888
|
};
|
|
3889
|
-
function
|
|
3889
|
+
function qt(e, t) {
|
|
3890
3890
|
let n = { type: "string" };
|
|
3891
3891
|
if (e.checks) for (let r of e.checks) switch (r.kind) {
|
|
3892
3892
|
case "min":
|
|
@@ -3922,10 +3922,10 @@ function Kt(e, t) {
|
|
|
3922
3922
|
q(n, G.cuid2, r.message, t);
|
|
3923
3923
|
break;
|
|
3924
3924
|
case "startsWith":
|
|
3925
|
-
q(n, RegExp(`^${
|
|
3925
|
+
q(n, RegExp(`^${Jt(r.value, t)}`), r.message, t);
|
|
3926
3926
|
break;
|
|
3927
3927
|
case "endsWith":
|
|
3928
|
-
q(n, RegExp(`${
|
|
3928
|
+
q(n, RegExp(`${Jt(r.value, t)}$`), r.message, t);
|
|
3929
3929
|
break;
|
|
3930
3930
|
case "datetime":
|
|
3931
3931
|
K(n, "date-time", r.message, t);
|
|
@@ -3943,7 +3943,7 @@ function Kt(e, t) {
|
|
|
3943
3943
|
U(n, "minLength", typeof n.minLength == "number" ? Math.max(n.minLength, r.value) : r.value, r.message, t), U(n, "maxLength", typeof n.maxLength == "number" ? Math.min(n.maxLength, r.value) : r.value, r.message, t);
|
|
3944
3944
|
break;
|
|
3945
3945
|
case "includes":
|
|
3946
|
-
q(n, RegExp(
|
|
3946
|
+
q(n, RegExp(Jt(r.value, t)), r.message, t);
|
|
3947
3947
|
break;
|
|
3948
3948
|
case "ip":
|
|
3949
3949
|
r.version !== "v6" && K(n, "ipv4", r.message, t), r.version !== "v4" && K(n, "ipv6", r.message, t);
|
|
@@ -3978,13 +3978,13 @@ function Kt(e, t) {
|
|
|
3978
3978
|
}
|
|
3979
3979
|
return n;
|
|
3980
3980
|
}
|
|
3981
|
-
function
|
|
3982
|
-
return t.patternStrategy === "escape" ?
|
|
3981
|
+
function Jt(e, t) {
|
|
3982
|
+
return t.patternStrategy === "escape" ? Xt(e) : e;
|
|
3983
3983
|
}
|
|
3984
|
-
var
|
|
3985
|
-
function
|
|
3984
|
+
var Yt = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
|
|
3985
|
+
function Xt(e) {
|
|
3986
3986
|
let t = "";
|
|
3987
|
-
for (let n = 0; n < e.length; n++)
|
|
3987
|
+
for (let n = 0; n < e.length; n++) Yt.has(e[n]) || (t += "\\"), t += e[n];
|
|
3988
3988
|
return t;
|
|
3989
3989
|
}
|
|
3990
3990
|
function K(e, t, n, r) {
|
|
@@ -4001,11 +4001,11 @@ function q(e, t, n, r) {
|
|
|
4001
4001
|
pattern: e.pattern,
|
|
4002
4002
|
...e.errorMessage && r.errorMessages && { errorMessage: { pattern: e.errorMessage.pattern } }
|
|
4003
4003
|
}), delete e.pattern, e.errorMessage && (delete e.errorMessage.pattern, Object.keys(e.errorMessage).length === 0 && delete e.errorMessage)), e.allOf.push({
|
|
4004
|
-
pattern:
|
|
4004
|
+
pattern: Zt(t, r),
|
|
4005
4005
|
...n && r.errorMessages && { errorMessage: { pattern: n } }
|
|
4006
|
-
})) : U(e, "pattern",
|
|
4006
|
+
})) : U(e, "pattern", Zt(t, r), n, r);
|
|
4007
4007
|
}
|
|
4008
|
-
function
|
|
4008
|
+
function Zt(e, t) {
|
|
4009
4009
|
if (!t.applyRegexFlags || !e.flags) return e.source;
|
|
4010
4010
|
let n = {
|
|
4011
4011
|
i: e.flags.includes("i"),
|
|
@@ -4046,8 +4046,8 @@ function Xt(e, t) {
|
|
|
4046
4046
|
}
|
|
4047
4047
|
//#endregion
|
|
4048
4048
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
|
|
4049
|
-
function
|
|
4050
|
-
if (t.target === "openAi" && console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."), t.target === "openApi3" && e.keyType?._def.typeName ===
|
|
4049
|
+
function Qt(e, t) {
|
|
4050
|
+
if (t.target === "openAi" && console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."), t.target === "openApi3" && e.keyType?._def.typeName === P.ZodEnum) return {
|
|
4051
4051
|
type: "object",
|
|
4052
4052
|
required: e.keyType._def.values,
|
|
4053
4053
|
properties: e.keyType._def.values.reduce((n, r) => ({
|
|
@@ -4071,19 +4071,19 @@ function Zt(e, t) {
|
|
|
4071
4071
|
}) ?? t.allowedAdditionalProperties
|
|
4072
4072
|
};
|
|
4073
4073
|
if (t.target === "openApi3") return n;
|
|
4074
|
-
if (e.keyType?._def.typeName ===
|
|
4075
|
-
let { type: r, ...i } =
|
|
4074
|
+
if (e.keyType?._def.typeName === P.ZodString && e.keyType._def.checks?.length) {
|
|
4075
|
+
let { type: r, ...i } = qt(e.keyType._def, t);
|
|
4076
4076
|
return {
|
|
4077
4077
|
...n,
|
|
4078
4078
|
propertyNames: i
|
|
4079
4079
|
};
|
|
4080
4080
|
}
|
|
4081
|
-
if (e.keyType?._def.typeName ===
|
|
4081
|
+
if (e.keyType?._def.typeName === P.ZodEnum) return {
|
|
4082
4082
|
...n,
|
|
4083
4083
|
propertyNames: { enum: e.keyType._def.values }
|
|
4084
4084
|
};
|
|
4085
|
-
if (e.keyType?._def.typeName ===
|
|
4086
|
-
let { type: r, ...i } =
|
|
4085
|
+
if (e.keyType?._def.typeName === P.ZodBranded && e.keyType._def.type._def.typeName === P.ZodString && e.keyType._def.type._def.checks?.length) {
|
|
4086
|
+
let { type: r, ...i } = It(e.keyType._def, t);
|
|
4087
4087
|
return {
|
|
4088
4088
|
...n,
|
|
4089
4089
|
propertyNames: i
|
|
@@ -4093,8 +4093,8 @@ function Zt(e, t) {
|
|
|
4093
4093
|
}
|
|
4094
4094
|
//#endregion
|
|
4095
4095
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/map.js
|
|
4096
|
-
function
|
|
4097
|
-
return t.mapStrategy === "record" ?
|
|
4096
|
+
function $t(e, t) {
|
|
4097
|
+
return t.mapStrategy === "record" ? Qt(e, t) : {
|
|
4098
4098
|
type: "array",
|
|
4099
4099
|
maxItems: 125,
|
|
4100
4100
|
items: {
|
|
@@ -4123,7 +4123,7 @@ function Qt(e, t) {
|
|
|
4123
4123
|
}
|
|
4124
4124
|
//#endregion
|
|
4125
4125
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
|
|
4126
|
-
function
|
|
4126
|
+
function en(e) {
|
|
4127
4127
|
let t = e.values, n = Object.keys(e.values).filter((e) => typeof t[t[e]] != "number").map((e) => t[e]), r = Array.from(new Set(n.map((e) => typeof e)));
|
|
4128
4128
|
return {
|
|
4129
4129
|
type: r.length === 1 ? r[0] === "string" ? "string" : "number" : ["string", "number"],
|
|
@@ -4132,7 +4132,7 @@ function $t(e) {
|
|
|
4132
4132
|
}
|
|
4133
4133
|
//#endregion
|
|
4134
4134
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/never.js
|
|
4135
|
-
function
|
|
4135
|
+
function tn(e) {
|
|
4136
4136
|
return e.target === "openAi" ? void 0 : { not: W({
|
|
4137
4137
|
...e,
|
|
4138
4138
|
currentPath: [...e.currentPath, "not"]
|
|
@@ -4140,7 +4140,7 @@ function en(e) {
|
|
|
4140
4140
|
}
|
|
4141
4141
|
//#endregion
|
|
4142
4142
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/null.js
|
|
4143
|
-
function
|
|
4143
|
+
function nn(e) {
|
|
4144
4144
|
return e.target === "openApi3" ? {
|
|
4145
4145
|
enum: ["null"],
|
|
4146
4146
|
nullable: !0
|
|
@@ -4148,19 +4148,19 @@ function tn(e) {
|
|
|
4148
4148
|
}
|
|
4149
4149
|
//#endregion
|
|
4150
4150
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/union.js
|
|
4151
|
-
var
|
|
4151
|
+
var rn = {
|
|
4152
4152
|
ZodString: "string",
|
|
4153
4153
|
ZodNumber: "number",
|
|
4154
4154
|
ZodBigInt: "integer",
|
|
4155
4155
|
ZodBoolean: "boolean",
|
|
4156
4156
|
ZodNull: "null"
|
|
4157
4157
|
};
|
|
4158
|
-
function
|
|
4159
|
-
if (t.target === "openApi3") return
|
|
4158
|
+
function an(e, t) {
|
|
4159
|
+
if (t.target === "openApi3") return on(e, t);
|
|
4160
4160
|
let n = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
|
|
4161
|
-
if (n.every((e) => e._def.typeName in
|
|
4161
|
+
if (n.every((e) => e._def.typeName in rn && (!e._def.checks || !e._def.checks.length))) {
|
|
4162
4162
|
let e = n.reduce((e, t) => {
|
|
4163
|
-
let n =
|
|
4163
|
+
let n = rn[t._def.typeName];
|
|
4164
4164
|
return n && !e.includes(n) ? [...e, n] : e;
|
|
4165
4165
|
}, []);
|
|
4166
4166
|
return { type: e.length > 1 ? e : e[0] };
|
|
@@ -4188,9 +4188,9 @@ function rn(e, t) {
|
|
|
4188
4188
|
type: "string",
|
|
4189
4189
|
enum: n.reduce((e, t) => [...e, ...t._def.values.filter((t) => !e.includes(t))], [])
|
|
4190
4190
|
};
|
|
4191
|
-
return
|
|
4191
|
+
return on(e, t);
|
|
4192
4192
|
}
|
|
4193
|
-
var
|
|
4193
|
+
var on = (e, t) => {
|
|
4194
4194
|
let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => J(e._def, {
|
|
4195
4195
|
...t,
|
|
4196
4196
|
currentPath: [
|
|
@@ -4203,7 +4203,7 @@ var an = (e, t) => {
|
|
|
4203
4203
|
};
|
|
4204
4204
|
//#endregion
|
|
4205
4205
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
|
|
4206
|
-
function
|
|
4206
|
+
function sn(e, t) {
|
|
4207
4207
|
if ([
|
|
4208
4208
|
"ZodString",
|
|
4209
4209
|
"ZodNumber",
|
|
@@ -4211,9 +4211,9 @@ function on(e, t) {
|
|
|
4211
4211
|
"ZodBoolean",
|
|
4212
4212
|
"ZodNull"
|
|
4213
4213
|
].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return t.target === "openApi3" ? {
|
|
4214
|
-
type:
|
|
4214
|
+
type: rn[e.innerType._def.typeName],
|
|
4215
4215
|
nullable: !0
|
|
4216
|
-
} : { type: [
|
|
4216
|
+
} : { type: [rn[e.innerType._def.typeName], "null"] };
|
|
4217
4217
|
if (t.target === "openApi3") {
|
|
4218
4218
|
let n = J(e.innerType._def, {
|
|
4219
4219
|
...t,
|
|
@@ -4239,12 +4239,12 @@ function on(e, t) {
|
|
|
4239
4239
|
}
|
|
4240
4240
|
//#endregion
|
|
4241
4241
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/number.js
|
|
4242
|
-
function
|
|
4242
|
+
function cn(e, t) {
|
|
4243
4243
|
let n = { type: "number" };
|
|
4244
4244
|
if (!e.checks) return n;
|
|
4245
4245
|
for (let r of e.checks) switch (r.kind) {
|
|
4246
4246
|
case "int":
|
|
4247
|
-
n.type = "integer",
|
|
4247
|
+
n.type = "integer", jt(n, "type", r.message, t);
|
|
4248
4248
|
break;
|
|
4249
4249
|
case "min":
|
|
4250
4250
|
t.target === "jsonSchema7" ? r.inclusive ? U(n, "minimum", r.value, r.message, t) : U(n, "exclusiveMinimum", r.value, r.message, t) : (r.inclusive || (n.exclusiveMinimum = !0), U(n, "minimum", r.value, r.message, t));
|
|
@@ -4258,7 +4258,7 @@ function sn(e, t) {
|
|
|
4258
4258
|
}
|
|
4259
4259
|
//#endregion
|
|
4260
4260
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/object.js
|
|
4261
|
-
function
|
|
4261
|
+
function ln(e, t) {
|
|
4262
4262
|
let n = t.target === "openAi", r = {
|
|
4263
4263
|
type: "object",
|
|
4264
4264
|
properties: {}
|
|
@@ -4266,7 +4266,7 @@ function cn(e, t) {
|
|
|
4266
4266
|
for (let e in a) {
|
|
4267
4267
|
let o = a[e];
|
|
4268
4268
|
if (o === void 0 || o._def === void 0) continue;
|
|
4269
|
-
let s =
|
|
4269
|
+
let s = dn(o);
|
|
4270
4270
|
s && n && (o._def.typeName === "ZodOptional" && (o = o._def.innerType), o.isNullable() || (o = o.nullable()), s = !1);
|
|
4271
4271
|
let c = J(o._def, {
|
|
4272
4272
|
...t,
|
|
@@ -4284,10 +4284,10 @@ function cn(e, t) {
|
|
|
4284
4284
|
c !== void 0 && (r.properties[e] = c, s || i.push(e));
|
|
4285
4285
|
}
|
|
4286
4286
|
i.length && (r.required = i);
|
|
4287
|
-
let o =
|
|
4287
|
+
let o = un(e, t);
|
|
4288
4288
|
return o !== void 0 && (r.additionalProperties = o), r;
|
|
4289
4289
|
}
|
|
4290
|
-
function
|
|
4290
|
+
function un(e, t) {
|
|
4291
4291
|
if (e.catchall._def.typeName !== "ZodNever") return J(e.catchall._def, {
|
|
4292
4292
|
...t,
|
|
4293
4293
|
currentPath: [...t.currentPath, "additionalProperties"]
|
|
@@ -4298,7 +4298,7 @@ function ln(e, t) {
|
|
|
4298
4298
|
case "strip": return t.removeAdditionalStrategy === "strict" ? t.allowedAdditionalProperties : t.rejectedAdditionalProperties;
|
|
4299
4299
|
}
|
|
4300
4300
|
}
|
|
4301
|
-
function
|
|
4301
|
+
function dn(e) {
|
|
4302
4302
|
try {
|
|
4303
4303
|
return e.isOptional();
|
|
4304
4304
|
} catch {
|
|
@@ -4307,7 +4307,7 @@ function un(e) {
|
|
|
4307
4307
|
}
|
|
4308
4308
|
//#endregion
|
|
4309
4309
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
|
|
4310
|
-
var
|
|
4310
|
+
var fn = (e, t) => {
|
|
4311
4311
|
if (t.currentPath.toString() === t.propertyPath?.toString()) return J(e.innerType._def, t);
|
|
4312
4312
|
let n = J(e.innerType._def, {
|
|
4313
4313
|
...t,
|
|
@@ -4318,7 +4318,7 @@ var dn = (e, t) => {
|
|
|
4318
4318
|
]
|
|
4319
4319
|
});
|
|
4320
4320
|
return n ? { anyOf: [{ not: W(t) }, n] } : W(t);
|
|
4321
|
-
},
|
|
4321
|
+
}, pn = (e, t) => {
|
|
4322
4322
|
if (t.pipeStrategy === "input") return J(e.in._def, t);
|
|
4323
4323
|
if (t.pipeStrategy === "output") return J(e.out._def, t);
|
|
4324
4324
|
let n = J(e.in._def, {
|
|
@@ -4340,12 +4340,12 @@ var dn = (e, t) => {
|
|
|
4340
4340
|
};
|
|
4341
4341
|
//#endregion
|
|
4342
4342
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
|
|
4343
|
-
function
|
|
4343
|
+
function mn(e, t) {
|
|
4344
4344
|
return J(e.type._def, t);
|
|
4345
4345
|
}
|
|
4346
4346
|
//#endregion
|
|
4347
4347
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/set.js
|
|
4348
|
-
function
|
|
4348
|
+
function hn(e, t) {
|
|
4349
4349
|
let n = {
|
|
4350
4350
|
type: "array",
|
|
4351
4351
|
uniqueItems: !0,
|
|
@@ -4358,7 +4358,7 @@ function mn(e, t) {
|
|
|
4358
4358
|
}
|
|
4359
4359
|
//#endregion
|
|
4360
4360
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
|
|
4361
|
-
function
|
|
4361
|
+
function gn(e, t) {
|
|
4362
4362
|
return e.rest ? {
|
|
4363
4363
|
type: "array",
|
|
4364
4364
|
minItems: e.items.length,
|
|
@@ -4390,54 +4390,54 @@ function hn(e, t) {
|
|
|
4390
4390
|
}
|
|
4391
4391
|
//#endregion
|
|
4392
4392
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
|
|
4393
|
-
function
|
|
4393
|
+
function _n(e) {
|
|
4394
4394
|
return { not: W(e) };
|
|
4395
4395
|
}
|
|
4396
4396
|
//#endregion
|
|
4397
4397
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
|
|
4398
|
-
function
|
|
4398
|
+
function vn(e) {
|
|
4399
4399
|
return W(e);
|
|
4400
4400
|
}
|
|
4401
4401
|
//#endregion
|
|
4402
4402
|
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
|
|
4403
|
-
var
|
|
4403
|
+
var yn = (e, t) => J(e.innerType._def, t), bn = (e, t, n) => {
|
|
4404
4404
|
switch (t) {
|
|
4405
|
-
case
|
|
4406
|
-
case
|
|
4407
|
-
case
|
|
4408
|
-
case
|
|
4409
|
-
case
|
|
4410
|
-
case
|
|
4411
|
-
case
|
|
4412
|
-
case
|
|
4413
|
-
case
|
|
4414
|
-
case
|
|
4415
|
-
case
|
|
4416
|
-
case
|
|
4417
|
-
case
|
|
4418
|
-
case
|
|
4419
|
-
case
|
|
4420
|
-
case
|
|
4421
|
-
case
|
|
4422
|
-
case
|
|
4423
|
-
case
|
|
4424
|
-
case
|
|
4425
|
-
case
|
|
4426
|
-
case
|
|
4427
|
-
case
|
|
4428
|
-
case
|
|
4429
|
-
case
|
|
4430
|
-
case
|
|
4431
|
-
case
|
|
4432
|
-
case
|
|
4433
|
-
case
|
|
4434
|
-
case
|
|
4435
|
-
case
|
|
4436
|
-
case
|
|
4437
|
-
case
|
|
4438
|
-
case
|
|
4439
|
-
case
|
|
4440
|
-
case
|
|
4405
|
+
case P.ZodString: return qt(e, n);
|
|
4406
|
+
case P.ZodNumber: return cn(e, n);
|
|
4407
|
+
case P.ZodObject: return ln(e, n);
|
|
4408
|
+
case P.ZodBigInt: return Pt(e, n);
|
|
4409
|
+
case P.ZodBoolean: return Ft();
|
|
4410
|
+
case P.ZodDate: return Rt(e, n);
|
|
4411
|
+
case P.ZodUndefined: return _n(n);
|
|
4412
|
+
case P.ZodNull: return nn(n);
|
|
4413
|
+
case P.ZodArray: return Nt(e, n);
|
|
4414
|
+
case P.ZodUnion:
|
|
4415
|
+
case P.ZodDiscriminatedUnion: return an(e, n);
|
|
4416
|
+
case P.ZodIntersection: return Wt(e, n);
|
|
4417
|
+
case P.ZodTuple: return gn(e, n);
|
|
4418
|
+
case P.ZodRecord: return Qt(e, n);
|
|
4419
|
+
case P.ZodLiteral: return Gt(e, n);
|
|
4420
|
+
case P.ZodEnum: return Ht(e);
|
|
4421
|
+
case P.ZodNativeEnum: return en(e);
|
|
4422
|
+
case P.ZodNullable: return sn(e, n);
|
|
4423
|
+
case P.ZodOptional: return fn(e, n);
|
|
4424
|
+
case P.ZodMap: return $t(e, n);
|
|
4425
|
+
case P.ZodSet: return hn(e, n);
|
|
4426
|
+
case P.ZodLazy: return () => e.getter()._def;
|
|
4427
|
+
case P.ZodPromise: return mn(e, n);
|
|
4428
|
+
case P.ZodNaN:
|
|
4429
|
+
case P.ZodNever: return tn(n);
|
|
4430
|
+
case P.ZodEffects: return Vt(e, n);
|
|
4431
|
+
case P.ZodAny: return W(n);
|
|
4432
|
+
case P.ZodUnknown: return vn(n);
|
|
4433
|
+
case P.ZodDefault: return Bt(e, n);
|
|
4434
|
+
case P.ZodBranded: return It(e, n);
|
|
4435
|
+
case P.ZodReadonly: return yn(e, n);
|
|
4436
|
+
case P.ZodCatch: return Lt(e, n);
|
|
4437
|
+
case P.ZodPipeline: return pn(e, n);
|
|
4438
|
+
case P.ZodFunction:
|
|
4439
|
+
case P.ZodVoid:
|
|
4440
|
+
case P.ZodSymbol: return;
|
|
4441
4441
|
default: return ((e) => void 0)(t);
|
|
4442
4442
|
}
|
|
4443
4443
|
};
|
|
@@ -4447,10 +4447,10 @@ function J(e, t, n = !1) {
|
|
|
4447
4447
|
let r = t.seen.get(e);
|
|
4448
4448
|
if (t.override) {
|
|
4449
4449
|
let i = t.override?.(e, t, r, n);
|
|
4450
|
-
if (i !==
|
|
4450
|
+
if (i !== Dt) return i;
|
|
4451
4451
|
}
|
|
4452
4452
|
if (r && !n) {
|
|
4453
|
-
let e =
|
|
4453
|
+
let e = xn(r, t);
|
|
4454
4454
|
if (e !== void 0) return e;
|
|
4455
4455
|
}
|
|
4456
4456
|
let i = {
|
|
@@ -4459,22 +4459,22 @@ function J(e, t, n = !1) {
|
|
|
4459
4459
|
jsonSchema: void 0
|
|
4460
4460
|
};
|
|
4461
4461
|
t.seen.set(e, i);
|
|
4462
|
-
let a =
|
|
4463
|
-
if (o &&
|
|
4462
|
+
let a = bn(e, e.typeName, t), o = typeof a == "function" ? J(a(), t) : a;
|
|
4463
|
+
if (o && Sn(e, t, o), t.postProcess) {
|
|
4464
4464
|
let n = t.postProcess(o, e, t);
|
|
4465
4465
|
return i.jsonSchema = o, n;
|
|
4466
4466
|
}
|
|
4467
4467
|
return i.jsonSchema = o, o;
|
|
4468
4468
|
}
|
|
4469
|
-
var
|
|
4469
|
+
var xn = (e, t) => {
|
|
4470
4470
|
switch (t.$refStrategy) {
|
|
4471
4471
|
case "root": return { $ref: e.path.join("/") };
|
|
4472
|
-
case "relative": return { $ref:
|
|
4472
|
+
case "relative": return { $ref: Mt(t.currentPath, e.path) };
|
|
4473
4473
|
case "none":
|
|
4474
4474
|
case "seen": return e.path.length < t.currentPath.length && e.path.every((e, n) => t.currentPath[n] === e) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`), W(t)) : t.$refStrategy === "seen" ? W(t) : void 0;
|
|
4475
4475
|
}
|
|
4476
|
-
},
|
|
4477
|
-
let n =
|
|
4476
|
+
}, Sn = (e, t, n) => (e.description && (n.description = e.description, t.markdownDescription && (n.markdownDescription = e.description)), n), Cn = (e, t) => {
|
|
4477
|
+
let n = At(t), r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({
|
|
4478
4478
|
...e,
|
|
4479
4479
|
[t]: J(r._def, {
|
|
4480
4480
|
...n,
|
|
@@ -4522,172 +4522,178 @@ var bn = (e, t) => {
|
|
|
4522
4522
|
}
|
|
4523
4523
|
};
|
|
4524
4524
|
return n.target === "jsonSchema7" ? s.$schema = "http://json-schema.org/draft-07/schema#" : (n.target === "jsonSchema2019-09" || n.target === "openAi") && (s.$schema = "https://json-schema.org/draft/2019-09/schema#"), n.target === "openAi" && ("anyOf" in s || "oneOf" in s || "allOf" in s || "type" in s && Array.isArray(s.type)) && console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."), s;
|
|
4525
|
-
}, Y = (e) => B(e).passthrough(), X = (e) => e.nullable().optional(), Z = B({}).passthrough(),
|
|
4526
|
-
id:
|
|
4527
|
-
name:
|
|
4528
|
-
key: X(
|
|
4529
|
-
description: X(
|
|
4530
|
-
}).describe("A project"),
|
|
4531
|
-
id:
|
|
4532
|
-
projectId:
|
|
4533
|
-
title:
|
|
4534
|
-
status:
|
|
4535
|
-
priority:
|
|
4536
|
-
assigneeId: X(
|
|
4537
|
-
dueDate: X(
|
|
4538
|
-
deadline: X(
|
|
4539
|
-
isMilestone: X(
|
|
4540
|
-
estimatedHours: X(
|
|
4541
|
-
loggedHours: X(
|
|
4542
|
-
isBlocked: X(
|
|
4543
|
-
}).describe("A task"),
|
|
4544
|
-
dependencyId:
|
|
4545
|
-
taskId:
|
|
4546
|
-
title:
|
|
4547
|
-
status:
|
|
4548
|
-
type:
|
|
4549
|
-
}),
|
|
4550
|
-
dependsOn: z(
|
|
4551
|
-
dependents: z(
|
|
4552
|
-
})).describe("Present when includeDependencies is true") }).describe("A task"),
|
|
4553
|
-
id:
|
|
4554
|
-
taskId:
|
|
4555
|
-
dependsOnTaskId:
|
|
4556
|
-
type:
|
|
4557
|
-
}).describe("A dependency between two tasks"),
|
|
4558
|
-
id:
|
|
4559
|
-
projectId:
|
|
4560
|
-
title:
|
|
4561
|
-
dueDate: X(
|
|
4562
|
-
}).describe("A deliverable"),
|
|
4563
|
-
id:
|
|
4564
|
-
taskId:
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
earlyFinishDate: X(I()),
|
|
4582
|
-
lateStartDate: X(I()),
|
|
4583
|
-
lateFinishDate: X(I()),
|
|
4584
|
-
levelingDelayHours: X(L()).describe("With levelling: hours spent waiting for the assignee"),
|
|
4585
|
-
waitingOn: X(I()).describe("With levelling: the task this one waited for"),
|
|
4586
|
-
isMilestone: X(R()).describe("True for a milestone"),
|
|
4587
|
-
deadlineDate: X(I()).describe("The task's deadline as an instant"),
|
|
4588
|
-
deadlineVarianceHours: X(L()).describe("Working hours from forecast finish to deadline; negative means it will be missed")
|
|
4589
|
-
}), Mn = Y({
|
|
4590
|
-
projectId: I(),
|
|
4591
|
-
projectStartDate: X(I()),
|
|
4592
|
-
projectEndDate: X(I()).describe("Forecast finish date"),
|
|
4593
|
-
totalDurationHours: L(),
|
|
4594
|
-
criticalTaskIds: z(I()).describe("Tasks with zero or negative slack, in schedule order"),
|
|
4595
|
-
missedDeadlineTaskIds: X(z(I())).describe("Tasks forecast to finish after their deadline"),
|
|
4596
|
-
tasks: z(jn),
|
|
4597
|
-
leveled: X(R()),
|
|
4598
|
-
unleveledProjectEndDate: X(I()).describe("With levelling: the end date before levelling"),
|
|
4599
|
-
overallocations: X(z(An)).describe("Assignee mode: periods where someone is booked above capacity")
|
|
4525
|
+
}, Y = (e) => B(e).passthrough(), X = (e) => e.nullable().optional(), Z = B({}).passthrough(), wn = Y({
|
|
4526
|
+
id: F().describe("Project id; pass as projectId to other tools"),
|
|
4527
|
+
name: F(),
|
|
4528
|
+
key: X(F()).describe("Short prefix, e.g. \"PROJ\""),
|
|
4529
|
+
description: X(F())
|
|
4530
|
+
}).describe("A project"), Tn = Y({
|
|
4531
|
+
id: F().describe("Task id; pass as id or taskId to other tools"),
|
|
4532
|
+
projectId: F(),
|
|
4533
|
+
title: F(),
|
|
4534
|
+
status: F().describe("Workflow status key"),
|
|
4535
|
+
priority: F().describe("urgent, high, medium, low or none"),
|
|
4536
|
+
assigneeId: X(F()),
|
|
4537
|
+
dueDate: X(F()),
|
|
4538
|
+
deadline: X(F()).describe("Latest acceptable finish, enforced by critical path analysis"),
|
|
4539
|
+
isMilestone: X(L()).describe("A zero-duration checkpoint"),
|
|
4540
|
+
estimatedHours: X(I()),
|
|
4541
|
+
loggedHours: X(I()),
|
|
4542
|
+
isBlocked: X(L())
|
|
4543
|
+
}).describe("A task"), En = Y({
|
|
4544
|
+
dependencyId: F().describe("Id of the dependency record"),
|
|
4545
|
+
taskId: F().describe("The other task"),
|
|
4546
|
+
title: F(),
|
|
4547
|
+
status: F(),
|
|
4548
|
+
type: F().describe("'blocking' (the waiting task cannot start until the other finishes) or 'relates_to' (informational)")
|
|
4549
|
+
}), Dn = Tn.extend({ dependencies: X(Y({
|
|
4550
|
+
dependsOn: z(En).describe("Tasks this task waits for (upstream)"),
|
|
4551
|
+
dependents: z(En).describe("Tasks waiting for this task (downstream)")
|
|
4552
|
+
})).describe("Present when includeDependencies is true") }).describe("A task"), On = Y({
|
|
4553
|
+
id: F(),
|
|
4554
|
+
taskId: F().describe("The task that waits"),
|
|
4555
|
+
dependsOnTaskId: F().describe("The task it waits for"),
|
|
4556
|
+
type: F().describe("blocking or relates_to")
|
|
4557
|
+
}).describe("A dependency between two tasks"), kn = Y({
|
|
4558
|
+
id: F(),
|
|
4559
|
+
projectId: F(),
|
|
4560
|
+
title: F(),
|
|
4561
|
+
dueDate: X(F())
|
|
4562
|
+
}).describe("A deliverable"), An = Y({
|
|
4563
|
+
id: F(),
|
|
4564
|
+
taskId: F(),
|
|
4565
|
+
hours: I(),
|
|
4566
|
+
userId: X(F()),
|
|
4567
|
+
loggedAt: X(F())
|
|
4568
|
+
}).describe("A time entry"), jn = Y({
|
|
4569
|
+
id: F(),
|
|
4570
|
+
taskId: F(),
|
|
4571
|
+
content: F(),
|
|
4572
|
+
authorId: X(F())
|
|
4573
|
+
}).describe("A task comment"), Mn = Y({
|
|
4574
|
+
assigneeId: X(F()),
|
|
4575
|
+
teamId: X(F()),
|
|
4576
|
+
capacity: I().describe("1 for a person, headcount for a team pool"),
|
|
4577
|
+
allocation: I().describe("Total booked in the period, e.g. 1.5 for 150%"),
|
|
4578
|
+
start: F(),
|
|
4579
|
+
end: F(),
|
|
4580
|
+
taskIds: z(F())
|
|
4600
4581
|
}), Nn = Y({
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4582
|
+
taskId: F(),
|
|
4583
|
+
isCritical: L().describe("True when any delay to this task delays the project end"),
|
|
4584
|
+
totalSlack: I().describe("Slack in hours; 0 means critical, negative means a deadline is missed by that much"),
|
|
4585
|
+
slackWorkingHours: X(I()).describe("Slack in working hours on the task calendar"),
|
|
4586
|
+
earlyStartDate: X(F()),
|
|
4587
|
+
earlyFinishDate: X(F()),
|
|
4588
|
+
lateStartDate: X(F()),
|
|
4589
|
+
lateFinishDate: X(F()),
|
|
4590
|
+
levelingDelayHours: X(I()).describe("With levelling: hours spent waiting for the assignee"),
|
|
4591
|
+
waitingOn: X(F()).describe("With levelling: the task this one waited for"),
|
|
4592
|
+
isMilestone: X(L()).describe("True for a milestone"),
|
|
4593
|
+
deadlineDate: X(F()).describe("The task's deadline as an instant"),
|
|
4594
|
+
deadlineVarianceHours: X(I()).describe("Working hours from forecast finish to deadline; negative means it will be missed")
|
|
4605
4595
|
}), Pn = Y({
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4596
|
+
projectId: F(),
|
|
4597
|
+
projectStartDate: X(F()),
|
|
4598
|
+
projectEndDate: X(F()).describe("Forecast finish date"),
|
|
4599
|
+
totalDurationHours: I(),
|
|
4600
|
+
criticalTaskIds: z(F()).describe("Tasks with zero or negative slack, in schedule order"),
|
|
4601
|
+
missedDeadlineTaskIds: X(z(F())).describe("Tasks forecast to finish after their deadline"),
|
|
4602
|
+
tasks: z(Nn),
|
|
4603
|
+
leveled: X(L()),
|
|
4604
|
+
unleveledProjectEndDate: X(F()).describe("With levelling: the end date before levelling"),
|
|
4605
|
+
overallocations: X(z(Mn)).describe("Assignee mode: periods where someone is booked above capacity")
|
|
4614
4606
|
}), Fn = Y({
|
|
4615
|
-
|
|
4616
|
-
|
|
4607
|
+
projects: z(Pn).describe("One analysis per project"),
|
|
4608
|
+
projectEndDate: X(F()).describe("The latest project end"),
|
|
4609
|
+
leveled: X(L()),
|
|
4610
|
+
overallocations: z(Mn)
|
|
4611
|
+
}), In = Y({
|
|
4612
|
+
id: F(),
|
|
4613
|
+
type: F().describe("container, iteration, deliverable or phase"),
|
|
4614
|
+
name: F(),
|
|
4615
|
+
health: F().describe("on_track, at_risk, blocked, overdue or completed"),
|
|
4616
|
+
progressPercentage: I().describe("0-100"),
|
|
4617
|
+
isCritical: L(),
|
|
4618
|
+
blockedTasks: I(),
|
|
4619
|
+
taskIds: z(F())
|
|
4620
|
+
}), Ln = Y({
|
|
4621
|
+
projectId: F(),
|
|
4622
|
+
level: F(),
|
|
4617
4623
|
macro: X(Y({
|
|
4618
|
-
health:
|
|
4619
|
-
overallProgressPercentage:
|
|
4620
|
-
projectedFinishDate: X(
|
|
4621
|
-
totalTasks:
|
|
4622
|
-
completedTasks:
|
|
4623
|
-
blockedTasks:
|
|
4624
|
-
phases: z(
|
|
4624
|
+
health: F().describe("on_track, at_risk, blocked, overdue or completed"),
|
|
4625
|
+
overallProgressPercentage: I().describe("0-100"),
|
|
4626
|
+
projectedFinishDate: X(F()),
|
|
4627
|
+
totalTasks: I(),
|
|
4628
|
+
completedTasks: I(),
|
|
4629
|
+
blockedTasks: I(),
|
|
4630
|
+
phases: z(In)
|
|
4625
4631
|
})).describe("Phase-level summary"),
|
|
4626
4632
|
standard: X(Z).describe("Task timeline: { tasks, criticalPathTaskIds, dependencies, totalDurationHours }"),
|
|
4627
4633
|
concrete: X(V(Z)).describe("Work evidence (time entries, attachments) by task id")
|
|
4628
|
-
}),
|
|
4629
|
-
taskId:
|
|
4630
|
-
macroPhase: X(
|
|
4634
|
+
}), Rn = Y({
|
|
4635
|
+
taskId: F(),
|
|
4636
|
+
macroPhase: X(In).describe("The phase this task belongs to"),
|
|
4631
4637
|
standard: Z.describe("The task with cpm (isCritical, slackWorkingHours, dates), blockingTaskIds and dependentTaskIds"),
|
|
4632
4638
|
concrete: Z.describe("Evidence of work on the task"),
|
|
4633
4639
|
metrics: X(Z).describe("Same as get_task_metrics")
|
|
4634
|
-
}),
|
|
4635
|
-
taskId:
|
|
4640
|
+
}), zn = Y({
|
|
4641
|
+
taskId: F(),
|
|
4636
4642
|
points: z(Y({
|
|
4637
|
-
timestamp:
|
|
4638
|
-
progress:
|
|
4639
|
-
status:
|
|
4643
|
+
timestamp: F(),
|
|
4644
|
+
progress: I().describe("0-100"),
|
|
4645
|
+
status: F()
|
|
4640
4646
|
})),
|
|
4641
|
-
curveProfile:
|
|
4642
|
-
}),
|
|
4643
|
-
taskId:
|
|
4647
|
+
curveProfile: F().describe("linear, s_curve, early_surge, late_rush, stalled or insufficient_data")
|
|
4648
|
+
}), Bn = Y({
|
|
4649
|
+
taskId: F(),
|
|
4644
4650
|
progress: Y({
|
|
4645
|
-
progressPercentage:
|
|
4646
|
-
source:
|
|
4651
|
+
progressPercentage: I().describe("0-100"),
|
|
4652
|
+
source: F().describe("Where the figure comes from: explicit, todos, time_effort, schedule_elapsed or blended")
|
|
4647
4653
|
}),
|
|
4648
4654
|
realityDelta: Y({
|
|
4649
|
-
estimatedHours:
|
|
4650
|
-
loggedHours:
|
|
4651
|
-
varianceHours:
|
|
4652
|
-
isOverdue:
|
|
4653
|
-
isOverEstimate:
|
|
4654
|
-
scheduleVarianceWorkingDays: X(
|
|
4655
|
+
estimatedHours: I(),
|
|
4656
|
+
loggedHours: I(),
|
|
4657
|
+
varianceHours: I().describe("logged minus estimated"),
|
|
4658
|
+
isOverdue: L(),
|
|
4659
|
+
isOverEstimate: L(),
|
|
4660
|
+
scheduleVarianceWorkingDays: X(I()).describe("Working days late (positive) or early (negative)")
|
|
4655
4661
|
}),
|
|
4656
4662
|
evm: Y({
|
|
4657
|
-
plannedValue:
|
|
4658
|
-
earnedValue:
|
|
4659
|
-
actualCost:
|
|
4660
|
-
costPerformanceIndex:
|
|
4661
|
-
schedulePerformanceIndex:
|
|
4663
|
+
plannedValue: I(),
|
|
4664
|
+
earnedValue: I(),
|
|
4665
|
+
actualCost: I(),
|
|
4666
|
+
costPerformanceIndex: I().describe("CPI = EV / AC; below 1 is over budget"),
|
|
4667
|
+
schedulePerformanceIndex: I().describe("SPI = EV / PV; below 1 is behind schedule")
|
|
4662
4668
|
}),
|
|
4663
4669
|
inferredActuals: Z.describe("Actual start/end dates and active working time"),
|
|
4664
|
-
progressHistory:
|
|
4665
|
-
}),
|
|
4666
|
-
startDate:
|
|
4667
|
-
endDate:
|
|
4668
|
-
interval:
|
|
4669
|
-
groupBy:
|
|
4670
|
-
metric:
|
|
4671
|
-
seriesKeys: z(
|
|
4672
|
-
seriesLabels: V(
|
|
4670
|
+
progressHistory: zn
|
|
4671
|
+
}), Vn = Y({
|
|
4672
|
+
startDate: F(),
|
|
4673
|
+
endDate: F(),
|
|
4674
|
+
interval: F(),
|
|
4675
|
+
groupBy: F(),
|
|
4676
|
+
metric: F(),
|
|
4677
|
+
seriesKeys: z(F()).describe("Ids of the people, teams, etc. in the series"),
|
|
4678
|
+
seriesLabels: V(F()).describe("Display name for each series key"),
|
|
4673
4679
|
buckets: z(Y({
|
|
4674
|
-
date:
|
|
4675
|
-
totalHours:
|
|
4676
|
-
values: V(
|
|
4677
|
-
capacity: X(V(
|
|
4678
|
-
utilizationRatio: X(
|
|
4680
|
+
date: F().describe("Start of the bucket (YYYY-MM-DD)"),
|
|
4681
|
+
totalHours: I(),
|
|
4682
|
+
values: V(I()).describe("Hours per series key"),
|
|
4683
|
+
capacity: X(V(I())).describe("Capacity hours per series key"),
|
|
4684
|
+
utilizationRatio: X(I()).describe("totalHours / totalCapacity; above 1 is overloaded")
|
|
4679
4685
|
})),
|
|
4680
|
-
totalHours:
|
|
4681
|
-
totalCapacity: X(
|
|
4682
|
-
averageUtilization: X(
|
|
4683
|
-
}),
|
|
4686
|
+
totalHours: I(),
|
|
4687
|
+
totalCapacity: X(I()),
|
|
4688
|
+
averageUtilization: X(I())
|
|
4689
|
+
}), Hn = Y({
|
|
4684
4690
|
skills: X(z(Y({
|
|
4685
|
-
name:
|
|
4686
|
-
description:
|
|
4691
|
+
name: F(),
|
|
4692
|
+
description: F()
|
|
4687
4693
|
}))).describe("Present when no name was given"),
|
|
4688
|
-
name: X(
|
|
4689
|
-
description: X(
|
|
4690
|
-
content: X(
|
|
4694
|
+
name: X(F()),
|
|
4695
|
+
description: X(F()),
|
|
4696
|
+
content: X(F()).describe("The playbook (markdown); follow its steps")
|
|
4691
4697
|
}), Q = [
|
|
4692
4698
|
{
|
|
4693
4699
|
name: "analyze-schedule",
|
|
@@ -4720,28 +4726,28 @@ var bn = (e, t) => {
|
|
|
4720
4726
|
content: "---\nname: triage-tasks\ndescription: Review new, unprioritized or stale tasks and set priority, estimate, tags and blocked state consistently. Use when the user asks to triage, groom or clean up a backlog.\n---\n\n# Triage tasks\n\nMake every task in scope actionable: a clear title, a priority, an estimate and an honest blocked state.\n\n## 1. Gather the tasks\n\n1. Get the `projectId` with `list_projects` if you do not have it, then `get_project` to learn the workflow status keys.\n2. Call `list_tasks` with filters that match the request, for example:\n - untriaged: `priority: \"none\"`;\n - a backlog: `status` set to the backlog key from the workflow;\n - one person's work: `assigneeId`.\n Page with `nextCursor` until it is empty, or stop at a sensible batch (about 25) and say how many remain.\n3. For tasks whose description is thin or which look blocked, read the discussion with `list_comments`.\n\n## 2. Decide, task by task\n\n| Field | Rule |\n| --- | --- |\n| `priority` | `urgent`: blocks other people now or a live problem. `high`: needed for the next deliverable. `medium`: planned work. `low`: nice to have. Reserve `urgent` for a handful of tasks. |\n| `estimatedHours` | Effort in hours. If a task is over about 24 hours, propose splitting it instead of estimating it. |\n| `tags` | Reuse tags already used in the project; do not invent a new scheme. |\n| `isBlocked` / `blockedReason` | Blocked only when work cannot continue; the reason names what it waits for. |\n| title | Starts with a verb and says the outcome. Rewrite only when it is unclear. |\n\nFlag likely duplicates (same outcome, different words) instead of deleting them.\n\n## 3. Propose, then apply\n\n1. Show the user a table: task title, current values, proposed values, one-line reason.\n2. After the user approves (all or some), apply each change with `update_task`, passing only the fields that change.\n3. For any non-obvious change, record why with `add_comment` on the task.\n\n## Guardrails\n\n- Do not change `status` or `assigneeId` during triage unless the user asked for it.\n- Never call `delete_task` during triage. Suggest canceling duplicates and let the user decide.\n"
|
|
4721
4727
|
}
|
|
4722
4728
|
];
|
|
4723
|
-
function
|
|
4729
|
+
function Un(e) {
|
|
4724
4730
|
return Q.find((t) => t.name === e);
|
|
4725
4731
|
}
|
|
4726
4732
|
//#endregion
|
|
4727
4733
|
//#region ../mcp/dist/tools/definitions.js
|
|
4728
|
-
var
|
|
4734
|
+
var Wn = {
|
|
4729
4735
|
core: "Projects, tasks and task dependencies: find, read, create, update and delete",
|
|
4730
4736
|
collaboration: "Deliverables and task comments",
|
|
4731
4737
|
scheduling: "Critical path, portfolio scheduling and workload/capacity",
|
|
4732
4738
|
analytics: "Project status ladder, task metrics, earned value and progress history",
|
|
4733
4739
|
guidance: "Skills: step-by-step playbooks for multi-step jobs"
|
|
4734
4740
|
};
|
|
4735
|
-
function
|
|
4736
|
-
let { $schema: t, ...n } =
|
|
4741
|
+
function Gn(e) {
|
|
4742
|
+
let { $schema: t, ...n } = Cn(e, { $refStrategy: "none" });
|
|
4737
4743
|
return n;
|
|
4738
4744
|
}
|
|
4739
4745
|
function $(e) {
|
|
4740
4746
|
let t = e.annotations?.readOnlyHint ?? !1;
|
|
4741
4747
|
return {
|
|
4742
4748
|
...e,
|
|
4743
|
-
inputSchema:
|
|
4744
|
-
outputSchema:
|
|
4749
|
+
inputSchema: Gn(e.zodSchema),
|
|
4750
|
+
outputSchema: Gn(e.outputZodSchema),
|
|
4745
4751
|
annotations: {
|
|
4746
4752
|
readOnlyHint: t,
|
|
4747
4753
|
destructiveHint: e.annotations?.destructiveHint ?? !1,
|
|
@@ -4750,65 +4756,65 @@ function $(e) {
|
|
|
4750
4756
|
}
|
|
4751
4757
|
};
|
|
4752
4758
|
}
|
|
4753
|
-
var
|
|
4759
|
+
var Kn = class extends Error {
|
|
4754
4760
|
constructor(e, t) {
|
|
4755
4761
|
super(`Invalid arguments for tool "${e}": ${t}`), this.name = "ToolArgumentError";
|
|
4756
4762
|
}
|
|
4757
4763
|
};
|
|
4758
|
-
function
|
|
4764
|
+
function qn(e, t) {
|
|
4759
4765
|
let n = e.zodSchema.strict().safeParse(t ?? {});
|
|
4760
4766
|
if (!n.success) {
|
|
4761
4767
|
let t = n.error.issues.map((e) => `${e.path.join(".") || "(root)"}: ${e.message}`).join("; ");
|
|
4762
|
-
throw new
|
|
4768
|
+
throw new Kn(e.name, t);
|
|
4763
4769
|
}
|
|
4764
4770
|
return n.data;
|
|
4765
4771
|
}
|
|
4766
|
-
async function
|
|
4772
|
+
async function Jn(e) {
|
|
4767
4773
|
return { isEngine: "store" in e && typeof e.store == "object" };
|
|
4768
4774
|
}
|
|
4769
|
-
var
|
|
4775
|
+
var Yn = $({
|
|
4770
4776
|
name: "list_projects",
|
|
4771
4777
|
title: "List Projects",
|
|
4772
4778
|
description: "List every project you can read, with its id, name and key. Start here to find a projectId; never guess ids. Returns { projects }.",
|
|
4773
4779
|
toolset: "core",
|
|
4774
|
-
outputZodSchema: B({ projects: z(
|
|
4780
|
+
outputZodSchema: B({ projects: z(wn) }),
|
|
4775
4781
|
zodSchema: B({}),
|
|
4776
4782
|
annotations: { readOnlyHint: !0 },
|
|
4777
4783
|
execute: async (e, t) => ({ projects: await t.getProjects() })
|
|
4778
|
-
}),
|
|
4784
|
+
}), Xn = $({
|
|
4779
4785
|
name: "get_project",
|
|
4780
4786
|
title: "Get Project",
|
|
4781
4787
|
description: "Get one project by id: name, key, workflow statuses, custom field definitions and calendar. Use it before creating or moving tasks to learn the valid status keys and custom fields. Returns the project. For its tasks use `list_tasks`.",
|
|
4782
4788
|
toolset: "core",
|
|
4783
|
-
outputZodSchema:
|
|
4784
|
-
zodSchema: B({ id:
|
|
4789
|
+
outputZodSchema: wn,
|
|
4790
|
+
zodSchema: B({ id: F().describe("The project ID") }),
|
|
4785
4791
|
annotations: { readOnlyHint: !0 },
|
|
4786
4792
|
execute: async (e, t) => t.getProject(e.id)
|
|
4787
|
-
}),
|
|
4793
|
+
}), Zn = $({
|
|
4788
4794
|
name: "create_project",
|
|
4789
4795
|
title: "Create Project",
|
|
4790
4796
|
description: "Create a new, empty project. Use only when the user wants a new project; to add work to an existing one use `create_task`. Returns the created project with its id.",
|
|
4791
4797
|
toolset: "core",
|
|
4792
|
-
outputZodSchema:
|
|
4798
|
+
outputZodSchema: wn,
|
|
4793
4799
|
zodSchema: B({
|
|
4794
|
-
name:
|
|
4795
|
-
description:
|
|
4796
|
-
key:
|
|
4797
|
-
customFields: V(
|
|
4800
|
+
name: F().describe("Name of the project"),
|
|
4801
|
+
description: F().optional().describe("Description of the project"),
|
|
4802
|
+
key: F().optional().describe("Short project key/prefix (e.g. \"PROJ\")"),
|
|
4803
|
+
customFields: V(R()).optional().describe("Custom field values as a JSON object (validated against the project's field definitions for tasks)")
|
|
4798
4804
|
}),
|
|
4799
4805
|
execute: async (e, t) => t.createProject(e)
|
|
4800
|
-
}),
|
|
4806
|
+
}), Qn = $({
|
|
4801
4807
|
name: "list_tasks",
|
|
4802
4808
|
title: "List Tasks",
|
|
4803
4809
|
description: "Find tasks, oldest first, filtered by project, status, priority, assignee, iteration, deliverable, container or parent task ('none' for top-level tasks only). Use it for questions like \"what is blocked / assigned to X / in progress\" and to look up task ids. Returns { tasks, nextCursor }; pass nextCursor back as cursor for the next page. For one task's full record use `get_task`.",
|
|
4804
4810
|
toolset: "core",
|
|
4805
4811
|
outputZodSchema: B({
|
|
4806
|
-
tasks: z(
|
|
4807
|
-
nextCursor:
|
|
4812
|
+
tasks: z(Tn),
|
|
4813
|
+
nextCursor: F().nullable().optional()
|
|
4808
4814
|
}),
|
|
4809
4815
|
zodSchema: B({
|
|
4810
|
-
projectId:
|
|
4811
|
-
status:
|
|
4816
|
+
projectId: F().optional().describe("Filter by project ID"),
|
|
4817
|
+
status: F().optional().describe("Filter by task status key"),
|
|
4812
4818
|
priority: H([
|
|
4813
4819
|
"urgent",
|
|
4814
4820
|
"high",
|
|
@@ -4816,13 +4822,13 @@ var qn = $({
|
|
|
4816
4822
|
"low",
|
|
4817
4823
|
"none"
|
|
4818
4824
|
]).optional().describe("Filter by priority"),
|
|
4819
|
-
assigneeId:
|
|
4820
|
-
iterationId:
|
|
4821
|
-
deliverableId:
|
|
4822
|
-
containerId:
|
|
4823
|
-
parentId:
|
|
4824
|
-
limit:
|
|
4825
|
-
cursor:
|
|
4825
|
+
assigneeId: F().optional().describe("Filter by assignee ID"),
|
|
4826
|
+
iterationId: F().optional().describe("Filter by iteration (sprint) ID"),
|
|
4827
|
+
deliverableId: F().optional().describe("Filter by deliverable ID"),
|
|
4828
|
+
containerId: F().optional().describe("Filter by container (e.g. epic) ID"),
|
|
4829
|
+
parentId: F().optional().describe("Subtasks of this task ID, or 'none' for top-level tasks only"),
|
|
4830
|
+
limit: I().int().min(1).max(500).optional().describe("Page size (default 100)"),
|
|
4831
|
+
cursor: F().optional().describe("nextCursor from a previous call")
|
|
4826
4832
|
}),
|
|
4827
4833
|
annotations: { readOnlyHint: !0 },
|
|
4828
4834
|
execute: async (e, t, n) => {
|
|
@@ -4843,30 +4849,37 @@ var qn = $({
|
|
|
4843
4849
|
nextCursor: r.nextCursor
|
|
4844
4850
|
};
|
|
4845
4851
|
}
|
|
4846
|
-
}),
|
|
4852
|
+
}), $n = $({
|
|
4847
4853
|
name: "get_task",
|
|
4848
4854
|
title: "Get Task",
|
|
4849
4855
|
description: "Get one task by id: status, priority, assignee, estimate, logged hours, dates, blocked state and custom fields. Set includeDependencies to also see which tasks it waits for and which wait for it. Returns the task, with { dependencies: { dependsOn, dependents } } when asked. For its discussion use `list_comments`; for progress and variance use `get_task_metrics`.",
|
|
4850
4856
|
toolset: "core",
|
|
4851
|
-
outputZodSchema:
|
|
4857
|
+
outputZodSchema: Dn,
|
|
4852
4858
|
zodSchema: B({
|
|
4853
|
-
id:
|
|
4854
|
-
includeDependencies:
|
|
4859
|
+
id: F().describe("The task ID"),
|
|
4860
|
+
includeDependencies: L().optional().describe("Also return the tasks this one waits for (dependsOn) and the tasks waiting for it (dependents)")
|
|
4855
4861
|
}),
|
|
4856
4862
|
annotations: { readOnlyHint: !0 },
|
|
4857
4863
|
execute: async (e, t) => {
|
|
4858
4864
|
let n = await t.getTask(e.id);
|
|
4859
4865
|
if (!n || !e.includeDependencies) return n;
|
|
4860
|
-
let r = await
|
|
4866
|
+
let r = await nr(t, e.id), i = new Map([...r.upstreamTasks, ...r.downstreamTasks].map((e) => [e.id, e]));
|
|
4867
|
+
for (let n of r.dependencies) {
|
|
4868
|
+
let r = n.taskId === e.id ? n.dependsOnTaskId : n.taskId;
|
|
4869
|
+
if (i.has(r) || r === e.id) continue;
|
|
4870
|
+
let a = await t.getTask(r).catch(() => null);
|
|
4871
|
+
a && i.set(r, a);
|
|
4872
|
+
}
|
|
4873
|
+
let a = [], o = [];
|
|
4861
4874
|
for (let t of r.dependencies) {
|
|
4862
|
-
let { waiting: n, waitedFor: r } =
|
|
4875
|
+
let { waiting: n, waitedFor: r } = er(t), s = n === e.id ? r : n, c = i.get(s);
|
|
4863
4876
|
if (!c || s === e.id) continue;
|
|
4864
4877
|
let ee = {
|
|
4865
4878
|
dependencyId: t.id,
|
|
4866
4879
|
taskId: c.id,
|
|
4867
4880
|
title: c.title,
|
|
4868
4881
|
status: c.status,
|
|
4869
|
-
type:
|
|
4882
|
+
type: tr(t)
|
|
4870
4883
|
};
|
|
4871
4884
|
(n === e.id ? a : o).push(ee);
|
|
4872
4885
|
}
|
|
@@ -4879,31 +4892,32 @@ var qn = $({
|
|
|
4879
4892
|
};
|
|
4880
4893
|
}
|
|
4881
4894
|
});
|
|
4882
|
-
function
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4895
|
+
function er(e) {
|
|
4896
|
+
let t = r(e);
|
|
4897
|
+
return t ? {
|
|
4898
|
+
waiting: t.after,
|
|
4899
|
+
waitedFor: t.before
|
|
4886
4900
|
} : {
|
|
4887
4901
|
waiting: e.taskId,
|
|
4888
4902
|
waitedFor: e.dependsOnTaskId
|
|
4889
4903
|
};
|
|
4890
4904
|
}
|
|
4891
|
-
var
|
|
4892
|
-
async function
|
|
4893
|
-
let { isEngine: n } = await
|
|
4905
|
+
var tr = (e) => e.type === "relates_to" ? "relates_to" : "blocking";
|
|
4906
|
+
async function nr(e, t) {
|
|
4907
|
+
let { isEngine: n } = await Jn(e);
|
|
4894
4908
|
return n ? e.getTaskDependencyGraph(t) : e.getTaskDependencies(t);
|
|
4895
4909
|
}
|
|
4896
|
-
var
|
|
4910
|
+
var rr = $({
|
|
4897
4911
|
name: "create_task",
|
|
4898
4912
|
title: "Create Task",
|
|
4899
4913
|
description: "Create a task in a project. Check with `list_tasks` first so you do not add a duplicate. Without a status the task starts in the project's default workflow status. Returns the created task with its id.",
|
|
4900
4914
|
toolset: "core",
|
|
4901
|
-
outputZodSchema:
|
|
4915
|
+
outputZodSchema: Tn,
|
|
4902
4916
|
zodSchema: B({
|
|
4903
|
-
projectId:
|
|
4904
|
-
title:
|
|
4905
|
-
description:
|
|
4906
|
-
status:
|
|
4917
|
+
projectId: F().optional().describe("Project ID (inferred from active view in browser if omitted)"),
|
|
4918
|
+
title: F().describe("Title of the task"),
|
|
4919
|
+
description: F().optional().describe("Detailed description / markdown"),
|
|
4920
|
+
status: F().optional().describe("Status key (defaults to the project workflow's default status)"),
|
|
4907
4921
|
priority: H([
|
|
4908
4922
|
"urgent",
|
|
4909
4923
|
"high",
|
|
@@ -4911,16 +4925,16 @@ var tr = $({
|
|
|
4911
4925
|
"low",
|
|
4912
4926
|
"none"
|
|
4913
4927
|
]).optional().default("none").describe("Task priority"),
|
|
4914
|
-
assigneeId:
|
|
4915
|
-
dueDate:
|
|
4916
|
-
deadline:
|
|
4917
|
-
isMilestone:
|
|
4918
|
-
tags: z(
|
|
4919
|
-
estimatedHours:
|
|
4920
|
-
allocation:
|
|
4921
|
-
isBlocked:
|
|
4922
|
-
blockedReason:
|
|
4923
|
-
customFields: V(
|
|
4928
|
+
assigneeId: F().optional().describe("User ID to assign task to"),
|
|
4929
|
+
dueDate: F().optional().describe("Due date (ISO string)"),
|
|
4930
|
+
deadline: F().optional().describe("Latest acceptable finish (YYYY-MM-DD for the end of that working day, or an ISO date-time). Critical path analysis reports a miss as negative slack"),
|
|
4931
|
+
isMilestone: L().optional().describe("Mark the task as a milestone: a zero-duration checkpoint (release, sign-off) fed by dependencies; its estimate is ignored"),
|
|
4932
|
+
tags: z(F()).optional().describe("Tags for categorization"),
|
|
4933
|
+
estimatedHours: I().optional().describe("Estimated hours to complete"),
|
|
4934
|
+
allocation: I().gt(0).max(1).optional().describe("Share of the assignee's time the task takes, in (0, 1]; e.g. 0.5 for half-time. Estimates are effort, so a 0.5 task takes twice as long"),
|
|
4935
|
+
isBlocked: L().optional().describe("Whether the task is blocked"),
|
|
4936
|
+
blockedReason: F().optional().describe("Reason why the task is blocked"),
|
|
4937
|
+
customFields: V(R()).optional().describe("Custom field values as a JSON object (validated against the project's field definitions for tasks)")
|
|
4924
4938
|
}),
|
|
4925
4939
|
execute: async (e, t, n) => {
|
|
4926
4940
|
let r = e.projectId || n?.projectId;
|
|
@@ -4944,17 +4958,17 @@ var tr = $({
|
|
|
4944
4958
|
};
|
|
4945
4959
|
return t.createTask(i);
|
|
4946
4960
|
}
|
|
4947
|
-
}),
|
|
4961
|
+
}), ir = $({
|
|
4948
4962
|
name: "update_task",
|
|
4949
4963
|
title: "Update Task",
|
|
4950
|
-
description: "Change an existing task: title, description, status, priority, assignee, due date, deadline, milestone flag, estimate,
|
|
4964
|
+
description: "Change an existing task: title, description, status, priority, assignee, due date, deadline, milestone flag, estimate, allocation, blocked state, tags or custom fields. Only the fields you pass change. Use it to move a task through its workflow or re-plan it. Returns the updated task.",
|
|
4951
4965
|
toolset: "core",
|
|
4952
|
-
outputZodSchema:
|
|
4966
|
+
outputZodSchema: Tn,
|
|
4953
4967
|
zodSchema: B({
|
|
4954
|
-
id:
|
|
4955
|
-
title:
|
|
4956
|
-
description:
|
|
4957
|
-
status:
|
|
4968
|
+
id: F().describe("The task ID"),
|
|
4969
|
+
title: F().optional().describe("New title"),
|
|
4970
|
+
description: F().optional().describe("New description (markdown)"),
|
|
4971
|
+
status: F().optional().describe("Status key from the project's workflow (see `get_project`)"),
|
|
4958
4972
|
priority: H([
|
|
4959
4973
|
"urgent",
|
|
4960
4974
|
"high",
|
|
@@ -4962,49 +4976,62 @@ var tr = $({
|
|
|
4962
4976
|
"low",
|
|
4963
4977
|
"none"
|
|
4964
4978
|
]).optional().describe("New priority"),
|
|
4965
|
-
assigneeId:
|
|
4966
|
-
dueDate:
|
|
4967
|
-
deadline:
|
|
4968
|
-
isMilestone:
|
|
4969
|
-
tags: z(
|
|
4970
|
-
estimatedHours:
|
|
4971
|
-
allocation:
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
customFields: V(Tt()).optional().describe("Custom field values as a JSON object (validated against the project's field definitions for tasks)")
|
|
4979
|
+
assigneeId: F().optional().describe("User ID to assign the task to"),
|
|
4980
|
+
dueDate: F().optional().describe("Due date (ISO string)"),
|
|
4981
|
+
deadline: F().optional().describe("Latest acceptable finish (YYYY-MM-DD for the end of that working day, or an ISO date-time). Critical path analysis reports a miss as negative slack"),
|
|
4982
|
+
isMilestone: L().optional().describe("Mark the task as a milestone: a zero-duration checkpoint (release, sign-off) fed by dependencies; its estimate is ignored"),
|
|
4983
|
+
tags: z(F()).optional().describe("Replaces all tags"),
|
|
4984
|
+
estimatedHours: I().optional().describe("Estimated effort in hours"),
|
|
4985
|
+
allocation: I().gt(0).max(1).optional().describe("Share of the assignee's time the task takes, in (0, 1]; e.g. 0.5 for half-time. Estimates are effort, so a 0.5 task takes twice as long"),
|
|
4986
|
+
isBlocked: L().optional().describe("Whether the task is blocked"),
|
|
4987
|
+
blockedReason: F().optional().describe("Reason why the task is blocked"),
|
|
4988
|
+
customFields: V(R()).optional().describe("Custom field values as a JSON object (validated against the project's field definitions for tasks)")
|
|
4976
4989
|
}),
|
|
4977
4990
|
annotations: { idempotentHint: !0 },
|
|
4978
4991
|
execute: async (e, t) => {
|
|
4979
4992
|
let { id: n, ...r } = e;
|
|
4980
4993
|
return t.updateTask(n, r);
|
|
4981
4994
|
}
|
|
4982
|
-
}),
|
|
4995
|
+
}), ar = $({
|
|
4983
4996
|
name: "delete_task",
|
|
4984
4997
|
title: "Delete Task",
|
|
4985
4998
|
description: "Permanently delete a task by id. This cannot be undone: confirm with the user first, and prefer `update_task` with a canceled status when the history should be kept. Returns { success }.",
|
|
4986
4999
|
toolset: "core",
|
|
4987
|
-
outputZodSchema: B({ success:
|
|
4988
|
-
zodSchema: B({ id:
|
|
5000
|
+
outputZodSchema: B({ success: L() }),
|
|
5001
|
+
zodSchema: B({ id: F().describe("The task ID to delete") }),
|
|
4989
5002
|
annotations: {
|
|
4990
5003
|
destructiveHint: !0,
|
|
4991
5004
|
idempotentHint: !0
|
|
4992
5005
|
},
|
|
4993
5006
|
execute: async (e, t) => ({ success: await t.deleteTask(e.id) })
|
|
4994
|
-
}),
|
|
5007
|
+
}), or = $({
|
|
5008
|
+
name: "log_time",
|
|
5009
|
+
title: "Log Time",
|
|
5010
|
+
description: "Record time worked on a task. The task's logged hours are the sum of its time entries, so this is how hours are added (they cannot be set directly). Returns the time entry.",
|
|
5011
|
+
toolset: "core",
|
|
5012
|
+
outputZodSchema: An,
|
|
5013
|
+
zodSchema: B({
|
|
5014
|
+
taskId: F().describe("The task worked on"),
|
|
5015
|
+
hours: I().positive().describe("Hours worked, e.g. 1.5"),
|
|
5016
|
+
description: F().optional().describe("What was done"),
|
|
5017
|
+
isBillable: L().optional().describe("Whether the time is billable (default true)"),
|
|
5018
|
+
loggedAt: F().optional().describe("When the work was done (ISO date-time; default now)")
|
|
5019
|
+
}),
|
|
5020
|
+
execute: async (e, t) => t.logTime(e)
|
|
5021
|
+
}), sr = $({
|
|
4995
5022
|
name: "add_dependency",
|
|
4996
5023
|
title: "Add Dependency",
|
|
4997
5024
|
description: "Record that a task cannot start until another task finishes, so the critical path schedules them in order. Use it when planning or re-sequencing work. Adding a link that already exists returns it; a link that would make a loop is refused. Returns the dependency { id, taskId, dependsOnTaskId, type }. To undo use `remove_dependency`.",
|
|
4998
5025
|
toolset: "core",
|
|
4999
|
-
outputZodSchema:
|
|
5026
|
+
outputZodSchema: On,
|
|
5000
5027
|
zodSchema: B({
|
|
5001
|
-
taskId:
|
|
5002
|
-
dependsOnTaskId:
|
|
5028
|
+
taskId: F().describe("The task that waits"),
|
|
5029
|
+
dependsOnTaskId: F().describe("The task that must finish first"),
|
|
5003
5030
|
type: H(["blocking", "relates_to"]).optional().describe("'blocking' (default) affects the schedule; 'relates_to' only links the tasks for reference")
|
|
5004
5031
|
}),
|
|
5005
5032
|
annotations: { idempotentHint: !0 },
|
|
5006
5033
|
execute: async (e, t) => {
|
|
5007
|
-
let n = e.type ?? "blocking", { isEngine: r } = await
|
|
5034
|
+
let n = e.type ?? "blocking", { isEngine: r } = await Jn(t);
|
|
5008
5035
|
return r ? t.addDependency({
|
|
5009
5036
|
taskId: e.taskId,
|
|
5010
5037
|
dependsOnTaskId: e.dependsOnTaskId,
|
|
@@ -5014,58 +5041,58 @@ var tr = $({
|
|
|
5014
5041
|
type: n
|
|
5015
5042
|
});
|
|
5016
5043
|
}
|
|
5017
|
-
}),
|
|
5044
|
+
}), cr = $({
|
|
5018
5045
|
name: "remove_dependency",
|
|
5019
5046
|
title: "Remove Dependency",
|
|
5020
5047
|
description: "Stop a task waiting for another task, for example when the order was wrong or the work no longer depends on it. Identify the link by its two task ids, as given to `add_dependency`. Removing a link that does not exist is not an error. Returns { removed, dependencyIds } with the number of links removed.",
|
|
5021
5048
|
toolset: "core",
|
|
5022
5049
|
outputZodSchema: B({
|
|
5023
|
-
removed:
|
|
5024
|
-
dependencyIds: z(
|
|
5050
|
+
removed: I().describe("How many dependency records were removed (0 if none matched)"),
|
|
5051
|
+
dependencyIds: z(F()).describe("Ids of the removed records")
|
|
5025
5052
|
}),
|
|
5026
5053
|
zodSchema: B({
|
|
5027
|
-
taskId:
|
|
5028
|
-
dependsOnTaskId:
|
|
5054
|
+
taskId: F().describe("The task that waits"),
|
|
5055
|
+
dependsOnTaskId: F().describe("The task it waits for"),
|
|
5029
5056
|
type: H(["blocking", "relates_to"]).optional().describe("Remove only links of this type (default: both)")
|
|
5030
5057
|
}),
|
|
5031
5058
|
annotations: { idempotentHint: !0 },
|
|
5032
5059
|
execute: async (e, t) => {
|
|
5033
|
-
let n = (await
|
|
5034
|
-
let { waiting: n, waitedFor: r } =
|
|
5035
|
-
return n === e.taskId && r === e.dependsOnTaskId && (!e.type ||
|
|
5036
|
-
}), { isEngine: r } = await
|
|
5060
|
+
let n = (await nr(t, e.taskId)).dependencies.filter((t) => {
|
|
5061
|
+
let { waiting: n, waitedFor: r } = er(t);
|
|
5062
|
+
return n === e.taskId && r === e.dependsOnTaskId && (!e.type || tr(t) === e.type);
|
|
5063
|
+
}), { isEngine: r } = await Jn(t), i = [];
|
|
5037
5064
|
for (let e of n) (r ? await t.removeDependency(e.id) : await t.removeDependency(e.taskId, e.id)) && i.push(e.id);
|
|
5038
5065
|
return {
|
|
5039
5066
|
removed: i.length,
|
|
5040
5067
|
dependencyIds: i
|
|
5041
5068
|
};
|
|
5042
5069
|
}
|
|
5043
|
-
}),
|
|
5070
|
+
}), lr = $({
|
|
5044
5071
|
name: "list_deliverables",
|
|
5045
5072
|
title: "List Deliverables",
|
|
5046
5073
|
description: "List a project's deliverables: outputs that group the tasks producing them. Use it to see what is due and which tasks feed each deliverable. For dated checkpoints, look for milestone tasks (`isMilestone`). Returns { deliverables }.",
|
|
5047
5074
|
toolset: "collaboration",
|
|
5048
|
-
outputZodSchema: B({ deliverables: z(
|
|
5049
|
-
zodSchema: B({ projectId:
|
|
5075
|
+
outputZodSchema: B({ deliverables: z(kn) }),
|
|
5076
|
+
zodSchema: B({ projectId: F().optional().describe("Project ID (falls back to ambient context if omitted)") }),
|
|
5050
5077
|
annotations: { readOnlyHint: !0 },
|
|
5051
5078
|
execute: async (e, t, n) => {
|
|
5052
5079
|
let r = e.projectId || n?.projectId;
|
|
5053
5080
|
if (!r) throw Error("projectId is required to list deliverables. Find one with `list_projects`.");
|
|
5054
5081
|
return "getDeliverables" in t && typeof t.getDeliverables == "function" ? { deliverables: await t.getDeliverables(r) } : { deliverables: [] };
|
|
5055
5082
|
}
|
|
5056
|
-
}),
|
|
5083
|
+
}), ur = $({
|
|
5057
5084
|
name: "create_deliverable",
|
|
5058
5085
|
title: "Create Deliverable",
|
|
5059
5086
|
description: "Create a deliverable in a project, optionally linking existing tasks by id. Use it for an output (a document, a build, an asset) that several tasks produce. For a dated checkpoint the schedule should enforce, create a task with `isMilestone: true` and a `deadline` instead. Returns the created deliverable.",
|
|
5060
5087
|
toolset: "collaboration",
|
|
5061
|
-
outputZodSchema:
|
|
5088
|
+
outputZodSchema: kn,
|
|
5062
5089
|
zodSchema: B({
|
|
5063
|
-
projectId:
|
|
5064
|
-
title:
|
|
5065
|
-
description:
|
|
5066
|
-
dueDate:
|
|
5067
|
-
taskIds: z(
|
|
5068
|
-
customFields: V(
|
|
5090
|
+
projectId: F().optional().describe("Project ID (falls back to ambient context if omitted)"),
|
|
5091
|
+
title: F().describe("Name of the deliverable"),
|
|
5092
|
+
description: F().optional().describe("What the deliverable is and how it is accepted"),
|
|
5093
|
+
dueDate: F().optional().describe("Due date (ISO string)"),
|
|
5094
|
+
taskIds: z(F()).optional().describe("IDs of existing tasks that feed this deliverable"),
|
|
5095
|
+
customFields: V(R()).optional().describe("Custom field values as a JSON object (validated against the project's field definitions for tasks)")
|
|
5069
5096
|
}),
|
|
5070
5097
|
execute: async (e, t, n) => {
|
|
5071
5098
|
let r = e.projectId || n?.projectId;
|
|
@@ -5076,43 +5103,43 @@ var tr = $({
|
|
|
5076
5103
|
});
|
|
5077
5104
|
throw Error("createDeliverable is not supported by this backend target.");
|
|
5078
5105
|
}
|
|
5079
|
-
}),
|
|
5106
|
+
}), dr = $({
|
|
5080
5107
|
name: "list_comments",
|
|
5081
5108
|
title: "List Comments",
|
|
5082
5109
|
description: "List the comments on a task. Use it to read the discussion, decisions or blockers recorded there. Returns { comments }.",
|
|
5083
5110
|
toolset: "collaboration",
|
|
5084
|
-
outputZodSchema: B({ comments: z(
|
|
5085
|
-
zodSchema: B({ taskId:
|
|
5111
|
+
outputZodSchema: B({ comments: z(jn) }),
|
|
5112
|
+
zodSchema: B({ taskId: F().describe("The task ID") }),
|
|
5086
5113
|
annotations: { readOnlyHint: !0 },
|
|
5087
5114
|
execute: async (e, t) => "getComments" in t && typeof t.getComments == "function" ? { comments: await t.getComments(e.taskId) } : { comments: [] }
|
|
5088
|
-
}),
|
|
5115
|
+
}), fr = $({
|
|
5089
5116
|
name: "add_comment",
|
|
5090
5117
|
title: "Add Comment",
|
|
5091
5118
|
description: "Post a comment on a task, attributed to the identity this server runs as. Use it to record a decision, status note, question or the reasoning behind a change you made. Returns the created comment.",
|
|
5092
5119
|
toolset: "collaboration",
|
|
5093
|
-
outputZodSchema:
|
|
5120
|
+
outputZodSchema: jn,
|
|
5094
5121
|
zodSchema: B({
|
|
5095
|
-
taskId:
|
|
5096
|
-
content:
|
|
5097
|
-
customFields: V(
|
|
5122
|
+
taskId: F().describe("The task ID"),
|
|
5123
|
+
content: F().describe("Comment body/markdown"),
|
|
5124
|
+
customFields: V(R()).optional().describe("Custom field values as a JSON object (validated against the project's field definitions for tasks)")
|
|
5098
5125
|
}),
|
|
5099
5126
|
execute: async (e, t) => t.addComment({
|
|
5100
5127
|
taskId: e.taskId,
|
|
5101
5128
|
content: e.content,
|
|
5102
5129
|
customFields: e.customFields
|
|
5103
5130
|
})
|
|
5104
|
-
}),
|
|
5131
|
+
}), pr = $({
|
|
5105
5132
|
name: "calculate_portfolio_critical_path",
|
|
5106
5133
|
title: "Calculate Portfolio Critical Path",
|
|
5107
5134
|
description: "Schedule several projects together (default: every project you can read) so people and teams shared between them are not double-booked. Use it for cross-project delivery dates and resource conflicts. Returns { projects, projectEndDate, overallocations } with one analysis per project. For a single project use `calculate_critical_path`.",
|
|
5108
5135
|
toolset: "scheduling",
|
|
5109
|
-
outputZodSchema:
|
|
5136
|
+
outputZodSchema: Fn,
|
|
5110
5137
|
zodSchema: B({
|
|
5111
|
-
projectIds: z(
|
|
5112
|
-
projectOrder: z(
|
|
5113
|
-
includeHiddenWork:
|
|
5138
|
+
projectIds: z(F()).optional().describe("Projects to include (default: every project you can read)"),
|
|
5139
|
+
projectOrder: z(F()).optional().describe("Project ids in priority order for levelling; unlisted projects come last"),
|
|
5140
|
+
includeHiddenWork: L().optional().describe("Also count other projects' work (even unreadable ones, shown only as 'hidden') toward people's capacity. Requires workspace.manage"),
|
|
5114
5141
|
calendars: H(["project", "assignee"]).optional().describe("'assignee' schedules each task on its assignee's or team's calendar"),
|
|
5115
|
-
levelResources:
|
|
5142
|
+
levelResources: L().optional().describe("With calendars 'assignee': share people and team pools across the projects"),
|
|
5116
5143
|
levelingPriority: H([
|
|
5117
5144
|
"slack",
|
|
5118
5145
|
"priority",
|
|
@@ -5123,14 +5150,12 @@ var tr = $({
|
|
|
5123
5150
|
}),
|
|
5124
5151
|
annotations: { readOnlyHint: !0 },
|
|
5125
5152
|
execute: async (e, t) => t.calculatePortfolioCriticalPath(e)
|
|
5126
|
-
}),
|
|
5127
|
-
qn,
|
|
5128
|
-
Jn,
|
|
5153
|
+
}), mr = [
|
|
5129
5154
|
Yn,
|
|
5130
5155
|
Xn,
|
|
5131
5156
|
Zn,
|
|
5132
|
-
|
|
5133
|
-
|
|
5157
|
+
Qn,
|
|
5158
|
+
$n,
|
|
5134
5159
|
rr,
|
|
5135
5160
|
ir,
|
|
5136
5161
|
ar,
|
|
@@ -5138,16 +5163,19 @@ var tr = $({
|
|
|
5138
5163
|
sr,
|
|
5139
5164
|
cr,
|
|
5140
5165
|
lr,
|
|
5166
|
+
ur,
|
|
5167
|
+
dr,
|
|
5168
|
+
fr,
|
|
5141
5169
|
$({
|
|
5142
5170
|
name: "calculate_critical_path",
|
|
5143
5171
|
title: "Calculate Critical Path",
|
|
5144
5172
|
description: "Schedule one project with the Critical Path Method: which tasks drive the end date, each task's early and late start and finish, and how much it can slip (slack). Use it for \"when will this finish?\", \"what is on the critical path?\" or \"can this task slip?\". Set calendars 'assignee' with levelResources so each person works on one task at a time. Returns { projectEndDate, criticalTaskIds, tasks, overallocations }. For several projects that share people use `calculate_portfolio_critical_path`.",
|
|
5145
5173
|
toolset: "scheduling",
|
|
5146
|
-
outputZodSchema:
|
|
5174
|
+
outputZodSchema: Pn,
|
|
5147
5175
|
zodSchema: B({
|
|
5148
|
-
projectId:
|
|
5176
|
+
projectId: F().optional().describe("Project ID (falls back to ambient context if omitted)"),
|
|
5149
5177
|
calendars: H(["project", "assignee"]).optional().describe("'assignee' schedules each task on its assignee's or team's working calendar; default uses the project calendar"),
|
|
5150
|
-
levelResources:
|
|
5178
|
+
levelResources: L().optional().describe("With calendars 'assignee': delay tasks so each assignee works on one task at a time"),
|
|
5151
5179
|
levelingPriority: H([
|
|
5152
5180
|
"slack",
|
|
5153
5181
|
"priority",
|
|
@@ -5169,23 +5197,23 @@ var tr = $({
|
|
|
5169
5197
|
});
|
|
5170
5198
|
}
|
|
5171
5199
|
}),
|
|
5172
|
-
|
|
5200
|
+
pr,
|
|
5173
5201
|
$({
|
|
5174
5202
|
name: "get_timeline_ladder",
|
|
5175
5203
|
title: "Get Timeline Ladder of Abstraction",
|
|
5176
5204
|
description: "Project status at three zoom levels: 'macro' phases with health (on_track, at_risk, blocked, overdue) and progress, 'standard' task timeline with the critical path and dependencies, and 'concrete' evidence of work (time logged, attachments) per task. Use it for project status reports; level 'macro' gives a compact summary. Returns { macro, standard, concrete }. For a single task use `get_task_ladder`.",
|
|
5177
5205
|
toolset: "analytics",
|
|
5178
|
-
outputZodSchema:
|
|
5206
|
+
outputZodSchema: Ln,
|
|
5179
5207
|
zodSchema: B({
|
|
5180
|
-
projectId:
|
|
5208
|
+
projectId: F().optional().describe("Project ID (falls back to ambient context if omitted)"),
|
|
5181
5209
|
level: H([
|
|
5182
5210
|
"macro",
|
|
5183
5211
|
"standard",
|
|
5184
5212
|
"concrete",
|
|
5185
5213
|
"all"
|
|
5186
5214
|
]).optional().describe("Abstraction level (macro, standard, concrete, or all)"),
|
|
5187
|
-
containerId:
|
|
5188
|
-
iterationId:
|
|
5215
|
+
containerId: F().optional().describe("Optional container ID filter"),
|
|
5216
|
+
iterationId: F().optional().describe("Optional iteration/sprint ID filter")
|
|
5189
5217
|
}),
|
|
5190
5218
|
annotations: { readOnlyHint: !0 },
|
|
5191
5219
|
execute: async (e, t, n) => {
|
|
@@ -5203,8 +5231,8 @@ var tr = $({
|
|
|
5203
5231
|
title: "Get Task Ladder View",
|
|
5204
5232
|
description: "One task in context: the phase it belongs to and that phase's health, its place in the schedule (dates, slack, critical or not) and evidence of work done. Use it to explain where a task fits and whether it puts its phase at risk. Returns { macroPhase, standard, concrete, metrics }. For the numbers alone use `get_task_metrics`.",
|
|
5205
5233
|
toolset: "analytics",
|
|
5206
|
-
outputZodSchema:
|
|
5207
|
-
zodSchema: B({ taskId:
|
|
5234
|
+
outputZodSchema: Rn,
|
|
5235
|
+
zodSchema: B({ taskId: F().describe("The task ID") }),
|
|
5208
5236
|
annotations: { readOnlyHint: !0 },
|
|
5209
5237
|
execute: async (e, t) => t.getTaskLadder(e.taskId)
|
|
5210
5238
|
}),
|
|
@@ -5213,8 +5241,8 @@ var tr = $({
|
|
|
5213
5241
|
title: "Get Task Metrics",
|
|
5214
5242
|
description: "Is a task on track? Progress percentage, actual against estimated hours, schedule variance, overdue flags and earned value (CPI, SPI). Use it to diagnose a late or over-budget task. Returns { progress, realityDelta, evm, inferredActuals, progressHistory }.",
|
|
5215
5243
|
toolset: "analytics",
|
|
5216
|
-
outputZodSchema:
|
|
5217
|
-
zodSchema: B({ taskId:
|
|
5244
|
+
outputZodSchema: Bn,
|
|
5245
|
+
zodSchema: B({ taskId: F().describe("The task ID") }),
|
|
5218
5246
|
annotations: { readOnlyHint: !0 },
|
|
5219
5247
|
execute: async (e, t) => t.getTaskMetrics(e.taskId)
|
|
5220
5248
|
}),
|
|
@@ -5223,8 +5251,8 @@ var tr = $({
|
|
|
5223
5251
|
title: "Get Task Progress History",
|
|
5224
5252
|
description: "How a task's progress has moved over time: dated progress points and a curve shape (linear, s_curve, early_surge, late_rush, stalled). Use it to tell whether work is stalling or being rushed at the end. Returns { points, curveProfile }. `get_task_metrics` includes the same history alongside variance and earned value.",
|
|
5225
5253
|
toolset: "analytics",
|
|
5226
|
-
outputZodSchema:
|
|
5227
|
-
zodSchema: B({ taskId:
|
|
5254
|
+
outputZodSchema: zn,
|
|
5255
|
+
zodSchema: B({ taskId: F().describe("The task ID") }),
|
|
5228
5256
|
annotations: { readOnlyHint: !0 },
|
|
5229
5257
|
execute: async (e, t) => t.getTaskProgressHistory(e.taskId)
|
|
5230
5258
|
}),
|
|
@@ -5233,11 +5261,11 @@ var tr = $({
|
|
|
5233
5261
|
title: "Get Workload Distribution",
|
|
5234
5262
|
description: "Hours of work per person, team, task type, priority or status in each day, week or month, with capacity and utilization. Use it for \"who is overloaded?\" and capacity planning; a utilizationRatio above 1 means more work than capacity. Omit projectId for the whole workspace. Returns { buckets, seriesKeys, seriesLabels, totalHours, averageUtilization }.",
|
|
5235
5263
|
toolset: "scheduling",
|
|
5236
|
-
outputZodSchema:
|
|
5264
|
+
outputZodSchema: Vn,
|
|
5237
5265
|
zodSchema: B({
|
|
5238
|
-
projectId:
|
|
5239
|
-
startDate:
|
|
5240
|
-
endDate:
|
|
5266
|
+
projectId: F().optional().describe("Project ID (optional, defaults to workspace-wide or ambient project)"),
|
|
5267
|
+
startDate: F().optional().describe("Start date ISO (YYYY-MM-DD)"),
|
|
5268
|
+
endDate: F().optional().describe("End date ISO (YYYY-MM-DD)"),
|
|
5241
5269
|
interval: H([
|
|
5242
5270
|
"day",
|
|
5243
5271
|
"week",
|
|
@@ -5256,7 +5284,7 @@ var tr = $({
|
|
|
5256
5284
|
"remaining",
|
|
5257
5285
|
"blended"
|
|
5258
5286
|
]).optional().describe("Effort metric mode"),
|
|
5259
|
-
defaultWeeklyCapacityHours:
|
|
5287
|
+
defaultWeeklyCapacityHours: I().optional().describe("Default weekly capacity hours per person (default 40)")
|
|
5260
5288
|
}),
|
|
5261
5289
|
annotations: { readOnlyHint: !0 },
|
|
5262
5290
|
execute: async (e, t, n) => {
|
|
@@ -5276,49 +5304,49 @@ var tr = $({
|
|
|
5276
5304
|
title: "Get Skill",
|
|
5277
5305
|
description: "Load a step-by-step playbook for a multi-step project management job, such as planning a project, triaging tasks, finding schedule risk, writing a status report, checking capacity or investigating a late task. Call it before starting such a job and follow its steps. Omit name to list the skills. Returns { name, description, content }, or { skills } without a name.",
|
|
5278
5306
|
toolset: "guidance",
|
|
5279
|
-
outputZodSchema:
|
|
5280
|
-
zodSchema: B({ name:
|
|
5307
|
+
outputZodSchema: Hn,
|
|
5308
|
+
zodSchema: B({ name: F().optional().describe("Skill name, e.g. \"plan-project\"; omit to list all skills") }),
|
|
5281
5309
|
annotations: { readOnlyHint: !0 },
|
|
5282
5310
|
execute: async (e) => {
|
|
5283
5311
|
if (!e.name) return { skills: Q.map(({ name: e, description: t }) => ({
|
|
5284
5312
|
name: e,
|
|
5285
5313
|
description: t
|
|
5286
5314
|
})) };
|
|
5287
|
-
let t =
|
|
5315
|
+
let t = Un(e.name);
|
|
5288
5316
|
if (!t) throw Error(`Skill "${e.name}" not found. Available skills: ${Q.map((e) => e.name).join(", ")}.`);
|
|
5289
5317
|
return t;
|
|
5290
5318
|
}
|
|
5291
5319
|
})
|
|
5292
|
-
],
|
|
5293
|
-
function
|
|
5294
|
-
let { tools: t, toolsets: n, readOnly: r } = e, i = (t ?? []).filter((e) => !
|
|
5295
|
-
if (i.length > 0) throw Error(`Unknown Critical Path tool(s): ${i.join(", ")}. Known tools: ${
|
|
5296
|
-
let a = (n ?? []).filter((e) => !(e in
|
|
5297
|
-
if (a.length > 0) throw Error(`Unknown Critical Path toolset(s): ${a.join(", ")}. Known toolsets: ${Object.keys(
|
|
5320
|
+
], hr = new Map(mr.map((e) => [e.name, e]));
|
|
5321
|
+
function gr(e = {}) {
|
|
5322
|
+
let { tools: t, toolsets: n, readOnly: r } = e, i = (t ?? []).filter((e) => !hr.has(e));
|
|
5323
|
+
if (i.length > 0) throw Error(`Unknown Critical Path tool(s): ${i.join(", ")}. Known tools: ${mr.map((e) => e.name).join(", ")}.`);
|
|
5324
|
+
let a = (n ?? []).filter((e) => !(e in Wn));
|
|
5325
|
+
if (a.length > 0) throw Error(`Unknown Critical Path toolset(s): ${a.join(", ")}. Known toolsets: ${Object.keys(Wn).join(", ")}.`);
|
|
5298
5326
|
let o = !t && !n;
|
|
5299
|
-
return
|
|
5327
|
+
return mr.filter((e) => (o || t?.includes(e.name) || n?.includes(e.toolset)) && (!r || e.annotations.readOnlyHint));
|
|
5300
5328
|
}
|
|
5301
|
-
var
|
|
5329
|
+
var _r = class extends Error {
|
|
5302
5330
|
constructor(e) {
|
|
5303
5331
|
super(e), this.name = "ToolNotFoundError";
|
|
5304
5332
|
}
|
|
5305
|
-
},
|
|
5306
|
-
async function
|
|
5333
|
+
}, vr = "Check the id: find valid project ids with `list_projects` and task ids with `list_tasks`. Ids are never guessable, and items you cannot read are reported as not found.";
|
|
5334
|
+
async function yr(e, t, n, r) {
|
|
5307
5335
|
try {
|
|
5308
|
-
let i = await e.execute(
|
|
5309
|
-
if (i == null) throw new
|
|
5336
|
+
let i = await e.execute(qn(e, t), n, r);
|
|
5337
|
+
if (i == null) throw new _r(`Nothing found for ${JSON.stringify(t ?? {})}.`);
|
|
5310
5338
|
return JSON.parse(JSON.stringify(i));
|
|
5311
5339
|
} catch (t) {
|
|
5312
|
-
throw Error(
|
|
5340
|
+
throw Error(br(e, t));
|
|
5313
5341
|
}
|
|
5314
5342
|
}
|
|
5315
|
-
function
|
|
5343
|
+
function br(e, t) {
|
|
5316
5344
|
let n = t?.message || String(t);
|
|
5317
|
-
return t instanceof
|
|
5345
|
+
return t instanceof Kn ? `${n}. Fix the arguments to match the input schema of "${e.name}" and call it again.` : t instanceof _r || t?.name === "NotFoundError" || t?.status === 404 || /not found/i.test(n) ? `${n} ${vr}` : t?.name === "CircularDependencyError" || /circular/i.test(n) ? `${n} The tasks are already ordered the other way round. Check with \`get_task\` and includeDependencies, and ask the user which order is right rather than retrying.` : t?.name === "ForbiddenError" || t?.status === 403 ? `${n} You do not have permission for this; tell the user rather than retrying.` : n;
|
|
5318
5346
|
}
|
|
5319
5347
|
//#endregion
|
|
5320
5348
|
//#region ../mcp/dist/tools/instructions.js
|
|
5321
|
-
var
|
|
5349
|
+
var xr = [
|
|
5322
5350
|
{
|
|
5323
5351
|
when: "Find a project or task id",
|
|
5324
5352
|
tools: ["list_projects", "list_tasks"]
|
|
@@ -5372,7 +5400,7 @@ var vr = [
|
|
|
5372
5400
|
tools: ["get_workload_distribution"]
|
|
5373
5401
|
}
|
|
5374
5402
|
];
|
|
5375
|
-
function
|
|
5403
|
+
function Sr(e, t = {}) {
|
|
5376
5404
|
let n = new Set(e.map((e) => e.name)), r = [
|
|
5377
5405
|
"Critical Path is a project management backend. A project holds tasks and deliverables (outputs that group the tasks producing them). Tasks have a workflow status, priority, assignee, effort estimate, logged hours, optional subtasks (parentId) and dependencies, and comments. A task with `isMilestone: true` is a zero-duration checkpoint, and a `deadline` on any task is enforced by critical path analysis.",
|
|
5378
5406
|
"",
|
|
@@ -5383,7 +5411,7 @@ function yr(e, t = {}) {
|
|
|
5383
5411
|
"- Confirm with the user before any tool marked destructive."
|
|
5384
5412
|
];
|
|
5385
5413
|
t.projectId && r.push(`- The user is viewing project "${t.projectId}"; tools use it when you omit projectId.`);
|
|
5386
|
-
let i =
|
|
5414
|
+
let i = xr.map((e) => ({
|
|
5387
5415
|
...e,
|
|
5388
5416
|
tools: e.tools.filter((e) => n.has(e))
|
|
5389
5417
|
})).filter((e) => e.tools.length > 0);
|
|
@@ -5399,7 +5427,7 @@ function yr(e, t = {}) {
|
|
|
5399
5427
|
}
|
|
5400
5428
|
//#endregion
|
|
5401
5429
|
//#region ../mcp/dist/web/index.js
|
|
5402
|
-
function
|
|
5430
|
+
function Cr(e = typeof document < "u" ? document : null) {
|
|
5403
5431
|
if (!e) return null;
|
|
5404
5432
|
if (!e.modelContext) {
|
|
5405
5433
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -5424,14 +5452,14 @@ function br(e = typeof document < "u" ? document : null) {
|
|
|
5424
5452
|
}
|
|
5425
5453
|
return e.modelContext;
|
|
5426
5454
|
}
|
|
5427
|
-
function
|
|
5455
|
+
function wr(e) {
|
|
5428
5456
|
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;
|
|
5429
|
-
t?.modelContext ? i = t.modelContext : n?.modelContext ? i = n.modelContext : t && (i =
|
|
5430
|
-
let a =
|
|
5457
|
+
t?.modelContext ? i = t.modelContext : n?.modelContext ? i = n.modelContext : t && (i = Cr(t) ?? void 0);
|
|
5458
|
+
let a = gr({
|
|
5431
5459
|
tools: e.tools,
|
|
5432
5460
|
toolsets: e.toolsets,
|
|
5433
5461
|
readOnly: e.readOnly
|
|
5434
|
-
}), o =
|
|
5462
|
+
}), o = Sr(a, { projectId: e.projectId }), s = [], c = new AbortController();
|
|
5435
5463
|
if (e.signal?.aborted) return {
|
|
5436
5464
|
unregister: () => {},
|
|
5437
5465
|
getRegisteredTools: () => [],
|
|
@@ -5447,7 +5475,7 @@ function xr(e) {
|
|
|
5447
5475
|
outputSchema: t.outputSchema,
|
|
5448
5476
|
annotations: { ...t.annotations },
|
|
5449
5477
|
execute: async (n) => {
|
|
5450
|
-
let r = e.projectId ? { projectId: e.projectId } : void 0, i = await
|
|
5478
|
+
let r = e.projectId ? { projectId: e.projectId } : void 0, i = await yr(t, n, e.client, r);
|
|
5451
5479
|
return e.onToolExecuted?.(t.name, n, i), i;
|
|
5452
5480
|
}
|
|
5453
5481
|
};
|
|
@@ -5477,7 +5505,7 @@ function xr(e) {
|
|
|
5477
5505
|
}
|
|
5478
5506
|
//#endregion
|
|
5479
5507
|
//#region src/webmcp-state.svelte.ts
|
|
5480
|
-
var
|
|
5508
|
+
var Tr = class {
|
|
5481
5509
|
client;
|
|
5482
5510
|
options;
|
|
5483
5511
|
#e = t.state(!1);
|
|
@@ -5524,7 +5552,7 @@ var Sr = class {
|
|
|
5524
5552
|
if (!this.registered) {
|
|
5525
5553
|
this.error = null;
|
|
5526
5554
|
try {
|
|
5527
|
-
this.abortController = new AbortController(), this.handle =
|
|
5555
|
+
this.abortController = new AbortController(), this.handle = wr({
|
|
5528
5556
|
client: this.client,
|
|
5529
5557
|
projectId: this.activeProjectId,
|
|
5530
5558
|
tools: this.options.tools,
|
|
@@ -5550,15 +5578,15 @@ var Sr = class {
|
|
|
5550
5578
|
this.activeProjectId !== e && (this.activeProjectId = e, this.registered && (this.unregister(), this.register()));
|
|
5551
5579
|
}
|
|
5552
5580
|
};
|
|
5553
|
-
function
|
|
5554
|
-
return new
|
|
5581
|
+
function Er(e, t) {
|
|
5582
|
+
return new Tr(e, t);
|
|
5555
5583
|
}
|
|
5556
5584
|
//#endregion
|
|
5557
5585
|
//#region src/critical-path-state.svelte.ts
|
|
5558
|
-
var
|
|
5586
|
+
var Dr = class {
|
|
5559
5587
|
client;
|
|
5560
5588
|
projectId;
|
|
5561
|
-
#e = new
|
|
5589
|
+
#e = new a();
|
|
5562
5590
|
#t = t.state(null);
|
|
5563
5591
|
get data() {
|
|
5564
5592
|
return t.get(this.#t);
|
|
@@ -5599,15 +5627,15 @@ var wr = class {
|
|
|
5599
5627
|
this.#e.cancel();
|
|
5600
5628
|
}
|
|
5601
5629
|
};
|
|
5602
|
-
function
|
|
5603
|
-
return new
|
|
5630
|
+
function Or(e, t) {
|
|
5631
|
+
return new Dr(e, t);
|
|
5604
5632
|
}
|
|
5605
5633
|
//#endregion
|
|
5606
5634
|
//#region src/timeline-ladder-state.svelte.ts
|
|
5607
|
-
var
|
|
5635
|
+
var kr = class {
|
|
5608
5636
|
client;
|
|
5609
5637
|
projectId;
|
|
5610
|
-
#e = new
|
|
5638
|
+
#e = new a();
|
|
5611
5639
|
#t = t.state(null);
|
|
5612
5640
|
get data() {
|
|
5613
5641
|
return t.get(this.#t);
|
|
@@ -5682,17 +5710,17 @@ var Er = class {
|
|
|
5682
5710
|
this.#e.cancel();
|
|
5683
5711
|
}
|
|
5684
5712
|
};
|
|
5685
|
-
function
|
|
5686
|
-
return new
|
|
5713
|
+
function Ar(e, t, n) {
|
|
5714
|
+
return new kr(e, t, n);
|
|
5687
5715
|
}
|
|
5688
5716
|
//#endregion
|
|
5689
5717
|
//#region src/task-metrics-state.svelte.ts
|
|
5690
|
-
var
|
|
5718
|
+
var jr = class {
|
|
5691
5719
|
client;
|
|
5692
5720
|
taskId;
|
|
5693
|
-
#e = new
|
|
5694
|
-
#t = new
|
|
5695
|
-
#n = new
|
|
5721
|
+
#e = new a();
|
|
5722
|
+
#t = new a();
|
|
5723
|
+
#n = new a();
|
|
5696
5724
|
#r = t.state(null);
|
|
5697
5725
|
get metrics() {
|
|
5698
5726
|
return t.get(this.#r);
|
|
@@ -5806,16 +5834,16 @@ var Or = class {
|
|
|
5806
5834
|
this.#e.cancel(), this.#t.cancel(), this.#n.cancel();
|
|
5807
5835
|
}
|
|
5808
5836
|
};
|
|
5809
|
-
function
|
|
5810
|
-
return new
|
|
5837
|
+
function Mr(e, t) {
|
|
5838
|
+
return new jr(e, t);
|
|
5811
5839
|
}
|
|
5812
5840
|
//#endregion
|
|
5813
5841
|
//#region src/workload-state.svelte.ts
|
|
5814
|
-
var
|
|
5842
|
+
var Nr = class {
|
|
5815
5843
|
client;
|
|
5816
5844
|
projectId;
|
|
5817
5845
|
initialOptions;
|
|
5818
|
-
#e = new
|
|
5846
|
+
#e = new a();
|
|
5819
5847
|
#t = t.state(null);
|
|
5820
5848
|
get data() {
|
|
5821
5849
|
return t.get(this.#t);
|
|
@@ -5934,13 +5962,13 @@ var Ar = class {
|
|
|
5934
5962
|
this.#e.cancel();
|
|
5935
5963
|
}
|
|
5936
5964
|
};
|
|
5937
|
-
function
|
|
5938
|
-
return new
|
|
5965
|
+
function Pr(e, t, n) {
|
|
5966
|
+
return new Nr(e, t, n);
|
|
5939
5967
|
}
|
|
5940
5968
|
//#endregion
|
|
5941
5969
|
//#region src/index.ts
|
|
5942
|
-
function
|
|
5970
|
+
function Fr(t) {
|
|
5943
5971
|
return new e(t);
|
|
5944
5972
|
}
|
|
5945
5973
|
//#endregion
|
|
5946
|
-
export {
|
|
5974
|
+
export { ae as AttachmentState, re as CommentState, Dr as CriticalPathState, le as DeliverableState, de as DeliverableSummaryState, pe as KanbanState, o as ProjectState, se as TaskActivityState, jr as TaskMetricsState, c as TaskState, he as TaskTransitionsState, kr as TimelineLadderState, Tr as WebMcpState, te as WorkflowState, Nr as WorkloadState, oe as createAttachmentState, ie as createCommentState, Fr as createCriticalPathClient, Or as createCriticalPathState, ue as createDeliverableState, fe as createDeliverableSummaryState, me as createKanbanState, s as createProjectState, ce as createTaskActivityState, Mr as createTaskMetricsState, ee as createTaskState, ge as createTaskTransitionsState, Ar as createTimelineLadderState, Er as createWebMcpState, ne as createWorkflowState, Pr as createWorkloadState };
|