@gitkraken/provider-apis 0.29.6 → 0.29.8
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 +9 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +282 -120
- package/dist/index.provider-utils.js +1 -1
- package/dist/index.providers.js +306 -144
- package/dist/providers/linear/linear.d.ts +22 -0
- package/dist/providers/linear/linearHelpers.d.ts +9 -0
- package/dist/providers/linear/userIssueCursorHelper.d.ts +13 -0
- package/dist/providers/makeProviderAPIs.d.ts +2 -0
- package/dist/types/exportedTypes/entityIdentifierTypes.d.ts +1 -0
- package/dist/types/exportedTypes/linear.d.ts +12 -0
- package/dist/types/exportedTypes/types.d.ts +3 -2
- package/dist/utils.d.ts +5 -0
- package/package.json +2 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { User as LinearUser } from '@linear/sdk';
|
|
2
|
+
import { Options } from '../../types/exportedTypes/gitProvider';
|
|
3
|
+
import { GetIssueInput, Issue } from '../../types/exportedTypes/issueProvider';
|
|
4
|
+
import { Result } from '../../types/exportedTypes/types';
|
|
5
|
+
import { CursorPageInput } from '../../types/exportedTypes/gitProvider';
|
|
6
|
+
import { LinearOrganization, LinearTeam } from '../../types/exportedTypes/linear';
|
|
7
|
+
import { PagedResult } from '../../types/exportedTypes/types';
|
|
8
|
+
import { IssueProvider } from '../issueProvider';
|
|
9
|
+
import { Provider } from '../provider';
|
|
10
|
+
export declare class Linear extends Provider implements IssueProvider {
|
|
11
|
+
private makeGraphQLRequest;
|
|
12
|
+
private fetchIssue;
|
|
13
|
+
private fetchOrganization;
|
|
14
|
+
private fetchTeams;
|
|
15
|
+
private rawRequest;
|
|
16
|
+
private fetchViewer;
|
|
17
|
+
getIssue(input: GetIssueInput, options?: Options): Promise<Result<Issue>>;
|
|
18
|
+
getLinearOrganization(options?: Options): Promise<Result<LinearOrganization>>;
|
|
19
|
+
getTeamsForCurrentUser(options?: Options): Promise<Result<LinearTeam[]>>;
|
|
20
|
+
getCurrentUser(options?: Options): Promise<Result<LinearUser>>;
|
|
21
|
+
getIssuesForCurrentUser(input: CursorPageInput, options?: Options): Promise<PagedResult<Issue>>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum UserIssueCategory {
|
|
2
|
+
None = 0,
|
|
3
|
+
Assignee = 1,
|
|
4
|
+
Creator = 2,
|
|
5
|
+
Mention = 3,
|
|
6
|
+
MentionInDescription = 4,
|
|
7
|
+
MentionInComments = 5
|
|
8
|
+
}
|
|
9
|
+
export declare function formatUserIssueCursor(category: UserIssueCategory | undefined | null, cursor: string | null | undefined): string | null;
|
|
10
|
+
export declare function parseUserIssueCursor(cursor: string | null | undefined): {
|
|
11
|
+
category: UserIssueCategory;
|
|
12
|
+
cursor?: string;
|
|
13
|
+
};
|
|
@@ -5,6 +5,7 @@ import { GitHub } from './github/github';
|
|
|
5
5
|
import { GitLab } from './gitlab/gitlab';
|
|
6
6
|
import { Jira } from './jira/jira';
|
|
7
7
|
import { JiraServer } from './jira/jiraServer';
|
|
8
|
+
import { Linear } from './linear/linear';
|
|
8
9
|
import { Trello } from './trello/trello';
|
|
9
10
|
import type { Config } from '../types/exportedTypes/types';
|
|
10
11
|
export declare const makeProviderAPIs: (config?: Partial<Config>) => {
|
|
@@ -15,5 +16,6 @@ export declare const makeProviderAPIs: (config?: Partial<Config>) => {
|
|
|
15
16
|
gitlab: GitLab;
|
|
16
17
|
jira: Jira;
|
|
17
18
|
jiraServer: JiraServer;
|
|
19
|
+
linear: Linear;
|
|
18
20
|
trello: Trello;
|
|
19
21
|
};
|
|
@@ -12,6 +12,7 @@ export interface Config extends SharedConfig {
|
|
|
12
12
|
azureDevOps?: ProviderBaseConfig;
|
|
13
13
|
jira?: ProviderBaseConfig;
|
|
14
14
|
jiraServer?: ProviderBaseConfig & EnterpriseConfig;
|
|
15
|
+
linear?: ProviderBaseConfig;
|
|
15
16
|
trello?: ProviderBaseConfig;
|
|
16
17
|
}
|
|
17
18
|
export interface SharedConfig {
|
|
@@ -99,7 +100,7 @@ export interface PullRequestGroupByBucket extends PullRequestBucketBase {
|
|
|
99
100
|
teamData?: Team;
|
|
100
101
|
}
|
|
101
102
|
export type OrganizationMemberIdentityPrProvider = 'github' | 'gitlab' | 'bitbucket' | 'azure';
|
|
102
|
-
export type OrganizationMemberIdentityIssueProvider = 'github' | 'gitlab' | 'jira' | 'azure' | 'trello';
|
|
103
|
+
export type OrganizationMemberIdentityIssueProvider = 'github' | 'gitlab' | 'jira' | 'linear' | 'azure' | 'trello';
|
|
103
104
|
export type EnrichedItemsByUniqueId = {
|
|
104
105
|
[uuid: string]: EnrichedItem[];
|
|
105
106
|
};
|
|
@@ -113,7 +114,7 @@ export type EnrichedItem = {
|
|
|
113
114
|
id: string;
|
|
114
115
|
userId?: string;
|
|
115
116
|
type: 'pin' | 'snooze';
|
|
116
|
-
provider: 'azure' | 'bitbucket' | 'github' | 'gitlab' | 'jira' | 'trello' | 'gitkraken';
|
|
117
|
+
provider: 'azure' | 'bitbucket' | 'github' | 'gitlab' | 'jira' | 'linear' | 'trello' | 'gitkraken';
|
|
117
118
|
entityType: 'issue' | 'pr';
|
|
118
119
|
entityId: string;
|
|
119
120
|
entityUrl: string;
|
package/dist/utils.d.ts
CHANGED
|
@@ -13,3 +13,8 @@ export declare const followCursors: <T>(fn: (cursor?: number | string | null) =>
|
|
|
13
13
|
pageInfo?: CursorPageInfo | NumberedPageInfo | undefined;
|
|
14
14
|
data: T[];
|
|
15
15
|
}>) => Promise<T[]>;
|
|
16
|
+
export type MaybePromiseArr<T> = (Promise<T | undefined> | T | undefined)[];
|
|
17
|
+
export declare function nonnullSettled<T>(arr: MaybePromiseArr<T>): Promise<T[]>;
|
|
18
|
+
export declare function flatSettled<T>(arr: MaybePromiseArr<(T | undefined)[]>): Promise<T[]>;
|
|
19
|
+
export declare function getSettledValue<T>(promise: PromiseSettledResult<Awaited<T | undefined>>): T | undefined;
|
|
20
|
+
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.29.
|
|
3
|
+
"version": "0.29.8",
|
|
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",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"watch": "yarn clean && node ./scripts/build.mjs --watch & tsc -w"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
+
"@linear/sdk": "58.1.0",
|
|
38
39
|
"js-base64": "3.7.5",
|
|
39
40
|
"node-fetch": "2.7.0"
|
|
40
41
|
},
|