@checkstack/catalog-common 2.0.0 → 2.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 CHANGED
@@ -1,5 +1,153 @@
1
1
  # @checkstack/catalog-common
2
2
 
3
+ ## 2.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 1ef2e79: feat: hotlinks on incidents/maintenances and additional links on systems
8
+
9
+ Users with `manage` access on an incident, maintenance, or system can now
10
+ attach free-form URL "hotlinks" — Jira tickets, runbooks, dashboards, ticket
11
+ tools, etc. — alongside the existing fields.
12
+
13
+ - **Incidents** & **maintenances**: links live on the entity itself and are
14
+ surfaced both in the editor dialog and on the public detail page. Two new
15
+ RPC procedures per plugin (`addLink`, `removeLink`) gated behind the
16
+ existing `manage` access rule. Links are returned as part of
17
+ `getIncident` / `getMaintenance` and cache-invalidated on every link
18
+ mutation.
19
+ - **Systems**: a parallel `system_links` table with `getSystemLinks`,
20
+ `addSystemLink`, `removeSystemLink` procedures. Surfaced inside the
21
+ system editor (next to contacts) and on the read-only system detail
22
+ sidebar. Cache-scoped per-system so list endpoints remain hot.
23
+ - **Shared UI**: a `LinksEditor` component in `@checkstack/ui` does the
24
+ presentation; the three plugins each own their own RPC wiring.
25
+
26
+ Database changes ship as additive migrations (new `incident_links`,
27
+ `maintenance_links`, `system_links` tables, all FK-cascaded on parent
28
+ delete). No existing columns or rows are touched.
29
+
30
+ The system incident and maintenance history pages now sort by relevance:
31
+ active entries (non-`resolved` incidents, `scheduled` or `in_progress`
32
+ maintenances) appear at the top, with creation date descending as the
33
+ tiebreaker.
34
+
35
+ ### Patch Changes
36
+
37
+ - Updated dependencies [42abfff]
38
+ - Updated dependencies [aa89bc5]
39
+ - Updated dependencies [950d6ec]
40
+ - @checkstack/common@0.9.0
41
+ - @checkstack/frontend-api@0.5.0
42
+ - @checkstack/auth-common@0.6.6
43
+ - @checkstack/notification-common@1.0.2
44
+
45
+ ## 2.0.1
46
+
47
+ ### Patch Changes
48
+
49
+ - 50e5f5f: Runtime plugin system: install + uninstall plugins from npm, GitHub releases
50
+ (including private GitHub Enterprise instances), or tarball uploads at
51
+ runtime, with multi-package bundles, dependency-derived compatibility checks,
52
+ multi-instance coordination via a Postgres artifact store, and
53
+ single-coordinator destructive cleanup.
54
+
55
+ Highlights:
56
+
57
+ - New `PluginSource` discriminated union and `PluginInstaller` /
58
+ `PluginInstallerRegistry` interfaces in `@checkstack/backend-api`. The
59
+ GitHub variant accepts an optional `apiBaseUrl` so deployments backed by
60
+ GitHub Enterprise can install from `https://ghe.example.com/api/v3`
61
+ instead of `api.github.com`.
62
+ - New `installPackageMetadataSchema` (Zod) in `@checkstack/common` validates
63
+ every plugin's `package.json` at install time. Required fields: `name`,
64
+ `version`, `description`, `author`, `license`, `checkstack.type`,
65
+ `checkstack.pluginId`. Optional: `checkstack.bundle`,
66
+ `checkstack.usageInstructions`, `checkstack.allowInstallScripts`.
67
+ - New `pluginManagerContract` in `@checkstack/pluginmanager-common` with
68
+ `list`, `previewInstall`, `install`, `previewUninstall`, `uninstall`, and
69
+ `events` procedures.
70
+ - New `@checkstack/pluginmanager-frontend` admin UI: installed-plugins list
71
+ with per-row uninstall (typed-confirmation modal, schema/configs/cascade
72
+ toggles), install page with NPM / Tarball Upload / GitHub Release tabs
73
+ (Catalog tab disabled — coming soon), and an events page surfacing the
74
+ install/uninstall audit log.
75
+ - New `bunx @checkstack/scripts plugin-pack` CLI for plugin authors —
76
+ per-package mode produces an npm-shaped tarball; `--bundle` mode produces
77
+ an outer tarball containing every sibling declared in
78
+ `package.json#checkstack.bundle`. Published to npm so external authors
79
+ can `bunx` it directly without a workspace checkout.
80
+ - Compatibility derived from `package.json#dependencies` ranges
81
+ (`semver.satisfies` against the platform's loaded `@checkstack/*`
82
+ versions) — no separate `compatibility` field.
83
+ - Multi-instance: originator persists artifacts + `plugins` rows + broadcasts
84
+ install/uninstall; receiving instances do in-process register/unregister
85
+ only. Destructive ops (drop schema, delete plugin_configs, delete
86
+ artifacts, delete `plugins` rows) run exactly once on the originator.
87
+ - Fresh-instance bootstrap: `loadPlugins()` hydrates any
88
+ `is_uninstallable=true` plugin missing from `node_modules` from the
89
+ artifact store before normal Phase 1 register.
90
+ - New schema: `plugin_artifacts` (tarball storage), `plugin_install_events`
91
+ (audit/error log). `plugins` extended with `version`, `metadata`,
92
+ `source`, `bundle_id`, `is_primary`. Local plugin sync now writes
93
+ `version` from each plugin's `package.json` so the admin UI shows real
94
+ versions instead of `—`.
95
+ - Tarball-upload endpoint (`POST /api/pluginmanager/upload-tarball`) for
96
+ the install UI; access-gated by `pluginmanager.plugin.manage`.
97
+ - Plugin Manager menu link added to the user menu (main grid, alongside
98
+ Profile / Notification Settings / etc.).
99
+
100
+ Cross-cutting changes:
101
+
102
+ - Backend request/response logging now flows through `rootLogger` (winston)
103
+ instead of `hono/logger`. 5xx responses include the response body inline
104
+ so swallowed early-return errors are visible in the log.
105
+ - The `/api/:pluginId/*` dispatcher now logs which core service is missing
106
+ or which `pluginId` had no metadata when it 500s.
107
+ - New `registerCorePluginMetadata` on `PluginManager` for core routers
108
+ (like the plugin manager itself) that need their metadata visible to the
109
+ RPC dispatcher without going through the full plugin lifecycle.
110
+ - ESLint: `unicorn/no-null` is now disabled globally. Drizzle distinguishes
111
+ between `null` (writes a real SQL NULL) and `undefined` (skip the column
112
+ on insert), so treating them as interchangeable produced latent bugs at
113
+ the persistence boundary. The bulk of the patch-bumped packages above
114
+ reflect lint-fix touches that landed when this rule was relaxed.
115
+ - Workspace-wide license normalization to `Elastic-2.0` (matches
116
+ `LICENSE.md`). Every `package.json` in the workspace now declares the
117
+ same SPDX identifier; the patch bumps capture this.
118
+
119
+ Plugin packages (every `plugins/*`): added a `pack` npm script
120
+ (`bunx @checkstack/scripts plugin-pack`), mirrored each plugin's
121
+ `pluginId` from `plugin-metadata.ts` into `package.json#checkstack.pluginId`
122
+ so install-time validation passes, stubbed any missing required metadata
123
+ fields (`description`, `author`, `license`), and added
124
+ `checkstack.bundle` to multi-package plugin primaries (telegram, rcon, ssh,
125
+ jira, queue-bullmq, queue-memory, cache-memory).
126
+
127
+ Breaking changes:
128
+
129
+ - The legacy single-method `PluginInstaller` interface (`install(packageName)`)
130
+ is removed. Callers must use `coreServices.pluginInstallerRegistry`.
131
+ - The old `pluginAdminContract` and `createPluginAdminRouter` are removed.
132
+ Replaced by `pluginManagerContract` in `@checkstack/pluginmanager-common`
133
+ and `createPluginManagerRouter` in `core/backend`.
134
+ - `@checkstack/test-utils-backend` no longer exports
135
+ `createMockPluginInstaller` / `MockPluginInstaller` (the legacy interface
136
+ it shimmed is gone).
137
+
138
+ Note: bumps are limited to `minor` (for packages with new public API
139
+ surface) and `patch` (for downstream consumers, license normalization,
140
+ and lint fixes). No `major` bumps despite the `PluginInstaller` removal —
141
+ the legacy interface had no third-party consumers in the wild before this
142
+ runtime plugin system landed, and the contract surface is the same shape
143
+ modulo the rename.
144
+
145
+ - Updated dependencies [50e5f5f]
146
+ - @checkstack/auth-common@0.6.5
147
+ - @checkstack/common@0.8.0
148
+ - @checkstack/frontend-api@0.4.2
149
+ - @checkstack/notification-common@1.0.1
150
+
3
151
  ## 2.0.0
4
152
 
5
153
  ### Major Changes
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@checkstack/catalog-common",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
+ "license": "Elastic-2.0",
4
5
  "type": "module",
5
6
  "exports": {
6
7
  ".": {
@@ -8,20 +9,20 @@
8
9
  }
9
10
  },
10
11
  "dependencies": {
11
- "@checkstack/common": "0.7.0",
12
- "@checkstack/auth-common": "0.6.3",
13
- "@checkstack/frontend-api": "0.4.0",
14
- "@checkstack/notification-common": "0.3.0",
12
+ "@checkstack/common": "0.8.0",
13
+ "@checkstack/auth-common": "0.6.5",
14
+ "@checkstack/frontend-api": "0.4.2",
15
+ "@checkstack/notification-common": "1.0.1",
15
16
  "@orpc/contract": "^1.13.14",
16
17
  "zod": "^4.2.1"
17
18
  },
18
19
  "devDependencies": {
19
20
  "typescript": "^5.7.2",
20
- "@checkstack/tsconfig": "0.0.5",
21
- "@checkstack/scripts": "0.1.2"
21
+ "@checkstack/tsconfig": "0.0.7",
22
+ "@checkstack/scripts": "0.3.0"
22
23
  },
23
24
  "scripts": {
24
- "typecheck": "tsc --noEmit",
25
+ "typecheck": "tsgo -b",
25
26
  "lint": "bun run lint:code",
26
27
  "lint:code": "eslint . --max-warnings 0"
27
28
  },
@@ -7,6 +7,7 @@ import {
7
7
  ViewSchema,
8
8
  SystemContactSchema,
9
9
  ContactTypeSchema,
10
+ SystemLinkSchema,
10
11
  } from "./types";
11
12
  import { catalogAccess } from "./access";
12
13
 
@@ -164,6 +165,43 @@ export const catalogContract = {
164
165
  .input(z.string())
165
166
  .output(z.object({ success: z.boolean() })),
166
167
 
168
+ // ==========================================================================
169
+ // SYSTEM LINKS MANAGEMENT
170
+ // Free-form URLs (Jira boards, dashboards, runbooks) attached to a system.
171
+ // ==========================================================================
172
+
173
+ getSystemLinks: proc({
174
+ operationType: "query",
175
+ userType: "public",
176
+ access: [catalogAccess.system.read],
177
+ instanceAccess: { idParam: "systemId" },
178
+ })
179
+ .input(z.object({ systemId: z.string() }))
180
+ .output(z.array(SystemLinkSchema)),
181
+
182
+ addSystemLink: proc({
183
+ operationType: "mutation",
184
+ userType: "authenticated",
185
+ access: [catalogAccess.system.manage],
186
+ instanceAccess: { idParam: "systemId" },
187
+ })
188
+ .input(
189
+ z.object({
190
+ systemId: z.string(),
191
+ label: z.string().max(120).optional(),
192
+ url: z.string().url("Must be a valid URL"),
193
+ }),
194
+ )
195
+ .output(SystemLinkSchema),
196
+
197
+ removeSystemLink: proc({
198
+ operationType: "mutation",
199
+ userType: "authenticated",
200
+ access: [catalogAccess.system.manage],
201
+ })
202
+ .input(z.string())
203
+ .output(z.object({ success: z.boolean() })),
204
+
167
205
  // ==========================================================================
168
206
  // GROUP MANAGEMENT (userType: "authenticated" with manage access)
169
207
  // ==========================================================================
package/src/types.ts CHANGED
@@ -46,6 +46,16 @@ export const SystemContactSchema = z.discriminatedUnion("type", [
46
46
  ]);
47
47
  export type SystemContact = z.infer<typeof SystemContactSchema>;
48
48
 
49
+ // System Links — free-form hotlinks attached to a system (Jira board, dashboards, etc.)
50
+ export const SystemLinkSchema = z.object({
51
+ id: z.string(),
52
+ systemId: z.string(),
53
+ label: z.string().nullable(),
54
+ url: z.string(),
55
+ createdAt: z.date(),
56
+ });
57
+ export type SystemLink = z.infer<typeof SystemLinkSchema>;
58
+
49
59
  export const GroupSchema = z.object({
50
60
  id: z.string(),
51
61
  name: z.string(),
package/tsconfig.json CHANGED
@@ -2,5 +2,19 @@
2
2
  "extends": "@checkstack/tsconfig/common.json",
3
3
  "include": [
4
4
  "src"
5
+ ],
6
+ "references": [
7
+ {
8
+ "path": "../auth-common"
9
+ },
10
+ {
11
+ "path": "../common"
12
+ },
13
+ {
14
+ "path": "../frontend-api"
15
+ },
16
+ {
17
+ "path": "../notification-common"
18
+ }
5
19
  ]
6
- }
20
+ }