authhero 8.14.0 → 8.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.
@@ -0,0 +1,128 @@
1
+ import { OpenAPIHono } from "@hono/zod-openapi";
2
+ import { Bindings, Variables } from "../../types";
3
+ export declare const operationRoutes: OpenAPIHono<{
4
+ Bindings: Bindings;
5
+ Variables: Variables;
6
+ }, {
7
+ "/:id": {
8
+ $get: {
9
+ input: {
10
+ param: {
11
+ id: string;
12
+ };
13
+ } & {
14
+ header: {
15
+ "tenant-id"?: string | undefined;
16
+ };
17
+ };
18
+ output: {
19
+ tenant_id: string | null;
20
+ kind: "provision" | "seed" | "upgrade" | "backup" | "deprovision";
21
+ engine: "inline" | "cloudflare-workflows";
22
+ id: string;
23
+ status: "pending" | "failed" | "running" | "succeeded" | "cancelled";
24
+ created_at: string;
25
+ updated_at: string;
26
+ events: {
27
+ operation_id: string;
28
+ step: string;
29
+ outcome: "failed" | "succeeded" | "started" | "retried" | "skipped" | "reconciled";
30
+ attempt: number;
31
+ id: string;
32
+ created_at: string;
33
+ detail?: {
34
+ [x: string]: import("hono/utils/types").JSONValue;
35
+ } | null | undefined;
36
+ }[];
37
+ rollout_id?: string | null | undefined;
38
+ engine_instance_id?: string | null | undefined;
39
+ target_worker_version?: string | null | undefined;
40
+ target_database_version?: string | null | undefined;
41
+ initiated_by?: string | null | undefined;
42
+ current_step?: string | null | undefined;
43
+ error?: string | null | undefined;
44
+ finished_at?: string | null | undefined;
45
+ };
46
+ outputFormat: "json";
47
+ status: 200;
48
+ };
49
+ };
50
+ }, "/">;
51
+ export declare const tenantOperationsRoutes: OpenAPIHono<{
52
+ Bindings: Bindings;
53
+ Variables: Variables;
54
+ }, {
55
+ "/": {
56
+ $get: {
57
+ input: {
58
+ query: {
59
+ page?: unknown;
60
+ per_page?: unknown;
61
+ kind?: "provision" | "seed" | "upgrade" | "backup" | "deprovision" | undefined;
62
+ status?: "pending" | "failed" | "running" | "succeeded" | "cancelled" | undefined;
63
+ };
64
+ } & {
65
+ header: {
66
+ "tenant-id"?: string | undefined;
67
+ };
68
+ };
69
+ output: {
70
+ operations: {
71
+ tenant_id: string | null;
72
+ kind: "provision" | "seed" | "upgrade" | "backup" | "deprovision";
73
+ engine: "inline" | "cloudflare-workflows";
74
+ id: string;
75
+ status: "pending" | "failed" | "running" | "succeeded" | "cancelled";
76
+ created_at: string;
77
+ updated_at: string;
78
+ rollout_id?: string | null | undefined;
79
+ engine_instance_id?: string | null | undefined;
80
+ target_worker_version?: string | null | undefined;
81
+ target_database_version?: string | null | undefined;
82
+ initiated_by?: string | null | undefined;
83
+ current_step?: string | null | undefined;
84
+ error?: string | null | undefined;
85
+ finished_at?: string | null | undefined;
86
+ }[];
87
+ start: number;
88
+ limit: number;
89
+ length: number;
90
+ };
91
+ outputFormat: "json";
92
+ status: 200;
93
+ };
94
+ };
95
+ } & {
96
+ "/": {
97
+ $post: {
98
+ input: {
99
+ header: {
100
+ "tenant-id"?: string | undefined;
101
+ };
102
+ } & {
103
+ json: {
104
+ kind: "provision" | "seed" | "upgrade" | "backup" | "deprovision";
105
+ };
106
+ };
107
+ output: {
108
+ tenant_id: string | null;
109
+ kind: "provision" | "seed" | "upgrade" | "backup" | "deprovision";
110
+ engine: "inline" | "cloudflare-workflows";
111
+ id: string;
112
+ status: "pending" | "failed" | "running" | "succeeded" | "cancelled";
113
+ created_at: string;
114
+ updated_at: string;
115
+ rollout_id?: string | null | undefined;
116
+ engine_instance_id?: string | null | undefined;
117
+ target_worker_version?: string | null | undefined;
118
+ target_database_version?: string | null | undefined;
119
+ initiated_by?: string | null | undefined;
120
+ current_step?: string | null | undefined;
121
+ error?: string | null | undefined;
122
+ finished_at?: string | null | undefined;
123
+ };
124
+ outputFormat: "json";
125
+ status: 201;
126
+ };
127
+ };
128
+ }, "/">;
@@ -781,3 +781,12 @@ export declare const tenantRoutes: OpenAPIHono<{
781
781
  };
782
782
  };
783
783
  }, "/">;
784
+ export declare function isControlPlaneTenant(ctx: {
785
+ env: {
786
+ data: {
787
+ multiTenancyConfig?: {
788
+ controlPlaneTenantId?: string;
789
+ };
790
+ };
791
+ };
792
+ }, tenantId: string): boolean;
@@ -1,4 +1,4 @@
1
- import { CodeExecutor, Connection, ConnectionInsert, CreateTenantParams, DataAdapters, Hook, ResourceServer, ResourceServerInsert, Role, RoleInsert, Tenant } from "@authhero/adapter-interfaces";
1
+ import { CodeExecutor, Connection, ConnectionInsert, CreateTenantParams, DataAdapters, Hook, ResourceServer, ResourceServerInsert, Role, RoleInsert, Tenant, TenantOperation, TenantOperationKind } from "@authhero/adapter-interfaces";
2
2
  import type { RolePermissionHooks, Hooks } from "./Hooks";
3
3
  import type { SamlSigner } from "@authhero/saml/core";
4
4
  import type { OpenAPIHono } from "@hono/zod-openapi";
@@ -99,6 +99,21 @@ export interface ManagementApiExtension {
99
99
  */
100
100
  router: OpenAPIHono<any, any, any>;
101
101
  }
102
+ /**
103
+ * Enqueues a durable tenant lifecycle operation (issue #1026): creates
104
+ * the `tenant_operations` row and starts execution on the configured
105
+ * engine. The inline engine resolves with a terminal row; durable engines
106
+ * resolve as soon as the run is enqueued — clients poll
107
+ * `GET /api/v2/operations/{id}`.
108
+ */
109
+ export interface TenantOperationExecutorBinding {
110
+ engine: string;
111
+ enqueue(params: {
112
+ kind: TenantOperationKind;
113
+ tenant_id: string | null;
114
+ initiated_by?: string;
115
+ }): Promise<TenantOperation>;
116
+ }
102
117
  /**
103
118
  * Configuration for the transactional outbox pattern.
104
119
  * When enabled, audit events are written atomically with entity mutations
@@ -380,6 +395,16 @@ export interface AuthHeroConfig {
380
395
  * ```
381
396
  */
382
397
  tenantUpgrade?: (tenantId: string) => Promise<void>;
398
+ /**
399
+ * Optional executor for durable tenant lifecycle operations (issue
400
+ * #1026). When set together with the `tenantOperations` /
401
+ * `tenantOperationEvents` adapters, `POST /api/v2/tenants/{id}/operations`
402
+ * enqueues operations through it. Kept structural so authhero core
403
+ * depends on neither `@authhero/multi-tenancy` nor any engine —
404
+ * `@authhero/multi-tenancy`'s `enqueueTenantOperation` + executors
405
+ * satisfy this shape.
406
+ */
407
+ tenantOperationExecutor?: TenantOperationExecutorBinding;
383
408
  /**
384
409
  * Optional powered-by logo to display at the bottom left of the login widget.
385
410
  * This is only configurable in code, not stored in the database.
@@ -1,7 +1,7 @@
1
1
  import { CodeExecutor, DataAdapters } from "@authhero/adapter-interfaces";
2
2
  import type { SamlSigner } from "@authhero/saml/core";
3
3
  import { Hooks } from "./Hooks";
4
- import { EntityHooksConfig, OutboxConfig, SigningKeyModeOption, UserLinkingModeOption, UsernamePasswordProviderResolver, WebhookInvoker } from "./AuthHeroConfig";
4
+ import { EntityHooksConfig, OutboxConfig, SigningKeyModeOption, TenantOperationExecutorBinding, UserLinkingModeOption, UsernamePasswordProviderResolver, WebhookInvoker } from "./AuthHeroConfig";
5
5
  import { StrategyHandler } from "../strategies";
6
6
  export type Bindings = {
7
7
  ENVIRONMENT: string;
@@ -34,6 +34,7 @@ export type Bindings = {
34
34
  codeExecutor?: CodeExecutor;
35
35
  webhookInvoker?: WebhookInvoker;
36
36
  tenantUpgrade?: (tenantId: string) => Promise<void>;
37
+ tenantOperationExecutor?: TenantOperationExecutorBinding;
37
38
  outbox?: OutboxConfig;
38
39
  userLinkingMode?: UserLinkingModeOption;
39
40
  usernamePasswordProvider?: UsernamePasswordProviderResolver;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "type": "git",
12
12
  "url": "https://github.com/markusahlstrand/authhero"
13
13
  },
14
- "version": "8.14.0",
14
+ "version": "8.15.0",
15
15
  "files": [
16
16
  "dist"
17
17
  ],
@@ -63,8 +63,8 @@
63
63
  "vite": "^8.0.14",
64
64
  "vite-plugin-dts": "^4.5.4",
65
65
  "vitest": "^4.1.7",
66
- "@authhero/kysely-adapter": "11.12.0",
67
- "@authhero/widget": "0.34.5"
66
+ "@authhero/kysely-adapter": "11.13.0",
67
+ "@authhero/widget": "0.34.6"
68
68
  },
69
69
  "dependencies": {
70
70
  "@peculiar/x509": "^1.14.0",
@@ -82,8 +82,8 @@
82
82
  "qrcode": "^1.5.4",
83
83
  "sanitize-html": "^2.17.4",
84
84
  "xstate": "^5.31.1",
85
- "@authhero/adapter-interfaces": "3.5.0",
86
- "@authhero/proxy": "0.8.1",
85
+ "@authhero/adapter-interfaces": "3.6.0",
86
+ "@authhero/proxy": "0.8.2",
87
87
  "@authhero/saml": "0.4.2"
88
88
  },
89
89
  "peerDependencies": {