diff --git a/examples/idv-identity-checks/README.md b/examples/idv-identity-checks/README.md
index 6ed41fe67..6ab68daa9 100644
--- a/examples/idv-identity-checks/README.md
+++ b/examples/idv-identity-checks/README.md
@@ -7,5 +7,5 @@
1. Start the server `npm start`
1. Visit `https://localhost:3003`
-* _The [default controller](./src/controllers/index.controller.js) demonstrates how to create an IDV session_
+* _The [default controller](./src/controllers/session.controller.js) demonstrates how to create an IDV session_
* _The [success controller](./src/controllers/success.controller.js) demonstrates how to retrieve an IDV session_
diff --git a/examples/idv-identity-checks/index.js b/examples/idv-identity-checks/index.js
index e577d6e1b..07f700a28 100644
--- a/examples/idv-identity-checks/index.js
+++ b/examples/idv-identity-checks/index.js
@@ -24,6 +24,7 @@ app.use(session({
const router = express.Router();
router.get('/', controllers.indexController);
+router.post('/session', controllers.sessionController);
router.get('/success', controllers.successController);
router.get('/media', controllers.mediaController);
router.get('/error', controllers.errorController);
diff --git a/examples/idv-identity-checks/src/controllers/index.controller.js b/examples/idv-identity-checks/src/controllers/index.controller.js
index 3edec87bb..039fc6466 100644
--- a/examples/idv-identity-checks/src/controllers/index.controller.js
+++ b/examples/idv-identity-checks/src/controllers/index.controller.js
@@ -1,60 +1,4 @@
-const {
- IDVClient,
- SessionSpecificationBuilder,
- SdkConfigBuilder,
-} = require('yoti');
-const config = require('../../config');
-
-/**
- * Create an IDV session.
- */
-async function createSession() {
- const idvClient = new IDVClient(config.YOTI_CLIENT_SDK_ID, config.YOTI_PEM);
-
- const subject = {
- subject_id: 'subject_id_string',
- };
-
- const identityProfileRequirements = {
- trust_framework: 'UK_TFIDA',
- scheme: {
- type: 'DBS',
- objective: 'BASIC',
- },
- };
-
- const sessionSpec = new SessionSpecificationBuilder()
- .withClientSessionTokenTtl(600) // 10 minutes
- .withResourcesTtl(90000) // session TTL(10 minutes) + 24 hours(minimum required)
- .withUserTrackingId('some-user-tracking-id')
- .withSubject(subject)
- .withIdentityProfileRequirements(identityProfileRequirements)
- .withSdkConfig(
- new SdkConfigBuilder()
- .withPrimaryColour('#2d9fff')
- .withLocale('en-GB')
- .withPresetIssuingCountry('GBR')
- .withSuccessUrl(`${config.YOTI_APP_BASE_URL}/success`)
- .withErrorUrl(`${config.YOTI_APP_BASE_URL}/error`)
- .withAllowHandoff(true)
- .build()
- )
- .build();
-
- return idvClient.createSession(sessionSpec);
-}
-
-module.exports = async (req, res) => {
- try {
- const session = await createSession();
-
- req.session.IDV_SESSION_ID = session.getSessionId();
- req.session.IDV_SESSION_TOKEN = session.getClientSessionToken();
-
- res.render('pages/index', {
- iframeUrl: `${config.YOTI_IDV_IFRAME_URL}?sessionID=${req.session.IDV_SESSION_ID}&sessionToken=${req.session.IDV_SESSION_TOKEN}`,
- });
- } catch (error) {
- res.render('pages/error', { error });
- }
+module.exports = (req, res) => {
+ res.render('pages/index', {
+ });
};
diff --git a/examples/idv-identity-checks/src/controllers/index.js b/examples/idv-identity-checks/src/controllers/index.js
index f24dd6937..fa962c859 100644
--- a/examples/idv-identity-checks/src/controllers/index.js
+++ b/examples/idv-identity-checks/src/controllers/index.js
@@ -1,10 +1,12 @@
const indexController = require('./index.controller');
+const sessionController = require('./session.controller');
const successController = require('./success.controller');
const mediaController = require('./media.controller');
const errorController = require('./error.controller');
module.exports = {
indexController,
+ sessionController,
successController,
mediaController,
errorController,
diff --git a/examples/idv-identity-checks/src/controllers/session.controller.js b/examples/idv-identity-checks/src/controllers/session.controller.js
new file mode 100644
index 000000000..0b80a4627
--- /dev/null
+++ b/examples/idv-identity-checks/src/controllers/session.controller.js
@@ -0,0 +1,128 @@
+const {
+ IDVClient,
+ SessionSpecificationBuilder,
+ SdkConfigBuilder,
+ AdvancedIdentityProfileBuilder,
+ AdvancedIdentityProfileRequirementsBuilder,
+ AdvancedIdentityProfileSchemeBuilder,
+} = require('yoti');
+const config = require('../../config');
+
+const identityProfileRequirementsDescriptors = {
+ RTW: {
+ trust_framework: 'UK_TFIDA',
+ scheme: {
+ type: 'RTW',
+ },
+ },
+ RTR: {
+ trust_framework: 'UK_TFIDA',
+ scheme: {
+ type: 'RTR',
+ },
+ },
+ DBS_BASIC: {
+ trust_framework: 'UK_TFIDA',
+ scheme: {
+ type: 'DBS',
+ objective: 'BASIC',
+ },
+ },
+ DBS_BASIC_RTW: {
+ trust_framework: 'UK_TFIDA',
+ scheme: {
+ type: 'DBS_RTW',
+ objective: 'BASIC',
+ },
+ },
+};
+
+/**
+ * Create an IDV session.
+ */
+async function createSession(scheme) {
+ const idvClient = new IDVClient(config.YOTI_CLIENT_SDK_ID, config.YOTI_PEM);
+
+ const sessionSpecificationBuilder = new SessionSpecificationBuilder();
+
+ const subject = {
+ subject_id: 'some_subject_id_string',
+ };
+
+ if (scheme === 'MTF_BASE') {
+ const advancedIdentityProfileSchemeDBS = new AdvancedIdentityProfileSchemeBuilder()
+ .withType('DBS')
+ .withObjective('BASIC')
+ .withLabel('label-for-DBS-BASIC')
+ .build();
+
+ const advancedIdentityProfileSchemeRTW = new AdvancedIdentityProfileSchemeBuilder()
+ .withType('RTW')
+ .withLabel('label-for-RTW')
+ .build();
+
+ const advancedIdentityProfileUKTFIDA = new AdvancedIdentityProfileBuilder()
+ .withTrustFramework('UK_TFIDA')
+ .withScheme(advancedIdentityProfileSchemeDBS)
+ .withScheme(advancedIdentityProfileSchemeRTW)
+ .build();
+
+ const advancedIdentityProfileSchemeAL1 = new AdvancedIdentityProfileSchemeBuilder()
+ .withType('IDENTITY')
+ .withObjective('AL_L1')
+ .withLabel('label-for-IDENTITY-AL-L1')
+ .build();
+
+ const advancedIdentityProfileYotiGlobal = new AdvancedIdentityProfileBuilder()
+ .withTrustFramework('YOTI_GLOBAL')
+ .withScheme(advancedIdentityProfileSchemeAL1)
+ .build();
+
+ const advancedIdentityProfileRequirements = new AdvancedIdentityProfileRequirementsBuilder()
+ .withProfile(advancedIdentityProfileUKTFIDA)
+ .withProfile(advancedIdentityProfileYotiGlobal)
+ .build();
+
+ sessionSpecificationBuilder
+ .withAdvancedIdentityProfileRequirements(advancedIdentityProfileRequirements);
+ } else {
+ const identityProfileRequirements = identityProfileRequirementsDescriptors[scheme];
+ sessionSpecificationBuilder
+ .withIdentityProfileRequirements(identityProfileRequirements);
+ }
+
+ const sessionSpec = sessionSpecificationBuilder
+ .withClientSessionTokenTtl(600) // 10 minutes
+ .withResourcesTtl(90000) // session TTL(10 minutes) + 24 hours(minimum required)
+ .withUserTrackingId('some-user-tracking-id')
+ .withSubject(subject)
+ .withSdkConfig(
+ new SdkConfigBuilder()
+ .withPrimaryColour('#2d9fff')
+ .withLocale('en-GB')
+ .withPresetIssuingCountry('GBR')
+ .withSuccessUrl(`${config.YOTI_APP_BASE_URL}/success`)
+ .withErrorUrl(`${config.YOTI_APP_BASE_URL}/error`)
+ .withAllowHandoff(true)
+ .withAllowsCameraAndUpload()
+ .build()
+ )
+ .build();
+
+ return idvClient.createSession(sessionSpec);
+}
+
+module.exports = async (req, res) => {
+ const { scheme } = req.body;
+ try {
+ const session = await createSession(scheme);
+
+ req.session.IDV_SESSION_ID = session.getSessionId();
+ req.session.IDV_SESSION_TOKEN = session.getClientSessionToken();
+ res.render('pages/session', {
+ iframeUrl: `${config.YOTI_IDV_IFRAME_URL}?sessionID=${req.session.IDV_SESSION_ID}&sessionToken=${req.session.IDV_SESSION_TOKEN}`,
+ });
+ } catch (error) {
+ res.render('pages/error', { error });
+ }
+};
diff --git a/examples/idv-identity-checks/static/images/logo.png b/examples/idv-identity-checks/static/images/logo.png
new file mode 100644
index 000000000..c60227fab
Binary files /dev/null and b/examples/idv-identity-checks/static/images/logo.png differ
diff --git a/examples/idv-identity-checks/static/images/logo.svg b/examples/idv-identity-checks/static/images/logo.svg
deleted file mode 100644
index 425e32c55..000000000
--- a/examples/idv-identity-checks/static/images/logo.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/examples/idv-identity-checks/static/images/logo@2x.png b/examples/idv-identity-checks/static/images/logo@2x.png
new file mode 100644
index 000000000..9f29784d1
Binary files /dev/null and b/examples/idv-identity-checks/static/images/logo@2x.png differ
diff --git a/examples/idv-identity-checks/static/style.css b/examples/idv-identity-checks/static/style.css
index 8ae73f4b9..d6b2f1670 100644
--- a/examples/idv-identity-checks/static/style.css
+++ b/examples/idv-identity-checks/static/style.css
@@ -1,8 +1,67 @@
-
-body {
- padding-top: 4.5rem;
+.yoti-body {
+ margin: 0;
}
table td:first-child {
width: 30%;
-}
\ No newline at end of file
+}
+
+.yoti-html {
+ height: 100%;
+}
+
+.yoti-top-section {
+ display: flex;
+ flex-direction: column;
+ padding: 20px 0;
+ align-items: center;
+}
+
+.yoti-logo-section {
+ margin-bottom: 10px;
+}
+
+.yoti-logo-image {
+ display: block;
+}
+
+.yoti-main-title {
+ text-align:center;
+ font-size:25px;
+ color:#2875bc;
+}
+
+.yoti-checks-section {
+ display: flex;
+ flex-direction: column;
+ margin-top: 150px;
+ align-items: center;
+}
+
+.yoti-checks-scheme {
+ font-weight: bold;
+ font-size: large;
+}
+
+.yoti-error-container {
+ color: #664d03;
+ background-color: #fff3cd;
+ border-color: #ffecb5;
+ position: relative;
+ padding: 1rem 1rem;
+ margin: 20px;
+ border-radius: 0.25rem;
+}
+
+.yoti-submit-button {
+ margin: 30px;
+ font-family: GT Eesti Display, sans-serif;
+ font-size: 15px;
+ font-weight: bold;
+ box-sizing: border-box;
+ width: 200px;
+ height: 50px;
+ border-radius: 12px;
+ color: #fff;
+ background-color: #2875bc;
+}
diff --git a/examples/idv-identity-checks/views/pages/index.ejs b/examples/idv-identity-checks/views/pages/index.ejs
index bf728fd60..91d5a2cc8 100644
--- a/examples/idv-identity-checks/views/pages/index.ejs
+++ b/examples/idv-identity-checks/views/pages/index.ejs
@@ -1,3 +1,22 @@
<%- include('layout/header'); -%>
-
+
+ Identity check example
+
+
<%- include('layout/footer'); -%>
diff --git a/examples/idv-identity-checks/views/pages/layout/header.ejs b/examples/idv-identity-checks/views/pages/layout/header.ejs
index 63357876c..fc2edd77d 100644
--- a/examples/idv-identity-checks/views/pages/layout/header.ejs
+++ b/examples/idv-identity-checks/views/pages/layout/header.ejs
@@ -9,10 +9,15 @@
-
-
diff --git a/index.js b/index.js
index f01dfc977..1c9613ea3 100644
--- a/index.js
+++ b/index.js
@@ -54,6 +54,11 @@ const {
CreateFaceCaptureResourcePayloadBuilder,
UploadFaceCaptureImagePayloadBuilder,
IDVService,
+ AdvancedIdentityProfileSchemeConfigBuilder,
+ AdvancedIdentityProfileBuilder,
+ AdvancedIdentityProfileSchemeBuilder,
+ AdvancedIdentityProfileRequirementsBuilder,
+
} = require('./src/idv_service');
const YotiCommon = require('./src/yoti_common');
@@ -115,4 +120,8 @@ module.exports = {
RequestedTypeListSourcesBuilder,
CreateFaceCaptureResourcePayloadBuilder,
UploadFaceCaptureImagePayloadBuilder,
+ AdvancedIdentityProfileSchemeConfigBuilder,
+ AdvancedIdentityProfileBuilder,
+ AdvancedIdentityProfileSchemeBuilder,
+ AdvancedIdentityProfileRequirementsBuilder,
};
diff --git a/src/idv_service/index.js b/src/idv_service/index.js
index 55d57aa69..7a24f3835 100644
--- a/src/idv_service/index.js
+++ b/src/idv_service/index.js
@@ -29,6 +29,10 @@ const RequestedTypeListSourcesBuilder = require('./session/create/check/requeste
const RequestedSearchProfileSourcesBuilder = require('./session/create/check/requested.search.profile.sources.builder');
const CreateFaceCaptureResourcePayloadBuilder = require('./session/create/face_capture/create.face.capture.resource.payload.builder');
const UploadFaceCaptureImagePayloadBuilder = require('./session/create/face_capture/upload.face.capture.image.payload.builder');
+const AdvancedIdentityProfileBuilder = require('./session/create/identity_profile/advanced/advanced.identity.profile.builder');
+const AdvancedIdentityProfileRequirementsBuilder = require('./session/create/identity_profile/advanced/advanced.identity.profile.requirements.builder');
+const AdvancedIdentityProfileSchemeBuilder = require('./session/create/identity_profile/advanced/advanced.identity.profile.scheme.builder');
+const AdvancedIdentityProfileSchemeConfigBuilder = require('./session/create/identity_profile/advanced/advanced.identity.profile.scheme.config');
module.exports = {
IDVService,
@@ -60,4 +64,8 @@ module.exports = {
RequestedTypeListSourcesBuilder,
CreateFaceCaptureResourcePayloadBuilder,
UploadFaceCaptureImagePayloadBuilder,
+ AdvancedIdentityProfileBuilder,
+ AdvancedIdentityProfileSchemeBuilder,
+ AdvancedIdentityProfileRequirementsBuilder,
+ AdvancedIdentityProfileSchemeConfigBuilder,
};
diff --git a/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.builder.js b/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.builder.js
new file mode 100644
index 000000000..02b50c86c
--- /dev/null
+++ b/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.builder.js
@@ -0,0 +1,42 @@
+'use strict';
+
+const Validation = require('../../../../../yoti_common/validation');
+const AdvancedIdentityProfileScheme = require('./advanced.identity.profile.scheme');
+const AdvancedIdentityProfile = require('./advanced.identity.profile');
+
+class AdvancedIdentityProfileBuilder {
+ constructor() {
+ /** @private {AdvancedIdentityProfileScheme[]} */
+ this.schemes = [];
+ }
+
+ /**
+ * @param {string} trustFramework
+ * @returns {AdvancedIdentityProfileBuilder}
+ */
+ withTrustFramework(trustFramework) {
+ Validation.isString(trustFramework, 'trustFramework');
+ /** @private {string} */
+ this.trustFramework = trustFramework;
+ return this;
+ }
+
+ /**
+ * @param {AdvancedIdentityProfileScheme} scheme
+ * @returns {AdvancedIdentityProfileBuilder}
+ */
+ withScheme(scheme) {
+ Validation.instanceOf(scheme, AdvancedIdentityProfileScheme, 'scheme');
+ this.schemes.push(scheme);
+ return this;
+ }
+
+ /**
+ * @returns {AdvancedIdentityProfile}
+ */
+ build() {
+ return new AdvancedIdentityProfile(this.trustFramework, this.schemes);
+ }
+}
+
+module.exports = AdvancedIdentityProfileBuilder;
diff --git a/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.js b/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.js
new file mode 100644
index 000000000..1ae6a9802
--- /dev/null
+++ b/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.js
@@ -0,0 +1,28 @@
+'use strict';
+
+const Validation = require('../../../../../yoti_common/validation');
+const AdvancedIdentityProfileScheme = require('./advanced.identity.profile.scheme');
+
+class AdvancedIdentityProfile {
+ /**
+ * @param {string} trustFramework
+ * @param {AdvancedIdentityProfileScheme[]} schemes
+ */
+ constructor(trustFramework, schemes) {
+ Validation.isString(trustFramework, 'trustFramework');
+ /** @private {string} */
+ this.trustFramework = trustFramework;
+ Validation.isArrayOfType(schemes, AdvancedIdentityProfileScheme, 'schemes');
+ /** @private {AdvancedIdentityProfileScheme[]} */
+ this.schemes = schemes;
+ }
+
+ toJSON() {
+ return {
+ trust_framework: this.trustFramework,
+ schemes: this.schemes,
+ };
+ }
+}
+
+module.exports = AdvancedIdentityProfile;
diff --git a/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.requirements.builder.js b/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.requirements.builder.js
new file mode 100644
index 000000000..c51e27594
--- /dev/null
+++ b/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.requirements.builder.js
@@ -0,0 +1,31 @@
+'use strict';
+
+const Validation = require('../../../../../yoti_common/validation');
+const AdvancedIdentityProfile = require('./advanced.identity.profile');
+const AdvancedIdentityProfileRequirements = require('./advanced.identity.profile.requirements');
+
+class AdvancedIdentityProfileRequirementsBuilder {
+ constructor() {
+ /** @private {AdvancedIdentityProfile[]} */
+ this.profiles = [];
+ }
+
+ /**
+ * @param {AdvancedIdentityProfile} profile
+ * @returns {AdvancedIdentityProfileRequirementsBuilder}
+ */
+ withProfile(profile) {
+ Validation.instanceOf(profile, AdvancedIdentityProfile, 'profile');
+ this.profiles.push(profile);
+ return this;
+ }
+
+ /**
+ * @returns {AdvancedIdentityProfileRequirements}
+ */
+ build() {
+ return new AdvancedIdentityProfileRequirements(this.profiles);
+ }
+}
+
+module.exports = AdvancedIdentityProfileRequirementsBuilder;
diff --git a/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.requirements.js b/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.requirements.js
new file mode 100644
index 000000000..09fea9057
--- /dev/null
+++ b/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.requirements.js
@@ -0,0 +1,16 @@
+'use strict';
+
+const Validation = require('../../../../../yoti_common/validation');
+const AdvancedIdentityProfile = require('./advanced.identity.profile');
+
+class AdvancedIdentityProfileRequirements {
+ /**
+ * @param {AdvancedIdentityProfile[]} profiles
+ */
+ constructor(profiles) {
+ Validation.isArrayOfType(profiles, AdvancedIdentityProfile, 'profiles');
+ this.profiles = profiles;
+ }
+}
+
+module.exports = AdvancedIdentityProfileRequirements;
diff --git a/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.builder.js b/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.builder.js
new file mode 100644
index 000000000..9c0c85e25
--- /dev/null
+++ b/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.builder.js
@@ -0,0 +1,56 @@
+'use strict';
+
+const Validation = require('../../../../../yoti_common/validation');
+const AdvancedIdentityProfileSchemeConfig = require('./advanced.identity.profile.scheme.config');
+const AdvancedIdentityProfileScheme = require('./advanced.identity.profile.scheme');
+
+class AdvancedIdentityProfileSchemeBuilder {
+ /**
+ * @param {string} type
+ * @returns {AdvancedIdentityProfileSchemeBuilder}
+ */
+ withType(type) {
+ Validation.isString(type, 'type');
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * @param {string} objective
+ * @returns {AdvancedIdentityProfileSchemeBuilder}
+ */
+ withObjective(objective) {
+ Validation.isString(objective, 'objective');
+ this.objective = objective;
+ return this;
+ }
+
+ /**
+ * @param {string} label
+ * @returns {AdvancedIdentityProfileSchemeBuilder}
+ */
+ withLabel(label) {
+ Validation.isString(label, 'label');
+ this.label = label;
+ return this;
+ }
+
+ /**
+ * @param {AdvancedIdentityProfileSchemeConfig} config
+ * @returns {AdvancedIdentityProfileSchemeBuilder}
+ */
+ withConfig(config) {
+ Validation.instanceOf(config, AdvancedIdentityProfileSchemeConfig, 'config');
+ this.config = config;
+ return this;
+ }
+
+ /**
+ * @returns {AdvancedIdentityProfileScheme}
+ */
+ build() {
+ return new AdvancedIdentityProfileScheme(this.type, this.objective, this.label, this.config);
+ }
+}
+
+module.exports = AdvancedIdentityProfileSchemeBuilder;
diff --git a/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.config.builder.js b/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.config.builder.js
new file mode 100644
index 000000000..0d15c06fa
--- /dev/null
+++ b/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.config.builder.js
@@ -0,0 +1,26 @@
+'use strict';
+
+const Validation = require('../../../../../yoti_common/validation');
+const DocumentFilter = require('../../filters/document.filter');
+const AdvancedIdentityProfileSchemeConfig = require('./advanced.identity.profile.scheme.config');
+
+class AdvancedIdentityProfileSchemeConfigBuilder {
+ /**
+ * @param {DocumentFilter} filter
+ * @returns {AdvancedIdentityProfileSchemeConfigBuilder}
+ */
+ withFilter(filter) {
+ Validation.instanceOf(filter, DocumentFilter, 'filter');
+ this.filter = filter;
+ return this;
+ }
+
+ /**
+ * @returns {AdvancedIdentityProfileSchemeConfig}
+ */
+ build() {
+ return new AdvancedIdentityProfileSchemeConfig(this.filter);
+ }
+}
+
+module.exports = AdvancedIdentityProfileSchemeConfigBuilder;
diff --git a/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.config.js b/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.config.js
new file mode 100644
index 000000000..bf765d5dd
--- /dev/null
+++ b/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.config.js
@@ -0,0 +1,24 @@
+'use strict';
+
+const Validation = require('../../../../../yoti_common/validation');
+const DocumentFilter = require('../../filters/document.filter');
+
+class AdvancedIdentityProfileSchemeConfig {
+ /**
+ * @param {DocumentFilter} filter
+ */
+ constructor(filter) {
+ if (filter) {
+ Validation.instanceOf(filter, DocumentFilter, 'filter');
+ this.filter = filter;
+ }
+ }
+
+ toJSON() {
+ return {
+ filter: this.filter,
+ };
+ }
+}
+
+module.exports = AdvancedIdentityProfileSchemeConfig;
diff --git a/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.js b/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.js
new file mode 100644
index 000000000..a112bb2f1
--- /dev/null
+++ b/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.js
@@ -0,0 +1,39 @@
+'use strict';
+
+const Validation = require('../../../../../yoti_common/validation');
+const AdvancedIdentityProfileSchemeConfig = require('./advanced.identity.profile.scheme.config');
+
+class AdvancedIdentityProfileScheme {
+ /**
+ * @param {string} type
+ * @param {string} objective
+ * @param {string} label
+ * @param {AdvancedIdentityProfileSchemeConfig} [config]
+ */
+ constructor(type, objective, label, config) {
+ Validation.isString(type, 'type');
+ this.type = type;
+
+ Validation.isString(objective, 'objective', true);
+ if (objective) this.objective = objective;
+
+ Validation.isString(label, 'label');
+ this.label = label;
+
+ if (config) {
+ Validation.instanceOf(config, AdvancedIdentityProfileSchemeConfig, 'config');
+ this.config = config;
+ }
+ }
+
+ toJSON() {
+ return {
+ type: this.type,
+ objective: this.objective,
+ label: this.label,
+ config: this.config,
+ };
+ }
+}
+
+module.exports = AdvancedIdentityProfileScheme;
diff --git a/src/idv_service/session/create/session.specification.builder.js b/src/idv_service/session/create/session.specification.builder.js
index 79becf0c9..df9228a40 100644
--- a/src/idv_service/session/create/session.specification.builder.js
+++ b/src/idv_service/session/create/session.specification.builder.js
@@ -7,6 +7,7 @@ const RequestedCheck = require('./check/requested.check');
const SdkConfig = require('./sdk.config');
const RequiredDocument = require('./filters/required.document');
const Validation = require('../../../yoti_common/validation');
+const AdvancedIdentityProfileRequirements = require('./identity_profile/advanced/advanced.identity.profile.requirements');
/**
* Builder to assist the creation of {@link SessionSpecification}.
@@ -169,6 +170,12 @@ class SessionSpecificationBuilder {
return this;
}
+ withAdvancedIdentityProfileRequirements(advancedIdentityProfileRequirements) {
+ Validation.instanceOf(advancedIdentityProfileRequirements, AdvancedIdentityProfileRequirements, 'advancedIdentityProfileRequirements');
+ this.advancedIdentityProfileRequirements = advancedIdentityProfileRequirements;
+ return this;
+ }
+
/**
* Builds the {@link SessionSpecification} based on the values supplied to the builder
*
@@ -187,7 +194,8 @@ class SessionSpecificationBuilder {
this.blockBiometricConsent,
this.sessionDeadline,
this.identityProfileRequirements,
- this.subject
+ this.subject,
+ this.advancedIdentityProfileRequirements
);
}
}
diff --git a/src/idv_service/session/create/session.specification.js b/src/idv_service/session/create/session.specification.js
index b332c453e..475954afa 100644
--- a/src/idv_service/session/create/session.specification.js
+++ b/src/idv_service/session/create/session.specification.js
@@ -6,6 +6,7 @@ const SdkConfig = require('./sdk.config');
const RequestedTask = require('./task/requested.task');
const RequestedCheck = require('./check/requested.check');
const RequiredDocument = require('./filters/required.document');
+const AdvancedIdentityProfileRequirements = require('./identity_profile/advanced/advanced.identity.profile.requirements');
/**
* Definition for the IDV Session to be created
@@ -34,9 +35,10 @@ class SessionSpecification {
* Sets whether or not to block the collection of biometric consent
* @param {Date} sessionDeadline
* The deadline that the session needs to be completed by
- * @param {object} identityProfileRequirements
- * @param {object} subject
+ * @param {object} [identityProfileRequirements]
+ * @param {object} [subject]
* Information about the subject of the session
+ * @param {AdvancedIdentityProfileRequirements} [advancedIdentityProfileRequirements]
*/
constructor(
clientSessionTokenTtl,
@@ -50,7 +52,8 @@ class SessionSpecification {
blockBiometricConsent,
sessionDeadline,
identityProfileRequirements,
- subject
+ subject,
+ advancedIdentityProfileRequirements
) {
Validation.isInteger(clientSessionTokenTtl, 'clientSessionTokenTtl', true);
/** @private */
@@ -88,6 +91,12 @@ class SessionSpecification {
this.identityProfileRequirements = identityProfileRequirements;
}
+ if (advancedIdentityProfileRequirements) {
+ Validation.instanceOf(advancedIdentityProfileRequirements, AdvancedIdentityProfileRequirements, 'advancedIdentityProfileRequirements');
+ /** @private */
+ this.advancedIdentityProfileRequirements = advancedIdentityProfileRequirements;
+ }
+
if (subject) {
Validation.isPlainObject(subject, 'subject');
/** @private */
@@ -130,6 +139,7 @@ class SessionSpecification {
block_biometric_consent: this.blockBiometricConsent,
identity_profile_requirements: this.identityProfileRequirements,
subject: this.subject,
+ advanced_identity_profile_requirements: this.advancedIdentityProfileRequirements,
};
}
}
diff --git a/src/idv_service/session/retrieve/get.session.result.js b/src/idv_service/session/retrieve/get.session.result.js
index ddef7e0fd..f9c704eca 100644
--- a/src/idv_service/session/retrieve/get.session.result.js
+++ b/src/idv_service/session/retrieve/get.session.result.js
@@ -14,7 +14,8 @@ const WatchlistScreeningCheckResponse = require('./watchlist.screening.check.res
const WatchlistAdvancedCaCheckResponse = require('./watchlist.advanced.ca.check.response');
const ThirdPartyIdentityFraud1CheckResponse = require('./third.party.identity.fraud.1.check.response');
const FaceComparisonCheckResponse = require('./face.comparison.check.response');
-const IdentityProfileResponse = require('./identity.profile.response');
+const IdentityProfileResponse = require('./identity_profile/identity.profile.response');
+const AdvancedIdentityProfileResponse = require('./identity_profile/advanced/advanced.identity.profile.response');
const IDVConstants = require('../../idv.constants');
const { YotiDate } = require('../../../data_type/date');
@@ -94,6 +95,13 @@ class GetSessionResult {
/** @private */
this.identityProfile = new IdentityProfileResponse(response.identity_profile);
}
+
+ if (response.advanced_identity_profile) {
+ Validation.isPlainObject(response.advanced_identity_profile, 'advanced_identity_profile');
+ /** @private */
+ // eslint-disable-next-line max-len
+ this.advancedIdentityProfile = new AdvancedIdentityProfileResponse(response.advanced_identity_profile);
+ }
}
/**
@@ -251,6 +259,13 @@ class GetSessionResult {
getIdentityProfile() {
return this.identityProfile;
}
+
+ /**
+ * @returns {AdvancedIdentityProfileResponse}
+ */
+ getAdvancedIdentityProfile() {
+ return this.advancedIdentityProfile;
+ }
}
module.exports = GetSessionResult;
diff --git a/src/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response.js b/src/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response.js
deleted file mode 100644
index 4d871f85e..000000000
--- a/src/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response.js
+++ /dev/null
@@ -1,38 +0,0 @@
-'use strict';
-
-const Validation = require('../../../yoti_common/validation');
-
-class IdentityProfileReportSchemesComplianceResponse {
- constructor(schemesCompliance) {
- Validation.isPlainObject(schemesCompliance.scheme, 'scheme');
- /** @private */
- this.scheme = schemesCompliance.scheme;
-
- Validation.isBoolean(schemesCompliance.requirements_met, 'requirements_met');
- /** @private @type {boolean} */
- this.requirementsMet = schemesCompliance.requirements_met;
-
- if (schemesCompliance.requirements_not_met_info) {
- Validation.isString(schemesCompliance.requirements_not_met_info, 'requirements_not_met_info');
- /** @private @type {string|undefined} */
- this.requirementsNotMetInfo = schemesCompliance.requirements_not_met_info;
- }
- }
-
- /**
- * @returns {object}
- */
- getScheme() {
- return this.scheme;
- }
-
- isRequirementsMet() {
- return this.requirementsMet;
- }
-
- getRequirementsNotMetInfo() {
- return this.requirementsNotMetInfo;
- }
-}
-
-module.exports = IdentityProfileReportSchemesComplianceResponse;
diff --git a/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.response.js b/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.response.js
new file mode 100644
index 000000000..2b0eae118
--- /dev/null
+++ b/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.response.js
@@ -0,0 +1,34 @@
+'use strict';
+
+const Validation = require('../../../../../yoti_common/validation');
+const MediaResponse = require('../../media.response');
+const AdvancedIdentityProfileTrustFrameworkResponse = require('./advanced.identity.profile.trust.framework.response');
+
+class AdvancedIdentityProfileReportResponse {
+ constructor(report) {
+ Validation.isArray(report.compliance, 'compliance');
+ /** @private {AdvancedIdentityProfileTrustFrameworkResponse[]} */
+ this.compliance = report.compliance
+ .map((compliance) => new AdvancedIdentityProfileTrustFrameworkResponse(compliance));
+
+ Validation.isPlainObject(report.media, 'media');
+ /** @private {MediaResponse} */
+ this.media = new MediaResponse(report.media);
+ }
+
+ /**
+ * @returns {AdvancedIdentityProfileTrustFrameworkResponse[]}
+ */
+ getCompliance() {
+ return this.compliance;
+ }
+
+ /**
+ * @returns {MediaResponse}
+ */
+ getMedia() {
+ return this.media;
+ }
+}
+
+module.exports = AdvancedIdentityProfileReportResponse;
diff --git a/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.scheme.compliance.response.js b/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.scheme.compliance.response.js
new file mode 100644
index 000000000..fcf03bf4c
--- /dev/null
+++ b/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.scheme.compliance.response.js
@@ -0,0 +1,44 @@
+'use strict';
+
+const Validation = require('../../../../../yoti_common/validation');
+const AdvancedIdentityProfileSchemeResponse = require('./advanced.identity.profile.scheme.response');
+
+class AdvancedIdentityProfileSchemeComplianceResponse {
+ constructor(schemesCompliance) {
+ Validation.isPlainObject(schemesCompliance.scheme, 'scheme');
+ /** @private {AdvancedIdentityProfileSchemeResponse} */
+ this.scheme = new AdvancedIdentityProfileSchemeResponse(schemesCompliance.scheme);
+
+ Validation.isBoolean(schemesCompliance.requirements_met, 'requirements_met');
+ /** @private {boolean} */
+ this.requirementsMet = schemesCompliance.requirements_met;
+
+ Validation.isString(schemesCompliance.requirements_not_met_info, 'requirements_not_met_info', true);
+ /** @private {string|undefined} */
+ this.requirementsNotMetInfo = schemesCompliance.requirements_not_met_info;
+ }
+
+ /**
+ * @returns {AdvancedIdentityProfileSchemeResponse}
+ */
+ getScheme() {
+ return this.scheme;
+ }
+
+ /**
+ * @returns {boolean}
+ */
+ getRequirementsMet() {
+ return this.requirementsMet;
+ }
+
+ /**
+ *
+ * @returns {string|undefined}
+ */
+ getRequirementsNotMetInfo() {
+ return this.requirementsNotMetInfo;
+ }
+}
+
+module.exports = AdvancedIdentityProfileSchemeComplianceResponse;
diff --git a/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.response.js b/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.response.js
new file mode 100644
index 000000000..241d79450
--- /dev/null
+++ b/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.response.js
@@ -0,0 +1,60 @@
+'use strict';
+
+const Validation = require('../../../../../yoti_common/validation');
+const AdvancedIdentityProfileReportResponse = require('./advanced.identity.profile.report.response');
+const IdentityProfileFailureReasonResponse = require('../identity.profile.failure.reason.response');
+
+class AdvancedIdentityProfileResponse {
+ constructor(response) {
+ Validation.isString(response.subject_id, 'subject_id');
+ /** @private {string} */
+ this.subjectId = response.subject_id;
+
+ Validation.isString(response.result, 'result');
+ /** @private {string} */
+ this.result = response.result;
+
+ if (response.failure_reason) {
+ Validation.isPlainObject(response.failure_reason, 'failure_reason');
+ /** @private {IdentityProfileFailureReasonResponse} */
+ this.failureReason = new IdentityProfileFailureReasonResponse(response.failure_reason);
+ }
+
+ if (response.identity_profile_report) {
+ Validation.isPlainObject(response.identity_profile_report, 'identity_profile_report');
+ /** @private {AdvancedIdentityProfileReportResponse} */
+ // eslint-disable-next-line max-len
+ this.identityProfileReport = new AdvancedIdentityProfileReportResponse(response.identity_profile_report);
+ }
+ }
+
+ /**
+ * @returns {string}
+ */
+ getSubjectId() {
+ return this.subjectId;
+ }
+
+ /**
+ * @returns {string}
+ */
+ getResult() {
+ return this.result;
+ }
+
+ /**
+ * @returns {IdentityProfileFailureReasonResponse|undefined}
+ */
+ getFailureReason() {
+ return this.failureReason;
+ }
+
+ /**
+ * @returns {AdvancedIdentityProfileReportResponse|undefined}
+ */
+ getIdentityProfileReport() {
+ return this.identityProfileReport;
+ }
+}
+
+module.exports = AdvancedIdentityProfileResponse;
diff --git a/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.scheme.response.js b/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.scheme.response.js
new file mode 100644
index 000000000..0f7793362
--- /dev/null
+++ b/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.scheme.response.js
@@ -0,0 +1,42 @@
+'use strict';
+
+const Validation = require('../../../../../yoti_common/validation');
+
+class AdvancedIdentityProfileSchemeResponse {
+ constructor(scheme) {
+ Validation.isString(scheme.type, 'type');
+ /** @private {string} */
+ this.type = scheme.type;
+
+ Validation.isString(scheme.objective, 'objective', true);
+ /** @private {string} */
+ this.objective = scheme.objective;
+
+ Validation.isString(scheme.label, 'label');
+ /** @private {string} */
+ this.label = scheme.label;
+ }
+
+ /**
+ * @returns {string}
+ */
+ getType() {
+ return this.type;
+ }
+
+ /**
+ * @returns {string}
+ */
+ getObjective() {
+ return this.objective;
+ }
+
+ /**
+ * @returns {string}
+ */
+ getLabel() {
+ return this.label;
+ }
+}
+
+module.exports = AdvancedIdentityProfileSchemeResponse;
diff --git a/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.trust.framework.response.js b/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.trust.framework.response.js
new file mode 100644
index 000000000..5a25c663a
--- /dev/null
+++ b/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.trust.framework.response.js
@@ -0,0 +1,34 @@
+'use strict';
+
+const Validation = require('../../../../../yoti_common/validation');
+const AdvancedIdentityProfileSchemeComplianceResponse = require('./advanced.identity.profile.report.scheme.compliance.response');
+
+class AdvancedIdentityProfileTrustFrameworkResponse {
+ constructor(trustFrameworkCompliance) {
+ Validation.isString(trustFrameworkCompliance.trust_framework, 'trust_framework');
+ /** @private {string} */
+ this.trustFramework = trustFrameworkCompliance.trust_framework;
+
+ Validation.isArray(trustFrameworkCompliance.schemes_compliance, 'schemes_compliance');
+ /** @private {AdvancedIdentityProfileSchemeComplianceResponse[]} */
+ this.schemesCompliance = trustFrameworkCompliance.schemes_compliance
+ // eslint-disable-next-line max-len
+ .map((schemeCompliance) => new AdvancedIdentityProfileSchemeComplianceResponse(schemeCompliance));
+ }
+
+ /**
+ * @returns {string}
+ */
+ getTrustFramework() {
+ return this.trustFramework;
+ }
+
+ /**
+ * @returns {AdvancedIdentityProfileSchemeComplianceResponse[]}
+ */
+ getSchemesCompliance() {
+ return this.schemesCompliance;
+ }
+}
+
+module.exports = AdvancedIdentityProfileTrustFrameworkResponse;
diff --git a/src/idv_service/session/retrieve/identity.profile.failure.reason.response.js b/src/idv_service/session/retrieve/identity_profile/identity.profile.failure.reason.response.js
similarity index 79%
rename from src/idv_service/session/retrieve/identity.profile.failure.reason.response.js
rename to src/idv_service/session/retrieve/identity_profile/identity.profile.failure.reason.response.js
index 520bc57d8..043de6ae2 100644
--- a/src/idv_service/session/retrieve/identity.profile.failure.reason.response.js
+++ b/src/idv_service/session/retrieve/identity_profile/identity.profile.failure.reason.response.js
@@ -1,15 +1,15 @@
'use strict';
-const Validation = require('../../../yoti_common/validation');
+const Validation = require('../../../../yoti_common/validation');
const IdentityProfileRequirementsNotMetDetailResponse = require('./identity.profile.requirements.not.met.detail.response');
class IdentityProfileFailureReasonResponse {
constructor(failureReason) {
Validation.isString(failureReason.reason_code, 'reason code');
- /** @private @type {string} */
+ /** @private {string} */
this.reasonCode = failureReason.reason_code;
- /** @private @type {IdentityProfileRequirementsNotMetDetailResponse[]} */
+ /** @private {IdentityProfileRequirementsNotMetDetailResponse[]} */
this.requirementsNotMetDetails = [];
// eslint-disable-next-line camelcase
@@ -23,10 +23,16 @@ class IdentityProfileFailureReasonResponse {
}
}
+ /**
+ * @returns {string}
+ */
getReasonCode() {
return this.reasonCode;
}
+ /**
+ * @returns {IdentityProfileRequirementsNotMetDetailResponse[]}
+ */
getRequirementsNotMetDetails() {
return this.requirementsNotMetDetails;
}
diff --git a/src/idv_service/session/retrieve/identity.profile.report.response.js b/src/idv_service/session/retrieve/identity_profile/identity.profile.report.response.js
similarity index 80%
rename from src/idv_service/session/retrieve/identity.profile.report.response.js
rename to src/idv_service/session/retrieve/identity_profile/identity.profile.report.response.js
index 1ea801b6e..cba02cc81 100644
--- a/src/idv_service/session/retrieve/identity.profile.report.response.js
+++ b/src/idv_service/session/retrieve/identity_profile/identity.profile.report.response.js
@@ -1,23 +1,23 @@
'use strict';
const IdentityProfileReportSchemesComplianceResponse = require('./identity.profile.report.schemes.compliance.response');
-const Validation = require('../../../yoti_common/validation');
-const MediaResponse = require('./media.response');
+const Validation = require('../../../../yoti_common/validation');
+const MediaResponse = require('../media.response');
class IdentityProfileReportResponse {
constructor(report) {
Validation.isString(report.trust_framework, 'trust_framework');
- /** @private */
+ /** @private {string} */
this.trustFramework = report.trust_framework;
Validation.isArray(report.schemes_compliance, 'schemes_compliance');
- /** @private */
+ /** @private {IdentityProfileReportSchemesComplianceResponse[]} */
this.schemesCompliance = report.schemes_compliance
// eslint-disable-next-line max-len
.map((schemeCompliance) => new IdentityProfileReportSchemesComplianceResponse(schemeCompliance));
Validation.isPlainObject(report.media, 'media');
- /** @private */
+ /** @private {MediaResponse} */
this.media = new MediaResponse(report.media);
}
diff --git a/src/idv_service/session/retrieve/identity_profile/identity.profile.report.schemes.compliance.response.js b/src/idv_service/session/retrieve/identity_profile/identity.profile.report.schemes.compliance.response.js
new file mode 100644
index 000000000..b1e05e7ee
--- /dev/null
+++ b/src/idv_service/session/retrieve/identity_profile/identity.profile.report.schemes.compliance.response.js
@@ -0,0 +1,43 @@
+'use strict';
+
+const Validation = require('../../../../yoti_common/validation');
+const IdentityProfileSchemeResponse = require('./identity.profile.scheme.response');
+
+class IdentityProfileReportSchemesComplianceResponse {
+ constructor(schemesCompliance) {
+ Validation.isPlainObject(schemesCompliance.scheme, 'scheme');
+ /** @private {IdentityProfileSchemeResponse} */
+ this.scheme = new IdentityProfileSchemeResponse(schemesCompliance.scheme);
+
+ Validation.isBoolean(schemesCompliance.requirements_met, 'requirements_met');
+ /** @private {boolean} */
+ this.requirementsMet = schemesCompliance.requirements_met;
+
+ Validation.isString(schemesCompliance.requirements_not_met_info, 'requirements_not_met_info', true);
+ /** @private {string|undefined} */
+ this.requirementsNotMetInfo = schemesCompliance.requirements_not_met_info;
+ }
+
+ /**
+ * @returns {IdentityProfileSchemeResponse}
+ */
+ getScheme() {
+ return this.scheme;
+ }
+
+ /**
+ * @returns {boolean}
+ */
+ isRequirementsMet() {
+ return this.requirementsMet;
+ }
+
+ /**
+ * @returns {string|undefined}
+ */
+ getRequirementsNotMetInfo() {
+ return this.requirementsNotMetInfo;
+ }
+}
+
+module.exports = IdentityProfileReportSchemesComplianceResponse;
diff --git a/src/idv_service/session/retrieve/identity.profile.requirements.not.met.detail.response.js b/src/idv_service/session/retrieve/identity_profile/identity.profile.requirements.not.met.detail.response.js
similarity index 69%
rename from src/idv_service/session/retrieve/identity.profile.requirements.not.met.detail.response.js
rename to src/idv_service/session/retrieve/identity_profile/identity.profile.requirements.not.met.detail.response.js
index 06b96af97..ee530b1d3 100644
--- a/src/idv_service/session/retrieve/identity.profile.requirements.not.met.detail.response.js
+++ b/src/idv_service/session/retrieve/identity_profile/identity.profile.requirements.not.met.detail.response.js
@@ -1,46 +1,61 @@
'use strict';
-const Validation = require('../../../yoti_common/validation');
+const Validation = require('../../../../yoti_common/validation');
class IdentityProfileRequirementsNotMetDetailResponse {
constructor(requirementsNotMetDetail) {
Validation.isString(requirementsNotMetDetail.failure_type, 'failure_type');
- /** @private @type {string} */
+ /** @private {string} */
this.failureType = requirementsNotMetDetail.failure_type;
- Validation.isString(requirementsNotMetDetail.document_type, 'document_type');
- /** @private @type {string} */
+ Validation.isString(requirementsNotMetDetail.document_type, 'document_type', true);
+ /** @private {string|undefined} */
this.documentType = requirementsNotMetDetail.document_type;
- Validation.isString(requirementsNotMetDetail.document_country_iso_code, 'document_country_iso_code');
- /** @private @type {string} */
+ Validation.isString(requirementsNotMetDetail.document_country_iso_code, 'document_country_iso_code', true);
+ /** @private {string|undefined} */
this.documentCountryIsoCode = requirementsNotMetDetail.document_country_iso_code;
Validation.isString(requirementsNotMetDetail.audit_id, 'audit_id', true);
- /** @private @type {string|undefined} */
+ /** @private {string|undefined} */
this.auditId = requirementsNotMetDetail.audit_id;
Validation.isString(requirementsNotMetDetail.details, 'details');
- /** @private @type {string} */
+ /** @private {string} */
this.details = requirementsNotMetDetail.details;
}
+ /**
+ * @returns {string}
+ */
getFailureType() {
return this.failureType;
}
+ /**
+ * @returns {string}
+ */
getDocumentType() {
return this.documentType;
}
+ /**
+ * @returns {string}
+ */
getDocumentCountryIsoCode() {
return this.documentCountryIsoCode;
}
+ /**
+ * @returns {string|undefined}
+ */
getAuditId() {
return this.auditId;
}
+ /**
+ * @returns {string}
+ */
getDetails() {
return this.details;
}
diff --git a/src/idv_service/session/retrieve/identity.profile.response.js b/src/idv_service/session/retrieve/identity_profile/identity.profile.response.js
similarity index 78%
rename from src/idv_service/session/retrieve/identity.profile.response.js
rename to src/idv_service/session/retrieve/identity_profile/identity.profile.response.js
index b961f01ad..e87f5f364 100644
--- a/src/idv_service/session/retrieve/identity.profile.response.js
+++ b/src/idv_service/session/retrieve/identity_profile/identity.profile.response.js
@@ -1,28 +1,28 @@
'use strict';
-const Validation = require('../../../yoti_common/validation');
+const Validation = require('../../../../yoti_common/validation');
const IdentityProfileReportResponse = require('./identity.profile.report.response');
const IdentityProfileFailureReasonResponse = require('./identity.profile.failure.reason.response');
class IdentityProfileResponse {
constructor(identityProfile) {
Validation.isString(identityProfile.subject_id, 'subject_id', true);
- /** @private */
+ /** @private {string|undefined} */
this.subjectId = identityProfile.subject_id;
Validation.isString(identityProfile.result, 'result');
- /** @private */
+ /** @private {string} */
this.result = identityProfile.result;
if (identityProfile.failure_reason) {
Validation.isPlainObject(identityProfile.failure_reason, 'failure_reason');
- /** @private */
+ /** @private {IdentityProfileFailureReasonResponse|undefined} */
this.failureReason = new IdentityProfileFailureReasonResponse(identityProfile.failure_reason);
}
if (identityProfile.identity_profile_report) {
Validation.isPlainObject(identityProfile.identity_profile_report, 'identity_profile_report');
- /** @private */
+ /** @private {IdentityProfileReportResponse|undefined} */
this.identityProfileReport = new IdentityProfileReportResponse(
identityProfile.identity_profile_report
);
@@ -44,14 +44,14 @@ class IdentityProfileResponse {
}
/**
- * @returns {IdentityProfileFailureReasonResponse}
+ * @returns {IdentityProfileFailureReasonResponse|undefined}
*/
getFailureReason() {
return this.failureReason;
}
/**
- * @returns {IdentityProfileReportResponse}
+ * @returns {IdentityProfileReportResponse|undefined}
*/
getIdentityProfileReport() {
return this.identityProfileReport;
diff --git a/src/idv_service/session/retrieve/identity_profile/identity.profile.scheme.response.js b/src/idv_service/session/retrieve/identity_profile/identity.profile.scheme.response.js
new file mode 100644
index 000000000..8fbf96aba
--- /dev/null
+++ b/src/idv_service/session/retrieve/identity_profile/identity.profile.scheme.response.js
@@ -0,0 +1,31 @@
+'use strict';
+
+const Validation = require('../../../../yoti_common/validation');
+
+class IdentityProfileSchemeResponse {
+ constructor(scheme) {
+ Validation.isString(scheme.type, 'type');
+ /** @private {string} */
+ this.type = scheme.type;
+
+ Validation.isString(scheme.objective, 'objective', true);
+ /** @private {string} */
+ this.objective = scheme.objective;
+ }
+
+ /**
+ * @returns {string}
+ */
+ getType() {
+ return this.type;
+ }
+
+ /**
+ * @returns {string|undefined}
+ */
+ getObjective() {
+ return this.objective;
+ }
+}
+
+module.exports = IdentityProfileSchemeResponse;
diff --git a/tests/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.builder.test.js b/tests/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.builder.test.js
new file mode 100644
index 000000000..5c3750d12
--- /dev/null
+++ b/tests/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.builder.test.js
@@ -0,0 +1,87 @@
+const AdvancedIdentityProfile = require('../../../../../../src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile');
+const AdvancedIdentityProfileBuilder = require('../../../../../../src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.builder');
+const AdvancedIdentityProfileSchemeBuilder = require('../../../../../../src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.builder');
+const AdvancedIdentityProfileSchemeConfigBuilder = require('../../../../../../src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.config.builder');
+const OrthogonalRestrictionsFilterBuilder = require('../../../../../../src/idv_service/session/create/filters/orthogonal/orthogonal.restrictions.filter.builder');
+
+function getScheme(type, objective, label, filterDocumentType = null) {
+ const builder = new AdvancedIdentityProfileSchemeBuilder()
+ .withType(type)
+ .withLabel(label);
+ if (objective) builder.withObjective(objective);
+
+ if (filterDocumentType) {
+ const documentFilter = new OrthogonalRestrictionsFilterBuilder()
+ .withWhitelistedDocumentTypes([filterDocumentType])
+ .withAllowNonLatinDocuments(true)
+ .build();
+ const advancedIdentityProfileSchemeConfig = new AdvancedIdentityProfileSchemeConfigBuilder()
+ .withFilter(documentFilter)
+ .build();
+
+ builder.withConfig(advancedIdentityProfileSchemeConfig);
+ }
+
+ return builder.build();
+}
+
+describe('AdvancedIdentityProfileSchemeBuilder', () => {
+ it('should build AdvancedIdentityProfileScheme (1 scheme)', () => {
+ const scheme = getScheme('DBS', 'STANDARD', 'dbs-standard');
+ const advancedIdentityProfile = new AdvancedIdentityProfileBuilder()
+ .withTrustFramework('UK_TFIDA')
+ .withScheme(scheme)
+ .build();
+
+ expect(advancedIdentityProfile).toBeInstanceOf(AdvancedIdentityProfile);
+
+ const expectedJson = JSON.stringify({
+ trust_framework: 'UK_TFIDA',
+ schemes: [
+ JSON.parse(JSON.stringify(scheme)),
+ ],
+ });
+
+ expect(JSON.stringify(advancedIdentityProfile)).toBe(expectedJson);
+ });
+
+ it('should build AdvancedIdentityProfileScheme (2 schemes)', () => {
+ const scheme1 = getScheme('DBS', 'STANDARD', 'dbs-standard');
+ const scheme2 = getScheme('RTW', null, 'some-rtw', 'PASSPORT');
+ const advancedIdentityProfile = new AdvancedIdentityProfileBuilder()
+ .withTrustFramework('UK_TFIDA')
+ .withScheme(scheme1)
+ .withScheme(scheme2)
+ .build();
+
+ expect(advancedIdentityProfile).toBeInstanceOf(AdvancedIdentityProfile);
+
+ const expectedJson = JSON.stringify({
+ trust_framework: 'UK_TFIDA',
+ schemes: [
+ JSON.parse(JSON.stringify(scheme1)),
+ JSON.parse(JSON.stringify(scheme2)),
+ ],
+ });
+
+ expect(JSON.stringify(advancedIdentityProfile)).toBe(expectedJson);
+ });
+
+ describe('#withTrustFramework', () => {
+ it('should error when called with incorrect argument type', () => {
+ expect(() => {
+ new AdvancedIdentityProfileBuilder()
+ .withTrustFramework(123);
+ }).toThrowError(TypeError);
+ });
+ });
+
+ describe('#withTrustFramework', () => {
+ it('should error when called with incorrect argument type', () => {
+ expect(() => {
+ new AdvancedIdentityProfileBuilder()
+ .withScheme({ not: 'a-scheme' });
+ }).toThrowError(TypeError);
+ });
+ });
+});
diff --git a/tests/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.requirements.builder.test.js b/tests/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.requirements.builder.test.js
new file mode 100644
index 000000000..0b5d4a06a
--- /dev/null
+++ b/tests/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.requirements.builder.test.js
@@ -0,0 +1,57 @@
+const AdvancedIdentityProfileRequirements = require('../../../../../../src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.requirements');
+const AdvancedIdentityProfileRequirementsBuilder = require('../../../../../../src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.requirements.builder');
+const AdvancedIdentityProfile = require('../../../../../../src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile');
+const AdvancedIdentityProfileScheme = require('../../../../../../src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme');
+
+const profile1 = new AdvancedIdentityProfile('UK_TFIDA', [
+ new AdvancedIdentityProfileScheme('DBS', 'STANDARD', 'dbs-standard'),
+ new AdvancedIdentityProfileScheme('RTW', 'BASIC', 'rtw-basic'),
+]);
+const profile2 = new AdvancedIdentityProfile('YOTI_GLOBAL', [
+ new AdvancedIdentityProfileScheme('IDENTITY', 'AL_L1', 'identity-AL-L1'),
+ new AdvancedIdentityProfileScheme('IDENTITY', 'AL_M1', 'identity-AL-M1'),
+]);
+
+describe('AdvancedIdentityProfileSchemeBuilder', () => {
+ it('should build AdvancedIdentityProfileScheme (1 profile)', () => {
+ const advancedIdentityProfileRequirements = new AdvancedIdentityProfileRequirementsBuilder()
+ .withProfile(profile1)
+ .build();
+
+ expect(advancedIdentityProfileRequirements).toBeInstanceOf(AdvancedIdentityProfileRequirements);
+
+ const expectedJson = JSON.stringify({
+ profiles: [
+ JSON.parse(JSON.stringify(profile1)),
+ ],
+ });
+
+ expect(JSON.stringify(advancedIdentityProfileRequirements)).toBe(expectedJson);
+ });
+ it('should build AdvancedIdentityProfileScheme (2 profiles)', () => {
+ const advancedIdentityProfileRequirements = new AdvancedIdentityProfileRequirementsBuilder()
+ .withProfile(profile1)
+ .withProfile(profile2)
+ .build();
+
+ expect(advancedIdentityProfileRequirements).toBeInstanceOf(AdvancedIdentityProfileRequirements);
+
+ const expectedJson = JSON.stringify({
+ profiles: [
+ JSON.parse(JSON.stringify(profile1)),
+ JSON.parse(JSON.stringify(profile2)),
+ ],
+ });
+
+ expect(JSON.stringify(advancedIdentityProfileRequirements)).toBe(expectedJson);
+ });
+
+ describe('#withProfile', () => {
+ it('should error when called with incorrect argument type', () => {
+ expect(() => {
+ new AdvancedIdentityProfileRequirementsBuilder()
+ .withProfile({ not: 'a-profile' });
+ }).toThrowError(TypeError);
+ });
+ });
+});
diff --git a/tests/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.builder.test.js b/tests/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.builder.test.js
new file mode 100644
index 000000000..8386ef50b
--- /dev/null
+++ b/tests/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.builder.test.js
@@ -0,0 +1,99 @@
+const AdvancedIdentityProfileSchemeBuilder = require('../../../../../../src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.builder');
+const AdvancedIdentityProfileScheme = require('../../../../../../src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme');
+const AdvancedIdentityProfileSchemeConfigBuilder = require('../../../../../../src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.config.builder');
+const OrthogonalRestrictionsFilterBuilder = require('../../../../../../src/idv_service/session/create/filters/orthogonal/orthogonal.restrictions.filter.builder');
+
+describe('AdvancedIdentityProfileSchemeBuilder', () => {
+ it('should build AdvancedIdentityProfileScheme (without config)', () => {
+ const advancedIdentityProfileScheme = new AdvancedIdentityProfileSchemeBuilder()
+ .withType('DBS')
+ .withObjective('STANDARD')
+ .withLabel('dbs-standard')
+ .build();
+
+ expect(advancedIdentityProfileScheme).toBeInstanceOf(AdvancedIdentityProfileScheme);
+
+ const expectedJson = JSON.stringify({
+ type: 'DBS',
+ objective: 'STANDARD',
+ label: 'dbs-standard',
+ });
+
+ expect(JSON.stringify(advancedIdentityProfileScheme)).toBe(expectedJson);
+ });
+ it('should build AdvancedIdentityProfileScheme (without config, nor objective, nor label)', () => {
+ const advancedIdentityProfileScheme = new AdvancedIdentityProfileSchemeBuilder()
+ .withType('RTW')
+ .withLabel('some-rtw')
+ .build();
+
+ expect(advancedIdentityProfileScheme).toBeInstanceOf(AdvancedIdentityProfileScheme);
+
+ const expectedJson = JSON.stringify({
+ type: 'RTW',
+ label: 'some-rtw',
+ });
+
+ expect(JSON.stringify(advancedIdentityProfileScheme)).toBe(expectedJson);
+ });
+ it('should build AdvancedIdentityProfileScheme (with config)', () => {
+ const documentFilter = new OrthogonalRestrictionsFilterBuilder()
+ .withWhitelistedDocumentTypes(['DRIVING_LICENCE'])
+ .withAllowNonLatinDocuments(true)
+ .build();
+
+ const advancedIdentityProfileSchemeConfig = new AdvancedIdentityProfileSchemeConfigBuilder()
+ .withFilter(documentFilter)
+ .build();
+
+ const advancedIdentityProfileScheme = new AdvancedIdentityProfileSchemeBuilder()
+ .withType('DBS')
+ .withObjective('STANDARD')
+ .withLabel('dbs-standard')
+ .withConfig(advancedIdentityProfileSchemeConfig)
+ .build();
+
+ expect(advancedIdentityProfileScheme).toBeInstanceOf(AdvancedIdentityProfileScheme);
+
+ const expectedJson = JSON.stringify({
+ type: 'DBS',
+ objective: 'STANDARD',
+ label: 'dbs-standard',
+ config: JSON.parse(JSON.stringify(advancedIdentityProfileSchemeConfig)),
+ });
+
+ expect(JSON.stringify(advancedIdentityProfileScheme)).toBe(expectedJson);
+ });
+ describe('#withType', () => {
+ it('should error when called with incorrect argument type', () => {
+ expect(() => {
+ new AdvancedIdentityProfileSchemeBuilder()
+ .withType(123);
+ }).toThrowError(TypeError);
+ });
+ });
+ describe('#withLabel', () => {
+ it('should error when called with incorrect argument type', () => {
+ expect(() => {
+ new AdvancedIdentityProfileSchemeBuilder()
+ .withLabel(123);
+ }).toThrowError(TypeError);
+ });
+ });
+ describe('#withObjective', () => {
+ it('should error when called with incorrect argument type', () => {
+ expect(() => {
+ new AdvancedIdentityProfileSchemeBuilder()
+ .withObjective(123);
+ }).toThrowError(TypeError);
+ });
+ });
+ describe('#withConfig', () => {
+ it('should error when called with incorrect argument type', () => {
+ expect(() => {
+ new AdvancedIdentityProfileSchemeBuilder()
+ .withConfig(123);
+ }).toThrowError(TypeError);
+ });
+ });
+});
diff --git a/tests/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.config.builder.test.js b/tests/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.config.builder.test.js
new file mode 100644
index 000000000..09e071e5d
--- /dev/null
+++ b/tests/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.config.builder.test.js
@@ -0,0 +1,45 @@
+const AdvancedIdentityProfileSchemeConfigBuilder = require('../../../../../../src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.config.builder');
+const AdvancedIdentityProfileSchemeConfig = require('../../../../../../src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.config');
+const OrthogonalRestrictionsFilterBuilder = require('../../../../../../src/idv_service/session/create/filters/orthogonal/orthogonal.restrictions.filter.builder');
+
+describe('AdvancedIdentityProfileSchemeConfigBuilder', () => {
+ it('should build AdvancedIdentityProfileSchemeConfig (no filter)', () => {
+ const advancedIdentityProfileSchemeConfig = new AdvancedIdentityProfileSchemeConfigBuilder()
+ .build();
+
+ expect(advancedIdentityProfileSchemeConfig).toBeInstanceOf(AdvancedIdentityProfileSchemeConfig);
+
+ const expectedJson = JSON.stringify({});
+
+ expect(JSON.stringify(advancedIdentityProfileSchemeConfig)).toBe(expectedJson);
+ });
+
+ describe('#withFilter()', () => {
+ it('should build AdvancedIdentityProfileSchemeConfig', () => {
+ const documentFilter = new OrthogonalRestrictionsFilterBuilder()
+ .withWhitelistedDocumentTypes(['DRIVING_LICENCE'])
+ .withAllowNonLatinDocuments(true)
+ .build();
+
+ const advancedIdentityProfileSchemeConfig = new AdvancedIdentityProfileSchemeConfigBuilder()
+ .withFilter(documentFilter)
+ .build();
+
+ expect(advancedIdentityProfileSchemeConfig)
+ .toBeInstanceOf(AdvancedIdentityProfileSchemeConfig);
+
+ const expectedJson = JSON.stringify({
+ filter: JSON.parse(JSON.stringify(documentFilter)),
+ });
+
+ expect(JSON.stringify(advancedIdentityProfileSchemeConfig)).toBe(expectedJson);
+ });
+ it('should error when argument is not a filter', () => {
+ expect(() => {
+ new AdvancedIdentityProfileSchemeConfigBuilder()
+ .withFilter({ fake: 'filter' })
+ .build();
+ }).toThrowError(TypeError);
+ });
+ });
+});
diff --git a/tests/idv_service/session/create/session.specification.builder.test.js b/tests/idv_service/session/create/session.specification.builder.test.js
index 01d44971b..0fd6e6ef9 100644
--- a/tests/idv_service/session/create/session.specification.builder.test.js
+++ b/tests/idv_service/session/create/session.specification.builder.test.js
@@ -14,6 +14,9 @@ const {
DocumentRestrictionsFilterBuilder,
RequestedCustomAccountWatchlistAdvancedCaConfigBuilder,
} = require('../../../..');
+const AdvancedIdentityProfile = require('../../../../src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile');
+const AdvancedIdentityProfileScheme = require('../../../../src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme');
+const AdvancedIdentityProfileRequirements = require('../../../../src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.requirements');
describe('SessionSpecificationBuilder', () => {
it('should build SessionSpecification', () => {
@@ -213,6 +216,64 @@ describe('SessionSpecificationBuilder', () => {
expect(JSON.stringify(sessionSpec)).toBe(expectedJson);
});
+ it('should build SessionSpecification with withAdvancedIdentityProfileRequirements', () => {
+ const advancedIdentityProfileRequirements = new AdvancedIdentityProfileRequirements([
+ new AdvancedIdentityProfile('UK_TFIDA', [
+ new AdvancedIdentityProfileScheme('DBS', 'STANDARD', 'dbs-standard'),
+ new AdvancedIdentityProfileScheme('RTW', undefined, 'some-rtw'),
+ ]),
+ new AdvancedIdentityProfile('YOTI_GLOBAL', [
+ new AdvancedIdentityProfileScheme('IDENTITY', 'AL_L1', 'identity-AL-L1'),
+ new AdvancedIdentityProfileScheme('IDENTITY', 'AL_M1', 'identity-AL-M1'),
+ ]),
+ ]);
+
+ const sessionSpec = new SessionSpecificationBuilder()
+ .withAdvancedIdentityProfileRequirements(advancedIdentityProfileRequirements)
+ .build();
+
+ const expectedJson = JSON.stringify({
+ requested_checks: [],
+ requested_tasks: [],
+ required_documents: [],
+ advanced_identity_profile_requirements: {
+ profiles: [
+ {
+ trust_framework: 'UK_TFIDA',
+ schemes: [
+ {
+ type: 'DBS',
+ objective: 'STANDARD',
+ label: 'dbs-standard',
+ },
+ {
+ type: 'RTW',
+ label: 'some-rtw',
+ },
+ ],
+ },
+ {
+ trust_framework: 'YOTI_GLOBAL',
+ schemes: [
+ {
+ type: 'IDENTITY',
+ objective: 'AL_L1',
+ label: 'identity-AL-L1',
+ },
+ {
+ type: 'IDENTITY',
+ objective: 'AL_M1',
+ label: 'identity-AL-M1',
+ },
+ ],
+ },
+ ],
+ },
+ });
+
+ expect(JSON.stringify(sessionSpec)).toBe(expectedJson);
+ });
+
it('should build SessionSpecification with subject', () => {
const subjectDescriptor = {
subject_id: 'some_subject_id_string',
diff --git a/tests/idv_service/session/retrieve/get.session.result.spec.js b/tests/idv_service/session/retrieve/get.session.result.spec.js
index 0a190a17c..cb53b3e11 100644
--- a/tests/idv_service/session/retrieve/get.session.result.spec.js
+++ b/tests/idv_service/session/retrieve/get.session.result.spec.js
@@ -12,7 +12,8 @@ const WatchlistScreeningCheckResponse = require('../../../../src/idv_service/ses
const WatchlistAdvancedCaCheckResponse = require('../../../../src/idv_service/session/retrieve/watchlist.advanced.ca.check.response');
const ThirdPartyIdentityFraud1CheckResponse = require('../../../../src/idv_service/session/retrieve/third.party.identity.fraud.1.check.response');
const FaceComparisonCheckResponse = require('../../../../src/idv_service/session/retrieve/face.comparison.check.response');
-const IdentityProfileResponse = require('../../../../src/idv_service/session/retrieve/identity.profile.response');
+const IdentityProfileResponse = require('../../../../src/idv_service/session/retrieve/identity_profile/identity.profile.response');
+const AdvancedIdentityProfileResponse = require('../../../../src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.response');
const { YotiDate } = require('../../../..');
const ID_DOCUMENT_AUTHENTICITY = 'ID_DOCUMENT_AUTHENTICITY';
@@ -105,6 +106,77 @@ describe('GetSessionResult', () => {
},
},
},
+ advanced_identity_profile: {
+ subject_id: 'some-subject',
+ result: 'DONE',
+ failure_reason: {
+ reason_code: 'MANDATORY_DOCUMENT_NOT_PROVIDED',
+ requirements_not_met_details: [
+ {
+ failure_type: 'ID_DOCUMENT_EXTRACTION',
+ document_type: 'PASSPORT',
+ document_country_iso_code: 'GBR',
+ audit_id: 'audit-123',
+ details: 'something not right',
+ },
+ {
+ failure_type: 'ID_DOCUMENT_AUTHENTICITY',
+ document_type: 'PASSPORT',
+ document_country_iso_code: 'GBR',
+ audit_id: 'audit-456',
+ details: 'something still not right',
+ },
+ ],
+ },
+ identity_profile_report: {
+ compliance: [
+ {
+ trust_framework: 'UK_TFIDA',
+ schemes_compliance: [
+ {
+ requirements_met: true,
+ scheme: {
+ type: 'DBS',
+ objective: 'STANDARD',
+ label: 'dbs-standard',
+ },
+ },
+ {
+ requirements_met: false,
+ requirements_not_met_info: 'HORRIBLE_FAILURE',
+ scheme: {
+ type: 'RTW',
+ label: 'some-RTW',
+ },
+ },
+ ],
+ },
+ {
+ trust_framework: 'YOTI_GLOBAL',
+ schemes_compliance: [
+ {
+ requirements_met: true,
+ scheme: {
+ type: 'IDENTITY',
+ objective: 'AL_M1',
+ label: 'identity-AL-M1',
+ },
+ },
+ {
+ requirements_met: false,
+ requirements_not_met_info: 'HORRIBLE_FAILURE',
+ scheme: {
+ type: 'IDENTITY',
+ objective: 'AL_L1',
+ label: 'identity-AL-L1',
+ },
+ },
+ ],
+ },
+ ],
+ media: {},
+ },
+ },
});
});
@@ -315,4 +387,12 @@ describe('GetSessionResult', () => {
expect(identityProfile).toBeInstanceOf(IdentityProfileResponse);
});
});
+
+ describe('#getAdvancedIdentityProfile', () => {
+ it('should return instance of AdvancedIdentityProfileResponse', () => {
+ const advancedIdentityProfile = session.getAdvancedIdentityProfile();
+
+ expect(advancedIdentityProfile).toBeInstanceOf(AdvancedIdentityProfileResponse);
+ });
+ });
});
diff --git a/tests/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.response.spec.js b/tests/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.response.spec.js
new file mode 100644
index 000000000..c69a1e238
--- /dev/null
+++ b/tests/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.response.spec.js
@@ -0,0 +1,118 @@
+const AdvancedIdentityProfileTrustFrameworkResponse = require('../../../../../../src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.trust.framework.response');
+const AdvancedIdentityProfileReportResponse = require('../../../../../../src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.response');
+const MediaResponse = require('../../../../../../src/idv_service/session/retrieve/media.response');
+
+describe('AdvancedIdentityProfileTrustFrameworkComplianceResponse', () => {
+ let advancedIdentityProfileReportResponse;
+
+ beforeEach(() => {
+ const response = {
+ compliance: [
+ {
+ trust_framework: 'UK_TFIDA',
+ schemes_compliance: [
+ {
+ requirements_met: true,
+ scheme: {
+ type: 'DBS',
+ objective: 'STANDARD',
+ label: 'dbs-standard',
+ },
+ },
+ {
+ requirements_met: false,
+ requirements_not_met_info: 'HORRIBLE_FAILURE',
+ scheme: {
+ type: 'RTW',
+ label: 'some-RTW',
+ },
+ },
+ ],
+ },
+ {
+ trust_framework: 'YOTI_GLOBAL',
+ schemes_compliance: [
+ {
+ requirements_met: true,
+ scheme: {
+ type: 'IDENTITY',
+ objective: 'AL_M1',
+ label: 'identity-AL-M1',
+ },
+ },
+ {
+ requirements_met: false,
+ requirements_not_met_info: 'HORRIBLE_FAILURE',
+ scheme: {
+ type: 'IDENTITY',
+ objective: 'AL_L1',
+ label: 'identity-AL-L1',
+ },
+ },
+ ],
+ },
+ ],
+ media: {},
+ };
+
+ // eslint-disable-next-line max-len
+ advancedIdentityProfileReportResponse = new AdvancedIdentityProfileReportResponse(response);
+ });
+
+ describe('#getCompliance', () => {
+ it('should return compliance', () => {
+ const compliance = advancedIdentityProfileReportResponse.getCompliance();
+ expect(compliance).toHaveLength(2);
+ expect(compliance[0]).toBeInstanceOf(AdvancedIdentityProfileTrustFrameworkResponse);
+ expect(compliance[0].getTrustFramework()).toBe('UK_TFIDA');
+ expect(compliance[0].getSchemesCompliance()).toHaveLength(2);
+ expect(compliance[0].getSchemesCompliance()).toEqual(expect.arrayContaining([
+ expect.objectContaining({
+ requirementsMet: true,
+ scheme: {
+ type: 'DBS',
+ objective: 'STANDARD',
+ label: 'dbs-standard',
+ },
+ }),
+ expect.objectContaining({
+ requirementsMet: false,
+ requirementsNotMetInfo: 'HORRIBLE_FAILURE',
+ scheme: {
+ type: 'RTW',
+ label: 'some-RTW',
+ },
+ }),
+ ]));
+
+ expect(compliance[1]).toBeInstanceOf(AdvancedIdentityProfileTrustFrameworkResponse);
+ expect(compliance[1].getTrustFramework()).toBe('YOTI_GLOBAL');
+ expect(compliance[1].getSchemesCompliance()).toHaveLength(2);
+ expect(compliance[1].getSchemesCompliance()).toEqual(expect.arrayContaining([
+ expect.objectContaining({
+ requirementsMet: true,
+ scheme: {
+ type: 'IDENTITY',
+ objective: 'AL_M1',
+ label: 'identity-AL-M1',
+ },
+ }),
+ expect.objectContaining({
+ requirementsMet: false,
+ requirementsNotMetInfo: 'HORRIBLE_FAILURE',
+ scheme: {
+ type: 'IDENTITY',
+ objective: 'AL_L1',
+ label: 'identity-AL-L1',
+ },
+ }),
+ ]));
+ });
+ });
+
+ describe('#getMedia', () => {
+ it('should return media', () => {
+ expect(advancedIdentityProfileReportResponse.getMedia()).toBeInstanceOf(MediaResponse);
+ });
+ });
+});
diff --git a/tests/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.scheme.response.spec.js b/tests/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.scheme.response.spec.js
new file mode 100644
index 000000000..16c7bdb8b
--- /dev/null
+++ b/tests/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.scheme.response.spec.js
@@ -0,0 +1,74 @@
+const AdvancedIdentityProfileSchemeResponse = require('../../../../../../src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.scheme.response');
+const AdvancedIdentityProfileReportSchemeComplianceResponse = require('../../../../../../src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.scheme.compliance.response');
+
+const schemeResponse = {
+ type: 'DBS',
+ objective: 'STANDARD',
+ label: 'dbs-standard',
+};
+
+describe('AdvancedIdentityProfileReportSchemeComplianceResponse', () => {
+ let advancedIdentityProfileReportSchemeComplianceResponse;
+
+ describe('with requirements met', () => {
+ beforeEach(() => {
+ const responseWithMetRequirements = {
+ requirements_met: true,
+ scheme: schemeResponse,
+ };
+ // eslint-disable-next-line max-len
+ advancedIdentityProfileReportSchemeComplianceResponse = new AdvancedIdentityProfileReportSchemeComplianceResponse(responseWithMetRequirements);
+ });
+
+ describe('#getScheme', () => {
+ it('should return scheme', () => {
+ const scheme = advancedIdentityProfileReportSchemeComplianceResponse.getScheme();
+ expect(scheme).toBeInstanceOf(AdvancedIdentityProfileSchemeResponse);
+ expect(scheme.getType()).toBe('DBS');
+ expect(scheme.getObjective()).toBe('STANDARD');
+ expect(scheme.getLabel()).toBe('dbs-standard');
+ });
+ });
+
+ describe('#getRequirementsMet', () => {
+ it('should return requirements_met', () => {
+ // eslint-disable-next-line max-len
+ expect(advancedIdentityProfileReportSchemeComplianceResponse.getRequirementsMet()).toBe(true);
+ });
+ });
+ });
+ describe('with requirements not met', () => {
+ beforeEach(() => {
+ const responseWithNotMetRequirements = {
+ requirements_met: false,
+ requirements_not_met_info: 'SOMETHING_FAILED',
+ scheme: schemeResponse,
+ };
+ // eslint-disable-next-line max-len
+ advancedIdentityProfileReportSchemeComplianceResponse = new AdvancedIdentityProfileReportSchemeComplianceResponse(responseWithNotMetRequirements);
+ });
+
+ describe('#getScheme', () => {
+ it('should return scheme', () => {
+ const scheme = advancedIdentityProfileReportSchemeComplianceResponse.getScheme();
+ expect(scheme).toBeInstanceOf(AdvancedIdentityProfileSchemeResponse);
+ expect(scheme.getType()).toBe('DBS');
+ expect(scheme.getObjective()).toBe('STANDARD');
+ expect(scheme.getLabel()).toBe('dbs-standard');
+ });
+ });
+
+ describe('#getRequirementsMet', () => {
+ it('should return requirements_met', () => {
+ // eslint-disable-next-line max-len
+ expect(advancedIdentityProfileReportSchemeComplianceResponse.getRequirementsMet()).toBe(false);
+ });
+ });
+ describe('#getRequirementsMet', () => {
+ it('should return requirements_met', () => {
+ // eslint-disable-next-line max-len
+ expect(advancedIdentityProfileReportSchemeComplianceResponse.getRequirementsNotMetInfo()).toBe('SOMETHING_FAILED');
+ });
+ });
+ });
+});
diff --git a/tests/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.response.spec.js b/tests/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.response.spec.js
new file mode 100644
index 000000000..1452494bd
--- /dev/null
+++ b/tests/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.response.spec.js
@@ -0,0 +1,134 @@
+const IdentityProfileFailureReasonResponse = require('../../../../../../src/idv_service/session/retrieve/identity_profile/identity.profile.failure.reason.response');
+const IdentityProfileRequirementsNotMetDetailResponse = require('../../../../../../src/idv_service/session/retrieve/identity_profile/identity.profile.requirements.not.met.detail.response');
+const AdvancedIdentityProfileReportResponse = require('../../../../../../src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.response');
+const AdvancedIdentityProfileResponse = require('../../../../../../src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.response');
+
+const reportResponse = {
+ compliance: [
+ {
+ trust_framework: 'UK_TFIDA',
+ schemes_compliance: [
+ {
+ requirements_met: true,
+ scheme: {
+ type: 'DBS',
+ objective: 'STANDARD',
+ label: 'dbs-standard',
+ },
+ },
+ {
+ requirements_met: false,
+ requirements_not_met_info: 'HORRIBLE_FAILURE',
+ scheme: {
+ type: 'RTW',
+ label: 'some-RTW',
+ },
+ },
+ ],
+ },
+ {
+ trust_framework: 'YOTI_GLOBAL',
+ schemes_compliance: [
+ {
+ requirements_met: true,
+ scheme: {
+ type: 'IDENTITY',
+ objective: 'AL_M1',
+ label: 'identity-AL-M1',
+ },
+ },
+ {
+ requirements_met: false,
+ requirements_not_met_info: 'HORRIBLE_FAILURE',
+ scheme: {
+ type: 'IDENTITY',
+ objective: 'AL_L1',
+ label: 'identity-AL-L1',
+ },
+ },
+ ],
+ },
+ ],
+ media: {},
+};
+
+describe('AdvancedIdentityProfileResponse', () => {
+ let advancedIdentityProfileResponse;
+
+ beforeEach(() => {
+ const response = {
+ subject_id: 'some-subject',
+ result: 'DONE',
+ failure_reason: {
+ reason_code: 'MANDATORY_DOCUMENT_NOT_PROVIDED',
+ requirements_not_met_details: [
+ {
+ failure_type: 'ID_DOCUMENT_EXTRACTION',
+ document_type: 'PASSPORT',
+ document_country_iso_code: 'GBR',
+ audit_id: 'audit-123',
+ details: 'something not right',
+ },
+ {
+ failure_type: 'ID_DOCUMENT_AUTHENTICITY',
+ document_type: 'PASSPORT',
+ document_country_iso_code: 'GBR',
+ audit_id: 'audit-456',
+ details: 'something still not right',
+ },
+ ],
+ },
+ identity_profile_report: reportResponse,
+ };
+
+ advancedIdentityProfileResponse = new AdvancedIdentityProfileResponse(response);
+ });
+
+ describe('#getSubjectId', () => {
+ it('Should return ID', () => {
+ expect(advancedIdentityProfileResponse.getSubjectId()).toBe('some-subject');
+ });
+ });
+
+ describe('#getResult', () => {
+ it('Should return result string', () => {
+ expect(advancedIdentityProfileResponse.getResult()).toBe('DONE');
+ });
+ });
+
+ describe('#getFailureReason', () => {
+ it('Should return failureReason object', () => {
+ const failureReason = advancedIdentityProfileResponse.getFailureReason();
+ expect(failureReason)
+ .toBeInstanceOf(IdentityProfileFailureReasonResponse);
+
+ expect(failureReason.getReasonCode()).toBe('MANDATORY_DOCUMENT_NOT_PROVIDED');
+ expect(failureReason.getRequirementsNotMetDetails()).toHaveLength(2);
+ const [firstDetail, secondDetail] = failureReason.getRequirementsNotMetDetails();
+ expect(firstDetail).toBeInstanceOf(IdentityProfileRequirementsNotMetDetailResponse);
+ expect(firstDetail).toEqual(expect.objectContaining({
+ failureType: 'ID_DOCUMENT_EXTRACTION',
+ documentType: 'PASSPORT',
+ documentCountryIsoCode: 'GBR',
+ auditId: 'audit-123',
+ details: 'something not right',
+ }));
+ expect(firstDetail).toBeInstanceOf(IdentityProfileRequirementsNotMetDetailResponse);
+ expect(secondDetail).toEqual(expect.objectContaining({
+ failureType: 'ID_DOCUMENT_AUTHENTICITY',
+ documentType: 'PASSPORT',
+ documentCountryIsoCode: 'GBR',
+ auditId: 'audit-456',
+ details: 'something still not right',
+ }));
+ });
+ });
+
+ describe('#getIdentityProfileReport', () => {
+ it('Should return instance of IdentityProfileReport', () => {
+ const report = advancedIdentityProfileResponse.getIdentityProfileReport();
+ expect(report).toBeInstanceOf(AdvancedIdentityProfileReportResponse);
+ expect(report.getCompliance()).toHaveLength(2);
+ });
+ });
+});
diff --git a/tests/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.scheme.response.spec.js b/tests/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.scheme.response.spec.js
new file mode 100644
index 000000000..9e80c8f9a
--- /dev/null
+++ b/tests/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.scheme.response.spec.js
@@ -0,0 +1,31 @@
+const AdvancedIdentityProfileSchemeResponse = require('../../../../../../src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.scheme.response');
+
+describe('AdvancedIdentityProfileSchemeResponse', () => {
+ let advancedIdentityProfileSchemeResponse;
+
+ beforeEach(() => {
+ advancedIdentityProfileSchemeResponse = new AdvancedIdentityProfileSchemeResponse({
+ type: 'DBS',
+ objective: 'STANDARD',
+ label: 'dbs-standard',
+ });
+ });
+
+ describe('#getType', () => {
+ it('should return type', () => {
+ expect(advancedIdentityProfileSchemeResponse.getType()).toBe('DBS');
+ });
+ });
+
+ describe('#getObjective', () => {
+ it('should return objective', () => {
+ expect(advancedIdentityProfileSchemeResponse.getObjective()).toBe('STANDARD');
+ });
+ });
+
+ describe('#getLabel', () => {
+ it('should return label', () => {
+ expect(advancedIdentityProfileSchemeResponse.getLabel()).toBe('dbs-standard');
+ });
+ });
+});
diff --git a/tests/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.trust.framework.response.spec.js b/tests/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.trust.framework.response.spec.js
new file mode 100644
index 000000000..d46afb42e
--- /dev/null
+++ b/tests/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.trust.framework.response.spec.js
@@ -0,0 +1,67 @@
+const AdvancedIdentityProfileSchemeComplianceResponse = require('../../../../../../src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.scheme.compliance.response');
+const AdvancedIdentityProfileTrustFrameworkResponse = require('../../../../../../src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.trust.framework.response');
+
+describe('AdvancedIdentityProfileTrustFrameworkResponse', () => {
+ let advancedIdentityProfileTrustFrameworkResponse;
+
+ beforeEach(() => {
+ const response = {
+ trust_framework: 'UK_TFIDA',
+ schemes_compliance: [
+ {
+ requirements_met: true,
+ scheme: {
+ type: 'DBS',
+ objective: 'STANDARD',
+ label: 'dbs-standard',
+ },
+ },
+ {
+ requirements_met: false,
+ requirements_not_met_info: 'HORRIBLE_FAILURE',
+ scheme: {
+ type: 'RTW',
+ label: 'some-rtw',
+ },
+ },
+ ],
+ };
+
+ // eslint-disable-next-line max-len
+ advancedIdentityProfileTrustFrameworkResponse = new AdvancedIdentityProfileTrustFrameworkResponse(response);
+ });
+
+ describe('#getTrustFramework', () => {
+ it('should return trust_framework', () => {
+ // eslint-disable-next-line max-len
+ const trustFramework = advancedIdentityProfileTrustFrameworkResponse.getTrustFramework();
+ expect(trustFramework).toBe('UK_TFIDA');
+ });
+ });
+
+ describe('#getSchemesCompliance', () => {
+ it('should return schemes_compliance', () => {
+ // eslint-disable-next-line max-len
+ const schemesCompliance = advancedIdentityProfileTrustFrameworkResponse.getSchemesCompliance();
+ expect(schemesCompliance).toHaveLength(2);
+ expect(schemesCompliance[0]).toBeInstanceOf(AdvancedIdentityProfileSchemeComplianceResponse);
+ expect(schemesCompliance[0]).toEqual(expect.objectContaining({
+ requirementsMet: true,
+ scheme: {
+ label: 'dbs-standard',
+ objective: 'STANDARD',
+ type: 'DBS',
+ },
+ }));
+ expect(schemesCompliance[1]).toBeInstanceOf(AdvancedIdentityProfileSchemeComplianceResponse);
+ expect(schemesCompliance[1]).toEqual(expect.objectContaining({
+ requirementsMet: false,
+ requirementsNotMetInfo: 'HORRIBLE_FAILURE',
+ scheme: {
+ type: 'RTW',
+ label: 'some-rtw',
+ },
+ }));
+ });
+ });
+});
diff --git a/tests/idv_service/session/retrieve/identity.profile.report.response.spec.js b/tests/idv_service/session/retrieve/identity_profile/identity.profile.report.response.spec.js
similarity index 80%
rename from tests/idv_service/session/retrieve/identity.profile.report.response.spec.js
rename to tests/idv_service/session/retrieve/identity_profile/identity.profile.report.response.spec.js
index 79b6eba90..da508a01f 100644
--- a/tests/idv_service/session/retrieve/identity.profile.report.response.spec.js
+++ b/tests/idv_service/session/retrieve/identity_profile/identity.profile.report.response.spec.js
@@ -1,6 +1,6 @@
-const IdentityProfileReportResponse = require('../../../../src/idv_service/session/retrieve/identity.profile.report.response');
-const IdentityProfileReportSchemesComplianceResponse = require('../../../../src/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response');
-const MediaResponse = require('../../../../src/idv_service/session/retrieve/media.response');
+const IdentityProfileReportResponse = require('../../../../../src/idv_service/session/retrieve/identity_profile/identity.profile.report.response');
+const IdentityProfileReportSchemesComplianceResponse = require('../../../../../src/idv_service/session/retrieve/identity_profile/identity.profile.report.schemes.compliance.response');
+const MediaResponse = require('../../../../../src/idv_service/session/retrieve/media.response');
describe('IdentityProfileResponseReport', () => {
let identityProfileReportResponse;
diff --git a/tests/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response.spec.js b/tests/idv_service/session/retrieve/identity_profile/identity.profile.report.schemes.compliance.response.spec.js
similarity index 70%
rename from tests/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response.spec.js
rename to tests/idv_service/session/retrieve/identity_profile/identity.profile.report.schemes.compliance.response.spec.js
index e14fefef9..e7a844965 100644
--- a/tests/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response.spec.js
+++ b/tests/idv_service/session/retrieve/identity_profile/identity.profile.report.schemes.compliance.response.spec.js
@@ -1,4 +1,5 @@
-const IdentityProfileReportSchemesComplianceResponse = require('../../../../src/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response');
+const IdentityProfileReportSchemesComplianceResponse = require('../../../../../src/idv_service/session/retrieve/identity_profile/identity.profile.report.schemes.compliance.response');
+const IdentityProfileSchemeResponse = require('../../../../../src/idv_service/session/retrieve/identity_profile/identity.profile.scheme.response');
describe('IdentityProfileReportSchemesComplianceResponse', () => {
let identityProfileReportSchemesComplianceResponse;
@@ -17,7 +18,9 @@ describe('IdentityProfileReportSchemesComplianceResponse', () => {
describe('#getScheme', () => {
it('Should return scheme object', () => {
- expect(identityProfileReportSchemesComplianceResponse.getScheme()).toMatchObject({
+ const scheme = identityProfileReportSchemesComplianceResponse.getScheme();
+ expect(scheme).toBeInstanceOf(IdentityProfileSchemeResponse);
+ expect(scheme).toMatchObject({
type: 'DBS',
objective: 'STANDARD',
});
diff --git a/tests/idv_service/session/retrieve/identity.profile.requirement.not.met.detail.response.spec.js b/tests/idv_service/session/retrieve/identity_profile/identity.profile.requirement.not.met.detail.response.spec.js
similarity index 93%
rename from tests/idv_service/session/retrieve/identity.profile.requirement.not.met.detail.response.spec.js
rename to tests/idv_service/session/retrieve/identity_profile/identity.profile.requirement.not.met.detail.response.spec.js
index 87b7d7919..75d3ed492 100644
--- a/tests/idv_service/session/retrieve/identity.profile.requirement.not.met.detail.response.spec.js
+++ b/tests/idv_service/session/retrieve/identity_profile/identity.profile.requirement.not.met.detail.response.spec.js
@@ -1,4 +1,4 @@
-const IdentityProfileRequirementsNotMetDetailResponse = require('../../../../src/idv_service/session/retrieve/identity.profile.requirements.not.met.detail.response');
+const IdentityProfileRequirementsNotMetDetailResponse = require('../../../../../src/idv_service/session/retrieve/identity_profile/identity.profile.requirements.not.met.detail.response');
describe('IdentityProfileRequirementsNotMetDetailResponse', () => {
let requirementsNotMetDetailResponse;
diff --git a/tests/idv_service/session/retrieve/identity.profile.response.spec.js b/tests/idv_service/session/retrieve/identity_profile/identity.profile.response.spec.js
similarity index 86%
rename from tests/idv_service/session/retrieve/identity.profile.response.spec.js
rename to tests/idv_service/session/retrieve/identity_profile/identity.profile.response.spec.js
index 850dc6a7b..4171a2e0c 100644
--- a/tests/idv_service/session/retrieve/identity.profile.response.spec.js
+++ b/tests/idv_service/session/retrieve/identity_profile/identity.profile.response.spec.js
@@ -1,7 +1,7 @@
-const IdentityProfileResponse = require('../../../../src/idv_service/session/retrieve/identity.profile.response');
-const IdentityProfileReportResponse = require('../../../../src/idv_service/session/retrieve/identity.profile.report.response');
-const IdentityProfileFailureReasonResponse = require('../../../../src/idv_service/session/retrieve/identity.profile.failure.reason.response');
-const IdentityProfileRequirementsNotMetDetailResponse = require('../../../../src/idv_service/session/retrieve/identity.profile.requirements.not.met.detail.response');
+const IdentityProfileResponse = require('../../../../../src/idv_service/session/retrieve/identity_profile/identity.profile.response');
+const IdentityProfileReportResponse = require('../../../../../src/idv_service/session/retrieve/identity_profile/identity.profile.report.response');
+const IdentityProfileFailureReasonResponse = require('../../../../../src/idv_service/session/retrieve/identity_profile/identity.profile.failure.reason.response');
+const IdentityProfileRequirementsNotMetDetailResponse = require('../../../../../src/idv_service/session/retrieve/identity_profile/identity.profile.requirements.not.met.detail.response');
describe('IdentityProfileResponse', () => {
let identityProfileResponse;
diff --git a/tests/idv_service/session/retrieve/identity_profile/identity.profile.scheme.response.spec.js b/tests/idv_service/session/retrieve/identity_profile/identity.profile.scheme.response.spec.js
new file mode 100644
index 000000000..af0c9a00f
--- /dev/null
+++ b/tests/idv_service/session/retrieve/identity_profile/identity.profile.scheme.response.spec.js
@@ -0,0 +1,24 @@
+const IdentityProfileSchemeResponse = require('../../../../../src/idv_service/session/retrieve/identity_profile/identity.profile.scheme.response');
+
+describe('IdentityProfileSchemeResponse', () => {
+ let identityProfileSchemeResponse;
+
+ beforeEach(() => {
+ identityProfileSchemeResponse = new IdentityProfileSchemeResponse({
+ type: 'DBS',
+ objective: 'STANDARD',
+ });
+ });
+
+ describe('#getType', () => {
+ it('should return type', () => {
+ expect(identityProfileSchemeResponse.getType()).toBe('DBS');
+ });
+ });
+
+ describe('#getObjective', () => {
+ it('should return objective', () => {
+ expect(identityProfileSchemeResponse.getObjective()).toBe('STANDARD');
+ });
+ });
+});
diff --git a/types/index.d.ts b/types/index.d.ts
index 0b9dfa54d..36bf13b03 100644
--- a/types/index.d.ts
+++ b/types/index.d.ts
@@ -50,10 +50,14 @@ import { RequestedSearchProfileSourcesBuilder } from "./src/idv_service";
import { RequestedTypeListSourcesBuilder } from "./src/idv_service";
import { CreateFaceCaptureResourcePayloadBuilder } from "./src/idv_service";
import { UploadFaceCaptureImagePayloadBuilder } from "./src/idv_service";
+import { AdvancedIdentityProfileSchemeConfigBuilder } from "./src/idv_service";
+import { AdvancedIdentityProfileBuilder } from "./src/idv_service";
+import { AdvancedIdentityProfileSchemeBuilder } from "./src/idv_service";
+import { AdvancedIdentityProfileRequirementsBuilder } from "./src/idv_service";
export declare namespace internals {
export { IDVService };
export { YotiCommon };
export { YotiRequest };
export { IDVError };
}
-export { YotiClient as Client, IDVClient, DigitalIdentityClient, IDVConstants, AmlAddress, AmlProfile, DigitalIdentityBuilders, DynamicScenarioBuilder, DynamicPolicyBuilder, WantedAttributeBuilder, ExtensionBuilder, LocationConstraintExtensionBuilder, ThirdPartyAttributeExtensionBuilder, TransactionalFlowExtensionBuilder, WantedAnchorBuilder, ConstraintsBuilder, SourceConstraintBuilder, RequestBuilder, Payload, YotiDate, constants, SessionSpecificationBuilder, NotificationConfigBuilder, SdkConfigBuilder, RequestedDocumentAuthenticityCheckBuilder, RequestedIdDocumentComparisonCheckBuilder, RequestedThirdPartyIdentityCheckBuilder, RequestedWatchlistScreeningCheckBuilder, RequestedWatchlistAdvancedCaCheckBuilder, RequestedFaceMatchCheckBuilder, RequestedFaceComparisonCheckBuilder, RequestedLivenessCheckBuilder, RequestedTextExtractionTaskBuilder, RequestedSupplementaryDocTextExtractionTaskBuilder, RequiredIdDocumentBuilder, RequiredSupplementaryDocumentBuilder, DocumentRestrictionsFilterBuilder, DocumentRestrictionBuilder, OrthogonalRestrictionsFilterBuilder, ProofOfAddressObjectiveBuilder, RequestedCustomAccountWatchlistAdvancedCaConfigBuilder, RequestedYotiAccountWatchlistAdvancedCaConfigBuilder, RequestedExactMatchingStrategyBuilder, RequestedFuzzyMatchingStrategyBuilder, RequestedSearchProfileSourcesBuilder, RequestedTypeListSourcesBuilder, CreateFaceCaptureResourcePayloadBuilder, UploadFaceCaptureImagePayloadBuilder };
+export { YotiClient as Client, IDVClient, DigitalIdentityClient, IDVConstants, AmlAddress, AmlProfile, DigitalIdentityBuilders, DynamicScenarioBuilder, DynamicPolicyBuilder, WantedAttributeBuilder, ExtensionBuilder, LocationConstraintExtensionBuilder, ThirdPartyAttributeExtensionBuilder, TransactionalFlowExtensionBuilder, WantedAnchorBuilder, ConstraintsBuilder, SourceConstraintBuilder, RequestBuilder, Payload, YotiDate, constants, SessionSpecificationBuilder, NotificationConfigBuilder, SdkConfigBuilder, RequestedDocumentAuthenticityCheckBuilder, RequestedIdDocumentComparisonCheckBuilder, RequestedThirdPartyIdentityCheckBuilder, RequestedWatchlistScreeningCheckBuilder, RequestedWatchlistAdvancedCaCheckBuilder, RequestedFaceMatchCheckBuilder, RequestedFaceComparisonCheckBuilder, RequestedLivenessCheckBuilder, RequestedTextExtractionTaskBuilder, RequestedSupplementaryDocTextExtractionTaskBuilder, RequiredIdDocumentBuilder, RequiredSupplementaryDocumentBuilder, DocumentRestrictionsFilterBuilder, DocumentRestrictionBuilder, OrthogonalRestrictionsFilterBuilder, ProofOfAddressObjectiveBuilder, RequestedCustomAccountWatchlistAdvancedCaConfigBuilder, RequestedYotiAccountWatchlistAdvancedCaConfigBuilder, RequestedExactMatchingStrategyBuilder, RequestedFuzzyMatchingStrategyBuilder, RequestedSearchProfileSourcesBuilder, RequestedTypeListSourcesBuilder, CreateFaceCaptureResourcePayloadBuilder, UploadFaceCaptureImagePayloadBuilder, AdvancedIdentityProfileSchemeConfigBuilder, AdvancedIdentityProfileBuilder, AdvancedIdentityProfileSchemeBuilder, AdvancedIdentityProfileRequirementsBuilder };
diff --git a/types/src/idv_service/index.d.ts b/types/src/idv_service/index.d.ts
index 137906650..57a80e2aa 100644
--- a/types/src/idv_service/index.d.ts
+++ b/types/src/idv_service/index.d.ts
@@ -27,4 +27,8 @@ import RequestedSearchProfileSourcesBuilder = require("./session/create/check/re
import RequestedTypeListSourcesBuilder = require("./session/create/check/requested.type.list.sources.builder");
import CreateFaceCaptureResourcePayloadBuilder = require("./session/create/face_capture/create.face.capture.resource.payload.builder");
import UploadFaceCaptureImagePayloadBuilder = require("./session/create/face_capture/upload.face.capture.image.payload.builder");
-export { IDVService, IDVConstants, SessionSpecificationBuilder, NotificationConfigBuilder, SdkConfigBuilder, RequestedDocumentAuthenticityCheckBuilder, RequestedIdDocumentComparisonCheckBuilder, RequestedThirdPartyIdentityCheckBuilder, RequestedWatchlistScreeningCheckBuilder, RequestedWatchlistAdvancedCaCheckBuilder, RequestedFaceMatchCheckBuilder, RequestedFaceComparisonCheckBuilder, RequestedLivenessCheckBuilder, RequestedTextExtractionTaskBuilder, RequestedSupplementaryDocTextExtractionTaskBuilder, RequiredIdDocumentBuilder, RequiredSupplementaryDocumentBuilder, DocumentRestrictionsFilterBuilder, DocumentRestrictionBuilder, OrthogonalRestrictionsFilterBuilder, ProofOfAddressObjectiveBuilder, RequestedYotiAccountWatchlistAdvancedCaConfigBuilder, RequestedCustomAccountWatchlistAdvancedCaConfigBuilder, RequestedExactMatchingStrategyBuilder, RequestedFuzzyMatchingStrategyBuilder, RequestedSearchProfileSourcesBuilder, RequestedTypeListSourcesBuilder, CreateFaceCaptureResourcePayloadBuilder, UploadFaceCaptureImagePayloadBuilder };
+import AdvancedIdentityProfileBuilder = require("./session/create/identity_profile/advanced/advanced.identity.profile.builder");
+import AdvancedIdentityProfileSchemeBuilder = require("./session/create/identity_profile/advanced/advanced.identity.profile.scheme.builder");
+import AdvancedIdentityProfileRequirementsBuilder = require("./session/create/identity_profile/advanced/advanced.identity.profile.requirements.builder");
+import AdvancedIdentityProfileSchemeConfigBuilder = require("./session/create/identity_profile/advanced/advanced.identity.profile.scheme.config");
+export { IDVService, IDVConstants, SessionSpecificationBuilder, NotificationConfigBuilder, SdkConfigBuilder, RequestedDocumentAuthenticityCheckBuilder, RequestedIdDocumentComparisonCheckBuilder, RequestedThirdPartyIdentityCheckBuilder, RequestedWatchlistScreeningCheckBuilder, RequestedWatchlistAdvancedCaCheckBuilder, RequestedFaceMatchCheckBuilder, RequestedFaceComparisonCheckBuilder, RequestedLivenessCheckBuilder, RequestedTextExtractionTaskBuilder, RequestedSupplementaryDocTextExtractionTaskBuilder, RequiredIdDocumentBuilder, RequiredSupplementaryDocumentBuilder, DocumentRestrictionsFilterBuilder, DocumentRestrictionBuilder, OrthogonalRestrictionsFilterBuilder, ProofOfAddressObjectiveBuilder, RequestedYotiAccountWatchlistAdvancedCaConfigBuilder, RequestedCustomAccountWatchlistAdvancedCaConfigBuilder, RequestedExactMatchingStrategyBuilder, RequestedFuzzyMatchingStrategyBuilder, RequestedSearchProfileSourcesBuilder, RequestedTypeListSourcesBuilder, CreateFaceCaptureResourcePayloadBuilder, UploadFaceCaptureImagePayloadBuilder, AdvancedIdentityProfileBuilder, AdvancedIdentityProfileSchemeBuilder, AdvancedIdentityProfileRequirementsBuilder, AdvancedIdentityProfileSchemeConfigBuilder };
diff --git a/types/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.builder.d.ts b/types/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.builder.d.ts
new file mode 100644
index 000000000..c67bed7ad
--- /dev/null
+++ b/types/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.builder.d.ts
@@ -0,0 +1,23 @@
+export = AdvancedIdentityProfileBuilder;
+declare class AdvancedIdentityProfileBuilder {
+ /** @private {AdvancedIdentityProfileScheme[]} */
+ private schemes;
+ /**
+ * @param {string} trustFramework
+ * @returns {AdvancedIdentityProfileBuilder}
+ */
+ withTrustFramework(trustFramework: string): AdvancedIdentityProfileBuilder;
+ /** @private {string} */
+ private trustFramework;
+ /**
+ * @param {AdvancedIdentityProfileScheme} scheme
+ * @returns {AdvancedIdentityProfileBuilder}
+ */
+ withScheme(scheme: AdvancedIdentityProfileScheme): AdvancedIdentityProfileBuilder;
+ /**
+ * @returns {AdvancedIdentityProfile}
+ */
+ build(): AdvancedIdentityProfile;
+}
+import AdvancedIdentityProfileScheme = require("./advanced.identity.profile.scheme");
+import AdvancedIdentityProfile = require("./advanced.identity.profile");
diff --git a/types/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.d.ts b/types/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.d.ts
new file mode 100644
index 000000000..04db2fb39
--- /dev/null
+++ b/types/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.d.ts
@@ -0,0 +1,17 @@
+export = AdvancedIdentityProfile;
+declare class AdvancedIdentityProfile {
+ /**
+ * @param {string} trustFramework
+ * @param {AdvancedIdentityProfileScheme[]} schemes
+ */
+ constructor(trustFramework: string, schemes: AdvancedIdentityProfileScheme[]);
+ /** @private {string} */
+ private trustFramework;
+ /** @private {AdvancedIdentityProfileScheme[]} */
+ private schemes;
+ toJSON(): {
+ trust_framework: string;
+ schemes: AdvancedIdentityProfileScheme[];
+ };
+}
+import AdvancedIdentityProfileScheme = require("./advanced.identity.profile.scheme");
diff --git a/types/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.requirements.builder.d.ts b/types/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.requirements.builder.d.ts
new file mode 100644
index 000000000..9080f78ec
--- /dev/null
+++ b/types/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.requirements.builder.d.ts
@@ -0,0 +1,16 @@
+export = AdvancedIdentityProfileRequirementsBuilder;
+declare class AdvancedIdentityProfileRequirementsBuilder {
+ /** @private {AdvancedIdentityProfile[]} */
+ private profiles;
+ /**
+ * @param {AdvancedIdentityProfile} profile
+ * @returns {AdvancedIdentityProfileRequirementsBuilder}
+ */
+ withProfile(profile: AdvancedIdentityProfile): AdvancedIdentityProfileRequirementsBuilder;
+ /**
+ * @returns {AdvancedIdentityProfileRequirements}
+ */
+ build(): AdvancedIdentityProfileRequirements;
+}
+import AdvancedIdentityProfile = require("./advanced.identity.profile");
+import AdvancedIdentityProfileRequirements = require("./advanced.identity.profile.requirements");
diff --git a/types/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.requirements.d.ts b/types/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.requirements.d.ts
new file mode 100644
index 000000000..728bd05d8
--- /dev/null
+++ b/types/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.requirements.d.ts
@@ -0,0 +1,9 @@
+export = AdvancedIdentityProfileRequirements;
+declare class AdvancedIdentityProfileRequirements {
+ /**
+ * @param {AdvancedIdentityProfile[]} profiles
+ */
+ constructor(profiles: AdvancedIdentityProfile[]);
+ profiles: AdvancedIdentityProfile[];
+}
+import AdvancedIdentityProfile = require("./advanced.identity.profile");
diff --git a/types/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.builder.d.ts b/types/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.builder.d.ts
new file mode 100644
index 000000000..96c9b6345
--- /dev/null
+++ b/types/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.builder.d.ts
@@ -0,0 +1,33 @@
+export = AdvancedIdentityProfileSchemeBuilder;
+declare class AdvancedIdentityProfileSchemeBuilder {
+ /**
+ * @param {string} type
+ * @returns {AdvancedIdentityProfileSchemeBuilder}
+ */
+ withType(type: string): AdvancedIdentityProfileSchemeBuilder;
+ type: string;
+ /**
+ * @param {string} objective
+ * @returns {AdvancedIdentityProfileSchemeBuilder}
+ */
+ withObjective(objective: string): AdvancedIdentityProfileSchemeBuilder;
+ objective: string;
+ /**
+ * @param {string} label
+ * @returns {AdvancedIdentityProfileSchemeBuilder}
+ */
+ withLabel(label: string): AdvancedIdentityProfileSchemeBuilder;
+ label: string;
+ /**
+ * @param {AdvancedIdentityProfileSchemeConfig} config
+ * @returns {AdvancedIdentityProfileSchemeBuilder}
+ */
+ withConfig(config: AdvancedIdentityProfileSchemeConfig): AdvancedIdentityProfileSchemeBuilder;
+ config: AdvancedIdentityProfileSchemeConfig;
+ /**
+ * @returns {AdvancedIdentityProfileScheme}
+ */
+ build(): AdvancedIdentityProfileScheme;
+}
+import AdvancedIdentityProfileSchemeConfig = require("./advanced.identity.profile.scheme.config");
+import AdvancedIdentityProfileScheme = require("./advanced.identity.profile.scheme");
diff --git a/types/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.config.d.ts b/types/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.config.d.ts
new file mode 100644
index 000000000..bb6ec5d7a
--- /dev/null
+++ b/types/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.config.d.ts
@@ -0,0 +1,12 @@
+export = AdvancedIdentityProfileSchemeConfig;
+declare class AdvancedIdentityProfileSchemeConfig {
+ /**
+ * @param {DocumentFilter} filter
+ */
+ constructor(filter: DocumentFilter);
+ filter: DocumentFilter;
+ toJSON(): {
+ filter: DocumentFilter;
+ };
+}
+import DocumentFilter = require("../../filters/document.filter");
diff --git a/types/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.d.ts b/types/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.d.ts
new file mode 100644
index 000000000..48695565e
--- /dev/null
+++ b/types/src/idv_service/session/create/identity_profile/advanced/advanced.identity.profile.scheme.d.ts
@@ -0,0 +1,21 @@
+export = AdvancedIdentityProfileScheme;
+declare class AdvancedIdentityProfileScheme {
+ /**
+ * @param {string} type
+ * @param {string} objective
+ * @param {string} label
+ * @param {AdvancedIdentityProfileSchemeConfig} [config]
+ */
+ constructor(type: string, objective: string, label: string, config?: AdvancedIdentityProfileSchemeConfig);
+ type: string;
+ objective: string;
+ label: string;
+ config: AdvancedIdentityProfileSchemeConfig;
+ toJSON(): {
+ type: string;
+ objective: string;
+ label: string;
+ config: AdvancedIdentityProfileSchemeConfig;
+ };
+}
+import AdvancedIdentityProfileSchemeConfig = require("./advanced.identity.profile.scheme.config");
diff --git a/types/src/idv_service/session/create/session.specification.builder.d.ts b/types/src/idv_service/session/create/session.specification.builder.d.ts
index 49d131e9d..b5c4526e6 100644
--- a/types/src/idv_service/session/create/session.specification.builder.d.ts
+++ b/types/src/idv_service/session/create/session.specification.builder.d.ts
@@ -106,6 +106,8 @@ declare class SessionSpecificationBuilder {
subject: any;
withIdentityProfileRequirements(identityProfileRequirements: any): this;
identityProfileRequirements: any;
+ withAdvancedIdentityProfileRequirements(advancedIdentityProfileRequirements: any): this;
+ advancedIdentityProfileRequirements: any;
/**
* Builds the {@link SessionSpecification} based on the values supplied to the builder
*
diff --git a/types/src/idv_service/session/create/session.specification.d.ts b/types/src/idv_service/session/create/session.specification.d.ts
index ce84f5566..83577333f 100644
--- a/types/src/idv_service/session/create/session.specification.d.ts
+++ b/types/src/idv_service/session/create/session.specification.d.ts
@@ -26,11 +26,12 @@ declare class SessionSpecification {
* Sets whether or not to block the collection of biometric consent
* @param {Date} sessionDeadline
* The deadline that the session needs to be completed by
- * @param {object} identityProfileRequirements
- * @param {object} subject
+ * @param {object} [identityProfileRequirements]
+ * @param {object} [subject]
* Information about the subject of the session
+ * @param {AdvancedIdentityProfileRequirements} [advancedIdentityProfileRequirements]
*/
- constructor(clientSessionTokenTtl: number, resourcesTtl: number, userTrackingId: string, notifications: NotificationConfig, requestedChecks: RequestedCheck[], requestedTasks: RequestedTask[], sdkConfig: SdkConfig, requiredDocuments: RequiredDocument[], blockBiometricConsent: boolean, sessionDeadline: Date, identityProfileRequirements: object, subject: object);
+ constructor(clientSessionTokenTtl: number, resourcesTtl: number, userTrackingId: string, notifications: NotificationConfig, requestedChecks: RequestedCheck[], requestedTasks: RequestedTask[], sdkConfig: SdkConfig, requiredDocuments: RequiredDocument[], blockBiometricConsent: boolean, sessionDeadline: Date, identityProfileRequirements?: object, subject?: object, advancedIdentityProfileRequirements?: AdvancedIdentityProfileRequirements);
/** @private */
private clientSessionTokenTtl;
/** @private */
@@ -46,6 +47,8 @@ declare class SessionSpecification {
/** @private */
private identityProfileRequirements;
/** @private */
+ private advancedIdentityProfileRequirements;
+ /** @private */
private subject;
/** @private */
private requestedChecks;
@@ -71,6 +74,7 @@ declare class SessionSpecification {
block_biometric_consent: boolean;
identity_profile_requirements: any;
subject: any;
+ advanced_identity_profile_requirements: AdvancedIdentityProfileRequirements;
};
}
import NotificationConfig = require("./notification.config");
@@ -78,3 +82,4 @@ import RequestedCheck = require("./check/requested.check");
import RequestedTask = require("./task/requested.task");
import SdkConfig = require("./sdk.config");
import RequiredDocument = require("./filters/required.document");
+import AdvancedIdentityProfileRequirements = require("./identity_profile/advanced/advanced.identity.profile.requirements");
diff --git a/types/src/idv_service/session/retrieve/get.session.result.d.ts b/types/src/idv_service/session/retrieve/get.session.result.d.ts
index 3e77a54c1..f9a2b2b5b 100644
--- a/types/src/idv_service/session/retrieve/get.session.result.d.ts
+++ b/types/src/idv_service/session/retrieve/get.session.result.d.ts
@@ -19,6 +19,8 @@ declare class GetSessionResult {
private biometricConsent;
/** @private */
private identityProfile;
+ /** @private */
+ private advancedIdentityProfile;
/**
* @returns {string}
*/
@@ -105,6 +107,10 @@ declare class GetSessionResult {
* @returns {IdentityProfileResponse}
*/
getIdentityProfile(): IdentityProfileResponse;
+ /**
+ * @returns {AdvancedIdentityProfileResponse}
+ */
+ getAdvancedIdentityProfile(): AdvancedIdentityProfileResponse;
}
import CheckResponse = require("./check.response");
import AuthenticityCheckResponse = require("./authenticity.check.response");
@@ -120,4 +126,5 @@ import ThirdPartyIdentityFraud1CheckResponse = require("./third.party.identity.f
import FaceComparisonCheckResponse = require("./face.comparison.check.response");
import ResourceContainer = require("./resource.container");
import { YotiDate } from "../../../data_type/date";
-import IdentityProfileResponse = require("./identity.profile.response");
+import IdentityProfileResponse = require("./identity_profile/identity.profile.response");
+import AdvancedIdentityProfileResponse = require("./identity_profile/advanced/advanced.identity.profile.response");
diff --git a/types/src/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response.d.ts b/types/src/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response.d.ts
deleted file mode 100644
index efac4284b..000000000
--- a/types/src/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response.d.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-export = IdentityProfileReportSchemesComplianceResponse;
-declare class IdentityProfileReportSchemesComplianceResponse {
- constructor(schemesCompliance: any);
- /** @private */
- private scheme;
- /** @private @type {boolean} */
- private requirementsMet;
- /** @private @type {string|undefined} */
- private requirementsNotMetInfo;
- /**
- * @returns {object}
- */
- getScheme(): object;
- isRequirementsMet(): boolean;
- getRequirementsNotMetInfo(): string;
-}
diff --git a/types/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.response.d.ts b/types/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.response.d.ts
new file mode 100644
index 000000000..091105c3a
--- /dev/null
+++ b/types/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.response.d.ts
@@ -0,0 +1,18 @@
+export = AdvancedIdentityProfileReportResponse;
+declare class AdvancedIdentityProfileReportResponse {
+ constructor(report: any);
+ /** @private {AdvancedIdentityProfileTrustFrameworkResponse[]} */
+ private compliance;
+ /** @private {MediaResponse} */
+ private media;
+ /**
+ * @returns {AdvancedIdentityProfileTrustFrameworkResponse[]}
+ */
+ getCompliance(): AdvancedIdentityProfileTrustFrameworkResponse[];
+ /**
+ * @returns {MediaResponse}
+ */
+ getMedia(): MediaResponse;
+}
+import AdvancedIdentityProfileTrustFrameworkResponse = require("./advanced.identity.profile.trust.framework.response");
+import MediaResponse = require("../../media.response");
diff --git a/types/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.scheme.compliance.response.d.ts b/types/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.scheme.compliance.response.d.ts
new file mode 100644
index 000000000..a58341866
--- /dev/null
+++ b/types/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.report.scheme.compliance.response.d.ts
@@ -0,0 +1,24 @@
+export = AdvancedIdentityProfileSchemeComplianceResponse;
+declare class AdvancedIdentityProfileSchemeComplianceResponse {
+ constructor(schemesCompliance: any);
+ /** @private {AdvancedIdentityProfileSchemeResponse} */
+ private scheme;
+ /** @private {boolean} */
+ private requirementsMet;
+ /** @private {string|undefined} */
+ private requirementsNotMetInfo;
+ /**
+ * @returns {AdvancedIdentityProfileSchemeResponse}
+ */
+ getScheme(): AdvancedIdentityProfileSchemeResponse;
+ /**
+ * @returns {boolean}
+ */
+ getRequirementsMet(): boolean;
+ /**
+ *
+ * @returns {string|undefined}
+ */
+ getRequirementsNotMetInfo(): string | undefined;
+}
+import AdvancedIdentityProfileSchemeResponse = require("./advanced.identity.profile.scheme.response");
diff --git a/types/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.response.d.ts b/types/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.response.d.ts
new file mode 100644
index 000000000..a36549737
--- /dev/null
+++ b/types/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.response.d.ts
@@ -0,0 +1,30 @@
+export = AdvancedIdentityProfileResponse;
+declare class AdvancedIdentityProfileResponse {
+ constructor(response: any);
+ /** @private {string} */
+ private subjectId;
+ /** @private {string} */
+ private result;
+ /** @private {IdentityProfileFailureReasonResponse} */
+ private failureReason;
+ /** @private {AdvancedIdentityProfileReportResponse} */
+ private identityProfileReport;
+ /**
+ * @returns {string}
+ */
+ getSubjectId(): string;
+ /**
+ * @returns {string}
+ */
+ getResult(): string;
+ /**
+ * @returns {IdentityProfileFailureReasonResponse|undefined}
+ */
+ getFailureReason(): IdentityProfileFailureReasonResponse | undefined;
+ /**
+ * @returns {AdvancedIdentityProfileReportResponse|undefined}
+ */
+ getIdentityProfileReport(): AdvancedIdentityProfileReportResponse | undefined;
+}
+import IdentityProfileFailureReasonResponse = require("../identity.profile.failure.reason.response");
+import AdvancedIdentityProfileReportResponse = require("./advanced.identity.profile.report.response");
diff --git a/types/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.scheme.response.d.ts b/types/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.scheme.response.d.ts
new file mode 100644
index 000000000..710a88e2b
--- /dev/null
+++ b/types/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.scheme.response.d.ts
@@ -0,0 +1,22 @@
+export = AdvancedIdentityProfileSchemeResponse;
+declare class AdvancedIdentityProfileSchemeResponse {
+ constructor(scheme: any);
+ /** @private {string} */
+ private type;
+ /** @private {string} */
+ private objective;
+ /** @private {string} */
+ private label;
+ /**
+ * @returns {string}
+ */
+ getType(): string;
+ /**
+ * @returns {string}
+ */
+ getObjective(): string;
+ /**
+ * @returns {string}
+ */
+ getLabel(): string;
+}
diff --git a/types/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.trust.framework.response.d.ts b/types/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.trust.framework.response.d.ts
new file mode 100644
index 000000000..27f7e4834
--- /dev/null
+++ b/types/src/idv_service/session/retrieve/identity_profile/advanced/advanced.identity.profile.trust.framework.response.d.ts
@@ -0,0 +1,17 @@
+export = AdvancedIdentityProfileTrustFrameworkResponse;
+declare class AdvancedIdentityProfileTrustFrameworkResponse {
+ constructor(trustFrameworkCompliance: any);
+ /** @private {string} */
+ private trustFramework;
+ /** @private {AdvancedIdentityProfileSchemeComplianceResponse[]} */
+ private schemesCompliance;
+ /**
+ * @returns {string}
+ */
+ getTrustFramework(): string;
+ /**
+ * @returns {AdvancedIdentityProfileSchemeComplianceResponse[]}
+ */
+ getSchemesCompliance(): AdvancedIdentityProfileSchemeComplianceResponse[];
+}
+import AdvancedIdentityProfileSchemeComplianceResponse = require("./advanced.identity.profile.report.scheme.compliance.response");
diff --git a/types/src/idv_service/session/retrieve/identity.profile.failure.reason.response.d.ts b/types/src/idv_service/session/retrieve/identity_profile/identity.profile.failure.reason.response.d.ts
similarity index 66%
rename from types/src/idv_service/session/retrieve/identity.profile.failure.reason.response.d.ts
rename to types/src/idv_service/session/retrieve/identity_profile/identity.profile.failure.reason.response.d.ts
index 8d7e56144..7cf471e2b 100644
--- a/types/src/idv_service/session/retrieve/identity.profile.failure.reason.response.d.ts
+++ b/types/src/idv_service/session/retrieve/identity_profile/identity.profile.failure.reason.response.d.ts
@@ -1,11 +1,17 @@
export = IdentityProfileFailureReasonResponse;
declare class IdentityProfileFailureReasonResponse {
constructor(failureReason: any);
- /** @private @type {string} */
+ /** @private {string} */
private reasonCode;
- /** @private @type {IdentityProfileRequirementsNotMetDetailResponse[]} */
+ /** @private {IdentityProfileRequirementsNotMetDetailResponse[]} */
private requirementsNotMetDetails;
+ /**
+ * @returns {string}
+ */
getReasonCode(): string;
+ /**
+ * @returns {IdentityProfileRequirementsNotMetDetailResponse[]}
+ */
getRequirementsNotMetDetails(): IdentityProfileRequirementsNotMetDetailResponse[];
}
import IdentityProfileRequirementsNotMetDetailResponse = require("./identity.profile.requirements.not.met.detail.response");
diff --git a/types/src/idv_service/session/retrieve/identity.profile.report.response.d.ts b/types/src/idv_service/session/retrieve/identity_profile/identity.profile.report.response.d.ts
similarity index 76%
rename from types/src/idv_service/session/retrieve/identity.profile.report.response.d.ts
rename to types/src/idv_service/session/retrieve/identity_profile/identity.profile.report.response.d.ts
index 062844c77..441ddb540 100644
--- a/types/src/idv_service/session/retrieve/identity.profile.report.response.d.ts
+++ b/types/src/idv_service/session/retrieve/identity_profile/identity.profile.report.response.d.ts
@@ -1,11 +1,11 @@
export = IdentityProfileReportResponse;
declare class IdentityProfileReportResponse {
constructor(report: any);
- /** @private */
+ /** @private {string} */
private trustFramework;
- /** @private */
+ /** @private {IdentityProfileReportSchemesComplianceResponse[]} */
private schemesCompliance;
- /** @private */
+ /** @private {MediaResponse} */
private media;
/**
* @returns {string}
@@ -21,4 +21,4 @@ declare class IdentityProfileReportResponse {
getMedia(): MediaResponse;
}
import IdentityProfileReportSchemesComplianceResponse = require("./identity.profile.report.schemes.compliance.response");
-import MediaResponse = require("./media.response");
+import MediaResponse = require("../media.response");
diff --git a/types/src/idv_service/session/retrieve/identity_profile/identity.profile.report.schemes.compliance.response.d.ts b/types/src/idv_service/session/retrieve/identity_profile/identity.profile.report.schemes.compliance.response.d.ts
new file mode 100644
index 000000000..09c31a6be
--- /dev/null
+++ b/types/src/idv_service/session/retrieve/identity_profile/identity.profile.report.schemes.compliance.response.d.ts
@@ -0,0 +1,23 @@
+export = IdentityProfileReportSchemesComplianceResponse;
+declare class IdentityProfileReportSchemesComplianceResponse {
+ constructor(schemesCompliance: any);
+ /** @private {IdentityProfileSchemeResponse} */
+ private scheme;
+ /** @private {boolean} */
+ private requirementsMet;
+ /** @private {string|undefined} */
+ private requirementsNotMetInfo;
+ /**
+ * @returns {IdentityProfileSchemeResponse}
+ */
+ getScheme(): IdentityProfileSchemeResponse;
+ /**
+ * @returns {boolean}
+ */
+ isRequirementsMet(): boolean;
+ /**
+ * @returns {string|undefined}
+ */
+ getRequirementsNotMetInfo(): string | undefined;
+}
+import IdentityProfileSchemeResponse = require("./identity.profile.scheme.response");
diff --git a/types/src/idv_service/session/retrieve/identity.profile.requirements.not.met.detail.response.d.ts b/types/src/idv_service/session/retrieve/identity_profile/identity.profile.requirements.not.met.detail.response.d.ts
similarity index 50%
rename from types/src/idv_service/session/retrieve/identity.profile.requirements.not.met.detail.response.d.ts
rename to types/src/idv_service/session/retrieve/identity_profile/identity.profile.requirements.not.met.detail.response.d.ts
index e015f1370..596526102 100644
--- a/types/src/idv_service/session/retrieve/identity.profile.requirements.not.met.detail.response.d.ts
+++ b/types/src/idv_service/session/retrieve/identity_profile/identity.profile.requirements.not.met.detail.response.d.ts
@@ -1,19 +1,34 @@
export = IdentityProfileRequirementsNotMetDetailResponse;
declare class IdentityProfileRequirementsNotMetDetailResponse {
constructor(requirementsNotMetDetail: any);
- /** @private @type {string} */
+ /** @private {string} */
private failureType;
- /** @private @type {string} */
+ /** @private {string|undefined} */
private documentType;
- /** @private @type {string} */
+ /** @private {string|undefined} */
private documentCountryIsoCode;
- /** @private @type {string|undefined} */
+ /** @private {string|undefined} */
private auditId;
- /** @private @type {string} */
+ /** @private {string} */
private details;
+ /**
+ * @returns {string}
+ */
getFailureType(): string;
+ /**
+ * @returns {string}
+ */
getDocumentType(): string;
+ /**
+ * @returns {string}
+ */
getDocumentCountryIsoCode(): string;
- getAuditId(): string;
+ /**
+ * @returns {string|undefined}
+ */
+ getAuditId(): string | undefined;
+ /**
+ * @returns {string}
+ */
getDetails(): string;
}
diff --git a/types/src/idv_service/session/retrieve/identity.profile.response.d.ts b/types/src/idv_service/session/retrieve/identity_profile/identity.profile.response.d.ts
similarity index 54%
rename from types/src/idv_service/session/retrieve/identity.profile.response.d.ts
rename to types/src/idv_service/session/retrieve/identity_profile/identity.profile.response.d.ts
index afa66d2af..c806a2ddc 100644
--- a/types/src/idv_service/session/retrieve/identity.profile.response.d.ts
+++ b/types/src/idv_service/session/retrieve/identity_profile/identity.profile.response.d.ts
@@ -1,13 +1,13 @@
export = IdentityProfileResponse;
declare class IdentityProfileResponse {
constructor(identityProfile: any);
- /** @private */
+ /** @private {string|undefined} */
private subjectId;
- /** @private */
+ /** @private {string} */
private result;
- /** @private */
+ /** @private {IdentityProfileFailureReasonResponse|undefined} */
private failureReason;
- /** @private */
+ /** @private {IdentityProfileReportResponse|undefined} */
private identityProfileReport;
/**
* @returns {string}
@@ -18,13 +18,13 @@ declare class IdentityProfileResponse {
*/
getResult(): string;
/**
- * @returns {IdentityProfileFailureReasonResponse}
+ * @returns {IdentityProfileFailureReasonResponse|undefined}
*/
- getFailureReason(): IdentityProfileFailureReasonResponse;
+ getFailureReason(): IdentityProfileFailureReasonResponse | undefined;
/**
- * @returns {IdentityProfileReportResponse}
+ * @returns {IdentityProfileReportResponse|undefined}
*/
- getIdentityProfileReport(): IdentityProfileReportResponse;
+ getIdentityProfileReport(): IdentityProfileReportResponse | undefined;
}
import IdentityProfileFailureReasonResponse = require("./identity.profile.failure.reason.response");
import IdentityProfileReportResponse = require("./identity.profile.report.response");
diff --git a/types/src/idv_service/session/retrieve/identity_profile/identity.profile.scheme.response.d.ts b/types/src/idv_service/session/retrieve/identity_profile/identity.profile.scheme.response.d.ts
new file mode 100644
index 000000000..7b9ee35e1
--- /dev/null
+++ b/types/src/idv_service/session/retrieve/identity_profile/identity.profile.scheme.response.d.ts
@@ -0,0 +1,16 @@
+export = IdentityProfileSchemeResponse;
+declare class IdentityProfileSchemeResponse {
+ constructor(scheme: any);
+ /** @private {string} */
+ private type;
+ /** @private {string} */
+ private objective;
+ /**
+ * @returns {string}
+ */
+ getType(): string;
+ /**
+ * @returns {string|undefined}
+ */
+ getObjective(): string | undefined;
+}