-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #281 from getyoti/release/3.17.0
Release/3.17.0
- Loading branch information
Showing
33 changed files
with
937 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "yoti", | ||
"version": "3.16.0", | ||
"version": "3.17.0", | ||
"description": "Yoti NodeJS SDK for back-end integration", | ||
"author": "Yoti LTD <[email protected]> (https://www.yoti.com/developers)", | ||
"license": "MIT", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/doc_scan_service/session/create/check/requested.watchlist.screening.check.builder.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
'use strict'; | ||
|
||
const RequestedWatchlistScreeningCheck = require('./requested.watchlist.screening.check'); | ||
const RequestedWatchlistScreeningConfig = require('./requested.watchlist.screening.config'); | ||
const DocScanConstants = require('../../../doc.scan.constants'); | ||
const Validation = require('../../../../yoti_common/validation'); | ||
|
||
/** | ||
* Builder to assist the creation of {@link RequestedWatchlistScreeningCheck}. | ||
* | ||
* @class RequestedWatchlistScreeningCheckBuilder | ||
*/ | ||
/* eslint class-methods-use-this: ["error", { "exceptMethods": ["build"] }] */ | ||
class RequestedWatchlistScreeningCheckBuilder { | ||
constructor() { | ||
this.categories = []; | ||
} | ||
|
||
/** | ||
* Adds ADVERSE_MEDIA to the list of categories used for watchlist screening | ||
* | ||
* @returns {this} | ||
*/ | ||
withAdverseMediaCategory() { | ||
return this.withCategory(DocScanConstants.ADVERSE_MEDIA); | ||
} | ||
|
||
/** | ||
* Adds SANCTIONS to the list of categories used for watchlist screening | ||
* | ||
* @returns {this} | ||
*/ | ||
withSanctionsCategory() { | ||
return this.withCategory(DocScanConstants.SANCTIONS); | ||
} | ||
|
||
/** | ||
* Adds a category to the list of categories used for watchlist screening | ||
* | ||
* @param {string} category | ||
* | ||
* @returns {this} | ||
*/ | ||
withCategory(category) { | ||
Validation.isString(category, 'category'); | ||
Validation.notNullOrEmpty(category, 'category'); | ||
this.categories.push(category); | ||
return this; | ||
} | ||
|
||
build() { | ||
const config = new RequestedWatchlistScreeningConfig(this.categories); | ||
return new RequestedWatchlistScreeningCheck(config); | ||
} | ||
} | ||
|
||
module.exports = RequestedWatchlistScreeningCheckBuilder; |
21 changes: 21 additions & 0 deletions
21
src/doc_scan_service/session/create/check/requested.watchlist.screening.check.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
const RequestedCheck = require('./requested.check'); | ||
const DocScanConstants = require('../../../doc.scan.constants'); | ||
const Validation = require('../../../../yoti_common/validation'); | ||
const RequestedWatchlistScreeningConfig = require('./requested.watchlist.screening.config'); | ||
|
||
/** | ||
* @class RequestedWatchlistScreeningCheck | ||
*/ | ||
class RequestedWatchlistScreeningCheck extends RequestedCheck { | ||
/** | ||
* @param {RequestedWatchlistScreeningConfig} config | ||
*/ | ||
constructor(config) { | ||
Validation.instanceOf(config, RequestedWatchlistScreeningConfig, 'config'); | ||
super(DocScanConstants.WATCHLIST_SCREENING, config); | ||
} | ||
} | ||
|
||
module.exports = RequestedWatchlistScreeningCheck; |
31 changes: 31 additions & 0 deletions
31
src/doc_scan_service/session/create/check/requested.watchlist.screening.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'use strict'; | ||
|
||
const Validation = require('../../../../yoti_common/validation'); | ||
/** | ||
* The configuration applied when creating a RequestedWatchlistScreeningCheck | ||
* | ||
* @class RequestedWatchlistScreeningConfig | ||
*/ | ||
class RequestedWatchlistScreeningConfig { | ||
/** | ||
* @param {string[]} categories | ||
* The list of categories corresponding to each watchlist screening conducted | ||
*/ | ||
constructor(categories) { | ||
if (categories) { | ||
Validation.isArrayOfStrings(categories, 'categories'); | ||
this.categories = categories.filter((elem, pos) => categories.indexOf(elem) === pos); | ||
} | ||
} | ||
|
||
/** | ||
* @returns {Object} data for JSON.stringify() | ||
*/ | ||
toJSON() { | ||
return { | ||
categories: this.categories, | ||
}; | ||
} | ||
} | ||
|
||
module.exports = RequestedWatchlistScreeningConfig; |
20 changes: 20 additions & 0 deletions
20
src/doc_scan_service/session/retrieve/generated.profile.response.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
|
||
const MediaResponse = require('./media.response'); | ||
|
||
class GeneratedProfileResponse { | ||
constructor(generatedProfile) { | ||
if (generatedProfile.media) { | ||
this.media = new MediaResponse(generatedProfile.media); | ||
} | ||
} | ||
|
||
/** | ||
* @returns {MediaResponse} | ||
*/ | ||
getMedia() { | ||
return this.media; | ||
} | ||
} | ||
|
||
module.exports = GeneratedProfileResponse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.