@authhero/kysely-adapter 0.20.1 → 0.22.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;
@@ -1113,6 +1102,7 @@ declare const codeInsertSchema: z.ZodObject<{
1113
1102
  "oauth2_state",
1114
1103
  "ticket"
1115
1104
  ]>;
1105
+ code_verifier: z.ZodOptional<z.ZodString>;
1116
1106
  expires_at: z.ZodString;
1117
1107
  used_at: z.ZodOptional<z.ZodString>;
1118
1108
  user_id: z.ZodOptional<z.ZodString>;
@@ -1123,6 +1113,7 @@ declare const codeInsertSchema: z.ZodObject<{
1123
1113
  expires_at: string;
1124
1114
  user_id?: string | undefined;
1125
1115
  connection_id?: string | undefined;
1116
+ code_verifier?: string | undefined;
1126
1117
  used_at?: string | undefined;
1127
1118
  }, {
1128
1119
  code_id: string;
@@ -1131,6 +1122,7 @@ declare const codeInsertSchema: z.ZodObject<{
1131
1122
  expires_at: string;
1132
1123
  user_id?: string | undefined;
1133
1124
  connection_id?: string | undefined;
1125
+ code_verifier?: string | undefined;
1134
1126
  used_at?: string | undefined;
1135
1127
  }>;
1136
1128
  export type CodeInsert = z.infer<typeof codeInsertSchema>;
@@ -1147,6 +1139,7 @@ declare const codeSchema: z.ZodObject<{
1147
1139
  "oauth2_state",
1148
1140
  "ticket"
1149
1141
  ]>;
1142
+ code_verifier: z.ZodOptional<z.ZodString>;
1150
1143
  expires_at: z.ZodString;
1151
1144
  used_at: z.ZodOptional<z.ZodString>;
1152
1145
  user_id: z.ZodOptional<z.ZodString>;
@@ -1158,6 +1151,7 @@ declare const codeSchema: z.ZodObject<{
1158
1151
  expires_at: string;
1159
1152
  user_id?: string | undefined;
1160
1153
  connection_id?: string | undefined;
1154
+ code_verifier?: string | undefined;
1161
1155
  used_at?: string | undefined;
1162
1156
  }, {
1163
1157
  created_at: string;
@@ -1167,6 +1161,7 @@ declare const codeSchema: z.ZodObject<{
1167
1161
  expires_at: string;
1168
1162
  user_id?: string | undefined;
1169
1163
  connection_id?: string | undefined;
1164
+ code_verifier?: string | undefined;
1170
1165
  used_at?: string | undefined;
1171
1166
  }>;
1172
1167
  export type Code = z.infer<typeof codeSchema>;
@@ -2856,23 +2851,122 @@ declare const promptSettingSchema: z.ZodObject<{
2856
2851
  password_first?: boolean | undefined;
2857
2852
  }>;
2858
2853
  export type PromptSetting = z.infer<typeof promptSettingSchema>;
2859
- export interface Ticket {
2860
- id: string;
2861
- tenant_id: string;
2862
- client_id: string;
2863
- email: string;
2864
- authParams?: {
2865
- nonce?: string;
2866
- state?: string;
2867
- scope?: string;
2868
- response_type?: AuthorizationResponseType;
2869
- response_mode?: AuthorizationResponseMode;
2870
- redirect_uri?: string;
2854
+ declare const emailProviderSchema: z.ZodObject<{
2855
+ name: z.ZodString;
2856
+ enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2857
+ default_from_address: z.ZodOptional<z.ZodString>;
2858
+ credentials: z.ZodUnion<[
2859
+ z.ZodObject<{
2860
+ accessKeyId: z.ZodString;
2861
+ secretAccessKey: z.ZodString;
2862
+ region: z.ZodString;
2863
+ }, "strip", z.ZodTypeAny, {
2864
+ accessKeyId: string;
2865
+ secretAccessKey: string;
2866
+ region: string;
2867
+ }, {
2868
+ accessKeyId: string;
2869
+ secretAccessKey: string;
2870
+ region: string;
2871
+ }>,
2872
+ z.ZodObject<{
2873
+ smtp_host: z.ZodArray<z.ZodString, "many">;
2874
+ smtp_port: z.ZodNumber;
2875
+ smtp_user: z.ZodString;
2876
+ smtp_pass: z.ZodString;
2877
+ }, "strip", z.ZodTypeAny, {
2878
+ smtp_host: string[];
2879
+ smtp_port: number;
2880
+ smtp_user: string;
2881
+ smtp_pass: string;
2882
+ }, {
2883
+ smtp_host: string[];
2884
+ smtp_port: number;
2885
+ smtp_user: string;
2886
+ smtp_pass: string;
2887
+ }>,
2888
+ z.ZodObject<{
2889
+ api_key: z.ZodString;
2890
+ domain: z.ZodOptional<z.ZodString>;
2891
+ }, "strip", z.ZodTypeAny, {
2892
+ api_key: string;
2893
+ domain?: string | undefined;
2894
+ }, {
2895
+ api_key: string;
2896
+ domain?: string | undefined;
2897
+ }>,
2898
+ z.ZodObject<{
2899
+ connectionString: z.ZodString;
2900
+ }, "strip", z.ZodTypeAny, {
2901
+ connectionString: string;
2902
+ }, {
2903
+ connectionString: string;
2904
+ }>,
2905
+ z.ZodObject<{
2906
+ tenantId: z.ZodString;
2907
+ clientId: z.ZodString;
2908
+ clientSecret: z.ZodString;
2909
+ }, "strip", z.ZodTypeAny, {
2910
+ tenantId: string;
2911
+ clientId: string;
2912
+ clientSecret: string;
2913
+ }, {
2914
+ tenantId: string;
2915
+ clientId: string;
2916
+ clientSecret: string;
2917
+ }>
2918
+ ]>;
2919
+ settings: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
2920
+ }, "strip", z.ZodTypeAny, {
2921
+ name: string;
2922
+ enabled: boolean;
2923
+ credentials: {
2924
+ accessKeyId: string;
2925
+ secretAccessKey: string;
2926
+ region: string;
2927
+ } | {
2928
+ smtp_host: string[];
2929
+ smtp_port: number;
2930
+ smtp_user: string;
2931
+ smtp_pass: string;
2932
+ } | {
2933
+ api_key: string;
2934
+ domain?: string | undefined;
2935
+ } | {
2936
+ connectionString: string;
2937
+ } | {
2938
+ tenantId: string;
2939
+ clientId: string;
2940
+ clientSecret: string;
2871
2941
  };
2872
- created_at: Date;
2873
- expires_at: Date;
2874
- used_at?: Date;
2875
- }
2942
+ default_from_address?: string | undefined;
2943
+ settings?: {} | undefined;
2944
+ }, {
2945
+ name: string;
2946
+ credentials: {
2947
+ accessKeyId: string;
2948
+ secretAccessKey: string;
2949
+ region: string;
2950
+ } | {
2951
+ smtp_host: string[];
2952
+ smtp_port: number;
2953
+ smtp_user: string;
2954
+ smtp_pass: string;
2955
+ } | {
2956
+ api_key: string;
2957
+ domain?: string | undefined;
2958
+ } | {
2959
+ connectionString: string;
2960
+ } | {
2961
+ tenantId: string;
2962
+ clientId: string;
2963
+ clientSecret: string;
2964
+ };
2965
+ enabled?: boolean | undefined;
2966
+ default_from_address?: string | undefined;
2967
+ settings?: {} | undefined;
2968
+ }>;
2969
+ export type EmailProvider = z.infer<typeof emailProviderSchema>;
2876
2970
  export interface ListParams {
2877
2971
  page: number;
2878
2972
  per_page: number;
@@ -2926,11 +3020,6 @@ export interface TenantsDataAdapter {
2926
3020
  update(id: string, tenant: Partial<Tenant>): Promise<void>;
2927
3021
  remove(tenantId: string): Promise<boolean>;
2928
3022
  }
2929
- export interface TicketsAdapter {
2930
- create: (ticket: Ticket) => Promise<void>;
2931
- get: (tenant_id: string, id: string) => Promise<Ticket | null>;
2932
- remove: (tenant_id: string, id: string) => Promise<void>;
2933
- }
2934
3023
  export interface ListUsersResponse extends Totals {
2935
3024
  users: User[];
2936
3025
  }
@@ -3015,6 +3104,11 @@ export interface PromptSettingsAdapter {
3015
3104
  set: (tenant_id: string, promptSetting: Partial<PromptSetting>) => Promise<void>;
3016
3105
  get: (tenant_id: string) => Promise<PromptSetting>;
3017
3106
  }
3107
+ export interface EmailProvidersAdapter {
3108
+ update: (tenant_id: string, emailProvider: Partial<EmailProvider>) => Promise<void>;
3109
+ create: (tenant_id: string, emailProvider: EmailProvider) => Promise<void>;
3110
+ get: (tenant_id: string) => Promise<EmailProvider | null>;
3111
+ }
3018
3112
  export interface DataAdapters {
3019
3113
  applications: ApplicationsAdapter;
3020
3114
  branding: BrandingAdapter;
@@ -3022,6 +3116,7 @@ export interface DataAdapters {
3022
3116
  codes: CodesAdapter;
3023
3117
  connections: ConnectionsAdapter;
3024
3118
  domains: DomainsAdapter;
3119
+ emailProviders: EmailProvidersAdapter;
3025
3120
  hooks: HooksAdapter;
3026
3121
  keys: KeysAdapter;
3027
3122
  logins: LoginsAdapter;
@@ -3031,24 +3126,8 @@ export interface DataAdapters {
3031
3126
  sessions: SessionsAdapter;
3032
3127
  tenants: TenantsDataAdapter;
3033
3128
  themes: ThemesAdapter;
3034
- tickets: TicketsAdapter;
3035
3129
  users: UserDataAdapter;
3036
3130
  }
3037
- export interface SqlTicket {
3038
- id: string;
3039
- tenant_id: string;
3040
- client_id: string;
3041
- email: string;
3042
- nonce?: string;
3043
- state?: string;
3044
- scope?: string;
3045
- response_type?: AuthorizationResponseType;
3046
- response_mode?: AuthorizationResponseMode;
3047
- redirect_uri?: string;
3048
- created_at: string;
3049
- expires_at: string;
3050
- used_at?: string;
3051
- }
3052
3131
  export interface SqlLog {
3053
3132
  id: string;
3054
3133
  tenant_id: string;
@@ -3100,6 +3179,15 @@ declare const sqlConnectionSchema: z.ZodObject<z.objectUtil.extendShape<any, {
3100
3179
  [x: string]: any;
3101
3180
  tenant_id?: unknown;
3102
3181
  }>;
3182
+ declare const sqlBrandingSchema: z.ZodObject<z.objectUtil.extendShape<any, {
3183
+ tenant_id: z.ZodString;
3184
+ }>, "strip", z.ZodTypeAny, {
3185
+ [x: string]: any;
3186
+ tenant_id?: unknown;
3187
+ }, {
3188
+ [x: string]: any;
3189
+ tenant_id?: unknown;
3190
+ }>;
3103
3191
  declare const sqlApplicationSchema: z.ZodObject<{
3104
3192
  tenant_id: z.ZodString;
3105
3193
  addons: z.ZodString;
@@ -3394,9 +3482,37 @@ declare const sqlHookSchema: z.ZodObject<{
3394
3482
  synchronous: number;
3395
3483
  priority?: number | undefined;
3396
3484
  }>;
3485
+ declare const sqlEmailProvidersSchema: z.ZodObject<{
3486
+ tenant_id: z.ZodString;
3487
+ credentials: z.ZodString;
3488
+ settings: z.ZodString;
3489
+ enabled: z.ZodNumber;
3490
+ created_at: z.ZodString;
3491
+ updated_at: z.ZodString;
3492
+ name: z.ZodString;
3493
+ default_from_address: z.ZodOptional<z.ZodString>;
3494
+ }, "strip", z.ZodTypeAny, {
3495
+ tenant_id: string;
3496
+ enabled: number;
3497
+ name: string;
3498
+ created_at: string;
3499
+ updated_at: string;
3500
+ credentials: string;
3501
+ settings: string;
3502
+ default_from_address?: string | undefined;
3503
+ }, {
3504
+ tenant_id: string;
3505
+ enabled: number;
3506
+ name: string;
3507
+ created_at: string;
3508
+ updated_at: string;
3509
+ credentials: string;
3510
+ settings: string;
3511
+ default_from_address?: string | undefined;
3512
+ }>;
3397
3513
  export interface Database {
3398
3514
  applications: z.infer<typeof sqlApplicationSchema>;
3399
- branding: SqlBranding;
3515
+ branding: z.infer<typeof sqlBrandingSchema>;
3400
3516
  codes: Code & {
3401
3517
  tenant_id: string;
3402
3518
  };
@@ -3404,6 +3520,7 @@ export interface Database {
3404
3520
  domains: Domain & {
3405
3521
  tenant_id: string;
3406
3522
  };
3523
+ email_providers: z.infer<typeof sqlEmailProvidersSchema>;
3407
3524
  hooks: z.infer<typeof sqlHookSchema>;
3408
3525
  keys: SigningKey & {
3409
3526
  created_at: string;
@@ -3420,7 +3537,6 @@ export interface Database {
3420
3537
  };
3421
3538
  tenants: Tenant;
3422
3539
  themes: z.infer<typeof sqlThemeSchema>;
3423
- tickets: SqlTicket;
3424
3540
  }
3425
3541
  export declare function migrateToLatest(db: Kysely<Database>, debug?: boolean): Promise<void>;
3426
3542
  export declare function migrateDown(db: Kysely<Database>): Promise<void>;