@checkstack/incident-backend 0.1.0 → 0.2.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,98 @@
1
1
  # @checkstack/incident-backend
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - @checkstack/backend-api@0.3.1
8
+ - @checkstack/integration-backend@0.1.1
9
+ - @checkstack/catalog-backend@0.2.1
10
+ - @checkstack/command-backend@0.1.1
11
+
12
+ ## 0.2.0
13
+
14
+ ### Minor Changes
15
+
16
+ - 9faec1f: # Unified AccessRule Terminology Refactoring
17
+
18
+ This release completes a comprehensive terminology refactoring from "permission" to "accessRule" across the entire codebase, establishing a consistent and modern access control vocabulary.
19
+
20
+ ## Changes
21
+
22
+ ### Core Infrastructure (`@checkstack/common`)
23
+
24
+ - Introduced `AccessRule` interface as the primary access control type
25
+ - Added `accessPair()` helper for creating read/manage access rule pairs
26
+ - Added `access()` builder for individual access rules
27
+ - Replaced `Permission` type with `AccessRule` throughout
28
+
29
+ ### API Changes
30
+
31
+ - `env.registerPermissions()` → `env.registerAccessRules()`
32
+ - `meta.permissions` → `meta.access` in RPC contracts
33
+ - `usePermission()` → `useAccess()` in frontend hooks
34
+ - Route `permission:` field → `accessRule:` field
35
+
36
+ ### UI Changes
37
+
38
+ - "Roles & Permissions" tab → "Roles & Access Rules"
39
+ - "You don't have permission..." → "You don't have access..."
40
+ - All permission-related UI text updated
41
+
42
+ ### Documentation & Templates
43
+
44
+ - Updated 18 documentation files with AccessRule terminology
45
+ - Updated 7 scaffolding templates with `accessPair()` pattern
46
+ - All code examples use new AccessRule API
47
+
48
+ ## Migration Guide
49
+
50
+ ### Backend Plugins
51
+
52
+ ```diff
53
+ - import { permissionList } from "./permissions";
54
+ - env.registerPermissions(permissionList);
55
+ + import { accessRules } from "./access";
56
+ + env.registerAccessRules(accessRules);
57
+ ```
58
+
59
+ ### RPC Contracts
60
+
61
+ ```diff
62
+ - .meta({ userType: "user", permissions: [permissions.read.id] })
63
+ + .meta({ userType: "user", access: [access.read] })
64
+ ```
65
+
66
+ ### Frontend Hooks
67
+
68
+ ```diff
69
+ - const canRead = accessApi.usePermission(permissions.read.id);
70
+ + const canRead = accessApi.useAccess(access.read);
71
+ ```
72
+
73
+ ### Routes
74
+
75
+ ```diff
76
+ - permission: permissions.entityRead.id,
77
+ + accessRule: access.read,
78
+ ```
79
+
80
+ ### Patch Changes
81
+
82
+ - Updated dependencies [9faec1f]
83
+ - Updated dependencies [827b286]
84
+ - Updated dependencies [f533141]
85
+ - Updated dependencies [aa4a8ab]
86
+ - @checkstack/backend-api@0.3.0
87
+ - @checkstack/catalog-backend@0.2.0
88
+ - @checkstack/catalog-common@1.1.0
89
+ - @checkstack/command-backend@0.1.0
90
+ - @checkstack/common@0.2.0
91
+ - @checkstack/incident-common@0.2.0
92
+ - @checkstack/integration-backend@0.1.0
93
+ - @checkstack/integration-common@0.1.0
94
+ - @checkstack/signal-common@0.1.0
95
+
3
96
  ## 0.1.0
4
97
 
5
98
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/incident-backend",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -2,16 +2,13 @@ import * as schema from "./schema";
2
2
  import type { NodePgDatabase } from "drizzle-orm/node-postgres";
3
3
  import { z } from "zod";
4
4
  import {
5
- permissionList,
5
+ incidentAccessRules,
6
+ incidentAccess,
6
7
  pluginMetadata,
7
8
  incidentContract,
8
9
  incidentRoutes,
9
- permissions,
10
10
  } from "@checkstack/incident-common";
11
- import {
12
- createBackendPlugin,
13
- coreServices,
14
- } from "@checkstack/backend-api";
11
+ import { createBackendPlugin, coreServices } from "@checkstack/backend-api";
15
12
  import { integrationEventExtensionPoint } from "@checkstack/integration-backend";
16
13
  import { IncidentService } from "./service";
17
14
  import { createRouter } from "./router";
@@ -60,7 +57,7 @@ const incidentResolvedPayloadSchema = z.object({
60
57
  export default createBackendPlugin({
61
58
  metadata: pluginMetadata,
62
59
  register(env) {
63
- env.registerPermissions(permissionList);
60
+ env.registerAccessRules(incidentAccessRules);
64
61
 
65
62
  // Register hooks as integration events
66
63
  const integrationEvents = env.getExtensionPoint(
@@ -136,7 +133,7 @@ export default createBackendPlugin({
136
133
  iconName: "CircleAlert",
137
134
  route:
138
135
  resolveRoute(incidentRoutes.routes.config) + "?action=create",
139
- requiredPermissions: [permissions.incidentManage],
136
+ requiredAccessRules: [incidentAccess.incident.manage],
140
137
  },
141
138
  {
142
139
  id: "manage",
@@ -145,7 +142,7 @@ export default createBackendPlugin({
145
142
  iconName: "CircleAlert",
146
143
  shortcuts: ["meta+shift+i", "ctrl+shift+i"],
147
144
  route: resolveRoute(incidentRoutes.routes.config),
148
- requiredPermissions: [permissions.incidentManage],
145
+ requiredAccessRules: [incidentAccess.incident.manage],
149
146
  },
150
147
  ],
151
148
  });