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