@authhero/proxy 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/proxy.cjs +1 -1
- package/dist/proxy.d.ts +17 -5
- package/dist/proxy.mjs +536 -456
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/app.d.ts +1 -0
- package/dist/types/data-plane/cache-adapter-cache.d.ts +8 -3
- package/dist/types/data-plane/cache-api-cache.d.ts +4 -2
- package/dist/types/data-plane/cache.d.ts +1 -0
- package/dist/types/data-plane/handlers/dispatch-namespace.d.ts +1 -0
- package/dist/types/data-plane/handlers/service-binding.d.ts +1 -0
- package/dist/types/data-plane/router.d.ts +1 -0
- package/dist/types/data-plane/timeout.d.ts +7 -0
- package/package.json +1 -1
package/dist/proxy.mjs
CHANGED
|
@@ -91,12 +91,12 @@ e.object({
|
|
|
91
91
|
tenant_id: e.string(),
|
|
92
92
|
number: e.number().int()
|
|
93
93
|
}).extend(n.shape);
|
|
94
|
-
var
|
|
94
|
+
var p = e.enum([
|
|
95
95
|
"user_action",
|
|
96
96
|
"admin_action",
|
|
97
97
|
"system",
|
|
98
98
|
"api"
|
|
99
|
-
]),
|
|
99
|
+
]), m = e.object({
|
|
100
100
|
type: e.enum([
|
|
101
101
|
"user",
|
|
102
102
|
"admin",
|
|
@@ -110,7 +110,7 @@ var ee = e.enum([
|
|
|
110
110
|
org_name: e.string().optional(),
|
|
111
111
|
scopes: e.array(e.string()).optional(),
|
|
112
112
|
client_id: e.string().optional()
|
|
113
|
-
}),
|
|
113
|
+
}), h = e.object({
|
|
114
114
|
type: e.string(),
|
|
115
115
|
id: e.string(),
|
|
116
116
|
before: e.record(e.string(), e.unknown()).optional(),
|
|
@@ -119,7 +119,7 @@ var ee = e.enum([
|
|
|
119
119
|
old: e.unknown(),
|
|
120
120
|
new: e.unknown()
|
|
121
121
|
})).optional()
|
|
122
|
-
}),
|
|
122
|
+
}), ee = e.object({
|
|
123
123
|
method: e.string(),
|
|
124
124
|
path: e.string(),
|
|
125
125
|
query: e.record(e.string(), e.string()).optional(),
|
|
@@ -127,17 +127,17 @@ var ee = e.enum([
|
|
|
127
127
|
ip: e.string(),
|
|
128
128
|
user_agent: e.string().optional(),
|
|
129
129
|
correlation_id: e.string().optional()
|
|
130
|
-
}),
|
|
130
|
+
}), te = e.object({
|
|
131
131
|
status_code: e.number(),
|
|
132
132
|
body: e.unknown().optional()
|
|
133
|
-
}),
|
|
133
|
+
}), ne = e.object({
|
|
134
134
|
country_code: e.string(),
|
|
135
135
|
city_name: e.string(),
|
|
136
136
|
latitude: e.string(),
|
|
137
137
|
longitude: e.string(),
|
|
138
138
|
time_zone: e.string(),
|
|
139
139
|
continent_code: e.string()
|
|
140
|
-
}),
|
|
140
|
+
}), re = e.object({
|
|
141
141
|
name: e.string(),
|
|
142
142
|
version: e.string(),
|
|
143
143
|
env: e.record(e.string(), e.string()).optional()
|
|
@@ -147,18 +147,18 @@ e.object({
|
|
|
147
147
|
event_type: e.string(),
|
|
148
148
|
log_type: e.string(),
|
|
149
149
|
description: e.string().optional(),
|
|
150
|
-
category:
|
|
151
|
-
actor:
|
|
152
|
-
target:
|
|
153
|
-
request:
|
|
154
|
-
response:
|
|
150
|
+
category: p,
|
|
151
|
+
actor: m,
|
|
152
|
+
target: h,
|
|
153
|
+
request: ee,
|
|
154
|
+
response: te.optional(),
|
|
155
155
|
connection: e.string().optional(),
|
|
156
156
|
strategy: e.string().optional(),
|
|
157
157
|
strategy_type: e.string().optional(),
|
|
158
158
|
audience: e.string().optional(),
|
|
159
159
|
scope: e.string().optional(),
|
|
160
|
-
location:
|
|
161
|
-
auth0_client:
|
|
160
|
+
location: ne.optional(),
|
|
161
|
+
auth0_client: re.optional(),
|
|
162
162
|
hostname: e.string(),
|
|
163
163
|
is_mobile: e.boolean().optional(),
|
|
164
164
|
timestamp: e.string()
|
|
@@ -173,14 +173,14 @@ e.object({
|
|
|
173
173
|
"SEND_REQUEST",
|
|
174
174
|
"SEND_EMAIL"
|
|
175
175
|
]), e.enum(["VERIFY_EMAIL"]);
|
|
176
|
-
var
|
|
176
|
+
var ie = e.object({
|
|
177
177
|
require_mx_record: e.boolean().optional(),
|
|
178
178
|
block_aliases: e.boolean().optional(),
|
|
179
179
|
block_free_emails: e.boolean().optional(),
|
|
180
180
|
block_disposable_emails: e.boolean().optional(),
|
|
181
181
|
blocklist: e.array(e.string()).optional(),
|
|
182
182
|
allowlist: e.array(e.string()).optional()
|
|
183
|
-
}),
|
|
183
|
+
}), ae = e.object({
|
|
184
184
|
id: e.string(),
|
|
185
185
|
alias: e.string().max(100).optional(),
|
|
186
186
|
type: e.literal("AUTH0"),
|
|
@@ -192,7 +192,7 @@ var se = e.object({
|
|
|
192
192
|
user_id: e.string(),
|
|
193
193
|
changes: e.record(e.string(), e.any())
|
|
194
194
|
})
|
|
195
|
-
}),
|
|
195
|
+
}), oe = e.object({
|
|
196
196
|
id: e.string(),
|
|
197
197
|
alias: e.string().max(100).optional(),
|
|
198
198
|
type: e.literal("EMAIL"),
|
|
@@ -201,13 +201,13 @@ var se = e.object({
|
|
|
201
201
|
mask_output: e.boolean().optional(),
|
|
202
202
|
params: e.object({
|
|
203
203
|
email: e.string(),
|
|
204
|
-
rules:
|
|
204
|
+
rules: ie.optional()
|
|
205
205
|
})
|
|
206
|
-
}),
|
|
206
|
+
}), se = e.enum([
|
|
207
207
|
"change-email",
|
|
208
208
|
"account",
|
|
209
209
|
"custom"
|
|
210
|
-
]),
|
|
210
|
+
]), ce = e.object({
|
|
211
211
|
id: e.string(),
|
|
212
212
|
alias: e.string().max(100).optional(),
|
|
213
213
|
type: e.literal("REDIRECT"),
|
|
@@ -215,17 +215,17 @@ var se = e.object({
|
|
|
215
215
|
allow_failure: e.boolean().optional(),
|
|
216
216
|
mask_output: e.boolean().optional(),
|
|
217
217
|
params: e.object({
|
|
218
|
-
target:
|
|
218
|
+
target: se.openapi({ description: "The predefined target to redirect to, or 'custom' for a custom URL" }),
|
|
219
219
|
custom_url: e.string().optional().openapi({ description: "Custom URL to redirect to when target is 'custom'" })
|
|
220
220
|
})
|
|
221
|
-
}),
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
221
|
+
}), le = e.union([
|
|
222
|
+
ae,
|
|
223
|
+
oe,
|
|
224
|
+
ce
|
|
225
225
|
]);
|
|
226
226
|
e.object({
|
|
227
227
|
name: e.string().min(1).max(150).openapi({ description: "The name of the flow" }),
|
|
228
|
-
actions: e.array(
|
|
228
|
+
actions: e.array(le).optional().default([]).openapi({ description: "The list of actions to execute in sequence" })
|
|
229
229
|
}).extend(n.shape).extend({ id: e.string().openapi({
|
|
230
230
|
description: "Unique identifier for the flow",
|
|
231
231
|
example: "af_12tMpdJ3iek7svMyZkSh5M"
|
|
@@ -241,7 +241,7 @@ e.object({
|
|
|
241
241
|
length: e.number(),
|
|
242
242
|
total: e.number().optional()
|
|
243
243
|
});
|
|
244
|
-
var
|
|
244
|
+
var ue = e.object({
|
|
245
245
|
email: e.string().optional(),
|
|
246
246
|
email_verified: e.boolean().optional(),
|
|
247
247
|
name: e.string().optional(),
|
|
@@ -250,7 +250,7 @@ var pe = e.object({
|
|
|
250
250
|
phone_number: e.string().optional(),
|
|
251
251
|
phone_verified: e.boolean().optional(),
|
|
252
252
|
family_name: e.string().optional()
|
|
253
|
-
}).catchall(e.any()),
|
|
253
|
+
}).catchall(e.any()), de = e.object({
|
|
254
254
|
connection: e.string(),
|
|
255
255
|
user_id: e.string(),
|
|
256
256
|
provider: e.string(),
|
|
@@ -263,15 +263,15 @@ var pe = e.object({
|
|
|
263
263
|
access_token: e.string().optional(),
|
|
264
264
|
access_token_secret: e.string().optional(),
|
|
265
265
|
refresh_token: e.string().optional(),
|
|
266
|
-
profileData:
|
|
267
|
-
}),
|
|
266
|
+
profileData: ue.optional()
|
|
267
|
+
}), fe = e.object({
|
|
268
268
|
formatted: e.string().optional(),
|
|
269
269
|
street_address: e.string().optional(),
|
|
270
270
|
locality: e.string().optional(),
|
|
271
271
|
region: e.string().optional(),
|
|
272
272
|
postal_code: e.string().optional(),
|
|
273
273
|
country: e.string().optional()
|
|
274
|
-
}).optional(),
|
|
274
|
+
}).optional(), pe = e.object({
|
|
275
275
|
email: e.string().transform((e) => e.toLowerCase()).optional(),
|
|
276
276
|
username: e.string().refine((e) => !e.includes("@"), { message: "Usernames must not contain \"@\". Use the email field for email addresses." }).optional(),
|
|
277
277
|
phone_number: e.string().optional(),
|
|
@@ -294,9 +294,9 @@ var pe = e.object({
|
|
|
294
294
|
gender: e.string().optional(),
|
|
295
295
|
birthdate: e.string().optional(),
|
|
296
296
|
zoneinfo: e.string().optional(),
|
|
297
|
-
address:
|
|
297
|
+
address: fe
|
|
298
298
|
});
|
|
299
|
-
|
|
299
|
+
pe.extend({
|
|
300
300
|
email_verified: e.boolean().default(!1),
|
|
301
301
|
verify_email: e.boolean().optional(),
|
|
302
302
|
last_ip: e.string().optional(),
|
|
@@ -316,24 +316,24 @@ ge.extend({
|
|
|
316
316
|
is_social: e.boolean(),
|
|
317
317
|
email: e.string().optional(),
|
|
318
318
|
login_count: e.number().default(0),
|
|
319
|
-
identities: e.array(
|
|
320
|
-
}).omit({ registration_completed_at: !0 }),
|
|
319
|
+
identities: e.array(de).optional()
|
|
320
|
+
}).omit({ registration_completed_at: !0 }), pe.extend({
|
|
321
321
|
login_count: e.number(),
|
|
322
322
|
multifactor: e.array(e.string()).optional(),
|
|
323
323
|
last_ip: e.string().optional(),
|
|
324
324
|
last_login: e.string().optional(),
|
|
325
325
|
user_id: e.string()
|
|
326
326
|
}).catchall(e.any());
|
|
327
|
-
var
|
|
327
|
+
var me = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", he = (e = 21) => {
|
|
328
328
|
let t = "", n = crypto.getRandomValues(new Uint8Array(e |= 0));
|
|
329
|
-
for (; e--;) t +=
|
|
329
|
+
for (; e--;) t += me[n[e] & 63];
|
|
330
330
|
return t;
|
|
331
|
-
},
|
|
331
|
+
}, ge = e.object({
|
|
332
332
|
client_id: e.string().optional().openapi({ description: "ID of this client. Generated server-side if omitted (Auth0 behavior)." }),
|
|
333
333
|
name: e.string().min(1).openapi({ description: "Name of this client (min length: 1 character, does not allow < or >)." }),
|
|
334
334
|
description: e.string().max(140).optional().openapi({ description: "Free text description of this client (max length: 140 characters)." }),
|
|
335
335
|
global: e.boolean().default(!1).openapi({ description: "Whether this is your global 'All Applications' client representing legacy tenant settings (true) or a regular client (false)." }),
|
|
336
|
-
client_secret: e.string().default(() =>
|
|
336
|
+
client_secret: e.string().default(() => he()).optional().openapi({ description: "Client secret (which you must not make public)." }),
|
|
337
337
|
app_type: e.enum([
|
|
338
338
|
"native",
|
|
339
339
|
"spa",
|
|
@@ -444,8 +444,8 @@ var _e = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", ve
|
|
|
444
444
|
e.object({
|
|
445
445
|
created_at: e.string(),
|
|
446
446
|
updated_at: e.string()
|
|
447
|
-
}).extend(
|
|
448
|
-
var
|
|
447
|
+
}).extend(ge.shape).extend({ client_id: e.string() });
|
|
448
|
+
var _e = e.object({
|
|
449
449
|
client_id: e.string().min(1).openapi({ description: "ID of the client." }),
|
|
450
450
|
audience: e.string().min(1).openapi({ description: "The audience (API identifier) of this client grant." }),
|
|
451
451
|
scope: e.array(e.string()).optional().openapi({ description: "Scopes allowed for this client grant." }),
|
|
@@ -458,15 +458,15 @@ var be = e.object({
|
|
|
458
458
|
is_system: e.boolean().optional().openapi({ description: "If enabled, this grant is a special grant created by Auth0. It cannot be modified or deleted directly." }),
|
|
459
459
|
subject_type: e.enum(["client", "user"]).optional().openapi({ description: "The type of application access the client grant allows. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement." }),
|
|
460
460
|
authorization_details_types: e.array(e.string()).optional().openapi({ description: "Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement." })
|
|
461
|
-
}),
|
|
461
|
+
}), ve = e.object({ id: e.string().openapi({ description: "ID of the client grant." }) }).extend(_e.shape).extend({
|
|
462
462
|
created_at: e.string().optional(),
|
|
463
463
|
updated_at: e.string().optional()
|
|
464
464
|
});
|
|
465
|
-
e.array(
|
|
466
|
-
var
|
|
465
|
+
e.array(ve);
|
|
466
|
+
var ye = e.enum(["iat", "rat"]), be = e.object({
|
|
467
467
|
id: e.string(),
|
|
468
468
|
token_hash: e.string(),
|
|
469
|
-
type:
|
|
469
|
+
type: ye,
|
|
470
470
|
client_id: e.string().optional(),
|
|
471
471
|
sub: e.string().optional(),
|
|
472
472
|
constraints: e.record(e.string(), e.unknown()).optional(),
|
|
@@ -477,23 +477,23 @@ e.object({
|
|
|
477
477
|
created_at: e.string(),
|
|
478
478
|
used_at: e.string().optional(),
|
|
479
479
|
revoked_at: e.string().optional()
|
|
480
|
-
}).extend(
|
|
481
|
-
var
|
|
480
|
+
}).extend(be.shape);
|
|
481
|
+
var g = e.object({
|
|
482
482
|
x: e.number(),
|
|
483
483
|
y: e.number()
|
|
484
|
-
}),
|
|
484
|
+
}), xe = /* @__PURE__ */ function(e) {
|
|
485
485
|
return e.RICH_TEXT = "RICH_TEXT", e.NEXT_BUTTON = "NEXT_BUTTON", e.BACK_BUTTON = "BACK_BUTTON", e.SUBMIT_BUTTON = "SUBMIT_BUTTON", e.DIVIDER = "DIVIDER", e.TEXT = "TEXT", e.EMAIL = "EMAIL", e.PASSWORD = "PASSWORD", e.NUMBER = "NUMBER", e.PHONE = "PHONE", e.DATE = "DATE", e.CHECKBOX = "CHECKBOX", e.RADIO = "RADIO", e.SELECT = "SELECT", e.HIDDEN = "HIDDEN", e.LEGAL = "LEGAL", e;
|
|
486
|
-
}({}),
|
|
486
|
+
}({}), Se = /* @__PURE__ */ function(e) {
|
|
487
487
|
return e.BLOCK = "BLOCK", e.FIELD = "FIELD", e;
|
|
488
|
-
}({}),
|
|
488
|
+
}({}), _ = e.object({
|
|
489
489
|
id: e.string(),
|
|
490
|
-
category: e.nativeEnum(
|
|
491
|
-
type: e.nativeEnum(
|
|
492
|
-
}),
|
|
490
|
+
category: e.nativeEnum(Se),
|
|
491
|
+
type: e.nativeEnum(xe)
|
|
492
|
+
}), Ce = _.extend({
|
|
493
493
|
category: e.literal("BLOCK"),
|
|
494
494
|
type: e.literal("RICH_TEXT"),
|
|
495
495
|
config: e.object({ content: e.string() }).passthrough()
|
|
496
|
-
}),
|
|
496
|
+
}), we = _.extend({
|
|
497
497
|
category: e.literal("BLOCK"),
|
|
498
498
|
type: e.union([
|
|
499
499
|
e.literal("NEXT_BUTTON"),
|
|
@@ -501,13 +501,13 @@ var p = e.object({
|
|
|
501
501
|
e.literal("SUBMIT_BUTTON")
|
|
502
502
|
]),
|
|
503
503
|
config: e.object({ text: e.string() }).passthrough()
|
|
504
|
-
}),
|
|
504
|
+
}), Te = _.extend({
|
|
505
505
|
category: e.literal("FIELD"),
|
|
506
506
|
type: e.literal("LEGAL"),
|
|
507
507
|
required: e.boolean().optional(),
|
|
508
508
|
sensitive: e.boolean().optional(),
|
|
509
509
|
config: e.object({ text: e.string() }).passthrough()
|
|
510
|
-
}),
|
|
510
|
+
}), Ee = _.extend({
|
|
511
511
|
category: e.literal("FIELD"),
|
|
512
512
|
type: e.union([
|
|
513
513
|
e.literal("TEXT"),
|
|
@@ -527,38 +527,38 @@ var p = e.object({
|
|
|
527
527
|
label: e.string().optional(),
|
|
528
528
|
placeholder: e.string().optional()
|
|
529
529
|
}).passthrough()
|
|
530
|
-
}),
|
|
530
|
+
}), De = e.object({
|
|
531
531
|
id: e.string(),
|
|
532
532
|
category: e.string(),
|
|
533
533
|
type: e.string()
|
|
534
|
-
}).passthrough(),
|
|
534
|
+
}).passthrough(), Oe = e.union([
|
|
535
|
+
Ce,
|
|
536
|
+
we,
|
|
537
|
+
Te,
|
|
535
538
|
Ee,
|
|
536
|
-
De
|
|
537
|
-
|
|
538
|
-
ke,
|
|
539
|
-
Ae
|
|
540
|
-
]), Me = e.object({
|
|
539
|
+
De
|
|
540
|
+
]), ke = e.object({
|
|
541
541
|
id: e.string(),
|
|
542
542
|
type: e.literal("STEP"),
|
|
543
|
-
coordinates:
|
|
543
|
+
coordinates: g,
|
|
544
544
|
alias: e.string().optional(),
|
|
545
545
|
config: e.object({
|
|
546
|
-
components: e.array(
|
|
546
|
+
components: e.array(Oe),
|
|
547
547
|
next_node: e.string()
|
|
548
548
|
}).passthrough()
|
|
549
|
-
}),
|
|
549
|
+
}), Ae = e.object({
|
|
550
550
|
id: e.string(),
|
|
551
551
|
type: e.literal("FLOW"),
|
|
552
|
-
coordinates:
|
|
552
|
+
coordinates: g,
|
|
553
553
|
alias: e.string().optional(),
|
|
554
554
|
config: e.object({
|
|
555
555
|
flow_id: e.string(),
|
|
556
556
|
next_node: e.string()
|
|
557
557
|
})
|
|
558
|
-
}),
|
|
558
|
+
}), je = e.object({
|
|
559
559
|
id: e.string(),
|
|
560
560
|
type: e.literal("ACTION"),
|
|
561
|
-
coordinates:
|
|
561
|
+
coordinates: g,
|
|
562
562
|
alias: e.string().optional(),
|
|
563
563
|
config: e.object({
|
|
564
564
|
action_type: e.enum(["REDIRECT"]).openapi({ description: "The type of action to perform" }),
|
|
@@ -570,29 +570,29 @@ var p = e.object({
|
|
|
570
570
|
custom_url: e.string().optional().openapi({ description: "Custom URL when target is 'custom'" }),
|
|
571
571
|
next_node: e.string().openapi({ description: "The next node to navigate to after action (for non-redirect actions)" })
|
|
572
572
|
}).passthrough()
|
|
573
|
-
}),
|
|
573
|
+
}), Me = e.object({
|
|
574
574
|
id: e.string(),
|
|
575
575
|
type: e.string(),
|
|
576
|
-
coordinates:
|
|
577
|
-
}).passthrough(),
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
]),
|
|
576
|
+
coordinates: g
|
|
577
|
+
}).passthrough(), Ne = e.union([
|
|
578
|
+
ke,
|
|
579
|
+
Ae,
|
|
580
|
+
je,
|
|
581
|
+
Me
|
|
582
|
+
]), Pe = e.object({
|
|
583
583
|
next_node: e.string(),
|
|
584
|
-
coordinates:
|
|
585
|
-
}).passthrough(),
|
|
584
|
+
coordinates: g
|
|
585
|
+
}).passthrough(), Fe = e.object({
|
|
586
586
|
resume_flow: e.boolean().optional(),
|
|
587
|
-
coordinates:
|
|
587
|
+
coordinates: g
|
|
588
588
|
}).passthrough();
|
|
589
589
|
e.object({
|
|
590
590
|
id: e.string(),
|
|
591
591
|
name: e.string(),
|
|
592
592
|
languages: e.object({ primary: e.string() }).passthrough(),
|
|
593
|
-
nodes: e.array(
|
|
594
|
-
start:
|
|
595
|
-
ending:
|
|
593
|
+
nodes: e.array(Ne),
|
|
594
|
+
start: Pe,
|
|
595
|
+
ending: Fe,
|
|
596
596
|
created_at: e.string(),
|
|
597
597
|
updated_at: e.string(),
|
|
598
598
|
links: e.object({
|
|
@@ -604,24 +604,24 @@ e.object({
|
|
|
604
604
|
created_at: !0,
|
|
605
605
|
updated_at: !0
|
|
606
606
|
});
|
|
607
|
-
var
|
|
607
|
+
var Ie = /* @__PURE__ */ function(e) {
|
|
608
608
|
return e.TOKEN = "token", e.ID_TOKEN = "id_token", e.TOKEN_ID_TOKEN = "id_token token", e.CODE = "code", e.CODE_ID_TOKEN = "code id_token", e.CODE_TOKEN = "code token", e.CODE_ID_TOKEN_TOKEN = "code id_token token", e;
|
|
609
|
-
}({}),
|
|
609
|
+
}({}), Le = /* @__PURE__ */ function(e) {
|
|
610
610
|
return e.QUERY = "query", e.FRAGMENT = "fragment", e.FORM_POST = "form_post", e.WEB_MESSAGE = "web_message", e.SAML_POST = "saml_post", e;
|
|
611
|
-
}({}),
|
|
611
|
+
}({}), Re = /* @__PURE__ */ function(e) {
|
|
612
612
|
return e.S256 = "S256", e.Plain = "plain", e;
|
|
613
|
-
}({}),
|
|
613
|
+
}({}), ze = e.union([e.null(), e.object({
|
|
614
614
|
essential: e.boolean().optional(),
|
|
615
615
|
value: e.unknown().optional(),
|
|
616
616
|
values: e.array(e.unknown()).optional()
|
|
617
|
-
})]).nullable(),
|
|
618
|
-
userinfo: e.record(e.string(),
|
|
619
|
-
id_token: e.record(e.string(),
|
|
620
|
-
}),
|
|
617
|
+
})]).nullable(), Be = e.object({
|
|
618
|
+
userinfo: e.record(e.string(), ze).optional(),
|
|
619
|
+
id_token: e.record(e.string(), ze).optional()
|
|
620
|
+
}), Ve = e.object({
|
|
621
621
|
client_id: e.string(),
|
|
622
622
|
act_as: e.string().optional(),
|
|
623
|
-
response_type: e.nativeEnum(
|
|
624
|
-
response_mode: e.nativeEnum(
|
|
623
|
+
response_type: e.nativeEnum(Ie).optional(),
|
|
624
|
+
response_mode: e.nativeEnum(Le).optional(),
|
|
625
625
|
redirect_uri: e.string().optional(),
|
|
626
626
|
audience: e.string().optional(),
|
|
627
627
|
organization: e.string().optional(),
|
|
@@ -629,13 +629,13 @@ var ze = /* @__PURE__ */ function(e) {
|
|
|
629
629
|
nonce: e.string().optional(),
|
|
630
630
|
scope: e.string().optional(),
|
|
631
631
|
prompt: e.string().optional(),
|
|
632
|
-
code_challenge_method: e.nativeEnum(
|
|
632
|
+
code_challenge_method: e.nativeEnum(Re).optional(),
|
|
633
633
|
code_challenge: e.string().optional(),
|
|
634
634
|
username: e.string().optional(),
|
|
635
635
|
ui_locales: e.string().optional(),
|
|
636
636
|
max_age: e.number().optional(),
|
|
637
637
|
acr_values: e.string().optional(),
|
|
638
|
-
claims:
|
|
638
|
+
claims: Be.optional(),
|
|
639
639
|
vendor_id: e.string().optional()
|
|
640
640
|
});
|
|
641
641
|
e.object({
|
|
@@ -658,7 +658,7 @@ e.object({
|
|
|
658
658
|
"auto"
|
|
659
659
|
]).optional()
|
|
660
660
|
});
|
|
661
|
-
var
|
|
661
|
+
var He = e.enum([
|
|
662
662
|
"password_reset",
|
|
663
663
|
"email_verification",
|
|
664
664
|
"otp",
|
|
@@ -671,7 +671,7 @@ e.object({
|
|
|
671
671
|
code_id: e.string().openapi({ description: "The code that will be used in for instance an email verification flow" }),
|
|
672
672
|
login_id: e.string().openapi({ description: "The id of the login session that the code is connected to" }),
|
|
673
673
|
connection_id: e.string().optional().openapi({ description: "The connection that the code is connected to" }),
|
|
674
|
-
code_type:
|
|
674
|
+
code_type: He,
|
|
675
675
|
code_verifier: e.string().optional().openapi({ description: "The code verifier used in PKCE in outbound flows" }),
|
|
676
676
|
code_challenge: e.string().optional().openapi({ description: "The code challenge used in PKCE in outbound flows" }),
|
|
677
677
|
code_challenge_method: e.enum(["plain", "S256"]).optional().openapi({ description: "The code challenge method used in PKCE in outbound flows" }),
|
|
@@ -683,7 +683,7 @@ e.object({
|
|
|
683
683
|
used_at: e.string().optional(),
|
|
684
684
|
user_id: e.string().optional()
|
|
685
685
|
}).extend({ created_at: e.string() });
|
|
686
|
-
var
|
|
686
|
+
var Ue = e.object({
|
|
687
687
|
kid: e.string().optional(),
|
|
688
688
|
team_id: e.string().optional(),
|
|
689
689
|
realms: e.string().optional(),
|
|
@@ -799,23 +799,23 @@ var Ge = e.object({
|
|
|
799
799
|
"never_on_login"
|
|
800
800
|
]).optional()
|
|
801
801
|
});
|
|
802
|
-
function
|
|
802
|
+
function v(e) {
|
|
803
803
|
if (e !== null) {
|
|
804
|
-
if (Array.isArray(e)) return e.filter((e) => e !== null).map(
|
|
804
|
+
if (Array.isArray(e)) return e.filter((e) => e !== null).map(v);
|
|
805
805
|
if (e && typeof e == "object") {
|
|
806
806
|
let t = {};
|
|
807
|
-
for (let [n, r] of Object.entries(e)) r !== null && (t[n] =
|
|
807
|
+
for (let [n, r] of Object.entries(e)) r !== null && (t[n] = v(r));
|
|
808
808
|
return t;
|
|
809
809
|
}
|
|
810
810
|
return e;
|
|
811
811
|
}
|
|
812
812
|
}
|
|
813
|
-
var
|
|
813
|
+
var We = e.object({
|
|
814
814
|
id: e.string().optional(),
|
|
815
815
|
name: e.string(),
|
|
816
816
|
display_name: e.string().optional(),
|
|
817
817
|
strategy: e.string(),
|
|
818
|
-
options: e.preprocess((e) => e === null ? {} :
|
|
818
|
+
options: e.preprocess((e) => e === null ? {} : v(e), Ue).default({}),
|
|
819
819
|
enabled_clients: e.array(e.string()).default([]).optional(),
|
|
820
820
|
response_type: e.custom().optional(),
|
|
821
821
|
response_mode: e.custom().optional(),
|
|
@@ -828,8 +828,8 @@ e.object({
|
|
|
828
828
|
id: e.string(),
|
|
829
829
|
created_at: e.string().transform((e) => e === null ? "" : e),
|
|
830
830
|
updated_at: e.string().transform((e) => e === null ? "" : e)
|
|
831
|
-
}).extend(
|
|
832
|
-
var
|
|
831
|
+
}).extend(We.shape);
|
|
832
|
+
var Ge = e.object({
|
|
833
833
|
domain: e.string(),
|
|
834
834
|
custom_domain_id: e.string().optional(),
|
|
835
835
|
type: e.enum(["auth0_managed_certs", "self_managed_certs"]),
|
|
@@ -843,7 +843,7 @@ var _ = e.object({
|
|
|
843
843
|
"null"
|
|
844
844
|
]).optional(),
|
|
845
845
|
domain_metadata: e.record(e.string(), e.string().max(255)).optional()
|
|
846
|
-
}),
|
|
846
|
+
}), Ke = e.discriminatedUnion("name", [e.object({
|
|
847
847
|
name: e.literal("txt"),
|
|
848
848
|
record: e.string(),
|
|
849
849
|
domain: e.string()
|
|
@@ -851,7 +851,7 @@ var _ = e.object({
|
|
|
851
851
|
name: e.literal("http"),
|
|
852
852
|
http_body: e.string(),
|
|
853
853
|
http_url: e.string()
|
|
854
|
-
})]),
|
|
854
|
+
})]), qe = Ge.extend({
|
|
855
855
|
custom_domain_id: e.string(),
|
|
856
856
|
primary: e.boolean(),
|
|
857
857
|
status: e.enum([
|
|
@@ -861,28 +861,28 @@ var _ = e.object({
|
|
|
861
861
|
"ready"
|
|
862
862
|
]),
|
|
863
863
|
origin_domain_name: e.string().optional(),
|
|
864
|
-
verification: e.object({ methods: e.array(
|
|
864
|
+
verification: e.object({ methods: e.array(Ke) }).optional(),
|
|
865
865
|
tls_policy: e.string().optional()
|
|
866
866
|
});
|
|
867
|
-
|
|
867
|
+
Ge.pick({
|
|
868
868
|
tls_policy: !0,
|
|
869
869
|
custom_client_ip_header: !0,
|
|
870
870
|
domain_metadata: !0
|
|
871
|
-
}).strict(),
|
|
871
|
+
}).strict(), qe.extend({ tenant_id: e.string() }), e.object({
|
|
872
872
|
certificate: e.string().regex(/^-----BEGIN CERTIFICATE-----[\s\S]+-----END CERTIFICATE-----\s*$/, "must be PEM-encoded; include the full certificate chain in leaf-first order"),
|
|
873
873
|
private_key: e.string().regex(/-----BEGIN (RSA |EC |ENCRYPTED )?PRIVATE KEY-----[\s\S]+-----END \1PRIVATE KEY-----\s*$/, "must be a PEM-encoded private key")
|
|
874
874
|
});
|
|
875
|
-
var
|
|
875
|
+
var y = e.object({
|
|
876
876
|
id: e.string(),
|
|
877
877
|
order: e.number().optional(),
|
|
878
878
|
visible: e.boolean().optional().default(!0)
|
|
879
|
-
}),
|
|
879
|
+
}), b = y.extend({ category: e.literal("BLOCK").optional() }), Je = b.extend({
|
|
880
880
|
type: e.literal("DIVIDER"),
|
|
881
881
|
config: e.object({ text: e.string().optional() }).optional()
|
|
882
|
-
}),
|
|
882
|
+
}), Ye = b.extend({
|
|
883
883
|
type: e.literal("HTML"),
|
|
884
884
|
config: e.object({ content: e.string().optional() }).optional()
|
|
885
|
-
}),
|
|
885
|
+
}), Xe = b.extend({
|
|
886
886
|
type: e.literal("IMAGE"),
|
|
887
887
|
config: e.object({
|
|
888
888
|
src: e.string().optional(),
|
|
@@ -890,43 +890,43 @@ var v = e.object({
|
|
|
890
890
|
width: e.number().optional(),
|
|
891
891
|
height: e.number().optional()
|
|
892
892
|
}).optional()
|
|
893
|
-
}),
|
|
893
|
+
}), Ze = b.extend({
|
|
894
894
|
type: e.literal("JUMP_BUTTON"),
|
|
895
895
|
config: e.object({
|
|
896
896
|
text: e.string().optional(),
|
|
897
897
|
target_step: e.string().optional()
|
|
898
898
|
})
|
|
899
|
-
}),
|
|
899
|
+
}), Qe = b.extend({
|
|
900
900
|
type: e.literal("RESEND_BUTTON"),
|
|
901
901
|
config: e.object({
|
|
902
902
|
text: e.string().optional(),
|
|
903
903
|
resend_action: e.string().optional()
|
|
904
904
|
})
|
|
905
|
-
}),
|
|
905
|
+
}), $e = b.extend({
|
|
906
906
|
type: e.literal("NEXT_BUTTON"),
|
|
907
907
|
config: e.object({ text: e.string().optional() })
|
|
908
|
-
}),
|
|
908
|
+
}), et = b.extend({
|
|
909
909
|
type: e.literal("PREVIOUS_BUTTON"),
|
|
910
910
|
config: e.object({ text: e.string().optional() })
|
|
911
|
-
}),
|
|
911
|
+
}), tt = b.extend({
|
|
912
912
|
type: e.literal("RICH_TEXT"),
|
|
913
913
|
config: e.object({ content: e.string().optional() }).optional()
|
|
914
|
-
}),
|
|
914
|
+
}), x = y.extend({
|
|
915
915
|
category: e.literal("WIDGET").optional(),
|
|
916
916
|
label: e.string().min(1).optional(),
|
|
917
917
|
hint: e.string().min(1).max(500).optional(),
|
|
918
918
|
required: e.boolean().optional(),
|
|
919
919
|
sensitive: e.boolean().optional()
|
|
920
|
-
}),
|
|
920
|
+
}), nt = x.extend({
|
|
921
921
|
type: e.literal("AUTH0_VERIFIABLE_CREDENTIALS"),
|
|
922
922
|
config: e.object({ credential_type: e.string().optional() })
|
|
923
|
-
}),
|
|
923
|
+
}), rt = x.extend({
|
|
924
924
|
type: e.literal("GMAPS_ADDRESS"),
|
|
925
925
|
config: e.object({ api_key: e.string().optional() })
|
|
926
|
-
}),
|
|
926
|
+
}), it = x.extend({
|
|
927
927
|
type: e.literal("RECAPTCHA"),
|
|
928
928
|
config: e.object({ site_key: e.string().optional() })
|
|
929
|
-
}),
|
|
929
|
+
}), S = y.extend({
|
|
930
930
|
category: e.literal("FIELD").optional(),
|
|
931
931
|
label: e.string().min(1).optional(),
|
|
932
932
|
hint: e.string().min(1).max(500).optional(),
|
|
@@ -942,10 +942,10 @@ var v = e.object({
|
|
|
942
942
|
})).optional(),
|
|
943
943
|
required: e.boolean().optional(),
|
|
944
944
|
sensitive: e.boolean().optional()
|
|
945
|
-
}),
|
|
945
|
+
}), at = S.extend({
|
|
946
946
|
type: e.literal("BOOLEAN"),
|
|
947
947
|
config: e.object({ default_value: e.boolean().optional() }).optional()
|
|
948
|
-
}),
|
|
948
|
+
}), ot = S.extend({
|
|
949
949
|
type: e.literal("CARDS"),
|
|
950
950
|
config: e.object({
|
|
951
951
|
options: e.array(e.object({
|
|
@@ -956,7 +956,7 @@ var v = e.object({
|
|
|
956
956
|
})).optional(),
|
|
957
957
|
multi_select: e.boolean().optional()
|
|
958
958
|
}).optional()
|
|
959
|
-
}),
|
|
959
|
+
}), st = S.extend({
|
|
960
960
|
type: e.literal("CHOICE"),
|
|
961
961
|
config: e.object({
|
|
962
962
|
options: e.array(e.object({
|
|
@@ -967,7 +967,7 @@ var v = e.object({
|
|
|
967
967
|
multiple: e.boolean().optional(),
|
|
968
968
|
default_value: e.union([e.string(), e.array(e.string())]).optional()
|
|
969
969
|
}).optional()
|
|
970
|
-
}),
|
|
970
|
+
}), ct = S.extend({
|
|
971
971
|
type: e.literal("CUSTOM"),
|
|
972
972
|
config: e.object({
|
|
973
973
|
component: e.string().optional(),
|
|
@@ -975,7 +975,7 @@ var v = e.object({
|
|
|
975
975
|
schema: e.record(e.string(), e.any()).optional(),
|
|
976
976
|
code: e.string().optional()
|
|
977
977
|
})
|
|
978
|
-
}),
|
|
978
|
+
}), lt = S.extend({
|
|
979
979
|
type: e.literal("DATE"),
|
|
980
980
|
config: e.object({
|
|
981
981
|
format: e.string().optional(),
|
|
@@ -983,7 +983,7 @@ var v = e.object({
|
|
|
983
983
|
max: e.string().optional(),
|
|
984
984
|
default_value: e.string().optional()
|
|
985
985
|
}).optional()
|
|
986
|
-
}),
|
|
986
|
+
}), ut = S.extend({
|
|
987
987
|
type: e.literal("DROPDOWN"),
|
|
988
988
|
config: e.object({
|
|
989
989
|
options: e.array(e.object({
|
|
@@ -995,26 +995,26 @@ var v = e.object({
|
|
|
995
995
|
multiple: e.boolean().optional(),
|
|
996
996
|
default_value: e.union([e.string(), e.array(e.string())]).optional()
|
|
997
997
|
}).optional()
|
|
998
|
-
}),
|
|
998
|
+
}), dt = S.extend({
|
|
999
999
|
type: e.literal("EMAIL"),
|
|
1000
1000
|
config: e.object({
|
|
1001
1001
|
placeholder: e.string().optional(),
|
|
1002
1002
|
default_value: e.string().optional()
|
|
1003
1003
|
}).optional()
|
|
1004
|
-
}),
|
|
1004
|
+
}), ft = S.extend({
|
|
1005
1005
|
type: e.literal("FILE"),
|
|
1006
1006
|
config: e.object({
|
|
1007
1007
|
accept: e.string().optional(),
|
|
1008
1008
|
max_size: e.number().optional(),
|
|
1009
1009
|
multiple: e.boolean().optional()
|
|
1010
1010
|
}).optional()
|
|
1011
|
-
}),
|
|
1011
|
+
}), pt = S.extend({
|
|
1012
1012
|
type: e.literal("LEGAL"),
|
|
1013
1013
|
config: e.object({
|
|
1014
1014
|
text: e.string(),
|
|
1015
1015
|
html: e.boolean().optional()
|
|
1016
1016
|
}).optional()
|
|
1017
|
-
}),
|
|
1017
|
+
}), mt = S.extend({
|
|
1018
1018
|
type: e.literal("NUMBER"),
|
|
1019
1019
|
config: e.object({
|
|
1020
1020
|
placeholder: e.string().optional(),
|
|
@@ -1023,7 +1023,7 @@ var v = e.object({
|
|
|
1023
1023
|
step: e.number().optional(),
|
|
1024
1024
|
default_value: e.string().optional()
|
|
1025
1025
|
}).optional()
|
|
1026
|
-
}),
|
|
1026
|
+
}), ht = S.extend({
|
|
1027
1027
|
type: e.literal("PASSWORD"),
|
|
1028
1028
|
config: e.object({
|
|
1029
1029
|
placeholder: e.string().optional(),
|
|
@@ -1032,13 +1032,13 @@ var v = e.object({
|
|
|
1032
1032
|
forgot_password_link: e.string().optional(),
|
|
1033
1033
|
default_value: e.string().optional()
|
|
1034
1034
|
}).optional()
|
|
1035
|
-
}),
|
|
1035
|
+
}), gt = S.extend({
|
|
1036
1036
|
type: e.literal("PAYMENT"),
|
|
1037
1037
|
config: e.object({
|
|
1038
1038
|
provider: e.string().optional(),
|
|
1039
1039
|
currency: e.string().optional()
|
|
1040
1040
|
}).optional()
|
|
1041
|
-
}),
|
|
1041
|
+
}), _t = S.extend({
|
|
1042
1042
|
type: e.literal("SOCIAL"),
|
|
1043
1043
|
config: e.object({
|
|
1044
1044
|
providers: e.array(e.string()).optional(),
|
|
@@ -1050,7 +1050,7 @@ var v = e.object({
|
|
|
1050
1050
|
href: e.string().optional()
|
|
1051
1051
|
})).optional()
|
|
1052
1052
|
}).optional()
|
|
1053
|
-
}),
|
|
1053
|
+
}), vt = S.extend({
|
|
1054
1054
|
type: e.literal("TEL"),
|
|
1055
1055
|
config: e.object({
|
|
1056
1056
|
placeholder: e.string().optional(),
|
|
@@ -1058,7 +1058,7 @@ var v = e.object({
|
|
|
1058
1058
|
default_value: e.string().optional(),
|
|
1059
1059
|
allow_email: e.boolean().optional()
|
|
1060
1060
|
}).optional()
|
|
1061
|
-
}),
|
|
1061
|
+
}), yt = S.extend({
|
|
1062
1062
|
type: e.literal("TEXT"),
|
|
1063
1063
|
config: e.object({
|
|
1064
1064
|
placeholder: e.string().optional(),
|
|
@@ -1066,36 +1066,37 @@ var v = e.object({
|
|
|
1066
1066
|
max_length: e.number().optional(),
|
|
1067
1067
|
default_value: e.string().optional()
|
|
1068
1068
|
}).optional()
|
|
1069
|
-
}),
|
|
1069
|
+
}), bt = S.extend({
|
|
1070
1070
|
type: e.literal("COUNTRY"),
|
|
1071
1071
|
config: e.object({
|
|
1072
1072
|
placeholder: e.string().optional(),
|
|
1073
1073
|
default_value: e.string().optional()
|
|
1074
1074
|
}).optional()
|
|
1075
|
-
}),
|
|
1075
|
+
}), xt = S.extend({
|
|
1076
1076
|
type: e.literal("URL"),
|
|
1077
1077
|
config: e.object({
|
|
1078
1078
|
placeholder: e.string().optional(),
|
|
1079
1079
|
default_value: e.string().optional()
|
|
1080
1080
|
}).optional()
|
|
1081
|
-
}),
|
|
1081
|
+
}), St = e.discriminatedUnion("type", [
|
|
1082
|
+
Je,
|
|
1082
1083
|
Ye,
|
|
1083
1084
|
Xe,
|
|
1084
1085
|
Ze,
|
|
1085
1086
|
Qe,
|
|
1086
1087
|
$e,
|
|
1087
1088
|
et,
|
|
1088
|
-
tt
|
|
1089
|
-
|
|
1090
|
-
|
|
1089
|
+
tt
|
|
1090
|
+
]), Ct = e.discriminatedUnion("type", [
|
|
1091
|
+
nt,
|
|
1091
1092
|
rt,
|
|
1092
|
-
it
|
|
1093
|
-
|
|
1094
|
-
|
|
1093
|
+
it
|
|
1094
|
+
]), wt = e.discriminatedUnion("type", [
|
|
1095
|
+
at,
|
|
1095
1096
|
ot,
|
|
1096
1097
|
st,
|
|
1098
|
+
bt,
|
|
1097
1099
|
ct,
|
|
1098
|
-
xt,
|
|
1099
1100
|
lt,
|
|
1100
1101
|
ut,
|
|
1101
1102
|
dt,
|
|
@@ -1107,12 +1108,11 @@ var v = e.object({
|
|
|
1107
1108
|
_t,
|
|
1108
1109
|
vt,
|
|
1109
1110
|
yt,
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1111
|
+
xt
|
|
1112
|
+
]), Tt = e.union([
|
|
1113
|
+
St,
|
|
1113
1114
|
Ct,
|
|
1114
|
-
wt
|
|
1115
|
-
Tt
|
|
1115
|
+
wt
|
|
1116
1116
|
]);
|
|
1117
1117
|
new Set([
|
|
1118
1118
|
"BOOLEAN",
|
|
@@ -1170,7 +1170,7 @@ var C = e.object({
|
|
|
1170
1170
|
coordinates: C,
|
|
1171
1171
|
alias: e.string().min(1).max(150).optional(),
|
|
1172
1172
|
config: e.object({
|
|
1173
|
-
components: e.array(
|
|
1173
|
+
components: e.array(Tt),
|
|
1174
1174
|
next_node: e.string().optional()
|
|
1175
1175
|
})
|
|
1176
1176
|
}), kt = e.discriminatedUnion("type", [
|
|
@@ -1234,7 +1234,7 @@ e.object({
|
|
|
1234
1234
|
method: e.enum(["POST", "GET"]),
|
|
1235
1235
|
title: e.string().optional(),
|
|
1236
1236
|
description: e.string().optional(),
|
|
1237
|
-
components: e.array(
|
|
1237
|
+
components: e.array(Tt),
|
|
1238
1238
|
messages: e.array(jt).optional(),
|
|
1239
1239
|
links: e.array(Mt).optional(),
|
|
1240
1240
|
footer: e.string().optional()
|
|
@@ -1431,7 +1431,7 @@ var Gt = /* @__PURE__ */ function(e) {
|
|
|
1431
1431
|
e.object({
|
|
1432
1432
|
csrf_token: e.string(),
|
|
1433
1433
|
auth0Client: e.string().optional(),
|
|
1434
|
-
authParams:
|
|
1434
|
+
authParams: Ve,
|
|
1435
1435
|
expires_at: e.string(),
|
|
1436
1436
|
deleted_at: e.string().optional(),
|
|
1437
1437
|
ip: e.string().optional(),
|
|
@@ -1658,52 +1658,52 @@ var Zt = e.enum([
|
|
|
1658
1658
|
"splunk",
|
|
1659
1659
|
"datadog",
|
|
1660
1660
|
"sumo"
|
|
1661
|
-
]),
|
|
1661
|
+
]), Qt = e.enum([
|
|
1662
1662
|
"active",
|
|
1663
1663
|
"paused",
|
|
1664
1664
|
"suspended"
|
|
1665
|
-
]),
|
|
1665
|
+
]), $t = e.object({
|
|
1666
1666
|
type: e.string(),
|
|
1667
1667
|
name: e.string()
|
|
1668
1668
|
});
|
|
1669
1669
|
e.object({
|
|
1670
1670
|
name: e.string(),
|
|
1671
1671
|
type: Zt,
|
|
1672
|
-
status:
|
|
1672
|
+
status: Qt.optional(),
|
|
1673
1673
|
sink: e.record(e.string(), e.unknown()),
|
|
1674
|
-
filters: e.array(
|
|
1674
|
+
filters: e.array($t).optional(),
|
|
1675
1675
|
isPriority: e.boolean().optional()
|
|
1676
1676
|
}).extend({
|
|
1677
1677
|
id: e.string(),
|
|
1678
|
-
status:
|
|
1678
|
+
status: Qt,
|
|
1679
1679
|
created_at: e.string().optional(),
|
|
1680
1680
|
updated_at: e.string().optional()
|
|
1681
1681
|
});
|
|
1682
|
-
var
|
|
1682
|
+
var en = e.enum([
|
|
1683
1683
|
"auth0",
|
|
1684
1684
|
"cognito",
|
|
1685
1685
|
"okta",
|
|
1686
1686
|
"oidc"
|
|
1687
|
-
]),
|
|
1687
|
+
]), tn = e.object({
|
|
1688
1688
|
domain: e.string(),
|
|
1689
1689
|
client_id: e.string(),
|
|
1690
1690
|
client_secret: e.string(),
|
|
1691
1691
|
audience: e.string().optional(),
|
|
1692
1692
|
scope: e.string().optional()
|
|
1693
|
-
}),
|
|
1693
|
+
}), nn = e.object({
|
|
1694
1694
|
id: e.string().optional(),
|
|
1695
1695
|
name: e.string(),
|
|
1696
|
-
provider:
|
|
1696
|
+
provider: en,
|
|
1697
1697
|
connection: e.string(),
|
|
1698
1698
|
enabled: e.boolean().default(!0),
|
|
1699
|
-
credentials:
|
|
1699
|
+
credentials: tn
|
|
1700
1700
|
});
|
|
1701
1701
|
e.object({
|
|
1702
1702
|
id: e.string(),
|
|
1703
1703
|
created_at: e.string(),
|
|
1704
1704
|
updated_at: e.string()
|
|
1705
|
-
}).extend(
|
|
1706
|
-
var
|
|
1705
|
+
}).extend(nn.shape);
|
|
1706
|
+
var rn = e.object({
|
|
1707
1707
|
enabled: e.boolean().optional(),
|
|
1708
1708
|
shields: e.array(e.string()).optional(),
|
|
1709
1709
|
admin_notification_frequency: e.array(e.string()).optional(),
|
|
@@ -1712,13 +1712,13 @@ var nn = e.object({
|
|
|
1712
1712
|
"pre-user-registration": e.object({ shields: e.array(e.string()).optional() }).optional(),
|
|
1713
1713
|
"pre-change-password": e.object({ shields: e.array(e.string()).optional() }).optional()
|
|
1714
1714
|
}).optional()
|
|
1715
|
-
}),
|
|
1715
|
+
}), an = e.object({
|
|
1716
1716
|
enabled: e.boolean().optional(),
|
|
1717
1717
|
shields: e.array(e.string()).optional(),
|
|
1718
1718
|
allowlist: e.array(e.string()).optional(),
|
|
1719
1719
|
mode: e.string().optional(),
|
|
1720
1720
|
max_attempts: e.number().optional()
|
|
1721
|
-
}),
|
|
1721
|
+
}), on = e.object({
|
|
1722
1722
|
enabled: e.boolean().optional(),
|
|
1723
1723
|
shields: e.array(e.string()).optional(),
|
|
1724
1724
|
allowlist: e.array(e.string()).optional(),
|
|
@@ -1732,10 +1732,10 @@ var nn = e.object({
|
|
|
1732
1732
|
rate: e.number().optional()
|
|
1733
1733
|
}).optional()
|
|
1734
1734
|
}).optional()
|
|
1735
|
-
}),
|
|
1736
|
-
breached_password_detection:
|
|
1737
|
-
brute_force_protection:
|
|
1738
|
-
suspicious_ip_throttling:
|
|
1735
|
+
}), sn = e.object({
|
|
1736
|
+
breached_password_detection: rn.optional(),
|
|
1737
|
+
brute_force_protection: an.optional(),
|
|
1738
|
+
suspicious_ip_throttling: on.optional()
|
|
1739
1739
|
});
|
|
1740
1740
|
e.object({
|
|
1741
1741
|
id: e.string().optional(),
|
|
@@ -1748,14 +1748,14 @@ e.object({
|
|
|
1748
1748
|
created_at: e.string(),
|
|
1749
1749
|
updated_at: e.string()
|
|
1750
1750
|
});
|
|
1751
|
-
var
|
|
1751
|
+
var cn = e.object({
|
|
1752
1752
|
initial_user_agent: e.string().describe("First user agent of the device from which this user logged in"),
|
|
1753
1753
|
initial_ip: e.string().describe("First IP address associated with this session"),
|
|
1754
1754
|
initial_asn: e.string().describe("First autonomous system number associated with this session"),
|
|
1755
1755
|
last_user_agent: e.string().describe("Last user agent of the device from which this user logged in"),
|
|
1756
1756
|
last_ip: e.string().describe("Last IP address from which this user logged in"),
|
|
1757
1757
|
last_asn: e.string().describe("Last autonomous system number from which this user logged in")
|
|
1758
|
-
}),
|
|
1758
|
+
}), ln = e.object({
|
|
1759
1759
|
id: e.string(),
|
|
1760
1760
|
revoked_at: e.string().optional(),
|
|
1761
1761
|
used_at: e.string().optional(),
|
|
@@ -1763,7 +1763,7 @@ var M = e.object({
|
|
|
1763
1763
|
expires_at: e.string().optional(),
|
|
1764
1764
|
login_session_id: e.string(),
|
|
1765
1765
|
idle_expires_at: e.string().optional(),
|
|
1766
|
-
device:
|
|
1766
|
+
device: cn.describe("Metadata related to the device used in the session"),
|
|
1767
1767
|
clients: e.array(e.string()).describe("List of client details for the session")
|
|
1768
1768
|
});
|
|
1769
1769
|
e.object({
|
|
@@ -1771,7 +1771,7 @@ e.object({
|
|
|
1771
1771
|
updated_at: e.string(),
|
|
1772
1772
|
authenticated_at: e.string(),
|
|
1773
1773
|
last_interaction_at: e.string()
|
|
1774
|
-
}).extend(
|
|
1774
|
+
}).extend(ln.shape), e.object({
|
|
1775
1775
|
kid: e.string().openapi({ description: "The key id of the signing key" }),
|
|
1776
1776
|
tenant_id: e.string().optional().openapi({ description: "The tenant the key belongs to. Omitted means the key is shared / control-plane scoped." }),
|
|
1777
1777
|
cert: e.string().openapi({ description: "The public certificate of the signing key" }),
|
|
@@ -1788,7 +1788,7 @@ e.object({
|
|
|
1788
1788
|
connection: e.string().optional().openapi({ description: "The connection identifier associated with the key" }),
|
|
1789
1789
|
type: e.enum(["jwt_signing", "saml_encryption"]).openapi({ description: "The type of the signing key" })
|
|
1790
1790
|
});
|
|
1791
|
-
var
|
|
1791
|
+
var un = e.object({
|
|
1792
1792
|
id: e.string().optional(),
|
|
1793
1793
|
audience: e.string().optional(),
|
|
1794
1794
|
friendly_name: e.string(),
|
|
@@ -1905,7 +1905,7 @@ var cn = e.object({
|
|
|
1905
1905
|
"shared_planetscale"
|
|
1906
1906
|
]).optional(),
|
|
1907
1907
|
d1_database_id: e.string().max(64).optional(),
|
|
1908
|
-
attack_protection:
|
|
1908
|
+
attack_protection: sn.optional(),
|
|
1909
1909
|
mfa: e.object({
|
|
1910
1910
|
policy: e.enum(["never", "always"]).default("never").optional(),
|
|
1911
1911
|
factors: e.object({
|
|
@@ -1936,7 +1936,7 @@ var cn = e.object({
|
|
|
1936
1936
|
e.object({
|
|
1937
1937
|
created_at: e.string().nullable().transform((e) => e ?? ""),
|
|
1938
1938
|
updated_at: e.string().nullable().transform((e) => e ?? "")
|
|
1939
|
-
}).extend(
|
|
1939
|
+
}).extend(un.shape).extend({
|
|
1940
1940
|
id: e.string(),
|
|
1941
1941
|
is_control_plane: e.boolean().optional()
|
|
1942
1942
|
}), e.object({
|
|
@@ -1951,7 +1951,7 @@ e.object({
|
|
|
1951
1951
|
code: e.string(),
|
|
1952
1952
|
state: e.string().optional()
|
|
1953
1953
|
});
|
|
1954
|
-
var
|
|
1954
|
+
var dn = e.object({
|
|
1955
1955
|
button_border_radius: e.number(),
|
|
1956
1956
|
button_border_weight: e.number(),
|
|
1957
1957
|
buttons_style: e.enum([
|
|
@@ -1969,7 +1969,7 @@ var ln = e.object({
|
|
|
1969
1969
|
show_widget_shadow: e.boolean(),
|
|
1970
1970
|
widget_border_weight: e.number(),
|
|
1971
1971
|
widget_corner_radius: e.number()
|
|
1972
|
-
}),
|
|
1972
|
+
}), fn = e.object({
|
|
1973
1973
|
base_focus_color: e.string(),
|
|
1974
1974
|
base_hover_color: e.string(),
|
|
1975
1975
|
body_text: e.string(),
|
|
@@ -1993,20 +1993,20 @@ var ln = e.object({
|
|
|
1993
1993
|
success: e.string(),
|
|
1994
1994
|
widget_background: e.string(),
|
|
1995
1995
|
widget_border: e.string()
|
|
1996
|
-
}),
|
|
1996
|
+
}), j = e.object({
|
|
1997
1997
|
bold: e.boolean(),
|
|
1998
1998
|
size: e.number()
|
|
1999
|
-
}),
|
|
2000
|
-
body_text:
|
|
2001
|
-
buttons_text:
|
|
1999
|
+
}), pn = e.object({
|
|
2000
|
+
body_text: j,
|
|
2001
|
+
buttons_text: j,
|
|
2002
2002
|
font_url: e.string(),
|
|
2003
|
-
input_labels:
|
|
2004
|
-
links:
|
|
2003
|
+
input_labels: j,
|
|
2004
|
+
links: j,
|
|
2005
2005
|
links_style: e.enum(["normal", "underlined"]),
|
|
2006
2006
|
reference_text_size: e.number(),
|
|
2007
|
-
subtitle:
|
|
2008
|
-
title:
|
|
2009
|
-
}),
|
|
2007
|
+
subtitle: j,
|
|
2008
|
+
title: j
|
|
2009
|
+
}), mn = e.object({
|
|
2010
2010
|
background_color: e.string(),
|
|
2011
2011
|
background_image_url: e.string(),
|
|
2012
2012
|
page_layout: e.enum([
|
|
@@ -2019,7 +2019,7 @@ var ln = e.object({
|
|
|
2019
2019
|
"chip",
|
|
2020
2020
|
"none"
|
|
2021
2021
|
]).optional()
|
|
2022
|
-
}),
|
|
2022
|
+
}), hn = e.object({
|
|
2023
2023
|
header_text_alignment: e.enum([
|
|
2024
2024
|
"center",
|
|
2025
2025
|
"left",
|
|
@@ -2036,39 +2036,39 @@ var ln = e.object({
|
|
|
2036
2036
|
social_buttons_layout: e.enum(["bottom", "top"])
|
|
2037
2037
|
});
|
|
2038
2038
|
e.object({
|
|
2039
|
-
borders:
|
|
2040
|
-
colors:
|
|
2039
|
+
borders: dn,
|
|
2040
|
+
colors: fn,
|
|
2041
2041
|
displayName: e.string(),
|
|
2042
|
-
fonts:
|
|
2043
|
-
page_background:
|
|
2044
|
-
widget:
|
|
2042
|
+
fonts: pn,
|
|
2043
|
+
page_background: mn,
|
|
2044
|
+
widget: hn
|
|
2045
2045
|
}).extend({ themeId: e.string() }), e.object({
|
|
2046
2046
|
universal_login_experience: e.enum(["new", "classic"]).default("new"),
|
|
2047
2047
|
identifier_first: e.boolean().default(!0),
|
|
2048
2048
|
password_first: e.boolean().default(!1),
|
|
2049
2049
|
webauthn_platform_first_factor: e.boolean()
|
|
2050
2050
|
});
|
|
2051
|
-
var
|
|
2051
|
+
var gn = e.object({
|
|
2052
2052
|
hosts: e.array(e.string()).optional(),
|
|
2053
2053
|
methods: e.array(e.string()).optional(),
|
|
2054
2054
|
path: e.string().default("/*"),
|
|
2055
2055
|
headers: e.record(e.string(), e.string()).optional(),
|
|
2056
2056
|
query: e.record(e.string(), e.string()).optional()
|
|
2057
|
-
}),
|
|
2057
|
+
}), _n = e.object({
|
|
2058
2058
|
type: e.string(),
|
|
2059
2059
|
options: e.record(e.string(), e.unknown()).default({})
|
|
2060
|
-
}),
|
|
2060
|
+
}), M = e.object({
|
|
2061
2061
|
id: e.string().optional(),
|
|
2062
2062
|
custom_domain_id: e.string(),
|
|
2063
2063
|
priority: e.number().int().default(100),
|
|
2064
|
-
match:
|
|
2065
|
-
handlers: e.array(
|
|
2066
|
-
}),
|
|
2064
|
+
match: gn,
|
|
2065
|
+
handlers: e.array(_n).min(1)
|
|
2066
|
+
}), vn = M.extend({
|
|
2067
2067
|
id: e.string(),
|
|
2068
2068
|
tenant_id: e.string(),
|
|
2069
2069
|
created_at: e.string(),
|
|
2070
2070
|
updated_at: e.string()
|
|
2071
|
-
}),
|
|
2071
|
+
}), yn = M.partial().omit({
|
|
2072
2072
|
id: !0,
|
|
2073
2073
|
custom_domain_id: !0
|
|
2074
2074
|
});
|
|
@@ -2079,7 +2079,7 @@ e.object({
|
|
|
2079
2079
|
credentials: e.record(e.string(), e.unknown()),
|
|
2080
2080
|
settings: e.object({}).optional()
|
|
2081
2081
|
});
|
|
2082
|
-
var
|
|
2082
|
+
var bn = e.enum([
|
|
2083
2083
|
"verify_email",
|
|
2084
2084
|
"verify_email_by_code",
|
|
2085
2085
|
"reset_email",
|
|
@@ -2094,7 +2094,7 @@ var gn = e.enum([
|
|
|
2094
2094
|
"user_invitation"
|
|
2095
2095
|
]);
|
|
2096
2096
|
e.object({
|
|
2097
|
-
template:
|
|
2097
|
+
template: bn,
|
|
2098
2098
|
body: e.string(),
|
|
2099
2099
|
from: e.string(),
|
|
2100
2100
|
subject: e.string(),
|
|
@@ -2111,7 +2111,7 @@ e.object({
|
|
|
2111
2111
|
expires_at: e.string().optional(),
|
|
2112
2112
|
idle_expires_at: e.string().optional(),
|
|
2113
2113
|
last_exchanged_at: e.string().optional(),
|
|
2114
|
-
device:
|
|
2114
|
+
device: cn,
|
|
2115
2115
|
resource_servers: e.array(e.object({
|
|
2116
2116
|
audience: e.string(),
|
|
2117
2117
|
scopes: e.string()
|
|
@@ -2132,10 +2132,10 @@ e.object({
|
|
|
2132
2132
|
name: e.string(),
|
|
2133
2133
|
options: e.object({})
|
|
2134
2134
|
});
|
|
2135
|
-
var
|
|
2135
|
+
var xn = e.object({
|
|
2136
2136
|
value: e.string(),
|
|
2137
2137
|
description: e.string().optional()
|
|
2138
|
-
}),
|
|
2138
|
+
}), Sn = e.object({
|
|
2139
2139
|
token_dialect: e.enum(["access_token", "access_token_authz"]).optional(),
|
|
2140
2140
|
enforce_policies: e.boolean().optional(),
|
|
2141
2141
|
allow_skipping_userinfo: e.boolean().optional(),
|
|
@@ -2143,11 +2143,11 @@ var _n = e.object({
|
|
|
2143
2143
|
persist_client_authorization: e.boolean().optional(),
|
|
2144
2144
|
enable_introspection_endpoint: e.boolean().optional(),
|
|
2145
2145
|
mtls: e.object({ bound_access_tokens: e.boolean().optional() }).optional()
|
|
2146
|
-
}),
|
|
2146
|
+
}), Cn = e.object({
|
|
2147
2147
|
id: e.string().optional(),
|
|
2148
2148
|
name: e.string(),
|
|
2149
2149
|
identifier: e.string(),
|
|
2150
|
-
scopes: e.array(
|
|
2150
|
+
scopes: e.array(xn).optional(),
|
|
2151
2151
|
signing_alg: e.string().optional(),
|
|
2152
2152
|
signing_secret: e.string().optional(),
|
|
2153
2153
|
token_lifetime: e.number().default(86400),
|
|
@@ -2155,26 +2155,26 @@ var _n = e.object({
|
|
|
2155
2155
|
skip_consent_for_verifiable_first_party_clients: e.boolean().optional(),
|
|
2156
2156
|
allow_offline_access: e.boolean().optional(),
|
|
2157
2157
|
verificationKey: e.string().optional(),
|
|
2158
|
-
options:
|
|
2158
|
+
options: Sn.optional(),
|
|
2159
2159
|
is_system: e.boolean().optional(),
|
|
2160
2160
|
metadata: e.record(e.string(), e.any()).optional()
|
|
2161
2161
|
}).extend({
|
|
2162
2162
|
created_at: e.string().optional(),
|
|
2163
2163
|
updated_at: e.string().optional()
|
|
2164
2164
|
});
|
|
2165
|
-
e.array(
|
|
2166
|
-
var
|
|
2165
|
+
e.array(Cn);
|
|
2166
|
+
var wn = e.object({
|
|
2167
2167
|
role_id: e.string(),
|
|
2168
2168
|
resource_server_identifier: e.string(),
|
|
2169
2169
|
permission_name: e.string()
|
|
2170
2170
|
}).extend({ created_at: e.string() });
|
|
2171
|
-
e.array(
|
|
2171
|
+
e.array(wn), e.object({
|
|
2172
2172
|
user_id: e.string().openapi({ description: "The id of the user that granted the consent" }),
|
|
2173
2173
|
clientID: e.string().openapi({ description: "The id of the client the grant was issued to" }),
|
|
2174
2174
|
audience: e.string().optional().openapi({ description: "The audience the grant applies to" }),
|
|
2175
2175
|
scope: e.array(e.string()).default([]).openapi({ description: "The list of OAuth scopes the user has consented to" })
|
|
2176
2176
|
}).extend({ id: e.string() });
|
|
2177
|
-
var
|
|
2177
|
+
var Tn = e.object({
|
|
2178
2178
|
user_id: e.string(),
|
|
2179
2179
|
resource_server_identifier: e.string(),
|
|
2180
2180
|
permission_name: e.string(),
|
|
@@ -2183,8 +2183,8 @@ var xn = e.object({
|
|
|
2183
2183
|
tenant_id: e.string(),
|
|
2184
2184
|
created_at: e.string().optional()
|
|
2185
2185
|
});
|
|
2186
|
-
e.array(
|
|
2187
|
-
var
|
|
2186
|
+
e.array(Tn);
|
|
2187
|
+
var En = e.object({
|
|
2188
2188
|
user_id: e.string(),
|
|
2189
2189
|
resource_server_identifier: e.string(),
|
|
2190
2190
|
resource_server_name: e.string(),
|
|
@@ -2193,8 +2193,8 @@ var Sn = e.object({
|
|
|
2193
2193
|
created_at: e.string().optional(),
|
|
2194
2194
|
organization_id: e.string().optional()
|
|
2195
2195
|
});
|
|
2196
|
-
e.array(
|
|
2197
|
-
var
|
|
2196
|
+
e.array(En);
|
|
2197
|
+
var Dn = e.object({
|
|
2198
2198
|
user_id: e.string(),
|
|
2199
2199
|
role_id: e.string(),
|
|
2200
2200
|
organization_id: e.string().optional()
|
|
@@ -2202,8 +2202,8 @@ var Cn = e.object({
|
|
|
2202
2202
|
tenant_id: e.string(),
|
|
2203
2203
|
created_at: e.string().optional()
|
|
2204
2204
|
});
|
|
2205
|
-
e.array(
|
|
2206
|
-
var
|
|
2205
|
+
e.array(Dn);
|
|
2206
|
+
var On = e.object({
|
|
2207
2207
|
id: e.string().optional().openapi({ description: "The unique identifier of the role. If not provided, one will be generated." }),
|
|
2208
2208
|
name: e.string().min(1).max(50).openapi({ description: "The name of the role. Cannot include '<' or '>'" }),
|
|
2209
2209
|
description: e.string().max(255).optional().openapi({ description: "The description of the role" }),
|
|
@@ -2214,19 +2214,19 @@ var wn = e.object({
|
|
|
2214
2214
|
created_at: e.string().optional(),
|
|
2215
2215
|
updated_at: e.string().optional()
|
|
2216
2216
|
});
|
|
2217
|
-
e.array(
|
|
2218
|
-
var
|
|
2217
|
+
e.array(On);
|
|
2218
|
+
var kn = e.object({
|
|
2219
2219
|
logo_url: e.string().optional().openapi({ description: "URL of the organization's logo" }),
|
|
2220
2220
|
colors: e.object({
|
|
2221
2221
|
primary: e.string().optional().openapi({ description: "Primary color in hex format (e.g., #FF0000)" }),
|
|
2222
2222
|
page_background: e.string().optional().openapi({ description: "Page background color in hex format (e.g., #FFFFFF)" })
|
|
2223
2223
|
}).optional()
|
|
2224
|
-
}).optional(),
|
|
2224
|
+
}).optional(), An = e.object({
|
|
2225
2225
|
connection_id: e.string().openapi({ description: "ID of the connection" }),
|
|
2226
2226
|
assign_membership_on_login: e.boolean().default(!1).openapi({ description: "Whether to assign membership to the organization on login" }),
|
|
2227
2227
|
show_as_button: e.boolean().default(!0).openapi({ description: "Whether to show this connection as a button in the login screen" }),
|
|
2228
2228
|
is_signup_enabled: e.boolean().default(!0).openapi({ description: "Whether signup is enabled for this connection" })
|
|
2229
|
-
}),
|
|
2229
|
+
}), jn = e.object({ client_credentials: e.object({
|
|
2230
2230
|
enforce: e.boolean().default(!1).openapi({ description: "Whether to enforce token quota limits" }),
|
|
2231
2231
|
per_day: e.number().min(0).default(0).openapi({ description: "Maximum tokens per day (0 = unlimited)" }),
|
|
2232
2232
|
per_hour: e.number().min(0).default(0).openapi({ description: "Maximum tokens per hour (0 = unlimited)" })
|
|
@@ -2235,15 +2235,15 @@ e.object({
|
|
|
2235
2235
|
id: e.string().optional(),
|
|
2236
2236
|
name: e.string().min(1).regex(/^[a-z0-9_-]+$/, { message: "Organization name must be lowercase and can only contain letters, numbers, hyphens, and underscores" }).openapi({ description: "The name of the organization. Must be lowercase and can only contain letters, numbers, hyphens, and underscores." }),
|
|
2237
2237
|
display_name: e.string().optional().openapi({ description: "The display name of the organization" }),
|
|
2238
|
-
branding:
|
|
2238
|
+
branding: kn,
|
|
2239
2239
|
metadata: e.record(e.string(), e.any()).default({}).optional().openapi({ description: "Custom metadata for the organization" }),
|
|
2240
|
-
enabled_connections: e.array(
|
|
2241
|
-
token_quota:
|
|
2240
|
+
enabled_connections: e.array(An).default([]).optional().openapi({ description: "List of enabled connections for the organization" }),
|
|
2241
|
+
token_quota: jn
|
|
2242
2242
|
}).extend(n.shape).extend({
|
|
2243
2243
|
id: e.string(),
|
|
2244
2244
|
name: e.string().min(1).openapi({ description: "The name of the organization" })
|
|
2245
2245
|
});
|
|
2246
|
-
var
|
|
2246
|
+
var Mn = e.object({
|
|
2247
2247
|
connection_id: e.string().openapi({ description: "ID of the tenant-level connection to enable for the org." }),
|
|
2248
2248
|
assign_membership_on_login: e.boolean().optional().default(!1),
|
|
2249
2249
|
show_as_button: e.boolean().optional().default(!0),
|
|
@@ -2256,7 +2256,7 @@ var On = e.object({
|
|
|
2256
2256
|
created_at: e.string().optional(),
|
|
2257
2257
|
updated_at: e.string().optional()
|
|
2258
2258
|
});
|
|
2259
|
-
e.array(
|
|
2259
|
+
e.array(Mn), e.object({
|
|
2260
2260
|
user_id: e.string().openapi({ description: "ID of the user" }),
|
|
2261
2261
|
organization_id: e.string().openapi({ description: "ID of the organization" })
|
|
2262
2262
|
}).extend(n.shape).extend({ id: e.string() }), e.object({
|
|
@@ -2389,22 +2389,22 @@ e.array(On), e.object({
|
|
|
2389
2389
|
"passwordless",
|
|
2390
2390
|
"enterprise"
|
|
2391
2391
|
]);
|
|
2392
|
-
var
|
|
2392
|
+
var Nn = e.object({
|
|
2393
2393
|
name: e.string(),
|
|
2394
2394
|
type: e.string()
|
|
2395
|
-
}),
|
|
2395
|
+
}), Pn = e.object({
|
|
2396
2396
|
elapsed: e.number(),
|
|
2397
2397
|
rows_read: e.number().optional(),
|
|
2398
2398
|
bytes_read: e.number().optional()
|
|
2399
2399
|
});
|
|
2400
2400
|
e.object({
|
|
2401
|
-
meta: e.array(
|
|
2401
|
+
meta: e.array(Nn),
|
|
2402
2402
|
data: e.array(e.record(e.string(), e.any())),
|
|
2403
2403
|
rows: e.number(),
|
|
2404
2404
|
rows_before_limit_at_least: e.number().optional(),
|
|
2405
|
-
statistics:
|
|
2405
|
+
statistics: Pn.optional()
|
|
2406
2406
|
});
|
|
2407
|
-
var
|
|
2407
|
+
var Fn = e.enum(/* @__PURE__ */ "login.login-id.login-password.signup.signup-id.signup-password.reset-password.consent.mfa.mfa-push.mfa-otp.mfa-voice.mfa-phone.mfa-webauthn.mfa-email.mfa-recovery-code.status.device-flow.email-verification.email-otp-challenge.organizations.invitation.common.passkeys.captcha.custom-form.login-passwordless.mfa-login-options".split(".")), In = e.record(e.string(), e.record(e.string(), e.string())).openapi({
|
|
2408
2408
|
type: "object",
|
|
2409
2409
|
additionalProperties: {
|
|
2410
2410
|
type: "object",
|
|
@@ -2412,11 +2412,11 @@ var jn = e.enum(/* @__PURE__ */ "login.login-id.login-password.signup.signup-id.
|
|
|
2412
2412
|
}
|
|
2413
2413
|
});
|
|
2414
2414
|
e.object({
|
|
2415
|
-
prompt:
|
|
2415
|
+
prompt: Fn,
|
|
2416
2416
|
language: e.string(),
|
|
2417
|
-
custom_text:
|
|
2417
|
+
custom_text: In
|
|
2418
2418
|
});
|
|
2419
|
-
var
|
|
2419
|
+
var Ln = e.enum([
|
|
2420
2420
|
"phone",
|
|
2421
2421
|
"totp",
|
|
2422
2422
|
"email",
|
|
@@ -2424,9 +2424,9 @@ var Nn = e.enum([
|
|
|
2424
2424
|
"webauthn-roaming",
|
|
2425
2425
|
"webauthn-platform",
|
|
2426
2426
|
"passkey"
|
|
2427
|
-
]),
|
|
2427
|
+
]), N = e.object({
|
|
2428
2428
|
user_id: e.string(),
|
|
2429
|
-
type:
|
|
2429
|
+
type: Ln,
|
|
2430
2430
|
phone_number: e.string().optional(),
|
|
2431
2431
|
totp_secret: e.string().optional(),
|
|
2432
2432
|
credential_id: e.string().optional(),
|
|
@@ -2437,7 +2437,7 @@ var Nn = e.enum([
|
|
|
2437
2437
|
friendly_name: e.string().optional(),
|
|
2438
2438
|
confirmed: e.boolean().default(!1)
|
|
2439
2439
|
});
|
|
2440
|
-
function
|
|
2440
|
+
function P(t, n) {
|
|
2441
2441
|
t.type === "phone" && !t.phone_number && n.addIssue({
|
|
2442
2442
|
code: e.ZodIssueCode.custom,
|
|
2443
2443
|
message: "phone_number is required when type is 'phone'",
|
|
@@ -2460,71 +2460,76 @@ function R(t, n) {
|
|
|
2460
2460
|
path: ["public_key"]
|
|
2461
2461
|
}));
|
|
2462
2462
|
}
|
|
2463
|
-
|
|
2463
|
+
N.superRefine(P), N.extend({
|
|
2464
2464
|
id: e.string(),
|
|
2465
2465
|
created_at: e.string(),
|
|
2466
2466
|
updated_at: e.string()
|
|
2467
|
-
}).superRefine(
|
|
2467
|
+
}).superRefine(P);
|
|
2468
2468
|
//#endregion
|
|
2469
2469
|
//#region src/data-plane/cache.ts
|
|
2470
|
-
var
|
|
2471
|
-
function
|
|
2470
|
+
var Rn = 1e4;
|
|
2471
|
+
function F(e, t, n) {
|
|
2472
2472
|
let r = typeof t == "number" ? {
|
|
2473
2473
|
freshTtlMs: t,
|
|
2474
2474
|
maxEntries: n
|
|
2475
|
-
} : t, i = r.freshTtlMs, a = r.staleTtlMs ?? 0, o = r.negativeTtlMs ?? i,
|
|
2476
|
-
function
|
|
2477
|
-
for (let [t, n] of
|
|
2478
|
-
for (;
|
|
2479
|
-
let e =
|
|
2475
|
+
} : t, i = r.freshTtlMs, a = r.staleTtlMs ?? 0, o = r.staleIfErrorTtlMs ?? 0, s = r.negativeTtlMs ?? i, c = r.maxEntries ?? Rn, l = r.waitUntil, u = /* @__PURE__ */ new Map();
|
|
2476
|
+
function d(e) {
|
|
2477
|
+
for (let [t, n] of u) n.stale_if_error_until <= e && n.stale_until <= e && !n.refreshing && u.delete(t);
|
|
2478
|
+
for (; u.size >= c;) {
|
|
2479
|
+
let e = u.keys().next().value;
|
|
2480
2480
|
if (e === void 0) break;
|
|
2481
|
-
|
|
2481
|
+
u.delete(e);
|
|
2482
2482
|
}
|
|
2483
2483
|
}
|
|
2484
|
-
function
|
|
2485
|
-
let r = n + (t === null ?
|
|
2484
|
+
function f(e, t, n) {
|
|
2485
|
+
let r = n + (t === null ? s : i), c = t === null ? r : r + a, l = {
|
|
2486
2486
|
value: t,
|
|
2487
2487
|
fresh_until: r,
|
|
2488
|
-
stale_until:
|
|
2488
|
+
stale_until: c,
|
|
2489
|
+
stale_if_error_until: t === null ? c : c + o
|
|
2489
2490
|
};
|
|
2490
|
-
return
|
|
2491
|
+
return u.delete(e), d(n), u.set(e, l), l;
|
|
2491
2492
|
}
|
|
2492
|
-
function
|
|
2493
|
-
let n =
|
|
2493
|
+
function p(t) {
|
|
2494
|
+
let n = u.get(t);
|
|
2494
2495
|
if (n?.refreshing) return n.refreshing;
|
|
2495
2496
|
let r = n ?? {
|
|
2496
2497
|
value: null,
|
|
2497
2498
|
fresh_until: 0,
|
|
2498
|
-
stale_until: 0
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
let i = (async () => {
|
|
2499
|
+
stale_until: 0,
|
|
2500
|
+
stale_if_error_until: 0
|
|
2501
|
+
}, i = (async () => {
|
|
2502
2502
|
try {
|
|
2503
2503
|
let n = await e.resolveHost(t);
|
|
2504
|
-
return
|
|
2504
|
+
return f(t, n, Date.now()), n;
|
|
2505
2505
|
} catch (e) {
|
|
2506
|
-
let n =
|
|
2507
|
-
throw n && (n.refreshing = void 0, n.
|
|
2506
|
+
let n = u.get(t);
|
|
2507
|
+
throw n && (n.refreshing = void 0, n.stale_if_error_until <= Date.now() && u.delete(t)), e;
|
|
2508
2508
|
}
|
|
2509
2509
|
})();
|
|
2510
|
-
return r.refreshing = i, i;
|
|
2510
|
+
return r.refreshing = i, n || (d(Date.now()), u.set(t, r)), i;
|
|
2511
2511
|
}
|
|
2512
2512
|
return { async resolveHost(e) {
|
|
2513
|
-
let t = Date.now(), n =
|
|
2514
|
-
if (n && n.fresh_until > t) return
|
|
2513
|
+
let t = Date.now(), n = u.get(e);
|
|
2514
|
+
if (n && n.fresh_until > t) return u.delete(e), u.set(e, n), n.value;
|
|
2515
2515
|
if (n && n.stale_until > t) {
|
|
2516
|
-
if (
|
|
2517
|
-
let t =
|
|
2518
|
-
|
|
2516
|
+
if (u.delete(e), u.set(e, n), !n.refreshing) {
|
|
2517
|
+
let t = p(e).catch(() => void 0);
|
|
2518
|
+
l && l(t);
|
|
2519
2519
|
}
|
|
2520
2520
|
return n.value;
|
|
2521
2521
|
}
|
|
2522
|
-
|
|
2522
|
+
try {
|
|
2523
|
+
return await p(e);
|
|
2524
|
+
} catch (e) {
|
|
2525
|
+
if (n && n.stale_if_error_until > t) return n.value;
|
|
2526
|
+
throw e;
|
|
2527
|
+
}
|
|
2523
2528
|
} };
|
|
2524
2529
|
}
|
|
2525
2530
|
//#endregion
|
|
2526
2531
|
//#region src/data-plane/registry.ts
|
|
2527
|
-
var
|
|
2532
|
+
var I = class {
|
|
2528
2533
|
definitions = /* @__PURE__ */ new Map();
|
|
2529
2534
|
bindings;
|
|
2530
2535
|
constructor(e = {}) {
|
|
@@ -2544,38 +2549,38 @@ var B = class {
|
|
|
2544
2549
|
return n.build(r.data, { bindings: this.bindings });
|
|
2545
2550
|
}
|
|
2546
2551
|
};
|
|
2547
|
-
function
|
|
2552
|
+
function L(e) {
|
|
2548
2553
|
return e;
|
|
2549
2554
|
}
|
|
2550
2555
|
//#endregion
|
|
2551
2556
|
//#region src/data-plane/handlers/util.ts
|
|
2552
|
-
var
|
|
2553
|
-
function
|
|
2554
|
-
e.set(
|
|
2557
|
+
var R = "__authhero_proxy_request__", z = "__authhero_proxy_tenant_id__", B = "__authhero_proxy_custom_domain_id__", V = "__authhero_proxy_domain__", H = "x-authhero-proxy-mutability-probe";
|
|
2558
|
+
function zn(e, t) {
|
|
2559
|
+
e.set(R, t);
|
|
2555
2560
|
}
|
|
2556
|
-
function
|
|
2557
|
-
return e.get(
|
|
2561
|
+
function U(e) {
|
|
2562
|
+
return e.get(R) ?? e.req.raw;
|
|
2558
2563
|
}
|
|
2559
|
-
function
|
|
2560
|
-
e.set(
|
|
2564
|
+
function Bn(e, t) {
|
|
2565
|
+
e.set(z, t.tenant_id), e.set(B, t.custom_domain_id), e.set(V, t.domain);
|
|
2561
2566
|
}
|
|
2562
|
-
function
|
|
2563
|
-
return e.get(
|
|
2567
|
+
function Vn(e) {
|
|
2568
|
+
return e.get(z);
|
|
2564
2569
|
}
|
|
2565
|
-
function
|
|
2566
|
-
return e.get(
|
|
2570
|
+
function Hn(e) {
|
|
2571
|
+
return e.get(B);
|
|
2567
2572
|
}
|
|
2568
|
-
function
|
|
2569
|
-
return e.get(
|
|
2573
|
+
function Un(e) {
|
|
2574
|
+
return e.get(V);
|
|
2570
2575
|
}
|
|
2571
|
-
function
|
|
2572
|
-
let n =
|
|
2573
|
-
t(r),
|
|
2576
|
+
function W(e, t) {
|
|
2577
|
+
let n = U(e), r = new Headers(n.headers);
|
|
2578
|
+
t(r), zn(e, new Request(n, { headers: r }));
|
|
2574
2579
|
}
|
|
2575
|
-
function
|
|
2580
|
+
function G(e) {
|
|
2576
2581
|
let t = e.res;
|
|
2577
2582
|
try {
|
|
2578
|
-
t.headers.append(
|
|
2583
|
+
t.headers.append(H, "1"), t.headers.delete(H);
|
|
2579
2584
|
return;
|
|
2580
2585
|
} catch {
|
|
2581
2586
|
e.res = new Response(t.body, {
|
|
@@ -2587,7 +2592,7 @@ function J(e) {
|
|
|
2587
2592
|
}
|
|
2588
2593
|
//#endregion
|
|
2589
2594
|
//#region src/data-plane/handlers/cors.ts
|
|
2590
|
-
var
|
|
2595
|
+
var Wn = e.object({
|
|
2591
2596
|
origins: e.array(e.string()).optional(),
|
|
2592
2597
|
allow_credentials: e.boolean().optional(),
|
|
2593
2598
|
allow_headers: e.array(e.string()).optional(),
|
|
@@ -2595,44 +2600,44 @@ var Vn = e.object({
|
|
|
2595
2600
|
expose_headers: e.array(e.string()).optional(),
|
|
2596
2601
|
max_age: e.number().int().optional()
|
|
2597
2602
|
}).refine((e) => !(e.allow_credentials && e.origins?.includes("*")), { message: "Cannot use wildcard origin (*) with allow_credentials" });
|
|
2598
|
-
function
|
|
2603
|
+
function K(e, t) {
|
|
2599
2604
|
let n = new Headers(), r = e.origins ?? ["*"], i = r.includes("*");
|
|
2600
2605
|
return i && !e.allow_credentials ? n.set("Access-Control-Allow-Origin", "*") : t && (i || r.includes(t)) && (n.set("Access-Control-Allow-Origin", t), n.append("Vary", "Origin")), e.allow_credentials && n.set("Access-Control-Allow-Credentials", "true"), e.allow_methods?.length && n.set("Access-Control-Allow-Methods", e.allow_methods.join(", ")), e.allow_headers?.length && n.set("Access-Control-Allow-Headers", e.allow_headers.join(", ")), e.expose_headers?.length && n.set("Access-Control-Expose-Headers", e.expose_headers.join(", ")), e.max_age !== void 0 && n.set("Access-Control-Max-Age", String(e.max_age)), n;
|
|
2601
2606
|
}
|
|
2602
|
-
var
|
|
2607
|
+
var Gn = L({
|
|
2603
2608
|
type: "cors",
|
|
2604
|
-
optionsSchema:
|
|
2609
|
+
optionsSchema: Wn,
|
|
2605
2610
|
build(e) {
|
|
2606
2611
|
return async (t, n) => {
|
|
2607
2612
|
let r = t.req.header("origin") ?? null;
|
|
2608
2613
|
if (t.req.method === "OPTIONS" && r !== null && t.req.header("access-control-request-method") !== void 0) {
|
|
2609
|
-
let t =
|
|
2614
|
+
let t = K(e, r);
|
|
2610
2615
|
return new Response(null, {
|
|
2611
2616
|
status: 204,
|
|
2612
2617
|
headers: t
|
|
2613
2618
|
});
|
|
2614
2619
|
}
|
|
2615
2620
|
await n();
|
|
2616
|
-
let i =
|
|
2617
|
-
|
|
2621
|
+
let i = K(e, r);
|
|
2622
|
+
G(t), i.forEach((e, n) => {
|
|
2618
2623
|
n.toLowerCase() === "vary" ? t.res.headers.append(n, e) : t.res.headers.set(n, e);
|
|
2619
2624
|
});
|
|
2620
2625
|
};
|
|
2621
2626
|
}
|
|
2622
|
-
}),
|
|
2627
|
+
}), Kn = e.object({
|
|
2623
2628
|
username: e.string(),
|
|
2624
2629
|
password: e.string(),
|
|
2625
2630
|
realm: e.string().optional()
|
|
2626
2631
|
});
|
|
2627
|
-
function
|
|
2632
|
+
function qn(e, t) {
|
|
2628
2633
|
let n = `${e}:${t}`;
|
|
2629
2634
|
return typeof btoa == "function" ? btoa(n) : Buffer.from(n, "utf-8").toString("base64");
|
|
2630
2635
|
}
|
|
2631
|
-
var
|
|
2636
|
+
var Jn = L({
|
|
2632
2637
|
type: "basic_auth",
|
|
2633
|
-
optionsSchema:
|
|
2638
|
+
optionsSchema: Kn,
|
|
2634
2639
|
build(e) {
|
|
2635
|
-
let t =
|
|
2640
|
+
let t = qn(e.username, e.password), n = (e.realm ?? "Restricted").replace(/["\\\r\n]/g, "");
|
|
2636
2641
|
return async (e, r) => {
|
|
2637
2642
|
let i = e.req.header("authorization");
|
|
2638
2643
|
if (i) {
|
|
@@ -2648,7 +2653,7 @@ var Kn = V({
|
|
|
2648
2653
|
});
|
|
2649
2654
|
};
|
|
2650
2655
|
}
|
|
2651
|
-
}),
|
|
2656
|
+
}), Yn = L({
|
|
2652
2657
|
type: "headers",
|
|
2653
2658
|
optionsSchema: e.object({
|
|
2654
2659
|
request: e.record(e.string(), e.string()).optional(),
|
|
@@ -2658,23 +2663,23 @@ var Kn = V({
|
|
|
2658
2663
|
}),
|
|
2659
2664
|
build(e) {
|
|
2660
2665
|
return async (t, n) => {
|
|
2661
|
-
if ((e.request || e.remove_request) &&
|
|
2666
|
+
if ((e.request || e.remove_request) && W(t, (t) => {
|
|
2662
2667
|
if (e.remove_request?.forEach((e) => t.delete(e)), e.request) for (let [n, r] of Object.entries(e.request)) t.set(n, r);
|
|
2663
|
-
}), await n(), (e.response || e.remove_response) && (
|
|
2668
|
+
}), await n(), (e.response || e.remove_response) && (G(t), e.remove_response?.forEach((e) => t.res.headers.delete(e)), e.response)) for (let [n, r] of Object.entries(e.response)) t.res.headers.set(n, r);
|
|
2664
2669
|
};
|
|
2665
2670
|
}
|
|
2666
|
-
}),
|
|
2671
|
+
}), Xn = L({
|
|
2667
2672
|
type: "cache",
|
|
2668
2673
|
optionsSchema: e.object({ ttl_seconds: e.number().int().positive() }),
|
|
2669
2674
|
build(e) {
|
|
2670
2675
|
return async (t, n) => {
|
|
2671
2676
|
if (await n(), !t.res.headers.has("Cache-Control")) {
|
|
2672
2677
|
let n = t.res.headers.has("set-cookie") ? "private" : "public";
|
|
2673
|
-
|
|
2678
|
+
G(t), t.res.headers.set("Cache-Control", `${n}, max-age=${e.ttl_seconds}`);
|
|
2674
2679
|
}
|
|
2675
2680
|
};
|
|
2676
2681
|
}
|
|
2677
|
-
}),
|
|
2682
|
+
}), Zn = L({
|
|
2678
2683
|
type: "forwarded_headers",
|
|
2679
2684
|
optionsSchema: e.object({
|
|
2680
2685
|
client_ip_header: e.string().default("cf-connecting-ip"),
|
|
@@ -2684,40 +2689,40 @@ var Kn = V({
|
|
|
2684
2689
|
build(e) {
|
|
2685
2690
|
return async (t, n) => {
|
|
2686
2691
|
let r = new URL(t.req.url);
|
|
2687
|
-
|
|
2692
|
+
W(t, (n) => {
|
|
2688
2693
|
n.set("x-forwarded-host", r.host), n.set("x-forwarded-proto", r.protocol.replace(":", "")), e.set_x_original_url && n.set("x-original-url", t.req.url);
|
|
2689
2694
|
let i = n.get(e.client_ip_header), a = (n.get("x-forwarded-for") ?? "").split(",").map((e) => e.trim()).filter(Boolean), o = i ?? a[a.length - 1] ?? "127.0.0.1", s = a.length === 0 || a[a.length - 1] !== o, c = a.length ? s ? `${a.join(", ")}, ${o}` : a.join(", ") : o;
|
|
2690
2695
|
n.set("x-forwarded-for", c), e.set_x_real_ip && n.set("x-real-ip", o);
|
|
2691
2696
|
}), await n();
|
|
2692
2697
|
};
|
|
2693
2698
|
}
|
|
2694
|
-
}),
|
|
2695
|
-
function
|
|
2699
|
+
}), Qn = e.object({ upstream_host: e.string().optional() });
|
|
2700
|
+
function $n(e) {
|
|
2696
2701
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2697
2702
|
}
|
|
2698
|
-
function
|
|
2703
|
+
function er(e) {
|
|
2699
2704
|
if (typeof e.getSetCookie == "function") return e.getSetCookie();
|
|
2700
2705
|
let t = [];
|
|
2701
2706
|
return e.forEach((e, n) => {
|
|
2702
2707
|
n.toLowerCase() === "set-cookie" && t.push(e);
|
|
2703
2708
|
}), t;
|
|
2704
2709
|
}
|
|
2705
|
-
var
|
|
2710
|
+
var tr = L({
|
|
2706
2711
|
type: "rewrite_cookies",
|
|
2707
|
-
optionsSchema:
|
|
2712
|
+
optionsSchema: Qn,
|
|
2708
2713
|
build(e) {
|
|
2709
2714
|
return async (t, n) => {
|
|
2710
2715
|
await n();
|
|
2711
2716
|
let r = new URL(t.req.url).hostname, i = e.upstream_host ?? t.get("__proxy_upstream_host__");
|
|
2712
2717
|
if (!i) return;
|
|
2713
|
-
let a =
|
|
2718
|
+
let a = er(t.res.headers);
|
|
2714
2719
|
if (a.length === 0) return;
|
|
2715
|
-
let o =
|
|
2716
|
-
|
|
2720
|
+
let o = $n(i), s = RegExp(`(?:^|;\\s*)Domain=\\.?${o}(?=;|$)`, "i");
|
|
2721
|
+
G(t), t.res.headers.delete("set-cookie");
|
|
2717
2722
|
for (let e of a) t.res.headers.append("set-cookie", e.replace(s, `Domain=${r}`));
|
|
2718
2723
|
};
|
|
2719
2724
|
}
|
|
2720
|
-
}),
|
|
2725
|
+
}), nr = L({
|
|
2721
2726
|
type: "rewrite_location",
|
|
2722
2727
|
optionsSchema: e.object({ upstream_origin: e.string().optional() }),
|
|
2723
2728
|
build(e) {
|
|
@@ -2737,10 +2742,33 @@ var $n = V({
|
|
|
2737
2742
|
}
|
|
2738
2743
|
if (o.origin !== a) return;
|
|
2739
2744
|
let s = new URL(t.req.url), c = `${`${s.protocol}//${s.host}`}${o.pathname}${o.search}${o.hash}`;
|
|
2740
|
-
|
|
2745
|
+
G(t), t.res.headers.set("location", c);
|
|
2741
2746
|
};
|
|
2742
2747
|
}
|
|
2743
|
-
}),
|
|
2748
|
+
}), rr = class extends Error {
|
|
2749
|
+
ms;
|
|
2750
|
+
constructor(e, t) {
|
|
2751
|
+
super(`${t ?? "Operation"} timed out after ${e}ms`), this.name = "TimeoutError", this.ms = e;
|
|
2752
|
+
}
|
|
2753
|
+
};
|
|
2754
|
+
function q(e) {
|
|
2755
|
+
return e instanceof rr ? !0 : e instanceof Error ? e.name === "AbortError" || e.name === "TimeoutError" : !1;
|
|
2756
|
+
}
|
|
2757
|
+
function J(e, t) {
|
|
2758
|
+
let n = new AbortController(), r = setTimeout(() => n.abort(), e);
|
|
2759
|
+
return t(n.signal).finally(() => clearTimeout(r));
|
|
2760
|
+
}
|
|
2761
|
+
function Y(e, t, n) {
|
|
2762
|
+
let r, i = new Promise((e, i) => {
|
|
2763
|
+
r = setTimeout(() => i(new rr(t, n)), t);
|
|
2764
|
+
});
|
|
2765
|
+
return Promise.race([e, i]).finally(() => {
|
|
2766
|
+
r && clearTimeout(r);
|
|
2767
|
+
});
|
|
2768
|
+
}
|
|
2769
|
+
//#endregion
|
|
2770
|
+
//#region src/data-plane/handlers/http.ts
|
|
2771
|
+
var ir = new Set([
|
|
2744
2772
|
"connection",
|
|
2745
2773
|
"keep-alive",
|
|
2746
2774
|
"proxy-authenticate",
|
|
@@ -2749,24 +2777,24 @@ var $n = V({
|
|
|
2749
2777
|
"trailers",
|
|
2750
2778
|
"transfer-encoding",
|
|
2751
2779
|
"upgrade"
|
|
2752
|
-
]),
|
|
2780
|
+
]), ar = 3e4, or = e.object({
|
|
2753
2781
|
upstream_url: e.string(),
|
|
2754
2782
|
preserve_host: e.boolean().default(!1),
|
|
2755
2783
|
timeout_ms: e.number().int().positive().optional()
|
|
2756
2784
|
});
|
|
2757
|
-
function
|
|
2785
|
+
function sr(e, t) {
|
|
2758
2786
|
return e === "" || e === "/" ? t : `${e.endsWith("/") ? e.slice(0, -1) : e}${t.startsWith("/") ? t : `/${t}`}`;
|
|
2759
2787
|
}
|
|
2760
|
-
function
|
|
2788
|
+
function cr(e) {
|
|
2761
2789
|
return e !== "GET" && e !== "HEAD";
|
|
2762
2790
|
}
|
|
2763
|
-
function
|
|
2791
|
+
function lr(e, t) {
|
|
2764
2792
|
let n = new URL(t.url), r = new URL(e.upstream_url);
|
|
2765
|
-
r.pathname =
|
|
2793
|
+
r.pathname = sr(r.pathname, n.pathname), r.search = n.search;
|
|
2766
2794
|
let i = new Headers(t.headers);
|
|
2767
|
-
for (let e of
|
|
2795
|
+
for (let e of ir) i.delete(e);
|
|
2768
2796
|
e.preserve_host || i.set("host", r.host), i.has("x-forwarded-host") || i.set("x-forwarded-host", n.host), i.has("x-forwarded-proto") || i.set("x-forwarded-proto", n.protocol.replace(":", ""));
|
|
2769
|
-
let a =
|
|
2797
|
+
let a = cr(t.method) ? t.body : void 0, o = {
|
|
2770
2798
|
method: t.method,
|
|
2771
2799
|
headers: i,
|
|
2772
2800
|
body: a,
|
|
@@ -2777,93 +2805,107 @@ function or(e, t) {
|
|
|
2777
2805
|
init: o
|
|
2778
2806
|
};
|
|
2779
2807
|
}
|
|
2780
|
-
var
|
|
2808
|
+
var ur = L({
|
|
2781
2809
|
type: "http",
|
|
2782
|
-
optionsSchema:
|
|
2810
|
+
optionsSchema: or,
|
|
2783
2811
|
build(e) {
|
|
2784
|
-
let t = e.timeout_ms ??
|
|
2812
|
+
let t = e.timeout_ms ?? ar;
|
|
2785
2813
|
return async (n) => {
|
|
2786
|
-
let { target: r, init: i } =
|
|
2814
|
+
let { target: r, init: i } = lr(e, U(n));
|
|
2787
2815
|
n.set("__proxy_upstream_host__", r.hostname), n.set("__proxy_upstream_origin__", `${r.protocol}//${r.host}`);
|
|
2788
|
-
let a = new AbortController(), o = setTimeout(() => a.abort(), t);
|
|
2789
2816
|
try {
|
|
2790
|
-
return await fetch(r.toString(), {
|
|
2817
|
+
return await J(t, (e) => fetch(r.toString(), {
|
|
2791
2818
|
...i,
|
|
2792
|
-
signal:
|
|
2793
|
-
});
|
|
2819
|
+
signal: e
|
|
2820
|
+
}));
|
|
2794
2821
|
} catch (e) {
|
|
2795
|
-
|
|
2796
|
-
throw e;
|
|
2797
|
-
} finally {
|
|
2798
|
-
clearTimeout(o);
|
|
2822
|
+
return q(e) ? n.text("Upstream timeout", 504, { "x-authhero-proxy-error": "http_timeout" }) : n.text("Bad gateway", 502, { "x-authhero-proxy-error": "http_failed" });
|
|
2799
2823
|
}
|
|
2800
2824
|
};
|
|
2801
2825
|
}
|
|
2802
|
-
}),
|
|
2826
|
+
}), dr = 3e4, fr = e.object({
|
|
2803
2827
|
binding: e.string(),
|
|
2804
2828
|
upstream_url: e.string().optional(),
|
|
2805
|
-
preserve_host: e.boolean().default(!0)
|
|
2829
|
+
preserve_host: e.boolean().default(!0),
|
|
2830
|
+
timeout_ms: e.number().int().positive().optional()
|
|
2806
2831
|
});
|
|
2807
|
-
function
|
|
2832
|
+
function pr(e) {
|
|
2808
2833
|
return typeof e == "object" && !!e && typeof e.fetch == "function";
|
|
2809
2834
|
}
|
|
2810
|
-
var
|
|
2835
|
+
var mr = L({
|
|
2811
2836
|
type: "service_binding",
|
|
2812
|
-
optionsSchema:
|
|
2837
|
+
optionsSchema: fr,
|
|
2813
2838
|
build(e, t) {
|
|
2814
2839
|
let n = t.bindings[e.binding];
|
|
2815
|
-
if (!
|
|
2816
|
-
let r = e.upstream_url ?? `https://${e.binding}.binding.invalid
|
|
2840
|
+
if (!pr(n)) throw Error(`Service binding "${e.binding}" is not configured or is not a Fetcher`);
|
|
2841
|
+
let r = e.upstream_url ?? `https://${e.binding}.binding.invalid/`, i = e.timeout_ms ?? dr;
|
|
2817
2842
|
return async (t) => {
|
|
2818
|
-
let
|
|
2843
|
+
let a = U(t), { target: o, init: s } = lr({
|
|
2819
2844
|
upstream_url: r,
|
|
2820
2845
|
preserve_host: e.preserve_host
|
|
2821
|
-
},
|
|
2822
|
-
|
|
2846
|
+
}, a);
|
|
2847
|
+
t.set("__proxy_upstream_host__", o.hostname), t.set("__proxy_upstream_origin__", `${o.protocol}//${o.host}`);
|
|
2848
|
+
try {
|
|
2849
|
+
return await J(i, async (e) => n.fetch(new Request(o.toString(), {
|
|
2850
|
+
...s,
|
|
2851
|
+
signal: e
|
|
2852
|
+
})));
|
|
2853
|
+
} catch (e) {
|
|
2854
|
+
return q(e) ? t.text(`service_binding timed out after ${i}ms`, 504, { "x-authhero-proxy-error": "service_binding_timeout" }) : t.text("Bad gateway", 502, { "x-authhero-proxy-error": "service_binding_failed" });
|
|
2855
|
+
}
|
|
2823
2856
|
};
|
|
2824
2857
|
}
|
|
2825
|
-
}),
|
|
2858
|
+
}), hr = 3e4, gr = e.object({
|
|
2826
2859
|
binding: e.string(),
|
|
2827
2860
|
script_name: e.string(),
|
|
2828
2861
|
cpu_ms: e.number().int().positive().optional(),
|
|
2829
|
-
subrequests: e.number().int().positive().optional()
|
|
2862
|
+
subrequests: e.number().int().positive().optional(),
|
|
2863
|
+
timeout_ms: e.number().int().positive().optional()
|
|
2830
2864
|
});
|
|
2831
|
-
function
|
|
2865
|
+
function _r(e) {
|
|
2832
2866
|
return typeof e == "object" && !!e && typeof e.get == "function";
|
|
2833
2867
|
}
|
|
2834
2868
|
var X = /\{(tenant_id|custom_domain_id|domain|host)\}/g;
|
|
2835
|
-
function
|
|
2869
|
+
function vr(e) {
|
|
2836
2870
|
return X.lastIndex = 0, X.test(e);
|
|
2837
2871
|
}
|
|
2838
|
-
var
|
|
2872
|
+
var yr = L({
|
|
2839
2873
|
type: "dispatch_namespace",
|
|
2840
|
-
optionsSchema:
|
|
2874
|
+
optionsSchema: gr,
|
|
2841
2875
|
build(e, t) {
|
|
2842
2876
|
let n = t.bindings[e.binding];
|
|
2843
|
-
if (!
|
|
2844
|
-
let r =
|
|
2877
|
+
if (!_r(n)) throw Error(`Dispatch namespace binding "${e.binding}" is not configured or does not expose .get()`);
|
|
2878
|
+
let r = vr(e.script_name), i = e.timeout_ms ?? hr, a = e.cpu_ms || e.subrequests ? { limits: {
|
|
2845
2879
|
...e.cpu_ms ? { cpuMs: e.cpu_ms } : {},
|
|
2846
2880
|
...e.subrequests ? { subrequests: e.subrequests } : {}
|
|
2847
2881
|
} } : void 0;
|
|
2848
2882
|
return async (t) => {
|
|
2849
|
-
let
|
|
2883
|
+
let o = e.script_name;
|
|
2850
2884
|
if (r) {
|
|
2851
|
-
let n =
|
|
2852
|
-
if (
|
|
2885
|
+
let n = Vn(t), r = Hn(t), i = Un(t), a = t.req.header("host") ?? t.req.header("x-forwarded-host") ?? "";
|
|
2886
|
+
if (o = o.replace(X, (e, t) => {
|
|
2853
2887
|
switch (t) {
|
|
2854
2888
|
case "tenant_id": return n ?? "";
|
|
2855
2889
|
case "custom_domain_id": return r ?? "";
|
|
2856
2890
|
case "domain": return i ?? "";
|
|
2857
|
-
case "host": return
|
|
2891
|
+
case "host": return a;
|
|
2858
2892
|
default: return "";
|
|
2859
2893
|
}
|
|
2860
|
-
}),
|
|
2894
|
+
}), o.includes("{") || o === "") return t.text(`dispatch_namespace: could not resolve script name from template "${e.script_name}"`, 500);
|
|
2895
|
+
}
|
|
2896
|
+
let s = U(t);
|
|
2897
|
+
try {
|
|
2898
|
+
let e = n.get(o, void 0, a);
|
|
2899
|
+
return await J(i, async (t) => {
|
|
2900
|
+
let n = new Request(s, { signal: t });
|
|
2901
|
+
return e.fetch(n);
|
|
2902
|
+
});
|
|
2903
|
+
} catch (e) {
|
|
2904
|
+
return q(e) ? t.text(`dispatch_namespace timed out after ${i}ms`, 504, { "x-authhero-proxy-error": "dispatch_namespace_timeout" }) : t.text("Bad gateway", 502, { "x-authhero-proxy-error": "dispatch_namespace_failed" });
|
|
2861
2905
|
}
|
|
2862
|
-
let o = n.get(a, void 0, i), s = K(t);
|
|
2863
|
-
return o.fetch(s);
|
|
2864
2906
|
};
|
|
2865
2907
|
}
|
|
2866
|
-
}),
|
|
2908
|
+
}), br = L({
|
|
2867
2909
|
type: "redirect",
|
|
2868
2910
|
optionsSchema: e.object({
|
|
2869
2911
|
upstream_url: e.string().refine((e) => {
|
|
@@ -2892,7 +2934,7 @@ var pr = V({
|
|
|
2892
2934
|
});
|
|
2893
2935
|
};
|
|
2894
2936
|
}
|
|
2895
|
-
}),
|
|
2937
|
+
}), xr = L({
|
|
2896
2938
|
type: "static",
|
|
2897
2939
|
optionsSchema: e.object({
|
|
2898
2940
|
status: e.number().int().default(200),
|
|
@@ -2912,15 +2954,15 @@ var pr = V({
|
|
|
2912
2954
|
});
|
|
2913
2955
|
//#endregion
|
|
2914
2956
|
//#region src/data-plane/handlers/index.ts
|
|
2915
|
-
function
|
|
2916
|
-
e.add(
|
|
2957
|
+
function Sr(e) {
|
|
2958
|
+
e.add(Gn).add(Jn).add(Yn).add(Xn).add(Zn).add(tr).add(nr).add(ur).add(mr).add(yr).add(br).add(xr);
|
|
2917
2959
|
}
|
|
2918
2960
|
//#endregion
|
|
2919
2961
|
//#region src/data-plane/matcher.ts
|
|
2920
|
-
function
|
|
2962
|
+
function Z(e) {
|
|
2921
2963
|
return [...e].sort((e, t) => e.priority === t.priority ? e.created_at.localeCompare(t.created_at) : e.priority - t.priority);
|
|
2922
2964
|
}
|
|
2923
|
-
function
|
|
2965
|
+
function Cr(e, t) {
|
|
2924
2966
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
2925
2967
|
if (n === r) return !0;
|
|
2926
2968
|
if (n.startsWith("*.")) {
|
|
@@ -2929,13 +2971,13 @@ function vr(e, t) {
|
|
|
2929
2971
|
}
|
|
2930
2972
|
return !1;
|
|
2931
2973
|
}
|
|
2932
|
-
function
|
|
2933
|
-
return !e || e.length === 0 ? !0 : e.some((e) =>
|
|
2974
|
+
function wr(e, t) {
|
|
2975
|
+
return !e || e.length === 0 ? !0 : e.some((e) => Cr(e, t));
|
|
2934
2976
|
}
|
|
2935
|
-
function
|
|
2977
|
+
function Tr(e) {
|
|
2936
2978
|
let t = (e.headers ? Object.entries(e.headers) : []).map(([e, t]) => [e.toLowerCase(), new RegExp(t)]), n = (e.query ? Object.entries(e.query) : []).map(([e, t]) => [e, new RegExp(t)]), r = e.hosts;
|
|
2937
2979
|
return async (e, i) => {
|
|
2938
|
-
if (r && !
|
|
2980
|
+
if (r && !wr(r, e.req.header("host") ?? "")) return new Response("No matching route", { status: 404 });
|
|
2939
2981
|
for (let [n, r] of t) {
|
|
2940
2982
|
let t = e.req.header(n);
|
|
2941
2983
|
if (t === void 0 || !r.test(t)) return new Response("No matching route", { status: 404 });
|
|
@@ -2952,7 +2994,7 @@ function br(e) {
|
|
|
2952
2994
|
}
|
|
2953
2995
|
//#endregion
|
|
2954
2996
|
//#region src/data-plane/compile.ts
|
|
2955
|
-
var
|
|
2997
|
+
var Er = [
|
|
2956
2998
|
"GET",
|
|
2957
2999
|
"POST",
|
|
2958
3000
|
"PUT",
|
|
@@ -2961,130 +3003,168 @@ var xr = [
|
|
|
2961
3003
|
"OPTIONS",
|
|
2962
3004
|
"HEAD"
|
|
2963
3005
|
];
|
|
2964
|
-
function
|
|
3006
|
+
function Dr(e, n, r) {
|
|
2965
3007
|
let i = new t();
|
|
2966
3008
|
r && i.use("*", async (e, t) => {
|
|
2967
|
-
|
|
3009
|
+
Bn(e, r), await t();
|
|
2968
3010
|
});
|
|
2969
|
-
let a =
|
|
3011
|
+
let a = Z(e);
|
|
2970
3012
|
for (let e of a) {
|
|
2971
3013
|
let t = [];
|
|
2972
|
-
t.push(
|
|
3014
|
+
t.push(Tr(e.match));
|
|
2973
3015
|
for (let r of e.handlers) t.push(n.build(r.type, r.options));
|
|
2974
|
-
let r = e.match.methods?.length ? e.match.methods.map((e) => e.toUpperCase()) :
|
|
3016
|
+
let r = e.match.methods?.length ? e.match.methods.map((e) => e.toUpperCase()) : Er, a = e.match.path || "/*";
|
|
2975
3017
|
i.on(r, [a], ...t);
|
|
2976
3018
|
}
|
|
2977
|
-
return i.all("*", (e) => e.text("No matching route", 404)), i
|
|
3019
|
+
return i.all("*", (e) => e.text("No matching route", 404)), i.onError((e, t) => {
|
|
3020
|
+
let n = q(e);
|
|
3021
|
+
return t.text(n ? "Upstream timeout" : "Bad gateway", n ? 504 : 502, { "x-authhero-proxy-error": n ? "handler_timeout" : "handler_failed" });
|
|
3022
|
+
}), i;
|
|
2978
3023
|
}
|
|
2979
3024
|
//#endregion
|
|
2980
3025
|
//#region src/data-plane/router.ts
|
|
2981
|
-
|
|
2982
|
-
|
|
3026
|
+
var Or = 5e3;
|
|
3027
|
+
function kr(e) {
|
|
3028
|
+
return e.resolver ? e.resolver : e.cache ? F(e.data, e.cache) : F(e.data, e.cacheTtlMs ?? 3e4);
|
|
2983
3029
|
}
|
|
2984
|
-
function
|
|
3030
|
+
function Ar(e) {
|
|
2985
3031
|
if (e.registry) return e.registry;
|
|
2986
|
-
let t = new
|
|
2987
|
-
return
|
|
3032
|
+
let t = new I(e.bindings ?? {});
|
|
3033
|
+
return Sr(t), t;
|
|
2988
3034
|
}
|
|
2989
|
-
function
|
|
2990
|
-
let t =
|
|
3035
|
+
function Q(e) {
|
|
3036
|
+
let t = kr(e), n = Ar(e), r = /* @__PURE__ */ new WeakMap(), i = e.resolveHostTimeoutMs ?? Or;
|
|
2991
3037
|
return async (e) => {
|
|
2992
|
-
let
|
|
2993
|
-
if (!
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3038
|
+
let a = e.req.header("host") ?? e.req.header("x-forwarded-host");
|
|
3039
|
+
if (!a) return e.text("Missing host", 400);
|
|
3040
|
+
try {
|
|
3041
|
+
let o = await Y(t.resolveHost(a), i, "resolveHost");
|
|
3042
|
+
if (!o) return e.text("Unknown host", 404);
|
|
3043
|
+
let s = r.get(o);
|
|
3044
|
+
return s || (s = Dr(o.routes, n, {
|
|
3045
|
+
tenant_id: o.tenant_id,
|
|
3046
|
+
custom_domain_id: o.custom_domain_id,
|
|
3047
|
+
domain: o.domain
|
|
3048
|
+
}), r.set(o, s)), await s.fetch(e.req.raw);
|
|
3049
|
+
} catch (t) {
|
|
3050
|
+
return q(t) ? e.text(`Resolve host timed out after ${i}ms`, 504, { "x-authhero-proxy-error": "resolve_host_timeout" }) : e.text("Bad gateway", 502, { "x-authhero-proxy-error": "data_plane_error" });
|
|
3051
|
+
}
|
|
3002
3052
|
};
|
|
3003
3053
|
}
|
|
3004
|
-
function
|
|
3054
|
+
function jr(e) {
|
|
3005
3055
|
let n = new t();
|
|
3006
|
-
return n.all("*",
|
|
3056
|
+
return n.all("*", Q(e)), n;
|
|
3007
3057
|
}
|
|
3008
3058
|
//#endregion
|
|
3009
3059
|
//#region src/app.ts
|
|
3010
|
-
function
|
|
3060
|
+
function Mr(e) {
|
|
3011
3061
|
let n = new t();
|
|
3012
|
-
return n.all("*",
|
|
3062
|
+
return n.all("*", Q({
|
|
3013
3063
|
data: e.data,
|
|
3014
3064
|
cacheTtlMs: e.cacheTtlMs,
|
|
3015
3065
|
cache: e.cache,
|
|
3016
3066
|
resolver: e.resolver,
|
|
3017
3067
|
registry: e.registry,
|
|
3018
|
-
bindings: e.bindings
|
|
3019
|
-
|
|
3068
|
+
bindings: e.bindings,
|
|
3069
|
+
resolveHostTimeoutMs: e.resolveHostTimeoutMs
|
|
3070
|
+
})), n.onError((e, t) => {
|
|
3071
|
+
let n = q(e);
|
|
3072
|
+
return t.text(n ? "Proxy timeout" : "Bad gateway", n ? 504 : 502, { "x-authhero-proxy-error": n ? "proxy_timeout" : "proxy_error" });
|
|
3073
|
+
}), n;
|
|
3020
3074
|
}
|
|
3021
3075
|
//#endregion
|
|
3022
3076
|
//#region src/data-plane/cache-api-cache.ts
|
|
3023
|
-
|
|
3077
|
+
var Nr = 1e3, Pr = 1e3;
|
|
3078
|
+
function Fr(e, t) {
|
|
3024
3079
|
return new Request(`https://proxy-cache.internal/${encodeURIComponent(e)}/hosts/${encodeURIComponent(t.toLowerCase())}`, { method: "GET" });
|
|
3025
3080
|
}
|
|
3026
|
-
function
|
|
3081
|
+
function Ir() {
|
|
3027
3082
|
return globalThis.caches?.default;
|
|
3028
3083
|
}
|
|
3029
|
-
function
|
|
3030
|
-
let t = e.cache ??
|
|
3084
|
+
function Lr(e) {
|
|
3085
|
+
let t = e.cache ?? Ir();
|
|
3031
3086
|
if (!t) return e.upstream;
|
|
3032
|
-
let n = e.namespace ?? "authhero-proxy",
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3087
|
+
let n = t, r = e.namespace ?? "authhero-proxy", i = e.cacheTtlSeconds ?? 60, a = e.negativeCacheTtlSeconds ?? 10, o = e.waitUntil, s = e.cacheReadTimeoutMs ?? Nr, c = e.cacheWriteTimeoutMs ?? Pr;
|
|
3088
|
+
async function l(e) {
|
|
3089
|
+
try {
|
|
3090
|
+
return await Y(Promise.resolve(n.match(e)), s, "cache.match");
|
|
3091
|
+
} catch {
|
|
3092
|
+
return;
|
|
3093
|
+
}
|
|
3094
|
+
}
|
|
3095
|
+
return { async resolveHost(t) {
|
|
3096
|
+
let s = Fr(r, t), u = await l(s);
|
|
3097
|
+
if (u) try {
|
|
3098
|
+
return (await u.json()).value;
|
|
3037
3099
|
} catch {}
|
|
3038
|
-
let
|
|
3100
|
+
let d = await e.upstream.resolveHost(t), f = d === null ? a : i, p = new Response(JSON.stringify({ value: d }), { headers: {
|
|
3039
3101
|
"content-type": "application/json",
|
|
3040
|
-
"cache-control": `public, max-age=${
|
|
3041
|
-
} }),
|
|
3042
|
-
return
|
|
3102
|
+
"cache-control": `public, max-age=${f}`
|
|
3103
|
+
} }), m = Y(Promise.resolve(n.put(s, p)), c, "cache.put").catch(() => void 0);
|
|
3104
|
+
return o ? o(m) : await m, d;
|
|
3043
3105
|
} };
|
|
3044
3106
|
}
|
|
3045
|
-
function
|
|
3046
|
-
return
|
|
3107
|
+
function Rr(e, t) {
|
|
3108
|
+
return Fr(e, t);
|
|
3047
3109
|
}
|
|
3048
3110
|
//#endregion
|
|
3049
3111
|
//#region src/data-plane/cache-adapter-cache.ts
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3112
|
+
var zr = 1e3, Br = 1e3;
|
|
3113
|
+
function Vr(e) {
|
|
3114
|
+
let { upstream: t, cache: n, freshTtlMs: r, staleTtlMs: i = 0, staleIfErrorTtlMs: a = 0, negativeTtlMs: o = r, keyPrefix: s = "authhero-proxy-host", waitUntil: c, cacheReadTimeoutMs: l = zr, cacheWriteTimeoutMs: u = Br } = e, d = /* @__PURE__ */ new Map();
|
|
3115
|
+
function f(e) {
|
|
3116
|
+
return `${s}:${e.toLowerCase()}`;
|
|
3117
|
+
}
|
|
3118
|
+
async function p(e) {
|
|
3119
|
+
try {
|
|
3120
|
+
return await Y(n.get(e), l, "cache.get") ?? null;
|
|
3121
|
+
} catch {
|
|
3122
|
+
return null;
|
|
3123
|
+
}
|
|
3124
|
+
}
|
|
3125
|
+
function m(e, t, r) {
|
|
3126
|
+
let i = Y(Promise.resolve().then(() => n.set(e, t, r)), u, "cache.set").catch(() => void 0);
|
|
3127
|
+
return c ? (c(i), Promise.resolve()) : i;
|
|
3054
3128
|
}
|
|
3055
|
-
async function
|
|
3056
|
-
let
|
|
3057
|
-
if (
|
|
3129
|
+
async function h(e) {
|
|
3130
|
+
let n = d.get(e);
|
|
3131
|
+
if (n) return n;
|
|
3058
3132
|
let s = (async () => {
|
|
3059
3133
|
try {
|
|
3060
|
-
let
|
|
3061
|
-
value:
|
|
3134
|
+
let n = await t.resolveHost(e), s = Date.now(), c = n === null ? o : r, l = n === null ? 0 : i, u = n === null ? 0 : a, d = {
|
|
3135
|
+
value: n,
|
|
3062
3136
|
freshUntilMs: s + c,
|
|
3063
|
-
staleUntilMs: s + c +
|
|
3064
|
-
|
|
3065
|
-
|
|
3137
|
+
staleUntilMs: s + c + l,
|
|
3138
|
+
staleIfErrorUntilMs: s + c + l + u
|
|
3139
|
+
}, p = Math.max(1, Math.ceil((c + l + u) / 1e3));
|
|
3140
|
+
return await m(f(e), d, p), n;
|
|
3066
3141
|
} finally {
|
|
3067
|
-
|
|
3142
|
+
d.delete(e);
|
|
3068
3143
|
}
|
|
3069
3144
|
})();
|
|
3070
|
-
return
|
|
3145
|
+
return d.set(e, s), s;
|
|
3071
3146
|
}
|
|
3072
3147
|
return { async resolveHost(e) {
|
|
3073
|
-
let t =
|
|
3074
|
-
if (
|
|
3075
|
-
if (
|
|
3076
|
-
if (
|
|
3077
|
-
if (!
|
|
3078
|
-
let t =
|
|
3079
|
-
|
|
3148
|
+
let t = await p(f(e)), n = Date.now();
|
|
3149
|
+
if (t && typeof t.freshUntilMs == "number") {
|
|
3150
|
+
if (t.freshUntilMs > n) return t.value;
|
|
3151
|
+
if (t.staleUntilMs > n) {
|
|
3152
|
+
if (!d.has(e)) {
|
|
3153
|
+
let t = h(e).catch(() => void 0);
|
|
3154
|
+
c && c(t);
|
|
3080
3155
|
}
|
|
3081
|
-
return
|
|
3156
|
+
return t.value;
|
|
3082
3157
|
}
|
|
3083
3158
|
}
|
|
3084
|
-
|
|
3159
|
+
try {
|
|
3160
|
+
return await h(e);
|
|
3161
|
+
} catch (e) {
|
|
3162
|
+
if (t && (t.staleIfErrorUntilMs ?? t.staleUntilMs) > n) return t.value;
|
|
3163
|
+
throw e;
|
|
3164
|
+
}
|
|
3085
3165
|
} };
|
|
3086
3166
|
}
|
|
3087
|
-
function
|
|
3167
|
+
function Hr(e, t) {
|
|
3088
3168
|
return `${e}:${t.toLowerCase()}`;
|
|
3089
3169
|
}
|
|
3090
3170
|
//#endregion
|
|
@@ -3092,7 +3172,7 @@ function jr(e, t) {
|
|
|
3092
3172
|
function $() {
|
|
3093
3173
|
throw Error("Static proxy adapter is read-only; configure routes at init time");
|
|
3094
3174
|
}
|
|
3095
|
-
function
|
|
3175
|
+
function Ur(e, t, n, r, i, a) {
|
|
3096
3176
|
return {
|
|
3097
3177
|
id: e.id ?? `${n}:${t}`,
|
|
3098
3178
|
tenant_id: r,
|
|
@@ -3107,10 +3187,10 @@ function Mr(e, t, n, r, i, a) {
|
|
|
3107
3187
|
updated_at: e.updated_at ?? a
|
|
3108
3188
|
};
|
|
3109
3189
|
}
|
|
3110
|
-
function
|
|
3190
|
+
function Wr(e) {
|
|
3111
3191
|
let t = (/* @__PURE__ */ new Date()).toISOString(), n = e.defaultTenantId ?? "static", r = /* @__PURE__ */ new Map();
|
|
3112
3192
|
for (let [i, a] of Object.entries(e.hosts)) {
|
|
3113
|
-
let e = i.toLowerCase(), o = Array.isArray(a) ? { routes: a } : a, s = o.tenant_id ?? n, c = o.custom_domain_id ?? e, l = o.routes.map((n, r) =>
|
|
3193
|
+
let e = i.toLowerCase(), o = Array.isArray(a) ? { routes: a } : a, s = o.tenant_id ?? n, c = o.custom_domain_id ?? e, l = o.routes.map((n, r) => Ur(n, r, e, s, c, t)).sort((e, t) => e.priority - t.priority);
|
|
3114
3194
|
r.set(e, {
|
|
3115
3195
|
tenant_id: s,
|
|
3116
3196
|
custom_domain_id: c,
|
|
@@ -3154,7 +3234,7 @@ function Nr(e) {
|
|
|
3154
3234
|
}
|
|
3155
3235
|
};
|
|
3156
3236
|
}
|
|
3157
|
-
function
|
|
3237
|
+
function Gr(e, t = {}) {
|
|
3158
3238
|
return {
|
|
3159
3239
|
priority: t.priority,
|
|
3160
3240
|
match: { path: t.path ?? "/*" },
|
|
@@ -3169,10 +3249,10 @@ function Pr(e, t = {}) {
|
|
|
3169
3249
|
}
|
|
3170
3250
|
//#endregion
|
|
3171
3251
|
//#region src/constants.ts
|
|
3172
|
-
var
|
|
3252
|
+
var Kr = "proxy:resolve_host";
|
|
3173
3253
|
//#endregion
|
|
3174
3254
|
//#region src/http-adapter/index.ts
|
|
3175
|
-
function
|
|
3255
|
+
function qr() {
|
|
3176
3256
|
let e = () => {
|
|
3177
3257
|
throw Error("HTTP proxy adapter does not expose write access to proxy_routes; mutate via the control-plane management API");
|
|
3178
3258
|
};
|
|
@@ -3194,7 +3274,7 @@ function Ir() {
|
|
|
3194
3274
|
}
|
|
3195
3275
|
};
|
|
3196
3276
|
}
|
|
3197
|
-
function
|
|
3277
|
+
function Jr(e) {
|
|
3198
3278
|
let t = e.fetch ?? fetch, n = e.baseUrl.replace(/\/+$/, ""), r = e.resolveHostPath ?? "/api/v2/proxy/control-plane/hosts/", i = e.audience ?? `${n}/api/v2/`, a = e.scope ?? "proxy:resolve_host", o = e.tokenRefreshSkewSeconds ?? 60, s = e.timeoutMs ?? 5e3;
|
|
3199
3279
|
function c(e) {
|
|
3200
3280
|
let t = new AbortController(), n = setTimeout(() => t.abort(), s);
|
|
@@ -3227,7 +3307,7 @@ function Lr(e) {
|
|
|
3227
3307
|
}), u);
|
|
3228
3308
|
}
|
|
3229
3309
|
return {
|
|
3230
|
-
proxyRoutes:
|
|
3310
|
+
proxyRoutes: qr(),
|
|
3231
3311
|
async resolveHost(e) {
|
|
3232
3312
|
let i = await f(), a = `${n}${r}${encodeURIComponent(e.toLowerCase())}`, o = await c((e) => t(a, {
|
|
3233
3313
|
headers: { authorization: `Bearer ${i}` },
|
|
@@ -3240,4 +3320,4 @@ function Lr(e) {
|
|
|
3240
3320
|
};
|
|
3241
3321
|
}
|
|
3242
3322
|
//#endregion
|
|
3243
|
-
export {
|
|
3323
|
+
export { I as HandlerRegistry, Kr as PROXY_RESOLVE_HOST_SCOPE, Jn as basicAuthHandler, Hr as buildCacheAdapterKey, Rr as buildCacheApiKey, Tr as buildMatchFilter, Xn as cacheHandler, Dr as compileHostApp, Gn as corsHandler, Vr as createCacheAdapterHostCache, Lr as createCacheApiHostCache, Jr as createHttpProxyAdapter, F as createInMemoryHostCache, Mr as createProxyApp, Q as createProxyDataPlaneHandler, jr as createProxyDataPlaneRouter, Wr as createStaticProxyAdapter, L as defineHandler, yr as dispatchNamespaceHandler, Zn as forwardedHeadersHandler, _n as handlerConfigSchema, Yn as headersHandler, ur as httpHandler, Gr as httpRoute, gn as matchSchema, wr as matchesAnyHost, Cr as matchesHost, M as proxyRouteInsertSchema, vn as proxyRouteSchema, yn as proxyRouteUpdateSchema, br as redirectHandler, Sr as registerBuiltinHandlers, tr as rewriteCookiesHandler, nr as rewriteLocationHandler, mr as serviceBindingHandler, Z as sortRoutes, xr as staticHandler };
|