@checkstack/catalog-common 2.1.0 → 2.2.1

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,72 @@
1
1
  # @checkstack/catalog-common
2
2
 
3
+ ## 2.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [a06b899]
8
+ - @checkstack/notification-common@1.1.1
9
+
10
+ ## 2.2.0
11
+
12
+ ### Minor Changes
13
+
14
+ - 9016526: Add a `/rest/:pluginId/*` HTTP mount that serves every plugin's oRPC contract
15
+ through the REST/OpenAPI shape described by `/api/openapi.json`. Queries are
16
+ `GET` with query parameters, mutations are `POST` with the input as the raw
17
+ JSON body. The existing `/api/:pluginId/*` mount continues to serve oRPC's
18
+ native wire protocol unchanged, so existing clients are not affected.
19
+
20
+ The OpenAPI spec at `/api/openapi.json` now reflects the real mount: every
21
+ `paths` entry is prefixed with `/rest` instead of `/api`.
22
+
23
+ Also fixes a SPA-fallback bug: the backend's `/api-docs` route previously
24
+ returned 404 on production deployments because the static-file middleware
25
+ skipped any path starting with `/api`, capturing `/api-docs` along with real
26
+ API routes. The skip now requires a trailing slash (`/api/`, `/rest/`).
27
+
28
+ Required access rules are now visible in the API Docs UI. The OpenAPI spec
29
+ generator was reading a non-existent `accessRules` field on procedure
30
+ metadata; the real field is `access: AccessRule[]`. Each procedure's access
31
+ rules are now flattened to fully-qualified IDs (e.g. `catalog.system.read`)
32
+ and emitted under `x-orpc-meta.accessRules`, which the existing
33
+ `Required Access Rules` section in the docs UI already knew how to render.
34
+
35
+ The API Docs schema renderer now handles record types (zod `z.record`),
36
+ `$ref`s into `components.schemas`, `oneOf`/`anyOf`/`allOf`, nullable union
37
+ types (`type: ["string", "null"]`), and `format` qualifiers. Previously
38
+ record outputs like `{ statuses: object }` masked the actual value type;
39
+ they now render as `{ [key]: <ResolvedType> { ... } }` with the inner
40
+ schema expanded, capped at 12 levels with cycle detection.
41
+
42
+ **REST method conventions.** `proc()` now defaults to `GET` for queries and
43
+ `POST` for mutations on the `/rest` mount, using bracket-notation query
44
+ params (`?filter[status]=active&ids[0]=a`) for GET inputs. Existing
45
+ procedures were updated to follow REST semantics:
46
+
47
+ - `update*` mutations → `PATCH`
48
+ - `delete*` / `remove*` mutations → `DELETE`
49
+ - `getBulk*` queries and any query taking a large array input → `POST`
50
+ (because `@orpc/openapi@1.13.x` has no GET→POST URL-length fallback)
51
+
52
+ GET endpoints require an `object` input — bare scalars like
53
+ `.input(z.string())` are not valid on GET. `getSystemConfigurations` was
54
+ refactored from `.input(z.string())` to `.input(z.object({ systemId: ... }))`
55
+ to fit the GET shape; the only call-site update was the in-process router
56
+ unpacking `input.systemId` instead of passing `input` directly.
57
+
58
+ The API Docs UI now renders query parameters (path/query/header/cookie) in a
59
+ dedicated table for GET endpoints, and the fetch example shows them in the
60
+ URL with `<required>` / `<optional>` placeholders.
61
+
62
+ ### Patch Changes
63
+
64
+ - Updated dependencies [9016526]
65
+ - @checkstack/common@0.10.0
66
+ - @checkstack/auth-common@0.7.0
67
+ - @checkstack/notification-common@1.1.0
68
+ - @checkstack/frontend-api@0.5.1
69
+
3
70
  ## 2.1.0
4
71
 
5
72
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/catalog-common",
3
- "version": "2.1.0",
3
+ "version": "2.2.1",
4
4
  "license": "Elastic-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -9,17 +9,17 @@
9
9
  }
10
10
  },
11
11
  "dependencies": {
12
- "@checkstack/common": "0.8.0",
13
- "@checkstack/auth-common": "0.6.5",
14
- "@checkstack/frontend-api": "0.4.2",
15
- "@checkstack/notification-common": "1.0.1",
12
+ "@checkstack/common": "0.10.0",
13
+ "@checkstack/auth-common": "0.7.0",
14
+ "@checkstack/frontend-api": "0.5.1",
15
+ "@checkstack/notification-common": "1.1.0",
16
16
  "@orpc/contract": "^1.13.14",
17
17
  "zod": "^4.2.1"
18
18
  },
19
19
  "devDependencies": {
20
20
  "typescript": "^5.7.2",
21
21
  "@checkstack/tsconfig": "0.0.7",
22
- "@checkstack/scripts": "0.3.0"
22
+ "@checkstack/scripts": "0.3.2"
23
23
  },
24
24
  "scripts": {
25
25
  "typecheck": "tsgo -b",
@@ -116,6 +116,7 @@ export const catalogContract = {
116
116
  userType: "authenticated",
117
117
  access: [catalogAccess.system.manage],
118
118
  })
119
+ .route({ method: "PATCH" })
119
120
  .input(UpdateSystemInputSchema)
120
121
  .output(SystemSchema),
121
122
 
@@ -124,6 +125,7 @@ export const catalogContract = {
124
125
  userType: "authenticated",
125
126
  access: [catalogAccess.system.manage],
126
127
  })
128
+ .route({ method: "DELETE" })
127
129
  .input(z.string())
128
130
  .output(z.object({ success: z.boolean() })),
129
131
 
@@ -162,6 +164,7 @@ export const catalogContract = {
162
164
  userType: "authenticated",
163
165
  access: [catalogAccess.system.manage],
164
166
  })
167
+ .route({ method: "DELETE" })
165
168
  .input(z.string())
166
169
  .output(z.object({ success: z.boolean() })),
167
170
 
@@ -199,6 +202,7 @@ export const catalogContract = {
199
202
  userType: "authenticated",
200
203
  access: [catalogAccess.system.manage],
201
204
  })
205
+ .route({ method: "DELETE" })
202
206
  .input(z.string())
203
207
  .output(z.object({ success: z.boolean() })),
204
208
 
@@ -219,6 +223,7 @@ export const catalogContract = {
219
223
  userType: "authenticated",
220
224
  access: [catalogAccess.group.manage],
221
225
  })
226
+ .route({ method: "PATCH" })
222
227
  .input(UpdateGroupInputSchema)
223
228
  .output(GroupSchema),
224
229
 
@@ -227,6 +232,7 @@ export const catalogContract = {
227
232
  userType: "authenticated",
228
233
  access: [catalogAccess.group.manage],
229
234
  })
235
+ .route({ method: "DELETE" })
230
236
  .input(z.string())
231
237
  .output(z.object({ success: z.boolean() })),
232
238
 
@@ -252,6 +258,7 @@ export const catalogContract = {
252
258
  userType: "authenticated",
253
259
  access: [catalogAccess.system.manage],
254
260
  })
261
+ .route({ method: "DELETE" })
255
262
  .input(
256
263
  z.object({
257
264
  groupId: z.string(),