@authhero/cloudflare-adapter 3.0.11 → 3.0.12

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.
@@ -1,84 +1,84 @@
1
1
  import { a as e, i as t, n, t as r } from "./sync-defaults-errors-BlLZh6Gt.mjs";
2
- import { TRIGGER_API_SHAPES as i, actionExecutionStatusSchema as a, verificationMethodsSchema as o } from "@authhero/adapter-interfaces";
3
- import { z as s } from "@hono/zod-openapi";
4
- import { HTTPException as c } from "hono/http-exception";
5
- import l from "wretch";
6
- import { dedupe as u, retry as d } from "wretch/middlewares";
2
+ import { TRIGGER_API_SHAPES as i, actionExecutionStatusSchema as a, tokenizeLuceneQuery as o, unescapeLuceneValue as s, verificationMethodsSchema as c } from "@authhero/adapter-interfaces";
3
+ import { z as l } from "@hono/zod-openapi";
4
+ import { HTTPException as u } from "hono/http-exception";
5
+ import d from "wretch";
6
+ import { dedupe as f, retry as p } from "wretch/middlewares";
7
7
  //#region src/types/CustomDomain.ts
8
- var f = s.object({
9
- code: s.number(),
10
- message: s.string()
11
- }), p = s.object({ message: s.string() }), m = s.object({
12
- emails: s.array(s.string()).optional(),
13
- http_body: s.string().optional(),
14
- http_url: s.string().optional(),
15
- txt_name: s.string().optional(),
16
- txt_value: s.string().optional()
17
- }), h = s.object({
18
- ciphers: s.array(s.string()).optional(),
19
- early_hints: s.string().optional(),
20
- http2: s.string().optional(),
21
- min_tls_version: s.string().optional(),
22
- tls_1_3: s.string().optional()
23
- }), g = s.object({
24
- id: s.string(),
25
- bundle_method: s.string().optional(),
26
- certificate_authority: s.string(),
27
- custom_certificate: s.string().optional(),
28
- custom_csr_id: s.string().optional(),
29
- custom_key: s.string().optional(),
30
- expires_on: s.string().optional(),
31
- hosts: s.array(s.string()).optional(),
32
- issuer: s.string().optional(),
33
- method: s.string(),
34
- serial_number: s.string().optional(),
35
- settings: h.optional(),
36
- signature: s.string().optional(),
37
- type: s.string(),
38
- uploaded_on: s.string().optional(),
39
- validation_errors: s.array(p).optional(),
40
- validation_records: s.array(m).optional(),
41
- wildcard: s.boolean()
42
- }), _ = s.object({
43
- name: s.string(),
44
- type: s.string(),
45
- value: s.string()
46
- }), ee = s.object({
47
- http_body: s.string().optional(),
48
- http_url: s.string().optional()
49
- }), v = s.object({
50
- id: s.string(),
51
- ssl: g,
52
- hostname: s.string(),
53
- custom_metadata: s.record(s.string(), s.string()).optional(),
54
- custom_origin_server: s.string().optional(),
55
- custom_origin_sni: s.string().optional(),
56
- ownership_verification: _.optional(),
57
- ownership_verification_http: ee.optional(),
58
- status: s.string(),
59
- verification_errors: s.array(s.string()).optional(),
60
- created_at: s.string()
61
- }), y = s.object({
62
- errors: s.array(f),
63
- messages: s.array(f),
64
- success: s.boolean(),
8
+ var m = l.object({
9
+ code: l.number(),
10
+ message: l.string()
11
+ }), h = l.object({ message: l.string() }), g = l.object({
12
+ emails: l.array(l.string()).optional(),
13
+ http_body: l.string().optional(),
14
+ http_url: l.string().optional(),
15
+ txt_name: l.string().optional(),
16
+ txt_value: l.string().optional()
17
+ }), _ = l.object({
18
+ ciphers: l.array(l.string()).optional(),
19
+ early_hints: l.string().optional(),
20
+ http2: l.string().optional(),
21
+ min_tls_version: l.string().optional(),
22
+ tls_1_3: l.string().optional()
23
+ }), ee = l.object({
24
+ id: l.string(),
25
+ bundle_method: l.string().optional(),
26
+ certificate_authority: l.string(),
27
+ custom_certificate: l.string().optional(),
28
+ custom_csr_id: l.string().optional(),
29
+ custom_key: l.string().optional(),
30
+ expires_on: l.string().optional(),
31
+ hosts: l.array(l.string()).optional(),
32
+ issuer: l.string().optional(),
33
+ method: l.string(),
34
+ serial_number: l.string().optional(),
35
+ settings: _.optional(),
36
+ signature: l.string().optional(),
37
+ type: l.string(),
38
+ uploaded_on: l.string().optional(),
39
+ validation_errors: l.array(h).optional(),
40
+ validation_records: l.array(g).optional(),
41
+ wildcard: l.boolean()
42
+ }), te = l.object({
43
+ name: l.string(),
44
+ type: l.string(),
45
+ value: l.string()
46
+ }), ne = l.object({
47
+ http_body: l.string().optional(),
48
+ http_url: l.string().optional()
49
+ }), v = l.object({
50
+ id: l.string(),
51
+ ssl: ee,
52
+ hostname: l.string(),
53
+ custom_metadata: l.record(l.string(), l.string()).optional(),
54
+ custom_origin_server: l.string().optional(),
55
+ custom_origin_sni: l.string().optional(),
56
+ ownership_verification: te.optional(),
57
+ ownership_verification_http: ne.optional(),
58
+ status: l.string(),
59
+ verification_errors: l.array(l.string()).optional(),
60
+ created_at: l.string()
61
+ }), y = l.object({
62
+ errors: l.array(m),
63
+ messages: l.array(m),
64
+ success: l.boolean(),
65
65
  result: v
66
- }), te = s.object({
67
- errors: s.array(f),
68
- messages: s.array(f),
69
- success: s.boolean(),
70
- result: s.array(v)
66
+ }), b = l.object({
67
+ errors: l.array(m),
68
+ messages: l.array(m),
69
+ success: l.boolean(),
70
+ result: l.array(v)
71
71
  });
72
72
  //#endregion
73
73
  //#region src/customDomains/index.ts
74
- function b(e) {
75
- return l(`https://api.cloudflare.com/client/v4/zones/${e.zoneId}`).headers({
74
+ function x(e) {
75
+ return d(`https://api.cloudflare.com/client/v4/zones/${e.zoneId}`).headers({
76
76
  "X-Auth-Email": e.authEmail,
77
77
  "X-Auth-Key": e.authKey,
78
78
  "Content-Type": "application/json"
79
- }).middlewares([d(), u()]);
79
+ }).middlewares([p(), f()]);
80
80
  }
81
- function x(e) {
81
+ function S(e) {
82
82
  let t = {}, n = {};
83
83
  if (!e) return {
84
84
  sslOverrides: t,
@@ -90,7 +90,7 @@ function x(e) {
90
90
  rest: n
91
91
  };
92
92
  }
93
- function S(e) {
93
+ function C(e) {
94
94
  let t = [];
95
95
  if (e.ssl.validation_records) for (let n of e.ssl.validation_records) n.txt_name && n.txt_value && t.push({
96
96
  name: "txt",
@@ -122,34 +122,34 @@ function S(e) {
122
122
  primary: e.primary,
123
123
  status: e.status === "active" ? "ready" : "pending",
124
124
  type: e.type ?? "auth0_managed_certs",
125
- verification: { methods: s.array(o).parse(t) },
125
+ verification: { methods: l.array(c).parse(t) },
126
126
  domain_metadata: n
127
127
  };
128
128
  }
129
- function C(e) {
129
+ function re(e) {
130
130
  let t = e instanceof Error ? e.message : String(e);
131
131
  return /duplicate/i.test(t);
132
132
  }
133
- async function ne(e, t, n) {
133
+ async function ie(e, t, n) {
134
134
  let r;
135
135
  try {
136
- r = await b(e).get(`/custom_hostnames?hostname=${encodeURIComponent(n)}`).json();
136
+ r = await x(e).get(`/custom_hostnames?hostname=${encodeURIComponent(n)}`).json();
137
137
  } catch {
138
138
  return null;
139
139
  }
140
- let i = te.safeParse(r);
140
+ let i = b.safeParse(r);
141
141
  if (!i.success || !i.data.success) return null;
142
142
  let a = i.data.result.find((e) => e.hostname.toLowerCase() === n.toLowerCase());
143
143
  return !a || e.enterprise && a.custom_metadata?.tenant_id !== t ? null : a;
144
144
  }
145
- function re(e) {
145
+ function ae(e) {
146
146
  return {
147
147
  create: async (t, n) => {
148
- let { sslOverrides: r, rest: i } = x(n.domain_metadata);
149
- if (await e.customDomainAdapter.getByDomain(n.domain)) throw new c(409, { message: `The domain ${n.domain} is already registered` });
148
+ let { sslOverrides: r, rest: i } = S(n.domain_metadata);
149
+ if (await e.customDomainAdapter.getByDomain(n.domain)) throw new u(409, { message: `The domain ${n.domain} is already registered` });
150
150
  let a;
151
151
  try {
152
- let i = y.parse(await b(e).post({
152
+ let i = y.parse(await x(e).post({
153
153
  hostname: n.domain,
154
154
  ssl: {
155
155
  method: "txt",
@@ -161,12 +161,12 @@ function re(e) {
161
161
  if (!i.success) throw Error(JSON.stringify(i.errors));
162
162
  a = i.result;
163
163
  } catch (r) {
164
- if (!C(r)) throw r;
165
- let i = await ne(e, t, n.domain);
164
+ if (!re(r)) throw r;
165
+ let i = await ie(e, t, n.domain);
166
166
  if (!i) throw r;
167
167
  a = i;
168
168
  }
169
- let o = S({
169
+ let o = C({
170
170
  ...a,
171
171
  primary: !1,
172
172
  type: n.type,
@@ -185,10 +185,10 @@ function re(e) {
185
185
  },
186
186
  get: async (t, n) => {
187
187
  let r = await e.customDomainAdapter.get(t, n);
188
- if (!r) throw new c(404);
188
+ if (!r) throw new u(404);
189
189
  let i;
190
190
  try {
191
- i = await b(e).get(`/custom_hostnames/${encodeURIComponent(n)}`).json();
191
+ i = await x(e).get(`/custom_hostnames/${encodeURIComponent(n)}`).json();
192
192
  } catch (e) {
193
193
  return console.warn(`[custom-domains] CF fetch failed for ${n} (tenant=${t}); returning stale DB row:`, e instanceof Error ? e.message : e), r;
194
194
  }
@@ -198,10 +198,10 @@ function re(e) {
198
198
  body: i
199
199
  }), r;
200
200
  let { result: o } = a.data;
201
- if (e.enterprise && o.custom_metadata?.tenant_id !== t) throw new c(404);
201
+ if (e.enterprise && o.custom_metadata?.tenant_id !== t) throw new u(404);
202
202
  let s;
203
203
  try {
204
- s = S({
204
+ s = C({
205
205
  ...r,
206
206
  ...o
207
207
  });
@@ -222,23 +222,23 @@ function re(e) {
222
222
  list: async (t) => e.customDomainAdapter.list(t),
223
223
  remove: async (t, n) => {
224
224
  if (e.enterprise) {
225
- let { result: r, success: i } = y.parse(await b(e).get(`/custom_hostnames/${encodeURIComponent(n)}`).json());
226
- if (!i || r.custom_metadata?.tenant_id !== t) throw new c(404);
225
+ let { result: r, success: i } = y.parse(await x(e).get(`/custom_hostnames/${encodeURIComponent(n)}`).json());
226
+ if (!i || r.custom_metadata?.tenant_id !== t) throw new u(404);
227
227
  }
228
- let r = await b(e).delete(`/custom_hostnames/${encodeURIComponent(n)}`).res();
228
+ let r = await x(e).delete(`/custom_hostnames/${encodeURIComponent(n)}`).res();
229
229
  return r.ok && await e.customDomainAdapter.remove(t, n), r.ok;
230
230
  },
231
231
  update: async (t, n, r) => {
232
- let { sslOverrides: i } = x(r.domain_metadata), a = {};
232
+ let { sslOverrides: i } = S(r.domain_metadata), a = {};
233
233
  if (Object.keys(i).length > 0) {
234
234
  let t;
235
235
  try {
236
- t = await b(e).get(`/custom_hostnames/${encodeURIComponent(n)}`).json();
236
+ t = await x(e).get(`/custom_hostnames/${encodeURIComponent(n)}`).json();
237
237
  } catch (e) {
238
- throw new c(503, { message: `Failed to fetch current custom hostname state: ${e instanceof Error ? e.message : String(e)}` });
238
+ throw new u(503, { message: `Failed to fetch current custom hostname state: ${e instanceof Error ? e.message : String(e)}` });
239
239
  }
240
240
  let r = y.safeParse(t);
241
- if (!r.success || !r.data.success) throw new c(503, { message: `Failed to parse current custom hostname state: ${JSON.stringify(r.success ? r.data.errors : r.error.issues)}` });
241
+ if (!r.success || !r.data.success) throw new u(503, { message: `Failed to parse current custom hostname state: ${JSON.stringify(r.success ? r.data.errors : r.error.issues)}` });
242
242
  a.ssl = {
243
243
  method: r.data.result.ssl.method,
244
244
  type: r.data.result.ssl.type,
@@ -247,35 +247,35 @@ function re(e) {
247
247
  };
248
248
  }
249
249
  if (Object.keys(a).length > 0) {
250
- let t = await b(e).patch(a, `/custom_hostnames/${encodeURIComponent(n)}`).res().catch((e) => {
251
- throw new c(503, { message: `Failed to update custom hostname: ${e instanceof Error ? e.message : String(e)}` });
250
+ let t = await x(e).patch(a, `/custom_hostnames/${encodeURIComponent(n)}`).res().catch((e) => {
251
+ throw new u(503, { message: `Failed to update custom hostname: ${e instanceof Error ? e.message : String(e)}` });
252
252
  });
253
- if (!t.ok) throw new c(503, { message: await t.text() });
253
+ if (!t.ok) throw new u(503, { message: await t.text() });
254
254
  }
255
255
  return e.customDomainAdapter.update(t, n, r);
256
256
  },
257
257
  uploadCertificate: async (t, n, r) => {
258
258
  let i = await e.customDomainAdapter.get(t, n);
259
- if (!i) throw new c(404);
260
- let a = await b(e).patch({ ssl: {
259
+ if (!i) throw new u(404);
260
+ let a = await x(e).patch({ ssl: {
261
261
  custom_certificate: r.certificate,
262
262
  custom_key: r.private_key
263
- } }, `/custom_hostnames/${encodeURIComponent(n)}`).json(), { result: o, errors: s, success: l } = y.parse(a);
264
- if (!l) throw new c(503, { message: JSON.stringify(s) });
265
- let u = S({
263
+ } }, `/custom_hostnames/${encodeURIComponent(n)}`).json(), { result: o, errors: s, success: c } = y.parse(a);
264
+ if (!c) throw new u(503, { message: JSON.stringify(s) });
265
+ let l = C({
266
266
  ...i,
267
267
  ...o
268
268
  });
269
269
  return await e.customDomainAdapter.update(t, n, {
270
- status: u.status,
271
- verification: u.verification
272
- }), u;
270
+ status: l.status,
271
+ verification: l.verification
272
+ }), l;
273
273
  }
274
274
  };
275
275
  }
276
276
  //#endregion
277
277
  //#region src/cache/index.ts
278
- var ie = class {
278
+ var oe = class {
279
279
  config;
280
280
  cache = null;
281
281
  constructor(e) {
@@ -349,8 +349,8 @@ var ie = class {
349
349
  console.warn("CloudflareCache.clear() is not implemented - Cloudflare Cache API does not support clearing all entries");
350
350
  }
351
351
  };
352
- function ae(e = {}) {
353
- return new ie({
352
+ function se(e = {}) {
353
+ return new oe({
354
354
  defaultTtlSeconds: 300,
355
355
  keyPrefix: "authhero",
356
356
  getTimeoutMs: 200,
@@ -359,9 +359,9 @@ function ae(e = {}) {
359
359
  }
360
360
  //#endregion
361
361
  //#region ../../node_modules/.pnpm/nanoid@5.1.11/node_modules/nanoid/url-alphabet/index.js
362
- var oe = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", w = (e = 21) => {
362
+ var ce = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", w = (e = 21) => {
363
363
  let t = "", n = crypto.getRandomValues(new Uint8Array(e |= 0));
364
- for (; e--;) t += oe[n[e] & 63];
364
+ for (; e--;) t += ce[n[e] & 63];
365
365
  return t;
366
366
  };
367
367
  //#endregion
@@ -434,16 +434,16 @@ function O(e) {
434
434
  } : void 0
435
435
  };
436
436
  }
437
- function se(e) {
437
+ function le(e) {
438
438
  return async (t, n) => {
439
439
  let r = n.log_id || w(), i = {
440
440
  ...n,
441
441
  log_id: r
442
442
  };
443
- return await ce(e, t, i), i;
443
+ return await ue(e, t, i), i;
444
444
  };
445
445
  }
446
- async function ce(e, t, n) {
446
+ async function ue(e, t, n) {
447
447
  let r = (e) => e ? JSON.stringify(e) : void 0, i = {
448
448
  id: n.log_id,
449
449
  tenant_id: t,
@@ -494,7 +494,7 @@ async function ce(e, t, n) {
494
494
  throw console.error("Failed to send log to Pipeline:", e), e;
495
495
  }
496
496
  }
497
- function le(e) {
497
+ function de(e) {
498
498
  return async (t, n) => {
499
499
  let r = e.namespace || "default", i = e.tableName || "logs", a = await T(e, `
500
500
  SELECT * FROM ${D(r)}.${D(i)}
@@ -509,7 +509,7 @@ function le(e) {
509
509
  }
510
510
  //#endregion
511
511
  //#region src/r2-sql-logs/list.ts
512
- function ue(e) {
512
+ function fe(e) {
513
513
  let t = {}, n = /(\w+):(?:"([^"]*)"|(\S+))/g, r;
514
514
  for (; (r = n.exec(e)) !== null;) {
515
515
  let e = r[1], n = r[2] === void 0 ? r[3] : r[2];
@@ -517,7 +517,7 @@ function ue(e) {
517
517
  }
518
518
  return t;
519
519
  }
520
- function de(e) {
520
+ function pe(e) {
521
521
  let t = [];
522
522
  for (let [n, r] of Object.entries(e)) {
523
523
  let e = n.replace(/[^a-zA-Z0-9_]/g, "");
@@ -525,12 +525,12 @@ function de(e) {
525
525
  }
526
526
  return t;
527
527
  }
528
- function fe(e) {
528
+ function me(e) {
529
529
  return async (t, n = {}) => {
530
530
  let { page: r = 0, per_page: i = 50, include_totals: a = !1, sort: o, q: s } = n, c = e.namespace || "default", l = e.tableName || "logs", u = [`tenant_id = ${E(t)}`];
531
531
  if (s) {
532
- let e = ue(s);
533
- u.push(...de(e));
532
+ let e = fe(s);
533
+ u.push(...pe(e));
534
534
  }
535
535
  let d = u.join(" AND "), f = "ORDER BY date DESC";
536
536
  if (o && o.sort_by) {
@@ -563,7 +563,7 @@ function fe(e) {
563
563
  }
564
564
  //#endregion
565
565
  //#region src/r2-sql-logs/stats.ts
566
- function pe() {
566
+ function he() {
567
567
  return {
568
568
  async getDaily() {
569
569
  throw Error("Stats queries are not supported by R2 SQL logs adapter. Use Analytics Engine or Kysely adapter instead.");
@@ -581,9 +581,9 @@ function k(e) {
581
581
  if (!e.authToken) throw Error("R2 SQL logs adapter requires \"authToken\" configuration");
582
582
  if (!e.warehouseName) throw Error("R2 SQL logs adapter requires \"warehouseName\" configuration");
583
583
  return {
584
- create: se(e),
585
- list: fe(e),
586
- get: le(e)
584
+ create: le(e),
585
+ list: me(e),
586
+ get: de(e)
587
587
  };
588
588
  }
589
589
  //#endregion
@@ -651,16 +651,16 @@ function N(e) {
651
651
  isMobile: e.double1 === 1
652
652
  };
653
653
  }
654
- function me(e) {
654
+ function ge(e) {
655
655
  return async (t, n) => {
656
656
  let r = n.log_id || w(), i = {
657
657
  ...n,
658
658
  log_id: r
659
659
  };
660
- return he(e, t, i), i;
660
+ return _e(e, t, i), i;
661
661
  };
662
662
  }
663
- function he(e, t, n) {
663
+ function _e(e, t, n) {
664
664
  if (!e.analyticsEngineBinding) {
665
665
  console.error("Analytics Engine binding not configured");
666
666
  return;
@@ -712,30 +712,19 @@ function P(e) {
712
712
  //#endregion
713
713
  //#region src/analytics-engine-logs/list.ts
714
714
  function F(e) {
715
- return e.replace(/\\([\\"+\-!(){}[\]^~*?:/&|])/g, "$1");
716
- }
717
- function I(e) {
718
- let t = [], n = "", r = !1;
719
- for (let i = 0; i < e.length; i++) {
720
- let a = e[i];
721
- a === "\"" ? (r = !r, n += a) : a === " " && !r ? (n.trim() && t.push(n.trim()), n = "") : n += a;
722
- }
723
- return n.trim() && t.push(n.trim()), t;
724
- }
725
- function L(e) {
726
715
  let t = e;
727
- return t.startsWith("\"") && t.endsWith("\"") && t.length > 1 && (t = t.slice(1, -1)), F(t);
716
+ return t.startsWith("\"") && t.endsWith("\"") && t.length > 1 && (t = t.slice(1, -1)), s(t);
728
717
  }
729
- function R(e) {
718
+ function I(e) {
730
719
  let t = {}, n = [];
731
- for (let r of I(e)) {
720
+ for (let r of o(e)) {
732
721
  if (r === "OR" || r === "AND") continue;
733
722
  let e = r.match(/^(\w+):([\s\S]*)$/);
734
723
  if (e) {
735
- let n = e[1], r = L(e[2]);
724
+ let n = e[1], r = F(e[2]);
736
725
  t[n] || (t[n] = []), t[n].push(r);
737
726
  } else {
738
- let e = L(r);
727
+ let e = F(r);
739
728
  e && n.push(e);
740
729
  }
741
730
  }
@@ -744,7 +733,7 @@ function R(e) {
744
733
  terms: n
745
734
  };
746
735
  }
747
- function z(e) {
736
+ function L(e) {
748
737
  return {
749
738
  log_id: "blob1",
750
739
  tenant_id: "blob2",
@@ -765,7 +754,7 @@ function z(e) {
765
754
  hostname: "blob17"
766
755
  }[e] || null;
767
756
  }
768
- function ge(e) {
757
+ function ve(e) {
769
758
  let t = [];
770
759
  for (let [n, r] of Object.entries(e)) {
771
760
  let e = r.filter((e) => e !== "");
@@ -776,7 +765,7 @@ function ge(e) {
776
765
  n.length > 0 && t.push(`(${n.join(" OR ")})`);
777
766
  continue;
778
767
  }
779
- let i = z(n);
768
+ let i = L(n);
780
769
  if (i) if (e.length === 1) t.push(`${i} = ${j(e[0])}`);
781
770
  else {
782
771
  let n = e.map((e) => j(e)).join(", ");
@@ -785,25 +774,25 @@ function ge(e) {
785
774
  }
786
775
  return t;
787
776
  }
788
- function _e(e) {
777
+ function ye(e) {
789
778
  return e.filter((e) => e !== "").map((e) => {
790
779
  let t = j(e), n = j(`%${e}%`);
791
780
  return `(blob7 = ${t} OR blob5 LIKE ${n} OR blob4 LIKE ${n})`;
792
781
  });
793
782
  }
794
- function ve(e) {
795
- return e === "date" ? "double2" : z(e) || "timestamp";
783
+ function be(e) {
784
+ return e === "date" ? "double2" : L(e) || "timestamp";
796
785
  }
797
- function ye(e) {
786
+ function xe(e) {
798
787
  return async (t, n = {}) => {
799
788
  let { page: r = 0, per_page: i = 50, include_totals: a = !1, sort: o, q: s, from_date: c, to_date: l } = n, u = e.dataset || "authhero_logs", d = [`index1 = ${j(t)}`];
800
789
  if (s) {
801
- let { fields: e, terms: t } = R(s);
802
- d.push(...ge(e)), d.push(..._e(t));
790
+ let { fields: e, terms: t } = I(s);
791
+ d.push(...ve(e)), d.push(...ye(t));
803
792
  }
804
793
  typeof c == "number" && Number.isFinite(c) && d.push(`double2 >= ${Math.floor(c) * 1e3}`), typeof l == "number" && Number.isFinite(l) && d.push(`double2 <= ${Math.floor(l) * 1e3}`);
805
794
  let f = d.join(" AND "), p = "ORDER BY timestamp DESC";
806
- o && o.sort_by && (p = `ORDER BY ${ve(o.sort_by)} ${o.sort_order === "asc" ? "ASC" : "DESC"}`);
795
+ o && o.sort_by && (p = `ORDER BY ${be(o.sort_by)} ${o.sort_order === "asc" ? "ASC" : "DESC"}`);
807
796
  let m = r * i, h = `LIMIT ${i} OFFSET ${m}`, g = (await A(e, `
808
797
  SELECT *
809
798
  FROM ${M(u)}
@@ -842,26 +831,35 @@ function ye(e) {
842
831
  }
843
832
  //#endregion
844
833
  //#region src/analytics-engine-logs/stats.ts
845
- var B = ["s"], be = ["pwd_leak"];
846
- function V(e) {
847
- return `${e.slice(0, 4)}-${e.slice(4, 6)}-${e.slice(6, 8)}`;
834
+ var R = ["s"], Se = ["pwd_leak"];
835
+ function z(e) {
836
+ return /^\d{8}$/.test(e) ? `${e.slice(0, 4)}-${e.slice(4, 6)}-${e.slice(6, 8)}` : e;
848
837
  }
849
- function H(e) {
838
+ function B(e) {
850
839
  return e.toISOString().split("T")[0];
851
840
  }
852
- function xe(e) {
841
+ function V(e, t) {
842
+ let n = (/* @__PURE__ */ new Date(`${e}T${t === "end" ? "23:59:59.999" : "00:00:00.000"}Z`)).getTime();
843
+ if (Number.isNaN(n)) return NaN;
844
+ let r = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
845
+ if (!r) return n;
846
+ let i = new Date(n);
847
+ return i.getUTCFullYear() !== Number(r[1]) || i.getUTCMonth() + 1 !== Number(r[2]) || i.getUTCDate() !== Number(r[3]) ? NaN : n;
848
+ }
849
+ function H(e) {
853
850
  let t = e.dataset || "authhero_logs";
854
851
  return {
855
852
  async getDaily(n, r = {}) {
856
853
  let { from: i, to: a } = r, o = /* @__PURE__ */ new Date(), s = new Date(o);
857
854
  s.setDate(s.getDate() - 30);
858
- let c = i ? V(i) : H(s), l = a ? V(a) : H(o), u = (/* @__PURE__ */ new Date(`${c}T00:00:00Z`)).getTime(), d = (/* @__PURE__ */ new Date(`${l}T23:59:59.999Z`)).getTime();
855
+ let c = i ? z(i) : B(s), l = a ? z(a) : B(o), u = V(c, "start"), d = V(l, "end");
856
+ if (Number.isNaN(u) || Number.isNaN(d)) throw Error(`Invalid stats date range: from='${c}' to='${l}'`);
859
857
  return (await A(e, `
860
858
  SELECT
861
859
  toDate(toDateTime(double2 / 1000)) AS date,
862
- SUM(CASE WHEN blob3 IN (${B.map((e) => j(e)).join(", ")}) THEN 1 ELSE 0 END) AS logins,
860
+ SUM(CASE WHEN blob3 IN (${R.map((e) => j(e)).join(", ")}) THEN 1 ELSE 0 END) AS logins,
863
861
  SUM(CASE WHEN blob3 = 'ss' THEN 1 ELSE 0 END) AS signups,
864
- SUM(CASE WHEN blob3 IN (${be.map((e) => j(e)).join(", ")}) THEN 1 ELSE 0 END) AS leaked_passwords,
862
+ SUM(CASE WHEN blob3 IN (${Se.map((e) => j(e)).join(", ")}) THEN 1 ELSE 0 END) AS leaked_passwords,
865
863
  MIN(double2) AS first_event,
866
864
  MAX(double2) AS last_event
867
865
  FROM "${t}"
@@ -882,7 +880,7 @@ function xe(e) {
882
880
  async getActiveUsers(n) {
883
881
  let r = /* @__PURE__ */ new Date();
884
882
  r.setDate(r.getDate() - 30);
885
- let i = r.getTime(), a = B.map((e) => j(e)).join(", "), o = (await A(e, `
883
+ let i = r.getTime(), a = R.map((e) => j(e)).join(", "), o = (await A(e, `
886
884
  SELECT COUNT(DISTINCT blob7) AS count
887
885
  FROM "${t}"
888
886
  WHERE index1 = ${j(n)}
@@ -897,7 +895,7 @@ function xe(e) {
897
895
  }
898
896
  //#endregion
899
897
  //#region src/analytics-engine-logs/analytics.ts
900
- var Se = {
898
+ var Ce = {
901
899
  "active-users": ["s", "seacft"],
902
900
  logins: [
903
901
  "s",
@@ -927,17 +925,17 @@ var Se = {
927
925
  "fvr"
928
926
  ],
929
927
  "codes-sent": ["cls", "cs"]
930
- }, Ce = {
928
+ }, we = {
931
929
  connection: "blob9",
932
930
  client_id: "blob11",
933
931
  user_type: "blob16",
934
932
  event: "blob3"
935
- }, we = {
933
+ }, Te = {
936
934
  connection: "blob9",
937
935
  client_id: "blob11",
938
936
  user_type: "blob16",
939
937
  user_id: "blob7"
940
- }, Te = {
938
+ }, Ee = {
941
939
  "active-users": {
942
940
  expr: "count(DISTINCT blob7)",
943
941
  alias: "active_users",
@@ -994,7 +992,7 @@ var Se = {
994
992
  type: "UInt64"
995
993
  }
996
994
  };
997
- function Ee(e, t) {
995
+ function De(e, t) {
998
996
  let n = `toDateTime(intDiv(double2, 1000), ${j(t)})`;
999
997
  switch (e) {
1000
998
  case "hour": return `toStartOfHour(${n})`;
@@ -1003,17 +1001,17 @@ function Ee(e, t) {
1003
1001
  default: return `toStartOfDay(${n})`;
1004
1002
  }
1005
1003
  }
1006
- function De(e) {
1004
+ function Oe(e) {
1007
1005
  return e === "hour" ? "DateTime" : "Date";
1008
1006
  }
1009
- function Oe(e, t, n) {
1007
+ function ke(e, t, n) {
1010
1008
  let r = new Date(e.from).getTime(), i = new Date(e.to).getTime(), a = n.map((e) => j(e)).join(", "), o = [
1011
1009
  `index1 = ${j(t)}`,
1012
1010
  `double2 >= ${r}`,
1013
1011
  `double2 < ${i}`,
1014
1012
  `blob3 IN (${a})`
1015
1013
  ];
1016
- for (let [t, n] of Object.entries(we)) {
1014
+ for (let [t, n] of Object.entries(Te)) {
1017
1015
  let r = e.filters[t];
1018
1016
  if (r && r.length > 0) {
1019
1017
  let e = r.map((e) => j(e)).join(", ");
@@ -1022,7 +1020,7 @@ function Oe(e, t, n) {
1022
1020
  }
1023
1021
  return o.join(" AND ");
1024
1022
  }
1025
- function ke(e, t, n) {
1023
+ function Ae(e, t, n) {
1026
1024
  if (e.order_by) {
1027
1025
  let t = e.order_by.startsWith("-");
1028
1026
  return `${M(t ? e.order_by.slice(1) : e.order_by)} ${t ? "DESC" : "ASC"}`;
@@ -1032,15 +1030,15 @@ function ke(e, t, n) {
1032
1030
  function U(e) {
1033
1031
  let t = e.dataset || "authhero_logs";
1034
1032
  return { async query(n, r, i) {
1035
- let a = Se[r], o = Te[r], s = [], c = [];
1033
+ let a = Ce[r], o = Ee[r], s = [], c = [];
1036
1034
  for (let e of i.group_by) if (e === "time") {
1037
- let e = Ee(i.interval, i.tz);
1035
+ let e = De(i.interval, i.tz);
1038
1036
  s.push(`${e} AS ${M("time")}`), c.push({
1039
1037
  name: "time",
1040
- type: De(i.interval)
1038
+ type: Oe(i.interval)
1041
1039
  });
1042
1040
  } else {
1043
- let t = Ce[e];
1041
+ let t = we[e];
1044
1042
  s.push(`${t} AS ${M(e)}`), c.push({
1045
1043
  name: e,
1046
1044
  type: "String"
@@ -1050,10 +1048,10 @@ function U(e) {
1050
1048
  name: o.alias,
1051
1049
  type: o.type
1052
1050
  });
1053
- let l = [...s, `${o.expr} AS ${M(o.alias)}`], u = i.group_by.length ? `GROUP BY ${i.group_by.map((e) => M(e === "time" ? "time" : e)).join(", ")}` : "", d = ke(i, i.group_by.map((e) => e === "time" ? "time" : e), o.alias), f = `
1051
+ let l = [...s, `${o.expr} AS ${M(o.alias)}`], u = i.group_by.length ? `GROUP BY ${i.group_by.map((e) => M(e === "time" ? "time" : e)).join(", ")}` : "", d = Ae(i, i.group_by.map((e) => e === "time" ? "time" : e), o.alias), f = `
1054
1052
  SELECT ${l.join(", ")}
1055
1053
  FROM ${M(t)}
1056
- WHERE ${Oe(i, n, a)}
1054
+ WHERE ${ke(i, n, a)}
1057
1055
  ${u}
1058
1056
  ORDER BY ${d}
1059
1057
  LIMIT ${Math.max(0, i.limit)} OFFSET ${Math.max(0, i.offset)}
@@ -1092,14 +1090,14 @@ function U(e) {
1092
1090
  //#region src/analytics-engine-logs/index.ts
1093
1091
  function W(e) {
1094
1092
  return e.analyticsEngineBinding || console.warn("Analytics Engine: No binding configured. Logs will not be written to Analytics Engine."), (!e.accountId || !e.apiToken) && console.warn("Analytics Engine: accountId and apiToken are required for querying logs via SQL API."), {
1095
- create: me(e),
1096
- list: ye(e),
1093
+ create: ge(e),
1094
+ list: xe(e),
1097
1095
  get: P(e)
1098
1096
  };
1099
1097
  }
1100
1098
  //#endregion
1101
1099
  //#region src/analytics-engine-action-executions/actionExecutions.ts
1102
- var Ae = "authhero_action_executions", je = 1024, Me = "[truncated]";
1100
+ var je = "authhero_action_executions", Me = 1024, Ne = "[truncated]";
1103
1101
  function G(e) {
1104
1102
  if (!(typeof e != "string" || e.length === 0)) try {
1105
1103
  return JSON.parse(e);
@@ -1107,30 +1105,30 @@ function G(e) {
1107
1105
  return;
1108
1106
  }
1109
1107
  }
1110
- function Ne(e) {
1108
+ function Pe(e) {
1111
1109
  let t = a.safeParse(e);
1112
1110
  return t.success ? t.data : "unspecified";
1113
1111
  }
1114
- function K(e, t = je) {
1115
- return e.length <= t ? e : `${e.substring(0, t - 11)}${Me}`;
1112
+ function K(e, t = Me) {
1113
+ return e.length <= t ? e : `${e.substring(0, t - 11)}${Ne}`;
1116
1114
  }
1117
1115
  function q(e) {
1118
1116
  return e == null ? "" : JSON.stringify(e);
1119
1117
  }
1120
- function Pe(e) {
1118
+ function Fe(e) {
1121
1119
  let t = typeof e.blob6 == "string" && e.blob6.length > 0 ? e.blob6 : typeof e.double1 == "number" ? new Date(e.double1).toISOString() : "", n = typeof e.blob7 == "string" && e.blob7.length > 0 ? e.blob7 : t;
1122
1120
  return {
1123
1121
  id: typeof e.blob1 == "string" ? e.blob1 : "",
1124
1122
  tenant_id: typeof e.index1 == "string" ? e.index1 : "",
1125
1123
  trigger_id: typeof e.blob2 == "string" ? e.blob2 : "",
1126
- status: Ne(e.blob3),
1124
+ status: Pe(e.blob3),
1127
1125
  results: G(e.blob4) ?? [],
1128
1126
  logs: G(e.blob5),
1129
1127
  created_at: t,
1130
1128
  updated_at: n
1131
1129
  };
1132
1130
  }
1133
- function Fe(e) {
1131
+ function Ie(e) {
1134
1132
  return async (t, n) => {
1135
1133
  let r = Date.now(), i = new Date(r).toISOString(), a = {
1136
1134
  id: n.id,
@@ -1142,10 +1140,10 @@ function Fe(e) {
1142
1140
  created_at: i,
1143
1141
  updated_at: i
1144
1142
  };
1145
- return Ie(e, t, a, r), a;
1143
+ return Le(e, t, a, r), a;
1146
1144
  };
1147
1145
  }
1148
- function Ie(e, t, n, r) {
1146
+ function Le(e, t, n, r) {
1149
1147
  if (!e.analyticsEngineBinding) {
1150
1148
  console.error("Analytics Engine action_executions binding not configured; skipping write");
1151
1149
  return;
@@ -1168,29 +1166,29 @@ function Ie(e, t, n, r) {
1168
1166
  console.error("Failed to write action_execution to Analytics Engine:", e);
1169
1167
  }
1170
1168
  }
1171
- function Le(e) {
1169
+ function Re(e) {
1172
1170
  return async (t, n) => {
1173
1171
  let r = await A(e, `
1174
1172
  SELECT *
1175
- FROM ${M(e.dataset || Ae)}
1173
+ FROM ${M(e.dataset || je)}
1176
1174
  WHERE index1 = ${j(t)}
1177
1175
  AND blob1 = ${j(n)}
1178
1176
  LIMIT 1
1179
1177
  `);
1180
- return r.length === 0 || !r[0] ? null : Pe(r[0]);
1178
+ return r.length === 0 || !r[0] ? null : Fe(r[0]);
1181
1179
  };
1182
1180
  }
1183
1181
  //#endregion
1184
1182
  //#region src/analytics-engine-action-executions/index.ts
1185
1183
  function J(e) {
1186
1184
  return e.analyticsEngineBinding || console.warn("Analytics Engine: No action_executions binding configured. Executions will not be written."), (!e.accountId || !e.apiToken) && console.warn("Analytics Engine: accountId and apiToken are required to read action_executions via the SQL API."), {
1187
- create: Fe(e),
1188
- get: Le(e)
1185
+ create: Ie(e),
1186
+ get: Re(e)
1189
1187
  };
1190
1188
  }
1191
1189
  //#endregion
1192
1190
  //#region src/geo/index.ts
1193
- function Re() {
1191
+ function ze() {
1194
1192
  return { async getGeoInfo(e) {
1195
1193
  try {
1196
1194
  let t = e["cf-ipcountry"], n = e["cf-ipcity"], r = e["cf-iplatitude"], i = e["cf-iplongitude"], a = e["cf-timezone"], o = e["cf-ipcontinent"];
@@ -1209,7 +1207,7 @@ function Re() {
1209
1207
  }
1210
1208
  //#endregion
1211
1209
  //#region src/rate-limit/index.ts
1212
- var ze = class {
1210
+ var Be = class {
1213
1211
  bindings;
1214
1212
  constructor(e) {
1215
1213
  this.bindings = e;
@@ -1226,7 +1224,7 @@ var ze = class {
1226
1224
  }
1227
1225
  };
1228
1226
  function Y(e) {
1229
- if (e && Object.keys(e).some((t) => e[t])) return new ze(e);
1227
+ if (e && Object.keys(e).some((t) => e[t])) return new Be(e);
1230
1228
  }
1231
1229
  //#endregion
1232
1230
  //#region src/code-executor/worker-template.ts
@@ -1408,21 +1406,21 @@ var Z = class {
1408
1406
  throw Error(`Failed to remove hook worker ${t}: ${r.status} ${e}`);
1409
1407
  }
1410
1408
  }
1411
- }, Be = Z, Ve = {
1409
+ }, Ve = Z, He = {
1412
1410
  "post-user-login": "onExecutePostLogin",
1413
1411
  "credentials-exchange": "onExecuteCredentialsExchange",
1414
1412
  "pre-user-registration": "onExecutePreUserRegistration",
1415
1413
  "post-user-registration": "onExecutePostUserRegistration"
1416
- }, He = i;
1417
- async function Ue(e) {
1414
+ }, Ue = i;
1415
+ async function We(e) {
1418
1416
  let t = new TextEncoder().encode(e), n = await crypto.subtle.digest("SHA-256", t), r = new Uint8Array(n), i = "";
1419
1417
  for (let e of r) i += e.toString(16).padStart(2, "0");
1420
1418
  return i;
1421
1419
  }
1422
- function We(e) {
1420
+ function Ge(e) {
1423
1421
  return `
1424
- const TRIGGER_FN_NAMES = ${JSON.stringify(Ve)};
1425
- const API_SHAPES = ${JSON.stringify(He)};
1422
+ const TRIGGER_FN_NAMES = ${JSON.stringify(He)};
1423
+ const API_SHAPES = ${JSON.stringify(Ue)};
1426
1424
  const MAX_LOG_ENTRIES = 50;
1427
1425
  const MAX_LOG_LENGTH = 500;
1428
1426
 
@@ -1522,7 +1520,7 @@ export default {
1522
1520
  };
1523
1521
  `;
1524
1522
  }
1525
- var Ge = class {
1523
+ var Q = class {
1526
1524
  loader;
1527
1525
  compatibilityDate;
1528
1526
  constructor(e) {
@@ -1531,11 +1529,11 @@ var Ge = class {
1531
1529
  async execute(e) {
1532
1530
  let t = Date.now();
1533
1531
  try {
1534
- let t = We(e.code), n = {
1532
+ let t = Ge(e.code), n = {
1535
1533
  compatibilityDate: this.compatibilityDate,
1536
1534
  mainModule: "hook.js",
1537
1535
  modules: { "hook.js": t }
1538
- }, r = e.hookCodeId ? `${e.hookCodeId}-${await Ue(e.code)}` : null;
1536
+ }, r = e.hookCodeId ? `${e.hookCodeId}-${await We(e.code)}` : null;
1539
1537
  return await (await (r ? this.loader.get(r, async () => n) : this.loader.load(n)).getEntrypoint().fetch(new Request("https://hook/execute", {
1540
1538
  method: "POST",
1541
1539
  headers: { "Content-Type": "application/json" },
@@ -1556,7 +1554,7 @@ var Ge = class {
1556
1554
  };
1557
1555
  //#endregion
1558
1556
  //#region src/wfp-provisioner/provisioner.ts
1559
- function Q(e) {
1557
+ function Ke(e) {
1560
1558
  let t = n(e);
1561
1559
  return {
1562
1560
  async onProvision(e) {
@@ -1577,10 +1575,10 @@ function Q(e) {
1577
1575
  }
1578
1576
  //#endregion
1579
1577
  //#region src/wfp-provisioner/tenant-hook.ts
1580
- function Ke(e) {
1578
+ function qe(e) {
1581
1579
  return e.deployment_type === "wfp";
1582
1580
  }
1583
- var qe = 2048;
1581
+ var Je = 2048;
1584
1582
  function $(e) {
1585
1583
  let t;
1586
1584
  if (e instanceof Error) t = e.message;
@@ -1589,10 +1587,10 @@ function $(e) {
1589
1587
  } catch {
1590
1588
  t = Object.prototype.toString.call(e);
1591
1589
  }
1592
- return t.slice(0, qe);
1590
+ return t.slice(0, Je);
1593
1591
  }
1594
- function Je(e) {
1595
- let { provisioner: t, tenants: n, syncDefaults: i } = e, a = e.shouldProvision ?? Ke, o = e.logger;
1592
+ function Ye(e) {
1593
+ let { provisioner: t, tenants: n, syncDefaults: i } = e, a = e.shouldProvision ?? qe, o = e.logger;
1596
1594
  async function s(e, t) {
1597
1595
  try {
1598
1596
  await n.update(e, {
@@ -1686,15 +1684,15 @@ function Je(e) {
1686
1684
  }
1687
1685
  //#endregion
1688
1686
  //#region src/wfp-provisioner/wfp-forward.ts
1689
- var Ye = "DISPATCHER", Xe = "tenant-{tenant_id}-auth", Ze = ["/u/widget/"];
1690
- function Qe(e) {
1687
+ var Xe = "DISPATCHER", Ze = "tenant-{tenant_id}-auth", Qe = ["/u/widget/"];
1688
+ function $e(e) {
1691
1689
  return typeof e == "object" && !!e && "get" in e && typeof Reflect.get(e, "get") == "function";
1692
1690
  }
1693
- function $e(e, t) {
1691
+ function et(e, t) {
1694
1692
  return e.replace(/\{tenant_id\}/g, t);
1695
1693
  }
1696
- function et(e) {
1697
- let { tenants: t, controlPlaneTenantId: n, dispatcherBinding: r = Ye, scriptNameTemplate: i = Xe, resolveTenantId: a = (e) => e.req.header("tenant-id"), localPaths: o = Ze } = e;
1694
+ function tt(e) {
1695
+ let { tenants: t, controlPlaneTenantId: n, dispatcherBinding: r = Xe, scriptNameTemplate: i = Ze, resolveTenantId: a = (e) => e.req.header("tenant-id"), localPaths: o = Qe } = e;
1698
1696
  return async (e, s) => {
1699
1697
  if (o.length > 0) {
1700
1698
  let t = e.req.path;
@@ -1705,8 +1703,8 @@ function et(e) {
1705
1703
  let l = await t.get(c);
1706
1704
  if (!l || l.deployment_type !== "wfp" || l.provisioning_state && l.provisioning_state !== "ready") return s();
1707
1705
  let u = Reflect.get(e.env ?? {}, r);
1708
- if (!Qe(u)) return s();
1709
- let d = $e(i, c), f;
1706
+ if (!$e(u)) return s();
1707
+ let d = et(i, c), f;
1710
1708
  try {
1711
1709
  f = await u.get(d).fetch(e.req.raw);
1712
1710
  } catch (t) {
@@ -1729,19 +1727,19 @@ function et(e) {
1729
1727
  }
1730
1728
  //#endregion
1731
1729
  //#region src/index.ts
1732
- function tt(e) {
1730
+ function nt(e) {
1733
1731
  let t = {
1734
- customDomains: re(e),
1735
- cache: ae({
1732
+ customDomains: ae(e),
1733
+ cache: se({
1736
1734
  ...e.cacheName && { cacheName: e.cacheName },
1737
1735
  ...e.defaultTtlSeconds !== void 0 && { defaultTtlSeconds: e.defaultTtlSeconds },
1738
1736
  ...e.keyPrefix && { keyPrefix: e.keyPrefix }
1739
1737
  }),
1740
- geo: Re()
1738
+ geo: ze()
1741
1739
  };
1742
- e.r2SqlLogs ? t.logs = k(e.r2SqlLogs) : e.analyticsEngineLogs && (t.logs = W(e.analyticsEngineLogs)), e.analyticsEngineLogs && (t.analytics = U(e.analyticsEngineLogs)), e.analyticsEngineActionExecutions && (t.actionExecutions = J(e.analyticsEngineActionExecutions));
1740
+ e.r2SqlLogs ? t.logs = k(e.r2SqlLogs) : e.analyticsEngineLogs && (t.logs = W(e.analyticsEngineLogs)), e.analyticsEngineLogs && (t.analytics = U(e.analyticsEngineLogs), t.stats = H(e.analyticsEngineLogs)), e.analyticsEngineActionExecutions && (t.actionExecutions = J(e.analyticsEngineActionExecutions));
1743
1741
  let n = Y(e.rateLimitBindings);
1744
1742
  return n && (t.rateLimit = n), t;
1745
1743
  }
1746
1744
  //#endregion
1747
- export { t as CloudflareApiClient, e as CloudflareApiError, Be as CloudflareCodeExecutor, Z as DispatchNamespaceCodeExecutor, Ge as WorkerLoaderCodeExecutor, J as createAnalyticsEngineActionExecutionsAdapter, U as createAnalyticsEngineAnalyticsAdapter, W as createAnalyticsEngineLogsAdapter, xe as createAnalyticsEngineStatsAdapter, Y as createCloudflareRateLimitAdapter, Q as createCloudflareWfpD1Provisioner, k as createR2SQLLogsAdapter, pe as createR2SQLStatsAdapter, et as createWfpForwardMiddleware, n as createWfpProvisionerSteps, Je as createWfpTenantProvisioningHook, tt as default, X as generateWorkerScript };
1745
+ export { t as CloudflareApiClient, e as CloudflareApiError, Ve as CloudflareCodeExecutor, Z as DispatchNamespaceCodeExecutor, Q as WorkerLoaderCodeExecutor, J as createAnalyticsEngineActionExecutionsAdapter, U as createAnalyticsEngineAnalyticsAdapter, W as createAnalyticsEngineLogsAdapter, H as createAnalyticsEngineStatsAdapter, Y as createCloudflareRateLimitAdapter, Ke as createCloudflareWfpD1Provisioner, k as createR2SQLLogsAdapter, he as createR2SQLStatsAdapter, tt as createWfpForwardMiddleware, n as createWfpProvisionerSteps, Ye as createWfpTenantProvisioningHook, nt as default, X as generateWorkerScript };