@connectedxm/zpl-generator 0.0.4-beta.6 → 0.0.4-beta.8
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/dist/index.es.js +151 -138
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -11,8 +11,8 @@ function u(e, t, n) {
|
|
|
11
11
|
return;
|
|
12
12
|
c._zod.traits.add(e), t(c, a);
|
|
13
13
|
const l = i.prototype, f = Object.keys(l);
|
|
14
|
-
for (let
|
|
15
|
-
const d = f[
|
|
14
|
+
for (let h = 0; h < f.length; h++) {
|
|
15
|
+
const d = f[h];
|
|
16
16
|
d in c || (c[d] = l[d].bind(c));
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -449,7 +449,7 @@ function vn(e) {
|
|
|
449
449
|
const bn = (e) => {
|
|
450
450
|
const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
451
451
|
return new RegExp(`^${t}$`);
|
|
452
|
-
}, yn = /^-?\d+$/, zn = /^-?\d+(?:\.\d+)?$/, wn = /^(?:true|false)$/i,
|
|
452
|
+
}, yn = /^-?\d+$/, zn = /^-?\d+(?:\.\d+)?$/, wn = /^(?:true|false)$/i, kn = /^[^A-Z]*$/, $n = /^[^a-z]*$/, E = /* @__PURE__ */ u("$ZodCheck", (e, t) => {
|
|
453
453
|
var n;
|
|
454
454
|
e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
|
|
455
455
|
}), tt = {
|
|
@@ -666,9 +666,9 @@ const bn = (e) => {
|
|
|
666
666
|
});
|
|
667
667
|
};
|
|
668
668
|
}), Nn = /* @__PURE__ */ u("$ZodCheckLowerCase", (e, t) => {
|
|
669
|
-
t.pattern ?? (t.pattern = $n), ie.init(e, t);
|
|
670
|
-
}), Pn = /* @__PURE__ */ u("$ZodCheckUpperCase", (e, t) => {
|
|
671
669
|
t.pattern ?? (t.pattern = kn), ie.init(e, t);
|
|
670
|
+
}), Pn = /* @__PURE__ */ u("$ZodCheckUpperCase", (e, t) => {
|
|
671
|
+
t.pattern ?? (t.pattern = $n), ie.init(e, t);
|
|
672
672
|
}), An = /* @__PURE__ */ u("$ZodCheckIncludes", (e, t) => {
|
|
673
673
|
E.init(e, t);
|
|
674
674
|
const n = U(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
@@ -767,18 +767,18 @@ const Dn = {
|
|
|
767
767
|
else {
|
|
768
768
|
const o = (i, c, a) => {
|
|
769
769
|
let l = D(i), f;
|
|
770
|
-
for (const
|
|
771
|
-
if (
|
|
772
|
-
if (!
|
|
770
|
+
for (const h of c) {
|
|
771
|
+
if (h._zod.def.when) {
|
|
772
|
+
if (!h._zod.def.when(i))
|
|
773
773
|
continue;
|
|
774
774
|
} else if (l)
|
|
775
775
|
continue;
|
|
776
|
-
const d = i.issues.length,
|
|
777
|
-
if (
|
|
776
|
+
const d = i.issues.length, m = h._zod.check(i);
|
|
777
|
+
if (m instanceof Promise && a?.async === !1)
|
|
778
778
|
throw new F();
|
|
779
|
-
if (f ||
|
|
779
|
+
if (f || m instanceof Promise)
|
|
780
780
|
f = (f ?? Promise.resolve()).then(async () => {
|
|
781
|
-
await
|
|
781
|
+
await m, i.issues.length !== d && (l || (l = D(i, d)));
|
|
782
782
|
});
|
|
783
783
|
else {
|
|
784
784
|
if (i.issues.length === d)
|
|
@@ -1073,7 +1073,7 @@ const ur = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
|
|
|
1073
1073
|
inst: e
|
|
1074
1074
|
}), n);
|
|
1075
1075
|
});
|
|
1076
|
-
function
|
|
1076
|
+
function ke(e, t, n) {
|
|
1077
1077
|
e.issues.length && t.issues.push(...Ke(n, e.issues)), t.value[n] = e.value;
|
|
1078
1078
|
}
|
|
1079
1079
|
const hr = /* @__PURE__ */ u("$ZodArray", (e, t) => {
|
|
@@ -1093,7 +1093,7 @@ const hr = /* @__PURE__ */ u("$ZodArray", (e, t) => {
|
|
|
1093
1093
|
value: c,
|
|
1094
1094
|
issues: []
|
|
1095
1095
|
}, r);
|
|
1096
|
-
a instanceof Promise ? s.push(a.then((l) =>
|
|
1096
|
+
a instanceof Promise ? s.push(a.then((l) => ke(l, n, i))) : ke(a, n, i);
|
|
1097
1097
|
}
|
|
1098
1098
|
return s.length ? Promise.all(s).then(() => n) : n;
|
|
1099
1099
|
};
|
|
@@ -1122,15 +1122,15 @@ function st(e) {
|
|
|
1122
1122
|
}
|
|
1123
1123
|
function ct(e, t, n, r, o, s) {
|
|
1124
1124
|
const i = [], c = o.keySet, a = o.catchall._zod, l = a.def.type, f = a.optout === "optional";
|
|
1125
|
-
for (const
|
|
1126
|
-
if (c.has(
|
|
1125
|
+
for (const h in t) {
|
|
1126
|
+
if (c.has(h))
|
|
1127
1127
|
continue;
|
|
1128
1128
|
if (l === "never") {
|
|
1129
|
-
i.push(
|
|
1129
|
+
i.push(h);
|
|
1130
1130
|
continue;
|
|
1131
1131
|
}
|
|
1132
|
-
const d = a.run({ value: t[
|
|
1133
|
-
d instanceof Promise ? e.push(d.then((
|
|
1132
|
+
const d = a.run({ value: t[h], issues: [] }, r);
|
|
1133
|
+
d instanceof Promise ? e.push(d.then((m) => X(m, n, h, t, f))) : X(d, n, h, t, f);
|
|
1134
1134
|
}
|
|
1135
1135
|
return i.length && n.issues.push({
|
|
1136
1136
|
code: "unrecognized_keys",
|
|
@@ -1158,8 +1158,8 @@ const mr = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1158
1158
|
const f = c[l]._zod;
|
|
1159
1159
|
if (f.values) {
|
|
1160
1160
|
a[l] ?? (a[l] = /* @__PURE__ */ new Set());
|
|
1161
|
-
for (const
|
|
1162
|
-
a[l].add(
|
|
1161
|
+
for (const h of f.values)
|
|
1162
|
+
a[l].add(h);
|
|
1163
1163
|
}
|
|
1164
1164
|
}
|
|
1165
1165
|
return a;
|
|
@@ -1177,29 +1177,29 @@ const mr = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1177
1177
|
inst: e
|
|
1178
1178
|
}), c;
|
|
1179
1179
|
c.value = {};
|
|
1180
|
-
const f = [],
|
|
1180
|
+
const f = [], h = i.shape;
|
|
1181
1181
|
for (const d of i.keys) {
|
|
1182
|
-
const
|
|
1183
|
-
|
|
1182
|
+
const m = h[d], w = m._zod.optout === "optional", k = m._zod.run({ value: l[d], issues: [] }, a);
|
|
1183
|
+
k instanceof Promise ? f.push(k.then((K) => X(K, c, d, l, w))) : X(k, c, d, l, w);
|
|
1184
1184
|
}
|
|
1185
1185
|
return s ? ct(f, l, c, a, r.value, e) : f.length ? Promise.all(f).then(() => c) : c;
|
|
1186
1186
|
};
|
|
1187
1187
|
}), _r = /* @__PURE__ */ u("$ZodObjectJIT", (e, t) => {
|
|
1188
1188
|
mr.init(e, t);
|
|
1189
1189
|
const n = e._zod.parse, r = ne(() => st(t)), o = (d) => {
|
|
1190
|
-
const
|
|
1190
|
+
const m = new Rn(["shape", "payload", "ctx"]), w = r.value, k = (N) => {
|
|
1191
1191
|
const O = ze(N);
|
|
1192
1192
|
return `shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`;
|
|
1193
1193
|
};
|
|
1194
|
-
|
|
1194
|
+
m.write("const input = payload.value;");
|
|
1195
1195
|
const K = /* @__PURE__ */ Object.create(null);
|
|
1196
|
-
let
|
|
1197
|
-
for (const N of
|
|
1198
|
-
K[N] = `key_${
|
|
1199
|
-
|
|
1200
|
-
for (const N of
|
|
1196
|
+
let $t = 0;
|
|
1197
|
+
for (const N of w.keys)
|
|
1198
|
+
K[N] = `key_${$t++}`;
|
|
1199
|
+
m.write("const newResult = {};");
|
|
1200
|
+
for (const N of w.keys) {
|
|
1201
1201
|
const O = K[N], I = ze(N), St = d[N]?._zod?.optout === "optional";
|
|
1202
|
-
|
|
1202
|
+
m.write(`const ${O} = ${k(N)};`), St ? m.write(`
|
|
1203
1203
|
if (${O}.issues.length) {
|
|
1204
1204
|
if (${I} in input) {
|
|
1205
1205
|
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
@@ -1217,7 +1217,7 @@ const mr = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1217
1217
|
newResult[${I}] = ${O}.value;
|
|
1218
1218
|
}
|
|
1219
1219
|
|
|
1220
|
-
`) :
|
|
1220
|
+
`) : m.write(`
|
|
1221
1221
|
if (${O}.issues.length) {
|
|
1222
1222
|
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
1223
1223
|
...iss,
|
|
@@ -1235,25 +1235,25 @@ const mr = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1235
1235
|
|
|
1236
1236
|
`);
|
|
1237
1237
|
}
|
|
1238
|
-
|
|
1239
|
-
const Zt =
|
|
1238
|
+
m.write("payload.value = newResult;"), m.write("return payload;");
|
|
1239
|
+
const Zt = m.compile();
|
|
1240
1240
|
return (N, O) => Zt(d, N, O);
|
|
1241
1241
|
};
|
|
1242
1242
|
let s;
|
|
1243
1243
|
const i = B, c = !Ve.jitless, l = c && Tt.value, f = t.catchall;
|
|
1244
|
-
let
|
|
1245
|
-
e._zod.parse = (d,
|
|
1246
|
-
|
|
1247
|
-
const
|
|
1248
|
-
return i(
|
|
1244
|
+
let h;
|
|
1245
|
+
e._zod.parse = (d, m) => {
|
|
1246
|
+
h ?? (h = r.value);
|
|
1247
|
+
const w = d.value;
|
|
1248
|
+
return i(w) ? c && l && m?.async === !1 && m.jitless !== !0 ? (s || (s = o(t.shape)), d = s(d, m), f ? ct([], w, d, m, h, e) : d) : n(d, m) : (d.issues.push({
|
|
1249
1249
|
expected: "object",
|
|
1250
1250
|
code: "invalid_type",
|
|
1251
|
-
input:
|
|
1251
|
+
input: w,
|
|
1252
1252
|
inst: e
|
|
1253
1253
|
}), d);
|
|
1254
1254
|
};
|
|
1255
1255
|
});
|
|
1256
|
-
function
|
|
1256
|
+
function $e(e, t, n, r) {
|
|
1257
1257
|
for (const s of e)
|
|
1258
1258
|
if (s.issues.length === 0)
|
|
1259
1259
|
return t.value = s.value, t;
|
|
@@ -1294,7 +1294,7 @@ const at = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
|
|
|
1294
1294
|
c.push(l);
|
|
1295
1295
|
}
|
|
1296
1296
|
}
|
|
1297
|
-
return i ? Promise.all(c).then((a) =>
|
|
1297
|
+
return i ? Promise.all(c).then((a) => $e(a, o, e, s)) : $e(c, o, e, s);
|
|
1298
1298
|
};
|
|
1299
1299
|
}), gr = /* @__PURE__ */ u("$ZodDiscriminatedUnion", (e, t) => {
|
|
1300
1300
|
t.inclusive = !1, at.init(e, t);
|
|
@@ -1465,12 +1465,12 @@ const ut = /* @__PURE__ */ u("$ZodOptional", (e, t) => {
|
|
|
1465
1465
|
};
|
|
1466
1466
|
}), wr = /* @__PURE__ */ u("$ZodExactOptional", (e, t) => {
|
|
1467
1467
|
ut.init(e, t), _(e._zod, "values", () => t.innerType._zod.values), _(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (n, r) => t.innerType._zod.run(n, r);
|
|
1468
|
-
}),
|
|
1468
|
+
}), kr = /* @__PURE__ */ u("$ZodNullable", (e, t) => {
|
|
1469
1469
|
y.init(e, t), _(e._zod, "optin", () => t.innerType._zod.optin), _(e._zod, "optout", () => t.innerType._zod.optout), _(e._zod, "pattern", () => {
|
|
1470
1470
|
const n = t.innerType._zod.pattern;
|
|
1471
1471
|
return n ? new RegExp(`^(${he(n.source)}|null)$`) : void 0;
|
|
1472
1472
|
}), _(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (n, r) => n.value === null ? n : t.innerType._zod.run(n, r);
|
|
1473
|
-
}),
|
|
1473
|
+
}), $r = /* @__PURE__ */ u("$ZodDefault", (e, t) => {
|
|
1474
1474
|
y.init(e, t), e._zod.optin = "optional", _(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
1475
1475
|
if (r.direction === "backward")
|
|
1476
1476
|
return t.innerType._zod.run(n, r);
|
|
@@ -2070,7 +2070,7 @@ function wo(e, t, n) {
|
|
|
2070
2070
|
});
|
|
2071
2071
|
}
|
|
2072
2072
|
// @__NO_SIDE_EFFECTS__
|
|
2073
|
-
function
|
|
2073
|
+
function ko(e, t, n) {
|
|
2074
2074
|
return new e({
|
|
2075
2075
|
type: "custom",
|
|
2076
2076
|
check: "custom",
|
|
@@ -2079,7 +2079,7 @@ function $o(e, t, n) {
|
|
|
2079
2079
|
});
|
|
2080
2080
|
}
|
|
2081
2081
|
// @__NO_SIDE_EFFECTS__
|
|
2082
|
-
function
|
|
2082
|
+
function $o(e) {
|
|
2083
2083
|
const t = /* @__PURE__ */ Zo((n) => (n.addIssue = (r) => {
|
|
2084
2084
|
if (typeof r == "string")
|
|
2085
2085
|
n.issues.push(Y(r, n.value, t._zod.def));
|
|
@@ -2134,13 +2134,13 @@ function $(e, t, n = { path: [], schemaPath: [] }) {
|
|
|
2134
2134
|
if (e._zod.processJSONSchema)
|
|
2135
2135
|
e._zod.processJSONSchema(t, i.schema, f);
|
|
2136
2136
|
else {
|
|
2137
|
-
const d = i.schema,
|
|
2138
|
-
if (!
|
|
2137
|
+
const d = i.schema, m = t.processors[o.type];
|
|
2138
|
+
if (!m)
|
|
2139
2139
|
throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);
|
|
2140
|
-
|
|
2140
|
+
m(e, t, d, f);
|
|
2141
2141
|
}
|
|
2142
|
-
const
|
|
2143
|
-
|
|
2142
|
+
const h = e._zod.parent;
|
|
2143
|
+
h && (i.ref || (i.ref = h), $(h, t, f), t.seen.get(h).isParent = !0);
|
|
2144
2144
|
}
|
|
2145
2145
|
const a = t.metadataRegistry.get(e);
|
|
2146
2146
|
return a && Object.assign(i.schema, a), t.io === "input" && S(e) && (delete i.schema.examples, delete i.schema.default), t.io === "input" && i.schema._prefault && ((r = i.schema).default ?? (r.default = i.schema._prefault)), delete i.schema._prefault, t.seen.get(e).schema;
|
|
@@ -2162,11 +2162,11 @@ function dt(e, t) {
|
|
|
2162
2162
|
const o = (i) => {
|
|
2163
2163
|
const c = e.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
2164
2164
|
if (e.external) {
|
|
2165
|
-
const
|
|
2166
|
-
if (
|
|
2167
|
-
return { ref: d(
|
|
2168
|
-
const
|
|
2169
|
-
return i[1].defId =
|
|
2165
|
+
const h = e.external.registry.get(i[0])?.id, d = e.external.uri ?? ((w) => w);
|
|
2166
|
+
if (h)
|
|
2167
|
+
return { ref: d(h) };
|
|
2168
|
+
const m = i[1].defId ?? i[1].schema.id ?? `schema${e.counter++}`;
|
|
2169
|
+
return i[1].defId = m, { defId: m, ref: `${d("__shared")}#/${c}/${m}` };
|
|
2170
2170
|
}
|
|
2171
2171
|
if (i[1] === n)
|
|
2172
2172
|
return { ref: "#" };
|
|
@@ -2178,8 +2178,8 @@ function dt(e, t) {
|
|
|
2178
2178
|
const c = i[1], { ref: a, defId: l } = o(i);
|
|
2179
2179
|
c.def = { ...c.schema }, l && (c.defId = l);
|
|
2180
2180
|
const f = c.schema;
|
|
2181
|
-
for (const
|
|
2182
|
-
delete f[
|
|
2181
|
+
for (const h in f)
|
|
2182
|
+
delete f[h];
|
|
2183
2183
|
f.$ref = a;
|
|
2184
2184
|
};
|
|
2185
2185
|
if (e.cycles === "throw")
|
|
@@ -2228,21 +2228,21 @@ function ht(e, t) {
|
|
|
2228
2228
|
const a = c.def ?? c.schema, l = { ...a }, f = c.ref;
|
|
2229
2229
|
if (c.ref = null, f) {
|
|
2230
2230
|
r(f);
|
|
2231
|
-
const d = e.seen.get(f),
|
|
2232
|
-
if (
|
|
2233
|
-
for (const
|
|
2234
|
-
|
|
2235
|
-
if (
|
|
2236
|
-
for (const
|
|
2237
|
-
|
|
2231
|
+
const d = e.seen.get(f), m = d.schema;
|
|
2232
|
+
if (m.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (a.allOf = a.allOf ?? [], a.allOf.push(m)) : Object.assign(a, m), Object.assign(a, l), i._zod.parent === f)
|
|
2233
|
+
for (const k in a)
|
|
2234
|
+
k === "$ref" || k === "allOf" || k in l || delete a[k];
|
|
2235
|
+
if (m.$ref && d.def)
|
|
2236
|
+
for (const k in a)
|
|
2237
|
+
k === "$ref" || k === "allOf" || k in d.def && JSON.stringify(a[k]) === JSON.stringify(d.def[k]) && delete a[k];
|
|
2238
2238
|
}
|
|
2239
|
-
const
|
|
2240
|
-
if (
|
|
2241
|
-
r(
|
|
2242
|
-
const d = e.seen.get(
|
|
2239
|
+
const h = i._zod.parent;
|
|
2240
|
+
if (h && h !== f) {
|
|
2241
|
+
r(h);
|
|
2242
|
+
const d = e.seen.get(h);
|
|
2243
2243
|
if (d?.schema.$ref && (a.$ref = d.schema.$ref, d.def))
|
|
2244
|
-
for (const
|
|
2245
|
-
|
|
2244
|
+
for (const m in a)
|
|
2245
|
+
m === "$ref" || m === "allOf" || m in d.def && JSON.stringify(a[m]) === JSON.stringify(d.def[m]) && delete a[m];
|
|
2246
2246
|
}
|
|
2247
2247
|
e.override({
|
|
2248
2248
|
zodSchema: i,
|
|
@@ -2345,9 +2345,9 @@ const So = (e, t = {}) => (n) => {
|
|
|
2345
2345
|
if (typeof s == "number" && (o.minLength = s), typeof i == "number" && (o.maxLength = i), c && (o.format = Oo[c] ?? c, o.format === "" && delete o.format, c === "time" && delete o.format), l && (o.contentEncoding = l), a && a.size > 0) {
|
|
2346
2346
|
const f = [...a];
|
|
2347
2347
|
f.length === 1 ? o.pattern = f[0].source : f.length > 1 && (o.allOf = [
|
|
2348
|
-
...f.map((
|
|
2348
|
+
...f.map((h) => ({
|
|
2349
2349
|
...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
|
|
2350
|
-
pattern:
|
|
2350
|
+
pattern: h.source
|
|
2351
2351
|
}))
|
|
2352
2352
|
]);
|
|
2353
2353
|
}
|
|
@@ -2553,7 +2553,7 @@ const ni = (e, t) => {
|
|
|
2553
2553
|
const n = e._zod.bag;
|
|
2554
2554
|
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */ lo(...r)), e.includes = (...r) => e.check(/* @__PURE__ */ ho(...r)), e.startsWith = (...r) => e.check(/* @__PURE__ */ mo(...r)), e.endsWith = (...r) => e.check(/* @__PURE__ */ _o(...r)), e.min = (...r) => e.check(/* @__PURE__ */ Q(...r)), e.max = (...r) => e.check(/* @__PURE__ */ lt(...r)), e.length = (...r) => e.check(/* @__PURE__ */ ft(...r)), e.nonempty = (...r) => e.check(/* @__PURE__ */ Q(1, ...r)), e.lowercase = (r) => e.check(/* @__PURE__ */ fo(r)), e.uppercase = (r) => e.check(/* @__PURE__ */ po(r)), e.trim = () => e.check(/* @__PURE__ */ vo()), e.normalize = (...r) => e.check(/* @__PURE__ */ go(...r)), e.toLowerCase = () => e.check(/* @__PURE__ */ bo()), e.toUpperCase = () => e.check(/* @__PURE__ */ yo()), e.slugify = () => e.check(/* @__PURE__ */ zo());
|
|
2555
2555
|
}), mi = /* @__PURE__ */ u("ZodString", (e, t) => {
|
|
2556
|
-
ve.init(e, t), _t.init(e, t), e.email = (n) => e.check(/* @__PURE__ */ jr(_i, n)), e.url = (n) => e.check(/* @__PURE__ */ Fr(gi, n)), e.jwt = (n) => e.check(/* @__PURE__ */ eo(Pi, n)), e.emoji = (n) => e.check(/* @__PURE__ */ Mr(vi, n)), e.guid = (n) => e.check(/* @__PURE__ */ Pe(Ce, n)), e.uuid = (n) => e.check(/* @__PURE__ */ xr(q, n)), e.uuidv4 = (n) => e.check(/* @__PURE__ */ Cr(q, n)), e.uuidv6 = (n) => e.check(/* @__PURE__ */ Rr(q, n)), e.uuidv7 = (n) => e.check(/* @__PURE__ */ Dr(q, n)), e.nanoid = (n) => e.check(/* @__PURE__ */ Ur(bi, n)), e.guid = (n) => e.check(/* @__PURE__ */ Pe(Ce, n)), e.cuid = (n) => e.check(/* @__PURE__ */ Lr(yi, n)), e.cuid2 = (n) => e.check(/* @__PURE__ */ Jr(zi, n)), e.ulid = (n) => e.check(/* @__PURE__ */ Vr(wi, n)), e.base64 = (n) => e.check(/* @__PURE__ */ qr(Ti, n)), e.base64url = (n) => e.check(/* @__PURE__ */ Xr(Ii, n)), e.xid = (n) => e.check(/* @__PURE__ */ Br(
|
|
2556
|
+
ve.init(e, t), _t.init(e, t), e.email = (n) => e.check(/* @__PURE__ */ jr(_i, n)), e.url = (n) => e.check(/* @__PURE__ */ Fr(gi, n)), e.jwt = (n) => e.check(/* @__PURE__ */ eo(Pi, n)), e.emoji = (n) => e.check(/* @__PURE__ */ Mr(vi, n)), e.guid = (n) => e.check(/* @__PURE__ */ Pe(Ce, n)), e.uuid = (n) => e.check(/* @__PURE__ */ xr(q, n)), e.uuidv4 = (n) => e.check(/* @__PURE__ */ Cr(q, n)), e.uuidv6 = (n) => e.check(/* @__PURE__ */ Rr(q, n)), e.uuidv7 = (n) => e.check(/* @__PURE__ */ Dr(q, n)), e.nanoid = (n) => e.check(/* @__PURE__ */ Ur(bi, n)), e.guid = (n) => e.check(/* @__PURE__ */ Pe(Ce, n)), e.cuid = (n) => e.check(/* @__PURE__ */ Lr(yi, n)), e.cuid2 = (n) => e.check(/* @__PURE__ */ Jr(zi, n)), e.ulid = (n) => e.check(/* @__PURE__ */ Vr(wi, n)), e.base64 = (n) => e.check(/* @__PURE__ */ qr(Ti, n)), e.base64url = (n) => e.check(/* @__PURE__ */ Xr(Ii, n)), e.xid = (n) => e.check(/* @__PURE__ */ Br(ki, n)), e.ksuid = (n) => e.check(/* @__PURE__ */ Wr($i, n)), e.ipv4 = (n) => e.check(/* @__PURE__ */ Yr(Zi, n)), e.ipv6 = (n) => e.check(/* @__PURE__ */ Kr(Si, n)), e.cidrv4 = (n) => e.check(/* @__PURE__ */ Gr(Oi, n)), e.cidrv6 = (n) => e.check(/* @__PURE__ */ Hr(Ei, n)), e.e164 = (n) => e.check(/* @__PURE__ */ Qr(Ni, n)), e.datetime = (n) => e.check(Go(n)), e.date = (n) => e.check(qo(n)), e.time = (n) => e.check(Qo(n)), e.duration = (n) => e.check(ti(n));
|
|
2557
2557
|
});
|
|
2558
2558
|
function P(e) {
|
|
2559
2559
|
return /* @__PURE__ */ Ar(mi, e);
|
|
@@ -2578,9 +2578,9 @@ const b = /* @__PURE__ */ u("ZodStringFormat", (e, t) => {
|
|
|
2578
2578
|
Wn.init(e, t), b.init(e, t);
|
|
2579
2579
|
}), wi = /* @__PURE__ */ u("ZodULID", (e, t) => {
|
|
2580
2580
|
Yn.init(e, t), b.init(e, t);
|
|
2581
|
-
}),
|
|
2581
|
+
}), ki = /* @__PURE__ */ u("ZodXID", (e, t) => {
|
|
2582
2582
|
Kn.init(e, t), b.init(e, t);
|
|
2583
|
-
}),
|
|
2583
|
+
}), $i = /* @__PURE__ */ u("ZodKSUID", (e, t) => {
|
|
2584
2584
|
Gn.init(e, t), b.init(e, t);
|
|
2585
2585
|
}), Zi = /* @__PURE__ */ u("ZodIPv4", (e, t) => {
|
|
2586
2586
|
er.init(e, t), b.init(e, t);
|
|
@@ -2717,7 +2717,7 @@ function Bi(e, t) {
|
|
|
2717
2717
|
...p(t)
|
|
2718
2718
|
});
|
|
2719
2719
|
}
|
|
2720
|
-
function
|
|
2720
|
+
function Z(e, t) {
|
|
2721
2721
|
return new te({
|
|
2722
2722
|
type: "enum",
|
|
2723
2723
|
entries: e,
|
|
@@ -2781,7 +2781,7 @@ function Hi(e) {
|
|
|
2781
2781
|
});
|
|
2782
2782
|
}
|
|
2783
2783
|
const qi = /* @__PURE__ */ u("ZodNullable", (e, t) => {
|
|
2784
|
-
|
|
2784
|
+
kr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Uo(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2785
2785
|
});
|
|
2786
2786
|
function Ue(e) {
|
|
2787
2787
|
return new qi({
|
|
@@ -2790,7 +2790,7 @@ function Ue(e) {
|
|
|
2790
2790
|
});
|
|
2791
2791
|
}
|
|
2792
2792
|
const Xi = /* @__PURE__ */ u("ZodDefault", (e, t) => {
|
|
2793
|
-
|
|
2793
|
+
$r.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Jo(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
2794
2794
|
});
|
|
2795
2795
|
function Qi(e, t) {
|
|
2796
2796
|
return new Xi({
|
|
@@ -2857,10 +2857,10 @@ const as = /* @__PURE__ */ u("ZodCustom", (e, t) => {
|
|
|
2857
2857
|
Ir.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => xo(e, n);
|
|
2858
2858
|
});
|
|
2859
2859
|
function us(e, t = {}) {
|
|
2860
|
-
return /* @__PURE__ */
|
|
2860
|
+
return /* @__PURE__ */ ko(as, e, t);
|
|
2861
2861
|
}
|
|
2862
2862
|
function ls(e) {
|
|
2863
|
-
return /* @__PURE__ */
|
|
2863
|
+
return /* @__PURE__ */ $o(e);
|
|
2864
2864
|
}
|
|
2865
2865
|
const fs = {
|
|
2866
2866
|
Off: "O",
|
|
@@ -2876,31 +2876,31 @@ const fs = {
|
|
|
2876
2876
|
Backfeed70: "70",
|
|
2877
2877
|
Backfeed80: "80",
|
|
2878
2878
|
Backfeed90: "90"
|
|
2879
|
-
}, ps =
|
|
2879
|
+
}, ps = Z(fs), ds = {
|
|
2880
2880
|
Continuous: "N",
|
|
2881
2881
|
VariableLengthContinuous: "V",
|
|
2882
2882
|
NonContinuousWebSensing: "W",
|
|
2883
2883
|
NonContinuousWebSensingAlt: "Y",
|
|
2884
2884
|
NonContinuousMarkSensing: "M",
|
|
2885
2885
|
AutoDetect: "A"
|
|
2886
|
-
}, hs =
|
|
2886
|
+
}, hs = Z(ds), ms = {
|
|
2887
2887
|
DirectThermal: "D",
|
|
2888
2888
|
ThermalTransfer: "T"
|
|
2889
|
-
}, _s =
|
|
2889
|
+
}, _s = Z(ms), gs = {
|
|
2890
2890
|
Invert: "I",
|
|
2891
2891
|
Normal: "N"
|
|
2892
|
-
}, vs =
|
|
2892
|
+
}, vs = Z(gs), bs = {
|
|
2893
2893
|
Mirror: "Y",
|
|
2894
2894
|
Normal: "N"
|
|
2895
|
-
}, ys =
|
|
2895
|
+
}, ys = Z(bs), zs = {
|
|
2896
2896
|
Normal: "A",
|
|
2897
2897
|
Half: "B"
|
|
2898
|
-
}, ws =
|
|
2898
|
+
}, ws = Z(
|
|
2899
2899
|
zs
|
|
2900
|
-
),
|
|
2900
|
+
), ks = {
|
|
2901
2901
|
Enable: "Y",
|
|
2902
2902
|
Disable: "N"
|
|
2903
|
-
},
|
|
2903
|
+
}, $s = Z(ks), Zs = {
|
|
2904
2904
|
TearOff: "T",
|
|
2905
2905
|
PeelOff: "P",
|
|
2906
2906
|
Rewind: "R",
|
|
@@ -2909,46 +2909,46 @@ const fs = {
|
|
|
2909
2909
|
DelayedCut: "D",
|
|
2910
2910
|
EncodeRFID: "F",
|
|
2911
2911
|
Kiosk: "K"
|
|
2912
|
-
}, Ss =
|
|
2912
|
+
}, Ss = Z(Zs), Os = {
|
|
2913
2913
|
Prepeel: "Y",
|
|
2914
2914
|
NoPrepeel: "N"
|
|
2915
|
-
}, Es =
|
|
2915
|
+
}, Es = Z(Os), Ts = {
|
|
2916
2916
|
AllMedia: "Y",
|
|
2917
2917
|
ContinuousOnly: "N"
|
|
2918
|
-
}, Is =
|
|
2918
|
+
}, Is = Z(Ts), Ns = {
|
|
2919
2919
|
NoRotation: "N",
|
|
2920
2920
|
Rotate90: "R",
|
|
2921
2921
|
Rotate180: "I",
|
|
2922
2922
|
Rotate270: "B"
|
|
2923
|
-
}, zt =
|
|
2923
|
+
}, zt = Z(Ns), Ps = {
|
|
2924
2924
|
Left: "L",
|
|
2925
2925
|
Right: "R",
|
|
2926
2926
|
Center: "C",
|
|
2927
2927
|
Justified: "J"
|
|
2928
|
-
}, As =
|
|
2928
|
+
}, As = Z(Ps), js = {
|
|
2929
2929
|
Highest: "H",
|
|
2930
2930
|
High: "Q",
|
|
2931
2931
|
Medium: "M",
|
|
2932
2932
|
Lower: "L"
|
|
2933
|
-
}, xs =
|
|
2933
|
+
}, xs = Z(js), Cs = {
|
|
2934
2934
|
Yes: "Y",
|
|
2935
2935
|
No: "N"
|
|
2936
|
-
}, ue =
|
|
2936
|
+
}, ue = Z(Cs), wt = {
|
|
2937
2937
|
Start: "start",
|
|
2938
2938
|
End: "end"
|
|
2939
|
-
}, Rs =
|
|
2939
|
+
}, Rs = Z(wt), Ds = {
|
|
2940
2940
|
account: "account",
|
|
2941
2941
|
accountAttributes: "accountAttributes",
|
|
2942
2942
|
accountTiers: "accountTiers",
|
|
2943
2943
|
pass: "pass",
|
|
2944
2944
|
passResponses: "passResponses",
|
|
2945
2945
|
passAttributes: "passAttributes"
|
|
2946
|
-
}, Fs =
|
|
2946
|
+
}, Fs = Z(Ds), V = {
|
|
2947
2947
|
None: "None",
|
|
2948
2948
|
Uppercase: "Uppercase",
|
|
2949
2949
|
Lowercase: "Lowercase",
|
|
2950
2950
|
Capitalize: "Capitalize"
|
|
2951
|
-
}, Ms =
|
|
2951
|
+
}, Ms = Z(V), rc = se({
|
|
2952
2952
|
word: P(),
|
|
2953
2953
|
width: g(),
|
|
2954
2954
|
spaceWidth: g()
|
|
@@ -3005,7 +3005,7 @@ const fs = {
|
|
|
3005
3005
|
]), Bs = se({
|
|
3006
3006
|
name: P(),
|
|
3007
3007
|
alias: P().length(1)
|
|
3008
|
-
}),
|
|
3008
|
+
}), kt = se({
|
|
3009
3009
|
type: M("thermal"),
|
|
3010
3010
|
// ~TA adjustment
|
|
3011
3011
|
tearOffAdjustment: g().int().min(0).max(120),
|
|
@@ -3032,7 +3032,7 @@ const fs = {
|
|
|
3032
3032
|
// ~SD darkness
|
|
3033
3033
|
darkness: g().int().min(0).max(30),
|
|
3034
3034
|
// ^LR reverse
|
|
3035
|
-
reverse:
|
|
3035
|
+
reverse: $s,
|
|
3036
3036
|
// ^MM mode, prepeel
|
|
3037
3037
|
postPrintMode: Ss,
|
|
3038
3038
|
prepeel: Es,
|
|
@@ -3046,10 +3046,10 @@ const fs = {
|
|
|
3046
3046
|
fonts: pe(Bs)
|
|
3047
3047
|
});
|
|
3048
3048
|
function oc(e) {
|
|
3049
|
-
return
|
|
3049
|
+
return kt.safeParse(e);
|
|
3050
3050
|
}
|
|
3051
3051
|
function ic(e) {
|
|
3052
|
-
return
|
|
3052
|
+
return kt.parse(e);
|
|
3053
3053
|
}
|
|
3054
3054
|
function sc(e, t) {
|
|
3055
3055
|
if (e.type === "thermal")
|
|
@@ -3109,37 +3109,50 @@ function Gs(e, t) {
|
|
|
3109
3109
|
let n = [];
|
|
3110
3110
|
const r = e.sourceLookup.split(",");
|
|
3111
3111
|
for (const o of r) {
|
|
3112
|
-
const s = o.
|
|
3113
|
-
let
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3112
|
+
const s = o.split("?").map((c) => c.trim());
|
|
3113
|
+
let i;
|
|
3114
|
+
for (const c of s) {
|
|
3115
|
+
const a = c.match(/^(.+)\[(\d+)\]$/), l = a ? a[1].trim() : c, f = a ? parseInt(a[2], 10) : void 0;
|
|
3116
|
+
let h;
|
|
3117
|
+
switch (e.sourceType) {
|
|
3118
|
+
case "account":
|
|
3119
|
+
h = t.account[l];
|
|
3120
|
+
break;
|
|
3121
|
+
case "accountAttributes":
|
|
3122
|
+
h = t.accountAttributes.find((d) => d.id === l)?.value;
|
|
3123
|
+
break;
|
|
3124
|
+
case "accountTiers":
|
|
3125
|
+
h = t.accountTier?.name;
|
|
3126
|
+
break;
|
|
3127
|
+
case "pass":
|
|
3128
|
+
h = t.pass[l];
|
|
3129
|
+
break;
|
|
3130
|
+
case "passResponses":
|
|
3131
|
+
h = t.passResponses.find((d) => d.name === l)?.value;
|
|
3132
|
+
break;
|
|
3133
|
+
case "passAttributes":
|
|
3134
|
+
h = t.passAttributes.find((d) => d.name === l)?.value;
|
|
3135
|
+
break;
|
|
3136
|
+
default:
|
|
3137
|
+
h = "";
|
|
3138
|
+
break;
|
|
3139
|
+
}
|
|
3140
|
+
if (h != null && h !== "")
|
|
3141
|
+
if (f !== void 0) {
|
|
3142
|
+
const m = h.split(",")[f];
|
|
3143
|
+
if (m !== void 0) {
|
|
3144
|
+
const w = m.trim();
|
|
3145
|
+
if (w) {
|
|
3146
|
+
i = w;
|
|
3147
|
+
break;
|
|
3148
|
+
}
|
|
3149
|
+
}
|
|
3150
|
+
} else {
|
|
3151
|
+
i = h;
|
|
3152
|
+
break;
|
|
3153
|
+
}
|
|
3136
3154
|
}
|
|
3137
|
-
|
|
3138
|
-
if (a && c !== void 0) {
|
|
3139
|
-
const f = a.split(",")[c];
|
|
3140
|
-
f !== void 0 && n.push(f.trim());
|
|
3141
|
-
} else
|
|
3142
|
-
n.push(a);
|
|
3155
|
+
i !== void 0 && n.push(i);
|
|
3143
3156
|
}
|
|
3144
3157
|
return n.length === 0 ? e.hideEmpty ? void 0 : (e.defaultValue ?? "").trim() : n.join(e.sourceSeperator ?? " ").trim();
|
|
3145
3158
|
}
|
|
@@ -3154,7 +3167,7 @@ function Hs(e, t) {
|
|
|
3154
3167
|
t = t.toLowerCase();
|
|
3155
3168
|
break;
|
|
3156
3169
|
case V.Capitalize:
|
|
3157
|
-
t = t.
|
|
3170
|
+
t = t.toLowerCase().replace(/\b\w/g, (n) => n.toUpperCase());
|
|
3158
3171
|
break;
|
|
3159
3172
|
}
|
|
3160
3173
|
return e.maxCharacters !== void 0 && (t = t.slice(0, e.maxCharacters)), t;
|
|
@@ -3202,7 +3215,7 @@ export {
|
|
|
3202
3215
|
zs as PrintDensityAdjustment,
|
|
3203
3216
|
gs as PrintOrientation,
|
|
3204
3217
|
js as QRCodeErrorCorrection,
|
|
3205
|
-
|
|
3218
|
+
ks as ReverseMode,
|
|
3206
3219
|
Ds as SourceType,
|
|
3207
3220
|
Ps as TextAlignment,
|
|
3208
3221
|
V as TextTransformation,
|
|
@@ -3211,7 +3224,7 @@ export {
|
|
|
3211
3224
|
Cs as YesNo,
|
|
3212
3225
|
Is as allMediaModeSchema,
|
|
3213
3226
|
ps as backfeedActionSchema,
|
|
3214
|
-
|
|
3227
|
+
kt as badgeSchema,
|
|
3215
3228
|
Ls as barcodeFieldSchema,
|
|
3216
3229
|
Xs as countLines,
|
|
3217
3230
|
Vs as fieldSchema,
|
|
@@ -3227,7 +3240,7 @@ export {
|
|
|
3227
3240
|
vs as printOrientationSchema,
|
|
3228
3241
|
xs as qrCodeErrorCorrectionSchema,
|
|
3229
3242
|
Js as qrcodeFieldSchema,
|
|
3230
|
-
|
|
3243
|
+
$s as reverseModeSchema,
|
|
3231
3244
|
Fs as sourceTypeSchema,
|
|
3232
3245
|
As as textAlignmentSchema,
|
|
3233
3246
|
Us as textFieldSchema,
|