@forge/storage 1.5.11 → 1.5.12-next.1

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.
@@ -648,4 +648,43 @@ describe('GlobalStorage', () => {
648
648
  await expect(response).rejects.toThrow(errors_1.APIError.forStatus(400));
649
649
  });
650
650
  });
651
+ describe('listCustomEntities', () => {
652
+ it('should use default values', async () => {
653
+ const apiClientMock = getApiClientMock({
654
+ data: {
655
+ appStoredCustomEntities: {
656
+ edges: []
657
+ }
658
+ }
659
+ });
660
+ const globalStorage = getStorage(apiClientMock);
661
+ const response = await globalStorage.listCustomEntities({});
662
+ expect(response).toMatchObject({
663
+ results: [],
664
+ nextCursor: null
665
+ });
666
+ verifyApiClientCalledWith(apiClientMock, {
667
+ contextAri
668
+ }, gql_queries_1.CustomEntityQueries.listQuery(contextAri, {}).query);
669
+ });
670
+ it('should return cursor when results are not present', async () => {
671
+ const apiClientMock = getApiClientMock({
672
+ data: {
673
+ appStoredCustomEntities: {
674
+ edges: [],
675
+ cursor: 'DUMMY_CURSOR'
676
+ }
677
+ }
678
+ });
679
+ const globalStorage = getStorage(apiClientMock);
680
+ const response = await globalStorage.listCustomEntities({});
681
+ expect(response).toMatchObject({
682
+ results: [],
683
+ nextCursor: 'DUMMY_CURSOR'
684
+ });
685
+ verifyApiClientCalledWith(apiClientMock, {
686
+ contextAri
687
+ }, gql_queries_1.CustomEntityQueries.listQuery(contextAri, {}).query);
688
+ });
689
+ });
651
690
  });
@@ -1 +1 @@
1
- {"version":3,"file":"global-storage.d.ts","sourceRoot":"","sources":["../src/global-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,WAAW,EAAE,MAAM,SAAS,CAAC;AAInD,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,UAAU,WAAW;IACnB,OAAO,EAAE;QAAE,GAA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,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKlC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKxC,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAI/D,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAK5E,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAK1D,WAAW;YAUX,iBAAiB;IAU/B,OAAO,CAAC,YAAY;YAUN,KAAK;YAML,QAAQ;CAqBvB"}
@@ -55,15 +55,13 @@ class GlobalStorage {
55
55
  };
56
56
  }
57
57
  async listCustomEntities(options) {
58
- var _a;
59
58
  const requestBody = gql_queries_1.CustomEntityQueries.listQuery(this.doGetAppContextAri(), options);
60
59
  const response = await this.query(requestBody);
61
60
  const edges = response.appStoredCustomEntities.edges;
62
- const nextCursor = (_a = edges === null || edges === void 0 ? void 0 : edges[edges.length - 1]) === null || _a === void 0 ? void 0 : _a.cursor;
63
61
  const results = edges.map(({ node }) => node);
64
62
  return {
65
63
  results,
66
- nextCursor
64
+ nextCursor: response.appStoredCustomEntities.cursor || null
67
65
  };
68
66
  }
69
67
  async set(key, value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/storage",
3
- "version": "1.5.11",
3
+ "version": "1.5.12-next.1",
4
4
  "description": "Forge Storage methods",
5
5
  "author": "Atlassian",
6
6
  "license": "UNLICENSED",
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "devDependencies": {
18
18
  "@types/node": "14.18.63",
19
- "@types/node-fetch": "^2.6.7",
19
+ "@types/node-fetch": "^2.6.8",
20
20
  "node-fetch": "2.7.0"
21
21
  }
22
22
  }