@incodetech/core 0.0.0-dev-20260309-dec7ce7 → 0.0.0-dev-20260309-8feea99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/document-upload.d.ts +1 -1
- package/dist/ekyc.esm.js +9 -2
- package/package.json +1 -1
|
@@ -62,7 +62,7 @@ declare const documentUploadMachine: xstate0.StateMachine<DocumentUploadContext,
|
|
|
62
62
|
type: "stopStream";
|
|
63
63
|
params: xstate0.NonReducibleUnknown;
|
|
64
64
|
};
|
|
65
|
-
}>, never, never, "
|
|
65
|
+
}>, never, never, "error" | "initCamera" | "idle" | "capturing" | "closed" | "uploading" | "finished", string, DocumentUploadInput, xstate0.NonReducibleUnknown, xstate0.EventObject, xstate0.MetaObject, {
|
|
66
66
|
readonly id: "documentUpload";
|
|
67
67
|
readonly initial: "idle";
|
|
68
68
|
readonly context: ({
|
package/dist/ekyc.esm.js
CHANGED
|
@@ -9924,6 +9924,7 @@ const BR_POSTAL_CODE_REGEX = /^(?:\d{5}|\d{8}|\d{5}-\d{3})$/;
|
|
|
9924
9924
|
const CA_POSTAL_CODE_REGEX = /^[A-Za-z]\d[A-Za-z] \d[A-Za-z]\d$/;
|
|
9925
9925
|
const ES_POSTAL_CODE_REGEX = /^\d{5}$/;
|
|
9926
9926
|
const UK_POSTAL_CODE_REGEX = /^(?:[A-Z]{2}\d|[A-Z]{2}\d{2}|[A-Z]\d|[A-Z]\d{2}|[A-Z]\d[A-Z]|[A-Z]{2}\d[A-Z]) \d[A-Z]{2}$/;
|
|
9927
|
+
const AR_POSTAL_CODE_REGEX = /^[A-Za-z]\d{4}[A-Za-z]{3}$/;
|
|
9927
9928
|
const DEFAULT_POSTAL_CODE_MAX = 8;
|
|
9928
9929
|
/**
|
|
9929
9930
|
* Validates postal code by country:
|
|
@@ -9932,6 +9933,7 @@ const DEFAULT_POSTAL_CODE_MAX = 8;
|
|
|
9932
9933
|
* - CA: A1A 1A1
|
|
9933
9934
|
* - ES: 5 digits
|
|
9934
9935
|
* - GB/UK: A0 0AA, AA0 0AA, AA0A 0AA
|
|
9936
|
+
* - AR: CPA XNNNNXXX (1 letter + 4 digits + 3 letters)
|
|
9935
9937
|
* - Others: 5 or 8 numeric digits
|
|
9936
9938
|
*/
|
|
9937
9939
|
function validatePostalCode(postalCode, country) {
|
|
@@ -9941,6 +9943,7 @@ function validatePostalCode(postalCode, country) {
|
|
|
9941
9943
|
if (country === "CA") return CA_POSTAL_CODE_REGEX.test(postalCode);
|
|
9942
9944
|
if (country === "ES") return ES_POSTAL_CODE_REGEX.test(postalCode);
|
|
9943
9945
|
if (country === "GB" || country === "UK") return UK_POSTAL_CODE_REGEX.test(postalCode.toUpperCase());
|
|
9946
|
+
if (country === "AR") return AR_POSTAL_CODE_REGEX.test(postalCode.replace(/\s/g, "").toUpperCase());
|
|
9944
9947
|
const stripped = postalCode.replace(/\D/g, "");
|
|
9945
9948
|
const maxLen = DEFAULT_POSTAL_CODE_MAX;
|
|
9946
9949
|
return /^\d+$/.test(stripped) && [5, maxLen].includes(stripped.length);
|
|
@@ -9976,6 +9979,7 @@ function formatPostalCode(value, country) {
|
|
|
9976
9979
|
if (normalized.length <= 3) return normalized;
|
|
9977
9980
|
return `${normalized.slice(0, -3)} ${normalized.slice(-3)}`;
|
|
9978
9981
|
}
|
|
9982
|
+
if (country === "AR") return value.replace(/[^A-Za-z0-9]/g, "").toUpperCase().slice(0, 8);
|
|
9979
9983
|
return value.replace(/\D/g, "").slice(0, DEFAULT_POSTAL_CODE_MAX);
|
|
9980
9984
|
}
|
|
9981
9985
|
/** Validates a phone number using libphonenumber-js country rules */
|
|
@@ -10033,7 +10037,8 @@ const POSTAL_CODE_MAX_LENGTH_BY_COUNTRY = {
|
|
|
10033
10037
|
CA: 7,
|
|
10034
10038
|
ES: 5,
|
|
10035
10039
|
GB: 8,
|
|
10036
|
-
UK: 8
|
|
10040
|
+
UK: 8,
|
|
10041
|
+
AR: 8
|
|
10037
10042
|
};
|
|
10038
10043
|
const DEFAULT_POSTAL_CODE_MAX_LENGTH = 8;
|
|
10039
10044
|
function getPostalCodeMaxLength(country) {
|
|
@@ -10042,6 +10047,7 @@ function getPostalCodeMaxLength(country) {
|
|
|
10042
10047
|
function getPostalCodeErrorKey(country) {
|
|
10043
10048
|
if (country === "CA") return "verification.errors.CAPostalCodeInvalidFormat";
|
|
10044
10049
|
if (country === "ES") return "verification.errors.ESPostalCodeInvalidFormat";
|
|
10050
|
+
if (country === "AR") return "verification.errors.ARPostalCodeInvalidFormat";
|
|
10045
10051
|
if (country === "GB" || country === "UK") return "verification.errors.UKPostalCodeInvalidFormat";
|
|
10046
10052
|
if (country === "US") return "verification.errors.zipCodeInvalidFormat";
|
|
10047
10053
|
return "verification.errors.postalCodeInvalidFormat";
|
|
@@ -10175,7 +10181,8 @@ const POSTAL_CODE_FORMAT_ERROR_KEYS = new Set([
|
|
|
10175
10181
|
"verification.errors.postalCodeInvalidFormat",
|
|
10176
10182
|
"verification.errors.CAPostalCodeInvalidFormat",
|
|
10177
10183
|
"verification.errors.ESPostalCodeInvalidFormat",
|
|
10178
|
-
"verification.errors.UKPostalCodeInvalidFormat"
|
|
10184
|
+
"verification.errors.UKPostalCodeInvalidFormat",
|
|
10185
|
+
"verification.errors.ARPostalCodeInvalidFormat"
|
|
10179
10186
|
]);
|
|
10180
10187
|
function computeDisplayErrors(errors, touched, submitAttempted, country) {
|
|
10181
10188
|
const display = {};
|