@authhero/cloudflare-adapter 2.31.0 → 2.31.1

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.
Files changed (29) hide show
  1. package/dist/cloudflare-adapter.d.ts +274 -783
  2. package/dist/tsconfig.types.tsbuildinfo +1 -0
  3. package/dist/types/analytics-engine-action-executions/actionExecutions.d.ts +8 -0
  4. package/dist/types/analytics-engine-action-executions/index.d.ts +29 -0
  5. package/dist/types/analytics-engine-action-executions/types.d.ts +29 -0
  6. package/dist/types/analytics-engine-logs/analytics.d.ts +3 -0
  7. package/dist/types/analytics-engine-logs/index.d.ts +53 -0
  8. package/dist/types/analytics-engine-logs/list.d.ts +10 -0
  9. package/dist/types/analytics-engine-logs/logs.d.ts +43 -0
  10. package/dist/types/analytics-engine-logs/query.d.ts +23 -0
  11. package/dist/types/analytics-engine-logs/stats.d.ts +6 -0
  12. package/dist/types/analytics-engine-logs/types.d.ts +39 -0
  13. package/dist/types/cache/index.d.ts +44 -0
  14. package/dist/types/code-executor/index.d.ts +106 -0
  15. package/dist/types/code-executor/worker-loader.d.ts +57 -0
  16. package/dist/types/code-executor/worker-template.d.ts +10 -0
  17. package/dist/types/customDomains/index.d.ts +3 -0
  18. package/dist/types/geo/index.d.ts +37 -0
  19. package/dist/types/index.d.ts +31 -0
  20. package/dist/types/r2-sql-logs/index.d.ts +60 -0
  21. package/dist/types/r2-sql-logs/list.d.ts +11 -0
  22. package/dist/types/r2-sql-logs/logs.d.ts +8 -0
  23. package/dist/types/r2-sql-logs/query.d.ts +13 -0
  24. package/dist/types/r2-sql-logs/stats.d.ts +8 -0
  25. package/dist/types/r2-sql-logs/types.d.ts +45 -0
  26. package/dist/types/rate-limit/index.d.ts +30 -0
  27. package/dist/types/types/CloudflareConfig.d.ts +47 -0
  28. package/dist/types/types/CustomDomain.d.ts +185 -0
  29. package/package.json +5 -5
@@ -1,577 +1,59 @@
1
- // Generated by dts-bundle-generator v9.5.1
1
+ import { StatsAdapter, LogsDataAdapter, AnalyticsAdapter, ActionExecutionsAdapter, RateLimitScope, RateLimitAdapter, CustomDomainsAdapter, CodeExecutor, CodeExecutionResult, CacheAdapter, GeoAdapter } from '@authhero/adapter-interfaces';
2
2
 
3
- import { z } from '@hono/zod-openapi';
4
-
5
- declare const actionExecutionSchema: z.ZodObject<{
6
- id: z.ZodString;
7
- tenant_id: z.ZodString;
8
- trigger_id: z.ZodString;
9
- status: z.ZodEnum<{
10
- unspecified: "unspecified";
11
- pending: "pending";
12
- final: "final";
13
- partial: "partial";
14
- canceled: "canceled";
15
- suspended: "suspended";
16
- }>;
17
- results: z.ZodArray<z.ZodObject<{
18
- action_name: z.ZodString;
19
- error: z.ZodNullable<z.ZodObject<{
20
- id: z.ZodString;
21
- msg: z.ZodString;
22
- url: z.ZodOptional<z.ZodString>;
23
- }, z.core.$strip>>;
24
- started_at: z.ZodString;
25
- ended_at: z.ZodString;
26
- }, z.core.$strip>>;
27
- logs: z.ZodOptional<z.ZodArray<z.ZodObject<{
28
- action_name: z.ZodString;
29
- lines: z.ZodArray<z.ZodObject<{
30
- level: z.ZodEnum<{
31
- error: "error";
32
- log: "log";
33
- info: "info";
34
- warn: "warn";
35
- debug: "debug";
36
- }>;
37
- message: z.ZodString;
38
- }, z.core.$strip>>;
39
- }, z.core.$strip>>>;
40
- created_at: z.ZodString;
41
- updated_at: z.ZodString;
42
- }, z.core.$strip>;
43
- export type ActionExecution = z.infer<typeof actionExecutionSchema>;
44
- declare const actionExecutionInsertSchema: z.ZodObject<{
45
- id: z.ZodString;
46
- status: z.ZodEnum<{
47
- unspecified: "unspecified";
48
- pending: "pending";
49
- final: "final";
50
- partial: "partial";
51
- canceled: "canceled";
52
- suspended: "suspended";
53
- }>;
54
- trigger_id: z.ZodString;
55
- results: z.ZodArray<z.ZodObject<{
56
- action_name: z.ZodString;
57
- error: z.ZodNullable<z.ZodObject<{
58
- id: z.ZodString;
59
- msg: z.ZodString;
60
- url: z.ZodOptional<z.ZodString>;
61
- }, z.core.$strip>>;
62
- started_at: z.ZodString;
63
- ended_at: z.ZodString;
64
- }, z.core.$strip>>;
65
- logs: z.ZodOptional<z.ZodArray<z.ZodObject<{
66
- action_name: z.ZodString;
67
- lines: z.ZodArray<z.ZodObject<{
68
- level: z.ZodEnum<{
69
- error: "error";
70
- log: "log";
71
- info: "info";
72
- warn: "warn";
73
- debug: "debug";
74
- }>;
75
- message: z.ZodString;
76
- }, z.core.$strip>>;
77
- }, z.core.$strip>>>;
78
- }, z.core.$strip>;
79
- export type ActionExecutionInsert = z.infer<typeof actionExecutionInsertSchema>;
80
- export interface Totals {
81
- start: number;
82
- limit: number;
83
- length: number;
84
- total?: number;
85
- }
86
- declare const customDomainInsertSchema: z.ZodObject<{
87
- domain: z.ZodString;
88
- custom_domain_id: z.ZodOptional<z.ZodString>;
89
- type: z.ZodEnum<{
90
- auth0_managed_certs: "auth0_managed_certs";
91
- self_managed_certs: "self_managed_certs";
92
- }>;
93
- verification_method: z.ZodOptional<z.ZodEnum<{
94
- txt: "txt";
95
- }>>;
96
- tls_policy: z.ZodOptional<z.ZodEnum<{
97
- recommended: "recommended";
98
- }>>;
99
- custom_client_ip_header: z.ZodOptional<z.ZodEnum<{
100
- null: "null";
101
- "true-client-ip": "true-client-ip";
102
- "cf-connecting-ip": "cf-connecting-ip";
103
- "x-forwarded-for": "x-forwarded-for";
104
- "x-azure-clientip": "x-azure-clientip";
105
- }>>;
106
- domain_metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
107
- }, z.core.$strip>;
108
- export type CustomDomainInsert = z.infer<typeof customDomainInsertSchema>;
109
- declare const customDomainSchema: z.ZodObject<{
110
- domain: z.ZodString;
111
- type: z.ZodEnum<{
112
- auth0_managed_certs: "auth0_managed_certs";
113
- self_managed_certs: "self_managed_certs";
114
- }>;
115
- verification_method: z.ZodOptional<z.ZodEnum<{
116
- txt: "txt";
117
- }>>;
118
- custom_client_ip_header: z.ZodOptional<z.ZodEnum<{
119
- null: "null";
120
- "true-client-ip": "true-client-ip";
121
- "cf-connecting-ip": "cf-connecting-ip";
122
- "x-forwarded-for": "x-forwarded-for";
123
- "x-azure-clientip": "x-azure-clientip";
124
- }>>;
125
- domain_metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
126
- custom_domain_id: z.ZodString;
127
- primary: z.ZodBoolean;
128
- status: z.ZodEnum<{
129
- pending: "pending";
130
- disabled: "disabled";
131
- pending_verification: "pending_verification";
132
- ready: "ready";
133
- }>;
134
- origin_domain_name: z.ZodOptional<z.ZodString>;
135
- verification: z.ZodOptional<z.ZodObject<{
136
- methods: z.ZodArray<z.ZodDiscriminatedUnion<[
137
- z.ZodObject<{
138
- name: z.ZodLiteral<"txt">;
139
- record: z.ZodString;
140
- domain: z.ZodString;
141
- }, z.core.$strip>,
142
- z.ZodObject<{
143
- name: z.ZodLiteral<"http">;
144
- http_body: z.ZodString;
145
- http_url: z.ZodString;
146
- }, z.core.$strip>
147
- ], "name">>;
148
- }, z.core.$strip>>;
149
- tls_policy: z.ZodOptional<z.ZodString>;
150
- }, z.core.$strip>;
151
- export type CustomDomain = z.infer<typeof customDomainSchema>;
152
- declare const customDomainWithTenantIdSchema: z.ZodObject<{
153
- domain: z.ZodString;
154
- type: z.ZodEnum<{
155
- auth0_managed_certs: "auth0_managed_certs";
156
- self_managed_certs: "self_managed_certs";
157
- }>;
158
- verification_method: z.ZodOptional<z.ZodEnum<{
159
- txt: "txt";
160
- }>>;
161
- custom_client_ip_header: z.ZodOptional<z.ZodEnum<{
162
- null: "null";
163
- "true-client-ip": "true-client-ip";
164
- "cf-connecting-ip": "cf-connecting-ip";
165
- "x-forwarded-for": "x-forwarded-for";
166
- "x-azure-clientip": "x-azure-clientip";
167
- }>>;
168
- domain_metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
169
- custom_domain_id: z.ZodString;
170
- primary: z.ZodBoolean;
171
- status: z.ZodEnum<{
172
- pending: "pending";
173
- disabled: "disabled";
174
- pending_verification: "pending_verification";
175
- ready: "ready";
176
- }>;
177
- origin_domain_name: z.ZodOptional<z.ZodString>;
178
- verification: z.ZodOptional<z.ZodObject<{
179
- methods: z.ZodArray<z.ZodDiscriminatedUnion<[
180
- z.ZodObject<{
181
- name: z.ZodLiteral<"txt">;
182
- record: z.ZodString;
183
- domain: z.ZodString;
184
- }, z.core.$strip>,
185
- z.ZodObject<{
186
- name: z.ZodLiteral<"http">;
187
- http_body: z.ZodString;
188
- http_url: z.ZodString;
189
- }, z.core.$strip>
190
- ], "name">>;
191
- }, z.core.$strip>>;
192
- tls_policy: z.ZodOptional<z.ZodString>;
193
- tenant_id: z.ZodString;
194
- }, z.core.$strip>;
195
- export type CustomDomainWithTenantId = z.infer<typeof customDomainWithTenantIdSchema>;
196
- export interface ListParams {
197
- page?: number;
198
- per_page?: number;
199
- include_totals?: boolean;
200
- q?: string;
201
- sort?: {
202
- sort_by: string;
203
- sort_order: "asc" | "desc";
204
- };
205
- from?: string;
206
- take?: number;
207
- from_date?: number;
208
- to_date?: number;
209
- }
210
- declare const logInsertSchema: z.ZodObject<{
211
- type: z.ZodString & z.ZodType<"fn" | "acls_summary" | "actions_execution_failed" | "api_limit" | "api_limit_warning" | "appi" | "ciba_exchange_failed" | "ciba_exchange_succeeded" | "ciba_start_failed" | "ciba_start_succeeded" | "cls" | "cs" | "depnote" | "f" | "fc" | "fce" | "fco" | "fcoa" | "fcp" | "fcph" | "fcpn" | "fcpr" | "fcpro" | "fcu" | "fd" | "fdeac" | "fdeaz" | "fdecc" | "fdu" | "feacft" | "feccft" | "fecte" | "fede" | "federated_logout_failed" | "fens" | "feoobft" | "feotpft" | "fepft" | "fepotpft" | "fercft" | "ferrt" | "fertft" | "fh" | "fimp" | "fi" | "flo" | "flows_execution_completed" | "flows_execution_failed" | "forms_submission_failed" | "forms_submission_succeeded" | "fp" | "fpar" | "fpurh" | "fs" | "fsa" | "fu" | "fui" | "fv" | "fvr" | "gd_auth_email_verification" | "gd_auth_fail_email_verification" | "gd_auth_failed" | "gd_auth_rejected" | "gd_auth_succeed" | "gd_enrollment_complete" | "gd_otp_rate_limit_exceed" | "gd_recovery_failed" | "gd_recovery_rate_limit_exceed" | "gd_recovery_succeed" | "gd_send_email" | "gd_send_email_verification" | "gd_send_email_verification_failure" | "gd_send_pn" | "gd_send_pn_failure" | "gd_send_sms" | "gd_send_sms_failure" | "gd_send_voice" | "gd_send_voice_failure" | "gd_start_auth" | "gd_start_enroll" | "gd_start_enroll_failed" | "gd_tenant_update" | "gd_unenroll" | "gd_update_device_account" | "gd_webauthn_challenge_failed" | "gd_webauthn_enrollment_failed" | "kms_key_management_failure" | "kms_key_management_success" | "kms_key_state_changed" | "limit_delegation" | "limit_mu" | "limit_sul" | "limit_wc" | "i" | "mfar" | "mgmt_api_read" | "my_account_authentication_method_failed" | "my_account_authentication_method_succeeded" | "oidc_backchannel_logout_failed" | "oidc_backchannel_logout_succeeded" | "organization_member_added" | "passkey_challenge_failed" | "passkey_challenge_started" | "pla" | "pwd_leak" | "reset_pwd_leak" | "resource_cleanup" | "rich_consents_access_error" | "s" | "sapi" | "fapi" | "sce" | "scoa" | "scp" | "scpn" | "scpr" | "scu" | "scv" | "sd" | "sdu" | "seacft" | "seccft" | "secte" | "sede" | "sens" | "seoobft" | "seotpft" | "sepotpft" | "sepft" | "sepkoobft" | "sepkotpft" | "sepkrcft" | "sercft" | "sertft" | "simp" | "si" | "signup_pwd_leak" | "slo" | "sh" | "spm" | "srrt" | "ss" | "ss_sso_failure" | "ss_sso_info" | "ss_sso_success" | "ssa" | "sscim" | "sui" | "sv" | "svr" | "too_many_records" | "ublkdu" | "universal_logout_failed" | "universal_logout_succeeded" | "w" | "wn" | "wum", string, z.core.$ZodTypeInternals<"fn" | "acls_summary" | "actions_execution_failed" | "api_limit" | "api_limit_warning" | "appi" | "ciba_exchange_failed" | "ciba_exchange_succeeded" | "ciba_start_failed" | "ciba_start_succeeded" | "cls" | "cs" | "depnote" | "f" | "fc" | "fce" | "fco" | "fcoa" | "fcp" | "fcph" | "fcpn" | "fcpr" | "fcpro" | "fcu" | "fd" | "fdeac" | "fdeaz" | "fdecc" | "fdu" | "feacft" | "feccft" | "fecte" | "fede" | "federated_logout_failed" | "fens" | "feoobft" | "feotpft" | "fepft" | "fepotpft" | "fercft" | "ferrt" | "fertft" | "fh" | "fimp" | "fi" | "flo" | "flows_execution_completed" | "flows_execution_failed" | "forms_submission_failed" | "forms_submission_succeeded" | "fp" | "fpar" | "fpurh" | "fs" | "fsa" | "fu" | "fui" | "fv" | "fvr" | "gd_auth_email_verification" | "gd_auth_fail_email_verification" | "gd_auth_failed" | "gd_auth_rejected" | "gd_auth_succeed" | "gd_enrollment_complete" | "gd_otp_rate_limit_exceed" | "gd_recovery_failed" | "gd_recovery_rate_limit_exceed" | "gd_recovery_succeed" | "gd_send_email" | "gd_send_email_verification" | "gd_send_email_verification_failure" | "gd_send_pn" | "gd_send_pn_failure" | "gd_send_sms" | "gd_send_sms_failure" | "gd_send_voice" | "gd_send_voice_failure" | "gd_start_auth" | "gd_start_enroll" | "gd_start_enroll_failed" | "gd_tenant_update" | "gd_unenroll" | "gd_update_device_account" | "gd_webauthn_challenge_failed" | "gd_webauthn_enrollment_failed" | "kms_key_management_failure" | "kms_key_management_success" | "kms_key_state_changed" | "limit_delegation" | "limit_mu" | "limit_sul" | "limit_wc" | "i" | "mfar" | "mgmt_api_read" | "my_account_authentication_method_failed" | "my_account_authentication_method_succeeded" | "oidc_backchannel_logout_failed" | "oidc_backchannel_logout_succeeded" | "organization_member_added" | "passkey_challenge_failed" | "passkey_challenge_started" | "pla" | "pwd_leak" | "reset_pwd_leak" | "resource_cleanup" | "rich_consents_access_error" | "s" | "sapi" | "fapi" | "sce" | "scoa" | "scp" | "scpn" | "scpr" | "scu" | "scv" | "sd" | "sdu" | "seacft" | "seccft" | "secte" | "sede" | "sens" | "seoobft" | "seotpft" | "sepotpft" | "sepft" | "sepkoobft" | "sepkotpft" | "sepkrcft" | "sercft" | "sertft" | "simp" | "si" | "signup_pwd_leak" | "slo" | "sh" | "spm" | "srrt" | "ss" | "ss_sso_failure" | "ss_sso_info" | "ss_sso_success" | "ssa" | "sscim" | "sui" | "sv" | "svr" | "too_many_records" | "ublkdu" | "universal_logout_failed" | "universal_logout_succeeded" | "w" | "wn" | "wum", string>>;
212
- date: z.ZodString;
213
- description: z.ZodOptional<z.ZodString>;
214
- ip: z.ZodOptional<z.ZodString>;
215
- user_agent: z.ZodOptional<z.ZodString>;
216
- details: z.ZodOptional<z.ZodAny>;
217
- isMobile: z.ZodBoolean;
218
- user_id: z.ZodOptional<z.ZodString>;
219
- user_name: z.ZodOptional<z.ZodString>;
220
- connection: z.ZodOptional<z.ZodString>;
221
- connection_id: z.ZodOptional<z.ZodString>;
222
- client_id: z.ZodOptional<z.ZodString>;
223
- client_name: z.ZodOptional<z.ZodString>;
224
- audience: z.ZodOptional<z.ZodString>;
225
- scope: z.ZodOptional<z.ZodString>;
226
- strategy: z.ZodOptional<z.ZodString>;
227
- strategy_type: z.ZodOptional<z.ZodString>;
228
- hostname: z.ZodOptional<z.ZodString>;
229
- auth0_client: z.ZodOptional<z.ZodObject<{
230
- name: z.ZodString;
231
- version: z.ZodString;
232
- env: z.ZodOptional<z.ZodObject<{
233
- node: z.ZodOptional<z.ZodString>;
234
- }, z.core.$strip>>;
235
- }, z.core.$strip>>;
236
- log_id: z.ZodOptional<z.ZodString>;
237
- location_info: z.ZodOptional<z.ZodObject<{
238
- country_code: z.ZodString;
239
- city_name: z.ZodString;
240
- latitude: z.ZodString;
241
- longitude: z.ZodString;
242
- time_zone: z.ZodString;
243
- continent_code: z.ZodString;
244
- }, z.core.$strip>>;
245
- }, z.core.$strip>;
246
- export type LogInsert = z.infer<typeof logInsertSchema>;
247
- declare const logSchema: z.ZodObject<{
248
- type: z.ZodString & z.ZodType<"fn" | "acls_summary" | "actions_execution_failed" | "api_limit" | "api_limit_warning" | "appi" | "ciba_exchange_failed" | "ciba_exchange_succeeded" | "ciba_start_failed" | "ciba_start_succeeded" | "cls" | "cs" | "depnote" | "f" | "fc" | "fce" | "fco" | "fcoa" | "fcp" | "fcph" | "fcpn" | "fcpr" | "fcpro" | "fcu" | "fd" | "fdeac" | "fdeaz" | "fdecc" | "fdu" | "feacft" | "feccft" | "fecte" | "fede" | "federated_logout_failed" | "fens" | "feoobft" | "feotpft" | "fepft" | "fepotpft" | "fercft" | "ferrt" | "fertft" | "fh" | "fimp" | "fi" | "flo" | "flows_execution_completed" | "flows_execution_failed" | "forms_submission_failed" | "forms_submission_succeeded" | "fp" | "fpar" | "fpurh" | "fs" | "fsa" | "fu" | "fui" | "fv" | "fvr" | "gd_auth_email_verification" | "gd_auth_fail_email_verification" | "gd_auth_failed" | "gd_auth_rejected" | "gd_auth_succeed" | "gd_enrollment_complete" | "gd_otp_rate_limit_exceed" | "gd_recovery_failed" | "gd_recovery_rate_limit_exceed" | "gd_recovery_succeed" | "gd_send_email" | "gd_send_email_verification" | "gd_send_email_verification_failure" | "gd_send_pn" | "gd_send_pn_failure" | "gd_send_sms" | "gd_send_sms_failure" | "gd_send_voice" | "gd_send_voice_failure" | "gd_start_auth" | "gd_start_enroll" | "gd_start_enroll_failed" | "gd_tenant_update" | "gd_unenroll" | "gd_update_device_account" | "gd_webauthn_challenge_failed" | "gd_webauthn_enrollment_failed" | "kms_key_management_failure" | "kms_key_management_success" | "kms_key_state_changed" | "limit_delegation" | "limit_mu" | "limit_sul" | "limit_wc" | "i" | "mfar" | "mgmt_api_read" | "my_account_authentication_method_failed" | "my_account_authentication_method_succeeded" | "oidc_backchannel_logout_failed" | "oidc_backchannel_logout_succeeded" | "organization_member_added" | "passkey_challenge_failed" | "passkey_challenge_started" | "pla" | "pwd_leak" | "reset_pwd_leak" | "resource_cleanup" | "rich_consents_access_error" | "s" | "sapi" | "fapi" | "sce" | "scoa" | "scp" | "scpn" | "scpr" | "scu" | "scv" | "sd" | "sdu" | "seacft" | "seccft" | "secte" | "sede" | "sens" | "seoobft" | "seotpft" | "sepotpft" | "sepft" | "sepkoobft" | "sepkotpft" | "sepkrcft" | "sercft" | "sertft" | "simp" | "si" | "signup_pwd_leak" | "slo" | "sh" | "spm" | "srrt" | "ss" | "ss_sso_failure" | "ss_sso_info" | "ss_sso_success" | "ssa" | "sscim" | "sui" | "sv" | "svr" | "too_many_records" | "ublkdu" | "universal_logout_failed" | "universal_logout_succeeded" | "w" | "wn" | "wum", string, z.core.$ZodTypeInternals<"fn" | "acls_summary" | "actions_execution_failed" | "api_limit" | "api_limit_warning" | "appi" | "ciba_exchange_failed" | "ciba_exchange_succeeded" | "ciba_start_failed" | "ciba_start_succeeded" | "cls" | "cs" | "depnote" | "f" | "fc" | "fce" | "fco" | "fcoa" | "fcp" | "fcph" | "fcpn" | "fcpr" | "fcpro" | "fcu" | "fd" | "fdeac" | "fdeaz" | "fdecc" | "fdu" | "feacft" | "feccft" | "fecte" | "fede" | "federated_logout_failed" | "fens" | "feoobft" | "feotpft" | "fepft" | "fepotpft" | "fercft" | "ferrt" | "fertft" | "fh" | "fimp" | "fi" | "flo" | "flows_execution_completed" | "flows_execution_failed" | "forms_submission_failed" | "forms_submission_succeeded" | "fp" | "fpar" | "fpurh" | "fs" | "fsa" | "fu" | "fui" | "fv" | "fvr" | "gd_auth_email_verification" | "gd_auth_fail_email_verification" | "gd_auth_failed" | "gd_auth_rejected" | "gd_auth_succeed" | "gd_enrollment_complete" | "gd_otp_rate_limit_exceed" | "gd_recovery_failed" | "gd_recovery_rate_limit_exceed" | "gd_recovery_succeed" | "gd_send_email" | "gd_send_email_verification" | "gd_send_email_verification_failure" | "gd_send_pn" | "gd_send_pn_failure" | "gd_send_sms" | "gd_send_sms_failure" | "gd_send_voice" | "gd_send_voice_failure" | "gd_start_auth" | "gd_start_enroll" | "gd_start_enroll_failed" | "gd_tenant_update" | "gd_unenroll" | "gd_update_device_account" | "gd_webauthn_challenge_failed" | "gd_webauthn_enrollment_failed" | "kms_key_management_failure" | "kms_key_management_success" | "kms_key_state_changed" | "limit_delegation" | "limit_mu" | "limit_sul" | "limit_wc" | "i" | "mfar" | "mgmt_api_read" | "my_account_authentication_method_failed" | "my_account_authentication_method_succeeded" | "oidc_backchannel_logout_failed" | "oidc_backchannel_logout_succeeded" | "organization_member_added" | "passkey_challenge_failed" | "passkey_challenge_started" | "pla" | "pwd_leak" | "reset_pwd_leak" | "resource_cleanup" | "rich_consents_access_error" | "s" | "sapi" | "fapi" | "sce" | "scoa" | "scp" | "scpn" | "scpr" | "scu" | "scv" | "sd" | "sdu" | "seacft" | "seccft" | "secte" | "sede" | "sens" | "seoobft" | "seotpft" | "sepotpft" | "sepft" | "sepkoobft" | "sepkotpft" | "sepkrcft" | "sercft" | "sertft" | "simp" | "si" | "signup_pwd_leak" | "slo" | "sh" | "spm" | "srrt" | "ss" | "ss_sso_failure" | "ss_sso_info" | "ss_sso_success" | "ssa" | "sscim" | "sui" | "sv" | "svr" | "too_many_records" | "ublkdu" | "universal_logout_failed" | "universal_logout_succeeded" | "w" | "wn" | "wum", string>>;
249
- date: z.ZodString;
250
- description: z.ZodOptional<z.ZodString>;
251
- ip: z.ZodOptional<z.ZodString>;
252
- user_agent: z.ZodOptional<z.ZodString>;
253
- details: z.ZodOptional<z.ZodAny>;
254
- isMobile: z.ZodBoolean;
255
- user_id: z.ZodOptional<z.ZodString>;
256
- user_name: z.ZodOptional<z.ZodString>;
257
- connection: z.ZodOptional<z.ZodString>;
258
- connection_id: z.ZodOptional<z.ZodString>;
259
- client_id: z.ZodOptional<z.ZodString>;
260
- client_name: z.ZodOptional<z.ZodString>;
261
- audience: z.ZodOptional<z.ZodString>;
262
- scope: z.ZodOptional<z.ZodString>;
263
- strategy: z.ZodOptional<z.ZodString>;
264
- strategy_type: z.ZodOptional<z.ZodString>;
265
- hostname: z.ZodOptional<z.ZodString>;
266
- auth0_client: z.ZodOptional<z.ZodObject<{
267
- name: z.ZodString;
268
- version: z.ZodString;
269
- env: z.ZodOptional<z.ZodObject<{
270
- node: z.ZodOptional<z.ZodString>;
271
- }, z.core.$strip>>;
272
- }, z.core.$strip>>;
273
- location_info: z.ZodOptional<z.ZodObject<{
274
- country_code: z.ZodString;
275
- city_name: z.ZodString;
276
- latitude: z.ZodString;
277
- longitude: z.ZodString;
278
- time_zone: z.ZodString;
279
- continent_code: z.ZodString;
280
- }, z.core.$strip>>;
281
- log_id: z.ZodString;
282
- }, z.core.$strip>;
283
- export type Log = z.infer<typeof logSchema>;
284
- declare const dailyStatsSchema: z.ZodObject<{
285
- date: z.ZodString;
286
- logins: z.ZodNumber;
287
- signups: z.ZodNumber;
288
- leaked_passwords: z.ZodNumber;
289
- updated_at: z.ZodString;
290
- created_at: z.ZodString;
291
- }, z.core.$strip>;
292
- export type DailyStats = z.infer<typeof dailyStatsSchema>;
293
- declare const analyticsResourceSchema: z.ZodEnum<{
294
- sessions: "sessions";
295
- logins: "logins";
296
- signups: "signups";
297
- "active-users": "active-users";
298
- "refresh-tokens": "refresh-tokens";
299
- }>;
300
- export type AnalyticsResource = z.infer<typeof analyticsResourceSchema>;
301
- declare const analyticsIntervalSchema: z.ZodEnum<{
302
- hour: "hour";
303
- day: "day";
304
- week: "week";
305
- month: "month";
306
- }>;
307
- export type AnalyticsInterval = z.infer<typeof analyticsIntervalSchema>;
308
- declare const analyticsGroupBySchema: z.ZodEnum<{
309
- client_id: "client_id";
310
- connection: "connection";
311
- time: "time";
312
- user_type: "user_type";
313
- event: "event";
314
- }>;
315
- export type AnalyticsGroupBy = z.infer<typeof analyticsGroupBySchema>;
316
- declare const analyticsUserTypeSchema: z.ZodEnum<{
317
- password: "password";
318
- passwordless: "passwordless";
319
- social: "social";
320
- enterprise: "enterprise";
321
- }>;
322
- export type AnalyticsUserType = z.infer<typeof analyticsUserTypeSchema>;
323
- export interface AnalyticsFilters {
324
- connection?: string[];
325
- client_id?: string[];
326
- user_type?: AnalyticsUserType[];
327
- user_id?: string[];
328
- }
329
- export interface AnalyticsQueryParams {
330
- /** Inclusive lower bound, ISO 8601 datetime in UTC */
331
- from: string;
332
- /** Exclusive upper bound, ISO 8601 datetime in UTC */
333
- to: string;
334
- interval: AnalyticsInterval;
335
- /** IANA timezone for bucket boundaries */
336
- tz: string;
337
- filters: AnalyticsFilters;
338
- group_by: AnalyticsGroupBy[];
339
- limit: number;
340
- offset: number;
341
- /** Column name, prefix with `-` for descending */
342
- order_by?: string;
343
- }
344
- export interface AnalyticsColumnMeta {
345
- name: string;
346
- /** ClickHouse-style type label (e.g. "Date", "String", "UInt64", "DateTime") */
347
- type: string;
348
- }
349
- export interface AnalyticsQueryResponse {
350
- meta: AnalyticsColumnMeta[];
351
- data: Array<Record<string, unknown>>;
352
- rows: number;
353
- rows_before_limit_at_least?: number;
354
- statistics?: {
355
- elapsed: number;
356
- rows_read?: number;
357
- bytes_read?: number;
358
- };
359
- }
360
- export interface ActionExecutionsAdapter {
361
- create: (tenant_id: string, execution: ActionExecutionInsert) => Promise<ActionExecution>;
362
- get: (tenant_id: string, execution_id: string) => Promise<ActionExecution | null>;
363
- }
364
- export interface CacheAdapter {
365
- /**
366
- * Get a value from the cache
367
- * @param key The cache key
368
- * @returns The cached value or null if not found or expired
369
- */
370
- get<T = any>(key: string): Promise<T | null>;
371
- /**
372
- * Set a value in the cache
373
- * @param key The cache key
374
- * @param value The value to cache
375
- * @param ttlSeconds Time to live in seconds (optional)
376
- */
377
- set<T = any>(key: string, value: T, ttlSeconds?: number): Promise<void>;
378
- /**
379
- * Delete a value from the cache
380
- * @param key The cache key
381
- * @returns True if the key existed and was deleted, false otherwise
382
- */
383
- delete(key: string): Promise<boolean>;
384
- /**
385
- * Delete all values from the cache that match a key prefix
386
- * @param prefix The key prefix to match
387
- * @returns The number of keys deleted
388
- */
389
- deleteByPrefix(prefix: string): Promise<number>;
390
- /**
391
- * Clear all items from the cache
392
- */
393
- clear(): Promise<void>;
394
- }
395
- export interface ListLogsResponse extends Totals {
396
- logs: Log[];
397
- }
398
- export interface LogsDataAdapter {
399
- create(tenantId: string, params: LogInsert): Promise<Log>;
400
- list(tenantId: string, params?: ListParams): Promise<ListLogsResponse>;
401
- get(tenantId: string, logId: string): Promise<Log | null>;
402
- }
403
- export interface CustomDomainsAdapter {
404
- create: (tenant_id: string, custom_domain: CustomDomainInsert) => Promise<CustomDomain>;
405
- get: (tenant_id: string, id: string) => Promise<CustomDomain | null>;
406
- getByDomain: (domain: string) => Promise<CustomDomainWithTenantId | null>;
407
- list: (tenant_id: string) => Promise<CustomDomain[]>;
408
- remove: (tenant_id: string, id: string) => Promise<boolean>;
409
- update: (tenant_id: string, id: string, custom_domain: Partial<CustomDomain>) => Promise<boolean>;
410
- }
411
- export interface GeoInfo {
412
- country_code: string;
413
- city_name: string;
414
- latitude: string;
415
- longitude: string;
416
- time_zone: string;
417
- continent_code: string;
418
- }
419
- export interface GeoAdapter {
420
- /**
421
- * Get geo information from request headers
422
- * @param headers - Record of HTTP headers (lowercase keys)
423
- * @returns Geo information or null if not available
424
- */
425
- getGeoInfo(headers: Record<string, string>): Promise<GeoInfo | null>;
426
- }
427
- export interface StatsListParams {
428
- from?: string;
429
- to?: string;
430
- }
431
- export interface StatsAdapter {
432
- /**
433
- * Get daily statistics (logins, signups, etc.) for a date range
434
- */
435
- getDaily(tenantId: string, params?: StatsListParams): Promise<DailyStats[]>;
436
- /**
437
- * Get the number of active users in the last 30 days
438
- */
439
- getActiveUsers(tenantId: string): Promise<number>;
440
- }
441
- export interface AnalyticsAdapter {
442
- /**
443
- * Run an analytics query for a tenant. The adapter is responsible for
444
- * injecting the tenant_id predicate; the route handler never trusts a
445
- * tenant value from a client-controlled source.
446
- */
447
- query(tenantId: string, resource: AnalyticsResource, params: AnalyticsQueryParams): Promise<AnalyticsQueryResponse>;
448
- }
449
- /**
450
- * Logical buckets that consumers can rate-limit against. Backends decide
451
- * how each scope is enforced (e.g. mapping to a separate Cloudflare Workers
452
- * Rate Limiter binding with its own deploy-time limit/period).
453
- */
454
- export type RateLimitScope = "pre-login" | "pre-user-registration" | "brute-force";
455
- export interface RateLimitDecision {
456
- /** True if the request is allowed; false if the limit was exceeded. */
457
- allowed: boolean;
458
- /** Optional retry-after hint in seconds (omitted if the backend can't tell). */
459
- retryAfterSeconds?: number;
460
- }
461
- export interface RateLimitAdapter {
462
- /**
463
- * Consume one unit of quota for the given scope and key.
464
- *
465
- * The numeric threshold and window are backend-specific; the
466
- * Cloudflare Workers Rate Limiter binding bakes them in at deploy
467
- * time and cannot honor a per-tenant override. Callers that need
468
- * per-tenant `max_attempts` should layer their own counter on top.
469
- *
470
- * Returns `{ allowed: true }` if the scope is not configured, so
471
- * callers can opt in by configuring backends without changing call
472
- * sites.
473
- */
474
- consume(scope: RateLimitScope, key: string): Promise<RateLimitDecision>;
475
- }
476
- export interface CodeExecutionLog {
477
- level: "log" | "info" | "warn" | "error" | "debug";
478
- message: string;
479
- }
480
- export interface CodeExecutionResult {
481
- success: boolean;
482
- error?: string;
483
- durationMs: number;
484
- apiCalls: Array<{
485
- method: string;
486
- args: unknown[];
487
- }>;
488
- /**
489
- * Console output captured from the user code during execution. Populated by
490
- * executors that shadow `console.*` inside the sandbox; absent on executors
491
- * that don't support capture.
492
- */
493
- logs?: CodeExecutionLog[];
494
- }
495
- export interface CodeExecutor {
496
- execute(params: {
497
- code: string;
498
- hookCodeId?: string;
499
- triggerId: string;
500
- event: Record<string, unknown>;
501
- /** Wall-clock timeout for the entire execution (ms). */
502
- timeoutMs?: number;
503
- /**
504
- * CPU-time limit (ms) for runtimes that distinguish CPU time from
505
- * wall-clock time (e.g. Cloudflare Workers for Platforms).
506
- * Ignored by executors that do not support CPU-time limits.
507
- */
508
- cpuLimitMs?: number;
509
- }): Promise<CodeExecutionResult>;
510
- /**
511
- * Deploy user code to the execution environment.
512
- * Called when hook code is created or updated.
513
- * Optional — LocalCodeExecutor does not need this.
514
- */
515
- deploy?(hookCodeId: string, code: string): Promise<void>;
516
- /**
517
- * Remove user code from the execution environment.
518
- * Called when hook code is deleted.
519
- * Optional — LocalCodeExecutor does not need this.
520
- */
521
- remove?(hookCodeId: string): Promise<void>;
522
- }
523
- export interface R2SQLLogsAdapterConfig {
524
- /**
525
- * Cloudflare Pipeline HTTP endpoint URL for ingesting logs
526
- * Example: "https://{stream-id}.ingest.cloudflare.com"
527
- * Optional if using pipelineBinding or baseAdapter
528
- */
529
- pipelineEndpoint?: string;
530
- /**
531
- * Cloudflare Pipeline binding (for Workers)
532
- * Use this instead of pipelineEndpoint when running in a Worker
533
- * Pass the Pipeline object from env (e.g., env.AUTH_LOGS_STREAM)
534
- * The Pipeline has a send() method for ingesting data
535
- */
536
- pipelineBinding?: {
537
- send: (data: any) => Promise<void>;
538
- };
539
- /**
540
- * Cloudflare account ID for R2 SQL API
541
- * Required for the official API endpoint
542
- * Can be passed via environment variable: CLOUDFLARE_ACCOUNT_ID
543
- */
544
- accountId: string;
545
- /**
546
- * Cloudflare R2 SQL API token for querying logs
547
- * Can be passed via environment variable: R2_SQL_AUTH_TOKEN
548
- */
549
- authToken: string;
550
- /**
551
- * R2 warehouse name (e.g., "default")
552
- * Can be passed via environment variable: R2_WAREHOUSE_NAME
553
- */
554
- warehouseName: string;
555
- /**
556
- * Catalog database/namespace for logs (default: "default")
557
- */
558
- namespace?: string;
559
- /**
560
- * Catalog table name for logs (default: "logs")
561
- */
562
- tableName?: string;
563
- /**
564
- * HTTP timeout in milliseconds (default: 30000)
565
- */
566
- timeout?: number;
3
+ interface R2SQLLogsAdapterConfig {
4
+ /**
5
+ * Cloudflare Pipeline HTTP endpoint URL for ingesting logs
6
+ * Example: "https://{stream-id}.ingest.cloudflare.com"
7
+ * Optional if using pipelineBinding or baseAdapter
8
+ */
9
+ pipelineEndpoint?: string;
10
+ /**
11
+ * Cloudflare Pipeline binding (for Workers)
12
+ * Use this instead of pipelineEndpoint when running in a Worker
13
+ * Pass the Pipeline object from env (e.g., env.AUTH_LOGS_STREAM)
14
+ * The Pipeline has a send() method for ingesting data
15
+ */
16
+ pipelineBinding?: {
17
+ send: (data: any) => Promise<void>;
18
+ };
19
+ /**
20
+ * Cloudflare account ID for R2 SQL API
21
+ * Required for the official API endpoint
22
+ * Can be passed via environment variable: CLOUDFLARE_ACCOUNT_ID
23
+ */
24
+ accountId: string;
25
+ /**
26
+ * Cloudflare R2 SQL API token for querying logs
27
+ * Can be passed via environment variable: R2_SQL_AUTH_TOKEN
28
+ */
29
+ authToken: string;
30
+ /**
31
+ * R2 warehouse name (e.g., "default")
32
+ * Can be passed via environment variable: R2_WAREHOUSE_NAME
33
+ */
34
+ warehouseName: string;
35
+ /**
36
+ * Catalog database/namespace for logs (default: "default")
37
+ */
38
+ namespace?: string;
39
+ /**
40
+ * Catalog table name for logs (default: "logs")
41
+ */
42
+ tableName?: string;
43
+ /**
44
+ * HTTP timeout in milliseconds (default: 30000)
45
+ */
46
+ timeout?: number;
567
47
  }
48
+
568
49
  /**
569
50
  * Create a stats adapter for R2 SQL that returns "not supported" errors
570
51
  *
571
52
  * R2 SQL logs does not currently support stats queries.
572
53
  * Use the Analytics Engine stats adapter or Kysely stats adapter instead.
573
54
  */
574
- export declare function createR2SQLStatsAdapter(): StatsAdapter;
55
+ declare function createR2SQLStatsAdapter(): StatsAdapter;
56
+
575
57
  /**
576
58
  * Create an R2 SQL logs adapter
577
59
  *
@@ -626,51 +108,55 @@ export declare function createR2SQLStatsAdapter(): StatsAdapter;
626
108
  * });
627
109
  * ```
628
110
  */
629
- export declare function createR2SQLLogsAdapter(config: R2SQLLogsAdapterConfig): LogsDataAdapter;
111
+ declare function createR2SQLLogsAdapter(config: R2SQLLogsAdapterConfig): LogsDataAdapter;
112
+
630
113
  /**
631
114
  * Analytics Engine dataset binding type
632
115
  * This is the binding object provided by Cloudflare Workers
633
116
  */
634
- export interface AnalyticsEngineDataset {
635
- writeDataPoint(data: {
636
- blobs?: string[];
637
- doubles?: number[];
638
- indexes?: string[];
639
- }): void;
640
- }
641
- export interface AnalyticsEngineLogsAdapterConfig {
642
- /**
643
- * Cloudflare Analytics Engine dataset binding (for Workers)
644
- * Pass the Analytics Engine dataset object from env (e.g., env.AUTH_LOGS)
645
- */
646
- analyticsEngineBinding?: AnalyticsEngineDataset;
647
- /**
648
- * Cloudflare account ID for querying logs via SQL API
649
- * Required for the SQL API endpoint
650
- * Can be passed via environment variable: CLOUDFLARE_ACCOUNT_ID
651
- */
652
- accountId: string;
653
- /**
654
- * Cloudflare API token for querying logs via SQL API
655
- * Must have Analytics Engine SQL API permissions
656
- * Can be passed via environment variable: ANALYTICS_ENGINE_API_TOKEN
657
- */
658
- apiToken: string;
659
- /**
660
- * Analytics Engine dataset name (default: "authhero_logs")
661
- * This should match the dataset name configured in wrangler.toml
662
- */
663
- dataset?: string;
664
- /**
665
- * HTTP timeout in milliseconds for SQL API queries (default: 30000)
666
- */
667
- timeout?: number;
117
+ interface AnalyticsEngineDataset {
118
+ writeDataPoint(data: {
119
+ blobs?: string[];
120
+ doubles?: number[];
121
+ indexes?: string[];
122
+ }): void;
123
+ }
124
+ interface AnalyticsEngineLogsAdapterConfig {
125
+ /**
126
+ * Cloudflare Analytics Engine dataset binding (for Workers)
127
+ * Pass the Analytics Engine dataset object from env (e.g., env.AUTH_LOGS)
128
+ */
129
+ analyticsEngineBinding?: AnalyticsEngineDataset;
130
+ /**
131
+ * Cloudflare account ID for querying logs via SQL API
132
+ * Required for the SQL API endpoint
133
+ * Can be passed via environment variable: CLOUDFLARE_ACCOUNT_ID
134
+ */
135
+ accountId: string;
136
+ /**
137
+ * Cloudflare API token for querying logs via SQL API
138
+ * Must have Analytics Engine SQL API permissions
139
+ * Can be passed via environment variable: ANALYTICS_ENGINE_API_TOKEN
140
+ */
141
+ apiToken: string;
142
+ /**
143
+ * Analytics Engine dataset name (default: "authhero_logs")
144
+ * This should match the dataset name configured in wrangler.toml
145
+ */
146
+ dataset?: string;
147
+ /**
148
+ * HTTP timeout in milliseconds for SQL API queries (default: 30000)
149
+ */
150
+ timeout?: number;
668
151
  }
152
+
669
153
  /**
670
154
  * Create a stats adapter that queries Analytics Engine
671
155
  */
672
- export declare function createAnalyticsEngineStatsAdapter(config: AnalyticsEngineLogsAdapterConfig): StatsAdapter;
673
- export declare function createAnalyticsEngineAnalyticsAdapter(config: AnalyticsEngineLogsAdapterConfig): AnalyticsAdapter;
156
+ declare function createAnalyticsEngineStatsAdapter(config: AnalyticsEngineLogsAdapterConfig): StatsAdapter;
157
+
158
+ declare function createAnalyticsEngineAnalyticsAdapter(config: AnalyticsEngineLogsAdapterConfig): AnalyticsAdapter;
159
+
674
160
  /**
675
161
  * Create an Analytics Engine logs adapter
676
162
  *
@@ -718,35 +204,37 @@ export declare function createAnalyticsEngineAnalyticsAdapter(config: AnalyticsE
718
204
  * });
719
205
  * ```
720
206
  */
721
- export declare function createAnalyticsEngineLogsAdapter(config: AnalyticsEngineLogsAdapterConfig): LogsDataAdapter;
722
- export interface AnalyticsEngineActionExecutionsAdapterConfig {
723
- /**
724
- * Cloudflare Analytics Engine dataset binding (for Workers).
725
- * Pass the Analytics Engine dataset object from env (e.g.
726
- * env.AUTH_ACTION_EXECUTIONS).
727
- */
728
- analyticsEngineBinding?: AnalyticsEngineDataset;
729
- /**
730
- * Cloudflare account ID for querying via the SQL API.
731
- * Can be passed via environment variable: CLOUDFLARE_ACCOUNT_ID.
732
- */
733
- accountId: string;
734
- /**
735
- * Cloudflare API token for querying via the SQL API.
736
- * Must have Analytics Engine SQL API permissions.
737
- * Can be passed via environment variable: ANALYTICS_ENGINE_API_TOKEN.
738
- */
739
- apiToken: string;
740
- /**
741
- * Analytics Engine dataset name (default: "authhero_action_executions").
742
- * Should match the dataset name configured in wrangler.toml.
743
- */
744
- dataset?: string;
745
- /**
746
- * HTTP timeout in milliseconds for SQL API queries (default: 30000).
747
- */
748
- timeout?: number;
207
+ declare function createAnalyticsEngineLogsAdapter(config: AnalyticsEngineLogsAdapterConfig): LogsDataAdapter;
208
+
209
+ interface AnalyticsEngineActionExecutionsAdapterConfig {
210
+ /**
211
+ * Cloudflare Analytics Engine dataset binding (for Workers).
212
+ * Pass the Analytics Engine dataset object from env (e.g.
213
+ * env.AUTH_ACTION_EXECUTIONS).
214
+ */
215
+ analyticsEngineBinding?: AnalyticsEngineDataset;
216
+ /**
217
+ * Cloudflare account ID for querying via the SQL API.
218
+ * Can be passed via environment variable: CLOUDFLARE_ACCOUNT_ID.
219
+ */
220
+ accountId: string;
221
+ /**
222
+ * Cloudflare API token for querying via the SQL API.
223
+ * Must have Analytics Engine SQL API permissions.
224
+ * Can be passed via environment variable: ANALYTICS_ENGINE_API_TOKEN.
225
+ */
226
+ apiToken: string;
227
+ /**
228
+ * Analytics Engine dataset name (default: "authhero_action_executions").
229
+ * Should match the dataset name configured in wrangler.toml.
230
+ */
231
+ dataset?: string;
232
+ /**
233
+ * HTTP timeout in milliseconds for SQL API queries (default: 30000).
234
+ */
235
+ timeout?: number;
749
236
  }
237
+
750
238
  /**
751
239
  * Create an Analytics Engine action_executions adapter.
752
240
  *
@@ -772,7 +260,8 @@ export interface AnalyticsEngineActionExecutionsAdapterConfig {
772
260
  * });
773
261
  * ```
774
262
  */
775
- export declare function createAnalyticsEngineActionExecutionsAdapter(config: AnalyticsEngineActionExecutionsAdapterConfig): ActionExecutionsAdapter;
263
+ declare function createAnalyticsEngineActionExecutionsAdapter(config: AnalyticsEngineActionExecutionsAdapterConfig): ActionExecutionsAdapter;
264
+
776
265
  /**
777
266
  * Minimal shape of the Cloudflare Workers Rate Limiter binding. We declare
778
267
  * it locally rather than depending on `@cloudflare/workers-types` so the
@@ -780,12 +269,12 @@ export declare function createAnalyticsEngineActionExecutionsAdapter(config: Ana
780
269
  *
781
270
  * Reference: https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/
782
271
  */
783
- export interface CloudflareRateLimitBinding {
784
- limit(options: {
785
- key: string;
786
- }): Promise<{
787
- success: boolean;
788
- }>;
272
+ interface CloudflareRateLimitBinding {
273
+ limit(options: {
274
+ key: string;
275
+ }): Promise<{
276
+ success: boolean;
277
+ }>;
789
278
  }
790
279
  /**
791
280
  * Map of scopes to Cloudflare Workers Rate Limiter bindings. Each binding's
@@ -800,50 +289,52 @@ export interface CloudflareRateLimitBinding {
800
289
  * Any scope omitted from this map results in a permissive ("allowed: true")
801
290
  * decision so callers can configure backends incrementally.
802
291
  */
803
- export type CloudflareRateLimitBindings = Partial<Record<RateLimitScope, CloudflareRateLimitBinding>>;
804
- export declare function createCloudflareRateLimitAdapter(bindings: CloudflareRateLimitBindings | undefined): RateLimitAdapter | undefined;
805
- export interface CloudflareConfig {
806
- zoneId: string;
807
- authKey: string;
808
- authEmail: string;
809
- enterprise?: boolean;
810
- customDomainAdapter: CustomDomainsAdapter;
811
- /**
812
- * Cache name to use (optional, defaults to "default")
813
- */
814
- cacheName?: string;
815
- /**
816
- * Default TTL in seconds for cache entries (optional)
817
- */
818
- defaultTtlSeconds?: number;
819
- /**
820
- * Key prefix to namespace cache entries (optional)
821
- */
822
- keyPrefix?: string;
823
- /**
824
- * R2 SQL logs adapter configuration (optional)
825
- * Use this for high-volume log storage with R2 Pipelines and R2 SQL
826
- */
827
- r2SqlLogs?: R2SQLLogsAdapterConfig;
828
- /**
829
- * Analytics Engine logs adapter configuration (optional)
830
- * Use this for low-latency log writes with Cloudflare Analytics Engine
831
- */
832
- analyticsEngineLogs?: AnalyticsEngineLogsAdapterConfig;
833
- /**
834
- * Analytics Engine action_executions adapter configuration (optional).
835
- * Stores Auth0-shaped action execution records in a dedicated AE dataset
836
- * so logs and the executions they reference can both live in AE.
837
- */
838
- analyticsEngineActionExecutions?: AnalyticsEngineActionExecutionsAdapterConfig;
839
- /**
840
- * Cloudflare Workers Rate Limiter bindings, keyed by logical scope.
841
- * Each binding's `limit` and `period` are baked in at deploy time; this
842
- * adapter can't override them per tenant. Bindings are optional any
843
- * unconfigured scope is treated as permissive.
844
- */
845
- rateLimitBindings?: CloudflareRateLimitBindings;
292
+ type CloudflareRateLimitBindings = Partial<Record<RateLimitScope, CloudflareRateLimitBinding>>;
293
+ declare function createCloudflareRateLimitAdapter(bindings: CloudflareRateLimitBindings | undefined): RateLimitAdapter | undefined;
294
+
295
+ interface CloudflareConfig {
296
+ zoneId: string;
297
+ authKey: string;
298
+ authEmail: string;
299
+ enterprise?: boolean;
300
+ customDomainAdapter: CustomDomainsAdapter;
301
+ /**
302
+ * Cache name to use (optional, defaults to "default")
303
+ */
304
+ cacheName?: string;
305
+ /**
306
+ * Default TTL in seconds for cache entries (optional)
307
+ */
308
+ defaultTtlSeconds?: number;
309
+ /**
310
+ * Key prefix to namespace cache entries (optional)
311
+ */
312
+ keyPrefix?: string;
313
+ /**
314
+ * R2 SQL logs adapter configuration (optional)
315
+ * Use this for high-volume log storage with R2 Pipelines and R2 SQL
316
+ */
317
+ r2SqlLogs?: R2SQLLogsAdapterConfig;
318
+ /**
319
+ * Analytics Engine logs adapter configuration (optional)
320
+ * Use this for low-latency log writes with Cloudflare Analytics Engine
321
+ */
322
+ analyticsEngineLogs?: AnalyticsEngineLogsAdapterConfig;
323
+ /**
324
+ * Analytics Engine action_executions adapter configuration (optional).
325
+ * Stores Auth0-shaped action execution records in a dedicated AE dataset
326
+ * so logs and the executions they reference can both live in AE.
327
+ */
328
+ analyticsEngineActionExecutions?: AnalyticsEngineActionExecutionsAdapterConfig;
329
+ /**
330
+ * Cloudflare Workers Rate Limiter bindings, keyed by logical scope.
331
+ * Each binding's `limit` and `period` are baked in at deploy time; this
332
+ * adapter can't override them per tenant. Bindings are optional — any
333
+ * unconfigured scope is treated as permissive.
334
+ */
335
+ rateLimitBindings?: CloudflareRateLimitBindings;
846
336
  }
337
+
847
338
  /**
848
339
  * Cloudflare Workers for Platforms dispatch namespace binding type.
849
340
  * This is the type of `env.DISPATCHER` when configured in wrangler.toml:
@@ -854,40 +345,40 @@ export interface CloudflareConfig {
854
345
  * namespace = "authhero-hooks"
855
346
  * ```
856
347
  */
857
- export interface DispatchNamespace {
858
- get(name: string, options?: Record<string, unknown>, init?: {
859
- limits?: {
860
- cpuMs?: number;
861
- subrequests?: number;
862
- };
863
- }): {
864
- fetch(request: Request | string, init?: RequestInit): Promise<Response>;
865
- };
866
- }
867
- export interface DispatchNamespaceCodeExecutorConfig {
868
- /** Cloudflare account ID */
869
- accountId: string;
870
- /** API token with Workers Scripts write permission */
871
- apiToken: string;
872
- /** Dispatch namespace name (e.g., "authhero-hooks") */
873
- dispatchNamespace: string;
874
- /**
875
- * Dispatch namespace binding from the worker environment.
876
- * When running inside a Cloudflare Worker, pass `env.DISPATCHER`.
877
- * Enables low-latency same-origin invocation.
878
- */
879
- dispatcher?: DispatchNamespace;
880
- /**
881
- * Fallback URL for invoking user workers when no dispatcher binding is available.
882
- * The executor appends `/{scriptName}` to this URL.
883
- * Only used when `dispatcher` is not provided.
884
- */
885
- dispatchUrl?: string;
886
- /**
887
- * Cloudflare Workers compatibility date used when deploying scripts.
888
- * Defaults to "2024-11-20" if not provided.
889
- */
890
- compatibilityDate?: string;
348
+ interface DispatchNamespace {
349
+ get(name: string, options?: Record<string, unknown>, init?: {
350
+ limits?: {
351
+ cpuMs?: number;
352
+ subrequests?: number;
353
+ };
354
+ }): {
355
+ fetch(request: Request | string, init?: RequestInit): Promise<Response>;
356
+ };
357
+ }
358
+ interface DispatchNamespaceCodeExecutorConfig {
359
+ /** Cloudflare account ID */
360
+ accountId: string;
361
+ /** API token with Workers Scripts write permission */
362
+ apiToken: string;
363
+ /** Dispatch namespace name (e.g., "authhero-hooks") */
364
+ dispatchNamespace: string;
365
+ /**
366
+ * Dispatch namespace binding from the worker environment.
367
+ * When running inside a Cloudflare Worker, pass `env.DISPATCHER`.
368
+ * Enables low-latency same-origin invocation.
369
+ */
370
+ dispatcher?: DispatchNamespace;
371
+ /**
372
+ * Fallback URL for invoking user workers when no dispatcher binding is available.
373
+ * The executor appends `/{scriptName}` to this URL.
374
+ * Only used when `dispatcher` is not provided.
375
+ */
376
+ dispatchUrl?: string;
377
+ /**
378
+ * Cloudflare Workers compatibility date used when deploying scripts.
379
+ * Defaults to "2024-11-20" if not provided.
380
+ */
381
+ compatibilityDate?: string;
891
382
  }
892
383
  /**
893
384
  * Code executor that uses Cloudflare Workers for Platforms dispatch namespaces.
@@ -913,32 +404,32 @@ export interface DispatchNamespaceCodeExecutorConfig {
913
404
  * const { app } = init({ dataAdapter, codeExecutor });
914
405
  * ```
915
406
  */
916
- export declare class DispatchNamespaceCodeExecutor implements CodeExecutor {
917
- private config;
918
- constructor(config: DispatchNamespaceCodeExecutorConfig);
919
- execute(params: {
920
- code: string;
921
- hookCodeId?: string;
922
- triggerId: string;
923
- event: Record<string, unknown>;
924
- /** Wall-clock timeout (ms). Used for HTTP-based fallback invocation. */
925
- timeoutMs?: number;
926
- /**
927
- * CPU-time limit (ms) passed to the Cloudflare dispatcher binding.
928
- * Unlike timeoutMs (wall-clock), this caps only actual CPU cycles;
929
- * I/O wait does not count against it. Defaults to 5 000 ms.
930
- */
931
- cpuLimitMs?: number;
932
- }): Promise<CodeExecutionResult>;
933
- /**
934
- * Deploy user code as a worker to the dispatch namespace.
935
- * Wraps the code in a worker template and uploads via Cloudflare API.
936
- */
937
- deploy(hookCodeId: string, code: string): Promise<void>;
938
- /**
939
- * Remove a user worker from the dispatch namespace.
940
- */
941
- remove(hookCodeId: string): Promise<void>;
407
+ declare class DispatchNamespaceCodeExecutor implements CodeExecutor {
408
+ private config;
409
+ constructor(config: DispatchNamespaceCodeExecutorConfig);
410
+ execute(params: {
411
+ code: string;
412
+ hookCodeId?: string;
413
+ triggerId: string;
414
+ event: Record<string, unknown>;
415
+ /** Wall-clock timeout (ms). Used for HTTP-based fallback invocation. */
416
+ timeoutMs?: number;
417
+ /**
418
+ * CPU-time limit (ms) passed to the Cloudflare dispatcher binding.
419
+ * Unlike timeoutMs (wall-clock), this caps only actual CPU cycles;
420
+ * I/O wait does not count against it. Defaults to 5 000 ms.
421
+ */
422
+ cpuLimitMs?: number;
423
+ }): Promise<CodeExecutionResult>;
424
+ /**
425
+ * Deploy user code as a worker to the dispatch namespace.
426
+ * Wraps the code in a worker template and uploads via Cloudflare API.
427
+ */
428
+ deploy(hookCodeId: string, code: string): Promise<void>;
429
+ /**
430
+ * Remove a user worker from the dispatch namespace.
431
+ */
432
+ remove(hookCodeId: string): Promise<void>;
942
433
  }
943
434
  /**
944
435
  * @deprecated Renamed to `DispatchNamespaceCodeExecutor` to disambiguate from
@@ -946,9 +437,10 @@ export declare class DispatchNamespaceCodeExecutor implements CodeExecutor {
946
437
  * Loader binding instead of Workers for Platforms). This alias will be removed
947
438
  * in the next major.
948
439
  */
949
- export declare const CloudflareCodeExecutor: typeof DispatchNamespaceCodeExecutor;
440
+ declare const CloudflareCodeExecutor: typeof DispatchNamespaceCodeExecutor;
950
441
  /** @deprecated Use `DispatchNamespaceCodeExecutorConfig`. */
951
- export type CloudflareCodeExecutorConfig = DispatchNamespaceCodeExecutorConfig;
442
+ type CloudflareCodeExecutorConfig = DispatchNamespaceCodeExecutorConfig;
443
+
952
444
  /**
953
445
  * Generates a Cloudflare Worker script that wraps user-authored code.
954
446
  *
@@ -958,30 +450,31 @@ export type CloudflareCodeExecutorConfig = DispatchNamespaceCodeExecutorConfig;
958
450
  * 3. Runs the user's exported function (e.g., exports.onExecutePostLogin)
959
451
  * 4. Returns { success, apiCalls, error, durationMs } as JSON
960
452
  */
961
- export declare function generateWorkerScript(userCode: string): string;
453
+ declare function generateWorkerScript(userCode: string): string;
454
+
962
455
  /**
963
456
  * Worker Loader binding type (Cloudflare Dynamic Workers).
964
457
  * Configure in wrangler.toml:
965
458
  * [[worker_loaders]]
966
459
  * binding = "LOADER"
967
460
  */
968
- export interface WorkerLoader {
969
- load(code: WorkerCode): WorkerStub;
970
- get(id: string, callback: () => Promise<WorkerCode>): WorkerStub;
461
+ interface WorkerLoader {
462
+ load(code: WorkerCode): WorkerStub;
463
+ get(id: string, callback: () => Promise<WorkerCode>): WorkerStub;
971
464
  }
972
- export interface WorkerCode {
973
- compatibilityDate: string;
974
- mainModule: string;
975
- modules: Record<string, string>;
465
+ interface WorkerCode {
466
+ compatibilityDate: string;
467
+ mainModule: string;
468
+ modules: Record<string, string>;
976
469
  }
977
- export interface WorkerStub {
978
- getEntrypoint(): {
979
- fetch(request: Request): Promise<Response>;
980
- };
470
+ interface WorkerStub {
471
+ getEntrypoint(): {
472
+ fetch(request: Request): Promise<Response>;
473
+ };
981
474
  }
982
- export interface WorkerLoaderCodeExecutorOptions {
983
- loader: WorkerLoader;
984
- compatibilityDate?: string;
475
+ interface WorkerLoaderCodeExecutorOptions {
476
+ loader: WorkerLoader;
477
+ compatibilityDate?: string;
985
478
  }
986
479
  /**
987
480
  * Cloudflare Dynamic Workers code executor (Worker Loader binding).
@@ -1001,32 +494,30 @@ export interface WorkerLoaderCodeExecutorOptions {
1001
494
  * Platforms dispatch namespaces and requires user code to be pre-deployed
1002
495
  * as individual worker scripts via the Cloudflare API.
1003
496
  */
1004
- export declare class WorkerLoaderCodeExecutor implements CodeExecutor {
1005
- private loader;
1006
- private compatibilityDate;
1007
- constructor(options: WorkerLoaderCodeExecutorOptions);
1008
- execute(params: {
1009
- code: string;
1010
- hookCodeId?: string;
1011
- triggerId: string;
1012
- event: Record<string, unknown>;
1013
- timeoutMs?: number;
1014
- cpuLimitMs?: number;
1015
- }): Promise<CodeExecutionResult>;
497
+ declare class WorkerLoaderCodeExecutor implements CodeExecutor {
498
+ private loader;
499
+ private compatibilityDate;
500
+ constructor(options: WorkerLoaderCodeExecutorOptions);
501
+ execute(params: {
502
+ code: string;
503
+ hookCodeId?: string;
504
+ triggerId: string;
505
+ event: Record<string, unknown>;
506
+ timeoutMs?: number;
507
+ cpuLimitMs?: number;
508
+ }): Promise<CodeExecutionResult>;
1016
509
  }
1017
- export interface CloudflareAdapters {
1018
- customDomains: CustomDomainsAdapter;
1019
- cache: CacheAdapter;
1020
- logs?: LogsDataAdapter;
1021
- analytics?: AnalyticsAdapter;
1022
- geo?: GeoAdapter;
1023
- rateLimit?: RateLimitAdapter;
1024
- actionExecutions?: ActionExecutionsAdapter;
510
+
511
+ interface CloudflareAdapters {
512
+ customDomains: CustomDomainsAdapter;
513
+ cache: CacheAdapter;
514
+ logs?: LogsDataAdapter;
515
+ analytics?: AnalyticsAdapter;
516
+ geo?: GeoAdapter;
517
+ rateLimit?: RateLimitAdapter;
518
+ actionExecutions?: ActionExecutionsAdapter;
1025
519
  }
1026
520
  declare function createAdapters(config: CloudflareConfig): CloudflareAdapters;
1027
521
 
1028
- export {
1029
- createAdapters as default,
1030
- };
1031
-
1032
- export {};
522
+ export { CloudflareCodeExecutor, DispatchNamespaceCodeExecutor, WorkerLoaderCodeExecutor, createAnalyticsEngineActionExecutionsAdapter, createAnalyticsEngineAnalyticsAdapter, createAnalyticsEngineLogsAdapter, createAnalyticsEngineStatsAdapter, createCloudflareRateLimitAdapter, createR2SQLLogsAdapter, createR2SQLStatsAdapter, createAdapters as default, generateWorkerScript };
523
+ export type { AnalyticsEngineActionExecutionsAdapterConfig, AnalyticsEngineDataset, AnalyticsEngineLogsAdapterConfig, CloudflareAdapters, CloudflareCodeExecutorConfig, CloudflareConfig, CloudflareRateLimitBinding, CloudflareRateLimitBindings, DispatchNamespace, DispatchNamespaceCodeExecutorConfig, R2SQLLogsAdapterConfig };