@authhero/drizzle 0.49.1 → 0.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/drizzle-adapter.cjs +2 -2
- package/dist/drizzle-adapter.mjs +698 -677
- package/package.json +2 -2
package/dist/drizzle-adapter.mjs
CHANGED
|
@@ -174,7 +174,7 @@ const Js = {
|
|
|
174
174
|
startActiveSpan(n, e) {
|
|
175
175
|
return e();
|
|
176
176
|
}
|
|
177
|
-
},
|
|
177
|
+
}, zt = Symbol.for("drizzle:ViewBaseConfig"), In = Symbol.for("drizzle:Schema"), xi = Symbol.for("drizzle:Columns"), ki = Symbol.for("drizzle:ExtraConfigColumns"), Cn = Symbol.for("drizzle:OriginalName"), Dn = Symbol.for("drizzle:BaseName"), _n = Symbol.for("drizzle:IsAlias"), Oi = Symbol.for("drizzle:ExtraConfigBuilder"), Qs = Symbol.for("drizzle:IsDrizzleTable");
|
|
178
178
|
var Zi, Hi, Ki, Ji, Qi, Gi, Wi, Xi, Yi, eo;
|
|
179
179
|
eo = L, Yi = Ot, Xi = Cn, Wi = In, Gi = xi, Qi = ki, Ji = Dn, Ki = _n, Hi = Qs, Zi = Oi;
|
|
180
180
|
class fe {
|
|
@@ -294,8 +294,8 @@ const mt = class mt {
|
|
|
294
294
|
return { sql: "", params: [] };
|
|
295
295
|
if (Array.isArray(p)) {
|
|
296
296
|
const y = [new we("(")];
|
|
297
|
-
for (const [E,
|
|
298
|
-
y.push(
|
|
297
|
+
for (const [E, T] of p.entries())
|
|
298
|
+
y.push(T), E < p.length - 1 && y.push(new we(", "));
|
|
299
299
|
return y.push(new we(")")), this.buildQueryFromSourceParams(y, i);
|
|
300
300
|
}
|
|
301
301
|
if (ve(p, mt))
|
|
@@ -321,14 +321,14 @@ const mt = class mt {
|
|
|
321
321
|
};
|
|
322
322
|
}
|
|
323
323
|
if (ve(p, gi)) {
|
|
324
|
-
const y = p[
|
|
324
|
+
const y = p[zt].schema, E = p[zt].name;
|
|
325
325
|
return {
|
|
326
|
-
sql: y === void 0 || p[
|
|
326
|
+
sql: y === void 0 || p[zt].isAlias ? s(E) : s(y) + "." + s(E),
|
|
327
327
|
params: []
|
|
328
328
|
};
|
|
329
329
|
}
|
|
330
|
-
if (ve(p,
|
|
331
|
-
if (ve(p.value,
|
|
330
|
+
if (ve(p, Ft)) {
|
|
331
|
+
if (ve(p.value, Pt))
|
|
332
332
|
return { sql: l(f.value++, p), params: [p], typings: ["none"] };
|
|
333
333
|
const y = p.value === null ? null : p.encoder.mapToDriverValue(p.value);
|
|
334
334
|
if (ve(y, mt))
|
|
@@ -338,7 +338,7 @@ const mt = class mt {
|
|
|
338
338
|
let E = ["none"];
|
|
339
339
|
return d && (E = [d(p.encoder)]), { sql: l(f.value++, y), params: [y], typings: E };
|
|
340
340
|
}
|
|
341
|
-
return ve(p,
|
|
341
|
+
return ve(p, Pt) ? { sql: l(f.value++, p), params: [p], typings: ["none"] } : ve(p, mt.Aliased) && p.fieldAlias !== void 0 ? { sql: s(p.fieldAlias), params: [] } : ve(p, hi) ? p._.isWith ? { sql: s(p._.alias), params: [] } : this.buildQueryFromSourceParams([
|
|
342
342
|
new we("("),
|
|
343
343
|
p._.sql,
|
|
344
344
|
new we(") "),
|
|
@@ -413,7 +413,7 @@ const Ia = {
|
|
|
413
413
|
});
|
|
414
414
|
var oo;
|
|
415
415
|
oo = L;
|
|
416
|
-
class
|
|
416
|
+
class Ft {
|
|
417
417
|
/**
|
|
418
418
|
* @param value - Parameter value
|
|
419
419
|
* @param encoder - Encoder to convert the value to a driver parameter
|
|
@@ -426,7 +426,7 @@ class zt {
|
|
|
426
426
|
return new ce([this]);
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
-
v(
|
|
429
|
+
v(Ft, oo, "Param");
|
|
430
430
|
function O(n, ...e) {
|
|
431
431
|
const t = [];
|
|
432
432
|
(e.length > 0 || n.length > 0 && n[0] !== "") && t.push(new we(n[0]));
|
|
@@ -459,11 +459,11 @@ function O(n, ...e) {
|
|
|
459
459
|
}
|
|
460
460
|
n.identifier = s;
|
|
461
461
|
function l(u) {
|
|
462
|
-
return new
|
|
462
|
+
return new Pt(u);
|
|
463
463
|
}
|
|
464
464
|
n.placeholder = l;
|
|
465
465
|
function d(u, f) {
|
|
466
|
-
return new
|
|
466
|
+
return new Ft(u, f);
|
|
467
467
|
}
|
|
468
468
|
n.param = d;
|
|
469
469
|
})(O || (O = {}));
|
|
@@ -490,7 +490,7 @@ function O(n, ...e) {
|
|
|
490
490
|
})(ce || (ce = {}));
|
|
491
491
|
var ao;
|
|
492
492
|
ao = L;
|
|
493
|
-
class
|
|
493
|
+
class Pt {
|
|
494
494
|
constructor(e) {
|
|
495
495
|
this.name = e;
|
|
496
496
|
}
|
|
@@ -498,17 +498,17 @@ class Ft {
|
|
|
498
498
|
return new ce([this]);
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
-
v(
|
|
501
|
+
v(Pt, ao, "Placeholder");
|
|
502
502
|
const Xs = Symbol.for("drizzle:IsDrizzleView");
|
|
503
503
|
var so, ro, lo;
|
|
504
|
-
lo = L, ro =
|
|
504
|
+
lo = L, ro = zt, so = Xs;
|
|
505
505
|
class gi {
|
|
506
506
|
constructor({ name: e, schema: t, selectedFields: i, query: o }) {
|
|
507
507
|
/** @internal */
|
|
508
508
|
v(this, ro);
|
|
509
509
|
/** @internal */
|
|
510
510
|
v(this, so, !0);
|
|
511
|
-
this[
|
|
511
|
+
this[zt] = {
|
|
512
512
|
name: e,
|
|
513
513
|
originalName: e,
|
|
514
514
|
schema: t,
|
|
@@ -540,7 +540,7 @@ function tn(n, e) {
|
|
|
540
540
|
}
|
|
541
541
|
const Da = typeof TextDecoder > "u" ? null : new TextDecoder();
|
|
542
542
|
function ct(n, e) {
|
|
543
|
-
return Ws(e) && !Aa(n) && !ve(n,
|
|
543
|
+
return Ws(e) && !Aa(n) && !ve(n, Ft) && !ve(n, Pt) && !ve(n, en) && !ve(n, fe) && !ve(n, gi) ? new Ft(n, e) : n;
|
|
544
544
|
}
|
|
545
545
|
const c = (n, e) => O`${n} = ${ct(e, n)}`, Ys = (n, e) => O`${n} <> ${ct(e, n)}`;
|
|
546
546
|
function g(...n) {
|
|
@@ -565,7 +565,7 @@ function $e(...n) {
|
|
|
565
565
|
new we(")")
|
|
566
566
|
]);
|
|
567
567
|
}
|
|
568
|
-
const pn = (n, e) => O`${n} > ${ct(e, n)}`,
|
|
568
|
+
const pn = (n, e) => O`${n} > ${ct(e, n)}`, Tt = (n, e) => O`${n} >= ${ct(e, n)}`, Qe = (n, e) => O`${n} < ${ct(e, n)}`, yt = (n, e) => O`${n} <= ${ct(e, n)}`;
|
|
569
569
|
function De(n, e) {
|
|
570
570
|
return Array.isArray(e) ? e.length === 0 ? O`false` : O`${n} in ${e.map((t) => ct(t, n))}` : O`${n} in ${ct(e, n)}`;
|
|
571
571
|
}
|
|
@@ -741,8 +741,8 @@ class za extends (vo = Ve, yo = L, vo) {
|
|
|
741
741
|
}
|
|
742
742
|
}
|
|
743
743
|
v(za, yo, "SQLiteBigInt");
|
|
744
|
-
var wo,
|
|
745
|
-
class Fa extends (
|
|
744
|
+
var wo, So;
|
|
745
|
+
class Fa extends (So = je, wo = L, So) {
|
|
746
746
|
constructor(e) {
|
|
747
747
|
super(e, "json", "SQLiteBlobJson");
|
|
748
748
|
}
|
|
@@ -755,8 +755,8 @@ class Fa extends (No = je, wo = L, No) {
|
|
|
755
755
|
}
|
|
756
756
|
}
|
|
757
757
|
v(Fa, wo, "SQLiteBlobJsonBuilder");
|
|
758
|
-
var
|
|
759
|
-
class Pa extends (bo = Ve,
|
|
758
|
+
var No, bo;
|
|
759
|
+
class Pa extends (bo = Ve, No = L, bo) {
|
|
760
760
|
getSQLType() {
|
|
761
761
|
return "blob";
|
|
762
762
|
}
|
|
@@ -771,7 +771,7 @@ class Pa extends (bo = Ve, So = L, bo) {
|
|
|
771
771
|
return Buffer.from(JSON.stringify(e));
|
|
772
772
|
}
|
|
773
773
|
}
|
|
774
|
-
v(Pa,
|
|
774
|
+
v(Pa, No, "SQLiteBlobJson");
|
|
775
775
|
var Eo, xo;
|
|
776
776
|
class qa extends (xo = je, Eo = L, xo) {
|
|
777
777
|
constructor(e) {
|
|
@@ -1117,8 +1117,8 @@ function lr() {
|
|
|
1117
1117
|
};
|
|
1118
1118
|
}
|
|
1119
1119
|
const Wn = Symbol.for("drizzle:SQLiteInlineForeignKeys");
|
|
1120
|
-
var ya, va, wa,
|
|
1121
|
-
class qt extends (
|
|
1120
|
+
var ya, va, wa, Sa, Na;
|
|
1121
|
+
class qt extends (Na = fe, Sa = L, wa = fe.Symbol.Columns, va = Wn, ya = fe.Symbol.ExtraConfigBuilder, Na) {
|
|
1122
1122
|
constructor() {
|
|
1123
1123
|
super(...arguments);
|
|
1124
1124
|
/** @internal */
|
|
@@ -1129,7 +1129,7 @@ class qt extends (Sa = fe, Na = L, wa = fe.Symbol.Columns, va = Wn, ya = fe.Symb
|
|
|
1129
1129
|
v(this, ya);
|
|
1130
1130
|
}
|
|
1131
1131
|
}
|
|
1132
|
-
v(qt,
|
|
1132
|
+
v(qt, Sa, "SQLiteTable"), /** @internal */
|
|
1133
1133
|
v(qt, "Symbol", Object.assign({}, fe.Symbol, {
|
|
1134
1134
|
InlineForeignKeys: Wn
|
|
1135
1135
|
}));
|
|
@@ -1426,7 +1426,7 @@ const B = j("tenants", {
|
|
|
1426
1426
|
),
|
|
1427
1427
|
D("idx_refresh_tokens_family_id").on(n.tenant_id, n.family_id)
|
|
1428
1428
|
]
|
|
1429
|
-
),
|
|
1429
|
+
), Y = j(
|
|
1430
1430
|
"login_sessions",
|
|
1431
1431
|
{
|
|
1432
1432
|
id: r("id", { length: 21 }).notNull(),
|
|
@@ -1626,7 +1626,7 @@ const B = j("tenants", {
|
|
|
1626
1626
|
}),
|
|
1627
1627
|
D("idx_clients_owner_user_id").on(n.tenant_id, n.owner_user_id)
|
|
1628
1628
|
]
|
|
1629
|
-
),
|
|
1629
|
+
), X = j(
|
|
1630
1630
|
"client_registration_tokens",
|
|
1631
1631
|
{
|
|
1632
1632
|
id: r("id", { length: 255 }).primaryKey(),
|
|
@@ -1729,7 +1729,7 @@ const B = j("tenants", {
|
|
|
1729
1729
|
dkim_public_key: r("dkim_public_key", { length: 2048 }),
|
|
1730
1730
|
created_at: r("created_at", { length: 35 }).notNull(),
|
|
1731
1731
|
updated_at: r("updated_at", { length: 35 }).notNull()
|
|
1732
|
-
}),
|
|
1732
|
+
}), ee = j(
|
|
1733
1733
|
"organizations",
|
|
1734
1734
|
{
|
|
1735
1735
|
id: r("id", { length: 21 }).primaryKey(),
|
|
@@ -1887,7 +1887,7 @@ const B = j("tenants", {
|
|
|
1887
1887
|
D("user_roles_role_fk").on(n.tenant_id, n.role_id),
|
|
1888
1888
|
D("user_roles_organization_fk").on(n.organization_id)
|
|
1889
1889
|
]
|
|
1890
|
-
),
|
|
1890
|
+
), te = j(
|
|
1891
1891
|
"resource_servers",
|
|
1892
1892
|
{
|
|
1893
1893
|
id: r("id", { length: 21 }).notNull(),
|
|
@@ -1916,7 +1916,7 @@ const B = j("tenants", {
|
|
|
1916
1916
|
name: "resource_servers_pk"
|
|
1917
1917
|
})
|
|
1918
1918
|
]
|
|
1919
|
-
),
|
|
1919
|
+
), Rt = j("branding", {
|
|
1920
1920
|
tenant_id: r("tenant_id", { length: 191 }).primaryKey().references(() => B.id, { onDelete: "cascade" }),
|
|
1921
1921
|
logo_url: r("logo_url", { length: 512 }),
|
|
1922
1922
|
favicon_url: r("favicon_url", { length: 512 }),
|
|
@@ -2097,7 +2097,7 @@ const B = j("tenants", {
|
|
|
2097
2097
|
updated_at: r("updated_at", { length: 35 }).notNull()
|
|
2098
2098
|
},
|
|
2099
2099
|
(n) => [D("flows_tenant_id_idx").on(n.tenant_id)]
|
|
2100
|
-
),
|
|
2100
|
+
), Ut = j("prompt_settings", {
|
|
2101
2101
|
tenant_id: r("tenant_id", { length: 191 }).primaryKey(),
|
|
2102
2102
|
universal_login_experience: r("universal_login_experience", { length: 16 }).notNull().default("new"),
|
|
2103
2103
|
identifier_first: w("identifier_first", { mode: "boolean" }).notNull().default(!0),
|
|
@@ -2185,7 +2185,7 @@ const B = j("tenants", {
|
|
|
2185
2185
|
() => pe.id,
|
|
2186
2186
|
{ onDelete: "cascade" }
|
|
2187
2187
|
)
|
|
2188
|
-
}),
|
|
2188
|
+
}), Ne = j(
|
|
2189
2189
|
"custom_text",
|
|
2190
2190
|
{
|
|
2191
2191
|
tenant_id: r("tenant_id", { length: 191 }).notNull().references(() => B.id, { onDelete: "cascade" }),
|
|
@@ -2305,14 +2305,14 @@ const B = j("tenants", {
|
|
|
2305
2305
|
__proto__: null,
|
|
2306
2306
|
authenticationCodes: cr,
|
|
2307
2307
|
authenticationMethods: ue,
|
|
2308
|
-
branding:
|
|
2308
|
+
branding: Rt,
|
|
2309
2309
|
clientGrants: ye,
|
|
2310
|
-
clientRegistrationTokens:
|
|
2310
|
+
clientRegistrationTokens: X,
|
|
2311
2311
|
clients: H,
|
|
2312
2312
|
codes: re,
|
|
2313
2313
|
connections: pe,
|
|
2314
2314
|
customDomains: Ie,
|
|
2315
|
-
customText:
|
|
2315
|
+
customText: Ne,
|
|
2316
2316
|
domains: pr,
|
|
2317
2317
|
emailProviders: dt,
|
|
2318
2318
|
emailTemplates: Ue,
|
|
@@ -2322,15 +2322,15 @@ const B = j("tenants", {
|
|
|
2322
2322
|
hooks: me,
|
|
2323
2323
|
invites: xe,
|
|
2324
2324
|
keys: Je,
|
|
2325
|
-
loginSessions:
|
|
2325
|
+
loginSessions: Y,
|
|
2326
2326
|
logs: z,
|
|
2327
|
-
organizations:
|
|
2327
|
+
organizations: ee,
|
|
2328
2328
|
otps: _r,
|
|
2329
2329
|
outboxEvents: q,
|
|
2330
2330
|
passwords: oe,
|
|
2331
|
-
promptSettings:
|
|
2331
|
+
promptSettings: Ut,
|
|
2332
2332
|
refreshTokens: J,
|
|
2333
|
-
resourceServers:
|
|
2333
|
+
resourceServers: te,
|
|
2334
2334
|
rolePermissions: Re,
|
|
2335
2335
|
roles: _e,
|
|
2336
2336
|
sessions: ae,
|
|
@@ -2420,7 +2420,7 @@ function mr(n) {
|
|
|
2420
2420
|
function yr(n) {
|
|
2421
2421
|
return {
|
|
2422
2422
|
async get(e) {
|
|
2423
|
-
const t = await n.select().from(
|
|
2423
|
+
const t = await n.select().from(Rt).where(c(Rt.tenant_id, e)).get();
|
|
2424
2424
|
if (!t) return null;
|
|
2425
2425
|
const {
|
|
2426
2426
|
tenant_id: i,
|
|
@@ -2459,8 +2459,8 @@ function yr(n) {
|
|
|
2459
2459
|
font_url: o == null ? void 0 : o.url,
|
|
2460
2460
|
dark_mode: s
|
|
2461
2461
|
};
|
|
2462
|
-
await n.insert(
|
|
2463
|
-
target:
|
|
2462
|
+
await n.insert(Rt).values({ tenant_id: e, ...f }).onConflictDoUpdate({
|
|
2463
|
+
target: Rt.tenant_id,
|
|
2464
2464
|
set: f
|
|
2465
2465
|
});
|
|
2466
2466
|
}
|
|
@@ -2492,7 +2492,7 @@ var _t = class extends Error {
|
|
|
2492
2492
|
});
|
|
2493
2493
|
}
|
|
2494
2494
|
};
|
|
2495
|
-
function
|
|
2495
|
+
function We(n, e, t) {
|
|
2496
2496
|
const i = e.split(/ OR /i);
|
|
2497
2497
|
if (i.length > 1) {
|
|
2498
2498
|
const f = i.map((p) => {
|
|
@@ -2500,8 +2500,8 @@ function Ge(n, e, t) {
|
|
|
2500
2500
|
if (m) {
|
|
2501
2501
|
const [, y, E] = m;
|
|
2502
2502
|
if (!y || !E) return null;
|
|
2503
|
-
const
|
|
2504
|
-
return G ? c(G,
|
|
2503
|
+
const T = E.replace(/^"(.*)"$/, "$1"), G = n[y.trim()];
|
|
2504
|
+
return G ? c(G, T.trim()) : null;
|
|
2505
2505
|
}
|
|
2506
2506
|
return null;
|
|
2507
2507
|
}).filter(Boolean);
|
|
@@ -2515,22 +2515,22 @@ function Ge(n, e, t) {
|
|
|
2515
2515
|
}
|
|
2516
2516
|
s.trim() && o.push(s.trim());
|
|
2517
2517
|
const d = o.filter((f) => f !== "AND").map((f) => f.replace(/^([^:]+)=/g, "$1:")).map((f) => {
|
|
2518
|
-
let p = f.startsWith("-"), m = null, y = "", E = !1,
|
|
2518
|
+
let p = f.startsWith("-"), m = null, y = "", E = !1, T;
|
|
2519
2519
|
if (f.startsWith("-_exists_:"))
|
|
2520
2520
|
m = f.substring(10), E = !0, p = !0;
|
|
2521
2521
|
else if (f.startsWith("_exists_:"))
|
|
2522
2522
|
m = f.substring(9), E = !0, p = !1;
|
|
2523
2523
|
else if (f.includes(":")) {
|
|
2524
|
-
const G = p ? f.substring(1) : f,
|
|
2525
|
-
m = G.substring(0,
|
|
2524
|
+
const G = p ? f.substring(1) : f, W = G.indexOf(":");
|
|
2525
|
+
m = G.substring(0, W), y = G.substring(W + 1), E = !1, y.startsWith(">=") ? (T = ">=", y = y.substring(2)) : y.startsWith(">") ? (T = ">", y = y.substring(1)) : y.startsWith("<=") ? (T = "<=", y = y.substring(2)) : y.startsWith("<") ? (T = "<", y = y.substring(1)) : T = "=", y.startsWith('"') && y.endsWith('"') && y.length > 1 && (y = y.slice(1, -1));
|
|
2526
2526
|
} else
|
|
2527
2527
|
m = null, y = f, E = !1;
|
|
2528
|
-
return { key: m, value: y, isNegation: p, isExistsQuery: E, operator:
|
|
2528
|
+
return { key: m, value: y, isNegation: p, isExistsQuery: E, operator: T };
|
|
2529
2529
|
}), u = [];
|
|
2530
2530
|
for (const { key: f, value: p, isNegation: m, isExistsQuery: y, operator: E } of d)
|
|
2531
2531
|
if (f) {
|
|
2532
|
-
const
|
|
2533
|
-
if (!
|
|
2532
|
+
const T = n[f];
|
|
2533
|
+
if (!T) {
|
|
2534
2534
|
y ? u.push(
|
|
2535
2535
|
m ? O`${O.identifier(f)} IS NULL` : O`${O.identifier(f)} IS NOT NULL`
|
|
2536
2536
|
) : u.push(
|
|
@@ -2539,45 +2539,45 @@ function Ge(n, e, t) {
|
|
|
2539
2539
|
continue;
|
|
2540
2540
|
}
|
|
2541
2541
|
if (y)
|
|
2542
|
-
u.push(m ? Ce(
|
|
2542
|
+
u.push(m ? Ce(T) : cn(T));
|
|
2543
2543
|
else if (m)
|
|
2544
2544
|
switch (E) {
|
|
2545
2545
|
case ">":
|
|
2546
|
-
u.push(yt(
|
|
2546
|
+
u.push(yt(T, p));
|
|
2547
2547
|
break;
|
|
2548
2548
|
case ">=":
|
|
2549
|
-
u.push(
|
|
2549
|
+
u.push(Qe(T, p));
|
|
2550
2550
|
break;
|
|
2551
2551
|
case "<":
|
|
2552
|
-
u.push(
|
|
2552
|
+
u.push(Tt(T, p));
|
|
2553
2553
|
break;
|
|
2554
2554
|
case "<=":
|
|
2555
|
-
u.push(pn(
|
|
2555
|
+
u.push(pn(T, p));
|
|
2556
2556
|
break;
|
|
2557
2557
|
default:
|
|
2558
|
-
u.push(Ys(
|
|
2558
|
+
u.push(Ys(T, p));
|
|
2559
2559
|
}
|
|
2560
2560
|
else
|
|
2561
2561
|
switch (E) {
|
|
2562
2562
|
case ">":
|
|
2563
|
-
u.push(pn(
|
|
2563
|
+
u.push(pn(T, p));
|
|
2564
2564
|
break;
|
|
2565
2565
|
case ">=":
|
|
2566
|
-
u.push(
|
|
2566
|
+
u.push(Tt(T, p));
|
|
2567
2567
|
break;
|
|
2568
2568
|
case "<":
|
|
2569
|
-
u.push(
|
|
2569
|
+
u.push(Qe(T, p));
|
|
2570
2570
|
break;
|
|
2571
2571
|
case "<=":
|
|
2572
|
-
u.push(yt(
|
|
2572
|
+
u.push(yt(T, p));
|
|
2573
2573
|
break;
|
|
2574
2574
|
default:
|
|
2575
|
-
u.push(c(
|
|
2575
|
+
u.push(c(T, p));
|
|
2576
2576
|
}
|
|
2577
2577
|
} else if (p) {
|
|
2578
|
-
const G = (p.includes("|") ? [...t, "user_id"] : t).map((
|
|
2579
|
-
const ie = n[
|
|
2580
|
-
return ie ?
|
|
2578
|
+
const G = (p.includes("|") ? [...t, "user_id"] : t).map((W) => {
|
|
2579
|
+
const ie = n[W];
|
|
2580
|
+
return ie ? W === "user_id" ? c(ie, p) : xt(ie, `%${p}%`) : null;
|
|
2581
2581
|
}).filter(Boolean);
|
|
2582
2582
|
G.length > 0 && u.push($e(...G));
|
|
2583
2583
|
}
|
|
@@ -2725,7 +2725,7 @@ function vr(n) {
|
|
|
2725
2725
|
} = t || {};
|
|
2726
2726
|
let u = n.select().from(H).where(c(H.tenant_id, e)).$dynamic();
|
|
2727
2727
|
if (d) {
|
|
2728
|
-
const y =
|
|
2728
|
+
const y = We(H, d, ["name", "client_id"]);
|
|
2729
2729
|
y && (u = u.where(g(c(H.tenant_id, e), y)));
|
|
2730
2730
|
}
|
|
2731
2731
|
if (l != null && l.sort_by) {
|
|
@@ -2764,7 +2764,7 @@ function wr(n) {
|
|
|
2764
2764
|
is_system: t ? !0 : void 0
|
|
2765
2765
|
});
|
|
2766
2766
|
}
|
|
2767
|
-
function
|
|
2767
|
+
function Sr(n) {
|
|
2768
2768
|
return {
|
|
2769
2769
|
async listByClient(e, t) {
|
|
2770
2770
|
const i = await n.select({ connections: H.connections }).from(H).where(
|
|
@@ -2832,7 +2832,7 @@ function Nr(n) {
|
|
|
2832
2832
|
}
|
|
2833
2833
|
};
|
|
2834
2834
|
}
|
|
2835
|
-
let
|
|
2835
|
+
let Nr = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", br = (n) => crypto.getRandomValues(new Uint8Array(n)), Er = (n, e, t) => {
|
|
2836
2836
|
let i = 256 - 256 % n.length;
|
|
2837
2837
|
if (i === 256) {
|
|
2838
2838
|
let s = n.length - 1;
|
|
@@ -2860,7 +2860,7 @@ let Sr = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", br
|
|
|
2860
2860
|
}, xr = (n, e = 21) => Er(n, e | 0, br), Le = (n = 21) => {
|
|
2861
2861
|
let e = "", t = crypto.getRandomValues(new Uint8Array(n |= 0));
|
|
2862
2862
|
for (; n--; )
|
|
2863
|
-
e +=
|
|
2863
|
+
e += Nr[t[n] & 63];
|
|
2864
2864
|
return e;
|
|
2865
2865
|
};
|
|
2866
2866
|
function Ln(n) {
|
|
@@ -2934,12 +2934,12 @@ function kr(n) {
|
|
|
2934
2934
|
include_totals: s = !1,
|
|
2935
2935
|
sort: l,
|
|
2936
2936
|
q: d
|
|
2937
|
-
} = t || {}, u = d ?
|
|
2937
|
+
} = t || {}, u = d ? We(ye, d, ["client_id", "audience"]) : void 0, f = u ? g(c(ye.tenant_id, e), u) : c(ye.tenant_id, e);
|
|
2938
2938
|
let p = n.select().from(ye).where(f).$dynamic();
|
|
2939
2939
|
if (l != null && l.sort_by) {
|
|
2940
|
-
const
|
|
2941
|
-
|
|
2942
|
-
l.sort_order === "desc" ? se(
|
|
2940
|
+
const T = ye[l.sort_by];
|
|
2941
|
+
T && (p = p.orderBy(
|
|
2942
|
+
l.sort_order === "desc" ? se(T) : he(T)
|
|
2943
2943
|
));
|
|
2944
2944
|
} else
|
|
2945
2945
|
p = p.orderBy(he(ye.created_at));
|
|
@@ -2973,7 +2973,7 @@ function Tr(n, e) {
|
|
|
2973
2973
|
var t;
|
|
2974
2974
|
return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
|
|
2975
2975
|
}
|
|
2976
|
-
function
|
|
2976
|
+
function Lt(n, e) {
|
|
2977
2977
|
const t = n.ZodType.prototype[e];
|
|
2978
2978
|
n.ZodType.prototype[e] = function(...i) {
|
|
2979
2979
|
const o = t.apply(this, i);
|
|
@@ -2985,14 +2985,14 @@ function Ar(n) {
|
|
|
2985
2985
|
return;
|
|
2986
2986
|
n.ZodType.prototype.openapi = function(o, s) {
|
|
2987
2987
|
var l, d, u, f, p, m;
|
|
2988
|
-
const y = typeof o == "string" ? s : o, E = y ?? {}, { param:
|
|
2989
|
-
param: Object.assign(Object.assign({}, (m = (p = this._def.openapi) === null || p === void 0 ? void 0 : p.metadata) === null || m === void 0 ? void 0 : m.param),
|
|
2990
|
-
} : void 0), qe = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(
|
|
2988
|
+
const y = typeof o == "string" ? s : o, E = y ?? {}, { param: T } = E, G = Or(E, ["param"]), W = Object.assign(Object.assign({}, (l = this._def.openapi) === null || l === void 0 ? void 0 : l._internal), typeof o == "string" ? { refId: o } : void 0), ie = Object.assign(Object.assign(Object.assign({}, (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata), G), !((f = (u = this._def.openapi) === null || u === void 0 ? void 0 : u.metadata) === null || f === void 0) && f.param || T ? {
|
|
2989
|
+
param: Object.assign(Object.assign({}, (m = (p = this._def.openapi) === null || p === void 0 ? void 0 : p.metadata) === null || m === void 0 ? void 0 : m.param), T)
|
|
2990
|
+
} : void 0), qe = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(W).length > 0 ? { _internal: W } : void 0), Object.keys(ie).length > 0 ? { metadata: ie } : void 0) }));
|
|
2991
2991
|
if (Tr(this, "ZodObject")) {
|
|
2992
|
-
const
|
|
2992
|
+
const Se = this.extend;
|
|
2993
2993
|
qe.extend = function(...Ee) {
|
|
2994
2994
|
var it, rt, En, xn, kn, On, Tn;
|
|
2995
|
-
const An =
|
|
2995
|
+
const An = Se.apply(this, Ee);
|
|
2996
2996
|
return An._def.openapi = {
|
|
2997
2997
|
_internal: {
|
|
2998
2998
|
extendedFrom: !((rt = (it = this._def.openapi) === null || it === void 0 ? void 0 : it._internal) === null || rt === void 0) && rt.refId ? { refId: (xn = (En = this._def.openapi) === null || En === void 0 ? void 0 : En._internal) === null || xn === void 0 ? void 0 : xn.refId, schema: this } : (On = (kn = this._def.openapi) === null || kn === void 0 ? void 0 : kn._internal) === null || On === void 0 ? void 0 : On.extendedFrom
|
|
@@ -3002,7 +3002,7 @@ function Ar(n) {
|
|
|
3002
3002
|
};
|
|
3003
3003
|
}
|
|
3004
3004
|
return qe;
|
|
3005
|
-
},
|
|
3005
|
+
}, Lt(n, "optional"), Lt(n, "nullable"), Lt(n, "default"), Lt(n, "transform"), Lt(n, "refine");
|
|
3006
3006
|
const e = n.ZodObject.prototype.deepPartial;
|
|
3007
3007
|
n.ZodObject.prototype.deepPartial = function() {
|
|
3008
3008
|
const o = this._def.shape(), s = e.apply(this), l = s._def.shape();
|
|
@@ -3068,7 +3068,7 @@ var ei;
|
|
|
3068
3068
|
// second overwrites first
|
|
3069
3069
|
});
|
|
3070
3070
|
})(ei || (ei = {}));
|
|
3071
|
-
const
|
|
3071
|
+
const A = K.arrayToEnum([
|
|
3072
3072
|
"string",
|
|
3073
3073
|
"nan",
|
|
3074
3074
|
"number",
|
|
@@ -3092,25 +3092,25 @@ const T = K.arrayToEnum([
|
|
|
3092
3092
|
]), at = (n) => {
|
|
3093
3093
|
switch (typeof n) {
|
|
3094
3094
|
case "undefined":
|
|
3095
|
-
return
|
|
3095
|
+
return A.undefined;
|
|
3096
3096
|
case "string":
|
|
3097
|
-
return
|
|
3097
|
+
return A.string;
|
|
3098
3098
|
case "number":
|
|
3099
|
-
return Number.isNaN(n) ?
|
|
3099
|
+
return Number.isNaN(n) ? A.nan : A.number;
|
|
3100
3100
|
case "boolean":
|
|
3101
|
-
return
|
|
3101
|
+
return A.boolean;
|
|
3102
3102
|
case "function":
|
|
3103
|
-
return
|
|
3103
|
+
return A.function;
|
|
3104
3104
|
case "bigint":
|
|
3105
|
-
return
|
|
3105
|
+
return A.bigint;
|
|
3106
3106
|
case "symbol":
|
|
3107
|
-
return
|
|
3107
|
+
return A.symbol;
|
|
3108
3108
|
case "object":
|
|
3109
|
-
return Array.isArray(n) ?
|
|
3109
|
+
return Array.isArray(n) ? A.array : n === null ? A.null : n.then && typeof n.then == "function" && n.catch && typeof n.catch == "function" ? A.promise : typeof Map < "u" && n instanceof Map ? A.map : typeof Set < "u" && n instanceof Set ? A.set : typeof Date < "u" && n instanceof Date ? A.date : A.object;
|
|
3110
3110
|
default:
|
|
3111
|
-
return
|
|
3111
|
+
return A.unknown;
|
|
3112
3112
|
}
|
|
3113
|
-
},
|
|
3113
|
+
}, S = K.arrayToEnum([
|
|
3114
3114
|
"invalid_type",
|
|
3115
3115
|
"invalid_literal",
|
|
3116
3116
|
"custom",
|
|
@@ -3195,52 +3195,52 @@ et.create = (n) => new et(n);
|
|
|
3195
3195
|
const fn = (n, e) => {
|
|
3196
3196
|
let t;
|
|
3197
3197
|
switch (n.code) {
|
|
3198
|
-
case
|
|
3199
|
-
n.received ===
|
|
3198
|
+
case S.invalid_type:
|
|
3199
|
+
n.received === A.undefined ? t = "Required" : t = `Expected ${n.expected}, received ${n.received}`;
|
|
3200
3200
|
break;
|
|
3201
|
-
case
|
|
3201
|
+
case S.invalid_literal:
|
|
3202
3202
|
t = `Invalid literal value, expected ${JSON.stringify(n.expected, K.jsonStringifyReplacer)}`;
|
|
3203
3203
|
break;
|
|
3204
|
-
case
|
|
3204
|
+
case S.unrecognized_keys:
|
|
3205
3205
|
t = `Unrecognized key(s) in object: ${K.joinValues(n.keys, ", ")}`;
|
|
3206
3206
|
break;
|
|
3207
|
-
case
|
|
3207
|
+
case S.invalid_union:
|
|
3208
3208
|
t = "Invalid input";
|
|
3209
3209
|
break;
|
|
3210
|
-
case
|
|
3210
|
+
case S.invalid_union_discriminator:
|
|
3211
3211
|
t = `Invalid discriminator value. Expected ${K.joinValues(n.options)}`;
|
|
3212
3212
|
break;
|
|
3213
|
-
case
|
|
3213
|
+
case S.invalid_enum_value:
|
|
3214
3214
|
t = `Invalid enum value. Expected ${K.joinValues(n.options)}, received '${n.received}'`;
|
|
3215
3215
|
break;
|
|
3216
|
-
case
|
|
3216
|
+
case S.invalid_arguments:
|
|
3217
3217
|
t = "Invalid function arguments";
|
|
3218
3218
|
break;
|
|
3219
|
-
case
|
|
3219
|
+
case S.invalid_return_type:
|
|
3220
3220
|
t = "Invalid function return type";
|
|
3221
3221
|
break;
|
|
3222
|
-
case
|
|
3222
|
+
case S.invalid_date:
|
|
3223
3223
|
t = "Invalid date";
|
|
3224
3224
|
break;
|
|
3225
|
-
case
|
|
3225
|
+
case S.invalid_string:
|
|
3226
3226
|
typeof n.validation == "object" ? "includes" in n.validation ? (t = `Invalid input: must include "${n.validation.includes}"`, typeof n.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${n.validation.position}`)) : "startsWith" in n.validation ? t = `Invalid input: must start with "${n.validation.startsWith}"` : "endsWith" in n.validation ? t = `Invalid input: must end with "${n.validation.endsWith}"` : K.assertNever(n.validation) : n.validation !== "regex" ? t = `Invalid ${n.validation}` : t = "Invalid";
|
|
3227
3227
|
break;
|
|
3228
|
-
case
|
|
3228
|
+
case S.too_small:
|
|
3229
3229
|
n.type === "array" ? t = `Array must contain ${n.exact ? "exactly" : n.inclusive ? "at least" : "more than"} ${n.minimum} element(s)` : n.type === "string" ? t = `String must contain ${n.exact ? "exactly" : n.inclusive ? "at least" : "over"} ${n.minimum} character(s)` : n.type === "number" ? t = `Number must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${n.minimum}` : n.type === "bigint" ? t = `Number must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${n.minimum}` : n.type === "date" ? t = `Date must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(n.minimum))}` : t = "Invalid input";
|
|
3230
3230
|
break;
|
|
3231
|
-
case
|
|
3231
|
+
case S.too_big:
|
|
3232
3232
|
n.type === "array" ? t = `Array must contain ${n.exact ? "exactly" : n.inclusive ? "at most" : "less than"} ${n.maximum} element(s)` : n.type === "string" ? t = `String must contain ${n.exact ? "exactly" : n.inclusive ? "at most" : "under"} ${n.maximum} character(s)` : n.type === "number" ? t = `Number must be ${n.exact ? "exactly" : n.inclusive ? "less than or equal to" : "less than"} ${n.maximum}` : n.type === "bigint" ? t = `BigInt must be ${n.exact ? "exactly" : n.inclusive ? "less than or equal to" : "less than"} ${n.maximum}` : n.type === "date" ? t = `Date must be ${n.exact ? "exactly" : n.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(n.maximum))}` : t = "Invalid input";
|
|
3233
3233
|
break;
|
|
3234
|
-
case
|
|
3234
|
+
case S.custom:
|
|
3235
3235
|
t = "Invalid input";
|
|
3236
3236
|
break;
|
|
3237
|
-
case
|
|
3237
|
+
case S.invalid_intersection_types:
|
|
3238
3238
|
t = "Intersection results could not be merged";
|
|
3239
3239
|
break;
|
|
3240
|
-
case
|
|
3240
|
+
case S.not_multiple_of:
|
|
3241
3241
|
t = `Number must be a multiple of ${n.multipleOf}`;
|
|
3242
3242
|
break;
|
|
3243
|
-
case
|
|
3243
|
+
case S.not_finite:
|
|
3244
3244
|
t = "Number must be finite";
|
|
3245
3245
|
break;
|
|
3246
3246
|
default:
|
|
@@ -3334,7 +3334,7 @@ class Te {
|
|
|
3334
3334
|
}
|
|
3335
3335
|
const R = Object.freeze({
|
|
3336
3336
|
status: "aborted"
|
|
3337
|
-
}), kt = (n) => ({ status: "dirty", value: n }), Fe = (n) => ({ status: "valid", value: n }), ti = (n) => n.status === "aborted", ni = (n) => n.status === "dirty",
|
|
3337
|
+
}), kt = (n) => ({ status: "dirty", value: n }), Fe = (n) => ({ status: "valid", value: n }), ti = (n) => n.status === "aborted", ni = (n) => n.status === "dirty", St = (n) => n.status === "valid", Mt = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
3338
3338
|
var C;
|
|
3339
3339
|
(function(n) {
|
|
3340
3340
|
n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
@@ -3348,7 +3348,7 @@ class tt {
|
|
|
3348
3348
|
}
|
|
3349
3349
|
}
|
|
3350
3350
|
const Ai = (n, e) => {
|
|
3351
|
-
if (
|
|
3351
|
+
if (St(e))
|
|
3352
3352
|
return { success: !0, data: e.value };
|
|
3353
3353
|
if (!n.common.issues.length)
|
|
3354
3354
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -3450,7 +3450,7 @@ class $ {
|
|
|
3450
3450
|
if (!this["~standard"].async)
|
|
3451
3451
|
try {
|
|
3452
3452
|
const s = this._parseSync({ data: e, path: [], parent: t });
|
|
3453
|
-
return
|
|
3453
|
+
return St(s) ? {
|
|
3454
3454
|
value: s.value
|
|
3455
3455
|
} : {
|
|
3456
3456
|
issues: t.common.issues
|
|
@@ -3461,7 +3461,7 @@ class $ {
|
|
|
3461
3461
|
async: !0
|
|
3462
3462
|
};
|
|
3463
3463
|
}
|
|
3464
|
-
return this._parseAsync({ data: e, path: [], parent: t }).then((s) =>
|
|
3464
|
+
return this._parseAsync({ data: e, path: [], parent: t }).then((s) => St(s) ? {
|
|
3465
3465
|
value: s.value
|
|
3466
3466
|
} : {
|
|
3467
3467
|
issues: t.common.issues
|
|
@@ -3492,7 +3492,7 @@ class $ {
|
|
|
3492
3492
|
const i = (o) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(o) : t;
|
|
3493
3493
|
return this._refinement((o, s) => {
|
|
3494
3494
|
const l = e(o), d = () => s.addIssue({
|
|
3495
|
-
code:
|
|
3495
|
+
code: S.custom,
|
|
3496
3496
|
...i(o)
|
|
3497
3497
|
});
|
|
3498
3498
|
return typeof Promise < "u" && l instanceof Promise ? l.then((u) => u ? !0 : (d(), !1)) : l ? !0 : (d(), !1);
|
|
@@ -3528,7 +3528,7 @@ class $ {
|
|
|
3528
3528
|
return this.nullable().optional();
|
|
3529
3529
|
}
|
|
3530
3530
|
array() {
|
|
3531
|
-
return
|
|
3531
|
+
return Ge.create(this);
|
|
3532
3532
|
}
|
|
3533
3533
|
promise() {
|
|
3534
3534
|
return Qt.create(this, this._def);
|
|
@@ -3557,7 +3557,7 @@ class $ {
|
|
|
3557
3557
|
});
|
|
3558
3558
|
}
|
|
3559
3559
|
brand() {
|
|
3560
|
-
return new
|
|
3560
|
+
return new Si({
|
|
3561
3561
|
typeName: U.ZodBranded,
|
|
3562
3562
|
type: this,
|
|
3563
3563
|
...M(this._def)
|
|
@@ -3580,7 +3580,7 @@ class $ {
|
|
|
3580
3580
|
});
|
|
3581
3581
|
}
|
|
3582
3582
|
pipe(e) {
|
|
3583
|
-
return
|
|
3583
|
+
return Nn.create(this, e);
|
|
3584
3584
|
}
|
|
3585
3585
|
readonly() {
|
|
3586
3586
|
return Xt.create(this);
|
|
@@ -3630,11 +3630,11 @@ function Gr(n, e) {
|
|
|
3630
3630
|
}
|
|
3631
3631
|
class Xe extends $ {
|
|
3632
3632
|
_parse(e) {
|
|
3633
|
-
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !==
|
|
3633
|
+
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== A.string) {
|
|
3634
3634
|
const s = this._getOrReturnCtx(e);
|
|
3635
3635
|
return k(s, {
|
|
3636
|
-
code:
|
|
3637
|
-
expected:
|
|
3636
|
+
code: S.invalid_type,
|
|
3637
|
+
expected: A.string,
|
|
3638
3638
|
received: s.parsedType
|
|
3639
3639
|
}), R;
|
|
3640
3640
|
}
|
|
@@ -3643,7 +3643,7 @@ class Xe extends $ {
|
|
|
3643
3643
|
for (const s of this._def.checks)
|
|
3644
3644
|
if (s.kind === "min")
|
|
3645
3645
|
e.data.length < s.value && (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3646
|
-
code:
|
|
3646
|
+
code: S.too_small,
|
|
3647
3647
|
minimum: s.value,
|
|
3648
3648
|
type: "string",
|
|
3649
3649
|
inclusive: !0,
|
|
@@ -3652,7 +3652,7 @@ class Xe extends $ {
|
|
|
3652
3652
|
}), i.dirty());
|
|
3653
3653
|
else if (s.kind === "max")
|
|
3654
3654
|
e.data.length > s.value && (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3655
|
-
code:
|
|
3655
|
+
code: S.too_big,
|
|
3656
3656
|
maximum: s.value,
|
|
3657
3657
|
type: "string",
|
|
3658
3658
|
inclusive: !0,
|
|
@@ -3662,14 +3662,14 @@ class Xe extends $ {
|
|
|
3662
3662
|
else if (s.kind === "length") {
|
|
3663
3663
|
const l = e.data.length > s.value, d = e.data.length < s.value;
|
|
3664
3664
|
(l || d) && (o = this._getOrReturnCtx(e, o), l ? k(o, {
|
|
3665
|
-
code:
|
|
3665
|
+
code: S.too_big,
|
|
3666
3666
|
maximum: s.value,
|
|
3667
3667
|
type: "string",
|
|
3668
3668
|
inclusive: !0,
|
|
3669
3669
|
exact: !0,
|
|
3670
3670
|
message: s.message
|
|
3671
3671
|
}) : d && k(o, {
|
|
3672
|
-
code:
|
|
3672
|
+
code: S.too_small,
|
|
3673
3673
|
minimum: s.value,
|
|
3674
3674
|
type: "string",
|
|
3675
3675
|
inclusive: !0,
|
|
@@ -3679,43 +3679,43 @@ class Xe extends $ {
|
|
|
3679
3679
|
} else if (s.kind === "email")
|
|
3680
3680
|
Pr.test(e.data) || (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3681
3681
|
validation: "email",
|
|
3682
|
-
code:
|
|
3682
|
+
code: S.invalid_string,
|
|
3683
3683
|
message: s.message
|
|
3684
3684
|
}), i.dirty());
|
|
3685
3685
|
else if (s.kind === "emoji")
|
|
3686
3686
|
Rn || (Rn = new RegExp(qr, "u")), Rn.test(e.data) || (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3687
3687
|
validation: "emoji",
|
|
3688
|
-
code:
|
|
3688
|
+
code: S.invalid_string,
|
|
3689
3689
|
message: s.message
|
|
3690
3690
|
}), i.dirty());
|
|
3691
3691
|
else if (s.kind === "uuid")
|
|
3692
3692
|
Rr.test(e.data) || (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3693
3693
|
validation: "uuid",
|
|
3694
|
-
code:
|
|
3694
|
+
code: S.invalid_string,
|
|
3695
3695
|
message: s.message
|
|
3696
3696
|
}), i.dirty());
|
|
3697
3697
|
else if (s.kind === "nanoid")
|
|
3698
3698
|
Ur.test(e.data) || (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3699
3699
|
validation: "nanoid",
|
|
3700
|
-
code:
|
|
3700
|
+
code: S.invalid_string,
|
|
3701
3701
|
message: s.message
|
|
3702
3702
|
}), i.dirty());
|
|
3703
3703
|
else if (s.kind === "cuid")
|
|
3704
3704
|
Cr.test(e.data) || (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3705
3705
|
validation: "cuid",
|
|
3706
|
-
code:
|
|
3706
|
+
code: S.invalid_string,
|
|
3707
3707
|
message: s.message
|
|
3708
3708
|
}), i.dirty());
|
|
3709
3709
|
else if (s.kind === "cuid2")
|
|
3710
3710
|
Dr.test(e.data) || (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3711
3711
|
validation: "cuid2",
|
|
3712
|
-
code:
|
|
3712
|
+
code: S.invalid_string,
|
|
3713
3713
|
message: s.message
|
|
3714
3714
|
}), i.dirty());
|
|
3715
3715
|
else if (s.kind === "ulid")
|
|
3716
3716
|
Lr.test(e.data) || (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3717
3717
|
validation: "ulid",
|
|
3718
|
-
code:
|
|
3718
|
+
code: S.invalid_string,
|
|
3719
3719
|
message: s.message
|
|
3720
3720
|
}), i.dirty());
|
|
3721
3721
|
else if (s.kind === "url")
|
|
@@ -3724,61 +3724,61 @@ class Xe extends $ {
|
|
|
3724
3724
|
} catch {
|
|
3725
3725
|
o = this._getOrReturnCtx(e, o), k(o, {
|
|
3726
3726
|
validation: "url",
|
|
3727
|
-
code:
|
|
3727
|
+
code: S.invalid_string,
|
|
3728
3728
|
message: s.message
|
|
3729
3729
|
}), i.dirty();
|
|
3730
3730
|
}
|
|
3731
3731
|
else s.kind === "regex" ? (s.regex.lastIndex = 0, s.regex.test(e.data) || (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3732
3732
|
validation: "regex",
|
|
3733
|
-
code:
|
|
3733
|
+
code: S.invalid_string,
|
|
3734
3734
|
message: s.message
|
|
3735
3735
|
}), i.dirty())) : s.kind === "trim" ? e.data = e.data.trim() : s.kind === "includes" ? e.data.includes(s.value, s.position) || (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3736
|
-
code:
|
|
3736
|
+
code: S.invalid_string,
|
|
3737
3737
|
validation: { includes: s.value, position: s.position },
|
|
3738
3738
|
message: s.message
|
|
3739
3739
|
}), i.dirty()) : s.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : s.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : s.kind === "startsWith" ? e.data.startsWith(s.value) || (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3740
|
-
code:
|
|
3740
|
+
code: S.invalid_string,
|
|
3741
3741
|
validation: { startsWith: s.value },
|
|
3742
3742
|
message: s.message
|
|
3743
3743
|
}), i.dirty()) : s.kind === "endsWith" ? e.data.endsWith(s.value) || (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3744
|
-
code:
|
|
3744
|
+
code: S.invalid_string,
|
|
3745
3745
|
validation: { endsWith: s.value },
|
|
3746
3746
|
message: s.message
|
|
3747
3747
|
}), i.dirty()) : s.kind === "datetime" ? gs(s).test(e.data) || (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3748
|
-
code:
|
|
3748
|
+
code: S.invalid_string,
|
|
3749
3749
|
validation: "datetime",
|
|
3750
3750
|
message: s.message
|
|
3751
3751
|
}), i.dirty()) : s.kind === "date" ? Hr.test(e.data) || (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3752
|
-
code:
|
|
3752
|
+
code: S.invalid_string,
|
|
3753
3753
|
validation: "date",
|
|
3754
3754
|
message: s.message
|
|
3755
3755
|
}), i.dirty()) : s.kind === "time" ? Kr(s).test(e.data) || (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3756
|
-
code:
|
|
3756
|
+
code: S.invalid_string,
|
|
3757
3757
|
validation: "time",
|
|
3758
3758
|
message: s.message
|
|
3759
3759
|
}), i.dirty()) : s.kind === "duration" ? Fr.test(e.data) || (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3760
3760
|
validation: "duration",
|
|
3761
|
-
code:
|
|
3761
|
+
code: S.invalid_string,
|
|
3762
3762
|
message: s.message
|
|
3763
3763
|
}), i.dirty()) : s.kind === "ip" ? Jr(e.data, s.version) || (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3764
3764
|
validation: "ip",
|
|
3765
|
-
code:
|
|
3765
|
+
code: S.invalid_string,
|
|
3766
3766
|
message: s.message
|
|
3767
3767
|
}), i.dirty()) : s.kind === "jwt" ? Qr(e.data, s.alg) || (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3768
3768
|
validation: "jwt",
|
|
3769
|
-
code:
|
|
3769
|
+
code: S.invalid_string,
|
|
3770
3770
|
message: s.message
|
|
3771
3771
|
}), i.dirty()) : s.kind === "cidr" ? Gr(e.data, s.version) || (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3772
3772
|
validation: "cidr",
|
|
3773
|
-
code:
|
|
3773
|
+
code: S.invalid_string,
|
|
3774
3774
|
message: s.message
|
|
3775
3775
|
}), i.dirty()) : s.kind === "base64" ? Vr.test(e.data) || (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3776
3776
|
validation: "base64",
|
|
3777
|
-
code:
|
|
3777
|
+
code: S.invalid_string,
|
|
3778
3778
|
message: s.message
|
|
3779
3779
|
}), i.dirty()) : s.kind === "base64url" ? Zr.test(e.data) || (o = this._getOrReturnCtx(e, o), k(o, {
|
|
3780
3780
|
validation: "base64url",
|
|
3781
|
-
code:
|
|
3781
|
+
code: S.invalid_string,
|
|
3782
3782
|
message: s.message
|
|
3783
3783
|
}), i.dirty()) : K.assertNever(s);
|
|
3784
3784
|
return { status: i.value, value: e.data };
|
|
@@ -3786,7 +3786,7 @@ class Xe extends $ {
|
|
|
3786
3786
|
_regex(e, t, i) {
|
|
3787
3787
|
return this.refinement((o) => e.test(o), {
|
|
3788
3788
|
validation: t,
|
|
3789
|
-
code:
|
|
3789
|
+
code: S.invalid_string,
|
|
3790
3790
|
...C.errToObj(i)
|
|
3791
3791
|
});
|
|
3792
3792
|
}
|
|
@@ -4015,16 +4015,16 @@ function Wr(n, e) {
|
|
|
4015
4015
|
const t = (n.toString().split(".")[1] || "").length, i = (e.toString().split(".")[1] || "").length, o = t > i ? t : i, s = Number.parseInt(n.toFixed(o).replace(".", "")), l = Number.parseInt(e.toFixed(o).replace(".", ""));
|
|
4016
4016
|
return s % l / 10 ** o;
|
|
4017
4017
|
}
|
|
4018
|
-
class
|
|
4018
|
+
class Nt extends $ {
|
|
4019
4019
|
constructor() {
|
|
4020
4020
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
4021
4021
|
}
|
|
4022
4022
|
_parse(e) {
|
|
4023
|
-
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !==
|
|
4023
|
+
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== A.number) {
|
|
4024
4024
|
const s = this._getOrReturnCtx(e);
|
|
4025
4025
|
return k(s, {
|
|
4026
|
-
code:
|
|
4027
|
-
expected:
|
|
4026
|
+
code: S.invalid_type,
|
|
4027
|
+
expected: A.number,
|
|
4028
4028
|
received: s.parsedType
|
|
4029
4029
|
}), R;
|
|
4030
4030
|
}
|
|
@@ -4032,30 +4032,30 @@ class St extends $ {
|
|
|
4032
4032
|
const o = new Te();
|
|
4033
4033
|
for (const s of this._def.checks)
|
|
4034
4034
|
s.kind === "int" ? K.isInteger(e.data) || (i = this._getOrReturnCtx(e, i), k(i, {
|
|
4035
|
-
code:
|
|
4035
|
+
code: S.invalid_type,
|
|
4036
4036
|
expected: "integer",
|
|
4037
4037
|
received: "float",
|
|
4038
4038
|
message: s.message
|
|
4039
4039
|
}), o.dirty()) : s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (i = this._getOrReturnCtx(e, i), k(i, {
|
|
4040
|
-
code:
|
|
4040
|
+
code: S.too_small,
|
|
4041
4041
|
minimum: s.value,
|
|
4042
4042
|
type: "number",
|
|
4043
4043
|
inclusive: s.inclusive,
|
|
4044
4044
|
exact: !1,
|
|
4045
4045
|
message: s.message
|
|
4046
4046
|
}), o.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (i = this._getOrReturnCtx(e, i), k(i, {
|
|
4047
|
-
code:
|
|
4047
|
+
code: S.too_big,
|
|
4048
4048
|
maximum: s.value,
|
|
4049
4049
|
type: "number",
|
|
4050
4050
|
inclusive: s.inclusive,
|
|
4051
4051
|
exact: !1,
|
|
4052
4052
|
message: s.message
|
|
4053
4053
|
}), o.dirty()) : s.kind === "multipleOf" ? Wr(e.data, s.value) !== 0 && (i = this._getOrReturnCtx(e, i), k(i, {
|
|
4054
|
-
code:
|
|
4054
|
+
code: S.not_multiple_of,
|
|
4055
4055
|
multipleOf: s.value,
|
|
4056
4056
|
message: s.message
|
|
4057
4057
|
}), o.dirty()) : s.kind === "finite" ? Number.isFinite(e.data) || (i = this._getOrReturnCtx(e, i), k(i, {
|
|
4058
|
-
code:
|
|
4058
|
+
code: S.not_finite,
|
|
4059
4059
|
message: s.message
|
|
4060
4060
|
}), o.dirty()) : K.assertNever(s);
|
|
4061
4061
|
return { status: o.value, value: e.data };
|
|
@@ -4073,7 +4073,7 @@ class St extends $ {
|
|
|
4073
4073
|
return this.setLimit("max", e, !1, C.toString(t));
|
|
4074
4074
|
}
|
|
4075
4075
|
setLimit(e, t, i, o) {
|
|
4076
|
-
return new
|
|
4076
|
+
return new Nt({
|
|
4077
4077
|
...this._def,
|
|
4078
4078
|
checks: [
|
|
4079
4079
|
...this._def.checks,
|
|
@@ -4087,7 +4087,7 @@ class St extends $ {
|
|
|
4087
4087
|
});
|
|
4088
4088
|
}
|
|
4089
4089
|
_addCheck(e) {
|
|
4090
|
-
return new
|
|
4090
|
+
return new Nt({
|
|
4091
4091
|
...this._def,
|
|
4092
4092
|
checks: [...this._def.checks, e]
|
|
4093
4093
|
});
|
|
@@ -4181,13 +4181,13 @@ class St extends $ {
|
|
|
4181
4181
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
4182
4182
|
}
|
|
4183
4183
|
}
|
|
4184
|
-
|
|
4184
|
+
Nt.create = (n) => new Nt({
|
|
4185
4185
|
checks: [],
|
|
4186
4186
|
typeName: U.ZodNumber,
|
|
4187
4187
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
4188
4188
|
...M(n)
|
|
4189
4189
|
});
|
|
4190
|
-
class
|
|
4190
|
+
class At extends $ {
|
|
4191
4191
|
constructor() {
|
|
4192
4192
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
4193
4193
|
}
|
|
@@ -4198,25 +4198,25 @@ class Tt extends $ {
|
|
|
4198
4198
|
} catch {
|
|
4199
4199
|
return this._getInvalidInput(e);
|
|
4200
4200
|
}
|
|
4201
|
-
if (this._getType(e) !==
|
|
4201
|
+
if (this._getType(e) !== A.bigint)
|
|
4202
4202
|
return this._getInvalidInput(e);
|
|
4203
4203
|
let i;
|
|
4204
4204
|
const o = new Te();
|
|
4205
4205
|
for (const s of this._def.checks)
|
|
4206
4206
|
s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (i = this._getOrReturnCtx(e, i), k(i, {
|
|
4207
|
-
code:
|
|
4207
|
+
code: S.too_small,
|
|
4208
4208
|
type: "bigint",
|
|
4209
4209
|
minimum: s.value,
|
|
4210
4210
|
inclusive: s.inclusive,
|
|
4211
4211
|
message: s.message
|
|
4212
4212
|
}), o.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (i = this._getOrReturnCtx(e, i), k(i, {
|
|
4213
|
-
code:
|
|
4213
|
+
code: S.too_big,
|
|
4214
4214
|
type: "bigint",
|
|
4215
4215
|
maximum: s.value,
|
|
4216
4216
|
inclusive: s.inclusive,
|
|
4217
4217
|
message: s.message
|
|
4218
4218
|
}), o.dirty()) : s.kind === "multipleOf" ? e.data % s.value !== BigInt(0) && (i = this._getOrReturnCtx(e, i), k(i, {
|
|
4219
|
-
code:
|
|
4219
|
+
code: S.not_multiple_of,
|
|
4220
4220
|
multipleOf: s.value,
|
|
4221
4221
|
message: s.message
|
|
4222
4222
|
}), o.dirty()) : K.assertNever(s);
|
|
@@ -4225,8 +4225,8 @@ class Tt extends $ {
|
|
|
4225
4225
|
_getInvalidInput(e) {
|
|
4226
4226
|
const t = this._getOrReturnCtx(e);
|
|
4227
4227
|
return k(t, {
|
|
4228
|
-
code:
|
|
4229
|
-
expected:
|
|
4228
|
+
code: S.invalid_type,
|
|
4229
|
+
expected: A.bigint,
|
|
4230
4230
|
received: t.parsedType
|
|
4231
4231
|
}), R;
|
|
4232
4232
|
}
|
|
@@ -4243,7 +4243,7 @@ class Tt extends $ {
|
|
|
4243
4243
|
return this.setLimit("max", e, !1, C.toString(t));
|
|
4244
4244
|
}
|
|
4245
4245
|
setLimit(e, t, i, o) {
|
|
4246
|
-
return new
|
|
4246
|
+
return new At({
|
|
4247
4247
|
...this._def,
|
|
4248
4248
|
checks: [
|
|
4249
4249
|
...this._def.checks,
|
|
@@ -4257,7 +4257,7 @@ class Tt extends $ {
|
|
|
4257
4257
|
});
|
|
4258
4258
|
}
|
|
4259
4259
|
_addCheck(e) {
|
|
4260
|
-
return new
|
|
4260
|
+
return new At({
|
|
4261
4261
|
...this._def,
|
|
4262
4262
|
checks: [...this._def.checks, e]
|
|
4263
4263
|
});
|
|
@@ -4314,7 +4314,7 @@ class Tt extends $ {
|
|
|
4314
4314
|
return e;
|
|
4315
4315
|
}
|
|
4316
4316
|
}
|
|
4317
|
-
|
|
4317
|
+
At.create = (n) => new At({
|
|
4318
4318
|
checks: [],
|
|
4319
4319
|
typeName: U.ZodBigInt,
|
|
4320
4320
|
coerce: (n == null ? void 0 : n.coerce) ?? !1,
|
|
@@ -4322,11 +4322,11 @@ Tt.create = (n) => new Tt({
|
|
|
4322
4322
|
});
|
|
4323
4323
|
class hn extends $ {
|
|
4324
4324
|
_parse(e) {
|
|
4325
|
-
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !==
|
|
4325
|
+
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== A.boolean) {
|
|
4326
4326
|
const i = this._getOrReturnCtx(e);
|
|
4327
4327
|
return k(i, {
|
|
4328
|
-
code:
|
|
4329
|
-
expected:
|
|
4328
|
+
code: S.invalid_type,
|
|
4329
|
+
expected: A.boolean,
|
|
4330
4330
|
received: i.parsedType
|
|
4331
4331
|
}), R;
|
|
4332
4332
|
}
|
|
@@ -4340,32 +4340,32 @@ hn.create = (n) => new hn({
|
|
|
4340
4340
|
});
|
|
4341
4341
|
class Bt extends $ {
|
|
4342
4342
|
_parse(e) {
|
|
4343
|
-
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !==
|
|
4343
|
+
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== A.date) {
|
|
4344
4344
|
const s = this._getOrReturnCtx(e);
|
|
4345
4345
|
return k(s, {
|
|
4346
|
-
code:
|
|
4347
|
-
expected:
|
|
4346
|
+
code: S.invalid_type,
|
|
4347
|
+
expected: A.date,
|
|
4348
4348
|
received: s.parsedType
|
|
4349
4349
|
}), R;
|
|
4350
4350
|
}
|
|
4351
4351
|
if (Number.isNaN(e.data.getTime())) {
|
|
4352
4352
|
const s = this._getOrReturnCtx(e);
|
|
4353
4353
|
return k(s, {
|
|
4354
|
-
code:
|
|
4354
|
+
code: S.invalid_date
|
|
4355
4355
|
}), R;
|
|
4356
4356
|
}
|
|
4357
4357
|
const i = new Te();
|
|
4358
4358
|
let o;
|
|
4359
4359
|
for (const s of this._def.checks)
|
|
4360
4360
|
s.kind === "min" ? e.data.getTime() < s.value && (o = this._getOrReturnCtx(e, o), k(o, {
|
|
4361
|
-
code:
|
|
4361
|
+
code: S.too_small,
|
|
4362
4362
|
message: s.message,
|
|
4363
4363
|
inclusive: !0,
|
|
4364
4364
|
exact: !1,
|
|
4365
4365
|
minimum: s.value,
|
|
4366
4366
|
type: "date"
|
|
4367
4367
|
}), i.dirty()) : s.kind === "max" ? e.data.getTime() > s.value && (o = this._getOrReturnCtx(e, o), k(o, {
|
|
4368
|
-
code:
|
|
4368
|
+
code: S.too_big,
|
|
4369
4369
|
message: s.message,
|
|
4370
4370
|
inclusive: !0,
|
|
4371
4371
|
exact: !1,
|
|
@@ -4418,11 +4418,11 @@ Bt.create = (n) => new Bt({
|
|
|
4418
4418
|
});
|
|
4419
4419
|
class ii extends $ {
|
|
4420
4420
|
_parse(e) {
|
|
4421
|
-
if (this._getType(e) !==
|
|
4421
|
+
if (this._getType(e) !== A.symbol) {
|
|
4422
4422
|
const i = this._getOrReturnCtx(e);
|
|
4423
4423
|
return k(i, {
|
|
4424
|
-
code:
|
|
4425
|
-
expected:
|
|
4424
|
+
code: S.invalid_type,
|
|
4425
|
+
expected: A.symbol,
|
|
4426
4426
|
received: i.parsedType
|
|
4427
4427
|
}), R;
|
|
4428
4428
|
}
|
|
@@ -4435,11 +4435,11 @@ ii.create = (n) => new ii({
|
|
|
4435
4435
|
});
|
|
4436
4436
|
class gn extends $ {
|
|
4437
4437
|
_parse(e) {
|
|
4438
|
-
if (this._getType(e) !==
|
|
4438
|
+
if (this._getType(e) !== A.undefined) {
|
|
4439
4439
|
const i = this._getOrReturnCtx(e);
|
|
4440
4440
|
return k(i, {
|
|
4441
|
-
code:
|
|
4442
|
-
expected:
|
|
4441
|
+
code: S.invalid_type,
|
|
4442
|
+
expected: A.undefined,
|
|
4443
4443
|
received: i.parsedType
|
|
4444
4444
|
}), R;
|
|
4445
4445
|
}
|
|
@@ -4452,11 +4452,11 @@ gn.create = (n) => new gn({
|
|
|
4452
4452
|
});
|
|
4453
4453
|
class $t extends $ {
|
|
4454
4454
|
_parse(e) {
|
|
4455
|
-
if (this._getType(e) !==
|
|
4455
|
+
if (this._getType(e) !== A.null) {
|
|
4456
4456
|
const i = this._getOrReturnCtx(e);
|
|
4457
4457
|
return k(i, {
|
|
4458
|
-
code:
|
|
4459
|
-
expected:
|
|
4458
|
+
code: S.invalid_type,
|
|
4459
|
+
expected: A.null,
|
|
4460
4460
|
received: i.parsedType
|
|
4461
4461
|
}), R;
|
|
4462
4462
|
}
|
|
@@ -4495,8 +4495,8 @@ class st extends $ {
|
|
|
4495
4495
|
_parse(e) {
|
|
4496
4496
|
const t = this._getOrReturnCtx(e);
|
|
4497
4497
|
return k(t, {
|
|
4498
|
-
code:
|
|
4499
|
-
expected:
|
|
4498
|
+
code: S.invalid_type,
|
|
4499
|
+
expected: A.never,
|
|
4500
4500
|
received: t.parsedType
|
|
4501
4501
|
}), R;
|
|
4502
4502
|
}
|
|
@@ -4507,11 +4507,11 @@ st.create = (n) => new st({
|
|
|
4507
4507
|
});
|
|
4508
4508
|
class oi extends $ {
|
|
4509
4509
|
_parse(e) {
|
|
4510
|
-
if (this._getType(e) !==
|
|
4510
|
+
if (this._getType(e) !== A.undefined) {
|
|
4511
4511
|
const i = this._getOrReturnCtx(e);
|
|
4512
4512
|
return k(i, {
|
|
4513
|
-
code:
|
|
4514
|
-
expected:
|
|
4513
|
+
code: S.invalid_type,
|
|
4514
|
+
expected: A.void,
|
|
4515
4515
|
received: i.parsedType
|
|
4516
4516
|
}), R;
|
|
4517
4517
|
}
|
|
@@ -4522,19 +4522,19 @@ oi.create = (n) => new oi({
|
|
|
4522
4522
|
typeName: U.ZodVoid,
|
|
4523
4523
|
...M(n)
|
|
4524
4524
|
});
|
|
4525
|
-
class
|
|
4525
|
+
class Ge extends $ {
|
|
4526
4526
|
_parse(e) {
|
|
4527
4527
|
const { ctx: t, status: i } = this._processInputParams(e), o = this._def;
|
|
4528
|
-
if (t.parsedType !==
|
|
4528
|
+
if (t.parsedType !== A.array)
|
|
4529
4529
|
return k(t, {
|
|
4530
|
-
code:
|
|
4531
|
-
expected:
|
|
4530
|
+
code: S.invalid_type,
|
|
4531
|
+
expected: A.array,
|
|
4532
4532
|
received: t.parsedType
|
|
4533
4533
|
}), R;
|
|
4534
4534
|
if (o.exactLength !== null) {
|
|
4535
4535
|
const l = t.data.length > o.exactLength.value, d = t.data.length < o.exactLength.value;
|
|
4536
4536
|
(l || d) && (k(t, {
|
|
4537
|
-
code: l ?
|
|
4537
|
+
code: l ? S.too_big : S.too_small,
|
|
4538
4538
|
minimum: d ? o.exactLength.value : void 0,
|
|
4539
4539
|
maximum: l ? o.exactLength.value : void 0,
|
|
4540
4540
|
type: "array",
|
|
@@ -4544,14 +4544,14 @@ class Qe extends $ {
|
|
|
4544
4544
|
}), i.dirty());
|
|
4545
4545
|
}
|
|
4546
4546
|
if (o.minLength !== null && t.data.length < o.minLength.value && (k(t, {
|
|
4547
|
-
code:
|
|
4547
|
+
code: S.too_small,
|
|
4548
4548
|
minimum: o.minLength.value,
|
|
4549
4549
|
type: "array",
|
|
4550
4550
|
inclusive: !0,
|
|
4551
4551
|
exact: !1,
|
|
4552
4552
|
message: o.minLength.message
|
|
4553
4553
|
}), i.dirty()), o.maxLength !== null && t.data.length > o.maxLength.value && (k(t, {
|
|
4554
|
-
code:
|
|
4554
|
+
code: S.too_big,
|
|
4555
4555
|
maximum: o.maxLength.value,
|
|
4556
4556
|
type: "array",
|
|
4557
4557
|
inclusive: !0,
|
|
@@ -4566,19 +4566,19 @@ class Qe extends $ {
|
|
|
4566
4566
|
return this._def.type;
|
|
4567
4567
|
}
|
|
4568
4568
|
min(e, t) {
|
|
4569
|
-
return new
|
|
4569
|
+
return new Ge({
|
|
4570
4570
|
...this._def,
|
|
4571
4571
|
minLength: { value: e, message: C.toString(t) }
|
|
4572
4572
|
});
|
|
4573
4573
|
}
|
|
4574
4574
|
max(e, t) {
|
|
4575
|
-
return new
|
|
4575
|
+
return new Ge({
|
|
4576
4576
|
...this._def,
|
|
4577
4577
|
maxLength: { value: e, message: C.toString(t) }
|
|
4578
4578
|
});
|
|
4579
4579
|
}
|
|
4580
4580
|
length(e, t) {
|
|
4581
|
-
return new
|
|
4581
|
+
return new Ge({
|
|
4582
4582
|
...this._def,
|
|
4583
4583
|
exactLength: { value: e, message: C.toString(t) }
|
|
4584
4584
|
});
|
|
@@ -4587,7 +4587,7 @@ class Qe extends $ {
|
|
|
4587
4587
|
return this.min(1, e);
|
|
4588
4588
|
}
|
|
4589
4589
|
}
|
|
4590
|
-
|
|
4590
|
+
Ge.create = (n, e) => new Ge({
|
|
4591
4591
|
type: n,
|
|
4592
4592
|
minLength: null,
|
|
4593
4593
|
maxLength: null,
|
|
@@ -4606,7 +4606,7 @@ function Et(n) {
|
|
|
4606
4606
|
...n._def,
|
|
4607
4607
|
shape: () => e
|
|
4608
4608
|
});
|
|
4609
|
-
} else return n instanceof
|
|
4609
|
+
} else return n instanceof Ge ? new Ge({
|
|
4610
4610
|
...n._def,
|
|
4611
4611
|
type: Et(n.element)
|
|
4612
4612
|
}) : n instanceof Ye ? Ye.create(Et(n.unwrap())) : n instanceof ft ? ft.create(Et(n.unwrap())) : n instanceof ut ? ut.create(n.items.map((e) => Et(e))) : n;
|
|
@@ -4622,11 +4622,11 @@ class de extends $ {
|
|
|
4622
4622
|
return this._cached = { shape: e, keys: t }, this._cached;
|
|
4623
4623
|
}
|
|
4624
4624
|
_parse(e) {
|
|
4625
|
-
if (this._getType(e) !==
|
|
4625
|
+
if (this._getType(e) !== A.object) {
|
|
4626
4626
|
const f = this._getOrReturnCtx(e);
|
|
4627
4627
|
return k(f, {
|
|
4628
|
-
code:
|
|
4629
|
-
expected:
|
|
4628
|
+
code: S.invalid_type,
|
|
4629
|
+
expected: A.object,
|
|
4630
4630
|
received: f.parsedType
|
|
4631
4631
|
}), R;
|
|
4632
4632
|
}
|
|
@@ -4653,7 +4653,7 @@ class de extends $ {
|
|
|
4653
4653
|
});
|
|
4654
4654
|
else if (f === "strict")
|
|
4655
4655
|
d.length > 0 && (k(o, {
|
|
4656
|
-
code:
|
|
4656
|
+
code: S.unrecognized_keys,
|
|
4657
4657
|
keys: d
|
|
4658
4658
|
}), i.dirty());
|
|
4659
4659
|
else if (f !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
@@ -4911,7 +4911,7 @@ class Vt extends $ {
|
|
|
4911
4911
|
return t.common.issues.push(...d.ctx.common.issues), d.result;
|
|
4912
4912
|
const l = s.map((d) => new et(d.ctx.common.issues));
|
|
4913
4913
|
return k(t, {
|
|
4914
|
-
code:
|
|
4914
|
+
code: S.invalid_union,
|
|
4915
4915
|
unionErrors: l
|
|
4916
4916
|
}), R;
|
|
4917
4917
|
}
|
|
@@ -4958,7 +4958,7 @@ class Vt extends $ {
|
|
|
4958
4958
|
return t.common.issues.push(...s.ctx.common.issues), s.result;
|
|
4959
4959
|
const d = l.map((u) => new et(u));
|
|
4960
4960
|
return k(t, {
|
|
4961
|
-
code:
|
|
4961
|
+
code: S.invalid_union,
|
|
4962
4962
|
unionErrors: d
|
|
4963
4963
|
}), R;
|
|
4964
4964
|
}
|
|
@@ -4972,14 +4972,14 @@ Vt.create = (n, e) => new Vt({
|
|
|
4972
4972
|
typeName: U.ZodUnion,
|
|
4973
4973
|
...M(e)
|
|
4974
4974
|
});
|
|
4975
|
-
const ot = (n) => n instanceof yn ? ot(n.schema) : n instanceof nt ? ot(n.innerType()) : n instanceof Kt ? [n.value] : n instanceof pt ? n.options : n instanceof Jt ? K.objectValues(n.enum) : n instanceof Gt ? ot(n._def.innerType) : n instanceof gn ? [void 0] : n instanceof $t ? [null] : n instanceof Ye ? [void 0, ...ot(n.unwrap())] : n instanceof ft ? [null, ...ot(n.unwrap())] : n instanceof
|
|
4976
|
-
class
|
|
4975
|
+
const ot = (n) => n instanceof yn ? ot(n.schema) : n instanceof nt ? ot(n.innerType()) : n instanceof Kt ? [n.value] : n instanceof pt ? n.options : n instanceof Jt ? K.objectValues(n.enum) : n instanceof Gt ? ot(n._def.innerType) : n instanceof gn ? [void 0] : n instanceof $t ? [null] : n instanceof Ye ? [void 0, ...ot(n.unwrap())] : n instanceof ft ? [null, ...ot(n.unwrap())] : n instanceof Si || n instanceof Xt ? ot(n.unwrap()) : n instanceof Wt ? ot(n._def.innerType) : [];
|
|
4976
|
+
class Sn extends $ {
|
|
4977
4977
|
_parse(e) {
|
|
4978
4978
|
const { ctx: t } = this._processInputParams(e);
|
|
4979
|
-
if (t.parsedType !==
|
|
4979
|
+
if (t.parsedType !== A.object)
|
|
4980
4980
|
return k(t, {
|
|
4981
|
-
code:
|
|
4982
|
-
expected:
|
|
4981
|
+
code: S.invalid_type,
|
|
4982
|
+
expected: A.object,
|
|
4983
4983
|
received: t.parsedType
|
|
4984
4984
|
}), R;
|
|
4985
4985
|
const i = this.discriminator, o = t.data[i], s = this.optionsMap.get(o);
|
|
@@ -4992,7 +4992,7 @@ class Nn extends $ {
|
|
|
4992
4992
|
path: t.path,
|
|
4993
4993
|
parent: t
|
|
4994
4994
|
}) : (k(t, {
|
|
4995
|
-
code:
|
|
4995
|
+
code: S.invalid_union_discriminator,
|
|
4996
4996
|
options: Array.from(this.optionsMap.keys()),
|
|
4997
4997
|
path: [i]
|
|
4998
4998
|
}), R);
|
|
@@ -5026,7 +5026,7 @@ class Nn extends $ {
|
|
|
5026
5026
|
o.set(d, s);
|
|
5027
5027
|
}
|
|
5028
5028
|
}
|
|
5029
|
-
return new
|
|
5029
|
+
return new Sn({
|
|
5030
5030
|
typeName: U.ZodDiscriminatedUnion,
|
|
5031
5031
|
discriminator: e,
|
|
5032
5032
|
options: t,
|
|
@@ -5039,7 +5039,7 @@ function ai(n, e) {
|
|
|
5039
5039
|
const t = at(n), i = at(e);
|
|
5040
5040
|
if (n === e)
|
|
5041
5041
|
return { valid: !0, data: n };
|
|
5042
|
-
if (t ===
|
|
5042
|
+
if (t === A.object && i === A.object) {
|
|
5043
5043
|
const o = K.objectKeys(e), s = K.objectKeys(n).filter((d) => o.indexOf(d) !== -1), l = { ...n, ...e };
|
|
5044
5044
|
for (const d of s) {
|
|
5045
5045
|
const u = ai(n[d], e[d]);
|
|
@@ -5048,7 +5048,7 @@ function ai(n, e) {
|
|
|
5048
5048
|
l[d] = u.data;
|
|
5049
5049
|
}
|
|
5050
5050
|
return { valid: !0, data: l };
|
|
5051
|
-
} else if (t ===
|
|
5051
|
+
} else if (t === A.array && i === A.array) {
|
|
5052
5052
|
if (n.length !== e.length)
|
|
5053
5053
|
return { valid: !1 };
|
|
5054
5054
|
const o = [];
|
|
@@ -5059,7 +5059,7 @@ function ai(n, e) {
|
|
|
5059
5059
|
o.push(u.data);
|
|
5060
5060
|
}
|
|
5061
5061
|
return { valid: !0, data: o };
|
|
5062
|
-
} else return t ===
|
|
5062
|
+
} else return t === A.date && i === A.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
|
|
5063
5063
|
}
|
|
5064
5064
|
class Zt extends $ {
|
|
5065
5065
|
_parse(e) {
|
|
@@ -5068,7 +5068,7 @@ class Zt extends $ {
|
|
|
5068
5068
|
return R;
|
|
5069
5069
|
const d = ai(s.value, l.value);
|
|
5070
5070
|
return d.valid ? ((ni(s) || ni(l)) && t.dirty(), { status: t.value, value: d.data }) : (k(i, {
|
|
5071
|
-
code:
|
|
5071
|
+
code: S.invalid_intersection_types
|
|
5072
5072
|
}), R);
|
|
5073
5073
|
};
|
|
5074
5074
|
return i.common.async ? Promise.all([
|
|
@@ -5102,22 +5102,22 @@ Zt.create = (n, e, t) => new Zt({
|
|
|
5102
5102
|
class ut extends $ {
|
|
5103
5103
|
_parse(e) {
|
|
5104
5104
|
const { status: t, ctx: i } = this._processInputParams(e);
|
|
5105
|
-
if (i.parsedType !==
|
|
5105
|
+
if (i.parsedType !== A.array)
|
|
5106
5106
|
return k(i, {
|
|
5107
|
-
code:
|
|
5108
|
-
expected:
|
|
5107
|
+
code: S.invalid_type,
|
|
5108
|
+
expected: A.array,
|
|
5109
5109
|
received: i.parsedType
|
|
5110
5110
|
}), R;
|
|
5111
5111
|
if (i.data.length < this._def.items.length)
|
|
5112
5112
|
return k(i, {
|
|
5113
|
-
code:
|
|
5113
|
+
code: S.too_small,
|
|
5114
5114
|
minimum: this._def.items.length,
|
|
5115
5115
|
inclusive: !0,
|
|
5116
5116
|
exact: !1,
|
|
5117
5117
|
type: "array"
|
|
5118
5118
|
}), R;
|
|
5119
5119
|
!this._def.rest && i.data.length > this._def.items.length && (k(i, {
|
|
5120
|
-
code:
|
|
5120
|
+
code: S.too_big,
|
|
5121
5121
|
maximum: this._def.items.length,
|
|
5122
5122
|
inclusive: !0,
|
|
5123
5123
|
exact: !1,
|
|
@@ -5158,10 +5158,10 @@ class Ht extends $ {
|
|
|
5158
5158
|
}
|
|
5159
5159
|
_parse(e) {
|
|
5160
5160
|
const { status: t, ctx: i } = this._processInputParams(e);
|
|
5161
|
-
if (i.parsedType !==
|
|
5161
|
+
if (i.parsedType !== A.object)
|
|
5162
5162
|
return k(i, {
|
|
5163
|
-
code:
|
|
5164
|
-
expected:
|
|
5163
|
+
code: S.invalid_type,
|
|
5164
|
+
expected: A.object,
|
|
5165
5165
|
received: i.parsedType
|
|
5166
5166
|
}), R;
|
|
5167
5167
|
const o = [], s = this._def.keyType, l = this._def.valueType;
|
|
@@ -5199,10 +5199,10 @@ class si extends $ {
|
|
|
5199
5199
|
}
|
|
5200
5200
|
_parse(e) {
|
|
5201
5201
|
const { status: t, ctx: i } = this._processInputParams(e);
|
|
5202
|
-
if (i.parsedType !==
|
|
5202
|
+
if (i.parsedType !== A.map)
|
|
5203
5203
|
return k(i, {
|
|
5204
|
-
code:
|
|
5205
|
-
expected:
|
|
5204
|
+
code: S.invalid_type,
|
|
5205
|
+
expected: A.map,
|
|
5206
5206
|
received: i.parsedType
|
|
5207
5207
|
}), R;
|
|
5208
5208
|
const o = this._def.keyType, s = this._def.valueType, l = [...i.data.entries()].map(([d, u], f) => ({
|
|
@@ -5238,25 +5238,25 @@ si.create = (n, e, t) => new si({
|
|
|
5238
5238
|
typeName: U.ZodMap,
|
|
5239
5239
|
...M(t)
|
|
5240
5240
|
});
|
|
5241
|
-
class
|
|
5241
|
+
class It extends $ {
|
|
5242
5242
|
_parse(e) {
|
|
5243
5243
|
const { status: t, ctx: i } = this._processInputParams(e);
|
|
5244
|
-
if (i.parsedType !==
|
|
5244
|
+
if (i.parsedType !== A.set)
|
|
5245
5245
|
return k(i, {
|
|
5246
|
-
code:
|
|
5247
|
-
expected:
|
|
5246
|
+
code: S.invalid_type,
|
|
5247
|
+
expected: A.set,
|
|
5248
5248
|
received: i.parsedType
|
|
5249
5249
|
}), R;
|
|
5250
5250
|
const o = this._def;
|
|
5251
5251
|
o.minSize !== null && i.data.size < o.minSize.value && (k(i, {
|
|
5252
|
-
code:
|
|
5252
|
+
code: S.too_small,
|
|
5253
5253
|
minimum: o.minSize.value,
|
|
5254
5254
|
type: "set",
|
|
5255
5255
|
inclusive: !0,
|
|
5256
5256
|
exact: !1,
|
|
5257
5257
|
message: o.minSize.message
|
|
5258
5258
|
}), t.dirty()), o.maxSize !== null && i.data.size > o.maxSize.value && (k(i, {
|
|
5259
|
-
code:
|
|
5259
|
+
code: S.too_big,
|
|
5260
5260
|
maximum: o.maxSize.value,
|
|
5261
5261
|
type: "set",
|
|
5262
5262
|
inclusive: !0,
|
|
@@ -5277,13 +5277,13 @@ class At extends $ {
|
|
|
5277
5277
|
return i.common.async ? Promise.all(d).then((u) => l(u)) : l(d);
|
|
5278
5278
|
}
|
|
5279
5279
|
min(e, t) {
|
|
5280
|
-
return new
|
|
5280
|
+
return new It({
|
|
5281
5281
|
...this._def,
|
|
5282
5282
|
minSize: { value: e, message: C.toString(t) }
|
|
5283
5283
|
});
|
|
5284
5284
|
}
|
|
5285
5285
|
max(e, t) {
|
|
5286
|
-
return new
|
|
5286
|
+
return new It({
|
|
5287
5287
|
...this._def,
|
|
5288
5288
|
maxSize: { value: e, message: C.toString(t) }
|
|
5289
5289
|
});
|
|
@@ -5295,7 +5295,7 @@ class At extends $ {
|
|
|
5295
5295
|
return this.min(1, e);
|
|
5296
5296
|
}
|
|
5297
5297
|
}
|
|
5298
|
-
|
|
5298
|
+
It.create = (n, e) => new It({
|
|
5299
5299
|
valueType: n,
|
|
5300
5300
|
minSize: null,
|
|
5301
5301
|
maxSize: null,
|
|
@@ -5322,7 +5322,7 @@ class Kt extends $ {
|
|
|
5322
5322
|
const t = this._getOrReturnCtx(e);
|
|
5323
5323
|
return k(t, {
|
|
5324
5324
|
received: t.data,
|
|
5325
|
-
code:
|
|
5325
|
+
code: S.invalid_literal,
|
|
5326
5326
|
expected: this._def.value
|
|
5327
5327
|
}), R;
|
|
5328
5328
|
}
|
|
@@ -5351,14 +5351,14 @@ class pt extends $ {
|
|
|
5351
5351
|
return k(t, {
|
|
5352
5352
|
expected: K.joinValues(i),
|
|
5353
5353
|
received: t.parsedType,
|
|
5354
|
-
code:
|
|
5354
|
+
code: S.invalid_type
|
|
5355
5355
|
}), R;
|
|
5356
5356
|
}
|
|
5357
5357
|
if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
|
|
5358
5358
|
const t = this._getOrReturnCtx(e), i = this._def.values;
|
|
5359
5359
|
return k(t, {
|
|
5360
5360
|
received: t.data,
|
|
5361
|
-
code:
|
|
5361
|
+
code: S.invalid_enum_value,
|
|
5362
5362
|
options: i
|
|
5363
5363
|
}), R;
|
|
5364
5364
|
}
|
|
@@ -5402,19 +5402,19 @@ pt.create = ms;
|
|
|
5402
5402
|
class Jt extends $ {
|
|
5403
5403
|
_parse(e) {
|
|
5404
5404
|
const t = K.getValidEnumValues(this._def.values), i = this._getOrReturnCtx(e);
|
|
5405
|
-
if (i.parsedType !==
|
|
5405
|
+
if (i.parsedType !== A.string && i.parsedType !== A.number) {
|
|
5406
5406
|
const o = K.objectValues(t);
|
|
5407
5407
|
return k(i, {
|
|
5408
5408
|
expected: K.joinValues(o),
|
|
5409
5409
|
received: i.parsedType,
|
|
5410
|
-
code:
|
|
5410
|
+
code: S.invalid_type
|
|
5411
5411
|
}), R;
|
|
5412
5412
|
}
|
|
5413
5413
|
if (this._cache || (this._cache = new Set(K.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
|
|
5414
5414
|
const o = K.objectValues(t);
|
|
5415
5415
|
return k(i, {
|
|
5416
5416
|
received: i.data,
|
|
5417
|
-
code:
|
|
5417
|
+
code: S.invalid_enum_value,
|
|
5418
5418
|
options: o
|
|
5419
5419
|
}), R;
|
|
5420
5420
|
}
|
|
@@ -5435,13 +5435,13 @@ class Qt extends $ {
|
|
|
5435
5435
|
}
|
|
5436
5436
|
_parse(e) {
|
|
5437
5437
|
const { ctx: t } = this._processInputParams(e);
|
|
5438
|
-
if (t.parsedType !==
|
|
5438
|
+
if (t.parsedType !== A.promise && t.common.async === !1)
|
|
5439
5439
|
return k(t, {
|
|
5440
|
-
code:
|
|
5441
|
-
expected:
|
|
5440
|
+
code: S.invalid_type,
|
|
5441
|
+
expected: A.promise,
|
|
5442
5442
|
received: t.parsedType
|
|
5443
5443
|
}), R;
|
|
5444
|
-
const i = t.parsedType ===
|
|
5444
|
+
const i = t.parsedType === A.promise ? t.data : Promise.resolve(t.data);
|
|
5445
5445
|
return Fe(i.then((o) => this._def.type.parseAsync(o, {
|
|
5446
5446
|
path: t.path,
|
|
5447
5447
|
errorMap: t.common.contextualErrorMap
|
|
@@ -5519,14 +5519,14 @@ class nt extends $ {
|
|
|
5519
5519
|
path: i.path,
|
|
5520
5520
|
parent: i
|
|
5521
5521
|
});
|
|
5522
|
-
if (!
|
|
5522
|
+
if (!St(l))
|
|
5523
5523
|
return R;
|
|
5524
5524
|
const d = o.transform(l.value, s);
|
|
5525
5525
|
if (d instanceof Promise)
|
|
5526
5526
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
5527
5527
|
return { status: t.value, value: d };
|
|
5528
5528
|
} else
|
|
5529
|
-
return this._def.schema._parseAsync({ data: i.data, path: i.path, parent: i }).then((l) =>
|
|
5529
|
+
return this._def.schema._parseAsync({ data: i.data, path: i.path, parent: i }).then((l) => St(l) ? Promise.resolve(o.transform(l.value, s)).then((d) => ({
|
|
5530
5530
|
status: t.value,
|
|
5531
5531
|
value: d
|
|
5532
5532
|
})) : R);
|
|
@@ -5547,7 +5547,7 @@ nt.createWithPreprocess = (n, e, t) => new nt({
|
|
|
5547
5547
|
});
|
|
5548
5548
|
class Ye extends $ {
|
|
5549
5549
|
_parse(e) {
|
|
5550
|
-
return this._getType(e) ===
|
|
5550
|
+
return this._getType(e) === A.undefined ? Fe(void 0) : this._def.innerType._parse(e);
|
|
5551
5551
|
}
|
|
5552
5552
|
unwrap() {
|
|
5553
5553
|
return this._def.innerType;
|
|
@@ -5560,7 +5560,7 @@ Ye.create = (n, e) => new Ye({
|
|
|
5560
5560
|
});
|
|
5561
5561
|
class ft extends $ {
|
|
5562
5562
|
_parse(e) {
|
|
5563
|
-
return this._getType(e) ===
|
|
5563
|
+
return this._getType(e) === A.null ? Fe(null) : this._def.innerType._parse(e);
|
|
5564
5564
|
}
|
|
5565
5565
|
unwrap() {
|
|
5566
5566
|
return this._def.innerType;
|
|
@@ -5575,7 +5575,7 @@ class Gt extends $ {
|
|
|
5575
5575
|
_parse(e) {
|
|
5576
5576
|
const { ctx: t } = this._processInputParams(e);
|
|
5577
5577
|
let i = t.data;
|
|
5578
|
-
return t.parsedType ===
|
|
5578
|
+
return t.parsedType === A.undefined && (i = this._def.defaultValue()), this._def.innerType._parse({
|
|
5579
5579
|
data: i,
|
|
5580
5580
|
path: t.path,
|
|
5581
5581
|
parent: t
|
|
@@ -5636,11 +5636,11 @@ Wt.create = (n, e) => new Wt({
|
|
|
5636
5636
|
});
|
|
5637
5637
|
class ri extends $ {
|
|
5638
5638
|
_parse(e) {
|
|
5639
|
-
if (this._getType(e) !==
|
|
5639
|
+
if (this._getType(e) !== A.nan) {
|
|
5640
5640
|
const i = this._getOrReturnCtx(e);
|
|
5641
5641
|
return k(i, {
|
|
5642
|
-
code:
|
|
5643
|
-
expected:
|
|
5642
|
+
code: S.invalid_type,
|
|
5643
|
+
expected: A.nan,
|
|
5644
5644
|
received: i.parsedType
|
|
5645
5645
|
}), R;
|
|
5646
5646
|
}
|
|
@@ -5651,7 +5651,7 @@ ri.create = (n) => new ri({
|
|
|
5651
5651
|
typeName: U.ZodNaN,
|
|
5652
5652
|
...M(n)
|
|
5653
5653
|
});
|
|
5654
|
-
class
|
|
5654
|
+
class Si extends $ {
|
|
5655
5655
|
_parse(e) {
|
|
5656
5656
|
const { ctx: t } = this._processInputParams(e), i = t.data;
|
|
5657
5657
|
return this._def.type._parse({
|
|
@@ -5664,7 +5664,7 @@ class Ni extends $ {
|
|
|
5664
5664
|
return this._def.type;
|
|
5665
5665
|
}
|
|
5666
5666
|
}
|
|
5667
|
-
class
|
|
5667
|
+
class Nn extends $ {
|
|
5668
5668
|
_parse(e) {
|
|
5669
5669
|
const { status: t, ctx: i } = this._processInputParams(e);
|
|
5670
5670
|
if (i.common.async)
|
|
@@ -5697,7 +5697,7 @@ class Sn extends $ {
|
|
|
5697
5697
|
}
|
|
5698
5698
|
}
|
|
5699
5699
|
static create(e, t) {
|
|
5700
|
-
return new
|
|
5700
|
+
return new Nn({
|
|
5701
5701
|
in: e,
|
|
5702
5702
|
out: t,
|
|
5703
5703
|
typeName: U.ZodPipeline
|
|
@@ -5706,7 +5706,7 @@ class Sn extends $ {
|
|
|
5706
5706
|
}
|
|
5707
5707
|
class Xt extends $ {
|
|
5708
5708
|
_parse(e) {
|
|
5709
|
-
const t = this._def.innerType._parse(e), i = (o) => (
|
|
5709
|
+
const t = this._def.innerType._parse(e), i = (o) => (St(o) && (o.value = Object.freeze(o.value)), o);
|
|
5710
5710
|
return Mt(t) ? t.then((o) => i(o)) : i(t);
|
|
5711
5711
|
}
|
|
5712
5712
|
unwrap() {
|
|
@@ -5725,12 +5725,12 @@ var U;
|
|
|
5725
5725
|
(function(n) {
|
|
5726
5726
|
n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
|
|
5727
5727
|
})(U || (U = {}));
|
|
5728
|
-
const a = Xe.create, x =
|
|
5728
|
+
const a = Xe.create, x = Nt.create, h = hn.create, ys = $t.create, V = jt.create, ze = mn.create;
|
|
5729
5729
|
st.create;
|
|
5730
|
-
const
|
|
5730
|
+
const N = Ge.create, _ = de.create, Pe = Vt.create, Ct = Sn.create;
|
|
5731
5731
|
Zt.create;
|
|
5732
5732
|
ut.create;
|
|
5733
|
-
const P = Ht.create,
|
|
5733
|
+
const P = Ht.create, I = Kt.create, b = pt.create, wt = Jt.create;
|
|
5734
5734
|
Qt.create;
|
|
5735
5735
|
Ye.create;
|
|
5736
5736
|
ft.create;
|
|
@@ -5742,14 +5742,14 @@ const vs = nt.createWithPreprocess, Xr = /* @__PURE__ */ Object.freeze(/* @__PUR
|
|
|
5742
5742
|
ParseStatus: Te,
|
|
5743
5743
|
Schema: $,
|
|
5744
5744
|
ZodAny: jt,
|
|
5745
|
-
ZodArray:
|
|
5746
|
-
ZodBigInt:
|
|
5745
|
+
ZodArray: Ge,
|
|
5746
|
+
ZodBigInt: At,
|
|
5747
5747
|
ZodBoolean: hn,
|
|
5748
|
-
ZodBranded:
|
|
5748
|
+
ZodBranded: Si,
|
|
5749
5749
|
ZodCatch: Wt,
|
|
5750
5750
|
ZodDate: Bt,
|
|
5751
5751
|
ZodDefault: Gt,
|
|
5752
|
-
ZodDiscriminatedUnion:
|
|
5752
|
+
ZodDiscriminatedUnion: Sn,
|
|
5753
5753
|
ZodEffects: nt,
|
|
5754
5754
|
ZodEnum: pt,
|
|
5755
5755
|
ZodError: et,
|
|
@@ -5757,7 +5757,7 @@ const vs = nt.createWithPreprocess, Xr = /* @__PURE__ */ Object.freeze(/* @__PUR
|
|
|
5757
5757
|
return U;
|
|
5758
5758
|
},
|
|
5759
5759
|
ZodIntersection: Zt,
|
|
5760
|
-
ZodIssueCode:
|
|
5760
|
+
ZodIssueCode: S,
|
|
5761
5761
|
ZodLazy: yn,
|
|
5762
5762
|
ZodLiteral: Kt,
|
|
5763
5763
|
ZodMap: si,
|
|
@@ -5766,16 +5766,16 @@ const vs = nt.createWithPreprocess, Xr = /* @__PURE__ */ Object.freeze(/* @__PUR
|
|
|
5766
5766
|
ZodNever: st,
|
|
5767
5767
|
ZodNull: $t,
|
|
5768
5768
|
ZodNullable: ft,
|
|
5769
|
-
ZodNumber:
|
|
5769
|
+
ZodNumber: Nt,
|
|
5770
5770
|
ZodObject: de,
|
|
5771
5771
|
ZodOptional: Ye,
|
|
5772
|
-
ZodParsedType:
|
|
5773
|
-
ZodPipeline:
|
|
5772
|
+
ZodParsedType: A,
|
|
5773
|
+
ZodPipeline: Nn,
|
|
5774
5774
|
ZodPromise: Qt,
|
|
5775
5775
|
ZodReadonly: Xt,
|
|
5776
5776
|
ZodRecord: Ht,
|
|
5777
5777
|
ZodSchema: $,
|
|
5778
|
-
ZodSet:
|
|
5778
|
+
ZodSet: It,
|
|
5779
5779
|
ZodString: Xe,
|
|
5780
5780
|
ZodSymbol: ii,
|
|
5781
5781
|
ZodTransformer: nt,
|
|
@@ -5787,20 +5787,20 @@ const vs = nt.createWithPreprocess, Xr = /* @__PURE__ */ Object.freeze(/* @__PUR
|
|
|
5787
5787
|
ZodVoid: oi,
|
|
5788
5788
|
addIssueToContext: k,
|
|
5789
5789
|
any: V,
|
|
5790
|
-
array:
|
|
5790
|
+
array: N,
|
|
5791
5791
|
boolean: h,
|
|
5792
5792
|
custom: li,
|
|
5793
5793
|
datetimeRegex: gs,
|
|
5794
5794
|
defaultErrorMap: fn,
|
|
5795
|
-
discriminatedUnion:
|
|
5795
|
+
discriminatedUnion: Ct,
|
|
5796
5796
|
enum: b,
|
|
5797
5797
|
getErrorMap: us,
|
|
5798
5798
|
getParsedType: at,
|
|
5799
5799
|
isAborted: ti,
|
|
5800
5800
|
isAsync: Mt,
|
|
5801
5801
|
isDirty: ni,
|
|
5802
|
-
isValid:
|
|
5803
|
-
literal:
|
|
5802
|
+
isValid: St,
|
|
5803
|
+
literal: I,
|
|
5804
5804
|
makeIssue: ps,
|
|
5805
5805
|
nativeEnum: wt,
|
|
5806
5806
|
null: ys,
|
|
@@ -5825,10 +5825,10 @@ const Ze = _({
|
|
|
5825
5825
|
}), ws = _({
|
|
5826
5826
|
id: a(),
|
|
5827
5827
|
version: a().optional()
|
|
5828
|
-
}),
|
|
5828
|
+
}), Ss = _({
|
|
5829
5829
|
name: a(),
|
|
5830
5830
|
version: a()
|
|
5831
|
-
}),
|
|
5831
|
+
}), Ns = _({
|
|
5832
5832
|
name: a(),
|
|
5833
5833
|
// Optional on writes so PATCH callers can omit the value to preserve the
|
|
5834
5834
|
// existing secret. The adapter merges by name when value is missing.
|
|
@@ -5836,10 +5836,10 @@ const Ze = _({
|
|
|
5836
5836
|
}), bs = _({
|
|
5837
5837
|
name: a().max(255),
|
|
5838
5838
|
code: a().max(1e5),
|
|
5839
|
-
supported_triggers:
|
|
5839
|
+
supported_triggers: N(ws).optional(),
|
|
5840
5840
|
runtime: a().max(50).optional(),
|
|
5841
|
-
dependencies:
|
|
5842
|
-
secrets:
|
|
5841
|
+
dependencies: N(Ss).optional(),
|
|
5842
|
+
secrets: N(Ns).optional(),
|
|
5843
5843
|
// Marks this action as a shared template owned by the control-plane tenant.
|
|
5844
5844
|
// Other tenants can opt-in by creating a row with the same `name` and
|
|
5845
5845
|
// `inherit: true`; at execute time the loader reads code from this row.
|
|
@@ -5859,7 +5859,7 @@ bs.extend({
|
|
|
5859
5859
|
status: b(["draft", "built"]).default("built"),
|
|
5860
5860
|
deployed_at: a().optional(),
|
|
5861
5861
|
// Override secrets to return names only (no values) in responses
|
|
5862
|
-
secrets:
|
|
5862
|
+
secrets: N(
|
|
5863
5863
|
_({
|
|
5864
5864
|
name: a(),
|
|
5865
5865
|
value: a().optional()
|
|
@@ -5886,17 +5886,17 @@ const Yr = a(), el = b([
|
|
|
5886
5886
|
}), il = _({
|
|
5887
5887
|
level: b(["log", "info", "warn", "error", "debug"]),
|
|
5888
5888
|
message: a()
|
|
5889
|
-
}), ol =
|
|
5889
|
+
}), ol = N(
|
|
5890
5890
|
_({
|
|
5891
5891
|
action_name: a(),
|
|
5892
|
-
lines:
|
|
5892
|
+
lines: N(il)
|
|
5893
5893
|
})
|
|
5894
5894
|
), al = _({
|
|
5895
5895
|
id: a(),
|
|
5896
5896
|
tenant_id: a(),
|
|
5897
5897
|
trigger_id: Yr,
|
|
5898
5898
|
status: el,
|
|
5899
|
-
results:
|
|
5899
|
+
results: N(nl),
|
|
5900
5900
|
logs: ol.optional(),
|
|
5901
5901
|
created_at: a(),
|
|
5902
5902
|
updated_at: a()
|
|
@@ -5910,9 +5910,9 @@ const sl = _({
|
|
|
5910
5910
|
action_id: a(),
|
|
5911
5911
|
code: a().max(1e5),
|
|
5912
5912
|
runtime: a().max(50).optional(),
|
|
5913
|
-
dependencies:
|
|
5914
|
-
secrets:
|
|
5915
|
-
supported_triggers:
|
|
5913
|
+
dependencies: N(Ss).optional(),
|
|
5914
|
+
secrets: N(Ns).optional(),
|
|
5915
|
+
supported_triggers: N(ws).optional(),
|
|
5916
5916
|
deployed: h().default(!0)
|
|
5917
5917
|
});
|
|
5918
5918
|
sl.extend({
|
|
@@ -5932,7 +5932,7 @@ const rl = b([
|
|
|
5932
5932
|
email: a().optional(),
|
|
5933
5933
|
org_id: a().optional(),
|
|
5934
5934
|
org_name: a().optional(),
|
|
5935
|
-
scopes:
|
|
5935
|
+
scopes: N(a()).optional(),
|
|
5936
5936
|
client_id: a().optional()
|
|
5937
5937
|
}), dl = _({
|
|
5938
5938
|
type: a(),
|
|
@@ -6000,13 +6000,13 @@ const hl = _({
|
|
|
6000
6000
|
block_aliases: h().optional(),
|
|
6001
6001
|
block_free_emails: h().optional(),
|
|
6002
6002
|
block_disposable_emails: h().optional(),
|
|
6003
|
-
blocklist:
|
|
6004
|
-
allowlist:
|
|
6003
|
+
blocklist: N(a()).optional(),
|
|
6004
|
+
allowlist: N(a()).optional()
|
|
6005
6005
|
}), gl = _({
|
|
6006
6006
|
id: a(),
|
|
6007
6007
|
alias: a().max(100).optional(),
|
|
6008
|
-
type:
|
|
6009
|
-
action:
|
|
6008
|
+
type: I("AUTH0"),
|
|
6009
|
+
action: I("UPDATE_USER"),
|
|
6010
6010
|
allow_failure: h().optional(),
|
|
6011
6011
|
mask_output: h().optional(),
|
|
6012
6012
|
params: _({
|
|
@@ -6017,8 +6017,8 @@ const hl = _({
|
|
|
6017
6017
|
}), ml = _({
|
|
6018
6018
|
id: a(),
|
|
6019
6019
|
alias: a().max(100).optional(),
|
|
6020
|
-
type:
|
|
6021
|
-
action:
|
|
6020
|
+
type: I("EMAIL"),
|
|
6021
|
+
action: I("VERIFY_EMAIL"),
|
|
6022
6022
|
allow_failure: h().optional(),
|
|
6023
6023
|
mask_output: h().optional(),
|
|
6024
6024
|
params: _({
|
|
@@ -6028,8 +6028,8 @@ const hl = _({
|
|
|
6028
6028
|
}), yl = b(["change-email", "account", "custom"]), vl = _({
|
|
6029
6029
|
id: a(),
|
|
6030
6030
|
alias: a().max(100).optional(),
|
|
6031
|
-
type:
|
|
6032
|
-
action:
|
|
6031
|
+
type: I("REDIRECT"),
|
|
6032
|
+
action: I("REDIRECT_USER"),
|
|
6033
6033
|
allow_failure: h().optional(),
|
|
6034
6034
|
mask_output: h().optional(),
|
|
6035
6035
|
params: _({
|
|
@@ -6044,16 +6044,16 @@ const hl = _({
|
|
|
6044
6044
|
gl,
|
|
6045
6045
|
ml,
|
|
6046
6046
|
vl
|
|
6047
|
-
]),
|
|
6047
|
+
]), Sl = _({
|
|
6048
6048
|
name: a().min(1).max(150).openapi({
|
|
6049
6049
|
description: "The name of the flow"
|
|
6050
6050
|
}),
|
|
6051
6051
|
// Actions is an array of action steps (Auth0 stores as JSON blob)
|
|
6052
|
-
actions:
|
|
6052
|
+
actions: N(wl).optional().default([]).openapi({
|
|
6053
6053
|
description: "The list of actions to execute in sequence"
|
|
6054
6054
|
})
|
|
6055
6055
|
});
|
|
6056
|
-
|
|
6056
|
+
Sl.extend({
|
|
6057
6057
|
...Ze.shape,
|
|
6058
6058
|
id: a().openapi({
|
|
6059
6059
|
description: "Unique identifier for the flow",
|
|
@@ -6083,7 +6083,7 @@ _({
|
|
|
6083
6083
|
length: x(),
|
|
6084
6084
|
total: x().optional()
|
|
6085
6085
|
});
|
|
6086
|
-
const
|
|
6086
|
+
const Nl = _({
|
|
6087
6087
|
email: a().optional(),
|
|
6088
6088
|
email_verified: h().optional(),
|
|
6089
6089
|
name: a().optional(),
|
|
@@ -6105,7 +6105,7 @@ const Sl = _({
|
|
|
6105
6105
|
access_token: a().optional(),
|
|
6106
6106
|
access_token_secret: a().optional(),
|
|
6107
6107
|
refresh_token: a().optional(),
|
|
6108
|
-
profileData:
|
|
6108
|
+
profileData: Nl.optional()
|
|
6109
6109
|
}), El = _({
|
|
6110
6110
|
formatted: a().optional(),
|
|
6111
6111
|
// Full mailing address
|
|
@@ -6183,14 +6183,14 @@ const Sl = _({
|
|
|
6183
6183
|
is_social: h(),
|
|
6184
6184
|
email: a().optional(),
|
|
6185
6185
|
login_count: x().default(0),
|
|
6186
|
-
identities:
|
|
6186
|
+
identities: N(bl).optional()
|
|
6187
6187
|
});
|
|
6188
6188
|
kl.omit({
|
|
6189
6189
|
registration_completed_at: !0
|
|
6190
6190
|
});
|
|
6191
6191
|
Es.extend({
|
|
6192
6192
|
login_count: x(),
|
|
6193
|
-
multifactor:
|
|
6193
|
+
multifactor: N(a()).optional(),
|
|
6194
6194
|
last_ip: a().optional(),
|
|
6195
6195
|
last_login: a().optional(),
|
|
6196
6196
|
user_id: a()
|
|
@@ -6258,25 +6258,25 @@ const Al = _({
|
|
|
6258
6258
|
auth0_conformant: h().default(!0).openapi({
|
|
6259
6259
|
description: "Whether this client follows Auth0-compatible behavior (true) or strict OIDC behavior (false). When true, profile/email claims are included in the ID token when scopes are requested. When false, these claims are only available from the userinfo endpoint (strict OIDC 5.4 compliance)."
|
|
6260
6260
|
}),
|
|
6261
|
-
callbacks:
|
|
6261
|
+
callbacks: N(a()).default([]).optional().openapi({
|
|
6262
6262
|
description: "Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication."
|
|
6263
6263
|
}),
|
|
6264
|
-
allowed_origins:
|
|
6264
|
+
allowed_origins: N(a()).default([]).optional().openapi({
|
|
6265
6265
|
description: "Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs."
|
|
6266
6266
|
}),
|
|
6267
|
-
web_origins:
|
|
6267
|
+
web_origins: N(a()).default([]).optional().openapi({
|
|
6268
6268
|
description: "Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode."
|
|
6269
6269
|
}),
|
|
6270
|
-
client_aliases:
|
|
6270
|
+
client_aliases: N(a()).default([]).optional().openapi({
|
|
6271
6271
|
description: "List of audiences/realms for SAML protocol. Used by the wsfed addon."
|
|
6272
6272
|
}),
|
|
6273
|
-
allowed_clients:
|
|
6273
|
+
allowed_clients: N(a()).default([]).optional().openapi({
|
|
6274
6274
|
description: "List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed."
|
|
6275
6275
|
}),
|
|
6276
|
-
connections:
|
|
6276
|
+
connections: N(a()).default([]).optional().openapi({
|
|
6277
6277
|
description: "List of connection IDs enabled for this client. The order determines the display order on the login page."
|
|
6278
6278
|
}),
|
|
6279
|
-
allowed_logout_urls:
|
|
6279
|
+
allowed_logout_urls: N(a()).default([]).optional().openapi({
|
|
6280
6280
|
description: "Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains."
|
|
6281
6281
|
}),
|
|
6282
6282
|
session_transfer: P(V()).default({}).optional().openapi({
|
|
@@ -6285,13 +6285,13 @@ const Al = _({
|
|
|
6285
6285
|
oidc_logout: P(V()).default({}).optional().openapi({
|
|
6286
6286
|
description: "Configuration for OIDC backchannel logout"
|
|
6287
6287
|
}),
|
|
6288
|
-
grant_types:
|
|
6288
|
+
grant_types: N(a()).default([]).optional().openapi({
|
|
6289
6289
|
description: "List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code."
|
|
6290
6290
|
}),
|
|
6291
6291
|
jwt_configuration: P(V()).default({}).optional().openapi({
|
|
6292
6292
|
description: "Configuration related to JWTs for the client."
|
|
6293
6293
|
}),
|
|
6294
|
-
signing_keys:
|
|
6294
|
+
signing_keys: N(P(V())).default([]).optional().openapi({
|
|
6295
6295
|
description: "Signing certificates associated with this client."
|
|
6296
6296
|
}),
|
|
6297
6297
|
encryption_key: P(V()).default({}).optional().openapi({
|
|
@@ -6438,7 +6438,7 @@ const Il = _({
|
|
|
6438
6438
|
audience: a().min(1).openapi({
|
|
6439
6439
|
description: "The audience (API identifier) of this client grant."
|
|
6440
6440
|
}),
|
|
6441
|
-
scope:
|
|
6441
|
+
scope: N(a()).optional().openapi({
|
|
6442
6442
|
description: "Scopes allowed for this client grant."
|
|
6443
6443
|
}),
|
|
6444
6444
|
organization_usage: b(["deny", "allow", "require"]).optional().openapi({
|
|
@@ -6453,7 +6453,7 @@ const Il = _({
|
|
|
6453
6453
|
subject_type: b(["client", "user"]).optional().openapi({
|
|
6454
6454
|
description: "The type of application access the client grant allows. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement."
|
|
6455
6455
|
}),
|
|
6456
|
-
authorization_details_types:
|
|
6456
|
+
authorization_details_types: N(a()).optional().openapi({
|
|
6457
6457
|
description: "Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement."
|
|
6458
6458
|
})
|
|
6459
6459
|
}), Cl = _({
|
|
@@ -6464,7 +6464,7 @@ const Il = _({
|
|
|
6464
6464
|
created_at: a().optional(),
|
|
6465
6465
|
updated_at: a().optional()
|
|
6466
6466
|
});
|
|
6467
|
-
|
|
6467
|
+
N(Cl);
|
|
6468
6468
|
const xs = b(["iat", "rat"]), Dl = _({
|
|
6469
6469
|
id: a(),
|
|
6470
6470
|
token_hash: a(),
|
|
@@ -6481,7 +6481,7 @@ _({
|
|
|
6481
6481
|
revoked_at: a().optional(),
|
|
6482
6482
|
...Dl.shape
|
|
6483
6483
|
});
|
|
6484
|
-
const
|
|
6484
|
+
const Dt = _({
|
|
6485
6485
|
x: x(),
|
|
6486
6486
|
y: x()
|
|
6487
6487
|
});
|
|
@@ -6491,11 +6491,11 @@ const bn = _({
|
|
|
6491
6491
|
category: wt(Os),
|
|
6492
6492
|
type: wt(ks)
|
|
6493
6493
|
}), Ll = bn.extend({
|
|
6494
|
-
category:
|
|
6494
|
+
category: I(
|
|
6495
6495
|
"BLOCK"
|
|
6496
6496
|
/* BLOCK */
|
|
6497
6497
|
),
|
|
6498
|
-
type:
|
|
6498
|
+
type: I(
|
|
6499
6499
|
"RICH_TEXT"
|
|
6500
6500
|
/* RICH_TEXT */
|
|
6501
6501
|
),
|
|
@@ -6503,20 +6503,20 @@ const bn = _({
|
|
|
6503
6503
|
content: a()
|
|
6504
6504
|
}).passthrough()
|
|
6505
6505
|
}), Rl = bn.extend({
|
|
6506
|
-
category:
|
|
6506
|
+
category: I(
|
|
6507
6507
|
"BLOCK"
|
|
6508
6508
|
/* BLOCK */
|
|
6509
6509
|
),
|
|
6510
6510
|
type: Pe([
|
|
6511
|
-
|
|
6511
|
+
I(
|
|
6512
6512
|
"NEXT_BUTTON"
|
|
6513
6513
|
/* NEXT_BUTTON */
|
|
6514
6514
|
),
|
|
6515
|
-
|
|
6515
|
+
I(
|
|
6516
6516
|
"BACK_BUTTON"
|
|
6517
6517
|
/* BACK_BUTTON */
|
|
6518
6518
|
),
|
|
6519
|
-
|
|
6519
|
+
I(
|
|
6520
6520
|
"SUBMIT_BUTTON"
|
|
6521
6521
|
/* SUBMIT_BUTTON */
|
|
6522
6522
|
)
|
|
@@ -6525,11 +6525,11 @@ const bn = _({
|
|
|
6525
6525
|
text: a()
|
|
6526
6526
|
}).passthrough()
|
|
6527
6527
|
}), Ul = bn.extend({
|
|
6528
|
-
category:
|
|
6528
|
+
category: I(
|
|
6529
6529
|
"FIELD"
|
|
6530
6530
|
/* FIELD */
|
|
6531
6531
|
),
|
|
6532
|
-
type:
|
|
6532
|
+
type: I(
|
|
6533
6533
|
"LEGAL"
|
|
6534
6534
|
/* LEGAL */
|
|
6535
6535
|
),
|
|
@@ -6539,48 +6539,48 @@ const bn = _({
|
|
|
6539
6539
|
text: a()
|
|
6540
6540
|
}).passthrough()
|
|
6541
6541
|
}), zl = bn.extend({
|
|
6542
|
-
category:
|
|
6542
|
+
category: I(
|
|
6543
6543
|
"FIELD"
|
|
6544
6544
|
/* FIELD */
|
|
6545
6545
|
),
|
|
6546
6546
|
type: Pe([
|
|
6547
|
-
|
|
6547
|
+
I(
|
|
6548
6548
|
"TEXT"
|
|
6549
6549
|
/* TEXT */
|
|
6550
6550
|
),
|
|
6551
|
-
|
|
6551
|
+
I(
|
|
6552
6552
|
"EMAIL"
|
|
6553
6553
|
/* EMAIL */
|
|
6554
6554
|
),
|
|
6555
|
-
|
|
6555
|
+
I(
|
|
6556
6556
|
"PASSWORD"
|
|
6557
6557
|
/* PASSWORD */
|
|
6558
6558
|
),
|
|
6559
|
-
|
|
6559
|
+
I(
|
|
6560
6560
|
"NUMBER"
|
|
6561
6561
|
/* NUMBER */
|
|
6562
6562
|
),
|
|
6563
|
-
|
|
6563
|
+
I(
|
|
6564
6564
|
"PHONE"
|
|
6565
6565
|
/* PHONE */
|
|
6566
6566
|
),
|
|
6567
|
-
|
|
6567
|
+
I(
|
|
6568
6568
|
"DATE"
|
|
6569
6569
|
/* DATE */
|
|
6570
6570
|
),
|
|
6571
|
-
|
|
6571
|
+
I(
|
|
6572
6572
|
"CHECKBOX"
|
|
6573
6573
|
/* CHECKBOX */
|
|
6574
6574
|
),
|
|
6575
|
-
|
|
6575
|
+
I(
|
|
6576
6576
|
"RADIO"
|
|
6577
6577
|
/* RADIO */
|
|
6578
6578
|
),
|
|
6579
|
-
|
|
6579
|
+
I(
|
|
6580
6580
|
"SELECT"
|
|
6581
6581
|
/* SELECT */
|
|
6582
6582
|
),
|
|
6583
|
-
|
|
6583
|
+
I(
|
|
6584
6584
|
"HIDDEN"
|
|
6585
6585
|
/* HIDDEN */
|
|
6586
6586
|
)
|
|
@@ -6603,23 +6603,23 @@ const bn = _({
|
|
|
6603
6603
|
Fl
|
|
6604
6604
|
]), ql = _({
|
|
6605
6605
|
id: a(),
|
|
6606
|
-
type:
|
|
6606
|
+
type: I(
|
|
6607
6607
|
"STEP"
|
|
6608
6608
|
/* STEP */
|
|
6609
6609
|
),
|
|
6610
|
-
coordinates:
|
|
6610
|
+
coordinates: Dt,
|
|
6611
6611
|
alias: a().optional(),
|
|
6612
6612
|
config: _({
|
|
6613
|
-
components:
|
|
6613
|
+
components: N(Pl),
|
|
6614
6614
|
next_node: a()
|
|
6615
6615
|
}).passthrough()
|
|
6616
6616
|
}), Ml = _({
|
|
6617
6617
|
id: a(),
|
|
6618
|
-
type:
|
|
6618
|
+
type: I(
|
|
6619
6619
|
"FLOW"
|
|
6620
6620
|
/* FLOW */
|
|
6621
6621
|
),
|
|
6622
|
-
coordinates:
|
|
6622
|
+
coordinates: Dt,
|
|
6623
6623
|
alias: a().optional(),
|
|
6624
6624
|
config: _({
|
|
6625
6625
|
flow_id: a(),
|
|
@@ -6627,11 +6627,11 @@ const bn = _({
|
|
|
6627
6627
|
})
|
|
6628
6628
|
}), Bl = _({
|
|
6629
6629
|
id: a(),
|
|
6630
|
-
type:
|
|
6630
|
+
type: I(
|
|
6631
6631
|
"ACTION"
|
|
6632
6632
|
/* ACTION */
|
|
6633
6633
|
),
|
|
6634
|
-
coordinates:
|
|
6634
|
+
coordinates: Dt,
|
|
6635
6635
|
alias: a().optional(),
|
|
6636
6636
|
config: _({
|
|
6637
6637
|
action_type: b(["REDIRECT"]).openapi({
|
|
@@ -6650,7 +6650,7 @@ const bn = _({
|
|
|
6650
6650
|
}), $l = _({
|
|
6651
6651
|
id: a(),
|
|
6652
6652
|
type: a(),
|
|
6653
|
-
coordinates:
|
|
6653
|
+
coordinates: Dt
|
|
6654
6654
|
}).passthrough(), jl = Pe([
|
|
6655
6655
|
ql,
|
|
6656
6656
|
Ml,
|
|
@@ -6658,17 +6658,17 @@ const bn = _({
|
|
|
6658
6658
|
$l
|
|
6659
6659
|
]), Vl = _({
|
|
6660
6660
|
next_node: a(),
|
|
6661
|
-
coordinates:
|
|
6661
|
+
coordinates: Dt
|
|
6662
6662
|
}).passthrough(), Zl = _({
|
|
6663
6663
|
resume_flow: h().optional(),
|
|
6664
|
-
coordinates:
|
|
6664
|
+
coordinates: Dt
|
|
6665
6665
|
}).passthrough(), Hl = _({
|
|
6666
6666
|
id: a(),
|
|
6667
6667
|
name: a(),
|
|
6668
6668
|
languages: _({
|
|
6669
6669
|
primary: a()
|
|
6670
6670
|
}).passthrough(),
|
|
6671
|
-
nodes:
|
|
6671
|
+
nodes: N(jl),
|
|
6672
6672
|
start: Vl,
|
|
6673
6673
|
ending: Zl,
|
|
6674
6674
|
created_at: a(),
|
|
@@ -6689,7 +6689,7 @@ const Ii = Pe([
|
|
|
6689
6689
|
_({
|
|
6690
6690
|
essential: h().optional(),
|
|
6691
6691
|
value: ze().optional(),
|
|
6692
|
-
values:
|
|
6692
|
+
values: N(ze()).optional()
|
|
6693
6693
|
})
|
|
6694
6694
|
]).nullable(), Kl = _({
|
|
6695
6695
|
userinfo: P(a(), Ii).optional(),
|
|
@@ -6821,7 +6821,7 @@ const Wl = _({
|
|
|
6821
6821
|
twilio_token: a().optional(),
|
|
6822
6822
|
icon_url: a().optional(),
|
|
6823
6823
|
// Email domains that route to this connection via Home Realm Discovery
|
|
6824
|
-
domain_aliases:
|
|
6824
|
+
domain_aliases: N(a()).optional(),
|
|
6825
6825
|
// Per-connection redirect_uri sent to the upstream IdP. When unset, the
|
|
6826
6826
|
// strategy falls back to the legacy `${authUrl}callback`. Lets operators
|
|
6827
6827
|
// migrate connections to a new callback path (e.g. `/login/callback`)
|
|
@@ -6842,7 +6842,7 @@ const Wl = _({
|
|
|
6842
6842
|
}).optional(),
|
|
6843
6843
|
password_dictionary: _({
|
|
6844
6844
|
enable: h().optional(),
|
|
6845
|
-
dictionary:
|
|
6845
|
+
dictionary: N(a()).optional()
|
|
6846
6846
|
}).optional(),
|
|
6847
6847
|
// Disable signup for this connection
|
|
6848
6848
|
disable_signup: h().optional(),
|
|
@@ -6957,7 +6957,7 @@ const Xl = _({
|
|
|
6957
6957
|
(n) => n === null ? {} : di(n),
|
|
6958
6958
|
Wl
|
|
6959
6959
|
).default({}),
|
|
6960
|
-
enabled_clients:
|
|
6960
|
+
enabled_clients: N(a()).default([]).optional(),
|
|
6961
6961
|
response_type: li().optional(),
|
|
6962
6962
|
response_mode: li().optional(),
|
|
6963
6963
|
is_domain_connection: h().optional(),
|
|
@@ -6984,14 +6984,14 @@ const Yl = _({
|
|
|
6984
6984
|
"null"
|
|
6985
6985
|
]).optional(),
|
|
6986
6986
|
domain_metadata: P(a().max(255)).optional()
|
|
6987
|
-
}), ed =
|
|
6987
|
+
}), ed = Ct("name", [
|
|
6988
6988
|
_({
|
|
6989
|
-
name:
|
|
6989
|
+
name: I("txt"),
|
|
6990
6990
|
record: a(),
|
|
6991
6991
|
domain: a()
|
|
6992
6992
|
}),
|
|
6993
6993
|
_({
|
|
6994
|
-
name:
|
|
6994
|
+
name: I("http"),
|
|
6995
6995
|
http_body: a(),
|
|
6996
6996
|
http_url: a()
|
|
6997
6997
|
})
|
|
@@ -7002,31 +7002,31 @@ const Yl = _({
|
|
|
7002
7002
|
status: b(["disabled", "pending", "pending_verification", "ready"]),
|
|
7003
7003
|
origin_domain_name: a().optional(),
|
|
7004
7004
|
verification: _({
|
|
7005
|
-
methods:
|
|
7005
|
+
methods: N(ed)
|
|
7006
7006
|
}).optional(),
|
|
7007
7007
|
tls_policy: a().optional()
|
|
7008
7008
|
});
|
|
7009
7009
|
td.extend({
|
|
7010
7010
|
tenant_id: a()
|
|
7011
7011
|
});
|
|
7012
|
-
const
|
|
7012
|
+
const Ni = _({
|
|
7013
7013
|
id: a(),
|
|
7014
7014
|
order: x().optional(),
|
|
7015
7015
|
visible: h().optional().default(!0)
|
|
7016
|
-
}), ht =
|
|
7017
|
-
category:
|
|
7016
|
+
}), ht = Ni.extend({
|
|
7017
|
+
category: I("BLOCK").optional()
|
|
7018
7018
|
}), nd = ht.extend({
|
|
7019
|
-
type:
|
|
7019
|
+
type: I("DIVIDER"),
|
|
7020
7020
|
config: _({
|
|
7021
7021
|
text: a().optional()
|
|
7022
7022
|
}).optional()
|
|
7023
7023
|
}), id = ht.extend({
|
|
7024
|
-
type:
|
|
7024
|
+
type: I("HTML"),
|
|
7025
7025
|
config: _({
|
|
7026
7026
|
content: a().optional()
|
|
7027
7027
|
}).optional()
|
|
7028
7028
|
}), od = ht.extend({
|
|
7029
|
-
type:
|
|
7029
|
+
type: I("IMAGE"),
|
|
7030
7030
|
config: _({
|
|
7031
7031
|
src: a().optional(),
|
|
7032
7032
|
alt: a().optional(),
|
|
@@ -7034,58 +7034,58 @@ const Si = _({
|
|
|
7034
7034
|
height: x().optional()
|
|
7035
7035
|
}).optional()
|
|
7036
7036
|
}), ad = ht.extend({
|
|
7037
|
-
type:
|
|
7037
|
+
type: I("JUMP_BUTTON"),
|
|
7038
7038
|
config: _({
|
|
7039
7039
|
text: a().optional(),
|
|
7040
7040
|
target_step: a().optional()
|
|
7041
7041
|
})
|
|
7042
7042
|
}), sd = ht.extend({
|
|
7043
|
-
type:
|
|
7043
|
+
type: I("RESEND_BUTTON"),
|
|
7044
7044
|
config: _({
|
|
7045
7045
|
text: a().optional(),
|
|
7046
7046
|
resend_action: a().optional()
|
|
7047
7047
|
})
|
|
7048
7048
|
}), rd = ht.extend({
|
|
7049
|
-
type:
|
|
7049
|
+
type: I("NEXT_BUTTON"),
|
|
7050
7050
|
config: _({
|
|
7051
7051
|
text: a().optional()
|
|
7052
7052
|
})
|
|
7053
7053
|
}), ld = ht.extend({
|
|
7054
|
-
type:
|
|
7054
|
+
type: I("PREVIOUS_BUTTON"),
|
|
7055
7055
|
config: _({
|
|
7056
7056
|
text: a().optional()
|
|
7057
7057
|
})
|
|
7058
7058
|
}), dd = ht.extend({
|
|
7059
|
-
type:
|
|
7059
|
+
type: I("RICH_TEXT"),
|
|
7060
7060
|
config: _({
|
|
7061
7061
|
content: a().optional()
|
|
7062
7062
|
}).optional()
|
|
7063
|
-
}), bi =
|
|
7064
|
-
category:
|
|
7063
|
+
}), bi = Ni.extend({
|
|
7064
|
+
category: I("WIDGET").optional(),
|
|
7065
7065
|
label: a().min(1).optional(),
|
|
7066
7066
|
hint: a().min(1).max(500).optional(),
|
|
7067
7067
|
required: h().optional(),
|
|
7068
7068
|
sensitive: h().optional()
|
|
7069
7069
|
}), cd = bi.extend({
|
|
7070
|
-
type:
|
|
7070
|
+
type: I("AUTH0_VERIFIABLE_CREDENTIALS"),
|
|
7071
7071
|
config: _({
|
|
7072
7072
|
credential_type: a().optional()
|
|
7073
7073
|
})
|
|
7074
7074
|
}), _d = bi.extend({
|
|
7075
|
-
type:
|
|
7075
|
+
type: I("GMAPS_ADDRESS"),
|
|
7076
7076
|
config: _({
|
|
7077
7077
|
api_key: a().optional()
|
|
7078
7078
|
})
|
|
7079
7079
|
}), ud = bi.extend({
|
|
7080
|
-
type:
|
|
7080
|
+
type: I("RECAPTCHA"),
|
|
7081
7081
|
config: _({
|
|
7082
7082
|
site_key: a().optional()
|
|
7083
7083
|
})
|
|
7084
|
-
}), be =
|
|
7085
|
-
category:
|
|
7084
|
+
}), be = Ni.extend({
|
|
7085
|
+
category: I("FIELD").optional(),
|
|
7086
7086
|
label: a().min(1).optional(),
|
|
7087
7087
|
hint: a().min(1).max(500).optional(),
|
|
7088
|
-
messages:
|
|
7088
|
+
messages: N(
|
|
7089
7089
|
_({
|
|
7090
7090
|
id: x().optional(),
|
|
7091
7091
|
text: a(),
|
|
@@ -7095,14 +7095,14 @@ const Si = _({
|
|
|
7095
7095
|
required: h().optional(),
|
|
7096
7096
|
sensitive: h().optional()
|
|
7097
7097
|
}), pd = be.extend({
|
|
7098
|
-
type:
|
|
7098
|
+
type: I("BOOLEAN"),
|
|
7099
7099
|
config: _({
|
|
7100
7100
|
default_value: h().optional()
|
|
7101
7101
|
}).optional()
|
|
7102
7102
|
}), fd = be.extend({
|
|
7103
|
-
type:
|
|
7103
|
+
type: I("CARDS"),
|
|
7104
7104
|
config: _({
|
|
7105
|
-
options:
|
|
7105
|
+
options: N(
|
|
7106
7106
|
_({
|
|
7107
7107
|
value: a(),
|
|
7108
7108
|
label: a(),
|
|
@@ -7113,9 +7113,9 @@ const Si = _({
|
|
|
7113
7113
|
multi_select: h().optional()
|
|
7114
7114
|
}).optional()
|
|
7115
7115
|
}), hd = be.extend({
|
|
7116
|
-
type:
|
|
7116
|
+
type: I("CHOICE"),
|
|
7117
7117
|
config: _({
|
|
7118
|
-
options:
|
|
7118
|
+
options: N(
|
|
7119
7119
|
_({
|
|
7120
7120
|
value: a(),
|
|
7121
7121
|
label: a()
|
|
@@ -7123,10 +7123,10 @@ const Si = _({
|
|
|
7123
7123
|
).optional(),
|
|
7124
7124
|
display: b(["radio", "checkbox"]).optional(),
|
|
7125
7125
|
multiple: h().optional(),
|
|
7126
|
-
default_value: Pe([a(),
|
|
7126
|
+
default_value: Pe([a(), N(a())]).optional()
|
|
7127
7127
|
}).optional()
|
|
7128
7128
|
}), gd = be.extend({
|
|
7129
|
-
type:
|
|
7129
|
+
type: I("CUSTOM"),
|
|
7130
7130
|
config: _({
|
|
7131
7131
|
component: a().optional(),
|
|
7132
7132
|
props: P(V()).optional(),
|
|
@@ -7134,7 +7134,7 @@ const Si = _({
|
|
|
7134
7134
|
code: a().optional()
|
|
7135
7135
|
})
|
|
7136
7136
|
}), md = be.extend({
|
|
7137
|
-
type:
|
|
7137
|
+
type: I("DATE"),
|
|
7138
7138
|
config: _({
|
|
7139
7139
|
format: a().optional(),
|
|
7140
7140
|
min: a().optional(),
|
|
@@ -7142,9 +7142,9 @@ const Si = _({
|
|
|
7142
7142
|
default_value: a().optional()
|
|
7143
7143
|
}).optional()
|
|
7144
7144
|
}), yd = be.extend({
|
|
7145
|
-
type:
|
|
7145
|
+
type: I("DROPDOWN"),
|
|
7146
7146
|
config: _({
|
|
7147
|
-
options:
|
|
7147
|
+
options: N(
|
|
7148
7148
|
_({
|
|
7149
7149
|
value: a(),
|
|
7150
7150
|
label: a()
|
|
@@ -7153,29 +7153,29 @@ const Si = _({
|
|
|
7153
7153
|
placeholder: a().optional(),
|
|
7154
7154
|
searchable: h().optional(),
|
|
7155
7155
|
multiple: h().optional(),
|
|
7156
|
-
default_value: Pe([a(),
|
|
7156
|
+
default_value: Pe([a(), N(a())]).optional()
|
|
7157
7157
|
}).optional()
|
|
7158
7158
|
}), vd = be.extend({
|
|
7159
|
-
type:
|
|
7159
|
+
type: I("EMAIL"),
|
|
7160
7160
|
config: _({
|
|
7161
7161
|
placeholder: a().optional(),
|
|
7162
7162
|
default_value: a().optional()
|
|
7163
7163
|
}).optional()
|
|
7164
7164
|
}), wd = be.extend({
|
|
7165
|
-
type:
|
|
7165
|
+
type: I("FILE"),
|
|
7166
7166
|
config: _({
|
|
7167
7167
|
accept: a().optional(),
|
|
7168
7168
|
max_size: x().optional(),
|
|
7169
7169
|
multiple: h().optional()
|
|
7170
7170
|
}).optional()
|
|
7171
|
-
}),
|
|
7172
|
-
type:
|
|
7171
|
+
}), Sd = be.extend({
|
|
7172
|
+
type: I("LEGAL"),
|
|
7173
7173
|
config: _({
|
|
7174
7174
|
text: a(),
|
|
7175
7175
|
html: h().optional()
|
|
7176
7176
|
}).optional()
|
|
7177
|
-
}),
|
|
7178
|
-
type:
|
|
7177
|
+
}), Nd = be.extend({
|
|
7178
|
+
type: I("NUMBER"),
|
|
7179
7179
|
config: _({
|
|
7180
7180
|
placeholder: a().optional(),
|
|
7181
7181
|
min: x().optional(),
|
|
@@ -7184,7 +7184,7 @@ const Si = _({
|
|
|
7184
7184
|
default_value: a().optional()
|
|
7185
7185
|
}).optional()
|
|
7186
7186
|
}), bd = be.extend({
|
|
7187
|
-
type:
|
|
7187
|
+
type: I("PASSWORD"),
|
|
7188
7188
|
config: _({
|
|
7189
7189
|
placeholder: a().optional(),
|
|
7190
7190
|
min_length: x().optional(),
|
|
@@ -7193,17 +7193,17 @@ const Si = _({
|
|
|
7193
7193
|
default_value: a().optional()
|
|
7194
7194
|
}).optional()
|
|
7195
7195
|
}), Ed = be.extend({
|
|
7196
|
-
type:
|
|
7196
|
+
type: I("PAYMENT"),
|
|
7197
7197
|
config: _({
|
|
7198
7198
|
provider: a().optional(),
|
|
7199
7199
|
currency: a().optional()
|
|
7200
7200
|
}).optional()
|
|
7201
7201
|
}), xd = be.extend({
|
|
7202
|
-
type:
|
|
7202
|
+
type: I("SOCIAL"),
|
|
7203
7203
|
config: _({
|
|
7204
|
-
providers:
|
|
7204
|
+
providers: N(a()).optional(),
|
|
7205
7205
|
// Extended provider info with icons and display names
|
|
7206
|
-
provider_details:
|
|
7206
|
+
provider_details: N(
|
|
7207
7207
|
_({
|
|
7208
7208
|
name: a(),
|
|
7209
7209
|
strategy: a().optional(),
|
|
@@ -7214,7 +7214,7 @@ const Si = _({
|
|
|
7214
7214
|
).optional()
|
|
7215
7215
|
}).optional()
|
|
7216
7216
|
}), kd = be.extend({
|
|
7217
|
-
type:
|
|
7217
|
+
type: I("TEL"),
|
|
7218
7218
|
config: _({
|
|
7219
7219
|
placeholder: a().optional(),
|
|
7220
7220
|
default_country: a().optional(),
|
|
@@ -7222,7 +7222,7 @@ const Si = _({
|
|
|
7222
7222
|
allow_email: h().optional()
|
|
7223
7223
|
}).optional()
|
|
7224
7224
|
}), Od = be.extend({
|
|
7225
|
-
type:
|
|
7225
|
+
type: I("TEXT"),
|
|
7226
7226
|
config: _({
|
|
7227
7227
|
placeholder: a().optional(),
|
|
7228
7228
|
multiline: h().optional(),
|
|
@@ -7230,18 +7230,18 @@ const Si = _({
|
|
|
7230
7230
|
default_value: a().optional()
|
|
7231
7231
|
}).optional()
|
|
7232
7232
|
}), Td = be.extend({
|
|
7233
|
-
type:
|
|
7233
|
+
type: I("COUNTRY"),
|
|
7234
7234
|
config: _({
|
|
7235
7235
|
placeholder: a().optional(),
|
|
7236
7236
|
default_value: a().optional()
|
|
7237
7237
|
}).optional()
|
|
7238
7238
|
}), Ad = be.extend({
|
|
7239
|
-
type:
|
|
7239
|
+
type: I("URL"),
|
|
7240
7240
|
config: _({
|
|
7241
7241
|
placeholder: a().optional(),
|
|
7242
7242
|
default_value: a().optional()
|
|
7243
7243
|
}).optional()
|
|
7244
|
-
}), Id =
|
|
7244
|
+
}), Id = Ct("type", [
|
|
7245
7245
|
nd,
|
|
7246
7246
|
id,
|
|
7247
7247
|
od,
|
|
@@ -7250,11 +7250,11 @@ const Si = _({
|
|
|
7250
7250
|
rd,
|
|
7251
7251
|
ld,
|
|
7252
7252
|
dd
|
|
7253
|
-
]), Cd =
|
|
7253
|
+
]), Cd = Ct("type", [
|
|
7254
7254
|
cd,
|
|
7255
7255
|
_d,
|
|
7256
7256
|
ud
|
|
7257
|
-
]), Dd =
|
|
7257
|
+
]), Dd = Ct("type", [
|
|
7258
7258
|
pd,
|
|
7259
7259
|
fd,
|
|
7260
7260
|
hd,
|
|
@@ -7264,8 +7264,8 @@ const Si = _({
|
|
|
7264
7264
|
yd,
|
|
7265
7265
|
vd,
|
|
7266
7266
|
wd,
|
|
7267
|
-
Nd,
|
|
7268
7267
|
Sd,
|
|
7268
|
+
Nd,
|
|
7269
7269
|
bd,
|
|
7270
7270
|
Ed,
|
|
7271
7271
|
xd,
|
|
@@ -7279,7 +7279,7 @@ const Si = _({
|
|
|
7279
7279
|
]);
|
|
7280
7280
|
_({
|
|
7281
7281
|
id: a(),
|
|
7282
|
-
type:
|
|
7282
|
+
type: I("submit"),
|
|
7283
7283
|
label: a(),
|
|
7284
7284
|
className: a().optional(),
|
|
7285
7285
|
disabled: h().optional().default(!1),
|
|
@@ -7292,7 +7292,7 @@ const Yt = _({
|
|
|
7292
7292
|
y: x()
|
|
7293
7293
|
}), Ld = _({
|
|
7294
7294
|
id: a(),
|
|
7295
|
-
type:
|
|
7295
|
+
type: I("FLOW"),
|
|
7296
7296
|
coordinates: Yt,
|
|
7297
7297
|
alias: a().min(1).max(150).optional(),
|
|
7298
7298
|
config: _({
|
|
@@ -7301,11 +7301,11 @@ const Yt = _({
|
|
|
7301
7301
|
})
|
|
7302
7302
|
}), Rd = _({
|
|
7303
7303
|
id: a(),
|
|
7304
|
-
type:
|
|
7304
|
+
type: I("ROUTER"),
|
|
7305
7305
|
coordinates: Yt,
|
|
7306
7306
|
alias: a().min(1).max(150),
|
|
7307
7307
|
config: _({
|
|
7308
|
-
rules:
|
|
7308
|
+
rules: N(
|
|
7309
7309
|
_({
|
|
7310
7310
|
id: a(),
|
|
7311
7311
|
alias: a().min(1).max(150).optional(),
|
|
@@ -7317,14 +7317,14 @@ const Yt = _({
|
|
|
7317
7317
|
})
|
|
7318
7318
|
}), Ud = _({
|
|
7319
7319
|
id: a(),
|
|
7320
|
-
type:
|
|
7320
|
+
type: I("STEP"),
|
|
7321
7321
|
coordinates: Yt,
|
|
7322
7322
|
alias: a().min(1).max(150).optional(),
|
|
7323
7323
|
config: _({
|
|
7324
|
-
components:
|
|
7324
|
+
components: N(Cs),
|
|
7325
7325
|
next_node: a().optional()
|
|
7326
7326
|
})
|
|
7327
|
-
}), zd =
|
|
7327
|
+
}), zd = Ct("type", [
|
|
7328
7328
|
Ld,
|
|
7329
7329
|
Rd,
|
|
7330
7330
|
Ud
|
|
@@ -7341,9 +7341,9 @@ const Yt = _({
|
|
|
7341
7341
|
default: a().optional()
|
|
7342
7342
|
}).optional(),
|
|
7343
7343
|
translations: P(a(), V()).optional(),
|
|
7344
|
-
nodes:
|
|
7344
|
+
nodes: N(zd).optional(),
|
|
7345
7345
|
start: _({
|
|
7346
|
-
hidden_fields:
|
|
7346
|
+
hidden_fields: N(_({ key: a(), value: a() })).optional(),
|
|
7347
7347
|
next_node: a().optional(),
|
|
7348
7348
|
coordinates: Yt.optional()
|
|
7349
7349
|
}).optional(),
|
|
@@ -7386,9 +7386,9 @@ _({
|
|
|
7386
7386
|
method: b(["POST", "GET"]),
|
|
7387
7387
|
title: a().optional(),
|
|
7388
7388
|
description: a().optional(),
|
|
7389
|
-
components:
|
|
7390
|
-
messages:
|
|
7391
|
-
links:
|
|
7389
|
+
components: N(Cs),
|
|
7390
|
+
messages: N(Pd).optional(),
|
|
7391
|
+
links: N(qd).optional(),
|
|
7392
7392
|
/** Footer HTML content displayed at the very bottom of the widget (e.g., terms and conditions) */
|
|
7393
7393
|
footer: a().optional()
|
|
7394
7394
|
});
|
|
@@ -7516,7 +7516,7 @@ const Qd = _({
|
|
|
7516
7516
|
app_metadata: P(V()).default({}).optional(),
|
|
7517
7517
|
user_metadata: P(V()).default({}).optional(),
|
|
7518
7518
|
ttl_sec: x().int().max(2592e3).default(604800).optional(),
|
|
7519
|
-
roles:
|
|
7519
|
+
roles: N(a()).default([]).optional(),
|
|
7520
7520
|
send_invitation_email: h().default(!0).optional()
|
|
7521
7521
|
});
|
|
7522
7522
|
_({
|
|
@@ -7549,25 +7549,25 @@ const Xd = _({
|
|
|
7549
7549
|
x: a().optional(),
|
|
7550
7550
|
y: a().optional(),
|
|
7551
7551
|
x5t: a().optional(),
|
|
7552
|
-
x5c:
|
|
7552
|
+
x5c: N(a()).optional()
|
|
7553
7553
|
}).superRefine((n, e) => {
|
|
7554
7554
|
if (n.kty === "RSA")
|
|
7555
7555
|
for (const t of ["n", "e"])
|
|
7556
7556
|
n[t] || e.addIssue({
|
|
7557
|
-
code:
|
|
7557
|
+
code: S.custom,
|
|
7558
7558
|
path: [t],
|
|
7559
7559
|
message: `RSA JWK is missing required member '${t}'`
|
|
7560
7560
|
});
|
|
7561
7561
|
else if (n.kty === "EC")
|
|
7562
7562
|
for (const t of ["crv", "x", "y"])
|
|
7563
7563
|
n[t] || e.addIssue({
|
|
7564
|
-
code:
|
|
7564
|
+
code: S.custom,
|
|
7565
7565
|
path: [t],
|
|
7566
7566
|
message: `EC JWK is missing required member '${t}'`
|
|
7567
7567
|
});
|
|
7568
7568
|
});
|
|
7569
7569
|
_({
|
|
7570
|
-
keys:
|
|
7570
|
+
keys: N(Xd)
|
|
7571
7571
|
});
|
|
7572
7572
|
_({
|
|
7573
7573
|
issuer: a(),
|
|
@@ -7578,20 +7578,20 @@ _({
|
|
|
7578
7578
|
registration_endpoint: a().optional(),
|
|
7579
7579
|
revocation_endpoint: a(),
|
|
7580
7580
|
end_session_endpoint: a().optional(),
|
|
7581
|
-
scopes_supported:
|
|
7582
|
-
response_types_supported:
|
|
7583
|
-
grant_types_supported:
|
|
7584
|
-
code_challenge_methods_supported:
|
|
7585
|
-
response_modes_supported:
|
|
7586
|
-
subject_types_supported:
|
|
7587
|
-
id_token_signing_alg_values_supported:
|
|
7588
|
-
token_endpoint_auth_methods_supported:
|
|
7589
|
-
claims_supported:
|
|
7581
|
+
scopes_supported: N(a()),
|
|
7582
|
+
response_types_supported: N(a()),
|
|
7583
|
+
grant_types_supported: N(a()).optional(),
|
|
7584
|
+
code_challenge_methods_supported: N(a()),
|
|
7585
|
+
response_modes_supported: N(a()),
|
|
7586
|
+
subject_types_supported: N(a()),
|
|
7587
|
+
id_token_signing_alg_values_supported: N(a()),
|
|
7588
|
+
token_endpoint_auth_methods_supported: N(a()),
|
|
7589
|
+
claims_supported: N(a()),
|
|
7590
7590
|
request_uri_parameter_supported: h(),
|
|
7591
7591
|
request_parameter_supported: h(),
|
|
7592
7592
|
claims_parameter_supported: h().optional(),
|
|
7593
|
-
request_object_signing_alg_values_supported:
|
|
7594
|
-
token_endpoint_auth_signing_alg_values_supported:
|
|
7593
|
+
request_object_signing_alg_values_supported: N(a()).optional(),
|
|
7594
|
+
token_endpoint_auth_signing_alg_values_supported: N(a())
|
|
7595
7595
|
});
|
|
7596
7596
|
var Fs = /* @__PURE__ */ ((n) => (n.PENDING = "pending", n.AUTHENTICATED = "authenticated", n.AWAITING_EMAIL_VERIFICATION = "awaiting_email_verification", n.AWAITING_MFA = "awaiting_mfa", n.AWAITING_HOOK = "awaiting_hook", n.AWAITING_CONTINUATION = "awaiting_continuation", n.COMPLETED = "completed", n.FAILED = "failed", n.EXPIRED = "expired", n))(Fs || {});
|
|
7597
7597
|
const Yd = wt(Fs), ec = _({
|
|
@@ -7788,6 +7788,8 @@ const nc = {
|
|
|
7788
7788
|
SUCCESS_LOGOUT: "slo",
|
|
7789
7789
|
SUCCESS_HOOK: "sh",
|
|
7790
7790
|
// Custom AuthHero-specific
|
|
7791
|
+
SUCCESS_PASSWORD_MIGRATION: "spm",
|
|
7792
|
+
// Custom AuthHero-specific: upstream password successfully imported
|
|
7791
7793
|
SUCCESS_REVOCATION: "srrt",
|
|
7792
7794
|
SUCCESS_SIGNUP: "ss",
|
|
7793
7795
|
FAILED_SS_SSO_OPERATION: "ss_sso_failure",
|
|
@@ -7865,7 +7867,7 @@ const rc = b([
|
|
|
7865
7867
|
type: rc,
|
|
7866
7868
|
status: Ps.optional(),
|
|
7867
7869
|
sink: P(a(), ze()),
|
|
7868
|
-
filters:
|
|
7870
|
+
filters: N(lc).optional(),
|
|
7869
7871
|
isPriority: h().optional()
|
|
7870
7872
|
});
|
|
7871
7873
|
dc.extend({
|
|
@@ -7900,27 +7902,27 @@ _({
|
|
|
7900
7902
|
}).extend(uc.shape);
|
|
7901
7903
|
const pc = _({
|
|
7902
7904
|
enabled: h().optional(),
|
|
7903
|
-
shields:
|
|
7904
|
-
admin_notification_frequency:
|
|
7905
|
+
shields: N(a()).optional(),
|
|
7906
|
+
admin_notification_frequency: N(a()).optional(),
|
|
7905
7907
|
method: a().optional(),
|
|
7906
7908
|
stage: _({
|
|
7907
7909
|
"pre-user-registration": _({
|
|
7908
|
-
shields:
|
|
7910
|
+
shields: N(a()).optional()
|
|
7909
7911
|
}).optional(),
|
|
7910
7912
|
"pre-change-password": _({
|
|
7911
|
-
shields:
|
|
7913
|
+
shields: N(a()).optional()
|
|
7912
7914
|
}).optional()
|
|
7913
7915
|
}).optional()
|
|
7914
7916
|
}), fc = _({
|
|
7915
7917
|
enabled: h().optional(),
|
|
7916
|
-
shields:
|
|
7917
|
-
allowlist:
|
|
7918
|
+
shields: N(a()).optional(),
|
|
7919
|
+
allowlist: N(a()).optional(),
|
|
7918
7920
|
mode: a().optional(),
|
|
7919
7921
|
max_attempts: x().optional()
|
|
7920
7922
|
}), hc = _({
|
|
7921
7923
|
enabled: h().optional(),
|
|
7922
|
-
shields:
|
|
7923
|
-
allowlist:
|
|
7924
|
+
shields: N(a()).optional(),
|
|
7925
|
+
allowlist: N(a()).optional(),
|
|
7924
7926
|
stage: _({
|
|
7925
7927
|
"pre-login": _({
|
|
7926
7928
|
max_attempts: x().optional(),
|
|
@@ -7965,7 +7967,7 @@ const qs = _({
|
|
|
7965
7967
|
device: qs.describe(
|
|
7966
7968
|
"Metadata related to the device used in the session"
|
|
7967
7969
|
),
|
|
7968
|
-
clients:
|
|
7970
|
+
clients: N(a()).describe("List of client details for the session")
|
|
7969
7971
|
});
|
|
7970
7972
|
_({
|
|
7971
7973
|
created_at: a(),
|
|
@@ -8024,7 +8026,7 @@ const vc = _({
|
|
|
8024
8026
|
mode: b(["persistent", "non-persistent"]).optional()
|
|
8025
8027
|
}).optional(),
|
|
8026
8028
|
// Logout settings
|
|
8027
|
-
allowed_logout_urls:
|
|
8029
|
+
allowed_logout_urls: N(a()).optional(),
|
|
8028
8030
|
// Universal Login settings
|
|
8029
8031
|
default_redirection_uri: a().optional(),
|
|
8030
8032
|
// Anchor client used for tenant-level flows that aren't tied to a specific
|
|
@@ -8033,7 +8035,7 @@ const vc = _({
|
|
|
8033
8035
|
// "Default App" / Global Client.
|
|
8034
8036
|
default_client_id: a().optional(),
|
|
8035
8037
|
// Advanced settings
|
|
8036
|
-
enabled_locales:
|
|
8038
|
+
enabled_locales: N(a()).optional(),
|
|
8037
8039
|
default_directory: a().optional(),
|
|
8038
8040
|
error_page: _({
|
|
8039
8041
|
html: a().optional(),
|
|
@@ -8063,11 +8065,11 @@ const vc = _({
|
|
|
8063
8065
|
// and relies on tenant ACLs/rate limits; we implement RFC 7591 initial
|
|
8064
8066
|
// access tokens and a per-tenant grant-type allowlist.
|
|
8065
8067
|
dcr_require_initial_access_token: h().optional(),
|
|
8066
|
-
dcr_allowed_grant_types:
|
|
8068
|
+
dcr_allowed_grant_types: N(a()).optional(),
|
|
8067
8069
|
// Per-tenant allowlist of fully-qualified http origins (scheme + host
|
|
8068
8070
|
// + port, no path) that may be used as `return_to` / `domain` on
|
|
8069
8071
|
// `/connect/start` despite not being loopback. Off by default.
|
|
8070
|
-
allow_http_return_to:
|
|
8072
|
+
allow_http_return_to: N(
|
|
8071
8073
|
a().refine(
|
|
8072
8074
|
(n) => {
|
|
8073
8075
|
try {
|
|
@@ -8105,7 +8107,7 @@ const vc = _({
|
|
|
8105
8107
|
// Sandbox settings
|
|
8106
8108
|
sandbox_version: a().optional(),
|
|
8107
8109
|
legacy_sandbox_version: a().optional(),
|
|
8108
|
-
sandbox_versions_available:
|
|
8110
|
+
sandbox_versions_available: N(a()).optional(),
|
|
8109
8111
|
// Change password settings
|
|
8110
8112
|
change_password: _({
|
|
8111
8113
|
enabled: h().optional(),
|
|
@@ -8147,7 +8149,7 @@ const vc = _({
|
|
|
8147
8149
|
// MFA settings
|
|
8148
8150
|
customize_mfa_in_postlogin_action: h().optional(),
|
|
8149
8151
|
// ACR values
|
|
8150
|
-
acr_values_supported:
|
|
8152
|
+
acr_values_supported: N(a()).optional(),
|
|
8151
8153
|
// mTLS settings
|
|
8152
8154
|
mtls: _({
|
|
8153
8155
|
enable_endpoint_aliases: h().optional()
|
|
@@ -8193,7 +8195,12 @@ _({
|
|
|
8193
8195
|
created_at: a().nullable().transform((n) => n ?? ""),
|
|
8194
8196
|
updated_at: a().nullable().transform((n) => n ?? ""),
|
|
8195
8197
|
...vc.shape,
|
|
8196
|
-
id: a()
|
|
8198
|
+
id: a(),
|
|
8199
|
+
// Computed server-side: true when this tenant is the deployment's control
|
|
8200
|
+
// plane (either `multiTenancyConfig.controlPlaneTenantId` matches the
|
|
8201
|
+
// tenant id, or no multi-tenancy config is set — i.e. single-tenant
|
|
8202
|
+
// deployment). Not persisted; ignored on writes.
|
|
8203
|
+
is_control_plane: h().optional()
|
|
8197
8204
|
});
|
|
8198
8205
|
_({
|
|
8199
8206
|
access_token: a(),
|
|
@@ -8218,7 +8225,7 @@ const wc = _({
|
|
|
8218
8225
|
show_widget_shadow: h(),
|
|
8219
8226
|
widget_border_weight: x(),
|
|
8220
8227
|
widget_corner_radius: x()
|
|
8221
|
-
}),
|
|
8228
|
+
}), Sc = _({
|
|
8222
8229
|
base_focus_color: a(),
|
|
8223
8230
|
base_hover_color: a(),
|
|
8224
8231
|
body_text: a(),
|
|
@@ -8241,7 +8248,7 @@ const wc = _({
|
|
|
8241
8248
|
}), bt = _({
|
|
8242
8249
|
bold: h(),
|
|
8243
8250
|
size: x()
|
|
8244
|
-
}),
|
|
8251
|
+
}), Nc = _({
|
|
8245
8252
|
body_text: bt,
|
|
8246
8253
|
buttons_text: bt,
|
|
8247
8254
|
font_url: a(),
|
|
@@ -8272,9 +8279,9 @@ const wc = _({
|
|
|
8272
8279
|
social_buttons_layout: b(["bottom", "top"])
|
|
8273
8280
|
}), xc = _({
|
|
8274
8281
|
borders: wc,
|
|
8275
|
-
colors:
|
|
8282
|
+
colors: Sc,
|
|
8276
8283
|
displayName: a(),
|
|
8277
|
-
fonts:
|
|
8284
|
+
fonts: Nc,
|
|
8278
8285
|
page_background: bc,
|
|
8279
8286
|
widget: Ec
|
|
8280
8287
|
});
|
|
@@ -8313,7 +8320,7 @@ _({
|
|
|
8313
8320
|
body: a(),
|
|
8314
8321
|
from: a(),
|
|
8315
8322
|
subject: a(),
|
|
8316
|
-
syntax:
|
|
8323
|
+
syntax: I("liquid").default("liquid"),
|
|
8317
8324
|
resultUrl: a().optional(),
|
|
8318
8325
|
urlLifetimeInSeconds: x().int().nonnegative().optional(),
|
|
8319
8326
|
includeEmailInRedirect: h().default(!1),
|
|
@@ -8333,7 +8340,7 @@ const Oc = _({
|
|
|
8333
8340
|
// When the token was last used.
|
|
8334
8341
|
last_exchanged_at: a().optional(),
|
|
8335
8342
|
device: qs,
|
|
8336
|
-
resource_servers:
|
|
8343
|
+
resource_servers: N(
|
|
8337
8344
|
_({
|
|
8338
8345
|
audience: a(),
|
|
8339
8346
|
scopes: a()
|
|
@@ -8387,7 +8394,7 @@ const Tc = _({
|
|
|
8387
8394
|
id: a().optional(),
|
|
8388
8395
|
name: a(),
|
|
8389
8396
|
identifier: a(),
|
|
8390
|
-
scopes:
|
|
8397
|
+
scopes: N(Tc).optional(),
|
|
8391
8398
|
signing_alg: a().optional(),
|
|
8392
8399
|
signing_secret: a().optional(),
|
|
8393
8400
|
token_lifetime: x().default(86400),
|
|
@@ -8403,7 +8410,7 @@ const Tc = _({
|
|
|
8403
8410
|
created_at: a().optional(),
|
|
8404
8411
|
updated_at: a().optional()
|
|
8405
8412
|
});
|
|
8406
|
-
|
|
8413
|
+
N(Cc);
|
|
8407
8414
|
const Dc = _({
|
|
8408
8415
|
role_id: a(),
|
|
8409
8416
|
resource_server_identifier: a(),
|
|
@@ -8412,7 +8419,7 @@ const Dc = _({
|
|
|
8412
8419
|
...Dc.shape,
|
|
8413
8420
|
created_at: a()
|
|
8414
8421
|
});
|
|
8415
|
-
|
|
8422
|
+
N(Lc);
|
|
8416
8423
|
const Rc = _({
|
|
8417
8424
|
user_id: a(),
|
|
8418
8425
|
resource_server_identifier: a(),
|
|
@@ -8423,7 +8430,7 @@ const Rc = _({
|
|
|
8423
8430
|
tenant_id: a(),
|
|
8424
8431
|
created_at: a().optional()
|
|
8425
8432
|
});
|
|
8426
|
-
|
|
8433
|
+
N(Uc);
|
|
8427
8434
|
const zc = _({
|
|
8428
8435
|
user_id: a(),
|
|
8429
8436
|
resource_server_identifier: a(),
|
|
@@ -8433,7 +8440,7 @@ const zc = _({
|
|
|
8433
8440
|
created_at: a().optional(),
|
|
8434
8441
|
organization_id: a().optional()
|
|
8435
8442
|
});
|
|
8436
|
-
|
|
8443
|
+
N(
|
|
8437
8444
|
zc
|
|
8438
8445
|
);
|
|
8439
8446
|
const Fc = _({
|
|
@@ -8445,7 +8452,7 @@ const Fc = _({
|
|
|
8445
8452
|
tenant_id: a(),
|
|
8446
8453
|
created_at: a().optional()
|
|
8447
8454
|
});
|
|
8448
|
-
|
|
8455
|
+
N(Pc);
|
|
8449
8456
|
const qc = _({
|
|
8450
8457
|
id: a().optional().openapi({
|
|
8451
8458
|
description: "The unique identifier of the role. If not provided, one will be generated."
|
|
@@ -8467,7 +8474,7 @@ const qc = _({
|
|
|
8467
8474
|
created_at: a().optional(),
|
|
8468
8475
|
updated_at: a().optional()
|
|
8469
8476
|
});
|
|
8470
|
-
|
|
8477
|
+
N(Mc);
|
|
8471
8478
|
const Bc = _({
|
|
8472
8479
|
logo_url: a().optional().openapi({
|
|
8473
8480
|
description: "URL of the organization's logo"
|
|
@@ -8519,7 +8526,7 @@ const Bc = _({
|
|
|
8519
8526
|
metadata: P(V()).default({}).optional().openapi({
|
|
8520
8527
|
description: "Custom metadata for the organization"
|
|
8521
8528
|
}),
|
|
8522
|
-
enabled_connections:
|
|
8529
|
+
enabled_connections: N($c).default([]).optional().openapi({
|
|
8523
8530
|
description: "List of enabled connections for the organization"
|
|
8524
8531
|
}),
|
|
8525
8532
|
token_quota: jc
|
|
@@ -8550,7 +8557,7 @@ const Zc = _({
|
|
|
8550
8557
|
created_at: a().optional(),
|
|
8551
8558
|
updated_at: a().optional()
|
|
8552
8559
|
});
|
|
8553
|
-
|
|
8560
|
+
N(
|
|
8554
8561
|
Hc
|
|
8555
8562
|
);
|
|
8556
8563
|
const Kc = _({
|
|
@@ -8578,7 +8585,7 @@ _({
|
|
|
8578
8585
|
// Universal Login settings
|
|
8579
8586
|
default_redirection_uri: a().optional(),
|
|
8580
8587
|
// Advanced settings
|
|
8581
|
-
enabled_locales:
|
|
8588
|
+
enabled_locales: N(a()).optional(),
|
|
8582
8589
|
default_directory: a().optional(),
|
|
8583
8590
|
error_page: _({
|
|
8584
8591
|
html: a().optional(),
|
|
@@ -8616,7 +8623,7 @@ _({
|
|
|
8616
8623
|
support_url: a().optional(),
|
|
8617
8624
|
// Sandbox settings
|
|
8618
8625
|
sandbox_version: a().optional(),
|
|
8619
|
-
sandbox_versions_available:
|
|
8626
|
+
sandbox_versions_available: N(a()).optional(),
|
|
8620
8627
|
// Change password settings
|
|
8621
8628
|
change_password: _({
|
|
8622
8629
|
enabled: h(),
|
|
@@ -8727,8 +8734,8 @@ const Jc = _({
|
|
|
8727
8734
|
bytes_read: x().optional()
|
|
8728
8735
|
});
|
|
8729
8736
|
_({
|
|
8730
|
-
meta:
|
|
8731
|
-
data:
|
|
8737
|
+
meta: N(Jc),
|
|
8738
|
+
data: N(P(a(), V())),
|
|
8732
8739
|
rows: x(),
|
|
8733
8740
|
rows_before_limit_at_least: x().optional(),
|
|
8734
8741
|
statistics: Qc.optional()
|
|
@@ -8794,26 +8801,26 @@ const Xc = b([
|
|
|
8794
8801
|
public_key: a().optional(),
|
|
8795
8802
|
sign_count: x().int().nonnegative().optional(),
|
|
8796
8803
|
credential_backed_up: h().optional(),
|
|
8797
|
-
transports:
|
|
8804
|
+
transports: N(a()).optional(),
|
|
8798
8805
|
friendly_name: a().optional(),
|
|
8799
8806
|
// Common
|
|
8800
8807
|
confirmed: h().default(!1)
|
|
8801
8808
|
});
|
|
8802
8809
|
function Bs(n, e) {
|
|
8803
8810
|
n.type === "phone" && !n.phone_number && e.addIssue({
|
|
8804
|
-
code:
|
|
8811
|
+
code: S.custom,
|
|
8805
8812
|
message: "phone_number is required when type is 'phone'",
|
|
8806
8813
|
path: ["phone_number"]
|
|
8807
8814
|
}), n.type === "totp" && !n.totp_secret && e.addIssue({
|
|
8808
|
-
code:
|
|
8815
|
+
code: S.custom,
|
|
8809
8816
|
message: "totp_secret is required when type is 'totp'",
|
|
8810
8817
|
path: ["totp_secret"]
|
|
8811
8818
|
}), ["webauthn-roaming", "webauthn-platform", "passkey"].includes(n.type) && (n.credential_id || e.addIssue({
|
|
8812
|
-
code:
|
|
8819
|
+
code: S.custom,
|
|
8813
8820
|
message: `credential_id is required when type is '${n.type}'`,
|
|
8814
8821
|
path: ["credential_id"]
|
|
8815
8822
|
}), n.public_key || e.addIssue({
|
|
8816
|
-
code:
|
|
8823
|
+
code: S.custom,
|
|
8817
8824
|
message: `public_key is required when type is '${n.type}'`,
|
|
8818
8825
|
path: ["public_key"]
|
|
8819
8826
|
}));
|
|
@@ -8861,7 +8868,7 @@ function t_(n) {
|
|
|
8861
8868
|
return {
|
|
8862
8869
|
async create(e, t) {
|
|
8863
8870
|
const i = Date.now();
|
|
8864
|
-
return await n.insert(
|
|
8871
|
+
return await n.insert(X).values({
|
|
8865
8872
|
id: t.id,
|
|
8866
8873
|
tenant_id: e,
|
|
8867
8874
|
token_hash: t.token_hash,
|
|
@@ -8885,63 +8892,63 @@ function t_(n) {
|
|
|
8885
8892
|
};
|
|
8886
8893
|
},
|
|
8887
8894
|
async get(e, t) {
|
|
8888
|
-
const i = await n.select().from(
|
|
8895
|
+
const i = await n.select().from(X).where(
|
|
8889
8896
|
g(
|
|
8890
|
-
c(
|
|
8891
|
-
c(
|
|
8897
|
+
c(X.tenant_id, e),
|
|
8898
|
+
c(X.id, t)
|
|
8892
8899
|
)
|
|
8893
8900
|
).get();
|
|
8894
8901
|
return i ? zn(i) : null;
|
|
8895
8902
|
},
|
|
8896
8903
|
async getByHash(e, t) {
|
|
8897
|
-
const i = await n.select().from(
|
|
8904
|
+
const i = await n.select().from(X).where(
|
|
8898
8905
|
g(
|
|
8899
|
-
c(
|
|
8900
|
-
c(
|
|
8906
|
+
c(X.tenant_id, e),
|
|
8907
|
+
c(X.token_hash, t)
|
|
8901
8908
|
)
|
|
8902
8909
|
).get();
|
|
8903
8910
|
return i ? zn(i) : null;
|
|
8904
8911
|
},
|
|
8905
8912
|
async listByClient(e, t) {
|
|
8906
|
-
return (await n.select().from(
|
|
8913
|
+
return (await n.select().from(X).where(
|
|
8907
8914
|
g(
|
|
8908
|
-
c(
|
|
8909
|
-
c(
|
|
8915
|
+
c(X.tenant_id, e),
|
|
8916
|
+
c(X.client_id, t)
|
|
8910
8917
|
)
|
|
8911
|
-
).orderBy(se(
|
|
8918
|
+
).orderBy(se(X.created_at_ts))).map(zn);
|
|
8912
8919
|
},
|
|
8913
8920
|
async markUsed(e, t, i) {
|
|
8914
|
-
return (await n.update(
|
|
8921
|
+
return (await n.update(X).set({ used_at_ts: an(i) }).where(
|
|
8915
8922
|
g(
|
|
8916
|
-
c(
|
|
8917
|
-
c(
|
|
8918
|
-
Ce(
|
|
8923
|
+
c(X.tenant_id, e),
|
|
8924
|
+
c(X.id, t),
|
|
8925
|
+
Ce(X.used_at_ts)
|
|
8919
8926
|
)
|
|
8920
8927
|
).returning()).length > 0;
|
|
8921
8928
|
},
|
|
8922
8929
|
async revoke(e, t, i) {
|
|
8923
|
-
return (await n.update(
|
|
8930
|
+
return (await n.update(X).set({ revoked_at_ts: an(i) }).where(
|
|
8924
8931
|
g(
|
|
8925
|
-
c(
|
|
8926
|
-
c(
|
|
8927
|
-
Ce(
|
|
8932
|
+
c(X.tenant_id, e),
|
|
8933
|
+
c(X.id, t),
|
|
8934
|
+
Ce(X.revoked_at_ts)
|
|
8928
8935
|
)
|
|
8929
8936
|
).returning()).length > 0;
|
|
8930
8937
|
},
|
|
8931
8938
|
async revokeByClient(e, t, i) {
|
|
8932
|
-
return (await n.update(
|
|
8939
|
+
return (await n.update(X).set({ revoked_at_ts: an(i) }).where(
|
|
8933
8940
|
g(
|
|
8934
|
-
c(
|
|
8935
|
-
c(
|
|
8936
|
-
Ce(
|
|
8941
|
+
c(X.tenant_id, e),
|
|
8942
|
+
c(X.client_id, t),
|
|
8943
|
+
Ce(X.revoked_at_ts)
|
|
8937
8944
|
)
|
|
8938
8945
|
).returning()).length;
|
|
8939
8946
|
},
|
|
8940
8947
|
async remove(e, t) {
|
|
8941
|
-
return (await n.delete(
|
|
8948
|
+
return (await n.delete(X).where(
|
|
8942
8949
|
g(
|
|
8943
|
-
c(
|
|
8944
|
-
c(
|
|
8950
|
+
c(X.tenant_id, e),
|
|
8951
|
+
c(X.id, t)
|
|
8945
8952
|
)
|
|
8946
8953
|
).returning()).length > 0;
|
|
8947
8954
|
}
|
|
@@ -9082,7 +9089,7 @@ function o_(n) {
|
|
|
9082
9089
|
} = t || {};
|
|
9083
9090
|
let u = c(pe.tenant_id, e);
|
|
9084
9091
|
if (d) {
|
|
9085
|
-
const E =
|
|
9092
|
+
const E = We(pe, d, ["name"]);
|
|
9086
9093
|
E && (u = g(u, E));
|
|
9087
9094
|
}
|
|
9088
9095
|
let f = n.select().from(pe).where(u).$dynamic();
|
|
@@ -9184,11 +9191,11 @@ function a_(n) {
|
|
|
9184
9191
|
function s_(n) {
|
|
9185
9192
|
return {
|
|
9186
9193
|
async get(e, t, i) {
|
|
9187
|
-
const o = await n.select().from(
|
|
9194
|
+
const o = await n.select().from(Ne).where(
|
|
9188
9195
|
g(
|
|
9189
|
-
c(
|
|
9190
|
-
c(
|
|
9191
|
-
c(
|
|
9196
|
+
c(Ne.tenant_id, e),
|
|
9197
|
+
c(Ne.prompt, t),
|
|
9198
|
+
c(Ne.language, i)
|
|
9192
9199
|
)
|
|
9193
9200
|
).get();
|
|
9194
9201
|
if (!o) return null;
|
|
@@ -9200,7 +9207,7 @@ function s_(n) {
|
|
|
9200
9207
|
},
|
|
9201
9208
|
async set(e, t, i, o) {
|
|
9202
9209
|
const s = Date.now(), l = JSON.stringify(o);
|
|
9203
|
-
await n.insert(
|
|
9210
|
+
await n.insert(Ne).values({
|
|
9204
9211
|
tenant_id: e,
|
|
9205
9212
|
prompt: t,
|
|
9206
9213
|
language: i,
|
|
@@ -9209,27 +9216,27 @@ function s_(n) {
|
|
|
9209
9216
|
updated_at_ts: s
|
|
9210
9217
|
}).onConflictDoUpdate({
|
|
9211
9218
|
target: [
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
|
|
9219
|
+
Ne.tenant_id,
|
|
9220
|
+
Ne.prompt,
|
|
9221
|
+
Ne.language
|
|
9215
9222
|
],
|
|
9216
9223
|
set: { custom_text: l, updated_at_ts: s }
|
|
9217
9224
|
});
|
|
9218
9225
|
},
|
|
9219
9226
|
async delete(e, t, i) {
|
|
9220
|
-
await n.delete(
|
|
9227
|
+
await n.delete(Ne).where(
|
|
9221
9228
|
g(
|
|
9222
|
-
c(
|
|
9223
|
-
c(
|
|
9224
|
-
c(
|
|
9229
|
+
c(Ne.tenant_id, e),
|
|
9230
|
+
c(Ne.prompt, t),
|
|
9231
|
+
c(Ne.language, i)
|
|
9225
9232
|
)
|
|
9226
9233
|
);
|
|
9227
9234
|
},
|
|
9228
9235
|
async list(e) {
|
|
9229
9236
|
return await n.select({
|
|
9230
|
-
prompt:
|
|
9231
|
-
language:
|
|
9232
|
-
}).from(
|
|
9237
|
+
prompt: Ne.prompt,
|
|
9238
|
+
language: Ne.language
|
|
9239
|
+
}).from(Ne).where(c(Ne.tenant_id, e)).all();
|
|
9233
9240
|
}
|
|
9234
9241
|
};
|
|
9235
9242
|
}
|
|
@@ -9390,9 +9397,9 @@ function d_(n) {
|
|
|
9390
9397
|
));
|
|
9391
9398
|
}
|
|
9392
9399
|
const f = (await d.offset(i * o).limit(o)).map((m) => {
|
|
9393
|
-
const { tenant_id: y, actions: E, ...
|
|
9400
|
+
const { tenant_id: y, actions: E, ...T } = m;
|
|
9394
9401
|
return Q({
|
|
9395
|
-
...
|
|
9402
|
+
...T,
|
|
9396
9403
|
actions: F(E, [])
|
|
9397
9404
|
});
|
|
9398
9405
|
});
|
|
@@ -9468,10 +9475,10 @@ function c_(n) {
|
|
|
9468
9475
|
));
|
|
9469
9476
|
}
|
|
9470
9477
|
const f = (await d.offset(i * o).limit(o)).map((m) => {
|
|
9471
|
-
const { tenant_id: y, ...E } = m,
|
|
9478
|
+
const { tenant_id: y, ...E } = m, T = { ...E };
|
|
9472
9479
|
for (const G of rn)
|
|
9473
|
-
|
|
9474
|
-
return Q(
|
|
9480
|
+
T[G] = F(E[G]);
|
|
9481
|
+
return Q(T);
|
|
9475
9482
|
});
|
|
9476
9483
|
if (!s)
|
|
9477
9484
|
return { forms: f };
|
|
@@ -9503,7 +9510,7 @@ function $s(n) {
|
|
|
9503
9510
|
function ci(n, e = (/* @__PURE__ */ new Date(0)).toISOString()) {
|
|
9504
9511
|
return $s(n) ?? e;
|
|
9505
9512
|
}
|
|
9506
|
-
function
|
|
9513
|
+
function ne(n) {
|
|
9507
9514
|
if (!n || n === "")
|
|
9508
9515
|
return null;
|
|
9509
9516
|
const e = new Date(n);
|
|
@@ -9627,7 +9634,7 @@ function g_(n) {
|
|
|
9627
9634
|
include_totals: s = !1,
|
|
9628
9635
|
sort: l,
|
|
9629
9636
|
q: d
|
|
9630
|
-
} = t || {}, u = d ?
|
|
9637
|
+
} = t || {}, u = d ? We(me, d, [
|
|
9631
9638
|
"url",
|
|
9632
9639
|
"form_id",
|
|
9633
9640
|
"template_id",
|
|
@@ -9641,12 +9648,12 @@ function g_(n) {
|
|
|
9641
9648
|
const E = (await p.offset(i * o).limit(o)).map(qn);
|
|
9642
9649
|
if (!s)
|
|
9643
9650
|
return { hooks: E };
|
|
9644
|
-
const [
|
|
9651
|
+
const [T] = await n.select({ count: ge() }).from(me).where(f);
|
|
9645
9652
|
return {
|
|
9646
9653
|
hooks: E,
|
|
9647
9654
|
start: i * o,
|
|
9648
9655
|
limit: o,
|
|
9649
|
-
length: Number((
|
|
9656
|
+
length: Number((T == null ? void 0 : T.count) ?? 0)
|
|
9650
9657
|
};
|
|
9651
9658
|
},
|
|
9652
9659
|
async remove(e, t) {
|
|
@@ -9814,7 +9821,7 @@ function Li(n) {
|
|
|
9814
9821
|
state_data: F(s)
|
|
9815
9822
|
});
|
|
9816
9823
|
}
|
|
9817
|
-
function
|
|
9824
|
+
function S_(n) {
|
|
9818
9825
|
return {
|
|
9819
9826
|
async create(e, t) {
|
|
9820
9827
|
var l, d;
|
|
@@ -9838,12 +9845,12 @@ function N_(n) {
|
|
|
9838
9845
|
authenticated_at: t.authenticated_at,
|
|
9839
9846
|
created_at_ts: i,
|
|
9840
9847
|
updated_at_ts: i,
|
|
9841
|
-
expires_at_ts: t.expires_at ?
|
|
9848
|
+
expires_at_ts: t.expires_at ? ne(t.expires_at) : i + 1e3 * 60 * 60 * 24
|
|
9842
9849
|
};
|
|
9843
|
-
return await n.insert(
|
|
9850
|
+
return await n.insert(Y).values(s), Li({ ...s, tenant_id: e });
|
|
9844
9851
|
},
|
|
9845
9852
|
async get(e, t) {
|
|
9846
|
-
const i = e ? g(c(
|
|
9853
|
+
const i = e ? g(c(Y.tenant_id, e), c(Y.id, t)) : c(Y.id, t), o = await n.select().from(Y).where(i).get();
|
|
9847
9854
|
return o ? Li(o) : null;
|
|
9848
9855
|
},
|
|
9849
9856
|
async update(e, t, i) {
|
|
@@ -9854,11 +9861,11 @@ function N_(n) {
|
|
|
9854
9861
|
if (i.session_id !== void 0 && (o.session_id = i.session_id), i.state !== void 0 && (o.state = i.state), i.state_data !== void 0 && (o.state_data = JSON.stringify(i.state_data)), i.failure_reason !== void 0 && (o.failure_reason = i.failure_reason), i.user_id !== void 0 && (o.user_id = i.user_id), i.auth_connection !== void 0 && (o.auth_connection = i.auth_connection), i.auth_strategy !== void 0 && (o.auth_strategy_strategy = (s = i.auth_strategy) == null ? void 0 : s.strategy, o.auth_strategy_strategy_type = (l = i.auth_strategy) == null ? void 0 : l.strategy_type), i.authenticated_at !== void 0 && (o.authenticated_at = i.authenticated_at), i.authorization_url !== void 0 && (o.authorization_url = (d = i.authorization_url) == null ? void 0 : d.substring(
|
|
9855
9862
|
0,
|
|
9856
9863
|
1024
|
|
9857
|
-
)), i.expires_at !== void 0 && (o.expires_at_ts =
|
|
9858
|
-
const u = await n.select({ auth_params:
|
|
9864
|
+
)), i.expires_at !== void 0 && (o.expires_at_ts = ne(i.expires_at)), i.authParams !== void 0) {
|
|
9865
|
+
const u = await n.select({ auth_params: Y.auth_params }).from(Y).where(
|
|
9859
9866
|
g(
|
|
9860
|
-
c(
|
|
9861
|
-
c(
|
|
9867
|
+
c(Y.tenant_id, e),
|
|
9868
|
+
c(Y.id, t)
|
|
9862
9869
|
)
|
|
9863
9870
|
).get(), f = u != null && u.auth_params && typeof u.auth_params == "string" && u.auth_params.length > 0 ? JSON.parse(u.auth_params) : {};
|
|
9864
9871
|
o.auth_params = JSON.stringify({
|
|
@@ -9866,13 +9873,13 @@ function N_(n) {
|
|
|
9866
9873
|
...i.authParams
|
|
9867
9874
|
});
|
|
9868
9875
|
}
|
|
9869
|
-
return await n.update(
|
|
9870
|
-
g(c(
|
|
9876
|
+
return await n.update(Y).set(o).where(
|
|
9877
|
+
g(c(Y.tenant_id, e), c(Y.id, t))
|
|
9871
9878
|
), !0;
|
|
9872
9879
|
},
|
|
9873
9880
|
async remove(e, t) {
|
|
9874
|
-
return (await n.delete(
|
|
9875
|
-
g(c(
|
|
9881
|
+
return (await n.delete(Y).where(
|
|
9882
|
+
g(c(Y.tenant_id, e), c(Y.id, t))
|
|
9876
9883
|
).returning()).length > 0;
|
|
9877
9884
|
}
|
|
9878
9885
|
};
|
|
@@ -9907,7 +9914,7 @@ function $n(n) {
|
|
|
9907
9914
|
continent_code: p
|
|
9908
9915
|
})), Q(E);
|
|
9909
9916
|
}
|
|
9910
|
-
function
|
|
9917
|
+
function N_(n) {
|
|
9911
9918
|
return {
|
|
9912
9919
|
async create(e, t) {
|
|
9913
9920
|
var s, l;
|
|
@@ -9942,34 +9949,48 @@ function S_(n) {
|
|
|
9942
9949
|
per_page: o = 50,
|
|
9943
9950
|
include_totals: s = !1,
|
|
9944
9951
|
sort: l,
|
|
9945
|
-
q: d
|
|
9946
|
-
|
|
9947
|
-
|
|
9952
|
+
q: d,
|
|
9953
|
+
from_date: u,
|
|
9954
|
+
to_date: f
|
|
9955
|
+
} = t || {}, p = [c(z.tenant_id, e)];
|
|
9948
9956
|
if (d) {
|
|
9949
|
-
const
|
|
9957
|
+
const W = We(z, d, [
|
|
9950
9958
|
"user_id",
|
|
9951
9959
|
"ip",
|
|
9952
9960
|
"type",
|
|
9953
9961
|
"client_id"
|
|
9954
9962
|
]);
|
|
9955
|
-
|
|
9963
|
+
W && p.push(W);
|
|
9956
9964
|
}
|
|
9965
|
+
typeof u == "number" && Number.isFinite(u) && p.push(
|
|
9966
|
+
Tt(
|
|
9967
|
+
z.date,
|
|
9968
|
+
new Date(Math.floor(u) * 1e3).toISOString()
|
|
9969
|
+
)
|
|
9970
|
+
), typeof f == "number" && Number.isFinite(f) && p.push(
|
|
9971
|
+
Qe(
|
|
9972
|
+
z.date,
|
|
9973
|
+
new Date((Math.floor(f) + 1) * 1e3).toISOString()
|
|
9974
|
+
)
|
|
9975
|
+
);
|
|
9976
|
+
const m = g(...p);
|
|
9977
|
+
let y = n.select().from(z).where(m).$dynamic();
|
|
9957
9978
|
if (l != null && l.sort_by) {
|
|
9958
|
-
const
|
|
9959
|
-
|
|
9960
|
-
l.sort_order === "desc" ? se(
|
|
9979
|
+
const W = z[l.sort_by];
|
|
9980
|
+
W && (y = y.orderBy(
|
|
9981
|
+
l.sort_order === "desc" ? se(W) : he(W)
|
|
9961
9982
|
));
|
|
9962
9983
|
} else
|
|
9963
|
-
|
|
9964
|
-
const
|
|
9984
|
+
y = y.orderBy(se(z.date));
|
|
9985
|
+
const T = (await y.offset(i * o).limit(o)).map($n);
|
|
9965
9986
|
if (!s)
|
|
9966
|
-
return { logs:
|
|
9967
|
-
const [
|
|
9987
|
+
return { logs: T };
|
|
9988
|
+
const [G] = await n.select({ count: ge() }).from(z).where(m);
|
|
9968
9989
|
return {
|
|
9969
|
-
logs:
|
|
9990
|
+
logs: T,
|
|
9970
9991
|
start: i * o,
|
|
9971
9992
|
limit: o,
|
|
9972
|
-
length: Number((
|
|
9993
|
+
length: Number((G == null ? void 0 : G.count) ?? 0)
|
|
9973
9994
|
};
|
|
9974
9995
|
},
|
|
9975
9996
|
async get(e, t) {
|
|
@@ -10121,7 +10142,7 @@ function k_(n) {
|
|
|
10121
10142
|
updated_at: i
|
|
10122
10143
|
};
|
|
10123
10144
|
try {
|
|
10124
|
-
await n.insert(
|
|
10145
|
+
await n.insert(ee).values(s);
|
|
10125
10146
|
} catch (u) {
|
|
10126
10147
|
throw (l = u == null ? void 0 : u.message) != null && l.includes("UNIQUE constraint failed") || (d = u == null ? void 0 : u.message) != null && d.includes("AlreadyExists") ? new _t(409, {
|
|
10127
10148
|
message: "Organization already exists"
|
|
@@ -10130,13 +10151,13 @@ function k_(n) {
|
|
|
10130
10151
|
return Vn({ ...s, tenant_id: e });
|
|
10131
10152
|
},
|
|
10132
10153
|
async get(e, t) {
|
|
10133
|
-
let i = await n.select().from(
|
|
10134
|
-
g(c(
|
|
10154
|
+
let i = await n.select().from(ee).where(
|
|
10155
|
+
g(c(ee.tenant_id, e), c(ee.id, t))
|
|
10135
10156
|
).get();
|
|
10136
|
-
return i || (i = await n.select().from(
|
|
10157
|
+
return i || (i = await n.select().from(ee).where(
|
|
10137
10158
|
g(
|
|
10138
|
-
c(
|
|
10139
|
-
c(
|
|
10159
|
+
c(ee.tenant_id, e),
|
|
10160
|
+
c(ee.name, t)
|
|
10140
10161
|
)
|
|
10141
10162
|
).get()), i ? Vn(i) : null;
|
|
10142
10163
|
},
|
|
@@ -10146,8 +10167,8 @@ function k_(n) {
|
|
|
10146
10167
|
};
|
|
10147
10168
|
return i.name !== void 0 && (o.name = i.name), i.display_name !== void 0 && (o.display_name = i.display_name), i.branding !== void 0 && (o.branding = JSON.stringify(i.branding)), i.metadata !== void 0 && (o.metadata = JSON.stringify(i.metadata)), i.enabled_connections !== void 0 && (o.enabled_connections = JSON.stringify(
|
|
10148
10169
|
i.enabled_connections
|
|
10149
|
-
)), i.token_quota !== void 0 && (o.token_quota = JSON.stringify(i.token_quota)), (await n.update(
|
|
10150
|
-
g(c(
|
|
10170
|
+
)), i.token_quota !== void 0 && (o.token_quota = JSON.stringify(i.token_quota)), (await n.update(ee).set(o).where(
|
|
10171
|
+
g(c(ee.tenant_id, e), c(ee.id, t))
|
|
10151
10172
|
).returning()).length > 0;
|
|
10152
10173
|
},
|
|
10153
10174
|
async list(e, t) {
|
|
@@ -10158,14 +10179,14 @@ function k_(n) {
|
|
|
10158
10179
|
sort: l,
|
|
10159
10180
|
q: d
|
|
10160
10181
|
} = t || {};
|
|
10161
|
-
let u = n.select().from(
|
|
10182
|
+
let u = n.select().from(ee).where(c(ee.tenant_id, e)).$dynamic();
|
|
10162
10183
|
if (d && (u = u.where(
|
|
10163
10184
|
$e(
|
|
10164
|
-
xt(
|
|
10165
|
-
xt(
|
|
10185
|
+
xt(ee.name, `%${d}%`),
|
|
10186
|
+
xt(ee.display_name, `%${d}%`)
|
|
10166
10187
|
)
|
|
10167
10188
|
)), l != null && l.sort_by) {
|
|
10168
|
-
const E =
|
|
10189
|
+
const E = ee[l.sort_by];
|
|
10169
10190
|
E && (u = u.orderBy(
|
|
10170
10191
|
l.sort_order === "desc" ? se(E) : he(E)
|
|
10171
10192
|
));
|
|
@@ -10173,14 +10194,14 @@ function k_(n) {
|
|
|
10173
10194
|
const p = (await u.offset(i * o).limit(o)).map(Vn);
|
|
10174
10195
|
if (!s)
|
|
10175
10196
|
return { organizations: p };
|
|
10176
|
-
const m = [c(
|
|
10197
|
+
const m = [c(ee.tenant_id, e)];
|
|
10177
10198
|
d && m.push(
|
|
10178
10199
|
$e(
|
|
10179
|
-
xt(
|
|
10180
|
-
xt(
|
|
10200
|
+
xt(ee.name, `%${d}%`),
|
|
10201
|
+
xt(ee.display_name, `%${d}%`)
|
|
10181
10202
|
)
|
|
10182
10203
|
);
|
|
10183
|
-
const [y] = await n.select({ count: ge() }).from(
|
|
10204
|
+
const [y] = await n.select({ count: ge() }).from(ee).where(g(...m));
|
|
10184
10205
|
return {
|
|
10185
10206
|
organizations: p,
|
|
10186
10207
|
start: i * o,
|
|
@@ -10189,8 +10210,8 @@ function k_(n) {
|
|
|
10189
10210
|
};
|
|
10190
10211
|
},
|
|
10191
10212
|
async remove(e, t) {
|
|
10192
|
-
return (await n.delete(
|
|
10193
|
-
g(c(
|
|
10213
|
+
return (await n.delete(ee).where(
|
|
10214
|
+
g(c(ee.tenant_id, e), c(ee.id, t))
|
|
10194
10215
|
).returning()).length > 0;
|
|
10195
10216
|
}
|
|
10196
10217
|
};
|
|
@@ -10265,7 +10286,7 @@ function O_(n) {
|
|
|
10265
10286
|
function T_(n) {
|
|
10266
10287
|
return {
|
|
10267
10288
|
async get(e) {
|
|
10268
|
-
const t = await n.select().from(
|
|
10289
|
+
const t = await n.select().from(Ut).where(c(Ut.tenant_id, e)).get();
|
|
10269
10290
|
return t ? {
|
|
10270
10291
|
universal_login_experience: t.universal_login_experience,
|
|
10271
10292
|
identifier_first: !!t.identifier_first,
|
|
@@ -10279,14 +10300,14 @@ function T_(n) {
|
|
|
10279
10300
|
};
|
|
10280
10301
|
},
|
|
10281
10302
|
async set(e, t) {
|
|
10282
|
-
await n.insert(
|
|
10303
|
+
await n.insert(Ut).values({
|
|
10283
10304
|
tenant_id: e,
|
|
10284
10305
|
universal_login_experience: t.universal_login_experience,
|
|
10285
10306
|
identifier_first: t.identifier_first,
|
|
10286
10307
|
password_first: t.password_first,
|
|
10287
10308
|
webauthn_platform_first_factor: t.webauthn_platform_first_factor
|
|
10288
10309
|
}).onConflictDoUpdate({
|
|
10289
|
-
target:
|
|
10310
|
+
target: Ut.tenant_id,
|
|
10290
10311
|
set: {
|
|
10291
10312
|
universal_login_experience: t.universal_login_experience,
|
|
10292
10313
|
identifier_first: t.identifier_first,
|
|
@@ -10355,11 +10376,11 @@ function I_(n) {
|
|
|
10355
10376
|
token_hash: t.token_hash ?? null,
|
|
10356
10377
|
family_id: t.family_id ?? null,
|
|
10357
10378
|
rotated_to: t.rotated_to ?? null,
|
|
10358
|
-
rotated_at_ts:
|
|
10379
|
+
rotated_at_ts: ne(t.rotated_at),
|
|
10359
10380
|
created_at_ts: i,
|
|
10360
|
-
expires_at_ts:
|
|
10361
|
-
idle_expires_at_ts:
|
|
10362
|
-
last_exchanged_at_ts:
|
|
10381
|
+
expires_at_ts: ne(t.expires_at),
|
|
10382
|
+
idle_expires_at_ts: ne(t.idle_expires_at),
|
|
10383
|
+
last_exchanged_at_ts: ne(t.last_exchanged_at)
|
|
10363
10384
|
};
|
|
10364
10385
|
await n.run(O`BEGIN`);
|
|
10365
10386
|
try {
|
|
@@ -10368,14 +10389,14 @@ function I_(n) {
|
|
|
10368
10389
|
o.expires_at_ts,
|
|
10369
10390
|
o.idle_expires_at_ts
|
|
10370
10391
|
);
|
|
10371
|
-
s > 0 && o.login_id && await n.update(
|
|
10392
|
+
s > 0 && o.login_id && await n.update(Y).set({
|
|
10372
10393
|
expires_at_ts: s,
|
|
10373
10394
|
updated_at_ts: i
|
|
10374
10395
|
}).where(
|
|
10375
10396
|
g(
|
|
10376
|
-
c(
|
|
10377
|
-
c(
|
|
10378
|
-
|
|
10397
|
+
c(Y.tenant_id, e),
|
|
10398
|
+
c(Y.id, o.login_id),
|
|
10399
|
+
Qe(Y.expires_at_ts, s)
|
|
10379
10400
|
)
|
|
10380
10401
|
), await n.run(O`COMMIT`);
|
|
10381
10402
|
} catch (s) {
|
|
@@ -10400,18 +10421,18 @@ function I_(n) {
|
|
|
10400
10421
|
},
|
|
10401
10422
|
async update(e, t, i, o) {
|
|
10402
10423
|
const s = {};
|
|
10403
|
-
i.device !== void 0 && (s.device = JSON.stringify(i.device)), i.resource_servers !== void 0 && (s.resource_servers = JSON.stringify(i.resource_servers)), i.rotating !== void 0 && (s.rotating = i.rotating), i.token_lookup !== void 0 && (s.token_lookup = i.token_lookup), i.token_hash !== void 0 && (s.token_hash = i.token_hash), i.family_id !== void 0 && (s.family_id = i.family_id), i.rotated_to !== void 0 && (s.rotated_to = i.rotated_to), i.rotated_at !== void 0 && (s.rotated_at_ts =
|
|
10404
|
-
const l = o == null ? void 0 : o.loginSessionBump, d = l ?
|
|
10424
|
+
i.device !== void 0 && (s.device = JSON.stringify(i.device)), i.resource_servers !== void 0 && (s.resource_servers = JSON.stringify(i.resource_servers)), i.rotating !== void 0 && (s.rotating = i.rotating), i.token_lookup !== void 0 && (s.token_lookup = i.token_lookup), i.token_hash !== void 0 && (s.token_hash = i.token_hash), i.family_id !== void 0 && (s.family_id = i.family_id), i.rotated_to !== void 0 && (s.rotated_to = i.rotated_to), i.rotated_at !== void 0 && (s.rotated_at_ts = ne(i.rotated_at)), i.expires_at !== void 0 && (s.expires_at_ts = ne(i.expires_at)), i.idle_expires_at !== void 0 && (s.idle_expires_at_ts = ne(i.idle_expires_at)), i.last_exchanged_at !== void 0 && (s.last_exchanged_at_ts = ne(i.last_exchanged_at)), i.revoked_at !== void 0 && (s.revoked_at_ts = ne(i.revoked_at));
|
|
10425
|
+
const l = o == null ? void 0 : o.loginSessionBump, d = l ? ne(l.expires_at) : null, u = await n.update(J).set(s).where(
|
|
10405
10426
|
g(c(J.tenant_id, e), c(J.id, t))
|
|
10406
10427
|
).returning();
|
|
10407
|
-
return l != null && l.login_id && d && d > 0 && await n.update(
|
|
10428
|
+
return l != null && l.login_id && d && d > 0 && await n.update(Y).set({
|
|
10408
10429
|
expires_at_ts: d,
|
|
10409
10430
|
updated_at_ts: Date.now()
|
|
10410
10431
|
}).where(
|
|
10411
10432
|
g(
|
|
10412
|
-
c(
|
|
10413
|
-
c(
|
|
10414
|
-
|
|
10433
|
+
c(Y.tenant_id, e),
|
|
10434
|
+
c(Y.id, l.login_id),
|
|
10435
|
+
Qe(Y.expires_at_ts, d)
|
|
10415
10436
|
)
|
|
10416
10437
|
).catch(() => {
|
|
10417
10438
|
}), u.length > 0;
|
|
@@ -10426,7 +10447,7 @@ function I_(n) {
|
|
|
10426
10447
|
} = t || {};
|
|
10427
10448
|
let u = n.select().from(J).where(c(J.tenant_id, e)).$dynamic();
|
|
10428
10449
|
if (d) {
|
|
10429
|
-
const y =
|
|
10450
|
+
const y = We(J, d, ["user_id"]);
|
|
10430
10451
|
y && (u = u.where(
|
|
10431
10452
|
g(c(J.tenant_id, e), y)
|
|
10432
10453
|
));
|
|
@@ -10454,7 +10475,7 @@ function I_(n) {
|
|
|
10454
10475
|
).returning()).length > 0;
|
|
10455
10476
|
},
|
|
10456
10477
|
async revokeByLoginSession(e, t, i) {
|
|
10457
|
-
return (await n.update(J).set({ revoked_at_ts:
|
|
10478
|
+
return (await n.update(J).set({ revoked_at_ts: ne(i) }).where(
|
|
10458
10479
|
g(
|
|
10459
10480
|
c(J.tenant_id, e),
|
|
10460
10481
|
c(J.login_id, t),
|
|
@@ -10463,7 +10484,7 @@ function I_(n) {
|
|
|
10463
10484
|
).returning()).length;
|
|
10464
10485
|
},
|
|
10465
10486
|
async revokeFamily(e, t, i) {
|
|
10466
|
-
return (await n.update(J).set({ revoked_at_ts:
|
|
10487
|
+
return (await n.update(J).set({ revoked_at_ts: ne(i) }).where(
|
|
10467
10488
|
g(
|
|
10468
10489
|
c(J.tenant_id, e),
|
|
10469
10490
|
c(J.family_id, t),
|
|
@@ -10535,13 +10556,13 @@ function D_(n) {
|
|
|
10535
10556
|
};
|
|
10536
10557
|
for (const l of fi)
|
|
10537
10558
|
t[l] !== void 0 && (s[l] = t[l] ? 1 : 0);
|
|
10538
|
-
return s.is_system === void 0 && (s.is_system = 0), await n.insert(
|
|
10559
|
+
return s.is_system === void 0 && (s.is_system = 0), await n.insert(te).values(s), Hn({ ...s, tenant_id: e });
|
|
10539
10560
|
},
|
|
10540
10561
|
async get(e, t) {
|
|
10541
|
-
const i = await n.select().from(
|
|
10562
|
+
const i = await n.select().from(te).where(
|
|
10542
10563
|
g(
|
|
10543
|
-
c(
|
|
10544
|
-
c(
|
|
10564
|
+
c(te.tenant_id, e),
|
|
10565
|
+
c(te.id, t)
|
|
10545
10566
|
)
|
|
10546
10567
|
).get();
|
|
10547
10568
|
return i ? Hn(i) : null;
|
|
@@ -10550,13 +10571,13 @@ function D_(n) {
|
|
|
10550
10571
|
const o = {
|
|
10551
10572
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
10552
10573
|
};
|
|
10553
|
-
i.name !== void 0 && (o.name = i.name), i.identifier !== void 0 && (o.identifier = i.identifier), i.signing_alg !== void 0 && (o.signing_alg = i.signing_alg), i.signing_secret !== void 0 && (o.signing_secret = i.signing_secret), i.token_lifetime !== void 0 && (o.token_lifetime = i.token_lifetime), i.token_lifetime_for_web !== void 0 && (o.token_lifetime_for_web = i.token_lifetime_for_web), i.scopes !== void 0 && (o.scopes = JSON.stringify(i.scopes)), i.options !== void 0 && (o.options = O`json_patch(COALESCE(${
|
|
10574
|
+
i.name !== void 0 && (o.name = i.name), i.identifier !== void 0 && (o.identifier = i.identifier), i.signing_alg !== void 0 && (o.signing_alg = i.signing_alg), i.signing_secret !== void 0 && (o.signing_secret = i.signing_secret), i.token_lifetime !== void 0 && (o.token_lifetime = i.token_lifetime), i.token_lifetime_for_web !== void 0 && (o.token_lifetime_for_web = i.token_lifetime_for_web), i.scopes !== void 0 && (o.scopes = JSON.stringify(i.scopes)), i.options !== void 0 && (o.options = O`json_patch(COALESCE(${te.options}, '{}'), ${JSON.stringify(i.options)})`), i.metadata !== void 0 && (o.metadata = JSON.stringify(i.metadata)), i.verificationKey !== void 0 && (o.verification_key = i.verificationKey);
|
|
10554
10575
|
for (const l of fi)
|
|
10555
10576
|
i[l] !== void 0 && (o[l] = i[l] ? 1 : 0);
|
|
10556
|
-
return (await n.update(
|
|
10577
|
+
return (await n.update(te).set(o).where(
|
|
10557
10578
|
g(
|
|
10558
|
-
c(
|
|
10559
|
-
c(
|
|
10579
|
+
c(te.tenant_id, e),
|
|
10580
|
+
c(te.id, t)
|
|
10560
10581
|
)
|
|
10561
10582
|
).returning()).length > 0;
|
|
10562
10583
|
},
|
|
@@ -10570,20 +10591,20 @@ function D_(n) {
|
|
|
10570
10591
|
} = t || {}, u = Math.max(0, Math.floor(Number(i) || 0)), f = Math.min(
|
|
10571
10592
|
Math.max(1, Math.floor(Number(o) || 50)),
|
|
10572
10593
|
500
|
|
10573
|
-
), p = [c(
|
|
10594
|
+
), p = [c(te.tenant_id, e)];
|
|
10574
10595
|
if (d) {
|
|
10575
10596
|
const G = d.match(/^([^:]+):(.+)$/);
|
|
10576
10597
|
if (G) {
|
|
10577
|
-
const [,
|
|
10578
|
-
if (
|
|
10579
|
-
const Ee =
|
|
10598
|
+
const [, W, ie] = G, qe = W == null ? void 0 : W.startsWith("-"), Se = qe ? W == null ? void 0 : W.substring(1) : W;
|
|
10599
|
+
if (Se && Ri.has(Se) && !qe) {
|
|
10600
|
+
const Ee = te[Se];
|
|
10580
10601
|
p.push(xt(Ee, `%${ie}%`));
|
|
10581
10602
|
}
|
|
10582
10603
|
}
|
|
10583
10604
|
}
|
|
10584
|
-
let m = n.select().from(
|
|
10605
|
+
let m = n.select().from(te).where(g(...p)).$dynamic();
|
|
10585
10606
|
if (l != null && l.sort_by && Ri.has(l.sort_by)) {
|
|
10586
|
-
const G =
|
|
10607
|
+
const G = te[l.sort_by];
|
|
10587
10608
|
m = m.orderBy(
|
|
10588
10609
|
l.sort_order === "desc" ? se(G) : he(G)
|
|
10589
10610
|
);
|
|
@@ -10591,19 +10612,19 @@ function D_(n) {
|
|
|
10591
10612
|
const E = (await m.offset(u * f).limit(f)).map(Hn);
|
|
10592
10613
|
if (!s)
|
|
10593
10614
|
return { resource_servers: E };
|
|
10594
|
-
const [
|
|
10615
|
+
const [T] = await n.select({ count: ge() }).from(te).where(g(...p));
|
|
10595
10616
|
return {
|
|
10596
10617
|
resource_servers: E,
|
|
10597
10618
|
start: u * f,
|
|
10598
10619
|
limit: f,
|
|
10599
|
-
length: Number((
|
|
10620
|
+
length: Number((T == null ? void 0 : T.count) ?? 0)
|
|
10600
10621
|
};
|
|
10601
10622
|
},
|
|
10602
10623
|
async remove(e, t) {
|
|
10603
|
-
return (await n.delete(
|
|
10624
|
+
return (await n.delete(te).where(
|
|
10604
10625
|
g(
|
|
10605
|
-
c(
|
|
10606
|
-
c(
|
|
10626
|
+
c(te.tenant_id, e),
|
|
10627
|
+
c(te.id, t)
|
|
10607
10628
|
)
|
|
10608
10629
|
).returning()).length > 0;
|
|
10609
10630
|
}
|
|
@@ -10638,12 +10659,12 @@ function L_(n) {
|
|
|
10638
10659
|
], l = /* @__PURE__ */ new Map();
|
|
10639
10660
|
if (s.length > 0) {
|
|
10640
10661
|
const d = await n.select({
|
|
10641
|
-
identifier:
|
|
10642
|
-
name:
|
|
10643
|
-
}).from(
|
|
10662
|
+
identifier: te.identifier,
|
|
10663
|
+
name: te.name
|
|
10664
|
+
}).from(te).where(
|
|
10644
10665
|
g(
|
|
10645
|
-
c(
|
|
10646
|
-
De(
|
|
10666
|
+
c(te.tenant_id, e),
|
|
10667
|
+
De(te.identifier, s)
|
|
10647
10668
|
)
|
|
10648
10669
|
).all();
|
|
10649
10670
|
for (const u of d)
|
|
@@ -10703,10 +10724,10 @@ function R_(n) {
|
|
|
10703
10724
|
const l = await n.select().from(Me).where(g(...s)).all();
|
|
10704
10725
|
return await Promise.all(
|
|
10705
10726
|
l.map(async (u) => {
|
|
10706
|
-
const f = await n.select({ name:
|
|
10727
|
+
const f = await n.select({ name: te.name }).from(te).where(
|
|
10707
10728
|
g(
|
|
10708
|
-
c(
|
|
10709
|
-
c(
|
|
10729
|
+
c(te.tenant_id, e),
|
|
10730
|
+
c(te.identifier, u.resource_server_identifier)
|
|
10710
10731
|
)
|
|
10711
10732
|
).get();
|
|
10712
10733
|
return {
|
|
@@ -10774,12 +10795,12 @@ function U_(n) {
|
|
|
10774
10795
|
include_totals: s = !1,
|
|
10775
10796
|
sort: l,
|
|
10776
10797
|
q: d
|
|
10777
|
-
} = t || {}, u = d ?
|
|
10798
|
+
} = t || {}, u = d ? We(_e, d, ["name"]) : void 0, f = u ? g(c(_e.tenant_id, e), u) : c(_e.tenant_id, e);
|
|
10778
10799
|
let p = n.select().from(_e).where(f).$dynamic();
|
|
10779
10800
|
if (l != null && l.sort_by) {
|
|
10780
|
-
const
|
|
10781
|
-
|
|
10782
|
-
l.sort_order === "desc" ? se(
|
|
10801
|
+
const T = _e[l.sort_by];
|
|
10802
|
+
T && (p = p.orderBy(
|
|
10803
|
+
l.sort_order === "desc" ? se(T) : he(T)
|
|
10783
10804
|
));
|
|
10784
10805
|
}
|
|
10785
10806
|
const y = (await p.offset(i * o).limit(o)).map(Kn);
|
|
@@ -10853,12 +10874,12 @@ function P_(n) {
|
|
|
10853
10874
|
clients: JSON.stringify(t.clients || []),
|
|
10854
10875
|
created_at_ts: i,
|
|
10855
10876
|
updated_at_ts: i,
|
|
10856
|
-
expires_at_ts:
|
|
10857
|
-
idle_expires_at_ts:
|
|
10858
|
-
authenticated_at_ts: t.authenticated_at ?
|
|
10859
|
-
last_interaction_at_ts: t.last_interaction_at ?
|
|
10860
|
-
used_at_ts:
|
|
10861
|
-
revoked_at_ts:
|
|
10877
|
+
expires_at_ts: ne(t.expires_at),
|
|
10878
|
+
idle_expires_at_ts: ne(t.idle_expires_at),
|
|
10879
|
+
authenticated_at_ts: t.authenticated_at ? ne(t.authenticated_at) : i,
|
|
10880
|
+
last_interaction_at_ts: t.last_interaction_at ? ne(t.last_interaction_at) : i,
|
|
10881
|
+
used_at_ts: ne(t.used_at),
|
|
10882
|
+
revoked_at_ts: ne(t.revoked_at)
|
|
10862
10883
|
};
|
|
10863
10884
|
return await n.insert(ae).values(o), Jn({ ...o, tenant_id: e });
|
|
10864
10885
|
},
|
|
@@ -10870,9 +10891,9 @@ function P_(n) {
|
|
|
10870
10891
|
const o = {
|
|
10871
10892
|
updated_at_ts: Date.now()
|
|
10872
10893
|
};
|
|
10873
|
-
return i.user_id !== void 0 && (o.user_id = i.user_id), i.login_session_id !== void 0 && (o.login_session_id = i.login_session_id), i.device !== void 0 && (o.device = JSON.stringify(i.device)), i.clients !== void 0 && (o.clients = JSON.stringify(i.clients)), i.expires_at !== void 0 && (o.expires_at_ts =
|
|
10894
|
+
return i.user_id !== void 0 && (o.user_id = i.user_id), i.login_session_id !== void 0 && (o.login_session_id = i.login_session_id), i.device !== void 0 && (o.device = JSON.stringify(i.device)), i.clients !== void 0 && (o.clients = JSON.stringify(i.clients)), i.expires_at !== void 0 && (o.expires_at_ts = ne(i.expires_at)), i.idle_expires_at !== void 0 && (o.idle_expires_at_ts = ne(i.idle_expires_at)), i.authenticated_at !== void 0 && (o.authenticated_at_ts = ne(i.authenticated_at)), i.last_interaction_at !== void 0 && (o.last_interaction_at_ts = ne(
|
|
10874
10895
|
i.last_interaction_at
|
|
10875
|
-
)), i.used_at !== void 0 && (o.used_at_ts =
|
|
10896
|
+
)), i.used_at !== void 0 && (o.used_at_ts = ne(i.used_at)), i.revoked_at !== void 0 && (o.revoked_at_ts = ne(i.revoked_at)), (await n.update(ae).set(o).where(g(c(ae.tenant_id, e), c(ae.id, t))).returning()).length > 0;
|
|
10876
10897
|
},
|
|
10877
10898
|
async list(e, t) {
|
|
10878
10899
|
const {
|
|
@@ -10881,12 +10902,12 @@ function P_(n) {
|
|
|
10881
10902
|
include_totals: s = !1,
|
|
10882
10903
|
sort: l,
|
|
10883
10904
|
q: d
|
|
10884
|
-
} = t || {}, u = d ?
|
|
10905
|
+
} = t || {}, u = d ? We(ae, d, ["user_id"]) : void 0, f = u ? g(c(ae.tenant_id, e), u) : c(ae.tenant_id, e);
|
|
10885
10906
|
let p = n.select().from(ae).where(f).$dynamic();
|
|
10886
10907
|
if (l != null && l.sort_by) {
|
|
10887
|
-
const
|
|
10888
|
-
|
|
10889
|
-
l.sort_order === "desc" ? se(
|
|
10908
|
+
const T = ae[l.sort_by];
|
|
10909
|
+
T && (p = p.orderBy(
|
|
10910
|
+
l.sort_order === "desc" ? se(T) : he(T)
|
|
10890
10911
|
));
|
|
10891
10912
|
}
|
|
10892
10913
|
const y = (await p.offset(i * o).limit(o)).map(Jn);
|
|
@@ -10979,7 +11000,7 @@ function q_(n) {
|
|
|
10979
11000
|
} = e || {};
|
|
10980
11001
|
let d = n.select().from(B).$dynamic();
|
|
10981
11002
|
if (l) {
|
|
10982
|
-
const m =
|
|
11003
|
+
const m = We(B, l, ["friendly_name"]);
|
|
10983
11004
|
m && (d = d.where(m));
|
|
10984
11005
|
}
|
|
10985
11006
|
if (s != null && s.sort_by) {
|
|
@@ -11105,7 +11126,7 @@ function Qn(n, e = []) {
|
|
|
11105
11126
|
linked_to: f,
|
|
11106
11127
|
profileData: p,
|
|
11107
11128
|
...m
|
|
11108
|
-
} = n, y = Pi(n, !0), E = e.map((
|
|
11129
|
+
} = n, y = Pi(n, !0), E = e.map((T) => Pi(T, !1));
|
|
11109
11130
|
return Q({
|
|
11110
11131
|
...m,
|
|
11111
11132
|
email: n.email || "",
|
|
@@ -11238,7 +11259,7 @@ function j_(n) {
|
|
|
11238
11259
|
Ce(Z.linked_to)
|
|
11239
11260
|
];
|
|
11240
11261
|
if (u) {
|
|
11241
|
-
const ie =
|
|
11262
|
+
const ie = We(Z, u, [
|
|
11242
11263
|
"email",
|
|
11243
11264
|
"name",
|
|
11244
11265
|
"nickname",
|
|
@@ -11255,25 +11276,25 @@ function j_(n) {
|
|
|
11255
11276
|
));
|
|
11256
11277
|
}
|
|
11257
11278
|
const y = await m.offset(o * s).limit(s), E = y.map((ie) => ie.user_id);
|
|
11258
|
-
let
|
|
11259
|
-
E.length > 0 && (
|
|
11279
|
+
let T = [];
|
|
11280
|
+
E.length > 0 && (T = await n.select().from(Z).where(
|
|
11260
11281
|
g(
|
|
11261
11282
|
c(Z.tenant_id, t),
|
|
11262
11283
|
De(Z.linked_to, E)
|
|
11263
11284
|
)
|
|
11264
11285
|
));
|
|
11265
11286
|
const G = y.map((ie) => {
|
|
11266
|
-
const qe =
|
|
11287
|
+
const qe = T.filter((Se) => Se.linked_to === ie.user_id);
|
|
11267
11288
|
return Qn(ie, qe);
|
|
11268
11289
|
});
|
|
11269
11290
|
if (!l)
|
|
11270
11291
|
return { users: G };
|
|
11271
|
-
const [
|
|
11292
|
+
const [W] = await n.select({ count: ge() }).from(Z).where(p);
|
|
11272
11293
|
return {
|
|
11273
11294
|
users: G,
|
|
11274
11295
|
start: o * s,
|
|
11275
11296
|
limit: s,
|
|
11276
|
-
length: Number((
|
|
11297
|
+
length: Number((W == null ? void 0 : W.count) ?? 0)
|
|
11277
11298
|
};
|
|
11278
11299
|
},
|
|
11279
11300
|
async remove(t, i) {
|
|
@@ -11423,15 +11444,15 @@ function Z_(n) {
|
|
|
11423
11444
|
} = t || {}, d = c(le.tenant_id, e);
|
|
11424
11445
|
let u = d;
|
|
11425
11446
|
if (l) {
|
|
11426
|
-
const y =
|
|
11447
|
+
const y = We(le, l, [
|
|
11427
11448
|
"user_id",
|
|
11428
11449
|
"organization_id"
|
|
11429
11450
|
]);
|
|
11430
11451
|
y && (u = g(d, y));
|
|
11431
11452
|
}
|
|
11432
11453
|
const p = (await n.select().from(le).where(u).offset(i * o).limit(o)).map((y) => {
|
|
11433
|
-
const { tenant_id: E, ...
|
|
11434
|
-
return
|
|
11454
|
+
const { tenant_id: E, ...T } = y;
|
|
11455
|
+
return T;
|
|
11435
11456
|
});
|
|
11436
11457
|
if (!s)
|
|
11437
11458
|
return { userOrganizations: p };
|
|
@@ -11451,26 +11472,26 @@ function Z_(n) {
|
|
|
11451
11472
|
)
|
|
11452
11473
|
).offset(o * s).limit(s).all(), f = (await Promise.all(
|
|
11453
11474
|
d.map(async (m) => {
|
|
11454
|
-
const y = await n.select().from(
|
|
11475
|
+
const y = await n.select().from(ee).where(
|
|
11455
11476
|
g(
|
|
11456
|
-
c(
|
|
11457
|
-
c(
|
|
11477
|
+
c(ee.tenant_id, e),
|
|
11478
|
+
c(ee.id, m.organization_id)
|
|
11458
11479
|
)
|
|
11459
11480
|
).get();
|
|
11460
11481
|
if (!y) return null;
|
|
11461
11482
|
const {
|
|
11462
11483
|
tenant_id: E,
|
|
11463
|
-
branding:
|
|
11484
|
+
branding: T,
|
|
11464
11485
|
metadata: G,
|
|
11465
|
-
enabled_connections:
|
|
11486
|
+
enabled_connections: W,
|
|
11466
11487
|
token_quota: ie,
|
|
11467
11488
|
...qe
|
|
11468
11489
|
} = y;
|
|
11469
11490
|
return Q({
|
|
11470
11491
|
...qe,
|
|
11471
|
-
branding: F(
|
|
11492
|
+
branding: F(T, {}),
|
|
11472
11493
|
metadata: F(G, {}),
|
|
11473
|
-
enabled_connections: F(
|
|
11494
|
+
enabled_connections: F(W, []),
|
|
11474
11495
|
token_quota: F(ie, {})
|
|
11475
11496
|
});
|
|
11476
11497
|
})
|
|
@@ -11524,7 +11545,7 @@ function K_(n) {
|
|
|
11524
11545
|
}).from(z).where(
|
|
11525
11546
|
g(
|
|
11526
11547
|
c(z.tenant_id, e),
|
|
11527
|
-
|
|
11548
|
+
Tt(z.date, o),
|
|
11528
11549
|
yt(z.date, `${s}T23:59:59.999Z`)
|
|
11529
11550
|
)
|
|
11530
11551
|
).groupBy(O`substr(${z.date}, 1, 10)`).orderBy(O`substr(${z.date}, 1, 10)`).all()).map((d) => ({
|
|
@@ -11544,7 +11565,7 @@ function K_(n) {
|
|
|
11544
11565
|
}).from(z).where(
|
|
11545
11566
|
g(
|
|
11546
11567
|
c(z.tenant_id, e),
|
|
11547
|
-
|
|
11568
|
+
Tt(z.date, t),
|
|
11548
11569
|
O`${z.type} IN (${O.join(
|
|
11549
11570
|
qi.map((o) => O`${o}`),
|
|
11550
11571
|
O`, `
|
|
@@ -11604,30 +11625,30 @@ function W_(n) {
|
|
|
11604
11625
|
function X_(n) {
|
|
11605
11626
|
return {
|
|
11606
11627
|
async query(e, t, i) {
|
|
11607
|
-
var G,
|
|
11628
|
+
var G, W, ie, qe;
|
|
11608
11629
|
const o = Date.now(), s = J_[t], l = Q_[t], d = [
|
|
11609
11630
|
c(z.tenant_id, e),
|
|
11610
|
-
|
|
11611
|
-
|
|
11631
|
+
Tt(z.date, i.from),
|
|
11632
|
+
Qe(z.date, i.to),
|
|
11612
11633
|
De(z.type, s)
|
|
11613
11634
|
];
|
|
11614
|
-
(G = i.filters.connection) != null && G.length && d.push(De(z.connection, i.filters.connection)), (
|
|
11635
|
+
(G = i.filters.connection) != null && G.length && d.push(De(z.connection, i.filters.connection)), (W = i.filters.client_id) != null && W.length && d.push(De(z.client_id, i.filters.client_id)), (ie = i.filters.user_type) != null && ie.length && d.push(
|
|
11615
11636
|
De(
|
|
11616
11637
|
z.strategy_type,
|
|
11617
11638
|
i.filters.user_type
|
|
11618
11639
|
)
|
|
11619
11640
|
), (qe = i.filters.user_id) != null && qe.length && d.push(De(z.user_id, i.filters.user_id));
|
|
11620
11641
|
const u = {}, f = [], p = [];
|
|
11621
|
-
for (const
|
|
11622
|
-
if (
|
|
11642
|
+
for (const Se of i.group_by)
|
|
11643
|
+
if (Se === "time") {
|
|
11623
11644
|
const Ee = G_(i.interval);
|
|
11624
11645
|
u.time = Ee, f.push(Ee), p.push({
|
|
11625
11646
|
name: "time",
|
|
11626
11647
|
type: i.interval === "hour" ? "DateTime" : "Date"
|
|
11627
11648
|
});
|
|
11628
11649
|
} else {
|
|
11629
|
-
const Ee = W_(
|
|
11630
|
-
u[
|
|
11650
|
+
const Ee = W_(Se);
|
|
11651
|
+
u[Se] = Ee, f.push(Ee), p.push({ name: Se, type: "String" });
|
|
11631
11652
|
}
|
|
11632
11653
|
u[l.alias] = l.agg === "uniq" ? O`COUNT(DISTINCT ${z.user_id})` : O`COUNT(*)`, p.push({ name: l.alias, type: l.type });
|
|
11633
11654
|
let m = n.select(u).from(z).where(g(...d));
|
|
@@ -11636,30 +11657,30 @@ function X_(n) {
|
|
|
11636
11657
|
...Object.keys(u)
|
|
11637
11658
|
]);
|
|
11638
11659
|
if (i.order_by) {
|
|
11639
|
-
const
|
|
11660
|
+
const Se = i.order_by.startsWith("-"), Ee = Se ? i.order_by.slice(1) : i.order_by;
|
|
11640
11661
|
if (!y.has(Ee))
|
|
11641
11662
|
throw new Error(
|
|
11642
11663
|
`Invalid order_by column '${Ee}' for analytics query`
|
|
11643
11664
|
);
|
|
11644
11665
|
const it = Gn(Ee);
|
|
11645
|
-
m = m.orderBy(O.raw(`${it} ${
|
|
11666
|
+
m = m.orderBy(O.raw(`${it} ${Se ? "DESC" : "ASC"}`));
|
|
11646
11667
|
} else i.group_by[0] === "time" ? m = m.orderBy(O.raw(`${Gn("time")} ASC`)) : m = m.orderBy(
|
|
11647
11668
|
O.raw(`${Gn(l.alias)} DESC`)
|
|
11648
11669
|
);
|
|
11649
11670
|
m = m.limit(i.limit).offset(i.offset);
|
|
11650
|
-
const
|
|
11671
|
+
const T = (await m.all()).map((Se) => {
|
|
11651
11672
|
const Ee = {};
|
|
11652
11673
|
for (const it of p) {
|
|
11653
|
-
const rt =
|
|
11674
|
+
const rt = Se[it.name];
|
|
11654
11675
|
Ee[it.name] = it.type === "UInt64" ? Number(rt) || 0 : rt ?? "";
|
|
11655
11676
|
}
|
|
11656
11677
|
return Ee;
|
|
11657
11678
|
});
|
|
11658
11679
|
return {
|
|
11659
11680
|
meta: p,
|
|
11660
|
-
data:
|
|
11661
|
-
rows:
|
|
11662
|
-
rows_before_limit_at_least:
|
|
11681
|
+
data: T,
|
|
11682
|
+
rows: T.length,
|
|
11683
|
+
rows_before_limit_at_least: T.length,
|
|
11663
11684
|
statistics: { elapsed: (Date.now() - o) / 1e3 }
|
|
11664
11685
|
};
|
|
11665
11686
|
}
|
|
@@ -11820,16 +11841,16 @@ function tu(n) {
|
|
|
11820
11841
|
try {
|
|
11821
11842
|
let i = [
|
|
11822
11843
|
$e(
|
|
11823
|
-
|
|
11824
|
-
|
|
11844
|
+
Qe(J.expires_at_ts, t),
|
|
11845
|
+
Qe(J.idle_expires_at_ts, t)
|
|
11825
11846
|
)
|
|
11826
11847
|
];
|
|
11827
11848
|
e != null && e.tenant_id && i.push(c(J.tenant_id, e.tenant_id)), await n.delete(J).where(g(...i)), i = [
|
|
11828
11849
|
$e(
|
|
11829
|
-
|
|
11830
|
-
|
|
11850
|
+
Qe(ae.expires_at_ts, t),
|
|
11851
|
+
Qe(ae.idle_expires_at_ts, t)
|
|
11831
11852
|
)
|
|
11832
|
-
], e != null && e.tenant_id && i.push(c(ae.tenant_id, e.tenant_id)), e != null && e.user_id && i.push(c(ae.user_id, e.user_id)), await n.delete(ae).where(g(...i)), i = [
|
|
11853
|
+
], e != null && e.tenant_id && i.push(c(ae.tenant_id, e.tenant_id)), e != null && e.user_id && i.push(c(ae.user_id, e.user_id)), await n.delete(ae).where(g(...i)), i = [Qe(Y.expires_at_ts, t)], e != null && e.tenant_id && i.push(c(Y.tenant_id, e.tenant_id)), await n.delete(Y).where(g(...i));
|
|
11833
11854
|
} catch (i) {
|
|
11834
11855
|
console.error("Session cleanup error:", i);
|
|
11835
11856
|
}
|
|
@@ -11842,7 +11863,7 @@ function ou(n, e = { useTransactions: !0 }) {
|
|
|
11842
11863
|
actionVersions: nr(),
|
|
11843
11864
|
branding: yr(n),
|
|
11844
11865
|
clients: vr(n),
|
|
11845
|
-
clientConnections:
|
|
11866
|
+
clientConnections: Sr(n),
|
|
11846
11867
|
clientGrants: kr(n),
|
|
11847
11868
|
clientRegistrationTokens: t_(n),
|
|
11848
11869
|
codes: n_(n),
|
|
@@ -11857,8 +11878,8 @@ function ou(n, e = { useTransactions: !0 }) {
|
|
|
11857
11878
|
hooks: g_(n),
|
|
11858
11879
|
invites: y_(n),
|
|
11859
11880
|
keys: v_(n),
|
|
11860
|
-
loginSessions:
|
|
11861
|
-
logs:
|
|
11881
|
+
loginSessions: S_(n),
|
|
11882
|
+
logs: N_(n),
|
|
11862
11883
|
authenticationMethods: E_(n),
|
|
11863
11884
|
organizations: k_(n),
|
|
11864
11885
|
passwords: O_(n),
|