@checkstack/integration-common 0.5.0 → 0.7.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,87 @@
1
1
  # @checkstack/integration-common
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 9dcc848: Align workspace dependency versions and migrate React Router to v7.
8
+
9
+ BREAKING CHANGES (React Router v7): All frontend packages now depend on `react-router-dom@^7.16.0`. Previously the workspace declared four divergent ranges (`^6.20.0`, `^6.22.0`, `^7.1.1`, `^7.14.2`), which resolved both `react-router@6` and `react-router@7` into a single bundle. Everything is now unified on v7. The public imports the app uses (`BrowserRouter`, `Routes`, `Route`, `Link`, `NavLink`, `MemoryRouter`, `useNavigate`, `useParams`, `useSearchParams`, `useLocation`) are unchanged between v6 and v7, so no source rewrites were required - but any out-of-tree plugin still on react-router v6 should upgrade to v7 (see the React Router v6 -> v7 upgrade guide) to share the host's single router instance via the import map.
10
+
11
+ Other unified ranges (no API change): `react` -> `^18.3.1`, the `@orpc/*` family (`contract`, `server`, `client`, `tanstack-query`, `openapi`, `zod`) -> `^1.14.4`, and `better-auth` -> `^1.6.13`.
12
+
13
+ Removed the pre-rename `@orpc/react-query` leftover from `@checkstack/frontend-api`; its `createRouterUtils` / `RouterUtils` / `ProcedureUtils` now come from `@orpc/tanstack-query` (the package already in use).
14
+
15
+ Stale in-range runtime deps pulled up to current published versions: `hono` `^4.12.23`, `@tanstack/react-query` (+devtools) `^5.100.14`, `date-fns` `^4.4.0`, `jose` `^6.2.3`, `tar` `^7.5.16`, `semver` `^7.8.1`, `@xyflow/react` `^12.11.0`.
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [9dcc848]
20
+ - Updated dependencies [9dcc848]
21
+ - Updated dependencies [9dcc848]
22
+ - Updated dependencies [9dcc848]
23
+ - @checkstack/common@0.13.0
24
+ - @checkstack/signal-common@0.2.6
25
+
26
+ ## 0.6.0
27
+
28
+ ### Minor Changes
29
+
30
+ - 41c77f4: feat(automation): one-time migration of webhook subscriptions + remove legacy integration backend
31
+
32
+ **BREAKING CHANGES** (platform is in BETA — no major bump):
33
+
34
+ - `IntegrationProvider` no longer carries `config` (subscription
35
+ config) or `deliver`. The interface now models a connection provider
36
+ only: connection schema + `getConnectionOptions` + `testConnection`.
37
+ - The legacy subscription / delivery-log / event endpoints
38
+ (`listSubscriptions`, `createSubscription`, `getDeliveryLogs`,
39
+ `listEventTypes`, …) are removed from `integrationContract`.
40
+ - `delivery-coordinator`, `hook-subscriber`, `event-registry`, and the
41
+ `integrationEventExtensionPoint` are deleted. Plugins that
42
+ previously called `integrationEvents.registerEvent(...)` now
43
+ register their hooks as automation triggers via
44
+ `automationTriggerExtensionPoint.registerTrigger(...)`.
45
+ - Frontend pages `IntegrationsPage` and `DeliveryLogsPage` are gone;
46
+ the integration plugin's only remaining UI is connection
47
+ management. Subscription management lives under `/automation/...`.
48
+ - `webhook_subscriptions` and `delivery_logs` tables stay in the
49
+ database for one release as a safety net (no code reads or writes
50
+ them), and will be dropped in a follow-up migration.
51
+
52
+ **New**:
53
+
54
+ - `jira.create_issue`, `teams.post_message`, `webex.post_message`,
55
+ `webhook.send`, `integration-script.run_shell`, and
56
+ `integration-script.run_script` actions registered against the
57
+ Automation Platform with matching `*.message`, `*.delivery`,
58
+ `shell.result`, and `script.result` artifact types. The script
59
+ plugin exposes **two** actions — `run_shell` runs bash via the
60
+ shared `ShellScriptRunner` (Monaco `shell` editor), `run_script`
61
+ runs an ESM module in a Bun subprocess via `EsmScriptRunner`
62
+ (Monaco `typescript` editor + `defineIntegration` helper) — to
63
+ preserve the legacy provider split. `jira.create_issue` keeps the
64
+ dynamic field-mapping dropdown (driven by
65
+ `JIRA_RESOLVERS.FIELD_OPTIONS`).
66
+ - One-time data migration runs on boot in
67
+ `automation-backend.afterPluginsReady`. It reads
68
+ `webhook_subscriptions` via a new service RPC
69
+ `IntegrationApi.listLegacySubscriptions`, translates each row into
70
+ a single-trigger / single-action automation (marked with
71
+ `managed_by = "migrated-subscription:<id>"`), and is idempotent
72
+ across restarts.
73
+ - Failed translations are recorded in a new
74
+ `automation_migration_failures` table and surfaced via
75
+ `AutomationApi.listMigrationFailures` /
76
+ `acknowledgeMigrationFailure` so admins can review and re-create
77
+ failed entries by hand.
78
+
79
+ ### Patch Changes
80
+
81
+ - Updated dependencies [6d52276]
82
+ - @checkstack/common@0.12.0
83
+ - @checkstack/signal-common@0.2.5
84
+
3
85
  ## 0.5.0
4
86
 
5
87
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/integration-common",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "license": "Elastic-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -10,15 +10,15 @@
10
10
  }
11
11
  },
12
12
  "dependencies": {
13
- "@checkstack/common": "0.10.0",
14
- "@checkstack/signal-common": "0.2.3",
15
- "@orpc/contract": "^1.13.14",
13
+ "@checkstack/common": "0.12.0",
14
+ "@checkstack/signal-common": "0.2.5",
15
+ "@orpc/contract": "^1.14.4",
16
16
  "zod": "^4.0.0"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@checkstack/tsconfig": "0.0.7",
20
20
  "typescript": "^5.7.2",
21
- "@checkstack/scripts": "0.3.2"
21
+ "@checkstack/scripts": "0.3.4"
22
22
  },
23
23
  "scripts": {
24
24
  "typecheck": "tsgo -b",
package/src/routes.ts CHANGED
@@ -2,14 +2,14 @@ import { createRoutes } from "@checkstack/common";
2
2
 
3
3
  /**
4
4
  * Route definitions for the integration plugin.
5
+ *
6
+ * The legacy subscription list / delivery log routes were removed when
7
+ * the platform moved to the Automation Platform model. The remaining
8
+ * surface is the per-provider connection management page.
5
9
  */
6
10
  export const integrationRoutes = createRoutes("integration", {
7
- /** Main integrations management page */
11
+ /** Main connections landing page */
8
12
  list: "/",
9
- /** Delivery logs page (all logs) */
10
- logs: "/logs",
11
- /** Delivery logs filtered by subscription */
12
- deliveryLogs: "/logs/:subscriptionId",
13
13
  /** Provider connections management */
14
14
  connections: "/connections/:providerId",
15
15
  });
@@ -3,100 +3,34 @@ import { integrationAccess } from "./access";
3
3
  import { pluginMetadata } from "./plugin-metadata";
4
4
  import {
5
5
  createClientDefinition,
6
- PaginatedResult,
7
- PaginationInput,
8
6
  proc,
9
7
  } from "@checkstack/common";
10
8
  import {
11
- WebhookSubscriptionSchema,
12
- CreateSubscriptionInputSchema,
13
- UpdateSubscriptionInputSchema,
14
- DeliveryLogSchema,
15
- DeliveryLogQueryInputSchema,
16
9
  IntegrationProviderInfoSchema,
17
- IntegrationEventInfoSchema,
18
10
  TestConnectionResultSchema,
19
11
  ProviderConnectionRedactedSchema,
20
12
  CreateConnectionInputSchema,
21
13
  UpdateConnectionInputSchema,
22
14
  GetConnectionOptionsInputSchema,
23
15
  ConnectionOptionSchema,
24
- EventPayloadSchemaOutputSchema,
25
16
  } from "./schemas";
26
17
 
27
- // Integration RPC Contract
18
+ /**
19
+ * Integration RPC contract — scoped to connection management.
20
+ *
21
+ * The legacy subscription + delivery-log + event-listing endpoints
22
+ * moved to the Automation Platform; existing subscriptions are
23
+ * auto-migrated on boot (see `@checkstack/automation-backend`'s
24
+ * migration module). All remaining endpoints relate to the connection
25
+ * store, which the Automation editor uses to pick a connection for
26
+ * provider-bound actions.
27
+ */
28
28
  export const integrationContract = {
29
- // ==========================================================================
30
- // SUBSCRIPTION MANAGEMENT (Admin only)
31
- // ==========================================================================
32
-
33
- /** List all webhook subscriptions */
34
- listSubscriptions: proc({
35
- operationType: "query",
36
- userType: "authenticated",
37
- access: [integrationAccess.manage],
38
- })
39
- .input(
40
- PaginationInput.extend({
41
- providerId: z.string().optional(),
42
- eventType: z.string().optional(),
43
- enabled: z.boolean().optional(),
44
- })
45
- )
46
- .output(PaginatedResult(WebhookSubscriptionSchema)),
47
-
48
- /** Get a single subscription by ID */
49
- getSubscription: proc({
50
- operationType: "query",
51
- userType: "authenticated",
52
- access: [integrationAccess.manage],
53
- })
54
- .input(z.object({ id: z.string() }))
55
- .output(WebhookSubscriptionSchema),
56
-
57
- /** Create a new webhook subscription */
58
- createSubscription: proc({
59
- operationType: "mutation",
60
- userType: "authenticated",
61
- access: [integrationAccess.manage],
62
- })
63
- .input(CreateSubscriptionInputSchema)
64
- .output(WebhookSubscriptionSchema),
65
-
66
- /** Update an existing subscription */
67
- updateSubscription: proc({
68
- operationType: "mutation",
69
- userType: "authenticated",
70
- access: [integrationAccess.manage],
71
- })
72
- .route({ method: "PATCH" })
73
- .input(UpdateSubscriptionInputSchema)
74
- .output(WebhookSubscriptionSchema),
75
-
76
- /** Delete a subscription */
77
- deleteSubscription: proc({
78
- operationType: "mutation",
79
- userType: "authenticated",
80
- access: [integrationAccess.manage],
81
- })
82
- .route({ method: "DELETE" })
83
- .input(z.object({ id: z.string() }))
84
- .output(z.object({ success: z.boolean() })),
85
-
86
- /** Toggle subscription enabled state */
87
- toggleSubscription: proc({
88
- operationType: "mutation",
89
- userType: "authenticated",
90
- access: [integrationAccess.manage],
91
- })
92
- .input(z.object({ id: z.string(), enabled: z.boolean() }))
93
- .output(z.object({ success: z.boolean() })),
94
-
95
29
  // ==========================================================================
96
30
  // PROVIDER DISCOVERY (Admin only)
97
31
  // ==========================================================================
98
32
 
99
- /** List all registered integration providers */
33
+ /** List all registered integration providers (connection-capable plugins) */
100
34
  listProviders: proc({
101
35
  operationType: "query",
102
36
  userType: "authenticated",
@@ -119,7 +53,6 @@ export const integrationContract = {
119
53
 
120
54
  // ==========================================================================
121
55
  // CONNECTION MANAGEMENT (Admin only)
122
- // Generic CRUD for site-wide provider connections
123
56
  // ==========================================================================
124
57
 
125
58
  /** List all connections for a provider */
@@ -188,111 +121,39 @@ export const integrationContract = {
188
121
  .output(z.array(ConnectionOptionSchema)),
189
122
 
190
123
  // ==========================================================================
191
- // EVENT DISCOVERY (Admin only)
124
+ // ONE-TIME MIGRATION SUPPORT (service-to-service)
125
+ //
126
+ // Exposed so `@checkstack/automation-backend` can read the legacy
127
+ // `webhook_subscriptions` rows during boot and translate them into
128
+ // automations. Plugins are sandboxed to their own schema, so this is
129
+ // the only way to reach the legacy table from another plugin.
130
+ // Once the legacy table is dropped in a follow-up release these
131
+ // endpoints will be removed.
192
132
  // ==========================================================================
193
133
 
194
- /** List all registered integration events */
195
- listEventTypes: proc({
134
+ listLegacySubscriptions: proc({
196
135
  operationType: "query",
197
- userType: "authenticated",
198
- access: [integrationAccess.manage],
199
- }).output(z.array(IntegrationEventInfoSchema)),
200
-
201
- /** Get events grouped by category */
202
- getEventsByCategory: proc({
203
- operationType: "query",
204
- userType: "authenticated",
205
- access: [integrationAccess.manage],
136
+ userType: "service",
137
+ access: [],
206
138
  }).output(
207
139
  z.array(
208
140
  z.object({
209
- category: z.string(),
210
- events: z.array(IntegrationEventInfoSchema),
211
- })
212
- )
213
- ),
214
-
215
- /** Get payload schema for a specific event with flattened property list for template hints */
216
- getEventPayloadSchema: proc({
217
- operationType: "query",
218
- userType: "authenticated",
219
- access: [integrationAccess.manage],
220
- })
221
- .input(z.object({ eventId: z.string() }))
222
- .output(EventPayloadSchemaOutputSchema),
223
-
224
- // ==========================================================================
225
- // DELIVERY LOGS (Admin only)
226
- // ==========================================================================
227
-
228
- /** Get delivery logs with filtering */
229
- getDeliveryLogs: proc({
230
- operationType: "query",
231
- userType: "authenticated",
232
- access: [integrationAccess.manage],
233
- })
234
- .input(DeliveryLogQueryInputSchema)
235
- .output(PaginatedResult(DeliveryLogSchema)),
236
-
237
- /** Get a single delivery log entry */
238
- getDeliveryLog: proc({
239
- operationType: "query",
240
- userType: "authenticated",
241
- access: [integrationAccess.manage],
242
- })
243
- .input(z.object({ id: z.string() }))
244
- .output(DeliveryLogSchema),
245
-
246
- /** Retry a failed delivery */
247
- retryDelivery: proc({
248
- operationType: "mutation",
249
- userType: "authenticated",
250
- access: [integrationAccess.manage],
251
- })
252
- .input(z.object({ logId: z.string() }))
253
- .output(z.object({ success: z.boolean(), message: z.string().optional() })),
254
-
255
- /** Get delivery statistics for dashboard */
256
- getDeliveryStats: proc({
257
- operationType: "query",
258
- userType: "authenticated",
259
- access: [integrationAccess.manage],
260
- })
261
- .input(
262
- z.object({
263
- /** Time range in hours (default: 24) */
264
- hours: z.number().min(1).max(720).default(24),
265
- })
266
- )
267
- .output(
268
- z.object({
269
- total: z.number(),
270
- successful: z.number(),
271
- failed: z.number(),
272
- retrying: z.number(),
273
- pending: z.number(),
274
- byEvent: z.array(
275
- z.object({
276
- eventType: z.string(),
277
- count: z.number(),
278
- })
279
- ),
280
- byProvider: z.array(
281
- z.object({
282
- providerId: z.string(),
283
- count: z.number(),
284
- })
285
- ),
286
- })
141
+ id: z.string(),
142
+ name: z.string(),
143
+ description: z.string().optional(),
144
+ providerId: z.string(),
145
+ providerConfig: z.record(z.string(), z.unknown()),
146
+ eventId: z.string(),
147
+ systemFilter: z.array(z.string()).optional(),
148
+ enabled: z.boolean(),
149
+ }),
287
150
  ),
151
+ ),
288
152
  };
289
153
 
290
- // Export contract type
291
154
  export type IntegrationContract = typeof integrationContract;
292
155
 
293
- // Export client definition for type-safe forPlugin usage
294
- // Use: const client = rpcApi.forPlugin(IntegrationApi);
295
156
  export const IntegrationApi = createClientDefinition(
296
157
  integrationContract,
297
- pluginMetadata
158
+ pluginMetadata,
298
159
  );