@gitkraken/provider-apis 0.17.5 → 0.18.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 +167 -0
- package/dist/index.js +124 -111
- package/dist/providers/azureDevops/azureDevOps.d.ts +67 -34
- package/dist/providers/bitbucket/bitbucket.d.ts +9 -9
- package/dist/providers/bitbucketServer/bitbucketServer.d.ts +10 -14
- package/dist/providers/gitProvider.d.ts +73 -0
- package/dist/providers/github/github.d.ts +51 -29
- package/dist/providers/github/githubTypes.d.ts +4 -0
- package/dist/providers/gitlab/gitlab.d.ts +48 -37
- package/dist/providers/issueProvider.d.ts +61 -6
- package/dist/providers/jira/jira.d.ts +17 -18
- package/dist/providers/jira/sharedHelpers.d.ts +10 -13
- package/dist/providers/jira/sharedTypes.d.ts +12 -0
- package/dist/providers/jiraServer/jiraServer.d.ts +10 -8
- package/dist/providers/trello/trello.d.ts +16 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,172 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.18.1
|
|
4
|
+
|
|
5
|
+
- reverted inclusion of local test config
|
|
6
|
+
|
|
7
|
+
## 0.18.0
|
|
8
|
+
|
|
9
|
+
### ⚠️ Breaking Changes
|
|
10
|
+
|
|
11
|
+
This version refactors all of the mutation functions for all providers. The mutation functions are now standardized to take `GitPullRequest` or `Issue` objects as arguments, which differs from the lack of standardization present in earlier verisons.
|
|
12
|
+
|
|
13
|
+
Examples of how to call the new functions:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
const pullRequest: GitPullRequest = { /* ... some PR object from your app's state ... */ };
|
|
17
|
+
|
|
18
|
+
// pre-v0.18.0 way of merging a pull request for gitlab
|
|
19
|
+
await gitlab.mergePullRequest({
|
|
20
|
+
repo: {
|
|
21
|
+
namespace: pullRequest.repository.owner.login!,
|
|
22
|
+
name: pullRequest.repository.name,
|
|
23
|
+
},
|
|
24
|
+
pullRequestId: pullRequest.number, // other providers might use the `graphQLId` or `id` fields
|
|
25
|
+
expectedSourceSha: pullRequest.headRef.oid!, // other providers might not need this at all
|
|
26
|
+
mergeStrategy: GitMergeStrategy.Squash, // or `undefined` to use the repo's default merge strategy
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// v0.18.0 way of merging a pull request for gitlab
|
|
30
|
+
await gitlab.mergePullRequest({
|
|
31
|
+
pullRequest,
|
|
32
|
+
mergeStrategy: GitMergeStrategy.Squash, // or `undefined` to use the repo's default merge strategy
|
|
33
|
+
});
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
const issue: Issue = { /* ... some issue object from your app's state ... */ };
|
|
38
|
+
const labels: GitLabel[] = [{ /* ... some label objects from your app's state ... */ }];
|
|
39
|
+
|
|
40
|
+
// pre-v0.18.0 way of setting issue labels for gitlab
|
|
41
|
+
await gitlab.setIssueLabels({
|
|
42
|
+
repo: {
|
|
43
|
+
namespace: issue.repository.owner.login!,
|
|
44
|
+
name: issue.repository.name,
|
|
45
|
+
},
|
|
46
|
+
issueId: issue.number, // other providers might use the `graphQLId` or `id` fields
|
|
47
|
+
labelGraphQLIds: labels.map((label) => label.graphQLId),
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// v0.18.0 way of setting issue labels
|
|
51
|
+
await gitlab.setIssueLabels({
|
|
52
|
+
issue,
|
|
53
|
+
labels,
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The new functions take various `Set*Input` interfaces as arguments.
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
interface GitProvider {
|
|
61
|
+
// ...
|
|
62
|
+
setPullRequestMilestone?(
|
|
63
|
+
input: {
|
|
64
|
+
pullRequest: SetPullRequestInput;
|
|
65
|
+
milestone: SetMilestoneInput | null;
|
|
66
|
+
},
|
|
67
|
+
options: Options
|
|
68
|
+
): Promise<void>;
|
|
69
|
+
// ...
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The `Set*Input` interfaces are designed to take their corresponding provider library object. `SetPullRequestInput` is designed to take a `GitPullRequest` object. `SetMilestoneInput` is designed to take a `GitMilestone` object. Here's a quick reference of the various `Set*Input` interfaces and the objects that they are designed to take:
|
|
74
|
+
|
|
75
|
+
|`Set*Input` interface|Provider library object |
|
|
76
|
+
|---------------------|-------------------------------------------|
|
|
77
|
+
|SetPullRequestInput |GitPullRequest |
|
|
78
|
+
|SetIssueInput |Issue |
|
|
79
|
+
|SetMilestoneInput |GitMilestone |
|
|
80
|
+
|SetAccountInput |Account |
|
|
81
|
+
|SetLabelInput |GitLabel |
|
|
82
|
+
|SetStatusInput |IssueTransition, TrelloBoard, WorkItemState|
|
|
83
|
+
|
|
84
|
+
Now, wih all of that explained, here's the list of updated mutation functions:
|
|
85
|
+
|
|
86
|
+
Azure Dev Ops:
|
|
87
|
+
- closePullRequest
|
|
88
|
+
- mergePullRequest
|
|
89
|
+
- addPullRequestLabel
|
|
90
|
+
- removePullRequestLabel
|
|
91
|
+
- setPullRequestAsDraft
|
|
92
|
+
- addPullRequestReviewer
|
|
93
|
+
- removePullRequestReviewer
|
|
94
|
+
- setIssueStatus
|
|
95
|
+
- setIssueAssignee
|
|
96
|
+
- setIssueLabels
|
|
97
|
+
|
|
98
|
+
- setPullRequestReviewers **(new)**
|
|
99
|
+
- setPullRequestLabels **(new)**
|
|
100
|
+
|
|
101
|
+
Bitbucket:
|
|
102
|
+
- closePullRequest
|
|
103
|
+
- mergePullRequest
|
|
104
|
+
- setPullRequestReviewers
|
|
105
|
+
|
|
106
|
+
Bitbucket Server:
|
|
107
|
+
- closePullRequest
|
|
108
|
+
- mergePullRequest
|
|
109
|
+
- setPullRequestReviewers
|
|
110
|
+
|
|
111
|
+
GitHub/GitHub Enterprise:
|
|
112
|
+
- closePullRequest
|
|
113
|
+
- mergePullRequest
|
|
114
|
+
- setPullRequestMilestone
|
|
115
|
+
- setPullRequestAsDraft
|
|
116
|
+
- setPullRequestReviewers
|
|
117
|
+
- setPullRequestAssignees
|
|
118
|
+
- setPullRequestLabels
|
|
119
|
+
- setIssueLabels
|
|
120
|
+
- setIssueMilestone
|
|
121
|
+
- setIssueAssignees
|
|
122
|
+
|
|
123
|
+
- reOpenIssue **(new)**
|
|
124
|
+
- closeIssue **(new)**
|
|
125
|
+
- closeIssueWithReason **(new)**
|
|
126
|
+
- reRequestPullRequestReviews **(new)**
|
|
127
|
+
|
|
128
|
+
- setIssueStatus was **removed**
|
|
129
|
+
|
|
130
|
+
GitLab/GitLab Self-Managed:
|
|
131
|
+
- closePullRequest
|
|
132
|
+
- mergePullRequest
|
|
133
|
+
- setPullRequestMilestone
|
|
134
|
+
- setPullRequestAsDraft
|
|
135
|
+
- setPullRequestReviewers
|
|
136
|
+
- setPullRequestAssignees
|
|
137
|
+
- setPullRequestLabels
|
|
138
|
+
- setIssueLabels
|
|
139
|
+
- setIssueMilestone
|
|
140
|
+
- setIssueAssignees
|
|
141
|
+
|
|
142
|
+
- closeIssue **(new)**
|
|
143
|
+
- reOpenIssue **(new)**
|
|
144
|
+
- reRequestPullRequestReview **(new)**
|
|
145
|
+
- reRequestPullRequestReviews **(new)**
|
|
146
|
+
|
|
147
|
+
- setIssueStatus was **removed**
|
|
148
|
+
|
|
149
|
+
Jira:
|
|
150
|
+
- setIssueStatus
|
|
151
|
+
- setIssueAssignee
|
|
152
|
+
- setIssueComponents
|
|
153
|
+
- setIssueLabels
|
|
154
|
+
|
|
155
|
+
Jira Server:
|
|
156
|
+
- setIssueStatus
|
|
157
|
+
- setIssueComponents
|
|
158
|
+
- setIssueLabels
|
|
159
|
+
|
|
160
|
+
Trello:
|
|
161
|
+
- setIssueStatus
|
|
162
|
+
- setIssueAssignees
|
|
163
|
+
- setIssueLabels
|
|
164
|
+
|
|
165
|
+
- archiveIssue **(new)**
|
|
166
|
+
- unArchiveIssue **(new)**
|
|
167
|
+
|
|
168
|
+
- setIssueArchived was **removed**
|
|
169
|
+
|
|
3
170
|
## 0.17.5
|
|
4
171
|
|
|
5
172
|
- added `getIssue` (Jira Cloud and Jira Server)
|