@gitkraken/provider-apis 0.52.0 → 0.53.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 +7 -0
- package/dist/index.js +121 -121
- package/dist/index.provider-utils.js +1 -1
- package/dist/index.providers.js +142 -142
- package/dist/providers/bitbucket/bitbucket.d.ts +14 -1
- package/dist/providers/gitlab/gitlab.d.ts +14 -2
- package/dist/providers/issueProvider.d.ts +2 -1
- package/dist/types/exportedTypes/issueProvider.d.ts +5 -1
- package/dist/utils.d.ts +7 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RefreshTokenResponse } from '../../types/exportedTypes/bitbucket';
|
|
2
2
|
import { Account, CursorPageInput, GetRepoErrorData, GetRepoInput, GetReposInput, GitMergeStrategy, GitPullRequest, GitPullRequestState, GitRepository, GitRepositoryPermissions, NumberedPageInput, Options, SetAccountInput, SetPullRequestInput } from '../../types/exportedTypes/gitProvider';
|
|
3
|
-
import { NumberedPageInfo } from '../../types/exportedTypes/types';
|
|
3
|
+
import { NumberedPageInfo, Result } from '../../types/exportedTypes/types';
|
|
4
4
|
import { BitbucketRepositoryRole } from '../../types/internalTypes/bitbucket';
|
|
5
5
|
import { GitProvider } from '../gitProvider';
|
|
6
6
|
import { Provider } from '../provider';
|
|
@@ -159,6 +159,19 @@ export declare class Bitbucket extends Provider implements GitProvider {
|
|
|
159
159
|
pageInfo: NumberedPageInfo;
|
|
160
160
|
data: GitPullRequest[];
|
|
161
161
|
}>;
|
|
162
|
+
/**
|
|
163
|
+
* Bitbucket Cloud exposes no native workspace-level "PRs where this user is a reviewer" endpoint.
|
|
164
|
+
* This helper provides a workspace-scoped call surface by fanning out the existing repo-scoped
|
|
165
|
+
* reviewer query across either the provided repo subset or every accessible repo in the workspace.
|
|
166
|
+
*/
|
|
167
|
+
getPullRequestsForReviewerAndWorkspace(input: {
|
|
168
|
+
reviewerId: string;
|
|
169
|
+
workspaceSlug: string;
|
|
170
|
+
repos?: GetRepoInput[];
|
|
171
|
+
states?: GitPullRequestState[];
|
|
172
|
+
query?: string;
|
|
173
|
+
pageSize?: number;
|
|
174
|
+
}, options?: Options): Promise<Result<GitPullRequest[]>>;
|
|
162
175
|
private getPullRequestsForRepoBase;
|
|
163
176
|
getPullRequestsForRepo(input: {
|
|
164
177
|
repo: GetRepoInput;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Account, AddInlineCommentInput, CursorPageInput, DeleteCommentInput, EditCommentInput, EnterpriseOptions, GetMergeBaseInput, GetPullRequestDescriptionInput, GetRepoErrorData, GetRepoInput, GetReposInput, GitComment, GitLabel, GitMergeStrategy, GitPullRequest, GitPullRequestReview, GitPullRequestState, GitRepository, GitTreeItem, NumberedPageInput, PullRequestDescription, ResolveReviewThreadInput, SetAccountInput, SetLabelInput, SetMilestoneInput, SetPullRequestDescriptionInput, SetPullRequestInput } from '../../types/exportedTypes/gitProvider';
|
|
2
2
|
import { GitLabGetIssueInput, PullRequestAssociation } from '../../types/exportedTypes/gitlab';
|
|
3
|
-
import { GitIssueState, Issue, SetIssueInput } from '../../types/exportedTypes/issueProvider';
|
|
4
|
-
import { NumberedPageInfo, Result } from '../../types/exportedTypes/types';
|
|
3
|
+
import { GetIssuesForCurrentUserInput, GitIssueState, Issue, SetIssueInput } from '../../types/exportedTypes/issueProvider';
|
|
4
|
+
import { NumberedPageInfo, PagedResult, Result } from '../../types/exportedTypes/types';
|
|
5
5
|
import { GitProvider } from '../gitProvider';
|
|
6
6
|
import { IssueProvider } from '../issueProvider';
|
|
7
7
|
import { EnterpriseProvider } from '../provider';
|
|
@@ -273,6 +273,18 @@ export declare class GitLab extends EnterpriseProvider implements GitProvider, I
|
|
|
273
273
|
};
|
|
274
274
|
data: Issue[];
|
|
275
275
|
}>;
|
|
276
|
+
/**
|
|
277
|
+
* Account-wide "my issues" read via REST `GET /issues` (GitLab's GraphQL API has no top-level, cross-project
|
|
278
|
+
* issue field, so this is the only account-wide issue endpoint). Open issues only (`state=opened`).
|
|
279
|
+
*
|
|
280
|
+
* `scope` controls breadth: `assigned_to_me` returns issues assigned to the token's user (GitLab scopes to the
|
|
281
|
+
* current user server-side, no username needed); `all` returns every issue visible to the user and is combined
|
|
282
|
+
* with `assigneeUsername` to scope to a specific assignee, or left unfiltered for the "all assignees" broaden.
|
|
283
|
+
* Without `scope`, GitLab defaults to `created_by_me`, which is too narrow for a "my issues" read.
|
|
284
|
+
*
|
|
285
|
+
* Numbered pagination (`page`/`per_page` + the `x-next-page` header); one page per call — follow `pageInfo`.
|
|
286
|
+
*/
|
|
287
|
+
getIssuesForCurrentUser(input?: GetIssuesForCurrentUserInput, options?: EnterpriseOptions): Promise<PagedResult<Issue>>;
|
|
276
288
|
private setIssueState;
|
|
277
289
|
closeIssue(input: {
|
|
278
290
|
issue: SetIssueInput;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { GetRepoInput, Options, SetAccountInput, SetLabelInput, SetMilestoneInput } from '../types/exportedTypes/gitProvider';
|
|
2
|
-
import { GetIssueInput, GetIssuesForReposInput, Issue, SetIssueInput, SetStatusInput } from '../types/exportedTypes/issueProvider';
|
|
2
|
+
import { GetIssueInput, GetIssuesForCurrentUserInput, GetIssuesForReposInput, Issue, SetIssueInput, SetStatusInput } from '../types/exportedTypes/issueProvider';
|
|
3
3
|
import { PagedResult, Result } from '../types/exportedTypes/types';
|
|
4
4
|
export interface IssueProvider {
|
|
5
5
|
getIssue?(input: GetIssueInput, options: Options): Promise<Result<Issue>>;
|
|
6
|
+
getIssuesForCurrentUser?(input: GetIssuesForCurrentUserInput, options: Options): Promise<PagedResult<Issue>>;
|
|
6
7
|
getIssuesForRepo?(input: {
|
|
7
8
|
repo: GetRepoInput;
|
|
8
9
|
}, options: Options): Promise<PagedResult<Issue>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Account, GetReposInput, GitLabel, GitMilestone } from './gitProvider';
|
|
1
|
+
import { Account, CursorPageInput, GetReposInput, GitLabel, GitMilestone, NumberedPageInput } from './gitProvider';
|
|
2
2
|
export declare enum GitIssueState {
|
|
3
3
|
Open = "OPEN",
|
|
4
4
|
Closed = "CLOSED"
|
|
@@ -13,6 +13,10 @@ export interface GetIssueInput {
|
|
|
13
13
|
export type GetIssuesForReposInput = GetReposInput | {
|
|
14
14
|
repoIds: (string | number)[];
|
|
15
15
|
};
|
|
16
|
+
export type GetIssuesForCurrentUserInput = CursorPageInput | ({
|
|
17
|
+
scope?: 'assigned_to_me' | 'all';
|
|
18
|
+
assigneeUsername?: string;
|
|
19
|
+
} & NumberedPageInput);
|
|
16
20
|
export interface IssueTransition {
|
|
17
21
|
id: string;
|
|
18
22
|
name: string;
|
package/dist/utils.d.ts
CHANGED
|
@@ -63,11 +63,17 @@ export interface CollectAcrossScopesResult<S, R> {
|
|
|
63
63
|
* and is returned in `successes` for the caller to shape into its own data type.
|
|
64
64
|
*
|
|
65
65
|
* An empty `scopes` list yields `complete` metadata with no failures.
|
|
66
|
+
*
|
|
67
|
+
* By default every scope runs concurrently (`Promise.all`). Pass `concurrency` to cap the number of
|
|
68
|
+
* in-flight `run` calls via `runInParallelBatches`, which avoids thundering-herd rate limiting when a
|
|
69
|
+
* caller fans out over a large scope list (a workspace's repos, projects, or resources). Scope order
|
|
70
|
+
* in `successes` is preserved either way. A `concurrency` that isn't a positive integer throws.
|
|
66
71
|
*/
|
|
67
|
-
export declare function collectAcrossScopes<S, R>(scopes: S[], { run, failureScope, completeness, }: {
|
|
72
|
+
export declare function collectAcrossScopes<S, R>(scopes: S[], { run, failureScope, completeness, concurrency, }: {
|
|
68
73
|
run: (scope: S) => Promise<R | undefined>;
|
|
69
74
|
failureScope: (scope: S) => CollectionScope;
|
|
70
75
|
completeness?: (result: Exclude<R, undefined>) => CollectionCompleteness;
|
|
76
|
+
concurrency?: number;
|
|
71
77
|
}): Promise<CollectAcrossScopesResult<S, R>>;
|
|
72
78
|
export declare function getSettledValue<T>(promise: PromiseSettledResult<Awaited<T | undefined>>): T | undefined;
|
|
73
79
|
export declare function getSettledValue<T>(promise: PromiseSettledResult<Awaited<T | undefined>> | undefined, defaultValue: NonNullable<T>): NonNullable<T>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitkraken/provider-apis",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.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",
|