@authhero/kysely-adapter 0.5.3 → 0.5.5
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/kysely-adapter.cjs +1 -1
- package/dist/kysely-adapter.d.ts +9 -12
- package/dist/kysely-adapter.iife.js +1 -1
- package/dist/kysely-adapter.mjs +301 -301
- package/package.json +2 -2
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -3157,10 +3157,12 @@ const us = i.enum([
|
|
|
3157
3157
|
description: "The id of the login session that the code is connected to"
|
|
3158
3158
|
}),
|
|
3159
3159
|
code_type: us,
|
|
3160
|
-
created_at: i.string(),
|
|
3161
3160
|
expires_at: i.string(),
|
|
3162
3161
|
used_at: i.string().optional()
|
|
3163
3162
|
}), ps = i.object({
|
|
3163
|
+
...ls.shape,
|
|
3164
|
+
created_at: i.string()
|
|
3165
|
+
}), hs = i.object({
|
|
3164
3166
|
domain: i.string(),
|
|
3165
3167
|
dkim_private_key: i.string().optional(),
|
|
3166
3168
|
dkim_public_key: i.string().optional(),
|
|
@@ -3168,20 +3170,20 @@ const us = i.enum([
|
|
|
3168
3170
|
email_service: i.enum(["mailgun", "mailchannels"])
|
|
3169
3171
|
});
|
|
3170
3172
|
ln.extend({
|
|
3171
|
-
...
|
|
3173
|
+
...hs.shape,
|
|
3172
3174
|
id: i.string()
|
|
3173
3175
|
});
|
|
3174
|
-
const
|
|
3176
|
+
const fs = i.object({
|
|
3175
3177
|
trigger_id: i.enum(["post-user-registration", "post-user-login"]),
|
|
3176
3178
|
enabled: i.boolean().default(!1),
|
|
3177
3179
|
url: i.string(),
|
|
3178
3180
|
hook_id: i.string().optional()
|
|
3179
3181
|
});
|
|
3180
|
-
|
|
3182
|
+
fs.extend({
|
|
3181
3183
|
...ln.shape,
|
|
3182
3184
|
hook_id: i.string()
|
|
3183
3185
|
});
|
|
3184
|
-
const
|
|
3186
|
+
const ms = i.object({
|
|
3185
3187
|
alg: i.string(),
|
|
3186
3188
|
e: i.string(),
|
|
3187
3189
|
kid: i.string(),
|
|
@@ -3190,7 +3192,7 @@ const fs = i.object({
|
|
|
3190
3192
|
use: i.string().optional()
|
|
3191
3193
|
});
|
|
3192
3194
|
i.object({
|
|
3193
|
-
keys: i.array(
|
|
3195
|
+
keys: i.array(ms)
|
|
3194
3196
|
});
|
|
3195
3197
|
i.object({
|
|
3196
3198
|
issuer: i.string(),
|
|
@@ -3214,22 +3216,22 @@ i.object({
|
|
|
3214
3216
|
request_parameter_supported: i.boolean(),
|
|
3215
3217
|
token_endpoint_auth_signing_alg_values_supported: i.array(i.string())
|
|
3216
3218
|
});
|
|
3217
|
-
const
|
|
3218
|
-
login_id: i.string().openapi({
|
|
3219
|
-
description: "This is is used as the state in the universal login"
|
|
3220
|
-
}),
|
|
3219
|
+
const _s = i.object({
|
|
3221
3220
|
auth0Client: i.string().optional(),
|
|
3222
3221
|
authParams: Jt,
|
|
3223
3222
|
expires_at: i.string(),
|
|
3224
|
-
deleted_at: i.string(),
|
|
3223
|
+
deleted_at: i.string().optional(),
|
|
3225
3224
|
ip: i.string().optional()
|
|
3226
3225
|
}).openapi({
|
|
3227
3226
|
description: "This represents a login sesion"
|
|
3228
|
-
}),
|
|
3229
|
-
...
|
|
3227
|
+
}), gs = i.object({
|
|
3228
|
+
..._s.shape,
|
|
3229
|
+
login_id: i.string().openapi({
|
|
3230
|
+
description: "This is is used as the state in the universal login"
|
|
3231
|
+
}),
|
|
3230
3232
|
created_at: i.string(),
|
|
3231
3233
|
updated_at: i.string()
|
|
3232
|
-
}),
|
|
3234
|
+
}), ys = i.enum([
|
|
3233
3235
|
"sapi",
|
|
3234
3236
|
// SUCCESS_API_OPERATION
|
|
3235
3237
|
"ssa",
|
|
@@ -3261,7 +3263,7 @@ const ms = i.object({
|
|
|
3261
3263
|
"seacft",
|
|
3262
3264
|
// SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN
|
|
3263
3265
|
"serft"
|
|
3264
|
-
]),
|
|
3266
|
+
]), vs = i.object({
|
|
3265
3267
|
name: i.string(),
|
|
3266
3268
|
version: i.string(),
|
|
3267
3269
|
env: i.object({
|
|
@@ -3269,7 +3271,7 @@ const ms = i.object({
|
|
|
3269
3271
|
}).optional()
|
|
3270
3272
|
});
|
|
3271
3273
|
i.object({
|
|
3272
|
-
type:
|
|
3274
|
+
type: ys,
|
|
3273
3275
|
date: i.string(),
|
|
3274
3276
|
description: i.string().optional(),
|
|
3275
3277
|
log_id: i.string().optional(),
|
|
@@ -3290,19 +3292,19 @@ i.object({
|
|
|
3290
3292
|
strategy: i.string().optional(),
|
|
3291
3293
|
strategy_type: i.string().optional(),
|
|
3292
3294
|
hostname: i.string().optional(),
|
|
3293
|
-
auth0_client:
|
|
3295
|
+
auth0_client: vs.optional()
|
|
3294
3296
|
});
|
|
3295
|
-
const
|
|
3297
|
+
const ws = i.object({
|
|
3296
3298
|
user_id: i.string(),
|
|
3297
3299
|
password: i.string(),
|
|
3298
3300
|
algorithm: i.enum(["bcrypt", "argon2id"]).default("argon2id")
|
|
3299
3301
|
});
|
|
3300
3302
|
i.object({
|
|
3301
|
-
...
|
|
3303
|
+
...ws.shape,
|
|
3302
3304
|
created_at: i.string(),
|
|
3303
3305
|
updated_at: i.string()
|
|
3304
3306
|
});
|
|
3305
|
-
const
|
|
3307
|
+
const ks = i.object({
|
|
3306
3308
|
session_id: i.string(),
|
|
3307
3309
|
client_id: i.string(),
|
|
3308
3310
|
expires_at: i.string(),
|
|
@@ -3312,7 +3314,7 @@ const ws = i.object({
|
|
|
3312
3314
|
});
|
|
3313
3315
|
i.object({
|
|
3314
3316
|
created_at: i.string(),
|
|
3315
|
-
...
|
|
3317
|
+
...ks.shape
|
|
3316
3318
|
});
|
|
3317
3319
|
i.object({
|
|
3318
3320
|
private_key: i.string(),
|
|
@@ -3341,7 +3343,7 @@ i.object({
|
|
|
3341
3343
|
revoked: i.boolean().optional().openapi({ description: "True if the key is revoked" }),
|
|
3342
3344
|
revoked_at: i.string().optional().openapi({ description: "The date and time when the key was revoked" })
|
|
3343
3345
|
});
|
|
3344
|
-
const
|
|
3346
|
+
const xs = i.object({
|
|
3345
3347
|
name: i.string(),
|
|
3346
3348
|
audience: i.string(),
|
|
3347
3349
|
sender_email: i.string().email(),
|
|
@@ -3352,7 +3354,7 @@ const ks = i.object({
|
|
|
3352
3354
|
secondary_color: i.string().optional(),
|
|
3353
3355
|
language: i.string().optional()
|
|
3354
3356
|
});
|
|
3355
|
-
|
|
3357
|
+
xs.extend({
|
|
3356
3358
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3357
3359
|
updated_at: i.string().transform((n) => n === null ? "" : n)
|
|
3358
3360
|
});
|
|
@@ -3418,7 +3420,7 @@ i.object({
|
|
|
3418
3420
|
code: i.string(),
|
|
3419
3421
|
state: i.string().optional()
|
|
3420
3422
|
});
|
|
3421
|
-
const
|
|
3423
|
+
const bs = i.object({
|
|
3422
3424
|
button_border_radius: i.number(),
|
|
3423
3425
|
button_border_weight: i.number(),
|
|
3424
3426
|
buttons_style: i.enum(["pill"]),
|
|
@@ -3428,7 +3430,7 @@ const xs = i.object({
|
|
|
3428
3430
|
show_widget_shadow: i.boolean(),
|
|
3429
3431
|
widget_border_weight: i.number(),
|
|
3430
3432
|
widget_corner_radius: i.number()
|
|
3431
|
-
}),
|
|
3433
|
+
}), Ts = i.object({
|
|
3432
3434
|
base_focus_color: i.string(),
|
|
3433
3435
|
base_hover_color: i.string(),
|
|
3434
3436
|
body_text: i.string(),
|
|
@@ -3451,7 +3453,7 @@ const xs = i.object({
|
|
|
3451
3453
|
}), De = i.object({
|
|
3452
3454
|
bold: i.boolean(),
|
|
3453
3455
|
size: i.number()
|
|
3454
|
-
}),
|
|
3456
|
+
}), Os = i.object({
|
|
3455
3457
|
body_text: De,
|
|
3456
3458
|
buttons_text: De,
|
|
3457
3459
|
font_url: i.string(),
|
|
@@ -3461,39 +3463,39 @@ const xs = i.object({
|
|
|
3461
3463
|
reference_text_size: i.number(),
|
|
3462
3464
|
subtitle: De,
|
|
3463
3465
|
title: De
|
|
3464
|
-
}),
|
|
3466
|
+
}), Ss = i.object({
|
|
3465
3467
|
background_color: i.string(),
|
|
3466
3468
|
background_image_url: i.string(),
|
|
3467
3469
|
page_layout: i.enum(["center"])
|
|
3468
|
-
}),
|
|
3470
|
+
}), Zs = i.object({
|
|
3469
3471
|
header_text_alignment: i.enum(["center"]),
|
|
3470
3472
|
logo_height: i.number(),
|
|
3471
3473
|
logo_position: i.enum(["center"]),
|
|
3472
3474
|
logo_url: i.string(),
|
|
3473
3475
|
social_buttons_layout: i.enum(["bottom"])
|
|
3474
|
-
}),
|
|
3475
|
-
borders:
|
|
3476
|
-
colors:
|
|
3476
|
+
}), js = i.object({
|
|
3477
|
+
borders: bs,
|
|
3478
|
+
colors: Ts,
|
|
3477
3479
|
displayName: i.string(),
|
|
3478
|
-
fonts:
|
|
3479
|
-
page_background:
|
|
3480
|
-
widget:
|
|
3480
|
+
fonts: Os,
|
|
3481
|
+
page_background: Ss,
|
|
3482
|
+
widget: Zs
|
|
3481
3483
|
});
|
|
3482
|
-
|
|
3484
|
+
js.extend({
|
|
3483
3485
|
themeId: i.string()
|
|
3484
3486
|
});
|
|
3485
|
-
const
|
|
3487
|
+
const Is = i.object({
|
|
3486
3488
|
id: i.string(),
|
|
3487
3489
|
expires_at: i.string(),
|
|
3488
3490
|
auth0Client: i.string().optional(),
|
|
3489
3491
|
authParams: Jt
|
|
3490
3492
|
});
|
|
3491
3493
|
i.object({
|
|
3492
|
-
...
|
|
3494
|
+
...Is.shape,
|
|
3493
3495
|
created_at: i.string(),
|
|
3494
3496
|
updated_at: i.string()
|
|
3495
3497
|
});
|
|
3496
|
-
const
|
|
3498
|
+
const Cs = i.object({
|
|
3497
3499
|
id: i.string(),
|
|
3498
3500
|
email: i.string(),
|
|
3499
3501
|
code: i.string(),
|
|
@@ -3506,9 +3508,9 @@ const Is = i.object({
|
|
|
3506
3508
|
});
|
|
3507
3509
|
i.object({
|
|
3508
3510
|
created_at: i.string(),
|
|
3509
|
-
...
|
|
3511
|
+
...Cs.shape
|
|
3510
3512
|
});
|
|
3511
|
-
const
|
|
3513
|
+
const Es = i.object({
|
|
3512
3514
|
authParams: Jt,
|
|
3513
3515
|
code: i.string(),
|
|
3514
3516
|
user_id: i.string(),
|
|
@@ -3517,7 +3519,7 @@ const Cs = i.object({
|
|
|
3517
3519
|
used_at: i.string().optional()
|
|
3518
3520
|
});
|
|
3519
3521
|
i.object({
|
|
3520
|
-
...
|
|
3522
|
+
...Es.shape,
|
|
3521
3523
|
created_at: i.string()
|
|
3522
3524
|
});
|
|
3523
3525
|
function fn(n) {
|
|
@@ -3545,7 +3547,7 @@ function Mn(n) {
|
|
|
3545
3547
|
}
|
|
3546
3548
|
};
|
|
3547
3549
|
}
|
|
3548
|
-
function
|
|
3550
|
+
function Ns(n) {
|
|
3549
3551
|
return async (e, t) => {
|
|
3550
3552
|
const [r, s] = await Promise.all([
|
|
3551
3553
|
n.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", t).selectAll().executeTakeFirst(),
|
|
@@ -3591,7 +3593,7 @@ function Ae(n, e, t, r) {
|
|
|
3591
3593
|
function be(n) {
|
|
3592
3594
|
return typeof n == "string" ? parseInt(n, 10) : typeof n == "bigint" ? Number(n) : n;
|
|
3593
3595
|
}
|
|
3594
|
-
function
|
|
3596
|
+
function As(n) {
|
|
3595
3597
|
return async (e, t) => {
|
|
3596
3598
|
let r = n.selectFrom("users").where("users.tenant_id", "=", e);
|
|
3597
3599
|
if (t.q && (r = Ae(n, r, t.q, ["email", "name"])), t.sort && t.sort.sort_by) {
|
|
@@ -3625,48 +3627,48 @@ function Ns(n) {
|
|
|
3625
3627
|
};
|
|
3626
3628
|
};
|
|
3627
3629
|
}
|
|
3628
|
-
function
|
|
3630
|
+
function Rs(n) {
|
|
3629
3631
|
return async (e, t) => (await n.deleteFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", t).execute(), (await n.deleteFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", t).execute()).length === 1);
|
|
3630
3632
|
}
|
|
3631
|
-
function
|
|
3633
|
+
function $s(n) {
|
|
3632
3634
|
if (n.email_verified !== void 0)
|
|
3633
3635
|
return n.email_verified ? 1 : 0;
|
|
3634
3636
|
}
|
|
3635
|
-
function
|
|
3637
|
+
function Ps(n) {
|
|
3636
3638
|
return async (e, t, r) => {
|
|
3637
3639
|
const s = {
|
|
3638
3640
|
...r,
|
|
3639
|
-
email_verified:
|
|
3641
|
+
email_verified: $s(r),
|
|
3640
3642
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3641
3643
|
};
|
|
3642
3644
|
return (await n.updateTable("users").set(s).where("users.tenant_id", "=", e).where("users.user_id", "=", t).execute()).length === 1;
|
|
3643
3645
|
};
|
|
3644
3646
|
}
|
|
3645
|
-
function
|
|
3647
|
+
function Ds(n) {
|
|
3646
3648
|
return async (e, t, r, s) => {
|
|
3647
3649
|
const a = { linked_to: null };
|
|
3648
3650
|
return (await n.updateTable("users").set(a).where("users.tenant_id", "=", e).where("users.user_id", "=", `${r}|${s}`).where("users.linked_to", "=", `${t}`).execute()).length === 1;
|
|
3649
3651
|
};
|
|
3650
3652
|
}
|
|
3651
|
-
function
|
|
3653
|
+
function Ms(n) {
|
|
3652
3654
|
return {
|
|
3653
3655
|
create: Gn(n),
|
|
3654
|
-
remove:
|
|
3655
|
-
get:
|
|
3656
|
-
list:
|
|
3657
|
-
update:
|
|
3656
|
+
remove: Rs(n),
|
|
3657
|
+
get: Ns(n),
|
|
3658
|
+
list: As(n),
|
|
3659
|
+
update: Ps(n),
|
|
3658
3660
|
// TODO - think about this more when other issues fixed
|
|
3659
|
-
unlink:
|
|
3661
|
+
unlink: Ds(n)
|
|
3660
3662
|
};
|
|
3661
3663
|
}
|
|
3662
|
-
const
|
|
3664
|
+
const Ls = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
3663
3665
|
let Re = (n = 21) => {
|
|
3664
3666
|
let e = "", t = crypto.getRandomValues(new Uint8Array(n));
|
|
3665
3667
|
for (; n--; )
|
|
3666
|
-
e +=
|
|
3668
|
+
e += Ls[t[n] & 63];
|
|
3667
3669
|
return e;
|
|
3668
3670
|
};
|
|
3669
|
-
function
|
|
3671
|
+
function Vs(n) {
|
|
3670
3672
|
return async (e) => {
|
|
3671
3673
|
const t = {
|
|
3672
3674
|
id: e.id || Re(),
|
|
@@ -3677,13 +3679,13 @@ function Ls(n) {
|
|
|
3677
3679
|
return await n.insertInto("tenants").values(t).execute(), t;
|
|
3678
3680
|
};
|
|
3679
3681
|
}
|
|
3680
|
-
function
|
|
3682
|
+
function Us(n) {
|
|
3681
3683
|
return async (e) => {
|
|
3682
3684
|
const t = await n.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
|
|
3683
3685
|
return t ? R(t) : null;
|
|
3684
3686
|
};
|
|
3685
3687
|
}
|
|
3686
|
-
function
|
|
3688
|
+
function Fs(n) {
|
|
3687
3689
|
return async (e) => {
|
|
3688
3690
|
let t = n.selectFrom("tenants");
|
|
3689
3691
|
if (e.sort && e.sort.sort_by) {
|
|
@@ -3705,7 +3707,7 @@ function Us(n) {
|
|
|
3705
3707
|
};
|
|
3706
3708
|
};
|
|
3707
3709
|
}
|
|
3708
|
-
function
|
|
3710
|
+
function zs(n) {
|
|
3709
3711
|
return async (e, t) => {
|
|
3710
3712
|
const r = {
|
|
3711
3713
|
...t,
|
|
@@ -3715,29 +3717,29 @@ function Fs(n) {
|
|
|
3715
3717
|
await n.updateTable("tenants").set(r).where("id", "=", e).execute();
|
|
3716
3718
|
};
|
|
3717
3719
|
}
|
|
3718
|
-
function
|
|
3720
|
+
function Bs(n) {
|
|
3719
3721
|
return async (e) => (await n.deleteFrom("tenants").where("tenants.id", "=", e).execute()).length === 1;
|
|
3720
3722
|
}
|
|
3721
|
-
function
|
|
3723
|
+
function qs(n) {
|
|
3722
3724
|
return {
|
|
3723
|
-
create:
|
|
3724
|
-
get:
|
|
3725
|
-
list:
|
|
3726
|
-
update:
|
|
3727
|
-
remove:
|
|
3725
|
+
create: Vs(n),
|
|
3726
|
+
get: Us(n),
|
|
3727
|
+
list: Fs(n),
|
|
3728
|
+
update: zs(n),
|
|
3729
|
+
remove: Bs(n)
|
|
3728
3730
|
};
|
|
3729
3731
|
}
|
|
3730
3732
|
function yn(n) {
|
|
3731
3733
|
return n ? JSON.stringify(n) : void 0;
|
|
3732
3734
|
}
|
|
3733
|
-
const
|
|
3734
|
-
function
|
|
3735
|
+
const Ws = 1024;
|
|
3736
|
+
function Ks(n) {
|
|
3735
3737
|
return async (e, t) => {
|
|
3736
3738
|
var s, a;
|
|
3737
3739
|
const r = {
|
|
3738
3740
|
id: Re(),
|
|
3739
3741
|
...t,
|
|
3740
|
-
user_agent: t.user_agent.slice(0,
|
|
3742
|
+
user_agent: t.user_agent.slice(0, Ws)
|
|
3741
3743
|
};
|
|
3742
3744
|
return await n.insertInto("logs").values({
|
|
3743
3745
|
...r,
|
|
@@ -3771,7 +3773,7 @@ function Ln(n) {
|
|
|
3771
3773
|
_id: n.id
|
|
3772
3774
|
};
|
|
3773
3775
|
}
|
|
3774
|
-
function
|
|
3776
|
+
function Qs(n) {
|
|
3775
3777
|
return async (e, t) => {
|
|
3776
3778
|
let r = n.selectFrom("logs").where("logs.tenant_id", "=", e);
|
|
3777
3779
|
t.q && (r = Ae(n, r, t.q, ["user_id", "ip"]));
|
|
@@ -3793,23 +3795,23 @@ function Ks(n) {
|
|
|
3793
3795
|
};
|
|
3794
3796
|
};
|
|
3795
3797
|
}
|
|
3796
|
-
function
|
|
3798
|
+
function Js(n) {
|
|
3797
3799
|
return async (e, t) => {
|
|
3798
3800
|
const r = await n.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", t).selectAll().executeTakeFirst();
|
|
3799
3801
|
return r ? Ln(r) : null;
|
|
3800
3802
|
};
|
|
3801
3803
|
}
|
|
3802
|
-
function
|
|
3804
|
+
function Hs(n) {
|
|
3803
3805
|
return {
|
|
3804
|
-
create:
|
|
3805
|
-
list:
|
|
3806
|
-
get:
|
|
3806
|
+
create: Ks(n),
|
|
3807
|
+
list: Qs(n),
|
|
3808
|
+
get: Js(n)
|
|
3807
3809
|
};
|
|
3808
3810
|
}
|
|
3809
|
-
function
|
|
3811
|
+
function Ys(n) {
|
|
3810
3812
|
return async (e, t) => await n.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).selectAll().executeTakeFirst() ?? null;
|
|
3811
3813
|
}
|
|
3812
|
-
function
|
|
3814
|
+
function Gs(n) {
|
|
3813
3815
|
return async (e, t) => {
|
|
3814
3816
|
const r = {
|
|
3815
3817
|
...t,
|
|
@@ -3819,13 +3821,13 @@ function Ys(n) {
|
|
|
3819
3821
|
return await n.insertInto("sessions").values({ ...r, tenant_id: e }).execute(), { ...t, ...r };
|
|
3820
3822
|
};
|
|
3821
3823
|
}
|
|
3822
|
-
function
|
|
3824
|
+
function Xs(n) {
|
|
3823
3825
|
return async (e, t) => !!(await n.updateTable("sessions").set({ deleted_at: (/* @__PURE__ */ new Date()).toISOString() }).where("tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).execute()).length;
|
|
3824
3826
|
}
|
|
3825
|
-
function
|
|
3827
|
+
function ea(n) {
|
|
3826
3828
|
return async (e, t, r) => !!(await n.updateTable("sessions").set(r).where("tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).execute()).length;
|
|
3827
3829
|
}
|
|
3828
|
-
function
|
|
3830
|
+
function ta(n) {
|
|
3829
3831
|
return async (e, t) => {
|
|
3830
3832
|
let r = n.selectFrom("sessions").where("sessions.tenant_id", "=", e);
|
|
3831
3833
|
t.q && (r = Ae(n, r, t.q, ["user_id", "session_id"]));
|
|
@@ -3847,16 +3849,16 @@ function ea(n) {
|
|
|
3847
3849
|
};
|
|
3848
3850
|
};
|
|
3849
3851
|
}
|
|
3850
|
-
function
|
|
3852
|
+
function na(n) {
|
|
3851
3853
|
return {
|
|
3852
|
-
create:
|
|
3853
|
-
get:
|
|
3854
|
-
list:
|
|
3855
|
-
remove:
|
|
3856
|
-
update:
|
|
3854
|
+
create: Gs(n),
|
|
3855
|
+
get: Ys(n),
|
|
3856
|
+
list: ta(n),
|
|
3857
|
+
remove: Xs(n),
|
|
3858
|
+
update: ea(n)
|
|
3857
3859
|
};
|
|
3858
3860
|
}
|
|
3859
|
-
function
|
|
3861
|
+
function ra(n) {
|
|
3860
3862
|
return async (e, t) => {
|
|
3861
3863
|
const r = await n.selectFrom("tickets").where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).where("tickets.used_at", "is", null).selectAll().executeTakeFirst();
|
|
3862
3864
|
if (!r)
|
|
@@ -3886,7 +3888,7 @@ function na(n) {
|
|
|
3886
3888
|
};
|
|
3887
3889
|
};
|
|
3888
3890
|
}
|
|
3889
|
-
function
|
|
3891
|
+
function sa(n) {
|
|
3890
3892
|
return async (e) => {
|
|
3891
3893
|
const { authParams: t, ...r } = e, s = {
|
|
3892
3894
|
...r,
|
|
@@ -3898,21 +3900,21 @@ function ra(n) {
|
|
|
3898
3900
|
await n.insertInto("tickets").values(s).execute();
|
|
3899
3901
|
};
|
|
3900
3902
|
}
|
|
3901
|
-
function
|
|
3903
|
+
function aa(n) {
|
|
3902
3904
|
return async (e, t) => {
|
|
3903
3905
|
await n.updateTable("tickets").set({
|
|
3904
3906
|
used_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3905
3907
|
}).where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).execute();
|
|
3906
3908
|
};
|
|
3907
3909
|
}
|
|
3908
|
-
function
|
|
3910
|
+
function ia(n) {
|
|
3909
3911
|
return {
|
|
3910
|
-
create:
|
|
3911
|
-
get:
|
|
3912
|
-
remove:
|
|
3912
|
+
create: sa(n),
|
|
3913
|
+
get: ra(n),
|
|
3914
|
+
remove: aa(n)
|
|
3913
3915
|
};
|
|
3914
3916
|
}
|
|
3915
|
-
function
|
|
3917
|
+
function oa(n) {
|
|
3916
3918
|
return async (e, t) => {
|
|
3917
3919
|
const r = (/* @__PURE__ */ new Date()).toISOString();
|
|
3918
3920
|
return (await n.selectFrom("otps").where("otps.tenant_id", "=", e).where("otps.email", "=", t).where("otps.expires_at", ">", r).where("otps.used_at", "is", null).selectAll().execute()).map((a) => {
|
|
@@ -3943,7 +3945,7 @@ function ia(n) {
|
|
|
3943
3945
|
});
|
|
3944
3946
|
};
|
|
3945
3947
|
}
|
|
3946
|
-
function
|
|
3948
|
+
function ca(n) {
|
|
3947
3949
|
return async (e, t) => {
|
|
3948
3950
|
const { authParams: r, ...s } = t;
|
|
3949
3951
|
await n.insertInto("otps").values({
|
|
@@ -3956,25 +3958,25 @@ function oa(n) {
|
|
|
3956
3958
|
}).execute();
|
|
3957
3959
|
};
|
|
3958
3960
|
}
|
|
3959
|
-
function
|
|
3961
|
+
function da(n) {
|
|
3960
3962
|
return async (e, t) => (await n.updateTable("otps").set({
|
|
3961
3963
|
used_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3962
3964
|
}).where("otps.tenant_id", "=", e).where("otps.id", "=", t).execute()).length > 0;
|
|
3963
3965
|
}
|
|
3964
|
-
function
|
|
3966
|
+
function ua(n) {
|
|
3965
3967
|
return {
|
|
3966
|
-
create:
|
|
3967
|
-
list:
|
|
3968
|
-
remove:
|
|
3968
|
+
create: ca(n),
|
|
3969
|
+
list: oa(n),
|
|
3970
|
+
remove: da(n)
|
|
3969
3971
|
};
|
|
3970
3972
|
}
|
|
3971
|
-
function
|
|
3973
|
+
function la(n) {
|
|
3972
3974
|
return async (e, t) => {
|
|
3973
3975
|
const r = await n.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", t).selectAll().executeTakeFirstOrThrow(), { tenant_id: s, ...a } = r;
|
|
3974
3976
|
return a;
|
|
3975
3977
|
};
|
|
3976
3978
|
}
|
|
3977
|
-
function
|
|
3979
|
+
function pa(n) {
|
|
3978
3980
|
return async (e, t) => {
|
|
3979
3981
|
const r = {
|
|
3980
3982
|
...t,
|
|
@@ -3987,20 +3989,20 @@ function la(n) {
|
|
|
3987
3989
|
}).execute(), r;
|
|
3988
3990
|
};
|
|
3989
3991
|
}
|
|
3990
|
-
function
|
|
3992
|
+
function ha(n) {
|
|
3991
3993
|
return async (e, t) => (await n.updateTable("passwords").set({
|
|
3992
3994
|
password: t.password,
|
|
3993
3995
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3994
3996
|
}).where("tenant_id", "=", e).where("user_id", "=", t.user_id).execute()).length === 1;
|
|
3995
3997
|
}
|
|
3996
|
-
function
|
|
3998
|
+
function fa(n) {
|
|
3997
3999
|
return {
|
|
3998
|
-
create:
|
|
3999
|
-
update:
|
|
4000
|
-
get:
|
|
4000
|
+
create: pa(n),
|
|
4001
|
+
update: ha(n),
|
|
4002
|
+
get: la(n)
|
|
4001
4003
|
};
|
|
4002
4004
|
}
|
|
4003
|
-
function
|
|
4005
|
+
function ma(n) {
|
|
4004
4006
|
return async (e, t) => {
|
|
4005
4007
|
let r = n.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
4006
4008
|
t.q && (r = Ae(n, r, t.q, ["code", "login_id"]));
|
|
@@ -4008,7 +4010,7 @@ function fa(n) {
|
|
|
4008
4010
|
return {
|
|
4009
4011
|
codes: a.map((d) => {
|
|
4010
4012
|
const { tenant_id: u, ...l } = d;
|
|
4011
|
-
return
|
|
4013
|
+
return ps.parse(R(l));
|
|
4012
4014
|
}),
|
|
4013
4015
|
start: t.page * t.per_page,
|
|
4014
4016
|
limit: t.per_page,
|
|
@@ -4016,13 +4018,11 @@ function fa(n) {
|
|
|
4016
4018
|
};
|
|
4017
4019
|
};
|
|
4018
4020
|
}
|
|
4019
|
-
function
|
|
4021
|
+
function _a(n) {
|
|
4020
4022
|
return async (e, t) => {
|
|
4021
4023
|
const r = {
|
|
4022
4024
|
...t,
|
|
4023
|
-
|
|
4024
|
-
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4025
|
-
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4025
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4026
4026
|
};
|
|
4027
4027
|
return await n.insertInto("codes").values({
|
|
4028
4028
|
...r,
|
|
@@ -4030,24 +4030,24 @@ function ma(n) {
|
|
|
4030
4030
|
}).execute(), r;
|
|
4031
4031
|
};
|
|
4032
4032
|
}
|
|
4033
|
-
function
|
|
4033
|
+
function ga(n) {
|
|
4034
4034
|
return async (e, t) => (await n.deleteFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4035
4035
|
}
|
|
4036
|
-
function
|
|
4036
|
+
function ya(n) {
|
|
4037
4037
|
return async (e, t, r) => {
|
|
4038
4038
|
const s = await n.selectFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", t).where("codes.code_type", "=", r).selectAll().executeTakeFirst();
|
|
4039
4039
|
return s ? R(s) : null;
|
|
4040
4040
|
};
|
|
4041
4041
|
}
|
|
4042
|
-
function
|
|
4042
|
+
function va(n) {
|
|
4043
4043
|
return {
|
|
4044
|
-
create:
|
|
4045
|
-
list:
|
|
4046
|
-
remove:
|
|
4047
|
-
get:
|
|
4044
|
+
create: _a(n),
|
|
4045
|
+
list: ma(n),
|
|
4046
|
+
remove: ga(n),
|
|
4047
|
+
get: ya(n)
|
|
4048
4048
|
};
|
|
4049
4049
|
}
|
|
4050
|
-
function
|
|
4050
|
+
function wa(n) {
|
|
4051
4051
|
return async (e) => {
|
|
4052
4052
|
const t = (/* @__PURE__ */ new Date()).toISOString(), r = await n.selectFrom("universal_login_sessions").where("universal_login_sessions.expires_at", ">", t).where("universal_login_sessions.id", "=", e).selectAll().executeTakeFirst();
|
|
4053
4053
|
if (!r) return null;
|
|
@@ -4085,7 +4085,7 @@ function va(n) {
|
|
|
4085
4085
|
};
|
|
4086
4086
|
};
|
|
4087
4087
|
}
|
|
4088
|
-
function
|
|
4088
|
+
function ka(n) {
|
|
4089
4089
|
return async (e, t) => {
|
|
4090
4090
|
const { authParams: r, ...s } = t, a = {
|
|
4091
4091
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -4094,20 +4094,20 @@ function wa(n) {
|
|
|
4094
4094
|
return await n.insertInto("universal_login_sessions").values({ ...r, ...s, ...a, tenant_id: e }).execute(), { ...t, ...a };
|
|
4095
4095
|
};
|
|
4096
4096
|
}
|
|
4097
|
-
function
|
|
4097
|
+
function xa(n) {
|
|
4098
4098
|
return async (e, t, r) => {
|
|
4099
4099
|
const { authParams: s, ...a } = r;
|
|
4100
4100
|
return (await n.updateTable("universal_login_sessions").set({ ...s, ...a }).where("id", "=", t).where("tenant_id", "=", e).execute()).length === 1;
|
|
4101
4101
|
};
|
|
4102
4102
|
}
|
|
4103
|
-
function
|
|
4103
|
+
function ba(n) {
|
|
4104
4104
|
return {
|
|
4105
|
-
create:
|
|
4106
|
-
get:
|
|
4107
|
-
update:
|
|
4105
|
+
create: ka(n),
|
|
4106
|
+
get: wa(n),
|
|
4107
|
+
update: xa(n)
|
|
4108
4108
|
};
|
|
4109
4109
|
}
|
|
4110
|
-
function
|
|
4110
|
+
function Ta(n) {
|
|
4111
4111
|
return async (e, t) => {
|
|
4112
4112
|
const r = {
|
|
4113
4113
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -4118,21 +4118,21 @@ function ba(n) {
|
|
|
4118
4118
|
return await n.insertInto("applications").values({ ...r, tenant_id: e }).execute(), r;
|
|
4119
4119
|
};
|
|
4120
4120
|
}
|
|
4121
|
-
function
|
|
4121
|
+
function Oa(n) {
|
|
4122
4122
|
return async (e) => ({
|
|
4123
4123
|
applications: await n.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()
|
|
4124
4124
|
});
|
|
4125
4125
|
}
|
|
4126
|
-
function
|
|
4126
|
+
function Sa(n) {
|
|
4127
4127
|
return async (e, t) => {
|
|
4128
4128
|
const r = await n.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).selectAll().executeTakeFirst();
|
|
4129
4129
|
return r ? (r.disable_sign_ups = !!r.disable_sign_ups, R(r)) : null;
|
|
4130
4130
|
};
|
|
4131
4131
|
}
|
|
4132
|
-
function
|
|
4132
|
+
function Za(n) {
|
|
4133
4133
|
return async (e, t) => (await n.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4134
4134
|
}
|
|
4135
|
-
function
|
|
4135
|
+
function ja(n) {
|
|
4136
4136
|
return async (e, t, r) => {
|
|
4137
4137
|
const s = {
|
|
4138
4138
|
...r,
|
|
@@ -4141,16 +4141,16 @@ function Za(n) {
|
|
|
4141
4141
|
return await n.updateTable("applications").set(s).where("applications.id", "=", t).where("applications.tenant_id", "=", e).execute(), !0;
|
|
4142
4142
|
};
|
|
4143
4143
|
}
|
|
4144
|
-
function
|
|
4144
|
+
function Ia(n) {
|
|
4145
4145
|
return {
|
|
4146
|
-
create:
|
|
4147
|
-
list:
|
|
4148
|
-
get:
|
|
4149
|
-
remove:
|
|
4150
|
-
update:
|
|
4146
|
+
create: Ta(n),
|
|
4147
|
+
list: Oa(n),
|
|
4148
|
+
get: Sa(n),
|
|
4149
|
+
remove: Za(n),
|
|
4150
|
+
update: ja(n)
|
|
4151
4151
|
};
|
|
4152
4152
|
}
|
|
4153
|
-
function
|
|
4153
|
+
function Ca(n) {
|
|
4154
4154
|
return async (e, t) => {
|
|
4155
4155
|
const r = {
|
|
4156
4156
|
id: Re(),
|
|
@@ -4161,7 +4161,7 @@ function Ia(n) {
|
|
|
4161
4161
|
return await n.insertInto("connections").values({ ...r, tenant_id: e }).execute(), r;
|
|
4162
4162
|
};
|
|
4163
4163
|
}
|
|
4164
|
-
function
|
|
4164
|
+
function Ea(n) {
|
|
4165
4165
|
return async (e, t) => {
|
|
4166
4166
|
let r = n.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
4167
4167
|
t.q && (r = Ae(n, r, t.q, ["user_id", "ip"]));
|
|
@@ -4174,16 +4174,16 @@ function Ca(n) {
|
|
|
4174
4174
|
};
|
|
4175
4175
|
};
|
|
4176
4176
|
}
|
|
4177
|
-
function
|
|
4177
|
+
function Na(n) {
|
|
4178
4178
|
return async (e, t) => (await n.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4179
4179
|
}
|
|
4180
|
-
function
|
|
4180
|
+
function Aa(n) {
|
|
4181
4181
|
return async (e, t) => {
|
|
4182
4182
|
const r = await n.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).selectAll().executeTakeFirst();
|
|
4183
4183
|
return r ? R(r) : null;
|
|
4184
4184
|
};
|
|
4185
4185
|
}
|
|
4186
|
-
function
|
|
4186
|
+
function Ra(n) {
|
|
4187
4187
|
return async (e, t, r) => {
|
|
4188
4188
|
const s = {
|
|
4189
4189
|
...r,
|
|
@@ -4192,19 +4192,19 @@ function Aa(n) {
|
|
|
4192
4192
|
return await n.updateTable("connections").set(s).where("connections.id", "=", t).where("connections.tenant_id", "=", e).execute(), !0;
|
|
4193
4193
|
};
|
|
4194
4194
|
}
|
|
4195
|
-
function
|
|
4195
|
+
function $a(n) {
|
|
4196
4196
|
return {
|
|
4197
|
-
create:
|
|
4198
|
-
get:
|
|
4199
|
-
list:
|
|
4200
|
-
remove:
|
|
4201
|
-
update:
|
|
4197
|
+
create: Ca(n),
|
|
4198
|
+
get: Aa(n),
|
|
4199
|
+
list: Ea(n),
|
|
4200
|
+
remove: Na(n),
|
|
4201
|
+
update: Ra(n)
|
|
4202
4202
|
};
|
|
4203
4203
|
}
|
|
4204
4204
|
function Xt(n) {
|
|
4205
4205
|
return n != null && n.length ? n.split(",").map((e) => e.trim()) : [];
|
|
4206
4206
|
}
|
|
4207
|
-
function
|
|
4207
|
+
function Pa(n) {
|
|
4208
4208
|
return {
|
|
4209
4209
|
get: async (e) => {
|
|
4210
4210
|
const t = await n.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
|
|
@@ -4234,25 +4234,25 @@ function $a(n) {
|
|
|
4234
4234
|
}
|
|
4235
4235
|
};
|
|
4236
4236
|
}
|
|
4237
|
-
function
|
|
4237
|
+
function Da(n) {
|
|
4238
4238
|
return async () => await n.selectFrom("keys").where("revoked_at", "is", null).selectAll().execute();
|
|
4239
4239
|
}
|
|
4240
|
-
function
|
|
4240
|
+
function Ma(n) {
|
|
4241
4241
|
return async (e) => {
|
|
4242
4242
|
await n.insertInto("keys").values(e).execute();
|
|
4243
4243
|
};
|
|
4244
4244
|
}
|
|
4245
|
-
function
|
|
4245
|
+
function La(n) {
|
|
4246
4246
|
return async (e, t) => !!(await n.updateTable("keys").set({ revoked_at: t.toISOString() }).where("kid", "=", e).execute()).length;
|
|
4247
4247
|
}
|
|
4248
|
-
function
|
|
4248
|
+
function Va(n) {
|
|
4249
4249
|
return {
|
|
4250
|
-
create:
|
|
4251
|
-
list:
|
|
4252
|
-
revoke:
|
|
4250
|
+
create: Ma(n),
|
|
4251
|
+
list: Da(n),
|
|
4252
|
+
revoke: La(n)
|
|
4253
4253
|
};
|
|
4254
4254
|
}
|
|
4255
|
-
function
|
|
4255
|
+
function Ua(n) {
|
|
4256
4256
|
return async (e, t) => {
|
|
4257
4257
|
const r = {
|
|
4258
4258
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -4264,7 +4264,7 @@ function Va(n) {
|
|
|
4264
4264
|
return await n.insertInto("domains").values(r).execute(), r;
|
|
4265
4265
|
};
|
|
4266
4266
|
}
|
|
4267
|
-
function
|
|
4267
|
+
function Fa(n) {
|
|
4268
4268
|
return async (e, t) => {
|
|
4269
4269
|
let r = n.selectFrom("domains").where("domains.tenant_id", "=", e);
|
|
4270
4270
|
t.q && (r = Ae(n, r, t.q, ["user_id", "ip"]));
|
|
@@ -4277,13 +4277,13 @@ function Ua(n) {
|
|
|
4277
4277
|
};
|
|
4278
4278
|
};
|
|
4279
4279
|
}
|
|
4280
|
-
function
|
|
4280
|
+
function za(n) {
|
|
4281
4281
|
return {
|
|
4282
|
-
create:
|
|
4283
|
-
list:
|
|
4282
|
+
create: Ua(n),
|
|
4283
|
+
list: Fa(n)
|
|
4284
4284
|
};
|
|
4285
4285
|
}
|
|
4286
|
-
function
|
|
4286
|
+
function Ba(n) {
|
|
4287
4287
|
return async (e) => {
|
|
4288
4288
|
const [t] = await n.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
|
|
4289
4289
|
if (!t)
|
|
@@ -4313,7 +4313,7 @@ function za(n) {
|
|
|
4313
4313
|
});
|
|
4314
4314
|
};
|
|
4315
4315
|
}
|
|
4316
|
-
function
|
|
4316
|
+
function qa(n) {
|
|
4317
4317
|
return async (e, t) => {
|
|
4318
4318
|
var o, c, d, u, l, T, A, L, Q, se, ce, de, ue, $e, Pe, J, H, Y;
|
|
4319
4319
|
const { colors: r, font: s, ...a } = t;
|
|
@@ -4341,13 +4341,13 @@ function Ba(n) {
|
|
|
4341
4341
|
}
|
|
4342
4342
|
};
|
|
4343
4343
|
}
|
|
4344
|
-
function
|
|
4344
|
+
function Wa(n) {
|
|
4345
4345
|
return {
|
|
4346
|
-
get:
|
|
4347
|
-
set:
|
|
4346
|
+
get: Ba(n),
|
|
4347
|
+
set: qa(n)
|
|
4348
4348
|
};
|
|
4349
4349
|
}
|
|
4350
|
-
function
|
|
4350
|
+
function Ka(n) {
|
|
4351
4351
|
return async (e, t) => {
|
|
4352
4352
|
const r = await n.selectFrom("authentication_codes").where("tenant_id", "=", e).where("code", "=", t).selectAll().executeTakeFirst();
|
|
4353
4353
|
if (!r)
|
|
@@ -4374,7 +4374,7 @@ function Wa(n) {
|
|
|
4374
4374
|
};
|
|
4375
4375
|
};
|
|
4376
4376
|
}
|
|
4377
|
-
function
|
|
4377
|
+
function Qa(n) {
|
|
4378
4378
|
return async (e, t) => {
|
|
4379
4379
|
const { authParams: r, ...s } = t;
|
|
4380
4380
|
await n.insertInto("authentication_codes").values({
|
|
@@ -4384,13 +4384,13 @@ function Ka(n) {
|
|
|
4384
4384
|
}).execute();
|
|
4385
4385
|
};
|
|
4386
4386
|
}
|
|
4387
|
-
function
|
|
4387
|
+
function Ja(n) {
|
|
4388
4388
|
return {
|
|
4389
|
-
create:
|
|
4390
|
-
get:
|
|
4389
|
+
create: Qa(n),
|
|
4390
|
+
get: Ka(n)
|
|
4391
4391
|
};
|
|
4392
4392
|
}
|
|
4393
|
-
function
|
|
4393
|
+
function Ha(n) {
|
|
4394
4394
|
return async (e, t) => {
|
|
4395
4395
|
let r = n.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
4396
4396
|
t.q && (r = Ae(n, r, t.q, ["url"]));
|
|
@@ -4409,16 +4409,16 @@ function Ja(n) {
|
|
|
4409
4409
|
};
|
|
4410
4410
|
};
|
|
4411
4411
|
}
|
|
4412
|
-
function
|
|
4412
|
+
function Ya(n) {
|
|
4413
4413
|
return async (e, t) => {
|
|
4414
4414
|
const r = await n.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).selectAll().executeTakeFirst();
|
|
4415
4415
|
return r ? (r.enabled = !!r.enabled, R(r)) : null;
|
|
4416
4416
|
};
|
|
4417
4417
|
}
|
|
4418
|
-
function
|
|
4418
|
+
function Ga(n) {
|
|
4419
4419
|
return async (e, t) => (await n.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4420
4420
|
}
|
|
4421
|
-
function
|
|
4421
|
+
function Xa(n) {
|
|
4422
4422
|
return async (e, t) => {
|
|
4423
4423
|
const r = {
|
|
4424
4424
|
hook_id: Re(),
|
|
@@ -4429,7 +4429,7 @@ function Ga(n) {
|
|
|
4429
4429
|
return await n.insertInto("hooks").values({ ...r, tenant_id: e }).execute(), r;
|
|
4430
4430
|
};
|
|
4431
4431
|
}
|
|
4432
|
-
function
|
|
4432
|
+
function ei(n) {
|
|
4433
4433
|
return async (e, t, r) => {
|
|
4434
4434
|
const s = {
|
|
4435
4435
|
...r,
|
|
@@ -4438,16 +4438,16 @@ function Xa(n) {
|
|
|
4438
4438
|
return await n.updateTable("hooks").set(s).where("hooks.hook_id", "=", t).where("hooks.tenant_id", "=", e).execute(), !0;
|
|
4439
4439
|
};
|
|
4440
4440
|
}
|
|
4441
|
-
function
|
|
4441
|
+
function ti(n) {
|
|
4442
4442
|
return {
|
|
4443
|
-
create:
|
|
4444
|
-
get:
|
|
4445
|
-
list:
|
|
4446
|
-
update:
|
|
4447
|
-
remove:
|
|
4443
|
+
create: Xa(n),
|
|
4444
|
+
get: Ya(n),
|
|
4445
|
+
list: Ha(n),
|
|
4446
|
+
update: ei(n),
|
|
4447
|
+
remove: Ga(n)
|
|
4448
4448
|
};
|
|
4449
4449
|
}
|
|
4450
|
-
function
|
|
4450
|
+
function ni(n, e) {
|
|
4451
4451
|
var t = {};
|
|
4452
4452
|
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && e.indexOf(r) < 0 && (t[r] = n[r]);
|
|
4453
4453
|
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -4455,7 +4455,7 @@ function ti(n, e) {
|
|
|
4455
4455
|
e.indexOf(r[s]) < 0 && Object.prototype.propertyIsEnumerable.call(n, r[s]) && (t[r[s]] = n[r[s]]);
|
|
4456
4456
|
return t;
|
|
4457
4457
|
}
|
|
4458
|
-
function
|
|
4458
|
+
function ri(n, e) {
|
|
4459
4459
|
var t;
|
|
4460
4460
|
return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
|
|
4461
4461
|
}
|
|
@@ -4466,15 +4466,15 @@ function He(n, e) {
|
|
|
4466
4466
|
return s._def.openapi = this._def.openapi, s;
|
|
4467
4467
|
};
|
|
4468
4468
|
}
|
|
4469
|
-
function
|
|
4469
|
+
function si(n) {
|
|
4470
4470
|
if (typeof n.ZodType.prototype.openapi < "u")
|
|
4471
4471
|
return;
|
|
4472
4472
|
n.ZodType.prototype.openapi = function(s, a) {
|
|
4473
4473
|
var o, c, d, u, l, T;
|
|
4474
|
-
const A = typeof s == "string" ? a : s, L = A ?? {}, { param: Q } = L, se =
|
|
4474
|
+
const A = typeof s == "string" ? a : s, L = A ?? {}, { param: Q } = L, se = ni(L, ["param"]), ce = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof s == "string" ? { refId: s } : void 0), de = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), se), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || Q ? {
|
|
4475
4475
|
param: Object.assign(Object.assign({}, (T = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || T === void 0 ? void 0 : T.param), Q)
|
|
4476
4476
|
} : void 0), ue = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(ce).length > 0 ? { _internal: ce } : void 0), Object.keys(de).length > 0 ? { metadata: de } : void 0) }));
|
|
4477
|
-
if (
|
|
4477
|
+
if (ri(this, "ZodObject")) {
|
|
4478
4478
|
const $e = this.extend;
|
|
4479
4479
|
ue.extend = function(...Pe) {
|
|
4480
4480
|
var J, H, Y, le, Te, Oe;
|
|
@@ -4612,7 +4612,7 @@ const g = C.arrayToEnum([
|
|
|
4612
4612
|
"invalid_intersection_types",
|
|
4613
4613
|
"not_multiple_of",
|
|
4614
4614
|
"not_finite"
|
|
4615
|
-
]),
|
|
4615
|
+
]), ai = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
4616
4616
|
class U extends Error {
|
|
4617
4617
|
constructor(e) {
|
|
4618
4618
|
super(), this.issues = [], this.addIssue = (r) => {
|
|
@@ -4730,7 +4730,7 @@ const We = (n, e) => {
|
|
|
4730
4730
|
return { message: t };
|
|
4731
4731
|
};
|
|
4732
4732
|
let Vn = We;
|
|
4733
|
-
function
|
|
4733
|
+
function ii(n) {
|
|
4734
4734
|
Vn = n;
|
|
4735
4735
|
}
|
|
4736
4736
|
function Ut() {
|
|
@@ -4756,7 +4756,7 @@ const Ft = (n) => {
|
|
|
4756
4756
|
path: a,
|
|
4757
4757
|
message: c
|
|
4758
4758
|
};
|
|
4759
|
-
},
|
|
4759
|
+
}, oi = [];
|
|
4760
4760
|
function m(n, e) {
|
|
4761
4761
|
const t = Ut(), r = Ft({
|
|
4762
4762
|
issueData: e,
|
|
@@ -5047,14 +5047,14 @@ class j {
|
|
|
5047
5047
|
return this.safeParse(null).success;
|
|
5048
5048
|
}
|
|
5049
5049
|
}
|
|
5050
|
-
const
|
|
5050
|
+
const ci = /^c[^\s-]{8,}$/i, di = /^[0-9a-z]+$/, ui = /^[0-9A-HJKMNP-TV-Z]{26}$/, li = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, pi = /^[a-z0-9_-]{21}$/i, hi = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, fi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, mi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
5051
5051
|
let en;
|
|
5052
|
-
const
|
|
5052
|
+
const _i = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, gi = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, yi = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Fn = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", vi = new RegExp(`^${Fn}$`);
|
|
5053
5053
|
function zn(n) {
|
|
5054
5054
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
5055
5055
|
return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
5056
5056
|
}
|
|
5057
|
-
function
|
|
5057
|
+
function wi(n) {
|
|
5058
5058
|
return new RegExp(`^${zn(n)}$`);
|
|
5059
5059
|
}
|
|
5060
5060
|
function Bn(n) {
|
|
@@ -5062,8 +5062,8 @@ function Bn(n) {
|
|
|
5062
5062
|
const t = [];
|
|
5063
5063
|
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
5064
5064
|
}
|
|
5065
|
-
function
|
|
5066
|
-
return !!((e === "v4" || !e) &&
|
|
5065
|
+
function ki(n, e) {
|
|
5066
|
+
return !!((e === "v4" || !e) && _i.test(n) || (e === "v6" || !e) && gi.test(n));
|
|
5067
5067
|
}
|
|
5068
5068
|
class z extends j {
|
|
5069
5069
|
_parse(e) {
|
|
@@ -5114,43 +5114,43 @@ class z extends j {
|
|
|
5114
5114
|
message: a.message
|
|
5115
5115
|
}), r.dirty());
|
|
5116
5116
|
} else if (a.kind === "email")
|
|
5117
|
-
|
|
5117
|
+
fi.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5118
5118
|
validation: "email",
|
|
5119
5119
|
code: h.invalid_string,
|
|
5120
5120
|
message: a.message
|
|
5121
5121
|
}), r.dirty());
|
|
5122
5122
|
else if (a.kind === "emoji")
|
|
5123
|
-
en || (en = new RegExp(
|
|
5123
|
+
en || (en = new RegExp(mi, "u")), en.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5124
5124
|
validation: "emoji",
|
|
5125
5125
|
code: h.invalid_string,
|
|
5126
5126
|
message: a.message
|
|
5127
5127
|
}), r.dirty());
|
|
5128
5128
|
else if (a.kind === "uuid")
|
|
5129
|
-
|
|
5129
|
+
li.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5130
5130
|
validation: "uuid",
|
|
5131
5131
|
code: h.invalid_string,
|
|
5132
5132
|
message: a.message
|
|
5133
5133
|
}), r.dirty());
|
|
5134
5134
|
else if (a.kind === "nanoid")
|
|
5135
|
-
|
|
5135
|
+
pi.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5136
5136
|
validation: "nanoid",
|
|
5137
5137
|
code: h.invalid_string,
|
|
5138
5138
|
message: a.message
|
|
5139
5139
|
}), r.dirty());
|
|
5140
5140
|
else if (a.kind === "cuid")
|
|
5141
|
-
|
|
5141
|
+
ci.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5142
5142
|
validation: "cuid",
|
|
5143
5143
|
code: h.invalid_string,
|
|
5144
5144
|
message: a.message
|
|
5145
5145
|
}), r.dirty());
|
|
5146
5146
|
else if (a.kind === "cuid2")
|
|
5147
|
-
|
|
5147
|
+
di.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5148
5148
|
validation: "cuid2",
|
|
5149
5149
|
code: h.invalid_string,
|
|
5150
5150
|
message: a.message
|
|
5151
5151
|
}), r.dirty());
|
|
5152
5152
|
else if (a.kind === "ulid")
|
|
5153
|
-
|
|
5153
|
+
ui.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5154
5154
|
validation: "ulid",
|
|
5155
5155
|
code: h.invalid_string,
|
|
5156
5156
|
message: a.message
|
|
@@ -5185,23 +5185,23 @@ class z extends j {
|
|
|
5185
5185
|
code: h.invalid_string,
|
|
5186
5186
|
validation: "datetime",
|
|
5187
5187
|
message: a.message
|
|
5188
|
-
}), r.dirty()) : a.kind === "date" ?
|
|
5188
|
+
}), r.dirty()) : a.kind === "date" ? vi.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5189
5189
|
code: h.invalid_string,
|
|
5190
5190
|
validation: "date",
|
|
5191
5191
|
message: a.message
|
|
5192
|
-
}), r.dirty()) : a.kind === "time" ?
|
|
5192
|
+
}), r.dirty()) : a.kind === "time" ? wi(a).test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5193
5193
|
code: h.invalid_string,
|
|
5194
5194
|
validation: "time",
|
|
5195
5195
|
message: a.message
|
|
5196
|
-
}), r.dirty()) : a.kind === "duration" ?
|
|
5196
|
+
}), r.dirty()) : a.kind === "duration" ? hi.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5197
5197
|
validation: "duration",
|
|
5198
5198
|
code: h.invalid_string,
|
|
5199
5199
|
message: a.message
|
|
5200
|
-
}), r.dirty()) : a.kind === "ip" ?
|
|
5200
|
+
}), r.dirty()) : a.kind === "ip" ? ki(e.data, a.version) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5201
5201
|
validation: "ip",
|
|
5202
5202
|
code: h.invalid_string,
|
|
5203
5203
|
message: a.message
|
|
5204
|
-
}), r.dirty()) : a.kind === "base64" ?
|
|
5204
|
+
}), r.dirty()) : a.kind === "base64" ? yi.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5205
5205
|
validation: "base64",
|
|
5206
5206
|
code: h.invalid_string,
|
|
5207
5207
|
message: a.message
|
|
@@ -5423,7 +5423,7 @@ z.create = (n) => {
|
|
|
5423
5423
|
...S(n)
|
|
5424
5424
|
});
|
|
5425
5425
|
};
|
|
5426
|
-
function
|
|
5426
|
+
function xi(n, e) {
|
|
5427
5427
|
const t = (n.toString().split(".")[1] || "").length, r = (e.toString().split(".")[1] || "").length, s = t > r ? t : r, a = parseInt(n.toFixed(s).replace(".", "")), o = parseInt(e.toFixed(s).replace(".", ""));
|
|
5428
5428
|
return a % o / Math.pow(10, s);
|
|
5429
5429
|
}
|
|
@@ -5462,7 +5462,7 @@ class ve extends j {
|
|
|
5462
5462
|
inclusive: a.inclusive,
|
|
5463
5463
|
exact: !1,
|
|
5464
5464
|
message: a.message
|
|
5465
|
-
}), s.dirty()) : a.kind === "multipleOf" ?
|
|
5465
|
+
}), s.dirty()) : a.kind === "multipleOf" ? xi(e.data, a.value) !== 0 && (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5466
5466
|
code: h.not_multiple_of,
|
|
5467
5467
|
multipleOf: a.value,
|
|
5468
5468
|
message: a.message
|
|
@@ -7163,7 +7163,7 @@ Kt.create = (n) => new Kt({
|
|
|
7163
7163
|
typeName: k.ZodNaN,
|
|
7164
7164
|
...S(n)
|
|
7165
7165
|
});
|
|
7166
|
-
const
|
|
7166
|
+
const bi = Symbol("zod_brand");
|
|
7167
7167
|
class mn extends j {
|
|
7168
7168
|
_parse(e) {
|
|
7169
7169
|
const { ctx: t } = this._processInputParams(e), r = t.data;
|
|
@@ -7240,16 +7240,16 @@ function Wn(n, e = {}, t) {
|
|
|
7240
7240
|
}
|
|
7241
7241
|
}) : Ke.create();
|
|
7242
7242
|
}
|
|
7243
|
-
const
|
|
7243
|
+
const Ti = {
|
|
7244
7244
|
object: N.lazycreate
|
|
7245
7245
|
};
|
|
7246
7246
|
var k;
|
|
7247
7247
|
(function(n) {
|
|
7248
7248
|
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";
|
|
7249
7249
|
})(k || (k = {}));
|
|
7250
|
-
const
|
|
7250
|
+
const Oi = (n, e = {
|
|
7251
7251
|
message: `Input not instance of ${n.name}`
|
|
7252
|
-
}) => Wn((t) => t instanceof n, e), Kn = z.create, Qn = ve.create,
|
|
7252
|
+
}) => Wn((t) => t instanceof n, e), Kn = z.create, Qn = ve.create, Si = Kt.create, Zi = we.create, Jn = gt.create, ji = Ee.create, Ii = Bt.create, Ci = yt.create, Ei = vt.create, Ni = Ke.create, Ai = je.create, Ri = oe.create, $i = qt.create, Pi = q.create, Di = N.create, Mi = N.strictCreate, Li = wt.create, Vi = Ht.create, Ui = kt.create, Fi = re.create, zi = xt.create, Bi = Wt.create, qi = Ne.create, Wi = Fe.create, Ki = bt.create, Qi = Tt.create, Ji = ke.create, Hi = Ot.create, Yi = Qe.create, kn = K.create, Gi = X.create, Xi = xe.create, eo = K.createWithPreprocess, to = Ct.create, no = () => Kn().optional(), ro = () => Qn().optional(), so = () => Jn().optional(), ao = {
|
|
7253
7253
|
string: (n) => z.create({ ...n, coerce: !0 }),
|
|
7254
7254
|
number: (n) => ve.create({ ...n, coerce: !0 }),
|
|
7255
7255
|
boolean: (n) => gt.create({
|
|
@@ -7258,14 +7258,14 @@ const Ti = (n, e = {
|
|
|
7258
7258
|
}),
|
|
7259
7259
|
bigint: (n) => we.create({ ...n, coerce: !0 }),
|
|
7260
7260
|
date: (n) => Ee.create({ ...n, coerce: !0 })
|
|
7261
|
-
},
|
|
7262
|
-
var
|
|
7261
|
+
}, io = x;
|
|
7262
|
+
var oo = /* @__PURE__ */ Object.freeze({
|
|
7263
7263
|
__proto__: null,
|
|
7264
7264
|
defaultErrorMap: We,
|
|
7265
|
-
setErrorMap:
|
|
7265
|
+
setErrorMap: ii,
|
|
7266
7266
|
getErrorMap: Ut,
|
|
7267
7267
|
makeIssue: Ft,
|
|
7268
|
-
EMPTY_PATH:
|
|
7268
|
+
EMPTY_PATH: oi,
|
|
7269
7269
|
addIssueToContext: m,
|
|
7270
7270
|
ParseStatus: P,
|
|
7271
7271
|
INVALID: x,
|
|
@@ -7319,63 +7319,63 @@ var io = /* @__PURE__ */ Object.freeze({
|
|
|
7319
7319
|
ZodDefault: St,
|
|
7320
7320
|
ZodCatch: Zt,
|
|
7321
7321
|
ZodNaN: Kt,
|
|
7322
|
-
BRAND:
|
|
7322
|
+
BRAND: bi,
|
|
7323
7323
|
ZodBranded: mn,
|
|
7324
7324
|
ZodPipeline: Ct,
|
|
7325
7325
|
ZodReadonly: jt,
|
|
7326
7326
|
custom: Wn,
|
|
7327
7327
|
Schema: j,
|
|
7328
7328
|
ZodSchema: j,
|
|
7329
|
-
late:
|
|
7329
|
+
late: Ti,
|
|
7330
7330
|
get ZodFirstPartyTypeKind() {
|
|
7331
7331
|
return k;
|
|
7332
7332
|
},
|
|
7333
|
-
coerce:
|
|
7334
|
-
any:
|
|
7335
|
-
array:
|
|
7336
|
-
bigint:
|
|
7333
|
+
coerce: ao,
|
|
7334
|
+
any: Ni,
|
|
7335
|
+
array: Pi,
|
|
7336
|
+
bigint: Zi,
|
|
7337
7337
|
boolean: Jn,
|
|
7338
|
-
date:
|
|
7339
|
-
discriminatedUnion:
|
|
7338
|
+
date: ji,
|
|
7339
|
+
discriminatedUnion: Vi,
|
|
7340
7340
|
effect: kn,
|
|
7341
|
-
enum:
|
|
7342
|
-
function:
|
|
7343
|
-
instanceof:
|
|
7344
|
-
intersection:
|
|
7345
|
-
lazy:
|
|
7346
|
-
literal:
|
|
7347
|
-
map:
|
|
7348
|
-
nan:
|
|
7349
|
-
nativeEnum:
|
|
7350
|
-
never:
|
|
7351
|
-
null:
|
|
7352
|
-
nullable:
|
|
7341
|
+
enum: Ji,
|
|
7342
|
+
function: Wi,
|
|
7343
|
+
instanceof: Oi,
|
|
7344
|
+
intersection: Ui,
|
|
7345
|
+
lazy: Ki,
|
|
7346
|
+
literal: Qi,
|
|
7347
|
+
map: Bi,
|
|
7348
|
+
nan: Si,
|
|
7349
|
+
nativeEnum: Hi,
|
|
7350
|
+
never: Ri,
|
|
7351
|
+
null: Ei,
|
|
7352
|
+
nullable: Xi,
|
|
7353
7353
|
number: Qn,
|
|
7354
|
-
object:
|
|
7355
|
-
oboolean:
|
|
7356
|
-
onumber:
|
|
7357
|
-
optional:
|
|
7358
|
-
ostring:
|
|
7359
|
-
pipeline:
|
|
7360
|
-
preprocess:
|
|
7361
|
-
promise:
|
|
7362
|
-
record:
|
|
7363
|
-
set:
|
|
7364
|
-
strictObject:
|
|
7354
|
+
object: Di,
|
|
7355
|
+
oboolean: so,
|
|
7356
|
+
onumber: ro,
|
|
7357
|
+
optional: Gi,
|
|
7358
|
+
ostring: no,
|
|
7359
|
+
pipeline: to,
|
|
7360
|
+
preprocess: eo,
|
|
7361
|
+
promise: Yi,
|
|
7362
|
+
record: zi,
|
|
7363
|
+
set: qi,
|
|
7364
|
+
strictObject: Mi,
|
|
7365
7365
|
string: Kn,
|
|
7366
|
-
symbol:
|
|
7366
|
+
symbol: Ii,
|
|
7367
7367
|
transformer: kn,
|
|
7368
|
-
tuple:
|
|
7369
|
-
undefined:
|
|
7370
|
-
union:
|
|
7371
|
-
unknown:
|
|
7372
|
-
void:
|
|
7373
|
-
NEVER:
|
|
7368
|
+
tuple: Fi,
|
|
7369
|
+
undefined: Ci,
|
|
7370
|
+
union: Li,
|
|
7371
|
+
unknown: Ai,
|
|
7372
|
+
void: $i,
|
|
7373
|
+
NEVER: io,
|
|
7374
7374
|
ZodIssueCode: h,
|
|
7375
|
-
quotelessJson:
|
|
7375
|
+
quotelessJson: ai,
|
|
7376
7376
|
ZodError: U
|
|
7377
7377
|
});
|
|
7378
|
-
|
|
7378
|
+
si(oo);
|
|
7379
7379
|
function Et(n, e = "", t = {}) {
|
|
7380
7380
|
for (let r in n)
|
|
7381
7381
|
if (Object.prototype.hasOwnProperty.call(n, r)) {
|
|
@@ -7384,7 +7384,7 @@ function Et(n, e = "", t = {}) {
|
|
|
7384
7384
|
}
|
|
7385
7385
|
return t;
|
|
7386
7386
|
}
|
|
7387
|
-
function
|
|
7387
|
+
function co(n, e) {
|
|
7388
7388
|
const t = {};
|
|
7389
7389
|
for (const [r, s] of Object.entries(n)) {
|
|
7390
7390
|
let a = t;
|
|
@@ -7402,7 +7402,7 @@ function oo(n, e) {
|
|
|
7402
7402
|
}
|
|
7403
7403
|
return t;
|
|
7404
7404
|
}
|
|
7405
|
-
function
|
|
7405
|
+
function uo(n) {
|
|
7406
7406
|
return async (e, t) => {
|
|
7407
7407
|
const r = {
|
|
7408
7408
|
themeId: Re(),
|
|
@@ -7413,16 +7413,16 @@ function co(n) {
|
|
|
7413
7413
|
return await n.insertInto("themes").values({ ...Et(r), tenant_id: e }).execute(), r;
|
|
7414
7414
|
};
|
|
7415
7415
|
}
|
|
7416
|
-
function
|
|
7416
|
+
function lo(n) {
|
|
7417
7417
|
return async (e, t) => (await n.deleteFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
7418
7418
|
}
|
|
7419
|
-
function
|
|
7419
|
+
function po(n) {
|
|
7420
7420
|
return async (e, t) => {
|
|
7421
7421
|
const r = await n.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", t).selectAll().executeTakeFirst();
|
|
7422
7422
|
return r ? R(r) : null;
|
|
7423
7423
|
};
|
|
7424
7424
|
}
|
|
7425
|
-
function
|
|
7425
|
+
function ho(n) {
|
|
7426
7426
|
return async (e, t, r) => {
|
|
7427
7427
|
const s = Et({
|
|
7428
7428
|
...r,
|
|
@@ -7431,24 +7431,24 @@ function po(n) {
|
|
|
7431
7431
|
return await n.updateTable("themes").set(s).where("themes.id", "=", t).where("themes.tenant_id", "=", e).execute(), !0;
|
|
7432
7432
|
};
|
|
7433
7433
|
}
|
|
7434
|
-
function
|
|
7434
|
+
function fo(n) {
|
|
7435
7435
|
return {
|
|
7436
|
-
create:
|
|
7437
|
-
get:
|
|
7438
|
-
remove:
|
|
7439
|
-
update:
|
|
7436
|
+
create: uo(n),
|
|
7437
|
+
get: po(n),
|
|
7438
|
+
remove: lo(n),
|
|
7439
|
+
update: ho(n)
|
|
7440
7440
|
};
|
|
7441
7441
|
}
|
|
7442
|
-
function
|
|
7442
|
+
function mo(n) {
|
|
7443
7443
|
return async (e, t) => {
|
|
7444
7444
|
const r = (/* @__PURE__ */ new Date()).toISOString(), s = await n.selectFrom("logins").where("logins.tenant_id", "=", e).where("logins.expires_at", ">", r).where("logins.id", "=", t).selectAll().executeTakeFirst();
|
|
7445
|
-
return s ?
|
|
7445
|
+
return s ? gs.parse(co(s, ["authParams"])) : null;
|
|
7446
7446
|
};
|
|
7447
7447
|
}
|
|
7448
|
-
function
|
|
7448
|
+
function _o(n) {
|
|
7449
7449
|
return async (e, t) => {
|
|
7450
7450
|
const r = {
|
|
7451
|
-
|
|
7451
|
+
login_id: Re(),
|
|
7452
7452
|
...t,
|
|
7453
7453
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7454
7454
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -7456,43 +7456,43 @@ function mo(n) {
|
|
|
7456
7456
|
return await n.insertInto("logins").values({ ...Et(r), tenant_id: e }).execute(), r;
|
|
7457
7457
|
};
|
|
7458
7458
|
}
|
|
7459
|
-
function
|
|
7459
|
+
function go(n) {
|
|
7460
7460
|
return async (e, t, r) => (await n.updateTable("logins").set(Et(r)).where("id", "=", t).where("tenant_id", "=", e).execute()).length === 1;
|
|
7461
7461
|
}
|
|
7462
|
-
function
|
|
7462
|
+
function yo(n) {
|
|
7463
7463
|
return async (e, t) => (await n.deleteFrom("logins").where("logins.tenant_id", "=", e).where("logins.id", "=", t).execute()).length > 0;
|
|
7464
7464
|
}
|
|
7465
|
-
function
|
|
7465
|
+
function vo(n) {
|
|
7466
7466
|
return {
|
|
7467
|
-
create:
|
|
7468
|
-
get:
|
|
7469
|
-
update:
|
|
7470
|
-
remove:
|
|
7467
|
+
create: _o(n),
|
|
7468
|
+
get: mo(n),
|
|
7469
|
+
update: go(n),
|
|
7470
|
+
remove: yo(n)
|
|
7471
7471
|
};
|
|
7472
7472
|
}
|
|
7473
|
-
function
|
|
7473
|
+
function ko(n) {
|
|
7474
7474
|
return {
|
|
7475
|
-
applications:
|
|
7476
|
-
authenticationCodes:
|
|
7477
|
-
branding:
|
|
7478
|
-
clients:
|
|
7479
|
-
codes:
|
|
7480
|
-
connections:
|
|
7481
|
-
domains:
|
|
7482
|
-
hooks:
|
|
7483
|
-
keys:
|
|
7484
|
-
|
|
7485
|
-
logs:
|
|
7486
|
-
OTP:
|
|
7487
|
-
passwords:
|
|
7488
|
-
users:
|
|
7489
|
-
sessions:
|
|
7490
|
-
tenants:
|
|
7491
|
-
themes:
|
|
7492
|
-
tickets:
|
|
7493
|
-
universalLoginSessions:
|
|
7475
|
+
applications: Ia(n),
|
|
7476
|
+
authenticationCodes: Ja(n),
|
|
7477
|
+
branding: Wa(n),
|
|
7478
|
+
clients: Pa(n),
|
|
7479
|
+
codes: va(n),
|
|
7480
|
+
connections: $a(n),
|
|
7481
|
+
domains: za(n),
|
|
7482
|
+
hooks: ti(n),
|
|
7483
|
+
keys: Va(n),
|
|
7484
|
+
logins: vo(n),
|
|
7485
|
+
logs: Hs(n),
|
|
7486
|
+
OTP: ua(n),
|
|
7487
|
+
passwords: fa(n),
|
|
7488
|
+
users: Ms(n),
|
|
7489
|
+
sessions: na(n),
|
|
7490
|
+
tenants: qs(n),
|
|
7491
|
+
themes: fo(n),
|
|
7492
|
+
tickets: ia(n),
|
|
7493
|
+
universalLoginSessions: ba(n)
|
|
7494
7494
|
};
|
|
7495
7495
|
}
|
|
7496
7496
|
export {
|
|
7497
|
-
|
|
7497
|
+
ko as default
|
|
7498
7498
|
};
|