@checkstack/announcement-common 0.3.2 → 0.4.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/announcement-common
2
2
 
3
+ ## 0.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [f23f3c9]
8
+ - Updated dependencies [f23f3c9]
9
+ - @checkstack/common@0.11.0
10
+ - @checkstack/signal-common@0.2.4
11
+
12
+ ## 0.4.0
13
+
14
+ ### Minor Changes
15
+
16
+ - 9016526: Add a `/rest/:pluginId/*` HTTP mount that serves every plugin's oRPC contract
17
+ through the REST/OpenAPI shape described by `/api/openapi.json`. Queries are
18
+ `GET` with query parameters, mutations are `POST` with the input as the raw
19
+ JSON body. The existing `/api/:pluginId/*` mount continues to serve oRPC's
20
+ native wire protocol unchanged, so existing clients are not affected.
21
+
22
+ The OpenAPI spec at `/api/openapi.json` now reflects the real mount: every
23
+ `paths` entry is prefixed with `/rest` instead of `/api`.
24
+
25
+ Also fixes a SPA-fallback bug: the backend's `/api-docs` route previously
26
+ returned 404 on production deployments because the static-file middleware
27
+ skipped any path starting with `/api`, capturing `/api-docs` along with real
28
+ API routes. The skip now requires a trailing slash (`/api/`, `/rest/`).
29
+
30
+ Required access rules are now visible in the API Docs UI. The OpenAPI spec
31
+ generator was reading a non-existent `accessRules` field on procedure
32
+ metadata; the real field is `access: AccessRule[]`. Each procedure's access
33
+ rules are now flattened to fully-qualified IDs (e.g. `catalog.system.read`)
34
+ and emitted under `x-orpc-meta.accessRules`, which the existing
35
+ `Required Access Rules` section in the docs UI already knew how to render.
36
+
37
+ The API Docs schema renderer now handles record types (zod `z.record`),
38
+ `$ref`s into `components.schemas`, `oneOf`/`anyOf`/`allOf`, nullable union
39
+ types (`type: ["string", "null"]`), and `format` qualifiers. Previously
40
+ record outputs like `{ statuses: object }` masked the actual value type;
41
+ they now render as `{ [key]: <ResolvedType> { ... } }` with the inner
42
+ schema expanded, capped at 12 levels with cycle detection.
43
+
44
+ **REST method conventions.** `proc()` now defaults to `GET` for queries and
45
+ `POST` for mutations on the `/rest` mount, using bracket-notation query
46
+ params (`?filter[status]=active&ids[0]=a`) for GET inputs. Existing
47
+ procedures were updated to follow REST semantics:
48
+
49
+ - `update*` mutations → `PATCH`
50
+ - `delete*` / `remove*` mutations → `DELETE`
51
+ - `getBulk*` queries and any query taking a large array input → `POST`
52
+ (because `@orpc/openapi@1.13.x` has no GET→POST URL-length fallback)
53
+
54
+ GET endpoints require an `object` input — bare scalars like
55
+ `.input(z.string())` are not valid on GET. `getSystemConfigurations` was
56
+ refactored from `.input(z.string())` to `.input(z.object({ systemId: ... }))`
57
+ to fit the GET shape; the only call-site update was the in-process router
58
+ unpacking `input.systemId` instead of passing `input` directly.
59
+
60
+ The API Docs UI now renders query parameters (path/query/header/cookie) in a
61
+ dedicated table for GET endpoints, and the fetch example shows them in the
62
+ URL with `<required>` / `<optional>` placeholders.
63
+
64
+ ### Patch Changes
65
+
66
+ - Updated dependencies [9016526]
67
+ - @checkstack/common@0.10.0
68
+ - @checkstack/signal-common@0.2.3
69
+
3
70
  ## 0.3.2
4
71
 
5
72
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/announcement-common",
3
- "version": "0.3.2",
3
+ "version": "0.4.1",
4
4
  "license": "Elastic-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -9,15 +9,15 @@
9
9
  }
10
10
  },
11
11
  "dependencies": {
12
- "@checkstack/common": "0.8.0",
13
- "@checkstack/signal-common": "0.2.1",
12
+ "@checkstack/common": "0.10.0",
13
+ "@checkstack/signal-common": "0.2.3",
14
14
  "@orpc/contract": "^1.13.14",
15
15
  "zod": "^4.2.1"
16
16
  },
17
17
  "devDependencies": {
18
18
  "typescript": "^5.7.2",
19
19
  "@checkstack/tsconfig": "0.0.7",
20
- "@checkstack/scripts": "0.3.0"
20
+ "@checkstack/scripts": "0.3.2"
21
21
  },
22
22
  "scripts": {
23
23
  "typecheck": "tsgo -b",
@@ -75,6 +75,7 @@ export const announcementContract = {
75
75
  userType: "authenticated",
76
76
  access: [announcementAccess.manage],
77
77
  })
78
+ .route({ method: "PATCH" })
78
79
  .input(UpdateAnnouncementInputSchema)
79
80
  .output(AnnouncementSchema),
80
81
 
@@ -84,6 +85,7 @@ export const announcementContract = {
84
85
  userType: "authenticated",
85
86
  access: [announcementAccess.manage],
86
87
  })
88
+ .route({ method: "DELETE" })
87
89
  .input(z.object({ id: z.string() }))
88
90
  .output(z.object({ success: z.boolean() })),
89
91
  };