@authhero/kysely-adapter 12.14.0 → 12.15.1
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.mjs +1556 -1351
- package/dist/types/src/cleanup.d.ts +5 -5
- package/dist/types/src/refreshTokens/update.d.ts +2 -2
- package/dist/types/src/tenants/list.d.ts +6 -6
- 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 +3 -3
|
@@ -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
|
*
|
|
@@ -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>;
|
|
@@ -184,9 +184,7 @@ export declare function list(db: Kysely<Database>): (params?: ListParams) => Pro
|
|
|
184
184
|
} | undefined;
|
|
185
185
|
is_control_plane?: boolean | undefined;
|
|
186
186
|
}[];
|
|
187
|
-
|
|
188
|
-
limit?: undefined;
|
|
189
|
-
length?: undefined;
|
|
187
|
+
totals?: undefined;
|
|
190
188
|
} | {
|
|
191
189
|
tenants: {
|
|
192
190
|
created_at: string;
|
|
@@ -370,7 +368,9 @@ export declare function list(db: Kysely<Database>): (params?: ListParams) => Pro
|
|
|
370
368
|
} | undefined;
|
|
371
369
|
is_control_plane?: boolean | undefined;
|
|
372
370
|
}[];
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
371
|
+
totals: {
|
|
372
|
+
start: number;
|
|
373
|
+
limit: number;
|
|
374
|
+
length: number;
|
|
375
|
+
};
|
|
376
376
|
}>;
|
|
@@ -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>;
|