@checkstack/backend 0.10.0 → 0.10.2
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,90 @@
|
|
|
1
1
|
# @checkstack/backend
|
|
2
2
|
|
|
3
|
+
## 0.10.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a06b899: Dead-code audit cleanup and a small platform of shared notification helpers.
|
|
8
|
+
|
|
9
|
+
**Removed (dead code)**
|
|
10
|
+
|
|
11
|
+
- `core/backend/src/plugin-manager/deregistration-guard.ts` deleted. The exported `assertCanDeregister()` was never called and was a less-complete version of the dependents+isUninstallable checks already done inline by `previewUninstallOriginator` / `uninstallOriginator` in `plugin-manager-orchestrator.ts`.
|
|
12
|
+
- `createMockQueueFactory` deprecated alias removed from `@checkstack/test-utils-backend`. Use `createMockQueueManager` directly.
|
|
13
|
+
|
|
14
|
+
**New shared helpers**
|
|
15
|
+
|
|
16
|
+
- `@checkstack/backend-api` now exports `requestTimeoutMs()` — a Zod field builder for outbound HTTP request timeouts (1s..60s, default 10s). Replaces hand-rolled `configNumber({}).min(1000).max(60_000).default(10_000)` in `integration-webhook-backend`, `integration-script-backend`, and `healthcheck-script-backend`'s inline collector.
|
|
17
|
+
- `@checkstack/notification-common` now exports `SubjectStatusSchema` / `SubjectStatus`, mirroring the existing `ImportanceSchema`.
|
|
18
|
+
- `@checkstack/notification-backend` now exports:
|
|
19
|
+
- `SUBJECT_STATUS_EMOJI` / `IMPORTANCE_EMOJI` — the shared status / importance emoji maps that Discord, Slack, Teams, Webex and Telegram previously each redefined inline.
|
|
20
|
+
- `postJson(opts)` — a timeout-bounded `fetch` wrapper that handles non-2xx logging and error mapping for webhook-style POSTs. Returns `{ ok: true, response } | { ok: false, error }`.
|
|
21
|
+
|
|
22
|
+
**Migrated to shared helpers**
|
|
23
|
+
|
|
24
|
+
- Discord, Slack, Gotify, Pushover notification backends now use `postJson`. Outer try/catch + per-plugin error mapping deleted (~140 LOC).
|
|
25
|
+
- Discord, Slack, Teams, Telegram, Webex notification backends now use `IMPORTANCE_EMOJI`. Discord, Slack, Teams use `SUBJECT_STATUS_EMOJI`.
|
|
26
|
+
- Teams, Webex, Backstage, Telegram kept their inline fetch/Bot logic: their error strings surface server response bodies to operators, or the transport isn't raw `fetch` (Telegram uses `grammy`'s `Bot`).
|
|
27
|
+
|
|
28
|
+
**API surface tightening**
|
|
29
|
+
|
|
30
|
+
- Per-plugin test-only re-exports in 6 notification backends (Pushover, Gotify, Backstage, Slack, Discord, Teams) and the `CertificateInfo` interface in `healthcheck-tls-backend/strategy.ts` are now JSDoc-tagged `@internal`. No behaviour change; signals that downstream consumers must not depend on them.
|
|
31
|
+
|
|
32
|
+
- Updated dependencies [a06b899]
|
|
33
|
+
- Updated dependencies [a06b899]
|
|
34
|
+
- @checkstack/backend-api@0.16.0
|
|
35
|
+
- @checkstack/cache-api@0.3.3
|
|
36
|
+
- @checkstack/queue-api@0.3.3
|
|
37
|
+
- @checkstack/signal-backend@0.2.7
|
|
38
|
+
|
|
39
|
+
## 0.10.1
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- 1909a61: Address open CodeQL code-scanning findings:
|
|
44
|
+
|
|
45
|
+
- **`@checkstack/ui` (`LinksEditor`)**: validate URL scheme on render and on
|
|
46
|
+
add; only `http:` / `https:` URLs are accepted, defeating stored XSS via
|
|
47
|
+
`javascript:` / `data:` schemes in user-supplied hotlinks
|
|
48
|
+
(`js/xss-through-dom`).
|
|
49
|
+
- **`@checkstack/backend-api` (`markdownToPlainText`)**: decode HTML entities
|
|
50
|
+
before stripping tags, then strip tags in a loop until the output
|
|
51
|
+
stabilizes. Decoding `&` last avoids reintroducing tag delimiters
|
|
52
|
+
via `<` round-trips (`js/double-escaping`,
|
|
53
|
+
`js/incomplete-multi-character-sanitization`).
|
|
54
|
+
- **`@checkstack/backend` (`createScopedWsRegistry`)**: drop the
|
|
55
|
+
identity-replacement on the path suffix; the leading-slash invariant
|
|
56
|
+
is documented on `WebSocketRouteRegistry` (`js/identity-replacement`).
|
|
57
|
+
|
|
58
|
+
- b33fb4d: Refresh `bun.lock` to clear MEDIUM-severity Trivy advisories on transitive
|
|
59
|
+
runtime dependencies. No public API change — bumping every workspace
|
|
60
|
+
package that lists `@orpc/server` as a direct dep so consumers re-resolve
|
|
61
|
+
the optional `ws` peer to the patched release on their next install.
|
|
62
|
+
|
|
63
|
+
- `ws` `8.20.0` → `8.20.1` (CVE-2026-45736). Pulled into the install tree
|
|
64
|
+
as `@orpc/server`'s optional WebSocket peer; Bun auto-installs it into
|
|
65
|
+
every backend package that depends on `@orpc/server`, so a stale 8.20.0
|
|
66
|
+
ships in the consumer's `node_modules` until the parent package
|
|
67
|
+
re-resolves.
|
|
68
|
+
- `brace-expansion` `5.0.5` → `5.0.6` (CVE-2026-45149). Pulled in only
|
|
69
|
+
through dev tooling (`minimatch@10` via `@typescript-eslint` and
|
|
70
|
+
`storybook`'s `glob@13`), so it does not ship to consumers and no
|
|
71
|
+
workspace `package.json` lists it; the lockfile bump alone clears the
|
|
72
|
+
finding for the Docker image and the local dev tree. No version bump
|
|
73
|
+
is attributed to this advisory.
|
|
74
|
+
|
|
75
|
+
The fix lives entirely in `bun.lock` — no `package.json`, `overrides`, or
|
|
76
|
+
`resolutions` change is needed because both parent ranges (`minimatch@10
|
|
77
|
+
→ brace-expansion@^5.0.5`, `@orpc/server / storybook / happy-dom →
|
|
78
|
+
ws@>=8.18.x`) already accept the patched releases, and `bun install`
|
|
79
|
+
keeps the resolved versions sticky after the initial `bun update`.
|
|
80
|
+
|
|
81
|
+
- Updated dependencies [1909a61]
|
|
82
|
+
- Updated dependencies [b33fb4d]
|
|
83
|
+
- @checkstack/backend-api@0.15.3
|
|
84
|
+
- @checkstack/cache-api@0.3.2
|
|
85
|
+
- @checkstack/queue-api@0.3.2
|
|
86
|
+
- @checkstack/signal-backend@0.2.6
|
|
87
|
+
|
|
3
88
|
## 0.10.0
|
|
4
89
|
|
|
5
90
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkstack/backend",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"license": "Elastic-2.0",
|
|
5
5
|
"checkstack": {
|
|
6
6
|
"type": "backend"
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
"lint:code": "eslint . --max-warnings 0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@checkstack/api-docs-common": "0.1.
|
|
18
|
-
"@checkstack/auth-common": "0.
|
|
19
|
-
"@checkstack/backend-api": "0.15.
|
|
20
|
-
"@checkstack/common": "0.
|
|
17
|
+
"@checkstack/api-docs-common": "0.1.13",
|
|
18
|
+
"@checkstack/auth-common": "0.7.0",
|
|
19
|
+
"@checkstack/backend-api": "0.15.3",
|
|
20
|
+
"@checkstack/common": "0.10.0",
|
|
21
21
|
"@checkstack/drizzle-helper": "0.0.5",
|
|
22
|
-
"@checkstack/cache-api": "0.3.
|
|
23
|
-
"@checkstack/queue-api": "0.3.
|
|
24
|
-
"@checkstack/signal-backend": "0.2.
|
|
25
|
-
"@checkstack/signal-common": "0.2.
|
|
26
|
-
"@checkstack/pluginmanager-common": "0.2.
|
|
22
|
+
"@checkstack/cache-api": "0.3.2",
|
|
23
|
+
"@checkstack/queue-api": "0.3.2",
|
|
24
|
+
"@checkstack/signal-backend": "0.2.6",
|
|
25
|
+
"@checkstack/signal-common": "0.2.3",
|
|
26
|
+
"@checkstack/pluginmanager-common": "0.2.2",
|
|
27
27
|
"@hono/zod-validator": "^0.7.6",
|
|
28
28
|
"@orpc/client": "^1.13.14",
|
|
29
29
|
"@orpc/contract": "^1.13.14",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"@types/bun": "latest",
|
|
46
46
|
"@types/semver": "^7.5.0",
|
|
47
47
|
"@checkstack/tsconfig": "0.0.7",
|
|
48
|
-
"@checkstack/scripts": "0.3.
|
|
49
|
-
"@checkstack/test-utils-backend": "0.1.
|
|
48
|
+
"@checkstack/scripts": "0.3.2",
|
|
49
|
+
"@checkstack/test-utils-backend": "0.1.27",
|
|
50
50
|
"drizzle-kit": "^0.31.10"
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -37,8 +37,9 @@ export function createScopedWsRegistry(
|
|
|
37
37
|
): WebSocketRouteRegistry {
|
|
38
38
|
return {
|
|
39
39
|
register(path: string, handler: WebSocketRouteHandler): void {
|
|
40
|
-
// Normalize: "/" maps to just the pluginId, "/foo" maps to "pluginId/foo"
|
|
41
|
-
|
|
40
|
+
// Normalize: "/" maps to just the pluginId, "/foo" maps to "pluginId/foo".
|
|
41
|
+
// Paths are documented to start with `/` (see WebSocketRouteRegistry).
|
|
42
|
+
const suffix = path === "/" ? "" : path;
|
|
42
43
|
const fullPath = `${pluginId}${suffix}`;
|
|
43
44
|
store.registerHandler(fullPath, handler);
|
|
44
45
|
},
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { eq } from "drizzle-orm";
|
|
2
|
-
import { SafeDatabase } from "@checkstack/backend-api";
|
|
3
|
-
import { ORPCError } from "@orpc/server";
|
|
4
|
-
import { plugins } from "../schema";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Validates that a plugin can be deregistered.
|
|
8
|
-
* throws ORPCError if the plugin is not uninstallable or has dependents.
|
|
9
|
-
*/
|
|
10
|
-
export async function assertCanDeregister({
|
|
11
|
-
pluginId,
|
|
12
|
-
db,
|
|
13
|
-
}: {
|
|
14
|
-
pluginId: string;
|
|
15
|
-
db: SafeDatabase<Record<string, unknown>>;
|
|
16
|
-
}): Promise<void> {
|
|
17
|
-
// 1. Check if plugin exists
|
|
18
|
-
const pluginRows = await db
|
|
19
|
-
.select()
|
|
20
|
-
.from(plugins)
|
|
21
|
-
.where(eq(plugins.name, pluginId));
|
|
22
|
-
|
|
23
|
-
if (pluginRows.length === 0) {
|
|
24
|
-
throw new ORPCError("NOT_FOUND", {
|
|
25
|
-
message: `Plugin "${pluginId}" not found`,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const plugin = pluginRows[0];
|
|
30
|
-
|
|
31
|
-
// 2. Check isUninstallable flag
|
|
32
|
-
if (!plugin.isUninstallable) {
|
|
33
|
-
throw new ORPCError("FORBIDDEN", {
|
|
34
|
-
message: `Plugin "${pluginId}" is a core platform component and cannot be uninstalled`,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// 3. TODO: Check for dependent plugins (consumers of this plugin's services)
|
|
39
|
-
// This would require tracking service dependencies at runtime
|
|
40
|
-
// For now, we skip this check and let the deregistration proceed
|
|
41
|
-
}
|