@authhero/kysely-adapter 0.21.0 → 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;
@@ -2862,23 +2851,122 @@ declare const promptSettingSchema: z.ZodObject<{
2862
2851
  password_first?: boolean | undefined;
2863
2852
  }>;
2864
2853
  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;
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;
2877
2941
  };
2878
- created_at: Date;
2879
- expires_at: Date;
2880
- used_at?: Date;
2881
- }
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>;
2882
2970
  export interface ListParams {
2883
2971
  page: number;
2884
2972
  per_page: number;
@@ -2932,11 +3020,6 @@ export interface TenantsDataAdapter {
2932
3020
  update(id: string, tenant: Partial<Tenant>): Promise<void>;
2933
3021
  remove(tenantId: string): Promise<boolean>;
2934
3022
  }
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
3023
  export interface ListUsersResponse extends Totals {
2941
3024
  users: User[];
2942
3025
  }
@@ -3021,6 +3104,11 @@ export interface PromptSettingsAdapter {
3021
3104
  set: (tenant_id: string, promptSetting: Partial<PromptSetting>) => Promise<void>;
3022
3105
  get: (tenant_id: string) => Promise<PromptSetting>;
3023
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
+ }
3024
3112
  export interface DataAdapters {
3025
3113
  applications: ApplicationsAdapter;
3026
3114
  branding: BrandingAdapter;
@@ -3028,6 +3116,7 @@ export interface DataAdapters {
3028
3116
  codes: CodesAdapter;
3029
3117
  connections: ConnectionsAdapter;
3030
3118
  domains: DomainsAdapter;
3119
+ emailProviders: EmailProvidersAdapter;
3031
3120
  hooks: HooksAdapter;
3032
3121
  keys: KeysAdapter;
3033
3122
  logins: LoginsAdapter;
@@ -3037,24 +3126,8 @@ export interface DataAdapters {
3037
3126
  sessions: SessionsAdapter;
3038
3127
  tenants: TenantsDataAdapter;
3039
3128
  themes: ThemesAdapter;
3040
- tickets: TicketsAdapter;
3041
3129
  users: UserDataAdapter;
3042
3130
  }
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
3131
  export interface SqlLog {
3059
3132
  id: string;
3060
3133
  tenant_id: string;
@@ -3106,6 +3179,15 @@ declare const sqlConnectionSchema: z.ZodObject<z.objectUtil.extendShape<any, {
3106
3179
  [x: string]: any;
3107
3180
  tenant_id?: unknown;
3108
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
+ }>;
3109
3191
  declare const sqlApplicationSchema: z.ZodObject<{
3110
3192
  tenant_id: z.ZodString;
3111
3193
  addons: z.ZodString;
@@ -3400,9 +3482,37 @@ declare const sqlHookSchema: z.ZodObject<{
3400
3482
  synchronous: number;
3401
3483
  priority?: number | undefined;
3402
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
+ }>;
3403
3513
  export interface Database {
3404
3514
  applications: z.infer<typeof sqlApplicationSchema>;
3405
- branding: SqlBranding;
3515
+ branding: z.infer<typeof sqlBrandingSchema>;
3406
3516
  codes: Code & {
3407
3517
  tenant_id: string;
3408
3518
  };
@@ -3410,6 +3520,7 @@ export interface Database {
3410
3520
  domains: Domain & {
3411
3521
  tenant_id: string;
3412
3522
  };
3523
+ email_providers: z.infer<typeof sqlEmailProvidersSchema>;
3413
3524
  hooks: z.infer<typeof sqlHookSchema>;
3414
3525
  keys: SigningKey & {
3415
3526
  created_at: string;
@@ -3426,7 +3537,6 @@ export interface Database {
3426
3537
  };
3427
3538
  tenants: Tenant;
3428
3539
  themes: z.infer<typeof sqlThemeSchema>;
3429
- tickets: SqlTicket;
3430
3540
  }
3431
3541
  export declare function migrateToLatest(db: Kysely<Database>, debug?: boolean): Promise<void>;
3432
3542
  export declare function migrateDown(db: Kysely<Database>): Promise<void>;