@gitkraken/provider-apis 0.22.6 → 0.22.7

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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.22.7
4
+
5
+ - updated GitLab `getRepos` function to be less likely to run into query complexity limits
6
+
3
7
  ## 0.22.6
4
8
 
5
9
  - exclude data from archived repos in the results of functions that return PRs: `getPullRequestsForUser`, `getPullRequestsAssociatedWithUser` (GitLab)
package/dist/index.js CHANGED
@@ -816,7 +816,7 @@ query getRepo($fullPath: ID!) {
816
816
  ${mt}
817
817
  }
818
818
  }
819
- `,variables:{fullPath:r}},t);if(!((o=n.body.data)!=null&&o.project))throw new Error(`Repository ${r} not found`);return{data:ft(n.body.data.project)}}async getRepos(e,t={}){let n=e.map(J).map((u,l)=>`
819
+ `,variables:{fullPath:r}},t);if(!((o=n.body.data)!=null&&o.project))throw new Error(`Repository ${r} not found`);return{data:ft(n.body.data.project)}}async getReposBase(e,t={}){let n=e.map(J).map((u,l)=>`
820
820
  getRepo_${l}: project(fullPath: "${u}") {
821
821
  ${mt}
822
822
  }
@@ -825,7 +825,7 @@ query getRepo($fullPath: ID!) {
825
825
  query batchGetRepos {
826
826
  ${n}
827
827
  }
828
- `},t);if(!o.body.data)throw new Error(we(o.body.errors)||o.statusText||"Unknown error");let i=[],a=[];return e.forEach((u,l)=>{let p=o.body.data[`getRepo_${l}`];p?i.push(ft(p)):a.push({input:u})}),{data:i,errors:a}}async getReposForCurrentUser(e,t={}){var o,i,a,u,l;let r=await b(this.config,{query:`
828
+ `},t);if(!o.body.data)throw new Error(we(o.body.errors)||o.statusText||"Unknown error");let i=[],a=[];return e.forEach((u,l)=>{let p=o.body.data[`getRepo_${l}`];p?i.push(ft(p)):a.push({input:u})}),{data:i,errors:a}}async getRepos(e,t={}){let r=[];for(let i=0;i<e.length;i+=20)r.push(e.slice(i,i+20));return(await Promise.all(r.map(i=>this.getReposBase(i,t)))).reduce((i,a)=>({data:[...i.data,...a.data],errors:[...i.errors,...a.errors]}),{data:[],errors:[]})}async getReposForCurrentUser(e,t={}){var o,i,a,u,l;let r=await b(this.config,{query:`
829
829
  query getReposForCurrentUser($after: String) {
830
830
  projects(membership: true first: 100 after: $after) {
831
831
  pageInfo {
@@ -41,6 +41,7 @@ export declare class GitLab extends EnterpriseProvider implements GitProvider, I
41
41
  getRepo(input: GetRepoInput, options?: EnterpriseOptions): Promise<{
42
42
  data: GitRepository;
43
43
  }>;
44
+ private getReposBase;
44
45
  getRepos(inputs: GetRepoInput[], options?: EnterpriseOptions): Promise<{
45
46
  data: GitRepository[];
46
47
  errors: GetRepoErrorData[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitkraken/provider-apis",
3
- "version": "0.22.6",
3
+ "version": "0.22.7",
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",