@gitkraken/provider-apis 0.29.9 → 0.30.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 +8 -0
- package/dist/defaults.d.ts +1 -6
- package/dist/index.js +249 -192
- package/dist/index.provider-utils.js +1 -1
- package/dist/index.providers.js +241 -184
- package/dist/providers/github/github.d.ts +1 -2
- package/dist/providers/linear/linear.d.ts +4 -2
- package/dist/providers/linear/linearHelpers.d.ts +28 -0
- package/dist/types/exportedTypes/linear.d.ts +25 -0
- package/dist/types/exportedTypes/types.d.ts +2 -3
- package/package.json +4 -5
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Account, CreateCommitInput, CursorPageInput, EnterpriseOptions, GetRepoErrorData, GetRepoInput, GitLabel, GitMergeStrategy, GitMilestone, GitPullRequest, GitPullRequestReviewComment, GitPullRequestReviewState, GitRepository, GitTreeItem, NumberedPageInput, Organization, SetAccountInput, SetLabelInput, SetMilestoneInput, SetPullRequestInput } from '../../types/exportedTypes/gitProvider';
|
|
3
2
|
import { FetchIssuesData, FetchPullRequestsData, GitHubIssueCloseReason } from '../../types/exportedTypes/github';
|
|
4
3
|
import { Issue, SetIssueInput } from '../../types/exportedTypes/issueProvider';
|
|
@@ -206,7 +205,7 @@ export declare class GitHub extends EnterpriseProvider implements GitProvider, I
|
|
|
206
205
|
path: string;
|
|
207
206
|
ref: string;
|
|
208
207
|
}, options?: EnterpriseOptions): Promise<{
|
|
209
|
-
data:
|
|
208
|
+
data: Blob;
|
|
210
209
|
}>;
|
|
211
210
|
searchPullRequests(input: {
|
|
212
211
|
query: string;
|
|
@@ -3,12 +3,11 @@ import { Options } from '../../types/exportedTypes/gitProvider';
|
|
|
3
3
|
import { GetIssueInput, Issue } from '../../types/exportedTypes/issueProvider';
|
|
4
4
|
import { Result } from '../../types/exportedTypes/types';
|
|
5
5
|
import { CursorPageInput } from '../../types/exportedTypes/gitProvider';
|
|
6
|
-
import { LinearGetIssuesInput, LinearOrganization, LinearTeam } from '../../types/exportedTypes/linear';
|
|
6
|
+
import { LinearCycle, LinearGetIssuesInput, LinearLabel, LinearOrganization, LinearProject, LinearTeam } from '../../types/exportedTypes/linear';
|
|
7
7
|
import { PagedResult } from '../../types/exportedTypes/types';
|
|
8
8
|
import { IssueProvider } from '../issueProvider';
|
|
9
9
|
import { Provider } from '../provider';
|
|
10
10
|
export declare class Linear extends Provider implements IssueProvider {
|
|
11
|
-
private makeGraphQLRequest;
|
|
12
11
|
private fetchIssue;
|
|
13
12
|
private fetchOrganization;
|
|
14
13
|
private fetchTeams;
|
|
@@ -17,6 +16,9 @@ export declare class Linear extends Provider implements IssueProvider {
|
|
|
17
16
|
getIssue(input: GetIssueInput, options?: Options): Promise<Result<Issue>>;
|
|
18
17
|
getLinearOrganization(options?: Options): Promise<Result<LinearOrganization>>;
|
|
19
18
|
getTeamsForCurrentUser(options?: Options): Promise<Result<LinearTeam[]>>;
|
|
19
|
+
getProjects(input?: CursorPageInput, options?: Options): Promise<PagedResult<LinearProject>>;
|
|
20
|
+
getCycles(input?: CursorPageInput, options?: Options): Promise<PagedResult<LinearCycle>>;
|
|
21
|
+
getLabels(input?: CursorPageInput, options?: Options): Promise<PagedResult<LinearLabel>>;
|
|
20
22
|
getCurrentUser(options?: Options): Promise<Result<LinearUser>>;
|
|
21
23
|
getIssuesForCurrentUser(input: CursorPageInput, options?: Options): Promise<PagedResult<Issue>>;
|
|
22
24
|
getIssues(input: LinearGetIssuesInput & CursorPageInput, options?: Options): Promise<PagedResult<Issue>>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Cycle, IssueLabel, Project } from '@linear/sdk';
|
|
2
|
+
import { LinearCycle, LinearLabel, LinearProject, Options, ProviderConfig } from '../..';
|
|
1
3
|
export declare class UniqueIdsArr<T extends {
|
|
2
4
|
id: string;
|
|
3
5
|
}> {
|
|
@@ -7,3 +9,29 @@ export declare class UniqueIdsArr<T extends {
|
|
|
7
9
|
get length(): number;
|
|
8
10
|
get items(): T[];
|
|
9
11
|
}
|
|
12
|
+
export declare const makeGraphQLRequest: <T>(config: ProviderConfig, options: Options, query: string, variables?: Record<string, unknown>) => Promise<T>;
|
|
13
|
+
export declare const normalizeDate: (date: string | Date | undefined) => Date | null;
|
|
14
|
+
export declare const normalizeFullProject: (project: Project) => LinearProject;
|
|
15
|
+
export declare const fetchProjects: (config: ProviderConfig, options: Options, cursor?: string) => Promise<{
|
|
16
|
+
nodes: Project[];
|
|
17
|
+
pageInfo: {
|
|
18
|
+
hasNextPage: boolean;
|
|
19
|
+
endCursor?: string;
|
|
20
|
+
};
|
|
21
|
+
}>;
|
|
22
|
+
export declare const normalizeFullCycle: (cycle: Cycle) => LinearCycle;
|
|
23
|
+
export declare const fetchCycles: (config: ProviderConfig, options: Options, cursor?: string) => Promise<{
|
|
24
|
+
nodes: Cycle[];
|
|
25
|
+
pageInfo: {
|
|
26
|
+
hasNextPage: boolean;
|
|
27
|
+
endCursor?: string;
|
|
28
|
+
};
|
|
29
|
+
}>;
|
|
30
|
+
export declare const normalizeFullLabel: (label: IssueLabel) => LinearLabel;
|
|
31
|
+
export declare const fetchLabels: (config: ProviderConfig, options: Options, cursor?: string) => Promise<{
|
|
32
|
+
nodes: IssueLabel[];
|
|
33
|
+
pageInfo: {
|
|
34
|
+
hasNextPage: boolean;
|
|
35
|
+
endCursor?: string;
|
|
36
|
+
};
|
|
37
|
+
}>;
|
|
@@ -10,6 +10,31 @@ export interface LinearOrganization {
|
|
|
10
10
|
key: string;
|
|
11
11
|
url: string;
|
|
12
12
|
}
|
|
13
|
+
export interface LinearProject {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
description: string | null;
|
|
17
|
+
state: string;
|
|
18
|
+
startDate: Date | null;
|
|
19
|
+
targetDate: Date | null;
|
|
20
|
+
url: string;
|
|
21
|
+
}
|
|
22
|
+
export interface LinearCycle {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
number: number;
|
|
26
|
+
description: string | null;
|
|
27
|
+
startsAt: Date;
|
|
28
|
+
endsAt: Date;
|
|
29
|
+
completedAt: Date | null;
|
|
30
|
+
url: string;
|
|
31
|
+
}
|
|
32
|
+
export interface LinearLabel {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
color: string;
|
|
36
|
+
description: string | null;
|
|
37
|
+
}
|
|
13
38
|
export interface LinearGetIssuesInput {
|
|
14
39
|
teams?: string[];
|
|
15
40
|
projects?: string[];
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="node-fetch" />
|
|
2
1
|
import { Account, GitPullRequest } from './gitProvider';
|
|
3
2
|
import { Issue } from './issueProvider';
|
|
4
|
-
export type Fetch = typeof
|
|
5
|
-
export declare const isFetch: (fetch: Fetch | RequestFunction, forceIsFetch?: boolean) => fetch is typeof
|
|
3
|
+
export type Fetch = typeof globalThis.fetch;
|
|
4
|
+
export declare const isFetch: (fetch: Fetch | RequestFunction, forceIsFetch?: boolean) => fetch is typeof globalThis.fetch;
|
|
6
5
|
export type RequestFunction = <T>(options: RequestOptions) => Promise<Response<T>>;
|
|
7
6
|
export interface Config extends SharedConfig {
|
|
8
7
|
github?: ProviderBaseConfig & EnterpriseConfig;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitkraken/provider-apis",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.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",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": ">=
|
|
8
|
+
"node": ">= 20"
|
|
9
9
|
},
|
|
10
10
|
"main": "dist/index.js",
|
|
11
11
|
"types": "dist/index.d.ts",
|
|
@@ -36,13 +36,12 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@linear/sdk": "58.1.0",
|
|
39
|
-
"js-base64": "3.7.5"
|
|
40
|
-
"node-fetch": "2.7.0"
|
|
39
|
+
"js-base64": "3.7.5"
|
|
41
40
|
},
|
|
42
41
|
"devDependencies": {
|
|
43
42
|
"@types/chai": "^4.3.5",
|
|
44
43
|
"@types/mocha": "^10.0.1",
|
|
45
|
-
"@types/node
|
|
44
|
+
"@types/node": "^20.0.0",
|
|
46
45
|
"@types/sinon": "^10.0.15",
|
|
47
46
|
"@typescript-eslint/eslint-plugin": "^5.59.9",
|
|
48
47
|
"@typescript-eslint/parser": "^5.59.9",
|