@authhero/adapter-interfaces 4.20.0 → 4.21.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,8 +1,23 @@
1
1
  import { OrganizationConnection, OrganizationConnectionInsert } from "../types";
2
2
  import { CreateOptions } from "../types/ImportMetadata";
3
+ import { ListParams } from "../types/ListParams";
4
+ export interface ListOrganizationConnectionsCheckpointResponse {
5
+ connections: OrganizationConnection[];
6
+ /** Opaque checkpoint cursor for the next page; absent on the last page. */
7
+ next?: string;
8
+ }
3
9
  export interface OrganizationConnectionsAdapter {
4
10
  create(tenant_id: string, organization_id: string, params: OrganizationConnectionInsert, options?: CreateOptions): Promise<OrganizationConnection>;
5
11
  list(tenant_id: string, organization_id: string): Promise<OrganizationConnection[]>;
12
+ /**
13
+ * Checkpoint (from/take) pagination over an organization's enabled
14
+ * connections, ordered by connection id ascending (unique per organization).
15
+ * Separate from `list` because that returns a bare array with nowhere to
16
+ * carry `next`. Optional so existing adapter implementations keep compiling;
17
+ * the management API answers checkpoint requests with 501 when it is
18
+ * missing.
19
+ */
20
+ listCheckpoint?(tenant_id: string, organization_id: string, params?: ListParams): Promise<ListOrganizationConnectionsCheckpointResponse>;
6
21
  get(tenant_id: string, organization_id: string, connection_id: string): Promise<OrganizationConnection | null>;
7
22
  update(tenant_id: string, organization_id: string, connection_id: string, params: Partial<Omit<OrganizationConnectionInsert, "connection_id">>): Promise<OrganizationConnection | null>;
8
23
  remove(tenant_id: string, organization_id: string, connection_id: string): Promise<boolean>;
@@ -21,6 +21,11 @@ export interface ListFailedEventsResponse {
21
21
  start: number;
22
22
  limit: number;
23
23
  length: number;
24
+ /**
25
+ * Opaque keyset cursor for the next page. Set only when the caller paginated
26
+ * with from/take and more rows may follow.
27
+ */
28
+ next?: string;
24
29
  }
25
30
  export interface OutboxAdapter {
26
31
  /** Write an audit event to the outbox. Returns the event ID. */
@@ -16,18 +16,6 @@ export interface RefreshTokenListParams extends ListParams {
16
16
  export interface ListRefreshTokenResponse extends Totals {
17
17
  refresh_tokens: RefreshToken[];
18
18
  }
19
- export interface UpdateRefreshTokenOptions {
20
- /**
21
- * When provided, the adapter also extends the parent login_session's
22
- * `expires_at` to `expires_at` (only if the current value is smaller).
23
- * The caller is expected to compute the new expiry so the adapter can
24
- * avoid a read-before-write and parallelise the two UPDATEs.
25
- */
26
- loginSessionBump?: {
27
- login_id: string;
28
- expires_at: string;
29
- };
30
- }
31
19
  /**
32
20
  * Update payload for a refresh token.
33
21
  *
@@ -55,7 +43,7 @@ export interface RefreshTokensAdapter {
55
43
  */
56
44
  getByLookup: (tenant_id: string, token_lookup: string) => Promise<RefreshToken | null>;
57
45
  list(tenant_id: string, params?: RefreshTokenListParams): Promise<ListRefreshTokenResponse>;
58
- update: (tenant_id: string, id: string, refresh_token: RefreshTokenUpdate, options?: UpdateRefreshTokenOptions) => Promise<boolean>;
46
+ update: (tenant_id: string, id: string, refresh_token: RefreshTokenUpdate) => Promise<boolean>;
59
47
  remove: (tenant_id: string, id: string) => Promise<boolean>;
60
48
  /**
61
49
  * Soft-revoke every refresh token belonging to a user that isn't already
@@ -1,8 +1,22 @@
1
1
  import { ListParams } from "../types/ListParams";
2
2
  import { UserPermissionInsert, UserPermissionWithDetailsList } from "../types";
3
3
  import { CreateOptions } from "../types/ImportMetadata";
4
+ export interface ListUserPermissionsCheckpointResponse {
5
+ permissions: UserPermissionWithDetailsList;
6
+ /** Opaque checkpoint cursor for the next page; absent on the last page. */
7
+ next?: string;
8
+ }
4
9
  export interface UserPermissionsAdapter {
5
10
  create(tenant_id: string, user_id: string, permission: UserPermissionInsert, organization_id?: string, options?: CreateOptions): Promise<boolean>;
6
11
  remove(tenant_id: string, user_id: string, permission: Pick<UserPermissionInsert, "resource_server_identifier" | "permission_name">, organization_id?: string): Promise<boolean>;
7
12
  list(tenant_id: string, user_id: string, params?: ListParams, organization_id?: string): Promise<UserPermissionWithDetailsList>;
13
+ /**
14
+ * Checkpoint (from/take) pagination over a user's permissions, ordered by
15
+ * (resource_server_identifier, permission_name, organization_id) ascending —
16
+ * the composite key. Separate from `list` because that returns a bare array
17
+ * with nowhere to carry `next`. Optional so existing adapter implementations
18
+ * keep compiling; the management API answers checkpoint requests with 501
19
+ * when it is missing.
20
+ */
21
+ listCheckpoint?(tenant_id: string, user_id: string, params?: ListParams, organization_id?: string): Promise<ListUserPermissionsCheckpointResponse>;
8
22
  }
@@ -7,6 +7,11 @@ export interface ListUserRolesResponse {
7
7
  limit: number;
8
8
  length: number;
9
9
  }
10
+ export interface ListUserRolesCheckpointResponse {
11
+ roles: Role[];
12
+ /** Opaque checkpoint cursor for the next page; absent on the last page. */
13
+ next?: string;
14
+ }
10
15
  export interface ListRoleUsersResponse {
11
16
  /** Distinct user ids holding the role, ordered by user_id ascending. */
12
17
  userIds: string[];
@@ -35,6 +40,15 @@ export interface UserRolesAdapter {
35
40
  * lookups (see #1198).
36
41
  */
37
42
  list(tenantId: string, userId: string, params?: ListParams, organizationId?: string): Promise<Role[]>;
43
+ /**
44
+ * Checkpoint (from/take) pagination over the roles assigned to a user,
45
+ * ordered by role id ascending. Roles are distinct: one held under several
46
+ * organization scopes appears once (unlike `list`, which returns one row per
47
+ * assignment). `organizationId` filters exactly as it does for `list`.
48
+ * Optional so existing adapter implementations keep compiling; the
49
+ * management API answers checkpoint requests with 501 when it is missing.
50
+ */
51
+ listCheckpoint?(tenantId: string, userId: string, params?: ListParams, organizationId?: string): Promise<ListUserRolesCheckpointResponse>;
38
52
  /**
39
53
  * List the distinct users assigned to a role, across all organization
40
54
  * scopes (a user holding the role in several organizations appears once).
@@ -137,6 +137,8 @@ export declare const auditEventInsertSchema: z.ZodObject<{
137
137
  hostname: z.ZodString;
138
138
  is_mobile: z.ZodOptional<z.ZodBoolean>;
139
139
  execution_id: z.ZodOptional<z.ZodString>;
140
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
141
+ login_session_id: z.ZodOptional<z.ZodString>;
140
142
  timestamp: z.ZodString;
141
143
  }, z.core.$strip>;
142
144
  export type AuditEventInsert = z.infer<typeof auditEventInsertSchema>;
@@ -214,6 +216,8 @@ export declare const auditEventSchema: z.ZodObject<{
214
216
  hostname: z.ZodString;
215
217
  is_mobile: z.ZodOptional<z.ZodBoolean>;
216
218
  execution_id: z.ZodOptional<z.ZodString>;
219
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
220
+ login_session_id: z.ZodOptional<z.ZodString>;
217
221
  timestamp: z.ZodString;
218
222
  id: z.ZodString;
219
223
  }, z.core.$strip>;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "type": "git",
12
12
  "url": "https://github.com/sesamyab/authhero"
13
13
  },
14
- "version": "4.20.0",
14
+ "version": "4.21.0",
15
15
  "files": [
16
16
  "dist"
17
17
  ],