@authhero/adapter-interfaces 4.18.0 → 4.20.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.
@@ -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
+ }
@@ -1,8 +1,22 @@
1
1
  import { ListParams } from "../types/ListParams";
2
2
  import { RolePermissionInsert, RolePermissionList } from "../types/RolePermission";
3
3
  import { CreateOptions } from "../types/ImportMetadata";
4
+ export interface ListRolePermissionsCheckpointResponse {
5
+ permissions: RolePermissionList;
6
+ /** Opaque checkpoint cursor for the next page; absent on the last page. */
7
+ next?: string;
8
+ }
4
9
  export interface RolePermissionsAdapter {
5
10
  assign(tenant_id: string, role_id: string, permissions: RolePermissionInsert[], options?: CreateOptions): Promise<boolean>;
6
11
  remove(tenant_id: string, role_id: string, permissions: Pick<RolePermissionInsert, "resource_server_identifier" | "permission_name">[]): Promise<boolean>;
7
12
  list(tenant_id: string, role_id: string, params?: ListParams): Promise<RolePermissionList>;
13
+ /**
14
+ * Checkpoint (from/take) pagination over a role's permissions, ordered by
15
+ * (resource_server_identifier, permission_name) ascending — the composite
16
+ * key, so the order is unique without a surrogate id. Separate from `list`
17
+ * because that returns a bare array with nowhere to carry `next`. Optional
18
+ * so existing adapter implementations keep compiling; the management API
19
+ * answers checkpoint requests with 501 when it is missing.
20
+ */
21
+ listCheckpoint?(tenant_id: string, role_id: string, params?: ListParams): Promise<ListRolePermissionsCheckpointResponse>;
8
22
  }
@@ -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";
@@ -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.18.0",
14
+ "version": "4.20.0",
15
15
  "files": [
16
16
  "dist"
17
17
  ],