@gitkraken/provider-apis 0.25.0 → 0.25.1

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.
@@ -6,6 +6,8 @@ import { IssueProvider } from '../issueProvider';
6
6
  import { Provider } from '../provider';
7
7
  export declare class Jira extends Provider implements IssueProvider {
8
8
  private _resourceUrlCache;
9
+ private _issueFieldsCache;
10
+ private getIssueFieldsForResource;
9
11
  private getResourceUrl;
10
12
  getCurrentUserForResource(input: {
11
13
  resourceId: string;
@@ -2,8 +2,9 @@ import { EnterpriseOptions, NumberedPageInput, SetLabelInput } from '../../types
2
2
  import { Issue, IssueComponent, IssueTransition, SetIssueInput, SetStatusInput } from '../../types/exportedTypes/issueProvider';
3
3
  import { JiraComponent, JiraUser, SetComponentInput } from '../../types/exportedTypes/jira';
4
4
  import { ProviderConfig } from '../../types/exportedTypes/types';
5
- import { JiraComponentStub, JiraIssue, JiraTransition } from '../../types/internalTypes/jira';
6
- export declare const normalizeIssue: (issue: JiraIssue, resourceUrl: string | null, resourceId?: string) => Issue;
5
+ import { JiraComponentStub, JiraIssueField, JiraIssue, JiraTransition } from '../../types/internalTypes/jira';
6
+ export type JiraIssueFieldNameToId = Record<string, string>;
7
+ export declare const normalizeIssue: (issue: JiraIssue, fields: JiraIssueFieldNameToId | null, resourceUrl: string | null, resourceId?: string) => Issue;
7
8
  export declare const normalizeTransition: (transition: JiraTransition) => IssueTransition;
8
9
  export declare const normalizeComponentStub: (component: JiraComponentStub) => IssueComponent;
9
10
  export declare const normalizeUserURL: (user: JiraUser, resourceUrl: string | null, isServer: boolean) => string;
@@ -15,15 +16,20 @@ export declare const normalizeUser: (user: JiraUser, resourceUrl: string | null,
15
16
  username: string;
16
17
  url: string;
17
18
  };
19
+ export declare const getIssueFields: (config: ProviderConfig, input: {
20
+ resourceId?: string;
21
+ }, options?: EnterpriseOptions) => Promise<JiraIssueField[]>;
18
22
  export declare const getIssue: (config: ProviderConfig, input: {
19
23
  resourceId?: string;
20
24
  number: string;
25
+ fields: JiraIssueFieldNameToId | null;
21
26
  } & NumberedPageInput, resourceUrl: string | null, options?: EnterpriseOptions) => Promise<{
22
27
  data: Issue;
23
28
  }>;
24
29
  export declare const getIssuesForResourceForCurrentUser: (config: ProviderConfig, input: {
25
30
  resourceId?: string;
26
31
  labelNames?: string[];
32
+ fields: JiraIssueFieldNameToId | null;
27
33
  } & NumberedPageInput, resourceUrl: string | null, options?: EnterpriseOptions) => Promise<{
28
34
  data: Issue[];
29
35
  pageInfo: {
@@ -38,6 +44,7 @@ export declare const getIssuesForProject: (config: ProviderConfig, input: {
38
44
  authorLogin?: string;
39
45
  mentionLogin?: string;
40
46
  labelNames?: string[];
47
+ fields: JiraIssueFieldNameToId | null;
41
48
  } & NumberedPageInput, resourceUrl: string | null, options?: EnterpriseOptions) => Promise<{
42
49
  data: Issue[];
43
50
  pageInfo: {
@@ -52,6 +59,7 @@ export declare const getIssuesForProjects: (config: ProviderConfig, input: {
52
59
  authorLogin?: string;
53
60
  mentionLogin?: string;
54
61
  labelNames?: string[];
62
+ fields: JiraIssueFieldNameToId | null;
55
63
  } & NumberedPageInput, resourceUrl: string | null, options?: EnterpriseOptions) => Promise<{
56
64
  data: Issue[];
57
65
  pageInfo: {
@@ -4,6 +4,8 @@ import { SetComponentInput } from '../../types/exportedTypes/jira';
4
4
  import { IssueProvider } from '../issueProvider';
5
5
  import { EnterpriseProvider } from '../provider';
6
6
  export declare class JiraServer extends EnterpriseProvider implements IssueProvider {
7
+ private _issueFieldsCache;
8
+ private getIssueFieldsForResource;
7
9
  getCurrentUser(options?: EnterpriseOptions): Promise<{
8
10
  data: {
9
11
  name: string;
@@ -29,6 +29,22 @@ export interface IssueComponent {
29
29
  name: string;
30
30
  }
31
31
  export type IssueStatusCategory = 'TO_DO' | 'IN_PROGRESS' | 'DONE';
32
+ export type IssueSprint = {
33
+ id: string;
34
+ name: string;
35
+ isActive: boolean;
36
+ startDate: Date | null;
37
+ endDate: Date | null;
38
+ completedDate: Date | null;
39
+ };
40
+ export type IssueFixVersion = {
41
+ id: string;
42
+ description: string;
43
+ name: string;
44
+ archived: boolean;
45
+ released: boolean;
46
+ releaseDate: Date | null;
47
+ };
32
48
  export interface Issue {
33
49
  author: Account | null;
34
50
  assignees: Account[];
@@ -69,6 +85,8 @@ export interface Issue {
69
85
  upvoteCount: number | null;
70
86
  url: string | null;
71
87
  milestone?: GitMilestone | null;
88
+ sprints?: IssueSprint[];
89
+ fixVersions?: IssueFixVersion[];
72
90
  }
73
91
  export interface SetIssueInput {
74
92
  id: string;
@@ -40,10 +40,53 @@ export interface JiraIssueStatus {
40
40
  self: string;
41
41
  };
42
42
  }
43
- export interface JiraIssue {
43
+ export interface JiraIssueField {
44
+ clauseNames: string[];
45
+ custom: boolean;
46
+ id: string;
47
+ key: string;
48
+ name: string;
49
+ navigable: boolean;
50
+ orderable: boolean;
51
+ scope?: {
52
+ type: string;
53
+ project: {
54
+ id: string;
55
+ };
56
+ };
57
+ schema?: {
58
+ type: string;
59
+ items: string;
60
+ custom: string;
61
+ customId: number;
62
+ };
63
+ searchable: boolean;
64
+ untranslatedName?: string;
65
+ }
66
+ export type JiraIssueSprint = {
67
+ id: string;
68
+ name: string;
69
+ state: string;
70
+ boardId: number;
71
+ goal: string;
72
+ startDate: string;
73
+ endDate: string;
74
+ completeDate?: string;
75
+ };
76
+ export type JiraFixVersion = {
77
+ self: string;
78
+ id: string;
79
+ description: string;
80
+ name: string;
81
+ archived: boolean;
82
+ released: boolean;
83
+ releaseDate?: string;
84
+ };
85
+ export type JiraIssue = {
44
86
  expand: string;
45
87
  fields: {
46
88
  components?: JiraComponentStub[];
89
+ fixVersions: JiraFixVersion[];
47
90
  project: {
48
91
  avatarUrls: AvatarUrls;
49
92
  id: string;
@@ -83,9 +126,9 @@ export interface JiraIssue {
83
126
  self: string;
84
127
  votes: number;
85
128
  };
86
- };
129
+ } & Record<string, unknown>;
87
130
  id: string;
88
131
  key: string;
89
132
  self: string;
90
133
  transitions?: JiraTransition[];
91
- }
134
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitkraken/provider-apis",
3
- "version": "0.25.0",
3
+ "version": "0.25.1",
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",