@critical-path/svelte 0.15.9 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +55 -0
- package/dist/index.js +235 -209
- package/dist/kanban-state.svelte.d.ts +1 -1
- package/dist/task-state.svelte.d.ts +4 -2
- package/dist/task-state.svelte.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/index.test.ts +61 -0
- package/src/task-state.svelte.ts +94 -69
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 {
|
|
3
|
+
import { isTempTaskId as n, resolveStatusDefinition as r } from "@critical-path/core";
|
|
4
4
|
//#region src/project-state.svelte.ts
|
|
5
|
-
var
|
|
5
|
+
var i = class {
|
|
6
6
|
client;
|
|
7
7
|
#e = t.state(t.proxy([]));
|
|
8
8
|
get data() {
|
|
@@ -56,12 +56,12 @@ var r = class {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
-
function
|
|
60
|
-
return new
|
|
59
|
+
function a(e) {
|
|
60
|
+
return new i(e);
|
|
61
61
|
}
|
|
62
62
|
//#endregion
|
|
63
63
|
//#region src/task-state.svelte.ts
|
|
64
|
-
var
|
|
64
|
+
var o = class {
|
|
65
65
|
client;
|
|
66
66
|
projectId;
|
|
67
67
|
#e = t.state(t.proxy([]));
|
|
@@ -85,6 +85,8 @@ var a = class {
|
|
|
85
85
|
set error(e) {
|
|
86
86
|
t.set(this.#n, e, !0);
|
|
87
87
|
}
|
|
88
|
+
pendingCreations = /* @__PURE__ */ new Map();
|
|
89
|
+
tempToRealIdMap = /* @__PURE__ */ new Map();
|
|
88
90
|
constructor(e, t) {
|
|
89
91
|
this.client = e, this.projectId = t;
|
|
90
92
|
}
|
|
@@ -106,88 +108,97 @@ var a = class {
|
|
|
106
108
|
updatedAt: n
|
|
107
109
|
};
|
|
108
110
|
this.data = [...this.data, r];
|
|
111
|
+
let i = this.client.createTask(e);
|
|
112
|
+
this.pendingCreations.set(t, i);
|
|
109
113
|
try {
|
|
110
|
-
let
|
|
111
|
-
return this.data = this.data.map((
|
|
114
|
+
let e = await i;
|
|
115
|
+
return this.tempToRealIdMap.set(t, e.id), this.data = this.data.map((n) => n.id === t ? e : n), e;
|
|
112
116
|
} catch (e) {
|
|
113
117
|
this.data = this.data.filter((e) => e.id !== t);
|
|
114
118
|
let n = e instanceof Error ? e : Error(String(e));
|
|
115
119
|
throw this.error = n, n;
|
|
120
|
+
} finally {
|
|
121
|
+
this.pendingCreations.delete(t);
|
|
116
122
|
}
|
|
117
123
|
}
|
|
118
124
|
async updateTask(e, t) {
|
|
119
|
-
let
|
|
120
|
-
|
|
121
|
-
let
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
e[n] = r, this.data = e;
|
|
125
|
+
let r = e;
|
|
126
|
+
this.tempToRealIdMap.has(e) && (r = this.tempToRealIdMap.get(e));
|
|
127
|
+
let i = this.data.findIndex((t) => t.id === r || t.id === e), a;
|
|
128
|
+
if (i !== -1) {
|
|
129
|
+
a = this.data[i];
|
|
130
|
+
let e = {
|
|
131
|
+
...a,
|
|
132
|
+
...t,
|
|
133
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
134
|
+
}, n = [...this.data];
|
|
135
|
+
n[i] = e, this.data = n;
|
|
136
|
+
}
|
|
137
|
+
if (n(r)) {
|
|
138
|
+
let t = this.pendingCreations.get(r) || (this.pendingCreations.size === 1 ? Array.from(this.pendingCreations.values())[0] : void 0);
|
|
139
|
+
if (t) try {
|
|
140
|
+
let n = await t;
|
|
141
|
+
n && n.id && (r = n.id, this.tempToRealIdMap.set(e, r));
|
|
142
|
+
} catch {
|
|
143
|
+
throw Error(`Failed to update task: task creation failed for "${e}"`);
|
|
139
144
|
}
|
|
140
|
-
let i = t instanceof Error ? t : Error(String(t));
|
|
141
|
-
throw this.error = i, i;
|
|
142
145
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
let r = this.data[n], i = {
|
|
148
|
-
...r,
|
|
149
|
-
status: t,
|
|
150
|
-
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
151
|
-
}, a = [...this.data];
|
|
152
|
-
a[n] = i, this.data = a;
|
|
146
|
+
if (n(r)) return this.data.find((t) => t.id === r || t.id === e) || {
|
|
147
|
+
id: r,
|
|
148
|
+
...t
|
|
149
|
+
};
|
|
153
150
|
try {
|
|
154
|
-
let n = await this.client.updateTask(
|
|
155
|
-
if (
|
|
151
|
+
let n = await this.client.updateTask(r, t), i = this.data.findIndex((t) => t.id === r || t.id === e);
|
|
152
|
+
if (i !== -1) {
|
|
156
153
|
let e = [...this.data];
|
|
157
|
-
e[
|
|
154
|
+
e[i] = n, this.data = e;
|
|
158
155
|
}
|
|
159
156
|
return n;
|
|
160
157
|
} catch (t) {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
158
|
+
if (a) {
|
|
159
|
+
let t = this.data.findIndex((t) => t.id === r || t.id === e);
|
|
160
|
+
if (t !== -1) {
|
|
161
|
+
let e = [...this.data];
|
|
162
|
+
e[t] = a, this.data = e;
|
|
163
|
+
}
|
|
165
164
|
}
|
|
166
|
-
let
|
|
167
|
-
throw this.error =
|
|
165
|
+
let n = t instanceof Error ? t : Error(String(t));
|
|
166
|
+
throw this.error = n, n;
|
|
168
167
|
}
|
|
169
168
|
}
|
|
169
|
+
async updateTaskStatus(e, t) {
|
|
170
|
+
return this.updateTask(e, { status: t });
|
|
171
|
+
}
|
|
170
172
|
async deleteTask(e) {
|
|
171
|
-
let t =
|
|
172
|
-
|
|
173
|
-
let n = this.data[
|
|
174
|
-
this.data = this.data.filter((
|
|
173
|
+
let t = e;
|
|
174
|
+
this.tempToRealIdMap.has(e) && (t = this.tempToRealIdMap.get(e));
|
|
175
|
+
let r = this.data.findIndex((n) => n.id === t || n.id === e), i = r === -1 ? void 0 : this.data[r];
|
|
176
|
+
if (r !== -1 && (this.data = this.data.filter((n) => n.id !== t && n.id !== e)), n(t)) {
|
|
177
|
+
let e = this.pendingCreations.get(t);
|
|
178
|
+
if (e) try {
|
|
179
|
+
let t = await e;
|
|
180
|
+
t && t.id && await this.client.deleteTask(t.id);
|
|
181
|
+
} catch {}
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
175
184
|
try {
|
|
176
|
-
await this.client.deleteTask(
|
|
185
|
+
await this.client.deleteTask(t);
|
|
177
186
|
} catch (e) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
187
|
+
if (i && r !== -1) {
|
|
188
|
+
let e = [...this.data];
|
|
189
|
+
e.splice(r, 0, i), this.data = e;
|
|
190
|
+
}
|
|
191
|
+
let t = e instanceof Error ? e : Error(String(e));
|
|
192
|
+
throw this.error = t, t;
|
|
182
193
|
}
|
|
183
194
|
}
|
|
184
195
|
};
|
|
185
|
-
function
|
|
186
|
-
return new
|
|
196
|
+
function s(e, t) {
|
|
197
|
+
return new o(e, t);
|
|
187
198
|
}
|
|
188
199
|
//#endregion
|
|
189
200
|
//#region src/workflow-state.svelte.ts
|
|
190
|
-
var
|
|
201
|
+
var c = class {
|
|
191
202
|
client;
|
|
192
203
|
#e = t.state(t.proxy([]));
|
|
193
204
|
get data() {
|
|
@@ -250,12 +261,12 @@ var s = class {
|
|
|
250
261
|
}
|
|
251
262
|
}
|
|
252
263
|
};
|
|
253
|
-
function
|
|
254
|
-
return new
|
|
264
|
+
function ee(e) {
|
|
265
|
+
return new c(e);
|
|
255
266
|
}
|
|
256
267
|
//#endregion
|
|
257
268
|
//#region src/comment-state.svelte.ts
|
|
258
|
-
var
|
|
269
|
+
var te = class {
|
|
259
270
|
client;
|
|
260
271
|
taskId;
|
|
261
272
|
#e = t.state(t.proxy([]));
|
|
@@ -373,12 +384,12 @@ var ee = class {
|
|
|
373
384
|
}
|
|
374
385
|
}
|
|
375
386
|
};
|
|
376
|
-
function
|
|
377
|
-
return new
|
|
387
|
+
function ne(e, t) {
|
|
388
|
+
return new te(e, t);
|
|
378
389
|
}
|
|
379
390
|
//#endregion
|
|
380
391
|
//#region src/attachment-state.svelte.ts
|
|
381
|
-
var
|
|
392
|
+
var re = class {
|
|
382
393
|
client;
|
|
383
394
|
filter;
|
|
384
395
|
#e = t.state(t.proxy([]));
|
|
@@ -436,12 +447,12 @@ var ne = class {
|
|
|
436
447
|
}
|
|
437
448
|
}
|
|
438
449
|
};
|
|
439
|
-
function
|
|
440
|
-
return new
|
|
450
|
+
function ie(e, t) {
|
|
451
|
+
return new re(e, t);
|
|
441
452
|
}
|
|
442
453
|
//#endregion
|
|
443
454
|
//#region src/activity-state.svelte.ts
|
|
444
|
-
var
|
|
455
|
+
var ae = class {
|
|
445
456
|
client;
|
|
446
457
|
taskId;
|
|
447
458
|
#e = t.state(t.proxy([]));
|
|
@@ -598,12 +609,12 @@ var ie = class {
|
|
|
598
609
|
}
|
|
599
610
|
}
|
|
600
611
|
};
|
|
601
|
-
function
|
|
602
|
-
return new
|
|
612
|
+
function oe(e, t) {
|
|
613
|
+
return new ae(e, t);
|
|
603
614
|
}
|
|
604
615
|
//#endregion
|
|
605
616
|
//#region src/deliverable-state.svelte.ts
|
|
606
|
-
var
|
|
617
|
+
var se = class {
|
|
607
618
|
client;
|
|
608
619
|
projectId;
|
|
609
620
|
#e = t.state(t.proxy([]));
|
|
@@ -681,12 +692,12 @@ var oe = class {
|
|
|
681
692
|
return this.client.getDeliverableSummary(e);
|
|
682
693
|
}
|
|
683
694
|
};
|
|
684
|
-
function
|
|
685
|
-
return new
|
|
695
|
+
function ce(e, t) {
|
|
696
|
+
return new se(e, t);
|
|
686
697
|
}
|
|
687
698
|
//#endregion
|
|
688
699
|
//#region src/deliverable-summary-state.svelte.ts
|
|
689
|
-
var
|
|
700
|
+
var le = class {
|
|
690
701
|
client;
|
|
691
702
|
deliverableId;
|
|
692
703
|
#e = t.state(null);
|
|
@@ -732,12 +743,12 @@ var ce = class {
|
|
|
732
743
|
}
|
|
733
744
|
}
|
|
734
745
|
};
|
|
735
|
-
function
|
|
736
|
-
return new
|
|
746
|
+
function ue(e, t) {
|
|
747
|
+
return new le(e, t);
|
|
737
748
|
}
|
|
738
749
|
//#endregion
|
|
739
750
|
//#region src/kanban-state.svelte.ts
|
|
740
|
-
var
|
|
751
|
+
var de = class {
|
|
741
752
|
projectId;
|
|
742
753
|
options;
|
|
743
754
|
taskState;
|
|
@@ -762,9 +773,9 @@ var ue = class {
|
|
|
762
773
|
completed: [],
|
|
763
774
|
canceled: []
|
|
764
775
|
};
|
|
765
|
-
for (let
|
|
766
|
-
let e =
|
|
767
|
-
t[e] ? t[e].push(
|
|
776
|
+
for (let n of e) {
|
|
777
|
+
let e = n.semanticStatus || r(n.status, this.options?.customDefinitions).category;
|
|
778
|
+
t[e] ? t[e].push(n) : t.not_started.push(n);
|
|
768
779
|
}
|
|
769
780
|
return t;
|
|
770
781
|
}
|
|
@@ -781,7 +792,7 @@ var ue = class {
|
|
|
781
792
|
t.set(this.#e, e);
|
|
782
793
|
}
|
|
783
794
|
constructor(e, t, n = {}) {
|
|
784
|
-
this.projectId = t, this.options = n, this.taskState = new
|
|
795
|
+
this.projectId = t, this.options = n, this.taskState = new o(e, t);
|
|
785
796
|
}
|
|
786
797
|
async fetch() {
|
|
787
798
|
return this.taskState.fetch();
|
|
@@ -799,12 +810,12 @@ var ue = class {
|
|
|
799
810
|
return this.taskState.deleteTask(e);
|
|
800
811
|
}
|
|
801
812
|
};
|
|
802
|
-
function
|
|
803
|
-
return new
|
|
813
|
+
function fe(e, t, n) {
|
|
814
|
+
return new de(e, t, n);
|
|
804
815
|
}
|
|
805
816
|
//#endregion
|
|
806
817
|
//#region src/task-transitions-state.svelte.ts
|
|
807
|
-
var
|
|
818
|
+
var pe = class {
|
|
808
819
|
client;
|
|
809
820
|
taskId;
|
|
810
821
|
#e = t.state(t.proxy([]));
|
|
@@ -847,8 +858,8 @@ var fe = class {
|
|
|
847
858
|
}
|
|
848
859
|
}
|
|
849
860
|
};
|
|
850
|
-
function
|
|
851
|
-
return new
|
|
861
|
+
function me(e, t) {
|
|
862
|
+
return new pe(e, t);
|
|
852
863
|
}
|
|
853
864
|
//#endregion
|
|
854
865
|
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js
|
|
@@ -882,13 +893,13 @@ var l;
|
|
|
882
893
|
}
|
|
883
894
|
e.joinValues = r, e.jsonStringifyReplacer = (e, t) => typeof t == "bigint" ? t.toString() : t;
|
|
884
895
|
})(l ||= {});
|
|
885
|
-
var
|
|
896
|
+
var he;
|
|
886
897
|
(function(e) {
|
|
887
898
|
e.mergeShapes = (e, t) => ({
|
|
888
899
|
...e,
|
|
889
900
|
...t
|
|
890
901
|
});
|
|
891
|
-
})(
|
|
902
|
+
})(he ||= {});
|
|
892
903
|
var u = l.arrayToEnum([
|
|
893
904
|
"string",
|
|
894
905
|
"nan",
|
|
@@ -1054,13 +1065,13 @@ var m = (e, t) => {
|
|
|
1054
1065
|
default: n = t.defaultError, l.assertNever(e);
|
|
1055
1066
|
}
|
|
1056
1067
|
return { message: n };
|
|
1057
|
-
},
|
|
1058
|
-
function
|
|
1059
|
-
return
|
|
1068
|
+
}, ge = m;
|
|
1069
|
+
function _e() {
|
|
1070
|
+
return ge;
|
|
1060
1071
|
}
|
|
1061
1072
|
//#endregion
|
|
1062
1073
|
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
1063
|
-
var
|
|
1074
|
+
var ve = (e) => {
|
|
1064
1075
|
let { data: t, path: n, errorMaps: r, issueData: i } = e, a = [...n, ...i.path || []], o = {
|
|
1065
1076
|
...i,
|
|
1066
1077
|
path: a
|
|
@@ -1082,7 +1093,7 @@ var _e = (e) => {
|
|
|
1082
1093
|
};
|
|
1083
1094
|
};
|
|
1084
1095
|
function h(e, t) {
|
|
1085
|
-
let n =
|
|
1096
|
+
let n = _e(), r = ve({
|
|
1086
1097
|
issueData: t,
|
|
1087
1098
|
data: e.data,
|
|
1088
1099
|
path: e.path,
|
|
@@ -1139,13 +1150,13 @@ var g = class e {
|
|
|
1139
1150
|
value: n
|
|
1140
1151
|
};
|
|
1141
1152
|
}
|
|
1142
|
-
}, _ = Object.freeze({ status: "aborted" }),
|
|
1153
|
+
}, _ = Object.freeze({ status: "aborted" }), ye = (e) => ({
|
|
1143
1154
|
status: "dirty",
|
|
1144
1155
|
value: e
|
|
1145
1156
|
}), v = (e) => ({
|
|
1146
1157
|
status: "valid",
|
|
1147
1158
|
value: e
|
|
1148
|
-
}),
|
|
1159
|
+
}), be = (e) => e.status === "aborted", xe = (e) => e.status === "dirty", y = (e) => e.status === "valid", b = (e) => typeof Promise < "u" && e instanceof Promise, x;
|
|
1149
1160
|
(function(e) {
|
|
1150
1161
|
e.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, e.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
1151
1162
|
})(x ||= {});
|
|
@@ -1158,7 +1169,7 @@ var S = class {
|
|
|
1158
1169
|
get path() {
|
|
1159
1170
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
1160
1171
|
}
|
|
1161
|
-
},
|
|
1172
|
+
}, Se = (e, t) => {
|
|
1162
1173
|
if (y(t)) return {
|
|
1163
1174
|
success: !0,
|
|
1164
1175
|
data: t.value
|
|
@@ -1245,7 +1256,7 @@ var w = class {
|
|
|
1245
1256
|
data: e,
|
|
1246
1257
|
parsedType: d(e)
|
|
1247
1258
|
};
|
|
1248
|
-
return
|
|
1259
|
+
return Se(n, this._parseSync({
|
|
1249
1260
|
data: e,
|
|
1250
1261
|
path: n.path,
|
|
1251
1262
|
parent: n
|
|
@@ -1304,7 +1315,7 @@ var w = class {
|
|
|
1304
1315
|
path: n.path,
|
|
1305
1316
|
parent: n
|
|
1306
1317
|
});
|
|
1307
|
-
return
|
|
1318
|
+
return Se(n, await (b(r) ? r : Promise.resolve(r)));
|
|
1308
1319
|
}
|
|
1309
1320
|
refine(e, t) {
|
|
1310
1321
|
let n = (e) => typeof t == "string" || t === void 0 ? { message: t } : typeof t == "function" ? t(e) : t;
|
|
@@ -1381,7 +1392,7 @@ var w = class {
|
|
|
1381
1392
|
});
|
|
1382
1393
|
}
|
|
1383
1394
|
brand() {
|
|
1384
|
-
return new
|
|
1395
|
+
return new ct({
|
|
1385
1396
|
typeName: Y.ZodBranded,
|
|
1386
1397
|
type: this,
|
|
1387
1398
|
...C(this._def)
|
|
@@ -1404,7 +1415,7 @@ var w = class {
|
|
|
1404
1415
|
});
|
|
1405
1416
|
}
|
|
1406
1417
|
pipe(e) {
|
|
1407
|
-
return
|
|
1418
|
+
return lt.create(this, e);
|
|
1408
1419
|
}
|
|
1409
1420
|
readonly() {
|
|
1410
1421
|
return J.create(this);
|
|
@@ -1415,25 +1426,25 @@ var w = class {
|
|
|
1415
1426
|
isNullable() {
|
|
1416
1427
|
return this.safeParse(null).success;
|
|
1417
1428
|
}
|
|
1418
|
-
},
|
|
1419
|
-
function
|
|
1429
|
+
}, Ce = /^c[^\s-]{8,}$/i, we = /^[0-9a-z]+$/, Te = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Ee = /^[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, De = /^[a-z0-9_-]{21}$/i, Oe = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, ke = /^[-+]?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)?)??$/, Ae = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, je = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", Me, Ne = /^(?:(?: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])$/, Pe = /^(?:(?: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])$/, Fe = /^(([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]))$/, Ie = /^(([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])$/, Le = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Re = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, ze = "((\\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])))", Be = RegExp(`^${ze}$`);
|
|
1430
|
+
function Ve(e) {
|
|
1420
1431
|
let t = "[0-5]\\d";
|
|
1421
1432
|
e.precision ? t = `${t}\\.\\d{${e.precision}}` : e.precision ?? (t = `${t}(\\.\\d+)?`);
|
|
1422
1433
|
let n = e.precision ? "+" : "?";
|
|
1423
1434
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`;
|
|
1424
1435
|
}
|
|
1425
|
-
function Ve(e) {
|
|
1426
|
-
return RegExp(`^${Be(e)}$`);
|
|
1427
|
-
}
|
|
1428
1436
|
function He(e) {
|
|
1429
|
-
|
|
1430
|
-
return n.push(e.local ? "Z?" : "Z"), e.offset && n.push("([+-]\\d{2}:?\\d{2})"), t = `${t}(${n.join("|")})`, RegExp(`^${t}$`);
|
|
1437
|
+
return RegExp(`^${Ve(e)}$`);
|
|
1431
1438
|
}
|
|
1432
|
-
function Ue(e
|
|
1433
|
-
|
|
1439
|
+
function Ue(e) {
|
|
1440
|
+
let t = `${ze}T${Ve(e)}`, n = [];
|
|
1441
|
+
return n.push(e.local ? "Z?" : "Z"), e.offset && n.push("([+-]\\d{2}:?\\d{2})"), t = `${t}(${n.join("|")})`, RegExp(`^${t}$`);
|
|
1434
1442
|
}
|
|
1435
1443
|
function We(e, t) {
|
|
1436
|
-
|
|
1444
|
+
return !!((t === "v4" || !t) && Ne.test(e) || (t === "v6" || !t) && Fe.test(e));
|
|
1445
|
+
}
|
|
1446
|
+
function Ge(e, t) {
|
|
1447
|
+
if (!Oe.test(e)) return !1;
|
|
1437
1448
|
try {
|
|
1438
1449
|
let [n] = e.split(".");
|
|
1439
1450
|
if (!n) return !1;
|
|
@@ -1443,8 +1454,8 @@ function We(e, t) {
|
|
|
1443
1454
|
return !1;
|
|
1444
1455
|
}
|
|
1445
1456
|
}
|
|
1446
|
-
function
|
|
1447
|
-
return !!((t === "v4" || !t) &&
|
|
1457
|
+
function Ke(e, t) {
|
|
1458
|
+
return !!((t === "v4" || !t) && Pe.test(e) || (t === "v6" || !t) && Ie.test(e));
|
|
1448
1459
|
}
|
|
1449
1460
|
var T = class e extends w {
|
|
1450
1461
|
_parse(e) {
|
|
@@ -1490,37 +1501,37 @@ var T = class e extends w {
|
|
|
1490
1501
|
exact: !0,
|
|
1491
1502
|
message: r.message
|
|
1492
1503
|
}), t.dirty());
|
|
1493
|
-
} else if (r.kind === "email")
|
|
1504
|
+
} else if (r.kind === "email") Ae.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1494
1505
|
validation: "email",
|
|
1495
1506
|
code: f.invalid_string,
|
|
1496
1507
|
message: r.message
|
|
1497
1508
|
}), t.dirty());
|
|
1498
|
-
else if (r.kind === "emoji")
|
|
1509
|
+
else if (r.kind === "emoji") Me ||= new RegExp(je, "u"), Me.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1499
1510
|
validation: "emoji",
|
|
1500
1511
|
code: f.invalid_string,
|
|
1501
1512
|
message: r.message
|
|
1502
1513
|
}), t.dirty());
|
|
1503
|
-
else if (r.kind === "uuid")
|
|
1514
|
+
else if (r.kind === "uuid") Ee.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1504
1515
|
validation: "uuid",
|
|
1505
1516
|
code: f.invalid_string,
|
|
1506
1517
|
message: r.message
|
|
1507
1518
|
}), t.dirty());
|
|
1508
|
-
else if (r.kind === "nanoid")
|
|
1519
|
+
else if (r.kind === "nanoid") De.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1509
1520
|
validation: "nanoid",
|
|
1510
1521
|
code: f.invalid_string,
|
|
1511
1522
|
message: r.message
|
|
1512
1523
|
}), t.dirty());
|
|
1513
|
-
else if (r.kind === "cuid")
|
|
1524
|
+
else if (r.kind === "cuid") Ce.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1514
1525
|
validation: "cuid",
|
|
1515
1526
|
code: f.invalid_string,
|
|
1516
1527
|
message: r.message
|
|
1517
1528
|
}), t.dirty());
|
|
1518
|
-
else if (r.kind === "cuid2")
|
|
1529
|
+
else if (r.kind === "cuid2") we.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1519
1530
|
validation: "cuid2",
|
|
1520
1531
|
code: f.invalid_string,
|
|
1521
1532
|
message: r.message
|
|
1522
1533
|
}), t.dirty());
|
|
1523
|
-
else if (r.kind === "ulid")
|
|
1534
|
+
else if (r.kind === "ulid") Te.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1524
1535
|
validation: "ulid",
|
|
1525
1536
|
code: f.invalid_string,
|
|
1526
1537
|
message: r.message
|
|
@@ -1553,39 +1564,39 @@ var T = class e extends w {
|
|
|
1553
1564
|
code: f.invalid_string,
|
|
1554
1565
|
validation: { endsWith: r.value },
|
|
1555
1566
|
message: r.message
|
|
1556
|
-
}), t.dirty()) : r.kind === "datetime" ?
|
|
1567
|
+
}), t.dirty()) : r.kind === "datetime" ? Ue(r).test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1557
1568
|
code: f.invalid_string,
|
|
1558
1569
|
validation: "datetime",
|
|
1559
1570
|
message: r.message
|
|
1560
|
-
}), t.dirty()) : r.kind === "date" ?
|
|
1571
|
+
}), t.dirty()) : r.kind === "date" ? Be.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1561
1572
|
code: f.invalid_string,
|
|
1562
1573
|
validation: "date",
|
|
1563
1574
|
message: r.message
|
|
1564
|
-
}), t.dirty()) : r.kind === "time" ?
|
|
1575
|
+
}), t.dirty()) : r.kind === "time" ? He(r).test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1565
1576
|
code: f.invalid_string,
|
|
1566
1577
|
validation: "time",
|
|
1567
1578
|
message: r.message
|
|
1568
|
-
}), t.dirty()) : r.kind === "duration" ?
|
|
1579
|
+
}), t.dirty()) : r.kind === "duration" ? ke.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1569
1580
|
validation: "duration",
|
|
1570
1581
|
code: f.invalid_string,
|
|
1571
1582
|
message: r.message
|
|
1572
|
-
}), t.dirty()) : r.kind === "ip" ?
|
|
1583
|
+
}), t.dirty()) : r.kind === "ip" ? We(e.data, r.version) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1573
1584
|
validation: "ip",
|
|
1574
1585
|
code: f.invalid_string,
|
|
1575
1586
|
message: r.message
|
|
1576
|
-
}), t.dirty()) : r.kind === "jwt" ?
|
|
1587
|
+
}), t.dirty()) : r.kind === "jwt" ? Ge(e.data, r.alg) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1577
1588
|
validation: "jwt",
|
|
1578
1589
|
code: f.invalid_string,
|
|
1579
1590
|
message: r.message
|
|
1580
|
-
}), t.dirty()) : r.kind === "cidr" ?
|
|
1591
|
+
}), t.dirty()) : r.kind === "cidr" ? Ke(e.data, r.version) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1581
1592
|
validation: "cidr",
|
|
1582
1593
|
code: f.invalid_string,
|
|
1583
1594
|
message: r.message
|
|
1584
|
-
}), t.dirty()) : r.kind === "base64" ?
|
|
1595
|
+
}), t.dirty()) : r.kind === "base64" ? Le.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1585
1596
|
validation: "base64",
|
|
1586
1597
|
code: f.invalid_string,
|
|
1587
1598
|
message: r.message
|
|
1588
|
-
}), t.dirty()) : r.kind === "base64url" ?
|
|
1599
|
+
}), t.dirty()) : r.kind === "base64url" ? Re.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1589
1600
|
validation: "base64url",
|
|
1590
1601
|
code: f.invalid_string,
|
|
1591
1602
|
message: r.message
|
|
@@ -1860,11 +1871,11 @@ T.create = (e) => new T({
|
|
|
1860
1871
|
coerce: e?.coerce ?? !1,
|
|
1861
1872
|
...C(e)
|
|
1862
1873
|
});
|
|
1863
|
-
function
|
|
1874
|
+
function qe(e, t) {
|
|
1864
1875
|
let n = (e.toString().split(".")[1] || "").length, r = (t.toString().split(".")[1] || "").length, i = n > r ? n : r;
|
|
1865
1876
|
return Number.parseInt(e.toFixed(i).replace(".", "")) % Number.parseInt(t.toFixed(i).replace(".", "")) / 10 ** i;
|
|
1866
1877
|
}
|
|
1867
|
-
var
|
|
1878
|
+
var Je = class e extends w {
|
|
1868
1879
|
constructor() {
|
|
1869
1880
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1870
1881
|
}
|
|
@@ -1897,7 +1908,7 @@ var qe = class e extends w {
|
|
|
1897
1908
|
inclusive: r.inclusive,
|
|
1898
1909
|
exact: !1,
|
|
1899
1910
|
message: r.message
|
|
1900
|
-
}), n.dirty()) : r.kind === "multipleOf" ?
|
|
1911
|
+
}), n.dirty()) : r.kind === "multipleOf" ? qe(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), h(t, {
|
|
1901
1912
|
code: f.not_multiple_of,
|
|
1902
1913
|
multipleOf: r.value,
|
|
1903
1914
|
message: r.message
|
|
@@ -2023,13 +2034,13 @@ var qe = class e extends w {
|
|
|
2023
2034
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
2024
2035
|
}
|
|
2025
2036
|
};
|
|
2026
|
-
|
|
2037
|
+
Je.create = (e) => new Je({
|
|
2027
2038
|
checks: [],
|
|
2028
2039
|
typeName: Y.ZodNumber,
|
|
2029
2040
|
coerce: e?.coerce || !1,
|
|
2030
2041
|
...C(e)
|
|
2031
2042
|
});
|
|
2032
|
-
var
|
|
2043
|
+
var Ye = class e extends w {
|
|
2033
2044
|
constructor() {
|
|
2034
2045
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
2035
2046
|
}
|
|
@@ -2150,13 +2161,13 @@ var Je = class e extends w {
|
|
|
2150
2161
|
return e;
|
|
2151
2162
|
}
|
|
2152
2163
|
};
|
|
2153
|
-
|
|
2164
|
+
Ye.create = (e) => new Ye({
|
|
2154
2165
|
checks: [],
|
|
2155
2166
|
typeName: Y.ZodBigInt,
|
|
2156
2167
|
coerce: e?.coerce ?? !1,
|
|
2157
2168
|
...C(e)
|
|
2158
2169
|
});
|
|
2159
|
-
var
|
|
2170
|
+
var E = class extends w {
|
|
2160
2171
|
_parse(e) {
|
|
2161
2172
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== u.boolean) {
|
|
2162
2173
|
let t = this._getOrReturnCtx(e);
|
|
@@ -2169,7 +2180,7 @@ var Ye = class extends w {
|
|
|
2169
2180
|
return v(e.data);
|
|
2170
2181
|
}
|
|
2171
2182
|
};
|
|
2172
|
-
|
|
2183
|
+
E.create = (e) => new E({
|
|
2173
2184
|
typeName: Y.ZodBoolean,
|
|
2174
2185
|
coerce: e?.coerce || !1,
|
|
2175
2186
|
...C(e)
|
|
@@ -2260,7 +2271,7 @@ Ze.create = (e) => new Ze({
|
|
|
2260
2271
|
typeName: Y.ZodSymbol,
|
|
2261
2272
|
...C(e)
|
|
2262
2273
|
});
|
|
2263
|
-
var
|
|
2274
|
+
var D = class extends w {
|
|
2264
2275
|
_parse(e) {
|
|
2265
2276
|
if (this._getType(e) !== u.undefined) {
|
|
2266
2277
|
let t = this._getOrReturnCtx(e);
|
|
@@ -2273,11 +2284,11 @@ var E = class extends w {
|
|
|
2273
2284
|
return v(e.data);
|
|
2274
2285
|
}
|
|
2275
2286
|
};
|
|
2276
|
-
|
|
2287
|
+
D.create = (e) => new D({
|
|
2277
2288
|
typeName: Y.ZodUndefined,
|
|
2278
2289
|
...C(e)
|
|
2279
2290
|
});
|
|
2280
|
-
var
|
|
2291
|
+
var O = class extends w {
|
|
2281
2292
|
_parse(e) {
|
|
2282
2293
|
if (this._getType(e) !== u.null) {
|
|
2283
2294
|
let t = this._getOrReturnCtx(e);
|
|
@@ -2290,11 +2301,11 @@ var D = class extends w {
|
|
|
2290
2301
|
return v(e.data);
|
|
2291
2302
|
}
|
|
2292
2303
|
};
|
|
2293
|
-
|
|
2304
|
+
O.create = (e) => new O({
|
|
2294
2305
|
typeName: Y.ZodNull,
|
|
2295
2306
|
...C(e)
|
|
2296
2307
|
});
|
|
2297
|
-
var
|
|
2308
|
+
var Qe = class extends w {
|
|
2298
2309
|
constructor() {
|
|
2299
2310
|
super(...arguments), this._any = !0;
|
|
2300
2311
|
}
|
|
@@ -2302,7 +2313,7 @@ var O = class extends w {
|
|
|
2302
2313
|
return v(e.data);
|
|
2303
2314
|
}
|
|
2304
2315
|
};
|
|
2305
|
-
|
|
2316
|
+
Qe.create = (e) => new Qe({
|
|
2306
2317
|
typeName: Y.ZodAny,
|
|
2307
2318
|
...C(e)
|
|
2308
2319
|
});
|
|
@@ -2332,7 +2343,7 @@ A.create = (e) => new A({
|
|
|
2332
2343
|
typeName: Y.ZodNever,
|
|
2333
2344
|
...C(e)
|
|
2334
2345
|
});
|
|
2335
|
-
var
|
|
2346
|
+
var $e = class extends w {
|
|
2336
2347
|
_parse(e) {
|
|
2337
2348
|
if (this._getType(e) !== u.undefined) {
|
|
2338
2349
|
let t = this._getOrReturnCtx(e);
|
|
@@ -2345,7 +2356,7 @@ var Qe = class extends w {
|
|
|
2345
2356
|
return v(e.data);
|
|
2346
2357
|
}
|
|
2347
2358
|
};
|
|
2348
|
-
|
|
2359
|
+
$e.create = (e) => new $e({
|
|
2349
2360
|
typeName: Y.ZodVoid,
|
|
2350
2361
|
...C(e)
|
|
2351
2362
|
});
|
|
@@ -2623,7 +2634,7 @@ var N = class e extends w {
|
|
|
2623
2634
|
});
|
|
2624
2635
|
}
|
|
2625
2636
|
keyof() {
|
|
2626
|
-
return
|
|
2637
|
+
return ot(l.objectKeys(this.shape));
|
|
2627
2638
|
}
|
|
2628
2639
|
};
|
|
2629
2640
|
N.create = (e, t) => new N({
|
|
@@ -2713,7 +2724,7 @@ P.create = (e, t) => new P({
|
|
|
2713
2724
|
typeName: Y.ZodUnion,
|
|
2714
2725
|
...C(t)
|
|
2715
2726
|
});
|
|
2716
|
-
var F = (e) => e instanceof R ? F(e.schema) : e instanceof U ? F(e.innerType()) : e instanceof z ? [e.value] : e instanceof B ? e.options : e instanceof V ? l.objectValues(e.enum) : e instanceof K ? F(e._def.innerType) : e instanceof
|
|
2727
|
+
var F = (e) => e instanceof R ? F(e.schema) : e instanceof U ? F(e.innerType()) : e instanceof z ? [e.value] : e instanceof B ? e.options : e instanceof V ? l.objectValues(e.enum) : e instanceof K ? F(e._def.innerType) : e instanceof D ? [void 0] : e instanceof O ? [null] : e instanceof W ? [void 0, ...F(e.unwrap())] : e instanceof G ? [null, ...F(e.unwrap())] : e instanceof ct || e instanceof J ? F(e.unwrap()) : e instanceof q ? F(e._def.innerType) : [], et = class e extends w {
|
|
2717
2728
|
_parse(e) {
|
|
2718
2729
|
let { ctx: t } = this._processInputParams(e);
|
|
2719
2730
|
if (t.parsedType !== u.object) return h(t, {
|
|
@@ -2764,7 +2775,7 @@ var F = (e) => e instanceof R ? F(e.schema) : e instanceof U ? F(e.innerType())
|
|
|
2764
2775
|
});
|
|
2765
2776
|
}
|
|
2766
2777
|
};
|
|
2767
|
-
function
|
|
2778
|
+
function tt(e, t) {
|
|
2768
2779
|
let n = d(e), r = d(t);
|
|
2769
2780
|
if (e === t) return {
|
|
2770
2781
|
valid: !0,
|
|
@@ -2776,7 +2787,7 @@ function et(e, t) {
|
|
|
2776
2787
|
...t
|
|
2777
2788
|
};
|
|
2778
2789
|
for (let n of r) {
|
|
2779
|
-
let r =
|
|
2790
|
+
let r = tt(e[n], t[n]);
|
|
2780
2791
|
if (!r.valid) return { valid: !1 };
|
|
2781
2792
|
i[n] = r.data;
|
|
2782
2793
|
}
|
|
@@ -2789,7 +2800,7 @@ function et(e, t) {
|
|
|
2789
2800
|
if (e.length !== t.length) return { valid: !1 };
|
|
2790
2801
|
let n = [];
|
|
2791
2802
|
for (let r = 0; r < e.length; r++) {
|
|
2792
|
-
let i = e[r], a = t[r], o =
|
|
2803
|
+
let i = e[r], a = t[r], o = tt(i, a);
|
|
2793
2804
|
if (!o.valid) return { valid: !1 };
|
|
2794
2805
|
n.push(o.data);
|
|
2795
2806
|
}
|
|
@@ -2806,9 +2817,9 @@ function et(e, t) {
|
|
|
2806
2817
|
var I = class extends w {
|
|
2807
2818
|
_parse(e) {
|
|
2808
2819
|
let { status: t, ctx: n } = this._processInputParams(e), r = (e, r) => {
|
|
2809
|
-
if (
|
|
2810
|
-
let i =
|
|
2811
|
-
return i.valid ? ((
|
|
2820
|
+
if (be(e) || be(r)) return _;
|
|
2821
|
+
let i = tt(e.value, r.value);
|
|
2822
|
+
return i.valid ? ((xe(e) || xe(r)) && t.dirty(), {
|
|
2812
2823
|
status: t.value,
|
|
2813
2824
|
value: i.data
|
|
2814
2825
|
}) : (h(n, { code: f.invalid_intersection_types }), _);
|
|
@@ -2885,7 +2896,7 @@ L.create = (e, t) => {
|
|
|
2885
2896
|
...C(t)
|
|
2886
2897
|
});
|
|
2887
2898
|
};
|
|
2888
|
-
var
|
|
2899
|
+
var nt = class e extends w {
|
|
2889
2900
|
get keySchema() {
|
|
2890
2901
|
return this._def.keyType;
|
|
2891
2902
|
}
|
|
@@ -2923,7 +2934,7 @@ var tt = class e extends w {
|
|
|
2923
2934
|
...C(n)
|
|
2924
2935
|
});
|
|
2925
2936
|
}
|
|
2926
|
-
},
|
|
2937
|
+
}, rt = class extends w {
|
|
2927
2938
|
get keySchema() {
|
|
2928
2939
|
return this._def.keyType;
|
|
2929
2940
|
}
|
|
@@ -2969,13 +2980,13 @@ var tt = class e extends w {
|
|
|
2969
2980
|
}
|
|
2970
2981
|
}
|
|
2971
2982
|
};
|
|
2972
|
-
|
|
2983
|
+
rt.create = (e, t, n) => new rt({
|
|
2973
2984
|
valueType: t,
|
|
2974
2985
|
keyType: e,
|
|
2975
2986
|
typeName: Y.ZodMap,
|
|
2976
2987
|
...C(n)
|
|
2977
2988
|
});
|
|
2978
|
-
var
|
|
2989
|
+
var it = class e extends w {
|
|
2979
2990
|
_parse(e) {
|
|
2980
2991
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2981
2992
|
if (n.parsedType !== u.set) return h(n, {
|
|
@@ -3039,14 +3050,14 @@ var rt = class e extends w {
|
|
|
3039
3050
|
return this.min(1, e);
|
|
3040
3051
|
}
|
|
3041
3052
|
};
|
|
3042
|
-
|
|
3053
|
+
it.create = (e, t) => new it({
|
|
3043
3054
|
valueType: e,
|
|
3044
3055
|
minSize: null,
|
|
3045
3056
|
maxSize: null,
|
|
3046
3057
|
typeName: Y.ZodSet,
|
|
3047
3058
|
...C(t)
|
|
3048
3059
|
});
|
|
3049
|
-
var
|
|
3060
|
+
var at = class e extends w {
|
|
3050
3061
|
constructor() {
|
|
3051
3062
|
super(...arguments), this.validate = this.implement;
|
|
3052
3063
|
}
|
|
@@ -3058,13 +3069,13 @@ var it = class e extends w {
|
|
|
3058
3069
|
received: t.parsedType
|
|
3059
3070
|
}), _;
|
|
3060
3071
|
function n(e, n) {
|
|
3061
|
-
return
|
|
3072
|
+
return ve({
|
|
3062
3073
|
data: e,
|
|
3063
3074
|
path: t.path,
|
|
3064
3075
|
errorMaps: [
|
|
3065
3076
|
t.common.contextualErrorMap,
|
|
3066
3077
|
t.schemaErrorMap,
|
|
3067
|
-
|
|
3078
|
+
_e(),
|
|
3068
3079
|
m
|
|
3069
3080
|
].filter((e) => !!e),
|
|
3070
3081
|
issueData: {
|
|
@@ -3074,13 +3085,13 @@ var it = class e extends w {
|
|
|
3074
3085
|
});
|
|
3075
3086
|
}
|
|
3076
3087
|
function r(e, n) {
|
|
3077
|
-
return
|
|
3088
|
+
return ve({
|
|
3078
3089
|
data: e,
|
|
3079
3090
|
path: t.path,
|
|
3080
3091
|
errorMaps: [
|
|
3081
3092
|
t.common.contextualErrorMap,
|
|
3082
3093
|
t.schemaErrorMap,
|
|
3083
|
-
|
|
3094
|
+
_e(),
|
|
3084
3095
|
m
|
|
3085
3096
|
].filter((e) => !!e),
|
|
3086
3097
|
issueData: {
|
|
@@ -3186,7 +3197,7 @@ z.create = (e, t) => new z({
|
|
|
3186
3197
|
typeName: Y.ZodLiteral,
|
|
3187
3198
|
...C(t)
|
|
3188
3199
|
});
|
|
3189
|
-
function
|
|
3200
|
+
function ot(e, t) {
|
|
3190
3201
|
return new B({
|
|
3191
3202
|
values: e,
|
|
3192
3203
|
typeName: Y.ZodEnum,
|
|
@@ -3244,7 +3255,7 @@ var B = class e extends w {
|
|
|
3244
3255
|
});
|
|
3245
3256
|
}
|
|
3246
3257
|
};
|
|
3247
|
-
B.create =
|
|
3258
|
+
B.create = ot;
|
|
3248
3259
|
var V = class extends w {
|
|
3249
3260
|
_parse(e) {
|
|
3250
3261
|
let t = l.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
@@ -3321,7 +3332,7 @@ var U = class extends w {
|
|
|
3321
3332
|
path: n.path,
|
|
3322
3333
|
parent: n
|
|
3323
3334
|
});
|
|
3324
|
-
return r.status === "aborted" ? _ : r.status === "dirty" || t.value === "dirty" ?
|
|
3335
|
+
return r.status === "aborted" ? _ : r.status === "dirty" || t.value === "dirty" ? ye(r.value) : r;
|
|
3325
3336
|
});
|
|
3326
3337
|
{
|
|
3327
3338
|
if (t.value === "aborted") return _;
|
|
@@ -3330,7 +3341,7 @@ var U = class extends w {
|
|
|
3330
3341
|
path: n.path,
|
|
3331
3342
|
parent: n
|
|
3332
3343
|
});
|
|
3333
|
-
return r.status === "aborted" ? _ : r.status === "dirty" || t.value === "dirty" ?
|
|
3344
|
+
return r.status === "aborted" ? _ : r.status === "dirty" || t.value === "dirty" ? ye(r.value) : r;
|
|
3334
3345
|
}
|
|
3335
3346
|
}
|
|
3336
3347
|
if (r.type === "refinement") {
|
|
@@ -3487,7 +3498,7 @@ q.create = (e, t) => new q({
|
|
|
3487
3498
|
catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
|
|
3488
3499
|
...C(t)
|
|
3489
3500
|
});
|
|
3490
|
-
var
|
|
3501
|
+
var st = class extends w {
|
|
3491
3502
|
_parse(e) {
|
|
3492
3503
|
if (this._getType(e) !== u.nan) {
|
|
3493
3504
|
let t = this._getOrReturnCtx(e);
|
|
@@ -3503,11 +3514,11 @@ var ot = class extends w {
|
|
|
3503
3514
|
};
|
|
3504
3515
|
}
|
|
3505
3516
|
};
|
|
3506
|
-
|
|
3517
|
+
st.create = (e) => new st({
|
|
3507
3518
|
typeName: Y.ZodNaN,
|
|
3508
3519
|
...C(e)
|
|
3509
3520
|
});
|
|
3510
|
-
var
|
|
3521
|
+
var ct = class extends w {
|
|
3511
3522
|
_parse(e) {
|
|
3512
3523
|
let { ctx: t } = this._processInputParams(e), n = t.data;
|
|
3513
3524
|
return this._def.type._parse({
|
|
@@ -3519,7 +3530,7 @@ var st = class extends w {
|
|
|
3519
3530
|
unwrap() {
|
|
3520
3531
|
return this._def.type;
|
|
3521
3532
|
}
|
|
3522
|
-
},
|
|
3533
|
+
}, lt = class e extends w {
|
|
3523
3534
|
_parse(e) {
|
|
3524
3535
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
3525
3536
|
if (n.common.async) return (async () => {
|
|
@@ -3528,7 +3539,7 @@ var st = class extends w {
|
|
|
3528
3539
|
path: n.path,
|
|
3529
3540
|
parent: n
|
|
3530
3541
|
});
|
|
3531
|
-
return e.status === "aborted" ? _ : e.status === "dirty" ? (t.dirty(),
|
|
3542
|
+
return e.status === "aborted" ? _ : e.status === "dirty" ? (t.dirty(), ye(e.value)) : this._def.out._parseAsync({
|
|
3532
3543
|
data: e.value,
|
|
3533
3544
|
path: n.path,
|
|
3534
3545
|
parent: n
|
|
@@ -3575,15 +3586,30 @@ var Y;
|
|
|
3575
3586
|
(function(e) {
|
|
3576
3587
|
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";
|
|
3577
3588
|
})(Y ||= {});
|
|
3578
|
-
var X = T.create, Z =
|
|
3579
|
-
|
|
3580
|
-
var
|
|
3581
|
-
Xe.create, Ze.create,
|
|
3582
|
-
var
|
|
3583
|
-
N.strictCreate, P.create,
|
|
3589
|
+
var X = T.create, Z = Je.create;
|
|
3590
|
+
st.create, Ye.create;
|
|
3591
|
+
var ut = E.create;
|
|
3592
|
+
Xe.create, Ze.create, D.create, O.create, Qe.create, k.create, A.create, $e.create;
|
|
3593
|
+
var dt = j.create, Q = N.create;
|
|
3594
|
+
N.strictCreate, P.create, et.create, I.create, L.create, nt.create, rt.create, it.create, at.create, R.create, z.create;
|
|
3584
3595
|
var $ = B.create;
|
|
3585
|
-
V.create, H.create, U.create, W.create, G.create, U.createWithPreprocess,
|
|
3586
|
-
|
|
3596
|
+
V.create, H.create, U.create, W.create, G.create, U.createWithPreprocess, lt.create;
|
|
3597
|
+
//#endregion
|
|
3598
|
+
//#region ../mcp/dist/tools/definitions.js
|
|
3599
|
+
var ft = class extends Error {
|
|
3600
|
+
constructor(e, t) {
|
|
3601
|
+
super(`Invalid arguments for tool "${e}": ${t}`), this.name = "ToolArgumentError";
|
|
3602
|
+
}
|
|
3603
|
+
};
|
|
3604
|
+
function pt(e, t) {
|
|
3605
|
+
let n = e.zodSchema.safeParse(t ?? {});
|
|
3606
|
+
if (!n.success) {
|
|
3607
|
+
let t = n.error.issues.map((e) => `${e.path.join(".") || "(root)"}: ${e.message}`).join("; ");
|
|
3608
|
+
throw new ft(e.name, t);
|
|
3609
|
+
}
|
|
3610
|
+
return n.data;
|
|
3611
|
+
}
|
|
3612
|
+
var mt = [
|
|
3587
3613
|
{
|
|
3588
3614
|
name: "list_projects",
|
|
3589
3615
|
title: "List Projects",
|
|
@@ -3730,9 +3756,9 @@ var dt = [
|
|
|
3730
3756
|
]).optional().default("none").describe("Task priority"),
|
|
3731
3757
|
assigneeId: X().optional().describe("User ID to assign task to"),
|
|
3732
3758
|
dueDate: X().optional().describe("Due date (ISO string)"),
|
|
3733
|
-
tags:
|
|
3759
|
+
tags: dt(X()).optional().describe("Tags for categorization"),
|
|
3734
3760
|
estimatedHours: Z().optional().describe("Estimated hours to complete"),
|
|
3735
|
-
isBlocked:
|
|
3761
|
+
isBlocked: ut().optional().describe("Whether the task is blocked"),
|
|
3736
3762
|
blockedReason: X().optional().describe("Reason why the task is blocked")
|
|
3737
3763
|
}),
|
|
3738
3764
|
inputSchema: {
|
|
@@ -3826,10 +3852,10 @@ var dt = [
|
|
|
3826
3852
|
]).optional(),
|
|
3827
3853
|
assigneeId: X().optional(),
|
|
3828
3854
|
dueDate: X().optional(),
|
|
3829
|
-
tags:
|
|
3855
|
+
tags: dt(X()).optional(),
|
|
3830
3856
|
estimatedHours: Z().optional(),
|
|
3831
3857
|
loggedHours: Z().optional(),
|
|
3832
|
-
isBlocked:
|
|
3858
|
+
isBlocked: ut().optional(),
|
|
3833
3859
|
blockedReason: X().optional()
|
|
3834
3860
|
}),
|
|
3835
3861
|
inputSchema: {
|
|
@@ -3923,7 +3949,7 @@ var dt = [
|
|
|
3923
3949
|
title: X(),
|
|
3924
3950
|
description: X().optional(),
|
|
3925
3951
|
dueDate: X().optional(),
|
|
3926
|
-
taskIds:
|
|
3952
|
+
taskIds: dt(X()).optional()
|
|
3927
3953
|
}),
|
|
3928
3954
|
inputSchema: {
|
|
3929
3955
|
type: "object",
|
|
@@ -4224,10 +4250,10 @@ var dt = [
|
|
|
4224
4250
|
}
|
|
4225
4251
|
}
|
|
4226
4252
|
];
|
|
4227
|
-
new Map(
|
|
4253
|
+
new Map(mt.map((e) => [e.name, e]));
|
|
4228
4254
|
//#endregion
|
|
4229
4255
|
//#region ../mcp/dist/web/index.js
|
|
4230
|
-
function
|
|
4256
|
+
function ht(e = typeof document < "u" ? document : null) {
|
|
4231
4257
|
if (!e) return null;
|
|
4232
4258
|
if (!e.modelContext) {
|
|
4233
4259
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -4252,10 +4278,10 @@ function ft(e = typeof document < "u" ? document : null) {
|
|
|
4252
4278
|
}
|
|
4253
4279
|
return e.modelContext;
|
|
4254
4280
|
}
|
|
4255
|
-
function
|
|
4281
|
+
function gt(e) {
|
|
4256
4282
|
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;
|
|
4257
|
-
t?.modelContext ? i = t.modelContext : n?.modelContext ? i = n.modelContext : t && (i =
|
|
4258
|
-
let a = e.tools ?
|
|
4283
|
+
t?.modelContext ? i = t.modelContext : n?.modelContext ? i = n.modelContext : t && (i = ht(t) ?? void 0);
|
|
4284
|
+
let a = e.tools ? mt.filter((t) => e.tools.includes(t.name)) : mt, o = [], s = new AbortController();
|
|
4259
4285
|
e.signal && e.signal.addEventListener("abort", () => s.abort(), { once: !0 });
|
|
4260
4286
|
for (let t of a) {
|
|
4261
4287
|
let n = {
|
|
@@ -4265,7 +4291,7 @@ function pt(e) {
|
|
|
4265
4291
|
inputSchema: t.inputSchema,
|
|
4266
4292
|
annotations: t.annotations,
|
|
4267
4293
|
execute: async (n) => {
|
|
4268
|
-
let r = e.projectId ? { projectId: e.projectId } : void 0, i = await t.execute(n, e.client, r);
|
|
4294
|
+
let r = e.projectId ? { projectId: e.projectId } : void 0, i = await t.execute(pt(t, n), e.client, r);
|
|
4269
4295
|
return e.onToolExecuted?.(t.name, n, i), i;
|
|
4270
4296
|
}
|
|
4271
4297
|
};
|
|
@@ -4293,7 +4319,7 @@ function pt(e) {
|
|
|
4293
4319
|
}
|
|
4294
4320
|
//#endregion
|
|
4295
4321
|
//#region src/webmcp-state.svelte.ts
|
|
4296
|
-
var
|
|
4322
|
+
var _t = class {
|
|
4297
4323
|
client;
|
|
4298
4324
|
options;
|
|
4299
4325
|
#e = t.state(!1);
|
|
@@ -4333,7 +4359,7 @@ var mt = class {
|
|
|
4333
4359
|
if (!this.registered) {
|
|
4334
4360
|
this.error = null;
|
|
4335
4361
|
try {
|
|
4336
|
-
this.abortController = new AbortController(), this.handle =
|
|
4362
|
+
this.abortController = new AbortController(), this.handle = gt({
|
|
4337
4363
|
client: this.client,
|
|
4338
4364
|
projectId: this.activeProjectId,
|
|
4339
4365
|
tools: this.options.tools,
|
|
@@ -4357,12 +4383,12 @@ var mt = class {
|
|
|
4357
4383
|
this.activeProjectId !== e && (this.activeProjectId = e, this.registered && (this.unregister(), this.register()));
|
|
4358
4384
|
}
|
|
4359
4385
|
};
|
|
4360
|
-
function
|
|
4361
|
-
return new
|
|
4386
|
+
function vt(e, t) {
|
|
4387
|
+
return new _t(e, t);
|
|
4362
4388
|
}
|
|
4363
4389
|
//#endregion
|
|
4364
4390
|
//#region src/critical-path-state.svelte.ts
|
|
4365
|
-
var
|
|
4391
|
+
var yt = class {
|
|
4366
4392
|
client;
|
|
4367
4393
|
projectId;
|
|
4368
4394
|
#e = t.state(null);
|
|
@@ -4400,12 +4426,12 @@ var gt = class {
|
|
|
4400
4426
|
}
|
|
4401
4427
|
}
|
|
4402
4428
|
};
|
|
4403
|
-
function
|
|
4404
|
-
return new
|
|
4429
|
+
function bt(e, t) {
|
|
4430
|
+
return new yt(e, t);
|
|
4405
4431
|
}
|
|
4406
4432
|
//#endregion
|
|
4407
4433
|
//#region src/timeline-ladder-state.svelte.ts
|
|
4408
|
-
var
|
|
4434
|
+
var xt = class {
|
|
4409
4435
|
client;
|
|
4410
4436
|
projectId;
|
|
4411
4437
|
#e = t.state(null);
|
|
@@ -4477,12 +4503,12 @@ var vt = class {
|
|
|
4477
4503
|
}
|
|
4478
4504
|
}
|
|
4479
4505
|
};
|
|
4480
|
-
function
|
|
4481
|
-
return new
|
|
4506
|
+
function St(e, t, n) {
|
|
4507
|
+
return new xt(e, t, n);
|
|
4482
4508
|
}
|
|
4483
4509
|
//#endregion
|
|
4484
4510
|
//#region src/task-metrics-state.svelte.ts
|
|
4485
|
-
var
|
|
4511
|
+
var Ct = class {
|
|
4486
4512
|
client;
|
|
4487
4513
|
taskId;
|
|
4488
4514
|
#e = t.state(null);
|
|
@@ -4589,12 +4615,12 @@ var bt = class {
|
|
|
4589
4615
|
}
|
|
4590
4616
|
}
|
|
4591
4617
|
};
|
|
4592
|
-
function
|
|
4593
|
-
return new
|
|
4618
|
+
function wt(e, t) {
|
|
4619
|
+
return new Ct(e, t);
|
|
4594
4620
|
}
|
|
4595
4621
|
//#endregion
|
|
4596
4622
|
//#region src/workload-state.svelte.ts
|
|
4597
|
-
var
|
|
4623
|
+
var Tt = class {
|
|
4598
4624
|
client;
|
|
4599
4625
|
projectId;
|
|
4600
4626
|
initialOptions;
|
|
@@ -4711,13 +4737,13 @@ var St = class {
|
|
|
4711
4737
|
}
|
|
4712
4738
|
}
|
|
4713
4739
|
};
|
|
4714
|
-
function
|
|
4715
|
-
return new
|
|
4740
|
+
function Et(e, t, n) {
|
|
4741
|
+
return new Tt(e, t, n);
|
|
4716
4742
|
}
|
|
4717
4743
|
//#endregion
|
|
4718
4744
|
//#region src/index.ts
|
|
4719
|
-
function
|
|
4745
|
+
function Dt(t) {
|
|
4720
4746
|
return new e(t);
|
|
4721
4747
|
}
|
|
4722
4748
|
//#endregion
|
|
4723
|
-
export {
|
|
4749
|
+
export { re as AttachmentState, te as CommentState, yt as CriticalPathState, se as DeliverableState, le as DeliverableSummaryState, de as KanbanState, i as ProjectState, ae as TaskActivityState, Ct as TaskMetricsState, o as TaskState, pe as TaskTransitionsState, xt as TimelineLadderState, _t as WebMcpState, c as WorkflowState, Tt as WorkloadState, ie as createAttachmentState, ne as createCommentState, Dt as createCriticalPathClient, bt as createCriticalPathState, ce as createDeliverableState, ue as createDeliverableSummaryState, fe as createKanbanState, a as createProjectState, oe as createTaskActivityState, wt as createTaskMetricsState, s as createTaskState, me as createTaskTransitionsState, St as createTimelineLadderState, vt as createWebMcpState, ee as createWorkflowState, Et as createWorkloadState };
|