@gitkraken/provider-apis 0.14.1 → 0.15.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.
@@ -0,0 +1,115 @@
1
+ export interface AvatarUrls {
2
+ '16x16': string;
3
+ '24x24': string;
4
+ '32x32': string;
5
+ '48x48': string;
6
+ }
7
+ export interface JiraUser {
8
+ accountId?: string;
9
+ accountType: string;
10
+ active: boolean;
11
+ avatarUrls: AvatarUrls;
12
+ displayName: string;
13
+ emailAddress: string;
14
+ key?: string;
15
+ self: string;
16
+ timeZone: string;
17
+ name?: string;
18
+ }
19
+ export interface JiraTransition {
20
+ id: string;
21
+ name: string;
22
+ to: {
23
+ self: string;
24
+ description: string;
25
+ iconUrl: string;
26
+ name: string;
27
+ id: string;
28
+ statusCategory: {
29
+ self: string;
30
+ id: number;
31
+ key: string;
32
+ colorName: string;
33
+ name: string;
34
+ };
35
+ };
36
+ hasScreen: boolean;
37
+ isGlobal: boolean;
38
+ isInitial: boolean;
39
+ isAvailable: boolean;
40
+ isConditional: boolean;
41
+ isLooped: boolean;
42
+ }
43
+ export interface JiraComponentStub {
44
+ description?: string;
45
+ id: string;
46
+ name: string;
47
+ self: string;
48
+ }
49
+ export interface JiraComponent {
50
+ ari?: string;
51
+ assignee?: JiraUser;
52
+ assigneeType: string;
53
+ description?: string;
54
+ id: string;
55
+ isAssigneeTypeValid: boolean;
56
+ lead?: JiraUser;
57
+ leadUserName?: string;
58
+ metadata?: unknown;
59
+ name: string;
60
+ project: string;
61
+ projectId: string;
62
+ realAssignee?: JiraUser;
63
+ realAssigneeType: string;
64
+ self: string;
65
+ }
66
+ export interface JiraIssueStatus {
67
+ name: string;
68
+ statusCategory: {
69
+ colorName: string;
70
+ id: number;
71
+ key: string;
72
+ name: 'To Do' | 'In Progress' | 'Done';
73
+ self: string;
74
+ };
75
+ }
76
+ export interface JiraIssue {
77
+ expand: string;
78
+ fields: {
79
+ components?: JiraComponentStub[];
80
+ status: JiraIssueStatus;
81
+ assignee?: JiraUser;
82
+ comment: {
83
+ comments: {
84
+ author: JiraUser;
85
+ body: string;
86
+ created: string;
87
+ id: string;
88
+ jsdPublic: boolean;
89
+ self: string;
90
+ updateAuthor: JiraUser;
91
+ }[];
92
+ maxResults: number;
93
+ self: string;
94
+ startAt: number;
95
+ total: number;
96
+ };
97
+ created: string;
98
+ creator: JiraUser;
99
+ issuetype: {
100
+ name: string;
101
+ };
102
+ labels?: string[];
103
+ summary: string;
104
+ updated: string;
105
+ votes: {
106
+ hasVoted: boolean;
107
+ self: string;
108
+ votes: number;
109
+ };
110
+ };
111
+ id: string;
112
+ key: string;
113
+ self: string;
114
+ transitions?: JiraTransition[];
115
+ }
@@ -1,5 +1,4 @@
1
1
  import { EnterpriseOptions } from '../gitProvider';
2
- import { Issue } from '../issueProvider';
3
2
  import { EnterpriseProvider } from '../provider';
4
3
  export interface JiraServerProject {
5
4
  id: string;
@@ -13,6 +12,7 @@ export declare class JiraServer extends EnterpriseProvider {
13
12
  avatarUrl: string;
14
13
  id: string;
15
14
  username: string;
15
+ url: null;
16
16
  };
17
17
  }>;
18
18
  getJiraProjects(options?: EnterpriseOptions): Promise<{
@@ -27,13 +27,21 @@ export declare class JiraServer extends EnterpriseProvider {
27
27
  authorLogin?: string;
28
28
  mentionLogin?: string;
29
29
  }, options?: EnterpriseOptions): Promise<{
30
- data: Issue[];
30
+ data: import("../issueProvider").Issue[];
31
31
  }>;
32
32
  setIssueStatus(input: {
33
33
  issueId: string;
34
34
  status: string;
35
35
  }, options?: EnterpriseOptions): Promise<void>;
36
- getLabels(options: EnterpriseOptions): Promise<{
36
+ setIssueLabels(input: {
37
+ issueId: string;
38
+ labelNames: string[];
39
+ }, options?: EnterpriseOptions): Promise<void>;
40
+ setIssueComponents(input: {
41
+ issueId: string;
42
+ componentIds: string[];
43
+ }, options?: EnterpriseOptions): Promise<void>;
44
+ getLabels(options?: EnterpriseOptions): Promise<{
37
45
  data: {
38
46
  color: null;
39
47
  description: null;
@@ -41,4 +49,9 @@ export declare class JiraServer extends EnterpriseProvider {
41
49
  name: string;
42
50
  }[];
43
51
  }>;
52
+ getComponentsForJiraProject(input: {
53
+ projectIdOrKey: string;
54
+ }, options?: EnterpriseOptions): Promise<{
55
+ data: import("../jira/sharedTypes").JiraComponent[];
56
+ }>;
44
57
  }
@@ -34,6 +34,7 @@ export declare class Trello extends Provider {
34
34
  avatarUrl: string | null;
35
35
  id: string;
36
36
  username: string;
37
+ url: string;
37
38
  };
38
39
  }>;
39
40
  getBoardsForCurrentUser(input: {
@@ -55,6 +56,7 @@ export declare class Trello extends Provider {
55
56
  username: string;
56
57
  email: null;
57
58
  avatarUrl: null;
59
+ url: null;
58
60
  }[];
59
61
  }>;
60
62
  getIssuesForBoard(input: {
package/dist/types.d.ts CHANGED
@@ -76,3 +76,5 @@ export type PagedResult<T> = {
76
76
  pageInfo: CursorPageInfo | NumberedPageInfo;
77
77
  data: T[];
78
78
  };
79
+ export type FullFieldMap<T> = Record<keyof T, boolean>;
80
+ export type FieldMap<T> = Partial<FullFieldMap<T>>;
package/dist/utils.d.ts CHANGED
@@ -1 +1,11 @@
1
+ import { FieldMap } from './types';
1
2
  export declare const getRequestHeaders: (token?: string, basicAuth?: boolean) => Record<string, string>;
3
+ export declare const toFieldMap: <T, K extends keyof T = keyof T>(fields?: K[] | undefined) => Partial<import("./types").FullFieldMap<T>> | undefined;
4
+ /**
5
+ * Returns providerQueryString if requestedFields is undefined or if any of the normalized fields depend on the query string.
6
+ * @param requestedFields
7
+ * @param normalizedFields
8
+ * @param providerQueryString
9
+ * @returns string
10
+ */
11
+ export declare const fieldQuery: <T>(requestedFields: Partial<import("./types").FullFieldMap<T>> | undefined, normalizedFields: (keyof T)[], providerQueryString: string) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitkraken/provider-apis",
3
- "version": "0.14.1",
3
+ "version": "0.15.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",