@gitkraken/provider-apis 0.15.2 → 0.17.0
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 +20 -0
- package/dist/index.js +71 -72
- package/dist/providers/azureDevops/azureDevOps.d.ts +33 -4
- package/dist/providers/azureDevops/azureDevOpsTypes.d.ts +8 -0
- package/dist/providers/gitProvider.d.ts +17 -25
- package/dist/providers/github/githubTypes.d.ts +48 -1
- package/dist/providers/gitlab/gitlabTypes.d.ts +14 -0
- package/dist/providers/jira/jira.d.ts +11 -3
- package/dist/providers/jira/sharedHelpers.d.ts +11 -3
- package/dist/providers/jiraServer/jiraServer.d.ts +11 -3
- package/package.json +1 -2
|
@@ -2,7 +2,7 @@ import { PagedResult, Result } from '../../types';
|
|
|
2
2
|
import { CursorPageInput, EnterpriseOptions, GetRepoErrorData, GetRepoInput, GitMergeStrategy, GitProvider, GitPullRequest, GitRepository, NumberedPageInput, Options } from '../gitProvider';
|
|
3
3
|
import { Issue } from '../issueProvider';
|
|
4
4
|
import { Provider } from '../provider';
|
|
5
|
-
import { PullRequestAsyncStatus, WorkItemType } from './azureDevOpsTypes';
|
|
5
|
+
import { AzureGraphAccount, PullRequestAsyncStatus, WorkItemType } from './azureDevOpsTypes';
|
|
6
6
|
export interface AzureGetRepoInput extends GetRepoInput {
|
|
7
7
|
project: string;
|
|
8
8
|
}
|
|
@@ -73,16 +73,45 @@ export declare class AzureDevOps extends Provider implements GitProvider {
|
|
|
73
73
|
scope: string;
|
|
74
74
|
};
|
|
75
75
|
}>;
|
|
76
|
-
|
|
76
|
+
getAzureGraphAccountsForAzureProject(input: {
|
|
77
77
|
namespace: string;
|
|
78
78
|
projectScopeDescriptor?: string;
|
|
79
|
+
} & CursorPageInput, options?: Options): Promise<{
|
|
80
|
+
pageInfo: {
|
|
81
|
+
endCursor: string | null;
|
|
82
|
+
hasNextPage: boolean;
|
|
83
|
+
};
|
|
84
|
+
data: {
|
|
85
|
+
avatarUrl: string | null;
|
|
86
|
+
descriptor: string;
|
|
87
|
+
email: string;
|
|
88
|
+
name: string;
|
|
89
|
+
storageKeyURL: string;
|
|
90
|
+
username: string;
|
|
91
|
+
}[];
|
|
92
|
+
}>;
|
|
93
|
+
getAccountFromAzureGraphAccount(input: {
|
|
94
|
+
azureGraphAccount: AzureGraphAccount;
|
|
79
95
|
}, options?: Options): Promise<{
|
|
80
96
|
data: {
|
|
97
|
+
avatarUrl: string | null;
|
|
98
|
+
email: string | null;
|
|
81
99
|
id: string;
|
|
82
100
|
name: string;
|
|
83
101
|
username: string;
|
|
84
|
-
|
|
85
|
-
|
|
102
|
+
url: null;
|
|
103
|
+
};
|
|
104
|
+
}>;
|
|
105
|
+
getAccountsFromAzureGraphAccounts(input: {
|
|
106
|
+
azureGraphAccounts: AzureGraphAccount[];
|
|
107
|
+
}, options?: Options): Promise<{
|
|
108
|
+
data: {
|
|
109
|
+
avatarUrl: string | null;
|
|
110
|
+
email: string | null;
|
|
111
|
+
id: string;
|
|
112
|
+
name: string;
|
|
113
|
+
username: string;
|
|
114
|
+
url: null;
|
|
86
115
|
}[];
|
|
87
116
|
}>;
|
|
88
117
|
getRepo(input: AzureGetRepoInput, options?: Options): Promise<{
|
|
@@ -232,6 +232,14 @@ export interface WorkItemType {
|
|
|
232
232
|
states: WorkItemState[];
|
|
233
233
|
url: string;
|
|
234
234
|
}
|
|
235
|
+
export interface AzureGraphAccount {
|
|
236
|
+
avatarUrl: string | null;
|
|
237
|
+
descriptor: string;
|
|
238
|
+
email: string | null;
|
|
239
|
+
name: string;
|
|
240
|
+
storageKeyURL: string;
|
|
241
|
+
username: string;
|
|
242
|
+
}
|
|
235
243
|
export interface UpdatePullRequestResponse {
|
|
236
244
|
status: string;
|
|
237
245
|
}
|
|
@@ -31,40 +31,23 @@ export declare enum GitBuildStatusStage {
|
|
|
31
31
|
Staging = "staging",
|
|
32
32
|
Test = "test"
|
|
33
33
|
}
|
|
34
|
-
export declare enum
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
Pending = "PENDING",
|
|
38
|
-
Queued = "QUEUED",
|
|
39
|
-
Requested = "REQUESTED",
|
|
40
|
-
Waiting = "WAITING"
|
|
41
|
-
}
|
|
42
|
-
export declare enum GitHubStatusState {
|
|
34
|
+
export declare enum GitBuildStatusState {
|
|
35
|
+
ActionRequired = "ACTION_REQUIRED",
|
|
36
|
+
Cancelled = "CANCELLED",
|
|
43
37
|
Error = "ERROR",
|
|
44
|
-
Expected = "EXPECTED",
|
|
45
|
-
Failure = "FAILURE",
|
|
46
|
-
Pending = "PENDING",
|
|
47
|
-
Success = "SUCCESS"
|
|
48
|
-
}
|
|
49
|
-
export declare enum GitLabCiJobStatus {
|
|
50
|
-
Canceled = "CANCELED",
|
|
51
|
-
Created = "CREATED",
|
|
52
38
|
Failed = "FAILED",
|
|
53
|
-
Manual = "MANUAL",
|
|
54
39
|
Pending = "PENDING",
|
|
55
|
-
Preparing = "PREPARING",
|
|
56
40
|
Running = "RUNNING",
|
|
57
|
-
Scheduled = "SCHEDULED",
|
|
58
41
|
Skipped = "SKIPPED",
|
|
59
42
|
Success = "SUCCESS",
|
|
60
|
-
|
|
61
|
-
|
|
43
|
+
Warning = "WARNING",
|
|
44
|
+
OptionalActionRequired = "OPTIONAL_ACTION_REQUIRED"
|
|
62
45
|
}
|
|
63
46
|
export interface GitBuildStatus {
|
|
64
47
|
completedAt: Date | null;
|
|
65
48
|
description: string | null;
|
|
66
49
|
name: string | null;
|
|
67
|
-
state:
|
|
50
|
+
state: GitBuildStatusState | null;
|
|
68
51
|
stage: GitBuildStatusStage | null;
|
|
69
52
|
startedAt: Date | null;
|
|
70
53
|
url: string;
|
|
@@ -147,9 +130,17 @@ export declare enum GitPullRequestReviewState {
|
|
|
147
130
|
ReviewRequested = "REVIEW_REQUESTED"
|
|
148
131
|
}
|
|
149
132
|
export declare enum GitPullRequestMergeableState {
|
|
150
|
-
|
|
133
|
+
Behind = "BEHIND",
|
|
134
|
+
Blocked = "BLOCKED",
|
|
151
135
|
Conflicts = "CONFLICTS",
|
|
152
|
-
|
|
136
|
+
Mergeable = "MERGEABLE",
|
|
137
|
+
Unknown = "UNKNOWN",
|
|
138
|
+
UnknownAndBlocked = "UNKNOWN_AND_BLOCKED",
|
|
139
|
+
Unstable = "UNSTABLE"
|
|
140
|
+
}
|
|
141
|
+
export interface GitPullRequestPermissions {
|
|
142
|
+
canMerge: boolean;
|
|
143
|
+
canMergeAndBypassProtections: boolean;
|
|
153
144
|
}
|
|
154
145
|
export interface GitPullRequest {
|
|
155
146
|
id: string;
|
|
@@ -210,6 +201,7 @@ export interface GitPullRequest {
|
|
|
210
201
|
mergeableState: GitPullRequestMergeableState;
|
|
211
202
|
milestone?: GitMilestone | null;
|
|
212
203
|
labels?: GitLabel[];
|
|
204
|
+
permissions: GitPullRequestPermissions | null;
|
|
213
205
|
}
|
|
214
206
|
export interface GitComment {
|
|
215
207
|
author: Account | User | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GetRepoInput
|
|
1
|
+
import { GetRepoInput } from '../gitProvider';
|
|
2
2
|
export declare enum GraphQLViewerPermission {
|
|
3
3
|
ADMIN = "ADMIN",
|
|
4
4
|
MAINTAIN = "MAINTAIN",
|
|
@@ -41,6 +41,23 @@ export declare enum GitHubPullRequestMergeableState {
|
|
|
41
41
|
Conflicting = "CONFLICTING",
|
|
42
42
|
Unknown = "UNKNOWN"
|
|
43
43
|
}
|
|
44
|
+
export declare enum GitHubPullRequestMergeStateStatus {
|
|
45
|
+
Behind = "BEHIND",
|
|
46
|
+
Blocked = "BLOCKED",
|
|
47
|
+
Clean = "CLEAN",
|
|
48
|
+
Dirty = "DIRTY",
|
|
49
|
+
Draft = "DRAFT",
|
|
50
|
+
HasHooks = "HAS_HOOKS",
|
|
51
|
+
Unknown = "UNKNOWN",
|
|
52
|
+
Unstable = "UNSTABLE"
|
|
53
|
+
}
|
|
54
|
+
export declare enum GitHubRepositoryPermission {
|
|
55
|
+
Admin = "ADMIN",
|
|
56
|
+
Maintain = "MAINTAIN",
|
|
57
|
+
Read = "READ",
|
|
58
|
+
Triage = "TRIAGE",
|
|
59
|
+
Write = "WRITE"
|
|
60
|
+
}
|
|
44
61
|
export interface GraphQLUser {
|
|
45
62
|
__typename: 'User';
|
|
46
63
|
id: string;
|
|
@@ -68,8 +85,35 @@ export interface GraphQLOrganization {
|
|
|
68
85
|
avatarUrl: string;
|
|
69
86
|
}
|
|
70
87
|
export type PullRequestState = 'OPEN' | 'CLOSED' | 'MERGED';
|
|
88
|
+
export declare enum GitHubCheckRunState {
|
|
89
|
+
Completed = "COMPLETED",
|
|
90
|
+
InProgress = "IN_PROGRESS",
|
|
91
|
+
Pending = "PENDING",
|
|
92
|
+
Queued = "QUEUED",
|
|
93
|
+
Requested = "REQUESTED",
|
|
94
|
+
Waiting = "WAITING"
|
|
95
|
+
}
|
|
96
|
+
export declare enum GitHubCheckRunConclusionState {
|
|
97
|
+
ActionRequired = "ACTION_REQUIRED",
|
|
98
|
+
Cancelled = "CANCELLED",
|
|
99
|
+
Failure = "FAILURE",
|
|
100
|
+
Neutral = "NEUTRAL",
|
|
101
|
+
Skipped = "SKIPPED",
|
|
102
|
+
Stale = "STALE",
|
|
103
|
+
StartupFailure = "STARTUP_FAILURE",
|
|
104
|
+
Success = "SUCCESS",
|
|
105
|
+
TimedOut = "TIMED_OUT"
|
|
106
|
+
}
|
|
107
|
+
export declare enum GitHubStatusState {
|
|
108
|
+
Error = "ERROR",
|
|
109
|
+
Expected = "EXPECTED",
|
|
110
|
+
Failure = "FAILURE",
|
|
111
|
+
Pending = "PENDING",
|
|
112
|
+
Success = "SUCCESS"
|
|
113
|
+
}
|
|
71
114
|
export interface GraphQLCheckRun {
|
|
72
115
|
completedAt: string | null;
|
|
116
|
+
conclusion: GitHubCheckRunConclusionState;
|
|
73
117
|
name: string;
|
|
74
118
|
permalink: string;
|
|
75
119
|
startedAt: string | null;
|
|
@@ -150,6 +194,7 @@ export interface GraphQLPullRequest {
|
|
|
150
194
|
};
|
|
151
195
|
sshUrl: string;
|
|
152
196
|
url: string;
|
|
197
|
+
viewerPermission: GitHubRepositoryPermission;
|
|
153
198
|
};
|
|
154
199
|
reviewRequests: {
|
|
155
200
|
nodes: {
|
|
@@ -166,10 +211,12 @@ export interface GraphQLPullRequest {
|
|
|
166
211
|
url: string;
|
|
167
212
|
updatedAt: string;
|
|
168
213
|
mergeable: GitHubPullRequestMergeableState;
|
|
214
|
+
mergeStateStatus: GitHubPullRequestMergeStateStatus;
|
|
169
215
|
milestone: GraphQLMilestone | null;
|
|
170
216
|
labels: {
|
|
171
217
|
nodes: GraphQLLabel[] | null;
|
|
172
218
|
} | null;
|
|
219
|
+
viewerCanMergeAsAdmin: boolean;
|
|
173
220
|
}
|
|
174
221
|
export interface GraphQLIssue {
|
|
175
222
|
id: string;
|
|
@@ -38,3 +38,17 @@ export declare enum GitLabPullRequestMergeableState {
|
|
|
38
38
|
Unchecked = "UNCHECKED",
|
|
39
39
|
Checking = "CHECKING"
|
|
40
40
|
}
|
|
41
|
+
export declare enum GitLabCiJobStatus {
|
|
42
|
+
Canceled = "CANCELED",
|
|
43
|
+
Created = "CREATED",
|
|
44
|
+
Failed = "FAILED",
|
|
45
|
+
Manual = "MANUAL",
|
|
46
|
+
Pending = "PENDING",
|
|
47
|
+
Preparing = "PREPARING",
|
|
48
|
+
Running = "RUNNING",
|
|
49
|
+
Scheduled = "SCHEDULED",
|
|
50
|
+
Skipped = "SKIPPED",
|
|
51
|
+
Success = "SUCCESS",
|
|
52
|
+
WaitingForCallback = "WAITING_FOR_CALLBACK",
|
|
53
|
+
WaitingForResource = "WAITING_FOR_RESOURCE"
|
|
54
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Result } from '../../types';
|
|
2
|
-
import { CursorPageInput, EnterpriseOptions } from '../gitProvider';
|
|
2
|
+
import { CursorPageInput, EnterpriseOptions, NumberedPageInput } from '../gitProvider';
|
|
3
3
|
import { Provider } from '../provider';
|
|
4
4
|
export interface JiraResource {
|
|
5
5
|
id: string;
|
|
@@ -75,13 +75,21 @@ export declare class Jira extends Provider {
|
|
|
75
75
|
assigneeLogins?: string[];
|
|
76
76
|
authorLogin?: string;
|
|
77
77
|
mentionLogin?: string;
|
|
78
|
-
}, options?: EnterpriseOptions): Promise<{
|
|
78
|
+
} & NumberedPageInput, options?: EnterpriseOptions): Promise<{
|
|
79
79
|
data: import("../issueProvider").Issue[];
|
|
80
|
+
pageInfo: {
|
|
81
|
+
hasNextPage: boolean;
|
|
82
|
+
nextPage: number | null;
|
|
83
|
+
};
|
|
80
84
|
}>;
|
|
81
85
|
getIssuesForResourceForCurrentUser(input: {
|
|
82
86
|
resourceId: string;
|
|
83
|
-
}, options?: EnterpriseOptions): Promise<{
|
|
87
|
+
} & NumberedPageInput, options?: EnterpriseOptions): Promise<{
|
|
84
88
|
data: import("../issueProvider").Issue[];
|
|
89
|
+
pageInfo: {
|
|
90
|
+
hasNextPage: boolean;
|
|
91
|
+
nextPage: number | null;
|
|
92
|
+
};
|
|
85
93
|
}>;
|
|
86
94
|
setIssueStatus(input: {
|
|
87
95
|
resourceId: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ProviderConfig } from '../../types';
|
|
2
|
-
import { EnterpriseOptions } from '../gitProvider';
|
|
2
|
+
import { EnterpriseOptions, NumberedPageInput } from '../gitProvider';
|
|
3
3
|
import { Issue, IssueComponent, IssueTransition } from '../issueProvider';
|
|
4
4
|
import { JiraComponent, JiraComponentStub, JiraIssue, JiraTransition, JiraUser } from './sharedTypes';
|
|
5
5
|
export declare const normalizeIssue: (issue: JiraIssue, resourceUrl: string | null, isServer: boolean) => Issue;
|
|
@@ -16,8 +16,12 @@ export declare const normalizeUser: (user: JiraUser, resourceUrl: string | null,
|
|
|
16
16
|
};
|
|
17
17
|
export declare const getIssuesForResourceForCurrentUser: (config: ProviderConfig, input: {
|
|
18
18
|
resourceId?: string;
|
|
19
|
-
}, resourceUrl: string | null, options?: EnterpriseOptions) => Promise<{
|
|
19
|
+
} & NumberedPageInput, resourceUrl: string | null, options?: EnterpriseOptions) => Promise<{
|
|
20
20
|
data: Issue[];
|
|
21
|
+
pageInfo: {
|
|
22
|
+
hasNextPage: boolean;
|
|
23
|
+
nextPage: number | null;
|
|
24
|
+
};
|
|
21
25
|
}>;
|
|
22
26
|
export declare const getIssuesForProject: (config: ProviderConfig, input: {
|
|
23
27
|
resourceId?: string;
|
|
@@ -25,8 +29,12 @@ export declare const getIssuesForProject: (config: ProviderConfig, input: {
|
|
|
25
29
|
assigneeLogins?: string[];
|
|
26
30
|
authorLogin?: string;
|
|
27
31
|
mentionLogin?: string;
|
|
28
|
-
}, resourceUrl: string | null, options?: EnterpriseOptions) => Promise<{
|
|
32
|
+
} & NumberedPageInput, resourceUrl: string | null, options?: EnterpriseOptions) => Promise<{
|
|
29
33
|
data: Issue[];
|
|
34
|
+
pageInfo: {
|
|
35
|
+
hasNextPage: boolean;
|
|
36
|
+
nextPage: number | null;
|
|
37
|
+
};
|
|
30
38
|
}>;
|
|
31
39
|
export declare const setIssueLabels: (config: ProviderConfig, input: {
|
|
32
40
|
resourceId?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EnterpriseOptions } from '../gitProvider';
|
|
1
|
+
import { EnterpriseOptions, NumberedPageInput } from '../gitProvider';
|
|
2
2
|
import { EnterpriseProvider } from '../provider';
|
|
3
3
|
export interface JiraServerProject {
|
|
4
4
|
id: string;
|
|
@@ -26,11 +26,19 @@ export declare class JiraServer extends EnterpriseProvider {
|
|
|
26
26
|
assigneeLogins?: string[];
|
|
27
27
|
authorLogin?: string;
|
|
28
28
|
mentionLogin?: string;
|
|
29
|
-
}, options?: EnterpriseOptions): Promise<{
|
|
29
|
+
} & NumberedPageInput, options?: EnterpriseOptions): Promise<{
|
|
30
30
|
data: import("../issueProvider").Issue[];
|
|
31
|
+
pageInfo: {
|
|
32
|
+
hasNextPage: boolean;
|
|
33
|
+
nextPage: number | null;
|
|
34
|
+
};
|
|
31
35
|
}>;
|
|
32
|
-
getIssuesForResourceForCurrentUser(input:
|
|
36
|
+
getIssuesForResourceForCurrentUser(input: NumberedPageInput, options?: EnterpriseOptions): Promise<{
|
|
33
37
|
data: import("../issueProvider").Issue[];
|
|
38
|
+
pageInfo: {
|
|
39
|
+
hasNextPage: boolean;
|
|
40
|
+
nextPage: number | null;
|
|
41
|
+
};
|
|
34
42
|
}>;
|
|
35
43
|
setIssueStatus(input: {
|
|
36
44
|
issueId: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitkraken/provider-apis",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "An SDK around different third-party APIs that accepts and returns data in a common format.",
|
|
5
5
|
"author": "Axosoft, LLC dba GitKraken",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"watch": "yarn clean && node ./scripts/build.mjs --watch & tsc -w"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"js-base64": "3.7.5",
|
|
33
32
|
"node-fetch": "2.7.0"
|
|
34
33
|
},
|
|
35
34
|
"devDependencies": {
|