@gitkraken/provider-apis 0.25.6 → 0.25.8
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 +37 -0
- package/dist/index.d.ts +1 -11
- package/dist/index.entity-identifiers.d.ts +2 -0
- package/dist/index.entity-identifiers.js +1 -0
- package/dist/index.js +47 -47
- package/dist/index.provider-utils.d.ts +19 -0
- package/dist/index.provider-utils.js +1 -0
- package/dist/index.providers.d.ts +21 -0
- package/dist/index.providers.js +1104 -0
- package/dist/providers/github/github.d.ts +28 -1
- package/dist/providers/makeProviderAPIs.d.ts +19 -0
- package/dist/types/internalTypes/github.d.ts +19 -0
- package/dist/types/internalTypes/jira.d.ts +1 -0
- package/package.json +7 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.25.8
|
|
4
|
+
|
|
5
|
+
- added `getReposForOrg` (GitHub)
|
|
6
|
+
- added `getReposForCurrentUser` (GitHub)
|
|
7
|
+
|
|
8
|
+
- fix null dereference error that sometimes happens when fetching issues (GitHub)
|
|
9
|
+
|
|
10
|
+
This version of the package introduces code-splitting. There are three new entry points that you can import code from:
|
|
11
|
+
```
|
|
12
|
+
// the main entry point exports everything in this package. this results in the largest bundle size when imported
|
|
13
|
+
import { ... } from '@gitkraken/provider-apis';
|
|
14
|
+
|
|
15
|
+
// the entity identifiers entry point exports entity identifier functions only. this results in a much smaller bundle
|
|
16
|
+
// size when imported on its own
|
|
17
|
+
import { EntityIdentifierUtils } from '@gitkraken/provider-apis/entity-identifiers';
|
|
18
|
+
|
|
19
|
+
// the provider utils entry point exports provider utility functions only, which includes all the bucketing functions
|
|
20
|
+
// used by the launchpad. this results in a much smaller bundle size when imported on its own
|
|
21
|
+
import { ... } from '@gitkraken/provider-apis/provider-utils';
|
|
22
|
+
|
|
23
|
+
// the providers entry point exports all provider API classes only, which are used to perform API calls to the various
|
|
24
|
+
// providers. this results in a smaller bundle size when imported on its own, but not by much
|
|
25
|
+
import { ... } from '@gitkraken/provider-apis/providers';
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Table of bundle sizes for each entry point for v0.25.8:
|
|
29
|
+
|Entry point |Parsed size|Gzipped size|
|
|
30
|
+
|--------------------------------------------|-----------|------------|
|
|
31
|
+
|@gitkraken/provider-apis |160 KB |36 KB |
|
|
32
|
+
|@gitkraken/provider-apis/entity-identifiers |8.97 KB |1.42 KB |
|
|
33
|
+
|@gitkraken/provider-apis/provider-utils |34 KB |9.21 KB |
|
|
34
|
+
|@gitkraken/provider-apis/providers |142 KB |32 KB |
|
|
35
|
+
|
|
36
|
+
## 0.25.7
|
|
37
|
+
|
|
38
|
+
- fetch description field for issues when using any Jira or Jira Server issue fetching functions
|
|
39
|
+
|
|
3
40
|
## 0.25.6
|
|
4
41
|
|
|
5
42
|
- added icon strings to some new Launchpad buckets
|
package/dist/index.d.ts
CHANGED
|
@@ -15,17 +15,7 @@ import * as GitHubUtils from './providerUtils/github';
|
|
|
15
15
|
import * as GitLabUtils from './providerUtils/gitlab';
|
|
16
16
|
import * as JiraUtils from './providerUtils/jira';
|
|
17
17
|
import * as TrelloUtils from './providerUtils/trello';
|
|
18
|
-
import {
|
|
19
|
-
declare const makeProviderAPIs: (config?: Partial<Config>) => {
|
|
20
|
-
azureDevOps: AzureDevOps;
|
|
21
|
-
bitbucket: Bitbucket;
|
|
22
|
-
bitbucketServer: BitbucketServer;
|
|
23
|
-
github: GitHub;
|
|
24
|
-
gitlab: GitLab;
|
|
25
|
-
jira: Jira;
|
|
26
|
-
jiraServer: JiraServer;
|
|
27
|
-
trello: Trello;
|
|
28
|
-
};
|
|
18
|
+
import { makeProviderAPIs } from './providers/makeProviderAPIs';
|
|
29
19
|
export default makeProviderAPIs;
|
|
30
20
|
export { AzureDevOps, Bitbucket, BitbucketServer, GitHub, GitLab, Jira, JiraServer, Trello };
|
|
31
21
|
export * from './types/exportedTypes/azureDevOps';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var g=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var w=(t,r)=>{for(var e in r)g(t,e,{get:r[e],enumerable:!0})},P=(t,r,e,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of T(r))!b.call(t,s)&&s!==e&&g(t,s,{get:()=>r[s],enumerable:!(u=q(r,s))||u.enumerable});return t};var O=t=>P(g({},"__esModule",{value:!0}),t);var N={};w(N,{EntityIdentifierUtils:()=>m});module.exports=O(N);var m={};w(m,{decode:()=>R,decodeV0:()=>j,encode:()=>k,validate:()=>z});var d=class{constructor(){}validate(r){if(!r.organizationName)throw new Error("organizationName is required");if(!r.projectId)throw new Error("projectId is required");if(!r.entityId)throw new Error("issueId is required")}encode(r){if(this.validate(r),!r.organizationName||!r.projectId||!r.entityId)throw new Error("Missing required fields for Azure DevOps issue uniqueId");let e=[];return e.push("azure"),e.push("issue"),e.push("1"),e.push(r.domain||""),e.push(r.organizationName),e.push(r.projectId),e.push(r.entityId),JSON.stringify(e)}decode(r){if(r.length<7)throw new Error("Invalid Azure DevOps issue uniqueId, check version");return{provider:r[0],entityType:r[1],version:r[2],domain:r[3]==""?null:r[3],resourceId:null,accountOrOrgId:null,organizationName:r[4],projectId:r[5],repoId:null,entityId:r[6]}}};var p=class{constructor(){}validate(r){if(!r.organizationName)throw new Error("organizationName is required");if(!r.projectId)throw new Error("projectId is required");if(!r.repoId)throw new Error("repoId is required");if(!r.entityId)throw new Error("entityId is required")}encode(r){if(this.validate(r),!r.organizationName||!r.projectId||!r.repoId||!r.entityId)throw new Error("Missing required fields for Azure DevOps pull request uniqueId");let e=[];return e.push("azure"),e.push("pr"),e.push("1"),e.push(r.domain||""),e.push(r.organizationName),e.push(r.projectId),e.push(r.repoId),e.push(r.entityId),JSON.stringify(e)}decode(r){if(r.length<8)throw new Error("Invalid Azure DevOps pull request uniqueId, check version");return{provider:r[0],entityType:r[1],version:r[2],domain:r[3]==""?null:r[3],resourceId:null,accountOrOrgId:null,organizationName:r[4],projectId:r[5],repoId:r[6],entityId:r[7]}}};var I=class{constructor(){}validate(r){if(!r.repoId)throw new Error("repoId is required");if(!r.entityId)throw new Error("issueId is required")}encode(r){if(this.validate(r),!r.repoId||!r.entityId)throw new Error("Missing required fields for Bitbucket DevOps issue uniqueId");let e=[];return e.push(r.provider),e.push("issue"),e.push("1"),r.provider==="bitbucketServer"?e.push(r.domain):e.push(""),e.push(r.repoId),e.push(r.entityId),JSON.stringify(e)}decode(r){if(r.length<6)throw new Error("Invalid Bitbucket DevOps issue uniqueId, check version");return{provider:r[0],entityType:r[1],version:r[2],domain:r[3]==""?null:r[3],resourceId:null,accountOrOrgId:null,organizationName:null,projectId:null,repoId:r[4],entityId:r[5]}}};var a=class{constructor(){}validate(r){if(!r.repoId)throw new Error("repoId is required");if(!r.entityId)throw new Error("entityId is required")}encode(r){if(this.validate(r),!r.repoId||!r.entityId)throw new Error("Missing required fields for Bitbucket DevOps pull request uniqueId");let e=[];return e.push(r.provider),e.push("pr"),e.push("1"),r.provider==="bitbucketServer"?e.push(r.domain):e.push(""),e.push(r.repoId),e.push(r.entityId),JSON.stringify(e)}decode(r){if(r.length<6)throw new Error("Invalid Bitbucket DevOps pull request uniqueId, check version");return{provider:r[0],entityType:r[1],version:r[2],domain:r[3]==""?null:r[3],resourceId:null,accountOrOrgId:null,organizationName:null,projectId:null,repoId:r[4],entityId:r[5]}}};var l=class{constructor(){}validate(r){if(!r.entityId)throw new Error("entityId is required")}encode(r){if(this.validate(r),!r.entityId)throw new Error("Missing required fields for Github issue uniqueId");let e=[];return e.push(r.provider),e.push("issue"),e.push("1"),r.provider==="githubEnterprise"?e.push(r.domain):e.push(""),e.push(r.entityId),JSON.stringify(e)}decode(r){if(r.length<5)throw new Error("Invalid Github issue uniqueId, check version");return{provider:r[0],entityType:r[1],version:r[2],domain:r[3]==""?null:r[3],resourceId:null,accountOrOrgId:null,organizationName:null,projectId:null,repoId:null,entityId:r[4]}}};var E=class{constructor(){}validate(r){if(!r.entityId)throw new Error("entityId is required")}encode(r){if(this.validate(r),!r.entityId)throw new Error("Missing required fields for Github pull request uniqueId");let e=[];return e.push(r.provider),e.push("pr"),e.push("1"),r.provider==="githubEnterprise"?e.push(r.domain):e.push(""),e.push(r.entityId),JSON.stringify(e)}decode(r){if(r.length<5)throw new Error("Invalid Github pull request uniqueId, check version");return{provider:r[0],entityType:r[1],version:r[2],domain:r[3]==""?null:r[3],resourceId:null,accountOrOrgId:null,organizationName:null,projectId:null,repoId:null,entityId:r[4]}}};var y=class{constructor(){}validate(r){if(!r.entityId)throw new Error("entityId is required")}encode(r){if(this.validate(r),!r.entityId)throw new Error("Missing required fields for Gitlab issue uniqueId");let e=[];return e.push(r.provider),e.push("issue"),e.push("1"),r.provider==="gitlabSelfHosted"?e.push(r.domain):e.push(""),e.push(r.entityId),JSON.stringify(e)}decode(r){if(r.length<5)throw new Error("Invalid Gitlab issue uniqueId, check version");return{provider:r[0],entityType:r[1],version:r[2],domain:r[3]==""?null:r[3],resourceId:null,accountOrOrgId:null,organizationName:null,projectId:null,repoId:null,entityId:r[4]}}};var c=class{constructor(){}validate(r){if(!r.entityId)throw new Error("entityId is required")}encode(r){if(this.validate(r),!r.entityId)throw new Error("Missing required fields for Gitlab pull request uniqueId");let e=[];return e.push(r.provider),e.push("pr"),e.push("1"),r.provider==="gitlabSelfHosted"?e.push(r.domain):e.push(""),e.push(r.entityId),JSON.stringify(e)}decode(r){if(r.length<5)throw new Error("Invalid Gitlab pull request uniqueId, check version");return{provider:r[0],entityType:r[1],version:r[2],domain:r[3]==""?null:r[3],resourceId:null,accountOrOrgId:null,organizationName:null,projectId:null,repoId:null,entityId:r[4]}}};var f=class{constructor(){}validate(r){if(!r.projectId)throw new Error("projectId is required");if(!r.entityId)throw new Error("entityId is required")}encode(r){if(this.validate(r),!r.projectId||!r.entityId)throw new Error("Missing required fields for Jira issue uniqueId");let e=[];return e.push(r.provider),e.push("issue"),e.push("1"),r.provider=="jira"?(e.push(""),e.push(r.resourceId)):(e.push(r.domain),e.push("")),e.push(r.projectId),e.push(r.entityId),JSON.stringify(e)}decode(r){if(r.length<7)throw new Error("Invalid Jira issue uniqueId, check version");return{provider:r[0],entityType:r[1],version:r[2],domain:r[3]==""?null:r[3],resourceId:r[4]==""?null:r[4],accountOrOrgId:null,organizationName:null,projectId:r[5],repoId:null,entityId:r[6]}}};var v=class{constructor(){}validate(r){if(!r.accountOrOrgId)throw new Error("accountOrOrgId is required");if(!r.projectId)throw new Error("projectId is required");if(!r.entityId)throw new Error("entityId is required")}encode(r){if(this.validate(r),!r.accountOrOrgId||!r.projectId||!r.entityId)throw new Error("Missing required fields for Trello issue uniqueId");let e=[];return e.push("trello"),e.push("issue"),e.push("1"),e.push(""),e.push(r.accountOrOrgId),e.push(r.projectId),e.push(r.entityId),JSON.stringify(e)}decode(r){if(r.length<7)throw new Error("Invalid Trello issue uniqueId, check version");return{provider:r[0],entityType:r[1],version:r[2],domain:r[3]==""?null:r[3],resourceId:null,accountOrOrgId:r[4],organizationName:null,projectId:r[5],repoId:null,entityId:r[6]}}};var h=(t,r)=>{if(r!=="issue"&&r!=="pr")throw new Error("unknown entityType");switch(t){case"azure":return r==="pr"?new p:new d;case"bitbucket":case"bitbucketServer":return r==="pr"?new a:new I;case"github":case"githubEnterprise":return r==="pr"?new E:new l;case"gitlab":case"gitlabSelfHosted":return r==="pr"?new c:new y;case"jira":case"jiraServer":if(r==="pr")throw new Error("EntityType PullRequest is not valid for Jira");return new f;case"trello":if(r==="pr")throw new Error("EntityType PullRequest is not valid for Jira");return new v;default:throw new Error("unknown provider")}},G=t=>{if(!t.entityType)throw new Error("entityType is required");if(!t.provider)throw new Error("provider is required");if(!t.entityId)throw new Error("entityID is required")},z=t=>{if(t.version==="0"){G(t);return}h(t.provider,t.entityType).validate(t)},k=t=>h(t.provider,t.entityType).encode(t),R=t=>{let r=JSON.parse(t);if(!r||!r.length)throw new Error("invalid issue unique id");return h(r[0],r[1]).decode(r)},j=(t,r,e)=>{if(!e)throw new Error("entityID is required");try{let u=JSON.parse(e);if(!u||!u.length)throw new Error("Invalid pull request uniqueId");let s=[t,r,"0",...u];return h(t,r).decode(s)}catch{return{provider:t,entityType:r,version:"0",domain:"",resourceId:null,accountOrOrgId:null,organizationName:null,projectId:null,repoId:null,entityId:e}}};
|