@authhero/kysely-adapter 8.2.0 → 9.0.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.
@@ -702,25 +702,6 @@ declare const brandingSchema: z.ZodObject<{
702
702
  }>;
703
703
  export type Branding = z.infer<typeof brandingSchema>;
704
704
  declare const ClientSchema: z.ZodObject<{
705
- domains: z.ZodArray<z.ZodObject<{
706
- domain: z.ZodString;
707
- dkim_private_key: z.ZodOptional<z.ZodString>;
708
- dkim_public_key: z.ZodOptional<z.ZodString>;
709
- email_api_key: z.ZodOptional<z.ZodString>;
710
- email_service: z.ZodOptional<z.ZodString>;
711
- }, "strip", z.ZodTypeAny, {
712
- domain: string;
713
- dkim_private_key?: string | undefined;
714
- dkim_public_key?: string | undefined;
715
- email_api_key?: string | undefined;
716
- email_service?: string | undefined;
717
- }, {
718
- domain: string;
719
- dkim_private_key?: string | undefined;
720
- dkim_public_key?: string | undefined;
721
- email_api_key?: string | undefined;
722
- email_service?: string | undefined;
723
- }>, "many">;
724
705
  tenant: z.ZodObject<{
725
706
  id: z.ZodString;
726
707
  name: z.ZodString;
@@ -978,13 +959,6 @@ declare const ClientSchema: z.ZodObject<{
978
959
  name: string;
979
960
  id: string;
980
961
  disable_sign_ups: boolean;
981
- domains: {
982
- domain: string;
983
- dkim_private_key?: string | undefined;
984
- dkim_public_key?: string | undefined;
985
- email_api_key?: string | undefined;
986
- email_service?: string | undefined;
987
- }[];
988
962
  tenant: {
989
963
  created_at: string;
990
964
  updated_at: string;
@@ -1056,13 +1030,6 @@ declare const ClientSchema: z.ZodObject<{
1056
1030
  updated_at: string;
1057
1031
  name: string;
1058
1032
  id: string;
1059
- domains: {
1060
- domain: string;
1061
- dkim_private_key?: string | undefined;
1062
- dkim_public_key?: string | undefined;
1063
- email_api_key?: string | undefined;
1064
- email_service?: string | undefined;
1065
- }[];
1066
1033
  tenant: {
1067
1034
  created_at: string;
1068
1035
  updated_at: string;
@@ -1416,36 +1383,96 @@ declare const connectionSchema: z.ZodObject<z.objectUtil.extendShape<{
1416
1383
  enabled_clients?: string[] | undefined;
1417
1384
  }>;
1418
1385
  export type Connection = z.infer<typeof connectionSchema>;
1419
- declare const domainSchema: z.ZodObject<z.objectUtil.extendShape<{
1420
- created_at: z.ZodString;
1421
- updated_at: z.ZodString;
1386
+ declare const customDomainInsertSchema: z.ZodObject<{
1387
+ domain: z.ZodString;
1388
+ type: z.ZodEnum<[
1389
+ "auth0_managed_certs",
1390
+ "self_managed_certs"
1391
+ ]>;
1392
+ verification_method: z.ZodOptional<z.ZodEnum<[
1393
+ "txt"
1394
+ ]>>;
1395
+ tls_policy: z.ZodOptional<z.ZodEnum<[
1396
+ "recommended"
1397
+ ]>>;
1398
+ custom_client_ip_header: z.ZodOptional<z.ZodEnum<[
1399
+ "true-client-ip",
1400
+ "cf-connecting-ip",
1401
+ "x-forwarded-for",
1402
+ "x-azure-clientip",
1403
+ "null"
1404
+ ]>>;
1405
+ domain_metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1406
+ }, "strip", z.ZodTypeAny, {
1407
+ type: "auth0_managed_certs" | "self_managed_certs";
1408
+ domain: string;
1409
+ verification_method?: "txt" | undefined;
1410
+ tls_policy?: "recommended" | undefined;
1411
+ custom_client_ip_header?: "null" | "true-client-ip" | "cf-connecting-ip" | "x-forwarded-for" | "x-azure-clientip" | undefined;
1412
+ domain_metadata?: Record<string, string> | undefined;
1422
1413
  }, {
1423
- id: z.ZodString;
1414
+ type: "auth0_managed_certs" | "self_managed_certs";
1415
+ domain: string;
1416
+ verification_method?: "txt" | undefined;
1417
+ tls_policy?: "recommended" | undefined;
1418
+ custom_client_ip_header?: "null" | "true-client-ip" | "cf-connecting-ip" | "x-forwarded-for" | "x-azure-clientip" | undefined;
1419
+ domain_metadata?: Record<string, string> | undefined;
1420
+ }>;
1421
+ export type CustomDomainInsert = z.infer<typeof customDomainInsertSchema>;
1422
+ declare const customDomainSchema: z.ZodObject<{
1423
+ custom_domain_id: z.ZodString;
1424
+ primary: z.ZodBoolean;
1425
+ status: z.ZodEnum<[
1426
+ "disabled",
1427
+ "pending",
1428
+ "pending_verification",
1429
+ "ready"
1430
+ ]>;
1431
+ origin_domain_name: z.ZodOptional<z.ZodString>;
1432
+ verification: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
1433
+ tls_policy: z.ZodOptional<z.ZodString>;
1424
1434
  domain: z.ZodString;
1425
- dkim_private_key: z.ZodOptional<z.ZodString>;
1426
- dkim_public_key: z.ZodOptional<z.ZodString>;
1427
- email_api_key: z.ZodOptional<z.ZodString>;
1428
- email_service: z.ZodOptional<z.ZodString>;
1429
- }>, "strip", z.ZodTypeAny, {
1430
- created_at: string;
1431
- updated_at: string;
1432
- id: string;
1435
+ type: z.ZodEnum<[
1436
+ "auth0_managed_certs",
1437
+ "self_managed_certs"
1438
+ ]>;
1439
+ verification_method: z.ZodOptional<z.ZodEnum<[
1440
+ "txt"
1441
+ ]>>;
1442
+ custom_client_ip_header: z.ZodOptional<z.ZodEnum<[
1443
+ "true-client-ip",
1444
+ "cf-connecting-ip",
1445
+ "x-forwarded-for",
1446
+ "x-azure-clientip",
1447
+ "null"
1448
+ ]>>;
1449
+ domain_metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1450
+ }, "strip", z.ZodTypeAny, {
1451
+ type: "auth0_managed_certs" | "self_managed_certs";
1452
+ status: "disabled" | "pending" | "pending_verification" | "ready";
1453
+ primary: boolean;
1433
1454
  domain: string;
1434
- dkim_private_key?: string | undefined;
1435
- dkim_public_key?: string | undefined;
1436
- email_api_key?: string | undefined;
1437
- email_service?: string | undefined;
1455
+ custom_domain_id: string;
1456
+ verification_method?: "txt" | undefined;
1457
+ tls_policy?: string | undefined;
1458
+ custom_client_ip_header?: "null" | "true-client-ip" | "cf-connecting-ip" | "x-forwarded-for" | "x-azure-clientip" | undefined;
1459
+ domain_metadata?: Record<string, string> | undefined;
1460
+ origin_domain_name?: string | undefined;
1461
+ verification?: {} | undefined;
1438
1462
  }, {
1439
- created_at: string;
1440
- updated_at: string;
1441
- id: string;
1463
+ type: "auth0_managed_certs" | "self_managed_certs";
1464
+ status: "disabled" | "pending" | "pending_verification" | "ready";
1465
+ primary: boolean;
1442
1466
  domain: string;
1443
- dkim_private_key?: string | undefined;
1444
- dkim_public_key?: string | undefined;
1445
- email_api_key?: string | undefined;
1446
- email_service?: string | undefined;
1467
+ custom_domain_id: string;
1468
+ verification_method?: "txt" | undefined;
1469
+ tls_policy?: string | undefined;
1470
+ custom_client_ip_header?: "null" | "true-client-ip" | "cf-connecting-ip" | "x-forwarded-for" | "x-azure-clientip" | undefined;
1471
+ domain_metadata?: Record<string, string> | undefined;
1472
+ origin_domain_name?: string | undefined;
1473
+ verification?: {} | undefined;
1447
1474
  }>;
1448
- export type Domain = z.infer<typeof domainSchema>;
1475
+ export type CustomDomain = z.infer<typeof customDomainSchema>;
1449
1476
  declare const hookInsertSchema: z.ZodObject<{
1450
1477
  trigger_id: z.ZodEnum<[
1451
1478
  "pre-user-signup",
@@ -1934,7 +1961,7 @@ export type Password = z.infer<typeof passwordSchema>;
1934
1961
  declare const sessionInsertSchema: z.ZodObject<{
1935
1962
  id: z.ZodString;
1936
1963
  revoked_at: z.ZodOptional<z.ZodString>;
1937
- used_at: z.ZodString;
1964
+ used_at: z.ZodOptional<z.ZodString>;
1938
1965
  user_id: z.ZodString;
1939
1966
  expires_at: z.ZodOptional<z.ZodString>;
1940
1967
  idle_expires_at: z.ZodOptional<z.ZodString>;
@@ -1964,7 +1991,6 @@ declare const sessionInsertSchema: z.ZodObject<{
1964
1991
  }, "strip", z.ZodTypeAny, {
1965
1992
  user_id: string;
1966
1993
  id: string;
1967
- used_at: string;
1968
1994
  device: {
1969
1995
  last_ip: string;
1970
1996
  initial_user_agent: string;
@@ -1975,12 +2001,12 @@ declare const sessionInsertSchema: z.ZodObject<{
1975
2001
  };
1976
2002
  clients: string[];
1977
2003
  expires_at?: string | undefined;
2004
+ used_at?: string | undefined;
1978
2005
  revoked_at?: string | undefined;
1979
2006
  idle_expires_at?: string | undefined;
1980
2007
  }, {
1981
2008
  user_id: string;
1982
2009
  id: string;
1983
- used_at: string;
1984
2010
  device: {
1985
2011
  last_ip: string;
1986
2012
  initial_user_agent: string;
@@ -1991,6 +2017,7 @@ declare const sessionInsertSchema: z.ZodObject<{
1991
2017
  };
1992
2018
  clients: string[];
1993
2019
  expires_at?: string | undefined;
2020
+ used_at?: string | undefined;
1994
2021
  revoked_at?: string | undefined;
1995
2022
  idle_expires_at?: string | undefined;
1996
2023
  }>;
@@ -1998,7 +2025,7 @@ export type SessionInsert = z.infer<typeof sessionInsertSchema>;
1998
2025
  declare const sessionSchema: z.ZodObject<{
1999
2026
  id: z.ZodString;
2000
2027
  revoked_at: z.ZodOptional<z.ZodString>;
2001
- used_at: z.ZodString;
2028
+ used_at: z.ZodOptional<z.ZodString>;
2002
2029
  user_id: z.ZodString;
2003
2030
  expires_at: z.ZodOptional<z.ZodString>;
2004
2031
  idle_expires_at: z.ZodOptional<z.ZodString>;
@@ -2034,7 +2061,6 @@ declare const sessionSchema: z.ZodObject<{
2034
2061
  updated_at: string;
2035
2062
  user_id: string;
2036
2063
  id: string;
2037
- used_at: string;
2038
2064
  device: {
2039
2065
  last_ip: string;
2040
2066
  initial_user_agent: string;
@@ -2047,6 +2073,7 @@ declare const sessionSchema: z.ZodObject<{
2047
2073
  authenticated_at: string;
2048
2074
  last_interaction_at: string;
2049
2075
  expires_at?: string | undefined;
2076
+ used_at?: string | undefined;
2050
2077
  revoked_at?: string | undefined;
2051
2078
  idle_expires_at?: string | undefined;
2052
2079
  }, {
@@ -2054,7 +2081,6 @@ declare const sessionSchema: z.ZodObject<{
2054
2081
  updated_at: string;
2055
2082
  user_id: string;
2056
2083
  id: string;
2057
- used_at: string;
2058
2084
  device: {
2059
2085
  last_ip: string;
2060
2086
  initial_user_agent: string;
@@ -2067,6 +2093,7 @@ declare const sessionSchema: z.ZodObject<{
2067
2093
  authenticated_at: string;
2068
2094
  last_interaction_at: string;
2069
2095
  expires_at?: string | undefined;
2096
+ used_at?: string | undefined;
2070
2097
  revoked_at?: string | undefined;
2071
2098
  idle_expires_at?: string | undefined;
2072
2099
  }>;
@@ -3377,12 +3404,12 @@ export interface ConnectionsAdapter {
3377
3404
  update(tenant_id: string, connection_id: string, params: Partial<ConnectionInsert>): Promise<boolean>;
3378
3405
  list(tenant_id: string, params?: ListParams): Promise<ListConnectionsResponse>;
3379
3406
  }
3380
- export interface ListDomainsResponse extends Totals {
3381
- domains: Domain[];
3382
- }
3383
- export interface DomainsAdapter {
3384
- create(tenant_id: string, params: Domain): Promise<Domain>;
3385
- list(tenant_id: string, params?: ListParams): Promise<ListDomainsResponse>;
3407
+ export interface CustomDomainsAdapter {
3408
+ create: (tenant_id: string, custom_domain: CustomDomainInsert) => Promise<CustomDomain>;
3409
+ get: (tenant_id: string, id: string) => Promise<CustomDomain | null>;
3410
+ list: (tenant_id: string) => Promise<CustomDomain[]>;
3411
+ remove: (tenant_id: string, id: string) => Promise<boolean>;
3412
+ update: (tenant_id: string, id: string, custom_domain: Partial<CustomDomain>) => Promise<boolean>;
3386
3413
  }
3387
3414
  export interface KeysAdapter {
3388
3415
  create: (key: SigningKey) => Promise<void>;
@@ -3443,7 +3470,7 @@ export interface DataAdapters {
3443
3470
  clients: ClientsAdapter;
3444
3471
  codes: CodesAdapter;
3445
3472
  connections: ConnectionsAdapter;
3446
- domains: DomainsAdapter;
3473
+ customDomains: CustomDomainsAdapter;
3447
3474
  emailProviders: EmailProvidersAdapter;
3448
3475
  hooks: HooksAdapter;
3449
3476
  keys: KeysAdapter;
@@ -3845,7 +3872,7 @@ declare const sqlSessionSchema: z.ZodObject<{
3845
3872
  clients: z.ZodString;
3846
3873
  id: z.ZodString;
3847
3874
  revoked_at: z.ZodOptional<z.ZodString>;
3848
- used_at: z.ZodString;
3875
+ used_at: z.ZodOptional<z.ZodString>;
3849
3876
  user_id: z.ZodString;
3850
3877
  expires_at: z.ZodOptional<z.ZodString>;
3851
3878
  idle_expires_at: z.ZodOptional<z.ZodString>;
@@ -3861,10 +3888,10 @@ declare const sqlSessionSchema: z.ZodObject<{
3861
3888
  user_id: string;
3862
3889
  device: string;
3863
3890
  clients: string;
3864
- used_at: string;
3865
3891
  authenticated_at: string;
3866
3892
  last_interaction_at: string;
3867
3893
  revoked_at?: string | undefined;
3894
+ used_at?: string | undefined;
3868
3895
  expires_at?: string | undefined;
3869
3896
  idle_expires_at?: string | undefined;
3870
3897
  }, {
@@ -3875,10 +3902,10 @@ declare const sqlSessionSchema: z.ZodObject<{
3875
3902
  user_id: string;
3876
3903
  device: string;
3877
3904
  clients: string;
3878
- used_at: string;
3879
3905
  authenticated_at: string;
3880
3906
  last_interaction_at: string;
3881
3907
  revoked_at?: string | undefined;
3908
+ used_at?: string | undefined;
3882
3909
  expires_at?: string | undefined;
3883
3910
  idle_expires_at?: string | undefined;
3884
3911
  }>;
@@ -3922,6 +3949,68 @@ declare const sqlRefreshTokensSchema: z.ZodObject<{
3922
3949
  idle_expires_at?: string | undefined;
3923
3950
  last_exchanged_at?: string | undefined;
3924
3951
  }>;
3952
+ declare const sqlCustomDomainSchema: z.ZodObject<{
3953
+ primary: z.ZodNumber;
3954
+ tenant_id: z.ZodString;
3955
+ created_at: z.ZodString;
3956
+ updated_at: z.ZodString;
3957
+ custom_domain_id: z.ZodString;
3958
+ status: z.ZodEnum<[
3959
+ "disabled",
3960
+ "pending",
3961
+ "pending_verification",
3962
+ "ready"
3963
+ ]>;
3964
+ origin_domain_name: z.ZodOptional<z.ZodString>;
3965
+ verification: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
3966
+ tls_policy: z.ZodOptional<z.ZodString>;
3967
+ domain: z.ZodString;
3968
+ type: z.ZodEnum<[
3969
+ "auth0_managed_certs",
3970
+ "self_managed_certs"
3971
+ ]>;
3972
+ verification_method: z.ZodOptional<z.ZodEnum<[
3973
+ "txt"
3974
+ ]>>;
3975
+ custom_client_ip_header: z.ZodOptional<z.ZodEnum<[
3976
+ "true-client-ip",
3977
+ "cf-connecting-ip",
3978
+ "x-forwarded-for",
3979
+ "x-azure-clientip",
3980
+ "null"
3981
+ ]>>;
3982
+ domain_metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
3983
+ }, "strip", z.ZodTypeAny, {
3984
+ tenant_id: string;
3985
+ type: "auth0_managed_certs" | "self_managed_certs";
3986
+ status: "disabled" | "pending" | "pending_verification" | "ready";
3987
+ created_at: string;
3988
+ updated_at: string;
3989
+ primary: number;
3990
+ custom_domain_id: string;
3991
+ domain: string;
3992
+ origin_domain_name?: string | undefined;
3993
+ verification?: {} | undefined;
3994
+ tls_policy?: string | undefined;
3995
+ verification_method?: "txt" | undefined;
3996
+ custom_client_ip_header?: "null" | "true-client-ip" | "cf-connecting-ip" | "x-forwarded-for" | "x-azure-clientip" | undefined;
3997
+ domain_metadata?: Record<string, string> | undefined;
3998
+ }, {
3999
+ tenant_id: string;
4000
+ type: "auth0_managed_certs" | "self_managed_certs";
4001
+ status: "disabled" | "pending" | "pending_verification" | "ready";
4002
+ created_at: string;
4003
+ updated_at: string;
4004
+ primary: number;
4005
+ custom_domain_id: string;
4006
+ domain: string;
4007
+ origin_domain_name?: string | undefined;
4008
+ verification?: {} | undefined;
4009
+ tls_policy?: string | undefined;
4010
+ verification_method?: "txt" | undefined;
4011
+ custom_client_ip_header?: "null" | "true-client-ip" | "cf-connecting-ip" | "x-forwarded-for" | "x-azure-clientip" | undefined;
4012
+ domain_metadata?: Record<string, string> | undefined;
4013
+ }>;
3925
4014
  export interface Database {
3926
4015
  applications: z.infer<typeof sqlApplicationSchema>;
3927
4016
  branding: z.infer<typeof sqlBrandingSchema>;
@@ -3929,9 +4018,7 @@ export interface Database {
3929
4018
  tenant_id: string;
3930
4019
  };
3931
4020
  connections: z.infer<typeof sqlConnectionSchema>;
3932
- domains: Domain & {
3933
- tenant_id: string;
3934
- };
4021
+ custom_domains: z.infer<typeof sqlCustomDomainSchema>;
3935
4022
  email_providers: z.infer<typeof sqlEmailProvidersSchema>;
3936
4023
  hooks: z.infer<typeof sqlHookSchema>;
3937
4024
  keys: SigningKey & {