@gitkraken/provider-apis 0.17.3 → 0.17.5

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.
@@ -243,6 +243,10 @@ export interface GetReposInput {
243
243
  export type GetPRsForReposInput = GetReposInput | {
244
244
  repoIds: (string | number)[];
245
245
  };
246
+ export type GetPRForRepoInput = {
247
+ repo: GetRepoInput;
248
+ number: number;
249
+ };
246
250
  export interface CursorPageInput {
247
251
  cursor?: string | null;
248
252
  }
@@ -283,5 +287,6 @@ export interface GitProvider {
283
287
  path: string;
284
288
  }, options: Options): Promise<Result<GitBlame>>;
285
289
  getPullRequestsForRepos?(input: GetPRsForReposInput, options: Options): Promise<Result<GitPullRequest[]>>;
290
+ getPullRequestForRepo?(input: GetPRForRepoInput, options: Options): Promise<Result<GitPullRequest | null>>;
286
291
  }
287
292
  export declare const MAX_PAGE_SIZE = 100;
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import { Account, CursorPageInput, EnterpriseOptions, GetRepoErrorData, GetRepoInput, GitLabel, GitMergeStrategy, GitMilestone, GitProvider, GitPullRequest, GitPullRequestReviewComment, GitRepository, Organization } from '../gitProvider';
2
3
  import { Issue } from '../issueProvider';
3
4
  import { EnterpriseProvider } from '../provider';
@@ -152,6 +153,13 @@ export declare class GitHub extends EnterpriseProvider implements GitProvider {
152
153
  }[];
153
154
  };
154
155
  }>;
156
+ getFileContents(input: {
157
+ repo: GetRepoInput;
158
+ path: string;
159
+ ref: string;
160
+ }, options?: EnterpriseOptions): Promise<{
161
+ data: import("buffer").Blob;
162
+ }>;
155
163
  searchPullRequests(input: {
156
164
  query: string;
157
165
  isDraft?: boolean;
@@ -190,6 +198,17 @@ export declare class GitHub extends EnterpriseProvider implements GitProvider {
190
198
  };
191
199
  data: GitPullRequest[];
192
200
  }>;
201
+ getPullRequestForRepo(input: {
202
+ repo: GetRepoInput;
203
+ number: number;
204
+ }, options?: EnterpriseOptions): Promise<{
205
+ data: GitPullRequest | null;
206
+ }>;
207
+ getPullRequestByGraphQLId(input: {
208
+ graphQLId: string;
209
+ }, options?: EnterpriseOptions): Promise<{
210
+ data: GitPullRequest | null;
211
+ }>;
193
212
  closePullRequest(input: {
194
213
  pullRequestGraphQLId: string;
195
214
  }, options?: EnterpriseOptions): Promise<void>;
@@ -1,5 +1,13 @@
1
1
  import { FieldMap, GraphQLBody, GraphQLError, GraphQLResponse, ProviderConfig } from '../../types';
2
2
  import { Account, EnterpriseOptions, GitDiffLineType } from '../gitProvider';
3
+ export declare const minimumFeatureVersions: {
4
+ AS_CODE_OWNER: number[];
5
+ CHECK_RUN: number[];
6
+ LATEST_REVIEWS: number[];
7
+ VIEWER_CAN_MERGE_AS_ADMIN: number[];
8
+ };
9
+ type MinimumFeatureVersions = typeof minimumFeatureVersions;
10
+ export declare const doesEnterpriseSupportFeature: (enterpriseVersion: [number, number, number], feature: keyof MinimumFeatureVersions) => boolean;
3
11
  export declare const GITHUB_API_URL = "https://api.github.com";
4
12
  export declare const GITHUB_GRAPHQL_API_URL: string;
5
13
  export declare const GRAPHQL_MILESTONE_FIELDS = "\ndescription\ndueOn\nid\nnumber\nstate\ntitle\nurl\n";
@@ -10,11 +18,11 @@ export declare const makeGitHubGraphQLRequest: <T>(config: ProviderConfig, data:
10
18
  export declare const hasEmailScope: (scopes: string[]) => boolean;
11
19
  export declare const getAccountFields: (withAvatarSizeVar?: boolean, includeEmail?: boolean, fields?: FieldMap<Account>) => string;
12
20
  export declare const getBotFields: (withAvatarSizeVar?: boolean) => string;
13
- export declare const getPullRequestFields: (isDraftPullRequestSupported: boolean, includeEmail: boolean | undefined, supportsEnterpriseVersion3: boolean) => string;
21
+ export declare const getPullRequestFields: (isDraftPullRequestSupported: boolean, includeEmail: boolean | undefined, enterpriseVersion: [number, number, number] | null) => string;
14
22
  export declare const getIssueFields: (includeEmail?: boolean) => string;
15
23
  export declare const GithubSearchSyntaxQualifiers: Record<string, string>;
16
24
  export declare const getProjectGithubSearchSyntax: (search: string) => string[];
17
- export declare const makeSearchIssuesOrPRsGraphQLBody: (type: 'issue' | 'pr', query: string, cursor: string | null | undefined, supportsEmail: boolean, supportsDrafts?: boolean, supportsEnterpriseVersion3?: boolean) => GraphQLBody;
25
+ export declare const makeSearchIssuesOrPRsGraphQLBody: (type: 'issue' | 'pr', query: string, cursor: string | null | undefined, supportsEmail: boolean, supportsDrafts?: boolean, enterpriseVersion?: [number, number, number] | null) => GraphQLBody;
18
26
  export declare const hasDraftsNotSupportedError: (errors?: GraphQLError[]) => boolean;
19
27
  export declare const getDiffLinesFromDiffHunk: (diffHunk: string, originalLine: number | null, originalStartLine: number | null, startDiffSide: 'LEFT' | 'RIGHT' | null) => {
20
28
  line: string;
@@ -22,3 +30,4 @@ export declare const getDiffLinesFromDiffHunk: (diffHunk: string, originalLine:
22
30
  newLineNumber: number | null;
23
31
  type: GitDiffLineType;
24
32
  }[];
33
+ export {};
@@ -216,7 +216,7 @@ export interface GraphQLPullRequest {
216
216
  labels: {
217
217
  nodes: GraphQLLabel[] | null;
218
218
  } | null;
219
- viewerCanMergeAsAdmin: boolean;
219
+ viewerCanMergeAsAdmin?: boolean;
220
220
  }
221
221
  export interface GraphQLIssue {
222
222
  id: string;
@@ -5,10 +5,10 @@ export declare enum GitIssueState {
5
5
  Closed = "CLOSED"
6
6
  }
7
7
  export interface GetIssueInput {
8
- id: string;
9
- name: string;
10
8
  namespace: string;
11
- project: string;
9
+ project?: string;
10
+ name: string;
11
+ number: string;
12
12
  }
13
13
  export type GetIssuesForReposInput = GetReposInput | {
14
14
  repoIds: (string | number)[];
@@ -69,6 +69,12 @@ export declare class Jira extends Provider {
69
69
  }, options?: EnterpriseOptions): Promise<{
70
70
  data: import("./sharedTypes").JiraComponent[];
71
71
  }>;
72
+ getIssue(input: {
73
+ resourceId: string;
74
+ number: string;
75
+ }, options?: EnterpriseOptions): Promise<{
76
+ data: import("../issueProvider").Issue;
77
+ }>;
72
78
  getIssuesForProject(input: {
73
79
  project: string;
74
80
  resourceId: string;
@@ -14,6 +14,12 @@ export declare const normalizeUser: (user: JiraUser, resourceUrl: string | null,
14
14
  username: string;
15
15
  url: string;
16
16
  };
17
+ export declare const getIssue: (config: ProviderConfig, input: {
18
+ resourceId?: string;
19
+ number: string;
20
+ } & NumberedPageInput, resourceUrl: string | null, options?: EnterpriseOptions) => Promise<{
21
+ data: Issue;
22
+ }>;
17
23
  export declare const getIssuesForResourceForCurrentUser: (config: ProviderConfig, input: {
18
24
  resourceId?: string;
19
25
  } & NumberedPageInput, resourceUrl: string | null, options?: EnterpriseOptions) => Promise<{
@@ -21,6 +21,11 @@ export declare class JiraServer extends EnterpriseProvider {
21
21
  name: string;
22
22
  }[];
23
23
  }>;
24
+ getIssue(input: {
25
+ number: string;
26
+ }, options?: EnterpriseOptions): Promise<{
27
+ data: import("../issueProvider").Issue;
28
+ }>;
24
29
  getIssuesForProject(input: {
25
30
  project: string;
26
31
  assigneeLogins?: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitkraken/provider-apis",
3
- "version": "0.17.3",
3
+ "version": "0.17.5",
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",