@onfido/api 3.0.0 → 3.1.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.
package/README.md CHANGED
@@ -32,7 +32,7 @@ Require the package:
32
32
  const {
33
33
  DefaultApi,
34
34
  Configuration,
35
- WebhookEventVerifier,
35
+ WebhookEventVerifier
36
36
  } = require("@onfido/api");
37
37
  const { isAxiosError } = require("axios");
38
38
  ```
@@ -44,7 +44,7 @@ import {
44
44
  DefaultApi,
45
45
  Configuration,
46
46
  Region,
47
- WebhookEventVerifier,
47
+ WebhookEventVerifier
48
48
  } from "@onfido/api";
49
49
  import { isAxiosError } from "axios";
50
50
  ```
@@ -56,8 +56,8 @@ const onfido = new DefaultApi(
56
56
  new Configuration({
57
57
  apiToken: process.env.ONFIDO_API_TOKEN,
58
58
  region: Region.EU, // Supports Region.EU, Region.US and Region.CA
59
- baseOptions: { timeout: 60_000 }, // Additional Axios options (timeout, etc.)
60
- }),
59
+ baseOptions: { timeout: 60_000 } // Additional Axios options (timeout, etc.)
60
+ })
61
61
  );
62
62
  ```
63
63
 
@@ -75,8 +75,8 @@ Using `async`/`await` (in an `async function`):
75
75
  last_name: "Doe",
76
76
  location: {
77
77
  ip_address: "127.0.0.1",
78
- country_of_residence: "GBR",
79
- },
78
+ country_of_residence: "GBR"
79
+ }
80
80
  });
81
81
 
82
82
  // ...
@@ -151,7 +151,7 @@ For some common types of streams, like instances of `fs.ReadStream`, you can pro
151
151
  onfido.uploadDocument(
152
152
  "passport",
153
153
  "<APPLICANT_ID>",
154
- fs.createReadStream("path/to/passport.png"),
154
+ fs.createReadStream("path/to/passport.png")
155
155
  );
156
156
  ```
157
157
 
@@ -162,7 +162,8 @@ Webhook events payload needs to be verified before it can be accessed. Library a
162
162
  ```js
163
163
  (async () => {
164
164
  try {
165
- const verifier = new WebhookEventVerifier("_ABC123abc...3ABC123_");
165
+ const token = process.env.ONFIDO_WEBHOOK_SECRET_TOKEN;
166
+ const verifier = new WebhookEventVerifier(token);
166
167
  const signature = "a0...760e";
167
168
 
168
169
  const event = verifier.readPayload(`{"payload":{"r...3"}}`, signature);
@@ -174,24 +175,46 @@ Webhook events payload needs to be verified before it can be accessed. Library a
174
175
  })();
175
176
  ```
176
177
 
178
+ ### Recommendations
179
+
180
+ #### Do not use square bracket syntax
181
+
182
+ Except for accessing Task object's outputs, retain from using the square bracket syntax (i.e. `[]`) to access not defined properties to avoid breaking changes when these fields will appear.
183
+
177
184
  ## Contributing
178
185
 
179
- This library is automatically generated using [OpenAPI Generator](https://openapi-generator.tech) - version: 7.5.0; therefore all the contributions, except tests files, should target [Onfido OpenAPI specification repository](https://github.com/onfido/onfido-openapi-spec/tree/master) instead of this repository.
186
+ This library is automatically generated using [OpenAPI Generator](https://openapi-generator.tech) (version: 7.6.0); therefore all the contributions, except tests files, should target [Onfido OpenAPI specification repository](https://github.com/onfido/onfido-openapi-spec/tree/master) instead of this repository.
180
187
 
181
188
  For contributions to the tests instead, please follow the steps below:
182
189
 
183
- 1. [Fork](<https://github.com/onfido/onfido-node/fork>) repository
190
+ 1. [Fork](https://github.com/onfido/onfido-node/fork) repository
184
191
  2. Create your feature branch (`git checkout -b my-new-feature`)
185
192
  3. Make your changes
186
193
  4. Commit your changes (`git commit -am 'Add some feature'`)
187
194
  5. Push to the branch (`git push origin my-new-feature`)
188
195
  6. Create a new Pull Request
189
196
 
197
+ ## Versioning policy
198
+
199
+ [Semantic Versioning](https://semver.org) policy is used for library versioning, following guidelines and limitations below:
200
+
201
+ - MAJOR versions (x.0.0) might:
202
+ - target a new API version
203
+ - include non-backward compatible change
204
+ - MINOR versions (0.x.0) might:
205
+ - add a new functionality, non-mandatory parameter or property
206
+ - deprecate an old functionality
207
+ - include non-backward compatible change to a functionality which is:
208
+ - labelled as alpha or beta
209
+ - completely broken and not usable
210
+ - PATCH version (0.0.x) might:
211
+ - fix a bug
212
+ - include backward compatible changes only
213
+
190
214
  ## More documentation
191
215
 
192
216
  More documentation and code examples can be found at <https://documentation.onfido.com>.
193
217
 
194
218
  ## Support
195
219
 
196
- Should you encounter any technical issues during integration, please contact Onfido's Customer Support team
197
- via the [Customer Experience Portal](https://public.support.onfido.com/) which also includes support documentation.
220
+ Should you encounter any technical issues during integration, please contact Onfido's Customer Support team via the [Customer Experience Portal](https://public.support.onfido.com/) which also includes support documentation.