@checkstack/catalog-frontend 0.8.7 → 0.9.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,300 @@
1
1
  # @checkstack/catalog-frontend
2
2
 
3
+ ## 0.9.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 50e5f5f: Runtime plugin system: install + uninstall plugins from npm, GitHub releases
8
+ (including private GitHub Enterprise instances), or tarball uploads at
9
+ runtime, with multi-package bundles, dependency-derived compatibility checks,
10
+ multi-instance coordination via a Postgres artifact store, and
11
+ single-coordinator destructive cleanup.
12
+
13
+ Highlights:
14
+
15
+ - New `PluginSource` discriminated union and `PluginInstaller` /
16
+ `PluginInstallerRegistry` interfaces in `@checkstack/backend-api`. The
17
+ GitHub variant accepts an optional `apiBaseUrl` so deployments backed by
18
+ GitHub Enterprise can install from `https://ghe.example.com/api/v3`
19
+ instead of `api.github.com`.
20
+ - New `installPackageMetadataSchema` (Zod) in `@checkstack/common` validates
21
+ every plugin's `package.json` at install time. Required fields: `name`,
22
+ `version`, `description`, `author`, `license`, `checkstack.type`,
23
+ `checkstack.pluginId`. Optional: `checkstack.bundle`,
24
+ `checkstack.usageInstructions`, `checkstack.allowInstallScripts`.
25
+ - New `pluginManagerContract` in `@checkstack/pluginmanager-common` with
26
+ `list`, `previewInstall`, `install`, `previewUninstall`, `uninstall`, and
27
+ `events` procedures.
28
+ - New `@checkstack/pluginmanager-frontend` admin UI: installed-plugins list
29
+ with per-row uninstall (typed-confirmation modal, schema/configs/cascade
30
+ toggles), install page with NPM / Tarball Upload / GitHub Release tabs
31
+ (Catalog tab disabled — coming soon), and an events page surfacing the
32
+ install/uninstall audit log.
33
+ - New `bunx @checkstack/scripts plugin-pack` CLI for plugin authors —
34
+ per-package mode produces an npm-shaped tarball; `--bundle` mode produces
35
+ an outer tarball containing every sibling declared in
36
+ `package.json#checkstack.bundle`. Published to npm so external authors
37
+ can `bunx` it directly without a workspace checkout.
38
+ - Compatibility derived from `package.json#dependencies` ranges
39
+ (`semver.satisfies` against the platform's loaded `@checkstack/*`
40
+ versions) — no separate `compatibility` field.
41
+ - Multi-instance: originator persists artifacts + `plugins` rows + broadcasts
42
+ install/uninstall; receiving instances do in-process register/unregister
43
+ only. Destructive ops (drop schema, delete plugin_configs, delete
44
+ artifacts, delete `plugins` rows) run exactly once on the originator.
45
+ - Fresh-instance bootstrap: `loadPlugins()` hydrates any
46
+ `is_uninstallable=true` plugin missing from `node_modules` from the
47
+ artifact store before normal Phase 1 register.
48
+ - New schema: `plugin_artifacts` (tarball storage), `plugin_install_events`
49
+ (audit/error log). `plugins` extended with `version`, `metadata`,
50
+ `source`, `bundle_id`, `is_primary`. Local plugin sync now writes
51
+ `version` from each plugin's `package.json` so the admin UI shows real
52
+ versions instead of `—`.
53
+ - Tarball-upload endpoint (`POST /api/pluginmanager/upload-tarball`) for
54
+ the install UI; access-gated by `pluginmanager.plugin.manage`.
55
+ - Plugin Manager menu link added to the user menu (main grid, alongside
56
+ Profile / Notification Settings / etc.).
57
+
58
+ Cross-cutting changes:
59
+
60
+ - Backend request/response logging now flows through `rootLogger` (winston)
61
+ instead of `hono/logger`. 5xx responses include the response body inline
62
+ so swallowed early-return errors are visible in the log.
63
+ - The `/api/:pluginId/*` dispatcher now logs which core service is missing
64
+ or which `pluginId` had no metadata when it 500s.
65
+ - New `registerCorePluginMetadata` on `PluginManager` for core routers
66
+ (like the plugin manager itself) that need their metadata visible to the
67
+ RPC dispatcher without going through the full plugin lifecycle.
68
+ - ESLint: `unicorn/no-null` is now disabled globally. Drizzle distinguishes
69
+ between `null` (writes a real SQL NULL) and `undefined` (skip the column
70
+ on insert), so treating them as interchangeable produced latent bugs at
71
+ the persistence boundary. The bulk of the patch-bumped packages above
72
+ reflect lint-fix touches that landed when this rule was relaxed.
73
+ - Workspace-wide license normalization to `Elastic-2.0` (matches
74
+ `LICENSE.md`). Every `package.json` in the workspace now declares the
75
+ same SPDX identifier; the patch bumps capture this.
76
+
77
+ Plugin packages (every `plugins/*`): added a `pack` npm script
78
+ (`bunx @checkstack/scripts plugin-pack`), mirrored each plugin's
79
+ `pluginId` from `plugin-metadata.ts` into `package.json#checkstack.pluginId`
80
+ so install-time validation passes, stubbed any missing required metadata
81
+ fields (`description`, `author`, `license`), and added
82
+ `checkstack.bundle` to multi-package plugin primaries (telegram, rcon, ssh,
83
+ jira, queue-bullmq, queue-memory, cache-memory).
84
+
85
+ Breaking changes:
86
+
87
+ - The legacy single-method `PluginInstaller` interface (`install(packageName)`)
88
+ is removed. Callers must use `coreServices.pluginInstallerRegistry`.
89
+ - The old `pluginAdminContract` and `createPluginAdminRouter` are removed.
90
+ Replaced by `pluginManagerContract` in `@checkstack/pluginmanager-common`
91
+ and `createPluginManagerRouter` in `core/backend`.
92
+ - `@checkstack/test-utils-backend` no longer exports
93
+ `createMockPluginInstaller` / `MockPluginInstaller` (the legacy interface
94
+ it shimmed is gone).
95
+
96
+ Note: bumps are limited to `minor` (for packages with new public API
97
+ surface) and `patch` (for downstream consumers, license normalization,
98
+ and lint fixes). No `major` bumps despite the `PluginInstaller` removal —
99
+ the legacy interface had no third-party consumers in the wild before this
100
+ runtime plugin system landed, and the contract surface is the same shape
101
+ modulo the rename.
102
+
103
+ - Updated dependencies [50e5f5f]
104
+ - @checkstack/auth-common@0.6.5
105
+ - @checkstack/catalog-common@2.0.1
106
+ - @checkstack/common@0.8.0
107
+ - @checkstack/gitops-frontend@0.3.8
108
+ - @checkstack/notification-frontend@0.3.1
109
+ - @checkstack/ui@1.7.1
110
+ - @checkstack/auth-frontend@0.5.33
111
+ - @checkstack/frontend-api@0.4.2
112
+ - @checkstack/notification-common@1.0.1
113
+
114
+ ## 0.9.0
115
+
116
+ ### Minor Changes
117
+
118
+ - 32d52c6: feat: unified notification-subscription manager dialog driven by spec registry
119
+
120
+ Replaces the bell-toggle UX (which only managed a single legacy
121
+ catalog group) with a modal that lists every notification type
122
+ registered against a target — system or group — and exposes both
123
+ per-type toggles and a bulk "Subscribe to all / Unsubscribe from all"
124
+ action. Both surfaces (system detail page header bell, dashboard group
125
+ header bell) now open the same `NotificationSubscriptionsManager`
126
+ component.
127
+
128
+ **Key change vs. the prior slot-based approach**: rows are now driven
129
+ by `notificationClient.listSubscriptionSpecs` — the backend's spec
130
+ registry is the single source of truth. Previously, a row only
131
+ appeared if a frontend plugin had remembered to register a
132
+ `createNotificationSubscriptionExtension`; this caused silent drift
133
+ (healthcheck and dependency registered backend specs without frontend
134
+ extensions, so the dialog counted them but never rendered rows). Now,
135
+ every spec the platform knows about renders a row using the spec's
136
+ `display` metadata (title, description, iconName resolved via
137
+ `DynamicIcon`).
138
+
139
+ **Sub-controls registry** (`@checkstack/notification-frontend`):
140
+ plugins that want sub-granularity (anomaly's per-field mute list,
141
+ future severity / channel filters) call
142
+ `registerSubscriptionSubControls(spec, Component)` at module load —
143
+ the manager looks the component up by `specId` when expanding a row.
144
+
145
+ **Removed (no compat)**:
146
+
147
+ - `createNotificationSubscriptionExtension` (replaced by the
148
+ spec-driven manager + the SubControls registry)
149
+ - `target.slot` field on `NotificationTarget` and the
150
+ `NotificationTargetInput.slot` parameter on
151
+ `defineNotificationTarget`
152
+ - `SystemNotificationSubscriptionsSlot` and
153
+ `GroupNotificationSubscriptionsSlot` from `@checkstack/catalog-common`
154
+ - `SystemNotificationsCard` from the system detail page's main column
155
+ - `SubscribeButton` wiring on dashboard group cards and the system
156
+ detail page header
157
+
158
+ **Migrated frontends**: anomaly (now registers `AnomalyFieldMuteList`
159
+ via the SubControls registry), incident, maintenance — all dropped
160
+ their `createNotificationSubscriptionExtension` calls. healthcheck and
161
+ dependency now show up automatically via the spec registry — no
162
+ frontend changes needed for them to render.
163
+
164
+ The trigger button reflects aggregate state — filled bell when at
165
+ least one spec is subscribed for the resource, ghost bell when none.
166
+
167
+ - 32d52c6: feat: notification target pattern + per-spec subscriptions
168
+
169
+ Replaces the all-or-nothing catalog system/group notification model with a
170
+ platform-level target pattern. Each notification-emitting plugin declares
171
+ _subscription specs_ against typed _target_ objects exported from the
172
+ target's owning plugin (catalog ships `catalogSystemTarget` and
173
+ `catalogGroupTarget`). Notification-backend handles every per-resource
174
+ group lifecycle, parent-edge inheritance, and legacy-subscription seeding
175
+ — plugins never author groupId helpers, lifecycle hooks, or migration
176
+ code again.
177
+
178
+ **Plugin-author surface area is now ~12 lines per emitter:**
179
+
180
+ ```ts
181
+ // <plugin>-common
182
+ const { defineSubscription } = createSubscriptionFactory(pluginMetadata);
183
+ export const fooSystemSubscription = defineSubscription({
184
+ localId: "system",
185
+ target: catalogSystemTarget,
186
+ display: { title: "Foo Alerts", description: "...", iconName: "Bell" },
187
+ });
188
+
189
+ // <plugin>-backend register()
190
+ env.registerSubscriptionSpecs([fooSystemSubscription]);
191
+ // ^ feeds the plugin loader's dependency sorter — each spec's
192
+ // target.ownerPlugin becomes an implicit init-order dep, so this
193
+ // plugin automatically waits for catalog (the target owner) to
194
+ // finish init + afterPluginsReady before its own runs.
195
+
196
+ // <plugin>-backend afterPluginsReady
197
+ await notificationClient.registerSubscriptionSpec(
198
+ specToRegistration(fooSystemSubscription)
199
+ );
200
+ // dispatch
201
+ await notificationClient.notifyForSubscription({
202
+ specId: fooSystemSubscription.specId,
203
+ resourceKeys: [systemId],
204
+ title,
205
+ body,
206
+ importance,
207
+ action,
208
+ collapseKey,
209
+ subjects,
210
+ });
211
+
212
+ // <plugin>-frontend
213
+ createNotificationSubscriptionExtension({ spec: fooSystemSubscription });
214
+ ```
215
+
216
+ **Migrated plugins**: anomaly, incident, maintenance, healthcheck,
217
+ dependency. Each lost its bespoke `notification-groups.ts`,
218
+ `bootstrap*NotificationGroups`, `ensure*Group`, and inheritance walk —
219
+ all of that is now centralized in notification-backend's
220
+ `subscription-engine`.
221
+
222
+ **Plugin loader change** (`@checkstack/backend-api`,
223
+ `@checkstack/backend`): the register-time API gains
224
+ `env.registerSubscriptionSpecs([...specs])`. The dependency sorter
225
+ walks `spec.target.ownerPlugin` for every declared spec and adds the
226
+ target owner as an init-order dependency of the emitting plugin. This
227
+ guarantees that catalog (the owner of the platform's `system` and
228
+ `group` targets) completes init + afterPluginsReady before any
229
+ emitting plugin tries to register its specs against the notification
230
+ service — no string-prefix heuristics, no manual `dependsOnPlugins`
231
+ list, no stub rows. Plugins that fail to declare their specs at
232
+ register time get a clear `Target type X is not registered. Did the
233
+ emitting plugin declare this spec via env.registerSubscriptionSpecs?`
234
+ error from the dispatcher.
235
+
236
+ **Removed** (no backwards compat):
237
+
238
+ - `catalogClient.notifySystemSubscribers` and
239
+ `catalogClient.notifyManySystemSubscribers`
240
+ - `notificationClient.notifyUsers` and `notificationClient.notifyGroups`
241
+ as direct dispatch primitives — replaced by spec-bound
242
+ `notifyForSubscription`
243
+ - catalog's `bootstrapNotificationGroups` (replaced by
244
+ `bootstrapNotificationTargets`)
245
+
246
+ **Enforcement**: the dispatcher rejects calls referencing unregistered
247
+ specIds, specs owned by other plugins, or resourceKeys that haven't been
248
+ pushed via `upsertNotificationResource`. Display metadata for any
249
+ groupId is recoverable via the spec registry, so audit lists render
250
+ correct labels even when an emitter's frontend isn't loaded.
251
+
252
+ **Per-field anomaly mute** keeps working — it now lives inside the
253
+ generic SubscriptionRow's optional `SubControls` panel
254
+ (`AnomalyFieldMuteList`), exposed through the catalog system detail
255
+ page's notifications card.
256
+
257
+ The catalog system detail page renders a "Notifications" card hosting
258
+ `SystemNotificationSubscriptionsSlot`. The matching group surface is
259
+ not yet rendered — group-level subscriptions are wired end-to-end on
260
+ the backend; a follow-up will add the host UI.
261
+
262
+ **Migration of existing subscribers**: target types declare a
263
+ `legacyGroupIdTemplate`; on first registration of each spec,
264
+ notification-backend reads subscribers from the legacy
265
+ `catalog.system.<id>` / `catalog.group.<id>` groups and seeds the new
266
+ spec groups exactly once per (spec × resource) pair, tracked in
267
+ `subscription_migrations`. Anomaly stays opt-in (its target also
268
+ declares the template, but the user-explicit nature of the original
269
+ opt-in flow means the seeding produces the same set of subscribers
270
+ they already had).
271
+
272
+ ### Patch Changes
273
+
274
+ - 32d52c6: Bulk notifications affecting multiple systems and collapse lifecycle events into a single card.
275
+
276
+ Notifications now carry an optional `subjects` array (the entities they affect) and an optional `collapseKey` (so related notifications collapse into one row per recipient). Incidents, maintenances, anomalies, healthchecks, and dependency-impact events route through these new fields, so an incident affecting three systems produces one in-app notification + one external send per subscriber instead of three. Lifecycle updates for the same entity (created → updated → resolved) also collapse, with an expandable "+N updates" timeline.
277
+
278
+ Subject kinds are namespaced as `<pluginId>.<localKind>` and built via type-safe helpers exported from each domain's common package (`createSystemSubject`, `incidentCollapseKey`, etc.). The frontend kind registry (`registerSubjectKind`) lets plugins bind icon + label for their kinds; unknown kinds fall back to a generic chip.
279
+
280
+ All notification strategies (SMTP, Slack, Discord, Teams, Telegram, Pushover, Gotify, Webex, Backstage) render the affected subjects natively in their format (HTML cards, Slack blocks, Discord embed fields, adaptive cards, markdown lists, etc.).
281
+
282
+ - Updated dependencies [32d52c6]
283
+ - Updated dependencies [32d52c6]
284
+ - Updated dependencies [32d52c6]
285
+ - Updated dependencies [32d52c6]
286
+ - Updated dependencies [32d52c6]
287
+ - Updated dependencies [32d52c6]
288
+ - Updated dependencies [32d52c6]
289
+ - @checkstack/notification-common@1.0.0
290
+ - @checkstack/notification-frontend@0.3.0
291
+ - @checkstack/catalog-common@2.0.0
292
+ - @checkstack/frontend-api@0.4.1
293
+ - @checkstack/auth-common@0.6.4
294
+ - @checkstack/auth-frontend@0.5.32
295
+ - @checkstack/ui@1.7.0
296
+ - @checkstack/gitops-frontend@0.3.7
297
+
3
298
  ## 0.8.7
4
299
 
5
300
  ### Patch Changes
package/package.json CHANGED
@@ -1,25 +1,27 @@
1
1
  {
2
2
  "name": "@checkstack/catalog-frontend",
3
- "version": "0.8.7",
3
+ "version": "0.9.1",
4
+ "license": "Elastic-2.0",
4
5
  "type": "module",
5
6
  "main": "src/index.tsx",
6
7
  "checkstack": {
7
8
  "type": "frontend"
8
9
  },
9
10
  "scripts": {
10
- "typecheck": "tsc --noEmit",
11
+ "typecheck": "tsgo -b",
11
12
  "lint": "bun run lint:code",
12
13
  "lint:code": "eslint . --max-warnings 0"
13
14
  },
14
15
  "dependencies": {
15
- "@checkstack/auth-common": "0.6.3",
16
- "@checkstack/auth-frontend": "0.5.30",
17
- "@checkstack/catalog-common": "1.5.2",
16
+ "@checkstack/auth-common": "0.6.4",
17
+ "@checkstack/auth-frontend": "0.5.32",
18
+ "@checkstack/catalog-common": "2.0.0",
18
19
  "@checkstack/common": "0.7.0",
19
- "@checkstack/frontend-api": "0.3.11",
20
- "@checkstack/gitops-frontend": "0.3.5",
21
- "@checkstack/notification-common": "0.2.9",
22
- "@checkstack/ui": "1.6.0",
20
+ "@checkstack/frontend-api": "0.4.1",
21
+ "@checkstack/gitops-frontend": "0.3.7",
22
+ "@checkstack/notification-common": "1.0.0",
23
+ "@checkstack/notification-frontend": "0.3.0",
24
+ "@checkstack/ui": "1.7.0",
23
25
  "@dnd-kit/core": "^6.3.1",
24
26
  "@dnd-kit/utilities": "^3.2.2",
25
27
  "lucide-react": "^0.344.0",
@@ -29,7 +31,7 @@
29
31
  "devDependencies": {
30
32
  "typescript": "^5.0.0",
31
33
  "@types/react": "^18.2.0",
32
- "@checkstack/tsconfig": "0.0.5",
34
+ "@checkstack/tsconfig": "0.0.6",
33
35
  "@checkstack/scripts": "0.1.2"
34
36
  }
35
37
  }
@@ -426,7 +426,7 @@ export const CatalogConfigPage = () => {
426
426
 
427
427
  {/* Drag overlay — the floating ghost shown while dragging */}
428
428
  {/* dropAnimation must be null (not undefined) per @dnd-kit API to disable the fly-back animation */}
429
- {/* eslint-disable-next-line unicorn/no-null */}
429
+ { }
430
430
  <DragOverlay dropAnimation={null}>
431
431
  {activeSystem ? <SystemDragOverlay system={activeSystem} /> : undefined}
432
432
  </DragOverlay>
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useState, useCallback } from "react";
1
+ import React, { useEffect, useState } from "react";
2
2
  import { useParams } from "react-router-dom";
3
3
  import {
4
4
  usePluginClient,
@@ -10,46 +10,31 @@ import {
10
10
  SystemDetailsSlot,
11
11
  SystemDetailsTopSlot,
12
12
  SystemStateBadgesSlot,
13
+ catalogSystemTarget,
13
14
  } from "@checkstack/catalog-common";
14
- import { NotificationApi } from "@checkstack/notification-common";
15
+ import { NotificationSubscriptionsManager } from "@checkstack/notification-frontend";
15
16
  import {
16
17
  Card,
17
18
  CardContent,
18
19
  Page,
19
20
  PageContent,
20
21
  PageLayout,
21
- SubscribeButton,
22
- useToast,
23
22
  LoadingSpinner,
24
23
  AccessDenied,
25
24
  } from "@checkstack/ui";
26
25
  import { authApiRef } from "@checkstack/auth-frontend/api";
27
26
 
28
27
  import { Activity, Calendar, Mail, User } from "lucide-react";
29
- import { extractErrorMessage } from "@checkstack/common";
30
-
31
- const CATALOG_PLUGIN_ID = "catalog";
32
28
 
33
29
  export const SystemDetailPage: React.FC = () => {
34
30
  const { systemId } = useParams<{ systemId: string }>();
35
31
  const catalogClient = usePluginClient(CatalogApi);
36
- const notificationClient = usePluginClient(NotificationApi);
37
- const toast = useToast();
38
32
  const authApi = useApi(authApiRef);
39
33
  const { data: session } = authApi.useSession();
40
34
 
41
35
  const [groups, setGroups] = useState<Group[]>([]);
42
36
  const [notFound, setNotFound] = useState(false);
43
37
 
44
- // Subscription state
45
- const [isSubscribed, setIsSubscribed] = useState(false);
46
- const [subscriptionLoading, setSubscriptionLoading] = useState(true);
47
-
48
- // Construct the full group ID for this system
49
- const getSystemGroupId = useCallback(() => {
50
- return `${CATALOG_PLUGIN_ID}.system.${systemId}`;
51
- }, [systemId]);
52
-
53
38
  // Fetch system data with useQuery
54
39
  const { data: systemsData, isLoading: systemsLoading } =
55
40
  catalogClient.getSystems.useQuery({});
@@ -68,33 +53,6 @@ export const SystemDetailPage: React.FC = () => {
68
53
  const system = systemsData?.systems.find((s) => s.id === systemId);
69
54
  const loading = systemsLoading || groupsLoading;
70
55
 
71
- // Fetch subscriptions with useQuery
72
- const { data: subscriptions, refetch: refetchSubscriptions } =
73
- notificationClient.getSubscriptions.useQuery({});
74
-
75
- // Subscribe/unsubscribe mutations
76
- const subscribeMutation = notificationClient.subscribe.useMutation({
77
- onSuccess: () => {
78
- setIsSubscribed(true);
79
- toast.success("Subscribed to system notifications");
80
- void refetchSubscriptions();
81
- },
82
- onError: (error) => {
83
- toast.error(extractErrorMessage(error, "Failed to subscribe"));
84
- },
85
- });
86
-
87
- const unsubscribeMutation = notificationClient.unsubscribe.useMutation({
88
- onSuccess: () => {
89
- setIsSubscribed(false);
90
- toast.success("Unsubscribed from system notifications");
91
- void refetchSubscriptions();
92
- },
93
- onError: (error) => {
94
- toast.error(extractErrorMessage(error, "Failed to unsubscribe"));
95
- },
96
- });
97
-
98
56
  // Update not found state
99
57
  useEffect(() => {
100
58
  if (!systemsLoading && !system && systemId) {
@@ -112,26 +70,6 @@ export const SystemDetailPage: React.FC = () => {
112
70
  }
113
71
  }, [groupsData, systemId]);
114
72
 
115
- // Update subscription status from query
116
- useEffect(() => {
117
- if (subscriptions && systemId) {
118
- const groupId = getSystemGroupId();
119
- const hasSubscription = subscriptions.some((s) => s.groupId === groupId);
120
- setIsSubscribed(hasSubscription);
121
- setSubscriptionLoading(false);
122
- }
123
- }, [subscriptions, systemId, getSystemGroupId]);
124
-
125
- const handleSubscribe = () => {
126
- setSubscriptionLoading(true);
127
- subscribeMutation.mutate({ groupId: getSystemGroupId() });
128
- };
129
-
130
- const handleUnsubscribe = () => {
131
- setSubscriptionLoading(true);
132
- unsubscribeMutation.mutate({ groupId: getSystemGroupId() });
133
- };
134
-
135
73
  if (loading) {
136
74
  return (
137
75
  <Page>
@@ -165,15 +103,9 @@ export const SystemDetailPage: React.FC = () => {
165
103
  <div className="flex items-center gap-2">
166
104
  <ExtensionSlot slot={SystemStateBadgesSlot} context={{ system }} />
167
105
  {session && (
168
- <SubscribeButton
169
- isSubscribed={isSubscribed}
170
- onSubscribe={handleSubscribe}
171
- onUnsubscribe={handleUnsubscribe}
172
- loading={
173
- subscriptionLoading ||
174
- subscribeMutation.isPending ||
175
- unsubscribeMutation.isPending
176
- }
106
+ <NotificationSubscriptionsManager
107
+ target={catalogSystemTarget}
108
+ resource={{ systemId: system.id, systemName: system.name }}
177
109
  />
178
110
  )}
179
111
  </div>
package/src/index.tsx CHANGED
@@ -9,11 +9,26 @@ import {
9
9
  catalogAccess,
10
10
  } from "@checkstack/catalog-common";
11
11
 
12
+ import { Server, FolderTree } from "lucide-react";
13
+ import { registerSubjectKind } from "@checkstack/notification-frontend";
14
+
12
15
  import { CatalogPage } from "./components/CatalogPage";
13
16
  import { CatalogConfigPage } from "./components/CatalogConfigPage";
14
17
  import { CatalogUserMenuItems } from "./components/UserMenuItems";
15
18
  import { SystemDetailPage } from "./components/SystemDetailPage";
16
19
 
20
+ // Notification subject kinds emitted by catalog (see catalog-common's
21
+ // `createSystemSubject` / `createGroupSubject`). Registered at module load
22
+ // so the notification bell + page render kind-appropriate icons.
23
+ registerSubjectKind(`${pluginMetadata.pluginId}.system`, {
24
+ label: "System",
25
+ icon: Server,
26
+ });
27
+ registerSubjectKind(`${pluginMetadata.pluginId}.group`, {
28
+ label: "Group",
29
+ icon: FolderTree,
30
+ });
31
+
17
32
  export const catalogPlugin = createFrontendPlugin({
18
33
  metadata: pluginMetadata,
19
34
  // No APIs needed - components use usePluginClient() directly
package/tsconfig.json CHANGED
@@ -2,5 +2,34 @@
2
2
  "extends": "@checkstack/tsconfig/frontend.json",
3
3
  "include": [
4
4
  "src"
5
+ ],
6
+ "references": [
7
+ {
8
+ "path": "../auth-common"
9
+ },
10
+ {
11
+ "path": "../auth-frontend"
12
+ },
13
+ {
14
+ "path": "../catalog-common"
15
+ },
16
+ {
17
+ "path": "../common"
18
+ },
19
+ {
20
+ "path": "../frontend-api"
21
+ },
22
+ {
23
+ "path": "../gitops-frontend"
24
+ },
25
+ {
26
+ "path": "../notification-common"
27
+ },
28
+ {
29
+ "path": "../notification-frontend"
30
+ },
31
+ {
32
+ "path": "../ui"
33
+ }
5
34
  ]
6
- }
35
+ }