@authhero/kysely-adapter 12.8.3 → 12.10.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.
- package/README.md +9 -1
- package/dist/kysely-adapter.cjs +2 -1
- package/dist/kysely-adapter.d.ts +56 -2
- package/dist/kysely-adapter.mjs +1315 -1119
- package/dist/types/migrate/migrations/2026-09-25T12:00:00_token_exchange_profiles.d.ts +4 -0
- package/dist/types/migrate/migrations/index.d.ts +2 -0
- package/dist/types/migrate/plan.d.ts +43 -0
- package/dist/types/src/codes/create.d.ts +1 -1
- package/dist/types/src/db.d.ts +12 -0
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/tokenExchangeProfiles/adapter.d.ts +4 -0
- package/dist/types/src/tokenExchangeProfiles/index.d.ts +1 -0
- package/dist/types/src/tokenExchangeProfiles/serialize.d.ts +4 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +3 -3
package/dist/kysely-adapter.d.ts
CHANGED
|
@@ -792,6 +792,7 @@ declare const sqlClientSchema: z.ZodObject<{
|
|
|
792
792
|
owner_user_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
793
793
|
registration_type: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
794
794
|
registration_metadata: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
795
|
+
token_exchange: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
795
796
|
}, z.core.$strip>;
|
|
796
797
|
declare const sqlClientRegistrationTokenSchema: z.ZodObject<{
|
|
797
798
|
id: z.ZodString;
|
|
@@ -938,6 +939,17 @@ interface Database {
|
|
|
938
939
|
created_at: string;
|
|
939
940
|
updated_at: string;
|
|
940
941
|
};
|
|
942
|
+
token_exchange_profiles: {
|
|
943
|
+
id: string;
|
|
944
|
+
tenant_id: string;
|
|
945
|
+
name: string;
|
|
946
|
+
subject_token_type: string;
|
|
947
|
+
action_id: string | null;
|
|
948
|
+
type: string;
|
|
949
|
+
jwt_verification: string | null;
|
|
950
|
+
created_at: string;
|
|
951
|
+
updated_at: string;
|
|
952
|
+
};
|
|
941
953
|
scim_configurations: {
|
|
942
954
|
connection_id: string;
|
|
943
955
|
tenant_id: string;
|
|
@@ -1024,6 +1036,48 @@ interface Database {
|
|
|
1024
1036
|
declare function migrateToLatest(db: Kysely<Database>, debug?: boolean): Promise<void>;
|
|
1025
1037
|
declare function migrateDown(db: Kysely<Database>, debug?: boolean): Promise<void>;
|
|
1026
1038
|
|
|
1039
|
+
interface PlannedStatement {
|
|
1040
|
+
sql: string;
|
|
1041
|
+
parameters: readonly unknown[];
|
|
1042
|
+
}
|
|
1043
|
+
interface PlannedMigration {
|
|
1044
|
+
name: string;
|
|
1045
|
+
/** Writes (DDL and DML) the migration would execute, in order. */
|
|
1046
|
+
statements: PlannedStatement[];
|
|
1047
|
+
/**
|
|
1048
|
+
* Set when the migration threw during planning. The statements captured
|
|
1049
|
+
* before the failure are still listed. This can be a dry-run artifact: a
|
|
1050
|
+
* migration that reads a column an earlier pending migration adds will fail
|
|
1051
|
+
* here because the earlier migration was never applied.
|
|
1052
|
+
*/
|
|
1053
|
+
error?: string;
|
|
1054
|
+
/** True when planning stopped at MAX_STATEMENTS_PER_MIGRATION. */
|
|
1055
|
+
truncated?: boolean;
|
|
1056
|
+
}
|
|
1057
|
+
interface MigrationPlan {
|
|
1058
|
+
/** Migrations already recorded as executed, in order. */
|
|
1059
|
+
executed: string[];
|
|
1060
|
+
/** Migrations `migrateToLatest` would run, in order. */
|
|
1061
|
+
pending: PlannedMigration[];
|
|
1062
|
+
}
|
|
1063
|
+
/**
|
|
1064
|
+
* Dry run of `migrateToLatest`: lists the pending migrations and the SQL each
|
|
1065
|
+
* would execute, without changing the database.
|
|
1066
|
+
*
|
|
1067
|
+
* Each pending migration's `up` runs against a wrapper around `db` that
|
|
1068
|
+
* passes reads through and captures writes. Nothing is written — including
|
|
1069
|
+
* the `kysely_migration` bookkeeping tables, which are only read if present.
|
|
1070
|
+
*
|
|
1071
|
+
* Because captured writes are never applied, the plan can diverge from a real
|
|
1072
|
+
* run where a migration depends on its own or an earlier migration's writes:
|
|
1073
|
+
* "tolerate duplicate column" guards never fire (so an already-present column
|
|
1074
|
+
* still shows up as an ALTER), and reads of not-yet-created columns fail (see
|
|
1075
|
+
* `PlannedMigration.error`).
|
|
1076
|
+
*/
|
|
1077
|
+
declare function planMigrations(db: Kysely<Database>): Promise<MigrationPlan>;
|
|
1078
|
+
/** Renders a plan as an SQL-ish script for printing. */
|
|
1079
|
+
declare function formatMigrationPlan(plan: MigrationPlan): string;
|
|
1080
|
+
|
|
1027
1081
|
declare function createProxyRoutesAdapter(db: Kysely<Database>): ProxyRoutesAdapter;
|
|
1028
1082
|
|
|
1029
1083
|
/**
|
|
@@ -1038,5 +1092,5 @@ declare function createAdapters(db: Kysely<Database>, databaseOptions?: {
|
|
|
1038
1092
|
useTransactions: boolean;
|
|
1039
1093
|
}): DataAdapters;
|
|
1040
1094
|
|
|
1041
|
-
export { createProxyDataAdapter, createProxyRoutesAdapter, createAdapters as default, migrateDown, migrateToLatest };
|
|
1042
|
-
export type { Database };
|
|
1095
|
+
export { createProxyDataAdapter, createProxyRoutesAdapter, createAdapters as default, formatMigrationPlan, migrateDown, migrateToLatest, planMigrations };
|
|
1096
|
+
export type { Database, MigrationPlan, PlannedMigration, PlannedStatement };
|