@authhero/cloudflare-adapter 2.7.6 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,11 @@
2
2
 
3
3
  import { z } from '@hono/zod-openapi';
4
4
 
5
+ export interface Totals {
6
+ start: number;
7
+ limit: number;
8
+ length: number;
9
+ }
5
10
  declare const customDomainInsertSchema: z.ZodObject<{
6
11
  domain: z.ZodString;
7
12
  custom_domain_id: z.ZodOptional<z.ZodString>;
@@ -229,6 +234,310 @@ declare const customDomainWithTenantIdSchema: z.ZodObject<{
229
234
  } | undefined;
230
235
  }>;
231
236
  export type CustomDomainWithTenantId = z.infer<typeof customDomainWithTenantIdSchema>;
237
+ export interface ListParams {
238
+ page?: number;
239
+ per_page?: number;
240
+ include_totals?: boolean;
241
+ q?: string;
242
+ sort?: {
243
+ sort_by: string;
244
+ sort_order: "asc" | "desc";
245
+ };
246
+ }
247
+ declare const logInsertSchema: z.ZodObject<{
248
+ type: z.ZodEffects<z.ZodString, "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" | "fi" | "flo" | "flows_execution_completed" | "flows_execution_failed" | "fn" | "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" | "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" | "sce" | "scoa" | "scp" | "scpn" | "scpr" | "scu" | "scv" | "sd" | "sdu" | "seacft" | "seccft" | "secte" | "sede" | "sens" | "seoobft" | "seotpft" | "sepft" | "sepkoobft" | "sepkotpft" | "sepkrcft" | "sercft" | "sertft" | "si" | "signup_pwd_leak" | "slo" | "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
+ }, "strip", z.ZodTypeAny, {
272
+ node?: string | undefined;
273
+ }, {
274
+ node?: string | undefined;
275
+ }>>;
276
+ }, "strip", z.ZodTypeAny, {
277
+ name: string;
278
+ version: string;
279
+ env?: {
280
+ node?: string | undefined;
281
+ } | undefined;
282
+ }, {
283
+ name: string;
284
+ version: string;
285
+ env?: {
286
+ node?: string | undefined;
287
+ } | undefined;
288
+ }>>;
289
+ log_id: z.ZodOptional<z.ZodString>;
290
+ location_info: z.ZodOptional<z.ZodObject<{
291
+ country_code: z.ZodString;
292
+ country_code3: z.ZodString;
293
+ country_name: z.ZodString;
294
+ city_name: z.ZodString;
295
+ latitude: z.ZodString;
296
+ longitude: z.ZodString;
297
+ time_zone: z.ZodString;
298
+ continent_code: z.ZodString;
299
+ }, "strip", z.ZodTypeAny, {
300
+ country_code: string;
301
+ country_code3: string;
302
+ country_name: string;
303
+ city_name: string;
304
+ latitude: string;
305
+ longitude: string;
306
+ time_zone: string;
307
+ continent_code: string;
308
+ }, {
309
+ country_code: string;
310
+ country_code3: string;
311
+ country_name: string;
312
+ city_name: string;
313
+ latitude: string;
314
+ longitude: string;
315
+ time_zone: string;
316
+ continent_code: string;
317
+ }>>;
318
+ }, "strip", z.ZodTypeAny, {
319
+ type: "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" | "fi" | "flo" | "flows_execution_completed" | "flows_execution_failed" | "fn" | "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" | "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" | "sce" | "scoa" | "scp" | "scpn" | "scpr" | "scu" | "scv" | "sd" | "sdu" | "seacft" | "seccft" | "secte" | "sede" | "sens" | "seoobft" | "seotpft" | "sepft" | "sepkoobft" | "sepkotpft" | "sepkrcft" | "sercft" | "sertft" | "si" | "signup_pwd_leak" | "slo" | "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";
320
+ date: string;
321
+ isMobile: boolean;
322
+ description?: string | undefined;
323
+ connection?: string | undefined;
324
+ user_id?: string | undefined;
325
+ client_id?: string | undefined;
326
+ audience?: string | undefined;
327
+ scope?: string | undefined;
328
+ strategy?: string | undefined;
329
+ connection_id?: string | undefined;
330
+ ip?: string | undefined;
331
+ user_agent?: string | undefined;
332
+ details?: any;
333
+ user_name?: string | undefined;
334
+ client_name?: string | undefined;
335
+ strategy_type?: string | undefined;
336
+ hostname?: string | undefined;
337
+ auth0_client?: {
338
+ name: string;
339
+ version: string;
340
+ env?: {
341
+ node?: string | undefined;
342
+ } | undefined;
343
+ } | undefined;
344
+ log_id?: string | undefined;
345
+ location_info?: {
346
+ country_code: string;
347
+ country_code3: string;
348
+ country_name: string;
349
+ city_name: string;
350
+ latitude: string;
351
+ longitude: string;
352
+ time_zone: string;
353
+ continent_code: string;
354
+ } | undefined;
355
+ }, {
356
+ type: string;
357
+ date: string;
358
+ isMobile: boolean;
359
+ description?: string | undefined;
360
+ connection?: string | undefined;
361
+ user_id?: string | undefined;
362
+ client_id?: string | undefined;
363
+ audience?: string | undefined;
364
+ scope?: string | undefined;
365
+ strategy?: string | undefined;
366
+ connection_id?: string | undefined;
367
+ ip?: string | undefined;
368
+ user_agent?: string | undefined;
369
+ details?: any;
370
+ user_name?: string | undefined;
371
+ client_name?: string | undefined;
372
+ strategy_type?: string | undefined;
373
+ hostname?: string | undefined;
374
+ auth0_client?: {
375
+ name: string;
376
+ version: string;
377
+ env?: {
378
+ node?: string | undefined;
379
+ } | undefined;
380
+ } | undefined;
381
+ log_id?: string | undefined;
382
+ location_info?: {
383
+ country_code: string;
384
+ country_code3: string;
385
+ country_name: string;
386
+ city_name: string;
387
+ latitude: string;
388
+ longitude: string;
389
+ time_zone: string;
390
+ continent_code: string;
391
+ } | undefined;
392
+ }>;
393
+ export type LogInsert = z.infer<typeof logInsertSchema>;
394
+ declare const logSchema: z.ZodObject<{
395
+ log_id: z.ZodString;
396
+ type: z.ZodEffects<z.ZodString, "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" | "fi" | "flo" | "flows_execution_completed" | "flows_execution_failed" | "fn" | "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" | "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" | "sce" | "scoa" | "scp" | "scpn" | "scpr" | "scu" | "scv" | "sd" | "sdu" | "seacft" | "seccft" | "secte" | "sede" | "sens" | "seoobft" | "seotpft" | "sepft" | "sepkoobft" | "sepkotpft" | "sepkrcft" | "sercft" | "sertft" | "si" | "signup_pwd_leak" | "slo" | "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>;
397
+ date: z.ZodString;
398
+ description: z.ZodOptional<z.ZodString>;
399
+ ip: z.ZodOptional<z.ZodString>;
400
+ user_agent: z.ZodOptional<z.ZodString>;
401
+ details: z.ZodOptional<z.ZodAny>;
402
+ isMobile: z.ZodBoolean;
403
+ user_id: z.ZodOptional<z.ZodString>;
404
+ user_name: z.ZodOptional<z.ZodString>;
405
+ connection: z.ZodOptional<z.ZodString>;
406
+ connection_id: z.ZodOptional<z.ZodString>;
407
+ client_id: z.ZodOptional<z.ZodString>;
408
+ client_name: z.ZodOptional<z.ZodString>;
409
+ audience: z.ZodOptional<z.ZodString>;
410
+ scope: z.ZodOptional<z.ZodString>;
411
+ strategy: z.ZodOptional<z.ZodString>;
412
+ strategy_type: z.ZodOptional<z.ZodString>;
413
+ hostname: z.ZodOptional<z.ZodString>;
414
+ auth0_client: z.ZodOptional<z.ZodObject<{
415
+ name: z.ZodString;
416
+ version: z.ZodString;
417
+ env: z.ZodOptional<z.ZodObject<{
418
+ node: z.ZodOptional<z.ZodString>;
419
+ }, "strip", z.ZodTypeAny, {
420
+ node?: string | undefined;
421
+ }, {
422
+ node?: string | undefined;
423
+ }>>;
424
+ }, "strip", z.ZodTypeAny, {
425
+ name: string;
426
+ version: string;
427
+ env?: {
428
+ node?: string | undefined;
429
+ } | undefined;
430
+ }, {
431
+ name: string;
432
+ version: string;
433
+ env?: {
434
+ node?: string | undefined;
435
+ } | undefined;
436
+ }>>;
437
+ location_info: z.ZodOptional<z.ZodObject<{
438
+ country_code: z.ZodString;
439
+ country_code3: z.ZodString;
440
+ country_name: z.ZodString;
441
+ city_name: z.ZodString;
442
+ latitude: z.ZodString;
443
+ longitude: z.ZodString;
444
+ time_zone: z.ZodString;
445
+ continent_code: z.ZodString;
446
+ }, "strip", z.ZodTypeAny, {
447
+ country_code: string;
448
+ country_code3: string;
449
+ country_name: string;
450
+ city_name: string;
451
+ latitude: string;
452
+ longitude: string;
453
+ time_zone: string;
454
+ continent_code: string;
455
+ }, {
456
+ country_code: string;
457
+ country_code3: string;
458
+ country_name: string;
459
+ city_name: string;
460
+ latitude: string;
461
+ longitude: string;
462
+ time_zone: string;
463
+ continent_code: string;
464
+ }>>;
465
+ }, "strip", z.ZodTypeAny, {
466
+ type: "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" | "fi" | "flo" | "flows_execution_completed" | "flows_execution_failed" | "fn" | "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" | "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" | "sce" | "scoa" | "scp" | "scpn" | "scpr" | "scu" | "scv" | "sd" | "sdu" | "seacft" | "seccft" | "secte" | "sede" | "sens" | "seoobft" | "seotpft" | "sepft" | "sepkoobft" | "sepkotpft" | "sepkrcft" | "sercft" | "sertft" | "si" | "signup_pwd_leak" | "slo" | "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";
467
+ date: string;
468
+ isMobile: boolean;
469
+ log_id: string;
470
+ description?: string | undefined;
471
+ connection?: string | undefined;
472
+ user_id?: string | undefined;
473
+ client_id?: string | undefined;
474
+ audience?: string | undefined;
475
+ scope?: string | undefined;
476
+ strategy?: string | undefined;
477
+ connection_id?: string | undefined;
478
+ ip?: string | undefined;
479
+ user_agent?: string | undefined;
480
+ details?: any;
481
+ user_name?: string | undefined;
482
+ client_name?: string | undefined;
483
+ strategy_type?: string | undefined;
484
+ hostname?: string | undefined;
485
+ auth0_client?: {
486
+ name: string;
487
+ version: string;
488
+ env?: {
489
+ node?: string | undefined;
490
+ } | undefined;
491
+ } | undefined;
492
+ location_info?: {
493
+ country_code: string;
494
+ country_code3: string;
495
+ country_name: string;
496
+ city_name: string;
497
+ latitude: string;
498
+ longitude: string;
499
+ time_zone: string;
500
+ continent_code: string;
501
+ } | undefined;
502
+ }, {
503
+ type: string;
504
+ date: string;
505
+ isMobile: boolean;
506
+ log_id: string;
507
+ description?: string | undefined;
508
+ connection?: string | undefined;
509
+ user_id?: string | undefined;
510
+ client_id?: string | undefined;
511
+ audience?: string | undefined;
512
+ scope?: string | undefined;
513
+ strategy?: string | undefined;
514
+ connection_id?: string | undefined;
515
+ ip?: string | undefined;
516
+ user_agent?: string | undefined;
517
+ details?: any;
518
+ user_name?: string | undefined;
519
+ client_name?: string | undefined;
520
+ strategy_type?: string | undefined;
521
+ hostname?: string | undefined;
522
+ auth0_client?: {
523
+ name: string;
524
+ version: string;
525
+ env?: {
526
+ node?: string | undefined;
527
+ } | undefined;
528
+ } | undefined;
529
+ location_info?: {
530
+ country_code: string;
531
+ country_code3: string;
532
+ country_name: string;
533
+ city_name: string;
534
+ latitude: string;
535
+ longitude: string;
536
+ time_zone: string;
537
+ continent_code: string;
538
+ } | undefined;
539
+ }>;
540
+ export type Log = z.infer<typeof logSchema>;
232
541
  export interface CacheAdapter {
233
542
  /**
234
543
  * Get a value from the cache
@@ -254,6 +563,14 @@ export interface CacheAdapter {
254
563
  */
255
564
  clear(): Promise<void>;
256
565
  }
566
+ export interface ListLogsResponse extends Totals {
567
+ logs: Log[];
568
+ }
569
+ export interface LogsDataAdapter {
570
+ create(tenantId: string, params: LogInsert): Promise<Log>;
571
+ list(tenantId: string, params?: ListParams): Promise<ListLogsResponse>;
572
+ get(tenantId: string, logId: string): Promise<Log | null>;
573
+ }
257
574
  export interface CustomDomainsAdapter {
258
575
  create: (tenant_id: string, custom_domain: CustomDomainInsert) => Promise<CustomDomain>;
259
576
  get: (tenant_id: string, id: string) => Promise<CustomDomain | null>;
@@ -262,6 +579,76 @@ export interface CustomDomainsAdapter {
262
579
  remove: (tenant_id: string, id: string) => Promise<boolean>;
263
580
  update: (tenant_id: string, id: string, custom_domain: Partial<CustomDomain>) => Promise<boolean>;
264
581
  }
582
+ export interface GeoInfo {
583
+ country_code: string;
584
+ country_code3: string;
585
+ country_name: string;
586
+ city_name: string;
587
+ latitude: string;
588
+ longitude: string;
589
+ time_zone: string;
590
+ continent_code: string;
591
+ }
592
+ export interface GeoAdapter {
593
+ /**
594
+ * Get geo information from the current request
595
+ * @returns Geo information or null if not available
596
+ */
597
+ getGeoInfo(): Promise<GeoInfo | null>;
598
+ }
599
+ export interface R2SQLLogsAdapterConfig {
600
+ /**
601
+ * Cloudflare Pipeline HTTP endpoint URL for ingesting logs
602
+ * Example: "https://{stream-id}.ingest.cloudflare.com"
603
+ * Optional if using pipelineBinding or baseAdapter
604
+ */
605
+ pipelineEndpoint?: string;
606
+ /**
607
+ * Cloudflare service binding for Pipeline (for Workers)
608
+ * Use this instead of pipelineEndpoint when running in a Worker
609
+ * Must have a fetch() method
610
+ */
611
+ pipelineBinding?: {
612
+ fetch: typeof fetch;
613
+ };
614
+ /**
615
+ * Base logs adapter to wrap (passthrough mode)
616
+ * When provided, logs will be sent to both the Pipeline and the base adapter
617
+ */
618
+ baseAdapter?: {
619
+ create: (tenantId: string, log: any) => Promise<any>;
620
+ get: (tenantId: string, logId: string) => Promise<any>;
621
+ list: (tenantId: string, params?: any) => Promise<any>;
622
+ };
623
+ /**
624
+ * Cloudflare account ID for R2 SQL API
625
+ * Required for the official API endpoint
626
+ * Can be passed via environment variable: CLOUDFLARE_ACCOUNT_ID
627
+ */
628
+ accountId: string;
629
+ /**
630
+ * Cloudflare R2 SQL API token for querying logs
631
+ * Can be passed via environment variable: R2_SQL_AUTH_TOKEN
632
+ */
633
+ authToken: string;
634
+ /**
635
+ * R2 warehouse name (e.g., "default")
636
+ * Can be passed via environment variable: R2_WAREHOUSE_NAME
637
+ */
638
+ warehouseName: string;
639
+ /**
640
+ * Catalog database/namespace for logs (default: "default")
641
+ */
642
+ namespace?: string;
643
+ /**
644
+ * Catalog table name for logs (default: "logs")
645
+ */
646
+ tableName?: string;
647
+ /**
648
+ * HTTP timeout in milliseconds (default: 30000)
649
+ */
650
+ timeout?: number;
651
+ }
265
652
  export interface CloudflareConfig {
266
653
  zoneId: string;
267
654
  authKey: string;
@@ -280,11 +667,22 @@ export interface CloudflareConfig {
280
667
  * Key prefix to namespace cache entries (optional)
281
668
  */
282
669
  keyPrefix?: string;
670
+ /**
671
+ * R2 SQL logs adapter configuration (optional)
672
+ */
673
+ r2SqlLogs?: R2SQLLogsAdapterConfig;
674
+ /**
675
+ * Function to get request headers for geo information (optional)
676
+ */
677
+ getHeaders?: () => Record<string, string>;
283
678
  }
284
- declare function createAdapters(config: CloudflareConfig): {
679
+ export interface CloudflareAdapters {
285
680
  customDomains: CustomDomainsAdapter;
286
681
  cache: CacheAdapter;
287
- };
682
+ logs?: LogsDataAdapter;
683
+ geo?: GeoAdapter;
684
+ }
685
+ declare function createAdapters(config: CloudflareConfig): CloudflareAdapters;
288
686
 
289
687
  export {
290
688
  createAdapters as default,