authhero 0.294.0 → 0.296.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.
@@ -18037,6 +18037,31 @@ export declare const tenantSettingsSchema: z.ZodObject<{
18037
18037
  } | undefined;
18038
18038
  }>;
18039
18039
  export type TenantSettings = z.infer<typeof tenantSettingsSchema>;
18040
+ export declare const dailyStatsSchema: z.ZodObject<{
18041
+ date: z.ZodString;
18042
+ logins: z.ZodNumber;
18043
+ signups: z.ZodNumber;
18044
+ leaked_passwords: z.ZodNumber;
18045
+ updated_at: z.ZodString;
18046
+ created_at: z.ZodString;
18047
+ }, "strip", z.ZodTypeAny, {
18048
+ date: string;
18049
+ created_at: string;
18050
+ updated_at: string;
18051
+ logins: number;
18052
+ signups: number;
18053
+ leaked_passwords: number;
18054
+ }, {
18055
+ date: string;
18056
+ created_at: string;
18057
+ updated_at: string;
18058
+ logins: number;
18059
+ signups: number;
18060
+ leaked_passwords: number;
18061
+ }>;
18062
+ export type DailyStats = z.infer<typeof dailyStatsSchema>;
18063
+ export declare const activeUsersResponseSchema: z.ZodNumber;
18064
+ export type ActiveUsersResponse = z.infer<typeof activeUsersResponseSchema>;
18040
18065
  export declare function parseUserId(user_id: string): {
18041
18066
  connection: string;
18042
18067
  id: string;
@@ -18472,6 +18497,20 @@ export interface GeoAdapter {
18472
18497
  */
18473
18498
  getGeoInfo(headers: Record<string, string>): Promise<GeoInfo | null>;
18474
18499
  }
18500
+ export interface StatsListParams {
18501
+ from?: string;
18502
+ to?: string;
18503
+ }
18504
+ export interface StatsAdapter {
18505
+ /**
18506
+ * Get daily statistics (logins, signups, etc.) for a date range
18507
+ */
18508
+ getDaily(tenantId: string, params?: StatsListParams): Promise<DailyStats[]>;
18509
+ /**
18510
+ * Get the number of active users in the last 30 days
18511
+ */
18512
+ getActiveUsers(tenantId: string): Promise<number>;
18513
+ }
18475
18514
  export interface DataAdapters {
18476
18515
  branding: BrandingAdapter;
18477
18516
  cache?: CacheAdapter;
@@ -18498,6 +18537,7 @@ export interface DataAdapters {
18498
18537
  userPermissions: UserPermissionsAdapter;
18499
18538
  roles: RolesAdapter;
18500
18539
  sessions: SessionsAdapter;
18540
+ stats?: StatsAdapter;
18501
18541
  tenants: TenantsDataAdapter;
18502
18542
  themes: ThemesAdapter;
18503
18543
  users: UserDataAdapter;
@@ -19255,6 +19295,44 @@ export declare function init(config: AuthHeroConfig): {
19255
19295
  Bindings: Bindings;
19256
19296
  Variables: Variables;
19257
19297
  }, import("hono/types").MergeSchemaPath<{
19298
+ "/daily": {
19299
+ $get: {
19300
+ input: {
19301
+ query: {
19302
+ from?: string | undefined;
19303
+ to?: string | undefined;
19304
+ };
19305
+ } & {
19306
+ header: {
19307
+ "tenant-id": string;
19308
+ };
19309
+ };
19310
+ output: {
19311
+ date: string;
19312
+ created_at: string;
19313
+ updated_at: string;
19314
+ logins: number;
19315
+ signups: number;
19316
+ leaked_passwords: number;
19317
+ }[];
19318
+ outputFormat: "json";
19319
+ status: 200;
19320
+ };
19321
+ };
19322
+ } & {
19323
+ "/active-users": {
19324
+ $get: {
19325
+ input: {
19326
+ header: {
19327
+ "tenant-id": string;
19328
+ };
19329
+ };
19330
+ output: number;
19331
+ outputFormat: "json";
19332
+ status: 200;
19333
+ };
19334
+ };
19335
+ }, "/stats"> & import("hono/types").MergeSchemaPath<{
19258
19336
  "/": {
19259
19337
  $get: {
19260
19338
  input: {