@authhero/kysely-adapter 0.21.0 → 0.23.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.
@@ -3,17 +3,6 @@
3
3
  import { z } from '@hono/zod-openapi';
4
4
  import { Kysely } from 'kysely';
5
5
 
6
- export interface SqlBranding {
7
- tenant_id: string;
8
- colors_primary?: string;
9
- colors_page_background_type?: string;
10
- colors_page_background_start?: string;
11
- colors_page_background_end?: string;
12
- colors_page_background_angle_dev?: number;
13
- logo_url?: string;
14
- favicon_url?: string;
15
- font_url?: string;
16
- }
17
6
  export interface Totals {
18
7
  start: number;
19
8
  limit: number;
@@ -1551,6 +1540,7 @@ declare const loginInsertSchema: z.ZodObject<{
1551
1540
  expires_at: z.ZodString;
1552
1541
  deleted_at: z.ZodOptional<z.ZodString>;
1553
1542
  ip: z.ZodOptional<z.ZodString>;
1543
+ useragent: z.ZodOptional<z.ZodString>;
1554
1544
  }, "strip", z.ZodTypeAny, {
1555
1545
  expires_at: string;
1556
1546
  authParams: {
@@ -1573,6 +1563,7 @@ declare const loginInsertSchema: z.ZodObject<{
1573
1563
  auth0Client?: string | undefined;
1574
1564
  deleted_at?: string | undefined;
1575
1565
  ip?: string | undefined;
1566
+ useragent?: string | undefined;
1576
1567
  }, {
1577
1568
  expires_at: string;
1578
1569
  authParams: {
@@ -1595,6 +1586,7 @@ declare const loginInsertSchema: z.ZodObject<{
1595
1586
  auth0Client?: string | undefined;
1596
1587
  deleted_at?: string | undefined;
1597
1588
  ip?: string | undefined;
1589
+ useragent?: string | undefined;
1598
1590
  }>;
1599
1591
  export type LoginInsert = z.infer<typeof loginInsertSchema>;
1600
1592
  declare const loginSchema: z.ZodObject<{
@@ -1654,6 +1646,7 @@ declare const loginSchema: z.ZodObject<{
1654
1646
  expires_at: z.ZodString;
1655
1647
  deleted_at: z.ZodOptional<z.ZodString>;
1656
1648
  ip: z.ZodOptional<z.ZodString>;
1649
+ useragent: z.ZodOptional<z.ZodString>;
1657
1650
  }, "strip", z.ZodTypeAny, {
1658
1651
  created_at: string;
1659
1652
  updated_at: string;
@@ -1679,6 +1672,7 @@ declare const loginSchema: z.ZodObject<{
1679
1672
  auth0Client?: string | undefined;
1680
1673
  deleted_at?: string | undefined;
1681
1674
  ip?: string | undefined;
1675
+ useragent?: string | undefined;
1682
1676
  }, {
1683
1677
  created_at: string;
1684
1678
  updated_at: string;
@@ -1704,6 +1698,7 @@ declare const loginSchema: z.ZodObject<{
1704
1698
  auth0Client?: string | undefined;
1705
1699
  deleted_at?: string | undefined;
1706
1700
  ip?: string | undefined;
1701
+ useragent?: string | undefined;
1707
1702
  }>;
1708
1703
  export type Login = z.infer<typeof loginSchema>;
1709
1704
  declare const LogType: z.ZodEnum<[
@@ -2862,23 +2857,122 @@ declare const promptSettingSchema: z.ZodObject<{
2862
2857
  password_first?: boolean | undefined;
2863
2858
  }>;
2864
2859
  export type PromptSetting = z.infer<typeof promptSettingSchema>;
2865
- export interface Ticket {
2866
- id: string;
2867
- tenant_id: string;
2868
- client_id: string;
2869
- email: string;
2870
- authParams?: {
2871
- nonce?: string;
2872
- state?: string;
2873
- scope?: string;
2874
- response_type?: AuthorizationResponseType;
2875
- response_mode?: AuthorizationResponseMode;
2876
- redirect_uri?: string;
2860
+ declare const emailProviderSchema: z.ZodObject<{
2861
+ name: z.ZodString;
2862
+ enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2863
+ default_from_address: z.ZodOptional<z.ZodString>;
2864
+ credentials: z.ZodUnion<[
2865
+ z.ZodObject<{
2866
+ accessKeyId: z.ZodString;
2867
+ secretAccessKey: z.ZodString;
2868
+ region: z.ZodString;
2869
+ }, "strip", z.ZodTypeAny, {
2870
+ accessKeyId: string;
2871
+ secretAccessKey: string;
2872
+ region: string;
2873
+ }, {
2874
+ accessKeyId: string;
2875
+ secretAccessKey: string;
2876
+ region: string;
2877
+ }>,
2878
+ z.ZodObject<{
2879
+ smtp_host: z.ZodArray<z.ZodString, "many">;
2880
+ smtp_port: z.ZodNumber;
2881
+ smtp_user: z.ZodString;
2882
+ smtp_pass: z.ZodString;
2883
+ }, "strip", z.ZodTypeAny, {
2884
+ smtp_host: string[];
2885
+ smtp_port: number;
2886
+ smtp_user: string;
2887
+ smtp_pass: string;
2888
+ }, {
2889
+ smtp_host: string[];
2890
+ smtp_port: number;
2891
+ smtp_user: string;
2892
+ smtp_pass: string;
2893
+ }>,
2894
+ z.ZodObject<{
2895
+ api_key: z.ZodString;
2896
+ domain: z.ZodOptional<z.ZodString>;
2897
+ }, "strip", z.ZodTypeAny, {
2898
+ api_key: string;
2899
+ domain?: string | undefined;
2900
+ }, {
2901
+ api_key: string;
2902
+ domain?: string | undefined;
2903
+ }>,
2904
+ z.ZodObject<{
2905
+ connectionString: z.ZodString;
2906
+ }, "strip", z.ZodTypeAny, {
2907
+ connectionString: string;
2908
+ }, {
2909
+ connectionString: string;
2910
+ }>,
2911
+ z.ZodObject<{
2912
+ tenantId: z.ZodString;
2913
+ clientId: z.ZodString;
2914
+ clientSecret: z.ZodString;
2915
+ }, "strip", z.ZodTypeAny, {
2916
+ tenantId: string;
2917
+ clientId: string;
2918
+ clientSecret: string;
2919
+ }, {
2920
+ tenantId: string;
2921
+ clientId: string;
2922
+ clientSecret: string;
2923
+ }>
2924
+ ]>;
2925
+ settings: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
2926
+ }, "strip", z.ZodTypeAny, {
2927
+ name: string;
2928
+ enabled: boolean;
2929
+ credentials: {
2930
+ accessKeyId: string;
2931
+ secretAccessKey: string;
2932
+ region: string;
2933
+ } | {
2934
+ smtp_host: string[];
2935
+ smtp_port: number;
2936
+ smtp_user: string;
2937
+ smtp_pass: string;
2938
+ } | {
2939
+ api_key: string;
2940
+ domain?: string | undefined;
2941
+ } | {
2942
+ connectionString: string;
2943
+ } | {
2944
+ tenantId: string;
2945
+ clientId: string;
2946
+ clientSecret: string;
2877
2947
  };
2878
- created_at: Date;
2879
- expires_at: Date;
2880
- used_at?: Date;
2881
- }
2948
+ default_from_address?: string | undefined;
2949
+ settings?: {} | undefined;
2950
+ }, {
2951
+ name: string;
2952
+ credentials: {
2953
+ accessKeyId: string;
2954
+ secretAccessKey: string;
2955
+ region: string;
2956
+ } | {
2957
+ smtp_host: string[];
2958
+ smtp_port: number;
2959
+ smtp_user: string;
2960
+ smtp_pass: string;
2961
+ } | {
2962
+ api_key: string;
2963
+ domain?: string | undefined;
2964
+ } | {
2965
+ connectionString: string;
2966
+ } | {
2967
+ tenantId: string;
2968
+ clientId: string;
2969
+ clientSecret: string;
2970
+ };
2971
+ enabled?: boolean | undefined;
2972
+ default_from_address?: string | undefined;
2973
+ settings?: {} | undefined;
2974
+ }>;
2975
+ export type EmailProvider = z.infer<typeof emailProviderSchema>;
2882
2976
  export interface ListParams {
2883
2977
  page: number;
2884
2978
  per_page: number;
@@ -2932,11 +3026,6 @@ export interface TenantsDataAdapter {
2932
3026
  update(id: string, tenant: Partial<Tenant>): Promise<void>;
2933
3027
  remove(tenantId: string): Promise<boolean>;
2934
3028
  }
2935
- export interface TicketsAdapter {
2936
- create: (ticket: Ticket) => Promise<void>;
2937
- get: (tenant_id: string, id: string) => Promise<Ticket | null>;
2938
- remove: (tenant_id: string, id: string) => Promise<void>;
2939
- }
2940
3029
  export interface ListUsersResponse extends Totals {
2941
3030
  users: User[];
2942
3031
  }
@@ -3021,6 +3110,11 @@ export interface PromptSettingsAdapter {
3021
3110
  set: (tenant_id: string, promptSetting: Partial<PromptSetting>) => Promise<void>;
3022
3111
  get: (tenant_id: string) => Promise<PromptSetting>;
3023
3112
  }
3113
+ export interface EmailProvidersAdapter {
3114
+ update: (tenant_id: string, emailProvider: Partial<EmailProvider>) => Promise<void>;
3115
+ create: (tenant_id: string, emailProvider: EmailProvider) => Promise<void>;
3116
+ get: (tenant_id: string) => Promise<EmailProvider | null>;
3117
+ }
3024
3118
  export interface DataAdapters {
3025
3119
  applications: ApplicationsAdapter;
3026
3120
  branding: BrandingAdapter;
@@ -3028,6 +3122,7 @@ export interface DataAdapters {
3028
3122
  codes: CodesAdapter;
3029
3123
  connections: ConnectionsAdapter;
3030
3124
  domains: DomainsAdapter;
3125
+ emailProviders: EmailProvidersAdapter;
3031
3126
  hooks: HooksAdapter;
3032
3127
  keys: KeysAdapter;
3033
3128
  logins: LoginsAdapter;
@@ -3037,24 +3132,8 @@ export interface DataAdapters {
3037
3132
  sessions: SessionsAdapter;
3038
3133
  tenants: TenantsDataAdapter;
3039
3134
  themes: ThemesAdapter;
3040
- tickets: TicketsAdapter;
3041
3135
  users: UserDataAdapter;
3042
3136
  }
3043
- export interface SqlTicket {
3044
- id: string;
3045
- tenant_id: string;
3046
- client_id: string;
3047
- email: string;
3048
- nonce?: string;
3049
- state?: string;
3050
- scope?: string;
3051
- response_type?: AuthorizationResponseType;
3052
- response_mode?: AuthorizationResponseMode;
3053
- redirect_uri?: string;
3054
- created_at: string;
3055
- expires_at: string;
3056
- used_at?: string;
3057
- }
3058
3137
  export interface SqlLog {
3059
3138
  id: string;
3060
3139
  tenant_id: string;
@@ -3106,6 +3185,15 @@ declare const sqlConnectionSchema: z.ZodObject<z.objectUtil.extendShape<any, {
3106
3185
  [x: string]: any;
3107
3186
  tenant_id?: unknown;
3108
3187
  }>;
3188
+ declare const sqlBrandingSchema: z.ZodObject<z.objectUtil.extendShape<any, {
3189
+ tenant_id: z.ZodString;
3190
+ }>, "strip", z.ZodTypeAny, {
3191
+ [x: string]: any;
3192
+ tenant_id?: unknown;
3193
+ }, {
3194
+ [x: string]: any;
3195
+ tenant_id?: unknown;
3196
+ }>;
3109
3197
  declare const sqlApplicationSchema: z.ZodObject<{
3110
3198
  tenant_id: z.ZodString;
3111
3199
  addons: z.ZodString;
@@ -3400,9 +3488,37 @@ declare const sqlHookSchema: z.ZodObject<{
3400
3488
  synchronous: number;
3401
3489
  priority?: number | undefined;
3402
3490
  }>;
3491
+ declare const sqlEmailProvidersSchema: z.ZodObject<{
3492
+ tenant_id: z.ZodString;
3493
+ credentials: z.ZodString;
3494
+ settings: z.ZodString;
3495
+ enabled: z.ZodNumber;
3496
+ created_at: z.ZodString;
3497
+ updated_at: z.ZodString;
3498
+ name: z.ZodString;
3499
+ default_from_address: z.ZodOptional<z.ZodString>;
3500
+ }, "strip", z.ZodTypeAny, {
3501
+ tenant_id: string;
3502
+ enabled: number;
3503
+ name: string;
3504
+ created_at: string;
3505
+ updated_at: string;
3506
+ credentials: string;
3507
+ settings: string;
3508
+ default_from_address?: string | undefined;
3509
+ }, {
3510
+ tenant_id: string;
3511
+ enabled: number;
3512
+ name: string;
3513
+ created_at: string;
3514
+ updated_at: string;
3515
+ credentials: string;
3516
+ settings: string;
3517
+ default_from_address?: string | undefined;
3518
+ }>;
3403
3519
  export interface Database {
3404
3520
  applications: z.infer<typeof sqlApplicationSchema>;
3405
- branding: SqlBranding;
3521
+ branding: z.infer<typeof sqlBrandingSchema>;
3406
3522
  codes: Code & {
3407
3523
  tenant_id: string;
3408
3524
  };
@@ -3410,6 +3526,7 @@ export interface Database {
3410
3526
  domains: Domain & {
3411
3527
  tenant_id: string;
3412
3528
  };
3529
+ email_providers: z.infer<typeof sqlEmailProvidersSchema>;
3413
3530
  hooks: z.infer<typeof sqlHookSchema>;
3414
3531
  keys: SigningKey & {
3415
3532
  created_at: string;
@@ -3426,7 +3543,6 @@ export interface Database {
3426
3543
  };
3427
3544
  tenants: Tenant;
3428
3545
  themes: z.infer<typeof sqlThemeSchema>;
3429
- tickets: SqlTicket;
3430
3546
  }
3431
3547
  export declare function migrateToLatest(db: Kysely<Database>, debug?: boolean): Promise<void>;
3432
3548
  export declare function migrateDown(db: Kysely<Database>): Promise<void>;