@authhero/drizzle 0.49.0 → 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 +702 -678
- 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(),
|
|
@@ -6859,7 +6859,10 @@ const Wl = _({
|
|
|
6859
6859
|
token_endpoint: a().optional(),
|
|
6860
6860
|
userinfo_endpoint: a().optional(),
|
|
6861
6861
|
client_id: a().optional(),
|
|
6862
|
-
client_secret: a().optional()
|
|
6862
|
+
client_secret: a().optional(),
|
|
6863
|
+
// Optional override for the `realm` sent in the password-realm grant.
|
|
6864
|
+
// Defaults to the connection name when omitted.
|
|
6865
|
+
realm: a().optional()
|
|
6863
6866
|
}).optional(),
|
|
6864
6867
|
// Flexible Identifiers: attributes schema (replaces legacy requires_username)
|
|
6865
6868
|
attributes: _({
|
|
@@ -6954,7 +6957,7 @@ const Xl = _({
|
|
|
6954
6957
|
(n) => n === null ? {} : di(n),
|
|
6955
6958
|
Wl
|
|
6956
6959
|
).default({}),
|
|
6957
|
-
enabled_clients:
|
|
6960
|
+
enabled_clients: N(a()).default([]).optional(),
|
|
6958
6961
|
response_type: li().optional(),
|
|
6959
6962
|
response_mode: li().optional(),
|
|
6960
6963
|
is_domain_connection: h().optional(),
|
|
@@ -6981,14 +6984,14 @@ const Yl = _({
|
|
|
6981
6984
|
"null"
|
|
6982
6985
|
]).optional(),
|
|
6983
6986
|
domain_metadata: P(a().max(255)).optional()
|
|
6984
|
-
}), ed =
|
|
6987
|
+
}), ed = Ct("name", [
|
|
6985
6988
|
_({
|
|
6986
|
-
name:
|
|
6989
|
+
name: I("txt"),
|
|
6987
6990
|
record: a(),
|
|
6988
6991
|
domain: a()
|
|
6989
6992
|
}),
|
|
6990
6993
|
_({
|
|
6991
|
-
name:
|
|
6994
|
+
name: I("http"),
|
|
6992
6995
|
http_body: a(),
|
|
6993
6996
|
http_url: a()
|
|
6994
6997
|
})
|
|
@@ -6999,31 +7002,31 @@ const Yl = _({
|
|
|
6999
7002
|
status: b(["disabled", "pending", "pending_verification", "ready"]),
|
|
7000
7003
|
origin_domain_name: a().optional(),
|
|
7001
7004
|
verification: _({
|
|
7002
|
-
methods:
|
|
7005
|
+
methods: N(ed)
|
|
7003
7006
|
}).optional(),
|
|
7004
7007
|
tls_policy: a().optional()
|
|
7005
7008
|
});
|
|
7006
7009
|
td.extend({
|
|
7007
7010
|
tenant_id: a()
|
|
7008
7011
|
});
|
|
7009
|
-
const
|
|
7012
|
+
const Ni = _({
|
|
7010
7013
|
id: a(),
|
|
7011
7014
|
order: x().optional(),
|
|
7012
7015
|
visible: h().optional().default(!0)
|
|
7013
|
-
}), ht =
|
|
7014
|
-
category:
|
|
7016
|
+
}), ht = Ni.extend({
|
|
7017
|
+
category: I("BLOCK").optional()
|
|
7015
7018
|
}), nd = ht.extend({
|
|
7016
|
-
type:
|
|
7019
|
+
type: I("DIVIDER"),
|
|
7017
7020
|
config: _({
|
|
7018
7021
|
text: a().optional()
|
|
7019
7022
|
}).optional()
|
|
7020
7023
|
}), id = ht.extend({
|
|
7021
|
-
type:
|
|
7024
|
+
type: I("HTML"),
|
|
7022
7025
|
config: _({
|
|
7023
7026
|
content: a().optional()
|
|
7024
7027
|
}).optional()
|
|
7025
7028
|
}), od = ht.extend({
|
|
7026
|
-
type:
|
|
7029
|
+
type: I("IMAGE"),
|
|
7027
7030
|
config: _({
|
|
7028
7031
|
src: a().optional(),
|
|
7029
7032
|
alt: a().optional(),
|
|
@@ -7031,58 +7034,58 @@ const Si = _({
|
|
|
7031
7034
|
height: x().optional()
|
|
7032
7035
|
}).optional()
|
|
7033
7036
|
}), ad = ht.extend({
|
|
7034
|
-
type:
|
|
7037
|
+
type: I("JUMP_BUTTON"),
|
|
7035
7038
|
config: _({
|
|
7036
7039
|
text: a().optional(),
|
|
7037
7040
|
target_step: a().optional()
|
|
7038
7041
|
})
|
|
7039
7042
|
}), sd = ht.extend({
|
|
7040
|
-
type:
|
|
7043
|
+
type: I("RESEND_BUTTON"),
|
|
7041
7044
|
config: _({
|
|
7042
7045
|
text: a().optional(),
|
|
7043
7046
|
resend_action: a().optional()
|
|
7044
7047
|
})
|
|
7045
7048
|
}), rd = ht.extend({
|
|
7046
|
-
type:
|
|
7049
|
+
type: I("NEXT_BUTTON"),
|
|
7047
7050
|
config: _({
|
|
7048
7051
|
text: a().optional()
|
|
7049
7052
|
})
|
|
7050
7053
|
}), ld = ht.extend({
|
|
7051
|
-
type:
|
|
7054
|
+
type: I("PREVIOUS_BUTTON"),
|
|
7052
7055
|
config: _({
|
|
7053
7056
|
text: a().optional()
|
|
7054
7057
|
})
|
|
7055
7058
|
}), dd = ht.extend({
|
|
7056
|
-
type:
|
|
7059
|
+
type: I("RICH_TEXT"),
|
|
7057
7060
|
config: _({
|
|
7058
7061
|
content: a().optional()
|
|
7059
7062
|
}).optional()
|
|
7060
|
-
}), bi =
|
|
7061
|
-
category:
|
|
7063
|
+
}), bi = Ni.extend({
|
|
7064
|
+
category: I("WIDGET").optional(),
|
|
7062
7065
|
label: a().min(1).optional(),
|
|
7063
7066
|
hint: a().min(1).max(500).optional(),
|
|
7064
7067
|
required: h().optional(),
|
|
7065
7068
|
sensitive: h().optional()
|
|
7066
7069
|
}), cd = bi.extend({
|
|
7067
|
-
type:
|
|
7070
|
+
type: I("AUTH0_VERIFIABLE_CREDENTIALS"),
|
|
7068
7071
|
config: _({
|
|
7069
7072
|
credential_type: a().optional()
|
|
7070
7073
|
})
|
|
7071
7074
|
}), _d = bi.extend({
|
|
7072
|
-
type:
|
|
7075
|
+
type: I("GMAPS_ADDRESS"),
|
|
7073
7076
|
config: _({
|
|
7074
7077
|
api_key: a().optional()
|
|
7075
7078
|
})
|
|
7076
7079
|
}), ud = bi.extend({
|
|
7077
|
-
type:
|
|
7080
|
+
type: I("RECAPTCHA"),
|
|
7078
7081
|
config: _({
|
|
7079
7082
|
site_key: a().optional()
|
|
7080
7083
|
})
|
|
7081
|
-
}), be =
|
|
7082
|
-
category:
|
|
7084
|
+
}), be = Ni.extend({
|
|
7085
|
+
category: I("FIELD").optional(),
|
|
7083
7086
|
label: a().min(1).optional(),
|
|
7084
7087
|
hint: a().min(1).max(500).optional(),
|
|
7085
|
-
messages:
|
|
7088
|
+
messages: N(
|
|
7086
7089
|
_({
|
|
7087
7090
|
id: x().optional(),
|
|
7088
7091
|
text: a(),
|
|
@@ -7092,14 +7095,14 @@ const Si = _({
|
|
|
7092
7095
|
required: h().optional(),
|
|
7093
7096
|
sensitive: h().optional()
|
|
7094
7097
|
}), pd = be.extend({
|
|
7095
|
-
type:
|
|
7098
|
+
type: I("BOOLEAN"),
|
|
7096
7099
|
config: _({
|
|
7097
7100
|
default_value: h().optional()
|
|
7098
7101
|
}).optional()
|
|
7099
7102
|
}), fd = be.extend({
|
|
7100
|
-
type:
|
|
7103
|
+
type: I("CARDS"),
|
|
7101
7104
|
config: _({
|
|
7102
|
-
options:
|
|
7105
|
+
options: N(
|
|
7103
7106
|
_({
|
|
7104
7107
|
value: a(),
|
|
7105
7108
|
label: a(),
|
|
@@ -7110,9 +7113,9 @@ const Si = _({
|
|
|
7110
7113
|
multi_select: h().optional()
|
|
7111
7114
|
}).optional()
|
|
7112
7115
|
}), hd = be.extend({
|
|
7113
|
-
type:
|
|
7116
|
+
type: I("CHOICE"),
|
|
7114
7117
|
config: _({
|
|
7115
|
-
options:
|
|
7118
|
+
options: N(
|
|
7116
7119
|
_({
|
|
7117
7120
|
value: a(),
|
|
7118
7121
|
label: a()
|
|
@@ -7120,10 +7123,10 @@ const Si = _({
|
|
|
7120
7123
|
).optional(),
|
|
7121
7124
|
display: b(["radio", "checkbox"]).optional(),
|
|
7122
7125
|
multiple: h().optional(),
|
|
7123
|
-
default_value: Pe([a(),
|
|
7126
|
+
default_value: Pe([a(), N(a())]).optional()
|
|
7124
7127
|
}).optional()
|
|
7125
7128
|
}), gd = be.extend({
|
|
7126
|
-
type:
|
|
7129
|
+
type: I("CUSTOM"),
|
|
7127
7130
|
config: _({
|
|
7128
7131
|
component: a().optional(),
|
|
7129
7132
|
props: P(V()).optional(),
|
|
@@ -7131,7 +7134,7 @@ const Si = _({
|
|
|
7131
7134
|
code: a().optional()
|
|
7132
7135
|
})
|
|
7133
7136
|
}), md = be.extend({
|
|
7134
|
-
type:
|
|
7137
|
+
type: I("DATE"),
|
|
7135
7138
|
config: _({
|
|
7136
7139
|
format: a().optional(),
|
|
7137
7140
|
min: a().optional(),
|
|
@@ -7139,9 +7142,9 @@ const Si = _({
|
|
|
7139
7142
|
default_value: a().optional()
|
|
7140
7143
|
}).optional()
|
|
7141
7144
|
}), yd = be.extend({
|
|
7142
|
-
type:
|
|
7145
|
+
type: I("DROPDOWN"),
|
|
7143
7146
|
config: _({
|
|
7144
|
-
options:
|
|
7147
|
+
options: N(
|
|
7145
7148
|
_({
|
|
7146
7149
|
value: a(),
|
|
7147
7150
|
label: a()
|
|
@@ -7150,29 +7153,29 @@ const Si = _({
|
|
|
7150
7153
|
placeholder: a().optional(),
|
|
7151
7154
|
searchable: h().optional(),
|
|
7152
7155
|
multiple: h().optional(),
|
|
7153
|
-
default_value: Pe([a(),
|
|
7156
|
+
default_value: Pe([a(), N(a())]).optional()
|
|
7154
7157
|
}).optional()
|
|
7155
7158
|
}), vd = be.extend({
|
|
7156
|
-
type:
|
|
7159
|
+
type: I("EMAIL"),
|
|
7157
7160
|
config: _({
|
|
7158
7161
|
placeholder: a().optional(),
|
|
7159
7162
|
default_value: a().optional()
|
|
7160
7163
|
}).optional()
|
|
7161
7164
|
}), wd = be.extend({
|
|
7162
|
-
type:
|
|
7165
|
+
type: I("FILE"),
|
|
7163
7166
|
config: _({
|
|
7164
7167
|
accept: a().optional(),
|
|
7165
7168
|
max_size: x().optional(),
|
|
7166
7169
|
multiple: h().optional()
|
|
7167
7170
|
}).optional()
|
|
7168
|
-
}),
|
|
7169
|
-
type:
|
|
7171
|
+
}), Sd = be.extend({
|
|
7172
|
+
type: I("LEGAL"),
|
|
7170
7173
|
config: _({
|
|
7171
7174
|
text: a(),
|
|
7172
7175
|
html: h().optional()
|
|
7173
7176
|
}).optional()
|
|
7174
|
-
}),
|
|
7175
|
-
type:
|
|
7177
|
+
}), Nd = be.extend({
|
|
7178
|
+
type: I("NUMBER"),
|
|
7176
7179
|
config: _({
|
|
7177
7180
|
placeholder: a().optional(),
|
|
7178
7181
|
min: x().optional(),
|
|
@@ -7181,7 +7184,7 @@ const Si = _({
|
|
|
7181
7184
|
default_value: a().optional()
|
|
7182
7185
|
}).optional()
|
|
7183
7186
|
}), bd = be.extend({
|
|
7184
|
-
type:
|
|
7187
|
+
type: I("PASSWORD"),
|
|
7185
7188
|
config: _({
|
|
7186
7189
|
placeholder: a().optional(),
|
|
7187
7190
|
min_length: x().optional(),
|
|
@@ -7190,17 +7193,17 @@ const Si = _({
|
|
|
7190
7193
|
default_value: a().optional()
|
|
7191
7194
|
}).optional()
|
|
7192
7195
|
}), Ed = be.extend({
|
|
7193
|
-
type:
|
|
7196
|
+
type: I("PAYMENT"),
|
|
7194
7197
|
config: _({
|
|
7195
7198
|
provider: a().optional(),
|
|
7196
7199
|
currency: a().optional()
|
|
7197
7200
|
}).optional()
|
|
7198
7201
|
}), xd = be.extend({
|
|
7199
|
-
type:
|
|
7202
|
+
type: I("SOCIAL"),
|
|
7200
7203
|
config: _({
|
|
7201
|
-
providers:
|
|
7204
|
+
providers: N(a()).optional(),
|
|
7202
7205
|
// Extended provider info with icons and display names
|
|
7203
|
-
provider_details:
|
|
7206
|
+
provider_details: N(
|
|
7204
7207
|
_({
|
|
7205
7208
|
name: a(),
|
|
7206
7209
|
strategy: a().optional(),
|
|
@@ -7211,7 +7214,7 @@ const Si = _({
|
|
|
7211
7214
|
).optional()
|
|
7212
7215
|
}).optional()
|
|
7213
7216
|
}), kd = be.extend({
|
|
7214
|
-
type:
|
|
7217
|
+
type: I("TEL"),
|
|
7215
7218
|
config: _({
|
|
7216
7219
|
placeholder: a().optional(),
|
|
7217
7220
|
default_country: a().optional(),
|
|
@@ -7219,7 +7222,7 @@ const Si = _({
|
|
|
7219
7222
|
allow_email: h().optional()
|
|
7220
7223
|
}).optional()
|
|
7221
7224
|
}), Od = be.extend({
|
|
7222
|
-
type:
|
|
7225
|
+
type: I("TEXT"),
|
|
7223
7226
|
config: _({
|
|
7224
7227
|
placeholder: a().optional(),
|
|
7225
7228
|
multiline: h().optional(),
|
|
@@ -7227,18 +7230,18 @@ const Si = _({
|
|
|
7227
7230
|
default_value: a().optional()
|
|
7228
7231
|
}).optional()
|
|
7229
7232
|
}), Td = be.extend({
|
|
7230
|
-
type:
|
|
7233
|
+
type: I("COUNTRY"),
|
|
7231
7234
|
config: _({
|
|
7232
7235
|
placeholder: a().optional(),
|
|
7233
7236
|
default_value: a().optional()
|
|
7234
7237
|
}).optional()
|
|
7235
7238
|
}), Ad = be.extend({
|
|
7236
|
-
type:
|
|
7239
|
+
type: I("URL"),
|
|
7237
7240
|
config: _({
|
|
7238
7241
|
placeholder: a().optional(),
|
|
7239
7242
|
default_value: a().optional()
|
|
7240
7243
|
}).optional()
|
|
7241
|
-
}), Id =
|
|
7244
|
+
}), Id = Ct("type", [
|
|
7242
7245
|
nd,
|
|
7243
7246
|
id,
|
|
7244
7247
|
od,
|
|
@@ -7247,11 +7250,11 @@ const Si = _({
|
|
|
7247
7250
|
rd,
|
|
7248
7251
|
ld,
|
|
7249
7252
|
dd
|
|
7250
|
-
]), Cd =
|
|
7253
|
+
]), Cd = Ct("type", [
|
|
7251
7254
|
cd,
|
|
7252
7255
|
_d,
|
|
7253
7256
|
ud
|
|
7254
|
-
]), Dd =
|
|
7257
|
+
]), Dd = Ct("type", [
|
|
7255
7258
|
pd,
|
|
7256
7259
|
fd,
|
|
7257
7260
|
hd,
|
|
@@ -7261,8 +7264,8 @@ const Si = _({
|
|
|
7261
7264
|
yd,
|
|
7262
7265
|
vd,
|
|
7263
7266
|
wd,
|
|
7264
|
-
Nd,
|
|
7265
7267
|
Sd,
|
|
7268
|
+
Nd,
|
|
7266
7269
|
bd,
|
|
7267
7270
|
Ed,
|
|
7268
7271
|
xd,
|
|
@@ -7276,7 +7279,7 @@ const Si = _({
|
|
|
7276
7279
|
]);
|
|
7277
7280
|
_({
|
|
7278
7281
|
id: a(),
|
|
7279
|
-
type:
|
|
7282
|
+
type: I("submit"),
|
|
7280
7283
|
label: a(),
|
|
7281
7284
|
className: a().optional(),
|
|
7282
7285
|
disabled: h().optional().default(!1),
|
|
@@ -7289,7 +7292,7 @@ const Yt = _({
|
|
|
7289
7292
|
y: x()
|
|
7290
7293
|
}), Ld = _({
|
|
7291
7294
|
id: a(),
|
|
7292
|
-
type:
|
|
7295
|
+
type: I("FLOW"),
|
|
7293
7296
|
coordinates: Yt,
|
|
7294
7297
|
alias: a().min(1).max(150).optional(),
|
|
7295
7298
|
config: _({
|
|
@@ -7298,11 +7301,11 @@ const Yt = _({
|
|
|
7298
7301
|
})
|
|
7299
7302
|
}), Rd = _({
|
|
7300
7303
|
id: a(),
|
|
7301
|
-
type:
|
|
7304
|
+
type: I("ROUTER"),
|
|
7302
7305
|
coordinates: Yt,
|
|
7303
7306
|
alias: a().min(1).max(150),
|
|
7304
7307
|
config: _({
|
|
7305
|
-
rules:
|
|
7308
|
+
rules: N(
|
|
7306
7309
|
_({
|
|
7307
7310
|
id: a(),
|
|
7308
7311
|
alias: a().min(1).max(150).optional(),
|
|
@@ -7314,14 +7317,14 @@ const Yt = _({
|
|
|
7314
7317
|
})
|
|
7315
7318
|
}), Ud = _({
|
|
7316
7319
|
id: a(),
|
|
7317
|
-
type:
|
|
7320
|
+
type: I("STEP"),
|
|
7318
7321
|
coordinates: Yt,
|
|
7319
7322
|
alias: a().min(1).max(150).optional(),
|
|
7320
7323
|
config: _({
|
|
7321
|
-
components:
|
|
7324
|
+
components: N(Cs),
|
|
7322
7325
|
next_node: a().optional()
|
|
7323
7326
|
})
|
|
7324
|
-
}), zd =
|
|
7327
|
+
}), zd = Ct("type", [
|
|
7325
7328
|
Ld,
|
|
7326
7329
|
Rd,
|
|
7327
7330
|
Ud
|
|
@@ -7338,9 +7341,9 @@ const Yt = _({
|
|
|
7338
7341
|
default: a().optional()
|
|
7339
7342
|
}).optional(),
|
|
7340
7343
|
translations: P(a(), V()).optional(),
|
|
7341
|
-
nodes:
|
|
7344
|
+
nodes: N(zd).optional(),
|
|
7342
7345
|
start: _({
|
|
7343
|
-
hidden_fields:
|
|
7346
|
+
hidden_fields: N(_({ key: a(), value: a() })).optional(),
|
|
7344
7347
|
next_node: a().optional(),
|
|
7345
7348
|
coordinates: Yt.optional()
|
|
7346
7349
|
}).optional(),
|
|
@@ -7383,9 +7386,9 @@ _({
|
|
|
7383
7386
|
method: b(["POST", "GET"]),
|
|
7384
7387
|
title: a().optional(),
|
|
7385
7388
|
description: a().optional(),
|
|
7386
|
-
components:
|
|
7387
|
-
messages:
|
|
7388
|
-
links:
|
|
7389
|
+
components: N(Cs),
|
|
7390
|
+
messages: N(Pd).optional(),
|
|
7391
|
+
links: N(qd).optional(),
|
|
7389
7392
|
/** Footer HTML content displayed at the very bottom of the widget (e.g., terms and conditions) */
|
|
7390
7393
|
footer: a().optional()
|
|
7391
7394
|
});
|
|
@@ -7513,7 +7516,7 @@ const Qd = _({
|
|
|
7513
7516
|
app_metadata: P(V()).default({}).optional(),
|
|
7514
7517
|
user_metadata: P(V()).default({}).optional(),
|
|
7515
7518
|
ttl_sec: x().int().max(2592e3).default(604800).optional(),
|
|
7516
|
-
roles:
|
|
7519
|
+
roles: N(a()).default([]).optional(),
|
|
7517
7520
|
send_invitation_email: h().default(!0).optional()
|
|
7518
7521
|
});
|
|
7519
7522
|
_({
|
|
@@ -7546,25 +7549,25 @@ const Xd = _({
|
|
|
7546
7549
|
x: a().optional(),
|
|
7547
7550
|
y: a().optional(),
|
|
7548
7551
|
x5t: a().optional(),
|
|
7549
|
-
x5c:
|
|
7552
|
+
x5c: N(a()).optional()
|
|
7550
7553
|
}).superRefine((n, e) => {
|
|
7551
7554
|
if (n.kty === "RSA")
|
|
7552
7555
|
for (const t of ["n", "e"])
|
|
7553
7556
|
n[t] || e.addIssue({
|
|
7554
|
-
code:
|
|
7557
|
+
code: S.custom,
|
|
7555
7558
|
path: [t],
|
|
7556
7559
|
message: `RSA JWK is missing required member '${t}'`
|
|
7557
7560
|
});
|
|
7558
7561
|
else if (n.kty === "EC")
|
|
7559
7562
|
for (const t of ["crv", "x", "y"])
|
|
7560
7563
|
n[t] || e.addIssue({
|
|
7561
|
-
code:
|
|
7564
|
+
code: S.custom,
|
|
7562
7565
|
path: [t],
|
|
7563
7566
|
message: `EC JWK is missing required member '${t}'`
|
|
7564
7567
|
});
|
|
7565
7568
|
});
|
|
7566
7569
|
_({
|
|
7567
|
-
keys:
|
|
7570
|
+
keys: N(Xd)
|
|
7568
7571
|
});
|
|
7569
7572
|
_({
|
|
7570
7573
|
issuer: a(),
|
|
@@ -7575,20 +7578,20 @@ _({
|
|
|
7575
7578
|
registration_endpoint: a().optional(),
|
|
7576
7579
|
revocation_endpoint: a(),
|
|
7577
7580
|
end_session_endpoint: a().optional(),
|
|
7578
|
-
scopes_supported:
|
|
7579
|
-
response_types_supported:
|
|
7580
|
-
grant_types_supported:
|
|
7581
|
-
code_challenge_methods_supported:
|
|
7582
|
-
response_modes_supported:
|
|
7583
|
-
subject_types_supported:
|
|
7584
|
-
id_token_signing_alg_values_supported:
|
|
7585
|
-
token_endpoint_auth_methods_supported:
|
|
7586
|
-
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()),
|
|
7587
7590
|
request_uri_parameter_supported: h(),
|
|
7588
7591
|
request_parameter_supported: h(),
|
|
7589
7592
|
claims_parameter_supported: h().optional(),
|
|
7590
|
-
request_object_signing_alg_values_supported:
|
|
7591
|
-
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())
|
|
7592
7595
|
});
|
|
7593
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 || {});
|
|
7594
7597
|
const Yd = wt(Fs), ec = _({
|
|
@@ -7785,6 +7788,8 @@ const nc = {
|
|
|
7785
7788
|
SUCCESS_LOGOUT: "slo",
|
|
7786
7789
|
SUCCESS_HOOK: "sh",
|
|
7787
7790
|
// Custom AuthHero-specific
|
|
7791
|
+
SUCCESS_PASSWORD_MIGRATION: "spm",
|
|
7792
|
+
// Custom AuthHero-specific: upstream password successfully imported
|
|
7788
7793
|
SUCCESS_REVOCATION: "srrt",
|
|
7789
7794
|
SUCCESS_SIGNUP: "ss",
|
|
7790
7795
|
FAILED_SS_SSO_OPERATION: "ss_sso_failure",
|
|
@@ -7862,7 +7867,7 @@ const rc = b([
|
|
|
7862
7867
|
type: rc,
|
|
7863
7868
|
status: Ps.optional(),
|
|
7864
7869
|
sink: P(a(), ze()),
|
|
7865
|
-
filters:
|
|
7870
|
+
filters: N(lc).optional(),
|
|
7866
7871
|
isPriority: h().optional()
|
|
7867
7872
|
});
|
|
7868
7873
|
dc.extend({
|
|
@@ -7897,27 +7902,27 @@ _({
|
|
|
7897
7902
|
}).extend(uc.shape);
|
|
7898
7903
|
const pc = _({
|
|
7899
7904
|
enabled: h().optional(),
|
|
7900
|
-
shields:
|
|
7901
|
-
admin_notification_frequency:
|
|
7905
|
+
shields: N(a()).optional(),
|
|
7906
|
+
admin_notification_frequency: N(a()).optional(),
|
|
7902
7907
|
method: a().optional(),
|
|
7903
7908
|
stage: _({
|
|
7904
7909
|
"pre-user-registration": _({
|
|
7905
|
-
shields:
|
|
7910
|
+
shields: N(a()).optional()
|
|
7906
7911
|
}).optional(),
|
|
7907
7912
|
"pre-change-password": _({
|
|
7908
|
-
shields:
|
|
7913
|
+
shields: N(a()).optional()
|
|
7909
7914
|
}).optional()
|
|
7910
7915
|
}).optional()
|
|
7911
7916
|
}), fc = _({
|
|
7912
7917
|
enabled: h().optional(),
|
|
7913
|
-
shields:
|
|
7914
|
-
allowlist:
|
|
7918
|
+
shields: N(a()).optional(),
|
|
7919
|
+
allowlist: N(a()).optional(),
|
|
7915
7920
|
mode: a().optional(),
|
|
7916
7921
|
max_attempts: x().optional()
|
|
7917
7922
|
}), hc = _({
|
|
7918
7923
|
enabled: h().optional(),
|
|
7919
|
-
shields:
|
|
7920
|
-
allowlist:
|
|
7924
|
+
shields: N(a()).optional(),
|
|
7925
|
+
allowlist: N(a()).optional(),
|
|
7921
7926
|
stage: _({
|
|
7922
7927
|
"pre-login": _({
|
|
7923
7928
|
max_attempts: x().optional(),
|
|
@@ -7962,7 +7967,7 @@ const qs = _({
|
|
|
7962
7967
|
device: qs.describe(
|
|
7963
7968
|
"Metadata related to the device used in the session"
|
|
7964
7969
|
),
|
|
7965
|
-
clients:
|
|
7970
|
+
clients: N(a()).describe("List of client details for the session")
|
|
7966
7971
|
});
|
|
7967
7972
|
_({
|
|
7968
7973
|
created_at: a(),
|
|
@@ -8021,7 +8026,7 @@ const vc = _({
|
|
|
8021
8026
|
mode: b(["persistent", "non-persistent"]).optional()
|
|
8022
8027
|
}).optional(),
|
|
8023
8028
|
// Logout settings
|
|
8024
|
-
allowed_logout_urls:
|
|
8029
|
+
allowed_logout_urls: N(a()).optional(),
|
|
8025
8030
|
// Universal Login settings
|
|
8026
8031
|
default_redirection_uri: a().optional(),
|
|
8027
8032
|
// Anchor client used for tenant-level flows that aren't tied to a specific
|
|
@@ -8030,7 +8035,7 @@ const vc = _({
|
|
|
8030
8035
|
// "Default App" / Global Client.
|
|
8031
8036
|
default_client_id: a().optional(),
|
|
8032
8037
|
// Advanced settings
|
|
8033
|
-
enabled_locales:
|
|
8038
|
+
enabled_locales: N(a()).optional(),
|
|
8034
8039
|
default_directory: a().optional(),
|
|
8035
8040
|
error_page: _({
|
|
8036
8041
|
html: a().optional(),
|
|
@@ -8060,11 +8065,11 @@ const vc = _({
|
|
|
8060
8065
|
// and relies on tenant ACLs/rate limits; we implement RFC 7591 initial
|
|
8061
8066
|
// access tokens and a per-tenant grant-type allowlist.
|
|
8062
8067
|
dcr_require_initial_access_token: h().optional(),
|
|
8063
|
-
dcr_allowed_grant_types:
|
|
8068
|
+
dcr_allowed_grant_types: N(a()).optional(),
|
|
8064
8069
|
// Per-tenant allowlist of fully-qualified http origins (scheme + host
|
|
8065
8070
|
// + port, no path) that may be used as `return_to` / `domain` on
|
|
8066
8071
|
// `/connect/start` despite not being loopback. Off by default.
|
|
8067
|
-
allow_http_return_to:
|
|
8072
|
+
allow_http_return_to: N(
|
|
8068
8073
|
a().refine(
|
|
8069
8074
|
(n) => {
|
|
8070
8075
|
try {
|
|
@@ -8102,7 +8107,7 @@ const vc = _({
|
|
|
8102
8107
|
// Sandbox settings
|
|
8103
8108
|
sandbox_version: a().optional(),
|
|
8104
8109
|
legacy_sandbox_version: a().optional(),
|
|
8105
|
-
sandbox_versions_available:
|
|
8110
|
+
sandbox_versions_available: N(a()).optional(),
|
|
8106
8111
|
// Change password settings
|
|
8107
8112
|
change_password: _({
|
|
8108
8113
|
enabled: h().optional(),
|
|
@@ -8144,7 +8149,7 @@ const vc = _({
|
|
|
8144
8149
|
// MFA settings
|
|
8145
8150
|
customize_mfa_in_postlogin_action: h().optional(),
|
|
8146
8151
|
// ACR values
|
|
8147
|
-
acr_values_supported:
|
|
8152
|
+
acr_values_supported: N(a()).optional(),
|
|
8148
8153
|
// mTLS settings
|
|
8149
8154
|
mtls: _({
|
|
8150
8155
|
enable_endpoint_aliases: h().optional()
|
|
@@ -8190,7 +8195,12 @@ _({
|
|
|
8190
8195
|
created_at: a().nullable().transform((n) => n ?? ""),
|
|
8191
8196
|
updated_at: a().nullable().transform((n) => n ?? ""),
|
|
8192
8197
|
...vc.shape,
|
|
8193
|
-
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()
|
|
8194
8204
|
});
|
|
8195
8205
|
_({
|
|
8196
8206
|
access_token: a(),
|
|
@@ -8215,7 +8225,7 @@ const wc = _({
|
|
|
8215
8225
|
show_widget_shadow: h(),
|
|
8216
8226
|
widget_border_weight: x(),
|
|
8217
8227
|
widget_corner_radius: x()
|
|
8218
|
-
}),
|
|
8228
|
+
}), Sc = _({
|
|
8219
8229
|
base_focus_color: a(),
|
|
8220
8230
|
base_hover_color: a(),
|
|
8221
8231
|
body_text: a(),
|
|
@@ -8238,7 +8248,7 @@ const wc = _({
|
|
|
8238
8248
|
}), bt = _({
|
|
8239
8249
|
bold: h(),
|
|
8240
8250
|
size: x()
|
|
8241
|
-
}),
|
|
8251
|
+
}), Nc = _({
|
|
8242
8252
|
body_text: bt,
|
|
8243
8253
|
buttons_text: bt,
|
|
8244
8254
|
font_url: a(),
|
|
@@ -8269,9 +8279,9 @@ const wc = _({
|
|
|
8269
8279
|
social_buttons_layout: b(["bottom", "top"])
|
|
8270
8280
|
}), xc = _({
|
|
8271
8281
|
borders: wc,
|
|
8272
|
-
colors:
|
|
8282
|
+
colors: Sc,
|
|
8273
8283
|
displayName: a(),
|
|
8274
|
-
fonts:
|
|
8284
|
+
fonts: Nc,
|
|
8275
8285
|
page_background: bc,
|
|
8276
8286
|
widget: Ec
|
|
8277
8287
|
});
|
|
@@ -8310,7 +8320,7 @@ _({
|
|
|
8310
8320
|
body: a(),
|
|
8311
8321
|
from: a(),
|
|
8312
8322
|
subject: a(),
|
|
8313
|
-
syntax:
|
|
8323
|
+
syntax: I("liquid").default("liquid"),
|
|
8314
8324
|
resultUrl: a().optional(),
|
|
8315
8325
|
urlLifetimeInSeconds: x().int().nonnegative().optional(),
|
|
8316
8326
|
includeEmailInRedirect: h().default(!1),
|
|
@@ -8330,7 +8340,7 @@ const Oc = _({
|
|
|
8330
8340
|
// When the token was last used.
|
|
8331
8341
|
last_exchanged_at: a().optional(),
|
|
8332
8342
|
device: qs,
|
|
8333
|
-
resource_servers:
|
|
8343
|
+
resource_servers: N(
|
|
8334
8344
|
_({
|
|
8335
8345
|
audience: a(),
|
|
8336
8346
|
scopes: a()
|
|
@@ -8384,7 +8394,7 @@ const Tc = _({
|
|
|
8384
8394
|
id: a().optional(),
|
|
8385
8395
|
name: a(),
|
|
8386
8396
|
identifier: a(),
|
|
8387
|
-
scopes:
|
|
8397
|
+
scopes: N(Tc).optional(),
|
|
8388
8398
|
signing_alg: a().optional(),
|
|
8389
8399
|
signing_secret: a().optional(),
|
|
8390
8400
|
token_lifetime: x().default(86400),
|
|
@@ -8400,7 +8410,7 @@ const Tc = _({
|
|
|
8400
8410
|
created_at: a().optional(),
|
|
8401
8411
|
updated_at: a().optional()
|
|
8402
8412
|
});
|
|
8403
|
-
|
|
8413
|
+
N(Cc);
|
|
8404
8414
|
const Dc = _({
|
|
8405
8415
|
role_id: a(),
|
|
8406
8416
|
resource_server_identifier: a(),
|
|
@@ -8409,7 +8419,7 @@ const Dc = _({
|
|
|
8409
8419
|
...Dc.shape,
|
|
8410
8420
|
created_at: a()
|
|
8411
8421
|
});
|
|
8412
|
-
|
|
8422
|
+
N(Lc);
|
|
8413
8423
|
const Rc = _({
|
|
8414
8424
|
user_id: a(),
|
|
8415
8425
|
resource_server_identifier: a(),
|
|
@@ -8420,7 +8430,7 @@ const Rc = _({
|
|
|
8420
8430
|
tenant_id: a(),
|
|
8421
8431
|
created_at: a().optional()
|
|
8422
8432
|
});
|
|
8423
|
-
|
|
8433
|
+
N(Uc);
|
|
8424
8434
|
const zc = _({
|
|
8425
8435
|
user_id: a(),
|
|
8426
8436
|
resource_server_identifier: a(),
|
|
@@ -8430,7 +8440,7 @@ const zc = _({
|
|
|
8430
8440
|
created_at: a().optional(),
|
|
8431
8441
|
organization_id: a().optional()
|
|
8432
8442
|
});
|
|
8433
|
-
|
|
8443
|
+
N(
|
|
8434
8444
|
zc
|
|
8435
8445
|
);
|
|
8436
8446
|
const Fc = _({
|
|
@@ -8442,7 +8452,7 @@ const Fc = _({
|
|
|
8442
8452
|
tenant_id: a(),
|
|
8443
8453
|
created_at: a().optional()
|
|
8444
8454
|
});
|
|
8445
|
-
|
|
8455
|
+
N(Pc);
|
|
8446
8456
|
const qc = _({
|
|
8447
8457
|
id: a().optional().openapi({
|
|
8448
8458
|
description: "The unique identifier of the role. If not provided, one will be generated."
|
|
@@ -8464,7 +8474,7 @@ const qc = _({
|
|
|
8464
8474
|
created_at: a().optional(),
|
|
8465
8475
|
updated_at: a().optional()
|
|
8466
8476
|
});
|
|
8467
|
-
|
|
8477
|
+
N(Mc);
|
|
8468
8478
|
const Bc = _({
|
|
8469
8479
|
logo_url: a().optional().openapi({
|
|
8470
8480
|
description: "URL of the organization's logo"
|
|
@@ -8516,7 +8526,7 @@ const Bc = _({
|
|
|
8516
8526
|
metadata: P(V()).default({}).optional().openapi({
|
|
8517
8527
|
description: "Custom metadata for the organization"
|
|
8518
8528
|
}),
|
|
8519
|
-
enabled_connections:
|
|
8529
|
+
enabled_connections: N($c).default([]).optional().openapi({
|
|
8520
8530
|
description: "List of enabled connections for the organization"
|
|
8521
8531
|
}),
|
|
8522
8532
|
token_quota: jc
|
|
@@ -8547,7 +8557,7 @@ const Zc = _({
|
|
|
8547
8557
|
created_at: a().optional(),
|
|
8548
8558
|
updated_at: a().optional()
|
|
8549
8559
|
});
|
|
8550
|
-
|
|
8560
|
+
N(
|
|
8551
8561
|
Hc
|
|
8552
8562
|
);
|
|
8553
8563
|
const Kc = _({
|
|
@@ -8575,7 +8585,7 @@ _({
|
|
|
8575
8585
|
// Universal Login settings
|
|
8576
8586
|
default_redirection_uri: a().optional(),
|
|
8577
8587
|
// Advanced settings
|
|
8578
|
-
enabled_locales:
|
|
8588
|
+
enabled_locales: N(a()).optional(),
|
|
8579
8589
|
default_directory: a().optional(),
|
|
8580
8590
|
error_page: _({
|
|
8581
8591
|
html: a().optional(),
|
|
@@ -8613,7 +8623,7 @@ _({
|
|
|
8613
8623
|
support_url: a().optional(),
|
|
8614
8624
|
// Sandbox settings
|
|
8615
8625
|
sandbox_version: a().optional(),
|
|
8616
|
-
sandbox_versions_available:
|
|
8626
|
+
sandbox_versions_available: N(a()).optional(),
|
|
8617
8627
|
// Change password settings
|
|
8618
8628
|
change_password: _({
|
|
8619
8629
|
enabled: h(),
|
|
@@ -8724,8 +8734,8 @@ const Jc = _({
|
|
|
8724
8734
|
bytes_read: x().optional()
|
|
8725
8735
|
});
|
|
8726
8736
|
_({
|
|
8727
|
-
meta:
|
|
8728
|
-
data:
|
|
8737
|
+
meta: N(Jc),
|
|
8738
|
+
data: N(P(a(), V())),
|
|
8729
8739
|
rows: x(),
|
|
8730
8740
|
rows_before_limit_at_least: x().optional(),
|
|
8731
8741
|
statistics: Qc.optional()
|
|
@@ -8791,26 +8801,26 @@ const Xc = b([
|
|
|
8791
8801
|
public_key: a().optional(),
|
|
8792
8802
|
sign_count: x().int().nonnegative().optional(),
|
|
8793
8803
|
credential_backed_up: h().optional(),
|
|
8794
|
-
transports:
|
|
8804
|
+
transports: N(a()).optional(),
|
|
8795
8805
|
friendly_name: a().optional(),
|
|
8796
8806
|
// Common
|
|
8797
8807
|
confirmed: h().default(!1)
|
|
8798
8808
|
});
|
|
8799
8809
|
function Bs(n, e) {
|
|
8800
8810
|
n.type === "phone" && !n.phone_number && e.addIssue({
|
|
8801
|
-
code:
|
|
8811
|
+
code: S.custom,
|
|
8802
8812
|
message: "phone_number is required when type is 'phone'",
|
|
8803
8813
|
path: ["phone_number"]
|
|
8804
8814
|
}), n.type === "totp" && !n.totp_secret && e.addIssue({
|
|
8805
|
-
code:
|
|
8815
|
+
code: S.custom,
|
|
8806
8816
|
message: "totp_secret is required when type is 'totp'",
|
|
8807
8817
|
path: ["totp_secret"]
|
|
8808
8818
|
}), ["webauthn-roaming", "webauthn-platform", "passkey"].includes(n.type) && (n.credential_id || e.addIssue({
|
|
8809
|
-
code:
|
|
8819
|
+
code: S.custom,
|
|
8810
8820
|
message: `credential_id is required when type is '${n.type}'`,
|
|
8811
8821
|
path: ["credential_id"]
|
|
8812
8822
|
}), n.public_key || e.addIssue({
|
|
8813
|
-
code:
|
|
8823
|
+
code: S.custom,
|
|
8814
8824
|
message: `public_key is required when type is '${n.type}'`,
|
|
8815
8825
|
path: ["public_key"]
|
|
8816
8826
|
}));
|
|
@@ -8858,7 +8868,7 @@ function t_(n) {
|
|
|
8858
8868
|
return {
|
|
8859
8869
|
async create(e, t) {
|
|
8860
8870
|
const i = Date.now();
|
|
8861
|
-
return await n.insert(
|
|
8871
|
+
return await n.insert(X).values({
|
|
8862
8872
|
id: t.id,
|
|
8863
8873
|
tenant_id: e,
|
|
8864
8874
|
token_hash: t.token_hash,
|
|
@@ -8882,63 +8892,63 @@ function t_(n) {
|
|
|
8882
8892
|
};
|
|
8883
8893
|
},
|
|
8884
8894
|
async get(e, t) {
|
|
8885
|
-
const i = await n.select().from(
|
|
8895
|
+
const i = await n.select().from(X).where(
|
|
8886
8896
|
g(
|
|
8887
|
-
c(
|
|
8888
|
-
c(
|
|
8897
|
+
c(X.tenant_id, e),
|
|
8898
|
+
c(X.id, t)
|
|
8889
8899
|
)
|
|
8890
8900
|
).get();
|
|
8891
8901
|
return i ? zn(i) : null;
|
|
8892
8902
|
},
|
|
8893
8903
|
async getByHash(e, t) {
|
|
8894
|
-
const i = await n.select().from(
|
|
8904
|
+
const i = await n.select().from(X).where(
|
|
8895
8905
|
g(
|
|
8896
|
-
c(
|
|
8897
|
-
c(
|
|
8906
|
+
c(X.tenant_id, e),
|
|
8907
|
+
c(X.token_hash, t)
|
|
8898
8908
|
)
|
|
8899
8909
|
).get();
|
|
8900
8910
|
return i ? zn(i) : null;
|
|
8901
8911
|
},
|
|
8902
8912
|
async listByClient(e, t) {
|
|
8903
|
-
return (await n.select().from(
|
|
8913
|
+
return (await n.select().from(X).where(
|
|
8904
8914
|
g(
|
|
8905
|
-
c(
|
|
8906
|
-
c(
|
|
8915
|
+
c(X.tenant_id, e),
|
|
8916
|
+
c(X.client_id, t)
|
|
8907
8917
|
)
|
|
8908
|
-
).orderBy(se(
|
|
8918
|
+
).orderBy(se(X.created_at_ts))).map(zn);
|
|
8909
8919
|
},
|
|
8910
8920
|
async markUsed(e, t, i) {
|
|
8911
|
-
return (await n.update(
|
|
8921
|
+
return (await n.update(X).set({ used_at_ts: an(i) }).where(
|
|
8912
8922
|
g(
|
|
8913
|
-
c(
|
|
8914
|
-
c(
|
|
8915
|
-
Ce(
|
|
8923
|
+
c(X.tenant_id, e),
|
|
8924
|
+
c(X.id, t),
|
|
8925
|
+
Ce(X.used_at_ts)
|
|
8916
8926
|
)
|
|
8917
8927
|
).returning()).length > 0;
|
|
8918
8928
|
},
|
|
8919
8929
|
async revoke(e, t, i) {
|
|
8920
|
-
return (await n.update(
|
|
8930
|
+
return (await n.update(X).set({ revoked_at_ts: an(i) }).where(
|
|
8921
8931
|
g(
|
|
8922
|
-
c(
|
|
8923
|
-
c(
|
|
8924
|
-
Ce(
|
|
8932
|
+
c(X.tenant_id, e),
|
|
8933
|
+
c(X.id, t),
|
|
8934
|
+
Ce(X.revoked_at_ts)
|
|
8925
8935
|
)
|
|
8926
8936
|
).returning()).length > 0;
|
|
8927
8937
|
},
|
|
8928
8938
|
async revokeByClient(e, t, i) {
|
|
8929
|
-
return (await n.update(
|
|
8939
|
+
return (await n.update(X).set({ revoked_at_ts: an(i) }).where(
|
|
8930
8940
|
g(
|
|
8931
|
-
c(
|
|
8932
|
-
c(
|
|
8933
|
-
Ce(
|
|
8941
|
+
c(X.tenant_id, e),
|
|
8942
|
+
c(X.client_id, t),
|
|
8943
|
+
Ce(X.revoked_at_ts)
|
|
8934
8944
|
)
|
|
8935
8945
|
).returning()).length;
|
|
8936
8946
|
},
|
|
8937
8947
|
async remove(e, t) {
|
|
8938
|
-
return (await n.delete(
|
|
8948
|
+
return (await n.delete(X).where(
|
|
8939
8949
|
g(
|
|
8940
|
-
c(
|
|
8941
|
-
c(
|
|
8950
|
+
c(X.tenant_id, e),
|
|
8951
|
+
c(X.id, t)
|
|
8942
8952
|
)
|
|
8943
8953
|
).returning()).length > 0;
|
|
8944
8954
|
}
|
|
@@ -9079,7 +9089,7 @@ function o_(n) {
|
|
|
9079
9089
|
} = t || {};
|
|
9080
9090
|
let u = c(pe.tenant_id, e);
|
|
9081
9091
|
if (d) {
|
|
9082
|
-
const E =
|
|
9092
|
+
const E = We(pe, d, ["name"]);
|
|
9083
9093
|
E && (u = g(u, E));
|
|
9084
9094
|
}
|
|
9085
9095
|
let f = n.select().from(pe).where(u).$dynamic();
|
|
@@ -9181,11 +9191,11 @@ function a_(n) {
|
|
|
9181
9191
|
function s_(n) {
|
|
9182
9192
|
return {
|
|
9183
9193
|
async get(e, t, i) {
|
|
9184
|
-
const o = await n.select().from(
|
|
9194
|
+
const o = await n.select().from(Ne).where(
|
|
9185
9195
|
g(
|
|
9186
|
-
c(
|
|
9187
|
-
c(
|
|
9188
|
-
c(
|
|
9196
|
+
c(Ne.tenant_id, e),
|
|
9197
|
+
c(Ne.prompt, t),
|
|
9198
|
+
c(Ne.language, i)
|
|
9189
9199
|
)
|
|
9190
9200
|
).get();
|
|
9191
9201
|
if (!o) return null;
|
|
@@ -9197,7 +9207,7 @@ function s_(n) {
|
|
|
9197
9207
|
},
|
|
9198
9208
|
async set(e, t, i, o) {
|
|
9199
9209
|
const s = Date.now(), l = JSON.stringify(o);
|
|
9200
|
-
await n.insert(
|
|
9210
|
+
await n.insert(Ne).values({
|
|
9201
9211
|
tenant_id: e,
|
|
9202
9212
|
prompt: t,
|
|
9203
9213
|
language: i,
|
|
@@ -9206,27 +9216,27 @@ function s_(n) {
|
|
|
9206
9216
|
updated_at_ts: s
|
|
9207
9217
|
}).onConflictDoUpdate({
|
|
9208
9218
|
target: [
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9219
|
+
Ne.tenant_id,
|
|
9220
|
+
Ne.prompt,
|
|
9221
|
+
Ne.language
|
|
9212
9222
|
],
|
|
9213
9223
|
set: { custom_text: l, updated_at_ts: s }
|
|
9214
9224
|
});
|
|
9215
9225
|
},
|
|
9216
9226
|
async delete(e, t, i) {
|
|
9217
|
-
await n.delete(
|
|
9227
|
+
await n.delete(Ne).where(
|
|
9218
9228
|
g(
|
|
9219
|
-
c(
|
|
9220
|
-
c(
|
|
9221
|
-
c(
|
|
9229
|
+
c(Ne.tenant_id, e),
|
|
9230
|
+
c(Ne.prompt, t),
|
|
9231
|
+
c(Ne.language, i)
|
|
9222
9232
|
)
|
|
9223
9233
|
);
|
|
9224
9234
|
},
|
|
9225
9235
|
async list(e) {
|
|
9226
9236
|
return await n.select({
|
|
9227
|
-
prompt:
|
|
9228
|
-
language:
|
|
9229
|
-
}).from(
|
|
9237
|
+
prompt: Ne.prompt,
|
|
9238
|
+
language: Ne.language
|
|
9239
|
+
}).from(Ne).where(c(Ne.tenant_id, e)).all();
|
|
9230
9240
|
}
|
|
9231
9241
|
};
|
|
9232
9242
|
}
|
|
@@ -9387,9 +9397,9 @@ function d_(n) {
|
|
|
9387
9397
|
));
|
|
9388
9398
|
}
|
|
9389
9399
|
const f = (await d.offset(i * o).limit(o)).map((m) => {
|
|
9390
|
-
const { tenant_id: y, actions: E, ...
|
|
9400
|
+
const { tenant_id: y, actions: E, ...T } = m;
|
|
9391
9401
|
return Q({
|
|
9392
|
-
...
|
|
9402
|
+
...T,
|
|
9393
9403
|
actions: F(E, [])
|
|
9394
9404
|
});
|
|
9395
9405
|
});
|
|
@@ -9465,10 +9475,10 @@ function c_(n) {
|
|
|
9465
9475
|
));
|
|
9466
9476
|
}
|
|
9467
9477
|
const f = (await d.offset(i * o).limit(o)).map((m) => {
|
|
9468
|
-
const { tenant_id: y, ...E } = m,
|
|
9478
|
+
const { tenant_id: y, ...E } = m, T = { ...E };
|
|
9469
9479
|
for (const G of rn)
|
|
9470
|
-
|
|
9471
|
-
return Q(
|
|
9480
|
+
T[G] = F(E[G]);
|
|
9481
|
+
return Q(T);
|
|
9472
9482
|
});
|
|
9473
9483
|
if (!s)
|
|
9474
9484
|
return { forms: f };
|
|
@@ -9500,7 +9510,7 @@ function $s(n) {
|
|
|
9500
9510
|
function ci(n, e = (/* @__PURE__ */ new Date(0)).toISOString()) {
|
|
9501
9511
|
return $s(n) ?? e;
|
|
9502
9512
|
}
|
|
9503
|
-
function
|
|
9513
|
+
function ne(n) {
|
|
9504
9514
|
if (!n || n === "")
|
|
9505
9515
|
return null;
|
|
9506
9516
|
const e = new Date(n);
|
|
@@ -9624,7 +9634,7 @@ function g_(n) {
|
|
|
9624
9634
|
include_totals: s = !1,
|
|
9625
9635
|
sort: l,
|
|
9626
9636
|
q: d
|
|
9627
|
-
} = t || {}, u = d ?
|
|
9637
|
+
} = t || {}, u = d ? We(me, d, [
|
|
9628
9638
|
"url",
|
|
9629
9639
|
"form_id",
|
|
9630
9640
|
"template_id",
|
|
@@ -9638,12 +9648,12 @@ function g_(n) {
|
|
|
9638
9648
|
const E = (await p.offset(i * o).limit(o)).map(qn);
|
|
9639
9649
|
if (!s)
|
|
9640
9650
|
return { hooks: E };
|
|
9641
|
-
const [
|
|
9651
|
+
const [T] = await n.select({ count: ge() }).from(me).where(f);
|
|
9642
9652
|
return {
|
|
9643
9653
|
hooks: E,
|
|
9644
9654
|
start: i * o,
|
|
9645
9655
|
limit: o,
|
|
9646
|
-
length: Number((
|
|
9656
|
+
length: Number((T == null ? void 0 : T.count) ?? 0)
|
|
9647
9657
|
};
|
|
9648
9658
|
},
|
|
9649
9659
|
async remove(e, t) {
|
|
@@ -9811,7 +9821,7 @@ function Li(n) {
|
|
|
9811
9821
|
state_data: F(s)
|
|
9812
9822
|
});
|
|
9813
9823
|
}
|
|
9814
|
-
function
|
|
9824
|
+
function S_(n) {
|
|
9815
9825
|
return {
|
|
9816
9826
|
async create(e, t) {
|
|
9817
9827
|
var l, d;
|
|
@@ -9835,12 +9845,12 @@ function N_(n) {
|
|
|
9835
9845
|
authenticated_at: t.authenticated_at,
|
|
9836
9846
|
created_at_ts: i,
|
|
9837
9847
|
updated_at_ts: i,
|
|
9838
|
-
expires_at_ts: t.expires_at ?
|
|
9848
|
+
expires_at_ts: t.expires_at ? ne(t.expires_at) : i + 1e3 * 60 * 60 * 24
|
|
9839
9849
|
};
|
|
9840
|
-
return await n.insert(
|
|
9850
|
+
return await n.insert(Y).values(s), Li({ ...s, tenant_id: e });
|
|
9841
9851
|
},
|
|
9842
9852
|
async get(e, t) {
|
|
9843
|
-
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();
|
|
9844
9854
|
return o ? Li(o) : null;
|
|
9845
9855
|
},
|
|
9846
9856
|
async update(e, t, i) {
|
|
@@ -9851,11 +9861,11 @@ function N_(n) {
|
|
|
9851
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(
|
|
9852
9862
|
0,
|
|
9853
9863
|
1024
|
|
9854
|
-
)), i.expires_at !== void 0 && (o.expires_at_ts =
|
|
9855
|
-
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(
|
|
9856
9866
|
g(
|
|
9857
|
-
c(
|
|
9858
|
-
c(
|
|
9867
|
+
c(Y.tenant_id, e),
|
|
9868
|
+
c(Y.id, t)
|
|
9859
9869
|
)
|
|
9860
9870
|
).get(), f = u != null && u.auth_params && typeof u.auth_params == "string" && u.auth_params.length > 0 ? JSON.parse(u.auth_params) : {};
|
|
9861
9871
|
o.auth_params = JSON.stringify({
|
|
@@ -9863,13 +9873,13 @@ function N_(n) {
|
|
|
9863
9873
|
...i.authParams
|
|
9864
9874
|
});
|
|
9865
9875
|
}
|
|
9866
|
-
return await n.update(
|
|
9867
|
-
g(c(
|
|
9876
|
+
return await n.update(Y).set(o).where(
|
|
9877
|
+
g(c(Y.tenant_id, e), c(Y.id, t))
|
|
9868
9878
|
), !0;
|
|
9869
9879
|
},
|
|
9870
9880
|
async remove(e, t) {
|
|
9871
|
-
return (await n.delete(
|
|
9872
|
-
g(c(
|
|
9881
|
+
return (await n.delete(Y).where(
|
|
9882
|
+
g(c(Y.tenant_id, e), c(Y.id, t))
|
|
9873
9883
|
).returning()).length > 0;
|
|
9874
9884
|
}
|
|
9875
9885
|
};
|
|
@@ -9904,7 +9914,7 @@ function $n(n) {
|
|
|
9904
9914
|
continent_code: p
|
|
9905
9915
|
})), Q(E);
|
|
9906
9916
|
}
|
|
9907
|
-
function
|
|
9917
|
+
function N_(n) {
|
|
9908
9918
|
return {
|
|
9909
9919
|
async create(e, t) {
|
|
9910
9920
|
var s, l;
|
|
@@ -9939,34 +9949,48 @@ function S_(n) {
|
|
|
9939
9949
|
per_page: o = 50,
|
|
9940
9950
|
include_totals: s = !1,
|
|
9941
9951
|
sort: l,
|
|
9942
|
-
q: d
|
|
9943
|
-
|
|
9944
|
-
|
|
9952
|
+
q: d,
|
|
9953
|
+
from_date: u,
|
|
9954
|
+
to_date: f
|
|
9955
|
+
} = t || {}, p = [c(z.tenant_id, e)];
|
|
9945
9956
|
if (d) {
|
|
9946
|
-
const
|
|
9957
|
+
const W = We(z, d, [
|
|
9947
9958
|
"user_id",
|
|
9948
9959
|
"ip",
|
|
9949
9960
|
"type",
|
|
9950
9961
|
"client_id"
|
|
9951
9962
|
]);
|
|
9952
|
-
|
|
9963
|
+
W && p.push(W);
|
|
9953
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();
|
|
9954
9978
|
if (l != null && l.sort_by) {
|
|
9955
|
-
const
|
|
9956
|
-
|
|
9957
|
-
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)
|
|
9958
9982
|
));
|
|
9959
9983
|
} else
|
|
9960
|
-
|
|
9961
|
-
const
|
|
9984
|
+
y = y.orderBy(se(z.date));
|
|
9985
|
+
const T = (await y.offset(i * o).limit(o)).map($n);
|
|
9962
9986
|
if (!s)
|
|
9963
|
-
return { logs:
|
|
9964
|
-
const [
|
|
9987
|
+
return { logs: T };
|
|
9988
|
+
const [G] = await n.select({ count: ge() }).from(z).where(m);
|
|
9965
9989
|
return {
|
|
9966
|
-
logs:
|
|
9990
|
+
logs: T,
|
|
9967
9991
|
start: i * o,
|
|
9968
9992
|
limit: o,
|
|
9969
|
-
length: Number((
|
|
9993
|
+
length: Number((G == null ? void 0 : G.count) ?? 0)
|
|
9970
9994
|
};
|
|
9971
9995
|
},
|
|
9972
9996
|
async get(e, t) {
|
|
@@ -10118,7 +10142,7 @@ function k_(n) {
|
|
|
10118
10142
|
updated_at: i
|
|
10119
10143
|
};
|
|
10120
10144
|
try {
|
|
10121
|
-
await n.insert(
|
|
10145
|
+
await n.insert(ee).values(s);
|
|
10122
10146
|
} catch (u) {
|
|
10123
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, {
|
|
10124
10148
|
message: "Organization already exists"
|
|
@@ -10127,13 +10151,13 @@ function k_(n) {
|
|
|
10127
10151
|
return Vn({ ...s, tenant_id: e });
|
|
10128
10152
|
},
|
|
10129
10153
|
async get(e, t) {
|
|
10130
|
-
let i = await n.select().from(
|
|
10131
|
-
g(c(
|
|
10154
|
+
let i = await n.select().from(ee).where(
|
|
10155
|
+
g(c(ee.tenant_id, e), c(ee.id, t))
|
|
10132
10156
|
).get();
|
|
10133
|
-
return i || (i = await n.select().from(
|
|
10157
|
+
return i || (i = await n.select().from(ee).where(
|
|
10134
10158
|
g(
|
|
10135
|
-
c(
|
|
10136
|
-
c(
|
|
10159
|
+
c(ee.tenant_id, e),
|
|
10160
|
+
c(ee.name, t)
|
|
10137
10161
|
)
|
|
10138
10162
|
).get()), i ? Vn(i) : null;
|
|
10139
10163
|
},
|
|
@@ -10143,8 +10167,8 @@ function k_(n) {
|
|
|
10143
10167
|
};
|
|
10144
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(
|
|
10145
10169
|
i.enabled_connections
|
|
10146
|
-
)), i.token_quota !== void 0 && (o.token_quota = JSON.stringify(i.token_quota)), (await n.update(
|
|
10147
|
-
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))
|
|
10148
10172
|
).returning()).length > 0;
|
|
10149
10173
|
},
|
|
10150
10174
|
async list(e, t) {
|
|
@@ -10155,14 +10179,14 @@ function k_(n) {
|
|
|
10155
10179
|
sort: l,
|
|
10156
10180
|
q: d
|
|
10157
10181
|
} = t || {};
|
|
10158
|
-
let u = n.select().from(
|
|
10182
|
+
let u = n.select().from(ee).where(c(ee.tenant_id, e)).$dynamic();
|
|
10159
10183
|
if (d && (u = u.where(
|
|
10160
10184
|
$e(
|
|
10161
|
-
xt(
|
|
10162
|
-
xt(
|
|
10185
|
+
xt(ee.name, `%${d}%`),
|
|
10186
|
+
xt(ee.display_name, `%${d}%`)
|
|
10163
10187
|
)
|
|
10164
10188
|
)), l != null && l.sort_by) {
|
|
10165
|
-
const E =
|
|
10189
|
+
const E = ee[l.sort_by];
|
|
10166
10190
|
E && (u = u.orderBy(
|
|
10167
10191
|
l.sort_order === "desc" ? se(E) : he(E)
|
|
10168
10192
|
));
|
|
@@ -10170,14 +10194,14 @@ function k_(n) {
|
|
|
10170
10194
|
const p = (await u.offset(i * o).limit(o)).map(Vn);
|
|
10171
10195
|
if (!s)
|
|
10172
10196
|
return { organizations: p };
|
|
10173
|
-
const m = [c(
|
|
10197
|
+
const m = [c(ee.tenant_id, e)];
|
|
10174
10198
|
d && m.push(
|
|
10175
10199
|
$e(
|
|
10176
|
-
xt(
|
|
10177
|
-
xt(
|
|
10200
|
+
xt(ee.name, `%${d}%`),
|
|
10201
|
+
xt(ee.display_name, `%${d}%`)
|
|
10178
10202
|
)
|
|
10179
10203
|
);
|
|
10180
|
-
const [y] = await n.select({ count: ge() }).from(
|
|
10204
|
+
const [y] = await n.select({ count: ge() }).from(ee).where(g(...m));
|
|
10181
10205
|
return {
|
|
10182
10206
|
organizations: p,
|
|
10183
10207
|
start: i * o,
|
|
@@ -10186,8 +10210,8 @@ function k_(n) {
|
|
|
10186
10210
|
};
|
|
10187
10211
|
},
|
|
10188
10212
|
async remove(e, t) {
|
|
10189
|
-
return (await n.delete(
|
|
10190
|
-
g(c(
|
|
10213
|
+
return (await n.delete(ee).where(
|
|
10214
|
+
g(c(ee.tenant_id, e), c(ee.id, t))
|
|
10191
10215
|
).returning()).length > 0;
|
|
10192
10216
|
}
|
|
10193
10217
|
};
|
|
@@ -10262,7 +10286,7 @@ function O_(n) {
|
|
|
10262
10286
|
function T_(n) {
|
|
10263
10287
|
return {
|
|
10264
10288
|
async get(e) {
|
|
10265
|
-
const t = await n.select().from(
|
|
10289
|
+
const t = await n.select().from(Ut).where(c(Ut.tenant_id, e)).get();
|
|
10266
10290
|
return t ? {
|
|
10267
10291
|
universal_login_experience: t.universal_login_experience,
|
|
10268
10292
|
identifier_first: !!t.identifier_first,
|
|
@@ -10276,14 +10300,14 @@ function T_(n) {
|
|
|
10276
10300
|
};
|
|
10277
10301
|
},
|
|
10278
10302
|
async set(e, t) {
|
|
10279
|
-
await n.insert(
|
|
10303
|
+
await n.insert(Ut).values({
|
|
10280
10304
|
tenant_id: e,
|
|
10281
10305
|
universal_login_experience: t.universal_login_experience,
|
|
10282
10306
|
identifier_first: t.identifier_first,
|
|
10283
10307
|
password_first: t.password_first,
|
|
10284
10308
|
webauthn_platform_first_factor: t.webauthn_platform_first_factor
|
|
10285
10309
|
}).onConflictDoUpdate({
|
|
10286
|
-
target:
|
|
10310
|
+
target: Ut.tenant_id,
|
|
10287
10311
|
set: {
|
|
10288
10312
|
universal_login_experience: t.universal_login_experience,
|
|
10289
10313
|
identifier_first: t.identifier_first,
|
|
@@ -10352,11 +10376,11 @@ function I_(n) {
|
|
|
10352
10376
|
token_hash: t.token_hash ?? null,
|
|
10353
10377
|
family_id: t.family_id ?? null,
|
|
10354
10378
|
rotated_to: t.rotated_to ?? null,
|
|
10355
|
-
rotated_at_ts:
|
|
10379
|
+
rotated_at_ts: ne(t.rotated_at),
|
|
10356
10380
|
created_at_ts: i,
|
|
10357
|
-
expires_at_ts:
|
|
10358
|
-
idle_expires_at_ts:
|
|
10359
|
-
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)
|
|
10360
10384
|
};
|
|
10361
10385
|
await n.run(O`BEGIN`);
|
|
10362
10386
|
try {
|
|
@@ -10365,14 +10389,14 @@ function I_(n) {
|
|
|
10365
10389
|
o.expires_at_ts,
|
|
10366
10390
|
o.idle_expires_at_ts
|
|
10367
10391
|
);
|
|
10368
|
-
s > 0 && o.login_id && await n.update(
|
|
10392
|
+
s > 0 && o.login_id && await n.update(Y).set({
|
|
10369
10393
|
expires_at_ts: s,
|
|
10370
10394
|
updated_at_ts: i
|
|
10371
10395
|
}).where(
|
|
10372
10396
|
g(
|
|
10373
|
-
c(
|
|
10374
|
-
c(
|
|
10375
|
-
|
|
10397
|
+
c(Y.tenant_id, e),
|
|
10398
|
+
c(Y.id, o.login_id),
|
|
10399
|
+
Qe(Y.expires_at_ts, s)
|
|
10376
10400
|
)
|
|
10377
10401
|
), await n.run(O`COMMIT`);
|
|
10378
10402
|
} catch (s) {
|
|
@@ -10397,18 +10421,18 @@ function I_(n) {
|
|
|
10397
10421
|
},
|
|
10398
10422
|
async update(e, t, i, o) {
|
|
10399
10423
|
const s = {};
|
|
10400
|
-
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 =
|
|
10401
|
-
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(
|
|
10402
10426
|
g(c(J.tenant_id, e), c(J.id, t))
|
|
10403
10427
|
).returning();
|
|
10404
|
-
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({
|
|
10405
10429
|
expires_at_ts: d,
|
|
10406
10430
|
updated_at_ts: Date.now()
|
|
10407
10431
|
}).where(
|
|
10408
10432
|
g(
|
|
10409
|
-
c(
|
|
10410
|
-
c(
|
|
10411
|
-
|
|
10433
|
+
c(Y.tenant_id, e),
|
|
10434
|
+
c(Y.id, l.login_id),
|
|
10435
|
+
Qe(Y.expires_at_ts, d)
|
|
10412
10436
|
)
|
|
10413
10437
|
).catch(() => {
|
|
10414
10438
|
}), u.length > 0;
|
|
@@ -10423,7 +10447,7 @@ function I_(n) {
|
|
|
10423
10447
|
} = t || {};
|
|
10424
10448
|
let u = n.select().from(J).where(c(J.tenant_id, e)).$dynamic();
|
|
10425
10449
|
if (d) {
|
|
10426
|
-
const y =
|
|
10450
|
+
const y = We(J, d, ["user_id"]);
|
|
10427
10451
|
y && (u = u.where(
|
|
10428
10452
|
g(c(J.tenant_id, e), y)
|
|
10429
10453
|
));
|
|
@@ -10451,7 +10475,7 @@ function I_(n) {
|
|
|
10451
10475
|
).returning()).length > 0;
|
|
10452
10476
|
},
|
|
10453
10477
|
async revokeByLoginSession(e, t, i) {
|
|
10454
|
-
return (await n.update(J).set({ revoked_at_ts:
|
|
10478
|
+
return (await n.update(J).set({ revoked_at_ts: ne(i) }).where(
|
|
10455
10479
|
g(
|
|
10456
10480
|
c(J.tenant_id, e),
|
|
10457
10481
|
c(J.login_id, t),
|
|
@@ -10460,7 +10484,7 @@ function I_(n) {
|
|
|
10460
10484
|
).returning()).length;
|
|
10461
10485
|
},
|
|
10462
10486
|
async revokeFamily(e, t, i) {
|
|
10463
|
-
return (await n.update(J).set({ revoked_at_ts:
|
|
10487
|
+
return (await n.update(J).set({ revoked_at_ts: ne(i) }).where(
|
|
10464
10488
|
g(
|
|
10465
10489
|
c(J.tenant_id, e),
|
|
10466
10490
|
c(J.family_id, t),
|
|
@@ -10532,13 +10556,13 @@ function D_(n) {
|
|
|
10532
10556
|
};
|
|
10533
10557
|
for (const l of fi)
|
|
10534
10558
|
t[l] !== void 0 && (s[l] = t[l] ? 1 : 0);
|
|
10535
|
-
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 });
|
|
10536
10560
|
},
|
|
10537
10561
|
async get(e, t) {
|
|
10538
|
-
const i = await n.select().from(
|
|
10562
|
+
const i = await n.select().from(te).where(
|
|
10539
10563
|
g(
|
|
10540
|
-
c(
|
|
10541
|
-
c(
|
|
10564
|
+
c(te.tenant_id, e),
|
|
10565
|
+
c(te.id, t)
|
|
10542
10566
|
)
|
|
10543
10567
|
).get();
|
|
10544
10568
|
return i ? Hn(i) : null;
|
|
@@ -10547,13 +10571,13 @@ function D_(n) {
|
|
|
10547
10571
|
const o = {
|
|
10548
10572
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
10549
10573
|
};
|
|
10550
|
-
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);
|
|
10551
10575
|
for (const l of fi)
|
|
10552
10576
|
i[l] !== void 0 && (o[l] = i[l] ? 1 : 0);
|
|
10553
|
-
return (await n.update(
|
|
10577
|
+
return (await n.update(te).set(o).where(
|
|
10554
10578
|
g(
|
|
10555
|
-
c(
|
|
10556
|
-
c(
|
|
10579
|
+
c(te.tenant_id, e),
|
|
10580
|
+
c(te.id, t)
|
|
10557
10581
|
)
|
|
10558
10582
|
).returning()).length > 0;
|
|
10559
10583
|
},
|
|
@@ -10567,20 +10591,20 @@ function D_(n) {
|
|
|
10567
10591
|
} = t || {}, u = Math.max(0, Math.floor(Number(i) || 0)), f = Math.min(
|
|
10568
10592
|
Math.max(1, Math.floor(Number(o) || 50)),
|
|
10569
10593
|
500
|
|
10570
|
-
), p = [c(
|
|
10594
|
+
), p = [c(te.tenant_id, e)];
|
|
10571
10595
|
if (d) {
|
|
10572
10596
|
const G = d.match(/^([^:]+):(.+)$/);
|
|
10573
10597
|
if (G) {
|
|
10574
|
-
const [,
|
|
10575
|
-
if (
|
|
10576
|
-
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];
|
|
10577
10601
|
p.push(xt(Ee, `%${ie}%`));
|
|
10578
10602
|
}
|
|
10579
10603
|
}
|
|
10580
10604
|
}
|
|
10581
|
-
let m = n.select().from(
|
|
10605
|
+
let m = n.select().from(te).where(g(...p)).$dynamic();
|
|
10582
10606
|
if (l != null && l.sort_by && Ri.has(l.sort_by)) {
|
|
10583
|
-
const G =
|
|
10607
|
+
const G = te[l.sort_by];
|
|
10584
10608
|
m = m.orderBy(
|
|
10585
10609
|
l.sort_order === "desc" ? se(G) : he(G)
|
|
10586
10610
|
);
|
|
@@ -10588,19 +10612,19 @@ function D_(n) {
|
|
|
10588
10612
|
const E = (await m.offset(u * f).limit(f)).map(Hn);
|
|
10589
10613
|
if (!s)
|
|
10590
10614
|
return { resource_servers: E };
|
|
10591
|
-
const [
|
|
10615
|
+
const [T] = await n.select({ count: ge() }).from(te).where(g(...p));
|
|
10592
10616
|
return {
|
|
10593
10617
|
resource_servers: E,
|
|
10594
10618
|
start: u * f,
|
|
10595
10619
|
limit: f,
|
|
10596
|
-
length: Number((
|
|
10620
|
+
length: Number((T == null ? void 0 : T.count) ?? 0)
|
|
10597
10621
|
};
|
|
10598
10622
|
},
|
|
10599
10623
|
async remove(e, t) {
|
|
10600
|
-
return (await n.delete(
|
|
10624
|
+
return (await n.delete(te).where(
|
|
10601
10625
|
g(
|
|
10602
|
-
c(
|
|
10603
|
-
c(
|
|
10626
|
+
c(te.tenant_id, e),
|
|
10627
|
+
c(te.id, t)
|
|
10604
10628
|
)
|
|
10605
10629
|
).returning()).length > 0;
|
|
10606
10630
|
}
|
|
@@ -10635,12 +10659,12 @@ function L_(n) {
|
|
|
10635
10659
|
], l = /* @__PURE__ */ new Map();
|
|
10636
10660
|
if (s.length > 0) {
|
|
10637
10661
|
const d = await n.select({
|
|
10638
|
-
identifier:
|
|
10639
|
-
name:
|
|
10640
|
-
}).from(
|
|
10662
|
+
identifier: te.identifier,
|
|
10663
|
+
name: te.name
|
|
10664
|
+
}).from(te).where(
|
|
10641
10665
|
g(
|
|
10642
|
-
c(
|
|
10643
|
-
De(
|
|
10666
|
+
c(te.tenant_id, e),
|
|
10667
|
+
De(te.identifier, s)
|
|
10644
10668
|
)
|
|
10645
10669
|
).all();
|
|
10646
10670
|
for (const u of d)
|
|
@@ -10700,10 +10724,10 @@ function R_(n) {
|
|
|
10700
10724
|
const l = await n.select().from(Me).where(g(...s)).all();
|
|
10701
10725
|
return await Promise.all(
|
|
10702
10726
|
l.map(async (u) => {
|
|
10703
|
-
const f = await n.select({ name:
|
|
10727
|
+
const f = await n.select({ name: te.name }).from(te).where(
|
|
10704
10728
|
g(
|
|
10705
|
-
c(
|
|
10706
|
-
c(
|
|
10729
|
+
c(te.tenant_id, e),
|
|
10730
|
+
c(te.identifier, u.resource_server_identifier)
|
|
10707
10731
|
)
|
|
10708
10732
|
).get();
|
|
10709
10733
|
return {
|
|
@@ -10771,12 +10795,12 @@ function U_(n) {
|
|
|
10771
10795
|
include_totals: s = !1,
|
|
10772
10796
|
sort: l,
|
|
10773
10797
|
q: d
|
|
10774
|
-
} = 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);
|
|
10775
10799
|
let p = n.select().from(_e).where(f).$dynamic();
|
|
10776
10800
|
if (l != null && l.sort_by) {
|
|
10777
|
-
const
|
|
10778
|
-
|
|
10779
|
-
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)
|
|
10780
10804
|
));
|
|
10781
10805
|
}
|
|
10782
10806
|
const y = (await p.offset(i * o).limit(o)).map(Kn);
|
|
@@ -10850,12 +10874,12 @@ function P_(n) {
|
|
|
10850
10874
|
clients: JSON.stringify(t.clients || []),
|
|
10851
10875
|
created_at_ts: i,
|
|
10852
10876
|
updated_at_ts: i,
|
|
10853
|
-
expires_at_ts:
|
|
10854
|
-
idle_expires_at_ts:
|
|
10855
|
-
authenticated_at_ts: t.authenticated_at ?
|
|
10856
|
-
last_interaction_at_ts: t.last_interaction_at ?
|
|
10857
|
-
used_at_ts:
|
|
10858
|
-
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)
|
|
10859
10883
|
};
|
|
10860
10884
|
return await n.insert(ae).values(o), Jn({ ...o, tenant_id: e });
|
|
10861
10885
|
},
|
|
@@ -10867,9 +10891,9 @@ function P_(n) {
|
|
|
10867
10891
|
const o = {
|
|
10868
10892
|
updated_at_ts: Date.now()
|
|
10869
10893
|
};
|
|
10870
|
-
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(
|
|
10871
10895
|
i.last_interaction_at
|
|
10872
|
-
)), 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;
|
|
10873
10897
|
},
|
|
10874
10898
|
async list(e, t) {
|
|
10875
10899
|
const {
|
|
@@ -10878,12 +10902,12 @@ function P_(n) {
|
|
|
10878
10902
|
include_totals: s = !1,
|
|
10879
10903
|
sort: l,
|
|
10880
10904
|
q: d
|
|
10881
|
-
} = 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);
|
|
10882
10906
|
let p = n.select().from(ae).where(f).$dynamic();
|
|
10883
10907
|
if (l != null && l.sort_by) {
|
|
10884
|
-
const
|
|
10885
|
-
|
|
10886
|
-
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)
|
|
10887
10911
|
));
|
|
10888
10912
|
}
|
|
10889
10913
|
const y = (await p.offset(i * o).limit(o)).map(Jn);
|
|
@@ -10976,7 +11000,7 @@ function q_(n) {
|
|
|
10976
11000
|
} = e || {};
|
|
10977
11001
|
let d = n.select().from(B).$dynamic();
|
|
10978
11002
|
if (l) {
|
|
10979
|
-
const m =
|
|
11003
|
+
const m = We(B, l, ["friendly_name"]);
|
|
10980
11004
|
m && (d = d.where(m));
|
|
10981
11005
|
}
|
|
10982
11006
|
if (s != null && s.sort_by) {
|
|
@@ -11102,7 +11126,7 @@ function Qn(n, e = []) {
|
|
|
11102
11126
|
linked_to: f,
|
|
11103
11127
|
profileData: p,
|
|
11104
11128
|
...m
|
|
11105
|
-
} = n, y = Pi(n, !0), E = e.map((
|
|
11129
|
+
} = n, y = Pi(n, !0), E = e.map((T) => Pi(T, !1));
|
|
11106
11130
|
return Q({
|
|
11107
11131
|
...m,
|
|
11108
11132
|
email: n.email || "",
|
|
@@ -11235,7 +11259,7 @@ function j_(n) {
|
|
|
11235
11259
|
Ce(Z.linked_to)
|
|
11236
11260
|
];
|
|
11237
11261
|
if (u) {
|
|
11238
|
-
const ie =
|
|
11262
|
+
const ie = We(Z, u, [
|
|
11239
11263
|
"email",
|
|
11240
11264
|
"name",
|
|
11241
11265
|
"nickname",
|
|
@@ -11252,25 +11276,25 @@ function j_(n) {
|
|
|
11252
11276
|
));
|
|
11253
11277
|
}
|
|
11254
11278
|
const y = await m.offset(o * s).limit(s), E = y.map((ie) => ie.user_id);
|
|
11255
|
-
let
|
|
11256
|
-
E.length > 0 && (
|
|
11279
|
+
let T = [];
|
|
11280
|
+
E.length > 0 && (T = await n.select().from(Z).where(
|
|
11257
11281
|
g(
|
|
11258
11282
|
c(Z.tenant_id, t),
|
|
11259
11283
|
De(Z.linked_to, E)
|
|
11260
11284
|
)
|
|
11261
11285
|
));
|
|
11262
11286
|
const G = y.map((ie) => {
|
|
11263
|
-
const qe =
|
|
11287
|
+
const qe = T.filter((Se) => Se.linked_to === ie.user_id);
|
|
11264
11288
|
return Qn(ie, qe);
|
|
11265
11289
|
});
|
|
11266
11290
|
if (!l)
|
|
11267
11291
|
return { users: G };
|
|
11268
|
-
const [
|
|
11292
|
+
const [W] = await n.select({ count: ge() }).from(Z).where(p);
|
|
11269
11293
|
return {
|
|
11270
11294
|
users: G,
|
|
11271
11295
|
start: o * s,
|
|
11272
11296
|
limit: s,
|
|
11273
|
-
length: Number((
|
|
11297
|
+
length: Number((W == null ? void 0 : W.count) ?? 0)
|
|
11274
11298
|
};
|
|
11275
11299
|
},
|
|
11276
11300
|
async remove(t, i) {
|
|
@@ -11420,15 +11444,15 @@ function Z_(n) {
|
|
|
11420
11444
|
} = t || {}, d = c(le.tenant_id, e);
|
|
11421
11445
|
let u = d;
|
|
11422
11446
|
if (l) {
|
|
11423
|
-
const y =
|
|
11447
|
+
const y = We(le, l, [
|
|
11424
11448
|
"user_id",
|
|
11425
11449
|
"organization_id"
|
|
11426
11450
|
]);
|
|
11427
11451
|
y && (u = g(d, y));
|
|
11428
11452
|
}
|
|
11429
11453
|
const p = (await n.select().from(le).where(u).offset(i * o).limit(o)).map((y) => {
|
|
11430
|
-
const { tenant_id: E, ...
|
|
11431
|
-
return
|
|
11454
|
+
const { tenant_id: E, ...T } = y;
|
|
11455
|
+
return T;
|
|
11432
11456
|
});
|
|
11433
11457
|
if (!s)
|
|
11434
11458
|
return { userOrganizations: p };
|
|
@@ -11448,26 +11472,26 @@ function Z_(n) {
|
|
|
11448
11472
|
)
|
|
11449
11473
|
).offset(o * s).limit(s).all(), f = (await Promise.all(
|
|
11450
11474
|
d.map(async (m) => {
|
|
11451
|
-
const y = await n.select().from(
|
|
11475
|
+
const y = await n.select().from(ee).where(
|
|
11452
11476
|
g(
|
|
11453
|
-
c(
|
|
11454
|
-
c(
|
|
11477
|
+
c(ee.tenant_id, e),
|
|
11478
|
+
c(ee.id, m.organization_id)
|
|
11455
11479
|
)
|
|
11456
11480
|
).get();
|
|
11457
11481
|
if (!y) return null;
|
|
11458
11482
|
const {
|
|
11459
11483
|
tenant_id: E,
|
|
11460
|
-
branding:
|
|
11484
|
+
branding: T,
|
|
11461
11485
|
metadata: G,
|
|
11462
|
-
enabled_connections:
|
|
11486
|
+
enabled_connections: W,
|
|
11463
11487
|
token_quota: ie,
|
|
11464
11488
|
...qe
|
|
11465
11489
|
} = y;
|
|
11466
11490
|
return Q({
|
|
11467
11491
|
...qe,
|
|
11468
|
-
branding: F(
|
|
11492
|
+
branding: F(T, {}),
|
|
11469
11493
|
metadata: F(G, {}),
|
|
11470
|
-
enabled_connections: F(
|
|
11494
|
+
enabled_connections: F(W, []),
|
|
11471
11495
|
token_quota: F(ie, {})
|
|
11472
11496
|
});
|
|
11473
11497
|
})
|
|
@@ -11521,7 +11545,7 @@ function K_(n) {
|
|
|
11521
11545
|
}).from(z).where(
|
|
11522
11546
|
g(
|
|
11523
11547
|
c(z.tenant_id, e),
|
|
11524
|
-
|
|
11548
|
+
Tt(z.date, o),
|
|
11525
11549
|
yt(z.date, `${s}T23:59:59.999Z`)
|
|
11526
11550
|
)
|
|
11527
11551
|
).groupBy(O`substr(${z.date}, 1, 10)`).orderBy(O`substr(${z.date}, 1, 10)`).all()).map((d) => ({
|
|
@@ -11541,7 +11565,7 @@ function K_(n) {
|
|
|
11541
11565
|
}).from(z).where(
|
|
11542
11566
|
g(
|
|
11543
11567
|
c(z.tenant_id, e),
|
|
11544
|
-
|
|
11568
|
+
Tt(z.date, t),
|
|
11545
11569
|
O`${z.type} IN (${O.join(
|
|
11546
11570
|
qi.map((o) => O`${o}`),
|
|
11547
11571
|
O`, `
|
|
@@ -11601,30 +11625,30 @@ function W_(n) {
|
|
|
11601
11625
|
function X_(n) {
|
|
11602
11626
|
return {
|
|
11603
11627
|
async query(e, t, i) {
|
|
11604
|
-
var G,
|
|
11628
|
+
var G, W, ie, qe;
|
|
11605
11629
|
const o = Date.now(), s = J_[t], l = Q_[t], d = [
|
|
11606
11630
|
c(z.tenant_id, e),
|
|
11607
|
-
|
|
11608
|
-
|
|
11631
|
+
Tt(z.date, i.from),
|
|
11632
|
+
Qe(z.date, i.to),
|
|
11609
11633
|
De(z.type, s)
|
|
11610
11634
|
];
|
|
11611
|
-
(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(
|
|
11612
11636
|
De(
|
|
11613
11637
|
z.strategy_type,
|
|
11614
11638
|
i.filters.user_type
|
|
11615
11639
|
)
|
|
11616
11640
|
), (qe = i.filters.user_id) != null && qe.length && d.push(De(z.user_id, i.filters.user_id));
|
|
11617
11641
|
const u = {}, f = [], p = [];
|
|
11618
|
-
for (const
|
|
11619
|
-
if (
|
|
11642
|
+
for (const Se of i.group_by)
|
|
11643
|
+
if (Se === "time") {
|
|
11620
11644
|
const Ee = G_(i.interval);
|
|
11621
11645
|
u.time = Ee, f.push(Ee), p.push({
|
|
11622
11646
|
name: "time",
|
|
11623
11647
|
type: i.interval === "hour" ? "DateTime" : "Date"
|
|
11624
11648
|
});
|
|
11625
11649
|
} else {
|
|
11626
|
-
const Ee = W_(
|
|
11627
|
-
u[
|
|
11650
|
+
const Ee = W_(Se);
|
|
11651
|
+
u[Se] = Ee, f.push(Ee), p.push({ name: Se, type: "String" });
|
|
11628
11652
|
}
|
|
11629
11653
|
u[l.alias] = l.agg === "uniq" ? O`COUNT(DISTINCT ${z.user_id})` : O`COUNT(*)`, p.push({ name: l.alias, type: l.type });
|
|
11630
11654
|
let m = n.select(u).from(z).where(g(...d));
|
|
@@ -11633,30 +11657,30 @@ function X_(n) {
|
|
|
11633
11657
|
...Object.keys(u)
|
|
11634
11658
|
]);
|
|
11635
11659
|
if (i.order_by) {
|
|
11636
|
-
const
|
|
11660
|
+
const Se = i.order_by.startsWith("-"), Ee = Se ? i.order_by.slice(1) : i.order_by;
|
|
11637
11661
|
if (!y.has(Ee))
|
|
11638
11662
|
throw new Error(
|
|
11639
11663
|
`Invalid order_by column '${Ee}' for analytics query`
|
|
11640
11664
|
);
|
|
11641
11665
|
const it = Gn(Ee);
|
|
11642
|
-
m = m.orderBy(O.raw(`${it} ${
|
|
11666
|
+
m = m.orderBy(O.raw(`${it} ${Se ? "DESC" : "ASC"}`));
|
|
11643
11667
|
} else i.group_by[0] === "time" ? m = m.orderBy(O.raw(`${Gn("time")} ASC`)) : m = m.orderBy(
|
|
11644
11668
|
O.raw(`${Gn(l.alias)} DESC`)
|
|
11645
11669
|
);
|
|
11646
11670
|
m = m.limit(i.limit).offset(i.offset);
|
|
11647
|
-
const
|
|
11671
|
+
const T = (await m.all()).map((Se) => {
|
|
11648
11672
|
const Ee = {};
|
|
11649
11673
|
for (const it of p) {
|
|
11650
|
-
const rt =
|
|
11674
|
+
const rt = Se[it.name];
|
|
11651
11675
|
Ee[it.name] = it.type === "UInt64" ? Number(rt) || 0 : rt ?? "";
|
|
11652
11676
|
}
|
|
11653
11677
|
return Ee;
|
|
11654
11678
|
});
|
|
11655
11679
|
return {
|
|
11656
11680
|
meta: p,
|
|
11657
|
-
data:
|
|
11658
|
-
rows:
|
|
11659
|
-
rows_before_limit_at_least:
|
|
11681
|
+
data: T,
|
|
11682
|
+
rows: T.length,
|
|
11683
|
+
rows_before_limit_at_least: T.length,
|
|
11660
11684
|
statistics: { elapsed: (Date.now() - o) / 1e3 }
|
|
11661
11685
|
};
|
|
11662
11686
|
}
|
|
@@ -11817,16 +11841,16 @@ function tu(n) {
|
|
|
11817
11841
|
try {
|
|
11818
11842
|
let i = [
|
|
11819
11843
|
$e(
|
|
11820
|
-
|
|
11821
|
-
|
|
11844
|
+
Qe(J.expires_at_ts, t),
|
|
11845
|
+
Qe(J.idle_expires_at_ts, t)
|
|
11822
11846
|
)
|
|
11823
11847
|
];
|
|
11824
11848
|
e != null && e.tenant_id && i.push(c(J.tenant_id, e.tenant_id)), await n.delete(J).where(g(...i)), i = [
|
|
11825
11849
|
$e(
|
|
11826
|
-
|
|
11827
|
-
|
|
11850
|
+
Qe(ae.expires_at_ts, t),
|
|
11851
|
+
Qe(ae.idle_expires_at_ts, t)
|
|
11828
11852
|
)
|
|
11829
|
-
], 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));
|
|
11830
11854
|
} catch (i) {
|
|
11831
11855
|
console.error("Session cleanup error:", i);
|
|
11832
11856
|
}
|
|
@@ -11839,7 +11863,7 @@ function ou(n, e = { useTransactions: !0 }) {
|
|
|
11839
11863
|
actionVersions: nr(),
|
|
11840
11864
|
branding: yr(n),
|
|
11841
11865
|
clients: vr(n),
|
|
11842
|
-
clientConnections:
|
|
11866
|
+
clientConnections: Sr(n),
|
|
11843
11867
|
clientGrants: kr(n),
|
|
11844
11868
|
clientRegistrationTokens: t_(n),
|
|
11845
11869
|
codes: n_(n),
|
|
@@ -11854,8 +11878,8 @@ function ou(n, e = { useTransactions: !0 }) {
|
|
|
11854
11878
|
hooks: g_(n),
|
|
11855
11879
|
invites: y_(n),
|
|
11856
11880
|
keys: v_(n),
|
|
11857
|
-
loginSessions:
|
|
11858
|
-
logs:
|
|
11881
|
+
loginSessions: S_(n),
|
|
11882
|
+
logs: N_(n),
|
|
11859
11883
|
authenticationMethods: E_(n),
|
|
11860
11884
|
organizations: k_(n),
|
|
11861
11885
|
passwords: O_(n),
|