@authhero/kysely-adapter 10.65.2 → 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.
@@ -828,7 +828,7 @@ declare const brandingSchema: z.ZodObject<{
828
828
  } | undefined;
829
829
  }>;
830
830
  export type Branding = z.infer<typeof brandingSchema>;
831
- declare const LegacyClientSchema: z.ZodObject<{
831
+ declare const legacyClientSchema: z.ZodObject<{
832
832
  tenant: z.ZodObject<{
833
833
  id: z.ZodString;
834
834
  audience: z.ZodString;
@@ -1873,7 +1873,7 @@ declare const LegacyClientSchema: z.ZodObject<{
1873
1873
  par_request_expiry?: number | undefined;
1874
1874
  token_quota?: Record<string, any> | undefined;
1875
1875
  }>;
1876
- export type LegacyClient = z.infer<typeof LegacyClientSchema>;
1876
+ export type LegacyClient = z.infer<typeof legacyClientSchema>;
1877
1877
  declare const codeTypeSchema: z.ZodEnum<[
1878
1878
  "password_reset",
1879
1879
  "email_verification",
@@ -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;