@gitkraken/provider-apis 0.28.5 → 0.29.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.
@@ -1,11 +1,11 @@
1
1
  import { AzureGetRepoInput, AzureGetReposInput, AzureGraphAccount, AzureOrganization, AzureProject, AzureSetAccountInput, AzureSetIssueInput, AzureSetPullRequestInput, PullRequestAsyncStatus, StatusByWorkItemIdByStatusId, WorkItemType } from '../../types/exportedTypes/azureDevOps';
2
- import { CursorPageInput, EnterpriseOptions, GetRepoErrorData, GetRepoInput, GetReposInput, GitMergeStrategy, GitPullRequest, GitRepository, GitRepositoryPermissions, NumberedPageInput, Options, SetAccountInput, SetLabelInput, SetPullRequestInput } from '../../types/exportedTypes/gitProvider';
2
+ import { CursorPageInput, EnterpriseOptions, GetRepoErrorData, GetRepoInput, GetReposInput, GitMergeStrategy, GitPullRequest, GitRepository, GitRepositoryPermissions, NumberedPageInput, SetAccountInput, SetLabelInput, SetPullRequestInput } from '../../types/exportedTypes/gitProvider';
3
3
  import { Issue, SetStatusInput } from '../../types/exportedTypes/issueProvider';
4
4
  import { PagedResult, Result } from '../../types/exportedTypes/types';
5
5
  import { GitProvider } from '../gitProvider';
6
6
  import { IssueProvider } from '../issueProvider';
7
- import { Provider } from '../provider';
8
- export declare class AzureDevOps extends Provider implements GitProvider, IssueProvider {
7
+ import { EnterpriseProvider } from '../provider';
8
+ export declare class AzureDevOps extends EnterpriseProvider implements GitProvider, IssueProvider {
9
9
  /** Note: PATs are not supported for this function, only OAuth tokens are. */
10
10
  getCurrentUser(input?: Record<string, never>, options?: EnterpriseOptions): Promise<{
11
11
  data: {
@@ -19,19 +19,20 @@ export declare class AzureDevOps extends Provider implements GitProvider, IssueP
19
19
  }>;
20
20
  getCurrentUserForInstance(input: {
21
21
  namespace: string;
22
- }, options?: Options): Promise<{
22
+ }, options?: EnterpriseOptions): Promise<{
23
23
  data: {
24
24
  id: string;
25
25
  name: string;
26
26
  username: string;
27
27
  email: string;
28
28
  avatarUrl: null;
29
+ url: null;
29
30
  };
30
31
  }>;
31
32
  getUserForCommit(input: {
32
33
  repo: GetRepoInput;
33
34
  oid: string;
34
- }, options?: Options): Promise<{
35
+ }, options?: EnterpriseOptions): Promise<{
35
36
  data: {
36
37
  name: string;
37
38
  email: string | null;
@@ -40,14 +41,22 @@ export declare class AzureDevOps extends Provider implements GitProvider, IssueP
40
41
  }>;
41
42
  getOrgsForUser(input: {
42
43
  userId: string;
43
- }, options?: Options): Promise<Result<AzureOrganization[]>>;
44
+ }, options?: EnterpriseOptions): Promise<Result<AzureOrganization[]>>;
45
+ getCollectionsForUser(input: {
46
+ userId: string;
47
+ }, options?: EnterpriseOptions): Promise<{
48
+ data: {
49
+ id: string;
50
+ name: string;
51
+ }[];
52
+ }>;
44
53
  getAzureProjects(input: {
45
54
  namespace: string;
46
- } & CursorPageInput, options?: Options): Promise<PagedResult<AzureProject>>;
55
+ } & CursorPageInput, options?: EnterpriseOptions): Promise<PagedResult<AzureProject>>;
47
56
  getAzureProjectScopeDescriptor(input: {
48
57
  namespace: string;
49
58
  projectId: string;
50
- }, options?: Options): Promise<{
59
+ }, options?: EnterpriseOptions): Promise<{
51
60
  data: {
52
61
  scope: string;
53
62
  };
@@ -55,7 +64,7 @@ export declare class AzureDevOps extends Provider implements GitProvider, IssueP
55
64
  getAzureGraphAccountsForAzureProject(input: {
56
65
  namespace: string;
57
66
  projectScopeDescriptor?: string;
58
- } & CursorPageInput, options?: Options): Promise<{
67
+ } & CursorPageInput, options?: EnterpriseOptions): Promise<{
59
68
  pageInfo: {
60
69
  endCursor: string | null;
61
70
  hasNextPage: boolean;
@@ -71,7 +80,7 @@ export declare class AzureDevOps extends Provider implements GitProvider, IssueP
71
80
  }>;
72
81
  getAccountFromAzureGraphAccount(input: {
73
82
  azureGraphAccount: AzureGraphAccount;
74
- }, options?: Options): Promise<{
83
+ }, options?: EnterpriseOptions): Promise<{
75
84
  data: {
76
85
  avatarUrl: string | null;
77
86
  email: string | null;
@@ -83,7 +92,7 @@ export declare class AzureDevOps extends Provider implements GitProvider, IssueP
83
92
  }>;
84
93
  getAccountsFromAzureGraphAccounts(input: {
85
94
  azureGraphAccounts: AzureGraphAccount[];
86
- }, options?: Options): Promise<{
95
+ }, options?: EnterpriseOptions): Promise<{
87
96
  data: {
88
97
  avatarUrl: string | null;
89
98
  email: string | null;
@@ -93,18 +102,18 @@ export declare class AzureDevOps extends Provider implements GitProvider, IssueP
93
102
  url: null;
94
103
  }[];
95
104
  }>;
96
- getRepo(input: AzureGetRepoInput, options?: Options): Promise<{
105
+ getRepo(input: AzureGetRepoInput, options?: EnterpriseOptions): Promise<{
97
106
  data: GitRepository & {
98
107
  projectId: string;
99
108
  };
100
109
  }>;
101
- getRepos(inputs: AzureGetRepoInput[], options?: Options): Promise<{
110
+ getRepos(inputs: AzureGetRepoInput[], options?: EnterpriseOptions): Promise<{
102
111
  data: (GitRepository & {
103
112
  projectId: string;
104
113
  })[];
105
114
  errors: GetRepoErrorData[];
106
115
  }>;
107
- getReposForAzureProject(input: AzureGetReposInput, options?: Options): Promise<{
116
+ getReposForAzureProject(input: AzureGetReposInput, options?: EnterpriseOptions): Promise<{
108
117
  data: (GitRepository & {
109
118
  projectId: string;
110
119
  })[];
@@ -112,7 +121,7 @@ export declare class AzureDevOps extends Provider implements GitProvider, IssueP
112
121
  private getRefs;
113
122
  getBranches(inputs: {
114
123
  repo: GetRepoInput;
115
- } & CursorPageInput, options?: Options): Promise<{
124
+ } & CursorPageInput, options?: EnterpriseOptions): Promise<{
116
125
  pageInfo: {
117
126
  hasNextPage: boolean;
118
127
  endCursor: string | null;
@@ -128,7 +137,7 @@ export declare class AzureDevOps extends Provider implements GitProvider, IssueP
128
137
  }>;
129
138
  getTags(inputs: {
130
139
  repo: GetRepoInput;
131
- } & CursorPageInput, options?: Options): Promise<{
140
+ } & CursorPageInput, options?: EnterpriseOptions): Promise<{
132
141
  pageInfo: {
133
142
  hasNextPage: boolean;
134
143
  endCursor: string | null;
@@ -1,5 +1,7 @@
1
- import { Options } from '../../types/exportedTypes/gitProvider';
1
+ import { EnterpriseOptions } from '../../types/exportedTypes/gitProvider';
2
2
  import { ProviderConfig } from '../../types/exportedTypes/types';
3
3
  import { AzurePullRequest } from '../../types/internalTypes/azureDevOps';
4
- export declare const getAzureRequestHeaders: (config: ProviderConfig, options?: Options) => Record<string, string>;
4
+ export declare const getAzureRequestHeaders: (config: ProviderConfig, options?: EnterpriseOptions) => Record<string, string>;
5
5
  export declare const getPullRequestUrl: (pullRequest: AzurePullRequest) => string;
6
+ export declare const getVSSPSBaseUrl: (config: ProviderConfig, options: EnterpriseOptions) => string;
7
+ export declare const getAPIBaseUrl: (config: ProviderConfig, options: EnterpriseOptions) => string;
@@ -8,6 +8,7 @@ export declare enum EntityType {
8
8
  }
9
9
  export declare enum EntityIdentifierProviderType {
10
10
  Azure = "azure",
11
+ AzureDevOpsServer = "azureDevOpsServer",
11
12
  Github = "github",
12
13
  GithubEnterprise = "githubEnterprise",
13
14
  Gitlab = "gitlab",
@@ -31,24 +32,30 @@ export type EntityIdentifier = {
31
32
  entityId: string;
32
33
  };
33
34
  export type AzureIssueEntityIdentifierInput = {
34
- provider: EntityIdentifierProviderType.Azure;
35
35
  entityType: EntityType.Issue;
36
36
  version?: EntityVersion;
37
37
  organizationName: string;
38
38
  projectId: string;
39
39
  entityId: string;
40
- domain?: string;
41
- };
42
- export type AzurePullRequestEntityIdentifierInput = {
40
+ } & ({
43
41
  provider: EntityIdentifierProviderType.Azure;
42
+ } | {
43
+ provider: EntityIdentifierProviderType.AzureDevOpsServer;
44
+ domain: string;
45
+ });
46
+ export type AzurePullRequestEntityIdentifierInput = {
44
47
  entityType: EntityType.PullRequest;
45
48
  version?: EntityVersion;
46
49
  organizationName: string;
47
50
  projectId: string;
48
51
  repoId: string;
49
52
  entityId: string;
50
- domain?: string;
51
- };
53
+ } & ({
54
+ provider: EntityIdentifierProviderType.Azure;
55
+ } | {
56
+ provider: EntityIdentifierProviderType.AzureDevOpsServer;
57
+ domain: string;
58
+ });
52
59
  export type BitbucketIssueEntityIdentifierInput = {
53
60
  entityType: EntityType.Issue;
54
61
  version?: EntityVersion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitkraken/provider-apis",
3
- "version": "0.28.5",
3
+ "version": "0.29.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",