@faable/sdk-base 1.0.11 → 1.0.13

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/README.md CHANGED
@@ -1,5 +1,3 @@
1
- # Faable Deploy SDK
2
-
3
1
  <p align="center">
4
2
  <a href="https://faable.com">
5
3
  <h1 align="center">SDK Builder base code</h1>
@@ -8,13 +6,13 @@
8
6
  </p>
9
7
 
10
8
  <p align="center">
11
- <a aria-label="NPM version" href="https://www.npmjs.com/package/@faable/sdk-generic">
12
- <img alt="" src="https://img.shields.io/npm/v/@faable/sdk-generic.svg?style=for-the-badge&labelColor=000000">
9
+ <a aria-label="NPM version" href="https://www.npmjs.com/package/@faable/sdk-base">
10
+ <img alt="" src="https://img.shields.io/npm/v/@faable/sdk-base.svg?style=for-the-badge&labelColor=000000">
13
11
  </a>
14
12
  </p>
15
13
 
16
14
  ## Install
17
15
 
18
16
  ```bash
19
- npm install @faable/sdk-generic
17
+ npm install @faable/sdk-base
20
18
  ```
@@ -4,7 +4,7 @@ export const buildPaginator = (fetcher) => (req) => {
4
4
  all: async () => {
5
5
  const pages = [];
6
6
  let data;
7
- let nextCurrent = null;
7
+ let nextCurrent;
8
8
  do {
9
9
  data = await fetcher.request({
10
10
  ...req,
@@ -13,7 +13,7 @@ export const buildPaginator = (fetcher) => (req) => {
13
13
  : req.params,
14
14
  });
15
15
  // Next cursor cannot be the same as previous received one. Sanity check the api.
16
- if (nextCurrent == data?.next) {
16
+ if (data?.next != null && nextCurrent == data?.next) {
17
17
  throw new FaableApiError("Bad next cursor");
18
18
  }
19
19
  nextCurrent = data.next;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faable/sdk-base",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "author": "Marc Pomar <marc@faable.com>",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",