@authhero/adapter-interfaces 2.0.0 → 2.2.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.
@@ -12449,16 +12449,19 @@ export declare const connectionOptionsSchema: z.ZodObject<{
12449
12449
  userinfo_endpoint: z.ZodOptional<z.ZodString>;
12450
12450
  client_id: z.ZodOptional<z.ZodString>;
12451
12451
  client_secret: z.ZodOptional<z.ZodString>;
12452
+ realm: z.ZodOptional<z.ZodString>;
12452
12453
  }, "strip", z.ZodTypeAny, {
12453
12454
  client_id?: string | undefined;
12454
12455
  client_secret?: string | undefined;
12455
12456
  token_endpoint?: string | undefined;
12456
12457
  userinfo_endpoint?: string | undefined;
12458
+ realm?: string | undefined;
12457
12459
  }, {
12458
12460
  client_id?: string | undefined;
12459
12461
  client_secret?: string | undefined;
12460
12462
  token_endpoint?: string | undefined;
12461
12463
  userinfo_endpoint?: string | undefined;
12464
+ realm?: string | undefined;
12462
12465
  }>>;
12463
12466
  attributes: z.ZodOptional<z.ZodObject<{
12464
12467
  email: z.ZodOptional<z.ZodObject<{
@@ -12868,6 +12871,7 @@ export declare const connectionOptionsSchema: z.ZodObject<{
12868
12871
  client_secret?: string | undefined;
12869
12872
  token_endpoint?: string | undefined;
12870
12873
  userinfo_endpoint?: string | undefined;
12874
+ realm?: string | undefined;
12871
12875
  } | undefined;
12872
12876
  attributes?: {
12873
12877
  email?: {
@@ -12980,6 +12984,7 @@ export declare const connectionOptionsSchema: z.ZodObject<{
12980
12984
  client_secret?: string | undefined;
12981
12985
  token_endpoint?: string | undefined;
12982
12986
  userinfo_endpoint?: string | undefined;
12987
+ realm?: string | undefined;
12983
12988
  } | undefined;
12984
12989
  attributes?: {
12985
12990
  email?: {
@@ -13121,16 +13126,19 @@ export declare const connectionInsertSchema: z.ZodObject<{
13121
13126
  userinfo_endpoint: z.ZodOptional<z.ZodString>;
13122
13127
  client_id: z.ZodOptional<z.ZodString>;
13123
13128
  client_secret: z.ZodOptional<z.ZodString>;
13129
+ realm: z.ZodOptional<z.ZodString>;
13124
13130
  }, "strip", z.ZodTypeAny, {
13125
13131
  client_id?: string | undefined;
13126
13132
  client_secret?: string | undefined;
13127
13133
  token_endpoint?: string | undefined;
13128
13134
  userinfo_endpoint?: string | undefined;
13135
+ realm?: string | undefined;
13129
13136
  }, {
13130
13137
  client_id?: string | undefined;
13131
13138
  client_secret?: string | undefined;
13132
13139
  token_endpoint?: string | undefined;
13133
13140
  userinfo_endpoint?: string | undefined;
13141
+ realm?: string | undefined;
13134
13142
  }>>;
13135
13143
  attributes: z.ZodOptional<z.ZodObject<{
13136
13144
  email: z.ZodOptional<z.ZodObject<{
@@ -13540,6 +13548,7 @@ export declare const connectionInsertSchema: z.ZodObject<{
13540
13548
  client_secret?: string | undefined;
13541
13549
  token_endpoint?: string | undefined;
13542
13550
  userinfo_endpoint?: string | undefined;
13551
+ realm?: string | undefined;
13543
13552
  } | undefined;
13544
13553
  attributes?: {
13545
13554
  email?: {
@@ -13652,6 +13661,7 @@ export declare const connectionInsertSchema: z.ZodObject<{
13652
13661
  client_secret?: string | undefined;
13653
13662
  token_endpoint?: string | undefined;
13654
13663
  userinfo_endpoint?: string | undefined;
13664
+ realm?: string | undefined;
13655
13665
  } | undefined;
13656
13666
  attributes?: {
13657
13667
  email?: {
@@ -13764,6 +13774,7 @@ export declare const connectionInsertSchema: z.ZodObject<{
13764
13774
  client_secret?: string | undefined;
13765
13775
  token_endpoint?: string | undefined;
13766
13776
  userinfo_endpoint?: string | undefined;
13777
+ realm?: string | undefined;
13767
13778
  } | undefined;
13768
13779
  attributes?: {
13769
13780
  email?: {
@@ -13885,6 +13896,7 @@ export declare const connectionInsertSchema: z.ZodObject<{
13885
13896
  client_secret?: string | undefined;
13886
13897
  token_endpoint?: string | undefined;
13887
13898
  userinfo_endpoint?: string | undefined;
13899
+ realm?: string | undefined;
13888
13900
  } | undefined;
13889
13901
  attributes?: {
13890
13902
  email?: {
@@ -14055,16 +14067,19 @@ export declare const connectionSchema: z.ZodObject<{
14055
14067
  userinfo_endpoint: z.ZodOptional<z.ZodString>;
14056
14068
  client_id: z.ZodOptional<z.ZodString>;
14057
14069
  client_secret: z.ZodOptional<z.ZodString>;
14070
+ realm: z.ZodOptional<z.ZodString>;
14058
14071
  }, "strip", z.ZodTypeAny, {
14059
14072
  client_id?: string | undefined;
14060
14073
  client_secret?: string | undefined;
14061
14074
  token_endpoint?: string | undefined;
14062
14075
  userinfo_endpoint?: string | undefined;
14076
+ realm?: string | undefined;
14063
14077
  }, {
14064
14078
  client_id?: string | undefined;
14065
14079
  client_secret?: string | undefined;
14066
14080
  token_endpoint?: string | undefined;
14067
14081
  userinfo_endpoint?: string | undefined;
14082
+ realm?: string | undefined;
14068
14083
  }>>;
14069
14084
  attributes: z.ZodOptional<z.ZodObject<{
14070
14085
  email: z.ZodOptional<z.ZodObject<{
@@ -14474,6 +14489,7 @@ export declare const connectionSchema: z.ZodObject<{
14474
14489
  client_secret?: string | undefined;
14475
14490
  token_endpoint?: string | undefined;
14476
14491
  userinfo_endpoint?: string | undefined;
14492
+ realm?: string | undefined;
14477
14493
  } | undefined;
14478
14494
  attributes?: {
14479
14495
  email?: {
@@ -14586,6 +14602,7 @@ export declare const connectionSchema: z.ZodObject<{
14586
14602
  client_secret?: string | undefined;
14587
14603
  token_endpoint?: string | undefined;
14588
14604
  userinfo_endpoint?: string | undefined;
14605
+ realm?: string | undefined;
14589
14606
  } | undefined;
14590
14607
  attributes?: {
14591
14608
  email?: {
@@ -14698,6 +14715,7 @@ export declare const connectionSchema: z.ZodObject<{
14698
14715
  client_secret?: string | undefined;
14699
14716
  token_endpoint?: string | undefined;
14700
14717
  userinfo_endpoint?: string | undefined;
14718
+ realm?: string | undefined;
14701
14719
  } | undefined;
14702
14720
  attributes?: {
14703
14721
  email?: {
@@ -14821,6 +14839,7 @@ export declare const connectionSchema: z.ZodObject<{
14821
14839
  client_secret?: string | undefined;
14822
14840
  token_endpoint?: string | undefined;
14823
14841
  userinfo_endpoint?: string | undefined;
14842
+ realm?: string | undefined;
14824
14843
  } | undefined;
14825
14844
  attributes?: {
14826
14845
  email?: {
@@ -45450,6 +45469,156 @@ export declare const logStreamSchema: z.ZodObject<{
45450
45469
  isPriority?: boolean | undefined;
45451
45470
  }>;
45452
45471
  export type LogStream = z.infer<typeof logStreamSchema>;
45472
+ export declare const migrationProviderTypeSchema: z.ZodEnum<[
45473
+ "auth0",
45474
+ "cognito",
45475
+ "okta",
45476
+ "oidc"
45477
+ ]>;
45478
+ export type MigrationProviderType = z.infer<typeof migrationProviderTypeSchema>;
45479
+ export declare const migrationSourceCredentialsSchema: z.ZodObject<{
45480
+ domain: z.ZodString;
45481
+ client_id: z.ZodString;
45482
+ client_secret: z.ZodString;
45483
+ audience: z.ZodOptional<z.ZodString>;
45484
+ scope: z.ZodOptional<z.ZodString>;
45485
+ }, "strip", z.ZodTypeAny, {
45486
+ client_id: string;
45487
+ client_secret: string;
45488
+ domain: string;
45489
+ audience?: string | undefined;
45490
+ scope?: string | undefined;
45491
+ }, {
45492
+ client_id: string;
45493
+ client_secret: string;
45494
+ domain: string;
45495
+ audience?: string | undefined;
45496
+ scope?: string | undefined;
45497
+ }>;
45498
+ export type MigrationSourceCredentials = z.infer<typeof migrationSourceCredentialsSchema>;
45499
+ export declare const migrationSourceInsertSchema: z.ZodObject<{
45500
+ id: z.ZodOptional<z.ZodString>;
45501
+ name: z.ZodString;
45502
+ provider: z.ZodEnum<[
45503
+ "auth0",
45504
+ "cognito",
45505
+ "okta",
45506
+ "oidc"
45507
+ ]>;
45508
+ connection: z.ZodString;
45509
+ enabled: z.ZodDefault<z.ZodBoolean>;
45510
+ credentials: z.ZodObject<{
45511
+ domain: z.ZodString;
45512
+ client_id: z.ZodString;
45513
+ client_secret: z.ZodString;
45514
+ audience: z.ZodOptional<z.ZodString>;
45515
+ scope: z.ZodOptional<z.ZodString>;
45516
+ }, "strip", z.ZodTypeAny, {
45517
+ client_id: string;
45518
+ client_secret: string;
45519
+ domain: string;
45520
+ audience?: string | undefined;
45521
+ scope?: string | undefined;
45522
+ }, {
45523
+ client_id: string;
45524
+ client_secret: string;
45525
+ domain: string;
45526
+ audience?: string | undefined;
45527
+ scope?: string | undefined;
45528
+ }>;
45529
+ }, "strip", z.ZodTypeAny, {
45530
+ name: string;
45531
+ connection: string;
45532
+ provider: "auth0" | "cognito" | "okta" | "oidc";
45533
+ enabled: boolean;
45534
+ credentials: {
45535
+ client_id: string;
45536
+ client_secret: string;
45537
+ domain: string;
45538
+ audience?: string | undefined;
45539
+ scope?: string | undefined;
45540
+ };
45541
+ id?: string | undefined;
45542
+ }, {
45543
+ name: string;
45544
+ connection: string;
45545
+ provider: "auth0" | "cognito" | "okta" | "oidc";
45546
+ credentials: {
45547
+ client_id: string;
45548
+ client_secret: string;
45549
+ domain: string;
45550
+ audience?: string | undefined;
45551
+ scope?: string | undefined;
45552
+ };
45553
+ id?: string | undefined;
45554
+ enabled?: boolean | undefined;
45555
+ }>;
45556
+ export type MigrationSourceInsert = z.infer<typeof migrationSourceInsertSchema>;
45557
+ export declare const migrationSourceSchema: z.ZodObject<{
45558
+ created_at: z.ZodString;
45559
+ updated_at: z.ZodString;
45560
+ } & {
45561
+ id: z.ZodOptional<z.ZodString>;
45562
+ name: z.ZodString;
45563
+ provider: z.ZodEnum<[
45564
+ "auth0",
45565
+ "cognito",
45566
+ "okta",
45567
+ "oidc"
45568
+ ]>;
45569
+ connection: z.ZodString;
45570
+ enabled: z.ZodDefault<z.ZodBoolean>;
45571
+ credentials: z.ZodObject<{
45572
+ domain: z.ZodString;
45573
+ client_id: z.ZodString;
45574
+ client_secret: z.ZodString;
45575
+ audience: z.ZodOptional<z.ZodString>;
45576
+ scope: z.ZodOptional<z.ZodString>;
45577
+ }, "strip", z.ZodTypeAny, {
45578
+ client_id: string;
45579
+ client_secret: string;
45580
+ domain: string;
45581
+ audience?: string | undefined;
45582
+ scope?: string | undefined;
45583
+ }, {
45584
+ client_id: string;
45585
+ client_secret: string;
45586
+ domain: string;
45587
+ audience?: string | undefined;
45588
+ scope?: string | undefined;
45589
+ }>;
45590
+ }, "strip", z.ZodTypeAny, {
45591
+ created_at: string;
45592
+ updated_at: string;
45593
+ name: string;
45594
+ connection: string;
45595
+ provider: "auth0" | "cognito" | "okta" | "oidc";
45596
+ enabled: boolean;
45597
+ credentials: {
45598
+ client_id: string;
45599
+ client_secret: string;
45600
+ domain: string;
45601
+ audience?: string | undefined;
45602
+ scope?: string | undefined;
45603
+ };
45604
+ id?: string | undefined;
45605
+ }, {
45606
+ created_at: string;
45607
+ updated_at: string;
45608
+ name: string;
45609
+ connection: string;
45610
+ provider: "auth0" | "cognito" | "okta" | "oidc";
45611
+ credentials: {
45612
+ client_id: string;
45613
+ client_secret: string;
45614
+ domain: string;
45615
+ audience?: string | undefined;
45616
+ scope?: string | undefined;
45617
+ };
45618
+ id?: string | undefined;
45619
+ enabled?: boolean | undefined;
45620
+ }>;
45621
+ export type MigrationSource = z.infer<typeof migrationSourceSchema>;
45453
45622
  export declare const breachedPasswordDetectionSchema: z.ZodObject<{
45454
45623
  enabled: z.ZodOptional<z.ZodBoolean>;
45455
45624
  shields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -51127,6 +51296,150 @@ export declare const dailyStatsSchema: z.ZodObject<{
51127
51296
  export type DailyStats = z.infer<typeof dailyStatsSchema>;
51128
51297
  export declare const activeUsersResponseSchema: z.ZodNumber;
51129
51298
  export type ActiveUsersResponse = z.infer<typeof activeUsersResponseSchema>;
51299
+ export declare const analyticsResourceSchema: z.ZodEnum<[
51300
+ "active-users",
51301
+ "logins",
51302
+ "signups",
51303
+ "refresh-tokens",
51304
+ "sessions"
51305
+ ]>;
51306
+ export type AnalyticsResource = z.infer<typeof analyticsResourceSchema>;
51307
+ export declare const analyticsIntervalSchema: z.ZodEnum<[
51308
+ "hour",
51309
+ "day",
51310
+ "week",
51311
+ "month"
51312
+ ]>;
51313
+ export type AnalyticsInterval = z.infer<typeof analyticsIntervalSchema>;
51314
+ export declare const analyticsGroupBySchema: z.ZodEnum<[
51315
+ "time",
51316
+ "connection",
51317
+ "client_id",
51318
+ "user_type",
51319
+ "event"
51320
+ ]>;
51321
+ export type AnalyticsGroupBy = z.infer<typeof analyticsGroupBySchema>;
51322
+ export declare const analyticsUserTypeSchema: z.ZodEnum<[
51323
+ "password",
51324
+ "social",
51325
+ "passwordless",
51326
+ "enterprise"
51327
+ ]>;
51328
+ export type AnalyticsUserType = z.infer<typeof analyticsUserTypeSchema>;
51329
+ export interface AnalyticsFilters {
51330
+ connection?: string[];
51331
+ client_id?: string[];
51332
+ user_type?: AnalyticsUserType[];
51333
+ user_id?: string[];
51334
+ }
51335
+ export interface AnalyticsQueryParams {
51336
+ /** Inclusive lower bound, ISO 8601 datetime in UTC */
51337
+ from: string;
51338
+ /** Exclusive upper bound, ISO 8601 datetime in UTC */
51339
+ to: string;
51340
+ interval: AnalyticsInterval;
51341
+ /** IANA timezone for bucket boundaries */
51342
+ tz: string;
51343
+ filters: AnalyticsFilters;
51344
+ group_by: AnalyticsGroupBy[];
51345
+ limit: number;
51346
+ offset: number;
51347
+ /** Column name, prefix with `-` for descending */
51348
+ order_by?: string;
51349
+ }
51350
+ export interface AnalyticsColumnMeta {
51351
+ name: string;
51352
+ /** ClickHouse-style type label (e.g. "Date", "String", "UInt64", "DateTime") */
51353
+ type: string;
51354
+ }
51355
+ export interface AnalyticsQueryResponse {
51356
+ meta: AnalyticsColumnMeta[];
51357
+ data: Array<Record<string, unknown>>;
51358
+ rows: number;
51359
+ rows_before_limit_at_least?: number;
51360
+ statistics?: {
51361
+ elapsed: number;
51362
+ rows_read?: number;
51363
+ bytes_read?: number;
51364
+ };
51365
+ }
51366
+ export declare const analyticsColumnMetaSchema: z.ZodObject<{
51367
+ name: z.ZodString;
51368
+ type: z.ZodString;
51369
+ }, "strip", z.ZodTypeAny, {
51370
+ type: string;
51371
+ name: string;
51372
+ }, {
51373
+ type: string;
51374
+ name: string;
51375
+ }>;
51376
+ export declare const analyticsStatisticsSchema: z.ZodObject<{
51377
+ elapsed: z.ZodNumber;
51378
+ rows_read: z.ZodOptional<z.ZodNumber>;
51379
+ bytes_read: z.ZodOptional<z.ZodNumber>;
51380
+ }, "strip", z.ZodTypeAny, {
51381
+ elapsed: number;
51382
+ rows_read?: number | undefined;
51383
+ bytes_read?: number | undefined;
51384
+ }, {
51385
+ elapsed: number;
51386
+ rows_read?: number | undefined;
51387
+ bytes_read?: number | undefined;
51388
+ }>;
51389
+ export declare const analyticsQueryResponseSchema: z.ZodObject<{
51390
+ meta: z.ZodArray<z.ZodObject<{
51391
+ name: z.ZodString;
51392
+ type: z.ZodString;
51393
+ }, "strip", z.ZodTypeAny, {
51394
+ type: string;
51395
+ name: string;
51396
+ }, {
51397
+ type: string;
51398
+ name: string;
51399
+ }>, "many">;
51400
+ data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>, "many">;
51401
+ rows: z.ZodNumber;
51402
+ rows_before_limit_at_least: z.ZodOptional<z.ZodNumber>;
51403
+ statistics: z.ZodOptional<z.ZodObject<{
51404
+ elapsed: z.ZodNumber;
51405
+ rows_read: z.ZodOptional<z.ZodNumber>;
51406
+ bytes_read: z.ZodOptional<z.ZodNumber>;
51407
+ }, "strip", z.ZodTypeAny, {
51408
+ elapsed: number;
51409
+ rows_read?: number | undefined;
51410
+ bytes_read?: number | undefined;
51411
+ }, {
51412
+ elapsed: number;
51413
+ rows_read?: number | undefined;
51414
+ bytes_read?: number | undefined;
51415
+ }>>;
51416
+ }, "strip", z.ZodTypeAny, {
51417
+ meta: {
51418
+ type: string;
51419
+ name: string;
51420
+ }[];
51421
+ data: Record<string, any>[];
51422
+ rows: number;
51423
+ rows_before_limit_at_least?: number | undefined;
51424
+ statistics?: {
51425
+ elapsed: number;
51426
+ rows_read?: number | undefined;
51427
+ bytes_read?: number | undefined;
51428
+ } | undefined;
51429
+ }, {
51430
+ meta: {
51431
+ type: string;
51432
+ name: string;
51433
+ }[];
51434
+ data: Record<string, any>[];
51435
+ rows: number;
51436
+ rows_before_limit_at_least?: number | undefined;
51437
+ statistics?: {
51438
+ elapsed: number;
51439
+ rows_read?: number | undefined;
51440
+ bytes_read?: number | undefined;
51441
+ } | undefined;
51442
+ }>;
51130
51443
  /**
51131
51444
  * Available prompt screens that can be customized
51132
51445
  * Based on Auth0's prompt customization options
@@ -51769,6 +52082,13 @@ export interface LogStreamsAdapter {
51769
52082
  update(tenant_id: string, id: string, params: Partial<LogStream>): Promise<boolean>;
51770
52083
  remove(tenant_id: string, id: string): Promise<boolean>;
51771
52084
  }
52085
+ export interface MigrationSourcesAdapter {
52086
+ create: (tenant_id: string, migration_source: MigrationSourceInsert) => Promise<MigrationSource>;
52087
+ get: (tenant_id: string, id: string) => Promise<MigrationSource | null>;
52088
+ list: (tenant_id: string) => Promise<MigrationSource[]>;
52089
+ remove: (tenant_id: string, id: string) => Promise<boolean>;
52090
+ update: (tenant_id: string, id: string, migration_source: Partial<MigrationSourceInsert>) => Promise<boolean>;
52091
+ }
51772
52092
  export interface ListConnectionsResponse extends Totals {
51773
52093
  connections: Connection[];
51774
52094
  }
@@ -52018,6 +52338,14 @@ export interface StatsAdapter {
52018
52338
  */
52019
52339
  getActiveUsers(tenantId: string): Promise<number>;
52020
52340
  }
52341
+ export interface AnalyticsAdapter {
52342
+ /**
52343
+ * Run an analytics query for a tenant. The adapter is responsible for
52344
+ * injecting the tenant_id predicate; the route handler never trusts a
52345
+ * tenant value from a client-controlled source.
52346
+ */
52347
+ query(tenantId: string, resource: AnalyticsResource, params: AnalyticsQueryParams): Promise<AnalyticsQueryResponse>;
52348
+ }
52021
52349
  export interface UniversalLoginTemplate {
52022
52350
  body: string;
52023
52351
  }
@@ -52236,6 +52564,12 @@ export interface DataAdapters {
52236
52564
  loginSessions: LoginSessionsAdapter;
52237
52565
  logs: LogsDataAdapter;
52238
52566
  logStreams?: LogStreamsAdapter;
52567
+ /**
52568
+ * Optional tenant-level migration sources for lazy refresh-token re-mint
52569
+ * against upstream IdPs (Auth0, Cognito, Okta, generic OIDC). When unset,
52570
+ * unrecognized refresh tokens fail with `invalid_grant` as usual.
52571
+ */
52572
+ migrationSources?: MigrationSourcesAdapter;
52239
52573
  passwords: PasswordsAdapter;
52240
52574
  promptSettings: PromptSettingsAdapter;
52241
52575
  refreshTokens: RefreshTokensAdapter;
@@ -52245,6 +52579,12 @@ export interface DataAdapters {
52245
52579
  roles: RolesAdapter;
52246
52580
  sessions: SessionsAdapter;
52247
52581
  stats?: StatsAdapter;
52582
+ /**
52583
+ * Optional richer analytics surface, exposed via `/api/v2/analytics/*`.
52584
+ * Returns ClickHouse-style `{ meta, data }` responses with filtering and
52585
+ * grouping. Unlike `stats`, this is not Auth0 wire-compatible.
52586
+ */
52587
+ analytics?: AnalyticsAdapter;
52248
52588
  tenants: TenantsDataAdapter;
52249
52589
  themes: ThemesAdapter;
52250
52590
  universalLoginTemplates: UniversalLoginTemplatesAdapter;