@gitkraken/provider-apis 0.19.1 → 0.21.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 +62 -0
- package/dist/defaults.d.ts +1 -1
- package/dist/fetchWrapper.d.ts +1 -1
- package/dist/index.d.ts +14 -14
- package/dist/index.js +153 -184
- package/dist/providerUtils/azureDevops.d.ts +2 -2
- package/dist/providerUtils/bitbucket.d.ts +2 -2
- package/dist/providerUtils/bitbucketServer.d.ts +2 -2
- package/dist/providerUtils/entityIdentifiers/entityIdentifier.d.ts +5 -0
- package/dist/providerUtils/entityIdentifiers/providerEntityIdentifiers/azureDevopsIssueEntityIdentifier.d.ts +9 -0
- package/dist/providerUtils/entityIdentifiers/providerEntityIdentifiers/azureDevopsPullRequestEntityIdentifier.d.ts +9 -0
- package/dist/providerUtils/entityIdentifiers/providerEntityIdentifiers/bitbucketIssueEntityIdentifier.d.ts +9 -0
- package/dist/providerUtils/entityIdentifiers/providerEntityIdentifiers/bitbucketPullRequestEntityIdentifier.d.ts +9 -0
- package/dist/providerUtils/entityIdentifiers/providerEntityIdentifiers/githubIssueEntityIdentifier.d.ts +9 -0
- package/dist/providerUtils/entityIdentifiers/providerEntityIdentifiers/githubPullRequestEntityIdentifier.d.ts +9 -0
- package/dist/providerUtils/entityIdentifiers/providerEntityIdentifiers/gitlabIssueEntityIdentifier.d.ts +9 -0
- package/dist/providerUtils/entityIdentifiers/providerEntityIdentifiers/gitlabPullRequestEntityIdentifier.d.ts +9 -0
- package/dist/providerUtils/entityIdentifiers/providerEntityIdentifiers/jiraIssueEntityIdentifier.d.ts +9 -0
- package/dist/providerUtils/entityIdentifiers/providerEntityIdentifiers/trelloIssueEntityIdentifier.d.ts +9 -0
- package/dist/providerUtils/gitProvider.d.ts +20 -3
- package/dist/providerUtils/github.d.ts +0 -2
- package/dist/providerUtils/gitlab.d.ts +2 -2
- package/dist/providerUtils/jira.d.ts +2 -2
- package/dist/providerUtils/shared.d.ts +1 -1
- package/dist/providerUtils/trello.d.ts +2 -1
- package/dist/providers/azureDevops/azureDevOps.d.ts +7 -53
- package/dist/providers/azureDevops/azureDevOpsHelpers.d.ts +3 -3
- package/dist/providers/bitbucket/bitbucket.d.ts +4 -11
- package/dist/providers/bitbucket/bitbucketHelpers.d.ts +2 -2
- package/dist/providers/bitbucketServer/bitbucketServer.d.ts +4 -4
- package/dist/providers/gitProvider.d.ts +3 -306
- package/dist/providers/github/github.d.ts +5 -3
- package/dist/providers/github/githubHelpers.d.ts +3 -3
- package/dist/providers/gitlab/gitlab.d.ts +6 -15
- package/dist/providers/gitlab/gitlabHelpers.d.ts +3 -3
- package/dist/providers/issueProvider.d.ts +3 -91
- package/dist/providers/jira/jira.d.ts +9 -24
- package/dist/providers/jira/{sharedHelpers.d.ts → jiraHelpers.d.ts} +5 -4
- package/dist/providers/{jiraServer → jira}/jiraServer.d.ts +8 -11
- package/dist/providers/provider.d.ts +1 -1
- package/dist/providers/trello/trello.d.ts +5 -26
- package/dist/types/exportedTypes/azureDevOps.d.ts +100 -0
- package/dist/types/exportedTypes/bitbucket.d.ts +15 -0
- package/dist/types/exportedTypes/gitProvider.d.ts +301 -0
- package/dist/types/exportedTypes/github.d.ts +23 -0
- package/dist/types/exportedTypes/gitlab.d.ts +7 -0
- package/dist/types/exportedTypes/issueProvider.d.ts +90 -0
- package/dist/types/exportedTypes/jira.d.ts +58 -0
- package/dist/types/exportedTypes/trello.d.ts +22 -0
- package/dist/{types.d.ts → types/exportedTypes/types.d.ts} +81 -3
- package/dist/{providers/azureDevops/azureDevOpsTypes.d.ts → types/internalTypes/azureDevOps.d.ts} +0 -51
- package/dist/{providers/bitbucketServer/bitbucketServerTypes.d.ts → types/internalTypes/bitbucketServer.d.ts} +0 -7
- package/dist/{providers/github/githubTypes.d.ts → types/internalTypes/github.d.ts} +0 -23
- package/dist/{providers/jira/sharedTypes.d.ts → types/internalTypes/jira.d.ts} +1 -38
- package/dist/utils.d.ts +3 -3
- package/package.json +1 -1
- /package/dist/{providers/bitbucket/bitbucketTypes.d.ts → types/internalTypes/bitbucket.d.ts} +0 -0
- /package/dist/{providers/gitlab/gitlabTypes.d.ts → types/internalTypes/gitlab.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,67 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.21.0
|
|
4
|
+
|
|
5
|
+
### ⚠️ Breaking Changes
|
|
6
|
+
|
|
7
|
+
Added new entity ID API for encoding/decoding entity IDs (previously known as unique IDs). This API replaces the `getPullRequestUniqueId` and `getIssueUniqueId` utility functions in older versions of this library.
|
|
8
|
+
|
|
9
|
+
The `EntityIdentifier` type represents a particular pull request or issue for a particular provider. The information stored in this type is enough to query the provider's REST or GraphQL API to fetch additional information about the entity (i.e. title, description, assignees, etc) or mutate the entity. `EntityIdentifier` is designed to be
|
|
10
|
+
serialized so we can send it to our backend services, giving us a portable way to communicate about pull requests or issues.
|
|
11
|
+
|
|
12
|
+
These are the new functions provided by the API:
|
|
13
|
+
- `validate`: takes an `EntityIdentifier` as input and validates that it is correctly formed
|
|
14
|
+
- `encode`: takes an `EntityIdentifier` as input and encodes it to an array of strings, which can be serialized and sent to our REST APIs
|
|
15
|
+
- `decode`: takes an array string and decodes it to an `EntityIdentifier`
|
|
16
|
+
|
|
17
|
+
Conversion guide:
|
|
18
|
+
```ts
|
|
19
|
+
const pullRequest: GitPullRequest = { /* ... pr from somewhere ... */ };
|
|
20
|
+
const githubEnterpriseDomain: string | undefined = ...; // undefined if this PR exists on https://github.com
|
|
21
|
+
|
|
22
|
+
// pre-v0.21.0 way to encode a unique ID (now called a V0 entity ID)
|
|
23
|
+
Utils.github.getPullRequestUniqueId({
|
|
24
|
+
pullRequest.id,
|
|
25
|
+
githubEnterpriseDomain,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// v0.21.0 way to encode an entity ID
|
|
29
|
+
encode({
|
|
30
|
+
provider: EntityIdentifierProviderType.Github,
|
|
31
|
+
entityType: EntityType.PullRequest,
|
|
32
|
+
version: EntityVersion.One,
|
|
33
|
+
domain: githubEnterpriseDomain ?? null,
|
|
34
|
+
resourceId: null,
|
|
35
|
+
accountOrOrgId: null,
|
|
36
|
+
organizationName: null,
|
|
37
|
+
projectId: null,
|
|
38
|
+
repoId: null,
|
|
39
|
+
entityId: pullRequest.id,
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## 0.20.0
|
|
44
|
+
|
|
45
|
+
- added `getActionablePullRequests` utility function
|
|
46
|
+
- `groupPullRequestsIntoBuckets` optionally takes a mapping of PRs to enriched items for "snoozed" and "pinned" bucketing
|
|
47
|
+
|
|
48
|
+
- fixed error when normalizing empty review author object (GitHub)
|
|
49
|
+
- fixed `getPullRequestsForRepos` hitting the GraphQL complexity limit (GitLab)
|
|
50
|
+
|
|
51
|
+
### ⚠️ Breaking Changes
|
|
52
|
+
|
|
53
|
+
- `getPullRequestsForRepos` no longer accepts `repoIds` as input (GitLab)
|
|
54
|
+
- changed `pullRequests` argument type from `GitPullRequest[]` to `PullRequestWithUniqueID[]` (groupPullRequestsIntoBuckets)
|
|
55
|
+
|
|
56
|
+
We re-organized provider-specific types into a new directory structure. The types that were moved will have broken imports, but they can be fixed by importing the type from "@gitkraken/provider-apis". Example
|
|
57
|
+
```ts
|
|
58
|
+
// provider-specific type import that is broken by v0.20.0
|
|
59
|
+
import type { WorkItemState } from '@gitkraken/provider-apis/dist/providers/azureDevops/azureDevOpsTypes';
|
|
60
|
+
|
|
61
|
+
// correct way to import this type in v0.20.0
|
|
62
|
+
import type { WorkItemState } from '@gitkraken/provider-apis';
|
|
63
|
+
```
|
|
64
|
+
|
|
3
65
|
## 0.19.1
|
|
4
66
|
|
|
5
67
|
- added `getCurrentUser` (Bitbucket Server)
|
package/dist/defaults.d.ts
CHANGED
package/dist/fetchWrapper.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Fetch, RequestFunction } from './types';
|
|
1
|
+
import { Fetch, RequestFunction } from './types/exportedTypes/types';
|
|
2
2
|
export declare const fetchWrapper: (fetch: Fetch) => RequestFunction;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,17 +4,18 @@ import { BitbucketServer } from './providers/bitbucketServer/bitbucketServer';
|
|
|
4
4
|
import { GitHub } from './providers/github/github';
|
|
5
5
|
import { GitLab } from './providers/gitlab/gitlab';
|
|
6
6
|
import { Jira } from './providers/jira/jira';
|
|
7
|
-
import { JiraServer } from './providers/
|
|
7
|
+
import { JiraServer } from './providers/jira/jiraServer';
|
|
8
8
|
import { Trello } from './providers/trello/trello';
|
|
9
9
|
import * as AzureDevopsUtils from './providerUtils/azureDevops';
|
|
10
10
|
import * as BitbucketUtils from './providerUtils/bitbucket';
|
|
11
11
|
import * as BitbucketServerUtils from './providerUtils/bitbucketServer';
|
|
12
|
+
import * as EntityIdentifier from './providerUtils/entityIdentifiers/entityIdentifier';
|
|
12
13
|
import * as GitProviderUtils from './providerUtils/gitProvider';
|
|
13
14
|
import * as GitHubUtils from './providerUtils/github';
|
|
14
15
|
import * as GitLabUtils from './providerUtils/gitlab';
|
|
15
16
|
import * as JiraUtils from './providerUtils/jira';
|
|
16
17
|
import * as TrelloUtils from './providerUtils/trello';
|
|
17
|
-
import { Config } from './types';
|
|
18
|
+
import { Config } from './types/exportedTypes/types';
|
|
18
19
|
declare const makeProviderAPIs: (config?: Partial<Config>) => {
|
|
19
20
|
azureDevOps: AzureDevOps;
|
|
20
21
|
bitbucket: Bitbucket;
|
|
@@ -27,17 +28,15 @@ declare const makeProviderAPIs: (config?: Partial<Config>) => {
|
|
|
27
28
|
};
|
|
28
29
|
export default makeProviderAPIs;
|
|
29
30
|
export { AzureDevOps, Bitbucket, BitbucketServer, GitHub, GitLab, Jira, JiraServer, Trello };
|
|
30
|
-
export
|
|
31
|
-
export
|
|
32
|
-
export
|
|
33
|
-
export
|
|
34
|
-
export
|
|
35
|
-
export
|
|
36
|
-
export
|
|
37
|
-
export
|
|
38
|
-
export
|
|
39
|
-
export type * from './providers/trello/trello';
|
|
40
|
-
export type * from './types';
|
|
31
|
+
export * from './types/exportedTypes/azureDevOps';
|
|
32
|
+
export * from './types/exportedTypes/bitbucket';
|
|
33
|
+
export * from './types/exportedTypes/gitProvider';
|
|
34
|
+
export * from './types/exportedTypes/github';
|
|
35
|
+
export * from './types/exportedTypes/gitlab';
|
|
36
|
+
export * from './types/exportedTypes/issueProvider';
|
|
37
|
+
export * from './types/exportedTypes/jira';
|
|
38
|
+
export * from './types/exportedTypes/trello';
|
|
39
|
+
export * from './types/exportedTypes/types';
|
|
41
40
|
declare const Utils: {
|
|
42
41
|
azureDevOps: typeof AzureDevopsUtils;
|
|
43
42
|
bitbucket: typeof BitbucketUtils;
|
|
@@ -47,5 +46,6 @@ declare const Utils: {
|
|
|
47
46
|
gitProvider: typeof GitProviderUtils;
|
|
48
47
|
jira: typeof JiraUtils;
|
|
49
48
|
trello: typeof TrelloUtils;
|
|
49
|
+
entityIdentifier: typeof EntityIdentifier;
|
|
50
50
|
};
|
|
51
|
-
export { AzureDevopsUtils, BitbucketServerUtils, BitbucketUtils, GitHubUtils, GitLabUtils, GitProviderUtils, JiraUtils, TrelloUtils, Utils, };
|
|
51
|
+
export { AzureDevopsUtils, BitbucketServerUtils, BitbucketUtils, EntityIdentifier, GitHubUtils, GitLabUtils, GitProviderUtils, JiraUtils, TrelloUtils, Utils, };
|