@authhero/adapter-interfaces 2.0.0 → 2.1.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.
@@ -45450,6 +45450,156 @@ export declare const logStreamSchema: z.ZodObject<{
45450
45450
  isPriority?: boolean | undefined;
45451
45451
  }>;
45452
45452
  export type LogStream = z.infer<typeof logStreamSchema>;
45453
+ export declare const migrationProviderTypeSchema: z.ZodEnum<[
45454
+ "auth0",
45455
+ "cognito",
45456
+ "okta",
45457
+ "oidc"
45458
+ ]>;
45459
+ export type MigrationProviderType = z.infer<typeof migrationProviderTypeSchema>;
45460
+ export declare const migrationSourceCredentialsSchema: z.ZodObject<{
45461
+ domain: z.ZodString;
45462
+ client_id: z.ZodString;
45463
+ client_secret: z.ZodString;
45464
+ audience: z.ZodOptional<z.ZodString>;
45465
+ scope: z.ZodOptional<z.ZodString>;
45466
+ }, "strip", z.ZodTypeAny, {
45467
+ client_id: string;
45468
+ client_secret: string;
45469
+ domain: string;
45470
+ audience?: string | undefined;
45471
+ scope?: string | undefined;
45472
+ }, {
45473
+ client_id: string;
45474
+ client_secret: string;
45475
+ domain: string;
45476
+ audience?: string | undefined;
45477
+ scope?: string | undefined;
45478
+ }>;
45479
+ export type MigrationSourceCredentials = z.infer<typeof migrationSourceCredentialsSchema>;
45480
+ export declare const migrationSourceInsertSchema: z.ZodObject<{
45481
+ id: z.ZodOptional<z.ZodString>;
45482
+ name: z.ZodString;
45483
+ provider: z.ZodEnum<[
45484
+ "auth0",
45485
+ "cognito",
45486
+ "okta",
45487
+ "oidc"
45488
+ ]>;
45489
+ connection: z.ZodString;
45490
+ enabled: z.ZodDefault<z.ZodBoolean>;
45491
+ credentials: z.ZodObject<{
45492
+ domain: z.ZodString;
45493
+ client_id: z.ZodString;
45494
+ client_secret: z.ZodString;
45495
+ audience: z.ZodOptional<z.ZodString>;
45496
+ scope: z.ZodOptional<z.ZodString>;
45497
+ }, "strip", z.ZodTypeAny, {
45498
+ client_id: string;
45499
+ client_secret: string;
45500
+ domain: string;
45501
+ audience?: string | undefined;
45502
+ scope?: string | undefined;
45503
+ }, {
45504
+ client_id: string;
45505
+ client_secret: string;
45506
+ domain: string;
45507
+ audience?: string | undefined;
45508
+ scope?: string | undefined;
45509
+ }>;
45510
+ }, "strip", z.ZodTypeAny, {
45511
+ name: string;
45512
+ connection: string;
45513
+ provider: "auth0" | "cognito" | "okta" | "oidc";
45514
+ enabled: boolean;
45515
+ credentials: {
45516
+ client_id: string;
45517
+ client_secret: string;
45518
+ domain: string;
45519
+ audience?: string | undefined;
45520
+ scope?: string | undefined;
45521
+ };
45522
+ id?: string | undefined;
45523
+ }, {
45524
+ name: string;
45525
+ connection: string;
45526
+ provider: "auth0" | "cognito" | "okta" | "oidc";
45527
+ credentials: {
45528
+ client_id: string;
45529
+ client_secret: string;
45530
+ domain: string;
45531
+ audience?: string | undefined;
45532
+ scope?: string | undefined;
45533
+ };
45534
+ id?: string | undefined;
45535
+ enabled?: boolean | undefined;
45536
+ }>;
45537
+ export type MigrationSourceInsert = z.infer<typeof migrationSourceInsertSchema>;
45538
+ export declare const migrationSourceSchema: z.ZodObject<{
45539
+ created_at: z.ZodString;
45540
+ updated_at: z.ZodString;
45541
+ } & {
45542
+ id: z.ZodOptional<z.ZodString>;
45543
+ name: z.ZodString;
45544
+ provider: z.ZodEnum<[
45545
+ "auth0",
45546
+ "cognito",
45547
+ "okta",
45548
+ "oidc"
45549
+ ]>;
45550
+ connection: z.ZodString;
45551
+ enabled: z.ZodDefault<z.ZodBoolean>;
45552
+ credentials: z.ZodObject<{
45553
+ domain: z.ZodString;
45554
+ client_id: z.ZodString;
45555
+ client_secret: z.ZodString;
45556
+ audience: z.ZodOptional<z.ZodString>;
45557
+ scope: z.ZodOptional<z.ZodString>;
45558
+ }, "strip", z.ZodTypeAny, {
45559
+ client_id: string;
45560
+ client_secret: string;
45561
+ domain: string;
45562
+ audience?: string | undefined;
45563
+ scope?: string | undefined;
45564
+ }, {
45565
+ client_id: string;
45566
+ client_secret: string;
45567
+ domain: string;
45568
+ audience?: string | undefined;
45569
+ scope?: string | undefined;
45570
+ }>;
45571
+ }, "strip", z.ZodTypeAny, {
45572
+ created_at: string;
45573
+ updated_at: string;
45574
+ name: string;
45575
+ connection: string;
45576
+ provider: "auth0" | "cognito" | "okta" | "oidc";
45577
+ enabled: boolean;
45578
+ credentials: {
45579
+ client_id: string;
45580
+ client_secret: string;
45581
+ domain: string;
45582
+ audience?: string | undefined;
45583
+ scope?: string | undefined;
45584
+ };
45585
+ id?: string | undefined;
45586
+ }, {
45587
+ created_at: string;
45588
+ updated_at: string;
45589
+ name: string;
45590
+ connection: string;
45591
+ provider: "auth0" | "cognito" | "okta" | "oidc";
45592
+ credentials: {
45593
+ client_id: string;
45594
+ client_secret: string;
45595
+ domain: string;
45596
+ audience?: string | undefined;
45597
+ scope?: string | undefined;
45598
+ };
45599
+ id?: string | undefined;
45600
+ enabled?: boolean | undefined;
45601
+ }>;
45602
+ export type MigrationSource = z.infer<typeof migrationSourceSchema>;
45453
45603
  export declare const breachedPasswordDetectionSchema: z.ZodObject<{
45454
45604
  enabled: z.ZodOptional<z.ZodBoolean>;
45455
45605
  shields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -51127,6 +51277,150 @@ export declare const dailyStatsSchema: z.ZodObject<{
51127
51277
  export type DailyStats = z.infer<typeof dailyStatsSchema>;
51128
51278
  export declare const activeUsersResponseSchema: z.ZodNumber;
51129
51279
  export type ActiveUsersResponse = z.infer<typeof activeUsersResponseSchema>;
51280
+ export declare const analyticsResourceSchema: z.ZodEnum<[
51281
+ "active-users",
51282
+ "logins",
51283
+ "signups",
51284
+ "refresh-tokens",
51285
+ "sessions"
51286
+ ]>;
51287
+ export type AnalyticsResource = z.infer<typeof analyticsResourceSchema>;
51288
+ export declare const analyticsIntervalSchema: z.ZodEnum<[
51289
+ "hour",
51290
+ "day",
51291
+ "week",
51292
+ "month"
51293
+ ]>;
51294
+ export type AnalyticsInterval = z.infer<typeof analyticsIntervalSchema>;
51295
+ export declare const analyticsGroupBySchema: z.ZodEnum<[
51296
+ "time",
51297
+ "connection",
51298
+ "client_id",
51299
+ "user_type",
51300
+ "event"
51301
+ ]>;
51302
+ export type AnalyticsGroupBy = z.infer<typeof analyticsGroupBySchema>;
51303
+ export declare const analyticsUserTypeSchema: z.ZodEnum<[
51304
+ "password",
51305
+ "social",
51306
+ "passwordless",
51307
+ "enterprise"
51308
+ ]>;
51309
+ export type AnalyticsUserType = z.infer<typeof analyticsUserTypeSchema>;
51310
+ export interface AnalyticsFilters {
51311
+ connection?: string[];
51312
+ client_id?: string[];
51313
+ user_type?: AnalyticsUserType[];
51314
+ user_id?: string[];
51315
+ }
51316
+ export interface AnalyticsQueryParams {
51317
+ /** Inclusive lower bound, ISO 8601 datetime in UTC */
51318
+ from: string;
51319
+ /** Exclusive upper bound, ISO 8601 datetime in UTC */
51320
+ to: string;
51321
+ interval: AnalyticsInterval;
51322
+ /** IANA timezone for bucket boundaries */
51323
+ tz: string;
51324
+ filters: AnalyticsFilters;
51325
+ group_by: AnalyticsGroupBy[];
51326
+ limit: number;
51327
+ offset: number;
51328
+ /** Column name, prefix with `-` for descending */
51329
+ order_by?: string;
51330
+ }
51331
+ export interface AnalyticsColumnMeta {
51332
+ name: string;
51333
+ /** ClickHouse-style type label (e.g. "Date", "String", "UInt64", "DateTime") */
51334
+ type: string;
51335
+ }
51336
+ export interface AnalyticsQueryResponse {
51337
+ meta: AnalyticsColumnMeta[];
51338
+ data: Array<Record<string, unknown>>;
51339
+ rows: number;
51340
+ rows_before_limit_at_least?: number;
51341
+ statistics?: {
51342
+ elapsed: number;
51343
+ rows_read?: number;
51344
+ bytes_read?: number;
51345
+ };
51346
+ }
51347
+ export declare const analyticsColumnMetaSchema: z.ZodObject<{
51348
+ name: z.ZodString;
51349
+ type: z.ZodString;
51350
+ }, "strip", z.ZodTypeAny, {
51351
+ type: string;
51352
+ name: string;
51353
+ }, {
51354
+ type: string;
51355
+ name: string;
51356
+ }>;
51357
+ export declare const analyticsStatisticsSchema: z.ZodObject<{
51358
+ elapsed: z.ZodNumber;
51359
+ rows_read: z.ZodOptional<z.ZodNumber>;
51360
+ bytes_read: z.ZodOptional<z.ZodNumber>;
51361
+ }, "strip", z.ZodTypeAny, {
51362
+ elapsed: number;
51363
+ rows_read?: number | undefined;
51364
+ bytes_read?: number | undefined;
51365
+ }, {
51366
+ elapsed: number;
51367
+ rows_read?: number | undefined;
51368
+ bytes_read?: number | undefined;
51369
+ }>;
51370
+ export declare const analyticsQueryResponseSchema: z.ZodObject<{
51371
+ meta: z.ZodArray<z.ZodObject<{
51372
+ name: z.ZodString;
51373
+ type: z.ZodString;
51374
+ }, "strip", z.ZodTypeAny, {
51375
+ type: string;
51376
+ name: string;
51377
+ }, {
51378
+ type: string;
51379
+ name: string;
51380
+ }>, "many">;
51381
+ data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>, "many">;
51382
+ rows: z.ZodNumber;
51383
+ rows_before_limit_at_least: z.ZodOptional<z.ZodNumber>;
51384
+ statistics: z.ZodOptional<z.ZodObject<{
51385
+ elapsed: z.ZodNumber;
51386
+ rows_read: z.ZodOptional<z.ZodNumber>;
51387
+ bytes_read: z.ZodOptional<z.ZodNumber>;
51388
+ }, "strip", z.ZodTypeAny, {
51389
+ elapsed: number;
51390
+ rows_read?: number | undefined;
51391
+ bytes_read?: number | undefined;
51392
+ }, {
51393
+ elapsed: number;
51394
+ rows_read?: number | undefined;
51395
+ bytes_read?: number | undefined;
51396
+ }>>;
51397
+ }, "strip", z.ZodTypeAny, {
51398
+ meta: {
51399
+ type: string;
51400
+ name: string;
51401
+ }[];
51402
+ data: Record<string, any>[];
51403
+ rows: number;
51404
+ rows_before_limit_at_least?: number | undefined;
51405
+ statistics?: {
51406
+ elapsed: number;
51407
+ rows_read?: number | undefined;
51408
+ bytes_read?: number | undefined;
51409
+ } | undefined;
51410
+ }, {
51411
+ meta: {
51412
+ type: string;
51413
+ name: string;
51414
+ }[];
51415
+ data: Record<string, any>[];
51416
+ rows: number;
51417
+ rows_before_limit_at_least?: number | undefined;
51418
+ statistics?: {
51419
+ elapsed: number;
51420
+ rows_read?: number | undefined;
51421
+ bytes_read?: number | undefined;
51422
+ } | undefined;
51423
+ }>;
51130
51424
  /**
51131
51425
  * Available prompt screens that can be customized
51132
51426
  * Based on Auth0's prompt customization options
@@ -51769,6 +52063,13 @@ export interface LogStreamsAdapter {
51769
52063
  update(tenant_id: string, id: string, params: Partial<LogStream>): Promise<boolean>;
51770
52064
  remove(tenant_id: string, id: string): Promise<boolean>;
51771
52065
  }
52066
+ export interface MigrationSourcesAdapter {
52067
+ create: (tenant_id: string, migration_source: MigrationSourceInsert) => Promise<MigrationSource>;
52068
+ get: (tenant_id: string, id: string) => Promise<MigrationSource | null>;
52069
+ list: (tenant_id: string) => Promise<MigrationSource[]>;
52070
+ remove: (tenant_id: string, id: string) => Promise<boolean>;
52071
+ update: (tenant_id: string, id: string, migration_source: Partial<MigrationSourceInsert>) => Promise<boolean>;
52072
+ }
51772
52073
  export interface ListConnectionsResponse extends Totals {
51773
52074
  connections: Connection[];
51774
52075
  }
@@ -52018,6 +52319,14 @@ export interface StatsAdapter {
52018
52319
  */
52019
52320
  getActiveUsers(tenantId: string): Promise<number>;
52020
52321
  }
52322
+ export interface AnalyticsAdapter {
52323
+ /**
52324
+ * Run an analytics query for a tenant. The adapter is responsible for
52325
+ * injecting the tenant_id predicate; the route handler never trusts a
52326
+ * tenant value from a client-controlled source.
52327
+ */
52328
+ query(tenantId: string, resource: AnalyticsResource, params: AnalyticsQueryParams): Promise<AnalyticsQueryResponse>;
52329
+ }
52021
52330
  export interface UniversalLoginTemplate {
52022
52331
  body: string;
52023
52332
  }
@@ -52236,6 +52545,12 @@ export interface DataAdapters {
52236
52545
  loginSessions: LoginSessionsAdapter;
52237
52546
  logs: LogsDataAdapter;
52238
52547
  logStreams?: LogStreamsAdapter;
52548
+ /**
52549
+ * Optional tenant-level migration sources for lazy refresh-token re-mint
52550
+ * against upstream IdPs (Auth0, Cognito, Okta, generic OIDC). When unset,
52551
+ * unrecognized refresh tokens fail with `invalid_grant` as usual.
52552
+ */
52553
+ migrationSources?: MigrationSourcesAdapter;
52239
52554
  passwords: PasswordsAdapter;
52240
52555
  promptSettings: PromptSettingsAdapter;
52241
52556
  refreshTokens: RefreshTokensAdapter;
@@ -52245,6 +52560,12 @@ export interface DataAdapters {
52245
52560
  roles: RolesAdapter;
52246
52561
  sessions: SessionsAdapter;
52247
52562
  stats?: StatsAdapter;
52563
+ /**
52564
+ * Optional richer analytics surface, exposed via `/api/v2/analytics/*`.
52565
+ * Returns ClickHouse-style `{ meta, data }` responses with filtering and
52566
+ * grouping. Unlike `stats`, this is not Auth0 wire-compatible.
52567
+ */
52568
+ analytics?: AnalyticsAdapter;
52248
52569
  tenants: TenantsDataAdapter;
52249
52570
  themes: ThemesAdapter;
52250
52571
  universalLoginTemplates: UniversalLoginTemplatesAdapter;