@onfido/api 4.5.0 → 5.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.
- package/README.md +22 -13
- package/dist/api.d.ts +142 -179
- package/dist/api.js +89 -38
- package/dist/configuration.js +1 -1
- package/dist/esm/api.d.ts +142 -179
- package/dist/esm/api.js +87 -36
- package/dist/esm/configuration.js +1 -1
- package/package.json +1 -1
package/dist/esm/api.js
CHANGED
|
@@ -368,13 +368,6 @@ export const DeviceIntelligenceBreakdownPropertiesDeviceBiometricCaptureEnum = {
|
|
|
368
368
|
UnknownMethod: 'unknown_method',
|
|
369
369
|
UnknownDefaultOpenApi: '11184809'
|
|
370
370
|
};
|
|
371
|
-
export const DocumentFileTypeEnum = {
|
|
372
|
-
Jpg: 'jpg',
|
|
373
|
-
Jpeg: 'jpeg',
|
|
374
|
-
Png: 'png',
|
|
375
|
-
Pdf: 'pdf',
|
|
376
|
-
UnknownDefaultOpenApi: '11184809'
|
|
377
|
-
};
|
|
378
371
|
export const DocumentSideEnum = {
|
|
379
372
|
Front: 'front',
|
|
380
373
|
Back: 'back',
|
|
@@ -404,13 +397,6 @@ export const DocumentPropertiesSecurityTierEnum = {
|
|
|
404
397
|
UnspecifiedSecurityTier: 'unspecified_security_tier',
|
|
405
398
|
UnknownDefaultOpenApi: '11184809'
|
|
406
399
|
};
|
|
407
|
-
export const DocumentSharedFileTypeEnum = {
|
|
408
|
-
Jpg: 'jpg',
|
|
409
|
-
Jpeg: 'jpeg',
|
|
410
|
-
Png: 'png',
|
|
411
|
-
Pdf: 'pdf',
|
|
412
|
-
UnknownDefaultOpenApi: '11184809'
|
|
413
|
-
};
|
|
414
400
|
export const DocumentSharedSideEnum = {
|
|
415
401
|
Front: 'front',
|
|
416
402
|
Back: 'back',
|
|
@@ -540,6 +526,7 @@ export const IdNumberTypeEnum = {
|
|
|
540
526
|
SocialInsurance: 'social_insurance',
|
|
541
527
|
TaxId: 'tax_id',
|
|
542
528
|
IdentityCard: 'identity_card',
|
|
529
|
+
DrivingLicense: 'driving_license',
|
|
543
530
|
DrivingLicence: 'driving_licence',
|
|
544
531
|
ShareCode: 'share_code',
|
|
545
532
|
VoterId: 'voter_id',
|
|
@@ -772,7 +759,6 @@ export const WebhookEventType = {
|
|
|
772
759
|
ReportAwaitingApproval: 'report.awaiting_approval',
|
|
773
760
|
ReportCompleted: 'report.completed',
|
|
774
761
|
WorkflowTimelineFileCreated: 'workflow_timeline_file.created',
|
|
775
|
-
WorkflowSignedEvidenceFileCreated: 'workflow_signed_evidence_file.created',
|
|
776
762
|
WorkflowRunEvidenceFolderCreated: 'workflow_run_evidence_folder.created',
|
|
777
763
|
UnknownDefaultOpenApi: '11184809'
|
|
778
764
|
};
|
|
@@ -1473,6 +1459,37 @@ export const DefaultApiAxiosParamCreator = function (configuration) {
|
|
|
1473
1459
|
options: localVarRequestOptions,
|
|
1474
1460
|
};
|
|
1475
1461
|
}),
|
|
1462
|
+
/**
|
|
1463
|
+
* Downloads digital photos extracted from specific documents belonging to an applicant. If successful, the response will be the binary data representing the image.
|
|
1464
|
+
* @summary Download NFC face
|
|
1465
|
+
* @param {string} documentId
|
|
1466
|
+
* @param {*} [options] Override http request option.
|
|
1467
|
+
* @throws {RequiredError}
|
|
1468
|
+
*/
|
|
1469
|
+
downloadNfcFace: (documentId, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
1470
|
+
// verify required parameter 'documentId' is not null or undefined
|
|
1471
|
+
assertParamExists('downloadNfcFace', 'documentId', documentId);
|
|
1472
|
+
const localVarPath = `/documents/{document_id}/nfc_face`
|
|
1473
|
+
.replace(`{${"document_id"}}`, encodeURIComponent(String(documentId)));
|
|
1474
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1475
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
1476
|
+
let baseOptions;
|
|
1477
|
+
if (configuration) {
|
|
1478
|
+
baseOptions = configuration.baseOptions;
|
|
1479
|
+
}
|
|
1480
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
1481
|
+
const localVarHeaderParameter = {};
|
|
1482
|
+
const localVarQueryParameter = {};
|
|
1483
|
+
// authentication Token required
|
|
1484
|
+
yield setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
|
|
1485
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1486
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1487
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1488
|
+
return {
|
|
1489
|
+
url: toPathString(localVarUrlObj),
|
|
1490
|
+
options: localVarRequestOptions,
|
|
1491
|
+
};
|
|
1492
|
+
}),
|
|
1476
1493
|
/**
|
|
1477
1494
|
* Retrieves the signed document or application form depending on the file_id provided.
|
|
1478
1495
|
* @summary Retrieves the signed document or application form
|
|
@@ -2517,10 +2534,11 @@ export const DefaultApiAxiosParamCreator = function (configuration) {
|
|
|
2517
2534
|
* @param {string} [createdAtGt] A ISO-8601 date to filter results with a created date greater than (after) the one provided.
|
|
2518
2535
|
* @param {string} [createdAtLt] A ISO-8601 date to filter results with a created date less than (before) the one provided.
|
|
2519
2536
|
* @param {ListWorkflowRunsSortEnum} [sort] A string with the value \'desc\' or \'asc\' that allows to sort the returned list by the completed datetime either descending or ascending, respectively. If not specified, defaults to \'desc\'.
|
|
2537
|
+
* @param {string} [applicantId] the applicant\'s id.
|
|
2520
2538
|
* @param {*} [options] Override http request option.
|
|
2521
2539
|
* @throws {RequiredError}
|
|
2522
2540
|
*/
|
|
2523
|
-
listWorkflowRuns: (page, status, createdAtGt, createdAtLt, sort, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
2541
|
+
listWorkflowRuns: (page, status, createdAtGt, createdAtLt, sort, applicantId, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
2524
2542
|
const localVarPath = `/workflow_runs`;
|
|
2525
2543
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2526
2544
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
@@ -2552,6 +2570,9 @@ export const DefaultApiAxiosParamCreator = function (configuration) {
|
|
|
2552
2570
|
if (sort !== undefined) {
|
|
2553
2571
|
localVarQueryParameter['sort'] = sort;
|
|
2554
2572
|
}
|
|
2573
|
+
if (applicantId !== undefined) {
|
|
2574
|
+
localVarQueryParameter['applicant_id'] = applicantId;
|
|
2575
|
+
}
|
|
2555
2576
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2556
2577
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2557
2578
|
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
@@ -2858,7 +2879,7 @@ export const DefaultApiAxiosParamCreator = function (configuration) {
|
|
|
2858
2879
|
* @param {DocumentTypes} type The type of document
|
|
2859
2880
|
* @param {string} applicantId The ID of the applicant whose document is being uploaded.
|
|
2860
2881
|
* @param {FileTransfer} file The file to be uploaded.
|
|
2861
|
-
* @param {
|
|
2882
|
+
* @param {string} [fileType] The file type of the uploaded file
|
|
2862
2883
|
* @param {UploadDocumentSideEnum} [side] The side of the document, if applicable. The possible values are front and back
|
|
2863
2884
|
* @param {CountryCodes} [issuingCountry] The issuing country of the document, a 3-letter ISO code.
|
|
2864
2885
|
* @param {boolean} [validateImageQuality] Defaults to false. When true the submitted image will undergo an image quality validation which may take up to 5 seconds.
|
|
@@ -3347,6 +3368,22 @@ export const DefaultApiFp = function (configuration) {
|
|
|
3347
3368
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
3348
3369
|
});
|
|
3349
3370
|
},
|
|
3371
|
+
/**
|
|
3372
|
+
* Downloads digital photos extracted from specific documents belonging to an applicant. If successful, the response will be the binary data representing the image.
|
|
3373
|
+
* @summary Download NFC face
|
|
3374
|
+
* @param {string} documentId
|
|
3375
|
+
* @param {*} [options] Override http request option.
|
|
3376
|
+
* @throws {RequiredError}
|
|
3377
|
+
*/
|
|
3378
|
+
downloadNfcFace(documentId, options) {
|
|
3379
|
+
var _a, _b, _c;
|
|
3380
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3381
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.downloadNfcFace(documentId, options);
|
|
3382
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
3383
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['DefaultApi.downloadNfcFace']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
3384
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
3385
|
+
});
|
|
3386
|
+
},
|
|
3350
3387
|
/**
|
|
3351
3388
|
* Retrieves the signed document or application form depending on the file_id provided.
|
|
3352
3389
|
* @summary Retrieves the signed document or application form
|
|
@@ -3872,13 +3909,14 @@ export const DefaultApiFp = function (configuration) {
|
|
|
3872
3909
|
* @param {string} [createdAtGt] A ISO-8601 date to filter results with a created date greater than (after) the one provided.
|
|
3873
3910
|
* @param {string} [createdAtLt] A ISO-8601 date to filter results with a created date less than (before) the one provided.
|
|
3874
3911
|
* @param {ListWorkflowRunsSortEnum} [sort] A string with the value \'desc\' or \'asc\' that allows to sort the returned list by the completed datetime either descending or ascending, respectively. If not specified, defaults to \'desc\'.
|
|
3912
|
+
* @param {string} [applicantId] the applicant\'s id.
|
|
3875
3913
|
* @param {*} [options] Override http request option.
|
|
3876
3914
|
* @throws {RequiredError}
|
|
3877
3915
|
*/
|
|
3878
|
-
listWorkflowRuns(page, status, createdAtGt, createdAtLt, sort, options) {
|
|
3916
|
+
listWorkflowRuns(page, status, createdAtGt, createdAtLt, sort, applicantId, options) {
|
|
3879
3917
|
var _a, _b, _c;
|
|
3880
3918
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3881
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.listWorkflowRuns(page, status, createdAtGt, createdAtLt, sort, options);
|
|
3919
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listWorkflowRuns(page, status, createdAtGt, createdAtLt, sort, applicantId, options);
|
|
3882
3920
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
3883
3921
|
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['DefaultApi.listWorkflowRuns']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
3884
3922
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
@@ -4036,7 +4074,7 @@ export const DefaultApiFp = function (configuration) {
|
|
|
4036
4074
|
* @param {DocumentTypes} type The type of document
|
|
4037
4075
|
* @param {string} applicantId The ID of the applicant whose document is being uploaded.
|
|
4038
4076
|
* @param {FileTransfer} file The file to be uploaded.
|
|
4039
|
-
* @param {
|
|
4077
|
+
* @param {string} [fileType] The file type of the uploaded file
|
|
4040
4078
|
* @param {UploadDocumentSideEnum} [side] The side of the document, if applicable. The possible values are front and back
|
|
4041
4079
|
* @param {CountryCodes} [issuingCountry] The issuing country of the document, a 3-letter ISO code.
|
|
4042
4080
|
* @param {boolean} [validateImageQuality] Defaults to false. When true the submitted image will undergo an image quality validation which may take up to 5 seconds.
|
|
@@ -4309,6 +4347,16 @@ export const DefaultApiFactory = function (configuration, basePath, axios) {
|
|
|
4309
4347
|
downloadMotionCaptureFrame(motionCaptureId, options) {
|
|
4310
4348
|
return localVarFp.downloadMotionCaptureFrame(motionCaptureId, options).then((request) => request(axios, basePath));
|
|
4311
4349
|
},
|
|
4350
|
+
/**
|
|
4351
|
+
* Downloads digital photos extracted from specific documents belonging to an applicant. If successful, the response will be the binary data representing the image.
|
|
4352
|
+
* @summary Download NFC face
|
|
4353
|
+
* @param {string} documentId
|
|
4354
|
+
* @param {*} [options] Override http request option.
|
|
4355
|
+
* @throws {RequiredError}
|
|
4356
|
+
*/
|
|
4357
|
+
downloadNfcFace(documentId, options) {
|
|
4358
|
+
return localVarFp.downloadNfcFace(documentId, options).then((request) => request(axios, basePath));
|
|
4359
|
+
},
|
|
4312
4360
|
/**
|
|
4313
4361
|
* Retrieves the signed document or application form depending on the file_id provided.
|
|
4314
4362
|
* @summary Retrieves the signed document or application form
|
|
@@ -4642,11 +4690,12 @@ export const DefaultApiFactory = function (configuration, basePath, axios) {
|
|
|
4642
4690
|
* @param {string} [createdAtGt] A ISO-8601 date to filter results with a created date greater than (after) the one provided.
|
|
4643
4691
|
* @param {string} [createdAtLt] A ISO-8601 date to filter results with a created date less than (before) the one provided.
|
|
4644
4692
|
* @param {ListWorkflowRunsSortEnum} [sort] A string with the value \'desc\' or \'asc\' that allows to sort the returned list by the completed datetime either descending or ascending, respectively. If not specified, defaults to \'desc\'.
|
|
4693
|
+
* @param {string} [applicantId] the applicant\'s id.
|
|
4645
4694
|
* @param {*} [options] Override http request option.
|
|
4646
4695
|
* @throws {RequiredError}
|
|
4647
4696
|
*/
|
|
4648
|
-
listWorkflowRuns(page, status, createdAtGt, createdAtLt, sort, options) {
|
|
4649
|
-
return localVarFp.listWorkflowRuns(page, status, createdAtGt, createdAtLt, sort, options).then((request) => request(axios, basePath));
|
|
4697
|
+
listWorkflowRuns(page, status, createdAtGt, createdAtLt, sort, applicantId, options) {
|
|
4698
|
+
return localVarFp.listWorkflowRuns(page, status, createdAtGt, createdAtLt, sort, applicantId, options).then((request) => request(axios, basePath));
|
|
4650
4699
|
},
|
|
4651
4700
|
/**
|
|
4652
4701
|
* Run a health check on the Onfido API
|
|
@@ -4746,7 +4795,7 @@ export const DefaultApiFactory = function (configuration, basePath, axios) {
|
|
|
4746
4795
|
* @param {DocumentTypes} type The type of document
|
|
4747
4796
|
* @param {string} applicantId The ID of the applicant whose document is being uploaded.
|
|
4748
4797
|
* @param {FileTransfer} file The file to be uploaded.
|
|
4749
|
-
* @param {
|
|
4798
|
+
* @param {string} [fileType] The file type of the uploaded file
|
|
4750
4799
|
* @param {UploadDocumentSideEnum} [side] The side of the document, if applicable. The possible values are front and back
|
|
4751
4800
|
* @param {CountryCodes} [issuingCountry] The issuing country of the document, a 3-letter ISO code.
|
|
4752
4801
|
* @param {boolean} [validateImageQuality] Defaults to false. When true the submitted image will undergo an image quality validation which may take up to 5 seconds.
|
|
@@ -5022,6 +5071,17 @@ export class DefaultApi extends BaseAPI {
|
|
|
5022
5071
|
downloadMotionCaptureFrame(motionCaptureId, options) {
|
|
5023
5072
|
return DefaultApiFp(this.configuration).downloadMotionCaptureFrame(motionCaptureId, options).then((request) => request(this.axios, this.basePath));
|
|
5024
5073
|
}
|
|
5074
|
+
/**
|
|
5075
|
+
* Downloads digital photos extracted from specific documents belonging to an applicant. If successful, the response will be the binary data representing the image.
|
|
5076
|
+
* @summary Download NFC face
|
|
5077
|
+
* @param {string} documentId
|
|
5078
|
+
* @param {*} [options] Override http request option.
|
|
5079
|
+
* @throws {RequiredError}
|
|
5080
|
+
* @memberof DefaultApi
|
|
5081
|
+
*/
|
|
5082
|
+
downloadNfcFace(documentId, options) {
|
|
5083
|
+
return DefaultApiFp(this.configuration).downloadNfcFace(documentId, options).then((request) => request(this.axios, this.basePath));
|
|
5084
|
+
}
|
|
5025
5085
|
/**
|
|
5026
5086
|
* Retrieves the signed document or application form depending on the file_id provided.
|
|
5027
5087
|
* @summary Retrieves the signed document or application form
|
|
@@ -5387,12 +5447,13 @@ export class DefaultApi extends BaseAPI {
|
|
|
5387
5447
|
* @param {string} [createdAtGt] A ISO-8601 date to filter results with a created date greater than (after) the one provided.
|
|
5388
5448
|
* @param {string} [createdAtLt] A ISO-8601 date to filter results with a created date less than (before) the one provided.
|
|
5389
5449
|
* @param {ListWorkflowRunsSortEnum} [sort] A string with the value \'desc\' or \'asc\' that allows to sort the returned list by the completed datetime either descending or ascending, respectively. If not specified, defaults to \'desc\'.
|
|
5450
|
+
* @param {string} [applicantId] the applicant\'s id.
|
|
5390
5451
|
* @param {*} [options] Override http request option.
|
|
5391
5452
|
* @throws {RequiredError}
|
|
5392
5453
|
* @memberof DefaultApi
|
|
5393
5454
|
*/
|
|
5394
|
-
listWorkflowRuns(page, status, createdAtGt, createdAtLt, sort, options) {
|
|
5395
|
-
return DefaultApiFp(this.configuration).listWorkflowRuns(page, status, createdAtGt, createdAtLt, sort, options).then((request) => request(this.axios, this.basePath));
|
|
5455
|
+
listWorkflowRuns(page, status, createdAtGt, createdAtLt, sort, applicantId, options) {
|
|
5456
|
+
return DefaultApiFp(this.configuration).listWorkflowRuns(page, status, createdAtGt, createdAtLt, sort, applicantId, options).then((request) => request(this.axios, this.basePath));
|
|
5396
5457
|
}
|
|
5397
5458
|
/**
|
|
5398
5459
|
* Run a health check on the Onfido API
|
|
@@ -5501,7 +5562,7 @@ export class DefaultApi extends BaseAPI {
|
|
|
5501
5562
|
* @param {DocumentTypes} type The type of document
|
|
5502
5563
|
* @param {string} applicantId The ID of the applicant whose document is being uploaded.
|
|
5503
5564
|
* @param {FileTransfer} file The file to be uploaded.
|
|
5504
|
-
* @param {
|
|
5565
|
+
* @param {string} [fileType] The file type of the uploaded file
|
|
5505
5566
|
* @param {UploadDocumentSideEnum} [side] The side of the document, if applicable. The possible values are front and back
|
|
5506
5567
|
* @param {CountryCodes} [issuingCountry] The issuing country of the document, a 3-letter ISO code.
|
|
5507
5568
|
* @param {boolean} [validateImageQuality] Defaults to false. When true the submitted image will undergo an image quality validation which may take up to 5 seconds.
|
|
@@ -5547,16 +5608,6 @@ export const ListWorkflowRunsSortEnum = {
|
|
|
5547
5608
|
Asc: 'asc',
|
|
5548
5609
|
UnknownDefaultOpenApi: '11184809'
|
|
5549
5610
|
};
|
|
5550
|
-
/**
|
|
5551
|
-
* @export
|
|
5552
|
-
*/
|
|
5553
|
-
export const UploadDocumentFileTypeEnum = {
|
|
5554
|
-
Jpg: 'jpg',
|
|
5555
|
-
Jpeg: 'jpeg',
|
|
5556
|
-
Png: 'png',
|
|
5557
|
-
Pdf: 'pdf',
|
|
5558
|
-
UnknownDefaultOpenApi: '11184809'
|
|
5559
|
-
};
|
|
5560
5611
|
/**
|
|
5561
5612
|
* @export
|
|
5562
5613
|
*/
|
|
@@ -29,7 +29,7 @@ export class Configuration {
|
|
|
29
29
|
}
|
|
30
30
|
this.apiKey = 'Token token=' + param.apiToken;
|
|
31
31
|
this.basePath = param.basePath || BASE_PATH.replace('.eu.', `.${Region[param.region || Region.EU].toLowerCase()}.`);
|
|
32
|
-
this.baseOptions = Object.assign(Object.assign({ timeout: 30000 }, param.baseOptions), { headers: Object.assign(Object.assign({}, (_a = param.baseOptions) === null || _a === void 0 ? void 0 : _a.headers), { 'User-Agent':
|
|
32
|
+
this.baseOptions = Object.assign(Object.assign({ timeout: 30000 }, param.baseOptions), { headers: Object.assign(Object.assign({}, (_a = param.baseOptions) === null || _a === void 0 ? void 0 : _a.headers), { 'User-Agent': "onfido-node/5.0.0" }) });
|
|
33
33
|
this.formDataCtor = param.formDataCtor || require('form-data'); // Injiect form data constructor (if needed)
|
|
34
34
|
}
|
|
35
35
|
/**
|