@checkstack/signal-common 0.0.4 → 0.1.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,86 @@
1
1
  # @checkstack/signal-common
2
2
 
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [7a23261]
8
+ - @checkstack/common@0.3.0
9
+
10
+ ## 0.1.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 [f533141]
82
+ - @checkstack/common@0.2.0
83
+
3
84
  ## 0.0.4
4
85
 
5
86
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/signal-common",
3
- "version": "0.0.4",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import type { Permission, PluginMetadata } from "@checkstack/common";
2
+ import type { AccessRule, PluginMetadata } from "@checkstack/common";
3
3
 
4
4
  // =============================================================================
5
5
  // SIGNAL DEFINITION
@@ -121,25 +121,25 @@ export interface SignalService {
121
121
  ): Promise<void>;
122
122
 
123
123
  /**
124
- * Emit a signal only to users from the provided list who have the required permission.
124
+ * Emit a signal only to users from the provided list who have the required access.
125
125
  * Uses S2S RPC to filter users via AuthApi before sending.
126
126
  *
127
127
  * @param signal - The signal to emit
128
128
  * @param userIds - List of user IDs to potentially send to
129
129
  * @param payload - Signal payload
130
- * @param pluginMetadata - The plugin metadata (for constructing fully-qualified permission ID)
131
- * @param permission - Permission object with native ID (will be prefixed with pluginId)
130
+ * @param pluginMetadata - The plugin metadata (for constructing fully-qualified access rule ID)
131
+ * @param accessRule - Access rule object with native ID (will be prefixed with pluginId)
132
132
  *
133
133
  * @example
134
134
  * ```typescript
135
- * import { pluginMetadata, permissions } from "@checkstack/healthcheck-common";
135
+ * import { pluginMetadata, healthCheckAccess } from "@checkstack/healthcheck-common";
136
136
  *
137
137
  * await signalService.sendToAuthorizedUsers(
138
138
  * HEALTH_STATE_CHANGED,
139
139
  * subscriberUserIds,
140
140
  * { systemId, newState: "degraded" },
141
141
  * pluginMetadata,
142
- * permissions.healthcheckStatusRead
142
+ * healthCheckAccess.status
143
143
  * );
144
144
  * ```
145
145
  */
@@ -148,7 +148,7 @@ export interface SignalService {
148
148
  userIds: string[],
149
149
  payload: T,
150
150
  pluginMetadata: PluginMetadata,
151
- permission: Permission
151
+ accessRule: AccessRule
152
152
  ): Promise<void>;
153
153
  }
154
154