@checkstack/maintenance-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,97 @@
1
1
  # @checkstack/maintenance-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/command-backend@0.1.1
10
+
11
+ ## 0.2.0
12
+
13
+ ### Minor Changes
14
+
15
+ - 9faec1f: # Unified AccessRule Terminology Refactoring
16
+
17
+ This release completes a comprehensive terminology refactoring from "permission" to "accessRule" across the entire codebase, establishing a consistent and modern access control vocabulary.
18
+
19
+ ## Changes
20
+
21
+ ### Core Infrastructure (`@checkstack/common`)
22
+
23
+ - Introduced `AccessRule` interface as the primary access control type
24
+ - Added `accessPair()` helper for creating read/manage access rule pairs
25
+ - Added `access()` builder for individual access rules
26
+ - Replaced `Permission` type with `AccessRule` throughout
27
+
28
+ ### API Changes
29
+
30
+ - `env.registerPermissions()` → `env.registerAccessRules()`
31
+ - `meta.permissions` → `meta.access` in RPC contracts
32
+ - `usePermission()` → `useAccess()` in frontend hooks
33
+ - Route `permission:` field → `accessRule:` field
34
+
35
+ ### UI Changes
36
+
37
+ - "Roles & Permissions" tab → "Roles & Access Rules"
38
+ - "You don't have permission..." → "You don't have access..."
39
+ - All permission-related UI text updated
40
+
41
+ ### Documentation & Templates
42
+
43
+ - Updated 18 documentation files with AccessRule terminology
44
+ - Updated 7 scaffolding templates with `accessPair()` pattern
45
+ - All code examples use new AccessRule API
46
+
47
+ ## Migration Guide
48
+
49
+ ### Backend Plugins
50
+
51
+ ```diff
52
+ - import { permissionList } from "./permissions";
53
+ - env.registerPermissions(permissionList);
54
+ + import { accessRules } from "./access";
55
+ + env.registerAccessRules(accessRules);
56
+ ```
57
+
58
+ ### RPC Contracts
59
+
60
+ ```diff
61
+ - .meta({ userType: "user", permissions: [permissions.read.id] })
62
+ + .meta({ userType: "user", access: [access.read] })
63
+ ```
64
+
65
+ ### Frontend Hooks
66
+
67
+ ```diff
68
+ - const canRead = accessApi.usePermission(permissions.read.id);
69
+ + const canRead = accessApi.useAccess(access.read);
70
+ ```
71
+
72
+ ### Routes
73
+
74
+ ```diff
75
+ - permission: permissions.entityRead.id,
76
+ + accessRule: access.read,
77
+ ```
78
+
79
+ ### Patch Changes
80
+
81
+ - Updated dependencies [9faec1f]
82
+ - Updated dependencies [827b286]
83
+ - Updated dependencies [f533141]
84
+ - Updated dependencies [aa4a8ab]
85
+ - @checkstack/backend-api@0.3.0
86
+ - @checkstack/catalog-common@1.1.0
87
+ - @checkstack/command-backend@0.1.0
88
+ - @checkstack/common@0.2.0
89
+ - @checkstack/integration-backend@0.1.0
90
+ - @checkstack/integration-common@0.1.0
91
+ - @checkstack/maintenance-common@0.2.0
92
+ - @checkstack/notification-common@0.1.0
93
+ - @checkstack/signal-common@0.1.0
94
+
3
95
  ## 0.1.0
4
96
 
5
97
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/maintenance-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
+ maintenanceAccessRules,
6
+ maintenanceAccess,
6
7
  pluginMetadata,
7
8
  maintenanceContract,
8
9
  maintenanceRoutes,
9
- permissions,
10
10
  } from "@checkstack/maintenance-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 { MaintenanceService } from "./service";
17
14
  import { createRouter } from "./router";
@@ -52,7 +49,7 @@ const maintenanceUpdatedPayloadSchema = z.object({
52
49
  export default createBackendPlugin({
53
50
  metadata: pluginMetadata,
54
51
  register(env) {
55
- env.registerPermissions(permissionList);
52
+ env.registerAccessRules(maintenanceAccessRules);
56
53
 
57
54
  // Register hooks as integration events
58
55
  const integrationEvents = env.getExtensionPoint(
@@ -117,7 +114,7 @@ export default createBackendPlugin({
117
114
  route:
118
115
  resolveRoute(maintenanceRoutes.routes.config) +
119
116
  "?action=create",
120
- requiredPermissions: [permissions.maintenanceManage],
117
+ requiredAccessRules: [maintenanceAccess.maintenance.manage],
121
118
  },
122
119
  {
123
120
  id: "manage",
@@ -126,7 +123,7 @@ export default createBackendPlugin({
126
123
  iconName: "Wrench",
127
124
  shortcuts: ["meta+shift+m", "ctrl+shift+m"],
128
125
  route: resolveRoute(maintenanceRoutes.routes.config),
129
- requiredPermissions: [permissions.maintenanceManage],
126
+ requiredAccessRules: [maintenanceAccess.maintenance.manage],
130
127
  },
131
128
  ],
132
129
  });