@checkstack/catalog-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,92 @@
1
1
  # @checkstack/catalog-backend
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - @checkstack/backend-api@0.3.1
8
+ - @checkstack/command-backend@0.1.1
9
+
10
+ ## 0.2.0
11
+
12
+ ### Minor Changes
13
+
14
+ - 9faec1f: # Unified AccessRule Terminology Refactoring
15
+
16
+ This release completes a comprehensive terminology refactoring from "permission" to "accessRule" across the entire codebase, establishing a consistent and modern access control vocabulary.
17
+
18
+ ## Changes
19
+
20
+ ### Core Infrastructure (`@checkstack/common`)
21
+
22
+ - Introduced `AccessRule` interface as the primary access control type
23
+ - Added `accessPair()` helper for creating read/manage access rule pairs
24
+ - Added `access()` builder for individual access rules
25
+ - Replaced `Permission` type with `AccessRule` throughout
26
+
27
+ ### API Changes
28
+
29
+ - `env.registerPermissions()` → `env.registerAccessRules()`
30
+ - `meta.permissions` → `meta.access` in RPC contracts
31
+ - `usePermission()` → `useAccess()` in frontend hooks
32
+ - Route `permission:` field → `accessRule:` field
33
+
34
+ ### UI Changes
35
+
36
+ - "Roles & Permissions" tab → "Roles & Access Rules"
37
+ - "You don't have permission..." → "You don't have access..."
38
+ - All permission-related UI text updated
39
+
40
+ ### Documentation & Templates
41
+
42
+ - Updated 18 documentation files with AccessRule terminology
43
+ - Updated 7 scaffolding templates with `accessPair()` pattern
44
+ - All code examples use new AccessRule API
45
+
46
+ ## Migration Guide
47
+
48
+ ### Backend Plugins
49
+
50
+ ```diff
51
+ - import { permissionList } from "./permissions";
52
+ - env.registerPermissions(permissionList);
53
+ + import { accessRules } from "./access";
54
+ + env.registerAccessRules(accessRules);
55
+ ```
56
+
57
+ ### RPC Contracts
58
+
59
+ ```diff
60
+ - .meta({ userType: "user", permissions: [permissions.read.id] })
61
+ + .meta({ userType: "user", access: [access.read] })
62
+ ```
63
+
64
+ ### Frontend Hooks
65
+
66
+ ```diff
67
+ - const canRead = accessApi.usePermission(permissions.read.id);
68
+ + const canRead = accessApi.useAccess(access.read);
69
+ ```
70
+
71
+ ### Routes
72
+
73
+ ```diff
74
+ - permission: permissions.entityRead.id,
75
+ + accessRule: access.read,
76
+ ```
77
+
78
+ ### Patch Changes
79
+
80
+ - Updated dependencies [9faec1f]
81
+ - Updated dependencies [827b286]
82
+ - Updated dependencies [f533141]
83
+ - Updated dependencies [aa4a8ab]
84
+ - @checkstack/backend-api@0.3.0
85
+ - @checkstack/catalog-common@1.1.0
86
+ - @checkstack/command-backend@0.1.0
87
+ - @checkstack/common@0.2.0
88
+ - @checkstack/notification-common@0.1.0
89
+
3
90
  ## 0.1.0
4
91
 
5
92
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/catalog-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,11 +2,11 @@ import { createBackendPlugin } from "@checkstack/backend-api";
2
2
  import { type NodePgDatabase } from "drizzle-orm/node-postgres";
3
3
  import { coreServices } from "@checkstack/backend-api";
4
4
  import {
5
- permissionList,
5
+ catalogAccessRules,
6
+ catalogAccess,
6
7
  pluginMetadata,
7
8
  catalogContract,
8
9
  catalogRoutes,
9
- permissions,
10
10
  } from "@checkstack/catalog-common";
11
11
  import { createCatalogRouter } from "./router";
12
12
  import { NotificationApi } from "@checkstack/notification-common";
@@ -24,7 +24,7 @@ export { catalogHooks } from "./hooks";
24
24
  export default createBackendPlugin({
25
25
  metadata: pluginMetadata,
26
26
  register(env) {
27
- env.registerPermissions(permissionList);
27
+ env.registerAccessRules(catalogAccessRules);
28
28
 
29
29
  env.registerInit({
30
30
  schema,
@@ -89,7 +89,7 @@ export default createBackendPlugin({
89
89
  iconName: "Activity",
90
90
  route:
91
91
  resolveRoute(catalogRoutes.routes.config) + "?action=create",
92
- requiredPermissions: [permissions.catalogManage],
92
+ requiredAccessRules: [catalogAccess.system.manage],
93
93
  },
94
94
  {
95
95
  id: "manage",
@@ -98,7 +98,7 @@ export default createBackendPlugin({
98
98
  iconName: "Activity",
99
99
  shortcuts: ["meta+shift+s", "ctrl+shift+s"],
100
100
  route: resolveRoute(catalogRoutes.routes.config),
101
- requiredPermissions: [permissions.catalogManage],
101
+ requiredAccessRules: [catalogAccess.system.manage],
102
102
  },
103
103
  ],
104
104
  });
package/src/router.ts CHANGED
@@ -12,8 +12,8 @@ import { eq } from "drizzle-orm";
12
12
  /**
13
13
  * Creates the catalog router using contract-based implementation.
14
14
  *
15
- * Auth and permissions are automatically enforced via autoAuthMiddleware
16
- * based on the contract's meta.userType and meta.permissions.
15
+ * Auth and access rules are automatically enforced via autoAuthMiddleware
16
+ * based on the contract's meta.userType and meta.access.
17
17
  */
18
18
  const os = implement(catalogContract)
19
19
  .$context<RpcContext>()