@authhero/kysely-adapter 2.0.0 → 4.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.
@@ -3005,6 +3005,61 @@ declare const emailProviderSchema: z.ZodObject<{
3005
3005
  settings?: {} | undefined;
3006
3006
  }>;
3007
3007
  export type EmailProvider = z.infer<typeof emailProviderSchema>;
3008
+ declare const refreshTokenInsertSchema: z.ZodObject<{
3009
+ token: z.ZodString;
3010
+ session_id: z.ZodString;
3011
+ scope: z.ZodString;
3012
+ audience: z.ZodString;
3013
+ expires_at: z.ZodString;
3014
+ used_at: z.ZodOptional<z.ZodString>;
3015
+ revoked_at: z.ZodOptional<z.ZodString>;
3016
+ }, "strip", z.ZodTypeAny, {
3017
+ audience: string;
3018
+ token: string;
3019
+ scope: string;
3020
+ expires_at: string;
3021
+ session_id: string;
3022
+ used_at?: string | undefined;
3023
+ revoked_at?: string | undefined;
3024
+ }, {
3025
+ audience: string;
3026
+ token: string;
3027
+ scope: string;
3028
+ expires_at: string;
3029
+ session_id: string;
3030
+ used_at?: string | undefined;
3031
+ revoked_at?: string | undefined;
3032
+ }>;
3033
+ export type RefreshTokenInsert = z.infer<typeof refreshTokenInsertSchema>;
3034
+ declare const refreshTokenSchema: z.ZodObject<{
3035
+ token: z.ZodString;
3036
+ session_id: z.ZodString;
3037
+ scope: z.ZodString;
3038
+ audience: z.ZodString;
3039
+ expires_at: z.ZodString;
3040
+ used_at: z.ZodOptional<z.ZodString>;
3041
+ revoked_at: z.ZodOptional<z.ZodString>;
3042
+ created_at: z.ZodString;
3043
+ }, "strip", z.ZodTypeAny, {
3044
+ created_at: string;
3045
+ audience: string;
3046
+ token: string;
3047
+ scope: string;
3048
+ expires_at: string;
3049
+ session_id: string;
3050
+ used_at?: string | undefined;
3051
+ revoked_at?: string | undefined;
3052
+ }, {
3053
+ created_at: string;
3054
+ audience: string;
3055
+ token: string;
3056
+ scope: string;
3057
+ expires_at: string;
3058
+ session_id: string;
3059
+ used_at?: string | undefined;
3060
+ revoked_at?: string | undefined;
3061
+ }>;
3062
+ export type RefreshToken = z.infer<typeof refreshTokenSchema>;
3008
3063
  export interface ListCodesResponse extends Totals {
3009
3064
  codes: Code[];
3010
3065
  }
@@ -3138,6 +3193,16 @@ export interface EmailProvidersAdapter {
3138
3193
  create: (tenant_id: string, emailProvider: EmailProvider) => Promise<void>;
3139
3194
  get: (tenant_id: string) => Promise<EmailProvider | null>;
3140
3195
  }
3196
+ export interface ListRefreshTokenResponse extends Totals {
3197
+ refresh_tokens: RefreshToken[];
3198
+ }
3199
+ export interface RefreshTokensAdapter {
3200
+ create: (tenant_id: string, refresh_token: RefreshTokenInsert) => Promise<RefreshToken>;
3201
+ get: (tenant_id: string, id: string) => Promise<RefreshToken | null>;
3202
+ list(tenant_id: string, params?: ListParams): Promise<ListRefreshTokenResponse>;
3203
+ update: (tenant_id: string, id: string, refresh_token: Partial<RefreshToken>) => Promise<boolean>;
3204
+ remove: (tenant_id: string, id: string) => Promise<boolean>;
3205
+ }
3141
3206
  export interface DataAdapters {
3142
3207
  applications: ApplicationsAdapter;
3143
3208
  branding: BrandingAdapter;
@@ -3152,6 +3217,7 @@ export interface DataAdapters {
3152
3217
  logs: LogsDataAdapter;
3153
3218
  passwords: PasswordsAdapter;
3154
3219
  promptSettings: PromptSettingsAdapter;
3220
+ refreshTokens: RefreshTokensAdapter;
3155
3221
  sessions: SessionsAdapter;
3156
3222
  tenants: TenantsDataAdapter;
3157
3223
  themes: ThemesAdapter;
@@ -3560,6 +3626,9 @@ export interface Database {
3560
3626
  tenant_id: string;
3561
3627
  };
3562
3628
  prompt_settings: z.infer<typeof sqlPromptSettingSchema>;
3629
+ refresh_tokens: RefreshToken & {
3630
+ tenant_id: string;
3631
+ };
3563
3632
  users: z.infer<typeof sqlUserSchema>;
3564
3633
  sessions: Session & {
3565
3634
  tenant_id: string;