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