@gitkraken/provider-apis 0.22.2 → 0.22.4

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.
@@ -1,5 +1,5 @@
1
1
  import { type Account } from '../types/exportedTypes/gitProvider';
2
- import type { ActionablePullRequest, EnrichedItemsByUniqueId, PullRequestBuckets, PullRequestWithUniqueID } from '../types/exportedTypes/types';
2
+ import type { ActionablePullRequest, CodeSuggestionsCountByPrUuid, EnrichedItemsByUniqueId, PullRequestBuckets, PullRequestWithUniqueID } from '../types/exportedTypes/types';
3
3
  export declare const PINNED_BUCKET_ID = "pinned";
4
4
  export declare const READY_TO_MERGE_BUCKET_ID = "readyToMerge";
5
5
  export declare const UNASSIGNED_REVIEWERS_BUCKET_ID = "unassignedReviewers";
@@ -24,7 +24,9 @@ export declare const DRAFT_ACTION_CATEGORY = "draft";
24
24
  export declare const OTHER_ACTION_CATEGORY = "other";
25
25
  export declare const getActionablePullRequests: (pullRequests: PullRequestWithUniqueID[], currentUser: Pick<Account, 'id'>, options?: {
26
26
  enrichedItemsByUniqueId?: EnrichedItemsByUniqueId;
27
+ codeSuggestionsCountByPrUuid?: CodeSuggestionsCountByPrUuid;
27
28
  }) => ActionablePullRequest[];
28
29
  export declare const groupPullRequestsIntoBuckets: (pullRequests: PullRequestWithUniqueID[], currentUser: Pick<Account, 'id'>, options?: {
29
30
  enrichedItemsByUniqueId?: EnrichedItemsByUniqueId;
31
+ codeSuggestionsCountByPrUuid?: CodeSuggestionsCountByPrUuid;
30
32
  }) => PullRequestBuckets;
@@ -1,7 +1,8 @@
1
1
  import { EnterpriseOptions } from '../../types/exportedTypes/gitProvider';
2
- import { GraphQLBody, GraphQLResponse, ProviderConfig } from '../../types/exportedTypes/types';
2
+ import { GraphQLBody, GraphQLError, GraphQLResponse, ProviderConfig } from '../../types/exportedTypes/types';
3
3
  export declare const GITLAB_API_URL = "https://gitlab.com/api/v4";
4
4
  export declare const GITLAB_GRAPHQL_API_URL = "https://gitlab.com/api/graphql";
5
5
  export declare const getRESTBaseUrl: (config: ProviderConfig, options: EnterpriseOptions) => string;
6
6
  export declare const getGraphQLEndpoint: (config: ProviderConfig, options: EnterpriseOptions) => string;
7
7
  export declare const makeGitLabGraphQLRequest: <T>(config: ProviderConfig, data: GraphQLBody, options: EnterpriseOptions) => Promise<import("../../types/exportedTypes/types").Response<GraphQLResponse<T>>>;
8
+ export declare const graphQLErrorsToString: (errors?: GraphQLError[]) => string | undefined;
@@ -52,6 +52,7 @@ export interface Issue {
52
52
  namespace: string | null;
53
53
  resourceId: string | null;
54
54
  name: string;
55
+ key: string | null;
55
56
  };
56
57
  state: {
57
58
  id?: string;
@@ -92,6 +92,11 @@ export interface PullRequestBucket {
92
92
  export type EnrichedItemsByUniqueId = {
93
93
  [uuid: string]: EnrichedItem[];
94
94
  };
95
+ export type CodeSuggestionsCountByPrUuid = {
96
+ [uuid: string]: {
97
+ count: number;
98
+ };
99
+ };
95
100
  export type EnrichedItem = {
96
101
  id: string;
97
102
  userId?: string;
@@ -126,6 +131,7 @@ export type ActionablePullRequest = PullRequestWithUniqueID & {
126
131
  failingCI: boolean;
127
132
  hasConflicts: boolean;
128
133
  changeRequestReviewCount: number;
134
+ codeSuggestionsCount: number;
129
135
  commentReviewCount: number;
130
136
  approvalReviewCount: number;
131
137
  };
@@ -88,6 +88,7 @@ export interface AzureReviewer extends AzureUser {
88
88
  vote: AzurePullRequestReviewState;
89
89
  hasDeclined: boolean;
90
90
  isFlagged: boolean;
91
+ isRequired?: boolean;
91
92
  }
92
93
  interface CompletionOptions {
93
94
  mergeCommitMessage: string;
package/dist/utils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { FieldMap } from './types/exportedTypes/types';
1
+ import { CursorPageInfo, FieldMap, NumberedPageInfo } from './types/exportedTypes/types';
2
2
  export declare const getRequestHeaders: (token?: string, basicAuth?: boolean) => Record<string, string>;
3
3
  export declare const toFieldMap: <T, K extends keyof T = keyof T>(fields?: K[] | undefined) => Partial<import("./types/exportedTypes/types").FullFieldMap<T>> | undefined;
4
4
  /**
@@ -9,3 +9,7 @@ export declare const toFieldMap: <T, K extends keyof T = keyof T>(fields?: K[] |
9
9
  * @returns string
10
10
  */
11
11
  export declare const fieldQuery: <T>(requestedFields: Partial<import("./types/exportedTypes/types").FullFieldMap<T>> | undefined, normalizedFields: (keyof T)[], providerQueryString: string) => string;
12
+ export declare const followCursors: <T>(fn: (cursor?: number | string | null) => Promise<{
13
+ pageInfo?: CursorPageInfo | NumberedPageInfo | undefined;
14
+ data: T[];
15
+ }>) => Promise<T[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitkraken/provider-apis",
3
- "version": "0.22.2",
3
+ "version": "0.22.4",
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",