@checkstack/maintenance-common 1.0.1 → 1.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,49 @@
1
1
  # @checkstack/maintenance-common
2
2
 
3
+ ## 1.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 [1ef2e79]
39
+ - Updated dependencies [aa89bc5]
40
+ - Updated dependencies [950d6ec]
41
+ - @checkstack/common@0.9.0
42
+ - @checkstack/catalog-common@2.1.0
43
+ - @checkstack/frontend-api@0.5.0
44
+ - @checkstack/notification-common@1.0.2
45
+ - @checkstack/signal-common@0.2.2
46
+
3
47
  ## 1.0.1
4
48
 
5
49
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/maintenance-common",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "license": "Elastic-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -9,18 +9,18 @@
9
9
  }
10
10
  },
11
11
  "dependencies": {
12
- "@checkstack/common": "0.7.0",
13
- "@checkstack/catalog-common": "2.0.0",
14
- "@checkstack/frontend-api": "0.4.1",
15
- "@checkstack/notification-common": "1.0.0",
16
- "@checkstack/signal-common": "0.2.0",
12
+ "@checkstack/common": "0.8.0",
13
+ "@checkstack/catalog-common": "2.0.1",
14
+ "@checkstack/frontend-api": "0.4.2",
15
+ "@checkstack/notification-common": "1.0.1",
16
+ "@checkstack/signal-common": "0.2.1",
17
17
  "@orpc/contract": "^1.13.14",
18
18
  "zod": "^4.2.1"
19
19
  },
20
20
  "devDependencies": {
21
21
  "typescript": "^5.7.2",
22
- "@checkstack/tsconfig": "0.0.6",
23
- "@checkstack/scripts": "0.1.2"
22
+ "@checkstack/tsconfig": "0.0.7",
23
+ "@checkstack/scripts": "0.3.0"
24
24
  },
25
25
  "scripts": {
26
26
  "typecheck": "tsgo -b",
package/src/index.ts CHANGED
@@ -10,6 +10,8 @@ export {
10
10
  MaintenanceWithSystemsSchema,
11
11
  MaintenanceUpdateSchema,
12
12
  MaintenanceDetailSchema,
13
+ MaintenanceLinkSchema,
14
+ AddMaintenanceLinkInputSchema,
13
15
  CreateMaintenanceInputSchema,
14
16
  UpdateMaintenanceInputSchema,
15
17
  AddMaintenanceUpdateInputSchema,
@@ -18,6 +20,8 @@ export {
18
20
  type MaintenanceWithSystems,
19
21
  type MaintenanceUpdate,
20
22
  type MaintenanceDetail,
23
+ type MaintenanceLink,
24
+ type AddMaintenanceLinkInput,
21
25
  type CreateMaintenanceInput,
22
26
  type UpdateMaintenanceInput,
23
27
  type AddMaintenanceUpdateInput,
@@ -6,6 +6,8 @@ import {
6
6
  MaintenanceWithSystemsSchema,
7
7
  MaintenanceDetailSchema,
8
8
  MaintenanceUpdateSchema,
9
+ MaintenanceLinkSchema,
10
+ AddMaintenanceLinkInputSchema,
9
11
  CreateMaintenanceInputSchema,
10
12
  UpdateMaintenanceInputSchema,
11
13
  AddMaintenanceUpdateInputSchema,
@@ -102,6 +104,24 @@ export const maintenanceContract = {
102
104
  .input(z.object({ id: z.string(), message: z.string().optional() }))
103
105
  .output(MaintenanceWithSystemsSchema),
104
106
 
107
+ /** Add a hotlink (e.g. change ticket, runbook) to a maintenance */
108
+ addLink: proc({
109
+ operationType: "mutation",
110
+ userType: "authenticated",
111
+ access: [maintenanceAccess.maintenance.manage],
112
+ })
113
+ .input(AddMaintenanceLinkInputSchema)
114
+ .output(MaintenanceLinkSchema),
115
+
116
+ /** Remove a hotlink from a maintenance */
117
+ removeLink: proc({
118
+ operationType: "mutation",
119
+ userType: "authenticated",
120
+ access: [maintenanceAccess.maintenance.manage],
121
+ })
122
+ .input(z.object({ id: z.string() }))
123
+ .output(z.object({ success: z.boolean() })),
124
+
105
125
  /** Delete a maintenance */
106
126
  deleteMaintenance: proc({
107
127
  operationType: "mutation",
package/src/schemas.ts CHANGED
@@ -52,10 +52,32 @@ export const MaintenanceUpdateSchema = z.object({
52
52
  export type MaintenanceUpdate = z.infer<typeof MaintenanceUpdateSchema>;
53
53
 
54
54
  /**
55
- * Full maintenance detail with systems and updates
55
+ * Free-form hotlink attached to a maintenance (e.g. change ticket, runbook).
56
+ */
57
+ export const MaintenanceLinkSchema = z.object({
58
+ id: z.string(),
59
+ maintenanceId: z.string(),
60
+ label: z.string().nullable(),
61
+ url: z.string(),
62
+ createdAt: z.date(),
63
+ });
64
+ export type MaintenanceLink = z.infer<typeof MaintenanceLinkSchema>;
65
+
66
+ export const AddMaintenanceLinkInputSchema = z.object({
67
+ maintenanceId: z.string(),
68
+ label: z.string().max(120).optional(),
69
+ url: z.string().url("Must be a valid URL"),
70
+ });
71
+ export type AddMaintenanceLinkInput = z.infer<
72
+ typeof AddMaintenanceLinkInputSchema
73
+ >;
74
+
75
+ /**
76
+ * Full maintenance detail with systems, updates, and hotlinks
56
77
  */
57
78
  export const MaintenanceDetailSchema = MaintenanceWithSystemsSchema.extend({
58
79
  updates: z.array(MaintenanceUpdateSchema),
80
+ links: z.array(MaintenanceLinkSchema),
59
81
  });
60
82
  export type MaintenanceDetail = z.infer<typeof MaintenanceDetailSchema>;
61
83