Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nexeraprotocol/nexera-id-schemas

Package Overview
Dependencies
Maintainers
1
Versions
385
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nexeraprotocol/nexera-id-schemas - npm Package Compare versions

Comparing version 1.0.18 to 1.0.19

dist/declarations/src/compliance/index.d.ts

215

compliance/kyc/dist/nexeraprotocol-nexera-id-schemas-compliance-kyc.cjs.dev.js

@@ -5,200 +5,23 @@ 'use strict';

var zod = require('zod');
var compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas = require('../../vc-schemas/vc-schemas/dist/nexeraprotocol-nexera-id-schemas-compliance-vc-schemas-vc-schemas.cjs.dev.js');
require('zod');
require('../../../dist/vc-schemas-f4be799d.cjs.dev.js');
var compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc = require('../../../dist/kyc-fc1f5193.cjs.dev.js');
var AVAILABLE_FLOWS = ["REQUEST", "MANAGEMENT"];
var KYCDataResponseSchema = zod.z["enum"](["onInitKyc", "signature"]);
var VerificationModes = ["production", "sandbox"];
var VerificationModeSchema = zod.z["enum"](VerificationModes);
var ApplicationClientDataSchema = zod.z.object({
id: zod.z.string(),
name: zod.z.string(),
team: zod.z.object({
id: zod.z.string(),
name: zod.z.string()
}),
verificationMode: VerificationModeSchema,
complianceEnabled: zod.z["boolean"](),
identityProviders: zod.z.object({
gbgProvider: zod.z["boolean"]()
}),
host: zod.z.string(),
requireProofOfResidence: zod.z["boolean"](),
companyName: zod.z.string(),
companyLegalName: zod.z.string(),
companyWebsite: zod.z.string(),
requestedDataLabels: zod.z.array(zod.z.object({
title: zod.z.any()
})).optional().nullish(),
logoImage: zod.z.object({
url: zod.z.string(),
alt: zod.z.string()
}),
developmentOptions: zod.z.object({
devKycFlowEnabled: zod.z["boolean"](),
localhostEnabled: zod.z["boolean"]()
}),
dataWebhookConfig: zod.z.object({
dataWebhookEndpoint: zod.z.string()
}).optional(),
scenarioWebhookConfig: zod.z.object({
scenarioResponseEndpoint: zod.z.string().optional(),
scenario: zod.z.object({
id: zod.z.string().optional(),
rules: zod.z.array(zod.z.object({
id: zod.z.string(),
requiredCredential: zod.z.string().transform(function (x) {
return x.replace("_", "-");
}).pipe(zod.z["enum"](compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.CredentialTypes)).describe("Transform is needed because of the underscore in the enum, the _ is generated by the backend")
})).optional()
}).optional()
}).optional()
});
var KYC_SDK_RESPONSES = ["requestInitialData", "signatureRequest", "kycCompletition", "offChainShareCompletition", "closeScreen"];
var KycSdkResponsesSchema = zod.z["enum"](KYC_SDK_RESPONSES);
var KycCompletitionDataSchema = zod.z.array(compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.VerifiableCredentialSchema);
var KYC_SDK_RESPONSES_DATA = {
kycCompletition: KycCompletitionDataSchema
};
var decodeUint8Array = function decodeUint8Array(data) {
var salt = data;
return new Uint8Array(Object.keys(salt).map(function (key) {
return salt[key];
}));
};
var EncryptedKycKeySchema = zod.z.object({
address: zod.z.string(),
encryptedPrivateKey: zod.z.string(),
signingMessage: zod.z.string(),
salt: zod.z.preprocess(decodeUint8Array, zod.z.unknown()),
iv: zod.z.preprocess(decodeUint8Array, zod.z.unknown()),
did: zod.z.string().optional()
});
var EncryptedVerifiableCredentialDataSchema = zod.z.object({
iv: zod.z.preprocess(decodeUint8Array, zod.z.unknown()),
ephemPublicKey: zod.z.preprocess(decodeUint8Array, zod.z.unknown()),
ciphertext: zod.z.preprocess(decodeUint8Array, zod.z.unknown()),
mac: zod.z.preprocess(decodeUint8Array, zod.z.unknown())
});
var EncryptedVerifiableCredentialSchema = zod.z.object({
id: zod.z.number().optional(),
did: zod.z.string(),
journeyId: zod.z.string().optional(),
type: zod.z["enum"](compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.CredentialTypes),
datetime: zod.z.coerce.date(),
credential: EncryptedVerifiableCredentialDataSchema,
identifier: zod.z.string().optional()
});
var DownloadableKycSchema = zod.z.object({
vcs: zod.z.array(zod.z.any()),
key: EncryptedKycKeySchema
});
var SumsubApplicantAddressSchema = zod.z.object({
country: zod.z.string().optional(),
postCode: zod.z.string().optional(),
town: zod.z.string().optional(),
street: zod.z.string().optional(),
subStreet: zod.z.string().optional(),
state: zod.z.string().optional()
});
var SumsubApplicantInfoSchema = zod.z.object({
firstName: zod.z.string().optional(),
lastName: zod.z.string().optional(),
middleName: zod.z.string().optional(),
firstNameEn: zod.z.string().optional(),
lastNameEn: zod.z.string().optional(),
middleNameEn: zod.z.string().optional(),
legalName: zod.z.string().optional(),
gender: zod.z.string().optional(),
dob: zod.z.string().optional(),
placeOfBirth: zod.z.string().optional(),
country: zod.z.string().optional(),
nationality: zod.z.string().optional(),
addresses: zod.z.array(SumsubApplicantAddressSchema).optional(),
idDocs: zod.z.array(zod.z.object({
idDocType: zod.z.string(),
country: zod.z.string(),
firstName: zod.z.string().optional(),
lastName: zod.z.string().optional(),
middleName: zod.z.string().optional(),
firstNameEn: zod.z.string().optional(),
lastNameEn: zod.z.string().optional(),
middleNameEn: zod.z.string().optional(),
validUntil: zod.z.string().optional(),
number: zod.z.string().optional(),
dob: zod.z.string().optional(),
mrzLine1: zod.z.string().optional(),
mrzLine2: zod.z.string().optional()
})).optional()
});
var SumsubApplicationDataSchema = zod.z.object({
id: zod.z.string(),
inspectionId: zod.z.string(),
externalUserId: zod.z.string(),
sourceKey: zod.z.string().optional(),
email: zod.z.string().optional(),
phone: zod.z.string().optional(),
lang: zod.z.string().optional(),
createdAt: zod.z.coerce.date(),
fixedInfo: SumsubApplicantInfoSchema.optional(),
info: SumsubApplicantInfoSchema.optional(),
applicantPlatform: zod.z.string().optional(),
ipCountry: zod.z.string().optional(),
requiredIdDocs: zod.z.object({
docSets: zod.z.array(zod.z.object({
idDocSetType: zod.z.string(),
subTypes: zod.z.array(zod.z.string()).optional(),
types: zod.z.array(zod.z.string()),
videoRequired: zod.z.string().optional()
}))
}),
review: zod.z.object({
levelName: zod.z.string(),
reviewResult: zod.z.object({
reviewAnswer: zod.z.string(),
rejectLabels: zod.z.array(zod.z.string()).optional()
}).optional(),
reviewStatus: zod.z.string()
}),
applicantRiskLevel: zod.z.object({
riskScoreInfo: zod.z.object({
answer: zod.z.string().optional(),
riskScore: zod.z.coerce.string().optional(),
riskScoreItems: zod.z.array(zod.z.object({
answer: zod.z.string().optional(),
riskScore: zod.z.coerce.string().optional(),
category: zod.z.string().optional(),
labels: zod.z.array(zod.z.string()).optional()
})).optional()
}).optional()
}).optional(),
riskLabels: zod.z.object({
attemptId: zod.z.string().optional(),
createdAt: zod.z.coerce.date(),
email: zod.z.array(zod.z.string()).optional().nullable(),
phone: zod.z.array(zod.z.string()).optional().nullable(),
device: zod.z.array(zod.z.string()).optional(),
crossCheck: zod.z.array(zod.z.string()).optional().nullable(),
selfie: zod.z.array(zod.z.string()).optional().nullable(),
aml: zod.z.array(zod.z.string()).optional().nullable(),
person: zod.z.array(zod.z.string()).optional().nullable()
}).optional()
});
exports.AVAILABLE_FLOWS = AVAILABLE_FLOWS;
exports.ApplicationClientDataSchema = ApplicationClientDataSchema;
exports.DownloadableKycSchema = DownloadableKycSchema;
exports.EncryptedKycKeySchema = EncryptedKycKeySchema;
exports.EncryptedVerifiableCredentialDataSchema = EncryptedVerifiableCredentialDataSchema;
exports.EncryptedVerifiableCredentialSchema = EncryptedVerifiableCredentialSchema;
exports.KYCDataResponseSchema = KYCDataResponseSchema;
exports.KYC_SDK_RESPONSES = KYC_SDK_RESPONSES;
exports.KYC_SDK_RESPONSES_DATA = KYC_SDK_RESPONSES_DATA;
exports.KycCompletitionDataSchema = KycCompletitionDataSchema;
exports.KycSdkResponsesSchema = KycSdkResponsesSchema;
exports.SumsubApplicantAddressSchema = SumsubApplicantAddressSchema;
exports.SumsubApplicantInfoSchema = SumsubApplicantInfoSchema;
exports.SumsubApplicationDataSchema = SumsubApplicationDataSchema;
exports.VerificationModeSchema = VerificationModeSchema;
exports.VerificationModes = VerificationModes;
exports.AVAILABLE_FLOWS = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.AVAILABLE_FLOWS;
exports.ApplicationClientDataSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.ApplicationClientDataSchema;
exports.DownloadableKycSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.DownloadableKycSchema;
exports.EncryptedKycKeySchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.EncryptedKycKeySchema;
exports.EncryptedVerifiableCredentialDataSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.EncryptedVerifiableCredentialDataSchema;
exports.EncryptedVerifiableCredentialSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.EncryptedVerifiableCredentialSchema;
exports.KYCDataResponseSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.KYCDataResponseSchema;
exports.KYC_SDK_RESPONSES = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.KYC_SDK_RESPONSES;
exports.KYC_SDK_RESPONSES_DATA = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.KYC_SDK_RESPONSES_DATA;
exports.KycCompletitionDataSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.KycCompletitionDataSchema;
exports.KycSdkResponsesSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.KycSdkResponsesSchema;
exports.SumsubApplicantAddressSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.SumsubApplicantAddressSchema;
exports.SumsubApplicantInfoSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.SumsubApplicantInfoSchema;
exports.SumsubApplicationDataSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.SumsubApplicationDataSchema;
exports.VerificationModeSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.VerificationModeSchema;
exports.VerificationModes = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.VerificationModes;

@@ -5,200 +5,23 @@ 'use strict';

var zod = require('zod');
var compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas = require('../../vc-schemas/vc-schemas/dist/nexeraprotocol-nexera-id-schemas-compliance-vc-schemas-vc-schemas.cjs.prod.js');
require('zod');
require('../../../dist/vc-schemas-60c4768b.cjs.prod.js');
var compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc = require('../../../dist/kyc-6fc98e73.cjs.prod.js');
var AVAILABLE_FLOWS = ["REQUEST", "MANAGEMENT"];
var KYCDataResponseSchema = zod.z["enum"](["onInitKyc", "signature"]);
var VerificationModes = ["production", "sandbox"];
var VerificationModeSchema = zod.z["enum"](VerificationModes);
var ApplicationClientDataSchema = zod.z.object({
id: zod.z.string(),
name: zod.z.string(),
team: zod.z.object({
id: zod.z.string(),
name: zod.z.string()
}),
verificationMode: VerificationModeSchema,
complianceEnabled: zod.z["boolean"](),
identityProviders: zod.z.object({
gbgProvider: zod.z["boolean"]()
}),
host: zod.z.string(),
requireProofOfResidence: zod.z["boolean"](),
companyName: zod.z.string(),
companyLegalName: zod.z.string(),
companyWebsite: zod.z.string(),
requestedDataLabels: zod.z.array(zod.z.object({
title: zod.z.any()
})).optional().nullish(),
logoImage: zod.z.object({
url: zod.z.string(),
alt: zod.z.string()
}),
developmentOptions: zod.z.object({
devKycFlowEnabled: zod.z["boolean"](),
localhostEnabled: zod.z["boolean"]()
}),
dataWebhookConfig: zod.z.object({
dataWebhookEndpoint: zod.z.string()
}).optional(),
scenarioWebhookConfig: zod.z.object({
scenarioResponseEndpoint: zod.z.string().optional(),
scenario: zod.z.object({
id: zod.z.string().optional(),
rules: zod.z.array(zod.z.object({
id: zod.z.string(),
requiredCredential: zod.z.string().transform(function (x) {
return x.replace("_", "-");
}).pipe(zod.z["enum"](compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.CredentialTypes)).describe("Transform is needed because of the underscore in the enum, the _ is generated by the backend")
})).optional()
}).optional()
}).optional()
});
var KYC_SDK_RESPONSES = ["requestInitialData", "signatureRequest", "kycCompletition", "offChainShareCompletition", "closeScreen"];
var KycSdkResponsesSchema = zod.z["enum"](KYC_SDK_RESPONSES);
var KycCompletitionDataSchema = zod.z.array(compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.VerifiableCredentialSchema);
var KYC_SDK_RESPONSES_DATA = {
kycCompletition: KycCompletitionDataSchema
};
var decodeUint8Array = function decodeUint8Array(data) {
var salt = data;
return new Uint8Array(Object.keys(salt).map(function (key) {
return salt[key];
}));
};
var EncryptedKycKeySchema = zod.z.object({
address: zod.z.string(),
encryptedPrivateKey: zod.z.string(),
signingMessage: zod.z.string(),
salt: zod.z.preprocess(decodeUint8Array, zod.z.unknown()),
iv: zod.z.preprocess(decodeUint8Array, zod.z.unknown()),
did: zod.z.string().optional()
});
var EncryptedVerifiableCredentialDataSchema = zod.z.object({
iv: zod.z.preprocess(decodeUint8Array, zod.z.unknown()),
ephemPublicKey: zod.z.preprocess(decodeUint8Array, zod.z.unknown()),
ciphertext: zod.z.preprocess(decodeUint8Array, zod.z.unknown()),
mac: zod.z.preprocess(decodeUint8Array, zod.z.unknown())
});
var EncryptedVerifiableCredentialSchema = zod.z.object({
id: zod.z.number().optional(),
did: zod.z.string(),
journeyId: zod.z.string().optional(),
type: zod.z["enum"](compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.CredentialTypes),
datetime: zod.z.coerce.date(),
credential: EncryptedVerifiableCredentialDataSchema,
identifier: zod.z.string().optional()
});
var DownloadableKycSchema = zod.z.object({
vcs: zod.z.array(zod.z.any()),
key: EncryptedKycKeySchema
});
var SumsubApplicantAddressSchema = zod.z.object({
country: zod.z.string().optional(),
postCode: zod.z.string().optional(),
town: zod.z.string().optional(),
street: zod.z.string().optional(),
subStreet: zod.z.string().optional(),
state: zod.z.string().optional()
});
var SumsubApplicantInfoSchema = zod.z.object({
firstName: zod.z.string().optional(),
lastName: zod.z.string().optional(),
middleName: zod.z.string().optional(),
firstNameEn: zod.z.string().optional(),
lastNameEn: zod.z.string().optional(),
middleNameEn: zod.z.string().optional(),
legalName: zod.z.string().optional(),
gender: zod.z.string().optional(),
dob: zod.z.string().optional(),
placeOfBirth: zod.z.string().optional(),
country: zod.z.string().optional(),
nationality: zod.z.string().optional(),
addresses: zod.z.array(SumsubApplicantAddressSchema).optional(),
idDocs: zod.z.array(zod.z.object({
idDocType: zod.z.string(),
country: zod.z.string(),
firstName: zod.z.string().optional(),
lastName: zod.z.string().optional(),
middleName: zod.z.string().optional(),
firstNameEn: zod.z.string().optional(),
lastNameEn: zod.z.string().optional(),
middleNameEn: zod.z.string().optional(),
validUntil: zod.z.string().optional(),
number: zod.z.string().optional(),
dob: zod.z.string().optional(),
mrzLine1: zod.z.string().optional(),
mrzLine2: zod.z.string().optional()
})).optional()
});
var SumsubApplicationDataSchema = zod.z.object({
id: zod.z.string(),
inspectionId: zod.z.string(),
externalUserId: zod.z.string(),
sourceKey: zod.z.string().optional(),
email: zod.z.string().optional(),
phone: zod.z.string().optional(),
lang: zod.z.string().optional(),
createdAt: zod.z.coerce.date(),
fixedInfo: SumsubApplicantInfoSchema.optional(),
info: SumsubApplicantInfoSchema.optional(),
applicantPlatform: zod.z.string().optional(),
ipCountry: zod.z.string().optional(),
requiredIdDocs: zod.z.object({
docSets: zod.z.array(zod.z.object({
idDocSetType: zod.z.string(),
subTypes: zod.z.array(zod.z.string()).optional(),
types: zod.z.array(zod.z.string()),
videoRequired: zod.z.string().optional()
}))
}),
review: zod.z.object({
levelName: zod.z.string(),
reviewResult: zod.z.object({
reviewAnswer: zod.z.string(),
rejectLabels: zod.z.array(zod.z.string()).optional()
}).optional(),
reviewStatus: zod.z.string()
}),
applicantRiskLevel: zod.z.object({
riskScoreInfo: zod.z.object({
answer: zod.z.string().optional(),
riskScore: zod.z.coerce.string().optional(),
riskScoreItems: zod.z.array(zod.z.object({
answer: zod.z.string().optional(),
riskScore: zod.z.coerce.string().optional(),
category: zod.z.string().optional(),
labels: zod.z.array(zod.z.string()).optional()
})).optional()
}).optional()
}).optional(),
riskLabels: zod.z.object({
attemptId: zod.z.string().optional(),
createdAt: zod.z.coerce.date(),
email: zod.z.array(zod.z.string()).optional().nullable(),
phone: zod.z.array(zod.z.string()).optional().nullable(),
device: zod.z.array(zod.z.string()).optional(),
crossCheck: zod.z.array(zod.z.string()).optional().nullable(),
selfie: zod.z.array(zod.z.string()).optional().nullable(),
aml: zod.z.array(zod.z.string()).optional().nullable(),
person: zod.z.array(zod.z.string()).optional().nullable()
}).optional()
});
exports.AVAILABLE_FLOWS = AVAILABLE_FLOWS;
exports.ApplicationClientDataSchema = ApplicationClientDataSchema;
exports.DownloadableKycSchema = DownloadableKycSchema;
exports.EncryptedKycKeySchema = EncryptedKycKeySchema;
exports.EncryptedVerifiableCredentialDataSchema = EncryptedVerifiableCredentialDataSchema;
exports.EncryptedVerifiableCredentialSchema = EncryptedVerifiableCredentialSchema;
exports.KYCDataResponseSchema = KYCDataResponseSchema;
exports.KYC_SDK_RESPONSES = KYC_SDK_RESPONSES;
exports.KYC_SDK_RESPONSES_DATA = KYC_SDK_RESPONSES_DATA;
exports.KycCompletitionDataSchema = KycCompletitionDataSchema;
exports.KycSdkResponsesSchema = KycSdkResponsesSchema;
exports.SumsubApplicantAddressSchema = SumsubApplicantAddressSchema;
exports.SumsubApplicantInfoSchema = SumsubApplicantInfoSchema;
exports.SumsubApplicationDataSchema = SumsubApplicationDataSchema;
exports.VerificationModeSchema = VerificationModeSchema;
exports.VerificationModes = VerificationModes;
exports.AVAILABLE_FLOWS = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.AVAILABLE_FLOWS;
exports.ApplicationClientDataSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.ApplicationClientDataSchema;
exports.DownloadableKycSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.DownloadableKycSchema;
exports.EncryptedKycKeySchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.EncryptedKycKeySchema;
exports.EncryptedVerifiableCredentialDataSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.EncryptedVerifiableCredentialDataSchema;
exports.EncryptedVerifiableCredentialSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.EncryptedVerifiableCredentialSchema;
exports.KYCDataResponseSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.KYCDataResponseSchema;
exports.KYC_SDK_RESPONSES = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.KYC_SDK_RESPONSES;
exports.KYC_SDK_RESPONSES_DATA = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.KYC_SDK_RESPONSES_DATA;
exports.KycCompletitionDataSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.KycCompletitionDataSchema;
exports.KycSdkResponsesSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.KycSdkResponsesSchema;
exports.SumsubApplicantAddressSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.SumsubApplicantAddressSchema;
exports.SumsubApplicantInfoSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.SumsubApplicantInfoSchema;
exports.SumsubApplicationDataSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.SumsubApplicationDataSchema;
exports.VerificationModeSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.VerificationModeSchema;
exports.VerificationModes = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.VerificationModes;

@@ -1,184 +0,3 @@

import { z } from 'zod';
import { CredentialTypes, VerifiableCredentialSchema } from '../../vc-schemas/vc-schemas/dist/nexeraprotocol-nexera-id-schemas-compliance-vc-schemas-vc-schemas.esm.js';
var AVAILABLE_FLOWS = ["REQUEST", "MANAGEMENT"];
var KYCDataResponseSchema = z["enum"](["onInitKyc", "signature"]);
var VerificationModes = ["production", "sandbox"];
var VerificationModeSchema = z["enum"](VerificationModes);
var ApplicationClientDataSchema = z.object({
id: z.string(),
name: z.string(),
team: z.object({
id: z.string(),
name: z.string()
}),
verificationMode: VerificationModeSchema,
complianceEnabled: z["boolean"](),
identityProviders: z.object({
gbgProvider: z["boolean"]()
}),
host: z.string(),
requireProofOfResidence: z["boolean"](),
companyName: z.string(),
companyLegalName: z.string(),
companyWebsite: z.string(),
requestedDataLabels: z.array(z.object({
title: z.any()
})).optional().nullish(),
logoImage: z.object({
url: z.string(),
alt: z.string()
}),
developmentOptions: z.object({
devKycFlowEnabled: z["boolean"](),
localhostEnabled: z["boolean"]()
}),
dataWebhookConfig: z.object({
dataWebhookEndpoint: z.string()
}).optional(),
scenarioWebhookConfig: z.object({
scenarioResponseEndpoint: z.string().optional(),
scenario: z.object({
id: z.string().optional(),
rules: z.array(z.object({
id: z.string(),
requiredCredential: z.string().transform(function (x) {
return x.replace("_", "-");
}).pipe(z["enum"](CredentialTypes)).describe("Transform is needed because of the underscore in the enum, the _ is generated by the backend")
})).optional()
}).optional()
}).optional()
});
var KYC_SDK_RESPONSES = ["requestInitialData", "signatureRequest", "kycCompletition", "offChainShareCompletition", "closeScreen"];
var KycSdkResponsesSchema = z["enum"](KYC_SDK_RESPONSES);
var KycCompletitionDataSchema = z.array(VerifiableCredentialSchema);
var KYC_SDK_RESPONSES_DATA = {
kycCompletition: KycCompletitionDataSchema
};
var decodeUint8Array = function decodeUint8Array(data) {
var salt = data;
return new Uint8Array(Object.keys(salt).map(function (key) {
return salt[key];
}));
};
var EncryptedKycKeySchema = z.object({
address: z.string(),
encryptedPrivateKey: z.string(),
signingMessage: z.string(),
salt: z.preprocess(decodeUint8Array, z.unknown()),
iv: z.preprocess(decodeUint8Array, z.unknown()),
did: z.string().optional()
});
var EncryptedVerifiableCredentialDataSchema = z.object({
iv: z.preprocess(decodeUint8Array, z.unknown()),
ephemPublicKey: z.preprocess(decodeUint8Array, z.unknown()),
ciphertext: z.preprocess(decodeUint8Array, z.unknown()),
mac: z.preprocess(decodeUint8Array, z.unknown())
});
var EncryptedVerifiableCredentialSchema = z.object({
id: z.number().optional(),
did: z.string(),
journeyId: z.string().optional(),
type: z["enum"](CredentialTypes),
datetime: z.coerce.date(),
credential: EncryptedVerifiableCredentialDataSchema,
identifier: z.string().optional()
});
var DownloadableKycSchema = z.object({
vcs: z.array(z.any()),
key: EncryptedKycKeySchema
});
var SumsubApplicantAddressSchema = z.object({
country: z.string().optional(),
postCode: z.string().optional(),
town: z.string().optional(),
street: z.string().optional(),
subStreet: z.string().optional(),
state: z.string().optional()
});
var SumsubApplicantInfoSchema = z.object({
firstName: z.string().optional(),
lastName: z.string().optional(),
middleName: z.string().optional(),
firstNameEn: z.string().optional(),
lastNameEn: z.string().optional(),
middleNameEn: z.string().optional(),
legalName: z.string().optional(),
gender: z.string().optional(),
dob: z.string().optional(),
placeOfBirth: z.string().optional(),
country: z.string().optional(),
nationality: z.string().optional(),
addresses: z.array(SumsubApplicantAddressSchema).optional(),
idDocs: z.array(z.object({
idDocType: z.string(),
country: z.string(),
firstName: z.string().optional(),
lastName: z.string().optional(),
middleName: z.string().optional(),
firstNameEn: z.string().optional(),
lastNameEn: z.string().optional(),
middleNameEn: z.string().optional(),
validUntil: z.string().optional(),
number: z.string().optional(),
dob: z.string().optional(),
mrzLine1: z.string().optional(),
mrzLine2: z.string().optional()
})).optional()
});
var SumsubApplicationDataSchema = z.object({
id: z.string(),
inspectionId: z.string(),
externalUserId: z.string(),
sourceKey: z.string().optional(),
email: z.string().optional(),
phone: z.string().optional(),
lang: z.string().optional(),
createdAt: z.coerce.date(),
fixedInfo: SumsubApplicantInfoSchema.optional(),
info: SumsubApplicantInfoSchema.optional(),
applicantPlatform: z.string().optional(),
ipCountry: z.string().optional(),
requiredIdDocs: z.object({
docSets: z.array(z.object({
idDocSetType: z.string(),
subTypes: z.array(z.string()).optional(),
types: z.array(z.string()),
videoRequired: z.string().optional()
}))
}),
review: z.object({
levelName: z.string(),
reviewResult: z.object({
reviewAnswer: z.string(),
rejectLabels: z.array(z.string()).optional()
}).optional(),
reviewStatus: z.string()
}),
applicantRiskLevel: z.object({
riskScoreInfo: z.object({
answer: z.string().optional(),
riskScore: z.coerce.string().optional(),
riskScoreItems: z.array(z.object({
answer: z.string().optional(),
riskScore: z.coerce.string().optional(),
category: z.string().optional(),
labels: z.array(z.string()).optional()
})).optional()
}).optional()
}).optional(),
riskLabels: z.object({
attemptId: z.string().optional(),
createdAt: z.coerce.date(),
email: z.array(z.string()).optional().nullable(),
phone: z.array(z.string()).optional().nullable(),
device: z.array(z.string()).optional(),
crossCheck: z.array(z.string()).optional().nullable(),
selfie: z.array(z.string()).optional().nullable(),
aml: z.array(z.string()).optional().nullable(),
person: z.array(z.string()).optional().nullable()
}).optional()
});
export { AVAILABLE_FLOWS, ApplicationClientDataSchema, DownloadableKycSchema, EncryptedKycKeySchema, EncryptedVerifiableCredentialDataSchema, EncryptedVerifiableCredentialSchema, KYCDataResponseSchema, KYC_SDK_RESPONSES, KYC_SDK_RESPONSES_DATA, KycCompletitionDataSchema, KycSdkResponsesSchema, SumsubApplicantAddressSchema, SumsubApplicantInfoSchema, SumsubApplicationDataSchema, VerificationModeSchema, VerificationModes };
import 'zod';
import '../../../dist/vc-schemas-bcbe3142.esm.js';
export { e as AVAILABLE_FLOWS, A as ApplicationClientDataSchema, D as DownloadableKycSchema, E as EncryptedKycKeySchema, a as EncryptedVerifiableCredentialDataSchema, b as EncryptedVerifiableCredentialSchema, K as KYCDataResponseSchema, f as KYC_SDK_RESPONSES, j as KYC_SDK_RESPONSES_DATA, i as KycCompletitionDataSchema, g as KycSdkResponsesSchema, S as SumsubApplicantAddressSchema, c as SumsubApplicantInfoSchema, d as SumsubApplicationDataSchema, V as VerificationModeSchema, h as VerificationModes } from '../../../dist/kyc-a8adb73c.esm.js';

@@ -5,389 +5,12 @@ 'use strict';

var zod = require('zod');
var compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas = require('../../../../dist/vc-schemas-f4be799d.cjs.dev.js');
require('zod');
function _typeof(obj) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
}, _typeof(obj);
}
var ID3_7CredentialSubjectSchema = zod.z.object({
journeyId: zod.z.string(),
amendmentsData: zod.z.object({
data: zod.z.object({
citizenship: zod.z.string().optional(),
documentType: zod.z.string().optional(),
firstName: zod.z.string().optional(),
lastName: zod.z.string().optional(),
gender: zod.z.string().optional(),
addressLine1: zod.z.string().nullable().optional(),
addressLine2: zod.z.string().nullable().optional(),
birthday: zod.z.string().optional(),
placeOfBirth: zod.z.string().optional(),
countryOfResidence: zod.z.string().optional(),
age: zod.z.string().optional(),
city: zod.z.string().optional(),
province: zod.z.string().optional(),
postalCode: zod.z.string().optional(),
emailAddress: zod.z.string().optional(),
phoneNumber: zod.z.string().optional(),
countryOfBirth: zod.z.string().optional(),
middleName: zod.z.string().optional()
}).optional(),
authenticateSPResult: zod.z.object({
AuthenticationID: zod.z.string().optional(),
Timestamp: zod.z.string().optional(),
CustomerRef: zod.z.string().optional(),
ProfileID: zod.z.string().optional(),
ProfileName: zod.z.string().optional(),
ProfileVersion: zod.z.number()["int"]().optional(),
ProfileRevision: zod.z.number()["int"]().optional(),
ProfileState: zod.z.string().optional(),
ResultCodes: zod.z.object({
GlobalItemCheckResultCodes: zod.z.array(zod.z.object({
Name: zod.z.string().optional(),
Description: zod.z.string().optional(),
Comment: zod.z.record(zod.z.any()).optional(),
Match: zod.z.record(zod.z.any()).optional(),
Warning: zod.z.record(zod.z.any()).optional(),
ID: zod.z.number()["int"]().optional(),
Pass: zod.z.string().optional(),
Address: zod.z.string().optional(),
Forename: zod.z.string().optional(),
Surname: zod.z.string().optional(),
DOB: zod.z.string().optional(),
Alert: zod.z.string().optional(),
SanctionsMatches: zod.z.union([zod.z.record(zod.z.any()), zod.z.string()]).optional()
})).optional()
}).strict().optional(),
Score: zod.z.number()["int"]().optional(),
BandText: zod.z.string().optional(),
Country: zod.z.string().optional()
}).optional(),
pepIntelligenceResult: zod.z.array(zod.z.object({
Fullname: zod.z.string().optional(),
Aliases: zod.z.object({
"a:string": zod.z.array(zod.z.string()).optional()
}).optional(),
SanctionsAddresses: zod.z.object({
GlobalSanctionsAddress: zod.z.array(zod.z.object({
AddressLine: zod.z.string().optional(),
City: zod.z.string().optional(),
Country: zod.z.string().optional(),
Region: zod.z.string().optional()
})).optional()
}).optional(),
SanctionsDates: zod.z.object({
GlobalSanctionsDate: zod.z.object({
DateType: zod.z.string().optional(),
Day: zod.z.number()["int"]().optional(),
Month: zod.z.number()["int"]().optional(),
Year: zod.z.number()["int"]().optional()
}).optional()
}).optional(),
IdentityInformation: zod.z.string().optional(),
SanctionsPositions: zod.z.object({
GlobalSanctionsPosition: zod.z.array(zod.z.object({
Position: zod.z.string().optional(),
Country: zod.z.string().optional()
})).optional()
}).optional()
})).optional(),
sanctionsEnforcementsResult: zod.z.array(zod.z.object({
Fullname: zod.z.string().optional(),
SanctionsBodies: zod.z.object({
"a:string": zod.z.array(zod.z.number()["int"]()).optional()
}).optional(),
Aliases: zod.z.object({
"a:string": zod.z.array(zod.z.string()).optional()
}).optional(),
SanctionsAddresses: zod.z.object({
GlobalSanctionsAddress: zod.z.array(zod.z.object({
AddressLine: zod.z.string().optional(),
City: zod.z.string().optional(),
Country: zod.z.string().optional(),
Region: zod.z.string().optional()
})).optional()
}).optional(),
SanctionsDates: zod.z.object({
GlobalSanctionsDate: zod.z.object({
DateType: zod.z.string().optional(),
Day: zod.z.number()["int"]().optional(),
Month: zod.z.number()["int"]().optional(),
Year: zod.z.number()["int"]().optional()
}).optional()
}).optional(),
IdentityInformation: zod.z.string().optional()
})).optional()
}).strict(),
originalData: zod.z.object({
data: zod.z.object({
citizenship: zod.z.string().optional(),
documentType: zod.z.string().optional(),
firstName: zod.z.string().optional(),
lastName: zod.z.string().optional(),
gender: zod.z.string().optional(),
addressLine1: zod.z.string().nullable().optional(),
addressLine2: zod.z.string().nullable().optional(),
birthday: zod.z.string().optional(),
age: zod.z.string().optional()
}).optional(),
authenticateSPResult: zod.z.object({
AuthenticationID: zod.z.string().optional(),
Timestamp: zod.z.string().optional(),
CustomerRef: zod.z.string().optional(),
ProfileID: zod.z.string().optional(),
ProfileName: zod.z.string().optional(),
ProfileVersion: zod.z.number()["int"]().optional(),
ProfileRevision: zod.z.number()["int"]().optional(),
ProfileState: zod.z.string().optional(),
ResultCodes: zod.z.object({
GlobalItemCheckResultCodes: zod.z.array(zod.z.object({
Name: zod.z.string().optional(),
Description: zod.z.string().optional(),
Comment: zod.z.record(zod.z.any()).optional(),
Match: zod.z.record(zod.z.any()).optional(),
Warning: zod.z.record(zod.z.any()).optional(),
ID: zod.z.number()["int"]().optional(),
Pass: zod.z.string().optional(),
Address: zod.z.string().optional(),
Forename: zod.z.string().optional(),
Surname: zod.z.string().optional(),
DOB: zod.z.string().optional(),
Alert: zod.z.string().optional(),
SanctionsMatches: zod.z.union([zod.z.record(zod.z.any()), zod.z.string()]).optional()
})).optional()
}).strict().optional(),
Score: zod.z.number()["int"]().optional(),
BandText: zod.z.string().optional(),
Country: zod.z.string().optional()
}).optional(),
pepIntelligenceResult: zod.z.array(zod.z.object({
Fullname: zod.z.string().optional(),
Aliases: zod.z.object({
"a:string": zod.z.array(zod.z.string()).optional()
}).optional(),
SanctionsAddresses: zod.z.object({
GlobalSanctionsAddress: zod.z.array(zod.z.object({
AddressLine: zod.z.string().optional(),
City: zod.z.string().optional(),
Country: zod.z.string().optional(),
Region: zod.z.string().optional()
})).optional()
}).optional(),
SanctionsDates: zod.z.object({
GlobalSanctionsDate: zod.z.object({
DateType: zod.z.string().optional(),
Day: zod.z.number()["int"]().optional(),
Month: zod.z.number()["int"]().optional(),
Year: zod.z.number()["int"]().optional()
}).optional()
}).optional(),
IdentityInformation: zod.z.string().optional(),
SanctionsPositions: zod.z.object({
GlobalSanctionsPosition: zod.z.array(zod.z.object({
Position: zod.z.string().optional(),
Country: zod.z.string().optional()
})).optional()
}).optional()
})).optional(),
sanctionsEnforcementsResult: zod.z.array(zod.z.object({
Fullname: zod.z.string().optional(),
SanctionsBodies: zod.z.object({
"a:string": zod.z.array(zod.z.number()["int"]()).optional()
}).optional(),
Aliases: zod.z.object({
"a:string": zod.z.array(zod.z.string()).optional()
}).optional(),
SanctionsAddresses: zod.z.object({
GlobalSanctionsAddress: zod.z.array(zod.z.object({
AddressLine: zod.z.string().optional(),
City: zod.z.string().optional(),
Country: zod.z.string().optional(),
Region: zod.z.string().optional()
})).optional()
}).optional(),
SanctionsDates: zod.z.object({
GlobalSanctionsDate: zod.z.object({
DateType: zod.z.string().optional(),
Day: zod.z.number()["int"]().optional(),
Month: zod.z.number()["int"]().optional(),
Year: zod.z.number()["int"]().optional()
}).optional()
}).optional(),
IdentityInformation: zod.z.string().optional()
})).optional()
}).strict(),
personalDetails: zod.z.object({
citizenship: zod.z.string().optional(),
documentType: zod.z.string().optional(),
firstName: zod.z.string().optional(),
lastName: zod.z.string().optional(),
gender: zod.z.string().optional(),
addressLine1: zod.z.string().nullable().optional(),
addressLine2: zod.z.string().nullable().optional(),
birthday: zod.z.string().optional(),
placeOfBirth: zod.z.string().optional(),
countryOfResidence: zod.z.string().optional(),
age: zod.z.string().optional(),
city: zod.z.string().optional(),
province: zod.z.string().optional(),
postalCode: zod.z.string().optional(),
emailAddress: zod.z.string().optional(),
phoneNumber: zod.z.string().optional(),
countryOfBirth: zod.z.string().optional(),
middleName: zod.z.string().optional()
}).strict(),
id: zod.z.string()
});
var IDScanPassportV1CredentialSubjectSchema = zod.z.object({
id: zod.z.string(),
journeyId: zod.z.string().describe("The ID of the journey that this credential is associated with"),
base64: zod.z.string().describe("Base64 encoded image of the passport image"),
name: zod.z.string().describe("Name of the docuemnt (e.g. passport.jpg)"),
documentType: zod.z.string().describe("Type of the document (e.g. image/jpeg, image/png)")
});
var IDScanSelfieV1CredentialSubjectSchema = zod.z.object({
id: zod.z.string(),
journeyId: zod.z.string().describe("The ID of the journey that this credential is associated with"),
base64: zod.z.string().describe("Base64 encoded image of the selfie image"),
name: zod.z.string().describe("Name of the docuemnt (e.g. selfie.jpg)"),
documentType: zod.z.string().describe("Type of the document (e.g. image/jpeg, image/png)")
});
var IDScanV2CredentialSubjectSchema = zod.z.object({
journeyId: zod.z.string().nullable(),
highLevelResult: zod.z.string().nullable().optional(),
firstName: zod.z.string().nullable().optional(),
middleName: zod.z.string().nullable().optional(),
lastName: zod.z.string().nullable().optional(),
gender: zod.z.string().nullable().optional(),
age: zod.z.string().nullable().optional(),
citizenship: zod.z.string().nullable().optional(),
documentCategory: zod.z.string().nullable().optional(),
documentName: zod.z.string().nullable().optional(),
documentSide: zod.z.string().nullable().optional(),
documentType: zod.z.string().nullable().optional(),
entryDate: zod.z.string().nullable().optional(),
entryTime: zod.z.string().nullable().optional(),
fullName: zod.z.string().nullable().optional(),
addressLine1: zod.z.string().nullable().optional(),
addressLine2: zod.z.string().nullable().optional(),
birthDate: zod.z.string().nullable().optional(),
birthPlace: zod.z.string().nullable().optional(),
highLevelResultDetails: zod.z.object({
documentOverallValidation: zod.z.string().optional(),
documentBlockingPolicy: zod.z.string().optional(),
documentExpiry: zod.z.string().optional(),
documentSupport: zod.z.string().optional(),
documentValidation: zod.z.string().optional(),
faceMatchValidation: zod.z.string().optional(),
accumulativeLivenessResult: zod.z.string().optional()
}).nullable().optional(),
faceMatchScore: zod.z.string().nullable().optional(),
qualityCheckDetails: zod.z.array(zod.z.object({
id: zod.z.string().optional(),
title: zod.z.string().optional(),
description: zod.z.string().optional(),
state: zod.z.number()["int"]().optional()
})).nullable().optional(),
validationDetails: zod.z.array(zod.z.object({
name: zod.z.string().optional(),
description: zod.z.string().optional(),
result: zod.z.number()["int"]().optional()
})).nullable().optional(),
id: zod.z.string()
});
var ProofOfResidenceV6CredentialSubjectSchema = zod.z.object({
id: zod.z.string(),
journeyId: zod.z.string().describe("The ID of the journey that this credential is associated with"),
country: zod.z.string().describe("The country of residence"),
base64: zod.z.string().describe("Base64 encoded image of the proof of residence"),
name: zod.z.string().describe("Name of the docuemnt (e.g. proofOfResidence.jpg)"),
documentType: zod.z.string().describe("Type of the document (e.g. image/jpeg, image/png)")
});
var CredentialTypes = ["ID3-v7", "ProofOfResidenceV6", "IDScanSelfieV1", "IDScanPassportV1", "IDScanV2"];
var CredentialTypesSchema = zod.z.string().transform(function (x) {
return x.replace("_", "-");
}).pipe(zod.z["enum"](CredentialTypes));
var VerifiableCredentialSchema = zod.z.object({
issuer: zod.z.string(),
type: zod.z.array(zod.z.union([zod.z.string(), CredentialTypesSchema])),
credentialSubject: zod.z.object({
journeyId: zod.z.string()
}).catchall(zod.z.any())
}).catchall(zod.z.any());
var CredentialZodSchemas = zod.z.union([ID3_7CredentialSubjectSchema, ProofOfResidenceV6CredentialSubjectSchema, IDScanSelfieV1CredentialSubjectSchema, IDScanPassportV1CredentialSubjectSchema, IDScanV2CredentialSubjectSchema]);
/**
* Recursively remove empty strings from object
* @param obj
*/
function removeEmptyStringAttributes(obj) {
if (_typeof(obj) !== "object" || obj === null) {
return obj;
}
for (var key in obj) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
if (obj[key] === "" || obj[key] === null || obj[key] === undefined) {
// remove key if value is empty string
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
delete obj[key];
} else {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
if (_typeof(obj[key]) === "object") {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
obj[key] = removeEmptyStringAttributes(obj[key]);
}
}
}
return obj;
}
var CredentialSchemas = {
"ID3-v7": {
url: "https://raw.githubusercontent.com/NexeraProtocol/vc-schemas/main/examples/id3/v7/id3.json",
zod: ID3_7CredentialSubjectSchema
},
ProofOfResidenceV6: {
url: "https://raw.githubusercontent.com/NexeraProtocol/vc-schemas/main/examples/proofOfResidence/v6/proofOfResidence.json",
zod: ProofOfResidenceV6CredentialSubjectSchema
},
IDScanSelfieV1: {
url: "https://raw.githubusercontent.com/NexeraProtocol/vc-schemas/main/examples/idScanSelfie/v1/idScanSelfie.json",
zod: IDScanSelfieV1CredentialSubjectSchema
},
IDScanPassportV1: {
url: "https://raw.githubusercontent.com/NexeraProtocol/vc-schemas/main/examples/idScanPassport/v1/idScanPassport.json",
zod: IDScanPassportV1CredentialSubjectSchema
},
IDScanV2: {
url: "https://raw.githubusercontent.com/NexeraProtocol/vc-schemas/main/examples/idscan/v2/idscan.json",
// check attributes for emptry strings and convert to null
zod: IDScanV2CredentialSubjectSchema.transform(function (obj) {
return removeEmptyStringAttributes(obj);
})
}
};
var GenericVerifiableCredentialSchema = zod.z.object({
credentialSubject: zod.z.record(zod.z.unknown()),
type: zod.z.array(zod.z.string())
}).nonstrict();
exports.CredentialSchemas = CredentialSchemas;
exports.CredentialTypes = CredentialTypes;
exports.CredentialTypesSchema = CredentialTypesSchema;
exports.CredentialZodSchemas = CredentialZodSchemas;
exports.GenericVerifiableCredentialSchema = GenericVerifiableCredentialSchema;
exports.VerifiableCredentialSchema = VerifiableCredentialSchema;
exports.CredentialSchemas = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.CredentialSchemas;
exports.CredentialTypes = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.CredentialTypes;
exports.CredentialTypesSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.CredentialTypesSchema;
exports.CredentialZodSchemas = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.CredentialZodSchemas;
exports.GenericVerifiableCredentialSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.GenericVerifiableCredentialSchema;
exports.VerifiableCredentialSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.VerifiableCredentialSchema;

@@ -5,389 +5,12 @@ 'use strict';

var zod = require('zod');
var compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas = require('../../../../dist/vc-schemas-60c4768b.cjs.prod.js');
require('zod');
function _typeof(obj) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
}, _typeof(obj);
}
var ID3_7CredentialSubjectSchema = zod.z.object({
journeyId: zod.z.string(),
amendmentsData: zod.z.object({
data: zod.z.object({
citizenship: zod.z.string().optional(),
documentType: zod.z.string().optional(),
firstName: zod.z.string().optional(),
lastName: zod.z.string().optional(),
gender: zod.z.string().optional(),
addressLine1: zod.z.string().nullable().optional(),
addressLine2: zod.z.string().nullable().optional(),
birthday: zod.z.string().optional(),
placeOfBirth: zod.z.string().optional(),
countryOfResidence: zod.z.string().optional(),
age: zod.z.string().optional(),
city: zod.z.string().optional(),
province: zod.z.string().optional(),
postalCode: zod.z.string().optional(),
emailAddress: zod.z.string().optional(),
phoneNumber: zod.z.string().optional(),
countryOfBirth: zod.z.string().optional(),
middleName: zod.z.string().optional()
}).optional(),
authenticateSPResult: zod.z.object({
AuthenticationID: zod.z.string().optional(),
Timestamp: zod.z.string().optional(),
CustomerRef: zod.z.string().optional(),
ProfileID: zod.z.string().optional(),
ProfileName: zod.z.string().optional(),
ProfileVersion: zod.z.number()["int"]().optional(),
ProfileRevision: zod.z.number()["int"]().optional(),
ProfileState: zod.z.string().optional(),
ResultCodes: zod.z.object({
GlobalItemCheckResultCodes: zod.z.array(zod.z.object({
Name: zod.z.string().optional(),
Description: zod.z.string().optional(),
Comment: zod.z.record(zod.z.any()).optional(),
Match: zod.z.record(zod.z.any()).optional(),
Warning: zod.z.record(zod.z.any()).optional(),
ID: zod.z.number()["int"]().optional(),
Pass: zod.z.string().optional(),
Address: zod.z.string().optional(),
Forename: zod.z.string().optional(),
Surname: zod.z.string().optional(),
DOB: zod.z.string().optional(),
Alert: zod.z.string().optional(),
SanctionsMatches: zod.z.union([zod.z.record(zod.z.any()), zod.z.string()]).optional()
})).optional()
}).strict().optional(),
Score: zod.z.number()["int"]().optional(),
BandText: zod.z.string().optional(),
Country: zod.z.string().optional()
}).optional(),
pepIntelligenceResult: zod.z.array(zod.z.object({
Fullname: zod.z.string().optional(),
Aliases: zod.z.object({
"a:string": zod.z.array(zod.z.string()).optional()
}).optional(),
SanctionsAddresses: zod.z.object({
GlobalSanctionsAddress: zod.z.array(zod.z.object({
AddressLine: zod.z.string().optional(),
City: zod.z.string().optional(),
Country: zod.z.string().optional(),
Region: zod.z.string().optional()
})).optional()
}).optional(),
SanctionsDates: zod.z.object({
GlobalSanctionsDate: zod.z.object({
DateType: zod.z.string().optional(),
Day: zod.z.number()["int"]().optional(),
Month: zod.z.number()["int"]().optional(),
Year: zod.z.number()["int"]().optional()
}).optional()
}).optional(),
IdentityInformation: zod.z.string().optional(),
SanctionsPositions: zod.z.object({
GlobalSanctionsPosition: zod.z.array(zod.z.object({
Position: zod.z.string().optional(),
Country: zod.z.string().optional()
})).optional()
}).optional()
})).optional(),
sanctionsEnforcementsResult: zod.z.array(zod.z.object({
Fullname: zod.z.string().optional(),
SanctionsBodies: zod.z.object({
"a:string": zod.z.array(zod.z.number()["int"]()).optional()
}).optional(),
Aliases: zod.z.object({
"a:string": zod.z.array(zod.z.string()).optional()
}).optional(),
SanctionsAddresses: zod.z.object({
GlobalSanctionsAddress: zod.z.array(zod.z.object({
AddressLine: zod.z.string().optional(),
City: zod.z.string().optional(),
Country: zod.z.string().optional(),
Region: zod.z.string().optional()
})).optional()
}).optional(),
SanctionsDates: zod.z.object({
GlobalSanctionsDate: zod.z.object({
DateType: zod.z.string().optional(),
Day: zod.z.number()["int"]().optional(),
Month: zod.z.number()["int"]().optional(),
Year: zod.z.number()["int"]().optional()
}).optional()
}).optional(),
IdentityInformation: zod.z.string().optional()
})).optional()
}).strict(),
originalData: zod.z.object({
data: zod.z.object({
citizenship: zod.z.string().optional(),
documentType: zod.z.string().optional(),
firstName: zod.z.string().optional(),
lastName: zod.z.string().optional(),
gender: zod.z.string().optional(),
addressLine1: zod.z.string().nullable().optional(),
addressLine2: zod.z.string().nullable().optional(),
birthday: zod.z.string().optional(),
age: zod.z.string().optional()
}).optional(),
authenticateSPResult: zod.z.object({
AuthenticationID: zod.z.string().optional(),
Timestamp: zod.z.string().optional(),
CustomerRef: zod.z.string().optional(),
ProfileID: zod.z.string().optional(),
ProfileName: zod.z.string().optional(),
ProfileVersion: zod.z.number()["int"]().optional(),
ProfileRevision: zod.z.number()["int"]().optional(),
ProfileState: zod.z.string().optional(),
ResultCodes: zod.z.object({
GlobalItemCheckResultCodes: zod.z.array(zod.z.object({
Name: zod.z.string().optional(),
Description: zod.z.string().optional(),
Comment: zod.z.record(zod.z.any()).optional(),
Match: zod.z.record(zod.z.any()).optional(),
Warning: zod.z.record(zod.z.any()).optional(),
ID: zod.z.number()["int"]().optional(),
Pass: zod.z.string().optional(),
Address: zod.z.string().optional(),
Forename: zod.z.string().optional(),
Surname: zod.z.string().optional(),
DOB: zod.z.string().optional(),
Alert: zod.z.string().optional(),
SanctionsMatches: zod.z.union([zod.z.record(zod.z.any()), zod.z.string()]).optional()
})).optional()
}).strict().optional(),
Score: zod.z.number()["int"]().optional(),
BandText: zod.z.string().optional(),
Country: zod.z.string().optional()
}).optional(),
pepIntelligenceResult: zod.z.array(zod.z.object({
Fullname: zod.z.string().optional(),
Aliases: zod.z.object({
"a:string": zod.z.array(zod.z.string()).optional()
}).optional(),
SanctionsAddresses: zod.z.object({
GlobalSanctionsAddress: zod.z.array(zod.z.object({
AddressLine: zod.z.string().optional(),
City: zod.z.string().optional(),
Country: zod.z.string().optional(),
Region: zod.z.string().optional()
})).optional()
}).optional(),
SanctionsDates: zod.z.object({
GlobalSanctionsDate: zod.z.object({
DateType: zod.z.string().optional(),
Day: zod.z.number()["int"]().optional(),
Month: zod.z.number()["int"]().optional(),
Year: zod.z.number()["int"]().optional()
}).optional()
}).optional(),
IdentityInformation: zod.z.string().optional(),
SanctionsPositions: zod.z.object({
GlobalSanctionsPosition: zod.z.array(zod.z.object({
Position: zod.z.string().optional(),
Country: zod.z.string().optional()
})).optional()
}).optional()
})).optional(),
sanctionsEnforcementsResult: zod.z.array(zod.z.object({
Fullname: zod.z.string().optional(),
SanctionsBodies: zod.z.object({
"a:string": zod.z.array(zod.z.number()["int"]()).optional()
}).optional(),
Aliases: zod.z.object({
"a:string": zod.z.array(zod.z.string()).optional()
}).optional(),
SanctionsAddresses: zod.z.object({
GlobalSanctionsAddress: zod.z.array(zod.z.object({
AddressLine: zod.z.string().optional(),
City: zod.z.string().optional(),
Country: zod.z.string().optional(),
Region: zod.z.string().optional()
})).optional()
}).optional(),
SanctionsDates: zod.z.object({
GlobalSanctionsDate: zod.z.object({
DateType: zod.z.string().optional(),
Day: zod.z.number()["int"]().optional(),
Month: zod.z.number()["int"]().optional(),
Year: zod.z.number()["int"]().optional()
}).optional()
}).optional(),
IdentityInformation: zod.z.string().optional()
})).optional()
}).strict(),
personalDetails: zod.z.object({
citizenship: zod.z.string().optional(),
documentType: zod.z.string().optional(),
firstName: zod.z.string().optional(),
lastName: zod.z.string().optional(),
gender: zod.z.string().optional(),
addressLine1: zod.z.string().nullable().optional(),
addressLine2: zod.z.string().nullable().optional(),
birthday: zod.z.string().optional(),
placeOfBirth: zod.z.string().optional(),
countryOfResidence: zod.z.string().optional(),
age: zod.z.string().optional(),
city: zod.z.string().optional(),
province: zod.z.string().optional(),
postalCode: zod.z.string().optional(),
emailAddress: zod.z.string().optional(),
phoneNumber: zod.z.string().optional(),
countryOfBirth: zod.z.string().optional(),
middleName: zod.z.string().optional()
}).strict(),
id: zod.z.string()
});
var IDScanPassportV1CredentialSubjectSchema = zod.z.object({
id: zod.z.string(),
journeyId: zod.z.string().describe("The ID of the journey that this credential is associated with"),
base64: zod.z.string().describe("Base64 encoded image of the passport image"),
name: zod.z.string().describe("Name of the docuemnt (e.g. passport.jpg)"),
documentType: zod.z.string().describe("Type of the document (e.g. image/jpeg, image/png)")
});
var IDScanSelfieV1CredentialSubjectSchema = zod.z.object({
id: zod.z.string(),
journeyId: zod.z.string().describe("The ID of the journey that this credential is associated with"),
base64: zod.z.string().describe("Base64 encoded image of the selfie image"),
name: zod.z.string().describe("Name of the docuemnt (e.g. selfie.jpg)"),
documentType: zod.z.string().describe("Type of the document (e.g. image/jpeg, image/png)")
});
var IDScanV2CredentialSubjectSchema = zod.z.object({
journeyId: zod.z.string().nullable(),
highLevelResult: zod.z.string().nullable().optional(),
firstName: zod.z.string().nullable().optional(),
middleName: zod.z.string().nullable().optional(),
lastName: zod.z.string().nullable().optional(),
gender: zod.z.string().nullable().optional(),
age: zod.z.string().nullable().optional(),
citizenship: zod.z.string().nullable().optional(),
documentCategory: zod.z.string().nullable().optional(),
documentName: zod.z.string().nullable().optional(),
documentSide: zod.z.string().nullable().optional(),
documentType: zod.z.string().nullable().optional(),
entryDate: zod.z.string().nullable().optional(),
entryTime: zod.z.string().nullable().optional(),
fullName: zod.z.string().nullable().optional(),
addressLine1: zod.z.string().nullable().optional(),
addressLine2: zod.z.string().nullable().optional(),
birthDate: zod.z.string().nullable().optional(),
birthPlace: zod.z.string().nullable().optional(),
highLevelResultDetails: zod.z.object({
documentOverallValidation: zod.z.string().optional(),
documentBlockingPolicy: zod.z.string().optional(),
documentExpiry: zod.z.string().optional(),
documentSupport: zod.z.string().optional(),
documentValidation: zod.z.string().optional(),
faceMatchValidation: zod.z.string().optional(),
accumulativeLivenessResult: zod.z.string().optional()
}).nullable().optional(),
faceMatchScore: zod.z.string().nullable().optional(),
qualityCheckDetails: zod.z.array(zod.z.object({
id: zod.z.string().optional(),
title: zod.z.string().optional(),
description: zod.z.string().optional(),
state: zod.z.number()["int"]().optional()
})).nullable().optional(),
validationDetails: zod.z.array(zod.z.object({
name: zod.z.string().optional(),
description: zod.z.string().optional(),
result: zod.z.number()["int"]().optional()
})).nullable().optional(),
id: zod.z.string()
});
var ProofOfResidenceV6CredentialSubjectSchema = zod.z.object({
id: zod.z.string(),
journeyId: zod.z.string().describe("The ID of the journey that this credential is associated with"),
country: zod.z.string().describe("The country of residence"),
base64: zod.z.string().describe("Base64 encoded image of the proof of residence"),
name: zod.z.string().describe("Name of the docuemnt (e.g. proofOfResidence.jpg)"),
documentType: zod.z.string().describe("Type of the document (e.g. image/jpeg, image/png)")
});
var CredentialTypes = ["ID3-v7", "ProofOfResidenceV6", "IDScanSelfieV1", "IDScanPassportV1", "IDScanV2"];
var CredentialTypesSchema = zod.z.string().transform(function (x) {
return x.replace("_", "-");
}).pipe(zod.z["enum"](CredentialTypes));
var VerifiableCredentialSchema = zod.z.object({
issuer: zod.z.string(),
type: zod.z.array(zod.z.union([zod.z.string(), CredentialTypesSchema])),
credentialSubject: zod.z.object({
journeyId: zod.z.string()
}).catchall(zod.z.any())
}).catchall(zod.z.any());
var CredentialZodSchemas = zod.z.union([ID3_7CredentialSubjectSchema, ProofOfResidenceV6CredentialSubjectSchema, IDScanSelfieV1CredentialSubjectSchema, IDScanPassportV1CredentialSubjectSchema, IDScanV2CredentialSubjectSchema]);
/**
* Recursively remove empty strings from object
* @param obj
*/
function removeEmptyStringAttributes(obj) {
if (_typeof(obj) !== "object" || obj === null) {
return obj;
}
for (var key in obj) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
if (obj[key] === "" || obj[key] === null || obj[key] === undefined) {
// remove key if value is empty string
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
delete obj[key];
} else {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
if (_typeof(obj[key]) === "object") {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
obj[key] = removeEmptyStringAttributes(obj[key]);
}
}
}
return obj;
}
var CredentialSchemas = {
"ID3-v7": {
url: "https://raw.githubusercontent.com/NexeraProtocol/vc-schemas/main/examples/id3/v7/id3.json",
zod: ID3_7CredentialSubjectSchema
},
ProofOfResidenceV6: {
url: "https://raw.githubusercontent.com/NexeraProtocol/vc-schemas/main/examples/proofOfResidence/v6/proofOfResidence.json",
zod: ProofOfResidenceV6CredentialSubjectSchema
},
IDScanSelfieV1: {
url: "https://raw.githubusercontent.com/NexeraProtocol/vc-schemas/main/examples/idScanSelfie/v1/idScanSelfie.json",
zod: IDScanSelfieV1CredentialSubjectSchema
},
IDScanPassportV1: {
url: "https://raw.githubusercontent.com/NexeraProtocol/vc-schemas/main/examples/idScanPassport/v1/idScanPassport.json",
zod: IDScanPassportV1CredentialSubjectSchema
},
IDScanV2: {
url: "https://raw.githubusercontent.com/NexeraProtocol/vc-schemas/main/examples/idscan/v2/idscan.json",
// check attributes for emptry strings and convert to null
zod: IDScanV2CredentialSubjectSchema.transform(function (obj) {
return removeEmptyStringAttributes(obj);
})
}
};
var GenericVerifiableCredentialSchema = zod.z.object({
credentialSubject: zod.z.record(zod.z.unknown()),
type: zod.z.array(zod.z.string())
}).nonstrict();
exports.CredentialSchemas = CredentialSchemas;
exports.CredentialTypes = CredentialTypes;
exports.CredentialTypesSchema = CredentialTypesSchema;
exports.CredentialZodSchemas = CredentialZodSchemas;
exports.GenericVerifiableCredentialSchema = GenericVerifiableCredentialSchema;
exports.VerifiableCredentialSchema = VerifiableCredentialSchema;
exports.CredentialSchemas = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.CredentialSchemas;
exports.CredentialTypes = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.CredentialTypes;
exports.CredentialTypesSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.CredentialTypesSchema;
exports.CredentialZodSchemas = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.CredentialZodSchemas;
exports.GenericVerifiableCredentialSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.GenericVerifiableCredentialSchema;
exports.VerifiableCredentialSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.VerifiableCredentialSchema;

@@ -1,383 +0,2 @@

import { z } from 'zod';
function _typeof(obj) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
}, _typeof(obj);
}
var ID3_7CredentialSubjectSchema = z.object({
journeyId: z.string(),
amendmentsData: z.object({
data: z.object({
citizenship: z.string().optional(),
documentType: z.string().optional(),
firstName: z.string().optional(),
lastName: z.string().optional(),
gender: z.string().optional(),
addressLine1: z.string().nullable().optional(),
addressLine2: z.string().nullable().optional(),
birthday: z.string().optional(),
placeOfBirth: z.string().optional(),
countryOfResidence: z.string().optional(),
age: z.string().optional(),
city: z.string().optional(),
province: z.string().optional(),
postalCode: z.string().optional(),
emailAddress: z.string().optional(),
phoneNumber: z.string().optional(),
countryOfBirth: z.string().optional(),
middleName: z.string().optional()
}).optional(),
authenticateSPResult: z.object({
AuthenticationID: z.string().optional(),
Timestamp: z.string().optional(),
CustomerRef: z.string().optional(),
ProfileID: z.string().optional(),
ProfileName: z.string().optional(),
ProfileVersion: z.number()["int"]().optional(),
ProfileRevision: z.number()["int"]().optional(),
ProfileState: z.string().optional(),
ResultCodes: z.object({
GlobalItemCheckResultCodes: z.array(z.object({
Name: z.string().optional(),
Description: z.string().optional(),
Comment: z.record(z.any()).optional(),
Match: z.record(z.any()).optional(),
Warning: z.record(z.any()).optional(),
ID: z.number()["int"]().optional(),
Pass: z.string().optional(),
Address: z.string().optional(),
Forename: z.string().optional(),
Surname: z.string().optional(),
DOB: z.string().optional(),
Alert: z.string().optional(),
SanctionsMatches: z.union([z.record(z.any()), z.string()]).optional()
})).optional()
}).strict().optional(),
Score: z.number()["int"]().optional(),
BandText: z.string().optional(),
Country: z.string().optional()
}).optional(),
pepIntelligenceResult: z.array(z.object({
Fullname: z.string().optional(),
Aliases: z.object({
"a:string": z.array(z.string()).optional()
}).optional(),
SanctionsAddresses: z.object({
GlobalSanctionsAddress: z.array(z.object({
AddressLine: z.string().optional(),
City: z.string().optional(),
Country: z.string().optional(),
Region: z.string().optional()
})).optional()
}).optional(),
SanctionsDates: z.object({
GlobalSanctionsDate: z.object({
DateType: z.string().optional(),
Day: z.number()["int"]().optional(),
Month: z.number()["int"]().optional(),
Year: z.number()["int"]().optional()
}).optional()
}).optional(),
IdentityInformation: z.string().optional(),
SanctionsPositions: z.object({
GlobalSanctionsPosition: z.array(z.object({
Position: z.string().optional(),
Country: z.string().optional()
})).optional()
}).optional()
})).optional(),
sanctionsEnforcementsResult: z.array(z.object({
Fullname: z.string().optional(),
SanctionsBodies: z.object({
"a:string": z.array(z.number()["int"]()).optional()
}).optional(),
Aliases: z.object({
"a:string": z.array(z.string()).optional()
}).optional(),
SanctionsAddresses: z.object({
GlobalSanctionsAddress: z.array(z.object({
AddressLine: z.string().optional(),
City: z.string().optional(),
Country: z.string().optional(),
Region: z.string().optional()
})).optional()
}).optional(),
SanctionsDates: z.object({
GlobalSanctionsDate: z.object({
DateType: z.string().optional(),
Day: z.number()["int"]().optional(),
Month: z.number()["int"]().optional(),
Year: z.number()["int"]().optional()
}).optional()
}).optional(),
IdentityInformation: z.string().optional()
})).optional()
}).strict(),
originalData: z.object({
data: z.object({
citizenship: z.string().optional(),
documentType: z.string().optional(),
firstName: z.string().optional(),
lastName: z.string().optional(),
gender: z.string().optional(),
addressLine1: z.string().nullable().optional(),
addressLine2: z.string().nullable().optional(),
birthday: z.string().optional(),
age: z.string().optional()
}).optional(),
authenticateSPResult: z.object({
AuthenticationID: z.string().optional(),
Timestamp: z.string().optional(),
CustomerRef: z.string().optional(),
ProfileID: z.string().optional(),
ProfileName: z.string().optional(),
ProfileVersion: z.number()["int"]().optional(),
ProfileRevision: z.number()["int"]().optional(),
ProfileState: z.string().optional(),
ResultCodes: z.object({
GlobalItemCheckResultCodes: z.array(z.object({
Name: z.string().optional(),
Description: z.string().optional(),
Comment: z.record(z.any()).optional(),
Match: z.record(z.any()).optional(),
Warning: z.record(z.any()).optional(),
ID: z.number()["int"]().optional(),
Pass: z.string().optional(),
Address: z.string().optional(),
Forename: z.string().optional(),
Surname: z.string().optional(),
DOB: z.string().optional(),
Alert: z.string().optional(),
SanctionsMatches: z.union([z.record(z.any()), z.string()]).optional()
})).optional()
}).strict().optional(),
Score: z.number()["int"]().optional(),
BandText: z.string().optional(),
Country: z.string().optional()
}).optional(),
pepIntelligenceResult: z.array(z.object({
Fullname: z.string().optional(),
Aliases: z.object({
"a:string": z.array(z.string()).optional()
}).optional(),
SanctionsAddresses: z.object({
GlobalSanctionsAddress: z.array(z.object({
AddressLine: z.string().optional(),
City: z.string().optional(),
Country: z.string().optional(),
Region: z.string().optional()
})).optional()
}).optional(),
SanctionsDates: z.object({
GlobalSanctionsDate: z.object({
DateType: z.string().optional(),
Day: z.number()["int"]().optional(),
Month: z.number()["int"]().optional(),
Year: z.number()["int"]().optional()
}).optional()
}).optional(),
IdentityInformation: z.string().optional(),
SanctionsPositions: z.object({
GlobalSanctionsPosition: z.array(z.object({
Position: z.string().optional(),
Country: z.string().optional()
})).optional()
}).optional()
})).optional(),
sanctionsEnforcementsResult: z.array(z.object({
Fullname: z.string().optional(),
SanctionsBodies: z.object({
"a:string": z.array(z.number()["int"]()).optional()
}).optional(),
Aliases: z.object({
"a:string": z.array(z.string()).optional()
}).optional(),
SanctionsAddresses: z.object({
GlobalSanctionsAddress: z.array(z.object({
AddressLine: z.string().optional(),
City: z.string().optional(),
Country: z.string().optional(),
Region: z.string().optional()
})).optional()
}).optional(),
SanctionsDates: z.object({
GlobalSanctionsDate: z.object({
DateType: z.string().optional(),
Day: z.number()["int"]().optional(),
Month: z.number()["int"]().optional(),
Year: z.number()["int"]().optional()
}).optional()
}).optional(),
IdentityInformation: z.string().optional()
})).optional()
}).strict(),
personalDetails: z.object({
citizenship: z.string().optional(),
documentType: z.string().optional(),
firstName: z.string().optional(),
lastName: z.string().optional(),
gender: z.string().optional(),
addressLine1: z.string().nullable().optional(),
addressLine2: z.string().nullable().optional(),
birthday: z.string().optional(),
placeOfBirth: z.string().optional(),
countryOfResidence: z.string().optional(),
age: z.string().optional(),
city: z.string().optional(),
province: z.string().optional(),
postalCode: z.string().optional(),
emailAddress: z.string().optional(),
phoneNumber: z.string().optional(),
countryOfBirth: z.string().optional(),
middleName: z.string().optional()
}).strict(),
id: z.string()
});
var IDScanPassportV1CredentialSubjectSchema = z.object({
id: z.string(),
journeyId: z.string().describe("The ID of the journey that this credential is associated with"),
base64: z.string().describe("Base64 encoded image of the passport image"),
name: z.string().describe("Name of the docuemnt (e.g. passport.jpg)"),
documentType: z.string().describe("Type of the document (e.g. image/jpeg, image/png)")
});
var IDScanSelfieV1CredentialSubjectSchema = z.object({
id: z.string(),
journeyId: z.string().describe("The ID of the journey that this credential is associated with"),
base64: z.string().describe("Base64 encoded image of the selfie image"),
name: z.string().describe("Name of the docuemnt (e.g. selfie.jpg)"),
documentType: z.string().describe("Type of the document (e.g. image/jpeg, image/png)")
});
var IDScanV2CredentialSubjectSchema = z.object({
journeyId: z.string().nullable(),
highLevelResult: z.string().nullable().optional(),
firstName: z.string().nullable().optional(),
middleName: z.string().nullable().optional(),
lastName: z.string().nullable().optional(),
gender: z.string().nullable().optional(),
age: z.string().nullable().optional(),
citizenship: z.string().nullable().optional(),
documentCategory: z.string().nullable().optional(),
documentName: z.string().nullable().optional(),
documentSide: z.string().nullable().optional(),
documentType: z.string().nullable().optional(),
entryDate: z.string().nullable().optional(),
entryTime: z.string().nullable().optional(),
fullName: z.string().nullable().optional(),
addressLine1: z.string().nullable().optional(),
addressLine2: z.string().nullable().optional(),
birthDate: z.string().nullable().optional(),
birthPlace: z.string().nullable().optional(),
highLevelResultDetails: z.object({
documentOverallValidation: z.string().optional(),
documentBlockingPolicy: z.string().optional(),
documentExpiry: z.string().optional(),
documentSupport: z.string().optional(),
documentValidation: z.string().optional(),
faceMatchValidation: z.string().optional(),
accumulativeLivenessResult: z.string().optional()
}).nullable().optional(),
faceMatchScore: z.string().nullable().optional(),
qualityCheckDetails: z.array(z.object({
id: z.string().optional(),
title: z.string().optional(),
description: z.string().optional(),
state: z.number()["int"]().optional()
})).nullable().optional(),
validationDetails: z.array(z.object({
name: z.string().optional(),
description: z.string().optional(),
result: z.number()["int"]().optional()
})).nullable().optional(),
id: z.string()
});
var ProofOfResidenceV6CredentialSubjectSchema = z.object({
id: z.string(),
journeyId: z.string().describe("The ID of the journey that this credential is associated with"),
country: z.string().describe("The country of residence"),
base64: z.string().describe("Base64 encoded image of the proof of residence"),
name: z.string().describe("Name of the docuemnt (e.g. proofOfResidence.jpg)"),
documentType: z.string().describe("Type of the document (e.g. image/jpeg, image/png)")
});
var CredentialTypes = ["ID3-v7", "ProofOfResidenceV6", "IDScanSelfieV1", "IDScanPassportV1", "IDScanV2"];
var CredentialTypesSchema = z.string().transform(function (x) {
return x.replace("_", "-");
}).pipe(z["enum"](CredentialTypes));
var VerifiableCredentialSchema = z.object({
issuer: z.string(),
type: z.array(z.union([z.string(), CredentialTypesSchema])),
credentialSubject: z.object({
journeyId: z.string()
}).catchall(z.any())
}).catchall(z.any());
var CredentialZodSchemas = z.union([ID3_7CredentialSubjectSchema, ProofOfResidenceV6CredentialSubjectSchema, IDScanSelfieV1CredentialSubjectSchema, IDScanPassportV1CredentialSubjectSchema, IDScanV2CredentialSubjectSchema]);
/**
* Recursively remove empty strings from object
* @param obj
*/
function removeEmptyStringAttributes(obj) {
if (_typeof(obj) !== "object" || obj === null) {
return obj;
}
for (var key in obj) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
if (obj[key] === "" || obj[key] === null || obj[key] === undefined) {
// remove key if value is empty string
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
delete obj[key];
} else {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
if (_typeof(obj[key]) === "object") {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
obj[key] = removeEmptyStringAttributes(obj[key]);
}
}
}
return obj;
}
var CredentialSchemas = {
"ID3-v7": {
url: "https://raw.githubusercontent.com/NexeraProtocol/vc-schemas/main/examples/id3/v7/id3.json",
zod: ID3_7CredentialSubjectSchema
},
ProofOfResidenceV6: {
url: "https://raw.githubusercontent.com/NexeraProtocol/vc-schemas/main/examples/proofOfResidence/v6/proofOfResidence.json",
zod: ProofOfResidenceV6CredentialSubjectSchema
},
IDScanSelfieV1: {
url: "https://raw.githubusercontent.com/NexeraProtocol/vc-schemas/main/examples/idScanSelfie/v1/idScanSelfie.json",
zod: IDScanSelfieV1CredentialSubjectSchema
},
IDScanPassportV1: {
url: "https://raw.githubusercontent.com/NexeraProtocol/vc-schemas/main/examples/idScanPassport/v1/idScanPassport.json",
zod: IDScanPassportV1CredentialSubjectSchema
},
IDScanV2: {
url: "https://raw.githubusercontent.com/NexeraProtocol/vc-schemas/main/examples/idscan/v2/idscan.json",
// check attributes for emptry strings and convert to null
zod: IDScanV2CredentialSubjectSchema.transform(function (obj) {
return removeEmptyStringAttributes(obj);
})
}
};
var GenericVerifiableCredentialSchema = z.object({
credentialSubject: z.record(z.unknown()),
type: z.array(z.string())
}).nonstrict();
export { CredentialSchemas, CredentialTypes, CredentialTypesSchema, CredentialZodSchemas, GenericVerifiableCredentialSchema, VerifiableCredentialSchema };
export { f as CredentialSchemas, C as CredentialTypes, d as CredentialTypesSchema, e as CredentialZodSchemas, G as GenericVerifiableCredentialSchema, V as VerifiableCredentialSchema } from '../../../../dist/vc-schemas-bcbe3142.esm.js';
import 'zod';

@@ -275,1 +275,3 @@ import { z } from "zod";

export type KycCompletionData = z.infer<typeof KycCompletitionDataSchema>;
export declare const IdentifierSchema: z.ZodUnion<[z.ZodLiteral<"verify">, z.ZodLiteral<"management">]>;
export type Identifier = z.infer<typeof IdentifierSchema>;

@@ -55,1 +55,2 @@ import { z } from "zod";

export type Subgraph = (typeof Subgraphs)[number];
export * from "./compliance/index.js";

@@ -6,2 +6,5 @@ 'use strict';

var zod = require('zod');
var compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc = require('./kyc-fc1f5193.cjs.dev.js');
var compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas = require('./vc-schemas-f4be799d.cjs.dev.js');
var i18nIsoCountries = require('i18n-iso-countries');

@@ -39,2 +42,483 @@ function _toPrimitive(input, hint) {

var IDScanCredentialSubjectSchema = zod.z.object({
journeyId: zod.z.string(),
highLevelResult: zod.z.string(),
firstName: zod.z.string(),
middleName: zod.z.string().optional(),
lastName: zod.z.string(),
gender: zod.z.string(),
age: zod.z.string(),
citizenship: zod.z.string(),
documentCategory: zod.z.string(),
documentName: zod.z.string(),
documentSide: zod.z.string(),
documentType: zod.z.string(),
entryDate: zod.z.string(),
entryTime: zod.z.string(),
fullName: zod.z.string(),
addressLine1: zod.z.string().nullable().optional(),
addressLine2: zod.z.string().nullable().optional(),
birthDate: zod.z.string(),
birthPlace: zod.z.string(),
highLevelResultDetails: zod.z.object({
documentOverallValidation: zod.z.string().optional(),
documentBlockingPolicy: zod.z.string().optional(),
documentExpiry: zod.z.string().optional(),
documentSupport: zod.z.string().optional(),
documentValidation: zod.z.string().optional(),
faceMatchValidation: zod.z.string().optional(),
accumulativeLivenessResult: zod.z.string().optional()
}),
faceMatchScore: zod.z.string(),
qualityCheckDetails: zod.z.array(zod.z.object({
id: zod.z.string().optional(),
title: zod.z.string().optional(),
description: zod.z.string().optional(),
state: zod.z.number()["int"]().optional()
})),
validationDetails: zod.z.array(zod.z.object({
name: zod.z.string().optional(),
description: zod.z.string().optional(),
result: zod.z.number()["int"]().optional()
})),
id: zod.z.string()
});
//AuthenticateSP
var GlobalItemCheckResultCodeSchema = zod.z.object({
Code: zod.z.number()["int"]().optional(),
Description: zod.z.string().optional()
});
var GlobalItemCheckResultCodeWrapperSchema = zod.z.object({
GlobalItemCheckResultCode: zod.z.union([GlobalItemCheckResultCodeSchema, zod.z.array(GlobalItemCheckResultCodeSchema)]).transform(function (value) {
return Array.isArray(value) ? value : [value];
}).optional()
});
var GlobalSanctionsMatchObjectSchema = zod.z.object({
SanctionID: zod.z.union([zod.z.number()["int"](), zod.z.string()]).optional(),
Url: zod.z.string().optional(),
Rank: zod.z.number()["int"]().optional(),
CaseID: zod.z.string().optional(),
SearchID: zod.z.string().optional()
});
var GlobalSanctionsMatchSchema = zod.z.union([GlobalSanctionsMatchObjectSchema, zod.z.array(GlobalSanctionsMatchObjectSchema)]);
var SanctionsMatchesSchema = zod.z.object({
GlobalSanctionsMatch: GlobalSanctionsMatchSchema.transform(function (value) {
return Array.isArray(value) ? value : [value];
})
});
var GlobalItemCheckResultCodesObjectSchema = zod.z.object({
Name: zod.z.string().optional(),
Description: zod.z.string().optional(),
Comment: GlobalItemCheckResultCodeWrapperSchema.optional(),
Match: GlobalItemCheckResultCodeWrapperSchema.optional(),
Warning: GlobalItemCheckResultCodeWrapperSchema.optional(),
Mismatch: GlobalItemCheckResultCodeWrapperSchema.optional(),
ID: zod.z.number()["int"]().optional(),
Pass: zod.z.string().optional(),
Address: zod.z.string().optional(),
Forename: zod.z.string().optional(),
Surname: zod.z.string().optional(),
DOB: zod.z.string().optional(),
Alert: zod.z.string().optional(),
SanctionsMatches: zod.z.union([zod.z.string().max(0), SanctionsMatchesSchema]).transform(function (value) {
if (compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas._typeof(value) !== "object") return {
GlobalSanctionsPosition: []
};
return value;
}).optional()
});
var GlobalItemCheckDecisionBandsSchema = zod.z.object({
ID: zod.z.number()["int"]().optional(),
BandScore: zod.z.number()["int"]().optional(),
BandText: zod.z.string().optional()
});
//copied from /packages/libs/schemas/src/compliance/vc-schemas/ID3_7CredentialSubjectSchema.ts
var AuthenticateSPResultSchema = zod.z.object({
AuthenticationID: zod.z.string().optional(),
Timestamp: zod.z.string().optional(),
CustomerRef: zod.z.string().optional(),
ProfileID: zod.z.string().optional(),
ProfileName: zod.z.string().optional(),
ProfileVersion: zod.z.number()["int"]().optional(),
ProfileRevision: zod.z.number()["int"]().optional(),
ProfileState: zod.z.string().optional(),
ResultCodes: zod.z.object({
GlobalItemCheckResultCodes: zod.z.union([GlobalItemCheckResultCodesObjectSchema, zod.z.array(GlobalItemCheckResultCodesObjectSchema)]).transform(function (value) {
return Array.isArray(value) ? value : [value];
}).optional()
}).strict().optional(),
Score: zod.z.number()["int"]().optional(),
BandText: zod.z.string().optional(),
Country: zod.z.string().optional(),
ItemCheckDecisionBands: zod.z.object({
GlobalItemCheckDecisionBands: zod.z.union([GlobalItemCheckDecisionBandsSchema, zod.z.array(GlobalItemCheckDecisionBandsSchema)]).transform(function (value) {
return Array.isArray(value) ? value : [value];
}).optional()
}).optional()
});
var GBGAuthenticateSPDataSchema = zod.z.object({
Timestamp: zod.z.string().optional(),
"s:Envelope": zod.z.object({
"s:Header": zod.z.object({
"o:Security": zod.z.object({
"u:Timestamp": zod.z.object({
"u:Created": zod.z.string(),
"u:Expires": zod.z.string()
})
})
}),
"s:Body": zod.z.object({
AuthenticateSPResponse: zod.z.object({
AuthenticateSPResult: AuthenticateSPResultSchema
})
})
})
});
var parseGBGAuthenticateSPData = function parseGBGAuthenticateSPData(obj) {
return GBGAuthenticateSPDataSchema.strip().parse(obj);
};
var ExtractedFieldSchema = zod.z.object({
Name: zod.z.string(),
Value: zod.z.string(),
OCRValue: zod.z.string().optional(),
LocalValue: zod.z.string().optional(),
OCRLocalValue: zod.z.string().optional()
});
var GlobalSanctionsAddressObjectSchema = zod.z.object({
AddressLine: zod.z.string().optional(),
City: zod.z.string().optional(),
Country: zod.z.string().optional(),
Region: zod.z.string().optional()
});
var GlobalSanctionsAddressSchema = zod.z.union([GlobalSanctionsAddressObjectSchema, zod.z.array(GlobalSanctionsAddressObjectSchema)]).transform(function (value) {
return Array.isArray(value) ? value : [value];
}).optional();
var StringOrArrayOfStringSchema = zod.z.union([zod.z.string(), zod.z.array(zod.z.string())]);
var AliasesStringSchema = zod.z.object({
"a:string": StringOrArrayOfStringSchema.transform(function (value) {
return Array.isArray(value) ? value : [value];
})
});
var AliasesSchema = zod.z.union([zod.z.string().max(0), AliasesStringSchema]).transform(function (value) {
if (compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas._typeof(value) !== "object") return {
"a:string": []
};
return value;
}).optional();
//PEP
var GlobalSanctionsPositionObjectSchema = zod.z.object({
Position: zod.z.string().optional(),
Country: zod.z.string().optional()
});
var GlobalSanctionsPositionSchema = zod.z.union([GlobalSanctionsPositionObjectSchema, zod.z.array(GlobalSanctionsPositionObjectSchema)]);
var SanctionsPositionSchema = zod.z.object({
GlobalSanctionsPosition: GlobalSanctionsPositionSchema.transform(function (value) {
return Array.isArray(value) ? value : [value];
})
});
//copied from /packages/libs/schemas/src/compliance/vc-schemas/ID3_7CredentialSubjectSchema.ts
var PepIntelligenceResultSchema = zod.z.object({
Fullname: zod.z.string().optional(),
Aliases: AliasesSchema,
SanctionsAddresses: zod.z.object({
GlobalSanctionsAddress: GlobalSanctionsAddressSchema
}).optional(),
SanctionsDates: zod.z.object({
GlobalSanctionsDate: zod.z.object({
DateType: zod.z.string().optional(),
Day: zod.z.number()["int"]().optional(),
Month: zod.z.number()["int"]().optional(),
Year: zod.z.number()["int"]().optional()
}).optional()
}).optional(),
IdentityInformation: zod.z.string().optional(),
SanctionsPositions: zod.z.union([zod.z.string().max(0), SanctionsPositionSchema]).transform(function (value) {
if (compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas._typeof(value) !== "object") return {
GlobalSanctionsPosition: []
};
return value;
}).optional()
});
var GBGPepIntelligenceDataSchema = zod.z.object({
"s:Envelope": zod.z.object({
"s:Body": zod.z.object({
GetPEPIntelligenceDataResponse: zod.z.object({
GetPEPIntelligenceDataResult: PepIntelligenceResultSchema
})
})
})
});
var parseGBGPepIntelligence = function parseGBGPepIntelligence(obj) {
return GBGPepIntelligenceDataSchema.strip().parse(obj);
};
//SanctionsEnforcements
var IntegerOrArrayOfIntegerSchema = zod.z.union([zod.z.number()["int"](), zod.z.array(zod.z.number()["int"]())]);
var SanctionsBodiesSchema = zod.z.object({
"a:string": IntegerOrArrayOfIntegerSchema.transform(function (value) {
return Array.isArray(value) ? value : [value];
})
});
//copied from /packages/libs/schemas/src/compliance/vc-schemas/ID3_7CredentialSubjectSchema.ts
var SanctionsEnforcementsResultSchema = zod.z.object({
Fullname: zod.z.string().optional(),
SanctionsBodies: zod.z.union([zod.z.string().max(0), SanctionsBodiesSchema]).transform(function (value) {
if (compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas._typeof(value) !== "object") return {
"a:string": []
};
return value;
}).optional(),
Aliases: AliasesSchema,
SanctionsAddresses: zod.z.object({
GlobalSanctionsAddress: GlobalSanctionsAddressSchema
}).optional(),
SanctionsDates: zod.z.object({
GlobalSanctionsDate: zod.z.object({
DateType: zod.z.string().optional(),
Day: zod.z.number()["int"]().optional(),
Month: zod.z.number()["int"]().optional(),
Year: zod.z.number()["int"]().optional()
}).optional()
}).optional(),
IdentityInformation: zod.z.string().optional()
});
var GBGSanctionsEnforcementsDataSchema = zod.z.object({
"s:Envelope": zod.z.object({
"s:Body": zod.z.object({
GetSanctionsEnforcementsDataResponse: zod.z.object({
GetSanctionsEnforcementsDataResult: SanctionsEnforcementsResultSchema
})
})
})
});
var parseGBGSanctionsEnforcement = function parseGBGSanctionsEnforcement(obj) {
return GBGSanctionsEnforcementsDataSchema.strip().parse(obj);
};
// TODO: break this down in multiple files
var GBGPersonalDetailsSchema = zod.z.object({
addressLine1: zod.z.string().optional(),
addressLine2: zod.z.string().optional(),
postalCode: zod.z.string().optional(),
emailAddress: zod.z.string().optional(),
phoneNumber: zod.z.string().optional(),
firstName: zod.z.string().optional(),
lastName: zod.z.string().optional(),
birthday: zod.z.string().optional()
});
// GBG Scan
var GBGScanResponseSimpleSchema = zod.z.object({
ProcessedDocuments: zod.z.array(zod.z.object({
ExtractedFields: zod.z.array(ExtractedFieldSchema),
DocumentCategory: zod.z.string(),
FaceMatchConfidenceScore: zod.z.string().optional()
})),
JourneyId: zod.z.string(),
HighLevelResult: zod.z.string(),
HighLevelResultDetails: zod.z.array(zod.z.string()).min(12)
});
//WIP adding all the new fields (will use .strip() in the meantime)
var FullGBGScanResponseSimpleSchema = zod.z.object({
JourneyId: zod.z.string(),
HighLevelResult: zod.z.string(),
HighLevelResultDetails: zod.z.array(zod.z.string()),
InitiatedDateTime: zod.z.string(),
ProcessedDocuments: zod.z.array(zod.z.union([zod.z.object({
IssuingCountryCode: zod.z.string(),
IssuingCountryName: zod.z.string(),
IssuingStateName: zod.z.string(),
DocumentCategory: zod.z.string(),
DocumentType: zod.z.string(),
DocumentName: zod.z.string(),
DocumentSide: zod.z.string(),
IsValidated: zod.z.string(),
ScanDateTime: zod.z.string(),
HighLevelResult: zod.z.string(),
ExtractedFields: zod.z.array(ExtractedFieldSchema),
DocumentImages: zod.z.array(zod.z.object({
Role: zod.z.string(),
Url: zod.z.string()
}))
}), zod.z.object({
DocumentCategory: zod.z.string(),
DocumentType: zod.z.string(),
IsValidated: zod.z.string(),
ScanDateTime: zod.z.string(),
HighLevelResult: zod.z.string(),
FaceMatchConfidenceScore: zod.z.string(),
ExtractedFields: zod.z.array(ExtractedFieldSchema),
DocumentImages: zod.z.array(zod.z.object({
Role: zod.z.string(),
Url: zod.z.string()
}))
})])),
ReferenceNumber: zod.z.string(),
AuthenticationToleranceLevel: zod.z.string(),
LastDecision: zod.z.object({
DecisionCode: zod.z.string(),
DecisionDateTime: zod.z.string(),
DecisionId: zod.z.string(),
Origin: zod.z.string()
}),
AdditionalData: zod.z.array(zod.z.object({
Name: zod.z.string(),
Value: zod.z.string()
})),
MetaData: zod.z.array(zod.z.any()),
ProcessedLiveness: zod.z.object({
LivenessOverallResult: zod.z.string(),
LivenessOverallFailureReason: zod.z.string(),
LivenessActions: zod.z.array(zod.z.object({
ActionNo: zod.z.string(),
ActionType: zod.z.string(),
Result: zod.z.string(),
Url: zod.z.string()
}))
}),
JourneyImages: zod.z.array(zod.z.object({
StepName: zod.z.string(),
Attempt: zod.z.number(),
ImageRole: zod.z.string(),
ImageUrl: zod.z.string()
})),
JourneySteps: zod.z.array(zod.z.object({
Type: zod.z.string(),
HighLevelResult: zod.z.number(),
FailureReason: zod.z.string(),
TripleScanAttempts: zod.z.string().optional(),
ValidationChecks: zod.z.array(zod.z.string())
})),
ProfileId: zod.z.string(),
IsOcrOnly: zod.z.string()
});
var GBGScanResponseCompleteSchema = zod.z.object({
CountryCode: zod.z.string().optional(),
CountryName: zod.z.string().optional(),
DocumentNumber: zod.z.string().optional(),
WhiteImageUrl: zod.z.string(),
SelfiePhotoImageUrl: zod.z.string(),
Citizenship: zod.z.string().optional(),
ExtractedFields: zod.z.array(ExtractedFieldSchema),
EntryDate: zod.z.string(),
FirstName: zod.z.string(),
MiddleName: zod.z.string().optional(),
LastName: zod.z.string(),
Gender: zod.z.string(),
Age: zod.z.string(),
DocumentCategory: zod.z.string(),
DocumentName: zod.z.string(),
DocumentSide: zod.z.string(),
DocumentType: zod.z.string(),
EntryTime: zod.z.string(),
FullName: zod.z.string(),
QualityCheckDetails: zod.z.array(zod.z.object({
Id: zod.z.string(),
Title: zod.z.string(),
Description: zod.z.string(),
State: zod.z.number()
})),
ValidationDetails: zod.z.array(zod.z.object({
Name: zod.z.string(),
Result: zod.z.number(),
Description: zod.z.string()
}))
});
// ID3 COmplete data
var GBGID3DataSchema = zod.z.object({
Id3AuthenticateSP: GBGAuthenticateSPDataSchema,
Id3PepIntelligenceData: zod.z.array(GBGPepIntelligenceDataSchema),
Id3SanctionsEnforcementsData: zod.z.array(GBGSanctionsEnforcementsDataSchema)
});
// ** Fields **
var EmailAddressSchema = zod.z.preprocess(function (val) {
return val === "" ? undefined : val;
}, zod.z.string().email({
message: "Please enter a valid email."
}));
var BirthdaySchema = zod.z.date().max(new Date(new Date().setFullYear(new Date().getFullYear() - 1)), {
message: "You must be at least 1 year old"
});
var ALPHA3_ENUM_CODES = Object.keys(i18nIsoCountries.getAlpha3Codes());
var alpha3CodeEnum = zod.z["enum"](ALPHA3_ENUM_CODES);
// Possible types of personal data fields
var PersonalDetailFieldSchema = zod.z.union([zod.z.string(), alpha3CodeEnum, EmailAddressSchema, BirthdaySchema, zod.z.undefined()]);
// ** Personal data interfaces **
// can be any validator we want from here: https://github.com/validatorjs/validator.js
var OriginalPersonalDetailsSchema = zod.z.object({
addressLine1: zod.z.string().optional(),
addressLine2: zod.z.string().optional(),
// birthday: BirthdaySchema.optional(), commented to conform to ID3_7CredentialSubjectSchema
birthday: zod.z.string().optional(),
age: zod.z.string().optional(),
citizenship: alpha3CodeEnum,
// ALPHA3
firstName: zod.z.string().optional(),
lastName: zod.z.string().optional(),
documentType: zod.z.string().optional(),
gender: zod.z.string().optional()
});
var PersonalDetailsSchema = OriginalPersonalDetailsSchema.extend({
city: zod.z.string().optional(),
province: zod.z.string().optional(),
countryOfResidence: alpha3CodeEnum,
postalCode: zod.z.string().optional(),
emailAddress: EmailAddressSchema.optional(),
phoneNumber: zod.z.string().optional(),
placeOfBirth: zod.z.string().optional(),
countryOfBirth: alpha3CodeEnum.optional(),
middleName: zod.z.string().optional()
});
var ProofOfResidenceSchema = zod.z.object({
name: zod.z.string(),
type: zod.z.string(),
base64: zod.z.string()
});
var PersonalDataSchema = zod.z.object({
amendmentsData: zod.z.record(PersonalDetailFieldSchema),
originalData: OriginalPersonalDetailsSchema,
personalDetails: PersonalDetailsSchema,
proofOfResidence: ProofOfResidenceSchema.optional()
});
function sortPersonalData(obj) {
if (compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas._typeof(obj) !== "object" || obj === null) {
return obj;
}
if (Array.isArray(obj)) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
return obj.map(function (item) {
return sortPersonalData(item);
});
}
var sortedKeys = Object.keys(obj).sort();
var sortedObj = {};
sortedKeys.forEach(function (key) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
sortedObj[key] = sortPersonalData(obj[key]);
});
return sortedObj;
}
function stringifyAndSortPersonalData(obj) {
return JSON.stringify(sortPersonalData(obj), null, 2);
}
var _NEXERA_CHAIN_RELAYER, _NEXERA_CHAIN_NAMES, _NEXERA_CHAIN_VALUES;

@@ -93,8 +577,53 @@ var NEXERA_RELAYERS = /*#__PURE__*/function (NEXERA_RELAYERS) {

exports.AVAILABLE_FLOWS = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.AVAILABLE_FLOWS;
exports.ApplicationClientDataSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.ApplicationClientDataSchema;
exports.DownloadableKycSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.DownloadableKycSchema;
exports.EncryptedKycKeySchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.EncryptedKycKeySchema;
exports.EncryptedVerifiableCredentialDataSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.EncryptedVerifiableCredentialDataSchema;
exports.EncryptedVerifiableCredentialSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.EncryptedVerifiableCredentialSchema;
exports.IdentifierSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.IdentifierSchema;
exports.KYCDataResponseSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.KYCDataResponseSchema;
exports.KYC_SDK_RESPONSES = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.KYC_SDK_RESPONSES;
exports.KYC_SDK_RESPONSES_DATA = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.KYC_SDK_RESPONSES_DATA;
exports.KycCompletitionDataSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.KycCompletitionDataSchema;
exports.KycSdkResponsesSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.KycSdkResponsesSchema;
exports.SumsubApplicantAddressSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.SumsubApplicantAddressSchema;
exports.SumsubApplicantInfoSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.SumsubApplicantInfoSchema;
exports.SumsubApplicationDataSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.SumsubApplicationDataSchema;
exports.VerificationModeSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.VerificationModeSchema;
exports.VerificationModes = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.VerificationModes;
exports.CredentialSchemas = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.CredentialSchemas;
exports.CredentialTypes = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.CredentialTypes;
exports.CredentialTypesSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.CredentialTypesSchema;
exports.CredentialZodSchemas = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.CredentialZodSchemas;
exports.GenericVerifiableCredentialSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.GenericVerifiableCredentialSchema;
exports.ID3_7CredentialSubjectSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.ID3_7CredentialSubjectSchema;
exports.IDScanPassportV1CredentialSubjectSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.IDScanPassportV1CredentialSubjectSchema;
exports.IDScanSelfieV1CredentialSubjectSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.IDScanSelfieV1CredentialSubjectSchema;
exports.IDScanV2CredentialSubjectSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.IDScanV2CredentialSubjectSchema;
exports.ProofOfResidenceV6CredentialSubjectSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.ProofOfResidenceV6CredentialSubjectSchema;
exports.VerifiableCredentialSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.VerifiableCredentialSchema;
exports.Address0xSchema = Address0xSchema;
exports.AddressSchema = AddressSchema;
exports.AliasesSchema = AliasesSchema;
exports.AliasesStringSchema = AliasesStringSchema;
exports.AuthenticateSPResultSchema = AuthenticateSPResultSchema;
exports.BirthdaySchema = BirthdaySchema;
exports.ChainIdNumberSchema = ChainIdNumberSchema;
exports.ChainIdSchema = ChainIdSchema;
exports.ChainIdStringSchema = ChainIdStringSchema;
exports.EmailAddressSchema = EmailAddressSchema;
exports.EnvironmentSchema = EnvironmentSchema;
exports.ExtractedFieldSchema = ExtractedFieldSchema;
exports.FullGBGScanResponseSimpleSchema = FullGBGScanResponseSimpleSchema;
exports.GBGAuthenticateSPDataSchema = GBGAuthenticateSPDataSchema;
exports.GBGID3DataSchema = GBGID3DataSchema;
exports.GBGPepIntelligenceDataSchema = GBGPepIntelligenceDataSchema;
exports.GBGPersonalDetailsSchema = GBGPersonalDetailsSchema;
exports.GBGSanctionsEnforcementsDataSchema = GBGSanctionsEnforcementsDataSchema;
exports.GBGScanResponseCompleteSchema = GBGScanResponseCompleteSchema;
exports.GBGScanResponseSimpleSchema = GBGScanResponseSimpleSchema;
exports.GlobalSanctionsAddressSchema = GlobalSanctionsAddressSchema;
exports.IDScanCredentialSubjectSchema = IDScanCredentialSubjectSchema;
exports.IntegerOrArrayOfIntegerSchema = IntegerOrArrayOfIntegerSchema;
exports.MNftIdSchema = MNftIdSchema;

@@ -106,4 +635,17 @@ exports.NEXERA_CHAINS = NEXERA_CHAINS;

exports.NEXERA_RELAYERS = NEXERA_RELAYERS;
exports.OriginalPersonalDetailsSchema = OriginalPersonalDetailsSchema;
exports.PepIntelligenceResultSchema = PepIntelligenceResultSchema;
exports.PersonalDataSchema = PersonalDataSchema;
exports.PersonalDetailFieldSchema = PersonalDetailFieldSchema;
exports.PersonalDetailsSchema = PersonalDetailsSchema;
exports.ProofOfResidenceSchema = ProofOfResidenceSchema;
exports.SanctionsBodiesSchema = SanctionsBodiesSchema;
exports.SanctionsEnforcementsResultSchema = SanctionsEnforcementsResultSchema;
exports.StringOrArrayOfStringSchema = StringOrArrayOfStringSchema;
exports.Subgraphs = Subgraphs;
exports.WagmiAddressSchema = WagmiAddressSchema;
exports.isValidAddress = isValidAddress;
exports.parseGBGAuthenticateSPData = parseGBGAuthenticateSPData;
exports.parseGBGPepIntelligence = parseGBGPepIntelligence;
exports.parseGBGSanctionsEnforcement = parseGBGSanctionsEnforcement;
exports.stringifyAndSortPersonalData = stringifyAndSortPersonalData;

@@ -6,2 +6,5 @@ 'use strict';

var zod = require('zod');
var compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc = require('./kyc-6fc98e73.cjs.prod.js');
var compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas = require('./vc-schemas-60c4768b.cjs.prod.js');
var i18nIsoCountries = require('i18n-iso-countries');

@@ -39,2 +42,483 @@ function _toPrimitive(input, hint) {

var IDScanCredentialSubjectSchema = zod.z.object({
journeyId: zod.z.string(),
highLevelResult: zod.z.string(),
firstName: zod.z.string(),
middleName: zod.z.string().optional(),
lastName: zod.z.string(),
gender: zod.z.string(),
age: zod.z.string(),
citizenship: zod.z.string(),
documentCategory: zod.z.string(),
documentName: zod.z.string(),
documentSide: zod.z.string(),
documentType: zod.z.string(),
entryDate: zod.z.string(),
entryTime: zod.z.string(),
fullName: zod.z.string(),
addressLine1: zod.z.string().nullable().optional(),
addressLine2: zod.z.string().nullable().optional(),
birthDate: zod.z.string(),
birthPlace: zod.z.string(),
highLevelResultDetails: zod.z.object({
documentOverallValidation: zod.z.string().optional(),
documentBlockingPolicy: zod.z.string().optional(),
documentExpiry: zod.z.string().optional(),
documentSupport: zod.z.string().optional(),
documentValidation: zod.z.string().optional(),
faceMatchValidation: zod.z.string().optional(),
accumulativeLivenessResult: zod.z.string().optional()
}),
faceMatchScore: zod.z.string(),
qualityCheckDetails: zod.z.array(zod.z.object({
id: zod.z.string().optional(),
title: zod.z.string().optional(),
description: zod.z.string().optional(),
state: zod.z.number()["int"]().optional()
})),
validationDetails: zod.z.array(zod.z.object({
name: zod.z.string().optional(),
description: zod.z.string().optional(),
result: zod.z.number()["int"]().optional()
})),
id: zod.z.string()
});
//AuthenticateSP
var GlobalItemCheckResultCodeSchema = zod.z.object({
Code: zod.z.number()["int"]().optional(),
Description: zod.z.string().optional()
});
var GlobalItemCheckResultCodeWrapperSchema = zod.z.object({
GlobalItemCheckResultCode: zod.z.union([GlobalItemCheckResultCodeSchema, zod.z.array(GlobalItemCheckResultCodeSchema)]).transform(function (value) {
return Array.isArray(value) ? value : [value];
}).optional()
});
var GlobalSanctionsMatchObjectSchema = zod.z.object({
SanctionID: zod.z.union([zod.z.number()["int"](), zod.z.string()]).optional(),
Url: zod.z.string().optional(),
Rank: zod.z.number()["int"]().optional(),
CaseID: zod.z.string().optional(),
SearchID: zod.z.string().optional()
});
var GlobalSanctionsMatchSchema = zod.z.union([GlobalSanctionsMatchObjectSchema, zod.z.array(GlobalSanctionsMatchObjectSchema)]);
var SanctionsMatchesSchema = zod.z.object({
GlobalSanctionsMatch: GlobalSanctionsMatchSchema.transform(function (value) {
return Array.isArray(value) ? value : [value];
})
});
var GlobalItemCheckResultCodesObjectSchema = zod.z.object({
Name: zod.z.string().optional(),
Description: zod.z.string().optional(),
Comment: GlobalItemCheckResultCodeWrapperSchema.optional(),
Match: GlobalItemCheckResultCodeWrapperSchema.optional(),
Warning: GlobalItemCheckResultCodeWrapperSchema.optional(),
Mismatch: GlobalItemCheckResultCodeWrapperSchema.optional(),
ID: zod.z.number()["int"]().optional(),
Pass: zod.z.string().optional(),
Address: zod.z.string().optional(),
Forename: zod.z.string().optional(),
Surname: zod.z.string().optional(),
DOB: zod.z.string().optional(),
Alert: zod.z.string().optional(),
SanctionsMatches: zod.z.union([zod.z.string().max(0), SanctionsMatchesSchema]).transform(function (value) {
if (compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas._typeof(value) !== "object") return {
GlobalSanctionsPosition: []
};
return value;
}).optional()
});
var GlobalItemCheckDecisionBandsSchema = zod.z.object({
ID: zod.z.number()["int"]().optional(),
BandScore: zod.z.number()["int"]().optional(),
BandText: zod.z.string().optional()
});
//copied from /packages/libs/schemas/src/compliance/vc-schemas/ID3_7CredentialSubjectSchema.ts
var AuthenticateSPResultSchema = zod.z.object({
AuthenticationID: zod.z.string().optional(),
Timestamp: zod.z.string().optional(),
CustomerRef: zod.z.string().optional(),
ProfileID: zod.z.string().optional(),
ProfileName: zod.z.string().optional(),
ProfileVersion: zod.z.number()["int"]().optional(),
ProfileRevision: zod.z.number()["int"]().optional(),
ProfileState: zod.z.string().optional(),
ResultCodes: zod.z.object({
GlobalItemCheckResultCodes: zod.z.union([GlobalItemCheckResultCodesObjectSchema, zod.z.array(GlobalItemCheckResultCodesObjectSchema)]).transform(function (value) {
return Array.isArray(value) ? value : [value];
}).optional()
}).strict().optional(),
Score: zod.z.number()["int"]().optional(),
BandText: zod.z.string().optional(),
Country: zod.z.string().optional(),
ItemCheckDecisionBands: zod.z.object({
GlobalItemCheckDecisionBands: zod.z.union([GlobalItemCheckDecisionBandsSchema, zod.z.array(GlobalItemCheckDecisionBandsSchema)]).transform(function (value) {
return Array.isArray(value) ? value : [value];
}).optional()
}).optional()
});
var GBGAuthenticateSPDataSchema = zod.z.object({
Timestamp: zod.z.string().optional(),
"s:Envelope": zod.z.object({
"s:Header": zod.z.object({
"o:Security": zod.z.object({
"u:Timestamp": zod.z.object({
"u:Created": zod.z.string(),
"u:Expires": zod.z.string()
})
})
}),
"s:Body": zod.z.object({
AuthenticateSPResponse: zod.z.object({
AuthenticateSPResult: AuthenticateSPResultSchema
})
})
})
});
var parseGBGAuthenticateSPData = function parseGBGAuthenticateSPData(obj) {
return GBGAuthenticateSPDataSchema.strip().parse(obj);
};
var ExtractedFieldSchema = zod.z.object({
Name: zod.z.string(),
Value: zod.z.string(),
OCRValue: zod.z.string().optional(),
LocalValue: zod.z.string().optional(),
OCRLocalValue: zod.z.string().optional()
});
var GlobalSanctionsAddressObjectSchema = zod.z.object({
AddressLine: zod.z.string().optional(),
City: zod.z.string().optional(),
Country: zod.z.string().optional(),
Region: zod.z.string().optional()
});
var GlobalSanctionsAddressSchema = zod.z.union([GlobalSanctionsAddressObjectSchema, zod.z.array(GlobalSanctionsAddressObjectSchema)]).transform(function (value) {
return Array.isArray(value) ? value : [value];
}).optional();
var StringOrArrayOfStringSchema = zod.z.union([zod.z.string(), zod.z.array(zod.z.string())]);
var AliasesStringSchema = zod.z.object({
"a:string": StringOrArrayOfStringSchema.transform(function (value) {
return Array.isArray(value) ? value : [value];
})
});
var AliasesSchema = zod.z.union([zod.z.string().max(0), AliasesStringSchema]).transform(function (value) {
if (compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas._typeof(value) !== "object") return {
"a:string": []
};
return value;
}).optional();
//PEP
var GlobalSanctionsPositionObjectSchema = zod.z.object({
Position: zod.z.string().optional(),
Country: zod.z.string().optional()
});
var GlobalSanctionsPositionSchema = zod.z.union([GlobalSanctionsPositionObjectSchema, zod.z.array(GlobalSanctionsPositionObjectSchema)]);
var SanctionsPositionSchema = zod.z.object({
GlobalSanctionsPosition: GlobalSanctionsPositionSchema.transform(function (value) {
return Array.isArray(value) ? value : [value];
})
});
//copied from /packages/libs/schemas/src/compliance/vc-schemas/ID3_7CredentialSubjectSchema.ts
var PepIntelligenceResultSchema = zod.z.object({
Fullname: zod.z.string().optional(),
Aliases: AliasesSchema,
SanctionsAddresses: zod.z.object({
GlobalSanctionsAddress: GlobalSanctionsAddressSchema
}).optional(),
SanctionsDates: zod.z.object({
GlobalSanctionsDate: zod.z.object({
DateType: zod.z.string().optional(),
Day: zod.z.number()["int"]().optional(),
Month: zod.z.number()["int"]().optional(),
Year: zod.z.number()["int"]().optional()
}).optional()
}).optional(),
IdentityInformation: zod.z.string().optional(),
SanctionsPositions: zod.z.union([zod.z.string().max(0), SanctionsPositionSchema]).transform(function (value) {
if (compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas._typeof(value) !== "object") return {
GlobalSanctionsPosition: []
};
return value;
}).optional()
});
var GBGPepIntelligenceDataSchema = zod.z.object({
"s:Envelope": zod.z.object({
"s:Body": zod.z.object({
GetPEPIntelligenceDataResponse: zod.z.object({
GetPEPIntelligenceDataResult: PepIntelligenceResultSchema
})
})
})
});
var parseGBGPepIntelligence = function parseGBGPepIntelligence(obj) {
return GBGPepIntelligenceDataSchema.strip().parse(obj);
};
//SanctionsEnforcements
var IntegerOrArrayOfIntegerSchema = zod.z.union([zod.z.number()["int"](), zod.z.array(zod.z.number()["int"]())]);
var SanctionsBodiesSchema = zod.z.object({
"a:string": IntegerOrArrayOfIntegerSchema.transform(function (value) {
return Array.isArray(value) ? value : [value];
})
});
//copied from /packages/libs/schemas/src/compliance/vc-schemas/ID3_7CredentialSubjectSchema.ts
var SanctionsEnforcementsResultSchema = zod.z.object({
Fullname: zod.z.string().optional(),
SanctionsBodies: zod.z.union([zod.z.string().max(0), SanctionsBodiesSchema]).transform(function (value) {
if (compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas._typeof(value) !== "object") return {
"a:string": []
};
return value;
}).optional(),
Aliases: AliasesSchema,
SanctionsAddresses: zod.z.object({
GlobalSanctionsAddress: GlobalSanctionsAddressSchema
}).optional(),
SanctionsDates: zod.z.object({
GlobalSanctionsDate: zod.z.object({
DateType: zod.z.string().optional(),
Day: zod.z.number()["int"]().optional(),
Month: zod.z.number()["int"]().optional(),
Year: zod.z.number()["int"]().optional()
}).optional()
}).optional(),
IdentityInformation: zod.z.string().optional()
});
var GBGSanctionsEnforcementsDataSchema = zod.z.object({
"s:Envelope": zod.z.object({
"s:Body": zod.z.object({
GetSanctionsEnforcementsDataResponse: zod.z.object({
GetSanctionsEnforcementsDataResult: SanctionsEnforcementsResultSchema
})
})
})
});
var parseGBGSanctionsEnforcement = function parseGBGSanctionsEnforcement(obj) {
return GBGSanctionsEnforcementsDataSchema.strip().parse(obj);
};
// TODO: break this down in multiple files
var GBGPersonalDetailsSchema = zod.z.object({
addressLine1: zod.z.string().optional(),
addressLine2: zod.z.string().optional(),
postalCode: zod.z.string().optional(),
emailAddress: zod.z.string().optional(),
phoneNumber: zod.z.string().optional(),
firstName: zod.z.string().optional(),
lastName: zod.z.string().optional(),
birthday: zod.z.string().optional()
});
// GBG Scan
var GBGScanResponseSimpleSchema = zod.z.object({
ProcessedDocuments: zod.z.array(zod.z.object({
ExtractedFields: zod.z.array(ExtractedFieldSchema),
DocumentCategory: zod.z.string(),
FaceMatchConfidenceScore: zod.z.string().optional()
})),
JourneyId: zod.z.string(),
HighLevelResult: zod.z.string(),
HighLevelResultDetails: zod.z.array(zod.z.string()).min(12)
});
//WIP adding all the new fields (will use .strip() in the meantime)
var FullGBGScanResponseSimpleSchema = zod.z.object({
JourneyId: zod.z.string(),
HighLevelResult: zod.z.string(),
HighLevelResultDetails: zod.z.array(zod.z.string()),
InitiatedDateTime: zod.z.string(),
ProcessedDocuments: zod.z.array(zod.z.union([zod.z.object({
IssuingCountryCode: zod.z.string(),
IssuingCountryName: zod.z.string(),
IssuingStateName: zod.z.string(),
DocumentCategory: zod.z.string(),
DocumentType: zod.z.string(),
DocumentName: zod.z.string(),
DocumentSide: zod.z.string(),
IsValidated: zod.z.string(),
ScanDateTime: zod.z.string(),
HighLevelResult: zod.z.string(),
ExtractedFields: zod.z.array(ExtractedFieldSchema),
DocumentImages: zod.z.array(zod.z.object({
Role: zod.z.string(),
Url: zod.z.string()
}))
}), zod.z.object({
DocumentCategory: zod.z.string(),
DocumentType: zod.z.string(),
IsValidated: zod.z.string(),
ScanDateTime: zod.z.string(),
HighLevelResult: zod.z.string(),
FaceMatchConfidenceScore: zod.z.string(),
ExtractedFields: zod.z.array(ExtractedFieldSchema),
DocumentImages: zod.z.array(zod.z.object({
Role: zod.z.string(),
Url: zod.z.string()
}))
})])),
ReferenceNumber: zod.z.string(),
AuthenticationToleranceLevel: zod.z.string(),
LastDecision: zod.z.object({
DecisionCode: zod.z.string(),
DecisionDateTime: zod.z.string(),
DecisionId: zod.z.string(),
Origin: zod.z.string()
}),
AdditionalData: zod.z.array(zod.z.object({
Name: zod.z.string(),
Value: zod.z.string()
})),
MetaData: zod.z.array(zod.z.any()),
ProcessedLiveness: zod.z.object({
LivenessOverallResult: zod.z.string(),
LivenessOverallFailureReason: zod.z.string(),
LivenessActions: zod.z.array(zod.z.object({
ActionNo: zod.z.string(),
ActionType: zod.z.string(),
Result: zod.z.string(),
Url: zod.z.string()
}))
}),
JourneyImages: zod.z.array(zod.z.object({
StepName: zod.z.string(),
Attempt: zod.z.number(),
ImageRole: zod.z.string(),
ImageUrl: zod.z.string()
})),
JourneySteps: zod.z.array(zod.z.object({
Type: zod.z.string(),
HighLevelResult: zod.z.number(),
FailureReason: zod.z.string(),
TripleScanAttempts: zod.z.string().optional(),
ValidationChecks: zod.z.array(zod.z.string())
})),
ProfileId: zod.z.string(),
IsOcrOnly: zod.z.string()
});
var GBGScanResponseCompleteSchema = zod.z.object({
CountryCode: zod.z.string().optional(),
CountryName: zod.z.string().optional(),
DocumentNumber: zod.z.string().optional(),
WhiteImageUrl: zod.z.string(),
SelfiePhotoImageUrl: zod.z.string(),
Citizenship: zod.z.string().optional(),
ExtractedFields: zod.z.array(ExtractedFieldSchema),
EntryDate: zod.z.string(),
FirstName: zod.z.string(),
MiddleName: zod.z.string().optional(),
LastName: zod.z.string(),
Gender: zod.z.string(),
Age: zod.z.string(),
DocumentCategory: zod.z.string(),
DocumentName: zod.z.string(),
DocumentSide: zod.z.string(),
DocumentType: zod.z.string(),
EntryTime: zod.z.string(),
FullName: zod.z.string(),
QualityCheckDetails: zod.z.array(zod.z.object({
Id: zod.z.string(),
Title: zod.z.string(),
Description: zod.z.string(),
State: zod.z.number()
})),
ValidationDetails: zod.z.array(zod.z.object({
Name: zod.z.string(),
Result: zod.z.number(),
Description: zod.z.string()
}))
});
// ID3 COmplete data
var GBGID3DataSchema = zod.z.object({
Id3AuthenticateSP: GBGAuthenticateSPDataSchema,
Id3PepIntelligenceData: zod.z.array(GBGPepIntelligenceDataSchema),
Id3SanctionsEnforcementsData: zod.z.array(GBGSanctionsEnforcementsDataSchema)
});
// ** Fields **
var EmailAddressSchema = zod.z.preprocess(function (val) {
return val === "" ? undefined : val;
}, zod.z.string().email({
message: "Please enter a valid email."
}));
var BirthdaySchema = zod.z.date().max(new Date(new Date().setFullYear(new Date().getFullYear() - 1)), {
message: "You must be at least 1 year old"
});
var ALPHA3_ENUM_CODES = Object.keys(i18nIsoCountries.getAlpha3Codes());
var alpha3CodeEnum = zod.z["enum"](ALPHA3_ENUM_CODES);
// Possible types of personal data fields
var PersonalDetailFieldSchema = zod.z.union([zod.z.string(), alpha3CodeEnum, EmailAddressSchema, BirthdaySchema, zod.z.undefined()]);
// ** Personal data interfaces **
// can be any validator we want from here: https://github.com/validatorjs/validator.js
var OriginalPersonalDetailsSchema = zod.z.object({
addressLine1: zod.z.string().optional(),
addressLine2: zod.z.string().optional(),
// birthday: BirthdaySchema.optional(), commented to conform to ID3_7CredentialSubjectSchema
birthday: zod.z.string().optional(),
age: zod.z.string().optional(),
citizenship: alpha3CodeEnum,
// ALPHA3
firstName: zod.z.string().optional(),
lastName: zod.z.string().optional(),
documentType: zod.z.string().optional(),
gender: zod.z.string().optional()
});
var PersonalDetailsSchema = OriginalPersonalDetailsSchema.extend({
city: zod.z.string().optional(),
province: zod.z.string().optional(),
countryOfResidence: alpha3CodeEnum,
postalCode: zod.z.string().optional(),
emailAddress: EmailAddressSchema.optional(),
phoneNumber: zod.z.string().optional(),
placeOfBirth: zod.z.string().optional(),
countryOfBirth: alpha3CodeEnum.optional(),
middleName: zod.z.string().optional()
});
var ProofOfResidenceSchema = zod.z.object({
name: zod.z.string(),
type: zod.z.string(),
base64: zod.z.string()
});
var PersonalDataSchema = zod.z.object({
amendmentsData: zod.z.record(PersonalDetailFieldSchema),
originalData: OriginalPersonalDetailsSchema,
personalDetails: PersonalDetailsSchema,
proofOfResidence: ProofOfResidenceSchema.optional()
});
function sortPersonalData(obj) {
if (compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas._typeof(obj) !== "object" || obj === null) {
return obj;
}
if (Array.isArray(obj)) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
return obj.map(function (item) {
return sortPersonalData(item);
});
}
var sortedKeys = Object.keys(obj).sort();
var sortedObj = {};
sortedKeys.forEach(function (key) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
sortedObj[key] = sortPersonalData(obj[key]);
});
return sortedObj;
}
function stringifyAndSortPersonalData(obj) {
return JSON.stringify(sortPersonalData(obj), null, 2);
}
var _NEXERA_CHAIN_RELAYER, _NEXERA_CHAIN_NAMES, _NEXERA_CHAIN_VALUES;

@@ -93,8 +577,53 @@ var NEXERA_RELAYERS = /*#__PURE__*/function (NEXERA_RELAYERS) {

exports.AVAILABLE_FLOWS = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.AVAILABLE_FLOWS;
exports.ApplicationClientDataSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.ApplicationClientDataSchema;
exports.DownloadableKycSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.DownloadableKycSchema;
exports.EncryptedKycKeySchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.EncryptedKycKeySchema;
exports.EncryptedVerifiableCredentialDataSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.EncryptedVerifiableCredentialDataSchema;
exports.EncryptedVerifiableCredentialSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.EncryptedVerifiableCredentialSchema;
exports.IdentifierSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.IdentifierSchema;
exports.KYCDataResponseSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.KYCDataResponseSchema;
exports.KYC_SDK_RESPONSES = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.KYC_SDK_RESPONSES;
exports.KYC_SDK_RESPONSES_DATA = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.KYC_SDK_RESPONSES_DATA;
exports.KycCompletitionDataSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.KycCompletitionDataSchema;
exports.KycSdkResponsesSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.KycSdkResponsesSchema;
exports.SumsubApplicantAddressSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.SumsubApplicantAddressSchema;
exports.SumsubApplicantInfoSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.SumsubApplicantInfoSchema;
exports.SumsubApplicationDataSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.SumsubApplicationDataSchema;
exports.VerificationModeSchema = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.VerificationModeSchema;
exports.VerificationModes = compliance_kyc_dist_nexeraprotocolNexeraIdSchemasComplianceKyc.VerificationModes;
exports.CredentialSchemas = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.CredentialSchemas;
exports.CredentialTypes = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.CredentialTypes;
exports.CredentialTypesSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.CredentialTypesSchema;
exports.CredentialZodSchemas = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.CredentialZodSchemas;
exports.GenericVerifiableCredentialSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.GenericVerifiableCredentialSchema;
exports.ID3_7CredentialSubjectSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.ID3_7CredentialSubjectSchema;
exports.IDScanPassportV1CredentialSubjectSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.IDScanPassportV1CredentialSubjectSchema;
exports.IDScanSelfieV1CredentialSubjectSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.IDScanSelfieV1CredentialSubjectSchema;
exports.IDScanV2CredentialSubjectSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.IDScanV2CredentialSubjectSchema;
exports.ProofOfResidenceV6CredentialSubjectSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.ProofOfResidenceV6CredentialSubjectSchema;
exports.VerifiableCredentialSchema = compliance_vcSchemas_vcSchemas_dist_nexeraprotocolNexeraIdSchemasComplianceVcSchemasVcSchemas.VerifiableCredentialSchema;
exports.Address0xSchema = Address0xSchema;
exports.AddressSchema = AddressSchema;
exports.AliasesSchema = AliasesSchema;
exports.AliasesStringSchema = AliasesStringSchema;
exports.AuthenticateSPResultSchema = AuthenticateSPResultSchema;
exports.BirthdaySchema = BirthdaySchema;
exports.ChainIdNumberSchema = ChainIdNumberSchema;
exports.ChainIdSchema = ChainIdSchema;
exports.ChainIdStringSchema = ChainIdStringSchema;
exports.EmailAddressSchema = EmailAddressSchema;
exports.EnvironmentSchema = EnvironmentSchema;
exports.ExtractedFieldSchema = ExtractedFieldSchema;
exports.FullGBGScanResponseSimpleSchema = FullGBGScanResponseSimpleSchema;
exports.GBGAuthenticateSPDataSchema = GBGAuthenticateSPDataSchema;
exports.GBGID3DataSchema = GBGID3DataSchema;
exports.GBGPepIntelligenceDataSchema = GBGPepIntelligenceDataSchema;
exports.GBGPersonalDetailsSchema = GBGPersonalDetailsSchema;
exports.GBGSanctionsEnforcementsDataSchema = GBGSanctionsEnforcementsDataSchema;
exports.GBGScanResponseCompleteSchema = GBGScanResponseCompleteSchema;
exports.GBGScanResponseSimpleSchema = GBGScanResponseSimpleSchema;
exports.GlobalSanctionsAddressSchema = GlobalSanctionsAddressSchema;
exports.IDScanCredentialSubjectSchema = IDScanCredentialSubjectSchema;
exports.IntegerOrArrayOfIntegerSchema = IntegerOrArrayOfIntegerSchema;
exports.MNftIdSchema = MNftIdSchema;

@@ -106,4 +635,17 @@ exports.NEXERA_CHAINS = NEXERA_CHAINS;

exports.NEXERA_RELAYERS = NEXERA_RELAYERS;
exports.OriginalPersonalDetailsSchema = OriginalPersonalDetailsSchema;
exports.PepIntelligenceResultSchema = PepIntelligenceResultSchema;
exports.PersonalDataSchema = PersonalDataSchema;
exports.PersonalDetailFieldSchema = PersonalDetailFieldSchema;
exports.PersonalDetailsSchema = PersonalDetailsSchema;
exports.ProofOfResidenceSchema = ProofOfResidenceSchema;
exports.SanctionsBodiesSchema = SanctionsBodiesSchema;
exports.SanctionsEnforcementsResultSchema = SanctionsEnforcementsResultSchema;
exports.StringOrArrayOfStringSchema = StringOrArrayOfStringSchema;
exports.Subgraphs = Subgraphs;
exports.WagmiAddressSchema = WagmiAddressSchema;
exports.isValidAddress = isValidAddress;
exports.parseGBGAuthenticateSPData = parseGBGAuthenticateSPData;
exports.parseGBGPepIntelligence = parseGBGPepIntelligence;
exports.parseGBGSanctionsEnforcement = parseGBGSanctionsEnforcement;
exports.stringifyAndSortPersonalData = stringifyAndSortPersonalData;
import { z } from 'zod';
export { e as AVAILABLE_FLOWS, A as ApplicationClientDataSchema, D as DownloadableKycSchema, E as EncryptedKycKeySchema, a as EncryptedVerifiableCredentialDataSchema, b as EncryptedVerifiableCredentialSchema, I as IdentifierSchema, K as KYCDataResponseSchema, f as KYC_SDK_RESPONSES, j as KYC_SDK_RESPONSES_DATA, i as KycCompletitionDataSchema, g as KycSdkResponsesSchema, S as SumsubApplicantAddressSchema, c as SumsubApplicantInfoSchema, d as SumsubApplicationDataSchema, V as VerificationModeSchema, h as VerificationModes } from './kyc-a8adb73c.esm.js';
import { _ as _typeof } from './vc-schemas-bcbe3142.esm.js';
export { f as CredentialSchemas, C as CredentialTypes, d as CredentialTypesSchema, e as CredentialZodSchemas, G as GenericVerifiableCredentialSchema, I as ID3_7CredentialSubjectSchema, a as IDScanPassportV1CredentialSubjectSchema, b as IDScanSelfieV1CredentialSubjectSchema, c as IDScanV2CredentialSubjectSchema, P as ProofOfResidenceV6CredentialSubjectSchema, V as VerifiableCredentialSchema } from './vc-schemas-bcbe3142.esm.js';
import { getAlpha3Codes } from 'i18n-iso-countries';

@@ -34,2 +38,483 @@ function _toPrimitive(input, hint) {

var IDScanCredentialSubjectSchema = z.object({
journeyId: z.string(),
highLevelResult: z.string(),
firstName: z.string(),
middleName: z.string().optional(),
lastName: z.string(),
gender: z.string(),
age: z.string(),
citizenship: z.string(),
documentCategory: z.string(),
documentName: z.string(),
documentSide: z.string(),
documentType: z.string(),
entryDate: z.string(),
entryTime: z.string(),
fullName: z.string(),
addressLine1: z.string().nullable().optional(),
addressLine2: z.string().nullable().optional(),
birthDate: z.string(),
birthPlace: z.string(),
highLevelResultDetails: z.object({
documentOverallValidation: z.string().optional(),
documentBlockingPolicy: z.string().optional(),
documentExpiry: z.string().optional(),
documentSupport: z.string().optional(),
documentValidation: z.string().optional(),
faceMatchValidation: z.string().optional(),
accumulativeLivenessResult: z.string().optional()
}),
faceMatchScore: z.string(),
qualityCheckDetails: z.array(z.object({
id: z.string().optional(),
title: z.string().optional(),
description: z.string().optional(),
state: z.number()["int"]().optional()
})),
validationDetails: z.array(z.object({
name: z.string().optional(),
description: z.string().optional(),
result: z.number()["int"]().optional()
})),
id: z.string()
});
//AuthenticateSP
var GlobalItemCheckResultCodeSchema = z.object({
Code: z.number()["int"]().optional(),
Description: z.string().optional()
});
var GlobalItemCheckResultCodeWrapperSchema = z.object({
GlobalItemCheckResultCode: z.union([GlobalItemCheckResultCodeSchema, z.array(GlobalItemCheckResultCodeSchema)]).transform(function (value) {
return Array.isArray(value) ? value : [value];
}).optional()
});
var GlobalSanctionsMatchObjectSchema = z.object({
SanctionID: z.union([z.number()["int"](), z.string()]).optional(),
Url: z.string().optional(),
Rank: z.number()["int"]().optional(),
CaseID: z.string().optional(),
SearchID: z.string().optional()
});
var GlobalSanctionsMatchSchema = z.union([GlobalSanctionsMatchObjectSchema, z.array(GlobalSanctionsMatchObjectSchema)]);
var SanctionsMatchesSchema = z.object({
GlobalSanctionsMatch: GlobalSanctionsMatchSchema.transform(function (value) {
return Array.isArray(value) ? value : [value];
})
});
var GlobalItemCheckResultCodesObjectSchema = z.object({
Name: z.string().optional(),
Description: z.string().optional(),
Comment: GlobalItemCheckResultCodeWrapperSchema.optional(),
Match: GlobalItemCheckResultCodeWrapperSchema.optional(),
Warning: GlobalItemCheckResultCodeWrapperSchema.optional(),
Mismatch: GlobalItemCheckResultCodeWrapperSchema.optional(),
ID: z.number()["int"]().optional(),
Pass: z.string().optional(),
Address: z.string().optional(),
Forename: z.string().optional(),
Surname: z.string().optional(),
DOB: z.string().optional(),
Alert: z.string().optional(),
SanctionsMatches: z.union([z.string().max(0), SanctionsMatchesSchema]).transform(function (value) {
if (_typeof(value) !== "object") return {
GlobalSanctionsPosition: []
};
return value;
}).optional()
});
var GlobalItemCheckDecisionBandsSchema = z.object({
ID: z.number()["int"]().optional(),
BandScore: z.number()["int"]().optional(),
BandText: z.string().optional()
});
//copied from /packages/libs/schemas/src/compliance/vc-schemas/ID3_7CredentialSubjectSchema.ts
var AuthenticateSPResultSchema = z.object({
AuthenticationID: z.string().optional(),
Timestamp: z.string().optional(),
CustomerRef: z.string().optional(),
ProfileID: z.string().optional(),
ProfileName: z.string().optional(),
ProfileVersion: z.number()["int"]().optional(),
ProfileRevision: z.number()["int"]().optional(),
ProfileState: z.string().optional(),
ResultCodes: z.object({
GlobalItemCheckResultCodes: z.union([GlobalItemCheckResultCodesObjectSchema, z.array(GlobalItemCheckResultCodesObjectSchema)]).transform(function (value) {
return Array.isArray(value) ? value : [value];
}).optional()
}).strict().optional(),
Score: z.number()["int"]().optional(),
BandText: z.string().optional(),
Country: z.string().optional(),
ItemCheckDecisionBands: z.object({
GlobalItemCheckDecisionBands: z.union([GlobalItemCheckDecisionBandsSchema, z.array(GlobalItemCheckDecisionBandsSchema)]).transform(function (value) {
return Array.isArray(value) ? value : [value];
}).optional()
}).optional()
});
var GBGAuthenticateSPDataSchema = z.object({
Timestamp: z.string().optional(),
"s:Envelope": z.object({
"s:Header": z.object({
"o:Security": z.object({
"u:Timestamp": z.object({
"u:Created": z.string(),
"u:Expires": z.string()
})
})
}),
"s:Body": z.object({
AuthenticateSPResponse: z.object({
AuthenticateSPResult: AuthenticateSPResultSchema
})
})
})
});
var parseGBGAuthenticateSPData = function parseGBGAuthenticateSPData(obj) {
return GBGAuthenticateSPDataSchema.strip().parse(obj);
};
var ExtractedFieldSchema = z.object({
Name: z.string(),
Value: z.string(),
OCRValue: z.string().optional(),
LocalValue: z.string().optional(),
OCRLocalValue: z.string().optional()
});
var GlobalSanctionsAddressObjectSchema = z.object({
AddressLine: z.string().optional(),
City: z.string().optional(),
Country: z.string().optional(),
Region: z.string().optional()
});
var GlobalSanctionsAddressSchema = z.union([GlobalSanctionsAddressObjectSchema, z.array(GlobalSanctionsAddressObjectSchema)]).transform(function (value) {
return Array.isArray(value) ? value : [value];
}).optional();
var StringOrArrayOfStringSchema = z.union([z.string(), z.array(z.string())]);
var AliasesStringSchema = z.object({
"a:string": StringOrArrayOfStringSchema.transform(function (value) {
return Array.isArray(value) ? value : [value];
})
});
var AliasesSchema = z.union([z.string().max(0), AliasesStringSchema]).transform(function (value) {
if (_typeof(value) !== "object") return {
"a:string": []
};
return value;
}).optional();
//PEP
var GlobalSanctionsPositionObjectSchema = z.object({
Position: z.string().optional(),
Country: z.string().optional()
});
var GlobalSanctionsPositionSchema = z.union([GlobalSanctionsPositionObjectSchema, z.array(GlobalSanctionsPositionObjectSchema)]);
var SanctionsPositionSchema = z.object({
GlobalSanctionsPosition: GlobalSanctionsPositionSchema.transform(function (value) {
return Array.isArray(value) ? value : [value];
})
});
//copied from /packages/libs/schemas/src/compliance/vc-schemas/ID3_7CredentialSubjectSchema.ts
var PepIntelligenceResultSchema = z.object({
Fullname: z.string().optional(),
Aliases: AliasesSchema,
SanctionsAddresses: z.object({
GlobalSanctionsAddress: GlobalSanctionsAddressSchema
}).optional(),
SanctionsDates: z.object({
GlobalSanctionsDate: z.object({
DateType: z.string().optional(),
Day: z.number()["int"]().optional(),
Month: z.number()["int"]().optional(),
Year: z.number()["int"]().optional()
}).optional()
}).optional(),
IdentityInformation: z.string().optional(),
SanctionsPositions: z.union([z.string().max(0), SanctionsPositionSchema]).transform(function (value) {
if (_typeof(value) !== "object") return {
GlobalSanctionsPosition: []
};
return value;
}).optional()
});
var GBGPepIntelligenceDataSchema = z.object({
"s:Envelope": z.object({
"s:Body": z.object({
GetPEPIntelligenceDataResponse: z.object({
GetPEPIntelligenceDataResult: PepIntelligenceResultSchema
})
})
})
});
var parseGBGPepIntelligence = function parseGBGPepIntelligence(obj) {
return GBGPepIntelligenceDataSchema.strip().parse(obj);
};
//SanctionsEnforcements
var IntegerOrArrayOfIntegerSchema = z.union([z.number()["int"](), z.array(z.number()["int"]())]);
var SanctionsBodiesSchema = z.object({
"a:string": IntegerOrArrayOfIntegerSchema.transform(function (value) {
return Array.isArray(value) ? value : [value];
})
});
//copied from /packages/libs/schemas/src/compliance/vc-schemas/ID3_7CredentialSubjectSchema.ts
var SanctionsEnforcementsResultSchema = z.object({
Fullname: z.string().optional(),
SanctionsBodies: z.union([z.string().max(0), SanctionsBodiesSchema]).transform(function (value) {
if (_typeof(value) !== "object") return {
"a:string": []
};
return value;
}).optional(),
Aliases: AliasesSchema,
SanctionsAddresses: z.object({
GlobalSanctionsAddress: GlobalSanctionsAddressSchema
}).optional(),
SanctionsDates: z.object({
GlobalSanctionsDate: z.object({
DateType: z.string().optional(),
Day: z.number()["int"]().optional(),
Month: z.number()["int"]().optional(),
Year: z.number()["int"]().optional()
}).optional()
}).optional(),
IdentityInformation: z.string().optional()
});
var GBGSanctionsEnforcementsDataSchema = z.object({
"s:Envelope": z.object({
"s:Body": z.object({
GetSanctionsEnforcementsDataResponse: z.object({
GetSanctionsEnforcementsDataResult: SanctionsEnforcementsResultSchema
})
})
})
});
var parseGBGSanctionsEnforcement = function parseGBGSanctionsEnforcement(obj) {
return GBGSanctionsEnforcementsDataSchema.strip().parse(obj);
};
// TODO: break this down in multiple files
var GBGPersonalDetailsSchema = z.object({
addressLine1: z.string().optional(),
addressLine2: z.string().optional(),
postalCode: z.string().optional(),
emailAddress: z.string().optional(),
phoneNumber: z.string().optional(),
firstName: z.string().optional(),
lastName: z.string().optional(),
birthday: z.string().optional()
});
// GBG Scan
var GBGScanResponseSimpleSchema = z.object({
ProcessedDocuments: z.array(z.object({
ExtractedFields: z.array(ExtractedFieldSchema),
DocumentCategory: z.string(),
FaceMatchConfidenceScore: z.string().optional()
})),
JourneyId: z.string(),
HighLevelResult: z.string(),
HighLevelResultDetails: z.array(z.string()).min(12)
});
//WIP adding all the new fields (will use .strip() in the meantime)
var FullGBGScanResponseSimpleSchema = z.object({
JourneyId: z.string(),
HighLevelResult: z.string(),
HighLevelResultDetails: z.array(z.string()),
InitiatedDateTime: z.string(),
ProcessedDocuments: z.array(z.union([z.object({
IssuingCountryCode: z.string(),
IssuingCountryName: z.string(),
IssuingStateName: z.string(),
DocumentCategory: z.string(),
DocumentType: z.string(),
DocumentName: z.string(),
DocumentSide: z.string(),
IsValidated: z.string(),
ScanDateTime: z.string(),
HighLevelResult: z.string(),
ExtractedFields: z.array(ExtractedFieldSchema),
DocumentImages: z.array(z.object({
Role: z.string(),
Url: z.string()
}))
}), z.object({
DocumentCategory: z.string(),
DocumentType: z.string(),
IsValidated: z.string(),
ScanDateTime: z.string(),
HighLevelResult: z.string(),
FaceMatchConfidenceScore: z.string(),
ExtractedFields: z.array(ExtractedFieldSchema),
DocumentImages: z.array(z.object({
Role: z.string(),
Url: z.string()
}))
})])),
ReferenceNumber: z.string(),
AuthenticationToleranceLevel: z.string(),
LastDecision: z.object({
DecisionCode: z.string(),
DecisionDateTime: z.string(),
DecisionId: z.string(),
Origin: z.string()
}),
AdditionalData: z.array(z.object({
Name: z.string(),
Value: z.string()
})),
MetaData: z.array(z.any()),
ProcessedLiveness: z.object({
LivenessOverallResult: z.string(),
LivenessOverallFailureReason: z.string(),
LivenessActions: z.array(z.object({
ActionNo: z.string(),
ActionType: z.string(),
Result: z.string(),
Url: z.string()
}))
}),
JourneyImages: z.array(z.object({
StepName: z.string(),
Attempt: z.number(),
ImageRole: z.string(),
ImageUrl: z.string()
})),
JourneySteps: z.array(z.object({
Type: z.string(),
HighLevelResult: z.number(),
FailureReason: z.string(),
TripleScanAttempts: z.string().optional(),
ValidationChecks: z.array(z.string())
})),
ProfileId: z.string(),
IsOcrOnly: z.string()
});
var GBGScanResponseCompleteSchema = z.object({
CountryCode: z.string().optional(),
CountryName: z.string().optional(),
DocumentNumber: z.string().optional(),
WhiteImageUrl: z.string(),
SelfiePhotoImageUrl: z.string(),
Citizenship: z.string().optional(),
ExtractedFields: z.array(ExtractedFieldSchema),
EntryDate: z.string(),
FirstName: z.string(),
MiddleName: z.string().optional(),
LastName: z.string(),
Gender: z.string(),
Age: z.string(),
DocumentCategory: z.string(),
DocumentName: z.string(),
DocumentSide: z.string(),
DocumentType: z.string(),
EntryTime: z.string(),
FullName: z.string(),
QualityCheckDetails: z.array(z.object({
Id: z.string(),
Title: z.string(),
Description: z.string(),
State: z.number()
})),
ValidationDetails: z.array(z.object({
Name: z.string(),
Result: z.number(),
Description: z.string()
}))
});
// ID3 COmplete data
var GBGID3DataSchema = z.object({
Id3AuthenticateSP: GBGAuthenticateSPDataSchema,
Id3PepIntelligenceData: z.array(GBGPepIntelligenceDataSchema),
Id3SanctionsEnforcementsData: z.array(GBGSanctionsEnforcementsDataSchema)
});
// ** Fields **
var EmailAddressSchema = z.preprocess(function (val) {
return val === "" ? undefined : val;
}, z.string().email({
message: "Please enter a valid email."
}));
var BirthdaySchema = z.date().max(new Date(new Date().setFullYear(new Date().getFullYear() - 1)), {
message: "You must be at least 1 year old"
});
var ALPHA3_ENUM_CODES = Object.keys(getAlpha3Codes());
var alpha3CodeEnum = z["enum"](ALPHA3_ENUM_CODES);
// Possible types of personal data fields
var PersonalDetailFieldSchema = z.union([z.string(), alpha3CodeEnum, EmailAddressSchema, BirthdaySchema, z.undefined()]);
// ** Personal data interfaces **
// can be any validator we want from here: https://github.com/validatorjs/validator.js
var OriginalPersonalDetailsSchema = z.object({
addressLine1: z.string().optional(),
addressLine2: z.string().optional(),
// birthday: BirthdaySchema.optional(), commented to conform to ID3_7CredentialSubjectSchema
birthday: z.string().optional(),
age: z.string().optional(),
citizenship: alpha3CodeEnum,
// ALPHA3
firstName: z.string().optional(),
lastName: z.string().optional(),
documentType: z.string().optional(),
gender: z.string().optional()
});
var PersonalDetailsSchema = OriginalPersonalDetailsSchema.extend({
city: z.string().optional(),
province: z.string().optional(),
countryOfResidence: alpha3CodeEnum,
postalCode: z.string().optional(),
emailAddress: EmailAddressSchema.optional(),
phoneNumber: z.string().optional(),
placeOfBirth: z.string().optional(),
countryOfBirth: alpha3CodeEnum.optional(),
middleName: z.string().optional()
});
var ProofOfResidenceSchema = z.object({
name: z.string(),
type: z.string(),
base64: z.string()
});
var PersonalDataSchema = z.object({
amendmentsData: z.record(PersonalDetailFieldSchema),
originalData: OriginalPersonalDetailsSchema,
personalDetails: PersonalDetailsSchema,
proofOfResidence: ProofOfResidenceSchema.optional()
});
function sortPersonalData(obj) {
if (_typeof(obj) !== "object" || obj === null) {
return obj;
}
if (Array.isArray(obj)) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
return obj.map(function (item) {
return sortPersonalData(item);
});
}
var sortedKeys = Object.keys(obj).sort();
var sortedObj = {};
sortedKeys.forEach(function (key) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
sortedObj[key] = sortPersonalData(obj[key]);
});
return sortedObj;
}
function stringifyAndSortPersonalData(obj) {
return JSON.stringify(sortPersonalData(obj), null, 2);
}
var _NEXERA_CHAIN_RELAYER, _NEXERA_CHAIN_NAMES, _NEXERA_CHAIN_VALUES;

@@ -88,2 +573,2 @@ var NEXERA_RELAYERS = /*#__PURE__*/function (NEXERA_RELAYERS) {

export { Address0xSchema, AddressSchema, ChainIdNumberSchema, ChainIdSchema, ChainIdStringSchema, EnvironmentSchema, MNftIdSchema, NEXERA_CHAINS, NEXERA_CHAIN_NAMES, NEXERA_CHAIN_RELAYERS, NEXERA_CHAIN_VALUES, NEXERA_RELAYERS, Subgraphs, WagmiAddressSchema, isValidAddress };
export { Address0xSchema, AddressSchema, AliasesSchema, AliasesStringSchema, AuthenticateSPResultSchema, BirthdaySchema, ChainIdNumberSchema, ChainIdSchema, ChainIdStringSchema, EmailAddressSchema, EnvironmentSchema, ExtractedFieldSchema, FullGBGScanResponseSimpleSchema, GBGAuthenticateSPDataSchema, GBGID3DataSchema, GBGPepIntelligenceDataSchema, GBGPersonalDetailsSchema, GBGSanctionsEnforcementsDataSchema, GBGScanResponseCompleteSchema, GBGScanResponseSimpleSchema, GlobalSanctionsAddressSchema, IDScanCredentialSubjectSchema, IntegerOrArrayOfIntegerSchema, MNftIdSchema, NEXERA_CHAINS, NEXERA_CHAIN_NAMES, NEXERA_CHAIN_RELAYERS, NEXERA_CHAIN_VALUES, NEXERA_RELAYERS, OriginalPersonalDetailsSchema, PepIntelligenceResultSchema, PersonalDataSchema, PersonalDetailFieldSchema, PersonalDetailsSchema, ProofOfResidenceSchema, SanctionsBodiesSchema, SanctionsEnforcementsResultSchema, StringOrArrayOfStringSchema, Subgraphs, WagmiAddressSchema, isValidAddress, parseGBGAuthenticateSPData, parseGBGPepIntelligence, parseGBGSanctionsEnforcement, stringifyAndSortPersonalData };
{
"name": "@nexeraprotocol/nexera-id-schemas",
"version": "1.0.18",
"version": "1.0.19",
"description": "",

@@ -13,2 +13,3 @@ "main": "dist/nexeraprotocol-nexera-id-schemas.cjs.js",

"lint:fix": "pnpm lint --fix",
"test": "mocha --require ts-node/register 'test/**/*.test.ts'",
"type-check": "tsc --noEmit",

@@ -52,2 +53,9 @@ "download-schema:IDScan": "curl https://raw.githubusercontent.com/NexeraProtocol/vc-schemas/main/examples/idscan/v1/idscan.json -o ./schemas/IDScan.json",

"dependencies": {
"@types/chai": "^4.3.5",
"@types/mocha": "^10.0.1",
"chai": "^4.3.7",
"i18n-iso-countries": "^7.6.0",
"mocha": "^10.2.0",
"ts-node": "^10.9.1",
"typescript": "^5.1.6",
"zod": "^3.21.4"

@@ -54,0 +62,0 @@ },

@@ -7,2 +7,5 @@ 'use strict';

var dist_nexeraprotocolNexeraIdSchemas = require('../../dist/nexeraprotocol-nexera-id-schemas.cjs.dev.js');
require('../../dist/kyc-fc1f5193.cjs.dev.js');
require('../../dist/vc-schemas-f4be799d.cjs.dev.js');
require('i18n-iso-countries');

@@ -9,0 +12,0 @@ var NameTypeSchema = zod.z.object({

@@ -7,2 +7,5 @@ 'use strict';

var dist_nexeraprotocolNexeraIdSchemas = require('../../dist/nexeraprotocol-nexera-id-schemas.cjs.prod.js');
require('../../dist/kyc-6fc98e73.cjs.prod.js');
require('../../dist/vc-schemas-60c4768b.cjs.prod.js');
require('i18n-iso-countries');

@@ -9,0 +12,0 @@ var NameTypeSchema = zod.z.object({

import { z } from 'zod';
import { ChainIdSchema, AddressSchema } from '../../dist/nexeraprotocol-nexera-id-schemas.esm.js';
import '../../dist/kyc-a8adb73c.esm.js';
import '../../dist/vc-schemas-bcbe3142.esm.js';
import 'i18n-iso-countries';

@@ -4,0 +7,0 @@ var NameTypeSchema = z.object({

{
"name": "@nexeraprotocol/nexera-id-schemas",
"version": "1.0.18",
"version": "1.0.19",
"description": "",

@@ -27,2 +27,9 @@ "main": "dist/nexeraprotocol-nexera-id-schemas.cjs.js",

"dependencies": {
"@types/chai": "^4.3.5",
"@types/mocha": "^10.0.1",
"chai": "^4.3.7",
"i18n-iso-countries": "^7.6.0",
"mocha": "^10.2.0",
"ts-node": "^10.9.1",
"typescript": "^5.1.6",
"zod": "^3.21.4"

@@ -38,2 +45,3 @@ },

"lint:fix": "pnpm lint --fix",
"test": "mocha --require ts-node/register 'test/**/*.test.ts'",
"type-check": "tsc --noEmit",

@@ -40,0 +48,0 @@ "download-schema:IDScan": "curl https://raw.githubusercontent.com/NexeraProtocol/vc-schemas/main/examples/idscan/v1/idscan.json -o ./schemas/IDScan.json",

# Overview
Opa client is automatically generated client for interacting with open-policy-agent API.
This is where we store Zod Schemas for our code base.
## Update Vc Schemas from vc-schemas repo
### Id Scan
`npm run download-schema:IDScan`
`npm run generate-zod:IDScan`
### IDScanV2
`npm run download-schema:IDScanV2`
`npm run generate-zod:IDScanV2`
### ID3_7
`npm run download-schema:ID3_7`
`npm run generate-zod:ID3_7`
### ProofOfResidenceV6
`npm run download-schema:ProofOfResidenceV6`
`npm run generate-zod:ProofOfResidenceV6`
### IDScanSelfieV1
`npm run download-schema:IDScanSelfieV1`
`npm run generate-zod:IDScanSelfieV1`
### IDScanPassportV1
`npm run download-schema:IDScanPassportV1`
`npm run generate-zod:IDScanPassportV1`
## OPA Client
Opa client is automatically generated client for interacting with open-policy-agent API.
OPA api is very stable and not subject to many changes, so don't expect this to change often
## Generate new API client
## Generate new client
// TODO: remove deprecated docs
Q: I don't think this is only used for API anymore, is it? Where is this information suppsoed to be?
In case of changes, run `pnpm run generate-typescript-client`. It uses publicly stored latest version of OPA API schema

@@ -8,2 +8,5 @@ 'use strict';

var metaTx_dist_nexeraprotocolNexeraIdSchemasMetaTx = require('../../meta-tx/dist/nexeraprotocol-nexera-id-schemas-meta-tx.cjs.dev.js');
require('../../dist/kyc-fc1f5193.cjs.dev.js');
require('../../dist/vc-schemas-f4be799d.cjs.dev.js');
require('i18n-iso-countries');

@@ -10,0 +13,0 @@ var TransactionTypes = ["mint_mnft", "deploy_smart_wallet", "create_rule", "assign_rule", "delete_rule", "transfer_to_smart_wallet", "transfer_from_smart_wallet", "transfer", "wrap", "unwrap", "create_approval", "delete_approval", "unknown", "approval", "mnft_recovery", "api", "execute_action"];

@@ -8,2 +8,5 @@ 'use strict';

var metaTx_dist_nexeraprotocolNexeraIdSchemasMetaTx = require('../../meta-tx/dist/nexeraprotocol-nexera-id-schemas-meta-tx.cjs.prod.js');
require('../../dist/kyc-6fc98e73.cjs.prod.js');
require('../../dist/vc-schemas-60c4768b.cjs.prod.js');
require('i18n-iso-countries');

@@ -10,0 +13,0 @@ var TransactionTypes = ["mint_mnft", "deploy_smart_wallet", "create_rule", "assign_rule", "delete_rule", "transfer_to_smart_wallet", "transfer_from_smart_wallet", "transfer", "wrap", "unwrap", "create_approval", "delete_approval", "unknown", "approval", "mnft_recovery", "api", "execute_action"];

import { z } from 'zod';
import { ChainIdSchema, Subgraphs } from '../../dist/nexeraprotocol-nexera-id-schemas.esm.js';
import { TxRelayStateSchema } from '../../meta-tx/dist/nexeraprotocol-nexera-id-schemas-meta-tx.esm.js';
import '../../dist/kyc-a8adb73c.esm.js';
import '../../dist/vc-schemas-bcbe3142.esm.js';
import 'i18n-iso-countries';

@@ -5,0 +8,0 @@ var TransactionTypes = ["mint_mnft", "deploy_smart_wallet", "create_rule", "assign_rule", "delete_rule", "transfer_to_smart_wallet", "transfer_from_smart_wallet", "transfer", "wrap", "unwrap", "create_approval", "delete_approval", "unknown", "approval", "mnft_recovery", "api", "execute_action"];

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc