Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Commit

Permalink
New client release: 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Engineering at Onfido committed Mar 7, 2019
1 parent cb1af6f commit 2e3d9b8
Show file tree
Hide file tree
Showing 39 changed files with 534 additions and 38 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The Onfido API is used to submit check requests.
This package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 2.0.0
- Package version: 3.0.0
- Package version: 3.1.0
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

## Installation
Expand Down Expand Up @@ -131,6 +131,7 @@ Class | Method | HTTP request | Description
*Onfido.DefaultApi* | [**findReport**](docs/DefaultApi.md#findReport) | **GET** /checks/{check_id}/reports/{report_id} | A single report can be retrieved using this endpoint with the corresponding unique identifier.
*Onfido.DefaultApi* | [**findReportTypeGroup**](docs/DefaultApi.md#findReportTypeGroup) | **GET** /report_type_groups/{report_type_group_id} | Retrieve single report type group object
*Onfido.DefaultApi* | [**findWebhook**](docs/DefaultApi.md#findWebhook) | **GET** /webhooks/{webhook_id} | Retrieve a Webhook
*Onfido.DefaultApi* | [**generateSdkToken**](docs/DefaultApi.md#generateSdkToken) | **POST** /sdk_token | Generate a SDK token
*Onfido.DefaultApi* | [**listApplicants**](docs/DefaultApi.md#listApplicants) | **GET** /applicants | List Applicants
*Onfido.DefaultApi* | [**listChecks**](docs/DefaultApi.md#listChecks) | **GET** /applicants/{applicant_id}/checks | Retrieve Checks
*Onfido.DefaultApi* | [**listDocuments**](docs/DefaultApi.md#listDocuments) | **GET** /applicants/{applicant_id}/documents | List documents
Expand Down Expand Up @@ -173,6 +174,8 @@ Class | Method | HTTP request | Description
- [Onfido.ReportTypeGroup](docs/ReportTypeGroup.md)
- [Onfido.ReportTypeGroupsList](docs/ReportTypeGroupsList.md)
- [Onfido.ReportsList](docs/ReportsList.md)
- [Onfido.SdkTokenRequest](docs/SdkTokenRequest.md)
- [Onfido.SdkTokenResponse](docs/SdkTokenResponse.md)
- [Onfido.Webhook](docs/Webhook.md)
- [Onfido.WebhooksList](docs/WebhooksList.md)

Expand Down
45 changes: 45 additions & 0 deletions docs/DefaultApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Method | HTTP request | Description
[**findReport**](DefaultApi.md#findReport) | **GET** /checks/{check_id}/reports/{report_id} | A single report can be retrieved using this endpoint with the corresponding unique identifier.
[**findReportTypeGroup**](DefaultApi.md#findReportTypeGroup) | **GET** /report_type_groups/{report_type_group_id} | Retrieve single report type group object
[**findWebhook**](DefaultApi.md#findWebhook) | **GET** /webhooks/{webhook_id} | Retrieve a Webhook
[**generateSdkToken**](DefaultApi.md#generateSdkToken) | **POST** /sdk_token | Generate a SDK token
[**listApplicants**](DefaultApi.md#listApplicants) | **GET** /applicants | List Applicants
[**listChecks**](DefaultApi.md#listChecks) | **GET** /applicants/{applicant_id}/checks | Retrieve Checks
[**listDocuments**](DefaultApi.md#listDocuments) | **GET** /applicants/{applicant_id}/documents | List documents
Expand Down Expand Up @@ -801,6 +802,50 @@ Name | Type | Description | Notes
- **Content-Type**: Not defined
- **Accept**: application/json

<a name="generateSdkToken"></a>
# **generateSdkToken**
> SdkTokenResponse generateSdkToken(SdkTokenRequest)
Generate a SDK token

### Example
```javascript
var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.instance;
// Configure API key authorization: Token
const token_auth = defaultClient.authentications['Token'];
token_auth.apiKey = 'token=' + 'YOUR API KEY';
token_auth.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();
var SdkTokenRequest = new Onfido.SdkTokenRequest(); // SdkTokenRequest |
apiInstance.generateSdkToken(SdkTokenRequest).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});

```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**SdkTokenRequest** | [**SdkTokenRequest**](SdkTokenRequest.md)| |

### Return type

[**SdkTokenResponse**](SdkTokenResponse.md)

### Authorization

[Token](../README.md#Token)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

<a name="listApplicants"></a>
# **listApplicants**
> ApplicantsList listApplicants(opts)
Expand Down
9 changes: 9 additions & 0 deletions docs/SdkTokenRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Onfido.SdkTokenRequest

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**applicant_id** | **String** | The unique identifier of the applicant |
**referrer** | **String** | The referrer URL pattern |


8 changes: 8 additions & 0 deletions docs/SdkTokenResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Onfido.SdkTokenResponse

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**token** | **String** | The generated SDK token | [optional]


2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "onfido",
"version": "3.0.0",
"version": "3.1.0",
"description": "Client library for the Onfido API.",
"license": "MIT",
"main": "src/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/ApiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

/**
* @module ApiClient
* @version 3.0.0
* @version 3.1.0
*/

/**
Expand Down
60 changes: 55 additions & 5 deletions src/api/DefaultApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Applicant', 'model/ApplicantsList', 'model/Check', 'model/CheckWithReportIds', 'model/ChecksList', 'model/Document', 'model/DocumentsList', 'model/Error', 'model/GenericAddressesList', 'model/LivePhoto', 'model/LivePhotosList', 'model/LiveVideo', 'model/LiveVideosList', 'model/Report', 'model/ReportTypeGroup', 'model/ReportTypeGroupsList', 'model/ReportsList', 'model/Webhook', 'model/WebhooksList'], factory);
define(['ApiClient', 'model/Applicant', 'model/ApplicantsList', 'model/Check', 'model/CheckWithReportIds', 'model/ChecksList', 'model/Document', 'model/DocumentsList', 'model/Error', 'model/GenericAddressesList', 'model/LivePhoto', 'model/LivePhotosList', 'model/LiveVideo', 'model/LiveVideosList', 'model/Report', 'model/ReportTypeGroup', 'model/ReportTypeGroupsList', 'model/ReportsList', 'model/SdkTokenRequest', 'model/SdkTokenResponse', 'model/Webhook', 'model/WebhooksList'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('../model/Applicant'), require('../model/ApplicantsList'), require('../model/Check'), require('../model/CheckWithReportIds'), require('../model/ChecksList'), require('../model/Document'), require('../model/DocumentsList'), require('../model/Error'), require('../model/GenericAddressesList'), require('../model/LivePhoto'), require('../model/LivePhotosList'), require('../model/LiveVideo'), require('../model/LiveVideosList'), require('../model/Report'), require('../model/ReportTypeGroup'), require('../model/ReportTypeGroupsList'), require('../model/ReportsList'), require('../model/Webhook'), require('../model/WebhooksList'));
module.exports = factory(require('../ApiClient'), require('../model/Applicant'), require('../model/ApplicantsList'), require('../model/Check'), require('../model/CheckWithReportIds'), require('../model/ChecksList'), require('../model/Document'), require('../model/DocumentsList'), require('../model/Error'), require('../model/GenericAddressesList'), require('../model/LivePhoto'), require('../model/LivePhotosList'), require('../model/LiveVideo'), require('../model/LiveVideosList'), require('../model/Report'), require('../model/ReportTypeGroup'), require('../model/ReportTypeGroupsList'), require('../model/ReportsList'), require('../model/SdkTokenRequest'), require('../model/SdkTokenResponse'), require('../model/Webhook'), require('../model/WebhooksList'));
} else {
// Browser globals (root is window)
if (!root.Onfido) {
root.Onfido = {};
}
root.Onfido.DefaultApi = factory(root.Onfido.ApiClient, root.Onfido.Applicant, root.Onfido.ApplicantsList, root.Onfido.Check, root.Onfido.CheckWithReportIds, root.Onfido.ChecksList, root.Onfido.Document, root.Onfido.DocumentsList, root.Onfido.Error, root.Onfido.GenericAddressesList, root.Onfido.LivePhoto, root.Onfido.LivePhotosList, root.Onfido.LiveVideo, root.Onfido.LiveVideosList, root.Onfido.Report, root.Onfido.ReportTypeGroup, root.Onfido.ReportTypeGroupsList, root.Onfido.ReportsList, root.Onfido.Webhook, root.Onfido.WebhooksList);
root.Onfido.DefaultApi = factory(root.Onfido.ApiClient, root.Onfido.Applicant, root.Onfido.ApplicantsList, root.Onfido.Check, root.Onfido.CheckWithReportIds, root.Onfido.ChecksList, root.Onfido.Document, root.Onfido.DocumentsList, root.Onfido.Error, root.Onfido.GenericAddressesList, root.Onfido.LivePhoto, root.Onfido.LivePhotosList, root.Onfido.LiveVideo, root.Onfido.LiveVideosList, root.Onfido.Report, root.Onfido.ReportTypeGroup, root.Onfido.ReportTypeGroupsList, root.Onfido.ReportsList, root.Onfido.SdkTokenRequest, root.Onfido.SdkTokenResponse, root.Onfido.Webhook, root.Onfido.WebhooksList);
}
}(this, function(ApiClient, Applicant, ApplicantsList, Check, CheckWithReportIds, ChecksList, Document, DocumentsList, Error, GenericAddressesList, LivePhoto, LivePhotosList, LiveVideo, LiveVideosList, Report, ReportTypeGroup, ReportTypeGroupsList, ReportsList, Webhook, WebhooksList) {
}(this, function(ApiClient, Applicant, ApplicantsList, Check, CheckWithReportIds, ChecksList, Document, DocumentsList, Error, GenericAddressesList, LivePhoto, LivePhotosList, LiveVideo, LiveVideosList, Report, ReportTypeGroup, ReportTypeGroupsList, ReportsList, SdkTokenRequest, SdkTokenResponse, Webhook, WebhooksList) {
'use strict';

/**
* Default service.
* @module api/DefaultApi
* @version 3.0.0
* @version 3.1.0
*/

/**
Expand Down Expand Up @@ -964,6 +964,56 @@
}


/**
* Generate a SDK token
* @param {module:model/SdkTokenRequest} SdkTokenRequest
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SdkTokenResponse} and HTTP response
*/
this.generateSdkTokenWithHttpInfo = function(SdkTokenRequest) {
var postBody = SdkTokenRequest;

// verify the required parameter 'SdkTokenRequest' is set
if (SdkTokenRequest === undefined || SdkTokenRequest === null) {
throw new Error("Missing the required parameter 'SdkTokenRequest' when calling generateSdkToken");
}


var pathParams = {
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};

var authNames = ['Token'];
var contentTypes = ['application/json'];
var accepts = ['application/json'];
var returnType = SdkTokenResponse;

return this.apiClient.callApi(
'/sdk_token', 'POST',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
);
}

/**
* Generate a SDK token
* @param {module:model/SdkTokenRequest} SdkTokenRequest
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SdkTokenResponse}
*/
this.generateSdkToken = function(SdkTokenRequest) {
return this.generateSdkTokenWithHttpInfo(SdkTokenRequest)
.then(function(response_and_data) {
return response_and_data.data;
});
}


/**
* List Applicants
* @param {Object} opts Optional parameters
Expand Down
18 changes: 14 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
(function(factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Address', 'model/Applicant', 'model/ApplicantsList', 'model/Check', 'model/CheckCommon', 'model/CheckWithReportIds', 'model/ChecksList', 'model/Document', 'model/DocumentsList', 'model/Error', 'model/GenericAddress', 'model/GenericAddressesList', 'model/IdNumber', 'model/LivePhoto', 'model/LivePhotosList', 'model/LiveVideo', 'model/LiveVideosList', 'model/Report', 'model/ReportDocument', 'model/ReportOption', 'model/ReportType', 'model/ReportTypeGroup', 'model/ReportTypeGroupsList', 'model/ReportsList', 'model/Webhook', 'model/WebhooksList', 'api/DefaultApi'], factory);
define(['ApiClient', 'model/Address', 'model/Applicant', 'model/ApplicantsList', 'model/Check', 'model/CheckCommon', 'model/CheckWithReportIds', 'model/ChecksList', 'model/Document', 'model/DocumentsList', 'model/Error', 'model/GenericAddress', 'model/GenericAddressesList', 'model/IdNumber', 'model/LivePhoto', 'model/LivePhotosList', 'model/LiveVideo', 'model/LiveVideosList', 'model/Report', 'model/ReportDocument', 'model/ReportOption', 'model/ReportType', 'model/ReportTypeGroup', 'model/ReportTypeGroupsList', 'model/ReportsList', 'model/SdkTokenRequest', 'model/SdkTokenResponse', 'model/Webhook', 'model/WebhooksList', 'api/DefaultApi'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('./ApiClient'), require('./model/Address'), require('./model/Applicant'), require('./model/ApplicantsList'), require('./model/Check'), require('./model/CheckCommon'), require('./model/CheckWithReportIds'), require('./model/ChecksList'), require('./model/Document'), require('./model/DocumentsList'), require('./model/Error'), require('./model/GenericAddress'), require('./model/GenericAddressesList'), require('./model/IdNumber'), require('./model/LivePhoto'), require('./model/LivePhotosList'), require('./model/LiveVideo'), require('./model/LiveVideosList'), require('./model/Report'), require('./model/ReportDocument'), require('./model/ReportOption'), require('./model/ReportType'), require('./model/ReportTypeGroup'), require('./model/ReportTypeGroupsList'), require('./model/ReportsList'), require('./model/Webhook'), require('./model/WebhooksList'), require('./api/DefaultApi'));
module.exports = factory(require('./ApiClient'), require('./model/Address'), require('./model/Applicant'), require('./model/ApplicantsList'), require('./model/Check'), require('./model/CheckCommon'), require('./model/CheckWithReportIds'), require('./model/ChecksList'), require('./model/Document'), require('./model/DocumentsList'), require('./model/Error'), require('./model/GenericAddress'), require('./model/GenericAddressesList'), require('./model/IdNumber'), require('./model/LivePhoto'), require('./model/LivePhotosList'), require('./model/LiveVideo'), require('./model/LiveVideosList'), require('./model/Report'), require('./model/ReportDocument'), require('./model/ReportOption'), require('./model/ReportType'), require('./model/ReportTypeGroup'), require('./model/ReportTypeGroupsList'), require('./model/ReportsList'), require('./model/SdkTokenRequest'), require('./model/SdkTokenResponse'), require('./model/Webhook'), require('./model/WebhooksList'), require('./api/DefaultApi'));
}
}(function(ApiClient, Address, Applicant, ApplicantsList, Check, CheckCommon, CheckWithReportIds, ChecksList, Document, DocumentsList, Error, GenericAddress, GenericAddressesList, IdNumber, LivePhoto, LivePhotosList, LiveVideo, LiveVideosList, Report, ReportDocument, ReportOption, ReportType, ReportTypeGroup, ReportTypeGroupsList, ReportsList, Webhook, WebhooksList, DefaultApi) {
}(function(ApiClient, Address, Applicant, ApplicantsList, Check, CheckCommon, CheckWithReportIds, ChecksList, Document, DocumentsList, Error, GenericAddress, GenericAddressesList, IdNumber, LivePhoto, LivePhotosList, LiveVideo, LiveVideosList, Report, ReportDocument, ReportOption, ReportType, ReportTypeGroup, ReportTypeGroupsList, ReportsList, SdkTokenRequest, SdkTokenResponse, Webhook, WebhooksList, DefaultApi) {
'use strict';

/**
Expand Down Expand Up @@ -53,7 +53,7 @@
* </pre>
* </p>
* @module index
* @version 3.0.0
* @version 3.1.0
*/
var exports = {
/**
Expand Down Expand Up @@ -181,6 +181,16 @@
* @property {module:model/ReportsList}
*/
ReportsList: ReportsList,
/**
* The SdkTokenRequest model constructor.
* @property {module:model/SdkTokenRequest}
*/
SdkTokenRequest: SdkTokenRequest,
/**
* The SdkTokenResponse model constructor.
* @property {module:model/SdkTokenResponse}
*/
SdkTokenResponse: SdkTokenResponse,
/**
* The Webhook model constructor.
* @property {module:model/Webhook}
Expand Down
2 changes: 1 addition & 1 deletion src/model/Address.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/**
* The Address model module.
* @module model/Address
* @version 3.0.0
* @version 3.1.0
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/model/Applicant.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/**
* The Applicant model module.
* @module model/Applicant
* @version 3.0.0
* @version 3.1.0
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/model/ApplicantsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/**
* The ApplicantsList model module.
* @module model/ApplicantsList
* @version 3.0.0
* @version 3.1.0
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/model/Check.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/**
* The Check model module.
* @module model/Check
* @version 3.0.0
* @version 3.1.0
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/model/CheckCommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/**
* The CheckCommon model module.
* @module model/CheckCommon
* @version 3.0.0
* @version 3.1.0
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/model/CheckWithReportIds.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/**
* The CheckWithReportIds model module.
* @module model/CheckWithReportIds
* @version 3.0.0
* @version 3.1.0
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/model/ChecksList.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/**
* The ChecksList model module.
* @module model/ChecksList
* @version 3.0.0
* @version 3.1.0
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/model/Document.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/**
* The Document model module.
* @module model/Document
* @version 3.0.0
* @version 3.1.0
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/model/DocumentsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/**
* The DocumentsList model module.
* @module model/DocumentsList
* @version 3.0.0
* @version 3.1.0
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/model/Error.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/**
* The Error model module.
* @module model/Error
* @version 3.0.0
* @version 3.1.0
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/model/GenericAddress.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/**
* The GenericAddress model module.
* @module model/GenericAddress
* @version 3.0.0
* @version 3.1.0
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/model/GenericAddressesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/**
* The GenericAddressesList model module.
* @module model/GenericAddressesList
* @version 3.0.0
* @version 3.1.0
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/model/IdNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/**
* The IdNumber model module.
* @module model/IdNumber
* @version 3.0.0
* @version 3.1.0
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/model/LivePhoto.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/**
* The LivePhoto model module.
* @module model/LivePhoto
* @version 3.0.0
* @version 3.1.0
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/model/LivePhotosList.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/**
* The LivePhotosList model module.
* @module model/LivePhotosList
* @version 3.0.0
* @version 3.1.0
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/model/LiveVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/**
* The LiveVideo model module.
* @module model/LiveVideo
* @version 3.0.0
* @version 3.1.0
*/

/**
Expand Down
Loading

0 comments on commit 2e3d9b8

Please sign in to comment.