Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh onfido-node after onfido-openapi-spec update (a6d9ac1) #143

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .release.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"source": {
"repo_url": "https://github.com/onfido/onfido-openapi-spec",
"short_sha": "f941ec8",
"long_sha": "f941ec84c3aeb0d3fcceea537991ba7e1ac96414",
"version": "v3.3.0"
"short_sha": "a6d9ac1",
"long_sha": "a6d9ac1aedd1d3b9432627568b73161560732919",
"version": "v3.3.2"
},
"release": "v3.4.0"
"release": "v3.5.0"
}
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,23 +132,23 @@ onfido

### File download

File downloads, for example `onfido.downloadDocument(documentId, {responseType: 'arraybuffer'})`, will return an instance of a specific object for this endpoint.
File downloads, for example `onfido.downloadDocument(documentId)`, will return an instance of a `FileTransfer` object.

These objects will have a content type, e.g. `image/png`.
This object will have a content type, e.g. `image/png`.

```js
download.headers["content-type"];
```

Call `slice()` to get a `Blob` of the download:
Call `slice()` to get a `Buffer` of the download:

```js
const blob = download.data.slice();
```

### File upload

File upload should use the provided FileTransfer class, e.g.:
File upload should make use of the provided `FileTransfer` class, e.g.:

```js
onfido.uploadDocument(
Expand All @@ -158,6 +158,8 @@ onfido.uploadDocument(
);
```

`FileTransfer` object can also be created from an existing file, e.g. `new FileTransfer("path/to/passport.png")`.

### Webhook event verification

Webhook events payload needs to be verified before it can be accessed. Library allows to easily decode the payload and verify its signature before returning it as an object for user convenience:
Expand Down
2 changes: 1 addition & 1 deletion api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12731,7 +12731,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati
}

if (location !== undefined) {
localVarFormParams.append('location', new Blob([JSON.stringify(location)], { type: "application/json", }));
localVarFormParams.append('location', JSON.stringify(location));
}


Expand Down
2 changes: 1 addition & 1 deletion configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class Configuration {
this.baseOptions = {...{ timeout: 30_000 },
...param.baseOptions,
...{ headers: {...param.baseOptions?.headers,
...{'User-Agent': 'onfido-node/3.4.0'}}}};
...{'User-Agent': 'onfido-node/3.5.0'}}}};
this.formDataCtor = param.formDataCtor || require('form-data'); // Injiect form data constructor (if needed)
}

Expand Down
Loading