@authhero/adapter-interfaces 4.19.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. */
@@ -0,0 +1,9 @@
1
+ import { CreateOptions, PromptPartials } from "../types";
2
+ export interface PromptPartialsAdapter {
3
+ get(tenant_id: string, prompt: string): Promise<PromptPartials | null>;
4
+ /** Replace all partials stored for a prompt. */
5
+ set(tenant_id: string, prompt: string, partials: PromptPartials, options?: CreateOptions): Promise<void>;
6
+ delete(tenant_id: string, prompt: string): Promise<void>;
7
+ /** List prompts with stored partials for tenant export. */
8
+ list(tenant_id: string): Promise<string[]>;
9
+ }
@@ -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).
@@ -50,6 +50,7 @@ import { StatsAdapter } from "./Stats";
50
50
  import { AnalyticsAdapter } from "./Analytics";
51
51
  import { UniversalLoginTemplatesAdapter } from "./UniversalLoginTemplates";
52
52
  import { CustomTextAdapter } from "./CustomText";
53
+ import { PromptPartialsAdapter } from "./PromptPartials";
53
54
  import { EmailServiceAdapter } from "./EmailService";
54
55
  import { SmsServiceAdapter } from "./SmsService";
55
56
  import { OutboxAdapter } from "./Outbox";
@@ -100,6 +101,8 @@ export interface DataAdapters {
100
101
  migrationSources?: MigrationSourcesAdapter;
101
102
  passwords: PasswordsAdapter;
102
103
  promptSettings: PromptSettingsAdapter;
104
+ /** Optional tenant-level storage for Auth0-compatible prompt partials. */
105
+ promptPartials?: PromptPartialsAdapter;
103
106
  /**
104
107
  * Optional adapter for managing reverse-proxy route configuration per tenant.
105
108
  * When set, AuthHero mounts the `/api/v2/proxy-routes` management API. A
@@ -248,6 +251,7 @@ export * from "./ActionVersions";
248
251
  export * from "./Flows";
249
252
  export * from "./Cache";
250
253
  export * from "./Clients";
254
+ export * from "./PromptPartials";
251
255
  export * from "./ClientConnections";
252
256
  export * from "./ClientGrants";
253
257
  export * from "./ClientRegistrationTokens";
@@ -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>;
@@ -1,4 +1,5 @@
1
1
  import { z } from "@hono/zod-openapi";
2
+ import type { PromptPartialInsertionPoint } from "./PromptPartials";
2
3
  declare const dividerComponent: z.ZodObject<{
3
4
  id: z.ZodString;
4
5
  order: z.ZodOptional<z.ZodNumber>;
@@ -4651,6 +4652,13 @@ export declare const screenLinkSchema: z.ZodObject<{
4651
4652
  linkText: z.ZodOptional<z.ZodString>;
4652
4653
  }, z.core.$strip>;
4653
4654
  export type ScreenLink = z.infer<typeof screenLinkSchema>;
4655
+ /**
4656
+ * Auth0 prompt partials attached to a rendered screen.
4657
+ *
4658
+ * This is a single screen's insertion points, rather than the complete
4659
+ * prompt -> screen -> insertion point object persisted by adapters.
4660
+ */
4661
+ export declare const uiScreenPartialsSchema: z.ZodType<Partial<Record<PromptPartialInsertionPoint, string>>>;
4654
4662
  /**
4655
4663
  * Screen sent to the widget (simplified STEP for rendering)
4656
4664
  * This is what the API returns to the widget - no flow routing logic
@@ -5288,6 +5296,7 @@ export declare const uiScreenSchema: z.ZodObject<{
5288
5296
  href: z.ZodString;
5289
5297
  linkText: z.ZodOptional<z.ZodString>;
5290
5298
  }, z.core.$strip>>>;
5299
+ partials: z.ZodOptional<z.ZodType<Partial<Record<"form-content-start" | "form-content-end" | "form-footer-start" | "form-footer-end" | "secondary-actions-start" | "secondary-actions-end", string>>, unknown, z.core.$ZodTypeInternals<Partial<Record<"form-content-start" | "form-content-end" | "form-footer-start" | "form-footer-end" | "secondary-actions-start" | "secondary-actions-end", string>>, unknown>>>;
5291
5300
  footer: z.ZodOptional<z.ZodString>;
5292
5301
  }, z.core.$strip>;
5293
5302
  export type UiScreen = z.infer<typeof uiScreenSchema>;
@@ -0,0 +1,22 @@
1
+ import { z } from "@hono/zod-openapi";
2
+ export declare const promptPartialInsertionPoints: readonly ["form-content-start", "form-content-end", "form-footer-start", "form-footer-end", "secondary-actions-start", "secondary-actions-end"];
3
+ export type PromptPartialInsertionPoint = (typeof promptPartialInsertionPoints)[number];
4
+ /**
5
+ * Auth0-compatible prompt partials, keyed by screen and insertion point.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * {
10
+ * signup: {
11
+ * "form-content-end": "<input name=\"ulp-first-name\">"
12
+ * }
13
+ * }
14
+ * ```
15
+ */
16
+ export type PromptPartials = Record<string, Partial<Record<PromptPartialInsertionPoint, string>>>;
17
+ export declare const promptPartialsSchema: z.ZodType<PromptPartials>;
18
+ export declare const promptPartialsEntrySchema: z.ZodObject<{
19
+ prompt: z.ZodString;
20
+ partials: z.ZodType<PromptPartials, unknown, z.core.$ZodTypeInternals<PromptPartials, unknown>>;
21
+ }, z.core.$strip>;
22
+ export type PromptPartialsEntry = z.infer<typeof promptPartialsEntrySchema>;
@@ -50,7 +50,6 @@ export declare const proxyRouteSchema: z.ZodObject<{
50
50
  }, z.core.$strip>;
51
51
  export type ProxyRoute = z.infer<typeof proxyRouteSchema>;
52
52
  export declare const proxyRouteUpdateSchema: z.ZodObject<{
53
- priority: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
54
53
  match: z.ZodOptional<z.ZodObject<{
55
54
  hosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
56
55
  methods: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -58,6 +57,7 @@ export declare const proxyRouteUpdateSchema: z.ZodObject<{
58
57
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
59
58
  query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
60
59
  }, z.core.$strip>>;
60
+ priority: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
61
61
  handlers: z.ZodOptional<z.ZodArray<z.ZodObject<{
62
62
  type: z.ZodString;
63
63
  options: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -60,6 +60,7 @@ export * from "./TenantSettings";
60
60
  export * from "./Stats";
61
61
  export * from "./Analytics";
62
62
  export * from "./CustomText";
63
+ export * from "./PromptPartials";
63
64
  export * from "./Strategy";
64
65
  export * from "./AuthenticationMethod";
65
66
  export * from "./ImportMetadata";
package/package.json CHANGED
@@ -9,9 +9,9 @@
9
9
  "homepage": "https://authhero.net",
10
10
  "repository": {
11
11
  "type": "git",
12
- "url": "https://github.com/markusahlstrand/authhero"
12
+ "url": "https://github.com/sesamyab/authhero"
13
13
  },
14
- "version": "4.19.0",
14
+ "version": "4.21.0",
15
15
  "files": [
16
16
  "dist"
17
17
  ],