@authhero/kysely-adapter 12.14.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.
@@ -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
- * The refreshTokens.create and refreshTokens.update adapter methods bump the
10
- * parent login_sessions.expires_at_ts in the same transaction whenever a refresh
11
- * token's validity is extended. Likewise, silent auth bumps it when a session is
12
- * refreshed. This invariant means we can delete expired login_sessions
13
- * independently without expensive subqueries to check for active children.
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
  *
@@ -1,4 +1,4 @@
1
1
  import { Kysely } from "kysely";
2
2
  import { Database } from "../db";
3
- import { RefreshTokenUpdate, UpdateRefreshTokenOptions } from "@authhero/adapter-interfaces";
4
- export declare function update(db: Kysely<Database>): (tenant_id: string, id: string, refresh_token: RefreshTokenUpdate, options?: UpdateRefreshTokenOptions) => Promise<boolean>;
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>;