@checkstack/backend 0.10.1 → 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,41 @@
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
+
3
39
  ## 0.10.1
4
40
 
5
41
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/backend",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "license": "Elastic-2.0",
5
5
  "checkstack": {
6
6
  "type": "backend"
@@ -16,12 +16,12 @@
16
16
  "dependencies": {
17
17
  "@checkstack/api-docs-common": "0.1.13",
18
18
  "@checkstack/auth-common": "0.7.0",
19
- "@checkstack/backend-api": "0.15.2",
19
+ "@checkstack/backend-api": "0.15.3",
20
20
  "@checkstack/common": "0.10.0",
21
21
  "@checkstack/drizzle-helper": "0.0.5",
22
- "@checkstack/cache-api": "0.3.1",
23
- "@checkstack/queue-api": "0.3.1",
24
- "@checkstack/signal-backend": "0.2.5",
22
+ "@checkstack/cache-api": "0.3.2",
23
+ "@checkstack/queue-api": "0.3.2",
24
+ "@checkstack/signal-backend": "0.2.6",
25
25
  "@checkstack/signal-common": "0.2.3",
26
26
  "@checkstack/pluginmanager-common": "0.2.2",
27
27
  "@hono/zod-validator": "^0.7.6",
@@ -46,7 +46,7 @@
46
46
  "@types/semver": "^7.5.0",
47
47
  "@checkstack/tsconfig": "0.0.7",
48
48
  "@checkstack/scripts": "0.3.2",
49
- "@checkstack/test-utils-backend": "0.1.26",
49
+ "@checkstack/test-utils-backend": "0.1.27",
50
50
  "drizzle-kit": "^0.31.10"
51
51
  }
52
52
  }
@@ -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
- }