@gitkraken/provider-apis 0.20.0 → 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 +40 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +152 -152
- 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/github.d.ts +0 -2
- package/dist/providerUtils/gitlab.d.ts +2 -2
- package/dist/providerUtils/jira.d.ts +2 -2
- package/dist/providerUtils/trello.d.ts +2 -1
- package/dist/types/exportedTypes/types.d.ts +37 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
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
|
+
|
|
3
43
|
## 0.20.0
|
|
4
44
|
|
|
5
45
|
- added `getActionablePullRequests` utility function
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ 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';
|
|
@@ -45,5 +46,6 @@ declare const Utils: {
|
|
|
45
46
|
gitProvider: typeof GitProviderUtils;
|
|
46
47
|
jira: typeof JiraUtils;
|
|
47
48
|
trello: typeof TrelloUtils;
|
|
49
|
+
entityIdentifier: typeof EntityIdentifier;
|
|
48
50
|
};
|
|
49
|
-
export { AzureDevopsUtils, BitbucketServerUtils, BitbucketUtils, GitHubUtils, GitLabUtils, GitProviderUtils, JiraUtils, TrelloUtils, Utils, };
|
|
51
|
+
export { AzureDevopsUtils, BitbucketServerUtils, BitbucketUtils, EntityIdentifier, GitHubUtils, GitLabUtils, GitProviderUtils, JiraUtils, TrelloUtils, Utils, };
|