@authhero/kysely-adapter 10.66.0 → 10.67.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.
@@ -8252,6 +8252,29 @@ declare const userOrganizationSchema: z.ZodObject<{
8252
8252
  organization_id: string;
8253
8253
  }>;
8254
8254
  export type UserOrganization = z.infer<typeof userOrganizationSchema>;
8255
+ declare const dailyStatsSchema: z.ZodObject<{
8256
+ date: z.ZodString;
8257
+ logins: z.ZodNumber;
8258
+ signups: z.ZodNumber;
8259
+ leaked_passwords: z.ZodNumber;
8260
+ updated_at: z.ZodString;
8261
+ created_at: z.ZodString;
8262
+ }, "strip", z.ZodTypeAny, {
8263
+ date: string;
8264
+ created_at: string;
8265
+ updated_at: string;
8266
+ logins: number;
8267
+ signups: number;
8268
+ leaked_passwords: number;
8269
+ }, {
8270
+ date: string;
8271
+ created_at: string;
8272
+ updated_at: string;
8273
+ logins: number;
8274
+ signups: number;
8275
+ leaked_passwords: number;
8276
+ }>;
8277
+ export type DailyStats = z.infer<typeof dailyStatsSchema>;
8255
8278
  export interface CacheAdapter {
8256
8279
  /**
8257
8280
  * Get a value from the cache
@@ -8562,6 +8585,20 @@ export interface GeoAdapter {
8562
8585
  */
8563
8586
  getGeoInfo(headers: Record<string, string>): Promise<GeoInfo | null>;
8564
8587
  }
8588
+ export interface StatsListParams {
8589
+ from?: string;
8590
+ to?: string;
8591
+ }
8592
+ export interface StatsAdapter {
8593
+ /**
8594
+ * Get daily statistics (logins, signups, etc.) for a date range
8595
+ */
8596
+ getDaily(tenantId: string, params?: StatsListParams): Promise<DailyStats[]>;
8597
+ /**
8598
+ * Get the number of active users in the last 30 days
8599
+ */
8600
+ getActiveUsers(tenantId: string): Promise<number>;
8601
+ }
8565
8602
  export interface DataAdapters {
8566
8603
  branding: BrandingAdapter;
8567
8604
  cache?: CacheAdapter;
@@ -8588,6 +8625,7 @@ export interface DataAdapters {
8588
8625
  userPermissions: UserPermissionsAdapter;
8589
8626
  roles: RolesAdapter;
8590
8627
  sessions: SessionsAdapter;
8628
+ stats?: StatsAdapter;
8591
8629
  tenants: TenantsDataAdapter;
8592
8630
  themes: ThemesAdapter;
8593
8631
  users: UserDataAdapter;