@authhero/kysely-adapter 0.7.7 → 0.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kysely-adapter.cjs +1 -1
- package/dist/kysely-adapter.d.ts +430 -52
- package/dist/kysely-adapter.iife.js +1 -1
- package/dist/kysely-adapter.mjs +327 -308
- package/package.json +2 -2
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -3040,6 +3040,23 @@ In.extend({
|
|
|
3040
3040
|
user_id: i.string()
|
|
3041
3041
|
}).catchall(i.any());
|
|
3042
3042
|
const ar = i.object({
|
|
3043
|
+
audience: i.string().optional(),
|
|
3044
|
+
recipient: i.string().optional(),
|
|
3045
|
+
createUpnClaim: i.boolean().optional(),
|
|
3046
|
+
mapUnknownClaimsAsIs: i.boolean().optional(),
|
|
3047
|
+
passthroughClaimsWithNoMapping: i.boolean().optional(),
|
|
3048
|
+
mapIdentities: i.boolean().optional(),
|
|
3049
|
+
signatureAlgorithm: i.string().optional(),
|
|
3050
|
+
digestAlgorithm: i.string().optional(),
|
|
3051
|
+
issuer: i.string().optional(),
|
|
3052
|
+
destination: i.string().optional(),
|
|
3053
|
+
lifetimeInSeconds: i.number().optional(),
|
|
3054
|
+
signResponse: i.boolean().optional(),
|
|
3055
|
+
nameIdentifierFormat: i.string().optional(),
|
|
3056
|
+
nameIdentifierProbes: i.array(i.string()).optional(),
|
|
3057
|
+
authnContextClassRef: i.string().optional(),
|
|
3058
|
+
mappings: i.record(i.string()).optional()
|
|
3059
|
+
}), ir = i.object({
|
|
3043
3060
|
id: i.string(),
|
|
3044
3061
|
name: i.string(),
|
|
3045
3062
|
callbacks: i.array(i.string()).openapi({
|
|
@@ -3054,7 +3071,9 @@ const ar = i.object({
|
|
|
3054
3071
|
allowed_logout_urls: i.array(i.string()).openapi({
|
|
3055
3072
|
description: "Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains."
|
|
3056
3073
|
}),
|
|
3057
|
-
addons: i.
|
|
3074
|
+
addons: i.object({
|
|
3075
|
+
samlp: ar.optional()
|
|
3076
|
+
}).optional().openapi({
|
|
3058
3077
|
description: "Addons associated with the client. The key is the addon's package name and the value is an object with the configuration for the addon."
|
|
3059
3078
|
}),
|
|
3060
3079
|
email_validation: i.enum(["enabled", "disabled", "enforced"]).default("enforced").openapi({
|
|
@@ -3064,10 +3083,10 @@ const ar = i.object({
|
|
|
3064
3083
|
disable_sign_ups: i.boolean().default(!1).openapi({
|
|
3065
3084
|
description: "Prevents users from signing up using the hosted login page. This is not available in auth0"
|
|
3066
3085
|
})
|
|
3067
|
-
}),
|
|
3086
|
+
}), or = i.object({
|
|
3068
3087
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3069
3088
|
updated_at: i.string().transform((n) => n === null ? "" : n),
|
|
3070
|
-
...
|
|
3089
|
+
...ir.shape
|
|
3071
3090
|
});
|
|
3072
3091
|
var Cn = /* @__PURE__ */ ((n) => (n.TOKEN = "token", n.TOKEN_ID_TOKEN = "token id_token", n.CODE = "code", n))(Cn || {}), En = /* @__PURE__ */ ((n) => (n.QUERY = "query", n.FRAGMENT = "fragment", n.FORM_POST = "form_post", n.WEB_MESSAGE = "web_message", n.SAML_POST = "saml_post", n))(En || {}), An = /* @__PURE__ */ ((n) => (n.S265 = "S256", n.plain = "plain", n))(An || {});
|
|
3073
3092
|
const Qt = i.object({
|
|
@@ -3100,7 +3119,7 @@ i.object({
|
|
|
3100
3119
|
url: i.string()
|
|
3101
3120
|
}).optional()
|
|
3102
3121
|
});
|
|
3103
|
-
const
|
|
3122
|
+
const cr = i.object({
|
|
3104
3123
|
id: i.string().optional(),
|
|
3105
3124
|
name: i.string(),
|
|
3106
3125
|
client_id: i.string().optional(),
|
|
@@ -3119,7 +3138,7 @@ const or = i.object({
|
|
|
3119
3138
|
id: i.string(),
|
|
3120
3139
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3121
3140
|
updated_at: i.string().transform((n) => n === null ? "" : n)
|
|
3122
|
-
}).extend(
|
|
3141
|
+
}).extend(cr.shape), dr = i.object({
|
|
3123
3142
|
name: i.string(),
|
|
3124
3143
|
audience: i.string(),
|
|
3125
3144
|
sender_email: i.string().email(),
|
|
@@ -3129,11 +3148,11 @@ const or = i.object({
|
|
|
3129
3148
|
primary_color: i.string().optional(),
|
|
3130
3149
|
secondary_color: i.string().optional(),
|
|
3131
3150
|
language: i.string().optional()
|
|
3132
|
-
}),
|
|
3151
|
+
}), ur = i.object({
|
|
3133
3152
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3134
3153
|
updated_at: i.string().transform((n) => n === null ? "" : n),
|
|
3135
3154
|
id: i.string(),
|
|
3136
|
-
...
|
|
3155
|
+
...dr.shape
|
|
3137
3156
|
});
|
|
3138
3157
|
i.object({
|
|
3139
3158
|
logoUrl: i.string(),
|
|
@@ -3153,7 +3172,7 @@ i.object({
|
|
|
3153
3172
|
siteUrl: i.string().nullable(),
|
|
3154
3173
|
manageSubscriptionsUrl: i.string().optional()
|
|
3155
3174
|
});
|
|
3156
|
-
const
|
|
3175
|
+
const lr = i.object({
|
|
3157
3176
|
domain: i.string(),
|
|
3158
3177
|
dkim_private_key: i.string().optional(),
|
|
3159
3178
|
dkim_public_key: i.string().optional(),
|
|
@@ -3161,32 +3180,32 @@ const ur = i.object({
|
|
|
3161
3180
|
email_service: i.union([i.literal("mailgun"), i.literal("mailchannels")]).optional()
|
|
3162
3181
|
});
|
|
3163
3182
|
i.object({
|
|
3164
|
-
...
|
|
3165
|
-
domains: i.array(
|
|
3166
|
-
tenant:
|
|
3183
|
+
...or.shape,
|
|
3184
|
+
domains: i.array(lr),
|
|
3185
|
+
tenant: ur,
|
|
3167
3186
|
connections: i.array(Rn)
|
|
3168
3187
|
});
|
|
3169
|
-
const
|
|
3188
|
+
const pr = i.enum([
|
|
3170
3189
|
"password_reset",
|
|
3171
3190
|
"email_verification",
|
|
3172
3191
|
"otp",
|
|
3173
3192
|
"oauth2",
|
|
3174
3193
|
"oauth2_state",
|
|
3175
3194
|
"ticket"
|
|
3176
|
-
]),
|
|
3195
|
+
]), hr = i.object({
|
|
3177
3196
|
code_id: i.string().openapi({
|
|
3178
3197
|
description: "The code that will be used in for instance an email verification flow"
|
|
3179
3198
|
}),
|
|
3180
3199
|
login_id: i.string().openapi({
|
|
3181
3200
|
description: "The id of the login session that the code is connected to"
|
|
3182
3201
|
}),
|
|
3183
|
-
code_type:
|
|
3202
|
+
code_type: pr,
|
|
3184
3203
|
expires_at: i.string(),
|
|
3185
3204
|
used_at: i.string().optional()
|
|
3186
|
-
}), hr = i.object({
|
|
3187
|
-
...pr.shape,
|
|
3188
|
-
created_at: i.string()
|
|
3189
3205
|
}), fr = i.object({
|
|
3206
|
+
...hr.shape,
|
|
3207
|
+
created_at: i.string()
|
|
3208
|
+
}), mr = i.object({
|
|
3190
3209
|
domain: i.string(),
|
|
3191
3210
|
dkim_private_key: i.string().optional(),
|
|
3192
3211
|
dkim_public_key: i.string().optional(),
|
|
@@ -3194,10 +3213,10 @@ const lr = i.enum([
|
|
|
3194
3213
|
email_service: i.enum(["mailgun", "mailchannels"])
|
|
3195
3214
|
});
|
|
3196
3215
|
un.extend({
|
|
3197
|
-
...
|
|
3216
|
+
...mr.shape,
|
|
3198
3217
|
id: i.string()
|
|
3199
3218
|
});
|
|
3200
|
-
const
|
|
3219
|
+
const _r = i.object({
|
|
3201
3220
|
trigger_id: i.enum([
|
|
3202
3221
|
"pre-user-signup",
|
|
3203
3222
|
"post-user-registration",
|
|
@@ -3209,11 +3228,11 @@ const mr = i.object({
|
|
|
3209
3228
|
synchronous: i.boolean().default(!1),
|
|
3210
3229
|
priority: i.number().optional()
|
|
3211
3230
|
});
|
|
3212
|
-
|
|
3231
|
+
_r.extend({
|
|
3213
3232
|
...un.shape,
|
|
3214
3233
|
hook_id: i.string()
|
|
3215
3234
|
});
|
|
3216
|
-
const
|
|
3235
|
+
const gr = i.object({
|
|
3217
3236
|
alg: i.string(),
|
|
3218
3237
|
e: i.string(),
|
|
3219
3238
|
kid: i.string(),
|
|
@@ -3222,7 +3241,7 @@ const _r = i.object({
|
|
|
3222
3241
|
use: i.string().optional()
|
|
3223
3242
|
});
|
|
3224
3243
|
i.object({
|
|
3225
|
-
keys: i.array(
|
|
3244
|
+
keys: i.array(gr)
|
|
3226
3245
|
});
|
|
3227
3246
|
i.object({
|
|
3228
3247
|
issuer: i.string(),
|
|
@@ -3246,7 +3265,7 @@ i.object({
|
|
|
3246
3265
|
request_parameter_supported: i.boolean(),
|
|
3247
3266
|
token_endpoint_auth_signing_alg_values_supported: i.array(i.string())
|
|
3248
3267
|
});
|
|
3249
|
-
const
|
|
3268
|
+
const yr = i.object({
|
|
3250
3269
|
auth0Client: i.string().optional(),
|
|
3251
3270
|
authParams: Qt,
|
|
3252
3271
|
expires_at: i.string(),
|
|
@@ -3254,14 +3273,14 @@ const gr = i.object({
|
|
|
3254
3273
|
ip: i.string().optional()
|
|
3255
3274
|
}).openapi({
|
|
3256
3275
|
description: "This represents a login sesion"
|
|
3257
|
-
}),
|
|
3258
|
-
...
|
|
3276
|
+
}), vr = i.object({
|
|
3277
|
+
...yr.shape,
|
|
3259
3278
|
login_id: i.string().openapi({
|
|
3260
3279
|
description: "This is is used as the state in the universal login"
|
|
3261
3280
|
}),
|
|
3262
3281
|
created_at: i.string(),
|
|
3263
3282
|
updated_at: i.string()
|
|
3264
|
-
}),
|
|
3283
|
+
}), wr = i.enum([
|
|
3265
3284
|
"cls",
|
|
3266
3285
|
// CODE_LINK_SENT
|
|
3267
3286
|
"fsa",
|
|
@@ -3310,7 +3329,7 @@ const gr = i.object({
|
|
|
3310
3329
|
// SUCCESS_VERIFICATION_EMAIL
|
|
3311
3330
|
"svr"
|
|
3312
3331
|
// SUCCESS_VERIFICATION_EMAIL_REQUEST
|
|
3313
|
-
]),
|
|
3332
|
+
]), kr = i.object({
|
|
3314
3333
|
name: i.string(),
|
|
3315
3334
|
version: i.string(),
|
|
3316
3335
|
env: i.object({
|
|
@@ -3318,7 +3337,7 @@ const gr = i.object({
|
|
|
3318
3337
|
}).optional()
|
|
3319
3338
|
});
|
|
3320
3339
|
i.object({
|
|
3321
|
-
type:
|
|
3340
|
+
type: wr,
|
|
3322
3341
|
date: i.string(),
|
|
3323
3342
|
description: i.string().optional(),
|
|
3324
3343
|
log_id: i.string().optional(),
|
|
@@ -3339,19 +3358,19 @@ i.object({
|
|
|
3339
3358
|
strategy: i.string().optional(),
|
|
3340
3359
|
strategy_type: i.string().optional(),
|
|
3341
3360
|
hostname: i.string().optional(),
|
|
3342
|
-
auth0_client:
|
|
3361
|
+
auth0_client: kr.optional()
|
|
3343
3362
|
});
|
|
3344
|
-
const
|
|
3363
|
+
const br = i.object({
|
|
3345
3364
|
user_id: i.string(),
|
|
3346
3365
|
password: i.string(),
|
|
3347
3366
|
algorithm: i.enum(["bcrypt", "argon2id"]).default("argon2id")
|
|
3348
3367
|
});
|
|
3349
3368
|
i.object({
|
|
3350
|
-
...
|
|
3369
|
+
...br.shape,
|
|
3351
3370
|
created_at: i.string(),
|
|
3352
3371
|
updated_at: i.string()
|
|
3353
3372
|
});
|
|
3354
|
-
const
|
|
3373
|
+
const xr = i.object({
|
|
3355
3374
|
session_id: i.string(),
|
|
3356
3375
|
client_id: i.string(),
|
|
3357
3376
|
expires_at: i.string(),
|
|
@@ -3361,7 +3380,7 @@ const br = i.object({
|
|
|
3361
3380
|
});
|
|
3362
3381
|
i.object({
|
|
3363
3382
|
created_at: i.string(),
|
|
3364
|
-
...
|
|
3383
|
+
...xr.shape
|
|
3365
3384
|
});
|
|
3366
3385
|
i.object({
|
|
3367
3386
|
private_key: i.string(),
|
|
@@ -3434,7 +3453,7 @@ i.object({
|
|
|
3434
3453
|
code: i.string(),
|
|
3435
3454
|
state: i.string().optional()
|
|
3436
3455
|
});
|
|
3437
|
-
const
|
|
3456
|
+
const Tr = i.object({
|
|
3438
3457
|
button_border_radius: i.number(),
|
|
3439
3458
|
button_border_weight: i.number(),
|
|
3440
3459
|
buttons_style: i.enum(["pill"]),
|
|
@@ -3444,7 +3463,7 @@ const xr = i.object({
|
|
|
3444
3463
|
show_widget_shadow: i.boolean(),
|
|
3445
3464
|
widget_border_weight: i.number(),
|
|
3446
3465
|
widget_corner_radius: i.number()
|
|
3447
|
-
}),
|
|
3466
|
+
}), Or = i.object({
|
|
3448
3467
|
base_focus_color: i.string(),
|
|
3449
3468
|
base_hover_color: i.string(),
|
|
3450
3469
|
body_text: i.string(),
|
|
@@ -3467,7 +3486,7 @@ const xr = i.object({
|
|
|
3467
3486
|
}), De = i.object({
|
|
3468
3487
|
bold: i.boolean(),
|
|
3469
3488
|
size: i.number()
|
|
3470
|
-
}),
|
|
3489
|
+
}), Sr = i.object({
|
|
3471
3490
|
body_text: De,
|
|
3472
3491
|
buttons_text: De,
|
|
3473
3492
|
font_url: i.string(),
|
|
@@ -3477,39 +3496,39 @@ const xr = i.object({
|
|
|
3477
3496
|
reference_text_size: i.number(),
|
|
3478
3497
|
subtitle: De,
|
|
3479
3498
|
title: De
|
|
3480
|
-
}),
|
|
3499
|
+
}), Zr = i.object({
|
|
3481
3500
|
background_color: i.string(),
|
|
3482
3501
|
background_image_url: i.string(),
|
|
3483
3502
|
page_layout: i.enum(["center"])
|
|
3484
|
-
}),
|
|
3503
|
+
}), jr = i.object({
|
|
3485
3504
|
header_text_alignment: i.enum(["center"]),
|
|
3486
3505
|
logo_height: i.number(),
|
|
3487
3506
|
logo_position: i.enum(["center"]),
|
|
3488
3507
|
logo_url: i.string(),
|
|
3489
3508
|
social_buttons_layout: i.enum(["bottom"])
|
|
3490
|
-
}),
|
|
3491
|
-
borders:
|
|
3492
|
-
colors:
|
|
3509
|
+
}), Nr = i.object({
|
|
3510
|
+
borders: Tr,
|
|
3511
|
+
colors: Or,
|
|
3493
3512
|
displayName: i.string(),
|
|
3494
|
-
fonts:
|
|
3495
|
-
page_background:
|
|
3496
|
-
widget:
|
|
3513
|
+
fonts: Sr,
|
|
3514
|
+
page_background: Zr,
|
|
3515
|
+
widget: jr
|
|
3497
3516
|
});
|
|
3498
|
-
|
|
3517
|
+
Nr.extend({
|
|
3499
3518
|
themeId: i.string()
|
|
3500
3519
|
});
|
|
3501
|
-
const
|
|
3520
|
+
const Ir = i.object({
|
|
3502
3521
|
id: i.string(),
|
|
3503
3522
|
expires_at: i.string(),
|
|
3504
3523
|
auth0Client: i.string().optional(),
|
|
3505
3524
|
authParams: Qt
|
|
3506
3525
|
});
|
|
3507
3526
|
i.object({
|
|
3508
|
-
...
|
|
3527
|
+
...Ir.shape,
|
|
3509
3528
|
created_at: i.string(),
|
|
3510
3529
|
updated_at: i.string()
|
|
3511
3530
|
});
|
|
3512
|
-
const
|
|
3531
|
+
const Cr = i.object({
|
|
3513
3532
|
id: i.string(),
|
|
3514
3533
|
email: i.string(),
|
|
3515
3534
|
code: i.string(),
|
|
@@ -3522,9 +3541,9 @@ const Ir = i.object({
|
|
|
3522
3541
|
});
|
|
3523
3542
|
i.object({
|
|
3524
3543
|
created_at: i.string(),
|
|
3525
|
-
...
|
|
3544
|
+
...Cr.shape
|
|
3526
3545
|
});
|
|
3527
|
-
const
|
|
3546
|
+
const Er = i.object({
|
|
3528
3547
|
authParams: Qt,
|
|
3529
3548
|
code: i.string(),
|
|
3530
3549
|
user_id: i.string(),
|
|
@@ -3533,7 +3552,7 @@ const Cr = i.object({
|
|
|
3533
3552
|
used_at: i.string().optional()
|
|
3534
3553
|
});
|
|
3535
3554
|
i.object({
|
|
3536
|
-
...
|
|
3555
|
+
...Er.shape,
|
|
3537
3556
|
created_at: i.string()
|
|
3538
3557
|
});
|
|
3539
3558
|
function pn(n) {
|
|
@@ -3561,7 +3580,7 @@ function Pn(n) {
|
|
|
3561
3580
|
}
|
|
3562
3581
|
};
|
|
3563
3582
|
}
|
|
3564
|
-
function
|
|
3583
|
+
function Ar(n) {
|
|
3565
3584
|
return async (e, t) => {
|
|
3566
3585
|
const [s, r] = await Promise.all([
|
|
3567
3586
|
n.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", t).selectAll().executeTakeFirst(),
|
|
@@ -3627,7 +3646,7 @@ function Ae(n, e, t, s) {
|
|
|
3627
3646
|
function xe(n) {
|
|
3628
3647
|
return typeof n == "string" ? parseInt(n, 10) : typeof n == "bigint" ? Number(n) : n;
|
|
3629
3648
|
}
|
|
3630
|
-
function
|
|
3649
|
+
function Rr(n) {
|
|
3631
3650
|
return async (e, t) => {
|
|
3632
3651
|
let s = n.selectFrom("users").where("users.tenant_id", "=", e);
|
|
3633
3652
|
if (t.q && (s = Ae(n, s, t.q, ["email", "name"])), t.sort && t.sort.sort_by) {
|
|
@@ -3661,48 +3680,48 @@ function Ar(n) {
|
|
|
3661
3680
|
};
|
|
3662
3681
|
};
|
|
3663
3682
|
}
|
|
3664
|
-
function
|
|
3683
|
+
function $r(n) {
|
|
3665
3684
|
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);
|
|
3666
3685
|
}
|
|
3667
|
-
function
|
|
3686
|
+
function Pr(n) {
|
|
3668
3687
|
if (n.email_verified !== void 0)
|
|
3669
3688
|
return n.email_verified ? 1 : 0;
|
|
3670
3689
|
}
|
|
3671
|
-
function
|
|
3690
|
+
function Dr(n) {
|
|
3672
3691
|
return async (e, t, s) => {
|
|
3673
3692
|
const r = {
|
|
3674
3693
|
...s,
|
|
3675
|
-
email_verified:
|
|
3694
|
+
email_verified: Pr(s),
|
|
3676
3695
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3677
3696
|
};
|
|
3678
3697
|
return (await n.updateTable("users").set(r).where("users.tenant_id", "=", e).where("users.user_id", "=", t).execute()).length === 1;
|
|
3679
3698
|
};
|
|
3680
3699
|
}
|
|
3681
|
-
function
|
|
3700
|
+
function Mr(n) {
|
|
3682
3701
|
return async (e, t, s, r) => {
|
|
3683
3702
|
const a = { linked_to: null };
|
|
3684
3703
|
return (await n.updateTable("users").set(a).where("users.tenant_id", "=", e).where("users.user_id", "=", `${s}|${r}`).where("users.linked_to", "=", `${t}`).execute()).length === 1;
|
|
3685
3704
|
};
|
|
3686
3705
|
}
|
|
3687
|
-
function
|
|
3706
|
+
function Lr(n) {
|
|
3688
3707
|
return {
|
|
3689
3708
|
create: Hn(n),
|
|
3690
|
-
remove:
|
|
3691
|
-
get:
|
|
3692
|
-
list:
|
|
3693
|
-
update:
|
|
3709
|
+
remove: $r(n),
|
|
3710
|
+
get: Ar(n),
|
|
3711
|
+
list: Rr(n),
|
|
3712
|
+
update: Dr(n),
|
|
3694
3713
|
// TODO - think about this more when other issues fixed
|
|
3695
|
-
unlink:
|
|
3714
|
+
unlink: Mr(n)
|
|
3696
3715
|
};
|
|
3697
3716
|
}
|
|
3698
|
-
const
|
|
3717
|
+
const Vr = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
3699
3718
|
let Re = (n = 21) => {
|
|
3700
3719
|
let e = "", t = crypto.getRandomValues(new Uint8Array(n));
|
|
3701
3720
|
for (; n--; )
|
|
3702
|
-
e +=
|
|
3721
|
+
e += Vr[t[n] & 63];
|
|
3703
3722
|
return e;
|
|
3704
3723
|
};
|
|
3705
|
-
function
|
|
3724
|
+
function Ur(n) {
|
|
3706
3725
|
return async (e) => {
|
|
3707
3726
|
const t = {
|
|
3708
3727
|
id: e.id || Re(),
|
|
@@ -3713,13 +3732,13 @@ function Vr(n) {
|
|
|
3713
3732
|
return await n.insertInto("tenants").values(t).execute(), t;
|
|
3714
3733
|
};
|
|
3715
3734
|
}
|
|
3716
|
-
function
|
|
3735
|
+
function Fr(n) {
|
|
3717
3736
|
return async (e) => {
|
|
3718
3737
|
const t = await n.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
|
|
3719
3738
|
return t ? R(t) : null;
|
|
3720
3739
|
};
|
|
3721
3740
|
}
|
|
3722
|
-
function
|
|
3741
|
+
function zr(n) {
|
|
3723
3742
|
return async (e) => {
|
|
3724
3743
|
let t = n.selectFrom("tenants");
|
|
3725
3744
|
if (e.sort && e.sort.sort_by) {
|
|
@@ -3741,7 +3760,7 @@ function Fr(n) {
|
|
|
3741
3760
|
};
|
|
3742
3761
|
};
|
|
3743
3762
|
}
|
|
3744
|
-
function
|
|
3763
|
+
function Br(n) {
|
|
3745
3764
|
return async (e, t) => {
|
|
3746
3765
|
const s = {
|
|
3747
3766
|
...t,
|
|
@@ -3751,29 +3770,29 @@ function zr(n) {
|
|
|
3751
3770
|
await n.updateTable("tenants").set(s).where("id", "=", e).execute();
|
|
3752
3771
|
};
|
|
3753
3772
|
}
|
|
3754
|
-
function
|
|
3773
|
+
function Wr(n) {
|
|
3755
3774
|
return async (e) => (await n.deleteFrom("tenants").where("tenants.id", "=", e).execute()).length === 1;
|
|
3756
3775
|
}
|
|
3757
|
-
function
|
|
3776
|
+
function qr(n) {
|
|
3758
3777
|
return {
|
|
3759
|
-
create:
|
|
3760
|
-
get:
|
|
3761
|
-
list:
|
|
3762
|
-
update:
|
|
3763
|
-
remove:
|
|
3778
|
+
create: Ur(n),
|
|
3779
|
+
get: Fr(n),
|
|
3780
|
+
list: zr(n),
|
|
3781
|
+
update: Br(n),
|
|
3782
|
+
remove: Wr(n)
|
|
3764
3783
|
};
|
|
3765
3784
|
}
|
|
3766
3785
|
function _n(n) {
|
|
3767
3786
|
return n ? JSON.stringify(n) : void 0;
|
|
3768
3787
|
}
|
|
3769
|
-
const
|
|
3770
|
-
function
|
|
3788
|
+
const Jr = 1024;
|
|
3789
|
+
function Kr(n) {
|
|
3771
3790
|
return async (e, t) => {
|
|
3772
3791
|
var r, a, o;
|
|
3773
3792
|
const s = {
|
|
3774
3793
|
id: Re(),
|
|
3775
3794
|
...t,
|
|
3776
|
-
user_agent: t.user_agent.slice(0,
|
|
3795
|
+
user_agent: t.user_agent.slice(0, Jr)
|
|
3777
3796
|
};
|
|
3778
3797
|
return await n.insertInto("logs").values({
|
|
3779
3798
|
...s,
|
|
@@ -3809,7 +3828,7 @@ function Dn(n) {
|
|
|
3809
3828
|
_id: n.id
|
|
3810
3829
|
};
|
|
3811
3830
|
}
|
|
3812
|
-
function
|
|
3831
|
+
function Qr(n) {
|
|
3813
3832
|
return async (e, t) => {
|
|
3814
3833
|
let s = n.selectFrom("logs").where("logs.tenant_id", "=", e);
|
|
3815
3834
|
t.q && (s = Ae(n, s, t.q, ["user_id", "ip"]));
|
|
@@ -3831,23 +3850,23 @@ function Kr(n) {
|
|
|
3831
3850
|
};
|
|
3832
3851
|
};
|
|
3833
3852
|
}
|
|
3834
|
-
function
|
|
3853
|
+
function Hr(n) {
|
|
3835
3854
|
return async (e, t) => {
|
|
3836
3855
|
const s = await n.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", t).selectAll().executeTakeFirst();
|
|
3837
3856
|
return s ? Dn(s) : null;
|
|
3838
3857
|
};
|
|
3839
3858
|
}
|
|
3840
|
-
function
|
|
3859
|
+
function Yr(n) {
|
|
3841
3860
|
return {
|
|
3842
|
-
create:
|
|
3843
|
-
list:
|
|
3844
|
-
get:
|
|
3861
|
+
create: Kr(n),
|
|
3862
|
+
list: Qr(n),
|
|
3863
|
+
get: Hr(n)
|
|
3845
3864
|
};
|
|
3846
3865
|
}
|
|
3847
|
-
function
|
|
3866
|
+
function Gr(n) {
|
|
3848
3867
|
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;
|
|
3849
3868
|
}
|
|
3850
|
-
function
|
|
3869
|
+
function Xr(n) {
|
|
3851
3870
|
return async (e, t) => {
|
|
3852
3871
|
const s = {
|
|
3853
3872
|
...t,
|
|
@@ -3857,13 +3876,13 @@ function Gr(n) {
|
|
|
3857
3876
|
return await n.insertInto("sessions").values({ ...s, tenant_id: e }).execute(), { ...t, ...s };
|
|
3858
3877
|
};
|
|
3859
3878
|
}
|
|
3860
|
-
function
|
|
3879
|
+
function ea(n) {
|
|
3861
3880
|
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;
|
|
3862
3881
|
}
|
|
3863
|
-
function
|
|
3882
|
+
function ta(n) {
|
|
3864
3883
|
return async (e, t, s) => !!(await n.updateTable("sessions").set(s).where("tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).execute()).length;
|
|
3865
3884
|
}
|
|
3866
|
-
function
|
|
3885
|
+
function na(n) {
|
|
3867
3886
|
return async (e, t) => {
|
|
3868
3887
|
let s = n.selectFrom("sessions").where("sessions.tenant_id", "=", e);
|
|
3869
3888
|
t.q && (s = Ae(n, s, t.q, ["user_id", "session_id"]));
|
|
@@ -3885,16 +3904,16 @@ function ta(n) {
|
|
|
3885
3904
|
};
|
|
3886
3905
|
};
|
|
3887
3906
|
}
|
|
3888
|
-
function
|
|
3907
|
+
function sa(n) {
|
|
3889
3908
|
return {
|
|
3890
|
-
create:
|
|
3891
|
-
get:
|
|
3892
|
-
list:
|
|
3893
|
-
remove:
|
|
3894
|
-
update:
|
|
3909
|
+
create: Xr(n),
|
|
3910
|
+
get: Gr(n),
|
|
3911
|
+
list: na(n),
|
|
3912
|
+
remove: ea(n),
|
|
3913
|
+
update: ta(n)
|
|
3895
3914
|
};
|
|
3896
3915
|
}
|
|
3897
|
-
function
|
|
3916
|
+
function ra(n) {
|
|
3898
3917
|
return async (e, t) => {
|
|
3899
3918
|
const s = await n.selectFrom("tickets").where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).where("tickets.used_at", "is", null).selectAll().executeTakeFirst();
|
|
3900
3919
|
if (!s)
|
|
@@ -3924,7 +3943,7 @@ function sa(n) {
|
|
|
3924
3943
|
};
|
|
3925
3944
|
};
|
|
3926
3945
|
}
|
|
3927
|
-
function
|
|
3946
|
+
function aa(n) {
|
|
3928
3947
|
return async (e) => {
|
|
3929
3948
|
const { authParams: t, ...s } = e, r = {
|
|
3930
3949
|
...s,
|
|
@@ -3936,21 +3955,21 @@ function ra(n) {
|
|
|
3936
3955
|
await n.insertInto("tickets").values(r).execute();
|
|
3937
3956
|
};
|
|
3938
3957
|
}
|
|
3939
|
-
function
|
|
3958
|
+
function ia(n) {
|
|
3940
3959
|
return async (e, t) => {
|
|
3941
3960
|
await n.updateTable("tickets").set({
|
|
3942
3961
|
used_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3943
3962
|
}).where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).execute();
|
|
3944
3963
|
};
|
|
3945
3964
|
}
|
|
3946
|
-
function
|
|
3965
|
+
function oa(n) {
|
|
3947
3966
|
return {
|
|
3948
|
-
create:
|
|
3949
|
-
get:
|
|
3950
|
-
remove:
|
|
3967
|
+
create: aa(n),
|
|
3968
|
+
get: ra(n),
|
|
3969
|
+
remove: ia(n)
|
|
3951
3970
|
};
|
|
3952
3971
|
}
|
|
3953
|
-
function
|
|
3972
|
+
function ca(n) {
|
|
3954
3973
|
return async (e, t) => {
|
|
3955
3974
|
const s = (/* @__PURE__ */ new Date()).toISOString();
|
|
3956
3975
|
return (await n.selectFrom("otps").where("otps.tenant_id", "=", e).where("otps.email", "=", t).where("otps.expires_at", ">", s).where("otps.used_at", "is", null).selectAll().execute()).map((a) => {
|
|
@@ -3981,7 +4000,7 @@ function oa(n) {
|
|
|
3981
4000
|
});
|
|
3982
4001
|
};
|
|
3983
4002
|
}
|
|
3984
|
-
function
|
|
4003
|
+
function da(n) {
|
|
3985
4004
|
return async (e, t) => {
|
|
3986
4005
|
const { authParams: s, ...r } = t;
|
|
3987
4006
|
await n.insertInto("otps").values({
|
|
@@ -3994,25 +4013,25 @@ function ca(n) {
|
|
|
3994
4013
|
}).execute();
|
|
3995
4014
|
};
|
|
3996
4015
|
}
|
|
3997
|
-
function
|
|
4016
|
+
function ua(n) {
|
|
3998
4017
|
return async (e, t) => (await n.updateTable("otps").set({
|
|
3999
4018
|
used_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4000
4019
|
}).where("otps.tenant_id", "=", e).where("otps.id", "=", t).execute()).length > 0;
|
|
4001
4020
|
}
|
|
4002
|
-
function
|
|
4021
|
+
function la(n) {
|
|
4003
4022
|
return {
|
|
4004
|
-
create:
|
|
4005
|
-
list:
|
|
4006
|
-
remove:
|
|
4023
|
+
create: da(n),
|
|
4024
|
+
list: ca(n),
|
|
4025
|
+
remove: ua(n)
|
|
4007
4026
|
};
|
|
4008
4027
|
}
|
|
4009
|
-
function
|
|
4028
|
+
function pa(n) {
|
|
4010
4029
|
return async (e, t) => {
|
|
4011
4030
|
const s = await n.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", t).selectAll().executeTakeFirstOrThrow(), { tenant_id: r, ...a } = s;
|
|
4012
4031
|
return a;
|
|
4013
4032
|
};
|
|
4014
4033
|
}
|
|
4015
|
-
function
|
|
4034
|
+
function ha(n) {
|
|
4016
4035
|
return async (e, t) => {
|
|
4017
4036
|
const s = {
|
|
4018
4037
|
...t,
|
|
@@ -4025,20 +4044,20 @@ function pa(n) {
|
|
|
4025
4044
|
}).execute(), s;
|
|
4026
4045
|
};
|
|
4027
4046
|
}
|
|
4028
|
-
function
|
|
4047
|
+
function fa(n) {
|
|
4029
4048
|
return async (e, t) => (await n.updateTable("passwords").set({
|
|
4030
4049
|
password: t.password,
|
|
4031
4050
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4032
4051
|
}).where("tenant_id", "=", e).where("user_id", "=", t.user_id).execute()).length === 1;
|
|
4033
4052
|
}
|
|
4034
|
-
function
|
|
4053
|
+
function ma(n) {
|
|
4035
4054
|
return {
|
|
4036
|
-
create:
|
|
4037
|
-
update:
|
|
4038
|
-
get:
|
|
4055
|
+
create: ha(n),
|
|
4056
|
+
update: fa(n),
|
|
4057
|
+
get: pa(n)
|
|
4039
4058
|
};
|
|
4040
4059
|
}
|
|
4041
|
-
function
|
|
4060
|
+
function _a(n) {
|
|
4042
4061
|
return async (e, t) => {
|
|
4043
4062
|
let s = n.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
4044
4063
|
t.q && (s = Ae(n, s, t.q, ["code", "login_id"]));
|
|
@@ -4046,7 +4065,7 @@ function ma(n) {
|
|
|
4046
4065
|
return {
|
|
4047
4066
|
codes: a.map((d) => {
|
|
4048
4067
|
const { tenant_id: u, ...l } = d;
|
|
4049
|
-
return
|
|
4068
|
+
return fr.parse(R(l));
|
|
4050
4069
|
}),
|
|
4051
4070
|
start: t.page * t.per_page,
|
|
4052
4071
|
limit: t.per_page,
|
|
@@ -4054,7 +4073,7 @@ function ma(n) {
|
|
|
4054
4073
|
};
|
|
4055
4074
|
};
|
|
4056
4075
|
}
|
|
4057
|
-
function
|
|
4076
|
+
function ga(n) {
|
|
4058
4077
|
return async (e, t) => {
|
|
4059
4078
|
const s = {
|
|
4060
4079
|
...t,
|
|
@@ -4066,24 +4085,24 @@ function _a(n) {
|
|
|
4066
4085
|
}).execute(), s;
|
|
4067
4086
|
};
|
|
4068
4087
|
}
|
|
4069
|
-
function
|
|
4088
|
+
function ya(n) {
|
|
4070
4089
|
return async (e, t) => (await n.deleteFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4071
4090
|
}
|
|
4072
|
-
function
|
|
4091
|
+
function va(n) {
|
|
4073
4092
|
return async (e, t, s) => {
|
|
4074
4093
|
const r = await n.selectFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", t).where("codes.code_type", "=", s).selectAll().executeTakeFirst();
|
|
4075
4094
|
return r ? R(r) : null;
|
|
4076
4095
|
};
|
|
4077
4096
|
}
|
|
4078
|
-
function
|
|
4097
|
+
function wa(n) {
|
|
4079
4098
|
return {
|
|
4080
|
-
create:
|
|
4081
|
-
list:
|
|
4082
|
-
remove:
|
|
4083
|
-
get:
|
|
4099
|
+
create: ga(n),
|
|
4100
|
+
list: _a(n),
|
|
4101
|
+
remove: ya(n),
|
|
4102
|
+
get: va(n)
|
|
4084
4103
|
};
|
|
4085
4104
|
}
|
|
4086
|
-
function
|
|
4105
|
+
function ka(n) {
|
|
4087
4106
|
return async (e) => {
|
|
4088
4107
|
const t = (/* @__PURE__ */ new Date()).toISOString(), s = await n.selectFrom("universal_login_sessions").where("universal_login_sessions.expires_at", ">", t).where("universal_login_sessions.id", "=", e).selectAll().executeTakeFirst();
|
|
4089
4108
|
if (!s) return null;
|
|
@@ -4121,7 +4140,7 @@ function wa(n) {
|
|
|
4121
4140
|
};
|
|
4122
4141
|
};
|
|
4123
4142
|
}
|
|
4124
|
-
function
|
|
4143
|
+
function ba(n) {
|
|
4125
4144
|
return async (e, t) => {
|
|
4126
4145
|
const { authParams: s, ...r } = t, a = {
|
|
4127
4146
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -4130,20 +4149,20 @@ function ka(n) {
|
|
|
4130
4149
|
return await n.insertInto("universal_login_sessions").values({ ...s, ...r, ...a, tenant_id: e }).execute(), { ...t, ...a };
|
|
4131
4150
|
};
|
|
4132
4151
|
}
|
|
4133
|
-
function
|
|
4152
|
+
function xa(n) {
|
|
4134
4153
|
return async (e, t, s) => {
|
|
4135
4154
|
const { authParams: r, ...a } = s;
|
|
4136
4155
|
return (await n.updateTable("universal_login_sessions").set({ ...r, ...a }).where("id", "=", t).where("tenant_id", "=", e).execute()).length === 1;
|
|
4137
4156
|
};
|
|
4138
4157
|
}
|
|
4139
|
-
function
|
|
4158
|
+
function Ta(n) {
|
|
4140
4159
|
return {
|
|
4141
|
-
create:
|
|
4142
|
-
get:
|
|
4143
|
-
update:
|
|
4160
|
+
create: ba(n),
|
|
4161
|
+
get: ka(n),
|
|
4162
|
+
update: xa(n)
|
|
4144
4163
|
};
|
|
4145
4164
|
}
|
|
4146
|
-
function
|
|
4165
|
+
function Oa(n) {
|
|
4147
4166
|
return async (e, t) => {
|
|
4148
4167
|
const s = {
|
|
4149
4168
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -4162,7 +4181,7 @@ function Ta(n) {
|
|
|
4162
4181
|
}).execute(), s;
|
|
4163
4182
|
};
|
|
4164
4183
|
}
|
|
4165
|
-
function
|
|
4184
|
+
function Sa(n) {
|
|
4166
4185
|
return async (e) => ({
|
|
4167
4186
|
applications: (await n.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((a) => ({
|
|
4168
4187
|
...a,
|
|
@@ -4175,7 +4194,7 @@ function Oa(n) {
|
|
|
4175
4194
|
}))
|
|
4176
4195
|
});
|
|
4177
4196
|
}
|
|
4178
|
-
function
|
|
4197
|
+
function Za(n) {
|
|
4179
4198
|
return async (e, t) => {
|
|
4180
4199
|
const s = await n.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).selectAll().executeTakeFirst();
|
|
4181
4200
|
return s ? R({
|
|
@@ -4189,10 +4208,10 @@ function Sa(n) {
|
|
|
4189
4208
|
}) : null;
|
|
4190
4209
|
};
|
|
4191
4210
|
}
|
|
4192
|
-
function
|
|
4211
|
+
function ja(n) {
|
|
4193
4212
|
return async (e, t) => (await n.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4194
4213
|
}
|
|
4195
|
-
function
|
|
4214
|
+
function Na(n) {
|
|
4196
4215
|
return async (e, t, s) => {
|
|
4197
4216
|
const r = {
|
|
4198
4217
|
...s,
|
|
@@ -4207,16 +4226,16 @@ function ja(n) {
|
|
|
4207
4226
|
return await n.updateTable("applications").set(r).where("applications.id", "=", t).where("applications.tenant_id", "=", e).execute(), !0;
|
|
4208
4227
|
};
|
|
4209
4228
|
}
|
|
4210
|
-
function
|
|
4229
|
+
function Ia(n) {
|
|
4211
4230
|
return {
|
|
4212
|
-
create:
|
|
4213
|
-
list:
|
|
4214
|
-
get:
|
|
4215
|
-
remove:
|
|
4216
|
-
update:
|
|
4231
|
+
create: Oa(n),
|
|
4232
|
+
list: Sa(n),
|
|
4233
|
+
get: Za(n),
|
|
4234
|
+
remove: ja(n),
|
|
4235
|
+
update: Na(n)
|
|
4217
4236
|
};
|
|
4218
4237
|
}
|
|
4219
|
-
function
|
|
4238
|
+
function Ca(n) {
|
|
4220
4239
|
return async (e, t) => {
|
|
4221
4240
|
const s = {
|
|
4222
4241
|
id: Re(),
|
|
@@ -4227,7 +4246,7 @@ function Ia(n) {
|
|
|
4227
4246
|
return await n.insertInto("connections").values({ ...s, tenant_id: e }).execute(), s;
|
|
4228
4247
|
};
|
|
4229
4248
|
}
|
|
4230
|
-
function
|
|
4249
|
+
function Ea(n) {
|
|
4231
4250
|
return async (e, t) => {
|
|
4232
4251
|
let s = n.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
4233
4252
|
t.q && (s = Ae(n, s, t.q, ["user_id", "ip"]));
|
|
@@ -4240,16 +4259,16 @@ function Ca(n) {
|
|
|
4240
4259
|
};
|
|
4241
4260
|
};
|
|
4242
4261
|
}
|
|
4243
|
-
function
|
|
4262
|
+
function Aa(n) {
|
|
4244
4263
|
return async (e, t) => (await n.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4245
4264
|
}
|
|
4246
|
-
function
|
|
4265
|
+
function Ra(n) {
|
|
4247
4266
|
return async (e, t) => {
|
|
4248
4267
|
const s = await n.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).selectAll().executeTakeFirst();
|
|
4249
4268
|
return s ? R(s) : null;
|
|
4250
4269
|
};
|
|
4251
4270
|
}
|
|
4252
|
-
function
|
|
4271
|
+
function $a(n) {
|
|
4253
4272
|
return async (e, t, s) => {
|
|
4254
4273
|
const r = {
|
|
4255
4274
|
...s,
|
|
@@ -4258,16 +4277,16 @@ function Ra(n) {
|
|
|
4258
4277
|
return await n.updateTable("connections").set(r).where("connections.id", "=", t).where("connections.tenant_id", "=", e).execute(), !0;
|
|
4259
4278
|
};
|
|
4260
4279
|
}
|
|
4261
|
-
function
|
|
4280
|
+
function Pa(n) {
|
|
4262
4281
|
return {
|
|
4263
|
-
create:
|
|
4264
|
-
get:
|
|
4265
|
-
list:
|
|
4266
|
-
remove:
|
|
4267
|
-
update:
|
|
4282
|
+
create: Ca(n),
|
|
4283
|
+
get: Ra(n),
|
|
4284
|
+
list: Ea(n),
|
|
4285
|
+
remove: Aa(n),
|
|
4286
|
+
update: $a(n)
|
|
4268
4287
|
};
|
|
4269
4288
|
}
|
|
4270
|
-
function
|
|
4289
|
+
function Da(n) {
|
|
4271
4290
|
return {
|
|
4272
4291
|
get: async (e) => {
|
|
4273
4292
|
const t = await n.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
|
|
@@ -4295,25 +4314,25 @@ function Pa(n) {
|
|
|
4295
4314
|
}
|
|
4296
4315
|
};
|
|
4297
4316
|
}
|
|
4298
|
-
function
|
|
4317
|
+
function Ma(n) {
|
|
4299
4318
|
return async () => await n.selectFrom("keys").where("revoked_at", "is", null).selectAll().execute();
|
|
4300
4319
|
}
|
|
4301
|
-
function
|
|
4320
|
+
function La(n) {
|
|
4302
4321
|
return async (e) => {
|
|
4303
4322
|
await n.insertInto("keys").values(e).execute();
|
|
4304
4323
|
};
|
|
4305
4324
|
}
|
|
4306
|
-
function
|
|
4325
|
+
function Va(n) {
|
|
4307
4326
|
return async (e, t) => !!(await n.updateTable("keys").set({ revoked_at: t.toISOString() }).where("kid", "=", e).execute()).length;
|
|
4308
4327
|
}
|
|
4309
|
-
function
|
|
4328
|
+
function Ua(n) {
|
|
4310
4329
|
return {
|
|
4311
|
-
create:
|
|
4312
|
-
list:
|
|
4313
|
-
revoke:
|
|
4330
|
+
create: La(n),
|
|
4331
|
+
list: Ma(n),
|
|
4332
|
+
revoke: Va(n)
|
|
4314
4333
|
};
|
|
4315
4334
|
}
|
|
4316
|
-
function
|
|
4335
|
+
function Fa(n) {
|
|
4317
4336
|
return async (e, t) => {
|
|
4318
4337
|
const s = {
|
|
4319
4338
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -4325,7 +4344,7 @@ function Ua(n) {
|
|
|
4325
4344
|
return await n.insertInto("domains").values(s).execute(), s;
|
|
4326
4345
|
};
|
|
4327
4346
|
}
|
|
4328
|
-
function
|
|
4347
|
+
function za(n) {
|
|
4329
4348
|
return async (e, t) => {
|
|
4330
4349
|
let s = n.selectFrom("domains").where("domains.tenant_id", "=", e);
|
|
4331
4350
|
t.q && (s = Ae(n, s, t.q, ["user_id", "ip"]));
|
|
@@ -4338,13 +4357,13 @@ function Fa(n) {
|
|
|
4338
4357
|
};
|
|
4339
4358
|
};
|
|
4340
4359
|
}
|
|
4341
|
-
function
|
|
4360
|
+
function Ba(n) {
|
|
4342
4361
|
return {
|
|
4343
|
-
create:
|
|
4344
|
-
list:
|
|
4362
|
+
create: Fa(n),
|
|
4363
|
+
list: za(n)
|
|
4345
4364
|
};
|
|
4346
4365
|
}
|
|
4347
|
-
function
|
|
4366
|
+
function Wa(n) {
|
|
4348
4367
|
return async (e) => {
|
|
4349
4368
|
const [t] = await n.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
|
|
4350
4369
|
if (!t)
|
|
@@ -4374,7 +4393,7 @@ function Ba(n) {
|
|
|
4374
4393
|
});
|
|
4375
4394
|
};
|
|
4376
4395
|
}
|
|
4377
|
-
function
|
|
4396
|
+
function qa(n) {
|
|
4378
4397
|
return async (e, t) => {
|
|
4379
4398
|
var o, c, d, u, l, T, C, L, K, re, ce, de, ue, $e, Pe, Q, H, Y;
|
|
4380
4399
|
const { colors: s, font: r, ...a } = t;
|
|
@@ -4402,13 +4421,13 @@ function Wa(n) {
|
|
|
4402
4421
|
}
|
|
4403
4422
|
};
|
|
4404
4423
|
}
|
|
4405
|
-
function
|
|
4424
|
+
function Ja(n) {
|
|
4406
4425
|
return {
|
|
4407
|
-
get:
|
|
4408
|
-
set:
|
|
4426
|
+
get: Wa(n),
|
|
4427
|
+
set: qa(n)
|
|
4409
4428
|
};
|
|
4410
4429
|
}
|
|
4411
|
-
function
|
|
4430
|
+
function Ka(n) {
|
|
4412
4431
|
return async (e, t) => {
|
|
4413
4432
|
const s = await n.selectFrom("authentication_codes").where("tenant_id", "=", e).where("code", "=", t).selectAll().executeTakeFirst();
|
|
4414
4433
|
if (!s)
|
|
@@ -4437,7 +4456,7 @@ function Ja(n) {
|
|
|
4437
4456
|
};
|
|
4438
4457
|
};
|
|
4439
4458
|
}
|
|
4440
|
-
function
|
|
4459
|
+
function Qa(n) {
|
|
4441
4460
|
return async (e, t) => {
|
|
4442
4461
|
const { authParams: s, ...r } = t;
|
|
4443
4462
|
await n.insertInto("authentication_codes").values({
|
|
@@ -4447,13 +4466,13 @@ function Ka(n) {
|
|
|
4447
4466
|
}).execute();
|
|
4448
4467
|
};
|
|
4449
4468
|
}
|
|
4450
|
-
function
|
|
4469
|
+
function Ha(n) {
|
|
4451
4470
|
return {
|
|
4452
|
-
create:
|
|
4453
|
-
get:
|
|
4471
|
+
create: Qa(n),
|
|
4472
|
+
get: Ka(n)
|
|
4454
4473
|
};
|
|
4455
4474
|
}
|
|
4456
|
-
function
|
|
4475
|
+
function Ya(n) {
|
|
4457
4476
|
return async (e, t) => {
|
|
4458
4477
|
let s = n.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
4459
4478
|
t.q && (s = Ae(n, s, t.q, ["url"]));
|
|
@@ -4473,16 +4492,16 @@ function Ha(n) {
|
|
|
4473
4492
|
};
|
|
4474
4493
|
};
|
|
4475
4494
|
}
|
|
4476
|
-
function
|
|
4495
|
+
function Ga(n) {
|
|
4477
4496
|
return async (e, t) => {
|
|
4478
4497
|
const s = await n.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).selectAll().executeTakeFirst();
|
|
4479
4498
|
return s ? (s.enabled = !!s.enabled, s.synchronous = !!s.synchronous, R(s)) : null;
|
|
4480
4499
|
};
|
|
4481
4500
|
}
|
|
4482
|
-
function
|
|
4501
|
+
function Xa(n) {
|
|
4483
4502
|
return async (e, t) => (await n.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4484
4503
|
}
|
|
4485
|
-
function
|
|
4504
|
+
function ei(n) {
|
|
4486
4505
|
return async (e, t) => {
|
|
4487
4506
|
const s = {
|
|
4488
4507
|
hook_id: Re(),
|
|
@@ -4496,7 +4515,7 @@ function Xa(n) {
|
|
|
4496
4515
|
}).execute(), s;
|
|
4497
4516
|
};
|
|
4498
4517
|
}
|
|
4499
|
-
function
|
|
4518
|
+
function ti(n) {
|
|
4500
4519
|
return async (e, t, s) => {
|
|
4501
4520
|
const r = {
|
|
4502
4521
|
...s,
|
|
@@ -4505,16 +4524,16 @@ function ei(n) {
|
|
|
4505
4524
|
return await n.updateTable("hooks").set(r).where("hooks.hook_id", "=", t).where("hooks.tenant_id", "=", e).execute(), !0;
|
|
4506
4525
|
};
|
|
4507
4526
|
}
|
|
4508
|
-
function
|
|
4527
|
+
function ni(n) {
|
|
4509
4528
|
return {
|
|
4510
|
-
create:
|
|
4511
|
-
get:
|
|
4512
|
-
list:
|
|
4513
|
-
update:
|
|
4514
|
-
remove:
|
|
4529
|
+
create: ei(n),
|
|
4530
|
+
get: Ga(n),
|
|
4531
|
+
list: Ya(n),
|
|
4532
|
+
update: ti(n),
|
|
4533
|
+
remove: Xa(n)
|
|
4515
4534
|
};
|
|
4516
4535
|
}
|
|
4517
|
-
function
|
|
4536
|
+
function si(n, e) {
|
|
4518
4537
|
var t = {};
|
|
4519
4538
|
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
|
|
4520
4539
|
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -4522,7 +4541,7 @@ function ni(n, e) {
|
|
|
4522
4541
|
e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
|
|
4523
4542
|
return t;
|
|
4524
4543
|
}
|
|
4525
|
-
function
|
|
4544
|
+
function ri(n, e) {
|
|
4526
4545
|
var t;
|
|
4527
4546
|
return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
|
|
4528
4547
|
}
|
|
@@ -4533,15 +4552,15 @@ function He(n, e) {
|
|
|
4533
4552
|
return r._def.openapi = this._def.openapi, r;
|
|
4534
4553
|
};
|
|
4535
4554
|
}
|
|
4536
|
-
function
|
|
4555
|
+
function ai(n) {
|
|
4537
4556
|
if (typeof n.ZodType.prototype.openapi < "u")
|
|
4538
4557
|
return;
|
|
4539
4558
|
n.ZodType.prototype.openapi = function(r, a) {
|
|
4540
4559
|
var o, c, d, u, l, T;
|
|
4541
|
-
const C = typeof r == "string" ? a : r, L = C ?? {}, { param: K } = L, re =
|
|
4560
|
+
const C = typeof r == "string" ? a : r, L = C ?? {}, { param: K } = L, re = si(L, ["param"]), ce = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), de = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), re), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || K ? {
|
|
4542
4561
|
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), K)
|
|
4543
4562
|
} : 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) }));
|
|
4544
|
-
if (
|
|
4563
|
+
if (ri(this, "ZodObject")) {
|
|
4545
4564
|
const $e = this.extend;
|
|
4546
4565
|
ue.extend = function(...Pe) {
|
|
4547
4566
|
var Q, H, Y, le, Te, Oe;
|
|
@@ -4679,7 +4698,7 @@ const g = I.arrayToEnum([
|
|
|
4679
4698
|
"invalid_intersection_types",
|
|
4680
4699
|
"not_multiple_of",
|
|
4681
4700
|
"not_finite"
|
|
4682
|
-
]),
|
|
4701
|
+
]), ii = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
4683
4702
|
class U extends Error {
|
|
4684
4703
|
constructor(e) {
|
|
4685
4704
|
super(), this.issues = [], this.addIssue = (s) => {
|
|
@@ -4797,7 +4816,7 @@ const qe = (n, e) => {
|
|
|
4797
4816
|
return { message: t };
|
|
4798
4817
|
};
|
|
4799
4818
|
let Mn = qe;
|
|
4800
|
-
function
|
|
4819
|
+
function oi(n) {
|
|
4801
4820
|
Mn = n;
|
|
4802
4821
|
}
|
|
4803
4822
|
function Ut() {
|
|
@@ -4823,7 +4842,7 @@ const Ft = (n) => {
|
|
|
4823
4842
|
path: a,
|
|
4824
4843
|
message: c
|
|
4825
4844
|
};
|
|
4826
|
-
},
|
|
4845
|
+
}, ci = [];
|
|
4827
4846
|
function m(n, e) {
|
|
4828
4847
|
const t = Ut(), s = Ft({
|
|
4829
4848
|
issueData: e,
|
|
@@ -5114,14 +5133,14 @@ class j {
|
|
|
5114
5133
|
return this.safeParse(null).success;
|
|
5115
5134
|
}
|
|
5116
5135
|
}
|
|
5117
|
-
const
|
|
5136
|
+
const di = /^c[^\s-]{8,}$/i, ui = /^[0-9a-z]+$/, li = /^[0-9A-HJKMNP-TV-Z]{26}$/, pi = /^[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, hi = /^[a-z0-9_-]{21}$/i, fi = /^[-+]?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)?)??$/, mi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, _i = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
5118
5137
|
let Xt;
|
|
5119
|
-
const
|
|
5138
|
+
const gi = /^(?:(?: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])$/, yi = /^(([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})))$/, vi = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Vn = "((\\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])))", wi = new RegExp(`^${Vn}$`);
|
|
5120
5139
|
function Un(n) {
|
|
5121
5140
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
5122
5141
|
return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
5123
5142
|
}
|
|
5124
|
-
function
|
|
5143
|
+
function ki(n) {
|
|
5125
5144
|
return new RegExp(`^${Un(n)}$`);
|
|
5126
5145
|
}
|
|
5127
5146
|
function Fn(n) {
|
|
@@ -5129,8 +5148,8 @@ function Fn(n) {
|
|
|
5129
5148
|
const t = [];
|
|
5130
5149
|
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
5131
5150
|
}
|
|
5132
|
-
function
|
|
5133
|
-
return !!((e === "v4" || !e) &&
|
|
5151
|
+
function bi(n, e) {
|
|
5152
|
+
return !!((e === "v4" || !e) && gi.test(n) || (e === "v6" || !e) && yi.test(n));
|
|
5134
5153
|
}
|
|
5135
5154
|
class z extends j {
|
|
5136
5155
|
_parse(e) {
|
|
@@ -5181,43 +5200,43 @@ class z extends j {
|
|
|
5181
5200
|
message: a.message
|
|
5182
5201
|
}), s.dirty());
|
|
5183
5202
|
} else if (a.kind === "email")
|
|
5184
|
-
|
|
5203
|
+
mi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5185
5204
|
validation: "email",
|
|
5186
5205
|
code: h.invalid_string,
|
|
5187
5206
|
message: a.message
|
|
5188
5207
|
}), s.dirty());
|
|
5189
5208
|
else if (a.kind === "emoji")
|
|
5190
|
-
Xt || (Xt = new RegExp(
|
|
5209
|
+
Xt || (Xt = new RegExp(_i, "u")), Xt.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5191
5210
|
validation: "emoji",
|
|
5192
5211
|
code: h.invalid_string,
|
|
5193
5212
|
message: a.message
|
|
5194
5213
|
}), s.dirty());
|
|
5195
5214
|
else if (a.kind === "uuid")
|
|
5196
|
-
|
|
5215
|
+
pi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5197
5216
|
validation: "uuid",
|
|
5198
5217
|
code: h.invalid_string,
|
|
5199
5218
|
message: a.message
|
|
5200
5219
|
}), s.dirty());
|
|
5201
5220
|
else if (a.kind === "nanoid")
|
|
5202
|
-
|
|
5221
|
+
hi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5203
5222
|
validation: "nanoid",
|
|
5204
5223
|
code: h.invalid_string,
|
|
5205
5224
|
message: a.message
|
|
5206
5225
|
}), s.dirty());
|
|
5207
5226
|
else if (a.kind === "cuid")
|
|
5208
|
-
|
|
5227
|
+
di.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5209
5228
|
validation: "cuid",
|
|
5210
5229
|
code: h.invalid_string,
|
|
5211
5230
|
message: a.message
|
|
5212
5231
|
}), s.dirty());
|
|
5213
5232
|
else if (a.kind === "cuid2")
|
|
5214
|
-
|
|
5233
|
+
ui.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5215
5234
|
validation: "cuid2",
|
|
5216
5235
|
code: h.invalid_string,
|
|
5217
5236
|
message: a.message
|
|
5218
5237
|
}), s.dirty());
|
|
5219
5238
|
else if (a.kind === "ulid")
|
|
5220
|
-
|
|
5239
|
+
li.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5221
5240
|
validation: "ulid",
|
|
5222
5241
|
code: h.invalid_string,
|
|
5223
5242
|
message: a.message
|
|
@@ -5252,23 +5271,23 @@ class z extends j {
|
|
|
5252
5271
|
code: h.invalid_string,
|
|
5253
5272
|
validation: "datetime",
|
|
5254
5273
|
message: a.message
|
|
5255
|
-
}), s.dirty()) : a.kind === "date" ?
|
|
5274
|
+
}), s.dirty()) : a.kind === "date" ? wi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5256
5275
|
code: h.invalid_string,
|
|
5257
5276
|
validation: "date",
|
|
5258
5277
|
message: a.message
|
|
5259
|
-
}), s.dirty()) : a.kind === "time" ?
|
|
5278
|
+
}), s.dirty()) : a.kind === "time" ? ki(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5260
5279
|
code: h.invalid_string,
|
|
5261
5280
|
validation: "time",
|
|
5262
5281
|
message: a.message
|
|
5263
|
-
}), s.dirty()) : a.kind === "duration" ?
|
|
5282
|
+
}), s.dirty()) : a.kind === "duration" ? fi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5264
5283
|
validation: "duration",
|
|
5265
5284
|
code: h.invalid_string,
|
|
5266
5285
|
message: a.message
|
|
5267
|
-
}), s.dirty()) : a.kind === "ip" ?
|
|
5286
|
+
}), s.dirty()) : a.kind === "ip" ? bi(e.data, a.version) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5268
5287
|
validation: "ip",
|
|
5269
5288
|
code: h.invalid_string,
|
|
5270
5289
|
message: a.message
|
|
5271
|
-
}), s.dirty()) : a.kind === "base64" ?
|
|
5290
|
+
}), s.dirty()) : a.kind === "base64" ? vi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5272
5291
|
validation: "base64",
|
|
5273
5292
|
code: h.invalid_string,
|
|
5274
5293
|
message: a.message
|
|
@@ -5490,7 +5509,7 @@ z.create = (n) => {
|
|
|
5490
5509
|
...S(n)
|
|
5491
5510
|
});
|
|
5492
5511
|
};
|
|
5493
|
-
function
|
|
5512
|
+
function xi(n, e) {
|
|
5494
5513
|
const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = t > s ? t : s, a = parseInt(n.toFixed(r).replace(".", "")), o = parseInt(e.toFixed(r).replace(".", ""));
|
|
5495
5514
|
return a % o / Math.pow(10, r);
|
|
5496
5515
|
}
|
|
@@ -5529,7 +5548,7 @@ class ve extends j {
|
|
|
5529
5548
|
inclusive: a.inclusive,
|
|
5530
5549
|
exact: !1,
|
|
5531
5550
|
message: a.message
|
|
5532
|
-
}), r.dirty()) : a.kind === "multipleOf" ?
|
|
5551
|
+
}), r.dirty()) : a.kind === "multipleOf" ? xi(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5533
5552
|
code: h.not_multiple_of,
|
|
5534
5553
|
multipleOf: a.value,
|
|
5535
5554
|
message: a.message
|
|
@@ -7230,7 +7249,7 @@ Jt.create = (n) => new Jt({
|
|
|
7230
7249
|
typeName: k.ZodNaN,
|
|
7231
7250
|
...S(n)
|
|
7232
7251
|
});
|
|
7233
|
-
const
|
|
7252
|
+
const Ti = Symbol("zod_brand");
|
|
7234
7253
|
class hn extends j {
|
|
7235
7254
|
_parse(e) {
|
|
7236
7255
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
@@ -7307,16 +7326,16 @@ function Bn(n, e = {}, t) {
|
|
|
7307
7326
|
}
|
|
7308
7327
|
}) : Je.create();
|
|
7309
7328
|
}
|
|
7310
|
-
const
|
|
7329
|
+
const Oi = {
|
|
7311
7330
|
object: A.lazycreate
|
|
7312
7331
|
};
|
|
7313
7332
|
var k;
|
|
7314
7333
|
(function(n) {
|
|
7315
7334
|
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";
|
|
7316
7335
|
})(k || (k = {}));
|
|
7317
|
-
const
|
|
7336
|
+
const Si = (n, e = {
|
|
7318
7337
|
message: `Input not instance of ${n.name}`
|
|
7319
|
-
}) => Bn((t) => t instanceof n, e), Wn = z.create, qn = ve.create,
|
|
7338
|
+
}) => Bn((t) => t instanceof n, e), Wn = z.create, qn = ve.create, Zi = Jt.create, ji = we.create, Jn = gt.create, Ni = Ce.create, Ii = Bt.create, Ci = yt.create, Ei = vt.create, Ai = Je.create, Ri = je.create, $i = oe.create, Pi = Wt.create, Di = W.create, Mi = A.create, Li = A.strictCreate, Vi = wt.create, Ui = Ht.create, Fi = kt.create, zi = se.create, Bi = bt.create, Wi = qt.create, qi = Ee.create, Ji = Fe.create, Ki = xt.create, Qi = Tt.create, Hi = ke.create, Yi = Ot.create, Gi = Ke.create, vn = J.create, Xi = X.create, eo = be.create, to = J.createWithPreprocess, no = It.create, so = () => Wn().optional(), ro = () => qn().optional(), ao = () => Jn().optional(), io = {
|
|
7320
7339
|
string: (n) => z.create({ ...n, coerce: !0 }),
|
|
7321
7340
|
number: (n) => ve.create({ ...n, coerce: !0 }),
|
|
7322
7341
|
boolean: (n) => gt.create({
|
|
@@ -7325,14 +7344,14 @@ const Oi = (n, e = {
|
|
|
7325
7344
|
}),
|
|
7326
7345
|
bigint: (n) => we.create({ ...n, coerce: !0 }),
|
|
7327
7346
|
date: (n) => Ce.create({ ...n, coerce: !0 })
|
|
7328
|
-
},
|
|
7329
|
-
var
|
|
7347
|
+
}, oo = b;
|
|
7348
|
+
var co = /* @__PURE__ */ Object.freeze({
|
|
7330
7349
|
__proto__: null,
|
|
7331
7350
|
defaultErrorMap: qe,
|
|
7332
|
-
setErrorMap:
|
|
7351
|
+
setErrorMap: oi,
|
|
7333
7352
|
getErrorMap: Ut,
|
|
7334
7353
|
makeIssue: Ft,
|
|
7335
|
-
EMPTY_PATH:
|
|
7354
|
+
EMPTY_PATH: ci,
|
|
7336
7355
|
addIssueToContext: m,
|
|
7337
7356
|
ParseStatus: P,
|
|
7338
7357
|
INVALID: b,
|
|
@@ -7386,63 +7405,63 @@ var oo = /* @__PURE__ */ Object.freeze({
|
|
|
7386
7405
|
ZodDefault: St,
|
|
7387
7406
|
ZodCatch: Zt,
|
|
7388
7407
|
ZodNaN: Jt,
|
|
7389
|
-
BRAND:
|
|
7408
|
+
BRAND: Ti,
|
|
7390
7409
|
ZodBranded: hn,
|
|
7391
7410
|
ZodPipeline: It,
|
|
7392
7411
|
ZodReadonly: jt,
|
|
7393
7412
|
custom: Bn,
|
|
7394
7413
|
Schema: j,
|
|
7395
7414
|
ZodSchema: j,
|
|
7396
|
-
late:
|
|
7415
|
+
late: Oi,
|
|
7397
7416
|
get ZodFirstPartyTypeKind() {
|
|
7398
7417
|
return k;
|
|
7399
7418
|
},
|
|
7400
|
-
coerce:
|
|
7401
|
-
any:
|
|
7402
|
-
array:
|
|
7403
|
-
bigint:
|
|
7419
|
+
coerce: io,
|
|
7420
|
+
any: Ai,
|
|
7421
|
+
array: Di,
|
|
7422
|
+
bigint: ji,
|
|
7404
7423
|
boolean: Jn,
|
|
7405
|
-
date:
|
|
7406
|
-
discriminatedUnion:
|
|
7424
|
+
date: Ni,
|
|
7425
|
+
discriminatedUnion: Ui,
|
|
7407
7426
|
effect: vn,
|
|
7408
|
-
enum:
|
|
7409
|
-
function:
|
|
7410
|
-
instanceof:
|
|
7411
|
-
intersection:
|
|
7412
|
-
lazy:
|
|
7413
|
-
literal:
|
|
7414
|
-
map:
|
|
7415
|
-
nan:
|
|
7416
|
-
nativeEnum:
|
|
7417
|
-
never:
|
|
7418
|
-
null:
|
|
7419
|
-
nullable:
|
|
7427
|
+
enum: Hi,
|
|
7428
|
+
function: Ji,
|
|
7429
|
+
instanceof: Si,
|
|
7430
|
+
intersection: Fi,
|
|
7431
|
+
lazy: Ki,
|
|
7432
|
+
literal: Qi,
|
|
7433
|
+
map: Wi,
|
|
7434
|
+
nan: Zi,
|
|
7435
|
+
nativeEnum: Yi,
|
|
7436
|
+
never: $i,
|
|
7437
|
+
null: Ei,
|
|
7438
|
+
nullable: eo,
|
|
7420
7439
|
number: qn,
|
|
7421
|
-
object:
|
|
7422
|
-
oboolean:
|
|
7423
|
-
onumber:
|
|
7424
|
-
optional:
|
|
7425
|
-
ostring:
|
|
7426
|
-
pipeline:
|
|
7427
|
-
preprocess:
|
|
7428
|
-
promise:
|
|
7429
|
-
record:
|
|
7430
|
-
set:
|
|
7431
|
-
strictObject:
|
|
7440
|
+
object: Mi,
|
|
7441
|
+
oboolean: ao,
|
|
7442
|
+
onumber: ro,
|
|
7443
|
+
optional: Xi,
|
|
7444
|
+
ostring: so,
|
|
7445
|
+
pipeline: no,
|
|
7446
|
+
preprocess: to,
|
|
7447
|
+
promise: Gi,
|
|
7448
|
+
record: Bi,
|
|
7449
|
+
set: qi,
|
|
7450
|
+
strictObject: Li,
|
|
7432
7451
|
string: Wn,
|
|
7433
|
-
symbol:
|
|
7452
|
+
symbol: Ii,
|
|
7434
7453
|
transformer: vn,
|
|
7435
|
-
tuple:
|
|
7436
|
-
undefined:
|
|
7437
|
-
union:
|
|
7438
|
-
unknown:
|
|
7439
|
-
void:
|
|
7440
|
-
NEVER:
|
|
7454
|
+
tuple: zi,
|
|
7455
|
+
undefined: Ci,
|
|
7456
|
+
union: Vi,
|
|
7457
|
+
unknown: Ri,
|
|
7458
|
+
void: Pi,
|
|
7459
|
+
NEVER: oo,
|
|
7441
7460
|
ZodIssueCode: h,
|
|
7442
|
-
quotelessJson:
|
|
7461
|
+
quotelessJson: ii,
|
|
7443
7462
|
ZodError: U
|
|
7444
7463
|
});
|
|
7445
|
-
|
|
7464
|
+
ai(co);
|
|
7446
7465
|
function Ct(n, e = "", t = {}) {
|
|
7447
7466
|
for (let s in n)
|
|
7448
7467
|
if (Object.prototype.hasOwnProperty.call(n, s)) {
|
|
@@ -7451,7 +7470,7 @@ function Ct(n, e = "", t = {}) {
|
|
|
7451
7470
|
}
|
|
7452
7471
|
return t;
|
|
7453
7472
|
}
|
|
7454
|
-
function
|
|
7473
|
+
function uo(n, e) {
|
|
7455
7474
|
const t = {};
|
|
7456
7475
|
for (const [s, r] of Object.entries(n)) {
|
|
7457
7476
|
const a = e.find(
|
|
@@ -7469,7 +7488,7 @@ function co(n, e) {
|
|
|
7469
7488
|
}
|
|
7470
7489
|
return t;
|
|
7471
7490
|
}
|
|
7472
|
-
function
|
|
7491
|
+
function lo(n) {
|
|
7473
7492
|
return async (e, t) => {
|
|
7474
7493
|
const s = {
|
|
7475
7494
|
themeId: Re(),
|
|
@@ -7480,16 +7499,16 @@ function uo(n) {
|
|
|
7480
7499
|
return await n.insertInto("themes").values({ ...Ct(s), tenant_id: e }).execute(), s;
|
|
7481
7500
|
};
|
|
7482
7501
|
}
|
|
7483
|
-
function
|
|
7502
|
+
function po(n) {
|
|
7484
7503
|
return async (e, t) => (await n.deleteFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
7485
7504
|
}
|
|
7486
|
-
function
|
|
7505
|
+
function ho(n) {
|
|
7487
7506
|
return async (e, t) => {
|
|
7488
7507
|
const s = await n.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", t).selectAll().executeTakeFirst();
|
|
7489
7508
|
return s ? R(s) : null;
|
|
7490
7509
|
};
|
|
7491
7510
|
}
|
|
7492
|
-
function
|
|
7511
|
+
function fo(n) {
|
|
7493
7512
|
return async (e, t, s) => {
|
|
7494
7513
|
const r = Ct({
|
|
7495
7514
|
...s,
|
|
@@ -7498,23 +7517,23 @@ function ho(n) {
|
|
|
7498
7517
|
return await n.updateTable("themes").set(r).where("themes.id", "=", t).where("themes.tenant_id", "=", e).execute(), !0;
|
|
7499
7518
|
};
|
|
7500
7519
|
}
|
|
7501
|
-
function
|
|
7520
|
+
function mo(n) {
|
|
7502
7521
|
return {
|
|
7503
|
-
create:
|
|
7504
|
-
get:
|
|
7505
|
-
remove:
|
|
7506
|
-
update:
|
|
7522
|
+
create: lo(n),
|
|
7523
|
+
get: ho(n),
|
|
7524
|
+
remove: po(n),
|
|
7525
|
+
update: fo(n)
|
|
7507
7526
|
};
|
|
7508
7527
|
}
|
|
7509
|
-
function
|
|
7528
|
+
function _o(n) {
|
|
7510
7529
|
return async (e, t) => {
|
|
7511
7530
|
const s = (/* @__PURE__ */ new Date()).toISOString(), r = await n.selectFrom("logins").where("logins.expires_at", ">", s).where("logins.login_id", "=", t).selectAll().executeTakeFirst();
|
|
7512
|
-
return r ?
|
|
7513
|
-
|
|
7531
|
+
return r ? vr.parse(
|
|
7532
|
+
uo(R(r), ["authParams"])
|
|
7514
7533
|
) : null;
|
|
7515
7534
|
};
|
|
7516
7535
|
}
|
|
7517
|
-
function
|
|
7536
|
+
function go(n) {
|
|
7518
7537
|
return async (e, t) => {
|
|
7519
7538
|
const s = {
|
|
7520
7539
|
login_id: Re(),
|
|
@@ -7525,43 +7544,43 @@ function _o(n) {
|
|
|
7525
7544
|
return await n.insertInto("logins").values({ ...Ct(s), tenant_id: e }).execute(), s;
|
|
7526
7545
|
};
|
|
7527
7546
|
}
|
|
7528
|
-
function
|
|
7547
|
+
function yo(n) {
|
|
7529
7548
|
return async (e, t, s) => (await n.updateTable("logins").set(Ct(s)).where("logins.login_id", "=", t).where("logins.tenant_id", "=", e).execute()).length === 1;
|
|
7530
7549
|
}
|
|
7531
|
-
function
|
|
7550
|
+
function vo(n) {
|
|
7532
7551
|
return async (e, t) => (await n.deleteFrom("logins").where("logins.tenant_id", "=", e).where("logins.login_id", "=", t).execute()).length > 0;
|
|
7533
7552
|
}
|
|
7534
|
-
function
|
|
7553
|
+
function wo(n) {
|
|
7535
7554
|
return {
|
|
7536
|
-
create:
|
|
7537
|
-
get:
|
|
7538
|
-
update:
|
|
7539
|
-
remove:
|
|
7555
|
+
create: go(n),
|
|
7556
|
+
get: _o(n),
|
|
7557
|
+
update: yo(n),
|
|
7558
|
+
remove: vo(n)
|
|
7540
7559
|
};
|
|
7541
7560
|
}
|
|
7542
|
-
function
|
|
7561
|
+
function bo(n) {
|
|
7543
7562
|
return {
|
|
7544
|
-
applications:
|
|
7545
|
-
authenticationCodes:
|
|
7546
|
-
branding:
|
|
7547
|
-
clients:
|
|
7548
|
-
codes:
|
|
7549
|
-
connections:
|
|
7550
|
-
domains:
|
|
7551
|
-
hooks:
|
|
7552
|
-
keys:
|
|
7553
|
-
logins:
|
|
7554
|
-
logs:
|
|
7555
|
-
OTP:
|
|
7556
|
-
passwords:
|
|
7557
|
-
users:
|
|
7558
|
-
sessions:
|
|
7559
|
-
tenants:
|
|
7560
|
-
themes:
|
|
7561
|
-
tickets:
|
|
7562
|
-
universalLoginSessions:
|
|
7563
|
+
applications: Ia(n),
|
|
7564
|
+
authenticationCodes: Ha(n),
|
|
7565
|
+
branding: Ja(n),
|
|
7566
|
+
clients: Da(n),
|
|
7567
|
+
codes: wa(n),
|
|
7568
|
+
connections: Pa(n),
|
|
7569
|
+
domains: Ba(n),
|
|
7570
|
+
hooks: ni(n),
|
|
7571
|
+
keys: Ua(n),
|
|
7572
|
+
logins: wo(n),
|
|
7573
|
+
logs: Yr(n),
|
|
7574
|
+
OTP: la(n),
|
|
7575
|
+
passwords: ma(n),
|
|
7576
|
+
users: Lr(n),
|
|
7577
|
+
sessions: sa(n),
|
|
7578
|
+
tenants: qr(n),
|
|
7579
|
+
themes: mo(n),
|
|
7580
|
+
tickets: oa(n),
|
|
7581
|
+
universalLoginSessions: Ta(n)
|
|
7563
7582
|
};
|
|
7564
7583
|
}
|
|
7565
7584
|
export {
|
|
7566
|
-
|
|
7585
|
+
bo as default
|
|
7567
7586
|
};
|