@zyphe-sdk/core 0.4.0 → 0.5.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/index.d.ts +2736 -476
- package/dist/index.js +170 -11
- package/dist/index.js.map +1 -1
- package/dist/openapi.d.ts +1746 -150
- package/dist/openapi.json +3437 -526
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31,6 +31,41 @@ var zypheApiClient = (opts) => {
|
|
|
31
31
|
});
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
+
// src/utils/guards.ts
|
|
35
|
+
var ApiKeyTypes = {
|
|
36
|
+
PUBLISHABLE: "zyphe_pk_",
|
|
37
|
+
SECRET: "zyphe_sk_"
|
|
38
|
+
};
|
|
39
|
+
function ensureApiKeyType(apiKey, types) {
|
|
40
|
+
if (!types.some((type) => apiKey.startsWith(ApiKeyTypes[type]))) {
|
|
41
|
+
throw new Error(`Invalid API key. This function is only available for ${types.join(", ")} keys`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// src/aml.ts
|
|
46
|
+
async function screenAml({ organizationId, isSandbox, query, subjectType, locale }, opts) {
|
|
47
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
48
|
+
const client = zypheApiClient(opts);
|
|
49
|
+
return client.POST("/sdk/organizations/{organization_id}/aml/screen", {
|
|
50
|
+
params: {
|
|
51
|
+
path: {
|
|
52
|
+
organization_id: organizationId
|
|
53
|
+
},
|
|
54
|
+
query: {
|
|
55
|
+
sandbox: isSandbox,
|
|
56
|
+
locale
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
body: {
|
|
60
|
+
query,
|
|
61
|
+
subjectType
|
|
62
|
+
},
|
|
63
|
+
headers: {
|
|
64
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
34
69
|
// src/sdk-error.ts
|
|
35
70
|
var ZypheError = class _ZypheError extends Error {
|
|
36
71
|
errorTag;
|
|
@@ -187,17 +222,6 @@ async function completeDocumentSelectionStep({ verificationSession, payload }, o
|
|
|
187
222
|
return processDocumentSelectionResponse.data;
|
|
188
223
|
}
|
|
189
224
|
|
|
190
|
-
// src/utils/guards.ts
|
|
191
|
-
var ApiKeyTypes = {
|
|
192
|
-
PUBLISHABLE: "zyphe_pk_",
|
|
193
|
-
SECRET: "zyphe_sk_"
|
|
194
|
-
};
|
|
195
|
-
function ensureApiKeyType(apiKey, types) {
|
|
196
|
-
if (!types.some((type) => apiKey.startsWith(ApiKeyTypes[type]))) {
|
|
197
|
-
throw new Error(`Invalid API key. This function is only available for ${types.join(", ")} keys`);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
225
|
// src/gen/dv_result.ts
|
|
202
226
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
203
227
|
function imageProvenanceFromJSON(object) {
|
|
@@ -1375,6 +1399,134 @@ async function getDvResult({ organizationId, flowResultId, dvResultId, isSandbox
|
|
|
1375
1399
|
};
|
|
1376
1400
|
}
|
|
1377
1401
|
|
|
1402
|
+
// src/kyb.ts
|
|
1403
|
+
async function addKybUbos({ organizationId, kybResultId, isSandbox, persons, locale }, opts) {
|
|
1404
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1405
|
+
const client = zypheApiClient(opts);
|
|
1406
|
+
return client.POST("/sdk/organizations/{organization_id}/kyb/{kyb_result_id}/ubos", {
|
|
1407
|
+
params: {
|
|
1408
|
+
path: {
|
|
1409
|
+
organization_id: organizationId,
|
|
1410
|
+
kyb_result_id: kybResultId
|
|
1411
|
+
},
|
|
1412
|
+
query: {
|
|
1413
|
+
sandbox: isSandbox,
|
|
1414
|
+
locale
|
|
1415
|
+
}
|
|
1416
|
+
},
|
|
1417
|
+
body: {
|
|
1418
|
+
persons
|
|
1419
|
+
},
|
|
1420
|
+
headers: {
|
|
1421
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
1422
|
+
}
|
|
1423
|
+
});
|
|
1424
|
+
}
|
|
1425
|
+
async function removeKybUbo({ organizationId, kybResultId, personId, isSandbox, locale }, opts) {
|
|
1426
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1427
|
+
const client = zypheApiClient(opts);
|
|
1428
|
+
return client.DELETE("/sdk/organizations/{organization_id}/kyb/{kyb_result_id}/ubos/{person_id}", {
|
|
1429
|
+
params: {
|
|
1430
|
+
path: {
|
|
1431
|
+
organization_id: organizationId,
|
|
1432
|
+
kyb_result_id: kybResultId,
|
|
1433
|
+
person_id: personId
|
|
1434
|
+
},
|
|
1435
|
+
query: {
|
|
1436
|
+
sandbox: isSandbox,
|
|
1437
|
+
locale
|
|
1438
|
+
}
|
|
1439
|
+
},
|
|
1440
|
+
headers: {
|
|
1441
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
1442
|
+
}
|
|
1443
|
+
});
|
|
1444
|
+
}
|
|
1445
|
+
async function addKybDirectors({ organizationId, kybResultId, isSandbox, persons, locale }, opts) {
|
|
1446
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1447
|
+
const client = zypheApiClient(opts);
|
|
1448
|
+
return client.POST("/sdk/organizations/{organization_id}/kyb/{kyb_result_id}/directors", {
|
|
1449
|
+
params: {
|
|
1450
|
+
path: {
|
|
1451
|
+
organization_id: organizationId,
|
|
1452
|
+
kyb_result_id: kybResultId
|
|
1453
|
+
},
|
|
1454
|
+
query: {
|
|
1455
|
+
sandbox: isSandbox,
|
|
1456
|
+
locale
|
|
1457
|
+
}
|
|
1458
|
+
},
|
|
1459
|
+
body: {
|
|
1460
|
+
persons
|
|
1461
|
+
},
|
|
1462
|
+
headers: {
|
|
1463
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
1464
|
+
}
|
|
1465
|
+
});
|
|
1466
|
+
}
|
|
1467
|
+
async function removeKybDirector({ organizationId, kybResultId, personId, isSandbox, locale }, opts) {
|
|
1468
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1469
|
+
const client = zypheApiClient(opts);
|
|
1470
|
+
return client.DELETE("/sdk/organizations/{organization_id}/kyb/{kyb_result_id}/directors/{person_id}", {
|
|
1471
|
+
params: {
|
|
1472
|
+
path: {
|
|
1473
|
+
organization_id: organizationId,
|
|
1474
|
+
kyb_result_id: kybResultId,
|
|
1475
|
+
person_id: personId
|
|
1476
|
+
},
|
|
1477
|
+
query: {
|
|
1478
|
+
sandbox: isSandbox,
|
|
1479
|
+
locale
|
|
1480
|
+
}
|
|
1481
|
+
},
|
|
1482
|
+
headers: {
|
|
1483
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
1484
|
+
}
|
|
1485
|
+
});
|
|
1486
|
+
}
|
|
1487
|
+
async function requestKybOnDemandDocument({ organizationId, kybResultId, documentKey, isSandbox, locale }, opts) {
|
|
1488
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1489
|
+
const client = zypheApiClient(opts);
|
|
1490
|
+
return client.POST("/sdk/organizations/{organization_id}/kyb/{kyb_result_id}/document-requests/on-demand", {
|
|
1491
|
+
params: {
|
|
1492
|
+
path: {
|
|
1493
|
+
organization_id: organizationId,
|
|
1494
|
+
kyb_result_id: kybResultId
|
|
1495
|
+
},
|
|
1496
|
+
query: {
|
|
1497
|
+
sandbox: isSandbox,
|
|
1498
|
+
locale
|
|
1499
|
+
}
|
|
1500
|
+
},
|
|
1501
|
+
body: {
|
|
1502
|
+
documentKey
|
|
1503
|
+
},
|
|
1504
|
+
headers: {
|
|
1505
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
1506
|
+
}
|
|
1507
|
+
});
|
|
1508
|
+
}
|
|
1509
|
+
async function sendKybUboReminder({ organizationId, kybResultId, recipientIndex, isSandbox, locale }, opts) {
|
|
1510
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1511
|
+
const client = zypheApiClient(opts);
|
|
1512
|
+
return client.POST("/sdk/organizations/{organization_id}/kyb/{kyb_result_id}/reminders/ubo/{recipient_index}", {
|
|
1513
|
+
params: {
|
|
1514
|
+
path: {
|
|
1515
|
+
organization_id: organizationId,
|
|
1516
|
+
kyb_result_id: kybResultId,
|
|
1517
|
+
recipient_index: recipientIndex
|
|
1518
|
+
},
|
|
1519
|
+
query: {
|
|
1520
|
+
sandbox: isSandbox,
|
|
1521
|
+
locale
|
|
1522
|
+
}
|
|
1523
|
+
},
|
|
1524
|
+
headers: {
|
|
1525
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
1526
|
+
}
|
|
1527
|
+
});
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1378
1530
|
// src/types.ts
|
|
1379
1531
|
var DocumentType = {
|
|
1380
1532
|
IDENTITY_CARD: 12,
|
|
@@ -1546,6 +1698,8 @@ export {
|
|
|
1546
1698
|
WebhookSignatureErrorCodes,
|
|
1547
1699
|
WebhookSignatureErrorMessages,
|
|
1548
1700
|
ZypheError,
|
|
1701
|
+
addKybDirectors,
|
|
1702
|
+
addKybUbos,
|
|
1549
1703
|
bufferToHex,
|
|
1550
1704
|
completeDocumentSelectionStep,
|
|
1551
1705
|
completeDvStep,
|
|
@@ -1558,6 +1712,11 @@ export {
|
|
|
1558
1712
|
hexToBytes,
|
|
1559
1713
|
listFlowResults,
|
|
1560
1714
|
parseSignatureHeader,
|
|
1715
|
+
removeKybDirector,
|
|
1716
|
+
removeKybUbo,
|
|
1717
|
+
requestKybOnDemandDocument,
|
|
1718
|
+
screenAml,
|
|
1719
|
+
sendKybUboReminder,
|
|
1561
1720
|
timingSafeEqual
|
|
1562
1721
|
};
|
|
1563
1722
|
//# sourceMappingURL=index.js.map
|