@authhero/kysely-adapter 0.9.1 → 0.9.3
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 +121 -121
- package/dist/kysely-adapter.iife.js +1 -1
- package/dist/kysely-adapter.mjs +312 -305
- package/package.json +2 -2
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -3039,7 +3039,14 @@ Cn.extend({
|
|
|
3039
3039
|
last_login: i.string().optional(),
|
|
3040
3040
|
user_id: i.string()
|
|
3041
3041
|
}).catchall(i.any());
|
|
3042
|
-
const ar =
|
|
3042
|
+
const ar = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
3043
|
+
let ir = (n = 21) => {
|
|
3044
|
+
let e = "", t = crypto.getRandomValues(new Uint8Array(n));
|
|
3045
|
+
for (; n--; )
|
|
3046
|
+
e += ar[t[n] & 63];
|
|
3047
|
+
return e;
|
|
3048
|
+
};
|
|
3049
|
+
const or = i.object({
|
|
3043
3050
|
audience: i.string().optional(),
|
|
3044
3051
|
recipient: i.string().optional(),
|
|
3045
3052
|
createUpnClaim: i.boolean().optional(),
|
|
@@ -3056,43 +3063,43 @@ const ar = i.object({
|
|
|
3056
3063
|
nameIdentifierProbes: i.array(i.string()).optional(),
|
|
3057
3064
|
authnContextClassRef: i.string().optional(),
|
|
3058
3065
|
mappings: i.record(i.string()).optional()
|
|
3059
|
-
}),
|
|
3066
|
+
}), cr = i.object({
|
|
3060
3067
|
id: i.string(),
|
|
3061
3068
|
name: i.string(),
|
|
3062
|
-
callbacks: i.array(i.string()).openapi({
|
|
3069
|
+
callbacks: i.array(i.string()).optional().openapi({
|
|
3063
3070
|
description: "Comma-separated list of URLs whitelisted to use as a callback to the client after authentication."
|
|
3064
|
-
}),
|
|
3065
|
-
allowed_origins: i.array(i.string()).openapi({
|
|
3071
|
+
}).default([]),
|
|
3072
|
+
allowed_origins: i.array(i.string()).optional().openapi({
|
|
3066
3073
|
description: "Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level. Query strings and hash information are not taken into account when validating these URLs."
|
|
3067
|
-
}),
|
|
3068
|
-
web_origins: i.array(i.string()).openapi({
|
|
3074
|
+
}).default([]),
|
|
3075
|
+
web_origins: i.array(i.string()).optional().openapi({
|
|
3069
3076
|
description: "Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode."
|
|
3070
|
-
}),
|
|
3071
|
-
allowed_logout_urls: i.array(i.string()).openapi({
|
|
3077
|
+
}).default([]),
|
|
3078
|
+
allowed_logout_urls: i.array(i.string()).optional().openapi({
|
|
3072
3079
|
description: "Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains."
|
|
3073
|
-
}),
|
|
3074
|
-
allowed_clients: i.array(i.string()).openapi({
|
|
3080
|
+
}).default([]),
|
|
3081
|
+
allowed_clients: i.array(i.string()).optional().openapi({
|
|
3075
3082
|
description: "Ids of clients that will be allowed to perform delegation requests. Clients that will be allowed to make delegation request. By default, all your clients will be allowed. This field allows you to specify specific clients"
|
|
3076
|
-
}),
|
|
3083
|
+
}).default([]),
|
|
3077
3084
|
addons: i.object({
|
|
3078
|
-
samlp:
|
|
3085
|
+
samlp: or.optional()
|
|
3079
3086
|
}).optional().openapi({
|
|
3080
3087
|
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."
|
|
3081
|
-
}),
|
|
3082
|
-
email_validation: i.enum(["enabled", "disabled", "enforced"]).default("enforced").openapi({
|
|
3088
|
+
}).default({}),
|
|
3089
|
+
email_validation: i.enum(["enabled", "disabled", "enforced"]).optional().default("enforced").openapi({
|
|
3083
3090
|
description: "Defines if it possible to sign in with an unverified email and if verification emails will be sent. This is not available in auth0"
|
|
3084
3091
|
}),
|
|
3085
|
-
client_secret: i.string().default(
|
|
3086
|
-
disable_sign_ups: i.boolean().default(!1).openapi({
|
|
3092
|
+
client_secret: i.string().optional().default(() => ir()),
|
|
3093
|
+
disable_sign_ups: i.boolean().optional().default(!1).openapi({
|
|
3087
3094
|
description: "Prevents users from signing up using the hosted login page. This is not available in auth0"
|
|
3088
3095
|
})
|
|
3089
|
-
}),
|
|
3096
|
+
}), dr = i.object({
|
|
3090
3097
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3091
3098
|
updated_at: i.string().transform((n) => n === null ? "" : n),
|
|
3092
|
-
...
|
|
3099
|
+
...cr.shape
|
|
3093
3100
|
});
|
|
3094
3101
|
var In = /* @__PURE__ */ ((n) => (n.TOKEN = "token", n.TOKEN_ID_TOKEN = "token id_token", n.CODE = "code", n))(In || {}), 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 || {});
|
|
3095
|
-
const
|
|
3102
|
+
const ur = i.object({
|
|
3096
3103
|
client_id: i.string(),
|
|
3097
3104
|
vendor_id: i.string().optional(),
|
|
3098
3105
|
response_type: i.nativeEnum(In).optional(),
|
|
@@ -3122,7 +3129,7 @@ i.object({
|
|
|
3122
3129
|
url: i.string()
|
|
3123
3130
|
}).optional()
|
|
3124
3131
|
});
|
|
3125
|
-
const
|
|
3132
|
+
const lr = i.object({
|
|
3126
3133
|
id: i.string().optional(),
|
|
3127
3134
|
name: i.string(),
|
|
3128
3135
|
strategy: i.enum([
|
|
@@ -3144,9 +3151,9 @@ const dr = i.object({
|
|
|
3144
3151
|
client_secret: i.string().optional(),
|
|
3145
3152
|
app_secret: i.string().optional(),
|
|
3146
3153
|
scope: i.string().optional()
|
|
3147
|
-
}).optional(),
|
|
3148
|
-
enabled_clients: i.array(i.string()).optional(),
|
|
3149
|
-
authorization_endpoint: i.string().optional(),
|
|
3154
|
+
}).optional().default({}),
|
|
3155
|
+
enabled_clients: i.array(i.string()).optional().default([]),
|
|
3156
|
+
authorization_endpoint: i.string().optional().default(""),
|
|
3150
3157
|
response_type: i.custom().optional(),
|
|
3151
3158
|
response_mode: i.custom().optional(),
|
|
3152
3159
|
// Deprecated
|
|
@@ -3163,7 +3170,7 @@ const dr = i.object({
|
|
|
3163
3170
|
id: i.string(),
|
|
3164
3171
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3165
3172
|
updated_at: i.string().transform((n) => n === null ? "" : n)
|
|
3166
|
-
}).extend(
|
|
3173
|
+
}).extend(lr.shape), pr = i.object({
|
|
3167
3174
|
name: i.string(),
|
|
3168
3175
|
audience: i.string(),
|
|
3169
3176
|
sender_email: i.string().email(),
|
|
@@ -3173,11 +3180,11 @@ const dr = i.object({
|
|
|
3173
3180
|
primary_color: i.string().optional(),
|
|
3174
3181
|
secondary_color: i.string().optional(),
|
|
3175
3182
|
language: i.string().optional()
|
|
3176
|
-
}),
|
|
3183
|
+
}), hr = i.object({
|
|
3177
3184
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3178
3185
|
updated_at: i.string().transform((n) => n === null ? "" : n),
|
|
3179
3186
|
id: i.string(),
|
|
3180
|
-
...
|
|
3187
|
+
...pr.shape
|
|
3181
3188
|
});
|
|
3182
3189
|
i.object({
|
|
3183
3190
|
logoUrl: i.string(),
|
|
@@ -3197,7 +3204,7 @@ i.object({
|
|
|
3197
3204
|
siteUrl: i.string().nullable(),
|
|
3198
3205
|
manageSubscriptionsUrl: i.string().optional()
|
|
3199
3206
|
});
|
|
3200
|
-
const
|
|
3207
|
+
const fr = i.object({
|
|
3201
3208
|
domain: i.string(),
|
|
3202
3209
|
dkim_private_key: i.string().optional(),
|
|
3203
3210
|
dkim_public_key: i.string().optional(),
|
|
@@ -3205,19 +3212,19 @@ const pr = i.object({
|
|
|
3205
3212
|
email_service: i.union([i.literal("mailgun"), i.literal("mailchannels")]).optional()
|
|
3206
3213
|
});
|
|
3207
3214
|
i.object({
|
|
3208
|
-
...
|
|
3209
|
-
domains: i.array(
|
|
3210
|
-
tenant:
|
|
3215
|
+
...dr.shape,
|
|
3216
|
+
domains: i.array(fr),
|
|
3217
|
+
tenant: hr,
|
|
3211
3218
|
connections: i.array(Rn)
|
|
3212
3219
|
});
|
|
3213
|
-
const
|
|
3220
|
+
const mr = i.enum([
|
|
3214
3221
|
"password_reset",
|
|
3215
3222
|
"email_verification",
|
|
3216
3223
|
"otp",
|
|
3217
3224
|
"authorization_code",
|
|
3218
3225
|
"oauth2_state",
|
|
3219
3226
|
"ticket"
|
|
3220
|
-
]),
|
|
3227
|
+
]), _r = i.object({
|
|
3221
3228
|
code_id: i.string().openapi({
|
|
3222
3229
|
description: "The code that will be used in for instance an email verification flow"
|
|
3223
3230
|
}),
|
|
@@ -3227,14 +3234,14 @@ const hr = i.enum([
|
|
|
3227
3234
|
connection_id: i.string().optional().openapi({
|
|
3228
3235
|
description: "The connection that the code is connected to"
|
|
3229
3236
|
}),
|
|
3230
|
-
code_type:
|
|
3237
|
+
code_type: mr,
|
|
3231
3238
|
expires_at: i.string(),
|
|
3232
3239
|
used_at: i.string().optional(),
|
|
3233
3240
|
user_id: i.string().optional()
|
|
3234
|
-
}),
|
|
3235
|
-
...
|
|
3241
|
+
}), gr = i.object({
|
|
3242
|
+
..._r.shape,
|
|
3236
3243
|
created_at: i.string()
|
|
3237
|
-
}),
|
|
3244
|
+
}), yr = i.object({
|
|
3238
3245
|
domain: i.string(),
|
|
3239
3246
|
dkim_private_key: i.string().optional(),
|
|
3240
3247
|
dkim_public_key: i.string().optional(),
|
|
@@ -3242,10 +3249,10 @@ const hr = i.enum([
|
|
|
3242
3249
|
email_service: i.enum(["mailgun", "mailchannels"])
|
|
3243
3250
|
});
|
|
3244
3251
|
dn.extend({
|
|
3245
|
-
...
|
|
3252
|
+
...yr.shape,
|
|
3246
3253
|
id: i.string()
|
|
3247
3254
|
});
|
|
3248
|
-
const
|
|
3255
|
+
const vr = i.object({
|
|
3249
3256
|
trigger_id: i.enum([
|
|
3250
3257
|
"pre-user-signup",
|
|
3251
3258
|
"post-user-registration",
|
|
@@ -3257,11 +3264,11 @@ const gr = i.object({
|
|
|
3257
3264
|
synchronous: i.boolean().default(!1),
|
|
3258
3265
|
priority: i.number().optional()
|
|
3259
3266
|
});
|
|
3260
|
-
|
|
3267
|
+
vr.extend({
|
|
3261
3268
|
...dn.shape,
|
|
3262
3269
|
hook_id: i.string()
|
|
3263
3270
|
});
|
|
3264
|
-
const
|
|
3271
|
+
const wr = i.object({
|
|
3265
3272
|
alg: i.enum([
|
|
3266
3273
|
"RS256",
|
|
3267
3274
|
"RS384",
|
|
@@ -3282,7 +3289,7 @@ const yr = i.object({
|
|
|
3282
3289
|
use: i.enum(["sig", "enc"]).optional()
|
|
3283
3290
|
});
|
|
3284
3291
|
i.object({
|
|
3285
|
-
keys: i.array(
|
|
3292
|
+
keys: i.array(wr)
|
|
3286
3293
|
});
|
|
3287
3294
|
i.object({
|
|
3288
3295
|
issuer: i.string(),
|
|
@@ -3306,22 +3313,22 @@ i.object({
|
|
|
3306
3313
|
request_parameter_supported: i.boolean(),
|
|
3307
3314
|
token_endpoint_auth_signing_alg_values_supported: i.array(i.string())
|
|
3308
3315
|
});
|
|
3309
|
-
const
|
|
3316
|
+
const br = i.object({
|
|
3310
3317
|
auth0Client: i.string().optional(),
|
|
3311
|
-
authParams:
|
|
3318
|
+
authParams: ur,
|
|
3312
3319
|
expires_at: i.string(),
|
|
3313
3320
|
deleted_at: i.string().optional(),
|
|
3314
3321
|
ip: i.string().optional()
|
|
3315
3322
|
}).openapi({
|
|
3316
3323
|
description: "This represents a login sesion"
|
|
3317
|
-
}),
|
|
3318
|
-
...
|
|
3324
|
+
}), kr = i.object({
|
|
3325
|
+
...br.shape,
|
|
3319
3326
|
login_id: i.string().openapi({
|
|
3320
3327
|
description: "This is is used as the state in the universal login"
|
|
3321
3328
|
}),
|
|
3322
3329
|
created_at: i.string(),
|
|
3323
3330
|
updated_at: i.string()
|
|
3324
|
-
}),
|
|
3331
|
+
}), xr = i.enum([
|
|
3325
3332
|
"cls",
|
|
3326
3333
|
// CODE_LINK_SENT
|
|
3327
3334
|
"fsa",
|
|
@@ -3370,7 +3377,7 @@ const vr = i.object({
|
|
|
3370
3377
|
// SUCCESS_VERIFICATION_EMAIL
|
|
3371
3378
|
"svr"
|
|
3372
3379
|
// SUCCESS_VERIFICATION_EMAIL_REQUEST
|
|
3373
|
-
]),
|
|
3380
|
+
]), Tr = i.object({
|
|
3374
3381
|
name: i.string(),
|
|
3375
3382
|
version: i.string(),
|
|
3376
3383
|
env: i.object({
|
|
@@ -3378,7 +3385,7 @@ const vr = i.object({
|
|
|
3378
3385
|
}).optional()
|
|
3379
3386
|
});
|
|
3380
3387
|
i.object({
|
|
3381
|
-
type:
|
|
3388
|
+
type: xr,
|
|
3382
3389
|
date: i.string(),
|
|
3383
3390
|
description: i.string().optional(),
|
|
3384
3391
|
log_id: i.string().optional(),
|
|
@@ -3399,19 +3406,19 @@ i.object({
|
|
|
3399
3406
|
strategy: i.string().optional(),
|
|
3400
3407
|
strategy_type: i.string().optional(),
|
|
3401
3408
|
hostname: i.string().optional(),
|
|
3402
|
-
auth0_client:
|
|
3409
|
+
auth0_client: Tr.optional()
|
|
3403
3410
|
});
|
|
3404
|
-
const
|
|
3411
|
+
const Or = i.object({
|
|
3405
3412
|
user_id: i.string(),
|
|
3406
3413
|
password: i.string(),
|
|
3407
3414
|
algorithm: i.enum(["bcrypt", "argon2id"]).default("argon2id")
|
|
3408
3415
|
});
|
|
3409
3416
|
i.object({
|
|
3410
|
-
...
|
|
3417
|
+
...Or.shape,
|
|
3411
3418
|
created_at: i.string(),
|
|
3412
3419
|
updated_at: i.string()
|
|
3413
3420
|
});
|
|
3414
|
-
const
|
|
3421
|
+
const Sr = i.object({
|
|
3415
3422
|
session_id: i.string(),
|
|
3416
3423
|
client_id: i.string(),
|
|
3417
3424
|
expires_at: i.string(),
|
|
@@ -3421,7 +3428,7 @@ const Tr = i.object({
|
|
|
3421
3428
|
});
|
|
3422
3429
|
i.object({
|
|
3423
3430
|
created_at: i.string(),
|
|
3424
|
-
...
|
|
3431
|
+
...Sr.shape
|
|
3425
3432
|
});
|
|
3426
3433
|
i.object({
|
|
3427
3434
|
kid: i.string().openapi({ description: "The key id of the signing key" }),
|
|
@@ -3487,7 +3494,7 @@ i.object({
|
|
|
3487
3494
|
code: i.string(),
|
|
3488
3495
|
state: i.string().optional()
|
|
3489
3496
|
});
|
|
3490
|
-
const
|
|
3497
|
+
const Zr = i.object({
|
|
3491
3498
|
button_border_radius: i.number(),
|
|
3492
3499
|
button_border_weight: i.number(),
|
|
3493
3500
|
buttons_style: i.enum(["pill"]),
|
|
@@ -3497,7 +3504,7 @@ const Or = i.object({
|
|
|
3497
3504
|
show_widget_shadow: i.boolean(),
|
|
3498
3505
|
widget_border_weight: i.number(),
|
|
3499
3506
|
widget_corner_radius: i.number()
|
|
3500
|
-
}),
|
|
3507
|
+
}), jr = i.object({
|
|
3501
3508
|
base_focus_color: i.string(),
|
|
3502
3509
|
base_hover_color: i.string(),
|
|
3503
3510
|
body_text: i.string(),
|
|
@@ -3520,7 +3527,7 @@ const Or = i.object({
|
|
|
3520
3527
|
}), Me = i.object({
|
|
3521
3528
|
bold: i.boolean(),
|
|
3522
3529
|
size: i.number()
|
|
3523
|
-
}),
|
|
3530
|
+
}), Nr = i.object({
|
|
3524
3531
|
body_text: Me,
|
|
3525
3532
|
buttons_text: Me,
|
|
3526
3533
|
font_url: i.string(),
|
|
@@ -3530,25 +3537,25 @@ const Or = i.object({
|
|
|
3530
3537
|
reference_text_size: i.number(),
|
|
3531
3538
|
subtitle: Me,
|
|
3532
3539
|
title: Me
|
|
3533
|
-
}),
|
|
3540
|
+
}), Cr = i.object({
|
|
3534
3541
|
background_color: i.string(),
|
|
3535
3542
|
background_image_url: i.string(),
|
|
3536
3543
|
page_layout: i.enum(["center"])
|
|
3537
|
-
}),
|
|
3544
|
+
}), Ir = i.object({
|
|
3538
3545
|
header_text_alignment: i.enum(["center"]),
|
|
3539
3546
|
logo_height: i.number(),
|
|
3540
3547
|
logo_position: i.enum(["center"]),
|
|
3541
3548
|
logo_url: i.string(),
|
|
3542
3549
|
social_buttons_layout: i.enum(["bottom"])
|
|
3543
|
-
}),
|
|
3544
|
-
borders:
|
|
3545
|
-
colors:
|
|
3550
|
+
}), Er = i.object({
|
|
3551
|
+
borders: Zr,
|
|
3552
|
+
colors: jr,
|
|
3546
3553
|
displayName: i.string(),
|
|
3547
|
-
fonts:
|
|
3548
|
-
page_background:
|
|
3549
|
-
widget:
|
|
3554
|
+
fonts: Nr,
|
|
3555
|
+
page_background: Cr,
|
|
3556
|
+
widget: Ir
|
|
3550
3557
|
});
|
|
3551
|
-
|
|
3558
|
+
Er.extend({
|
|
3552
3559
|
themeId: i.string()
|
|
3553
3560
|
});
|
|
3554
3561
|
i.object({
|
|
@@ -3582,7 +3589,7 @@ function Pn(n) {
|
|
|
3582
3589
|
}
|
|
3583
3590
|
};
|
|
3584
3591
|
}
|
|
3585
|
-
function
|
|
3592
|
+
function Ar(n) {
|
|
3586
3593
|
return async (e, t) => {
|
|
3587
3594
|
const [s, r] = await Promise.all([
|
|
3588
3595
|
n.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", t).selectAll().executeTakeFirst(),
|
|
@@ -3648,7 +3655,7 @@ function Ee(n, e, t, s) {
|
|
|
3648
3655
|
function ke(n) {
|
|
3649
3656
|
return typeof n == "string" ? parseInt(n, 10) : typeof n == "bigint" ? Number(n) : n;
|
|
3650
3657
|
}
|
|
3651
|
-
function
|
|
3658
|
+
function Rr(n) {
|
|
3652
3659
|
return async (e, t) => {
|
|
3653
3660
|
let s = n.selectFrom("users").where("users.tenant_id", "=", e);
|
|
3654
3661
|
if (t.q && (s = Ee(n, s, t.q, ["email", "name"])), t.sort && t.sort.sort_by) {
|
|
@@ -3682,48 +3689,48 @@ function Er(n) {
|
|
|
3682
3689
|
};
|
|
3683
3690
|
};
|
|
3684
3691
|
}
|
|
3685
|
-
function
|
|
3692
|
+
function $r(n) {
|
|
3686
3693
|
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);
|
|
3687
3694
|
}
|
|
3688
|
-
function
|
|
3695
|
+
function Pr(n) {
|
|
3689
3696
|
if (n.email_verified !== void 0)
|
|
3690
3697
|
return n.email_verified ? 1 : 0;
|
|
3691
3698
|
}
|
|
3692
|
-
function
|
|
3699
|
+
function Dr(n) {
|
|
3693
3700
|
return async (e, t, s) => {
|
|
3694
3701
|
const r = {
|
|
3695
3702
|
...s,
|
|
3696
|
-
email_verified:
|
|
3703
|
+
email_verified: Pr(s),
|
|
3697
3704
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3698
3705
|
};
|
|
3699
3706
|
return (await n.updateTable("users").set(r).where("users.tenant_id", "=", e).where("users.user_id", "=", t).execute()).length === 1;
|
|
3700
3707
|
};
|
|
3701
3708
|
}
|
|
3702
|
-
function
|
|
3709
|
+
function Mr(n) {
|
|
3703
3710
|
return async (e, t, s, r) => {
|
|
3704
3711
|
const a = { linked_to: null };
|
|
3705
3712
|
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;
|
|
3706
3713
|
};
|
|
3707
3714
|
}
|
|
3708
|
-
function
|
|
3715
|
+
function Lr(n) {
|
|
3709
3716
|
return {
|
|
3710
3717
|
create: Qn(n),
|
|
3711
|
-
remove:
|
|
3712
|
-
get:
|
|
3713
|
-
list:
|
|
3714
|
-
update:
|
|
3718
|
+
remove: $r(n),
|
|
3719
|
+
get: Ar(n),
|
|
3720
|
+
list: Rr(n),
|
|
3721
|
+
update: Dr(n),
|
|
3715
3722
|
// TODO - think about this more when other issues fixed
|
|
3716
|
-
unlink:
|
|
3723
|
+
unlink: Mr(n)
|
|
3717
3724
|
};
|
|
3718
3725
|
}
|
|
3719
|
-
const
|
|
3726
|
+
const Vr = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
3720
3727
|
let Ae = (n = 21) => {
|
|
3721
3728
|
let e = "", t = crypto.getRandomValues(new Uint8Array(n));
|
|
3722
3729
|
for (; n--; )
|
|
3723
|
-
e +=
|
|
3730
|
+
e += Vr[t[n] & 63];
|
|
3724
3731
|
return e;
|
|
3725
3732
|
};
|
|
3726
|
-
function
|
|
3733
|
+
function Ur(n) {
|
|
3727
3734
|
return async (e) => {
|
|
3728
3735
|
const t = {
|
|
3729
3736
|
id: e.id || Ae(),
|
|
@@ -3734,13 +3741,13 @@ function Lr(n) {
|
|
|
3734
3741
|
return await n.insertInto("tenants").values(t).execute(), t;
|
|
3735
3742
|
};
|
|
3736
3743
|
}
|
|
3737
|
-
function
|
|
3744
|
+
function Fr(n) {
|
|
3738
3745
|
return async (e) => {
|
|
3739
3746
|
const t = await n.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
|
|
3740
3747
|
return t ? R(t) : null;
|
|
3741
3748
|
};
|
|
3742
3749
|
}
|
|
3743
|
-
function
|
|
3750
|
+
function zr(n) {
|
|
3744
3751
|
return async (e) => {
|
|
3745
3752
|
let t = n.selectFrom("tenants");
|
|
3746
3753
|
if (e.sort && e.sort.sort_by) {
|
|
@@ -3762,7 +3769,7 @@ function Ur(n) {
|
|
|
3762
3769
|
};
|
|
3763
3770
|
};
|
|
3764
3771
|
}
|
|
3765
|
-
function
|
|
3772
|
+
function Br(n) {
|
|
3766
3773
|
return async (e, t) => {
|
|
3767
3774
|
const s = {
|
|
3768
3775
|
...t,
|
|
@@ -3772,29 +3779,29 @@ function Fr(n) {
|
|
|
3772
3779
|
await n.updateTable("tenants").set(s).where("id", "=", e).execute();
|
|
3773
3780
|
};
|
|
3774
3781
|
}
|
|
3775
|
-
function
|
|
3782
|
+
function Wr(n) {
|
|
3776
3783
|
return async (e) => (await n.deleteFrom("tenants").where("tenants.id", "=", e).execute()).length === 1;
|
|
3777
3784
|
}
|
|
3778
|
-
function
|
|
3785
|
+
function qr(n) {
|
|
3779
3786
|
return {
|
|
3780
|
-
create:
|
|
3781
|
-
get:
|
|
3782
|
-
list:
|
|
3783
|
-
update:
|
|
3784
|
-
remove:
|
|
3787
|
+
create: Ur(n),
|
|
3788
|
+
get: Fr(n),
|
|
3789
|
+
list: zr(n),
|
|
3790
|
+
update: Br(n),
|
|
3791
|
+
remove: Wr(n)
|
|
3785
3792
|
};
|
|
3786
3793
|
}
|
|
3787
3794
|
function _n(n) {
|
|
3788
3795
|
return n ? JSON.stringify(n) : void 0;
|
|
3789
3796
|
}
|
|
3790
|
-
const
|
|
3791
|
-
function
|
|
3797
|
+
const Jr = 1024;
|
|
3798
|
+
function Kr(n) {
|
|
3792
3799
|
return async (e, t) => {
|
|
3793
3800
|
var r, a, o;
|
|
3794
3801
|
const s = {
|
|
3795
3802
|
id: Ae(),
|
|
3796
3803
|
...t,
|
|
3797
|
-
user_agent: t.user_agent.slice(0,
|
|
3804
|
+
user_agent: t.user_agent.slice(0, Jr)
|
|
3798
3805
|
};
|
|
3799
3806
|
return await n.insertInto("logs").values({
|
|
3800
3807
|
...s,
|
|
@@ -3830,7 +3837,7 @@ function Dn(n) {
|
|
|
3830
3837
|
_id: n.id
|
|
3831
3838
|
};
|
|
3832
3839
|
}
|
|
3833
|
-
function
|
|
3840
|
+
function Hr(n) {
|
|
3834
3841
|
return async (e, t) => {
|
|
3835
3842
|
let s = n.selectFrom("logs").where("logs.tenant_id", "=", e);
|
|
3836
3843
|
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
@@ -3852,23 +3859,23 @@ function Jr(n) {
|
|
|
3852
3859
|
};
|
|
3853
3860
|
};
|
|
3854
3861
|
}
|
|
3855
|
-
function
|
|
3862
|
+
function Qr(n) {
|
|
3856
3863
|
return async (e, t) => {
|
|
3857
3864
|
const s = await n.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", t).selectAll().executeTakeFirst();
|
|
3858
3865
|
return s ? Dn(s) : null;
|
|
3859
3866
|
};
|
|
3860
3867
|
}
|
|
3861
|
-
function
|
|
3868
|
+
function Yr(n) {
|
|
3862
3869
|
return {
|
|
3863
|
-
create:
|
|
3864
|
-
list:
|
|
3865
|
-
get:
|
|
3870
|
+
create: Kr(n),
|
|
3871
|
+
list: Hr(n),
|
|
3872
|
+
get: Qr(n)
|
|
3866
3873
|
};
|
|
3867
3874
|
}
|
|
3868
|
-
function
|
|
3875
|
+
function Gr(n) {
|
|
3869
3876
|
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;
|
|
3870
3877
|
}
|
|
3871
|
-
function
|
|
3878
|
+
function Xr(n) {
|
|
3872
3879
|
return async (e, t) => {
|
|
3873
3880
|
const s = {
|
|
3874
3881
|
...t,
|
|
@@ -3878,13 +3885,13 @@ function Yr(n) {
|
|
|
3878
3885
|
return await n.insertInto("sessions").values({ ...s, tenant_id: e }).execute(), { ...t, ...s };
|
|
3879
3886
|
};
|
|
3880
3887
|
}
|
|
3881
|
-
function
|
|
3888
|
+
function ea(n) {
|
|
3882
3889
|
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;
|
|
3883
3890
|
}
|
|
3884
|
-
function
|
|
3891
|
+
function ta(n) {
|
|
3885
3892
|
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;
|
|
3886
3893
|
}
|
|
3887
|
-
function
|
|
3894
|
+
function na(n) {
|
|
3888
3895
|
return async (e, t) => {
|
|
3889
3896
|
let s = n.selectFrom("sessions").where("sessions.tenant_id", "=", e);
|
|
3890
3897
|
t.q && (s = Ee(n, s, t.q, ["user_id", "session_id"]));
|
|
@@ -3906,16 +3913,16 @@ function ea(n) {
|
|
|
3906
3913
|
};
|
|
3907
3914
|
};
|
|
3908
3915
|
}
|
|
3909
|
-
function
|
|
3916
|
+
function sa(n) {
|
|
3910
3917
|
return {
|
|
3911
|
-
create:
|
|
3912
|
-
get:
|
|
3913
|
-
list:
|
|
3914
|
-
remove:
|
|
3915
|
-
update:
|
|
3918
|
+
create: Xr(n),
|
|
3919
|
+
get: Gr(n),
|
|
3920
|
+
list: na(n),
|
|
3921
|
+
remove: ea(n),
|
|
3922
|
+
update: ta(n)
|
|
3916
3923
|
};
|
|
3917
3924
|
}
|
|
3918
|
-
function
|
|
3925
|
+
function ra(n) {
|
|
3919
3926
|
return async (e, t) => {
|
|
3920
3927
|
const s = await n.selectFrom("tickets").where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).where("tickets.used_at", "is", null).selectAll().executeTakeFirst();
|
|
3921
3928
|
if (!s)
|
|
@@ -3945,7 +3952,7 @@ function na(n) {
|
|
|
3945
3952
|
};
|
|
3946
3953
|
};
|
|
3947
3954
|
}
|
|
3948
|
-
function
|
|
3955
|
+
function aa(n) {
|
|
3949
3956
|
return async (e) => {
|
|
3950
3957
|
const { authParams: t, ...s } = e, r = {
|
|
3951
3958
|
...s,
|
|
@@ -3957,27 +3964,27 @@ function sa(n) {
|
|
|
3957
3964
|
await n.insertInto("tickets").values(r).execute();
|
|
3958
3965
|
};
|
|
3959
3966
|
}
|
|
3960
|
-
function
|
|
3967
|
+
function ia(n) {
|
|
3961
3968
|
return async (e, t) => {
|
|
3962
3969
|
await n.updateTable("tickets").set({
|
|
3963
3970
|
used_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3964
3971
|
}).where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).execute();
|
|
3965
3972
|
};
|
|
3966
3973
|
}
|
|
3967
|
-
function
|
|
3974
|
+
function oa(n) {
|
|
3968
3975
|
return {
|
|
3969
|
-
create:
|
|
3970
|
-
get:
|
|
3971
|
-
remove:
|
|
3976
|
+
create: aa(n),
|
|
3977
|
+
get: ra(n),
|
|
3978
|
+
remove: ia(n)
|
|
3972
3979
|
};
|
|
3973
3980
|
}
|
|
3974
|
-
function
|
|
3981
|
+
function ca(n) {
|
|
3975
3982
|
return async (e, t) => {
|
|
3976
3983
|
const s = await n.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", t).selectAll().executeTakeFirstOrThrow(), { tenant_id: r, ...a } = s;
|
|
3977
3984
|
return a;
|
|
3978
3985
|
};
|
|
3979
3986
|
}
|
|
3980
|
-
function
|
|
3987
|
+
function da(n) {
|
|
3981
3988
|
return async (e, t) => {
|
|
3982
3989
|
const s = {
|
|
3983
3990
|
...t,
|
|
@@ -3990,20 +3997,20 @@ function oa(n) {
|
|
|
3990
3997
|
}).execute(), s;
|
|
3991
3998
|
};
|
|
3992
3999
|
}
|
|
3993
|
-
function
|
|
4000
|
+
function ua(n) {
|
|
3994
4001
|
return async (e, t) => (await n.updateTable("passwords").set({
|
|
3995
4002
|
password: t.password,
|
|
3996
4003
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3997
4004
|
}).where("tenant_id", "=", e).where("user_id", "=", t.user_id).execute()).length === 1;
|
|
3998
4005
|
}
|
|
3999
|
-
function
|
|
4006
|
+
function la(n) {
|
|
4000
4007
|
return {
|
|
4001
|
-
create:
|
|
4002
|
-
update:
|
|
4003
|
-
get:
|
|
4008
|
+
create: da(n),
|
|
4009
|
+
update: ua(n),
|
|
4010
|
+
get: ca(n)
|
|
4004
4011
|
};
|
|
4005
4012
|
}
|
|
4006
|
-
function
|
|
4013
|
+
function pa(n) {
|
|
4007
4014
|
return async (e, t) => {
|
|
4008
4015
|
let s = n.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
4009
4016
|
t.q && (s = Ee(n, s, t.q, ["code", "login_id"]));
|
|
@@ -4011,7 +4018,7 @@ function ua(n) {
|
|
|
4011
4018
|
return {
|
|
4012
4019
|
codes: a.map((d) => {
|
|
4013
4020
|
const { tenant_id: u, ...l } = d;
|
|
4014
|
-
return
|
|
4021
|
+
return gr.parse(R(l));
|
|
4015
4022
|
}),
|
|
4016
4023
|
start: t.page * t.per_page,
|
|
4017
4024
|
limit: t.per_page,
|
|
@@ -4019,7 +4026,7 @@ function ua(n) {
|
|
|
4019
4026
|
};
|
|
4020
4027
|
};
|
|
4021
4028
|
}
|
|
4022
|
-
function
|
|
4029
|
+
function ha(n) {
|
|
4023
4030
|
return async (e, t) => {
|
|
4024
4031
|
const s = {
|
|
4025
4032
|
...t,
|
|
@@ -4031,10 +4038,10 @@ function la(n) {
|
|
|
4031
4038
|
}).execute(), s;
|
|
4032
4039
|
};
|
|
4033
4040
|
}
|
|
4034
|
-
function
|
|
4041
|
+
function fa(n) {
|
|
4035
4042
|
return async (e, t) => (await n.deleteFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4036
4043
|
}
|
|
4037
|
-
function
|
|
4044
|
+
function ma(n) {
|
|
4038
4045
|
return async (e, t, s) => {
|
|
4039
4046
|
let r = n.selectFrom("codes").where("codes.code_id", "=", t).where("codes.code_type", "=", s).where("codes.expires_at", ">", (/* @__PURE__ */ new Date()).toISOString());
|
|
4040
4047
|
e.length && (r = r.where("codes.tenant_id", "=", e));
|
|
@@ -4042,15 +4049,15 @@ function ha(n) {
|
|
|
4042
4049
|
return a ? R(a) : null;
|
|
4043
4050
|
};
|
|
4044
4051
|
}
|
|
4045
|
-
function
|
|
4052
|
+
function _a(n) {
|
|
4046
4053
|
return {
|
|
4047
|
-
create:
|
|
4048
|
-
list:
|
|
4049
|
-
remove:
|
|
4050
|
-
get:
|
|
4054
|
+
create: ha(n),
|
|
4055
|
+
list: pa(n),
|
|
4056
|
+
remove: fa(n),
|
|
4057
|
+
get: ma(n)
|
|
4051
4058
|
};
|
|
4052
4059
|
}
|
|
4053
|
-
function
|
|
4060
|
+
function ga(n) {
|
|
4054
4061
|
return async (e, t) => {
|
|
4055
4062
|
const s = {
|
|
4056
4063
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -4069,7 +4076,7 @@ function ma(n) {
|
|
|
4069
4076
|
}).execute(), s;
|
|
4070
4077
|
};
|
|
4071
4078
|
}
|
|
4072
|
-
function
|
|
4079
|
+
function ya(n) {
|
|
4073
4080
|
return async (e) => ({
|
|
4074
4081
|
applications: (await n.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((a) => ({
|
|
4075
4082
|
...a,
|
|
@@ -4082,7 +4089,7 @@ function _a(n) {
|
|
|
4082
4089
|
}))
|
|
4083
4090
|
});
|
|
4084
4091
|
}
|
|
4085
|
-
function
|
|
4092
|
+
function va(n) {
|
|
4086
4093
|
return async (e, t) => {
|
|
4087
4094
|
const s = await n.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).selectAll().executeTakeFirst();
|
|
4088
4095
|
return s ? R({
|
|
@@ -4096,10 +4103,10 @@ function ga(n) {
|
|
|
4096
4103
|
}) : null;
|
|
4097
4104
|
};
|
|
4098
4105
|
}
|
|
4099
|
-
function
|
|
4106
|
+
function wa(n) {
|
|
4100
4107
|
return async (e, t) => (await n.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4101
4108
|
}
|
|
4102
|
-
function
|
|
4109
|
+
function ba(n) {
|
|
4103
4110
|
return async (e, t, s) => {
|
|
4104
4111
|
const r = {
|
|
4105
4112
|
...s,
|
|
@@ -4114,16 +4121,16 @@ function va(n) {
|
|
|
4114
4121
|
return await n.updateTable("applications").set(r).where("applications.id", "=", t).where("applications.tenant_id", "=", e).execute(), !0;
|
|
4115
4122
|
};
|
|
4116
4123
|
}
|
|
4117
|
-
function
|
|
4124
|
+
function ka(n) {
|
|
4118
4125
|
return {
|
|
4119
|
-
create:
|
|
4120
|
-
list:
|
|
4121
|
-
get:
|
|
4122
|
-
remove:
|
|
4123
|
-
update:
|
|
4126
|
+
create: ga(n),
|
|
4127
|
+
list: ya(n),
|
|
4128
|
+
get: va(n),
|
|
4129
|
+
remove: wa(n),
|
|
4130
|
+
update: ba(n)
|
|
4124
4131
|
};
|
|
4125
4132
|
}
|
|
4126
|
-
function
|
|
4133
|
+
function xa(n, e) {
|
|
4127
4134
|
var t = {};
|
|
4128
4135
|
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
|
|
4129
4136
|
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -4131,7 +4138,7 @@ function ba(n, e) {
|
|
|
4131
4138
|
e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
|
|
4132
4139
|
return t;
|
|
4133
4140
|
}
|
|
4134
|
-
function
|
|
4141
|
+
function Ta(n, e) {
|
|
4135
4142
|
var t;
|
|
4136
4143
|
return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
|
|
4137
4144
|
}
|
|
@@ -4142,15 +4149,15 @@ function Ye(n, e) {
|
|
|
4142
4149
|
return r._def.openapi = this._def.openapi, r;
|
|
4143
4150
|
};
|
|
4144
4151
|
}
|
|
4145
|
-
function
|
|
4152
|
+
function Oa(n) {
|
|
4146
4153
|
if (typeof n.ZodType.prototype.openapi < "u")
|
|
4147
4154
|
return;
|
|
4148
4155
|
n.ZodType.prototype.openapi = function(r, a) {
|
|
4149
4156
|
var o, c, d, u, l, j;
|
|
4150
|
-
const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U, $e =
|
|
4157
|
+
const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U, $e = xa(U, ["param"]), oe = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), ce = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), $e), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || ie ? {
|
|
4151
4158
|
param: Object.assign(Object.assign({}, (j = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || j === void 0 ? void 0 : j.param), ie)
|
|
4152
4159
|
} : void 0), de = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(oe).length > 0 ? { _internal: oe } : void 0), Object.keys(ce).length > 0 ? { metadata: ce } : void 0) }));
|
|
4153
|
-
if (
|
|
4160
|
+
if (Ta(this, "ZodObject")) {
|
|
4154
4161
|
const Pe = this.extend;
|
|
4155
4162
|
de.extend = function(...De) {
|
|
4156
4163
|
var K, H, Q, ue, xe, Te;
|
|
@@ -4288,7 +4295,7 @@ const g = C.arrayToEnum([
|
|
|
4288
4295
|
"invalid_intersection_types",
|
|
4289
4296
|
"not_multiple_of",
|
|
4290
4297
|
"not_finite"
|
|
4291
|
-
]),
|
|
4298
|
+
]), Sa = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
4292
4299
|
class V extends Error {
|
|
4293
4300
|
constructor(e) {
|
|
4294
4301
|
super(), this.issues = [], this.addIssue = (s) => {
|
|
@@ -4406,7 +4413,7 @@ const Je = (n, e) => {
|
|
|
4406
4413
|
return { message: t };
|
|
4407
4414
|
};
|
|
4408
4415
|
let Mn = Je;
|
|
4409
|
-
function
|
|
4416
|
+
function Za(n) {
|
|
4410
4417
|
Mn = n;
|
|
4411
4418
|
}
|
|
4412
4419
|
function Vt() {
|
|
@@ -4432,7 +4439,7 @@ const Ut = (n) => {
|
|
|
4432
4439
|
path: a,
|
|
4433
4440
|
message: c
|
|
4434
4441
|
};
|
|
4435
|
-
},
|
|
4442
|
+
}, ja = [];
|
|
4436
4443
|
function m(n, e) {
|
|
4437
4444
|
const t = Vt(), s = Ut({
|
|
4438
4445
|
issueData: e,
|
|
@@ -4723,14 +4730,14 @@ class Z {
|
|
|
4723
4730
|
return this.safeParse(null).success;
|
|
4724
4731
|
}
|
|
4725
4732
|
}
|
|
4726
|
-
const
|
|
4733
|
+
const Na = /^c[^\s-]{8,}$/i, Ca = /^[0-9a-z]+$/, Ia = /^[0-9A-HJKMNP-TV-Z]{26}$/, Ea = /^[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, Aa = /^[a-z0-9_-]{21}$/i, Ra = /^[-+]?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)?)??$/, $a = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Pa = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
4727
4734
|
let Yt;
|
|
4728
|
-
const
|
|
4735
|
+
const Da = /^(?:(?: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])$/, Ma = /^(([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})))$/, La = /^([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])))", Va = new RegExp(`^${Vn}$`);
|
|
4729
4736
|
function Un(n) {
|
|
4730
4737
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
4731
4738
|
return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
4732
4739
|
}
|
|
4733
|
-
function
|
|
4740
|
+
function Ua(n) {
|
|
4734
4741
|
return new RegExp(`^${Un(n)}$`);
|
|
4735
4742
|
}
|
|
4736
4743
|
function Fn(n) {
|
|
@@ -4738,8 +4745,8 @@ function Fn(n) {
|
|
|
4738
4745
|
const t = [];
|
|
4739
4746
|
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
4740
4747
|
}
|
|
4741
|
-
function
|
|
4742
|
-
return !!((e === "v4" || !e) &&
|
|
4748
|
+
function Fa(n, e) {
|
|
4749
|
+
return !!((e === "v4" || !e) && Da.test(n) || (e === "v6" || !e) && Ma.test(n));
|
|
4743
4750
|
}
|
|
4744
4751
|
class z extends Z {
|
|
4745
4752
|
_parse(e) {
|
|
@@ -4790,43 +4797,43 @@ class z extends Z {
|
|
|
4790
4797
|
message: a.message
|
|
4791
4798
|
}), s.dirty());
|
|
4792
4799
|
} else if (a.kind === "email")
|
|
4793
|
-
|
|
4800
|
+
$a.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4794
4801
|
validation: "email",
|
|
4795
4802
|
code: h.invalid_string,
|
|
4796
4803
|
message: a.message
|
|
4797
4804
|
}), s.dirty());
|
|
4798
4805
|
else if (a.kind === "emoji")
|
|
4799
|
-
Yt || (Yt = new RegExp(
|
|
4806
|
+
Yt || (Yt = new RegExp(Pa, "u")), Yt.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4800
4807
|
validation: "emoji",
|
|
4801
4808
|
code: h.invalid_string,
|
|
4802
4809
|
message: a.message
|
|
4803
4810
|
}), s.dirty());
|
|
4804
4811
|
else if (a.kind === "uuid")
|
|
4805
|
-
|
|
4812
|
+
Ea.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4806
4813
|
validation: "uuid",
|
|
4807
4814
|
code: h.invalid_string,
|
|
4808
4815
|
message: a.message
|
|
4809
4816
|
}), s.dirty());
|
|
4810
4817
|
else if (a.kind === "nanoid")
|
|
4811
|
-
|
|
4818
|
+
Aa.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4812
4819
|
validation: "nanoid",
|
|
4813
4820
|
code: h.invalid_string,
|
|
4814
4821
|
message: a.message
|
|
4815
4822
|
}), s.dirty());
|
|
4816
4823
|
else if (a.kind === "cuid")
|
|
4817
|
-
|
|
4824
|
+
Na.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4818
4825
|
validation: "cuid",
|
|
4819
4826
|
code: h.invalid_string,
|
|
4820
4827
|
message: a.message
|
|
4821
4828
|
}), s.dirty());
|
|
4822
4829
|
else if (a.kind === "cuid2")
|
|
4823
|
-
|
|
4830
|
+
Ca.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4824
4831
|
validation: "cuid2",
|
|
4825
4832
|
code: h.invalid_string,
|
|
4826
4833
|
message: a.message
|
|
4827
4834
|
}), s.dirty());
|
|
4828
4835
|
else if (a.kind === "ulid")
|
|
4829
|
-
|
|
4836
|
+
Ia.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4830
4837
|
validation: "ulid",
|
|
4831
4838
|
code: h.invalid_string,
|
|
4832
4839
|
message: a.message
|
|
@@ -4861,23 +4868,23 @@ class z extends Z {
|
|
|
4861
4868
|
code: h.invalid_string,
|
|
4862
4869
|
validation: "datetime",
|
|
4863
4870
|
message: a.message
|
|
4864
|
-
}), s.dirty()) : a.kind === "date" ?
|
|
4871
|
+
}), s.dirty()) : a.kind === "date" ? Va.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4865
4872
|
code: h.invalid_string,
|
|
4866
4873
|
validation: "date",
|
|
4867
4874
|
message: a.message
|
|
4868
|
-
}), s.dirty()) : a.kind === "time" ?
|
|
4875
|
+
}), s.dirty()) : a.kind === "time" ? Ua(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4869
4876
|
code: h.invalid_string,
|
|
4870
4877
|
validation: "time",
|
|
4871
4878
|
message: a.message
|
|
4872
|
-
}), s.dirty()) : a.kind === "duration" ?
|
|
4879
|
+
}), s.dirty()) : a.kind === "duration" ? Ra.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4873
4880
|
validation: "duration",
|
|
4874
4881
|
code: h.invalid_string,
|
|
4875
4882
|
message: a.message
|
|
4876
|
-
}), s.dirty()) : a.kind === "ip" ?
|
|
4883
|
+
}), s.dirty()) : a.kind === "ip" ? Fa(e.data, a.version) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4877
4884
|
validation: "ip",
|
|
4878
4885
|
code: h.invalid_string,
|
|
4879
4886
|
message: a.message
|
|
4880
|
-
}), s.dirty()) : a.kind === "base64" ?
|
|
4887
|
+
}), s.dirty()) : a.kind === "base64" ? La.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4881
4888
|
validation: "base64",
|
|
4882
4889
|
code: h.invalid_string,
|
|
4883
4890
|
message: a.message
|
|
@@ -5099,7 +5106,7 @@ z.create = (n) => {
|
|
|
5099
5106
|
...O(n)
|
|
5100
5107
|
});
|
|
5101
5108
|
};
|
|
5102
|
-
function
|
|
5109
|
+
function za(n, e) {
|
|
5103
5110
|
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(".", ""));
|
|
5104
5111
|
return a % o / Math.pow(10, r);
|
|
5105
5112
|
}
|
|
@@ -5138,7 +5145,7 @@ class ye extends Z {
|
|
|
5138
5145
|
inclusive: a.inclusive,
|
|
5139
5146
|
exact: !1,
|
|
5140
5147
|
message: a.message
|
|
5141
|
-
}), r.dirty()) : a.kind === "multipleOf" ?
|
|
5148
|
+
}), r.dirty()) : a.kind === "multipleOf" ? za(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5142
5149
|
code: h.not_multiple_of,
|
|
5143
5150
|
multipleOf: a.value,
|
|
5144
5151
|
message: a.message
|
|
@@ -6839,7 +6846,7 @@ qt.create = (n) => new qt({
|
|
|
6839
6846
|
typeName: b.ZodNaN,
|
|
6840
6847
|
...O(n)
|
|
6841
6848
|
});
|
|
6842
|
-
const
|
|
6849
|
+
const Ba = Symbol("zod_brand");
|
|
6843
6850
|
class pn extends Z {
|
|
6844
6851
|
_parse(e) {
|
|
6845
6852
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
@@ -6916,16 +6923,16 @@ function Bn(n, e = {}, t) {
|
|
|
6916
6923
|
}
|
|
6917
6924
|
}) : Ke.create();
|
|
6918
6925
|
}
|
|
6919
|
-
const
|
|
6926
|
+
const Wa = {
|
|
6920
6927
|
object: E.lazycreate
|
|
6921
6928
|
};
|
|
6922
6929
|
var b;
|
|
6923
6930
|
(function(n) {
|
|
6924
6931
|
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";
|
|
6925
6932
|
})(b || (b = {}));
|
|
6926
|
-
const
|
|
6933
|
+
const qa = (n, e = {
|
|
6927
6934
|
message: `Input not instance of ${n.name}`
|
|
6928
|
-
}) => Bn((t) => t instanceof n, e), Wn = z.create, qn = ye.create,
|
|
6935
|
+
}) => Bn((t) => t instanceof n, e), Wn = z.create, qn = ye.create, Ja = qt.create, Ka = ve.create, Jn = yt.create, Ha = Ce.create, Qa = zt.create, Ya = vt.create, Ga = wt.create, Xa = Ke.create, ei = Ze.create, ti = ae.create, ni = Bt.create, si = W.create, ri = E.create, ai = E.strictCreate, ii = bt.create, oi = Kt.create, ci = kt.create, di = ne.create, ui = xt.create, li = Wt.create, pi = Ie.create, hi = ze.create, fi = Tt.create, mi = Ot.create, _i = we.create, gi = St.create, yi = He.create, vn = J.create, vi = G.create, wi = be.create, bi = J.createWithPreprocess, ki = It.create, xi = () => Wn().optional(), Ti = () => qn().optional(), Oi = () => Jn().optional(), Si = {
|
|
6929
6936
|
string: (n) => z.create({ ...n, coerce: !0 }),
|
|
6930
6937
|
number: (n) => ye.create({ ...n, coerce: !0 }),
|
|
6931
6938
|
boolean: (n) => yt.create({
|
|
@@ -6934,14 +6941,14 @@ const Ba = (n, e = {
|
|
|
6934
6941
|
}),
|
|
6935
6942
|
bigint: (n) => ve.create({ ...n, coerce: !0 }),
|
|
6936
6943
|
date: (n) => Ce.create({ ...n, coerce: !0 })
|
|
6937
|
-
},
|
|
6938
|
-
var
|
|
6944
|
+
}, Zi = k;
|
|
6945
|
+
var ji = /* @__PURE__ */ Object.freeze({
|
|
6939
6946
|
__proto__: null,
|
|
6940
6947
|
defaultErrorMap: Je,
|
|
6941
|
-
setErrorMap:
|
|
6948
|
+
setErrorMap: Za,
|
|
6942
6949
|
getErrorMap: Vt,
|
|
6943
6950
|
makeIssue: Ut,
|
|
6944
|
-
EMPTY_PATH:
|
|
6951
|
+
EMPTY_PATH: ja,
|
|
6945
6952
|
addIssueToContext: m,
|
|
6946
6953
|
ParseStatus: P,
|
|
6947
6954
|
INVALID: k,
|
|
@@ -6995,63 +7002,63 @@ var Si = /* @__PURE__ */ Object.freeze({
|
|
|
6995
7002
|
ZodDefault: Zt,
|
|
6996
7003
|
ZodCatch: jt,
|
|
6997
7004
|
ZodNaN: qt,
|
|
6998
|
-
BRAND:
|
|
7005
|
+
BRAND: Ba,
|
|
6999
7006
|
ZodBranded: pn,
|
|
7000
7007
|
ZodPipeline: It,
|
|
7001
7008
|
ZodReadonly: Nt,
|
|
7002
7009
|
custom: Bn,
|
|
7003
7010
|
Schema: Z,
|
|
7004
7011
|
ZodSchema: Z,
|
|
7005
|
-
late:
|
|
7012
|
+
late: Wa,
|
|
7006
7013
|
get ZodFirstPartyTypeKind() {
|
|
7007
7014
|
return b;
|
|
7008
7015
|
},
|
|
7009
|
-
coerce:
|
|
7010
|
-
any:
|
|
7011
|
-
array:
|
|
7012
|
-
bigint:
|
|
7016
|
+
coerce: Si,
|
|
7017
|
+
any: Xa,
|
|
7018
|
+
array: si,
|
|
7019
|
+
bigint: Ka,
|
|
7013
7020
|
boolean: Jn,
|
|
7014
|
-
date:
|
|
7015
|
-
discriminatedUnion:
|
|
7021
|
+
date: Ha,
|
|
7022
|
+
discriminatedUnion: oi,
|
|
7016
7023
|
effect: vn,
|
|
7017
|
-
enum:
|
|
7018
|
-
function:
|
|
7019
|
-
instanceof:
|
|
7020
|
-
intersection:
|
|
7021
|
-
lazy:
|
|
7022
|
-
literal:
|
|
7023
|
-
map:
|
|
7024
|
-
nan:
|
|
7025
|
-
nativeEnum:
|
|
7026
|
-
never:
|
|
7027
|
-
null:
|
|
7028
|
-
nullable:
|
|
7024
|
+
enum: _i,
|
|
7025
|
+
function: hi,
|
|
7026
|
+
instanceof: qa,
|
|
7027
|
+
intersection: ci,
|
|
7028
|
+
lazy: fi,
|
|
7029
|
+
literal: mi,
|
|
7030
|
+
map: li,
|
|
7031
|
+
nan: Ja,
|
|
7032
|
+
nativeEnum: gi,
|
|
7033
|
+
never: ti,
|
|
7034
|
+
null: Ga,
|
|
7035
|
+
nullable: wi,
|
|
7029
7036
|
number: qn,
|
|
7030
|
-
object:
|
|
7031
|
-
oboolean:
|
|
7032
|
-
onumber:
|
|
7033
|
-
optional:
|
|
7034
|
-
ostring:
|
|
7035
|
-
pipeline:
|
|
7036
|
-
preprocess:
|
|
7037
|
-
promise:
|
|
7038
|
-
record:
|
|
7039
|
-
set:
|
|
7040
|
-
strictObject:
|
|
7037
|
+
object: ri,
|
|
7038
|
+
oboolean: Oi,
|
|
7039
|
+
onumber: Ti,
|
|
7040
|
+
optional: vi,
|
|
7041
|
+
ostring: xi,
|
|
7042
|
+
pipeline: ki,
|
|
7043
|
+
preprocess: bi,
|
|
7044
|
+
promise: yi,
|
|
7045
|
+
record: ui,
|
|
7046
|
+
set: pi,
|
|
7047
|
+
strictObject: ai,
|
|
7041
7048
|
string: Wn,
|
|
7042
|
-
symbol:
|
|
7049
|
+
symbol: Qa,
|
|
7043
7050
|
transformer: vn,
|
|
7044
|
-
tuple:
|
|
7045
|
-
undefined:
|
|
7046
|
-
union:
|
|
7047
|
-
unknown:
|
|
7048
|
-
void:
|
|
7049
|
-
NEVER:
|
|
7051
|
+
tuple: di,
|
|
7052
|
+
undefined: Ya,
|
|
7053
|
+
union: ii,
|
|
7054
|
+
unknown: ei,
|
|
7055
|
+
void: ni,
|
|
7056
|
+
NEVER: Zi,
|
|
7050
7057
|
ZodIssueCode: h,
|
|
7051
|
-
quotelessJson:
|
|
7058
|
+
quotelessJson: Sa,
|
|
7052
7059
|
ZodError: V
|
|
7053
7060
|
});
|
|
7054
|
-
|
|
7061
|
+
Oa(ji);
|
|
7055
7062
|
function Re(n, e = "", t = {}) {
|
|
7056
7063
|
for (let s in n)
|
|
7057
7064
|
if (Object.prototype.hasOwnProperty.call(n, s)) {
|
|
@@ -7078,7 +7085,7 @@ function hn(n, e) {
|
|
|
7078
7085
|
}
|
|
7079
7086
|
return t;
|
|
7080
7087
|
}
|
|
7081
|
-
function
|
|
7088
|
+
function Ni(n) {
|
|
7082
7089
|
return async (e, t) => {
|
|
7083
7090
|
const s = {
|
|
7084
7091
|
id: Ae(),
|
|
@@ -7089,7 +7096,7 @@ function Zi(n) {
|
|
|
7089
7096
|
return await n.insertInto("connections").values({ ...Re(s), tenant_id: e }).execute(), s;
|
|
7090
7097
|
};
|
|
7091
7098
|
}
|
|
7092
|
-
function
|
|
7099
|
+
function Ci(n) {
|
|
7093
7100
|
return async (e, t) => {
|
|
7094
7101
|
let s = n.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
7095
7102
|
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
@@ -7104,16 +7111,16 @@ function ji(n) {
|
|
|
7104
7111
|
};
|
|
7105
7112
|
};
|
|
7106
7113
|
}
|
|
7107
|
-
function
|
|
7114
|
+
function Ii(n) {
|
|
7108
7115
|
return async (e, t) => (await n.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
7109
7116
|
}
|
|
7110
|
-
function
|
|
7117
|
+
function Ei(n) {
|
|
7111
7118
|
return async (e, t) => {
|
|
7112
7119
|
const s = await n.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).selectAll().executeTakeFirst();
|
|
7113
7120
|
return s ? R(hn(s, ["options"])) : null;
|
|
7114
7121
|
};
|
|
7115
7122
|
}
|
|
7116
|
-
function
|
|
7123
|
+
function Ai(n) {
|
|
7117
7124
|
return async (e, t, s) => {
|
|
7118
7125
|
const r = {
|
|
7119
7126
|
...s,
|
|
@@ -7122,16 +7129,16 @@ function Ii(n) {
|
|
|
7122
7129
|
return await n.updateTable("connections").set(Re(r)).where("connections.id", "=", t).where("connections.tenant_id", "=", e).execute(), !0;
|
|
7123
7130
|
};
|
|
7124
7131
|
}
|
|
7125
|
-
function
|
|
7132
|
+
function Ri(n) {
|
|
7126
7133
|
return {
|
|
7127
|
-
create:
|
|
7128
|
-
get:
|
|
7129
|
-
list:
|
|
7130
|
-
remove:
|
|
7131
|
-
update:
|
|
7134
|
+
create: Ni(n),
|
|
7135
|
+
get: Ei(n),
|
|
7136
|
+
list: Ci(n),
|
|
7137
|
+
remove: Ii(n),
|
|
7138
|
+
update: Ai(n)
|
|
7132
7139
|
};
|
|
7133
7140
|
}
|
|
7134
|
-
function
|
|
7141
|
+
function $i(n) {
|
|
7135
7142
|
return {
|
|
7136
7143
|
get: async (e) => {
|
|
7137
7144
|
const t = await n.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
|
|
@@ -7159,25 +7166,25 @@ function Ai(n) {
|
|
|
7159
7166
|
}
|
|
7160
7167
|
};
|
|
7161
7168
|
}
|
|
7162
|
-
function
|
|
7169
|
+
function Pi(n) {
|
|
7163
7170
|
return async () => await n.selectFrom("keys").where("revoked_at", "is", null).selectAll().execute();
|
|
7164
7171
|
}
|
|
7165
|
-
function
|
|
7172
|
+
function Di(n) {
|
|
7166
7173
|
return async (e) => {
|
|
7167
7174
|
await n.insertInto("keys").values({ ...e, created_at: (/* @__PURE__ */ new Date()).toDateString() }).execute();
|
|
7168
7175
|
};
|
|
7169
7176
|
}
|
|
7170
|
-
function
|
|
7177
|
+
function Mi(n) {
|
|
7171
7178
|
return async (e, t) => !!(await n.updateTable("keys").set(t).where("kid", "=", e).execute()).length;
|
|
7172
7179
|
}
|
|
7173
|
-
function
|
|
7180
|
+
function Li(n) {
|
|
7174
7181
|
return {
|
|
7175
|
-
create:
|
|
7176
|
-
list:
|
|
7177
|
-
update:
|
|
7182
|
+
create: Di(n),
|
|
7183
|
+
list: Pi(n),
|
|
7184
|
+
update: Mi(n)
|
|
7178
7185
|
};
|
|
7179
7186
|
}
|
|
7180
|
-
function
|
|
7187
|
+
function Vi(n) {
|
|
7181
7188
|
return async (e, t) => {
|
|
7182
7189
|
const s = {
|
|
7183
7190
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -7189,7 +7196,7 @@ function Mi(n) {
|
|
|
7189
7196
|
return await n.insertInto("domains").values(s).execute(), s;
|
|
7190
7197
|
};
|
|
7191
7198
|
}
|
|
7192
|
-
function
|
|
7199
|
+
function Ui(n) {
|
|
7193
7200
|
return async (e, t) => {
|
|
7194
7201
|
let s = n.selectFrom("domains").where("domains.tenant_id", "=", e);
|
|
7195
7202
|
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
@@ -7202,13 +7209,13 @@ function Li(n) {
|
|
|
7202
7209
|
};
|
|
7203
7210
|
};
|
|
7204
7211
|
}
|
|
7205
|
-
function
|
|
7212
|
+
function Fi(n) {
|
|
7206
7213
|
return {
|
|
7207
|
-
create:
|
|
7208
|
-
list:
|
|
7214
|
+
create: Vi(n),
|
|
7215
|
+
list: Ui(n)
|
|
7209
7216
|
};
|
|
7210
7217
|
}
|
|
7211
|
-
function
|
|
7218
|
+
function zi(n) {
|
|
7212
7219
|
return async (e) => {
|
|
7213
7220
|
const [t] = await n.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
|
|
7214
7221
|
if (!t)
|
|
@@ -7238,7 +7245,7 @@ function Ui(n) {
|
|
|
7238
7245
|
});
|
|
7239
7246
|
};
|
|
7240
7247
|
}
|
|
7241
|
-
function
|
|
7248
|
+
function Bi(n) {
|
|
7242
7249
|
return async (e, t) => {
|
|
7243
7250
|
var o, c, d, u, l, j, A, U, ie, $e, oe, ce, de, Pe, De, K, H, Q;
|
|
7244
7251
|
const { colors: s, font: r, ...a } = t;
|
|
@@ -7266,13 +7273,13 @@ function Fi(n) {
|
|
|
7266
7273
|
}
|
|
7267
7274
|
};
|
|
7268
7275
|
}
|
|
7269
|
-
function
|
|
7276
|
+
function Wi(n) {
|
|
7270
7277
|
return {
|
|
7271
|
-
get:
|
|
7272
|
-
set:
|
|
7278
|
+
get: zi(n),
|
|
7279
|
+
set: Bi(n)
|
|
7273
7280
|
};
|
|
7274
7281
|
}
|
|
7275
|
-
function
|
|
7282
|
+
function qi(n) {
|
|
7276
7283
|
return async (e, t) => {
|
|
7277
7284
|
let s = n.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
7278
7285
|
t.q && (s = Ee(n, s, t.q, ["url"]));
|
|
@@ -7292,16 +7299,16 @@ function Bi(n) {
|
|
|
7292
7299
|
};
|
|
7293
7300
|
};
|
|
7294
7301
|
}
|
|
7295
|
-
function
|
|
7302
|
+
function Ji(n) {
|
|
7296
7303
|
return async (e, t) => {
|
|
7297
7304
|
const s = await n.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).selectAll().executeTakeFirst();
|
|
7298
7305
|
return s ? (s.enabled = !!s.enabled, s.synchronous = !!s.synchronous, R(s)) : null;
|
|
7299
7306
|
};
|
|
7300
7307
|
}
|
|
7301
|
-
function
|
|
7308
|
+
function Ki(n) {
|
|
7302
7309
|
return async (e, t) => (await n.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
7303
7310
|
}
|
|
7304
|
-
function
|
|
7311
|
+
function Hi(n) {
|
|
7305
7312
|
return async (e, t) => {
|
|
7306
7313
|
const s = {
|
|
7307
7314
|
hook_id: Ae(),
|
|
@@ -7315,7 +7322,7 @@ function Ji(n) {
|
|
|
7315
7322
|
}).execute(), s;
|
|
7316
7323
|
};
|
|
7317
7324
|
}
|
|
7318
|
-
function
|
|
7325
|
+
function Qi(n) {
|
|
7319
7326
|
return async (e, t, s) => {
|
|
7320
7327
|
const r = {
|
|
7321
7328
|
...s,
|
|
@@ -7324,16 +7331,16 @@ function Ki(n) {
|
|
|
7324
7331
|
return await n.updateTable("hooks").set(r).where("hooks.hook_id", "=", t).where("hooks.tenant_id", "=", e).execute(), !0;
|
|
7325
7332
|
};
|
|
7326
7333
|
}
|
|
7327
|
-
function
|
|
7334
|
+
function Yi(n) {
|
|
7328
7335
|
return {
|
|
7329
|
-
create:
|
|
7330
|
-
get:
|
|
7331
|
-
list:
|
|
7332
|
-
update:
|
|
7333
|
-
remove:
|
|
7336
|
+
create: Hi(n),
|
|
7337
|
+
get: Ji(n),
|
|
7338
|
+
list: qi(n),
|
|
7339
|
+
update: Qi(n),
|
|
7340
|
+
remove: Ki(n)
|
|
7334
7341
|
};
|
|
7335
7342
|
}
|
|
7336
|
-
function
|
|
7343
|
+
function Gi(n) {
|
|
7337
7344
|
return async (e, t) => {
|
|
7338
7345
|
const s = {
|
|
7339
7346
|
themeId: Ae(),
|
|
@@ -7344,16 +7351,16 @@ function Qi(n) {
|
|
|
7344
7351
|
return await n.insertInto("themes").values({ ...Re(s), tenant_id: e }).execute(), s;
|
|
7345
7352
|
};
|
|
7346
7353
|
}
|
|
7347
|
-
function
|
|
7354
|
+
function Xi(n) {
|
|
7348
7355
|
return async (e, t) => (await n.deleteFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
7349
7356
|
}
|
|
7350
|
-
function
|
|
7357
|
+
function eo(n) {
|
|
7351
7358
|
return async (e, t) => {
|
|
7352
7359
|
const s = await n.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", t).selectAll().executeTakeFirst();
|
|
7353
7360
|
return s ? R(s) : null;
|
|
7354
7361
|
};
|
|
7355
7362
|
}
|
|
7356
|
-
function
|
|
7363
|
+
function to(n) {
|
|
7357
7364
|
return async (e, t, s) => {
|
|
7358
7365
|
const r = Re({
|
|
7359
7366
|
...s,
|
|
@@ -7362,23 +7369,23 @@ function Xi(n) {
|
|
|
7362
7369
|
return await n.updateTable("themes").set(r).where("themes.id", "=", t).where("themes.tenant_id", "=", e).execute(), !0;
|
|
7363
7370
|
};
|
|
7364
7371
|
}
|
|
7365
|
-
function
|
|
7372
|
+
function no(n) {
|
|
7366
7373
|
return {
|
|
7367
|
-
create:
|
|
7368
|
-
get:
|
|
7369
|
-
remove:
|
|
7370
|
-
update:
|
|
7374
|
+
create: Gi(n),
|
|
7375
|
+
get: eo(n),
|
|
7376
|
+
remove: Xi(n),
|
|
7377
|
+
update: to(n)
|
|
7371
7378
|
};
|
|
7372
7379
|
}
|
|
7373
|
-
function
|
|
7380
|
+
function so(n) {
|
|
7374
7381
|
return async (e, t) => {
|
|
7375
7382
|
const s = (/* @__PURE__ */ new Date()).toISOString(), r = await n.selectFrom("logins").where("logins.expires_at", ">", s).where("logins.login_id", "=", t).selectAll().executeTakeFirst();
|
|
7376
|
-
return r ?
|
|
7383
|
+
return r ? kr.parse(
|
|
7377
7384
|
hn(R(r), ["authParams"])
|
|
7378
7385
|
) : null;
|
|
7379
7386
|
};
|
|
7380
7387
|
}
|
|
7381
|
-
function
|
|
7388
|
+
function ro(n) {
|
|
7382
7389
|
return async (e, t) => {
|
|
7383
7390
|
const s = {
|
|
7384
7391
|
login_id: Ae(),
|
|
@@ -7389,21 +7396,21 @@ function no(n) {
|
|
|
7389
7396
|
return await n.insertInto("logins").values({ ...Re(s), tenant_id: e }).execute(), s;
|
|
7390
7397
|
};
|
|
7391
7398
|
}
|
|
7392
|
-
function
|
|
7399
|
+
function ao(n) {
|
|
7393
7400
|
return async (e, t, s) => (await n.updateTable("logins").set(Re(s)).where("logins.login_id", "=", t).where("logins.tenant_id", "=", e).execute()).length === 1;
|
|
7394
7401
|
}
|
|
7395
|
-
function
|
|
7402
|
+
function io(n) {
|
|
7396
7403
|
return async (e, t) => (await n.deleteFrom("logins").where("logins.tenant_id", "=", e).where("logins.login_id", "=", t).execute()).length > 0;
|
|
7397
7404
|
}
|
|
7398
|
-
function
|
|
7405
|
+
function oo(n) {
|
|
7399
7406
|
return {
|
|
7400
|
-
create:
|
|
7401
|
-
get:
|
|
7402
|
-
update:
|
|
7403
|
-
remove:
|
|
7407
|
+
create: ro(n),
|
|
7408
|
+
get: so(n),
|
|
7409
|
+
update: ao(n),
|
|
7410
|
+
remove: io(n)
|
|
7404
7411
|
};
|
|
7405
7412
|
}
|
|
7406
|
-
function
|
|
7413
|
+
function co(n) {
|
|
7407
7414
|
return async (e) => {
|
|
7408
7415
|
const [t] = await n.selectFrom("promptSettings").where("promptSettings.tenant_id", "=", e).selectAll().execute();
|
|
7409
7416
|
return R({
|
|
@@ -7414,7 +7421,7 @@ function io(n) {
|
|
|
7414
7421
|
});
|
|
7415
7422
|
};
|
|
7416
7423
|
}
|
|
7417
|
-
function
|
|
7424
|
+
function uo(n) {
|
|
7418
7425
|
return async (e, t) => {
|
|
7419
7426
|
try {
|
|
7420
7427
|
await n.insertInto("promptSettings").values({
|
|
@@ -7426,33 +7433,33 @@ function oo(n) {
|
|
|
7426
7433
|
}
|
|
7427
7434
|
};
|
|
7428
7435
|
}
|
|
7429
|
-
function
|
|
7436
|
+
function lo(n) {
|
|
7430
7437
|
return {
|
|
7431
|
-
get:
|
|
7432
|
-
set:
|
|
7438
|
+
get: co(n),
|
|
7439
|
+
set: uo(n)
|
|
7433
7440
|
};
|
|
7434
7441
|
}
|
|
7435
|
-
function
|
|
7442
|
+
function ho(n) {
|
|
7436
7443
|
return {
|
|
7437
|
-
applications:
|
|
7438
|
-
branding:
|
|
7439
|
-
clients:
|
|
7440
|
-
codes:
|
|
7441
|
-
connections:
|
|
7442
|
-
domains:
|
|
7443
|
-
hooks:
|
|
7444
|
-
keys:
|
|
7445
|
-
logins:
|
|
7446
|
-
logs:
|
|
7447
|
-
passwords:
|
|
7448
|
-
promptSettings:
|
|
7449
|
-
users:
|
|
7450
|
-
sessions:
|
|
7451
|
-
tenants:
|
|
7452
|
-
themes:
|
|
7453
|
-
tickets:
|
|
7444
|
+
applications: ka(n),
|
|
7445
|
+
branding: Wi(n),
|
|
7446
|
+
clients: $i(n),
|
|
7447
|
+
codes: _a(n),
|
|
7448
|
+
connections: Ri(n),
|
|
7449
|
+
domains: Fi(n),
|
|
7450
|
+
hooks: Yi(n),
|
|
7451
|
+
keys: Li(n),
|
|
7452
|
+
logins: oo(n),
|
|
7453
|
+
logs: Yr(n),
|
|
7454
|
+
passwords: la(n),
|
|
7455
|
+
promptSettings: lo(n),
|
|
7456
|
+
users: Lr(n),
|
|
7457
|
+
sessions: sa(n),
|
|
7458
|
+
tenants: qr(n),
|
|
7459
|
+
themes: no(n),
|
|
7460
|
+
tickets: oa(n)
|
|
7454
7461
|
};
|
|
7455
7462
|
}
|
|
7456
7463
|
export {
|
|
7457
|
-
|
|
7464
|
+
ho as default
|
|
7458
7465
|
};
|