authhero 0.82.0 → 0.84.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,19 +3,6 @@
3
3
  import { OpenAPIHono, z } from '@hono/zod-openapi';
4
4
  import { Context } from 'hono';
5
5
 
6
- export type Variables = {
7
- tenant_id: string;
8
- client_id?: string;
9
- user_id?: string;
10
- username?: string;
11
- connection?: string;
12
- body?: any;
13
- log?: string;
14
- user?: {
15
- sub: string;
16
- tenant_id: string;
17
- };
18
- };
19
6
  export declare const totalsSchema: z.ZodObject<{
20
7
  start: z.ZodNumber;
21
8
  limit: z.ZodNumber;
@@ -1004,12 +991,12 @@ export declare enum CodeChallengeMethod {
1004
991
  }
1005
992
  export declare const authParamsSchema: z.ZodObject<{
1006
993
  client_id: z.ZodString;
1007
- vendor_id: z.ZodOptional<z.ZodString>;
1008
994
  act_as: z.ZodOptional<z.ZodString>;
1009
995
  response_type: z.ZodOptional<z.ZodNativeEnum<typeof AuthorizationResponseType>>;
1010
996
  response_mode: z.ZodOptional<z.ZodNativeEnum<typeof AuthorizationResponseMode>>;
1011
997
  redirect_uri: z.ZodOptional<z.ZodString>;
1012
998
  audience: z.ZodOptional<z.ZodString>;
999
+ organization: z.ZodOptional<z.ZodString>;
1013
1000
  state: z.ZodOptional<z.ZodString>;
1014
1001
  nonce: z.ZodOptional<z.ZodString>;
1015
1002
  scope: z.ZodOptional<z.ZodString>;
@@ -1018,15 +1005,16 @@ export declare const authParamsSchema: z.ZodObject<{
1018
1005
  code_challenge: z.ZodOptional<z.ZodString>;
1019
1006
  username: z.ZodOptional<z.ZodString>;
1020
1007
  ui_locales: z.ZodOptional<z.ZodString>;
1008
+ vendor_id: z.ZodOptional<z.ZodString>;
1021
1009
  }, "strip", z.ZodTypeAny, {
1022
1010
  client_id: string;
1023
1011
  username?: string | undefined;
1024
1012
  audience?: string | undefined;
1025
- vendor_id?: string | undefined;
1026
1013
  act_as?: string | undefined;
1027
1014
  response_type?: AuthorizationResponseType | undefined;
1028
1015
  response_mode?: AuthorizationResponseMode | undefined;
1029
1016
  redirect_uri?: string | undefined;
1017
+ organization?: string | undefined;
1030
1018
  state?: string | undefined;
1031
1019
  nonce?: string | undefined;
1032
1020
  scope?: string | undefined;
@@ -1034,15 +1022,16 @@ export declare const authParamsSchema: z.ZodObject<{
1034
1022
  code_challenge_method?: CodeChallengeMethod | undefined;
1035
1023
  code_challenge?: string | undefined;
1036
1024
  ui_locales?: string | undefined;
1025
+ vendor_id?: string | undefined;
1037
1026
  }, {
1038
1027
  client_id: string;
1039
1028
  username?: string | undefined;
1040
1029
  audience?: string | undefined;
1041
- vendor_id?: string | undefined;
1042
1030
  act_as?: string | undefined;
1043
1031
  response_type?: AuthorizationResponseType | undefined;
1044
1032
  response_mode?: AuthorizationResponseMode | undefined;
1045
1033
  redirect_uri?: string | undefined;
1034
+ organization?: string | undefined;
1046
1035
  state?: string | undefined;
1047
1036
  nonce?: string | undefined;
1048
1037
  scope?: string | undefined;
@@ -1050,6 +1039,7 @@ export declare const authParamsSchema: z.ZodObject<{
1050
1039
  code_challenge_method?: CodeChallengeMethod | undefined;
1051
1040
  code_challenge?: string | undefined;
1052
1041
  ui_locales?: string | undefined;
1042
+ vendor_id?: string | undefined;
1053
1043
  }>;
1054
1044
  export type AuthParams = z.infer<typeof authParamsSchema>;
1055
1045
  export declare const brandingSchema: z.ZodObject<{
@@ -2253,16 +2243,16 @@ export interface ListParams {
2253
2243
  sort_order: "asc" | "desc";
2254
2244
  };
2255
2245
  }
2256
- export declare const loginInsertSchema: z.ZodObject<{
2246
+ export declare const loginSessionInsertSchema: z.ZodObject<{
2257
2247
  auth0Client: z.ZodOptional<z.ZodString>;
2258
2248
  authParams: z.ZodObject<{
2259
2249
  client_id: z.ZodString;
2260
- vendor_id: z.ZodOptional<z.ZodString>;
2261
2250
  act_as: z.ZodOptional<z.ZodString>;
2262
2251
  response_type: z.ZodOptional<z.ZodNativeEnum<typeof AuthorizationResponseType>>;
2263
2252
  response_mode: z.ZodOptional<z.ZodNativeEnum<typeof AuthorizationResponseMode>>;
2264
2253
  redirect_uri: z.ZodOptional<z.ZodString>;
2265
2254
  audience: z.ZodOptional<z.ZodString>;
2255
+ organization: z.ZodOptional<z.ZodString>;
2266
2256
  state: z.ZodOptional<z.ZodString>;
2267
2257
  nonce: z.ZodOptional<z.ZodString>;
2268
2258
  scope: z.ZodOptional<z.ZodString>;
@@ -2271,15 +2261,16 @@ export declare const loginInsertSchema: z.ZodObject<{
2271
2261
  code_challenge: z.ZodOptional<z.ZodString>;
2272
2262
  username: z.ZodOptional<z.ZodString>;
2273
2263
  ui_locales: z.ZodOptional<z.ZodString>;
2264
+ vendor_id: z.ZodOptional<z.ZodString>;
2274
2265
  }, "strip", z.ZodTypeAny, {
2275
2266
  client_id: string;
2276
2267
  username?: string | undefined;
2277
2268
  audience?: string | undefined;
2278
- vendor_id?: string | undefined;
2279
2269
  act_as?: string | undefined;
2280
2270
  response_type?: AuthorizationResponseType | undefined;
2281
2271
  response_mode?: AuthorizationResponseMode | undefined;
2282
2272
  redirect_uri?: string | undefined;
2273
+ organization?: string | undefined;
2283
2274
  state?: string | undefined;
2284
2275
  nonce?: string | undefined;
2285
2276
  scope?: string | undefined;
@@ -2287,15 +2278,16 @@ export declare const loginInsertSchema: z.ZodObject<{
2287
2278
  code_challenge_method?: CodeChallengeMethod | undefined;
2288
2279
  code_challenge?: string | undefined;
2289
2280
  ui_locales?: string | undefined;
2281
+ vendor_id?: string | undefined;
2290
2282
  }, {
2291
2283
  client_id: string;
2292
2284
  username?: string | undefined;
2293
2285
  audience?: string | undefined;
2294
- vendor_id?: string | undefined;
2295
2286
  act_as?: string | undefined;
2296
2287
  response_type?: AuthorizationResponseType | undefined;
2297
2288
  response_mode?: AuthorizationResponseMode | undefined;
2298
2289
  redirect_uri?: string | undefined;
2290
+ organization?: string | undefined;
2299
2291
  state?: string | undefined;
2300
2292
  nonce?: string | undefined;
2301
2293
  scope?: string | undefined;
@@ -2303,22 +2295,24 @@ export declare const loginInsertSchema: z.ZodObject<{
2303
2295
  code_challenge_method?: CodeChallengeMethod | undefined;
2304
2296
  code_challenge?: string | undefined;
2305
2297
  ui_locales?: string | undefined;
2298
+ vendor_id?: string | undefined;
2306
2299
  }>;
2307
2300
  expires_at: z.ZodString;
2308
2301
  deleted_at: z.ZodOptional<z.ZodString>;
2309
2302
  ip: z.ZodOptional<z.ZodString>;
2310
2303
  useragent: z.ZodOptional<z.ZodString>;
2304
+ authorization_url: z.ZodOptional<z.ZodString>;
2311
2305
  }, "strip", z.ZodTypeAny, {
2312
2306
  expires_at: string;
2313
2307
  authParams: {
2314
2308
  client_id: string;
2315
2309
  username?: string | undefined;
2316
2310
  audience?: string | undefined;
2317
- vendor_id?: string | undefined;
2318
2311
  act_as?: string | undefined;
2319
2312
  response_type?: AuthorizationResponseType | undefined;
2320
2313
  response_mode?: AuthorizationResponseMode | undefined;
2321
2314
  redirect_uri?: string | undefined;
2315
+ organization?: string | undefined;
2322
2316
  state?: string | undefined;
2323
2317
  nonce?: string | undefined;
2324
2318
  scope?: string | undefined;
@@ -2326,22 +2320,24 @@ export declare const loginInsertSchema: z.ZodObject<{
2326
2320
  code_challenge_method?: CodeChallengeMethod | undefined;
2327
2321
  code_challenge?: string | undefined;
2328
2322
  ui_locales?: string | undefined;
2323
+ vendor_id?: string | undefined;
2329
2324
  };
2330
2325
  auth0Client?: string | undefined;
2331
2326
  deleted_at?: string | undefined;
2332
2327
  ip?: string | undefined;
2333
2328
  useragent?: string | undefined;
2329
+ authorization_url?: string | undefined;
2334
2330
  }, {
2335
2331
  expires_at: string;
2336
2332
  authParams: {
2337
2333
  client_id: string;
2338
2334
  username?: string | undefined;
2339
2335
  audience?: string | undefined;
2340
- vendor_id?: string | undefined;
2341
2336
  act_as?: string | undefined;
2342
2337
  response_type?: AuthorizationResponseType | undefined;
2343
2338
  response_mode?: AuthorizationResponseMode | undefined;
2344
2339
  redirect_uri?: string | undefined;
2340
+ organization?: string | undefined;
2345
2341
  state?: string | undefined;
2346
2342
  nonce?: string | undefined;
2347
2343
  scope?: string | undefined;
@@ -2349,26 +2345,28 @@ export declare const loginInsertSchema: z.ZodObject<{
2349
2345
  code_challenge_method?: CodeChallengeMethod | undefined;
2350
2346
  code_challenge?: string | undefined;
2351
2347
  ui_locales?: string | undefined;
2348
+ vendor_id?: string | undefined;
2352
2349
  };
2353
2350
  auth0Client?: string | undefined;
2354
2351
  deleted_at?: string | undefined;
2355
2352
  ip?: string | undefined;
2356
2353
  useragent?: string | undefined;
2354
+ authorization_url?: string | undefined;
2357
2355
  }>;
2358
- export type LoginInsert = z.infer<typeof loginInsertSchema>;
2359
- export declare const loginSchema: z.ZodObject<{
2356
+ export type LoginSessionInsert = z.infer<typeof loginSessionInsertSchema>;
2357
+ export declare const loginSessionSchema: z.ZodObject<{
2360
2358
  login_id: z.ZodString;
2361
2359
  created_at: z.ZodString;
2362
2360
  updated_at: z.ZodString;
2363
2361
  auth0Client: z.ZodOptional<z.ZodString>;
2364
2362
  authParams: z.ZodObject<{
2365
2363
  client_id: z.ZodString;
2366
- vendor_id: z.ZodOptional<z.ZodString>;
2367
2364
  act_as: z.ZodOptional<z.ZodString>;
2368
2365
  response_type: z.ZodOptional<z.ZodNativeEnum<typeof AuthorizationResponseType>>;
2369
2366
  response_mode: z.ZodOptional<z.ZodNativeEnum<typeof AuthorizationResponseMode>>;
2370
2367
  redirect_uri: z.ZodOptional<z.ZodString>;
2371
2368
  audience: z.ZodOptional<z.ZodString>;
2369
+ organization: z.ZodOptional<z.ZodString>;
2372
2370
  state: z.ZodOptional<z.ZodString>;
2373
2371
  nonce: z.ZodOptional<z.ZodString>;
2374
2372
  scope: z.ZodOptional<z.ZodString>;
@@ -2377,15 +2375,16 @@ export declare const loginSchema: z.ZodObject<{
2377
2375
  code_challenge: z.ZodOptional<z.ZodString>;
2378
2376
  username: z.ZodOptional<z.ZodString>;
2379
2377
  ui_locales: z.ZodOptional<z.ZodString>;
2378
+ vendor_id: z.ZodOptional<z.ZodString>;
2380
2379
  }, "strip", z.ZodTypeAny, {
2381
2380
  client_id: string;
2382
2381
  username?: string | undefined;
2383
2382
  audience?: string | undefined;
2384
- vendor_id?: string | undefined;
2385
2383
  act_as?: string | undefined;
2386
2384
  response_type?: AuthorizationResponseType | undefined;
2387
2385
  response_mode?: AuthorizationResponseMode | undefined;
2388
2386
  redirect_uri?: string | undefined;
2387
+ organization?: string | undefined;
2389
2388
  state?: string | undefined;
2390
2389
  nonce?: string | undefined;
2391
2390
  scope?: string | undefined;
@@ -2393,15 +2392,16 @@ export declare const loginSchema: z.ZodObject<{
2393
2392
  code_challenge_method?: CodeChallengeMethod | undefined;
2394
2393
  code_challenge?: string | undefined;
2395
2394
  ui_locales?: string | undefined;
2395
+ vendor_id?: string | undefined;
2396
2396
  }, {
2397
2397
  client_id: string;
2398
2398
  username?: string | undefined;
2399
2399
  audience?: string | undefined;
2400
- vendor_id?: string | undefined;
2401
2400
  act_as?: string | undefined;
2402
2401
  response_type?: AuthorizationResponseType | undefined;
2403
2402
  response_mode?: AuthorizationResponseMode | undefined;
2404
2403
  redirect_uri?: string | undefined;
2404
+ organization?: string | undefined;
2405
2405
  state?: string | undefined;
2406
2406
  nonce?: string | undefined;
2407
2407
  scope?: string | undefined;
@@ -2409,11 +2409,13 @@ export declare const loginSchema: z.ZodObject<{
2409
2409
  code_challenge_method?: CodeChallengeMethod | undefined;
2410
2410
  code_challenge?: string | undefined;
2411
2411
  ui_locales?: string | undefined;
2412
+ vendor_id?: string | undefined;
2412
2413
  }>;
2413
2414
  expires_at: z.ZodString;
2414
2415
  deleted_at: z.ZodOptional<z.ZodString>;
2415
2416
  ip: z.ZodOptional<z.ZodString>;
2416
2417
  useragent: z.ZodOptional<z.ZodString>;
2418
+ authorization_url: z.ZodOptional<z.ZodString>;
2417
2419
  }, "strip", z.ZodTypeAny, {
2418
2420
  created_at: string;
2419
2421
  updated_at: string;
@@ -2423,11 +2425,11 @@ export declare const loginSchema: z.ZodObject<{
2423
2425
  client_id: string;
2424
2426
  username?: string | undefined;
2425
2427
  audience?: string | undefined;
2426
- vendor_id?: string | undefined;
2427
2428
  act_as?: string | undefined;
2428
2429
  response_type?: AuthorizationResponseType | undefined;
2429
2430
  response_mode?: AuthorizationResponseMode | undefined;
2430
2431
  redirect_uri?: string | undefined;
2432
+ organization?: string | undefined;
2431
2433
  state?: string | undefined;
2432
2434
  nonce?: string | undefined;
2433
2435
  scope?: string | undefined;
@@ -2435,11 +2437,13 @@ export declare const loginSchema: z.ZodObject<{
2435
2437
  code_challenge_method?: CodeChallengeMethod | undefined;
2436
2438
  code_challenge?: string | undefined;
2437
2439
  ui_locales?: string | undefined;
2440
+ vendor_id?: string | undefined;
2438
2441
  };
2439
2442
  auth0Client?: string | undefined;
2440
2443
  deleted_at?: string | undefined;
2441
2444
  ip?: string | undefined;
2442
2445
  useragent?: string | undefined;
2446
+ authorization_url?: string | undefined;
2443
2447
  }, {
2444
2448
  created_at: string;
2445
2449
  updated_at: string;
@@ -2449,11 +2453,11 @@ export declare const loginSchema: z.ZodObject<{
2449
2453
  client_id: string;
2450
2454
  username?: string | undefined;
2451
2455
  audience?: string | undefined;
2452
- vendor_id?: string | undefined;
2453
2456
  act_as?: string | undefined;
2454
2457
  response_type?: AuthorizationResponseType | undefined;
2455
2458
  response_mode?: AuthorizationResponseMode | undefined;
2456
2459
  redirect_uri?: string | undefined;
2460
+ organization?: string | undefined;
2457
2461
  state?: string | undefined;
2458
2462
  nonce?: string | undefined;
2459
2463
  scope?: string | undefined;
@@ -2461,13 +2465,15 @@ export declare const loginSchema: z.ZodObject<{
2461
2465
  code_challenge_method?: CodeChallengeMethod | undefined;
2462
2466
  code_challenge?: string | undefined;
2463
2467
  ui_locales?: string | undefined;
2468
+ vendor_id?: string | undefined;
2464
2469
  };
2465
2470
  auth0Client?: string | undefined;
2466
2471
  deleted_at?: string | undefined;
2467
2472
  ip?: string | undefined;
2468
2473
  useragent?: string | undefined;
2474
+ authorization_url?: string | undefined;
2469
2475
  }>;
2470
- export type Login = z.infer<typeof loginSchema>;
2476
+ export type LoginSession = z.infer<typeof loginSessionSchema>;
2471
2477
  export declare enum LogTypes {
2472
2478
  FAILED_SILENT_AUTH = "fsa",
2473
2479
  FAILED_SIGNUP = "fs",
@@ -4612,10 +4618,10 @@ export interface ThemesAdapter {
4612
4618
  get: (tenant_id: string, themeId: string) => Promise<Theme | null>;
4613
4619
  update: (tenant_id: string, themeId: any, theme: Partial<ThemeInsert>) => Promise<boolean>;
4614
4620
  }
4615
- export interface LoginsAdapter {
4616
- create: (tenant_id: string, session: LoginInsert) => Promise<Login>;
4617
- update: (tenant_id: string, login_id: string, session: Partial<Login>) => Promise<boolean>;
4618
- get: (tenant_id: string, login_id: string) => Promise<Login | null>;
4621
+ export interface LoginSessionsAdapter {
4622
+ create: (tenant_id: string, session: LoginSessionInsert) => Promise<LoginSession>;
4623
+ update: (tenant_id: string, login_id: string, session: Partial<LoginSession>) => Promise<boolean>;
4624
+ get: (tenant_id: string, login_id: string) => Promise<LoginSession | null>;
4619
4625
  remove: (tenant_id: string, login_id: string) => Promise<boolean>;
4620
4626
  }
4621
4627
  export interface PromptSettingsAdapter {
@@ -4647,7 +4653,7 @@ export interface DataAdapters {
4647
4653
  emailProviders: EmailProvidersAdapter;
4648
4654
  hooks: HooksAdapter;
4649
4655
  keys: KeysAdapter;
4650
- logins: LoginsAdapter;
4656
+ loginSessions: LoginSessionsAdapter;
4651
4657
  logs: LogsDataAdapter;
4652
4658
  passwords: PasswordsAdapter;
4653
4659
  promptSettings: PromptSettingsAdapter;
@@ -4657,8 +4663,57 @@ export interface DataAdapters {
4657
4663
  themes: ThemesAdapter;
4658
4664
  users: UserDataAdapter;
4659
4665
  }
4666
+ export type Variables = {
4667
+ tenant_id: string;
4668
+ ip: string;
4669
+ client_id?: string;
4670
+ user_id?: string;
4671
+ username?: string;
4672
+ connection?: string;
4673
+ body?: any;
4674
+ log?: string;
4675
+ user?: {
4676
+ sub: string;
4677
+ tenant_id: string;
4678
+ };
4679
+ loginSession?: LoginSession;
4680
+ };
4681
+ export type Transaction = {
4682
+ locale: string;
4683
+ login_hint?: string;
4684
+ prompt?: string;
4685
+ redirect_uri?: string;
4686
+ requested_scopes?: string[];
4687
+ response_mode?: AuthorizationResponseMode;
4688
+ response_type?: AuthorizationResponseType;
4689
+ state?: string;
4690
+ ui_locales?: string;
4691
+ };
4692
+ export type HookRequest = {
4693
+ body?: Record<string, any>;
4694
+ geoip?: {
4695
+ cityName?: string;
4696
+ continentCode?: string;
4697
+ countryCode?: string;
4698
+ countryCode3?: string;
4699
+ countryName?: string;
4700
+ latitude?: number;
4701
+ longitude?: number;
4702
+ subdivisionCode?: string;
4703
+ subdivisionName?: string;
4704
+ timeZone?: string;
4705
+ };
4706
+ hostname?: string;
4707
+ ip: string;
4708
+ language?: string;
4709
+ method: string;
4710
+ user_agent?: string;
4711
+ url: string;
4712
+ };
4660
4713
  export type HookEvent = {
4661
4714
  client?: Client;
4715
+ request: HookRequest;
4716
+ transaction?: Transaction;
4662
4717
  user?: User;
4663
4718
  scope?: string;
4664
4719
  grant_type?: string;
@@ -6921,9 +6976,10 @@ export declare function init(config: AuthHeroConfig): {
6921
6976
  auth0Client?: string | undefined;
6922
6977
  code_challenge_method?: CodeChallengeMethod | undefined;
6923
6978
  code_challenge?: string | undefined;
6924
- vendor_id?: string | undefined;
6979
+ organization?: string | undefined;
6925
6980
  prompt?: string | undefined;
6926
6981
  ui_locales?: string | undefined;
6982
+ vendor_id?: string | undefined;
6927
6983
  realm?: string | undefined;
6928
6984
  login_hint?: string | undefined;
6929
6985
  max_age?: string | undefined;
@@ -6948,9 +7004,10 @@ export declare function init(config: AuthHeroConfig): {
6948
7004
  auth0Client?: string | undefined;
6949
7005
  code_challenge_method?: CodeChallengeMethod | undefined;
6950
7006
  code_challenge?: string | undefined;
6951
- vendor_id?: string | undefined;
7007
+ organization?: string | undefined;
6952
7008
  prompt?: string | undefined;
6953
7009
  ui_locales?: string | undefined;
7010
+ vendor_id?: string | undefined;
6954
7011
  realm?: string | undefined;
6955
7012
  login_hint?: string | undefined;
6956
7013
  max_age?: string | undefined;
@@ -7005,10 +7062,11 @@ export declare function init(config: AuthHeroConfig): {
7005
7062
  redirect_uri?: string | undefined;
7006
7063
  code_challenge_method?: CodeChallengeMethod | undefined;
7007
7064
  code_challenge?: string | undefined;
7008
- vendor_id?: string | undefined;
7009
7065
  act_as?: string | undefined;
7066
+ organization?: string | undefined;
7010
7067
  prompt?: string | undefined;
7011
7068
  ui_locales?: string | undefined;
7069
+ vendor_id?: string | undefined;
7012
7070
  };
7013
7071
  send: "code" | "link";
7014
7072
  };