@blotout/qinto-cli 0.1.14 → 0.1.15
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/README.md +11 -3
- package/dist/index.js +837 -815
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1048,7 +1048,7 @@ function Kn(e) {
|
|
|
1048
1048
|
}
|
|
1049
1049
|
//#endregion
|
|
1050
1050
|
//#region ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@25.6.0/node_modules/@inquirer/core/dist/lib/Separator.js
|
|
1051
|
-
var
|
|
1051
|
+
var T = class {
|
|
1052
1052
|
separator = g("dim", Array.from({ length: 15 }).join(St.line));
|
|
1053
1053
|
type = "separator";
|
|
1054
1054
|
constructor(e) {
|
|
@@ -1057,7 +1057,7 @@ var qn = class {
|
|
|
1057
1057
|
static isSeparator(e) {
|
|
1058
1058
|
return !!(e && typeof e == "object" && "type" in e && e.type === "separator");
|
|
1059
1059
|
}
|
|
1060
|
-
},
|
|
1060
|
+
}, qn = {
|
|
1061
1061
|
icon: {
|
|
1062
1062
|
checked: g("green", St.circleFilled),
|
|
1063
1063
|
unchecked: St.circle,
|
|
@@ -1073,32 +1073,32 @@ var qn = class {
|
|
|
1073
1073
|
},
|
|
1074
1074
|
i18n: { disabledError: "This option is disabled and cannot be toggled." }
|
|
1075
1075
|
};
|
|
1076
|
+
function Jn(e) {
|
|
1077
|
+
return !T.isSeparator(e) && !e.disabled;
|
|
1078
|
+
}
|
|
1076
1079
|
function Yn(e) {
|
|
1077
|
-
return !
|
|
1080
|
+
return !T.isSeparator(e);
|
|
1078
1081
|
}
|
|
1079
1082
|
function Xn(e) {
|
|
1080
|
-
return !
|
|
1083
|
+
return !T.isSeparator(e) && e.checked;
|
|
1081
1084
|
}
|
|
1082
1085
|
function Zn(e) {
|
|
1083
|
-
return
|
|
1084
|
-
}
|
|
1085
|
-
function Qn(e) {
|
|
1086
|
-
return Yn(e) ? {
|
|
1086
|
+
return Jn(e) ? {
|
|
1087
1087
|
...e,
|
|
1088
1088
|
checked: !e.checked
|
|
1089
1089
|
} : e;
|
|
1090
1090
|
}
|
|
1091
|
-
function
|
|
1091
|
+
function Qn(e) {
|
|
1092
1092
|
return function(t) {
|
|
1093
|
-
return
|
|
1093
|
+
return Jn(t) ? {
|
|
1094
1094
|
...t,
|
|
1095
1095
|
checked: e
|
|
1096
1096
|
} : t;
|
|
1097
1097
|
};
|
|
1098
1098
|
}
|
|
1099
|
-
function
|
|
1099
|
+
function $n(e) {
|
|
1100
1100
|
return e.map((e) => {
|
|
1101
|
-
if (
|
|
1101
|
+
if (T.isSeparator(e)) return e;
|
|
1102
1102
|
if (typeof e != "object" || !e || !("value" in e)) {
|
|
1103
1103
|
let t = String(e);
|
|
1104
1104
|
return {
|
|
@@ -1121,16 +1121,16 @@ function er(e) {
|
|
|
1121
1121
|
return e.description && (n.description = e.description), n;
|
|
1122
1122
|
});
|
|
1123
1123
|
}
|
|
1124
|
-
var
|
|
1124
|
+
var er = Kn((e, t) => {
|
|
1125
1125
|
let { pageSize: n = 7, loop: r = !0, required: i, validate: a = () => !0 } = e, o = {
|
|
1126
1126
|
all: "a",
|
|
1127
1127
|
invert: "i",
|
|
1128
1128
|
...e.shortcuts
|
|
1129
|
-
}, s = Dt(
|
|
1129
|
+
}, s = Dt(qn, e.theme), { keybindings: c } = s, [l, u] = w("idle"), d = Ot({
|
|
1130
1130
|
status: l,
|
|
1131
1131
|
theme: s
|
|
1132
|
-
}), [f, p] = w(
|
|
1133
|
-
let e = f.findIndex(
|
|
1132
|
+
}), [f, p] = w($n(e.choices)), m = kt(() => {
|
|
1133
|
+
let e = f.findIndex(Yn), t = f.findLastIndex(Yn);
|
|
1134
1134
|
if (e === -1) throw new it("[checkbox prompt] No selectable choices. All choices are disabled.");
|
|
1135
1135
|
return {
|
|
1136
1136
|
first: e,
|
|
@@ -1139,33 +1139,33 @@ var tr = Kn((e, t) => {
|
|
|
1139
1139
|
}, [f]), [h, g] = w(m.first), [_, v] = w();
|
|
1140
1140
|
jt(async (e) => {
|
|
1141
1141
|
if ($e(e)) {
|
|
1142
|
-
let e = f.filter(
|
|
1142
|
+
let e = f.filter(Xn), n = await a([...e]);
|
|
1143
1143
|
i && !e.length ? v("At least one choice must be selected") : n === !0 ? (u("done"), t(e.map((e) => e.value))) : v(n || "You must select a valid value");
|
|
1144
1144
|
} else if (qe(e, c) || Je(e, c)) {
|
|
1145
1145
|
if (_ && v(void 0), r || qe(e, c) && h !== m.first || Je(e, c) && h !== m.last) {
|
|
1146
1146
|
let t = qe(e, c) ? -1 : 1, n = h;
|
|
1147
1147
|
do
|
|
1148
1148
|
n = (n + t + f.length) % f.length;
|
|
1149
|
-
while (!
|
|
1149
|
+
while (!Yn(f[n]));
|
|
1150
1150
|
g(n);
|
|
1151
1151
|
}
|
|
1152
1152
|
} else if (Ye(e)) {
|
|
1153
1153
|
let e = f[h];
|
|
1154
|
-
e && !
|
|
1154
|
+
e && !T.isSeparator(e) && (e.disabled ? v(s.i18n.disabledError) : (v(void 0), p(f.map((e, t) => t === h ? Zn(e) : e))));
|
|
1155
1155
|
} else if (e.name === o.all) {
|
|
1156
|
-
let e = f.some((e) =>
|
|
1157
|
-
p(f.map(
|
|
1158
|
-
} else if (e.name === o.invert) p(f.map(
|
|
1156
|
+
let e = f.some((e) => Jn(e) && !e.checked);
|
|
1157
|
+
p(f.map(Qn(e)));
|
|
1158
|
+
} else if (e.name === o.invert) p(f.map(Zn));
|
|
1159
1159
|
else if (Qe(e)) {
|
|
1160
|
-
let t = Number(e.name) - 1, n = -1, r = f.findIndex((e) =>
|
|
1161
|
-
i &&
|
|
1160
|
+
let t = Number(e.name) - 1, n = -1, r = f.findIndex((e) => T.isSeparator(e) ? !1 : (n++, n === t)), i = f[r];
|
|
1161
|
+
i && Jn(i) && (g(r), p(f.map((e, t) => t === r ? Zn(e) : e)));
|
|
1162
1162
|
}
|
|
1163
1163
|
});
|
|
1164
1164
|
let y = s.style.message(e.message, l), ee, b = hn({
|
|
1165
1165
|
items: f,
|
|
1166
1166
|
active: h,
|
|
1167
1167
|
renderItem({ item: e, isActive: t }) {
|
|
1168
|
-
if (
|
|
1168
|
+
if (T.isSeparator(e)) return ` ${e.separator}`;
|
|
1169
1169
|
let n = t ? s.icon.cursor : " ";
|
|
1170
1170
|
if (e.disabled) {
|
|
1171
1171
|
let t = typeof e.disabled == "string" ? e.disabled : "(disabled)", r = e.checked ? s.icon.disabledChecked : s.icon.disabledUnchecked;
|
|
@@ -1179,7 +1179,7 @@ var tr = Kn((e, t) => {
|
|
|
1179
1179
|
loop: r
|
|
1180
1180
|
});
|
|
1181
1181
|
if (l === "done") {
|
|
1182
|
-
let e = f.filter(
|
|
1182
|
+
let e = f.filter(Xn);
|
|
1183
1183
|
return [
|
|
1184
1184
|
d,
|
|
1185
1185
|
y,
|
|
@@ -1200,31 +1200,31 @@ var tr = Kn((e, t) => {
|
|
|
1200
1200
|
});
|
|
1201
1201
|
//#endregion
|
|
1202
1202
|
//#region ../../node_modules/.pnpm/@inquirer+confirm@6.1.1_@types+node@25.6.0/node_modules/@inquirer/confirm/dist/index.js
|
|
1203
|
-
function
|
|
1203
|
+
function tr(e, t) {
|
|
1204
1204
|
let n = t !== !1;
|
|
1205
1205
|
return /^(y|yes)/i.test(e) ? n = !0 : /^(n|no)/i.test(e) && (n = !1), n;
|
|
1206
1206
|
}
|
|
1207
|
-
function
|
|
1207
|
+
function nr(e) {
|
|
1208
1208
|
return e ? "Yes" : "No";
|
|
1209
1209
|
}
|
|
1210
|
-
var
|
|
1211
|
-
let { transformer: n =
|
|
1210
|
+
var rr = Kn((e, t) => {
|
|
1211
|
+
let { transformer: n = nr } = e, [r, i] = w("idle"), [a, o] = w(""), s = Dt(e.theme), c = Ot({
|
|
1212
1212
|
status: r,
|
|
1213
1213
|
theme: s
|
|
1214
1214
|
});
|
|
1215
1215
|
jt((s, c) => {
|
|
1216
1216
|
if (r === "idle") if ($e(s)) {
|
|
1217
|
-
let r =
|
|
1217
|
+
let r = tr(a, e.default);
|
|
1218
1218
|
o(n(r)), i("done"), t(r);
|
|
1219
1219
|
} else if (Ze(s)) {
|
|
1220
|
-
let t =
|
|
1220
|
+
let t = nr(!tr(a, e.default));
|
|
1221
1221
|
c.clearLine(0), c.write(t), o(t);
|
|
1222
1222
|
} else o(c.line);
|
|
1223
1223
|
});
|
|
1224
1224
|
let l = a, u = "";
|
|
1225
1225
|
return r === "done" ? l = s.style.answer(a) : u = ` ${s.style.defaultAnswer(e.default === !1 ? "y/N" : "Y/n")}`, `${c} ${s.style.message(e.message, r)}${u} ${l}`;
|
|
1226
|
-
}),
|
|
1227
|
-
let { prefill: n = "tab" } = e, r = Dt(
|
|
1226
|
+
}), ir = { validationFailureMode: "keep" }, ar = Kn((e, t) => {
|
|
1227
|
+
let { prefill: n = "tab" } = e, r = Dt(ir, e.theme), [i, a] = w("idle"), [o, s] = w(String(e.default ?? "")), [c, l] = w(), [u, d] = w(""), f = Ot({
|
|
1228
1228
|
status: i,
|
|
1229
1229
|
theme: r
|
|
1230
1230
|
});
|
|
@@ -1253,8 +1253,8 @@ var ir = Kn((e, t) => {
|
|
|
1253
1253
|
g,
|
|
1254
1254
|
h
|
|
1255
1255
|
].filter((e) => e !== void 0).join(" "), _];
|
|
1256
|
-
}),
|
|
1257
|
-
let { validate: n = () => !0 } = e, r = Dt(
|
|
1256
|
+
}), or = { style: { maskedText: "[input is masked]" } }, sr = Kn((e, t) => {
|
|
1257
|
+
let { validate: n = () => !0 } = e, r = Dt(or, e.theme), [i, a] = w("idle"), [o, s] = w(), [c, l] = w(""), u = Ot({
|
|
1258
1258
|
status: i,
|
|
1259
1259
|
theme: r
|
|
1260
1260
|
});
|
|
@@ -1274,7 +1274,7 @@ var ir = Kn((e, t) => {
|
|
|
1274
1274
|
d,
|
|
1275
1275
|
e.mask ? f : p
|
|
1276
1276
|
].join(" "), m];
|
|
1277
|
-
}),
|
|
1277
|
+
}), cr = {
|
|
1278
1278
|
icon: { cursor: St.pointer },
|
|
1279
1279
|
style: {
|
|
1280
1280
|
disabled: (e) => g("dim", e),
|
|
@@ -1284,15 +1284,15 @@ var ir = Kn((e, t) => {
|
|
|
1284
1284
|
i18n: { disabledError: "This option is disabled and cannot be selected." },
|
|
1285
1285
|
indexMode: "hidden"
|
|
1286
1286
|
};
|
|
1287
|
+
function lr(e) {
|
|
1288
|
+
return !T.isSeparator(e) && !e.disabled;
|
|
1289
|
+
}
|
|
1287
1290
|
function ur(e) {
|
|
1288
|
-
return !
|
|
1291
|
+
return !T.isSeparator(e);
|
|
1289
1292
|
}
|
|
1290
1293
|
function dr(e) {
|
|
1291
|
-
return !qn.isSeparator(e);
|
|
1292
|
-
}
|
|
1293
|
-
function fr(e) {
|
|
1294
1294
|
return e.map((e) => {
|
|
1295
|
-
if (
|
|
1295
|
+
if (T.isSeparator(e)) return e;
|
|
1296
1296
|
if (typeof e != "object" || !e || !("value" in e)) {
|
|
1297
1297
|
let t = String(e);
|
|
1298
1298
|
return {
|
|
@@ -1311,19 +1311,19 @@ function fr(e) {
|
|
|
1311
1311
|
return e.description && (n.description = e.description), n;
|
|
1312
1312
|
});
|
|
1313
1313
|
}
|
|
1314
|
-
var
|
|
1315
|
-
let { loop: n = !0, pageSize: r = 7 } = e, i = Dt(
|
|
1314
|
+
var fr = Kn((e, t) => {
|
|
1315
|
+
let { loop: n = !0, pageSize: r = 7 } = e, i = Dt(cr, e.theme), { keybindings: a } = i, [o, s] = w("idle"), c = Ot({
|
|
1316
1316
|
status: o,
|
|
1317
1317
|
theme: i
|
|
1318
|
-
}), l = At(), u = !a.includes("vim"), d = kt(() =>
|
|
1319
|
-
let e = d.findIndex(
|
|
1318
|
+
}), l = At(), u = !a.includes("vim"), d = kt(() => dr(e.choices), [e.choices]), f = kt(() => {
|
|
1319
|
+
let e = d.findIndex(ur), t = d.findLastIndex(ur);
|
|
1320
1320
|
if (e === -1) throw new it("[select prompt] No selectable choices. All choices are disabled.");
|
|
1321
1321
|
return {
|
|
1322
1322
|
first: e,
|
|
1323
1323
|
last: t
|
|
1324
1324
|
};
|
|
1325
|
-
}, [d]), p = kt(() => "default" in e ? d.findIndex((t) =>
|
|
1326
|
-
if (g == null ||
|
|
1325
|
+
}, [d]), p = kt(() => "default" in e ? d.findIndex((t) => lr(t) && t.value === e.default) : -1, [e.default, d]), [m, h] = w(p === -1 ? f.first : p), g = d[m];
|
|
1326
|
+
if (g == null || T.isSeparator(g)) throw Error("Active index does not point to a choice");
|
|
1327
1327
|
let [_, v] = w();
|
|
1328
1328
|
jt((e, r) => {
|
|
1329
1329
|
if (clearTimeout(l.current), _ && v(void 0), $e(e)) g.disabled ? v(i.i18n.disabledError) : (s("done"), t(g.value));
|
|
@@ -1332,17 +1332,17 @@ var pr = Kn((e, t) => {
|
|
|
1332
1332
|
let t = qe(e, a) ? -1 : 1, n = m;
|
|
1333
1333
|
do
|
|
1334
1334
|
n = (n + t + d.length) % d.length;
|
|
1335
|
-
while (!
|
|
1335
|
+
while (!ur(d[n]));
|
|
1336
1336
|
h(n);
|
|
1337
1337
|
}
|
|
1338
1338
|
} else if (Qe(e) && !Number.isNaN(Number(r.line))) {
|
|
1339
|
-
let e = Number(r.line) - 1, t = -1, n = d.findIndex((n) =>
|
|
1340
|
-
i != null &&
|
|
1339
|
+
let e = Number(r.line) - 1, t = -1, n = d.findIndex((n) => T.isSeparator(n) ? !1 : (t++, t === e)), i = d[n];
|
|
1340
|
+
i != null && lr(i) && h(n), l.current = setTimeout(() => {
|
|
1341
1341
|
r.clearLine(0);
|
|
1342
1342
|
}, 700);
|
|
1343
1343
|
} else if (Xe(e)) r.clearLine(0);
|
|
1344
1344
|
else if (u) {
|
|
1345
|
-
let e = r.line.toLowerCase(), t = d.findIndex((t) =>
|
|
1345
|
+
let e = r.line.toLowerCase(), t = d.findIndex((t) => T.isSeparator(t) || !lr(t) ? !1 : t.name.toLowerCase().startsWith(e));
|
|
1346
1346
|
t !== -1 && h(t), l.current = setTimeout(() => {
|
|
1347
1347
|
r.clearLine(0);
|
|
1348
1348
|
}, 700);
|
|
@@ -1354,7 +1354,7 @@ var pr = Kn((e, t) => {
|
|
|
1354
1354
|
items: d,
|
|
1355
1355
|
active: m,
|
|
1356
1356
|
renderItem({ item: e, isActive: t, index: n }) {
|
|
1357
|
-
if (
|
|
1357
|
+
if (T.isSeparator(e)) return b++, ` ${e.separator}`;
|
|
1358
1358
|
let r = t ? i.icon.cursor : " ", a = i.indexMode === "number" ? `${n + 1 - b}. ` : "";
|
|
1359
1359
|
if (e.disabled) {
|
|
1360
1360
|
let n = typeof e.disabled == "string" ? e.disabled : "(disabled)", r = t ? i.icon.cursor : "-";
|
|
@@ -1379,9 +1379,9 @@ var pr = Kn((e, t) => {
|
|
|
1379
1379
|
_ ? i.style.error(_) : "",
|
|
1380
1380
|
ee
|
|
1381
1381
|
].filter(Boolean).join("\n").trimEnd()}${Mn}`;
|
|
1382
|
-
}),
|
|
1382
|
+
}), pr = {
|
|
1383
1383
|
name: "@blotout/qinto-cli",
|
|
1384
|
-
version: "0.1.
|
|
1384
|
+
version: "0.1.15",
|
|
1385
1385
|
type: "module",
|
|
1386
1386
|
description: "Qinto CLI: authenticate against the Qinto platform and operate it from the terminal or from an agent.",
|
|
1387
1387
|
repository: {
|
|
@@ -1430,38 +1430,38 @@ var pr = Kn((e, t) => {
|
|
|
1430
1430
|
vite: "catalog:",
|
|
1431
1431
|
vitest: "catalog:"
|
|
1432
1432
|
}
|
|
1433
|
-
},
|
|
1433
|
+
}, E = class extends Error {}, D = class extends E {}, mr = class extends E {
|
|
1434
1434
|
status;
|
|
1435
1435
|
code;
|
|
1436
1436
|
constructor(e, t, n) {
|
|
1437
1437
|
super(e), this.status = t, this.code = n;
|
|
1438
1438
|
}
|
|
1439
|
-
},
|
|
1439
|
+
}, hr = class extends E {
|
|
1440
1440
|
code;
|
|
1441
1441
|
constructor(e, t) {
|
|
1442
1442
|
super(t), this.code = e;
|
|
1443
1443
|
}
|
|
1444
|
-
},
|
|
1444
|
+
}, gr = async (e) => {
|
|
1445
1445
|
let t = c(e);
|
|
1446
1446
|
await ve(t, {
|
|
1447
1447
|
recursive: !0,
|
|
1448
1448
|
mode: 448
|
|
1449
1449
|
}), await _e(t, 448);
|
|
1450
|
-
},
|
|
1451
|
-
await
|
|
1450
|
+
}, _r = async (e, t) => {
|
|
1451
|
+
await gr(e);
|
|
1452
1452
|
let n = `${e}.${process.pid}.${ue()}.tmp`;
|
|
1453
1453
|
await we(n, `${JSON.stringify(t, null, 2)}\n`, { mode: 384 }), await _e(n, 384), await xe(n, e);
|
|
1454
|
-
},
|
|
1454
|
+
}, vr = pr.version, yr = "https://registry.npmjs.org/@blotout/qinto-cli/latest", br = 1440 * 60 * 1e3, xr = 1500, Sr = "\x1B[33m", Cr = "\x1B[0m", wr = (e) => {
|
|
1455
1455
|
let t = /^(\d+)\.(\d+)\.(\d+)$/.exec(e);
|
|
1456
1456
|
return t === null ? null : [
|
|
1457
1457
|
Number(t[1]),
|
|
1458
1458
|
Number(t[2]),
|
|
1459
1459
|
Number(t[3])
|
|
1460
1460
|
];
|
|
1461
|
-
},
|
|
1462
|
-
let n =
|
|
1461
|
+
}, Tr = (e, t) => {
|
|
1462
|
+
let n = wr(e), r = wr(t);
|
|
1463
1463
|
return n === null || r === null ? !1 : n[0] > r[0] || n[0] === r[0] && n[1] > r[1] || n[0] === r[0] && n[1] === r[1] && n[2] > r[2];
|
|
1464
|
-
},
|
|
1464
|
+
}, Er = async (e) => {
|
|
1465
1465
|
try {
|
|
1466
1466
|
let t = JSON.parse(await C(e, "utf8"));
|
|
1467
1467
|
return typeof t.checkedAt == "number" ? {
|
|
@@ -1471,18 +1471,18 @@ var pr = Kn((e, t) => {
|
|
|
1471
1471
|
} catch {
|
|
1472
1472
|
return null;
|
|
1473
1473
|
}
|
|
1474
|
-
},
|
|
1474
|
+
}, Dr = async (e, t) => {
|
|
1475
1475
|
try {
|
|
1476
|
-
await
|
|
1476
|
+
await _r(e.versionCheckPath, {
|
|
1477
1477
|
checkedAt: e.now(),
|
|
1478
1478
|
...t === void 0 ? {} : { latest: t }
|
|
1479
1479
|
});
|
|
1480
1480
|
} catch {}
|
|
1481
|
-
},
|
|
1481
|
+
}, Or = async (e) => {
|
|
1482
1482
|
try {
|
|
1483
|
-
let t = await e.fetch(
|
|
1483
|
+
let t = await e.fetch(yr, {
|
|
1484
1484
|
headers: { accept: "application/json" },
|
|
1485
|
-
signal: AbortSignal.timeout(
|
|
1485
|
+
signal: AbortSignal.timeout(xr)
|
|
1486
1486
|
});
|
|
1487
1487
|
if (!t.ok) return;
|
|
1488
1488
|
let n = await t.json();
|
|
@@ -1490,24 +1490,24 @@ var pr = Kn((e, t) => {
|
|
|
1490
1490
|
} catch {
|
|
1491
1491
|
return;
|
|
1492
1492
|
}
|
|
1493
|
+
}, kr = async (e) => {
|
|
1494
|
+
let t = await Er(e.versionCheckPath);
|
|
1495
|
+
if (t !== null && e.now() - t.checkedAt < br) return t.latest ?? null;
|
|
1496
|
+
let n = await Or(e);
|
|
1497
|
+
return await Dr(e, n ?? t?.latest), n ?? t?.latest ?? null;
|
|
1493
1498
|
}, Ar = async (e) => {
|
|
1494
|
-
let t = await
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
return await Or(e, n ?? t?.latest), n ?? t?.latest ?? null;
|
|
1498
|
-
}, jr = async (e) => {
|
|
1499
|
-
let t = await kr(e);
|
|
1500
|
-
return t === void 0 ? null : (await Or(e, t), t);
|
|
1501
|
-
}, Mr = (e, t) => {
|
|
1499
|
+
let t = await Or(e);
|
|
1500
|
+
return t === void 0 ? null : (await Dr(e, t), t);
|
|
1501
|
+
}, jr = (e, t) => {
|
|
1502
1502
|
let n = e.env.QINTO_NO_UPDATE_CHECK;
|
|
1503
1503
|
return n !== void 0 && n !== "" || !e.interactive || t.includes("--json") || t.includes("--no-input") ? !1 : t.at(0) !== "update";
|
|
1504
|
-
},
|
|
1505
|
-
let n = `A new Qinto CLI is available: ${
|
|
1506
|
-
return r !== void 0 && r !== "" ? `\n${n}\n` : `\n${
|
|
1507
|
-
},
|
|
1504
|
+
}, Mr = (e, t) => jr(e, t) ? kr(e) : Promise.resolve(null), Nr = (e, t) => {
|
|
1505
|
+
let n = `A new Qinto CLI is available: ${vr} -> ${t}. Run \`qinto update\` to install it.`, r = e.NO_COLOR;
|
|
1506
|
+
return r !== void 0 && r !== "" ? `\n${n}\n` : `\n${Sr}${n}${Cr}\n`;
|
|
1507
|
+
}, Pr = async (e, t) => {
|
|
1508
1508
|
let n = await t;
|
|
1509
|
-
n !== null &&
|
|
1510
|
-
},
|
|
1509
|
+
n !== null && Tr(n, vr) && e.stderr(Nr(e.env, n));
|
|
1510
|
+
}, Fr = (e) => Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0)), Ir = (e) => String(e.split(" ").at(0)).slice(2), Lr = (e) => ({
|
|
1511
1511
|
schemaVersion: 2,
|
|
1512
1512
|
commands: e.map((e) => ({
|
|
1513
1513
|
path: e.path,
|
|
@@ -1515,14 +1515,14 @@ var pr = Kn((e, t) => {
|
|
|
1515
1515
|
environment: e.environment ?? [],
|
|
1516
1516
|
...e.result === void 0 ? {} : { result: e.result },
|
|
1517
1517
|
arguments: {
|
|
1518
|
-
...Object.fromEntries(e.positionals.map((e) => [e.name,
|
|
1518
|
+
...Object.fromEntries(e.positionals.map((e) => [e.name, Fr({
|
|
1519
1519
|
type: "string",
|
|
1520
1520
|
description: e.description,
|
|
1521
1521
|
required: e.required ? !0 : void 0,
|
|
1522
1522
|
positional: !0,
|
|
1523
1523
|
variadic: e.variadic
|
|
1524
1524
|
})])),
|
|
1525
|
-
...Object.fromEntries(e.options.map((e) => [
|
|
1525
|
+
...Object.fromEntries(e.options.map((e) => [Ir(e.flag), Fr({
|
|
1526
1526
|
type: e.type,
|
|
1527
1527
|
description: e.description,
|
|
1528
1528
|
required: e.required,
|
|
@@ -1532,7 +1532,7 @@ var pr = Kn((e, t) => {
|
|
|
1532
1532
|
})]))
|
|
1533
1533
|
}
|
|
1534
1534
|
}))
|
|
1535
|
-
}),
|
|
1535
|
+
}), Rr = class extends Error {}, zr = async (e, t) => {
|
|
1536
1536
|
try {
|
|
1537
1537
|
await Ee({
|
|
1538
1538
|
...t,
|
|
@@ -1540,11 +1540,11 @@ var pr = Kn((e, t) => {
|
|
|
1540
1540
|
logLevel: "silent"
|
|
1541
1541
|
});
|
|
1542
1542
|
} catch (t) {
|
|
1543
|
-
throw new
|
|
1543
|
+
throw new Rr(`The ${e} bundle failed to build: ${t.message}`);
|
|
1544
1544
|
}
|
|
1545
|
-
},
|
|
1545
|
+
}, Br = "(function(d){var s=d.currentScript,g=(s&&s.dataset?s.dataset.qintoGlobal:void 0)||\"qinto\";var q=window[g];if(!q||!q._q){return;}var l=function(){var f=null;", Vr = (e) => `return f;};(q._apps=q._apps||[]).push([${JSON.stringify(e)},l]);})(document);`, Hr = (e) => `import * as m from ${JSON.stringify(e)}\nf = m.default && m.default.__qintoBrowserApp ? m.default.factory : null\n`, Ur = async (e) => {
|
|
1546
1546
|
let t = l(e.outDir, "server.js");
|
|
1547
|
-
await
|
|
1547
|
+
await zr("server", {
|
|
1548
1548
|
entryPoints: [l(e.dir, e.manifest.server.entry)],
|
|
1549
1549
|
format: "esm",
|
|
1550
1550
|
platform: "neutral",
|
|
@@ -1559,27 +1559,27 @@ var pr = Kn((e, t) => {
|
|
|
1559
1559
|
browser: null
|
|
1560
1560
|
};
|
|
1561
1561
|
let r = l(e.outDir, "browser.js");
|
|
1562
|
-
return await
|
|
1562
|
+
return await zr("browser", {
|
|
1563
1563
|
stdin: {
|
|
1564
|
-
contents:
|
|
1564
|
+
contents: Hr(l(e.dir, n)),
|
|
1565
1565
|
resolveDir: e.dir,
|
|
1566
1566
|
loader: "js"
|
|
1567
1567
|
},
|
|
1568
1568
|
format: "iife",
|
|
1569
1569
|
target: "es2022",
|
|
1570
1570
|
minify: !0,
|
|
1571
|
-
banner: { js:
|
|
1572
|
-
footer: { js:
|
|
1571
|
+
banner: { js: Br },
|
|
1572
|
+
footer: { js: Vr(e.manifest.slug) },
|
|
1573
1573
|
outfile: r,
|
|
1574
1574
|
absWorkingDir: e.dir
|
|
1575
1575
|
}), {
|
|
1576
1576
|
server: t,
|
|
1577
1577
|
browser: r
|
|
1578
1578
|
};
|
|
1579
|
-
},
|
|
1579
|
+
}, Wr = async (e) => (await be(e, {
|
|
1580
1580
|
recursive: !0,
|
|
1581
1581
|
withFileTypes: !0
|
|
1582
|
-
})).filter((e) => e.isFile()).map((t) => d(e, l(t.parentPath, t.name)).split(p).join("/")).sort(),
|
|
1582
|
+
})).filter((e) => e.isFile()).map((t) => d(e, l(t.parentPath, t.name)).split(p).join("/")).sort(), Gr = (e) => JSON.stringify(Array.isArray(e) ? [...e].sort() : e), Kr = async (e) => {
|
|
1583
1583
|
let t = c(e), n = l(t, "__qinto_hook_validator__.js"), r = `import app from ${JSON.stringify(`./${s(e)}`)};export default{fetch(){return Response.json({hooks:app?.__hooks??null,migrations:Object.keys(app?.migrations??{}),schedules:Object.keys(app?.schedules??{}),workflows:Object.keys(app?.workflows??{}),endpoints:Object.keys(app?.endpoints??{}),tools:Object.keys(app?.tools??{}),ui:typeof app?.ui==='function'})}}`;
|
|
1584
1584
|
try {
|
|
1585
1585
|
let i = new De({ workers: [{ config: {
|
|
@@ -1616,9 +1616,9 @@ var pr = Kn((e, t) => {
|
|
|
1616
1616
|
await i.dispose();
|
|
1617
1617
|
}
|
|
1618
1618
|
} catch (e) {
|
|
1619
|
-
throw new
|
|
1619
|
+
throw new Rr(`The built server bundle could not be imported by Workerd: ${e.message}`);
|
|
1620
1620
|
}
|
|
1621
|
-
},
|
|
1621
|
+
}, qr = [
|
|
1622
1622
|
{
|
|
1623
1623
|
label: "migrations",
|
|
1624
1624
|
noun: "backfill handler",
|
|
@@ -1654,10 +1654,10 @@ var pr = Kn((e, t) => {
|
|
|
1654
1654
|
declared: (e) => e.tools.map((e) => e.name),
|
|
1655
1655
|
exported: (e) => e.tools
|
|
1656
1656
|
}
|
|
1657
|
-
],
|
|
1657
|
+
], Jr = (e, t, n) => {
|
|
1658
1658
|
let r = e.declared(t);
|
|
1659
1659
|
return [...r.filter((e) => !n.includes(e)).map((t) => `the manifest declares ${e.noun} ${t}, which the bundle does not register`), ...n.filter((e) => !r.includes(e)).map((t) => `the bundle registers ${e.noun} ${t}, which no ${e.owner} declares`)];
|
|
1660
|
-
},
|
|
1660
|
+
}, Yr = (e, t) => {
|
|
1661
1661
|
let n = [];
|
|
1662
1662
|
for (let r of [
|
|
1663
1663
|
"transform",
|
|
@@ -1666,16 +1666,16 @@ var pr = Kn((e, t) => {
|
|
|
1666
1666
|
"onLifecycle"
|
|
1667
1667
|
]) {
|
|
1668
1668
|
let i = r === "onLifecycle" ? e[r] ?? [] : e[r], a = r === "onLifecycle" ? t[r] ?? [] : t[r];
|
|
1669
|
-
|
|
1669
|
+
Gr(i) !== Gr(a) && n.push(`${r}: the manifest declares ${JSON.stringify(i)}, the bundle exports ${JSON.stringify(a)}`);
|
|
1670
1670
|
}
|
|
1671
1671
|
return n;
|
|
1672
|
-
},
|
|
1673
|
-
let { hooks: t, migrations: n, schedules: r, workflows: i, endpoints: a, tools: o, ui: s } = await
|
|
1674
|
-
if (t === null) throw new
|
|
1675
|
-
let c =
|
|
1676
|
-
if (c.length > 0) throw new
|
|
1677
|
-
for (let c of
|
|
1678
|
-
let l =
|
|
1672
|
+
}, Xr = async (e) => {
|
|
1673
|
+
let { hooks: t, migrations: n, schedules: r, workflows: i, endpoints: a, tools: o, ui: s } = await Kr(e.serverBundle);
|
|
1674
|
+
if (t === null) throw new Rr("The server bundle default export carries no __hooks metadata to validate against the manifest.");
|
|
1675
|
+
let c = Yr(e.manifest.server.hooks, t);
|
|
1676
|
+
if (c.length > 0) throw new Rr(`The built server bundle's __hooks do not match the manifest — ${c.join("; ")}.`);
|
|
1677
|
+
for (let c of qr) {
|
|
1678
|
+
let l = Jr(c, e.manifest, c.exported({
|
|
1679
1679
|
hooks: t,
|
|
1680
1680
|
migrations: n,
|
|
1681
1681
|
schedules: r,
|
|
@@ -1684,18 +1684,18 @@ var pr = Kn((e, t) => {
|
|
|
1684
1684
|
tools: o,
|
|
1685
1685
|
ui: s
|
|
1686
1686
|
}));
|
|
1687
|
-
if (l.length > 0) throw new
|
|
1687
|
+
if (l.length > 0) throw new Rr(`The built server bundle's ${c.label} do not match the manifest — ${l.join("; ")}.`);
|
|
1688
1688
|
}
|
|
1689
|
-
if (s && e.manifest.ui === void 0) throw new
|
|
1690
|
-
},
|
|
1689
|
+
if (s && e.manifest.ui === void 0) throw new Rr("The server bundle exports a ui handler, but the manifest declares no ui block. Add one, or remove the handler.");
|
|
1690
|
+
}, Zr = m(t), Qr = "https://app-ui.invalid", $r = class extends Rr {
|
|
1691
1691
|
constructor(e) {
|
|
1692
1692
|
super(`${e.file} references ${e.reference}, which resolves to ${e.resolved} outside the served prefix ${e.basePath}.`);
|
|
1693
1693
|
}
|
|
1694
|
-
},
|
|
1694
|
+
}, ei = async (e) => {
|
|
1695
1695
|
if (e.ui.build === void 0) return;
|
|
1696
1696
|
let t = /\bastro\b/.test(e.ui.build) ? `${e.ui.build} --base=${e.basePath}` : e.ui.build, n = c(f(e.dir, e.ui.dir));
|
|
1697
1697
|
try {
|
|
1698
|
-
await
|
|
1698
|
+
await Zr(t, {
|
|
1699
1699
|
cwd: n,
|
|
1700
1700
|
env: {
|
|
1701
1701
|
...process.env,
|
|
@@ -1703,35 +1703,35 @@ var pr = Kn((e, t) => {
|
|
|
1703
1703
|
}
|
|
1704
1704
|
});
|
|
1705
1705
|
} catch (e) {
|
|
1706
|
-
throw new
|
|
1706
|
+
throw new Rr(`The UI build failed: ${e.message}`);
|
|
1707
1707
|
}
|
|
1708
|
-
},
|
|
1709
|
-
let t = new URL(e.file, `${
|
|
1710
|
-
for (let n of e.content.matchAll(
|
|
1708
|
+
}, ti = /^(?:(?:https?:)?\/\/|data:|mailto:|#)/i, ni = /(?:src|href)\s*=\s*["']([^"']+)["']/gi, ri = (e) => {
|
|
1709
|
+
let t = new URL(e.file, `${Qr}${e.basePath}`);
|
|
1710
|
+
for (let n of e.content.matchAll(ni)) {
|
|
1711
1711
|
let r = n[1];
|
|
1712
|
-
if (
|
|
1712
|
+
if (ti.test(r)) continue;
|
|
1713
1713
|
let i = new URL(r, t);
|
|
1714
|
-
if (i.origin !==
|
|
1714
|
+
if (i.origin !== Qr || !i.pathname.startsWith(e.basePath)) throw new $r({
|
|
1715
1715
|
file: e.file,
|
|
1716
1716
|
reference: r,
|
|
1717
|
-
resolved: i.origin ===
|
|
1717
|
+
resolved: i.origin === Qr ? i.pathname : i.href,
|
|
1718
1718
|
basePath: e.basePath
|
|
1719
1719
|
});
|
|
1720
1720
|
}
|
|
1721
|
-
},
|
|
1721
|
+
}, ii = "sourceMappingURL=data:", ai = [
|
|
1722
1722
|
".js",
|
|
1723
1723
|
".mjs",
|
|
1724
1724
|
".css"
|
|
1725
|
-
],
|
|
1725
|
+
], oi = (e) => {
|
|
1726
1726
|
let t = e.split("/");
|
|
1727
1727
|
return e.endsWith(".map") || t.some((e) => e.startsWith(".") || e === "node_modules");
|
|
1728
|
-
},
|
|
1729
|
-
if (!S(e.uiRoot)) throw new
|
|
1730
|
-
let t = await
|
|
1731
|
-
if (!t.includes("index.html")) throw new
|
|
1732
|
-
let n = t.filter((e) => !
|
|
1733
|
-
for (let t of n.filter((e) =>
|
|
1734
|
-
for (let t of n.filter((e) => e.endsWith(".html")))
|
|
1728
|
+
}, si = async (e) => {
|
|
1729
|
+
if (!S(e.uiRoot)) throw new Rr(`The UI directory ${e.uiRoot} does not exist. Check ui.dir in qinto.app.jsonc, or its build output.`);
|
|
1730
|
+
let t = await Wr(e.uiRoot);
|
|
1731
|
+
if (!t.includes("index.html")) throw new Rr(`index.html is missing from the root of ${e.uiRoot}.`);
|
|
1732
|
+
let n = t.filter((e) => !oi(e)), r = t.filter(oi), i = [];
|
|
1733
|
+
for (let t of n.filter((e) => ai.some((t) => e.endsWith(t)))) (await C(l(e.uiRoot, t), "utf8")).includes(ii) && i.push(t);
|
|
1734
|
+
for (let t of n.filter((e) => e.endsWith(".html"))) ri({
|
|
1735
1735
|
file: t,
|
|
1736
1736
|
content: await C(l(e.uiRoot, t), "utf8"),
|
|
1737
1737
|
basePath: e.basePath
|
|
@@ -1741,35 +1741,35 @@ var pr = Kn((e, t) => {
|
|
|
1741
1741
|
skipped: r,
|
|
1742
1742
|
inlineSourceMaps: i
|
|
1743
1743
|
};
|
|
1744
|
-
},
|
|
1744
|
+
}, ci = "@blotout/qinto-sdk-app", li = "^0.1.0", ui = (e = c(Te(import.meta.url))) => {
|
|
1745
1745
|
let t = e;
|
|
1746
1746
|
for (; !S(l(t, "templates"));) {
|
|
1747
1747
|
let e = c(t);
|
|
1748
|
-
if (e === t) throw new
|
|
1748
|
+
if (e === t) throw new E("The Qinto CLI templates are missing from this installation.");
|
|
1749
1749
|
t = e;
|
|
1750
1750
|
}
|
|
1751
1751
|
return l(t, "templates");
|
|
1752
|
-
},
|
|
1752
|
+
}, di = async (e = ui()) => {
|
|
1753
1753
|
let t = f(e, "..", "..", "app", "sdk", "package.json");
|
|
1754
|
-
return S(t) && JSON.parse(await C(t, "utf8")).name ===
|
|
1755
|
-
},
|
|
1754
|
+
return S(t) && JSON.parse(await C(t, "utf8")).name === ci ? "workspace:*" : li;
|
|
1755
|
+
}, fi = (e, t) => {
|
|
1756
1756
|
let n = JSON.stringify(t.slug).slice(1, -1), r = JSON.stringify(t.name).slice(1, -1);
|
|
1757
1757
|
return e.replaceAll("__APP_SLUG__", n).replaceAll("__APP_NAME__", r).replaceAll("__APP_SDK_SPECIFIER__", t.sdkSpecifier);
|
|
1758
|
-
},
|
|
1759
|
-
let t = await
|
|
1758
|
+
}, pi = async (e) => {
|
|
1759
|
+
let t = await Wr(e.templateDir), n = await di(), r = [];
|
|
1760
1760
|
for (let i of t) {
|
|
1761
1761
|
let t = i === "gitignore" ? ".gitignore" : i, a = l(e.targetDir, t);
|
|
1762
|
-
await ve(c(a), { recursive: !0 }), await we(a,
|
|
1762
|
+
await ve(c(a), { recursive: !0 }), await we(a, fi(await C(l(e.templateDir, i), "utf8"), {
|
|
1763
1763
|
...e.values,
|
|
1764
1764
|
sdkSpecifier: n
|
|
1765
1765
|
})), r.push(t);
|
|
1766
1766
|
}
|
|
1767
1767
|
return r;
|
|
1768
|
-
},
|
|
1769
|
-
templateDir: l(
|
|
1768
|
+
}, mi = async (e) => (await pi({
|
|
1769
|
+
templateDir: l(ui(), "ui"),
|
|
1770
1770
|
targetDir: l(e.dir, "ui"),
|
|
1771
1771
|
values: e.values
|
|
1772
|
-
})).map((e) => `ui/${e}`),
|
|
1772
|
+
})).map((e) => `ui/${e}`), hi = async (e) => {
|
|
1773
1773
|
let t = await C(e, "utf8");
|
|
1774
1774
|
await we(e, Oe(t, ke(t, ["ui"], {
|
|
1775
1775
|
dir: "ui/dist",
|
|
@@ -1778,40 +1778,40 @@ var pr = Kn((e, t) => {
|
|
|
1778
1778
|
insertSpaces: !0,
|
|
1779
1779
|
tabSize: 2
|
|
1780
1780
|
} })));
|
|
1781
|
-
},
|
|
1781
|
+
}, gi = m(t), _i = async (e) => await di(e) === "workspace:*" ? {
|
|
1782
1782
|
root: "pnpm install",
|
|
1783
1783
|
ui: "pnpm install --ignore-workspace"
|
|
1784
1784
|
} : {
|
|
1785
1785
|
root: "npm install",
|
|
1786
1786
|
ui: "npm install"
|
|
1787
|
-
},
|
|
1787
|
+
}, vi = async (e) => {
|
|
1788
1788
|
try {
|
|
1789
|
-
return await
|
|
1789
|
+
return await gi(e.command, { cwd: e.dir }), !0;
|
|
1790
1790
|
} catch {
|
|
1791
1791
|
return !1;
|
|
1792
1792
|
}
|
|
1793
|
-
},
|
|
1794
|
-
let r =
|
|
1793
|
+
}, yi = /^([0-9]|[1-5][0-9])$/, bi = /^(\*|\d{1,2}(-\d{1,2})?)(\/\d{1,2})?$/, xi = (e, t) => Array.from({ length: t - e + 1 }, (t, n) => e + n), Si = (e, t, n) => {
|
|
1794
|
+
let r = bi.exec(e);
|
|
1795
1795
|
if (r === null) return null;
|
|
1796
1796
|
let i = r[3] === void 0 ? 1 : Number(r[3].slice(1));
|
|
1797
1797
|
if (i < 1) return null;
|
|
1798
1798
|
let a = r[1], [o, s] = a === "*" ? [t, n] : a.split("-").map(Number), c = o, l = s ?? (i === 1 ? c : n);
|
|
1799
|
-
return c < t || l > n || c > l ? null :
|
|
1800
|
-
},
|
|
1799
|
+
return c < t || l > n || c > l ? null : xi(c, l).filter((e) => (e - c) % i === 0);
|
|
1800
|
+
}, Ci = (e, t, n) => {
|
|
1801
1801
|
let r = /* @__PURE__ */ new Set();
|
|
1802
1802
|
for (let i of e.split(",")) {
|
|
1803
|
-
let e =
|
|
1803
|
+
let e = Si(i, t, n);
|
|
1804
1804
|
if (e === null) return null;
|
|
1805
1805
|
for (let t of e) r.add(t);
|
|
1806
1806
|
}
|
|
1807
1807
|
return r;
|
|
1808
|
-
},
|
|
1808
|
+
}, wi = (e) => {
|
|
1809
1809
|
if (e.length > 128) return null;
|
|
1810
1810
|
let t = e.split(" ");
|
|
1811
1811
|
if (t.length !== 5) return null;
|
|
1812
1812
|
let [n, r, i, a, o] = t;
|
|
1813
|
-
if (!
|
|
1814
|
-
let s =
|
|
1813
|
+
if (!yi.test(n) || i !== "*" && o !== "*") return null;
|
|
1814
|
+
let s = Ci(r, 0, 23), c = Ci(i, 1, 31), l = Ci(a, 1, 12), u = Ci(o, 0, 6);
|
|
1815
1815
|
return s === null || c === null || l === null || u === null ? null : {
|
|
1816
1816
|
minute: Number(n),
|
|
1817
1817
|
hour: s,
|
|
@@ -1819,25 +1819,25 @@ var pr = Kn((e, t) => {
|
|
|
1819
1819
|
month: l,
|
|
1820
1820
|
dayOfWeek: u
|
|
1821
1821
|
};
|
|
1822
|
-
},
|
|
1822
|
+
}, Ti = (e, t) => t.getUTCMinutes() === e.minute && e.hour.has(t.getUTCHours()) && e.dayOfMonth.has(t.getUTCDate()) && e.month.has(t.getUTCMonth() + 1) && e.dayOfWeek.has(t.getUTCDay()), Ei = (e, t, n) => {
|
|
1823
1823
|
let r = Math.floor(n / 6e4);
|
|
1824
1824
|
for (let n = 0; n < r; n += 1) {
|
|
1825
1825
|
let r = new Date(t.getTime() + n * 6e4);
|
|
1826
|
-
if (
|
|
1826
|
+
if (Ti(e, r)) return r;
|
|
1827
1827
|
}
|
|
1828
1828
|
return null;
|
|
1829
|
-
},
|
|
1830
|
-
if (Array.isArray(e)) return e.map(
|
|
1829
|
+
}, Di = (e) => {
|
|
1830
|
+
if (Array.isArray(e)) return e.map(Di);
|
|
1831
1831
|
if (typeof e == "object" && e) {
|
|
1832
|
-
let t = Object.entries(e).sort(([e], [t]) => e < t ? -1 : 1).map(([e, t]) => [e,
|
|
1832
|
+
let t = Object.entries(e).sort(([e], [t]) => e < t ? -1 : 1).map(([e, t]) => [e, Di(t)]);
|
|
1833
1833
|
return Object.fromEntries(t);
|
|
1834
1834
|
}
|
|
1835
1835
|
return e;
|
|
1836
|
-
},
|
|
1837
|
-
let t = new TextEncoder().encode(JSON.stringify(
|
|
1836
|
+
}, Oi = async (e) => {
|
|
1837
|
+
let t = new TextEncoder().encode(JSON.stringify(Di(e))), n = await crypto.subtle.digest("SHA-256", t);
|
|
1838
1838
|
return Array.from(new Uint8Array(n), (e) => e.toString(16).padStart(2, "0")).join("");
|
|
1839
|
-
},
|
|
1840
|
-
function
|
|
1839
|
+
}, ki, Ai = /*@__PURE__*/ Object.freeze({ status: "aborted" });
|
|
1840
|
+
function O(e, t, n) {
|
|
1841
1841
|
function r(n, r) {
|
|
1842
1842
|
if (n._zod || Object.defineProperty(n, "_zod", {
|
|
1843
1843
|
value: {
|
|
@@ -1866,30 +1866,30 @@ function D(e, t, n) {
|
|
|
1866
1866
|
}
|
|
1867
1867
|
return Object.defineProperty(o, "init", { value: r }), Object.defineProperty(o, Symbol.hasInstance, { value: (t) => n?.Parent && t instanceof n.Parent ? !0 : t?._zod?.traits?.has(e) }), Object.defineProperty(o, "name", { value: e }), o;
|
|
1868
1868
|
}
|
|
1869
|
-
var
|
|
1869
|
+
var ji = class extends Error {
|
|
1870
1870
|
constructor() {
|
|
1871
1871
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
1872
1872
|
}
|
|
1873
|
-
},
|
|
1873
|
+
}, Mi = class extends Error {
|
|
1874
1874
|
constructor(e) {
|
|
1875
1875
|
super(`Encountered unidirectional transform during encode: ${e}`), this.name = "ZodEncodeError";
|
|
1876
1876
|
}
|
|
1877
1877
|
};
|
|
1878
|
-
(
|
|
1879
|
-
var
|
|
1880
|
-
function
|
|
1881
|
-
return e && Object.assign(
|
|
1878
|
+
(ki = globalThis).__zod_globalConfig ?? (ki.__zod_globalConfig = {});
|
|
1879
|
+
var Ni = globalThis.__zod_globalConfig;
|
|
1880
|
+
function Pi(e) {
|
|
1881
|
+
return e && Object.assign(Ni, e), Ni;
|
|
1882
1882
|
}
|
|
1883
1883
|
//#endregion
|
|
1884
1884
|
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
|
|
1885
|
-
function
|
|
1885
|
+
function Fi(e) {
|
|
1886
1886
|
let t = Object.values(e).filter((e) => typeof e == "number");
|
|
1887
1887
|
return Object.entries(e).filter(([e, n]) => t.indexOf(+e) === -1).map(([e, t]) => t);
|
|
1888
1888
|
}
|
|
1889
|
-
function
|
|
1889
|
+
function Ii(e, t) {
|
|
1890
1890
|
return typeof t == "bigint" ? t.toString() : t;
|
|
1891
1891
|
}
|
|
1892
|
-
function
|
|
1892
|
+
function Li(e) {
|
|
1893
1893
|
return { get value() {
|
|
1894
1894
|
{
|
|
1895
1895
|
let t = e();
|
|
@@ -1898,23 +1898,23 @@ function Ri(e) {
|
|
|
1898
1898
|
throw Error("cached value already set");
|
|
1899
1899
|
} };
|
|
1900
1900
|
}
|
|
1901
|
-
function
|
|
1901
|
+
function Ri(e) {
|
|
1902
1902
|
return e == null;
|
|
1903
1903
|
}
|
|
1904
|
-
function
|
|
1904
|
+
function zi(e) {
|
|
1905
1905
|
let t = +!!e.startsWith("^"), n = e.endsWith("$") ? e.length - 1 : e.length;
|
|
1906
1906
|
return e.slice(t, n);
|
|
1907
1907
|
}
|
|
1908
|
-
function
|
|
1908
|
+
function Bi(e, t) {
|
|
1909
1909
|
let n = e / t, r = Math.round(n), i = 2 ** -52 * Math.max(Math.abs(n), 1);
|
|
1910
1910
|
return Math.abs(n - r) < i ? 0 : n - r;
|
|
1911
1911
|
}
|
|
1912
|
-
var
|
|
1913
|
-
function
|
|
1912
|
+
var Vi = /* @__PURE__*/ Symbol("evaluating");
|
|
1913
|
+
function k(e, t, n) {
|
|
1914
1914
|
let r;
|
|
1915
1915
|
Object.defineProperty(e, t, {
|
|
1916
1916
|
get() {
|
|
1917
|
-
if (r !==
|
|
1917
|
+
if (r !== Vi) return r === void 0 && (r = Vi, r = n()), r;
|
|
1918
1918
|
},
|
|
1919
1919
|
set(n) {
|
|
1920
1920
|
Object.defineProperty(e, t, { value: n });
|
|
@@ -1922,7 +1922,7 @@ function O(e, t, n) {
|
|
|
1922
1922
|
configurable: !0
|
|
1923
1923
|
});
|
|
1924
1924
|
}
|
|
1925
|
-
function
|
|
1925
|
+
function Hi(e, t, n) {
|
|
1926
1926
|
Object.defineProperty(e, t, {
|
|
1927
1927
|
value: n,
|
|
1928
1928
|
writable: !0,
|
|
@@ -1930,7 +1930,7 @@ function Ui(e, t, n) {
|
|
|
1930
1930
|
configurable: !0
|
|
1931
1931
|
});
|
|
1932
1932
|
}
|
|
1933
|
-
function
|
|
1933
|
+
function Ui(...e) {
|
|
1934
1934
|
let t = {};
|
|
1935
1935
|
for (let n of e) {
|
|
1936
1936
|
let e = Object.getOwnPropertyDescriptors(n);
|
|
@@ -1938,47 +1938,47 @@ function Wi(...e) {
|
|
|
1938
1938
|
}
|
|
1939
1939
|
return Object.defineProperties({}, t);
|
|
1940
1940
|
}
|
|
1941
|
-
function
|
|
1941
|
+
function Wi(e) {
|
|
1942
1942
|
return JSON.stringify(e);
|
|
1943
1943
|
}
|
|
1944
|
-
function
|
|
1944
|
+
function Gi(e) {
|
|
1945
1945
|
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
1946
1946
|
}
|
|
1947
|
-
var
|
|
1948
|
-
function
|
|
1947
|
+
var Ki = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {};
|
|
1948
|
+
function qi(e) {
|
|
1949
1949
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1950
1950
|
}
|
|
1951
|
-
var
|
|
1952
|
-
if (
|
|
1951
|
+
var Ji = /* @__PURE__*/ Li(() => {
|
|
1952
|
+
if (Ni.jitless || typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare")) return !1;
|
|
1953
1953
|
try {
|
|
1954
1954
|
return Function(""), !0;
|
|
1955
1955
|
} catch {
|
|
1956
1956
|
return !1;
|
|
1957
1957
|
}
|
|
1958
1958
|
});
|
|
1959
|
-
function
|
|
1960
|
-
if (
|
|
1959
|
+
function Yi(e) {
|
|
1960
|
+
if (qi(e) === !1) return !1;
|
|
1961
1961
|
let t = e.constructor;
|
|
1962
1962
|
if (t === void 0 || typeof t != "function") return !0;
|
|
1963
1963
|
let n = t.prototype;
|
|
1964
|
-
return !(
|
|
1964
|
+
return !(qi(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
|
|
1965
1965
|
}
|
|
1966
|
-
function
|
|
1967
|
-
return
|
|
1966
|
+
function Xi(e) {
|
|
1967
|
+
return Yi(e) ? { ...e } : Array.isArray(e) ? [...e] : e instanceof Map ? new Map(e) : e instanceof Set ? new Set(e) : e;
|
|
1968
1968
|
}
|
|
1969
|
-
var
|
|
1969
|
+
var Zi = /* @__PURE__*/ new Set([
|
|
1970
1970
|
"string",
|
|
1971
1971
|
"number",
|
|
1972
1972
|
"symbol"
|
|
1973
1973
|
]);
|
|
1974
|
-
function
|
|
1974
|
+
function Qi(e) {
|
|
1975
1975
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1976
1976
|
}
|
|
1977
|
-
function
|
|
1977
|
+
function $i(e, t, n) {
|
|
1978
1978
|
let r = new e._zod.constr(t ?? e._zod.def);
|
|
1979
1979
|
return (!t || n?.parent) && (r._zod.parent = e), r;
|
|
1980
1980
|
}
|
|
1981
|
-
function
|
|
1981
|
+
function A(e) {
|
|
1982
1982
|
let t = e;
|
|
1983
1983
|
if (!t) return {};
|
|
1984
1984
|
if (typeof t == "string") return { error: () => t };
|
|
@@ -1991,80 +1991,80 @@ function k(e) {
|
|
|
1991
1991
|
error: () => t.error
|
|
1992
1992
|
} : t;
|
|
1993
1993
|
}
|
|
1994
|
-
function
|
|
1994
|
+
function ea(e) {
|
|
1995
1995
|
return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
|
|
1996
1996
|
}
|
|
1997
|
-
var
|
|
1997
|
+
var ta = {
|
|
1998
1998
|
safeint: [-(2 ** 53 - 1), 2 ** 53 - 1],
|
|
1999
1999
|
int32: [-2147483648, 2147483647],
|
|
2000
2000
|
uint32: [0, 4294967295],
|
|
2001
2001
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
2002
2002
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
2003
2003
|
};
|
|
2004
|
-
function
|
|
2004
|
+
function na(e, t) {
|
|
2005
2005
|
let n = e._zod.def, r = n.checks;
|
|
2006
2006
|
if (r && r.length > 0) throw Error(".pick() cannot be used on object schemas containing refinements");
|
|
2007
|
-
return
|
|
2007
|
+
return $i(e, Ui(e._zod.def, {
|
|
2008
2008
|
get shape() {
|
|
2009
2009
|
let e = {};
|
|
2010
2010
|
for (let r in t) {
|
|
2011
2011
|
if (!(r in n.shape)) throw Error(`Unrecognized key: "${r}"`);
|
|
2012
2012
|
t[r] && (e[r] = n.shape[r]);
|
|
2013
2013
|
}
|
|
2014
|
-
return
|
|
2014
|
+
return Hi(this, "shape", e), e;
|
|
2015
2015
|
},
|
|
2016
2016
|
checks: []
|
|
2017
2017
|
}));
|
|
2018
2018
|
}
|
|
2019
|
-
function
|
|
2019
|
+
function ra(e, t) {
|
|
2020
2020
|
let n = e._zod.def, r = n.checks;
|
|
2021
2021
|
if (r && r.length > 0) throw Error(".omit() cannot be used on object schemas containing refinements");
|
|
2022
|
-
return
|
|
2022
|
+
return $i(e, Ui(e._zod.def, {
|
|
2023
2023
|
get shape() {
|
|
2024
2024
|
let r = { ...e._zod.def.shape };
|
|
2025
2025
|
for (let e in t) {
|
|
2026
2026
|
if (!(e in n.shape)) throw Error(`Unrecognized key: "${e}"`);
|
|
2027
2027
|
t[e] && delete r[e];
|
|
2028
2028
|
}
|
|
2029
|
-
return
|
|
2029
|
+
return Hi(this, "shape", r), r;
|
|
2030
2030
|
},
|
|
2031
2031
|
checks: []
|
|
2032
2032
|
}));
|
|
2033
2033
|
}
|
|
2034
|
-
function
|
|
2035
|
-
if (!
|
|
2034
|
+
function ia(e, t) {
|
|
2035
|
+
if (!Yi(t)) throw Error("Invalid input to extend: expected a plain object");
|
|
2036
2036
|
let n = e._zod.def.checks;
|
|
2037
2037
|
if (n && n.length > 0) {
|
|
2038
2038
|
let n = e._zod.def.shape;
|
|
2039
2039
|
for (let e in t) if (Object.getOwnPropertyDescriptor(n, e) !== void 0) throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
2040
2040
|
}
|
|
2041
|
-
return
|
|
2041
|
+
return $i(e, Ui(e._zod.def, { get shape() {
|
|
2042
2042
|
let n = {
|
|
2043
2043
|
...e._zod.def.shape,
|
|
2044
2044
|
...t
|
|
2045
2045
|
};
|
|
2046
|
-
return
|
|
2046
|
+
return Hi(this, "shape", n), n;
|
|
2047
2047
|
} }));
|
|
2048
2048
|
}
|
|
2049
|
-
function
|
|
2050
|
-
if (!
|
|
2051
|
-
return
|
|
2049
|
+
function aa(e, t) {
|
|
2050
|
+
if (!Yi(t)) throw Error("Invalid input to safeExtend: expected a plain object");
|
|
2051
|
+
return $i(e, Ui(e._zod.def, { get shape() {
|
|
2052
2052
|
let n = {
|
|
2053
2053
|
...e._zod.def.shape,
|
|
2054
2054
|
...t
|
|
2055
2055
|
};
|
|
2056
|
-
return
|
|
2056
|
+
return Hi(this, "shape", n), n;
|
|
2057
2057
|
} }));
|
|
2058
2058
|
}
|
|
2059
|
-
function
|
|
2059
|
+
function oa(e, t) {
|
|
2060
2060
|
if (e._zod.def.checks?.length) throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
2061
|
-
return
|
|
2061
|
+
return $i(e, Ui(e._zod.def, {
|
|
2062
2062
|
get shape() {
|
|
2063
2063
|
let n = {
|
|
2064
2064
|
...e._zod.def.shape,
|
|
2065
2065
|
...t._zod.def.shape
|
|
2066
2066
|
};
|
|
2067
|
-
return
|
|
2067
|
+
return Hi(this, "shape", n), n;
|
|
2068
2068
|
},
|
|
2069
2069
|
get catchall() {
|
|
2070
2070
|
return t._zod.def.catchall;
|
|
@@ -2072,10 +2072,10 @@ function sa(e, t) {
|
|
|
2072
2072
|
checks: t._zod.def.checks ?? []
|
|
2073
2073
|
}));
|
|
2074
2074
|
}
|
|
2075
|
-
function
|
|
2075
|
+
function sa(e, t, n) {
|
|
2076
2076
|
let r = t._zod.def.checks;
|
|
2077
2077
|
if (r && r.length > 0) throw Error(".partial() cannot be used on object schemas containing refinements");
|
|
2078
|
-
return
|
|
2078
|
+
return $i(t, Ui(t._zod.def, {
|
|
2079
2079
|
get shape() {
|
|
2080
2080
|
let r = t._zod.def.shape, i = { ...r };
|
|
2081
2081
|
if (n) for (let t in n) {
|
|
@@ -2089,13 +2089,13 @@ function ca(e, t, n) {
|
|
|
2089
2089
|
type: "optional",
|
|
2090
2090
|
innerType: r[t]
|
|
2091
2091
|
}) : r[t];
|
|
2092
|
-
return
|
|
2092
|
+
return Hi(this, "shape", i), i;
|
|
2093
2093
|
},
|
|
2094
2094
|
checks: []
|
|
2095
2095
|
}));
|
|
2096
2096
|
}
|
|
2097
|
-
function
|
|
2098
|
-
return
|
|
2097
|
+
function ca(e, t, n) {
|
|
2098
|
+
return $i(t, Ui(t._zod.def, { get shape() {
|
|
2099
2099
|
let r = t._zod.def.shape, i = { ...r };
|
|
2100
2100
|
if (n) for (let t in n) {
|
|
2101
2101
|
if (!(t in i)) throw Error(`Unrecognized key: "${t}"`);
|
|
@@ -2108,36 +2108,36 @@ function la(e, t, n) {
|
|
|
2108
2108
|
type: "nonoptional",
|
|
2109
2109
|
innerType: r[t]
|
|
2110
2110
|
});
|
|
2111
|
-
return
|
|
2111
|
+
return Hi(this, "shape", i), i;
|
|
2112
2112
|
} }));
|
|
2113
2113
|
}
|
|
2114
|
-
function
|
|
2114
|
+
function la(e, t = 0) {
|
|
2115
2115
|
if (e.aborted === !0) return !0;
|
|
2116
2116
|
for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue !== !0) return !0;
|
|
2117
2117
|
return !1;
|
|
2118
2118
|
}
|
|
2119
|
-
function
|
|
2119
|
+
function ua(e, t = 0) {
|
|
2120
2120
|
if (e.aborted === !0) return !0;
|
|
2121
2121
|
for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue === !1) return !0;
|
|
2122
2122
|
return !1;
|
|
2123
2123
|
}
|
|
2124
|
-
function
|
|
2124
|
+
function da(e, t) {
|
|
2125
2125
|
return t.map((t) => {
|
|
2126
2126
|
var n;
|
|
2127
2127
|
return (n = t).path ?? (n.path = []), t.path.unshift(e), t;
|
|
2128
2128
|
});
|
|
2129
2129
|
}
|
|
2130
|
-
function
|
|
2130
|
+
function fa(e) {
|
|
2131
2131
|
return typeof e == "string" ? e : e?.message;
|
|
2132
2132
|
}
|
|
2133
|
-
function
|
|
2134
|
-
let r = e.message ? e.message :
|
|
2133
|
+
function pa(e, t, n) {
|
|
2134
|
+
let r = e.message ? e.message : fa(e.inst?._zod.def?.error?.(e)) ?? fa(t?.error?.(e)) ?? fa(n.customError?.(e)) ?? fa(n.localeError?.(e)) ?? "Invalid input", { inst: i, continue: a, input: o, ...s } = e;
|
|
2135
2135
|
return s.path ??= [], s.message = r, t?.reportInput && (s.input = o), s;
|
|
2136
2136
|
}
|
|
2137
|
-
function
|
|
2137
|
+
function ma(e) {
|
|
2138
2138
|
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
2139
2139
|
}
|
|
2140
|
-
function
|
|
2140
|
+
function ha(...e) {
|
|
2141
2141
|
let [t, n, r] = e;
|
|
2142
2142
|
return typeof t == "string" ? {
|
|
2143
2143
|
message: t,
|
|
@@ -2148,19 +2148,19 @@ function ga(...e) {
|
|
|
2148
2148
|
}
|
|
2149
2149
|
//#endregion
|
|
2150
2150
|
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
|
|
2151
|
-
var
|
|
2151
|
+
var ga = (e, t) => {
|
|
2152
2152
|
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
2153
2153
|
value: e._zod,
|
|
2154
2154
|
enumerable: !1
|
|
2155
2155
|
}), Object.defineProperty(e, "issues", {
|
|
2156
2156
|
value: t,
|
|
2157
2157
|
enumerable: !1
|
|
2158
|
-
}), e.message = JSON.stringify(t,
|
|
2158
|
+
}), e.message = JSON.stringify(t, Ii, 2), Object.defineProperty(e, "toString", {
|
|
2159
2159
|
value: () => e.message,
|
|
2160
2160
|
enumerable: !1
|
|
2161
2161
|
});
|
|
2162
|
-
},
|
|
2163
|
-
function
|
|
2162
|
+
}, _a = O("$ZodError", ga), va = O("$ZodError", ga, { Parent: Error });
|
|
2163
|
+
function ya(e, t = (e) => e.message) {
|
|
2164
2164
|
let n = {}, r = [];
|
|
2165
2165
|
for (let i of e.issues) i.path.length > 0 ? (n[i.path[0]] = n[i.path[0]] || [], n[i.path[0]].push(t(i))) : r.push(t(i));
|
|
2166
2166
|
return {
|
|
@@ -2168,7 +2168,7 @@ function ba(e, t = (e) => e.message) {
|
|
|
2168
2168
|
fieldErrors: n
|
|
2169
2169
|
};
|
|
2170
2170
|
}
|
|
2171
|
-
function
|
|
2171
|
+
function ba(e, t = (e) => e.message) {
|
|
2172
2172
|
let n = { _errors: [] }, r = (e, i = []) => {
|
|
2173
2173
|
for (let a of e.issues) if (a.code === "invalid_union" && a.errors.length) a.errors.map((e) => r({ issues: e }, [...i, ...a.path]));
|
|
2174
2174
|
else if (a.code === "invalid_key") r({ issues: a.issues }, [...i, ...a.path]);
|
|
@@ -2189,7 +2189,7 @@ function xa(e, t = (e) => e.message) {
|
|
|
2189
2189
|
}
|
|
2190
2190
|
//#endregion
|
|
2191
2191
|
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
|
|
2192
|
-
var
|
|
2192
|
+
var xa = (e) => (t, n, r, i) => {
|
|
2193
2193
|
let a = r ? {
|
|
2194
2194
|
...r,
|
|
2195
2195
|
async: !1
|
|
@@ -2197,13 +2197,13 @@ var Sa = (e) => (t, n, r, i) => {
|
|
|
2197
2197
|
value: n,
|
|
2198
2198
|
issues: []
|
|
2199
2199
|
}, a);
|
|
2200
|
-
if (o instanceof Promise) throw new
|
|
2200
|
+
if (o instanceof Promise) throw new ji();
|
|
2201
2201
|
if (o.issues.length) {
|
|
2202
|
-
let t = new ((i?.Err) ?? e)(o.issues.map((e) =>
|
|
2203
|
-
throw
|
|
2202
|
+
let t = new ((i?.Err) ?? e)(o.issues.map((e) => pa(e, a, Pi())));
|
|
2203
|
+
throw Ki(t, i?.callee), t;
|
|
2204
2204
|
}
|
|
2205
2205
|
return o.value;
|
|
2206
|
-
},
|
|
2206
|
+
}, Sa = (e) => async (t, n, r, i) => {
|
|
2207
2207
|
let a = r ? {
|
|
2208
2208
|
...r,
|
|
2209
2209
|
async: !0
|
|
@@ -2212,11 +2212,11 @@ var Sa = (e) => (t, n, r, i) => {
|
|
|
2212
2212
|
issues: []
|
|
2213
2213
|
}, a);
|
|
2214
2214
|
if (o instanceof Promise && (o = await o), o.issues.length) {
|
|
2215
|
-
let t = new ((i?.Err) ?? e)(o.issues.map((e) =>
|
|
2216
|
-
throw
|
|
2215
|
+
let t = new ((i?.Err) ?? e)(o.issues.map((e) => pa(e, a, Pi())));
|
|
2216
|
+
throw Ki(t, i?.callee), t;
|
|
2217
2217
|
}
|
|
2218
2218
|
return o.value;
|
|
2219
|
-
},
|
|
2219
|
+
}, Ca = (e) => (t, n, r) => {
|
|
2220
2220
|
let i = r ? {
|
|
2221
2221
|
...r,
|
|
2222
2222
|
async: !1
|
|
@@ -2224,15 +2224,15 @@ var Sa = (e) => (t, n, r, i) => {
|
|
|
2224
2224
|
value: n,
|
|
2225
2225
|
issues: []
|
|
2226
2226
|
}, i);
|
|
2227
|
-
if (a instanceof Promise) throw new
|
|
2227
|
+
if (a instanceof Promise) throw new ji();
|
|
2228
2228
|
return a.issues.length ? {
|
|
2229
2229
|
success: !1,
|
|
2230
|
-
error: new (e ??
|
|
2230
|
+
error: new (e ?? _a)(a.issues.map((e) => pa(e, i, Pi())))
|
|
2231
2231
|
} : {
|
|
2232
2232
|
success: !0,
|
|
2233
2233
|
data: a.value
|
|
2234
2234
|
};
|
|
2235
|
-
},
|
|
2235
|
+
}, wa = /* @__PURE__*/ Ca(va), Ta = (e) => async (t, n, r) => {
|
|
2236
2236
|
let i = r ? {
|
|
2237
2237
|
...r,
|
|
2238
2238
|
async: !0
|
|
@@ -2242,65 +2242,65 @@ var Sa = (e) => (t, n, r, i) => {
|
|
|
2242
2242
|
}, i);
|
|
2243
2243
|
return a instanceof Promise && (a = await a), a.issues.length ? {
|
|
2244
2244
|
success: !1,
|
|
2245
|
-
error: new e(a.issues.map((e) =>
|
|
2245
|
+
error: new e(a.issues.map((e) => pa(e, i, Pi())))
|
|
2246
2246
|
} : {
|
|
2247
2247
|
success: !0,
|
|
2248
2248
|
data: a.value
|
|
2249
2249
|
};
|
|
2250
|
-
},
|
|
2250
|
+
}, Ea = /* @__PURE__*/ Ta(va), Da = (e) => (t, n, r) => {
|
|
2251
2251
|
let i = r ? {
|
|
2252
2252
|
...r,
|
|
2253
2253
|
direction: "backward"
|
|
2254
2254
|
} : { direction: "backward" };
|
|
2255
|
-
return
|
|
2256
|
-
},
|
|
2255
|
+
return xa(e)(t, n, i);
|
|
2256
|
+
}, Oa = (e) => (t, n, r) => xa(e)(t, n, r), ka = (e) => async (t, n, r) => {
|
|
2257
2257
|
let i = r ? {
|
|
2258
2258
|
...r,
|
|
2259
2259
|
direction: "backward"
|
|
2260
2260
|
} : { direction: "backward" };
|
|
2261
|
-
return
|
|
2262
|
-
},
|
|
2261
|
+
return Sa(e)(t, n, i);
|
|
2262
|
+
}, Aa = (e) => async (t, n, r) => Sa(e)(t, n, r), ja = (e) => (t, n, r) => {
|
|
2263
2263
|
let i = r ? {
|
|
2264
2264
|
...r,
|
|
2265
2265
|
direction: "backward"
|
|
2266
2266
|
} : { direction: "backward" };
|
|
2267
|
-
return
|
|
2268
|
-
},
|
|
2267
|
+
return Ca(e)(t, n, i);
|
|
2268
|
+
}, Ma = (e) => (t, n, r) => Ca(e)(t, n, r), Na = (e) => async (t, n, r) => {
|
|
2269
2269
|
let i = r ? {
|
|
2270
2270
|
...r,
|
|
2271
2271
|
direction: "backward"
|
|
2272
2272
|
} : { direction: "backward" };
|
|
2273
|
-
return
|
|
2274
|
-
},
|
|
2275
|
-
function
|
|
2276
|
-
return new RegExp(
|
|
2273
|
+
return Ta(e)(t, n, i);
|
|
2274
|
+
}, Pa = (e) => async (t, n, r) => Ta(e)(t, n, r), Fa = /^[cC][0-9a-z]{6,}$/, Ia = /^[0-9a-z]+$/, La = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Ra = /^[0-9a-vA-V]{20}$/, za = /^[A-Za-z0-9]{27}$/, Ba = /^[a-zA-Z0-9_-]{21}$/, Va = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Ha = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, Ua = (e) => e ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, Wa = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Ga = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
2275
|
+
function Ka() {
|
|
2276
|
+
return new RegExp(Ga, "u");
|
|
2277
2277
|
}
|
|
2278
|
-
var
|
|
2279
|
-
function
|
|
2278
|
+
var qa = /^(?:(?: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])$/, Ja = /^(([0-9a-fA-F]{1,4}:){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}|:))$/, Ya = /^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/, Xa = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Za = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Qa = /^[A-Za-z0-9_-]*$/, $a = /^https?$/, eo = /^\+[1-9]\d{6,14}$/, to = "(?:(?:\\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])))", no = /*@__PURE__*/ RegExp(`^${to}$`);
|
|
2279
|
+
function ro(e) {
|
|
2280
2280
|
let t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
2281
2281
|
return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
2282
2282
|
}
|
|
2283
|
-
function
|
|
2284
|
-
return RegExp(`^${
|
|
2283
|
+
function io(e) {
|
|
2284
|
+
return RegExp(`^${ro(e)}$`);
|
|
2285
2285
|
}
|
|
2286
|
-
function
|
|
2287
|
-
let t =
|
|
2286
|
+
function ao(e) {
|
|
2287
|
+
let t = ro({ precision: e.precision }), n = ["Z"];
|
|
2288
2288
|
e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
2289
2289
|
let r = `${t}(?:${n.join("|")})`;
|
|
2290
|
-
return RegExp(`^${
|
|
2290
|
+
return RegExp(`^${to}T(?:${r})$`);
|
|
2291
2291
|
}
|
|
2292
|
-
var
|
|
2292
|
+
var oo = (e) => {
|
|
2293
2293
|
let t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
2294
2294
|
return RegExp(`^${t}$`);
|
|
2295
|
-
},
|
|
2295
|
+
}, so = /^-?\d+$/, co = /^-?\d+(?:\.\d+)?$/, lo = /^(?:true|false)$/i, uo = /^[^A-Z]*$/, fo = /^[^a-z]*$/, po = /*@__PURE__*/ O("$ZodCheck", (e, t) => {
|
|
2296
2296
|
var n;
|
|
2297
2297
|
e._zod ??= {}, e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
|
|
2298
2298
|
}), mo = {
|
|
2299
2299
|
number: "number",
|
|
2300
2300
|
bigint: "bigint",
|
|
2301
2301
|
object: "date"
|
|
2302
|
-
}, ho = /*@__PURE__*/
|
|
2303
|
-
|
|
2302
|
+
}, ho = /*@__PURE__*/ O("$ZodCheckLessThan", (e, t) => {
|
|
2303
|
+
po.init(e, t);
|
|
2304
2304
|
let n = mo[typeof t.value];
|
|
2305
2305
|
e._zod.onattach.push((e) => {
|
|
2306
2306
|
let n = e._zod.bag, r = (t.inclusive ? n.maximum : n.exclusiveMaximum) ?? Infinity;
|
|
@@ -2316,8 +2316,8 @@ var so = (e) => {
|
|
|
2316
2316
|
continue: !t.abort
|
|
2317
2317
|
});
|
|
2318
2318
|
};
|
|
2319
|
-
}), go = /*@__PURE__*/
|
|
2320
|
-
|
|
2319
|
+
}), go = /*@__PURE__*/ O("$ZodCheckGreaterThan", (e, t) => {
|
|
2320
|
+
po.init(e, t);
|
|
2321
2321
|
let n = mo[typeof t.value];
|
|
2322
2322
|
e._zod.onattach.push((e) => {
|
|
2323
2323
|
let n = e._zod.bag, r = (t.inclusive ? n.minimum : n.exclusiveMinimum) ?? -Infinity;
|
|
@@ -2333,13 +2333,13 @@ var so = (e) => {
|
|
|
2333
2333
|
continue: !t.abort
|
|
2334
2334
|
});
|
|
2335
2335
|
};
|
|
2336
|
-
}), _o = /*@__PURE__*/
|
|
2337
|
-
|
|
2336
|
+
}), _o = /*@__PURE__*/ O("$ZodCheckMultipleOf", (e, t) => {
|
|
2337
|
+
po.init(e, t), e._zod.onattach.push((e) => {
|
|
2338
2338
|
var n;
|
|
2339
2339
|
(n = e._zod.bag).multipleOf ?? (n.multipleOf = t.value);
|
|
2340
2340
|
}), e._zod.check = (n) => {
|
|
2341
2341
|
if (typeof n.value != typeof t.value) throw Error("Cannot mix number and bigint in multiple_of check.");
|
|
2342
|
-
(typeof n.value == "bigint" ? n.value % t.value === BigInt(0) :
|
|
2342
|
+
(typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : Bi(n.value, t.value) === 0) || n.issues.push({
|
|
2343
2343
|
origin: typeof n.value,
|
|
2344
2344
|
code: "not_multiple_of",
|
|
2345
2345
|
divisor: t.value,
|
|
@@ -2348,12 +2348,12 @@ var so = (e) => {
|
|
|
2348
2348
|
continue: !t.abort
|
|
2349
2349
|
});
|
|
2350
2350
|
};
|
|
2351
|
-
}), vo = /*@__PURE__*/
|
|
2352
|
-
|
|
2353
|
-
let n = t.format?.includes("int"), r = n ? "int" : "number", [i, a] =
|
|
2351
|
+
}), vo = /*@__PURE__*/ O("$ZodCheckNumberFormat", (e, t) => {
|
|
2352
|
+
po.init(e, t), t.format = t.format || "float64";
|
|
2353
|
+
let n = t.format?.includes("int"), r = n ? "int" : "number", [i, a] = ta[t.format];
|
|
2354
2354
|
e._zod.onattach.push((e) => {
|
|
2355
2355
|
let r = e._zod.bag;
|
|
2356
|
-
r.format = t.format, r.minimum = i, r.maximum = a, n && (r.pattern =
|
|
2356
|
+
r.format = t.format, r.minimum = i, r.maximum = a, n && (r.pattern = so);
|
|
2357
2357
|
}), e._zod.check = (o) => {
|
|
2358
2358
|
let s = o.value;
|
|
2359
2359
|
if (n) {
|
|
@@ -2409,18 +2409,18 @@ var so = (e) => {
|
|
|
2409
2409
|
continue: !t.abort
|
|
2410
2410
|
});
|
|
2411
2411
|
};
|
|
2412
|
-
}), yo = /*@__PURE__*/
|
|
2412
|
+
}), yo = /*@__PURE__*/ O("$ZodCheckMaxLength", (e, t) => {
|
|
2413
2413
|
var n;
|
|
2414
|
-
|
|
2414
|
+
po.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
|
|
2415
2415
|
let t = e.value;
|
|
2416
|
-
return !
|
|
2416
|
+
return !Ri(t) && t.length !== void 0;
|
|
2417
2417
|
}), e._zod.onattach.push((e) => {
|
|
2418
2418
|
let n = e._zod.bag.maximum ?? Infinity;
|
|
2419
2419
|
t.maximum < n && (e._zod.bag.maximum = t.maximum);
|
|
2420
2420
|
}), e._zod.check = (n) => {
|
|
2421
2421
|
let r = n.value;
|
|
2422
2422
|
if (r.length <= t.maximum) return;
|
|
2423
|
-
let i =
|
|
2423
|
+
let i = ma(r);
|
|
2424
2424
|
n.issues.push({
|
|
2425
2425
|
origin: i,
|
|
2426
2426
|
code: "too_big",
|
|
@@ -2431,18 +2431,18 @@ var so = (e) => {
|
|
|
2431
2431
|
continue: !t.abort
|
|
2432
2432
|
});
|
|
2433
2433
|
};
|
|
2434
|
-
}), bo = /*@__PURE__*/
|
|
2434
|
+
}), bo = /*@__PURE__*/ O("$ZodCheckMinLength", (e, t) => {
|
|
2435
2435
|
var n;
|
|
2436
|
-
|
|
2436
|
+
po.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
|
|
2437
2437
|
let t = e.value;
|
|
2438
|
-
return !
|
|
2438
|
+
return !Ri(t) && t.length !== void 0;
|
|
2439
2439
|
}), e._zod.onattach.push((e) => {
|
|
2440
2440
|
let n = e._zod.bag.minimum ?? -Infinity;
|
|
2441
2441
|
t.minimum > n && (e._zod.bag.minimum = t.minimum);
|
|
2442
2442
|
}), e._zod.check = (n) => {
|
|
2443
2443
|
let r = n.value;
|
|
2444
2444
|
if (r.length >= t.minimum) return;
|
|
2445
|
-
let i =
|
|
2445
|
+
let i = ma(r);
|
|
2446
2446
|
n.issues.push({
|
|
2447
2447
|
origin: i,
|
|
2448
2448
|
code: "too_small",
|
|
@@ -2453,18 +2453,18 @@ var so = (e) => {
|
|
|
2453
2453
|
continue: !t.abort
|
|
2454
2454
|
});
|
|
2455
2455
|
};
|
|
2456
|
-
}), xo = /*@__PURE__*/
|
|
2456
|
+
}), xo = /*@__PURE__*/ O("$ZodCheckLengthEquals", (e, t) => {
|
|
2457
2457
|
var n;
|
|
2458
|
-
|
|
2458
|
+
po.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
|
|
2459
2459
|
let t = e.value;
|
|
2460
|
-
return !
|
|
2460
|
+
return !Ri(t) && t.length !== void 0;
|
|
2461
2461
|
}), e._zod.onattach.push((e) => {
|
|
2462
2462
|
let n = e._zod.bag;
|
|
2463
2463
|
n.minimum = t.length, n.maximum = t.length, n.length = t.length;
|
|
2464
2464
|
}), e._zod.check = (n) => {
|
|
2465
2465
|
let r = n.value, i = r.length;
|
|
2466
2466
|
if (i === t.length) return;
|
|
2467
|
-
let a =
|
|
2467
|
+
let a = ma(r), o = i > t.length;
|
|
2468
2468
|
n.issues.push({
|
|
2469
2469
|
origin: a,
|
|
2470
2470
|
...o ? {
|
|
@@ -2481,9 +2481,9 @@ var so = (e) => {
|
|
|
2481
2481
|
continue: !t.abort
|
|
2482
2482
|
});
|
|
2483
2483
|
};
|
|
2484
|
-
}), So = /*@__PURE__*/
|
|
2484
|
+
}), So = /*@__PURE__*/ O("$ZodCheckStringFormat", (e, t) => {
|
|
2485
2485
|
var n, r;
|
|
2486
|
-
|
|
2486
|
+
po.init(e, t), e._zod.onattach.push((e) => {
|
|
2487
2487
|
let n = e._zod.bag;
|
|
2488
2488
|
n.format = t.format, t.pattern && (n.patterns ??= /* @__PURE__ */ new Set(), n.patterns.add(t.pattern));
|
|
2489
2489
|
}), t.pattern ? (n = e._zod).check ?? (n.check = (n) => {
|
|
@@ -2497,7 +2497,7 @@ var so = (e) => {
|
|
|
2497
2497
|
continue: !t.abort
|
|
2498
2498
|
});
|
|
2499
2499
|
}) : (r = e._zod).check ?? (r.check = () => {});
|
|
2500
|
-
}), Co = /*@__PURE__*/
|
|
2500
|
+
}), Co = /*@__PURE__*/ O("$ZodCheckRegex", (e, t) => {
|
|
2501
2501
|
So.init(e, t), e._zod.check = (n) => {
|
|
2502
2502
|
t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
|
|
2503
2503
|
origin: "string",
|
|
@@ -2509,13 +2509,13 @@ var so = (e) => {
|
|
|
2509
2509
|
continue: !t.abort
|
|
2510
2510
|
});
|
|
2511
2511
|
};
|
|
2512
|
-
}), wo = /*@__PURE__*/
|
|
2512
|
+
}), wo = /*@__PURE__*/ O("$ZodCheckLowerCase", (e, t) => {
|
|
2513
|
+
t.pattern ??= uo, So.init(e, t);
|
|
2514
|
+
}), To = /*@__PURE__*/ O("$ZodCheckUpperCase", (e, t) => {
|
|
2513
2515
|
t.pattern ??= fo, So.init(e, t);
|
|
2514
|
-
}),
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
A.init(e, t);
|
|
2518
|
-
let n = $i(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
2516
|
+
}), Eo = /*@__PURE__*/ O("$ZodCheckIncludes", (e, t) => {
|
|
2517
|
+
po.init(e, t);
|
|
2518
|
+
let n = Qi(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
2519
2519
|
t.pattern = r, e._zod.onattach.push((e) => {
|
|
2520
2520
|
let t = e._zod.bag;
|
|
2521
2521
|
t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(r);
|
|
@@ -2530,9 +2530,9 @@ var so = (e) => {
|
|
|
2530
2530
|
continue: !t.abort
|
|
2531
2531
|
});
|
|
2532
2532
|
};
|
|
2533
|
-
}), Do = /*@__PURE__*/
|
|
2534
|
-
|
|
2535
|
-
let n = RegExp(`^${
|
|
2533
|
+
}), Do = /*@__PURE__*/ O("$ZodCheckStartsWith", (e, t) => {
|
|
2534
|
+
po.init(e, t);
|
|
2535
|
+
let n = RegExp(`^${Qi(t.prefix)}.*`);
|
|
2536
2536
|
t.pattern ??= n, e._zod.onattach.push((e) => {
|
|
2537
2537
|
let t = e._zod.bag;
|
|
2538
2538
|
t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
|
|
@@ -2547,9 +2547,9 @@ var so = (e) => {
|
|
|
2547
2547
|
continue: !t.abort
|
|
2548
2548
|
});
|
|
2549
2549
|
};
|
|
2550
|
-
}), Oo = /*@__PURE__*/
|
|
2551
|
-
|
|
2552
|
-
let n = RegExp(`.*${
|
|
2550
|
+
}), Oo = /*@__PURE__*/ O("$ZodCheckEndsWith", (e, t) => {
|
|
2551
|
+
po.init(e, t);
|
|
2552
|
+
let n = RegExp(`.*${Qi(t.suffix)}$`);
|
|
2553
2553
|
t.pattern ??= n, e._zod.onattach.push((e) => {
|
|
2554
2554
|
let t = e._zod.bag;
|
|
2555
2555
|
t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
|
|
@@ -2564,8 +2564,8 @@ var so = (e) => {
|
|
|
2564
2564
|
continue: !t.abort
|
|
2565
2565
|
});
|
|
2566
2566
|
};
|
|
2567
|
-
}), ko = /*@__PURE__*/
|
|
2568
|
-
|
|
2567
|
+
}), ko = /*@__PURE__*/ O("$ZodCheckOverwrite", (e, t) => {
|
|
2568
|
+
po.init(e, t), e._zod.check = (e) => {
|
|
2569
2569
|
e.value = t.tx(e.value);
|
|
2570
2570
|
};
|
|
2571
2571
|
}), Ao = class {
|
|
@@ -2591,7 +2591,7 @@ var so = (e) => {
|
|
|
2591
2591
|
major: 4,
|
|
2592
2592
|
minor: 4,
|
|
2593
2593
|
patch: 3
|
|
2594
|
-
}, j = /*@__PURE__*/
|
|
2594
|
+
}, j = /*@__PURE__*/ O("$ZodType", (e, t) => {
|
|
2595
2595
|
var n;
|
|
2596
2596
|
e ??= {}, e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = jo;
|
|
2597
2597
|
let r = [...e._zod.def.checks ?? []];
|
|
@@ -2602,27 +2602,27 @@ var so = (e) => {
|
|
|
2602
2602
|
});
|
|
2603
2603
|
else {
|
|
2604
2604
|
let t = (e, t, n) => {
|
|
2605
|
-
let r =
|
|
2605
|
+
let r = la(e), i;
|
|
2606
2606
|
for (let a of t) {
|
|
2607
2607
|
if (a._zod.def.when) {
|
|
2608
|
-
if (
|
|
2608
|
+
if (ua(e) || !a._zod.def.when(e)) continue;
|
|
2609
2609
|
} else if (r) continue;
|
|
2610
2610
|
let t = e.issues.length, o = a._zod.check(e);
|
|
2611
|
-
if (o instanceof Promise && n?.async === !1) throw new
|
|
2611
|
+
if (o instanceof Promise && n?.async === !1) throw new ji();
|
|
2612
2612
|
if (i || o instanceof Promise) i = (i ?? Promise.resolve()).then(async () => {
|
|
2613
|
-
await o, e.issues.length !== t && (r ||=
|
|
2613
|
+
await o, e.issues.length !== t && (r ||= la(e, t));
|
|
2614
2614
|
});
|
|
2615
2615
|
else {
|
|
2616
2616
|
if (e.issues.length === t) continue;
|
|
2617
|
-
r ||=
|
|
2617
|
+
r ||= la(e, t);
|
|
2618
2618
|
}
|
|
2619
2619
|
}
|
|
2620
2620
|
return i ? i.then(() => e) : e;
|
|
2621
2621
|
}, n = (n, i, a) => {
|
|
2622
|
-
if (
|
|
2622
|
+
if (la(n)) return n.aborted = !0, n;
|
|
2623
2623
|
let o = t(i, r, a);
|
|
2624
2624
|
if (o instanceof Promise) {
|
|
2625
|
-
if (a.async === !1) throw new
|
|
2625
|
+
if (a.async === !1) throw new ji();
|
|
2626
2626
|
return o.then((t) => e._zod.parse(t, a));
|
|
2627
2627
|
}
|
|
2628
2628
|
return e._zod.parse(o, a);
|
|
@@ -2641,26 +2641,26 @@ var so = (e) => {
|
|
|
2641
2641
|
}
|
|
2642
2642
|
let o = e._zod.parse(i, a);
|
|
2643
2643
|
if (o instanceof Promise) {
|
|
2644
|
-
if (a.async === !1) throw new
|
|
2644
|
+
if (a.async === !1) throw new ji();
|
|
2645
2645
|
return o.then((e) => t(e, r, a));
|
|
2646
2646
|
}
|
|
2647
2647
|
return t(o, r, a);
|
|
2648
2648
|
};
|
|
2649
2649
|
}
|
|
2650
|
-
|
|
2650
|
+
k(e, "~standard", () => ({
|
|
2651
2651
|
validate: (t) => {
|
|
2652
2652
|
try {
|
|
2653
|
-
let n =
|
|
2653
|
+
let n = wa(e, t);
|
|
2654
2654
|
return n.success ? { value: n.data } : { issues: n.error?.issues };
|
|
2655
2655
|
} catch {
|
|
2656
|
-
return
|
|
2656
|
+
return Ea(e, t).then((e) => e.success ? { value: e.data } : { issues: e.error?.issues });
|
|
2657
2657
|
}
|
|
2658
2658
|
},
|
|
2659
2659
|
vendor: "zod",
|
|
2660
2660
|
version: 1
|
|
2661
2661
|
}));
|
|
2662
|
-
}), Mo = /*@__PURE__*/
|
|
2663
|
-
j.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ??
|
|
2662
|
+
}), Mo = /*@__PURE__*/ O("$ZodString", (e, t) => {
|
|
2663
|
+
j.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? oo(e._zod.bag), e._zod.parse = (n, r) => {
|
|
2664
2664
|
if (t.coerce) try {
|
|
2665
2665
|
n.value = String(n.value);
|
|
2666
2666
|
} catch {}
|
|
@@ -2671,11 +2671,11 @@ var so = (e) => {
|
|
|
2671
2671
|
inst: e
|
|
2672
2672
|
}), n;
|
|
2673
2673
|
};
|
|
2674
|
-
}), M = /*@__PURE__*/
|
|
2674
|
+
}), M = /*@__PURE__*/ O("$ZodStringFormat", (e, t) => {
|
|
2675
2675
|
So.init(e, t), Mo.init(e, t);
|
|
2676
|
-
}), No = /*@__PURE__*/
|
|
2677
|
-
t.pattern ??=
|
|
2678
|
-
}), Po = /*@__PURE__*/
|
|
2676
|
+
}), No = /*@__PURE__*/ O("$ZodGUID", (e, t) => {
|
|
2677
|
+
t.pattern ??= Ha, M.init(e, t);
|
|
2678
|
+
}), Po = /*@__PURE__*/ O("$ZodUUID", (e, t) => {
|
|
2679
2679
|
if (t.version) {
|
|
2680
2680
|
let e = {
|
|
2681
2681
|
v1: 1,
|
|
@@ -2688,16 +2688,16 @@ var so = (e) => {
|
|
|
2688
2688
|
v8: 8
|
|
2689
2689
|
}[t.version];
|
|
2690
2690
|
if (e === void 0) throw Error(`Invalid UUID version: "${t.version}"`);
|
|
2691
|
-
t.pattern ??=
|
|
2692
|
-
} else t.pattern ??=
|
|
2691
|
+
t.pattern ??= Ua(e);
|
|
2692
|
+
} else t.pattern ??= Ua();
|
|
2693
2693
|
M.init(e, t);
|
|
2694
|
-
}), Fo = /*@__PURE__*/
|
|
2695
|
-
t.pattern ??=
|
|
2696
|
-
}), Io = /*@__PURE__*/
|
|
2694
|
+
}), Fo = /*@__PURE__*/ O("$ZodEmail", (e, t) => {
|
|
2695
|
+
t.pattern ??= Wa, M.init(e, t);
|
|
2696
|
+
}), Io = /*@__PURE__*/ O("$ZodURL", (e, t) => {
|
|
2697
2697
|
M.init(e, t), e._zod.check = (n) => {
|
|
2698
2698
|
try {
|
|
2699
2699
|
let r = n.value.trim();
|
|
2700
|
-
if (!t.normalize && t.protocol?.source ===
|
|
2700
|
+
if (!t.normalize && t.protocol?.source === $a.source && !/^https?:\/\//i.test(r)) {
|
|
2701
2701
|
n.issues.push({
|
|
2702
2702
|
code: "invalid_format",
|
|
2703
2703
|
format: "url",
|
|
@@ -2737,32 +2737,32 @@ var so = (e) => {
|
|
|
2737
2737
|
});
|
|
2738
2738
|
}
|
|
2739
2739
|
};
|
|
2740
|
-
}), Lo = /*@__PURE__*/
|
|
2741
|
-
t.pattern ??=
|
|
2742
|
-
}), Ro = /*@__PURE__*/
|
|
2743
|
-
t.pattern ??=
|
|
2744
|
-
}), zo = /*@__PURE__*/
|
|
2740
|
+
}), Lo = /*@__PURE__*/ O("$ZodEmoji", (e, t) => {
|
|
2741
|
+
t.pattern ??= Ka(), M.init(e, t);
|
|
2742
|
+
}), Ro = /*@__PURE__*/ O("$ZodNanoID", (e, t) => {
|
|
2743
|
+
t.pattern ??= Ba, M.init(e, t);
|
|
2744
|
+
}), zo = /*@__PURE__*/ O("$ZodCUID", (e, t) => {
|
|
2745
|
+
t.pattern ??= Fa, M.init(e, t);
|
|
2746
|
+
}), Bo = /*@__PURE__*/ O("$ZodCUID2", (e, t) => {
|
|
2745
2747
|
t.pattern ??= Ia, M.init(e, t);
|
|
2746
|
-
}),
|
|
2748
|
+
}), Vo = /*@__PURE__*/ O("$ZodULID", (e, t) => {
|
|
2747
2749
|
t.pattern ??= La, M.init(e, t);
|
|
2748
|
-
}),
|
|
2750
|
+
}), Ho = /*@__PURE__*/ O("$ZodXID", (e, t) => {
|
|
2749
2751
|
t.pattern ??= Ra, M.init(e, t);
|
|
2750
|
-
}),
|
|
2752
|
+
}), Uo = /*@__PURE__*/ O("$ZodKSUID", (e, t) => {
|
|
2751
2753
|
t.pattern ??= za, M.init(e, t);
|
|
2752
|
-
}),
|
|
2753
|
-
t.pattern ??= Ba, M.init(e, t);
|
|
2754
|
-
}), Wo = /*@__PURE__*/ D("$ZodISODateTime", (e, t) => {
|
|
2755
|
-
t.pattern ??= oo(t), M.init(e, t);
|
|
2756
|
-
}), Go = /*@__PURE__*/ D("$ZodISODate", (e, t) => {
|
|
2757
|
-
t.pattern ??= ro, M.init(e, t);
|
|
2758
|
-
}), Ko = /*@__PURE__*/ D("$ZodISOTime", (e, t) => {
|
|
2754
|
+
}), Wo = /*@__PURE__*/ O("$ZodISODateTime", (e, t) => {
|
|
2759
2755
|
t.pattern ??= ao(t), M.init(e, t);
|
|
2760
|
-
}),
|
|
2761
|
-
t.pattern ??=
|
|
2762
|
-
}),
|
|
2763
|
-
t.pattern ??=
|
|
2764
|
-
}),
|
|
2765
|
-
t.pattern ??=
|
|
2756
|
+
}), Go = /*@__PURE__*/ O("$ZodISODate", (e, t) => {
|
|
2757
|
+
t.pattern ??= no, M.init(e, t);
|
|
2758
|
+
}), Ko = /*@__PURE__*/ O("$ZodISOTime", (e, t) => {
|
|
2759
|
+
t.pattern ??= io(t), M.init(e, t);
|
|
2760
|
+
}), qo = /*@__PURE__*/ O("$ZodISODuration", (e, t) => {
|
|
2761
|
+
t.pattern ??= Va, M.init(e, t);
|
|
2762
|
+
}), Jo = /*@__PURE__*/ O("$ZodIPv4", (e, t) => {
|
|
2763
|
+
t.pattern ??= qa, M.init(e, t), e._zod.bag.format = "ipv4";
|
|
2764
|
+
}), Yo = /*@__PURE__*/ O("$ZodIPv6", (e, t) => {
|
|
2765
|
+
t.pattern ??= Ja, M.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
|
|
2766
2766
|
try {
|
|
2767
2767
|
new URL(`http://[${n.value}]`);
|
|
2768
2768
|
} catch {
|
|
@@ -2775,10 +2775,10 @@ var so = (e) => {
|
|
|
2775
2775
|
});
|
|
2776
2776
|
}
|
|
2777
2777
|
};
|
|
2778
|
-
}), Xo = /*@__PURE__*/
|
|
2779
|
-
t.pattern ??=
|
|
2780
|
-
}), Zo = /*@__PURE__*/
|
|
2781
|
-
t.pattern ??=
|
|
2778
|
+
}), Xo = /*@__PURE__*/ O("$ZodCIDRv4", (e, t) => {
|
|
2779
|
+
t.pattern ??= Ya, M.init(e, t);
|
|
2780
|
+
}), Zo = /*@__PURE__*/ O("$ZodCIDRv6", (e, t) => {
|
|
2781
|
+
t.pattern ??= Xa, M.init(e, t), e._zod.check = (n) => {
|
|
2782
2782
|
let r = n.value.split("/");
|
|
2783
2783
|
try {
|
|
2784
2784
|
if (r.length !== 2) throw Error();
|
|
@@ -2807,8 +2807,8 @@ function Qo(e) {
|
|
|
2807
2807
|
return !1;
|
|
2808
2808
|
}
|
|
2809
2809
|
}
|
|
2810
|
-
var $o = /*@__PURE__*/
|
|
2811
|
-
t.pattern ??=
|
|
2810
|
+
var $o = /*@__PURE__*/ O("$ZodBase64", (e, t) => {
|
|
2811
|
+
t.pattern ??= Za, M.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
|
|
2812
2812
|
Qo(n.value) || n.issues.push({
|
|
2813
2813
|
code: "invalid_format",
|
|
2814
2814
|
format: "base64",
|
|
@@ -2819,12 +2819,12 @@ var $o = /*@__PURE__*/ D("$ZodBase64", (e, t) => {
|
|
|
2819
2819
|
};
|
|
2820
2820
|
});
|
|
2821
2821
|
function es(e) {
|
|
2822
|
-
if (
|
|
2822
|
+
if (!Qa.test(e)) return !1;
|
|
2823
2823
|
let t = e.replace(/[-_]/g, (e) => e === "-" ? "+" : "/");
|
|
2824
2824
|
return Qo(t.padEnd(Math.ceil(t.length / 4) * 4, "="));
|
|
2825
2825
|
}
|
|
2826
|
-
var ts = /*@__PURE__*/
|
|
2827
|
-
t.pattern ??=
|
|
2826
|
+
var ts = /*@__PURE__*/ O("$ZodBase64URL", (e, t) => {
|
|
2827
|
+
t.pattern ??= Qa, M.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
|
|
2828
2828
|
es(n.value) || n.issues.push({
|
|
2829
2829
|
code: "invalid_format",
|
|
2830
2830
|
format: "base64url",
|
|
@@ -2833,8 +2833,8 @@ var ts = /*@__PURE__*/ D("$ZodBase64URL", (e, t) => {
|
|
|
2833
2833
|
continue: !t.abort
|
|
2834
2834
|
});
|
|
2835
2835
|
};
|
|
2836
|
-
}), ns = /*@__PURE__*/
|
|
2837
|
-
t.pattern ??=
|
|
2836
|
+
}), ns = /*@__PURE__*/ O("$ZodE164", (e, t) => {
|
|
2837
|
+
t.pattern ??= eo, M.init(e, t);
|
|
2838
2838
|
});
|
|
2839
2839
|
function rs(e, t = null) {
|
|
2840
2840
|
try {
|
|
@@ -2848,7 +2848,7 @@ function rs(e, t = null) {
|
|
|
2848
2848
|
return !1;
|
|
2849
2849
|
}
|
|
2850
2850
|
}
|
|
2851
|
-
var is = /*@__PURE__*/
|
|
2851
|
+
var is = /*@__PURE__*/ O("$ZodJWT", (e, t) => {
|
|
2852
2852
|
M.init(e, t), e._zod.check = (n) => {
|
|
2853
2853
|
rs(n.value, t.alg) || n.issues.push({
|
|
2854
2854
|
code: "invalid_format",
|
|
@@ -2858,8 +2858,8 @@ var is = /*@__PURE__*/ D("$ZodJWT", (e, t) => {
|
|
|
2858
2858
|
continue: !t.abort
|
|
2859
2859
|
});
|
|
2860
2860
|
};
|
|
2861
|
-
}), as = /*@__PURE__*/
|
|
2862
|
-
j.init(e, t), e._zod.pattern = e._zod.bag.pattern ??
|
|
2861
|
+
}), as = /*@__PURE__*/ O("$ZodNumber", (e, t) => {
|
|
2862
|
+
j.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? co, e._zod.parse = (n, r) => {
|
|
2863
2863
|
if (t.coerce) try {
|
|
2864
2864
|
n.value = Number(n.value);
|
|
2865
2865
|
} catch {}
|
|
@@ -2874,10 +2874,10 @@ var is = /*@__PURE__*/ D("$ZodJWT", (e, t) => {
|
|
|
2874
2874
|
...a ? { received: a } : {}
|
|
2875
2875
|
}), n;
|
|
2876
2876
|
};
|
|
2877
|
-
}), os = /*@__PURE__*/
|
|
2877
|
+
}), os = /*@__PURE__*/ O("$ZodNumberFormat", (e, t) => {
|
|
2878
2878
|
vo.init(e, t), as.init(e, t);
|
|
2879
|
-
}), ss = /*@__PURE__*/
|
|
2880
|
-
j.init(e, t), e._zod.pattern =
|
|
2879
|
+
}), ss = /*@__PURE__*/ O("$ZodBoolean", (e, t) => {
|
|
2880
|
+
j.init(e, t), e._zod.pattern = lo, e._zod.parse = (n, r) => {
|
|
2881
2881
|
if (t.coerce) try {
|
|
2882
2882
|
n.value = !!n.value;
|
|
2883
2883
|
} catch {}
|
|
@@ -2889,9 +2889,9 @@ var is = /*@__PURE__*/ D("$ZodJWT", (e, t) => {
|
|
|
2889
2889
|
inst: e
|
|
2890
2890
|
}), n;
|
|
2891
2891
|
};
|
|
2892
|
-
}), cs = /*@__PURE__*/
|
|
2892
|
+
}), cs = /*@__PURE__*/ O("$ZodUnknown", (e, t) => {
|
|
2893
2893
|
j.init(e, t), e._zod.parse = (e) => e;
|
|
2894
|
-
}), ls = /*@__PURE__*/
|
|
2894
|
+
}), ls = /*@__PURE__*/ O("$ZodNever", (e, t) => {
|
|
2895
2895
|
j.init(e, t), e._zod.parse = (t, n) => (t.issues.push({
|
|
2896
2896
|
expected: "never",
|
|
2897
2897
|
code: "invalid_type",
|
|
@@ -2900,9 +2900,9 @@ var is = /*@__PURE__*/ D("$ZodJWT", (e, t) => {
|
|
|
2900
2900
|
}), t);
|
|
2901
2901
|
});
|
|
2902
2902
|
function us(e, t, n) {
|
|
2903
|
-
e.issues.length && t.issues.push(...
|
|
2903
|
+
e.issues.length && t.issues.push(...da(n, e.issues)), t.value[n] = e.value;
|
|
2904
2904
|
}
|
|
2905
|
-
var ds = /*@__PURE__*/
|
|
2905
|
+
var ds = /*@__PURE__*/ O("$ZodArray", (e, t) => {
|
|
2906
2906
|
j.init(e, t), e._zod.parse = (n, r) => {
|
|
2907
2907
|
let i = n.value;
|
|
2908
2908
|
if (!Array.isArray(i)) return n.issues.push({
|
|
@@ -2927,7 +2927,7 @@ function fs(e, t, n, r, i, a) {
|
|
|
2927
2927
|
let o = n in r;
|
|
2928
2928
|
if (e.issues.length) {
|
|
2929
2929
|
if (i && a && !o) return;
|
|
2930
|
-
t.issues.push(...
|
|
2930
|
+
t.issues.push(...da(n, e.issues));
|
|
2931
2931
|
}
|
|
2932
2932
|
if (!o && !i) {
|
|
2933
2933
|
e.issues.length || t.issues.push({
|
|
@@ -2943,7 +2943,7 @@ function fs(e, t, n, r, i, a) {
|
|
|
2943
2943
|
function ps(e) {
|
|
2944
2944
|
let t = Object.keys(e.shape);
|
|
2945
2945
|
for (let n of t) if (!e.shape?.[n]?._zod?.traits?.has("$ZodType")) throw Error(`Invalid element at key "${n}": expected a Zod schema`);
|
|
2946
|
-
let n =
|
|
2946
|
+
let n = ea(e.shape);
|
|
2947
2947
|
return {
|
|
2948
2948
|
...e,
|
|
2949
2949
|
keys: t,
|
|
@@ -2973,7 +2973,7 @@ function ms(e, t, n, r, i, a) {
|
|
|
2973
2973
|
inst: a
|
|
2974
2974
|
}), e.length ? Promise.all(e).then(() => n) : n;
|
|
2975
2975
|
}
|
|
2976
|
-
var hs = /*@__PURE__*/
|
|
2976
|
+
var hs = /*@__PURE__*/ O("$ZodObject", (e, t) => {
|
|
2977
2977
|
if (j.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
|
|
2978
2978
|
let e = t.shape;
|
|
2979
2979
|
Object.defineProperty(t, "shape", { get: () => {
|
|
@@ -2981,8 +2981,8 @@ var hs = /*@__PURE__*/ D("$ZodObject", (e, t) => {
|
|
|
2981
2981
|
return Object.defineProperty(t, "shape", { value: n }), n;
|
|
2982
2982
|
} });
|
|
2983
2983
|
}
|
|
2984
|
-
let n =
|
|
2985
|
-
|
|
2984
|
+
let n = Li(() => ps(t));
|
|
2985
|
+
k(e._zod, "propValues", () => {
|
|
2986
2986
|
let e = t.shape, n = {};
|
|
2987
2987
|
for (let t in e) {
|
|
2988
2988
|
let r = e[t]._zod;
|
|
@@ -2993,7 +2993,7 @@ var hs = /*@__PURE__*/ D("$ZodObject", (e, t) => {
|
|
|
2993
2993
|
}
|
|
2994
2994
|
return n;
|
|
2995
2995
|
});
|
|
2996
|
-
let r =
|
|
2996
|
+
let r = qi, i = t.catchall, a;
|
|
2997
2997
|
e._zod.parse = (t, o) => {
|
|
2998
2998
|
a ??= n.value;
|
|
2999
2999
|
let s = t.value;
|
|
@@ -3014,15 +3014,15 @@ var hs = /*@__PURE__*/ D("$ZodObject", (e, t) => {
|
|
|
3014
3014
|
}
|
|
3015
3015
|
return i ? ms(c, s, t, o, n.value, e) : c.length ? Promise.all(c).then(() => t) : t;
|
|
3016
3016
|
};
|
|
3017
|
-
}), gs = /*@__PURE__*/
|
|
3017
|
+
}), gs = /*@__PURE__*/ O("$ZodObjectJIT", (e, t) => {
|
|
3018
3018
|
hs.init(e, t);
|
|
3019
|
-
let n = e._zod.parse, r =
|
|
3019
|
+
let n = e._zod.parse, r = Li(() => ps(t)), i = (e) => {
|
|
3020
3020
|
let t = new Ao([
|
|
3021
3021
|
"shape",
|
|
3022
3022
|
"payload",
|
|
3023
3023
|
"ctx"
|
|
3024
3024
|
]), n = r.value, i = (e) => {
|
|
3025
|
-
let t =
|
|
3025
|
+
let t = Wi(e);
|
|
3026
3026
|
return `shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`;
|
|
3027
3027
|
};
|
|
3028
3028
|
t.write("const input = payload.value;");
|
|
@@ -3030,7 +3030,7 @@ var hs = /*@__PURE__*/ D("$ZodObject", (e, t) => {
|
|
|
3030
3030
|
for (let e of n.keys) a[e] = `key_${o++}`;
|
|
3031
3031
|
t.write("const newResult = {};");
|
|
3032
3032
|
for (let r of n.keys) {
|
|
3033
|
-
let n = a[r], o =
|
|
3033
|
+
let n = a[r], o = Wi(r), s = e[r], c = s?._zod?.optin === "optional", l = s?._zod?.optout === "optional";
|
|
3034
3034
|
t.write(`const ${n} = ${i(r)};`), c && l ? t.write(`
|
|
3035
3035
|
if (${n}.issues.length) {
|
|
3036
3036
|
if (${o} in input) {
|
|
@@ -3095,7 +3095,7 @@ var hs = /*@__PURE__*/ D("$ZodObject", (e, t) => {
|
|
|
3095
3095
|
t.write("payload.value = newResult;"), t.write("return payload;");
|
|
3096
3096
|
let s = t.compile();
|
|
3097
3097
|
return (t, n) => s(e, t, n);
|
|
3098
|
-
}, a, o =
|
|
3098
|
+
}, a, o = qi, s = !Ni.jitless, c = s && Ji.value, l = t.catchall, u;
|
|
3099
3099
|
e._zod.parse = (d, f) => {
|
|
3100
3100
|
u ??= r.value;
|
|
3101
3101
|
let p = d.value;
|
|
@@ -3109,21 +3109,21 @@ var hs = /*@__PURE__*/ D("$ZodObject", (e, t) => {
|
|
|
3109
3109
|
});
|
|
3110
3110
|
function _s(e, t, n, r) {
|
|
3111
3111
|
for (let n of e) if (n.issues.length === 0) return t.value = n.value, t;
|
|
3112
|
-
let i = e.filter((e) => !
|
|
3112
|
+
let i = e.filter((e) => !la(e));
|
|
3113
3113
|
return i.length === 1 ? (t.value = i[0].value, i[0]) : (t.issues.push({
|
|
3114
3114
|
code: "invalid_union",
|
|
3115
3115
|
input: t.value,
|
|
3116
3116
|
inst: n,
|
|
3117
|
-
errors: e.map((e) => e.issues.map((e) =>
|
|
3117
|
+
errors: e.map((e) => e.issues.map((e) => pa(e, r, Pi())))
|
|
3118
3118
|
}), t);
|
|
3119
3119
|
}
|
|
3120
|
-
var vs = /*@__PURE__*/
|
|
3121
|
-
j.init(e, t),
|
|
3120
|
+
var vs = /*@__PURE__*/ O("$ZodUnion", (e, t) => {
|
|
3121
|
+
j.init(e, t), k(e._zod, "optin", () => t.options.some((e) => e._zod.optin === "optional") ? "optional" : void 0), k(e._zod, "optout", () => t.options.some((e) => e._zod.optout === "optional") ? "optional" : void 0), k(e._zod, "values", () => {
|
|
3122
3122
|
if (t.options.every((e) => e._zod.values)) return new Set(t.options.flatMap((e) => Array.from(e._zod.values)));
|
|
3123
|
-
}),
|
|
3123
|
+
}), k(e._zod, "pattern", () => {
|
|
3124
3124
|
if (t.options.every((e) => e._zod.pattern)) {
|
|
3125
3125
|
let e = t.options.map((e) => e._zod.pattern);
|
|
3126
|
-
return RegExp(`^(${e.map((e) =>
|
|
3126
|
+
return RegExp(`^(${e.map((e) => zi(e.source)).join("|")})$`);
|
|
3127
3127
|
}
|
|
3128
3128
|
});
|
|
3129
3129
|
let n = t.options.length === 1 ? t.options[0]._zod.run : null;
|
|
@@ -3143,10 +3143,10 @@ var vs = /*@__PURE__*/ D("$ZodUnion", (e, t) => {
|
|
|
3143
3143
|
}
|
|
3144
3144
|
return a ? Promise.all(o).then((t) => _s(t, r, e, i)) : _s(o, r, e, i);
|
|
3145
3145
|
};
|
|
3146
|
-
}), ys = /*@__PURE__*/
|
|
3146
|
+
}), ys = /*@__PURE__*/ O("$ZodDiscriminatedUnion", (e, t) => {
|
|
3147
3147
|
t.inclusive = !1, vs.init(e, t);
|
|
3148
3148
|
let n = e._zod.parse;
|
|
3149
|
-
|
|
3149
|
+
k(e._zod, "propValues", () => {
|
|
3150
3150
|
let e = {};
|
|
3151
3151
|
for (let n of t.options) {
|
|
3152
3152
|
let r = n._zod.propValues;
|
|
@@ -3158,7 +3158,7 @@ var vs = /*@__PURE__*/ D("$ZodUnion", (e, t) => {
|
|
|
3158
3158
|
}
|
|
3159
3159
|
return e;
|
|
3160
3160
|
});
|
|
3161
|
-
let r =
|
|
3161
|
+
let r = Li(() => {
|
|
3162
3162
|
let e = t.options, n = /* @__PURE__ */ new Map();
|
|
3163
3163
|
for (let r of e) {
|
|
3164
3164
|
let e = r._zod.propValues?.[t.discriminator];
|
|
@@ -3172,7 +3172,7 @@ var vs = /*@__PURE__*/ D("$ZodUnion", (e, t) => {
|
|
|
3172
3172
|
});
|
|
3173
3173
|
e._zod.parse = (i, a) => {
|
|
3174
3174
|
let o = i.value;
|
|
3175
|
-
if (!
|
|
3175
|
+
if (!qi(o)) return i.issues.push({
|
|
3176
3176
|
code: "invalid_type",
|
|
3177
3177
|
expected: "object",
|
|
3178
3178
|
input: o,
|
|
@@ -3190,7 +3190,7 @@ var vs = /*@__PURE__*/ D("$ZodUnion", (e, t) => {
|
|
|
3190
3190
|
inst: e
|
|
3191
3191
|
}), i);
|
|
3192
3192
|
};
|
|
3193
|
-
}), bs = /*@__PURE__*/
|
|
3193
|
+
}), bs = /*@__PURE__*/ O("$ZodIntersection", (e, t) => {
|
|
3194
3194
|
j.init(e, t), e._zod.parse = (e, n) => {
|
|
3195
3195
|
let r = e.value, i = t.left._zod.run({
|
|
3196
3196
|
value: r,
|
|
@@ -3207,7 +3207,7 @@ function xs(e, t) {
|
|
|
3207
3207
|
valid: !0,
|
|
3208
3208
|
data: e
|
|
3209
3209
|
};
|
|
3210
|
-
if (
|
|
3210
|
+
if (Yi(e) && Yi(t)) {
|
|
3211
3211
|
let n = Object.keys(t), r = Object.keys(e).filter((e) => n.indexOf(e) !== -1), i = {
|
|
3212
3212
|
...e,
|
|
3213
3213
|
...t
|
|
@@ -3261,15 +3261,15 @@ function Ss(e, t, n) {
|
|
|
3261
3261
|
if (a.length && i && e.issues.push({
|
|
3262
3262
|
...i,
|
|
3263
3263
|
keys: a
|
|
3264
|
-
}),
|
|
3264
|
+
}), la(e)) return e;
|
|
3265
3265
|
let o = xs(t.value, n.value);
|
|
3266
3266
|
if (!o.valid) throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);
|
|
3267
3267
|
return e.value = o.data, e;
|
|
3268
3268
|
}
|
|
3269
|
-
var Cs = /*@__PURE__*/
|
|
3269
|
+
var Cs = /*@__PURE__*/ O("$ZodRecord", (e, t) => {
|
|
3270
3270
|
j.init(e, t), e._zod.parse = (n, r) => {
|
|
3271
3271
|
let i = n.value;
|
|
3272
|
-
if (!
|
|
3272
|
+
if (!Yi(i)) return n.issues.push({
|
|
3273
3273
|
expected: "record",
|
|
3274
3274
|
code: "invalid_type",
|
|
3275
3275
|
input: i,
|
|
@@ -3290,7 +3290,7 @@ var Cs = /*@__PURE__*/ D("$ZodRecord", (e, t) => {
|
|
|
3290
3290
|
n.issues.push({
|
|
3291
3291
|
code: "invalid_key",
|
|
3292
3292
|
origin: "record",
|
|
3293
|
-
issues: o.issues.map((e) =>
|
|
3293
|
+
issues: o.issues.map((e) => pa(e, r, Pi())),
|
|
3294
3294
|
input: c,
|
|
3295
3295
|
path: [c],
|
|
3296
3296
|
inst: e
|
|
@@ -3302,8 +3302,8 @@ var Cs = /*@__PURE__*/ D("$ZodRecord", (e, t) => {
|
|
|
3302
3302
|
issues: []
|
|
3303
3303
|
}, r);
|
|
3304
3304
|
u instanceof Promise ? a.push(u.then((e) => {
|
|
3305
|
-
e.issues.length && n.issues.push(...
|
|
3306
|
-
})) : (u.issues.length && n.issues.push(...
|
|
3305
|
+
e.issues.length && n.issues.push(...da(c, e.issues)), n.value[l] = e.value;
|
|
3306
|
+
})) : (u.issues.length && n.issues.push(...da(c, u.issues)), n.value[l] = u.value);
|
|
3307
3307
|
}
|
|
3308
3308
|
let c;
|
|
3309
3309
|
for (let e in i) s.has(e) || (c ??= [], c.push(e));
|
|
@@ -3322,7 +3322,7 @@ var Cs = /*@__PURE__*/ D("$ZodRecord", (e, t) => {
|
|
|
3322
3322
|
issues: []
|
|
3323
3323
|
}, r);
|
|
3324
3324
|
if (s instanceof Promise) throw Error("Async schemas not supported in object keys currently");
|
|
3325
|
-
if (typeof o == "string" &&
|
|
3325
|
+
if (typeof o == "string" && co.test(o) && s.issues.length) {
|
|
3326
3326
|
let e = t.keyType._zod.run({
|
|
3327
3327
|
value: Number(o),
|
|
3328
3328
|
issues: []
|
|
@@ -3334,7 +3334,7 @@ var Cs = /*@__PURE__*/ D("$ZodRecord", (e, t) => {
|
|
|
3334
3334
|
t.mode === "loose" ? n.value[o] = i[o] : n.issues.push({
|
|
3335
3335
|
code: "invalid_key",
|
|
3336
3336
|
origin: "record",
|
|
3337
|
-
issues: s.issues.map((e) =>
|
|
3337
|
+
issues: s.issues.map((e) => pa(e, r, Pi())),
|
|
3338
3338
|
input: o,
|
|
3339
3339
|
path: [o],
|
|
3340
3340
|
inst: e
|
|
@@ -3346,16 +3346,16 @@ var Cs = /*@__PURE__*/ D("$ZodRecord", (e, t) => {
|
|
|
3346
3346
|
issues: []
|
|
3347
3347
|
}, r);
|
|
3348
3348
|
c instanceof Promise ? a.push(c.then((e) => {
|
|
3349
|
-
e.issues.length && n.issues.push(...
|
|
3350
|
-
})) : (c.issues.length && n.issues.push(...
|
|
3349
|
+
e.issues.length && n.issues.push(...da(o, e.issues)), n.value[s.value] = e.value;
|
|
3350
|
+
})) : (c.issues.length && n.issues.push(...da(o, c.issues)), n.value[s.value] = c.value);
|
|
3351
3351
|
}
|
|
3352
3352
|
}
|
|
3353
3353
|
return a.length ? Promise.all(a).then(() => n) : n;
|
|
3354
3354
|
};
|
|
3355
|
-
}), ws = /*@__PURE__*/
|
|
3355
|
+
}), ws = /*@__PURE__*/ O("$ZodEnum", (e, t) => {
|
|
3356
3356
|
j.init(e, t);
|
|
3357
|
-
let n =
|
|
3358
|
-
e._zod.values = r, e._zod.pattern = RegExp(`^(${n.filter((e) =>
|
|
3357
|
+
let n = Fi(t.entries), r = new Set(n);
|
|
3358
|
+
e._zod.values = r, e._zod.pattern = RegExp(`^(${n.filter((e) => Zi.has(typeof e)).map((e) => typeof e == "string" ? Qi(e) : e.toString()).join("|")})$`), e._zod.parse = (t, i) => {
|
|
3359
3359
|
let a = t.value;
|
|
3360
3360
|
return r.has(a) || t.issues.push({
|
|
3361
3361
|
code: "invalid_value",
|
|
@@ -3364,10 +3364,10 @@ var Cs = /*@__PURE__*/ D("$ZodRecord", (e, t) => {
|
|
|
3364
3364
|
inst: e
|
|
3365
3365
|
}), t;
|
|
3366
3366
|
};
|
|
3367
|
-
}), Ts = /*@__PURE__*/
|
|
3367
|
+
}), Ts = /*@__PURE__*/ O("$ZodLiteral", (e, t) => {
|
|
3368
3368
|
if (j.init(e, t), t.values.length === 0) throw Error("Cannot create literal schema with no valid values");
|
|
3369
3369
|
let n = new Set(t.values);
|
|
3370
|
-
e._zod.values = n, e._zod.pattern = RegExp(`^(${t.values.map((e) => typeof e == "string" ?
|
|
3370
|
+
e._zod.values = n, e._zod.pattern = RegExp(`^(${t.values.map((e) => typeof e == "string" ? Qi(e) : e ? Qi(e.toString()) : String(e)).join("|")})$`), e._zod.parse = (r, i) => {
|
|
3371
3371
|
let a = r.value;
|
|
3372
3372
|
return n.has(a) || r.issues.push({
|
|
3373
3373
|
code: "invalid_value",
|
|
@@ -3376,12 +3376,12 @@ var Cs = /*@__PURE__*/ D("$ZodRecord", (e, t) => {
|
|
|
3376
3376
|
inst: e
|
|
3377
3377
|
}), r;
|
|
3378
3378
|
};
|
|
3379
|
-
}), Es = /*@__PURE__*/
|
|
3379
|
+
}), Es = /*@__PURE__*/ O("$ZodTransform", (e, t) => {
|
|
3380
3380
|
j.init(e, t), e._zod.optin = "optional", e._zod.parse = (n, r) => {
|
|
3381
|
-
if (r.direction === "backward") throw new
|
|
3381
|
+
if (r.direction === "backward") throw new Mi(e.constructor.name);
|
|
3382
3382
|
let i = t.transform(n.value, n);
|
|
3383
3383
|
if (r.async) return (i instanceof Promise ? i : Promise.resolve(i)).then((e) => (n.value = e, n.fallback = !0, n));
|
|
3384
|
-
if (i instanceof Promise) throw new
|
|
3384
|
+
if (i instanceof Promise) throw new ji();
|
|
3385
3385
|
return n.value = i, n.fallback = !0, n;
|
|
3386
3386
|
};
|
|
3387
3387
|
});
|
|
@@ -3391,10 +3391,10 @@ function Ds(e, t) {
|
|
|
3391
3391
|
value: void 0
|
|
3392
3392
|
} : e;
|
|
3393
3393
|
}
|
|
3394
|
-
var Os = /*@__PURE__*/
|
|
3395
|
-
j.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional",
|
|
3394
|
+
var Os = /*@__PURE__*/ O("$ZodOptional", (e, t) => {
|
|
3395
|
+
j.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", k(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), k(e._zod, "pattern", () => {
|
|
3396
3396
|
let e = t.innerType._zod.pattern;
|
|
3397
|
-
return e ? RegExp(`^(${
|
|
3397
|
+
return e ? RegExp(`^(${zi(e.source)})?$`) : void 0;
|
|
3398
3398
|
}), e._zod.parse = (e, n) => {
|
|
3399
3399
|
if (t.innerType._zod.optin === "optional") {
|
|
3400
3400
|
let r = e.value, i = t.innerType._zod.run(e, n);
|
|
@@ -3402,15 +3402,15 @@ var Os = /*@__PURE__*/ D("$ZodOptional", (e, t) => {
|
|
|
3402
3402
|
}
|
|
3403
3403
|
return e.value === void 0 ? e : t.innerType._zod.run(e, n);
|
|
3404
3404
|
};
|
|
3405
|
-
}), ks = /*@__PURE__*/
|
|
3406
|
-
Os.init(e, t),
|
|
3407
|
-
}), As = /*@__PURE__*/
|
|
3408
|
-
j.init(e, t),
|
|
3405
|
+
}), ks = /*@__PURE__*/ O("$ZodExactOptional", (e, t) => {
|
|
3406
|
+
Os.init(e, t), k(e._zod, "values", () => t.innerType._zod.values), k(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (e, n) => t.innerType._zod.run(e, n);
|
|
3407
|
+
}), As = /*@__PURE__*/ O("$ZodNullable", (e, t) => {
|
|
3408
|
+
j.init(e, t), k(e._zod, "optin", () => t.innerType._zod.optin), k(e._zod, "optout", () => t.innerType._zod.optout), k(e._zod, "pattern", () => {
|
|
3409
3409
|
let e = t.innerType._zod.pattern;
|
|
3410
|
-
return e ? RegExp(`^(${
|
|
3411
|
-
}),
|
|
3412
|
-
}), js = /*@__PURE__*/
|
|
3413
|
-
j.init(e, t), e._zod.optin = "optional",
|
|
3410
|
+
return e ? RegExp(`^(${zi(e.source)}|null)$`) : void 0;
|
|
3411
|
+
}), k(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (e, n) => e.value === null ? e : t.innerType._zod.run(e, n);
|
|
3412
|
+
}), js = /*@__PURE__*/ O("$ZodDefault", (e, t) => {
|
|
3413
|
+
j.init(e, t), e._zod.optin = "optional", k(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => {
|
|
3414
3414
|
if (n.direction === "backward") return t.innerType._zod.run(e, n);
|
|
3415
3415
|
if (e.value === void 0) return e.value = t.defaultValue, e;
|
|
3416
3416
|
let r = t.innerType._zod.run(e, n);
|
|
@@ -3420,10 +3420,10 @@ var Os = /*@__PURE__*/ D("$ZodOptional", (e, t) => {
|
|
|
3420
3420
|
function Ms(e, t) {
|
|
3421
3421
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
3422
3422
|
}
|
|
3423
|
-
var Ns = /*@__PURE__*/
|
|
3424
|
-
j.init(e, t), e._zod.optin = "optional",
|
|
3425
|
-
}), Ps = /*@__PURE__*/
|
|
3426
|
-
j.init(e, t),
|
|
3423
|
+
var Ns = /*@__PURE__*/ O("$ZodPrefault", (e, t) => {
|
|
3424
|
+
j.init(e, t), e._zod.optin = "optional", k(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => (n.direction === "backward" || e.value === void 0 && (e.value = t.defaultValue), t.innerType._zod.run(e, n));
|
|
3425
|
+
}), Ps = /*@__PURE__*/ O("$ZodNonOptional", (e, t) => {
|
|
3426
|
+
j.init(e, t), k(e._zod, "values", () => {
|
|
3427
3427
|
let e = t.innerType._zod.values;
|
|
3428
3428
|
return e ? new Set([...e].filter((e) => e !== void 0)) : void 0;
|
|
3429
3429
|
}), e._zod.parse = (n, r) => {
|
|
@@ -3439,22 +3439,22 @@ function Fs(e, t) {
|
|
|
3439
3439
|
inst: t
|
|
3440
3440
|
}), e;
|
|
3441
3441
|
}
|
|
3442
|
-
var Is = /*@__PURE__*/
|
|
3443
|
-
j.init(e, t), e._zod.optin = "optional",
|
|
3442
|
+
var Is = /*@__PURE__*/ O("$ZodCatch", (e, t) => {
|
|
3443
|
+
j.init(e, t), e._zod.optin = "optional", k(e._zod, "optout", () => t.innerType._zod.optout), k(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => {
|
|
3444
3444
|
if (n.direction === "backward") return t.innerType._zod.run(e, n);
|
|
3445
3445
|
let r = t.innerType._zod.run(e, n);
|
|
3446
3446
|
return r instanceof Promise ? r.then((r) => (e.value = r.value, r.issues.length && (e.value = t.catchValue({
|
|
3447
3447
|
...e,
|
|
3448
|
-
error: { issues: r.issues.map((e) =>
|
|
3448
|
+
error: { issues: r.issues.map((e) => pa(e, n, Pi())) },
|
|
3449
3449
|
input: e.value
|
|
3450
3450
|
}), e.issues = [], e.fallback = !0), e)) : (e.value = r.value, r.issues.length && (e.value = t.catchValue({
|
|
3451
3451
|
...e,
|
|
3452
|
-
error: { issues: r.issues.map((e) =>
|
|
3452
|
+
error: { issues: r.issues.map((e) => pa(e, n, Pi())) },
|
|
3453
3453
|
input: e.value
|
|
3454
3454
|
}), e.issues = [], e.fallback = !0), e);
|
|
3455
3455
|
};
|
|
3456
|
-
}), Ls = /*@__PURE__*/
|
|
3457
|
-
j.init(e, t),
|
|
3456
|
+
}), Ls = /*@__PURE__*/ O("$ZodPipe", (e, t) => {
|
|
3457
|
+
j.init(e, t), k(e._zod, "values", () => t.in._zod.values), k(e._zod, "optin", () => t.in._zod.optin), k(e._zod, "optout", () => t.out._zod.optout), k(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (e, n) => {
|
|
3458
3458
|
if (n.direction === "backward") {
|
|
3459
3459
|
let r = t.out._zod.run(e, n);
|
|
3460
3460
|
return r instanceof Promise ? r.then((e) => Rs(e, t.in, n)) : Rs(r, t.in, n);
|
|
@@ -3470,10 +3470,10 @@ function Rs(e, t, n) {
|
|
|
3470
3470
|
fallback: e.fallback
|
|
3471
3471
|
}, n);
|
|
3472
3472
|
}
|
|
3473
|
-
var zs = /*@__PURE__*/
|
|
3473
|
+
var zs = /*@__PURE__*/ O("$ZodPreprocess", (e, t) => {
|
|
3474
3474
|
Ls.init(e, t);
|
|
3475
|
-
}), Bs = /*@__PURE__*/
|
|
3476
|
-
j.init(e, t),
|
|
3475
|
+
}), Bs = /*@__PURE__*/ O("$ZodReadonly", (e, t) => {
|
|
3476
|
+
j.init(e, t), k(e._zod, "propValues", () => t.innerType._zod.propValues), k(e._zod, "values", () => t.innerType._zod.values), k(e._zod, "optin", () => t.innerType?._zod?.optin), k(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (e, n) => {
|
|
3477
3477
|
if (n.direction === "backward") return t.innerType._zod.run(e, n);
|
|
3478
3478
|
let r = t.innerType._zod.run(e, n);
|
|
3479
3479
|
return r instanceof Promise ? r.then(Vs) : Vs(r);
|
|
@@ -3482,13 +3482,13 @@ var zs = /*@__PURE__*/ D("$ZodPreprocess", (e, t) => {
|
|
|
3482
3482
|
function Vs(e) {
|
|
3483
3483
|
return e.value = Object.freeze(e.value), e;
|
|
3484
3484
|
}
|
|
3485
|
-
var Hs = /*@__PURE__*/
|
|
3486
|
-
j.init(e, t),
|
|
3485
|
+
var Hs = /*@__PURE__*/ O("$ZodLazy", (e, t) => {
|
|
3486
|
+
j.init(e, t), k(e._zod, "innerType", () => {
|
|
3487
3487
|
let e = t;
|
|
3488
3488
|
return e._cachedInner ||= t.getter(), e._cachedInner;
|
|
3489
|
-
}),
|
|
3490
|
-
}), Us = /*@__PURE__*/
|
|
3491
|
-
|
|
3489
|
+
}), k(e._zod, "pattern", () => e._zod.innerType?._zod?.pattern), k(e._zod, "propValues", () => e._zod.innerType?._zod?.propValues), k(e._zod, "optin", () => e._zod.innerType?._zod?.optin ?? void 0), k(e._zod, "optout", () => e._zod.innerType?._zod?.optout ?? void 0), e._zod.parse = (t, n) => e._zod.innerType._zod.run(t, n);
|
|
3490
|
+
}), Us = /*@__PURE__*/ O("$ZodCustom", (e, t) => {
|
|
3491
|
+
po.init(e, t), j.init(e, t), e._zod.parse = (e, t) => e, e._zod.check = (n) => {
|
|
3492
3492
|
let r = n.value, i = t.fn(r);
|
|
3493
3493
|
if (i instanceof Promise) return i.then((t) => Ws(t, n, r, e));
|
|
3494
3494
|
Ws(i, n, r, e);
|
|
@@ -3503,7 +3503,7 @@ function Ws(e, t, n, r) {
|
|
|
3503
3503
|
path: [...r._zod.def.path ?? []],
|
|
3504
3504
|
continue: !r._zod.def.abort
|
|
3505
3505
|
};
|
|
3506
|
-
r._zod.def.params && (e.params = r._zod.def.params), t.issues.push(
|
|
3506
|
+
r._zod.def.params && (e.params = r._zod.def.params), t.issues.push(ha(e));
|
|
3507
3507
|
}
|
|
3508
3508
|
}
|
|
3509
3509
|
//#endregion
|
|
@@ -3551,7 +3551,7 @@ var Js = globalThis.__zod_globalRegistry;
|
|
|
3551
3551
|
function Ys(e, t) {
|
|
3552
3552
|
return new e({
|
|
3553
3553
|
type: "string",
|
|
3554
|
-
...
|
|
3554
|
+
...A(t)
|
|
3555
3555
|
});
|
|
3556
3556
|
}
|
|
3557
3557
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3561,7 +3561,7 @@ function Xs(e, t) {
|
|
|
3561
3561
|
format: "email",
|
|
3562
3562
|
check: "string_format",
|
|
3563
3563
|
abort: !1,
|
|
3564
|
-
...
|
|
3564
|
+
...A(t)
|
|
3565
3565
|
});
|
|
3566
3566
|
}
|
|
3567
3567
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3571,7 +3571,7 @@ function Zs(e, t) {
|
|
|
3571
3571
|
format: "guid",
|
|
3572
3572
|
check: "string_format",
|
|
3573
3573
|
abort: !1,
|
|
3574
|
-
...
|
|
3574
|
+
...A(t)
|
|
3575
3575
|
});
|
|
3576
3576
|
}
|
|
3577
3577
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3581,7 +3581,7 @@ function Qs(e, t) {
|
|
|
3581
3581
|
format: "uuid",
|
|
3582
3582
|
check: "string_format",
|
|
3583
3583
|
abort: !1,
|
|
3584
|
-
...
|
|
3584
|
+
...A(t)
|
|
3585
3585
|
});
|
|
3586
3586
|
}
|
|
3587
3587
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3592,7 +3592,7 @@ function $s(e, t) {
|
|
|
3592
3592
|
check: "string_format",
|
|
3593
3593
|
abort: !1,
|
|
3594
3594
|
version: "v4",
|
|
3595
|
-
...
|
|
3595
|
+
...A(t)
|
|
3596
3596
|
});
|
|
3597
3597
|
}
|
|
3598
3598
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3603,7 +3603,7 @@ function ec(e, t) {
|
|
|
3603
3603
|
check: "string_format",
|
|
3604
3604
|
abort: !1,
|
|
3605
3605
|
version: "v6",
|
|
3606
|
-
...
|
|
3606
|
+
...A(t)
|
|
3607
3607
|
});
|
|
3608
3608
|
}
|
|
3609
3609
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3614,7 +3614,7 @@ function tc(e, t) {
|
|
|
3614
3614
|
check: "string_format",
|
|
3615
3615
|
abort: !1,
|
|
3616
3616
|
version: "v7",
|
|
3617
|
-
...
|
|
3617
|
+
...A(t)
|
|
3618
3618
|
});
|
|
3619
3619
|
}
|
|
3620
3620
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3624,7 +3624,7 @@ function nc(e, t) {
|
|
|
3624
3624
|
format: "url",
|
|
3625
3625
|
check: "string_format",
|
|
3626
3626
|
abort: !1,
|
|
3627
|
-
...
|
|
3627
|
+
...A(t)
|
|
3628
3628
|
});
|
|
3629
3629
|
}
|
|
3630
3630
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3634,7 +3634,7 @@ function rc(e, t) {
|
|
|
3634
3634
|
format: "emoji",
|
|
3635
3635
|
check: "string_format",
|
|
3636
3636
|
abort: !1,
|
|
3637
|
-
...
|
|
3637
|
+
...A(t)
|
|
3638
3638
|
});
|
|
3639
3639
|
}
|
|
3640
3640
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3644,7 +3644,7 @@ function ic(e, t) {
|
|
|
3644
3644
|
format: "nanoid",
|
|
3645
3645
|
check: "string_format",
|
|
3646
3646
|
abort: !1,
|
|
3647
|
-
...
|
|
3647
|
+
...A(t)
|
|
3648
3648
|
});
|
|
3649
3649
|
}
|
|
3650
3650
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3654,7 +3654,7 @@ function ac(e, t) {
|
|
|
3654
3654
|
format: "cuid",
|
|
3655
3655
|
check: "string_format",
|
|
3656
3656
|
abort: !1,
|
|
3657
|
-
...
|
|
3657
|
+
...A(t)
|
|
3658
3658
|
});
|
|
3659
3659
|
}
|
|
3660
3660
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3664,7 +3664,7 @@ function oc(e, t) {
|
|
|
3664
3664
|
format: "cuid2",
|
|
3665
3665
|
check: "string_format",
|
|
3666
3666
|
abort: !1,
|
|
3667
|
-
...
|
|
3667
|
+
...A(t)
|
|
3668
3668
|
});
|
|
3669
3669
|
}
|
|
3670
3670
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3674,7 +3674,7 @@ function sc(e, t) {
|
|
|
3674
3674
|
format: "ulid",
|
|
3675
3675
|
check: "string_format",
|
|
3676
3676
|
abort: !1,
|
|
3677
|
-
...
|
|
3677
|
+
...A(t)
|
|
3678
3678
|
});
|
|
3679
3679
|
}
|
|
3680
3680
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3684,7 +3684,7 @@ function cc(e, t) {
|
|
|
3684
3684
|
format: "xid",
|
|
3685
3685
|
check: "string_format",
|
|
3686
3686
|
abort: !1,
|
|
3687
|
-
...
|
|
3687
|
+
...A(t)
|
|
3688
3688
|
});
|
|
3689
3689
|
}
|
|
3690
3690
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3694,7 +3694,7 @@ function lc(e, t) {
|
|
|
3694
3694
|
format: "ksuid",
|
|
3695
3695
|
check: "string_format",
|
|
3696
3696
|
abort: !1,
|
|
3697
|
-
...
|
|
3697
|
+
...A(t)
|
|
3698
3698
|
});
|
|
3699
3699
|
}
|
|
3700
3700
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3704,7 +3704,7 @@ function uc(e, t) {
|
|
|
3704
3704
|
format: "ipv4",
|
|
3705
3705
|
check: "string_format",
|
|
3706
3706
|
abort: !1,
|
|
3707
|
-
...
|
|
3707
|
+
...A(t)
|
|
3708
3708
|
});
|
|
3709
3709
|
}
|
|
3710
3710
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3714,7 +3714,7 @@ function dc(e, t) {
|
|
|
3714
3714
|
format: "ipv6",
|
|
3715
3715
|
check: "string_format",
|
|
3716
3716
|
abort: !1,
|
|
3717
|
-
...
|
|
3717
|
+
...A(t)
|
|
3718
3718
|
});
|
|
3719
3719
|
}
|
|
3720
3720
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3724,7 +3724,7 @@ function fc(e, t) {
|
|
|
3724
3724
|
format: "cidrv4",
|
|
3725
3725
|
check: "string_format",
|
|
3726
3726
|
abort: !1,
|
|
3727
|
-
...
|
|
3727
|
+
...A(t)
|
|
3728
3728
|
});
|
|
3729
3729
|
}
|
|
3730
3730
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3734,7 +3734,7 @@ function pc(e, t) {
|
|
|
3734
3734
|
format: "cidrv6",
|
|
3735
3735
|
check: "string_format",
|
|
3736
3736
|
abort: !1,
|
|
3737
|
-
...
|
|
3737
|
+
...A(t)
|
|
3738
3738
|
});
|
|
3739
3739
|
}
|
|
3740
3740
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3744,7 +3744,7 @@ function mc(e, t) {
|
|
|
3744
3744
|
format: "base64",
|
|
3745
3745
|
check: "string_format",
|
|
3746
3746
|
abort: !1,
|
|
3747
|
-
...
|
|
3747
|
+
...A(t)
|
|
3748
3748
|
});
|
|
3749
3749
|
}
|
|
3750
3750
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3754,7 +3754,7 @@ function hc(e, t) {
|
|
|
3754
3754
|
format: "base64url",
|
|
3755
3755
|
check: "string_format",
|
|
3756
3756
|
abort: !1,
|
|
3757
|
-
...
|
|
3757
|
+
...A(t)
|
|
3758
3758
|
});
|
|
3759
3759
|
}
|
|
3760
3760
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3764,7 +3764,7 @@ function gc(e, t) {
|
|
|
3764
3764
|
format: "e164",
|
|
3765
3765
|
check: "string_format",
|
|
3766
3766
|
abort: !1,
|
|
3767
|
-
...
|
|
3767
|
+
...A(t)
|
|
3768
3768
|
});
|
|
3769
3769
|
}
|
|
3770
3770
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3774,7 +3774,7 @@ function _c(e, t) {
|
|
|
3774
3774
|
format: "jwt",
|
|
3775
3775
|
check: "string_format",
|
|
3776
3776
|
abort: !1,
|
|
3777
|
-
...
|
|
3777
|
+
...A(t)
|
|
3778
3778
|
});
|
|
3779
3779
|
}
|
|
3780
3780
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3786,7 +3786,7 @@ function vc(e, t) {
|
|
|
3786
3786
|
offset: !1,
|
|
3787
3787
|
local: !1,
|
|
3788
3788
|
precision: null,
|
|
3789
|
-
...
|
|
3789
|
+
...A(t)
|
|
3790
3790
|
});
|
|
3791
3791
|
}
|
|
3792
3792
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3795,7 +3795,7 @@ function yc(e, t) {
|
|
|
3795
3795
|
type: "string",
|
|
3796
3796
|
format: "date",
|
|
3797
3797
|
check: "string_format",
|
|
3798
|
-
...
|
|
3798
|
+
...A(t)
|
|
3799
3799
|
});
|
|
3800
3800
|
}
|
|
3801
3801
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3805,7 +3805,7 @@ function bc(e, t) {
|
|
|
3805
3805
|
format: "time",
|
|
3806
3806
|
check: "string_format",
|
|
3807
3807
|
precision: null,
|
|
3808
|
-
...
|
|
3808
|
+
...A(t)
|
|
3809
3809
|
});
|
|
3810
3810
|
}
|
|
3811
3811
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3814,7 +3814,7 @@ function xc(e, t) {
|
|
|
3814
3814
|
type: "string",
|
|
3815
3815
|
format: "duration",
|
|
3816
3816
|
check: "string_format",
|
|
3817
|
-
...
|
|
3817
|
+
...A(t)
|
|
3818
3818
|
});
|
|
3819
3819
|
}
|
|
3820
3820
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3822,7 +3822,7 @@ function Sc(e, t) {
|
|
|
3822
3822
|
return new e({
|
|
3823
3823
|
type: "number",
|
|
3824
3824
|
checks: [],
|
|
3825
|
-
...
|
|
3825
|
+
...A(t)
|
|
3826
3826
|
});
|
|
3827
3827
|
}
|
|
3828
3828
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3832,14 +3832,14 @@ function Cc(e, t) {
|
|
|
3832
3832
|
check: "number_format",
|
|
3833
3833
|
abort: !1,
|
|
3834
3834
|
format: "safeint",
|
|
3835
|
-
...
|
|
3835
|
+
...A(t)
|
|
3836
3836
|
});
|
|
3837
3837
|
}
|
|
3838
3838
|
// @__NO_SIDE_EFFECTS__
|
|
3839
3839
|
function wc(e, t) {
|
|
3840
3840
|
return new e({
|
|
3841
3841
|
type: "boolean",
|
|
3842
|
-
...
|
|
3842
|
+
...A(t)
|
|
3843
3843
|
});
|
|
3844
3844
|
}
|
|
3845
3845
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3850,14 +3850,14 @@ function Tc(e) {
|
|
|
3850
3850
|
function Ec(e, t) {
|
|
3851
3851
|
return new e({
|
|
3852
3852
|
type: "never",
|
|
3853
|
-
...
|
|
3853
|
+
...A(t)
|
|
3854
3854
|
});
|
|
3855
3855
|
}
|
|
3856
3856
|
// @__NO_SIDE_EFFECTS__
|
|
3857
3857
|
function Dc(e, t) {
|
|
3858
3858
|
return new ho({
|
|
3859
3859
|
check: "less_than",
|
|
3860
|
-
...
|
|
3860
|
+
...A(t),
|
|
3861
3861
|
value: e,
|
|
3862
3862
|
inclusive: !1
|
|
3863
3863
|
});
|
|
@@ -3866,7 +3866,7 @@ function Dc(e, t) {
|
|
|
3866
3866
|
function Oc(e, t) {
|
|
3867
3867
|
return new ho({
|
|
3868
3868
|
check: "less_than",
|
|
3869
|
-
...
|
|
3869
|
+
...A(t),
|
|
3870
3870
|
value: e,
|
|
3871
3871
|
inclusive: !0
|
|
3872
3872
|
});
|
|
@@ -3875,7 +3875,7 @@ function Oc(e, t) {
|
|
|
3875
3875
|
function kc(e, t) {
|
|
3876
3876
|
return new go({
|
|
3877
3877
|
check: "greater_than",
|
|
3878
|
-
...
|
|
3878
|
+
...A(t),
|
|
3879
3879
|
value: e,
|
|
3880
3880
|
inclusive: !1
|
|
3881
3881
|
});
|
|
@@ -3884,7 +3884,7 @@ function kc(e, t) {
|
|
|
3884
3884
|
function Ac(e, t) {
|
|
3885
3885
|
return new go({
|
|
3886
3886
|
check: "greater_than",
|
|
3887
|
-
...
|
|
3887
|
+
...A(t),
|
|
3888
3888
|
value: e,
|
|
3889
3889
|
inclusive: !0
|
|
3890
3890
|
});
|
|
@@ -3893,7 +3893,7 @@ function Ac(e, t) {
|
|
|
3893
3893
|
function jc(e, t) {
|
|
3894
3894
|
return new _o({
|
|
3895
3895
|
check: "multiple_of",
|
|
3896
|
-
...
|
|
3896
|
+
...A(t),
|
|
3897
3897
|
value: e
|
|
3898
3898
|
});
|
|
3899
3899
|
}
|
|
@@ -3901,7 +3901,7 @@ function jc(e, t) {
|
|
|
3901
3901
|
function Mc(e, t) {
|
|
3902
3902
|
return new yo({
|
|
3903
3903
|
check: "max_length",
|
|
3904
|
-
...
|
|
3904
|
+
...A(t),
|
|
3905
3905
|
maximum: e
|
|
3906
3906
|
});
|
|
3907
3907
|
}
|
|
@@ -3909,7 +3909,7 @@ function Mc(e, t) {
|
|
|
3909
3909
|
function Nc(e, t) {
|
|
3910
3910
|
return new bo({
|
|
3911
3911
|
check: "min_length",
|
|
3912
|
-
...
|
|
3912
|
+
...A(t),
|
|
3913
3913
|
minimum: e
|
|
3914
3914
|
});
|
|
3915
3915
|
}
|
|
@@ -3917,7 +3917,7 @@ function Nc(e, t) {
|
|
|
3917
3917
|
function Pc(e, t) {
|
|
3918
3918
|
return new xo({
|
|
3919
3919
|
check: "length_equals",
|
|
3920
|
-
...
|
|
3920
|
+
...A(t),
|
|
3921
3921
|
length: e
|
|
3922
3922
|
});
|
|
3923
3923
|
}
|
|
@@ -3926,7 +3926,7 @@ function Fc(e, t) {
|
|
|
3926
3926
|
return new Co({
|
|
3927
3927
|
check: "string_format",
|
|
3928
3928
|
format: "regex",
|
|
3929
|
-
...
|
|
3929
|
+
...A(t),
|
|
3930
3930
|
pattern: e
|
|
3931
3931
|
});
|
|
3932
3932
|
}
|
|
@@ -3935,7 +3935,7 @@ function Ic(e) {
|
|
|
3935
3935
|
return new wo({
|
|
3936
3936
|
check: "string_format",
|
|
3937
3937
|
format: "lowercase",
|
|
3938
|
-
...
|
|
3938
|
+
...A(e)
|
|
3939
3939
|
});
|
|
3940
3940
|
}
|
|
3941
3941
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3943,7 +3943,7 @@ function Lc(e) {
|
|
|
3943
3943
|
return new To({
|
|
3944
3944
|
check: "string_format",
|
|
3945
3945
|
format: "uppercase",
|
|
3946
|
-
...
|
|
3946
|
+
...A(e)
|
|
3947
3947
|
});
|
|
3948
3948
|
}
|
|
3949
3949
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -3951,7 +3951,7 @@ function Rc(e, t) {
|
|
|
3951
3951
|
return new Eo({
|
|
3952
3952
|
check: "string_format",
|
|
3953
3953
|
format: "includes",
|
|
3954
|
-
...
|
|
3954
|
+
...A(t),
|
|
3955
3955
|
includes: e
|
|
3956
3956
|
});
|
|
3957
3957
|
}
|
|
@@ -3960,7 +3960,7 @@ function zc(e, t) {
|
|
|
3960
3960
|
return new Do({
|
|
3961
3961
|
check: "string_format",
|
|
3962
3962
|
format: "starts_with",
|
|
3963
|
-
...
|
|
3963
|
+
...A(t),
|
|
3964
3964
|
prefix: e
|
|
3965
3965
|
});
|
|
3966
3966
|
}
|
|
@@ -3969,7 +3969,7 @@ function Bc(e, t) {
|
|
|
3969
3969
|
return new Oo({
|
|
3970
3970
|
check: "string_format",
|
|
3971
3971
|
format: "ends_with",
|
|
3972
|
-
...
|
|
3972
|
+
...A(t),
|
|
3973
3973
|
suffix: e
|
|
3974
3974
|
});
|
|
3975
3975
|
}
|
|
@@ -3998,14 +3998,14 @@ function Gc() {
|
|
|
3998
3998
|
}
|
|
3999
3999
|
// @__NO_SIDE_EFFECTS__
|
|
4000
4000
|
function Kc() {
|
|
4001
|
-
return /* @__PURE__ */ Vc((e) =>
|
|
4001
|
+
return /* @__PURE__ */ Vc((e) => Gi(e));
|
|
4002
4002
|
}
|
|
4003
4003
|
// @__NO_SIDE_EFFECTS__
|
|
4004
4004
|
function qc(e, t, n) {
|
|
4005
4005
|
return new e({
|
|
4006
4006
|
type: "array",
|
|
4007
4007
|
element: t,
|
|
4008
|
-
...
|
|
4008
|
+
...A(n)
|
|
4009
4009
|
});
|
|
4010
4010
|
}
|
|
4011
4011
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -4014,25 +4014,25 @@ function Jc(e, t, n) {
|
|
|
4014
4014
|
type: "custom",
|
|
4015
4015
|
check: "custom",
|
|
4016
4016
|
fn: t,
|
|
4017
|
-
...
|
|
4017
|
+
...A(n)
|
|
4018
4018
|
});
|
|
4019
4019
|
}
|
|
4020
4020
|
// @__NO_SIDE_EFFECTS__
|
|
4021
4021
|
function Yc(e, t) {
|
|
4022
4022
|
let n = /* @__PURE__ */ Xc((t) => (t.addIssue = (e) => {
|
|
4023
|
-
if (typeof e == "string") t.issues.push(
|
|
4023
|
+
if (typeof e == "string") t.issues.push(ha(e, t.value, n._zod.def));
|
|
4024
4024
|
else {
|
|
4025
4025
|
let r = e;
|
|
4026
|
-
r.fatal && (r.continue = !1), r.code ??= "custom", r.input ??= t.value, r.inst ??= n, r.continue ??= !n._zod.def.abort, t.issues.push(
|
|
4026
|
+
r.fatal && (r.continue = !1), r.code ??= "custom", r.input ??= t.value, r.inst ??= n, r.continue ??= !n._zod.def.abort, t.issues.push(ha(r));
|
|
4027
4027
|
}
|
|
4028
4028
|
}, e(t.value, t)), t);
|
|
4029
4029
|
return n;
|
|
4030
4030
|
}
|
|
4031
4031
|
// @__NO_SIDE_EFFECTS__
|
|
4032
4032
|
function Xc(e, t) {
|
|
4033
|
-
let n = new
|
|
4033
|
+
let n = new po({
|
|
4034
4034
|
check: "custom",
|
|
4035
|
-
...
|
|
4035
|
+
...A(t)
|
|
4036
4036
|
});
|
|
4037
4037
|
return n._zod.check = e, n;
|
|
4038
4038
|
}
|
|
@@ -4284,7 +4284,7 @@ var el = (e, t = {}) => (n) => {
|
|
|
4284
4284
|
}, ol = (e, t, n, r) => {
|
|
4285
4285
|
n.not = {};
|
|
4286
4286
|
}, sl = (e, t, n, r) => {
|
|
4287
|
-
let i = e._zod.def, a =
|
|
4287
|
+
let i = e._zod.def, a = Fi(i.entries);
|
|
4288
4288
|
a.every((e) => typeof e == "number") && (n.type = "number"), a.every((e) => typeof e == "string") && (n.type = "string"), n.enum = a;
|
|
4289
4289
|
}, cl = (e, t, n, r) => {
|
|
4290
4290
|
let i = e._zod.def, a = [];
|
|
@@ -4432,45 +4432,45 @@ var el = (e, t = {}) => (n) => {
|
|
|
4432
4432
|
N(i, t, r);
|
|
4433
4433
|
let a = t.seen.get(e);
|
|
4434
4434
|
a.ref = i;
|
|
4435
|
-
}, Tl = /*@__PURE__*/
|
|
4435
|
+
}, Tl = /*@__PURE__*/ O("ZodISODateTime", (e, t) => {
|
|
4436
4436
|
Wo.init(e, t), L.init(e, t);
|
|
4437
4437
|
});
|
|
4438
4438
|
function El(e) {
|
|
4439
4439
|
return /* @__PURE__ */ vc(Tl, e);
|
|
4440
4440
|
}
|
|
4441
|
-
var Dl = /*@__PURE__*/
|
|
4441
|
+
var Dl = /*@__PURE__*/ O("ZodISODate", (e, t) => {
|
|
4442
4442
|
Go.init(e, t), L.init(e, t);
|
|
4443
4443
|
});
|
|
4444
4444
|
function Ol(e) {
|
|
4445
4445
|
return /* @__PURE__ */ yc(Dl, e);
|
|
4446
4446
|
}
|
|
4447
|
-
var kl = /*@__PURE__*/
|
|
4447
|
+
var kl = /*@__PURE__*/ O("ZodISOTime", (e, t) => {
|
|
4448
4448
|
Ko.init(e, t), L.init(e, t);
|
|
4449
4449
|
});
|
|
4450
4450
|
function Al(e) {
|
|
4451
4451
|
return /* @__PURE__ */ bc(kl, e);
|
|
4452
4452
|
}
|
|
4453
|
-
var jl = /*@__PURE__*/
|
|
4453
|
+
var jl = /*@__PURE__*/ O("ZodISODuration", (e, t) => {
|
|
4454
4454
|
qo.init(e, t), L.init(e, t);
|
|
4455
4455
|
});
|
|
4456
4456
|
function Ml(e) {
|
|
4457
4457
|
return /* @__PURE__ */ xc(jl, e);
|
|
4458
4458
|
}
|
|
4459
|
-
var Nl = /*@__PURE__*/
|
|
4460
|
-
|
|
4461
|
-
format: { value: (t) =>
|
|
4462
|
-
flatten: { value: (t) =>
|
|
4459
|
+
var Nl = /*@__PURE__*/ O("ZodError", (e, t) => {
|
|
4460
|
+
_a.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
4461
|
+
format: { value: (t) => ba(e, t) },
|
|
4462
|
+
flatten: { value: (t) => ya(e, t) },
|
|
4463
4463
|
addIssue: { value: (t) => {
|
|
4464
|
-
e.issues.push(t), e.message = JSON.stringify(e.issues,
|
|
4464
|
+
e.issues.push(t), e.message = JSON.stringify(e.issues, Ii, 2);
|
|
4465
4465
|
} },
|
|
4466
4466
|
addIssues: { value: (t) => {
|
|
4467
|
-
e.issues.push(...t), e.message = JSON.stringify(e.issues,
|
|
4467
|
+
e.issues.push(...t), e.message = JSON.stringify(e.issues, Ii, 2);
|
|
4468
4468
|
} },
|
|
4469
4469
|
isEmpty: { get() {
|
|
4470
4470
|
return e.issues.length === 0;
|
|
4471
4471
|
} }
|
|
4472
4472
|
});
|
|
4473
|
-
}, { Parent: Error }), Pl = /* @__PURE__ */
|
|
4473
|
+
}, { Parent: Error }), Pl = /* @__PURE__ */ xa(Nl), Fl = /* @__PURE__ */ Sa(Nl), Il = /* @__PURE__ */ Ca(Nl), Ll = /* @__PURE__ */ Ta(Nl), Rl = /* @__PURE__ */ Da(Nl), zl = /* @__PURE__ */ Oa(Nl), Bl = /* @__PURE__ */ ka(Nl), Vl = /* @__PURE__ */ Aa(Nl), Hl = /* @__PURE__ */ ja(Nl), Ul = /* @__PURE__ */ Ma(Nl), Wl = /* @__PURE__ */ Na(Nl), Gl = /* @__PURE__ */ Pa(Nl), Kl = /* @__PURE__ */ new WeakMap();
|
|
4474
4474
|
function ql(e, t, n) {
|
|
4475
4475
|
let r = Object.getPrototypeOf(e), i = Kl.get(r);
|
|
4476
4476
|
if (i || (i = /* @__PURE__ */ new Set(), Kl.set(r, i)), !i.has(t)) {
|
|
@@ -4501,13 +4501,13 @@ function ql(e, t, n) {
|
|
|
4501
4501
|
}
|
|
4502
4502
|
}
|
|
4503
4503
|
}
|
|
4504
|
-
var F = /*@__PURE__*/
|
|
4504
|
+
var F = /*@__PURE__*/ O("ZodType", (e, t) => (j.init(e, t), Object.assign(e["~standard"], { jsonSchema: {
|
|
4505
4505
|
input: tl(e, "input"),
|
|
4506
4506
|
output: tl(e, "output")
|
|
4507
4507
|
} }), e.toJSONSchema = el(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.parse = (t, n) => Pl(e, t, n, { callee: e.parse }), e.safeParse = (t, n) => Il(e, t, n), e.parseAsync = async (t, n) => Fl(e, t, n, { callee: e.parseAsync }), e.safeParseAsync = async (t, n) => Ll(e, t, n), e.spa = e.safeParseAsync, e.encode = (t, n) => Rl(e, t, n), e.decode = (t, n) => zl(e, t, n), e.encodeAsync = async (t, n) => Bl(e, t, n), e.decodeAsync = async (t, n) => Vl(e, t, n), e.safeEncode = (t, n) => Hl(e, t, n), e.safeDecode = (t, n) => Ul(e, t, n), e.safeEncodeAsync = async (t, n) => Wl(e, t, n), e.safeDecodeAsync = async (t, n) => Gl(e, t, n), ql(e, "ZodType", {
|
|
4508
4508
|
check(...e) {
|
|
4509
4509
|
let t = this.def;
|
|
4510
|
-
return this.clone(
|
|
4510
|
+
return this.clone(Ui(t, { checks: [...t.checks ?? [], ...e.map((e) => typeof e == "function" ? { _zod: {
|
|
4511
4511
|
check: e,
|
|
4512
4512
|
def: { check: "custom" },
|
|
4513
4513
|
onattach: []
|
|
@@ -4517,7 +4517,7 @@ var F = /*@__PURE__*/ D("ZodType", (e, t) => (j.init(e, t), Object.assign(e["~st
|
|
|
4517
4517
|
return this.check(...e);
|
|
4518
4518
|
},
|
|
4519
4519
|
clone(e, t) {
|
|
4520
|
-
return
|
|
4520
|
+
return $i(this, e, t);
|
|
4521
4521
|
},
|
|
4522
4522
|
brand() {
|
|
4523
4523
|
return this;
|
|
@@ -4599,7 +4599,7 @@ var F = /*@__PURE__*/ D("ZodType", (e, t) => (j.init(e, t), Object.assign(e["~st
|
|
|
4599
4599
|
return Js.get(e)?.description;
|
|
4600
4600
|
},
|
|
4601
4601
|
configurable: !0
|
|
4602
|
-
}), e)), Jl = /*@__PURE__*/
|
|
4602
|
+
}), e)), Jl = /*@__PURE__*/ O("_ZodString", (e, t) => {
|
|
4603
4603
|
Mo.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => rl(e, t, n, r);
|
|
4604
4604
|
let n = e._zod.bag;
|
|
4605
4605
|
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, ql(e, "_ZodString", {
|
|
@@ -4649,65 +4649,65 @@ var F = /*@__PURE__*/ D("ZodType", (e, t) => (j.init(e, t), Object.assign(e["~st
|
|
|
4649
4649
|
return this.check(/* @__PURE__ */ Kc());
|
|
4650
4650
|
}
|
|
4651
4651
|
});
|
|
4652
|
-
}), Yl = /*@__PURE__*/
|
|
4652
|
+
}), Yl = /*@__PURE__*/ O("ZodString", (e, t) => {
|
|
4653
4653
|
Mo.init(e, t), Jl.init(e, t), e.email = (t) => e.check(/* @__PURE__ */ Xs(Xl, t)), e.url = (t) => e.check(/* @__PURE__ */ nc(tu, t)), e.jwt = (t) => e.check(/* @__PURE__ */ _c(_u, t)), e.emoji = (t) => e.check(/* @__PURE__ */ rc(ru, t)), e.guid = (t) => e.check(/* @__PURE__ */ Zs(Ql, t)), e.uuid = (t) => e.check(/* @__PURE__ */ Qs($l, t)), e.uuidv4 = (t) => e.check(/* @__PURE__ */ $s($l, t)), e.uuidv6 = (t) => e.check(/* @__PURE__ */ ec($l, t)), e.uuidv7 = (t) => e.check(/* @__PURE__ */ tc($l, t)), e.nanoid = (t) => e.check(/* @__PURE__ */ ic(iu, t)), e.guid = (t) => e.check(/* @__PURE__ */ Zs(Ql, t)), e.cuid = (t) => e.check(/* @__PURE__ */ ac(au, t)), e.cuid2 = (t) => e.check(/* @__PURE__ */ oc(ou, t)), e.ulid = (t) => e.check(/* @__PURE__ */ sc(su, t)), e.base64 = (t) => e.check(/* @__PURE__ */ mc(mu, t)), e.base64url = (t) => e.check(/* @__PURE__ */ hc(hu, t)), e.xid = (t) => e.check(/* @__PURE__ */ cc(cu, t)), e.ksuid = (t) => e.check(/* @__PURE__ */ lc(lu, t)), e.ipv4 = (t) => e.check(/* @__PURE__ */ uc(uu, t)), e.ipv6 = (t) => e.check(/* @__PURE__ */ dc(du, t)), e.cidrv4 = (t) => e.check(/* @__PURE__ */ fc(fu, t)), e.cidrv6 = (t) => e.check(/* @__PURE__ */ pc(pu, t)), e.e164 = (t) => e.check(/* @__PURE__ */ gc(gu, t)), e.datetime = (t) => e.check(El(t)), e.date = (t) => e.check(Ol(t)), e.time = (t) => e.check(Al(t)), e.duration = (t) => e.check(Ml(t));
|
|
4654
4654
|
});
|
|
4655
4655
|
function I(e) {
|
|
4656
4656
|
return /* @__PURE__ */ Ys(Yl, e);
|
|
4657
4657
|
}
|
|
4658
|
-
var L = /*@__PURE__*/
|
|
4658
|
+
var L = /*@__PURE__*/ O("ZodStringFormat", (e, t) => {
|
|
4659
4659
|
M.init(e, t), Jl.init(e, t);
|
|
4660
|
-
}), Xl = /*@__PURE__*/
|
|
4660
|
+
}), Xl = /*@__PURE__*/ O("ZodEmail", (e, t) => {
|
|
4661
4661
|
Fo.init(e, t), L.init(e, t);
|
|
4662
4662
|
});
|
|
4663
4663
|
function Zl(e) {
|
|
4664
4664
|
return /* @__PURE__ */ Xs(Xl, e);
|
|
4665
4665
|
}
|
|
4666
|
-
var Ql = /*@__PURE__*/
|
|
4666
|
+
var Ql = /*@__PURE__*/ O("ZodGUID", (e, t) => {
|
|
4667
4667
|
No.init(e, t), L.init(e, t);
|
|
4668
|
-
}), $l = /*@__PURE__*/
|
|
4668
|
+
}), $l = /*@__PURE__*/ O("ZodUUID", (e, t) => {
|
|
4669
4669
|
Po.init(e, t), L.init(e, t);
|
|
4670
4670
|
});
|
|
4671
4671
|
function eu(e) {
|
|
4672
4672
|
return /* @__PURE__ */ Qs($l, e);
|
|
4673
4673
|
}
|
|
4674
|
-
var tu = /*@__PURE__*/
|
|
4674
|
+
var tu = /*@__PURE__*/ O("ZodURL", (e, t) => {
|
|
4675
4675
|
Io.init(e, t), L.init(e, t);
|
|
4676
4676
|
});
|
|
4677
4677
|
function nu(e) {
|
|
4678
4678
|
return /* @__PURE__ */ nc(tu, e);
|
|
4679
4679
|
}
|
|
4680
|
-
var ru = /*@__PURE__*/
|
|
4680
|
+
var ru = /*@__PURE__*/ O("ZodEmoji", (e, t) => {
|
|
4681
4681
|
Lo.init(e, t), L.init(e, t);
|
|
4682
|
-
}), iu = /*@__PURE__*/
|
|
4682
|
+
}), iu = /*@__PURE__*/ O("ZodNanoID", (e, t) => {
|
|
4683
4683
|
Ro.init(e, t), L.init(e, t);
|
|
4684
|
-
}), au = /*@__PURE__*/
|
|
4684
|
+
}), au = /*@__PURE__*/ O("ZodCUID", (e, t) => {
|
|
4685
4685
|
zo.init(e, t), L.init(e, t);
|
|
4686
|
-
}), ou = /*@__PURE__*/
|
|
4686
|
+
}), ou = /*@__PURE__*/ O("ZodCUID2", (e, t) => {
|
|
4687
4687
|
Bo.init(e, t), L.init(e, t);
|
|
4688
|
-
}), su = /*@__PURE__*/
|
|
4688
|
+
}), su = /*@__PURE__*/ O("ZodULID", (e, t) => {
|
|
4689
4689
|
Vo.init(e, t), L.init(e, t);
|
|
4690
|
-
}), cu = /*@__PURE__*/
|
|
4690
|
+
}), cu = /*@__PURE__*/ O("ZodXID", (e, t) => {
|
|
4691
4691
|
Ho.init(e, t), L.init(e, t);
|
|
4692
|
-
}), lu = /*@__PURE__*/
|
|
4692
|
+
}), lu = /*@__PURE__*/ O("ZodKSUID", (e, t) => {
|
|
4693
4693
|
Uo.init(e, t), L.init(e, t);
|
|
4694
|
-
}), uu = /*@__PURE__*/
|
|
4694
|
+
}), uu = /*@__PURE__*/ O("ZodIPv4", (e, t) => {
|
|
4695
4695
|
Jo.init(e, t), L.init(e, t);
|
|
4696
|
-
}), du = /*@__PURE__*/
|
|
4696
|
+
}), du = /*@__PURE__*/ O("ZodIPv6", (e, t) => {
|
|
4697
4697
|
Yo.init(e, t), L.init(e, t);
|
|
4698
|
-
}), fu = /*@__PURE__*/
|
|
4698
|
+
}), fu = /*@__PURE__*/ O("ZodCIDRv4", (e, t) => {
|
|
4699
4699
|
Xo.init(e, t), L.init(e, t);
|
|
4700
|
-
}), pu = /*@__PURE__*/
|
|
4700
|
+
}), pu = /*@__PURE__*/ O("ZodCIDRv6", (e, t) => {
|
|
4701
4701
|
Zo.init(e, t), L.init(e, t);
|
|
4702
|
-
}), mu = /*@__PURE__*/
|
|
4702
|
+
}), mu = /*@__PURE__*/ O("ZodBase64", (e, t) => {
|
|
4703
4703
|
$o.init(e, t), L.init(e, t);
|
|
4704
|
-
}), hu = /*@__PURE__*/
|
|
4704
|
+
}), hu = /*@__PURE__*/ O("ZodBase64URL", (e, t) => {
|
|
4705
4705
|
ts.init(e, t), L.init(e, t);
|
|
4706
|
-
}), gu = /*@__PURE__*/
|
|
4706
|
+
}), gu = /*@__PURE__*/ O("ZodE164", (e, t) => {
|
|
4707
4707
|
ns.init(e, t), L.init(e, t);
|
|
4708
|
-
}), _u = /*@__PURE__*/
|
|
4708
|
+
}), _u = /*@__PURE__*/ O("ZodJWT", (e, t) => {
|
|
4709
4709
|
is.init(e, t), L.init(e, t);
|
|
4710
|
-
}), vu = /*@__PURE__*/
|
|
4710
|
+
}), vu = /*@__PURE__*/ O("ZodNumber", (e, t) => {
|
|
4711
4711
|
as.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => il(e, t, n, r), ql(e, "ZodNumber", {
|
|
4712
4712
|
gt(e, t) {
|
|
4713
4713
|
return this.check(/* @__PURE__ */ kc(e, t));
|
|
@@ -4761,31 +4761,31 @@ var ru = /*@__PURE__*/ D("ZodEmoji", (e, t) => {
|
|
|
4761
4761
|
function R(e) {
|
|
4762
4762
|
return /* @__PURE__ */ Sc(vu, e);
|
|
4763
4763
|
}
|
|
4764
|
-
var yu = /*@__PURE__*/
|
|
4764
|
+
var yu = /*@__PURE__*/ O("ZodNumberFormat", (e, t) => {
|
|
4765
4765
|
os.init(e, t), vu.init(e, t);
|
|
4766
4766
|
});
|
|
4767
4767
|
function bu(e) {
|
|
4768
4768
|
return /* @__PURE__ */ Cc(yu, e);
|
|
4769
4769
|
}
|
|
4770
|
-
var xu = /*@__PURE__*/
|
|
4770
|
+
var xu = /*@__PURE__*/ O("ZodBoolean", (e, t) => {
|
|
4771
4771
|
ss.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => al(e, t, n, r);
|
|
4772
4772
|
});
|
|
4773
4773
|
function z(e) {
|
|
4774
4774
|
return /* @__PURE__ */ wc(xu, e);
|
|
4775
4775
|
}
|
|
4776
|
-
var Su = /*@__PURE__*/
|
|
4776
|
+
var Su = /*@__PURE__*/ O("ZodUnknown", (e, t) => {
|
|
4777
4777
|
cs.init(e, t), F.init(e, t), e._zod.processJSONSchema = (e, t, n) => void 0;
|
|
4778
4778
|
});
|
|
4779
4779
|
function B() {
|
|
4780
4780
|
return /* @__PURE__ */ Tc(Su);
|
|
4781
4781
|
}
|
|
4782
|
-
var Cu = /*@__PURE__*/
|
|
4782
|
+
var Cu = /*@__PURE__*/ O("ZodNever", (e, t) => {
|
|
4783
4783
|
ls.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => ol(e, t, n, r);
|
|
4784
4784
|
});
|
|
4785
4785
|
function wu(e) {
|
|
4786
4786
|
return /* @__PURE__ */ Ec(Cu, e);
|
|
4787
4787
|
}
|
|
4788
|
-
var Tu = /*@__PURE__*/
|
|
4788
|
+
var Tu = /*@__PURE__*/ O("ZodArray", (e, t) => {
|
|
4789
4789
|
ds.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => dl(e, t, n, r), e.element = t.element, ql(e, "ZodArray", {
|
|
4790
4790
|
min(e, t) {
|
|
4791
4791
|
return this.check(/* @__PURE__ */ Nc(e, t));
|
|
@@ -4807,8 +4807,8 @@ var Tu = /*@__PURE__*/ D("ZodArray", (e, t) => {
|
|
|
4807
4807
|
function V(e, t) {
|
|
4808
4808
|
return /* @__PURE__ */ qc(Tu, e, t);
|
|
4809
4809
|
}
|
|
4810
|
-
var Eu = /*@__PURE__*/
|
|
4811
|
-
gs.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => fl(e, t, n, r),
|
|
4810
|
+
var Eu = /*@__PURE__*/ O("ZodObject", (e, t) => {
|
|
4811
|
+
gs.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => fl(e, t, n, r), k(e, "shape", () => t.shape), ql(e, "ZodObject", {
|
|
4812
4812
|
keyof() {
|
|
4813
4813
|
return W(Object.keys(this._zod.def.shape));
|
|
4814
4814
|
},
|
|
@@ -4843,25 +4843,25 @@ var Eu = /*@__PURE__*/ D("ZodObject", (e, t) => {
|
|
|
4843
4843
|
});
|
|
4844
4844
|
},
|
|
4845
4845
|
extend(e) {
|
|
4846
|
-
return
|
|
4846
|
+
return ia(this, e);
|
|
4847
4847
|
},
|
|
4848
4848
|
safeExtend(e) {
|
|
4849
|
-
return
|
|
4849
|
+
return aa(this, e);
|
|
4850
4850
|
},
|
|
4851
4851
|
merge(e) {
|
|
4852
|
-
return
|
|
4852
|
+
return oa(this, e);
|
|
4853
4853
|
},
|
|
4854
4854
|
pick(e) {
|
|
4855
|
-
return
|
|
4855
|
+
return na(this, e);
|
|
4856
4856
|
},
|
|
4857
4857
|
omit(e) {
|
|
4858
|
-
return
|
|
4858
|
+
return ra(this, e);
|
|
4859
4859
|
},
|
|
4860
4860
|
partial(...e) {
|
|
4861
|
-
return
|
|
4861
|
+
return sa(Ru, this, e[0]);
|
|
4862
4862
|
},
|
|
4863
4863
|
required(...e) {
|
|
4864
|
-
return
|
|
4864
|
+
return ca(Ju, this, e[0]);
|
|
4865
4865
|
}
|
|
4866
4866
|
});
|
|
4867
4867
|
});
|
|
@@ -4869,20 +4869,20 @@ function H(e, t) {
|
|
|
4869
4869
|
return new Eu({
|
|
4870
4870
|
type: "object",
|
|
4871
4871
|
shape: e ?? {},
|
|
4872
|
-
...
|
|
4872
|
+
...A(t)
|
|
4873
4873
|
});
|
|
4874
4874
|
}
|
|
4875
|
-
var Du = /*@__PURE__*/
|
|
4875
|
+
var Du = /*@__PURE__*/ O("ZodUnion", (e, t) => {
|
|
4876
4876
|
vs.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => pl(e, t, n, r), e.options = t.options;
|
|
4877
4877
|
});
|
|
4878
4878
|
function Ou(e, t) {
|
|
4879
4879
|
return new Du({
|
|
4880
4880
|
type: "union",
|
|
4881
4881
|
options: e,
|
|
4882
|
-
...
|
|
4882
|
+
...A(t)
|
|
4883
4883
|
});
|
|
4884
4884
|
}
|
|
4885
|
-
var ku = /*@__PURE__*/
|
|
4885
|
+
var ku = /*@__PURE__*/ O("ZodDiscriminatedUnion", (e, t) => {
|
|
4886
4886
|
Du.init(e, t), ys.init(e, t);
|
|
4887
4887
|
});
|
|
4888
4888
|
function Au(e, t, n) {
|
|
@@ -4890,10 +4890,10 @@ function Au(e, t, n) {
|
|
|
4890
4890
|
type: "union",
|
|
4891
4891
|
options: t,
|
|
4892
4892
|
discriminator: e,
|
|
4893
|
-
...
|
|
4893
|
+
...A(n)
|
|
4894
4894
|
});
|
|
4895
4895
|
}
|
|
4896
|
-
var ju = /*@__PURE__*/
|
|
4896
|
+
var ju = /*@__PURE__*/ O("ZodIntersection", (e, t) => {
|
|
4897
4897
|
bs.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => ml(e, t, n, r);
|
|
4898
4898
|
});
|
|
4899
4899
|
function Mu(e, t) {
|
|
@@ -4903,7 +4903,7 @@ function Mu(e, t) {
|
|
|
4903
4903
|
right: t
|
|
4904
4904
|
});
|
|
4905
4905
|
}
|
|
4906
|
-
var Nu = /*@__PURE__*/
|
|
4906
|
+
var Nu = /*@__PURE__*/ O("ZodRecord", (e, t) => {
|
|
4907
4907
|
Cs.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => hl(e, t, n, r), e.keyType = t.keyType, e.valueType = t.valueType;
|
|
4908
4908
|
});
|
|
4909
4909
|
function U(e, t, n) {
|
|
@@ -4911,15 +4911,15 @@ function U(e, t, n) {
|
|
|
4911
4911
|
type: "record",
|
|
4912
4912
|
keyType: I(),
|
|
4913
4913
|
valueType: e,
|
|
4914
|
-
...
|
|
4914
|
+
...A(t)
|
|
4915
4915
|
}) : new Nu({
|
|
4916
4916
|
type: "record",
|
|
4917
4917
|
keyType: e,
|
|
4918
4918
|
valueType: t,
|
|
4919
|
-
...
|
|
4919
|
+
...A(n)
|
|
4920
4920
|
});
|
|
4921
4921
|
}
|
|
4922
|
-
var Pu = /*@__PURE__*/
|
|
4922
|
+
var Pu = /*@__PURE__*/ O("ZodEnum", (e, t) => {
|
|
4923
4923
|
ws.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => sl(e, t, n, r), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
4924
4924
|
let n = new Set(Object.keys(t.entries));
|
|
4925
4925
|
e.extract = (e, r) => {
|
|
@@ -4929,7 +4929,7 @@ var Pu = /*@__PURE__*/ D("ZodEnum", (e, t) => {
|
|
|
4929
4929
|
return new Pu({
|
|
4930
4930
|
...t,
|
|
4931
4931
|
checks: [],
|
|
4932
|
-
...
|
|
4932
|
+
...A(r),
|
|
4933
4933
|
entries: i
|
|
4934
4934
|
});
|
|
4935
4935
|
}, e.exclude = (e, r) => {
|
|
@@ -4939,7 +4939,7 @@ var Pu = /*@__PURE__*/ D("ZodEnum", (e, t) => {
|
|
|
4939
4939
|
return new Pu({
|
|
4940
4940
|
...t,
|
|
4941
4941
|
checks: [],
|
|
4942
|
-
...
|
|
4942
|
+
...A(r),
|
|
4943
4943
|
entries: i
|
|
4944
4944
|
});
|
|
4945
4945
|
};
|
|
@@ -4948,10 +4948,10 @@ function W(e, t) {
|
|
|
4948
4948
|
return new Pu({
|
|
4949
4949
|
type: "enum",
|
|
4950
4950
|
entries: Array.isArray(e) ? Object.fromEntries(e.map((e) => [e, e])) : e,
|
|
4951
|
-
...
|
|
4951
|
+
...A(t)
|
|
4952
4952
|
});
|
|
4953
4953
|
}
|
|
4954
|
-
var Fu = /*@__PURE__*/
|
|
4954
|
+
var Fu = /*@__PURE__*/ O("ZodLiteral", (e, t) => {
|
|
4955
4955
|
Ts.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => cl(e, t, n, r), e.values = new Set(t.values), Object.defineProperty(e, "value", { get() {
|
|
4956
4956
|
if (t.values.length > 1) throw Error("This schema contains multiple valid literal values. Use `.values` instead.");
|
|
4957
4957
|
return t.values[0];
|
|
@@ -4961,17 +4961,17 @@ function G(e, t) {
|
|
|
4961
4961
|
return new Fu({
|
|
4962
4962
|
type: "literal",
|
|
4963
4963
|
values: Array.isArray(e) ? e : [e],
|
|
4964
|
-
...
|
|
4964
|
+
...A(t)
|
|
4965
4965
|
});
|
|
4966
4966
|
}
|
|
4967
|
-
var Iu = /*@__PURE__*/
|
|
4967
|
+
var Iu = /*@__PURE__*/ O("ZodTransform", (e, t) => {
|
|
4968
4968
|
Es.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => ul(e, t, n, r), e._zod.parse = (n, r) => {
|
|
4969
|
-
if (r.direction === "backward") throw new
|
|
4969
|
+
if (r.direction === "backward") throw new Mi(e.constructor.name);
|
|
4970
4970
|
n.addIssue = (r) => {
|
|
4971
|
-
if (typeof r == "string") n.issues.push(
|
|
4971
|
+
if (typeof r == "string") n.issues.push(ha(r, n.value, t));
|
|
4972
4972
|
else {
|
|
4973
4973
|
let t = r;
|
|
4974
|
-
t.fatal && (t.continue = !1), t.code ??= "custom", t.input ??= n.value, t.inst ??= e, n.issues.push(
|
|
4974
|
+
t.fatal && (t.continue = !1), t.code ??= "custom", t.input ??= n.value, t.inst ??= e, n.issues.push(ha(t));
|
|
4975
4975
|
}
|
|
4976
4976
|
};
|
|
4977
4977
|
let i = t.transform(n.value, n);
|
|
@@ -4984,7 +4984,7 @@ function Lu(e) {
|
|
|
4984
4984
|
transform: e
|
|
4985
4985
|
});
|
|
4986
4986
|
}
|
|
4987
|
-
var Ru = /*@__PURE__*/
|
|
4987
|
+
var Ru = /*@__PURE__*/ O("ZodOptional", (e, t) => {
|
|
4988
4988
|
Os.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => Cl(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
4989
4989
|
});
|
|
4990
4990
|
function zu(e) {
|
|
@@ -4993,7 +4993,7 @@ function zu(e) {
|
|
|
4993
4993
|
innerType: e
|
|
4994
4994
|
});
|
|
4995
4995
|
}
|
|
4996
|
-
var Bu = /*@__PURE__*/
|
|
4996
|
+
var Bu = /*@__PURE__*/ O("ZodExactOptional", (e, t) => {
|
|
4997
4997
|
ks.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => Cl(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
4998
4998
|
});
|
|
4999
4999
|
function Vu(e) {
|
|
@@ -5002,7 +5002,7 @@ function Vu(e) {
|
|
|
5002
5002
|
innerType: e
|
|
5003
5003
|
});
|
|
5004
5004
|
}
|
|
5005
|
-
var Hu = /*@__PURE__*/
|
|
5005
|
+
var Hu = /*@__PURE__*/ O("ZodNullable", (e, t) => {
|
|
5006
5006
|
As.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => gl(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
5007
5007
|
});
|
|
5008
5008
|
function Uu(e) {
|
|
@@ -5011,7 +5011,7 @@ function Uu(e) {
|
|
|
5011
5011
|
innerType: e
|
|
5012
5012
|
});
|
|
5013
5013
|
}
|
|
5014
|
-
var Wu = /*@__PURE__*/
|
|
5014
|
+
var Wu = /*@__PURE__*/ O("ZodDefault", (e, t) => {
|
|
5015
5015
|
js.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => vl(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
5016
5016
|
});
|
|
5017
5017
|
function Gu(e, t) {
|
|
@@ -5019,11 +5019,11 @@ function Gu(e, t) {
|
|
|
5019
5019
|
type: "default",
|
|
5020
5020
|
innerType: e,
|
|
5021
5021
|
get defaultValue() {
|
|
5022
|
-
return typeof t == "function" ? t() :
|
|
5022
|
+
return typeof t == "function" ? t() : Xi(t);
|
|
5023
5023
|
}
|
|
5024
5024
|
});
|
|
5025
5025
|
}
|
|
5026
|
-
var Ku = /*@__PURE__*/
|
|
5026
|
+
var Ku = /*@__PURE__*/ O("ZodPrefault", (e, t) => {
|
|
5027
5027
|
Ns.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => yl(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
5028
5028
|
});
|
|
5029
5029
|
function qu(e, t) {
|
|
@@ -5031,21 +5031,21 @@ function qu(e, t) {
|
|
|
5031
5031
|
type: "prefault",
|
|
5032
5032
|
innerType: e,
|
|
5033
5033
|
get defaultValue() {
|
|
5034
|
-
return typeof t == "function" ? t() :
|
|
5034
|
+
return typeof t == "function" ? t() : Xi(t);
|
|
5035
5035
|
}
|
|
5036
5036
|
});
|
|
5037
5037
|
}
|
|
5038
|
-
var Ju = /*@__PURE__*/
|
|
5038
|
+
var Ju = /*@__PURE__*/ O("ZodNonOptional", (e, t) => {
|
|
5039
5039
|
Ps.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => _l(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
5040
5040
|
});
|
|
5041
5041
|
function Yu(e, t) {
|
|
5042
5042
|
return new Ju({
|
|
5043
5043
|
type: "nonoptional",
|
|
5044
5044
|
innerType: e,
|
|
5045
|
-
...
|
|
5045
|
+
...A(t)
|
|
5046
5046
|
});
|
|
5047
5047
|
}
|
|
5048
|
-
var Xu = /*@__PURE__*/
|
|
5048
|
+
var Xu = /*@__PURE__*/ O("ZodCatch", (e, t) => {
|
|
5049
5049
|
Is.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => bl(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
5050
5050
|
});
|
|
5051
5051
|
function Zu(e, t) {
|
|
@@ -5055,7 +5055,7 @@ function Zu(e, t) {
|
|
|
5055
5055
|
catchValue: typeof t == "function" ? t : () => t
|
|
5056
5056
|
});
|
|
5057
5057
|
}
|
|
5058
|
-
var Qu = /*@__PURE__*/
|
|
5058
|
+
var Qu = /*@__PURE__*/ O("ZodPipe", (e, t) => {
|
|
5059
5059
|
Ls.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => xl(e, t, n, r), e.in = t.in, e.out = t.out;
|
|
5060
5060
|
});
|
|
5061
5061
|
function $u(e, t) {
|
|
@@ -5065,9 +5065,9 @@ function $u(e, t) {
|
|
|
5065
5065
|
out: t
|
|
5066
5066
|
});
|
|
5067
5067
|
}
|
|
5068
|
-
var ed = /*@__PURE__*/
|
|
5068
|
+
var ed = /*@__PURE__*/ O("ZodPreprocess", (e, t) => {
|
|
5069
5069
|
Qu.init(e, t), zs.init(e, t);
|
|
5070
|
-
}), td = /*@__PURE__*/
|
|
5070
|
+
}), td = /*@__PURE__*/ O("ZodReadonly", (e, t) => {
|
|
5071
5071
|
Bs.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => Sl(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
5072
5072
|
});
|
|
5073
5073
|
function nd(e) {
|
|
@@ -5076,7 +5076,7 @@ function nd(e) {
|
|
|
5076
5076
|
innerType: e
|
|
5077
5077
|
});
|
|
5078
5078
|
}
|
|
5079
|
-
var rd = /*@__PURE__*/
|
|
5079
|
+
var rd = /*@__PURE__*/ O("ZodLazy", (e, t) => {
|
|
5080
5080
|
Hs.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => wl(e, t, n, r), e.unwrap = () => e._zod.def.getter();
|
|
5081
5081
|
});
|
|
5082
5082
|
function id(e) {
|
|
@@ -5085,7 +5085,7 @@ function id(e) {
|
|
|
5085
5085
|
getter: e
|
|
5086
5086
|
});
|
|
5087
5087
|
}
|
|
5088
|
-
var ad = /*@__PURE__*/
|
|
5088
|
+
var ad = /*@__PURE__*/ O("ZodCustom", (e, t) => {
|
|
5089
5089
|
Us.init(e, t), F.init(e, t), e._zod.processJSONSchema = (t, n, r) => ll(e, t, n, r);
|
|
5090
5090
|
});
|
|
5091
5091
|
function od(e, t = {}) {
|
|
@@ -5303,7 +5303,7 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
5303
5303
|
}, Qd = cd((e, t) => Zd(e) ? (t.addIssue({
|
|
5304
5304
|
code: "custom",
|
|
5305
5305
|
message: "Tool input schemas may nest at most 4 levels"
|
|
5306
|
-
}),
|
|
5306
|
+
}), Ai) : e, V(Jd).max(8).default([])), $d = (e) => Ld.includes(e), ef = (e) => e !== void 0 && e.type !== "array" && e.type !== "object" && e.default !== void 0, tf = (e) => e.type === "object" ? [e] : e.type === "array" ? tf(e.items) : [], nf = (e, t, n) => {
|
|
5307
5307
|
let r = Object.keys(e.properties), i = e.required ?? [];
|
|
5308
5308
|
K(n, i, [...t, "required"], "required property");
|
|
5309
5309
|
for (let a of i) r.includes(a) || n.addIssue({
|
|
@@ -5527,7 +5527,6 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
5527
5527
|
catalog: z()
|
|
5528
5528
|
}).strict(),
|
|
5529
5529
|
If("analytics_engine"),
|
|
5530
|
-
If("ai"),
|
|
5531
5530
|
ip,
|
|
5532
5531
|
np,
|
|
5533
5532
|
H({
|
|
@@ -5599,7 +5598,7 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
5599
5598
|
}).strict()).max(64).optional()
|
|
5600
5599
|
}).strict(), pp = H({
|
|
5601
5600
|
id: I().min(1).max(32).regex(ld),
|
|
5602
|
-
cron: I().max(128).refine((e) =>
|
|
5601
|
+
cron: I().max(128).refine((e) => wi(e) !== null, "cron must be five space-separated fields with a literal minute, so a schedule runs at most once an hour"),
|
|
5603
5602
|
description: I().min(1).max(200).optional()
|
|
5604
5603
|
}).strict(), mp = H({
|
|
5605
5604
|
$schema: I().min(1).max(255).optional().meta({ description: "Path or URL of the JSON Schema an editor completes this file against." }),
|
|
@@ -6036,12 +6035,12 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
6036
6035
|
try {
|
|
6037
6036
|
n = await C(t, "utf8");
|
|
6038
6037
|
} catch (t) {
|
|
6039
|
-
throw t.code === "ENOENT" ? new
|
|
6038
|
+
throw t.code === "ENOENT" ? new D(`No ${Kp} in ${e}. Run \`qinto app create\` first.`) : t;
|
|
6040
6039
|
}
|
|
6041
6040
|
let r = [], i = Ae(n, r, { allowTrailingComma: !0 });
|
|
6042
|
-
if (r.length > 0) throw new
|
|
6041
|
+
if (r.length > 0) throw new D(`${Kp} is not valid JSONC.`);
|
|
6043
6042
|
let a = jp(i);
|
|
6044
|
-
if (!a.ok) throw new
|
|
6043
|
+
if (!a.ok) throw new D(`${Kp} is invalid:\n${a.issues.map((e) => ` - ${e}`).join("\n")}`);
|
|
6045
6044
|
return {
|
|
6046
6045
|
path: t,
|
|
6047
6046
|
manifest: a.manifest
|
|
@@ -6081,16 +6080,16 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
6081
6080
|
t.stdout("This app already has a UI panel — nothing to add.\n");
|
|
6082
6081
|
return;
|
|
6083
6082
|
}
|
|
6084
|
-
let a = await
|
|
6083
|
+
let a = await mi({
|
|
6085
6084
|
dir: r,
|
|
6086
6085
|
values: {
|
|
6087
6086
|
slug: i.manifest.slug,
|
|
6088
6087
|
name: i.manifest.name
|
|
6089
6088
|
}
|
|
6090
6089
|
});
|
|
6091
|
-
await
|
|
6092
|
-
let o = l(r, "ui"), s = (await
|
|
6093
|
-
if (n.install !== !1 && (c = await
|
|
6090
|
+
await hi(i.path);
|
|
6091
|
+
let o = l(r, "ui"), s = (await _i()).ui, c = !1;
|
|
6092
|
+
if (n.install !== !1 && (c = await vi({
|
|
6094
6093
|
dir: o,
|
|
6095
6094
|
command: s
|
|
6096
6095
|
})), n.json === !0) t.stdout(`${JSON.stringify({
|
|
@@ -6103,7 +6102,7 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
6103
6102
|
for (let e of a) t.stdout(` ${e}\n`);
|
|
6104
6103
|
t.stdout(c ? `Installed its dependencies with \`${s}\`.\n` : `Run \`${s}\` in ${o} before the first publish.\n`);
|
|
6105
6104
|
}
|
|
6106
|
-
if (n.install !== !1 && !c) throw new
|
|
6105
|
+
if (n.install !== !1 && !c) throw new E(`The panel is in ${o}, but \`${s}\` failed there. Run it yourself before \`qinto app publish\`.`);
|
|
6107
6106
|
}
|
|
6108
6107
|
}, Yp = ["production", "sandbox"], Xp = {
|
|
6109
6108
|
production: "https://api.qinto.io",
|
|
@@ -6113,9 +6112,9 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
6113
6112
|
try {
|
|
6114
6113
|
n = new URL(e);
|
|
6115
6114
|
} catch {
|
|
6116
|
-
throw new
|
|
6115
|
+
throw new E(`Invalid ${t}: ${e}`);
|
|
6117
6116
|
}
|
|
6118
|
-
if (n.protocol !== "http:" && n.protocol !== "https:") throw new
|
|
6117
|
+
if (n.protocol !== "http:" && n.protocol !== "https:") throw new E(`Invalid ${t}: ${e}`);
|
|
6119
6118
|
return n;
|
|
6120
6119
|
}, Qp = async (e) => {
|
|
6121
6120
|
let t;
|
|
@@ -6124,21 +6123,21 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
6124
6123
|
} catch (t) {
|
|
6125
6124
|
let n = t;
|
|
6126
6125
|
if (n.code === "ENOENT") return null;
|
|
6127
|
-
throw new
|
|
6126
|
+
throw new E(`Could not read ${e.settingsPath}: ${n.message}`);
|
|
6128
6127
|
}
|
|
6129
6128
|
let n;
|
|
6130
6129
|
try {
|
|
6131
6130
|
n = JSON.parse(t);
|
|
6132
6131
|
} catch {
|
|
6133
|
-
throw new
|
|
6132
|
+
throw new E(`${e.settingsPath} is corrupted. Delete it and run \`qinto env\` again.`);
|
|
6134
6133
|
}
|
|
6135
6134
|
let r = n.environment;
|
|
6136
6135
|
if (r === void 0) return null;
|
|
6137
6136
|
let i = Yp.find((e) => e === r);
|
|
6138
|
-
if (i === void 0) throw new
|
|
6137
|
+
if (i === void 0) throw new E(`${e.settingsPath} names an unknown environment '${r}'. Run \`qinto env\` to choose one.`);
|
|
6139
6138
|
return i;
|
|
6140
6139
|
}, $p = async (e, t) => {
|
|
6141
|
-
await
|
|
6140
|
+
await _r(e.settingsPath, { environment: t });
|
|
6142
6141
|
}, q = async (e, t) => t.apiUrl === void 0 ? Xp[t.env ?? await Qp(e) ?? "production"] : Zp(t.apiUrl, "API URL").origin, em = (e) => {
|
|
6143
6142
|
let t = Yp.find((t) => Xp[t] === e);
|
|
6144
6143
|
return t === void 0 ? ["--api-url", e] : ["--env", t];
|
|
@@ -6164,12 +6163,12 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
6164
6163
|
} catch (t) {
|
|
6165
6164
|
let n = t;
|
|
6166
6165
|
if (n.code === "ENOENT") return {};
|
|
6167
|
-
throw new
|
|
6166
|
+
throw new E(`Could not read ${e}: ${n.message}`);
|
|
6168
6167
|
}
|
|
6169
6168
|
try {
|
|
6170
6169
|
return JSON.parse(t);
|
|
6171
6170
|
} catch {
|
|
6172
|
-
throw new
|
|
6171
|
+
throw new E(`${e} is corrupted. Delete it and log in again.`);
|
|
6173
6172
|
}
|
|
6174
6173
|
}, im = (e, t) => ({
|
|
6175
6174
|
login: e[t]?.login ?? null,
|
|
@@ -6183,7 +6182,7 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
6183
6182
|
...n.activeTeamId === null ? {} : { activeTeamId: n.activeTeamId }
|
|
6184
6183
|
}, r);
|
|
6185
6184
|
}, om = async (e, t) => {
|
|
6186
|
-
await
|
|
6185
|
+
await gr(e.credentialsPath);
|
|
6187
6186
|
let n = `${e.credentialsPath}.guard`;
|
|
6188
6187
|
await we(n, "", {
|
|
6189
6188
|
flag: "a",
|
|
@@ -6203,7 +6202,7 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
6203
6202
|
}
|
|
6204
6203
|
});
|
|
6205
6204
|
} catch (t) {
|
|
6206
|
-
throw new
|
|
6205
|
+
throw new E(`Could not lock ${e.credentialsPath}: ${t.message}`);
|
|
6207
6206
|
}
|
|
6208
6207
|
try {
|
|
6209
6208
|
let n = await rm(e.credentialsPath);
|
|
@@ -6211,7 +6210,7 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
6211
6210
|
load: (e) => im(n, e),
|
|
6212
6211
|
save: async (t, r) => {
|
|
6213
6212
|
let i = am(n, t, r);
|
|
6214
|
-
await
|
|
6213
|
+
await _r(e.credentialsPath, i), n = i;
|
|
6215
6214
|
}
|
|
6216
6215
|
});
|
|
6217
6216
|
} finally {
|
|
@@ -6243,21 +6242,21 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
6243
6242
|
signal: AbortSignal.timeout(r)
|
|
6244
6243
|
});
|
|
6245
6244
|
} catch (e) {
|
|
6246
|
-
throw e instanceof DOMException && e.name === "TimeoutError" ? new
|
|
6245
|
+
throw e instanceof DOMException && e.name === "TimeoutError" ? new E(`The Qinto API did not respond within ${Math.round(r / 1e3)} seconds.`) : e;
|
|
6247
6246
|
}
|
|
6248
6247
|
}, hm = "qinto-cli", gm = async (e, t) => {
|
|
6249
6248
|
try {
|
|
6250
6249
|
return await e.json();
|
|
6251
6250
|
} catch {
|
|
6252
|
-
throw new
|
|
6251
|
+
throw new E(`${t} did not answer with JSON. Is this a Qinto API?`);
|
|
6253
6252
|
}
|
|
6254
6253
|
}, _m = async (e, t) => {
|
|
6255
6254
|
let n = await mm(e, `${t}/.well-known/oauth-authorization-server`);
|
|
6256
|
-
if (!n.ok) throw new
|
|
6255
|
+
if (!n.ok) throw new E(`Could not discover the Qinto OAuth server at ${t}: status ${n.status}.`);
|
|
6257
6256
|
let { issuer: r, authorization_endpoint: i, token_endpoint: a, revocation_endpoint: o, scopes_supported: s } = await gm(n, t);
|
|
6258
|
-
if (typeof r != "string" || typeof i != "string" || typeof a != "string" || typeof o != "string" || !Array.isArray(s) || !s.every((e) => typeof e == "string")) throw new
|
|
6257
|
+
if (typeof r != "string" || typeof i != "string" || typeof a != "string" || typeof o != "string" || !Array.isArray(s) || !s.every((e) => typeof e == "string")) throw new E(`${t} did not answer with a valid OAuth discovery document.`);
|
|
6259
6258
|
let c = Zp(r, "OAuth issuer"), l = Zp(i, "OAuth authorization endpoint"), u = Zp(a, "OAuth token endpoint"), d = Zp(o, "OAuth revocation endpoint");
|
|
6260
|
-
if (c.href !== `${t}/` || u.origin !== t || d.origin !== t) throw new
|
|
6259
|
+
if (c.href !== `${t}/` || u.origin !== t || d.origin !== t) throw new E(`${t} did not answer with a valid OAuth discovery document.`);
|
|
6261
6260
|
return {
|
|
6262
6261
|
authorizationEndpoint: l.href,
|
|
6263
6262
|
tokenEndpoint: u.href,
|
|
@@ -6289,9 +6288,9 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
6289
6288
|
client_id: hm
|
|
6290
6289
|
}).toString()
|
|
6291
6290
|
}), i = await gm(r, t);
|
|
6292
|
-
if (!r.ok) throw new
|
|
6291
|
+
if (!r.ok) throw new hr(typeof i.error == "string" ? i.error : `status_${r.status}`, typeof i.error_description == "string" ? i.error_description : `The token endpoint answered ${r.status}.`);
|
|
6293
6292
|
let { access_token: a, expires_in: o, scope: s, refresh_token: c } = i;
|
|
6294
|
-
if (typeof a != "string" || typeof o != "number" || typeof s != "string") throw new
|
|
6293
|
+
if (typeof a != "string" || typeof o != "number" || typeof s != "string") throw new E("The token endpoint answered with an unexpected shape.");
|
|
6295
6294
|
return {
|
|
6296
6295
|
accessToken: a,
|
|
6297
6296
|
refreshToken: typeof c == "string" ? c : null,
|
|
@@ -6307,7 +6306,7 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
6307
6306
|
client_id: hm
|
|
6308
6307
|
}).toString()
|
|
6309
6308
|
});
|
|
6310
|
-
if (!r.ok) throw new
|
|
6309
|
+
if (!r.ok) throw new E(`The revocation endpoint answered ${r.status}.`);
|
|
6311
6310
|
}, Sm = async (e, t) => (await Promise.all(t.map(async (t) => {
|
|
6312
6311
|
try {
|
|
6313
6312
|
return await xm(e, t.revocationEndpoint, t.token), null;
|
|
@@ -6329,10 +6328,10 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
6329
6328
|
login: null,
|
|
6330
6329
|
pendingRevocations: n.pendingRevocations,
|
|
6331
6330
|
activeTeamId: n.activeTeamId
|
|
6332
|
-
}), new
|
|
6331
|
+
}), new E(`Your session expired. Run \`${tm(t)}\` again.`);
|
|
6333
6332
|
}, Em = async (e, t, n, r) => om(e, async (i) => {
|
|
6334
6333
|
let a = i.load(t), o = a.login;
|
|
6335
|
-
if (o === null) throw new
|
|
6334
|
+
if (o === null) throw new E(`Your session expired. Run \`${tm(t)}\` again.`);
|
|
6336
6335
|
if (o.accessToken !== n || !r && o.expiresAt > e.now() + Cm) return o;
|
|
6337
6336
|
if (o.refreshToken === null) return Tm(i, t, a);
|
|
6338
6337
|
let s;
|
|
@@ -6342,7 +6341,7 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
6342
6341
|
refresh_token: o.refreshToken
|
|
6343
6342
|
});
|
|
6344
6343
|
} catch (e) {
|
|
6345
|
-
if (e instanceof
|
|
6344
|
+
if (e instanceof hr && e.code === "invalid_grant") return Tm(i, t, a);
|
|
6346
6345
|
throw e;
|
|
6347
6346
|
}
|
|
6348
6347
|
let c = {
|
|
@@ -6368,11 +6367,11 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
6368
6367
|
token: i,
|
|
6369
6368
|
options: r
|
|
6370
6369
|
});
|
|
6371
|
-
if (a.status === 401) throw new
|
|
6370
|
+
if (a.status === 401) throw new E("The token in QINTO_API_TOKEN is invalid or expired.");
|
|
6372
6371
|
return a;
|
|
6373
6372
|
}
|
|
6374
6373
|
let a = await sm(e, t);
|
|
6375
|
-
if (a === null) throw new
|
|
6374
|
+
if (a === null) throw new E(`Not logged in. Run \`${tm(t)}\`.`);
|
|
6376
6375
|
a.expiresAt <= e.now() + Cm && (a = await Em(e, t, a.accessToken, !1));
|
|
6377
6376
|
let o = await wm({
|
|
6378
6377
|
deps: e,
|
|
@@ -6402,29 +6401,29 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
6402
6401
|
try {
|
|
6403
6402
|
a = await i.json();
|
|
6404
6403
|
} catch {
|
|
6405
|
-
throw new
|
|
6404
|
+
throw new E(`The Qinto API answered ${i.status} without JSON.`);
|
|
6406
6405
|
}
|
|
6407
6406
|
if (!i.ok) {
|
|
6408
6407
|
let e = a, t = typeof e.error == "string" ? e.error : null, n = typeof e.message == "string" ? e.message : t ?? `status ${i.status}`, r = typeof e.details == "object" && e.details !== null ? Om(e.details, "") : null, o = r === null ? n : `${n} (${r})`;
|
|
6409
|
-
throw new
|
|
6408
|
+
throw new mr(`The Qinto API rejected the request: ${o}${o.endsWith(".") ? "" : "."}`, i.status, t);
|
|
6410
6409
|
}
|
|
6411
6410
|
return a;
|
|
6412
6411
|
}, km = async (e, t) => (await Y(e, t, "/me")).organizations, Am = async (e) => {
|
|
6413
6412
|
let { deps: t, organizations: n, requested: r, machine: i } = e;
|
|
6414
6413
|
if (r !== void 0) {
|
|
6415
6414
|
let e = n.find((e) => e.organizationId === r || e.name === r);
|
|
6416
|
-
if (e === void 0) throw new
|
|
6415
|
+
if (e === void 0) throw new D(`Organization ${r} is not available to this credential.`);
|
|
6417
6416
|
return e;
|
|
6418
6417
|
}
|
|
6419
|
-
if (n.length === 0) throw new
|
|
6418
|
+
if (n.length === 0) throw new D("This credential has no organizations. Log in with `qinto login` first.");
|
|
6420
6419
|
let a = n.at(0);
|
|
6421
6420
|
if (n.length === 1 && a !== void 0) return a;
|
|
6422
|
-
if (i) throw new
|
|
6421
|
+
if (i) throw new D("Several organizations are available. Pass --org <organizationId>.");
|
|
6423
6422
|
let o = await t.prompts.select("Which organization should own the app?", n.map((e) => ({
|
|
6424
6423
|
name: `${e.name} (${e.role})`,
|
|
6425
6424
|
value: e.organizationId
|
|
6426
6425
|
}))), s = n.find((e) => e.organizationId === o);
|
|
6427
|
-
if (s === void 0) throw new
|
|
6426
|
+
if (s === void 0) throw new D(`Organization ${o} is not available to this credential.`);
|
|
6428
6427
|
return s;
|
|
6429
6428
|
}, jm = async (e) => {
|
|
6430
6429
|
let { deps: t, origin: n, machine: r, slug: i, name: a, description: o, org: s } = e, c = await Am({
|
|
@@ -6485,7 +6484,7 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
6485
6484
|
if (e === null) return i;
|
|
6486
6485
|
if (r) {
|
|
6487
6486
|
let t = e.suggestions.length === 0 ? "" : ` Free slugs: ${e.suggestions.join(", ")}.`;
|
|
6488
|
-
throw new
|
|
6487
|
+
throw new D(`${e.message}${t} Pass a different --slug.`);
|
|
6489
6488
|
}
|
|
6490
6489
|
t.stderr(`${e.message}\n`), i = await Rm(t, e.suggestions);
|
|
6491
6490
|
}
|
|
@@ -6502,27 +6501,27 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
6502
6501
|
full: !0
|
|
6503
6502
|
}, Wm = async (e) => {
|
|
6504
6503
|
if (e.name !== void 0 && e.name !== "") return e.name;
|
|
6505
|
-
if (e.machine) throw new
|
|
6504
|
+
if (e.machine) throw new D("Pass --name <name>.");
|
|
6506
6505
|
return e.deps.prompts.input("App name");
|
|
6507
6506
|
}, Gm = async (e) => e.template === void 0 ? e.machine ? "minimal" : await e.deps.prompts.select("Template", Hm, "minimal") : e.template, Km = async (e) => e.register === void 0 ? !e.machine && e.deps.prompts.confirm(`Register '${e.slug}' with the Qinto platform now?`, !0) : e.register, qm = async (e) => {
|
|
6508
6507
|
let t = {
|
|
6509
6508
|
slug: e.slug,
|
|
6510
6509
|
name: e.name
|
|
6511
|
-
}, n =
|
|
6512
|
-
return e.ui && r.push(...await
|
|
6510
|
+
}, n = ui(), r = [];
|
|
6511
|
+
return e.ui && r.push(...await mi({
|
|
6513
6512
|
dir: e.dir,
|
|
6514
6513
|
values: t
|
|
6515
|
-
})), r.push(...await
|
|
6514
|
+
})), r.push(...await pi({
|
|
6516
6515
|
templateDir: l(n, "project"),
|
|
6517
6516
|
targetDir: e.dir,
|
|
6518
6517
|
values: t
|
|
6519
|
-
}), ...await
|
|
6518
|
+
}), ...await pi({
|
|
6520
6519
|
templateDir: l(n, "app", e.template),
|
|
6521
6520
|
targetDir: e.dir,
|
|
6522
6521
|
values: t
|
|
6523
|
-
})), e.ui && !Um[e.template] && await
|
|
6522
|
+
})), e.ui && !Um[e.template] && await hi(l(e.dir, Kp)), [...new Set(r)].sort();
|
|
6524
6523
|
}, Jm = async (e) => {
|
|
6525
|
-
let t = await
|
|
6524
|
+
let t = await _i(), n = [{
|
|
6526
6525
|
dir: e.dir,
|
|
6527
6526
|
command: t.root
|
|
6528
6527
|
}];
|
|
@@ -6531,11 +6530,11 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
6531
6530
|
command: t.ui
|
|
6532
6531
|
});
|
|
6533
6532
|
let r = [];
|
|
6534
|
-
for (let t of n) e.json || e.deps.stdout(`\nInstalling dependencies: \`${t.command}\` in ${t.dir}\n`), await
|
|
6533
|
+
for (let t of n) e.json || e.deps.stdout(`\nInstalling dependencies: \`${t.command}\` in ${t.dir}\n`), await vi(t) || r.push(`\`${t.command}\` in ${t.dir}`);
|
|
6535
6534
|
return r;
|
|
6536
6535
|
}, Ym = async (e, t) => {
|
|
6537
6536
|
let n = e.options, r = nm(n, t), i = n.json === !0, a = f(e.positionals.at(0) ?? ".");
|
|
6538
|
-
if (S(l(a, "qinto.app.jsonc"))) throw new
|
|
6537
|
+
if (S(l(a, "qinto.app.jsonc"))) throw new D(`${a} already contains ${Kp}. Scaffold into an empty directory instead.`);
|
|
6539
6538
|
let o = await Wm({
|
|
6540
6539
|
deps: t,
|
|
6541
6540
|
machine: r,
|
|
@@ -6597,7 +6596,7 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
6597
6596
|
...e
|
|
6598
6597
|
}, null, 2)}\n`);
|
|
6599
6598
|
} else g === null ? t.stdout("\nNext: register it with `qinto app register`, then publish with `qinto app publish`.\n") : (Mm(t, g), t.stdout("Next: publish it with `qinto app publish`.\n"));
|
|
6600
|
-
if (m.length > 0) throw new
|
|
6599
|
+
if (m.length > 0) throw new E(`The scaffold is in ${a}, but ${m.join(" and ")} failed. Run it yourself before \`qinto app publish\`.`);
|
|
6601
6600
|
}, Xm = {
|
|
6602
6601
|
path: ["app", "create"],
|
|
6603
6602
|
description: "Scaffold a new Qinto app in a directory, install its dependencies, and optionally register it",
|
|
@@ -6750,7 +6749,6 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
6750
6749
|
workerName: $m(e.slug, a.identifier)
|
|
6751
6750
|
};
|
|
6752
6751
|
break;
|
|
6753
|
-
case "ai":
|
|
6754
6752
|
case "vectorize":
|
|
6755
6753
|
r.push({
|
|
6756
6754
|
binding: a.binding,
|
|
@@ -7080,7 +7078,7 @@ var ld = /^[a-z][a-z0-9-]*$/, ud = /^[A-Z][A-Z0-9_]*$/, dd = /^[a-z][a-z0-9-]{2,
|
|
|
7080
7078
|
}, i = (t) => {
|
|
7081
7079
|
let n = e.stack.secrets();
|
|
7082
7080
|
return e.stack.apps().flatMap((e) => e.app.installs.some((t) => Wh(e.manifest, e.app, t, n)) ? (e.manifest.server.schedules ?? []).flatMap((n) => {
|
|
7083
|
-
let r =
|
|
7081
|
+
let r = Ei(wi(n.cron), t, Xh);
|
|
7084
7082
|
return r === null ? [] : [{
|
|
7085
7083
|
slug: e.slug,
|
|
7086
7084
|
scheduleId: n.id,
|
|
@@ -10388,12 +10386,12 @@ var jS = (e) => e.reduce((e, t) => e | kS[t], 0), MS = (e) => {
|
|
|
10388
10386
|
}]))
|
|
10389
10387
|
};
|
|
10390
10388
|
}, RS = async (e, t) => {
|
|
10391
|
-
let n = await
|
|
10389
|
+
let n = await Ur({
|
|
10392
10390
|
dir: e,
|
|
10393
10391
|
manifest: t,
|
|
10394
10392
|
outDir: await ye(l(a(), "qinto-dev-build-"))
|
|
10395
10393
|
});
|
|
10396
|
-
return await
|
|
10394
|
+
return await Xr({
|
|
10397
10395
|
manifest: t,
|
|
10398
10396
|
serverBundle: n.server
|
|
10399
10397
|
}), {
|
|
@@ -10402,13 +10400,13 @@ var jS = (e) => e.reduce((e, t) => e | kS[t], 0), MS = (e) => {
|
|
|
10402
10400
|
};
|
|
10403
10401
|
}, zS = (e, t) => `/${e}/${t}/`, BS = async (e, t, n) => {
|
|
10404
10402
|
if (t.ui === void 0) return null;
|
|
10405
|
-
await
|
|
10403
|
+
await ei({
|
|
10406
10404
|
dir: e,
|
|
10407
10405
|
ui: t.ui,
|
|
10408
10406
|
basePath: n
|
|
10409
10407
|
});
|
|
10410
10408
|
let r = f(e, t.ui.dir);
|
|
10411
|
-
return await
|
|
10409
|
+
return await si({
|
|
10412
10410
|
uiRoot: r,
|
|
10413
10411
|
basePath: n
|
|
10414
10412
|
}), r;
|
|
@@ -12671,6 +12669,7 @@ ${Object.keys(Kw).map((e) => ` <button class="outline" data-std="${e}">${
|
|
|
12671
12669
|
});
|
|
12672
12670
|
}),
|
|
12673
12671
|
spawn: r,
|
|
12672
|
+
now: () => Date.now(),
|
|
12674
12673
|
env: process.env,
|
|
12675
12674
|
platform: process.platform,
|
|
12676
12675
|
arch: process.arch
|
|
@@ -12888,16 +12887,16 @@ ${Object.keys(Kw).map((e) => ` <button class="outline" data-std="${e}">${
|
|
|
12888
12887
|
await ZT(r.intervalMs);
|
|
12889
12888
|
}
|
|
12890
12889
|
throw UT(`${i} was not published in DNS in time.`, n);
|
|
12891
|
-
}, nE = 12e4, rE = 1e3, iE =
|
|
12890
|
+
}, nE = 12e4, rE = 1e3, iE = 600 * 1e3, aE = 3600 * 1e3, oE = 2147483647, sE = "it reached the time limit it was given", cE = (e) => {
|
|
12892
12891
|
let t = l(e, "qinto-tunnel.yml");
|
|
12893
12892
|
return te(e, { recursive: !0 }), se(t, "{}\n"), t;
|
|
12894
|
-
},
|
|
12893
|
+
}, lE = (e, t) => {
|
|
12895
12894
|
let n = Object.fromEntries(Object.entries(e).filter(([e]) => !e.startsWith("TUNNEL_") && !e.startsWith("CLOUDFLARE_")));
|
|
12896
12895
|
return t === void 0 ? n : {
|
|
12897
12896
|
...n,
|
|
12898
12897
|
TUNNEL_TOKEN: t
|
|
12899
12898
|
};
|
|
12900
|
-
},
|
|
12899
|
+
}, uE = async (e) => {
|
|
12901
12900
|
let t = e.onProgress ?? (() => {}), n = e.named, r = await RT(e.cacheRoot, e.deps, {
|
|
12902
12901
|
signal: e.signal,
|
|
12903
12902
|
onProgress: t
|
|
@@ -12907,7 +12906,7 @@ ${Object.keys(Kw).map((e) => ` <button class="outline" data-std="${e}">${
|
|
|
12907
12906
|
"tunnel",
|
|
12908
12907
|
"--no-autoupdate",
|
|
12909
12908
|
"--config",
|
|
12910
|
-
|
|
12909
|
+
cE(e.cacheRoot),
|
|
12911
12910
|
...n === void 0 ? ["--url", e.origin] : ["run"]
|
|
12912
12911
|
], a = HT(e.deps.spawn(r, i, {
|
|
12913
12912
|
stdio: [
|
|
@@ -12915,7 +12914,7 @@ ${Object.keys(Kw).map((e) => ` <button class="outline" data-std="${e}">${
|
|
|
12915
12914
|
"pipe",
|
|
12916
12915
|
"pipe"
|
|
12917
12916
|
],
|
|
12918
|
-
env:
|
|
12917
|
+
env: lE(e.deps.env, n?.token)
|
|
12919
12918
|
}), [KT, qT]), o = {
|
|
12920
12919
|
intervalMs: e.probeIntervalMs ?? rE,
|
|
12921
12920
|
deadline: Date.now() + (e.readyTimeoutMs ?? nE),
|
|
@@ -12931,45 +12930,51 @@ ${Object.keys(Kw).map((e) => ` <button class="outline" data-std="${e}">${
|
|
|
12931
12930
|
} catch (e) {
|
|
12932
12931
|
throw await GT(a), e;
|
|
12933
12932
|
}
|
|
12934
|
-
let c = !0, l =
|
|
12935
|
-
e.onReminder?.(Math.max(0,
|
|
12936
|
-
}, e.reminderIntervalMs ??
|
|
12937
|
-
|
|
12938
|
-
let
|
|
12939
|
-
clearTimeout(
|
|
12940
|
-
|
|
12941
|
-
|
|
12942
|
-
|
|
12943
|
-
|
|
12944
|
-
|
|
12933
|
+
let c = !0, l = e.expiryMs !== void 0, u = e.deps.now() + (e.expiryMs ?? 0), d, f = l ? setInterval(() => {
|
|
12934
|
+
e.onReminder?.(Math.max(0, u - e.deps.now()));
|
|
12935
|
+
}, e.reminderIntervalMs ?? iE) : void 0;
|
|
12936
|
+
f?.unref();
|
|
12937
|
+
let p = (t) => c ? (c = !1, clearTimeout(d), clearInterval(f), t !== void 0 && e.onDown?.(t), GT(a)) : Promise.resolve(), m = () => {
|
|
12938
|
+
if (clearTimeout(d), !l) return;
|
|
12939
|
+
let t = u;
|
|
12940
|
+
d = setTimeout(() => {
|
|
12941
|
+
if (e.deps.now() < t) {
|
|
12942
|
+
m();
|
|
12943
|
+
return;
|
|
12944
|
+
}
|
|
12945
|
+
p(sE);
|
|
12946
|
+
}, Math.min(Math.max(0, t - e.deps.now()), e.maxDelayMs ?? oE)), d.unref();
|
|
12947
|
+
};
|
|
12948
|
+
return m(), a.onExit((e) => {
|
|
12949
|
+
p(e);
|
|
12945
12950
|
}), {
|
|
12946
12951
|
publicOrigins: () => c ? s : [],
|
|
12947
|
-
extend: (
|
|
12948
|
-
if (!c) return 0;
|
|
12949
|
-
let
|
|
12950
|
-
return
|
|
12952
|
+
extend: (t = aE) => {
|
|
12953
|
+
if (!c || !l) return 0;
|
|
12954
|
+
let n = e.deps.now();
|
|
12955
|
+
return u = Math.max(u, n) + t, m(), u - n;
|
|
12951
12956
|
},
|
|
12952
12957
|
stop: async () => {
|
|
12953
|
-
await
|
|
12958
|
+
await p(void 0);
|
|
12954
12959
|
}
|
|
12955
12960
|
};
|
|
12956
|
-
},
|
|
12961
|
+
}, dE = /* @__PURE__ */ new Set([
|
|
12957
12962
|
"node_modules",
|
|
12958
12963
|
".git",
|
|
12959
12964
|
".astro",
|
|
12960
12965
|
".wrangler",
|
|
12961
12966
|
".qinto"
|
|
12962
|
-
]),
|
|
12963
|
-
let n =
|
|
12964
|
-
return !n.split("/").some((e) =>
|
|
12965
|
-
let t =
|
|
12967
|
+
]), fE = (e) => e.split(p).join("/"), pE = (e, t) => {
|
|
12968
|
+
let n = fE(e);
|
|
12969
|
+
return !n.split("/").some((e) => dE.has(e)) && !t.some((e) => {
|
|
12970
|
+
let t = fE(e);
|
|
12966
12971
|
return n === t || n.startsWith(`${t}/`);
|
|
12967
12972
|
});
|
|
12968
|
-
},
|
|
12973
|
+
}, mE = (e, t, n) => {
|
|
12969
12974
|
if (t === null) return !1;
|
|
12970
12975
|
let r = t.toString();
|
|
12971
|
-
return r !== s(e) &&
|
|
12972
|
-
},
|
|
12976
|
+
return r !== s(e) && pE(r, n);
|
|
12977
|
+
}, hE = (e) => {
|
|
12973
12978
|
let t = null, n = !1, r = !1, i = !1, a = async () => {
|
|
12974
12979
|
n = !0;
|
|
12975
12980
|
try {
|
|
@@ -12996,35 +13001,35 @@ ${Object.keys(Kw).map((e) => ` <button class="outline" data-std="${e}">${
|
|
|
12996
13001
|
i = !0, t !== null && (clearTimeout(t), t = null);
|
|
12997
13002
|
}
|
|
12998
13003
|
};
|
|
12999
|
-
},
|
|
13004
|
+
}, gE = (e) => {
|
|
13000
13005
|
let t = oe(e.dir, { recursive: !0 }, (t, n) => {
|
|
13001
|
-
|
|
13006
|
+
mE(e.dir, n, e.ignore) && e.onChange();
|
|
13002
13007
|
});
|
|
13003
13008
|
return { stop: () => {
|
|
13004
13009
|
t.close();
|
|
13005
13010
|
} };
|
|
13006
|
-
},
|
|
13011
|
+
}, _E = (e) => {
|
|
13007
13012
|
try {
|
|
13008
13013
|
let t = re(e, { withFileTypes: !0 });
|
|
13009
13014
|
return new Set(t.filter((e) => e.isDirectory()).map((e) => e.name));
|
|
13010
13015
|
} catch {
|
|
13011
13016
|
return null;
|
|
13012
13017
|
}
|
|
13013
|
-
},
|
|
13014
|
-
let t =
|
|
13015
|
-
let n =
|
|
13016
|
-
n === null || t === null ||
|
|
13018
|
+
}, vE = (e, t) => e.size === t.size && [...e].every((e) => t.has(e)), yE = (e) => {
|
|
13019
|
+
let t = _E(e.dir), n = setInterval(() => {
|
|
13020
|
+
let n = _E(e.dir);
|
|
13021
|
+
n === null || t === null || vE(n, t) || (t = n, e.onChange());
|
|
13017
13022
|
}, e.intervalMs);
|
|
13018
13023
|
return n.unref(), { stop: () => {
|
|
13019
13024
|
clearInterval(n);
|
|
13020
13025
|
} };
|
|
13021
|
-
},
|
|
13022
|
-
for (let e of
|
|
13026
|
+
}, bE = ["./worker-artifact", "../../../../../portal/services/worker-artifact"], xE = () => {
|
|
13027
|
+
for (let e of bE) {
|
|
13023
13028
|
let t = Te(new URL(e, import.meta.url));
|
|
13024
13029
|
if (S(l(t, "version.json"))) return t;
|
|
13025
13030
|
}
|
|
13026
|
-
throw new
|
|
13027
|
-
},
|
|
13031
|
+
throw new E("This build of the Qinto CLI ships no platform bundles, so `qinto app dev` cannot start.");
|
|
13032
|
+
}, SE = () => {
|
|
13028
13033
|
let e = !1, t = [], n = new AbortController(), r = () => {
|
|
13029
13034
|
e = !0, n.abort();
|
|
13030
13035
|
for (let e of t.splice(0)) e();
|
|
@@ -13043,32 +13048,32 @@ ${Object.keys(Kw).map((e) => ` <button class="outline" data-std="${e}">${
|
|
|
13043
13048
|
process.off("SIGINT", r), process.off("SIGTERM", r);
|
|
13044
13049
|
}
|
|
13045
13050
|
};
|
|
13046
|
-
},
|
|
13051
|
+
}, CE = "Account > Cloudflare Tunnel > Edit", wE = "Zone > Zone > Read and Zone > DNS > Edit", TE = (e, t) => {
|
|
13047
13052
|
let n = typeof e == "string" ? e.trim() : "", r = typeof t == "string" ? t.trim() : "";
|
|
13048
13053
|
return n === "" || r === "" ? void 0 : {
|
|
13049
13054
|
accountId: n,
|
|
13050
13055
|
token: r
|
|
13051
13056
|
};
|
|
13052
|
-
},
|
|
13057
|
+
}, EE = async (e) => {
|
|
13053
13058
|
let t;
|
|
13054
13059
|
try {
|
|
13055
13060
|
t = await C(e, "utf8");
|
|
13056
13061
|
} catch (t) {
|
|
13057
13062
|
let n = t;
|
|
13058
13063
|
if (n.code === "ENOENT") return {};
|
|
13059
|
-
throw new
|
|
13064
|
+
throw new E(`Could not read ${e}: ${n.message}`);
|
|
13060
13065
|
}
|
|
13061
13066
|
try {
|
|
13062
13067
|
return JSON.parse(t);
|
|
13063
13068
|
} catch {
|
|
13064
|
-
throw new
|
|
13069
|
+
throw new E(`${e} is corrupted. Delete it and run the command again.`);
|
|
13065
13070
|
}
|
|
13066
|
-
},
|
|
13071
|
+
}, DE = (e) => `
|
|
13067
13072
|
A named tunnel is read from your own Cloudflare account, and qinto has no credentials for it yet.
|
|
13068
13073
|
|
|
13069
13074
|
1. Open https://dash.cloudflare.com/profile/api-tokens
|
|
13070
13075
|
2. Select Create Token, then Create Custom Token.
|
|
13071
|
-
3. Under Permissions, add: ${
|
|
13076
|
+
3. Under Permissions, add: ${CE}\n To let qinto create the tunnel for you, also add: ${wE}\n Nothing more: the token is saved on this machine.
|
|
13072
13077
|
(An account-owned token lists the first row as Cloudflare One Connector: cloudflared, or Argo Tunnel (Legacy).)
|
|
13073
13078
|
4. Under Account Resources, select the account that holds the tunnel; under Zone Resources, the zone its hostname is on.
|
|
13074
13079
|
5. Create the token and copy it — Cloudflare shows it once.
|
|
@@ -13076,38 +13081,38 @@ ${Object.keys(Kw).map((e) => ` <button class="outline" data-std="${e}">${
|
|
|
13076
13081
|
Your account ID is the last part of the dashboard URL:
|
|
13077
13082
|
https://dash.cloudflare.com/<account-id>
|
|
13078
13083
|
|
|
13079
|
-
qinto saves both in ${e}, readable only by you. Delete that file to enter them again.\n\n`,
|
|
13080
|
-
let n = e.cloudflareAccountPath, r = e.env.CLOUDFLARE_ACCOUNT_ID, i = e.env.CLOUDFLARE_API_TOKEN, a =
|
|
13084
|
+
qinto saves both in ${e}, readable only by you. Delete that file to enter them again.\n\n`, OE = async (e, t) => {
|
|
13085
|
+
let n = e.cloudflareAccountPath, r = e.env.CLOUDFLARE_ACCOUNT_ID, i = e.env.CLOUDFLARE_API_TOKEN, a = TE(r, i);
|
|
13081
13086
|
if (a !== void 0) return {
|
|
13082
13087
|
account: a,
|
|
13083
13088
|
remember: () => Promise.resolve()
|
|
13084
13089
|
};
|
|
13085
|
-
if ((r ?? "").trim() !== "" || (i ?? "").trim() !== "") throw new
|
|
13086
|
-
let o = await
|
|
13090
|
+
if ((r ?? "").trim() !== "" || (i ?? "").trim() !== "") throw new D("Set both CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or neither. One on its own would be paired with a credential from somewhere else, and an account the token cannot reach is refused with nothing to say why.");
|
|
13091
|
+
let o = await EE(n), s = TE(o.accountId, o.apiToken);
|
|
13087
13092
|
if (s !== void 0) return {
|
|
13088
13093
|
account: s,
|
|
13089
13094
|
remember: () => Promise.resolve()
|
|
13090
13095
|
};
|
|
13091
|
-
if (t.machine) throw new
|
|
13092
|
-
Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a terminal to save them in ${n}.\nThe token needs one permission: ${
|
|
13093
|
-
e.stdout(
|
|
13094
|
-
let c =
|
|
13095
|
-
if (c === void 0) throw new
|
|
13096
|
+
if (t.machine) throw new D(`A named tunnel needs Cloudflare credentials, and this run cannot ask for them.
|
|
13097
|
+
Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a terminal to save them in ${n}.\nThe token needs one permission: ${CE}.`);
|
|
13098
|
+
e.stdout(DE(n));
|
|
13099
|
+
let c = TE(await e.prompts.input("Cloudflare account ID"), await e.prompts.password("Cloudflare API token"));
|
|
13100
|
+
if (c === void 0) throw new D("A named tunnel needs both a Cloudflare account ID and an API token.");
|
|
13096
13101
|
return {
|
|
13097
13102
|
account: c,
|
|
13098
|
-
remember: () =>
|
|
13103
|
+
remember: () => _r(n, {
|
|
13099
13104
|
accountId: c.accountId,
|
|
13100
13105
|
apiToken: c.token
|
|
13101
13106
|
})
|
|
13102
13107
|
};
|
|
13103
|
-
},
|
|
13108
|
+
}, kE = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/, AE = (e, t, n) => `To create the tunnel "${e}" yourself:\n 1. Open https://one.dash.cloudflare.com/${t}/networks/tunnels and select Create a tunnel.\n 2. Choose Cloudflared and name it "${e}". Skip installing a connector — qinto runs cloudflared for you.\n 3. Under Public Hostnames, add the hostname a vendor should call, with service ${n} (the port --worker-port sets).\nThen run the command again.`, jE = async (e) => {
|
|
13104
13109
|
let { name: t, origin: n, account: r, deps: i } = e, a = `No Cloudflare Tunnel named "${t}" exists in account ${r.accountId}.`;
|
|
13105
|
-
if (e.machine) throw new
|
|
13110
|
+
if (e.machine) throw new D(`${a} Run the command in a terminal to create it here.\n${AE(t, r.accountId, n)}`);
|
|
13106
13111
|
if (i.stdout(`\n ${a}\n qinto can create it: the tunnel, a public hostname routed to the site worker, and the DNS record for that hostname
|
|
13107
|
-
in your zone. The API token then also needs ${
|
|
13112
|
+
in your zone. The API token then also needs ${wE}.\n\n`), !await i.prompts.confirm("Create it now?", !0)) throw new E(AE(t, r.accountId, n));
|
|
13108
13113
|
let o = (await i.prompts.input("Public hostname (one level below a zone on this account, e.g. hooks.example.com)")).trim().toLowerCase();
|
|
13109
|
-
if (o === "") throw new
|
|
13110
|
-
if (!
|
|
13114
|
+
if (o === "") throw new D("A tunnel needs a public hostname to route to the site worker.");
|
|
13115
|
+
if (!kE.test(o)) throw new D(`"${o}" is not a hostname a vendor can call. Enter one concrete name such as hooks.example.com — no wildcard, scheme or path.`);
|
|
13111
13116
|
i.stdout(`\n Creating the tunnel "${t}" and publishing ${o}…\n`);
|
|
13112
13117
|
let s = await vT({
|
|
13113
13118
|
name: t,
|
|
@@ -13118,14 +13123,24 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13118
13123
|
signal: e.signal
|
|
13119
13124
|
});
|
|
13120
13125
|
return i.stdout(` Created. From now on --tunnel-name ${t} reads ${o} from it and asks nothing.\n`), s;
|
|
13126
|
+
}, ME = (e) => {
|
|
13127
|
+
let t = Number(e);
|
|
13128
|
+
if (!Number.isFinite(t) || t <= 0) throw new D("Pass a positive number of hours to --tunnel-hours.");
|
|
13129
|
+
return t;
|
|
13121
13130
|
}, NE = (e) => {
|
|
13122
|
-
if (e.tunnel === !0 && e.tunnelName !== void 0) throw new
|
|
13123
|
-
|
|
13131
|
+
if (e.tunnel === !0 && e.tunnelName !== void 0) throw new D("Pass --tunnel for a fresh trycloudflare.com hostname, or --tunnel-name for a named tunnel — not both.");
|
|
13132
|
+
let t = e.tunnelHours === void 0 ? void 0 : ME(e.tunnelHours), n = t === void 0 ? {} : { hours: t };
|
|
13133
|
+
if (e.tunnelName !== void 0) return {
|
|
13134
|
+
name: e.tunnelName,
|
|
13135
|
+
...n
|
|
13136
|
+
};
|
|
13137
|
+
if (e.tunnel === !0) return n;
|
|
13138
|
+
if (t !== void 0) throw new D("--tunnel-hours closes a tunnel early, so it needs one: pass --tunnel or --tunnel-name as well.");
|
|
13124
13139
|
}, PE = (e) => {
|
|
13125
13140
|
let t = Math.max(1, Math.ceil(e / 6e4)), n = Math.floor(t / 60), r = t % 60;
|
|
13126
13141
|
return n === 0 ? `${r}m` : r === 0 ? `${n}h` : `${n}h ${r}m`;
|
|
13127
13142
|
}, FE = (e) => "\n Anyone who has this URL can:\n · call your app’s ungated endpoints\n · make your app code run against real vendor APIs, with your dev variables and secrets\n · reach whatever the site worker passes through\n\n" + (e === void 0 ? " Restrict it with Cloudflare Access on a named tunnel (--tunnel-name) if that matters here.\n" : " Restrict it with Cloudflare Access if that matters here.\n"), IE = async (e) => {
|
|
13128
|
-
let { name: t, origin: n, deps: r } = e, { account: i, remember: a } = await
|
|
13143
|
+
let { name: t, origin: n, deps: r } = e, { account: i, remember: a } = await OE(r, { machine: e.machine }), o = e.signals.signal;
|
|
13129
13144
|
try {
|
|
13130
13145
|
let s = await pT({
|
|
13131
13146
|
name: t,
|
|
@@ -13134,7 +13149,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13134
13149
|
fetch: r.fetch,
|
|
13135
13150
|
signal: o
|
|
13136
13151
|
});
|
|
13137
|
-
return await a(), s ?? await
|
|
13152
|
+
return await a(), s ?? await jE({
|
|
13138
13153
|
name: t,
|
|
13139
13154
|
origin: n,
|
|
13140
13155
|
account: i,
|
|
@@ -13143,7 +13158,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13143
13158
|
signal: o
|
|
13144
13159
|
});
|
|
13145
13160
|
} catch (e) {
|
|
13146
|
-
throw e instanceof tT ? new
|
|
13161
|
+
throw e instanceof tT ? new E(`${e.message}\nGive that token the permission, or replace it: set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or delete ${r.cloudflareAccountPath} to enter different ones.`) : e;
|
|
13147
13162
|
}
|
|
13148
13163
|
}, LE = (e, t, n) => {
|
|
13149
13164
|
let r = (e) => {
|
|
@@ -13155,19 +13170,20 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13155
13170
|
e.off("data", r), e.pause();
|
|
13156
13171
|
};
|
|
13157
13172
|
}, RE = async (e) => {
|
|
13158
|
-
let { deps: t } = e, n = !e.machine && t.interactive && e.stdin.isTTY === !0;
|
|
13173
|
+
let { deps: t } = e, n = e.choice.hours === void 0 ? void 0 : e.choice.hours * 60 * 60 * 1e3, r = n !== void 0 && !e.machine && t.interactive && e.stdin.isTTY === !0;
|
|
13159
13174
|
t.stdout(FE(e.choice.name)), t.stdout("\n Opening a Cloudflare Tunnel to the site worker — this usually takes 20-40 seconds.\n");
|
|
13160
|
-
let
|
|
13175
|
+
let i;
|
|
13161
13176
|
try {
|
|
13162
|
-
let
|
|
13177
|
+
let a = e.choice.name === void 0 ? void 0 : await IE({
|
|
13163
13178
|
name: e.choice.name,
|
|
13164
13179
|
origin: e.origin,
|
|
13165
13180
|
signals: e.signals,
|
|
13166
13181
|
deps: t,
|
|
13167
13182
|
machine: e.machine
|
|
13168
13183
|
});
|
|
13169
|
-
|
|
13170
|
-
...
|
|
13184
|
+
i = await uE({
|
|
13185
|
+
...a === void 0 ? {} : { named: a },
|
|
13186
|
+
...n === void 0 ? {} : { expiryMs: n },
|
|
13171
13187
|
origin: e.origin,
|
|
13172
13188
|
cacheRoot: qh(),
|
|
13173
13189
|
deps: bT(),
|
|
@@ -13176,7 +13192,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13176
13192
|
t.stdout(` · ${e}…\n`);
|
|
13177
13193
|
},
|
|
13178
13194
|
onReminder: (e) => {
|
|
13179
|
-
t.stdout(`\n The tunnel is still open, and closes in ${PE(e)}.${
|
|
13195
|
+
t.stdout(`\n The tunnel is still open, and closes in ${PE(e)}.${r ? " Press a then Enter to add an hour." : ""}\n`);
|
|
13180
13196
|
},
|
|
13181
13197
|
onDown: (e) => {
|
|
13182
13198
|
t.stderr(`\n ! The tunnel closed — ${e}. The public endpoint URLs no longer answer.\n`);
|
|
@@ -13186,20 +13202,21 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13186
13202
|
if (!e.signals.signalled()) throw t;
|
|
13187
13203
|
return;
|
|
13188
13204
|
}
|
|
13189
|
-
|
|
13205
|
+
n !== void 0 && t.stdout(`\n The tunnel closes in ${PE(n)}.${r ? " Press a then Enter to add an hour." : ""}\n`);
|
|
13206
|
+
let a = r ? LE(e.stdin, i, t) : () => {};
|
|
13190
13207
|
return {
|
|
13191
|
-
origins: () =>
|
|
13208
|
+
origins: () => i.publicOrigins(),
|
|
13192
13209
|
stop: async () => {
|
|
13193
|
-
|
|
13210
|
+
a(), await i.stop();
|
|
13194
13211
|
}
|
|
13195
13212
|
};
|
|
13196
13213
|
}, zE = async (e) => ge(l(e, Kp)).then(() => !0, () => !1), BE = async (e) => (await be(e, { withFileTypes: !0 }).catch(() => {
|
|
13197
|
-
throw new
|
|
13214
|
+
throw new D(`${e} cannot be read.`);
|
|
13198
13215
|
})).filter((e) => e.isDirectory() && !e.name.startsWith(".")).map((t) => l(e, t.name)), VE = (e) => {
|
|
13199
13216
|
let t = /* @__PURE__ */ new Map();
|
|
13200
13217
|
for (let n of e) {
|
|
13201
13218
|
let e = t.get(n.manifest.slug);
|
|
13202
|
-
if (e !== void 0) throw new
|
|
13219
|
+
if (e !== void 0) throw new D(`${e} and ${n.dir} both declare the slug ${n.manifest.slug}.`);
|
|
13203
13220
|
t.set(n.manifest.slug, n.dir);
|
|
13204
13221
|
}
|
|
13205
13222
|
}, HE = async (e) => {
|
|
@@ -13212,24 +13229,24 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13212
13229
|
dir: n,
|
|
13213
13230
|
manifest: (await qp(n)).manifest
|
|
13214
13231
|
});
|
|
13215
|
-
if (t.length === 0) throw new
|
|
13232
|
+
if (t.length === 0) throw new D(`No ${Kp} in ${e} or any folder directly inside it. Run \`qinto app create\` first, or point the command at an app directory.`);
|
|
13216
13233
|
return VE(t), t.sort((e, t) => e.manifest.slug.localeCompare(t.manifest.slug));
|
|
13217
13234
|
}, UE = async (e, t) => {
|
|
13218
13235
|
let n = e.map((e) => e.manifest.slug);
|
|
13219
13236
|
if (t.requested !== void 0) {
|
|
13220
13237
|
let e = t.requested.split(",").map((e) => e.trim()).filter((e) => e !== ""), r = e.filter((e) => !n.includes(e));
|
|
13221
|
-
if (r.length > 0) throw new
|
|
13238
|
+
if (r.length > 0) throw new D(`No app named ${r.join(", ")} was found. Available: ${n.join(", ")}.`);
|
|
13222
13239
|
return e;
|
|
13223
13240
|
}
|
|
13224
13241
|
return n.length === 1 || t.machine ? n : t.checkbox(n);
|
|
13225
13242
|
}, WE = async (e, t) => {
|
|
13226
13243
|
let n = await UE(e, t);
|
|
13227
|
-
if (n.length === 0) throw new
|
|
13228
|
-
if (n.length > 50) throw new
|
|
13244
|
+
if (n.length === 0) throw new D("No app was selected, so there is nothing to run.");
|
|
13245
|
+
if (n.length > 50) throw new D(`A site takes at most 50 apps, and ${n.length} were selected.`);
|
|
13229
13246
|
return e.filter((e) => n.includes(e.manifest.slug));
|
|
13230
13247
|
}, GE = "4310", KE = "4301", qE = "4300", JE = "4302", YE = (e, t) => {
|
|
13231
13248
|
let n = Number(t);
|
|
13232
|
-
if (!Number.isInteger(n) || n < 0 || n > 65535) throw new
|
|
13249
|
+
if (!Number.isInteger(n) || n < 0 || n > 65535) throw new D(`Pass a port between 0 and 65535 to ${e}.`);
|
|
13233
13250
|
return n;
|
|
13234
13251
|
}, XE = (e, t) => {
|
|
13235
13252
|
let n = e.state().apps[t], r = e.apps().find((e) => e.slug === t)?.manifest;
|
|
@@ -13258,7 +13275,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13258
13275
|
for (let e of n.events ?? []) t.stdout(` · ${e.name}${e.attrs === void 0 ? "" : ` ${JSON.stringify(e.attrs)}`}\n`);
|
|
13259
13276
|
}
|
|
13260
13277
|
}, nD = (e) => {
|
|
13261
|
-
let t = /* @__PURE__ */ new Set(), n =
|
|
13278
|
+
let t = /* @__PURE__ */ new Set(), n = hE({
|
|
13262
13279
|
quietMs: $E,
|
|
13263
13280
|
onChange: async () => {
|
|
13264
13281
|
let n = [...t];
|
|
@@ -13271,7 +13288,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13271
13288
|
}
|
|
13272
13289
|
}), r = e.mounted.map((e) => {
|
|
13273
13290
|
let r = e.manifest.ui?.dir;
|
|
13274
|
-
return
|
|
13291
|
+
return gE({
|
|
13275
13292
|
dir: e.dir,
|
|
13276
13293
|
ignore: r === void 0 ? [] : [r],
|
|
13277
13294
|
onChange: () => {
|
|
@@ -13281,7 +13298,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13281
13298
|
});
|
|
13282
13299
|
if (!new Set(e.mounted.map((e) => e.dir)).has(e.root)) {
|
|
13283
13300
|
let t = !1;
|
|
13284
|
-
r.push(
|
|
13301
|
+
r.push(yE({
|
|
13285
13302
|
dir: e.root,
|
|
13286
13303
|
intervalMs: eD,
|
|
13287
13304
|
onChange: () => {
|
|
@@ -13297,7 +13314,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13297
13314
|
console: YE("--console-port", r.consolePort),
|
|
13298
13315
|
ui: YE("--ui-port", r.uiPort)
|
|
13299
13316
|
};
|
|
13300
|
-
if (i.console === 0) throw new
|
|
13317
|
+
if (i.console === 0) throw new D("--console-port must be a real port: the app workers are given the console address before they start.");
|
|
13301
13318
|
let a = NE(r), o = nm(r, t), s = await WE(await HE(n), {
|
|
13302
13319
|
requested: r.apps,
|
|
13303
13320
|
machine: o,
|
|
@@ -13310,7 +13327,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13310
13327
|
let c = s.map((e) => ({
|
|
13311
13328
|
dir: e.dir,
|
|
13312
13329
|
readManifest: async () => (await qp(e.dir)).manifest
|
|
13313
|
-
})), l =
|
|
13330
|
+
})), l = SE();
|
|
13314
13331
|
try {
|
|
13315
13332
|
await iD({
|
|
13316
13333
|
root: n,
|
|
@@ -13329,7 +13346,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13329
13346
|
let c = await yC({
|
|
13330
13347
|
apps: n,
|
|
13331
13348
|
root: e,
|
|
13332
|
-
artifactRoot:
|
|
13349
|
+
artifactRoot: xE(),
|
|
13333
13350
|
host: "127.0.0.1",
|
|
13334
13351
|
port: r.worker,
|
|
13335
13352
|
uiPort: r.ui,
|
|
@@ -13452,6 +13469,11 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13452
13469
|
description: "Use this named Cloudflare Tunnel instead, for a hostname that survives a restart. Read from your own account, and created there if it does not exist: set CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID",
|
|
13453
13470
|
type: "string"
|
|
13454
13471
|
},
|
|
13472
|
+
{
|
|
13473
|
+
flag: "--tunnel-hours <hours>",
|
|
13474
|
+
description: "Close the tunnel after this many hours, instead of leaving it open until app dev stops",
|
|
13475
|
+
type: "string"
|
|
13476
|
+
},
|
|
13455
13477
|
{
|
|
13456
13478
|
flag: "--no-input",
|
|
13457
13479
|
description: "Disable all interactive prompts",
|
|
@@ -13529,7 +13551,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13529
13551
|
run: sD
|
|
13530
13552
|
}, lD = async (e) => {
|
|
13531
13553
|
let { deps: t, origin: n, slug: r, org: i, machine: a } = e, o = await km(t, n), s = i === void 0 ? o : o.filter((e) => e.organizationId === i || e.name === i);
|
|
13532
|
-
if (i !== void 0 && s.length === 0) throw new
|
|
13554
|
+
if (i !== void 0 && s.length === 0) throw new D(`Organization ${i} is not available to this credential.`);
|
|
13533
13555
|
let c = [];
|
|
13534
13556
|
for (let e of s) {
|
|
13535
13557
|
let i = (await Y(t, n, `/developer/organizations/${e.organizationId}/apps`)).apps.find((e) => e.slug === r);
|
|
@@ -13540,8 +13562,8 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13540
13562
|
}
|
|
13541
13563
|
let l = c.at(0);
|
|
13542
13564
|
if (c.length === 1 && l !== void 0) return l;
|
|
13543
|
-
if (c.length === 0) throw new
|
|
13544
|
-
if (a) throw new
|
|
13565
|
+
if (c.length === 0) throw new E(e.notFound);
|
|
13566
|
+
if (a) throw new D(`App '${r}' exists in several organizations.${e.orgFlag === !0 ? " Pass --org <organization>." : ""}`);
|
|
13545
13567
|
let u = await t.prompts.select(`Which organization's '${r}' should be used?`, c.map((e) => ({
|
|
13546
13568
|
name: e.organization.name,
|
|
13547
13569
|
value: e.organization.organizationId
|
|
@@ -13552,17 +13574,17 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13552
13574
|
if (i !== void 0 && fD.test(i)) try {
|
|
13553
13575
|
return (await Y(e, n, `/teams/${r}/domains/${i}`)).site;
|
|
13554
13576
|
} catch (e) {
|
|
13555
|
-
throw e instanceof
|
|
13577
|
+
throw e instanceof mr && e.code === "not_found" ? new D(`No authorized site matches ${i} in team ${r}.`) : e;
|
|
13556
13578
|
}
|
|
13557
13579
|
let o = await dD(e, n, r);
|
|
13558
13580
|
if (i !== void 0) {
|
|
13559
13581
|
let e = o.find((e) => e.domainId === i || e.domain === i);
|
|
13560
|
-
if (e === void 0) throw new
|
|
13582
|
+
if (e === void 0) throw new D(`No authorized site matches ${i} in team ${r}.`);
|
|
13561
13583
|
return e;
|
|
13562
13584
|
}
|
|
13563
13585
|
if (o.length === 1) return o[0];
|
|
13564
|
-
if (!a) throw new
|
|
13565
|
-
if (o.length === 0) throw new
|
|
13586
|
+
if (!a) throw new D("Pass a site ID or exact hostname when the team does not have exactly one authorized site.");
|
|
13587
|
+
if (o.length === 0) throw new D("This team has no authorized sites.");
|
|
13566
13588
|
let s = await e.prompts.select("Choose a site", o.map((e) => ({
|
|
13567
13589
|
name: `${e.domain} (${e.domainId})`,
|
|
13568
13590
|
value: e.domainId
|
|
@@ -13573,7 +13595,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13573
13595
|
return Y(e, n, `/teams/${r}/domains/${i}/dns/check`, { method: "POST" });
|
|
13574
13596
|
}, hD = (e) => e.records.length === 0 ? [] : e.records.map((e) => `${e.type} ${e.name} → ${e.value}${e.note === void 0 ? "" : ` (${e.note})`}`), gD = async (e, t) => (await Y(e, t, "/teams")).teams, _D = (e, t) => {
|
|
13575
13597
|
let n = e.find((e) => e.teamId === t);
|
|
13576
|
-
if (n === void 0) throw new
|
|
13598
|
+
if (n === void 0) throw new D(`Team ${t} is not authorized for this credential.`);
|
|
13577
13599
|
return n;
|
|
13578
13600
|
}, vD = async (e, t, n, r) => {
|
|
13579
13601
|
if (r !== void 0) return _D(n, r);
|
|
@@ -13586,13 +13608,13 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13586
13608
|
let r = n[0];
|
|
13587
13609
|
return await lm(e, t, r.teamId), r;
|
|
13588
13610
|
}
|
|
13589
|
-
throw new
|
|
13611
|
+
throw new D("No active team is selected. Run `qinto team active <teamId>` or pass `--team <teamId>`.");
|
|
13590
13612
|
}, yD = async (e) => {
|
|
13591
13613
|
let { deps: t, origin: n } = e, r = await vD(t, n, await gD(t, n), e.team), i = await dD(t, n, r.teamId), a = i.find((t) => t.domainId === e.site || t.domain === e.site);
|
|
13592
13614
|
if (a === void 0) {
|
|
13593
|
-
if (i.length === 0) throw new
|
|
13615
|
+
if (i.length === 0) throw new D(`Team ${r.teamId} has no authorized sites.`);
|
|
13594
13616
|
let t = i.map((e) => `${e.domain} (${e.domainId})`).join(", ");
|
|
13595
|
-
throw new
|
|
13617
|
+
throw new D(`No site matches '${e.site}' in team ${r.teamId}. Sites: ${t}.`);
|
|
13596
13618
|
}
|
|
13597
13619
|
return {
|
|
13598
13620
|
team: r,
|
|
@@ -13651,7 +13673,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13651
13673
|
headers: n.upload.headers,
|
|
13652
13674
|
body: new Uint8Array(t)
|
|
13653
13675
|
});
|
|
13654
|
-
if (!r.ok) throw new
|
|
13676
|
+
if (!r.ok) throw new E(`Uploading ${n.upload.key} failed with status ${r.status}${await TD(r)}.`);
|
|
13655
13677
|
}
|
|
13656
13678
|
});
|
|
13657
13679
|
await Promise.all(n);
|
|
@@ -13666,12 +13688,12 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13666
13688
|
}
|
|
13667
13689
|
}, OD = "The Qinto API rejected the request: ", kD = async (e) => {
|
|
13668
13690
|
let { error: t } = e;
|
|
13669
|
-
if (!(t instanceof
|
|
13691
|
+
if (!(t instanceof mr)) throw t;
|
|
13670
13692
|
let n = DD[t.code ?? ""];
|
|
13671
13693
|
if (n === void 0 || e.consent[n.key]) throw t;
|
|
13672
13694
|
let r = t.message.replace(OD, "");
|
|
13673
|
-
if (e.machine) throw new
|
|
13674
|
-
if (!await e.deps.prompts.confirm(`${r} Proceed?`, !1)) throw new
|
|
13695
|
+
if (e.machine) throw new D(`${r} Pass ${n.flag} to proceed.`);
|
|
13696
|
+
if (!await e.deps.prompts.confirm(`${r} Proceed?`, !1)) throw new D(`Install declined. Rerun with ${n.flag} to proceed.`);
|
|
13675
13697
|
return n.key;
|
|
13676
13698
|
}, AD = async (e) => {
|
|
13677
13699
|
let { deps: t, origin: n, machine: r, target: i, slug: a, appVersionId: o } = e, s = { ...e.consent }, c = `/teams/${i.team.teamId}/domains/${i.site.domainId}/apps/${a}`;
|
|
@@ -13702,7 +13724,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13702
13724
|
update: 1e4
|
|
13703
13725
|
});
|
|
13704
13726
|
} catch {
|
|
13705
|
-
throw new
|
|
13727
|
+
throw new E("A publish is already in progress here.");
|
|
13706
13728
|
}
|
|
13707
13729
|
try {
|
|
13708
13730
|
return await t();
|
|
@@ -13720,16 +13742,16 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13720
13742
|
try {
|
|
13721
13743
|
return JSON.parse(t);
|
|
13722
13744
|
} catch {
|
|
13723
|
-
throw new
|
|
13745
|
+
throw new E(".qinto/publish.json is corrupted. Pass --restart to discard it and start a fresh publish.");
|
|
13724
13746
|
}
|
|
13725
13747
|
}, ND = async (e, t) => {
|
|
13726
13748
|
await ve(l(e, ".qinto"), { recursive: !0 }), await we(l(e, ".qinto", "publish.json"), `${JSON.stringify(t, null, 2)}\n`);
|
|
13727
13749
|
}, PD = async (e) => {
|
|
13728
13750
|
await Se(l(e, ".qinto", "publish.json"), { force: !0 });
|
|
13729
13751
|
}, FD = "/dry-run/0.0.0/", ID = (e) => {
|
|
13730
|
-
if (e.bump !== void 0 && e.version !== void 0) throw new
|
|
13752
|
+
if (e.bump !== void 0 && e.version !== void 0) throw new D("Pass either --bump or --version, not both.");
|
|
13731
13753
|
if (e.version !== void 0) {
|
|
13732
|
-
if (!/^\d+\.\d+\.\d+$/.test(e.version)) throw new
|
|
13754
|
+
if (!/^\d+\.\d+\.\d+$/.test(e.version)) throw new D("Pass --version as x.y.z.");
|
|
13733
13755
|
return { version: e.version };
|
|
13734
13756
|
}
|
|
13735
13757
|
return { bump: e.bump ?? "patch" };
|
|
@@ -13740,7 +13762,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13740
13762
|
let t = e.restart ? null : await MD(e.dir);
|
|
13741
13763
|
if (t !== null) {
|
|
13742
13764
|
let n = t.request.bump === e.request.bump && t.request.version === e.request.version;
|
|
13743
|
-
if (t.slug !== e.slug || t.appId !== e.appId || !n) throw new
|
|
13765
|
+
if (t.slug !== e.slug || t.appId !== e.appId || !n) throw new D("An unfinished publish in this directory was started with different arguments. Rerun it with the same app and version request, or pass --restart to discard it.");
|
|
13744
13766
|
return t;
|
|
13745
13767
|
}
|
|
13746
13768
|
let n = {
|
|
@@ -13756,12 +13778,12 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13756
13778
|
}, BD = async (e) => {
|
|
13757
13779
|
let { deps: t, dir: n, manifest: r, basePath: i, outDir: a, progress: o } = e;
|
|
13758
13780
|
o("Building the server bundle…");
|
|
13759
|
-
let s = await
|
|
13781
|
+
let s = await Ur({
|
|
13760
13782
|
dir: n,
|
|
13761
13783
|
manifest: r,
|
|
13762
13784
|
outDir: a
|
|
13763
13785
|
});
|
|
13764
|
-
await
|
|
13786
|
+
await Xr({
|
|
13765
13787
|
manifest: r,
|
|
13766
13788
|
serverBundle: s.server
|
|
13767
13789
|
});
|
|
@@ -13779,12 +13801,12 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13779
13801
|
skipped: [],
|
|
13780
13802
|
inlineSourceMaps: []
|
|
13781
13803
|
};
|
|
13782
|
-
o("Building the UI panel…"), await
|
|
13804
|
+
o("Building the UI panel…"), await ei({
|
|
13783
13805
|
dir: n,
|
|
13784
13806
|
ui: r.ui,
|
|
13785
13807
|
basePath: i
|
|
13786
13808
|
});
|
|
13787
|
-
let u = f(n, r.ui.dir), d = await
|
|
13809
|
+
let u = f(n, r.ui.dir), d = await si({
|
|
13788
13810
|
uiRoot: u,
|
|
13789
13811
|
basePath: i
|
|
13790
13812
|
});
|
|
@@ -13798,7 +13820,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13798
13820
|
}, VD = async (e) => {
|
|
13799
13821
|
let { deps: t, origin: n, versionPath: r, publishId: i, manifest: a, artifacts: o } = e, s = {
|
|
13800
13822
|
publishId: i,
|
|
13801
|
-
manifestDigest: await
|
|
13823
|
+
manifestDigest: await Oi(a),
|
|
13802
13824
|
server: {
|
|
13803
13825
|
hash: o.server.hash,
|
|
13804
13826
|
size: o.server.size
|
|
@@ -13829,8 +13851,8 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
13829
13851
|
body: { publishId: i }
|
|
13830
13852
|
})).version;
|
|
13831
13853
|
} catch (a) {
|
|
13832
|
-
if (a instanceof
|
|
13833
|
-
if (!(a instanceof
|
|
13854
|
+
if (a instanceof mr && a.code === "app_variables_unset") throw new E(`${a.message} Set each one with \`qinto app var set\` or \`qinto app secret set\`, then re-run \`qinto app publish\` — this draft is still held, so it resumes on the same version.`);
|
|
13855
|
+
if (!(a instanceof mr) || a.code !== "artifacts_stale") throw a;
|
|
13834
13856
|
return e.progress("The declared artifacts went stale — redeclaring…"), await VD(e), (await Y(t, n, `${r}/finalize`, {
|
|
13835
13857
|
method: "POST",
|
|
13836
13858
|
body: { publishId: i }
|
|
@@ -14144,11 +14166,11 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
14144
14166
|
"description"
|
|
14145
14167
|
], XD = async (e) => {
|
|
14146
14168
|
if (e.value !== void 0 && e.value !== "") return e.value;
|
|
14147
|
-
if (e.machine) throw new
|
|
14169
|
+
if (e.machine) throw new D(`Pass ${e.flag}.`);
|
|
14148
14170
|
return e.deps.prompts.input(e.prompt);
|
|
14149
14171
|
}, ZD = async (e, t) => {
|
|
14150
14172
|
let n = YD.filter((e) => t[e] !== void 0);
|
|
14151
|
-
if (n.length > 0) throw new
|
|
14173
|
+
if (n.length > 0) throw new D(`${Kp} in ${e} already names the app. Remove ${n.map((e) => `--${e}`).join(", ")}.`);
|
|
14152
14174
|
let { manifest: r } = await qp(e);
|
|
14153
14175
|
return {
|
|
14154
14176
|
slug: r.slug,
|
|
@@ -14243,10 +14265,10 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
14243
14265
|
notFound: `App '${e.slug}' was not found in your organizations.`
|
|
14244
14266
|
}), aO = async (e, t, n) => (await Y(e, t, rO(n))).variables, oO = async (e) => {
|
|
14245
14267
|
let { deps: t, origin: n, resolved: r, name: i, value: a, scope: o } = e, s = (await aO(t, n, r)).find((e) => e.name === i);
|
|
14246
|
-
if (s === void 0) throw new
|
|
14268
|
+
if (s === void 0) throw new E(`No version of '${r.app.slug}' declares an app ${o.noun} named ${i}. Declare it under appVariables in qinto.app.jsonc first.`);
|
|
14247
14269
|
if (s.kind !== o.kind) {
|
|
14248
14270
|
let e = o.kind === "secret" ? tO : nO;
|
|
14249
|
-
throw new
|
|
14271
|
+
throw new E(`${i} is declared as a ${e.noun}; set it with \`${e.setCommand}\`.`);
|
|
14250
14272
|
}
|
|
14251
14273
|
return (await Y(t, n, rO(r), {
|
|
14252
14274
|
method: "PATCH",
|
|
@@ -14297,7 +14319,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
14297
14319
|
run: sO
|
|
14298
14320
|
}, lO = async (e, t) => {
|
|
14299
14321
|
let n = (e.interactive ? await e.prompts.password(`Value for ${t}`) : await e.readStdin()).trim();
|
|
14300
|
-
if (n === "") throw new
|
|
14322
|
+
if (n === "") throw new D(`No value for ${t}. Pipe it in (\`echo -n "$SECRET" | qinto app secret set …\`) or run this in a terminal.`);
|
|
14301
14323
|
return n;
|
|
14302
14324
|
}, uO = async (e, t) => {
|
|
14303
14325
|
let n = e.options, r = e.positionals.at(0), i = e.positionals.at(1), a = await q(t, n), o = await oO({
|
|
@@ -14369,7 +14391,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
14369
14391
|
try {
|
|
14370
14392
|
return await Y(t, n, `/teams/${r.team.teamId}/domains/${r.site.domainId}/apps/${i}`);
|
|
14371
14393
|
} catch (e) {
|
|
14372
|
-
throw e instanceof
|
|
14394
|
+
throw e instanceof mr && e.code === "not_found" ? new E(`App '${i}' is not installed on ${r.site.domain}.`) : e;
|
|
14373
14395
|
}
|
|
14374
14396
|
}, vO = async (e, t) => {
|
|
14375
14397
|
let n = e.options, r = e.positionals.at(0), i = await q(t, n), a = await yD({
|
|
@@ -14523,9 +14545,9 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
14523
14545
|
if (r !== void 0) return r;
|
|
14524
14546
|
o = e.nextCursor;
|
|
14525
14547
|
} while (o !== null);
|
|
14526
|
-
throw new
|
|
14548
|
+
throw new E(`Version ${i} was not found for '${r.app.slug}'.`);
|
|
14527
14549
|
}, TO = (e, t) => {
|
|
14528
|
-
throw e instanceof
|
|
14550
|
+
throw e instanceof mr && e.code === "not_draft" ? new E(`Version ${t} is already ready and can never be cancelled.`) : e instanceof mr && e.code === "not_holder" ? new E("Another publish holds this draft. Cancel it from that checkout, or pass --force as an organization owner.") : e;
|
|
14529
14551
|
}, EO = async (e, t) => {
|
|
14530
14552
|
let n = e.options, r = e.positionals.at(0), i = e.positionals.at(1), a = nm(n, t), o = await q(t, n), s = await lD({
|
|
14531
14553
|
deps: t,
|
|
@@ -14539,9 +14561,9 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
14539
14561
|
resolved: s,
|
|
14540
14562
|
version: i
|
|
14541
14563
|
});
|
|
14542
|
-
if (c.status === "ready") throw new
|
|
14564
|
+
if (c.status === "ready") throw new E(`Version ${i} is ready. A ready version is never cancelled; publish a new version instead.`);
|
|
14543
14565
|
let l = f(n.dir ?? "."), u = await MD(l), d = u !== null && u.appVersionId === c.appVersionId ? u.publishId : null;
|
|
14544
|
-
if (d === null && n.force !== !0) throw new
|
|
14566
|
+
if (d === null && n.force !== !0) throw new D("This checkout does not hold this draft. Organization owners can pass --force to release it.");
|
|
14545
14567
|
let p = {
|
|
14546
14568
|
...d === null ? {} : { publishId: d },
|
|
14547
14569
|
...n.force === !0 ? { force: !0 } : {}
|
|
@@ -14602,7 +14624,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
14602
14624
|
}, OO = (e) => {
|
|
14603
14625
|
if (e === void 0) return;
|
|
14604
14626
|
let t = Number.parseInt(e, 10);
|
|
14605
|
-
if (!Number.isInteger(t) || t < 1 || `${t}` !== e) throw new
|
|
14627
|
+
if (!Number.isInteger(t) || t < 1 || `${t}` !== e) throw new D("Pass a positive integer to --limit.");
|
|
14606
14628
|
return t;
|
|
14607
14629
|
}, kO = async (e, t) => {
|
|
14608
14630
|
let n = e.options, r = e.positionals.at(0), i = nm(n, t), a = OO(n.limit), o = await q(t, n), s = await lD({
|
|
@@ -14670,8 +14692,8 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
14670
14692
|
options: [],
|
|
14671
14693
|
run: async (e, t) => {
|
|
14672
14694
|
let n = e.positionals, r = n.length === 0 ? nA : nA.filter((e) => e.path.join(" ") === n.join(" "));
|
|
14673
|
-
if (r.length === 0) throw new
|
|
14674
|
-
t.stdout(`${JSON.stringify(
|
|
14695
|
+
if (r.length === 0) throw new E(`Unknown command: ${n.join(" ")}. Run \`qinto describe\` for the full list.`);
|
|
14696
|
+
t.stdout(`${JSON.stringify(Lr(r), null, 2)}\n`);
|
|
14675
14697
|
}
|
|
14676
14698
|
}, MO = async (e, t) => {
|
|
14677
14699
|
let n = e.options, r = await q(t, n), i = await vD(t, r, await gD(t, r), n.team), a = await pD(t, {
|
|
@@ -14782,7 +14804,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
14782
14804
|
}, HO = (e) => {
|
|
14783
14805
|
if (e === void 0) return [];
|
|
14784
14806
|
let t = VO(e);
|
|
14785
|
-
if (t === null) throw new
|
|
14807
|
+
if (t === null) throw new D("--share-dns must contain 1–10 comma-separated email addresses.");
|
|
14786
14808
|
return t;
|
|
14787
14809
|
}, UO = async (e) => {
|
|
14788
14810
|
let { deps: t, origin: n, teamId: r, domainId: i, emails: a, submissionId: o } = e;
|
|
@@ -14829,7 +14851,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
14829
14851
|
}, JO = async (e) => {
|
|
14830
14852
|
let { deps: t, origin: n, team: r, site: i, initialDns: a, options: o, machine: s, initiallyShared: c } = e, l = a, u = c, d = o.delivery === void 0 ? void 0 : RO[o.delivery];
|
|
14831
14853
|
if (d === "development_url") {
|
|
14832
|
-
if (i.developmentUrl === null) throw new
|
|
14854
|
+
if (i.developmentUrl === null) throw new D("This host does not provide a development URL.");
|
|
14833
14855
|
return {
|
|
14834
14856
|
dns: l,
|
|
14835
14857
|
delivery: "development_url",
|
|
@@ -14934,7 +14956,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
14934
14956
|
t.hostZone,
|
|
14935
14957
|
t.workersForPlatforms === !0 ? "workers-for-platforms" : void 0
|
|
14936
14958
|
];
|
|
14937
|
-
if (t.site !== void 0 && e !== void 0) throw new
|
|
14959
|
+
if (t.site !== void 0 && e !== void 0) throw new D("Pass either a root domain or --site, not both.");
|
|
14938
14960
|
if (t.site !== void 0 && [
|
|
14939
14961
|
t.mode,
|
|
14940
14962
|
t.name,
|
|
@@ -14942,7 +14964,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
14942
14964
|
t.jurisdiction,
|
|
14943
14965
|
t.locationHint,
|
|
14944
14966
|
...n
|
|
14945
|
-
].some((e) => e !== void 0)) throw new
|
|
14967
|
+
].some((e) => e !== void 0)) throw new D("--site cannot be combined with site creation or host settings.");
|
|
14946
14968
|
}, nk = (e, t) => {
|
|
14947
14969
|
if ([
|
|
14948
14970
|
e.hostId,
|
|
@@ -14950,19 +14972,19 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
14950
14972
|
e.cloudflareAccountId,
|
|
14951
14973
|
e.hostZone,
|
|
14952
14974
|
e.workersForPlatforms === !0 ? "workers-for-platforms" : void 0
|
|
14953
|
-
].some((e) => e !== void 0) && e.mode !== "self") throw new
|
|
14954
|
-
if (e.hostId !== void 0 && (e.hostName !== void 0 || e.cloudflareAccountId !== void 0)) throw new
|
|
14955
|
-
if (e.hostId !== void 0 && e.workersForPlatforms === !0) throw new
|
|
14956
|
-
if (t && e.mode === "self" && e.hostId === void 0 && (e.hostName === void 0 || e.cloudflareAccountId === void 0)) throw new
|
|
14975
|
+
].some((e) => e !== void 0) && e.mode !== "self") throw new D("Self-host options require --mode self.");
|
|
14976
|
+
if (e.hostId !== void 0 && (e.hostName !== void 0 || e.cloudflareAccountId !== void 0)) throw new D("--host-id cannot be combined with new-host settings.");
|
|
14977
|
+
if (e.hostId !== void 0 && e.workersForPlatforms === !0) throw new D("--workers-for-platforms is available only when creating a new host.");
|
|
14978
|
+
if (t && e.mode === "self" && e.hostId === void 0 && (e.hostName === void 0 || e.cloudflareAccountId === void 0)) throw new D("Self-hosting requires --host-id, or both --host-name and --cloudflare-account-id.");
|
|
14957
14979
|
}, rk = (e) => {
|
|
14958
|
-
if (e.shareSubmissionId !== void 0 && e.shareDns === void 0) throw new
|
|
14959
|
-
if (e.shareSubmissionId !== void 0 && !/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e.shareSubmissionId)) throw new
|
|
14980
|
+
if (e.shareSubmissionId !== void 0 && e.shareDns === void 0) throw new D("--share-submission-id requires --share-dns.");
|
|
14981
|
+
if (e.shareSubmissionId !== void 0 && !/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e.shareSubmissionId)) throw new D("--share-submission-id must be a UUID.");
|
|
14960
14982
|
HO(e.shareDns);
|
|
14961
14983
|
}, ik = (e, t, n) => {
|
|
14962
|
-
if (tk(e, t), nk(t, n), rk(t), n && t.site === void 0 && e === void 0) throw new
|
|
14984
|
+
if (tk(e, t), nk(t, n), rk(t), n && t.site === void 0 && e === void 0) throw new D("Pass [rootDomain] or --site in non-interactive mode.");
|
|
14963
14985
|
}, ak = async (e, t, n, r) => {
|
|
14964
14986
|
let i = t ?? await e.prompts.input("Customer root domain");
|
|
14965
|
-
if (i.trim() === "") throw new
|
|
14987
|
+
if (i.trim() === "") throw new D("The customer root domain cannot be empty.");
|
|
14966
14988
|
let a = n.mode ?? (r ? "managed" : await e.prompts.select("Hosting mode", [{
|
|
14967
14989
|
name: "Managed by Qinto",
|
|
14968
14990
|
value: "managed"
|
|
@@ -15045,7 +15067,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
15045
15067
|
return n === "__new__" ? void 0 : n;
|
|
15046
15068
|
}, dk = async (e, t, n) => {
|
|
15047
15069
|
let r = t.find((e) => e.hostId === n);
|
|
15048
|
-
if (r === void 0) throw new
|
|
15070
|
+
if (r === void 0) throw new D(`Host ${n} is not available in team ${e.teamId}.`);
|
|
15049
15071
|
let i = {
|
|
15050
15072
|
host: r,
|
|
15051
15073
|
zoneRequired: r.zoneDomain === null ? [] : null,
|
|
@@ -15076,7 +15098,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
15076
15098
|
}, pk = async (e) => {
|
|
15077
15099
|
let { deps: t, origin: n, teamId: r, options: i, machine: a } = e, o = i.hostName ?? await fk(t, () => t.prompts.input("Host display name"), "A host display name is required."), s = i.cloudflareAccountId ?? await fk(t, () => t.prompts.input("Cloudflare account ID"), "A Cloudflare account ID is required."), c = t.env.QINTO_CLOUDFLARE_API_TOKEN, l = c === void 0 || c === "" ? void 0 : c;
|
|
15078
15100
|
if (l === void 0) {
|
|
15079
|
-
if (a) throw new
|
|
15101
|
+
if (a) throw new D("Set QINTO_CLOUDFLARE_API_TOKEN when creating a self-host in non-interactive mode.");
|
|
15080
15102
|
l = await fk(t, () => t.prompts.password("Cloudflare API token"), "A Cloudflare API token is required.");
|
|
15081
15103
|
}
|
|
15082
15104
|
let u = await Y(t, n, `/teams/${r}/hosts`, {
|
|
@@ -15098,12 +15120,12 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
15098
15120
|
}, hk = async (e) => {
|
|
15099
15121
|
let { deps: t, candidates: n, hostname: r, machine: i } = e, a = n.find((e) => e.domain === r);
|
|
15100
15122
|
if (a === void 0) return null;
|
|
15101
|
-
if (i) throw new
|
|
15102
|
-
if (!await t.prompts.confirm(`Resume onboarding for ${r} (site ${a.domainId})?`, !0)) throw new
|
|
15123
|
+
if (i) throw new D(`Site ${r} already exists. Pass --site ${a.domainId} to resume it.`);
|
|
15124
|
+
if (!await t.prompts.confirm(`Resume onboarding for ${r} (site ${a.domainId})?`, !0)) throw new D(`Site ${r} already exists. Pass a different --subdomain, or --site ${a.domainId} to resume it.`);
|
|
15103
15125
|
return a;
|
|
15104
15126
|
}, gk = async (e) => {
|
|
15105
15127
|
let { deps: t, candidates: n, rootDomain: r, machine: i } = e;
|
|
15106
|
-
if (i) throw new
|
|
15128
|
+
if (i) throw new D(`Sites for ${r} already exist (${n.map((e) => e.domainId).join(", ")}). Pass --site <siteId> to resume one, or --subdomain to create a new site.`);
|
|
15107
15129
|
let a = await t.prompts.select(`${r} already has sites`, [...n.map((e) => ({
|
|
15108
15130
|
name: `Resume site ${e.domain} (${e.domainId})`,
|
|
15109
15131
|
value: e.domainId
|
|
@@ -15119,7 +15141,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
15119
15141
|
try {
|
|
15120
15142
|
s = await dD(t, n, r);
|
|
15121
15143
|
} catch (e) {
|
|
15122
|
-
if (e instanceof
|
|
15144
|
+
if (e instanceof mr && e.code === "forbidden") return null;
|
|
15123
15145
|
throw e;
|
|
15124
15146
|
}
|
|
15125
15147
|
let c = s.filter((e) => e.rootDomain === o);
|
|
@@ -15193,7 +15215,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
15193
15215
|
}, yk = async (e) => {
|
|
15194
15216
|
let { deps: t, origin: n, teams: r, options: i, machine: a } = e;
|
|
15195
15217
|
if (i.team !== void 0 || a) return vD(t, n, r, i.team);
|
|
15196
|
-
if (r.length === 0) throw new
|
|
15218
|
+
if (r.length === 0) throw new D("This credential has no authorized teams.");
|
|
15197
15219
|
let o = await cm(t, n), s = o === null ? void 0 : r.find((e) => e.teamId === o);
|
|
15198
15220
|
if (s !== void 0 && await t.prompts.confirm(`Use active team ${s.name ?? s.teamId} (${s.teamId})?`, !0)) return s;
|
|
15199
15221
|
let c = _D(r, await t.prompts.select("Choose the team to onboard", r.map((e) => ({
|
|
@@ -15395,7 +15417,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
15395
15417
|
e.stdout(`${t} (${Xp[t]})\n`);
|
|
15396
15418
|
}, Ck = (e) => {
|
|
15397
15419
|
let t = Yp.find((t) => t === e);
|
|
15398
|
-
if (t === void 0) throw new
|
|
15420
|
+
if (t === void 0) throw new D(`Unknown environment: ${e}. Choose ${Yp.join(" or ")}.`);
|
|
15399
15421
|
return t;
|
|
15400
15422
|
}, wk = {
|
|
15401
15423
|
path: ["env"],
|
|
@@ -15462,17 +15484,17 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
15462
15484
|
n.writeHead(e, { "content-type": "text/html; charset=utf-8" }).end(Ek(t, r));
|
|
15463
15485
|
};
|
|
15464
15486
|
if (r.searchParams.get("state") !== e) {
|
|
15465
|
-
i(400, "This login response does not match", "Close this tab and run the login command again."), u(new
|
|
15487
|
+
i(400, "This login response does not match", "Close this tab and run the login command again."), u(new E("State mismatch in the login response. Run `qinto login` again."));
|
|
15466
15488
|
return;
|
|
15467
15489
|
}
|
|
15468
15490
|
let a = r.searchParams.get("error");
|
|
15469
15491
|
if (a !== null) {
|
|
15470
|
-
i(200, "Login was not completed", "You can close this tab."), u(new
|
|
15492
|
+
i(200, "Login was not completed", "You can close this tab."), u(new E(a === "access_denied" ? "Login was denied in the browser." : `Authorization failed: ${a}`));
|
|
15471
15493
|
return;
|
|
15472
15494
|
}
|
|
15473
15495
|
let o = r.searchParams.get("code");
|
|
15474
15496
|
if (o === null) {
|
|
15475
|
-
i(400, "This login response carried no code", "Close this tab and run the login command again."), u(new
|
|
15497
|
+
i(400, "This login response carried no code", "Close this tab and run the login command again."), u(new E("The login response carried no authorization code."));
|
|
15476
15498
|
return;
|
|
15477
15499
|
}
|
|
15478
15500
|
i(200, "You are logged in to Qinto CLI", "Return to your terminal."), l(o);
|
|
@@ -15487,19 +15509,19 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
15487
15509
|
});
|
|
15488
15510
|
});
|
|
15489
15511
|
} catch (e) {
|
|
15490
|
-
throw c(), new
|
|
15512
|
+
throw c(), new E(`Could not start the browser login callback: ${e.message}`);
|
|
15491
15513
|
}
|
|
15492
15514
|
a.on("error", (e) => {
|
|
15493
|
-
u(new
|
|
15515
|
+
u(new E(`The browser login callback failed: ${e.message}`));
|
|
15494
15516
|
});
|
|
15495
15517
|
let { port: d } = a.address();
|
|
15496
15518
|
return o = setTimeout(() => {
|
|
15497
|
-
u(new
|
|
15519
|
+
u(new E(`Timed out after ${Math.round(t / 1e3)}s waiting for the browser login.`));
|
|
15498
15520
|
}, t), {
|
|
15499
15521
|
redirectUri: `http://127.0.0.1:${d}/callback`,
|
|
15500
15522
|
waitForCode: () => n,
|
|
15501
15523
|
close: () => {
|
|
15502
|
-
u(new
|
|
15524
|
+
u(new E("Browser login callback closed."));
|
|
15503
15525
|
}
|
|
15504
15526
|
};
|
|
15505
15527
|
}, Ok = (e) => ce("sha256").update(e).digest("base64url"), kk = () => {
|
|
@@ -15511,7 +15533,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
15511
15533
|
};
|
|
15512
15534
|
}, Ak = (e) => {
|
|
15513
15535
|
let t = Number(e);
|
|
15514
|
-
if (!Number.isFinite(t) || t <= 0) throw new
|
|
15536
|
+
if (!Number.isFinite(t) || t <= 0) throw new E(`Invalid --timeout value: ${e}`);
|
|
15515
15537
|
return t * 1e3;
|
|
15516
15538
|
}, jk = (e, t) => e === void 0 ? vm(t).join(" ") : e.split(/[\s,]+/).filter((e) => e !== "").join(" "), Mk = async (e, t, n) => {
|
|
15517
15539
|
try {
|
|
@@ -15556,7 +15578,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
15556
15578
|
try {
|
|
15557
15579
|
await xm(e, n.revocationEndpoint, n.refreshToken ?? n.accessToken);
|
|
15558
15580
|
} catch (e) {
|
|
15559
|
-
throw new
|
|
15581
|
+
throw new E(`Could not save the new login (${t.message}) and could not revoke it (${e.message}). Revoke Qinto CLI under User → Authorized apps in the Qinto platform.`);
|
|
15560
15582
|
}
|
|
15561
15583
|
throw t;
|
|
15562
15584
|
}
|
|
@@ -15645,7 +15667,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
15645
15667
|
let a = await Sm(t, i);
|
|
15646
15668
|
if (a.length > 0) {
|
|
15647
15669
|
let e = a[0];
|
|
15648
|
-
throw new
|
|
15670
|
+
throw new E(`Could not revoke the session on the server (${e.error.message}) Nothing was cleared — retry once the Qinto API is reachable, or revoke the app under User → Authorized apps in the Qinto platform.`);
|
|
15649
15671
|
}
|
|
15650
15672
|
return await e.save(r, {
|
|
15651
15673
|
login: null,
|
|
@@ -15679,7 +15701,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
15679
15701
|
await Bk(t, r, i, n.json === !0);
|
|
15680
15702
|
return;
|
|
15681
15703
|
}
|
|
15682
|
-
if (i.length === 0) throw new
|
|
15704
|
+
if (i.length === 0) throw new D("This credential has no authorized teams.");
|
|
15683
15705
|
let o = a;
|
|
15684
15706
|
if (o === void 0) {
|
|
15685
15707
|
let e = await cm(t, r), n = e === null ? void 0 : i.find((t) => t.teamId === e);
|
|
@@ -15754,7 +15776,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
15754
15776
|
let t = e;
|
|
15755
15777
|
for (; !S(l(t, "package.json"));) {
|
|
15756
15778
|
let e = c(t);
|
|
15757
|
-
if (e === t) throw new
|
|
15779
|
+
if (e === t) throw new E("Could not find the Qinto CLI installation directory.");
|
|
15758
15780
|
t = e;
|
|
15759
15781
|
}
|
|
15760
15782
|
return t;
|
|
@@ -15763,30 +15785,30 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
15763
15785
|
let t = e.replaceAll("\\", "/");
|
|
15764
15786
|
return Kk.find(([e]) => t.includes(e))?.[1] ?? "npm";
|
|
15765
15787
|
}, Yk = (e) => {
|
|
15766
|
-
throw new
|
|
15788
|
+
throw new E(`Unsupported install source: ${String(e)}`);
|
|
15767
15789
|
}, Xk = (e) => {
|
|
15768
15790
|
switch (e) {
|
|
15769
15791
|
case "npm": return `npm install --global ${Gk}@latest`;
|
|
15770
15792
|
case "pnpm": return `pnpm add --global ${Gk}@latest`;
|
|
15771
15793
|
case "yarn": return `yarn global add ${Gk}@latest`;
|
|
15772
15794
|
case "bun": return `bun add --global ${Gk}@latest`;
|
|
15773
|
-
case "npx": throw new
|
|
15774
|
-
case "checkout": throw new
|
|
15795
|
+
case "npx": throw new E("This CLI runs through npx, which fetches the newest version on every run. There is nothing to update.");
|
|
15796
|
+
case "checkout": throw new E("This CLI runs from a source checkout. Update it with git, not with a package manager.");
|
|
15775
15797
|
/* v8 ignore next 3 -- InstallSource is a closed union; the default only enforces exhaustive handling. */
|
|
15776
15798
|
default: return Yk(e);
|
|
15777
15799
|
}
|
|
15778
15800
|
}, Zk = async (e, t) => {
|
|
15779
|
-
let n = await
|
|
15780
|
-
if (n === null) throw new
|
|
15781
|
-
if (!
|
|
15782
|
-
e.stdout(`The Qinto CLI is up to date (${
|
|
15801
|
+
let n = await Ar(e);
|
|
15802
|
+
if (n === null) throw new E("Could not reach the npm registry to look up the newest Qinto CLI.");
|
|
15803
|
+
if (!Tr(n, vr)) {
|
|
15804
|
+
e.stdout(`The Qinto CLI is up to date (${vr}).\n`);
|
|
15783
15805
|
return;
|
|
15784
15806
|
}
|
|
15785
|
-
e.stderr(`Updating the Qinto CLI ${
|
|
15807
|
+
e.stderr(`Updating the Qinto CLI ${vr} -> ${n} with \`${t}\`.\n`);
|
|
15786
15808
|
try {
|
|
15787
15809
|
await e.runShell(t);
|
|
15788
15810
|
} catch (e) {
|
|
15789
|
-
throw new
|
|
15811
|
+
throw new E(`\`${t}\` failed: ${e instanceof Error ? e.message : String(e)}`);
|
|
15790
15812
|
}
|
|
15791
15813
|
e.stdout(`Updated the Qinto CLI to ${n}.\n`);
|
|
15792
15814
|
}, Qk = {
|
|
@@ -15809,8 +15831,8 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
15809
15831
|
return e.teams.length > 0 && n.push("Teams:", ...e.teams.map((e) => ` ${e.teamId === t ? "*" : "-"} ${e.name ?? e.teamId} (${e.teamId})`)), e.organizations.length > 0 && n.push("Organizations:", ...e.organizations.map((e) => ` - ${e.name} (${e.role})`)), n.push("Scopes:", ...$k(e.scopes)), n;
|
|
15810
15832
|
}, tA = async (e, t) => {
|
|
15811
15833
|
let n = e.options, r = await q(t, n), i = await Dm(t, r, "/me");
|
|
15812
|
-
if (i.status === 401) throw new
|
|
15813
|
-
if (!i.ok) throw new
|
|
15834
|
+
if (i.status === 401) throw new E(`Your session is no longer valid. Run \`${tm(r)}\` again.`);
|
|
15835
|
+
if (!i.ok) throw new E(`The Qinto API answered ${i.status}.`);
|
|
15814
15836
|
let a = await i.json(), o = await cm(t, r);
|
|
15815
15837
|
if (n.json === !0) {
|
|
15816
15838
|
t.stdout(`${JSON.stringify({
|
|
@@ -15868,11 +15890,11 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
15868
15890
|
} catch (e) {
|
|
15869
15891
|
if (e instanceof Error && e.name === "ExitPromptError") throw n.stderr("Aborted.\n"), new rA("Aborted.", 130);
|
|
15870
15892
|
let r = e instanceof Error ? e.message : String(e);
|
|
15871
|
-
throw n.stderr(t.options.json === !0 ? `${JSON.stringify({ error: r })}\n` : `${r}\n`), new rA(r, e instanceof
|
|
15893
|
+
throw n.stderr(t.options.json === !0 ? `${JSON.stringify({ error: r })}\n` : `${r}\n`), new rA(r, e instanceof D ? 2 : 1);
|
|
15872
15894
|
}
|
|
15873
15895
|
}, oA = (e, t = nA, n = !1) => {
|
|
15874
15896
|
let r = new pe("qinto");
|
|
15875
|
-
r.description("The Qinto platform CLI"), r.version(
|
|
15897
|
+
r.description("The Qinto platform CLI"), r.version(pr.version);
|
|
15876
15898
|
let i = (t) => {
|
|
15877
15899
|
t.exitOverride(), t.configureOutput({
|
|
15878
15900
|
writeOut: (t) => {
|
|
@@ -15909,7 +15931,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
15909
15931
|
return r;
|
|
15910
15932
|
}, sA = (e) => {
|
|
15911
15933
|
let t = [...nA].sort((e, t) => t.path.length - e.path.length).find((t) => t.path.every((t, n) => e.at(n) === t));
|
|
15912
|
-
return t === void 0 || !e.includes("--json") ? !1 : t.options.some((e) =>
|
|
15934
|
+
return t === void 0 || !e.includes("--json") ? !1 : t.options.some((e) => Ir(e.flag) === "json");
|
|
15913
15935
|
}, cA = async (e, t) => {
|
|
15914
15936
|
let n = t.length === 0 ? ["--help"] : t, r = sA(n);
|
|
15915
15937
|
try {
|
|
@@ -15920,11 +15942,11 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
15920
15942
|
throw t;
|
|
15921
15943
|
}
|
|
15922
15944
|
}, lA = async (e, t) => {
|
|
15923
|
-
let n =
|
|
15945
|
+
let n = Mr(e, t);
|
|
15924
15946
|
try {
|
|
15925
15947
|
return await cA(e, t);
|
|
15926
15948
|
} finally {
|
|
15927
|
-
await
|
|
15949
|
+
await Pr(e, n);
|
|
15928
15950
|
}
|
|
15929
15951
|
}, uA = m(t), dA = {
|
|
15930
15952
|
fetch: globalThis.fetch,
|
|
@@ -15953,7 +15975,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
15953
15975
|
return Buffer.concat(e).toString("utf8");
|
|
15954
15976
|
},
|
|
15955
15977
|
prompts: {
|
|
15956
|
-
select: async (e, t, n) =>
|
|
15978
|
+
select: async (e, t, n) => fr({
|
|
15957
15979
|
message: e,
|
|
15958
15980
|
choices: t,
|
|
15959
15981
|
default: n
|
|
@@ -15961,7 +15983,7 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
15961
15983
|
input: process.stdin,
|
|
15962
15984
|
output: process.stderr
|
|
15963
15985
|
}),
|
|
15964
|
-
checkbox: async (e, t, n) =>
|
|
15986
|
+
checkbox: async (e, t, n) => er({
|
|
15965
15987
|
message: e,
|
|
15966
15988
|
choices: t.map((e) => ({
|
|
15967
15989
|
...e,
|
|
@@ -15971,21 +15993,21 @@ Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, or run the command once in a
|
|
|
15971
15993
|
input: process.stdin,
|
|
15972
15994
|
output: process.stderr
|
|
15973
15995
|
}),
|
|
15974
|
-
input: async (e, t) =>
|
|
15996
|
+
input: async (e, t) => ar({
|
|
15975
15997
|
message: e,
|
|
15976
15998
|
default: t
|
|
15977
15999
|
}, {
|
|
15978
16000
|
input: process.stdin,
|
|
15979
16001
|
output: process.stderr
|
|
15980
16002
|
}),
|
|
15981
|
-
confirm: async (e, t) =>
|
|
16003
|
+
confirm: async (e, t) => rr({
|
|
15982
16004
|
message: e,
|
|
15983
16005
|
default: t
|
|
15984
16006
|
}, {
|
|
15985
16007
|
input: process.stdin,
|
|
15986
16008
|
output: process.stderr
|
|
15987
16009
|
}),
|
|
15988
|
-
password: async (e) =>
|
|
16010
|
+
password: async (e) => sr({
|
|
15989
16011
|
message: e,
|
|
15990
16012
|
mask: "*"
|
|
15991
16013
|
}, {
|