@oneblink/sdk 2.0.0-beta.1 → 2.0.0

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.
Files changed (2) hide show
  1. package/README.md +38 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -5,3 +5,41 @@ OneBlink SDK to serve as an entry point for all OneBlink Services in NodeJS
5
5
  ## Documentation
6
6
 
7
7
  See the [Documentation](https://oneblink.github.io/sdk-node-js/) for more details.
8
+
9
+ ## Migrating to v2
10
+
11
+ ### Forms.search()
12
+
13
+ In previous versions (< 2.0), this function returned all forms in one call. This is no longer the case and mandatory pagination is now enforced.
14
+
15
+ If no `limit` is provided, this is set to 200. If no `offset` is provided, this is set to `0`.
16
+
17
+ If you currently have more than 200 forms returned from this function, or expect to have more than 200 forms returned, you will need to update your code to account for this.
18
+ If you do need to account for this, accessing all forms as you previously could now requires that you make multiple calls to this function. This could look something like:
19
+
20
+ ```javascript
21
+ const { Forms } = require('@oneblink/sdk')
22
+
23
+ const options = {
24
+ accessKey: '123455678901ABCDEFGHIJKL',
25
+ secretKey: '123455678901ABCDEFGHIJKL123455678901ABCDEFGHIJKL',
26
+ }
27
+ const forms = new Forms(options)
28
+
29
+ const nextOffset = 0
30
+ const forms = []
31
+
32
+ while (nextOffset !== undefined) {
33
+ var result = await forms.searchForms({
34
+ // ...filters
35
+ limit: 100,
36
+ offset: nextOffset,
37
+ })
38
+ forms.push(result.forms)
39
+ nextOffset = result.meta.nextOffset
40
+ }
41
+
42
+ // Use `forms`
43
+ ```
44
+
45
+ Alternately, you could integrate pagination directly into your application.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oneblink/sdk",
3
3
  "description": "OneBlink SDK to serve as an entry point for all OneBlink Services in NodeJS",
4
- "version": "2.0.0-beta.1",
4
+ "version": "2.0.0",
5
5
  "author": "OneBlink <developers@oneblink.io> (https://oneblink.io)",
6
6
  "bugs": {
7
7
  "url": "https://github.com/oneblink/sdk-node-js/issues"