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