@checkstack/integration-jira-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,88 @@
1
1
  # @checkstack/integration-jira-common
2
2
 
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [7a23261]
8
+ - @checkstack/common@0.3.0
9
+ - @checkstack/integration-common@0.2.0
10
+
11
+ ## 0.1.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 [f533141]
83
+ - @checkstack/common@0.2.0
84
+ - @checkstack/integration-common@0.1.0
85
+
3
86
  ## 0.0.4
4
87
 
5
88
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/integration-jira-common",
3
- "version": "0.0.4",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
@@ -10,6 +10,7 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "@checkstack/common": "workspace:*",
13
+ "@checkstack/integration-common": "workspace:*",
13
14
  "@orpc/contract": "^1.13.2",
14
15
  "zod": "^4.2.1"
15
16
  },
@@ -1,10 +1,7 @@
1
- import { oc } from "@orpc/contract";
2
1
  import { z } from "zod";
3
2
  import { pluginMetadata } from "./plugin-metadata";
4
- import {
5
- createClientDefinition,
6
- type ProcedureMetadata,
7
- } from "@checkstack/common";
3
+ import { createClientDefinition, proc } from "@checkstack/common";
4
+ import { integrationAccess } from "@checkstack/integration-common";
8
5
  import {
9
6
  JiraConnectionRedactedSchema,
10
7
  CreateJiraConnectionInputSchema,
@@ -14,9 +11,6 @@ import {
14
11
  JiraFieldSchema,
15
12
  } from "./schemas";
16
13
 
17
- // Base builder with full metadata support
18
- const _base = oc.$meta<ProcedureMetadata>({});
19
-
20
14
  /**
21
15
  * RPC contract for Jira-specific operations.
22
16
  * These endpoints are in addition to the generic integration endpoints.
@@ -27,55 +21,54 @@ export const jiraContract = {
27
21
  // ==========================================================================
28
22
 
29
23
  /** List all Jira connections (redacted - no API tokens) */
30
- listConnections: _base
31
- .meta({
32
- userType: "user",
33
- permissions: ["integration.manage"],
34
- })
35
- .output(z.array(JiraConnectionRedactedSchema)),
24
+ listConnections: proc({
25
+ operationType: "query",
26
+ userType: "user",
27
+ access: [integrationAccess.manage],
28
+ }).output(z.array(JiraConnectionRedactedSchema)),
36
29
 
37
30
  /** Get a single connection (redacted) */
38
- getConnection: _base
39
- .meta({
40
- userType: "user",
41
- permissions: ["integration.manage"],
42
- })
31
+ getConnection: proc({
32
+ operationType: "query",
33
+ userType: "user",
34
+ access: [integrationAccess.manage],
35
+ })
43
36
  .input(z.object({ id: z.string() }))
44
37
  .output(JiraConnectionRedactedSchema),
45
38
 
46
39
  /** Create a new Jira connection */
47
- createConnection: _base
48
- .meta({
49
- userType: "user",
50
- permissions: ["integration.manage"],
51
- })
40
+ createConnection: proc({
41
+ operationType: "mutation",
42
+ userType: "user",
43
+ access: [integrationAccess.manage],
44
+ })
52
45
  .input(CreateJiraConnectionInputSchema)
53
46
  .output(JiraConnectionRedactedSchema),
54
47
 
55
48
  /** Update a Jira connection */
56
- updateConnection: _base
57
- .meta({
58
- userType: "user",
59
- permissions: ["integration.manage"],
60
- })
49
+ updateConnection: proc({
50
+ operationType: "mutation",
51
+ userType: "user",
52
+ access: [integrationAccess.manage],
53
+ })
61
54
  .input(UpdateJiraConnectionInputSchema)
62
55
  .output(JiraConnectionRedactedSchema),
63
56
 
64
57
  /** Delete a Jira connection */
65
- deleteConnection: _base
66
- .meta({
67
- userType: "user",
68
- permissions: ["integration.manage"],
69
- })
58
+ deleteConnection: proc({
59
+ operationType: "mutation",
60
+ userType: "user",
61
+ access: [integrationAccess.manage],
62
+ })
70
63
  .input(z.object({ id: z.string() }))
71
64
  .output(z.object({ success: z.boolean() })),
72
65
 
73
66
  /** Test a Jira connection */
74
- testConnection: _base
75
- .meta({
76
- userType: "user",
77
- permissions: ["integration.manage"],
78
- })
67
+ testConnection: proc({
68
+ operationType: "mutation",
69
+ userType: "user",
70
+ access: [integrationAccess.manage],
71
+ })
79
72
  .input(z.object({ id: z.string() }))
80
73
  .output(
81
74
  z.object({
@@ -89,20 +82,20 @@ export const jiraContract = {
89
82
  // ==========================================================================
90
83
 
91
84
  /** Get projects available in a Jira connection */
92
- getProjects: _base
93
- .meta({
94
- userType: "user",
95
- permissions: ["integration.manage"],
96
- })
85
+ getProjects: proc({
86
+ operationType: "query",
87
+ userType: "user",
88
+ access: [integrationAccess.manage],
89
+ })
97
90
  .input(z.object({ connectionId: z.string() }))
98
91
  .output(z.array(JiraProjectSchema)),
99
92
 
100
93
  /** Get issue types available for a project */
101
- getIssueTypes: _base
102
- .meta({
103
- userType: "user",
104
- permissions: ["integration.manage"],
105
- })
94
+ getIssueTypes: proc({
95
+ operationType: "query",
96
+ userType: "user",
97
+ access: [integrationAccess.manage],
98
+ })
106
99
  .input(
107
100
  z.object({
108
101
  connectionId: z.string(),
@@ -112,11 +105,11 @@ export const jiraContract = {
112
105
  .output(z.array(JiraIssueTypeSchema)),
113
106
 
114
107
  /** Get fields available for a project and issue type */
115
- getFields: _base
116
- .meta({
117
- userType: "user",
118
- permissions: ["integration.manage"],
119
- })
108
+ getFields: proc({
109
+ operationType: "query",
110
+ userType: "user",
111
+ access: [integrationAccess.manage],
112
+ })
120
113
  .input(
121
114
  z.object({
122
115
  connectionId: z.string(),
@@ -127,11 +120,11 @@ export const jiraContract = {
127
120
  .output(z.array(JiraFieldSchema)),
128
121
 
129
122
  /** Get priorities available in Jira */
130
- getPriorities: _base
131
- .meta({
132
- userType: "user",
133
- permissions: ["integration.manage"],
134
- })
123
+ getPriorities: proc({
124
+ operationType: "query",
125
+ userType: "user",
126
+ access: [integrationAccess.manage],
127
+ })
135
128
  .input(z.object({ connectionId: z.string() }))
136
129
  .output(
137
130
  z.array(