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