@authhero/kysely-adapter 12.13.0 → 12.15.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/dist/kysely-adapter.cjs +2 -2
- package/dist/kysely-adapter.d.ts +8 -0
- package/dist/kysely-adapter.mjs +1583 -1331
- package/dist/types/migrate/migrations/2026-10-13T12:00:00_prompt_partials.d.ts +4 -0
- package/dist/types/migrate/migrations/index.d.ts +2 -0
- package/dist/types/src/cleanup.d.ts +5 -5
- package/dist/types/src/db.d.ts +8 -0
- package/dist/types/src/promptPartials/index.d.ts +4 -0
- package/dist/types/src/refreshTokens/update.d.ts +2 -2
- package/dist/types/src/user-permissions/index.d.ts +1 -0
- package/dist/types/src/user-permissions/list.d.ts +3 -2
- package/dist/types/src/user-roles/index.d.ts +1 -0
- package/dist/types/src/user-roles/list.d.ts +2 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -9,6 +9,7 @@ import * as refreshTokenSessionId from "./2026-08-20T12:00:00_refresh_token_sess
|
|
|
9
9
|
import * as refreshTokenSessionIdBackfill from "./2026-08-21T12:00:00_refresh_token_session_id_backfill";
|
|
10
10
|
import * as tenantOperationRows from "./2026-09-01T12:00:00_tenant_operation_rows";
|
|
11
11
|
import * as tokenExchangeProfiles from "./2026-09-25T12:00:00_token_exchange_profiles";
|
|
12
|
+
import * as promptPartials from "./2026-10-13T12:00:00_prompt_partials";
|
|
12
13
|
/**
|
|
13
14
|
* Kysely runs these in key order and refuses to start if an already-executed
|
|
14
15
|
* migration sorts after a pending one, so the keys must sort in execution
|
|
@@ -36,5 +37,6 @@ declare const _default: {
|
|
|
36
37
|
"2026-08-21T12:00:00_refresh_token_session_id_backfill": typeof refreshTokenSessionIdBackfill;
|
|
37
38
|
"2026-09-01T12:00:00_tenant_operation_rows": typeof tenantOperationRows;
|
|
38
39
|
"2026-09-25T12:00:00_token_exchange_profiles": typeof tokenExchangeProfiles;
|
|
40
|
+
"2026-10-13T12:00:00_prompt_partials": typeof promptPartials;
|
|
39
41
|
};
|
|
40
42
|
export default _default;
|
|
@@ -6,11 +6,11 @@ export declare const MAX_BATCHES = 300;
|
|
|
6
6
|
* Create a scoped session cleanup function that can filter by tenant and/or user.
|
|
7
7
|
* This is designed for lazy cleanup after login session creation.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
9
|
+
* refreshTokens.create and silent auth bump the parent login_sessions.expires_at_ts
|
|
10
|
+
* so a login_session is not reaped while a session still references it. The
|
|
11
|
+
* refresh grant no longer resolves anything through the login_session, so a
|
|
12
|
+
* refresh exchange does not keep it alive. Cleanup deletes each table on its
|
|
13
|
+
* own clock without subqueries to check for children.
|
|
14
14
|
*
|
|
15
15
|
* Records are deleted only after they have been expired for the grace period (1 week).
|
|
16
16
|
*
|
package/dist/types/src/db.d.ts
CHANGED
|
@@ -48,6 +48,13 @@ declare const sqlCustomTextSchema: z.ZodObject<{
|
|
|
48
48
|
created_at_ts: z.ZodNumber;
|
|
49
49
|
updated_at_ts: z.ZodNumber;
|
|
50
50
|
}, z.core.$strip>;
|
|
51
|
+
declare const sqlPromptPartialsSchema: z.ZodObject<{
|
|
52
|
+
tenant_id: z.ZodString;
|
|
53
|
+
prompt: z.ZodString;
|
|
54
|
+
body: z.ZodString;
|
|
55
|
+
created_at_ts: z.ZodNumber;
|
|
56
|
+
updated_at_ts: z.ZodNumber;
|
|
57
|
+
}, z.core.$strip>;
|
|
51
58
|
declare const sqlPromptSettingSchema: z.ZodObject<{
|
|
52
59
|
universal_login_experience: z.ZodDefault<z.ZodEnum<{
|
|
53
60
|
new: "new";
|
|
@@ -887,6 +894,7 @@ export interface Database {
|
|
|
887
894
|
invites: z.infer<typeof sqlInviteSchema>;
|
|
888
895
|
universal_login_templates: z.infer<typeof sqlUniversalLoginTemplateSchema>;
|
|
889
896
|
custom_text: z.infer<typeof sqlCustomTextSchema>;
|
|
897
|
+
prompt_partials: z.infer<typeof sqlPromptPartialsSchema>;
|
|
890
898
|
authentication_methods: z.infer<typeof sqlAuthenticationMethodSchema>;
|
|
891
899
|
log_streams: {
|
|
892
900
|
id: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Kysely } from "kysely";
|
|
2
2
|
import { Database } from "../db";
|
|
3
|
-
import { RefreshTokenUpdate
|
|
4
|
-
export declare function update(db: Kysely<Database>): (tenant_id: string, id: string, refresh_token: RefreshTokenUpdate
|
|
3
|
+
import { RefreshTokenUpdate } from "@authhero/adapter-interfaces";
|
|
4
|
+
export declare function update(db: Kysely<Database>): (tenant_id: string, id: string, refresh_token: RefreshTokenUpdate) => Promise<boolean>;
|
|
@@ -7,4 +7,5 @@ export declare function userPermissions(db: Kysely<Database>): {
|
|
|
7
7
|
permission_name: string;
|
|
8
8
|
}, organization_id?: string) => Promise<boolean>;
|
|
9
9
|
list: (tenant_id: string, user_id: string, _params?: import("@authhero/adapter-interfaces").ListParams, organization_id?: string) => Promise<import("@authhero/adapter-interfaces").UserPermissionWithDetails[]>;
|
|
10
|
+
listCheckpoint: (tenant_id: string, user_id: string, params?: import("@authhero/adapter-interfaces").ListParams, organization_id?: string) => Promise<import("@authhero/adapter-interfaces").ListUserPermissionsCheckpointResponse>;
|
|
10
11
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Kysely } from "kysely";
|
|
2
2
|
import { Database } from "../db";
|
|
3
|
-
import { ListParams, UserPermissionWithDetails } from "@authhero/adapter-interfaces";
|
|
4
|
-
export declare function list(db: Kysely<Database>): (tenant_id: string, user_id: string, _params?: ListParams, // TODO: Implement pagination when needed
|
|
3
|
+
import { ListParams, ListUserPermissionsCheckpointResponse, UserPermissionWithDetails } from "@authhero/adapter-interfaces";
|
|
4
|
+
export declare function list(db: Kysely<Database>): (tenant_id: string, user_id: string, _params?: ListParams, // TODO: Implement offset pagination when needed
|
|
5
5
|
organization_id?: string) => Promise<UserPermissionWithDetails[]>;
|
|
6
|
+
export declare function listCheckpoint(db: Kysely<Database>): (tenant_id: string, user_id: string, params?: ListParams, organization_id?: string) => Promise<ListUserPermissionsCheckpointResponse>;
|
|
@@ -2,6 +2,7 @@ import { Kysely } from "kysely";
|
|
|
2
2
|
import { Database } from "../db";
|
|
3
3
|
export declare function userRoles(db: Kysely<Database>): {
|
|
4
4
|
list: (tenant_id: string, user_id: string, _params?: import("@authhero/adapter-interfaces").ListParams, organization_id?: string) => Promise<import("@authhero/adapter-interfaces").Role[]>;
|
|
5
|
+
listCheckpoint: (tenant_id: string, user_id: string, params?: import("@authhero/adapter-interfaces").ListParams, organization_id?: string) => Promise<import("@authhero/adapter-interfaces").ListUserRolesCheckpointResponse>;
|
|
5
6
|
listUsers: (tenant_id: string, role_id: string, params?: import("@authhero/adapter-interfaces").ListParams) => Promise<import("@authhero/adapter-interfaces").ListRoleUsersResponse>;
|
|
6
7
|
create: (tenant_id: string, user_id: string, role_id: string, organization_id?: string, options?: import("@authhero/adapter-interfaces").CreateOptions) => Promise<boolean>;
|
|
7
8
|
remove: (tenant_id: string, user_id: string, role_id: string, organization_id?: string) => Promise<boolean>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Kysely } from "kysely";
|
|
2
2
|
import { Database } from "../db";
|
|
3
|
-
import { Role, ListParams } from "@authhero/adapter-interfaces";
|
|
3
|
+
import { Role, ListParams, ListUserRolesCheckpointResponse } from "@authhero/adapter-interfaces";
|
|
4
4
|
export declare function list(db: Kysely<Database>): (tenant_id: string, user_id: string, _params?: ListParams, organization_id?: string) => Promise<Role[]>;
|
|
5
|
+
export declare function listCheckpoint(db: Kysely<Database>): (tenant_id: string, user_id: string, params?: ListParams, organization_id?: string) => Promise<ListUserRolesCheckpointResponse>;
|