@checkstack/healthcheck-common 1.0.1 → 1.1.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 +71 -0
- package/package.json +7 -7
- package/src/rpc-contract.ts +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,76 @@
|
|
|
1
1
|
# @checkstack/healthcheck-common
|
|
2
2
|
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9016526: Add a `/rest/:pluginId/*` HTTP mount that serves every plugin's oRPC contract
|
|
8
|
+
through the REST/OpenAPI shape described by `/api/openapi.json`. Queries are
|
|
9
|
+
`GET` with query parameters, mutations are `POST` with the input as the raw
|
|
10
|
+
JSON body. The existing `/api/:pluginId/*` mount continues to serve oRPC's
|
|
11
|
+
native wire protocol unchanged, so existing clients are not affected.
|
|
12
|
+
|
|
13
|
+
The OpenAPI spec at `/api/openapi.json` now reflects the real mount: every
|
|
14
|
+
`paths` entry is prefixed with `/rest` instead of `/api`.
|
|
15
|
+
|
|
16
|
+
Also fixes a SPA-fallback bug: the backend's `/api-docs` route previously
|
|
17
|
+
returned 404 on production deployments because the static-file middleware
|
|
18
|
+
skipped any path starting with `/api`, capturing `/api-docs` along with real
|
|
19
|
+
API routes. The skip now requires a trailing slash (`/api/`, `/rest/`).
|
|
20
|
+
|
|
21
|
+
Required access rules are now visible in the API Docs UI. The OpenAPI spec
|
|
22
|
+
generator was reading a non-existent `accessRules` field on procedure
|
|
23
|
+
metadata; the real field is `access: AccessRule[]`. Each procedure's access
|
|
24
|
+
rules are now flattened to fully-qualified IDs (e.g. `catalog.system.read`)
|
|
25
|
+
and emitted under `x-orpc-meta.accessRules`, which the existing
|
|
26
|
+
`Required Access Rules` section in the docs UI already knew how to render.
|
|
27
|
+
|
|
28
|
+
The API Docs schema renderer now handles record types (zod `z.record`),
|
|
29
|
+
`$ref`s into `components.schemas`, `oneOf`/`anyOf`/`allOf`, nullable union
|
|
30
|
+
types (`type: ["string", "null"]`), and `format` qualifiers. Previously
|
|
31
|
+
record outputs like `{ statuses: object }` masked the actual value type;
|
|
32
|
+
they now render as `{ [key]: <ResolvedType> { ... } }` with the inner
|
|
33
|
+
schema expanded, capped at 12 levels with cycle detection.
|
|
34
|
+
|
|
35
|
+
**REST method conventions.** `proc()` now defaults to `GET` for queries and
|
|
36
|
+
`POST` for mutations on the `/rest` mount, using bracket-notation query
|
|
37
|
+
params (`?filter[status]=active&ids[0]=a`) for GET inputs. Existing
|
|
38
|
+
procedures were updated to follow REST semantics:
|
|
39
|
+
|
|
40
|
+
- `update*` mutations → `PATCH`
|
|
41
|
+
- `delete*` / `remove*` mutations → `DELETE`
|
|
42
|
+
- `getBulk*` queries and any query taking a large array input → `POST`
|
|
43
|
+
(because `@orpc/openapi@1.13.x` has no GET→POST URL-length fallback)
|
|
44
|
+
|
|
45
|
+
GET endpoints require an `object` input — bare scalars like
|
|
46
|
+
`.input(z.string())` are not valid on GET. `getSystemConfigurations` was
|
|
47
|
+
refactored from `.input(z.string())` to `.input(z.object({ systemId: ... }))`
|
|
48
|
+
to fit the GET shape; the only call-site update was the in-process router
|
|
49
|
+
unpacking `input.systemId` instead of passing `input` directly.
|
|
50
|
+
|
|
51
|
+
The API Docs UI now renders query parameters (path/query/header/cookie) in a
|
|
52
|
+
dedicated table for GET endpoints, and the fetch example shows them in the
|
|
53
|
+
URL with `<required>` / `<optional>` placeholders.
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- Updated dependencies [9016526]
|
|
58
|
+
- @checkstack/common@0.10.0
|
|
59
|
+
- @checkstack/catalog-common@2.2.0
|
|
60
|
+
- @checkstack/notification-common@1.1.0
|
|
61
|
+
- @checkstack/signal-common@0.2.3
|
|
62
|
+
|
|
63
|
+
## 1.0.2
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- Updated dependencies [42abfff]
|
|
68
|
+
- Updated dependencies [1ef2e79]
|
|
69
|
+
- @checkstack/common@0.9.0
|
|
70
|
+
- @checkstack/catalog-common@2.1.0
|
|
71
|
+
- @checkstack/notification-common@1.0.2
|
|
72
|
+
- @checkstack/signal-common@0.2.2
|
|
73
|
+
|
|
3
74
|
## 1.0.1
|
|
4
75
|
|
|
5
76
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkstack/healthcheck-common",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
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.
|
|
13
|
-
"@checkstack/catalog-common": "2.
|
|
14
|
-
"@checkstack/notification-common": "1.0.
|
|
15
|
-
"@checkstack/signal-common": "0.2.
|
|
12
|
+
"@checkstack/common": "0.9.0",
|
|
13
|
+
"@checkstack/catalog-common": "2.1.0",
|
|
14
|
+
"@checkstack/notification-common": "1.0.2",
|
|
15
|
+
"@checkstack/signal-common": "0.2.2",
|
|
16
16
|
"zod": "^4.2.1"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"typescript": "^5.7.2",
|
|
20
|
-
"@checkstack/tsconfig": "0.0.
|
|
21
|
-
"@checkstack/scripts": "0.1
|
|
20
|
+
"@checkstack/tsconfig": "0.0.7",
|
|
21
|
+
"@checkstack/scripts": "0.3.1"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"typecheck": "tsgo -b",
|
package/src/rpc-contract.ts
CHANGED
|
@@ -92,6 +92,7 @@ export const healthCheckContract = {
|
|
|
92
92
|
userType: "authenticated",
|
|
93
93
|
access: [healthCheckAccess.configuration.manage],
|
|
94
94
|
})
|
|
95
|
+
.route({ method: "PATCH" })
|
|
95
96
|
.input(
|
|
96
97
|
z.object({
|
|
97
98
|
id: z.string(),
|
|
@@ -105,6 +106,7 @@ export const healthCheckContract = {
|
|
|
105
106
|
userType: "authenticated",
|
|
106
107
|
access: [healthCheckAccess.configuration.manage],
|
|
107
108
|
})
|
|
109
|
+
.route({ method: "DELETE" })
|
|
108
110
|
.input(z.string())
|
|
109
111
|
.output(z.void()),
|
|
110
112
|
|
|
@@ -133,7 +135,7 @@ export const healthCheckContract = {
|
|
|
133
135
|
userType: "authenticated",
|
|
134
136
|
access: [healthCheckAccess.configuration.read],
|
|
135
137
|
})
|
|
136
|
-
.input(z.string())
|
|
138
|
+
.input(z.object({ systemId: z.string() }))
|
|
137
139
|
.output(z.array(HealthCheckConfigurationSchema)),
|
|
138
140
|
|
|
139
141
|
getSystemAssociations: proc({
|
|
@@ -209,6 +211,7 @@ export const healthCheckContract = {
|
|
|
209
211
|
userType: "authenticated",
|
|
210
212
|
access: [healthCheckAccess.configuration.manage],
|
|
211
213
|
})
|
|
214
|
+
.route({ method: "PATCH" })
|
|
212
215
|
.input(
|
|
213
216
|
z.object({
|
|
214
217
|
systemId: z.string(),
|
|
@@ -346,6 +349,7 @@ export const healthCheckContract = {
|
|
|
346
349
|
access: [healthCheckAccess.status],
|
|
347
350
|
instanceAccess: { recordKey: "statuses" },
|
|
348
351
|
})
|
|
352
|
+
.route({ method: "POST" })
|
|
349
353
|
.input(z.object({ systemIds: z.array(z.string()) }))
|
|
350
354
|
.output(
|
|
351
355
|
z.object({
|