@alviere/core 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities/constants/account-enums.d.ts +9 -0
- package/dist/entities/constants/account-enums.d.ts.map +1 -0
- package/dist/entities/requests/accounts/accounts.d.ts +2 -2
- package/dist/entities/requests/accounts/accounts.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +161 -1
- package/dist/index.mjs.map +1 -1
- package/dist/infrastructure/security/validator.service.d.ts +1 -0
- package/dist/infrastructure/security/validator.service.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -398,6 +398,10 @@ class Validator {
|
|
|
398
398
|
if (trimmed.includes("..")) {
|
|
399
399
|
return "Please enter a valid email address.";
|
|
400
400
|
}
|
|
401
|
+
const localPart = trimmed.split("@")[0];
|
|
402
|
+
if (localPart.startsWith(".") || localPart.endsWith(".")) {
|
|
403
|
+
return "Please enter a valid email address.";
|
|
404
|
+
}
|
|
401
405
|
const emailRegEx = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/;
|
|
402
406
|
if (!emailRegEx.test(trimmed)) {
|
|
403
407
|
return "Please enter a valid email address.";
|
|
@@ -534,6 +538,7 @@ class Validator {
|
|
|
534
538
|
* for a legitimate name — callers are responsible for normalising the value
|
|
535
539
|
* to the API-accepted character set before sending (API regex:
|
|
536
540
|
* ^[a-zA-Z0-9' -]{1,40}$).
|
|
541
|
+
* Length is enforced to match API limits: min 1, max 40 characters.
|
|
537
542
|
* @param value - The value to validate
|
|
538
543
|
* @param fieldName - Optional field name for error message
|
|
539
544
|
*/
|
|
@@ -541,7 +546,11 @@ class Validator {
|
|
|
541
546
|
if (!value || typeof value !== "string") {
|
|
542
547
|
return fieldName ? `${fieldName} is required.` : "This field is required.";
|
|
543
548
|
}
|
|
544
|
-
|
|
549
|
+
const trimmed = value.trim();
|
|
550
|
+
if (trimmed.length > 40) {
|
|
551
|
+
return fieldName ? `${fieldName} must be no more than 40 characters long.` : "Must be no more than 40 characters long.";
|
|
552
|
+
}
|
|
553
|
+
if (!/^[-.,\p{L}\p{M}\s\d\u0027\u2019]+$/u.test(trimmed)) {
|
|
545
554
|
return fieldName ? `${fieldName} must contain only letters, numbers, spaces, hyphens, apostrophes, periods, and commas.` : "Must contain only letters, numbers, spaces, hyphens, apostrophes, periods, and commas.";
|
|
546
555
|
}
|
|
547
556
|
return null;
|
|
@@ -1417,6 +1426,153 @@ class LegalTextsGateway extends AlcoreBase {
|
|
|
1417
1426
|
return throwIfApiError(decrypted);
|
|
1418
1427
|
}
|
|
1419
1428
|
}
|
|
1429
|
+
const BUSINESS_TYPES = [
|
|
1430
|
+
"SOLE_PROPRIETORSHIP",
|
|
1431
|
+
"LLC",
|
|
1432
|
+
"LLP",
|
|
1433
|
+
"CORPORATION_C",
|
|
1434
|
+
"CORPORATION_S",
|
|
1435
|
+
"GENERAL_PARTNERSHIP",
|
|
1436
|
+
"GOVERNMENT_ENTITY",
|
|
1437
|
+
"NON_PROFIT_CORPORATION"
|
|
1438
|
+
];
|
|
1439
|
+
const COUNTRIES = ["USA", "CAN", "MEX", "GBR"];
|
|
1440
|
+
const PROFESSIONS = [
|
|
1441
|
+
"ACCOUNTANT",
|
|
1442
|
+
"ACTOR",
|
|
1443
|
+
"ADMINISTRATIVE_ASSISTANT",
|
|
1444
|
+
"ANALYST",
|
|
1445
|
+
"ARCHITECT",
|
|
1446
|
+
"ARTIST",
|
|
1447
|
+
"CARPENTER",
|
|
1448
|
+
"CASHIER",
|
|
1449
|
+
"CHILDCARE",
|
|
1450
|
+
"COOK",
|
|
1451
|
+
"CLEANER",
|
|
1452
|
+
"COACH",
|
|
1453
|
+
"CONSTRUCTION_WORKER",
|
|
1454
|
+
"CONSULTANT",
|
|
1455
|
+
"CONTENT_CREATOR",
|
|
1456
|
+
"COUNSELOR",
|
|
1457
|
+
"CUSTOMER_SERVICE",
|
|
1458
|
+
"DATA_ENTRY",
|
|
1459
|
+
"DESIGNER",
|
|
1460
|
+
"DENTIST",
|
|
1461
|
+
"DEVELOPER",
|
|
1462
|
+
"DIETITIAN",
|
|
1463
|
+
"DOCTOR",
|
|
1464
|
+
"DRIVER",
|
|
1465
|
+
"EDITOR",
|
|
1466
|
+
"ELECTRICIAN",
|
|
1467
|
+
"ENGINEER",
|
|
1468
|
+
"ESTHETICIAN",
|
|
1469
|
+
"EXECUTIVE",
|
|
1470
|
+
"EXECUTIVE_ASSISTANT",
|
|
1471
|
+
"FARMER",
|
|
1472
|
+
"FINANCIAL_ADVISOR",
|
|
1473
|
+
"FIREFIGHTER",
|
|
1474
|
+
"GRAPHIC_DESIGNER",
|
|
1475
|
+
"HAIRDRESSER",
|
|
1476
|
+
"HUMAN_RESOURCES",
|
|
1477
|
+
"IT_SUPPORT",
|
|
1478
|
+
"JANITOR",
|
|
1479
|
+
"JUDGE",
|
|
1480
|
+
"LAWYER",
|
|
1481
|
+
"LIBRARIAN",
|
|
1482
|
+
"MAINTENANCE_WORKER",
|
|
1483
|
+
"MANAGER",
|
|
1484
|
+
"MEDICAL_ASSISTANT",
|
|
1485
|
+
"MECHANIC",
|
|
1486
|
+
"MILITARY",
|
|
1487
|
+
"MUSICIAN",
|
|
1488
|
+
"NURSE",
|
|
1489
|
+
"PARALEGAL",
|
|
1490
|
+
"PARAMEDIC",
|
|
1491
|
+
"PHARMACIST",
|
|
1492
|
+
"PHOTOGRAPHER",
|
|
1493
|
+
"PHYSICAL_THERAPIST",
|
|
1494
|
+
"PHYSICIAN",
|
|
1495
|
+
"PILOT",
|
|
1496
|
+
"PLUMBER",
|
|
1497
|
+
"POLICE_OFFICER",
|
|
1498
|
+
"POLITICIAN",
|
|
1499
|
+
"PROFESSOR",
|
|
1500
|
+
"PROJECT_MANAGER",
|
|
1501
|
+
"PSYCHOLOGIST",
|
|
1502
|
+
"REAL_ESTATE_AGENT",
|
|
1503
|
+
"RECEPTIONIST",
|
|
1504
|
+
"RESEARCHER",
|
|
1505
|
+
"RETAIL_ASSOCIATE",
|
|
1506
|
+
"SALES_REPRESENTATIVE",
|
|
1507
|
+
"SCIENTIST",
|
|
1508
|
+
"SECURITY_GUARD",
|
|
1509
|
+
"SOCIAL_WORKER",
|
|
1510
|
+
"TEACHER",
|
|
1511
|
+
"TECHNICIAN",
|
|
1512
|
+
"TRANSLATOR",
|
|
1513
|
+
"VETERINARIAN",
|
|
1514
|
+
"WAREHOUSE_WORKER",
|
|
1515
|
+
"WELDER",
|
|
1516
|
+
"WRITER"
|
|
1517
|
+
];
|
|
1518
|
+
const US_STATES = [
|
|
1519
|
+
"AL",
|
|
1520
|
+
"AK",
|
|
1521
|
+
"AZ",
|
|
1522
|
+
"AR",
|
|
1523
|
+
"CA",
|
|
1524
|
+
"CO",
|
|
1525
|
+
"CT",
|
|
1526
|
+
"DE",
|
|
1527
|
+
"FL",
|
|
1528
|
+
"GA",
|
|
1529
|
+
"HI",
|
|
1530
|
+
"ID",
|
|
1531
|
+
"IL",
|
|
1532
|
+
"IN",
|
|
1533
|
+
"IA",
|
|
1534
|
+
"KS",
|
|
1535
|
+
"KY",
|
|
1536
|
+
"LA",
|
|
1537
|
+
"ME",
|
|
1538
|
+
"MD",
|
|
1539
|
+
"MA",
|
|
1540
|
+
"MI",
|
|
1541
|
+
"MN",
|
|
1542
|
+
"MS",
|
|
1543
|
+
"MO",
|
|
1544
|
+
"MT",
|
|
1545
|
+
"NE",
|
|
1546
|
+
"NV",
|
|
1547
|
+
"NH",
|
|
1548
|
+
"NJ",
|
|
1549
|
+
"NM",
|
|
1550
|
+
"NY",
|
|
1551
|
+
"NC",
|
|
1552
|
+
"ND",
|
|
1553
|
+
"OH",
|
|
1554
|
+
"OK",
|
|
1555
|
+
"OR",
|
|
1556
|
+
"PA",
|
|
1557
|
+
"RI",
|
|
1558
|
+
"SC",
|
|
1559
|
+
"SD",
|
|
1560
|
+
"TN",
|
|
1561
|
+
"TX",
|
|
1562
|
+
"UT",
|
|
1563
|
+
"VT",
|
|
1564
|
+
"VA",
|
|
1565
|
+
"WA",
|
|
1566
|
+
"WV",
|
|
1567
|
+
"WI",
|
|
1568
|
+
"WY",
|
|
1569
|
+
"DC",
|
|
1570
|
+
"AS",
|
|
1571
|
+
"GU",
|
|
1572
|
+
"MP",
|
|
1573
|
+
"PR",
|
|
1574
|
+
"VI"
|
|
1575
|
+
];
|
|
1420
1576
|
function NewAddCardRequest(params) {
|
|
1421
1577
|
const { external_id, name, pan, expiry, code, zip } = params;
|
|
1422
1578
|
const expiryParts = expiry.split("/");
|
|
@@ -2506,9 +2662,11 @@ export {
|
|
|
2506
2662
|
AlcoreErrorMessages,
|
|
2507
2663
|
AlviereCore,
|
|
2508
2664
|
AuthGateway,
|
|
2665
|
+
BUSINESS_TYPES,
|
|
2509
2666
|
BankInfoGateway,
|
|
2510
2667
|
BaseFieldPlugin,
|
|
2511
2668
|
CERTIFICATE_ID,
|
|
2669
|
+
COUNTRIES,
|
|
2512
2670
|
CardNumberPlugin,
|
|
2513
2671
|
CriticalErrorCodes,
|
|
2514
2672
|
Cryptor,
|
|
@@ -2537,11 +2695,13 @@ export {
|
|
|
2537
2695
|
NewSendFundsRequest,
|
|
2538
2696
|
NewTransferFundsRequest,
|
|
2539
2697
|
NewWithdrawFundsRequest,
|
|
2698
|
+
PROFESSIONS,
|
|
2540
2699
|
PaymentInstrumentsApiService,
|
|
2541
2700
|
PaymentInstrumentsGateway,
|
|
2542
2701
|
PaymentProcessor,
|
|
2543
2702
|
PaymentsGateway,
|
|
2544
2703
|
RSA_PUB_KEY,
|
|
2704
|
+
US_STATES,
|
|
2545
2705
|
Validator,
|
|
2546
2706
|
WalletsApiService,
|
|
2547
2707
|
WalletsGateway,
|