@authhero/kysely-adapter 11.4.1 → 11.5.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.
@@ -1,6 +1,7 @@
1
1
  import { Kysely } from 'kysely';
2
2
  import { z } from '@hono/zod-openapi';
3
- import { Code, SigningKey, DataAdapters } from '@authhero/adapter-interfaces';
3
+ import { Code, SigningKey, ProxyRoutesAdapter, DataAdapters } from '@authhero/adapter-interfaces';
4
+ import { ProxyDataAdapter } from '@authhero/proxy';
4
5
 
5
6
  declare const sqlThemeSchema: z.ZodObject<{
6
7
  readonly [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
@@ -887,14 +888,34 @@ interface Database {
887
888
  dead_lettered_at: string | null;
888
889
  final_error: string | null;
889
890
  };
891
+ proxy_routes: {
892
+ id: string;
893
+ tenant_id: string;
894
+ custom_domain_id: string;
895
+ priority: number;
896
+ match: string;
897
+ handlers: string;
898
+ created_at: string;
899
+ updated_at: string;
900
+ };
890
901
  }
891
902
 
892
903
  declare function migrateToLatest(db: Kysely<Database>, debug?: boolean): Promise<void>;
893
904
  declare function migrateDown(db: Kysely<Database>, debug?: boolean): Promise<void>;
894
905
 
906
+ declare function createProxyRoutesAdapter(db: Kysely<Database>): ProxyRoutesAdapter;
907
+
908
+ /**
909
+ * Build a full `ProxyDataAdapter` (CRUD + cross-tenant `resolveHost`) for the
910
+ * `@authhero/proxy` data plane. Authhero itself only needs the CRUD adapter
911
+ * surfaced via `createAdapters(db).proxyRoutes`; a separate proxy worker
912
+ * process uses this helper when reading directly from the same database.
913
+ */
914
+ declare function createProxyDataAdapter(db: Kysely<Database>): ProxyDataAdapter;
915
+
895
916
  declare function createAdapters(db: Kysely<Database>, databaseOptions?: {
896
917
  useTransactions: boolean;
897
918
  }): DataAdapters;
898
919
 
899
- export { createAdapters as default, migrateDown, migrateToLatest };
920
+ export { createProxyDataAdapter, createProxyRoutesAdapter, createAdapters as default, migrateDown, migrateToLatest };
900
921
  export type { Database };