@seamapi/http 1.25.0 → 1.25.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.
package/README.md CHANGED
@@ -329,6 +329,32 @@ if (hasNextPage) {
329
329
  }
330
330
  ```
331
331
 
332
+ #### Resume pagination
333
+
334
+ Get the first page on initial load:
335
+
336
+ ```ts
337
+ const params = { limit: 20 }
338
+
339
+ const pages = seam.createPaginator(seam.devices.list(params))
340
+
341
+ const [devices, pagination] = await pages.firstPage()
342
+
343
+ localStorage.setItem('/seam/devices/list', JSON.stringify([params, pagination]))
344
+ ```
345
+
346
+ Get the next page at a later time:
347
+
348
+ ```ts
349
+ const [params = {}, { hasNextPage = false, nextPageCursor = null } = {}] =
350
+ JSON.parse(localStorage.getItem('/seam/devices/list') ?? '[]')
351
+
352
+ if (hasNextPage) {
353
+ const pages = seam.createPaginator(seam.devices.list(params))
354
+ const [moreDevices] = await pages.nextPage(nextPageCursor)
355
+ }
356
+ ```
357
+
332
358
  #### Iterate over all pages
333
359
 
334
360
  ```ts
@@ -366,7 +392,7 @@ const pages = seam.createPaginator(
366
392
  }),
367
393
  )
368
394
 
369
- const devices = await pages.toArray()
395
+ const devices = await pages.flattenToArray()
370
396
  ```
371
397
 
372
398
  ### Interacting with Multiple Workspaces
package/lib/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const seamapiJavascriptHttpVersion = "1.25.0";
1
+ declare const seamapiJavascriptHttpVersion = "1.25.1";
2
2
  export default seamapiJavascriptHttpVersion;
package/lib/version.js CHANGED
@@ -1,3 +1,3 @@
1
- const seamapiJavascriptHttpVersion = '1.25.0';
1
+ const seamapiJavascriptHttpVersion = '1.25.1';
2
2
  export default seamapiJavascriptHttpVersion;
3
3
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamapi/http",
3
- "version": "1.25.0",
3
+ "version": "1.25.1",
4
4
  "description": "JavaScript HTTP client for the Seam API written in TypeScript.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -92,13 +92,13 @@
92
92
  }
93
93
  },
94
94
  "dependencies": {
95
- "@seamapi/url-search-params-serializer": "^1.1.0",
95
+ "@seamapi/url-search-params-serializer": "^1.2.0",
96
96
  "axios": "^1.5.0",
97
97
  "axios-better-stacktrace": "^2.1.7",
98
98
  "axios-retry": "^4.4.2"
99
99
  },
100
100
  "devDependencies": {
101
- "@seamapi/fake-seam-connect": "^1.76.0",
101
+ "@seamapi/fake-seam-connect": "^1.77.0",
102
102
  "@seamapi/types": "1.351.1",
103
103
  "@types/eslint": "^8.44.2",
104
104
  "@types/jsonwebtoken": "^9.0.6",
@@ -1,3 +1,3 @@
1
- const seamapiJavascriptHttpVersion = '1.25.0'
1
+ const seamapiJavascriptHttpVersion = '1.25.1'
2
2
 
3
3
  export default seamapiJavascriptHttpVersion