@checkstack/incident-common 1.0.0 → 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,60 @@
1
1
  # @checkstack/incident-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
+
47
+ ## 1.0.1
48
+
49
+ ### Patch Changes
50
+
51
+ - Updated dependencies [50e5f5f]
52
+ - @checkstack/catalog-common@2.0.1
53
+ - @checkstack/common@0.8.0
54
+ - @checkstack/frontend-api@0.4.2
55
+ - @checkstack/notification-common@1.0.1
56
+ - @checkstack/signal-common@0.2.1
57
+
3
58
  ## 1.0.0
4
59
 
5
60
  ### Major Changes
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@checkstack/incident-common",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
+ "license": "Elastic-2.0",
4
5
  "type": "module",
5
6
  "exports": {
6
7
  ".": {
@@ -8,21 +9,21 @@
8
9
  }
9
10
  },
10
11
  "dependencies": {
11
- "@checkstack/common": "0.7.0",
12
- "@checkstack/catalog-common": "1.5.3",
13
- "@checkstack/frontend-api": "0.4.0",
14
- "@checkstack/notification-common": "0.3.0",
15
- "@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",
16
17
  "@orpc/contract": "^1.13.14",
17
18
  "zod": "^4.2.1"
18
19
  },
19
20
  "devDependencies": {
20
21
  "typescript": "^5.7.2",
21
- "@checkstack/tsconfig": "0.0.5",
22
- "@checkstack/scripts": "0.1.2"
22
+ "@checkstack/tsconfig": "0.0.7",
23
+ "@checkstack/scripts": "0.3.0"
23
24
  },
24
25
  "scripts": {
25
- "typecheck": "tsc --noEmit",
26
+ "typecheck": "tsgo -b",
26
27
  "lint": "bun run lint:code",
27
28
  "lint:code": "eslint . --max-warnings 0"
28
29
  },
package/src/index.ts CHANGED
@@ -11,6 +11,8 @@ export {
11
11
  IncidentWithSystemsSchema,
12
12
  IncidentUpdateSchema,
13
13
  IncidentDetailSchema,
14
+ IncidentLinkSchema,
15
+ AddIncidentLinkInputSchema,
14
16
  CreateIncidentInputSchema,
15
17
  UpdateIncidentInputSchema,
16
18
  AddIncidentUpdateInputSchema,
@@ -20,6 +22,8 @@ export {
20
22
  type IncidentWithSystems,
21
23
  type IncidentUpdate,
22
24
  type IncidentDetail,
25
+ type IncidentLink,
26
+ type AddIncidentLinkInput,
23
27
  type CreateIncidentInput,
24
28
  type UpdateIncidentInput,
25
29
  type AddIncidentUpdateInput,
@@ -6,6 +6,8 @@ import {
6
6
  IncidentWithSystemsSchema,
7
7
  IncidentDetailSchema,
8
8
  IncidentUpdateSchema,
9
+ IncidentLinkSchema,
10
+ AddIncidentLinkInputSchema,
9
11
  CreateIncidentInputSchema,
10
12
  UpdateIncidentInputSchema,
11
13
  AddIncidentUpdateInputSchema,
@@ -100,6 +102,24 @@ export const incidentContract = {
100
102
  .input(z.object({ id: z.string(), message: z.string().optional() }))
101
103
  .output(IncidentWithSystemsSchema),
102
104
 
105
+ /** Add a hotlink (e.g. Jira ticket, runbook) to an incident */
106
+ addLink: proc({
107
+ operationType: "mutation",
108
+ userType: "authenticated",
109
+ access: [incidentAccess.incident.manage],
110
+ })
111
+ .input(AddIncidentLinkInputSchema)
112
+ .output(IncidentLinkSchema),
113
+
114
+ /** Remove a hotlink from an incident */
115
+ removeLink: proc({
116
+ operationType: "mutation",
117
+ userType: "authenticated",
118
+ access: [incidentAccess.incident.manage],
119
+ })
120
+ .input(z.object({ id: z.string() }))
121
+ .output(z.object({ success: z.boolean() })),
122
+
103
123
  /** Delete an incident */
104
124
  deleteIncident: proc({
105
125
  operationType: "mutation",
package/src/schemas.ts CHANGED
@@ -58,10 +58,30 @@ export const IncidentUpdateSchema = z.object({
58
58
  export type IncidentUpdate = z.infer<typeof IncidentUpdateSchema>;
59
59
 
60
60
  /**
61
- * Full incident detail with systems and updates
61
+ * Free-form hotlink attached to an incident (e.g. Jira ticket, runbook).
62
+ */
63
+ export const IncidentLinkSchema = z.object({
64
+ id: z.string(),
65
+ incidentId: z.string(),
66
+ label: z.string().nullable(),
67
+ url: z.string(),
68
+ createdAt: z.date(),
69
+ });
70
+ export type IncidentLink = z.infer<typeof IncidentLinkSchema>;
71
+
72
+ export const AddIncidentLinkInputSchema = z.object({
73
+ incidentId: z.string(),
74
+ label: z.string().max(120).optional(),
75
+ url: z.string().url("Must be a valid URL"),
76
+ });
77
+ export type AddIncidentLinkInput = z.infer<typeof AddIncidentLinkInputSchema>;
78
+
79
+ /**
80
+ * Full incident detail with systems, updates, and hotlinks
62
81
  */
63
82
  export const IncidentDetailSchema = IncidentWithSystemsSchema.extend({
64
83
  updates: z.array(IncidentUpdateSchema),
84
+ links: z.array(IncidentLinkSchema),
65
85
  });
66
86
  export type IncidentDetail = z.infer<typeof IncidentDetailSchema>;
67
87
 
package/tsconfig.json CHANGED
@@ -2,5 +2,22 @@
2
2
  "extends": "@checkstack/tsconfig/common.json",
3
3
  "include": [
4
4
  "src"
5
+ ],
6
+ "references": [
7
+ {
8
+ "path": "../catalog-common"
9
+ },
10
+ {
11
+ "path": "../common"
12
+ },
13
+ {
14
+ "path": "../frontend-api"
15
+ },
16
+ {
17
+ "path": "../notification-common"
18
+ },
19
+ {
20
+ "path": "../signal-common"
21
+ }
5
22
  ]
6
- }
23
+ }