@zyphe-sdk/core 0.6.0 → 0.8.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 +4481 -1817
- package/dist/index.js +320 -2
- package/dist/index.js.map +1 -1
- package/dist/openapi.d.ts +2190 -638
- package/dist/openapi.json +3146 -484
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1526,6 +1526,247 @@ async function sendKybUboReminder({ organizationId, kybResultId, recipientIndex,
|
|
|
1526
1526
|
}
|
|
1527
1527
|
});
|
|
1528
1528
|
}
|
|
1529
|
+
async function getKybCase({ organizationId, caseId, isSandbox, locale }, opts) {
|
|
1530
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1531
|
+
const client = zypheApiClient(opts);
|
|
1532
|
+
return client.GET("/sdk/organizations/{organization_id}/kyb-cases/{case_id}", {
|
|
1533
|
+
params: {
|
|
1534
|
+
path: {
|
|
1535
|
+
organization_id: organizationId,
|
|
1536
|
+
case_id: caseId
|
|
1537
|
+
},
|
|
1538
|
+
query: {
|
|
1539
|
+
sandbox: isSandbox,
|
|
1540
|
+
locale
|
|
1541
|
+
}
|
|
1542
|
+
},
|
|
1543
|
+
headers: {
|
|
1544
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
1545
|
+
}
|
|
1546
|
+
});
|
|
1547
|
+
}
|
|
1548
|
+
function attachmentFileName(header) {
|
|
1549
|
+
return header ? /filename="?([^";]+)"?/i.exec(header)?.[1] : void 0;
|
|
1550
|
+
}
|
|
1551
|
+
async function getKybCaseReport({ organizationId, caseId, isSandbox, locale, ifNoneMatch }, opts) {
|
|
1552
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1553
|
+
const client = zypheApiClient(opts);
|
|
1554
|
+
const { data, error, response } = await client.GET("/sdk/organizations/{organization_id}/kyb-cases/{case_id}/report", {
|
|
1555
|
+
params: {
|
|
1556
|
+
path: {
|
|
1557
|
+
organization_id: organizationId,
|
|
1558
|
+
case_id: caseId
|
|
1559
|
+
},
|
|
1560
|
+
query: {
|
|
1561
|
+
sandbox: isSandbox,
|
|
1562
|
+
locale
|
|
1563
|
+
},
|
|
1564
|
+
header: ifNoneMatch ? { "If-None-Match": ifNoneMatch } : void 0
|
|
1565
|
+
},
|
|
1566
|
+
headers: {
|
|
1567
|
+
[API_KEY_HEADER]: opts.apiKey,
|
|
1568
|
+
Accept: "application/pdf"
|
|
1569
|
+
},
|
|
1570
|
+
parseAs: "arrayBuffer"
|
|
1571
|
+
});
|
|
1572
|
+
const etag = response.headers.get("etag") ?? void 0;
|
|
1573
|
+
if (response.status === 304) {
|
|
1574
|
+
return { data: void 0, error: void 0, response, notModified: true, etag, fileName: void 0 };
|
|
1575
|
+
}
|
|
1576
|
+
return {
|
|
1577
|
+
data: data ? new Uint8Array(data) : void 0,
|
|
1578
|
+
error,
|
|
1579
|
+
response,
|
|
1580
|
+
notModified: false,
|
|
1581
|
+
etag,
|
|
1582
|
+
fileName: attachmentFileName(response.headers.get("content-disposition"))
|
|
1583
|
+
};
|
|
1584
|
+
}
|
|
1585
|
+
async function decideKybCase({ organizationId, caseId, isSandbox, locale, outcome, reason, reasonCode, dueDiligenceLevel, confirmingProposalId }, opts) {
|
|
1586
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1587
|
+
const client = zypheApiClient(opts);
|
|
1588
|
+
return client.POST("/sdk/organizations/{organization_id}/kyb-cases/{case_id}/decision", {
|
|
1589
|
+
params: {
|
|
1590
|
+
path: {
|
|
1591
|
+
organization_id: organizationId,
|
|
1592
|
+
case_id: caseId
|
|
1593
|
+
},
|
|
1594
|
+
query: {
|
|
1595
|
+
sandbox: isSandbox,
|
|
1596
|
+
locale
|
|
1597
|
+
}
|
|
1598
|
+
},
|
|
1599
|
+
body: {
|
|
1600
|
+
outcome,
|
|
1601
|
+
reason,
|
|
1602
|
+
reasonCode,
|
|
1603
|
+
dueDiligenceLevel,
|
|
1604
|
+
confirmingProposalId
|
|
1605
|
+
},
|
|
1606
|
+
headers: {
|
|
1607
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
1608
|
+
}
|
|
1609
|
+
});
|
|
1610
|
+
}
|
|
1611
|
+
async function getKybCaseOfficers({ organizationId, caseId, isSandbox, locale }, opts) {
|
|
1612
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1613
|
+
const client = zypheApiClient(opts);
|
|
1614
|
+
return client.GET("/sdk/organizations/{organization_id}/kyb-cases/{case_id}/officers", {
|
|
1615
|
+
params: {
|
|
1616
|
+
path: {
|
|
1617
|
+
organization_id: organizationId,
|
|
1618
|
+
case_id: caseId
|
|
1619
|
+
},
|
|
1620
|
+
query: {
|
|
1621
|
+
sandbox: isSandbox,
|
|
1622
|
+
locale
|
|
1623
|
+
}
|
|
1624
|
+
},
|
|
1625
|
+
headers: {
|
|
1626
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
1627
|
+
}
|
|
1628
|
+
});
|
|
1629
|
+
}
|
|
1630
|
+
async function addKybCaseUbos({ organizationId, caseId, isSandbox, persons, locale }, opts) {
|
|
1631
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1632
|
+
const client = zypheApiClient(opts);
|
|
1633
|
+
return client.POST("/sdk/organizations/{organization_id}/kyb-cases/{case_id}/ubos", {
|
|
1634
|
+
params: {
|
|
1635
|
+
path: {
|
|
1636
|
+
organization_id: organizationId,
|
|
1637
|
+
case_id: caseId
|
|
1638
|
+
},
|
|
1639
|
+
query: {
|
|
1640
|
+
sandbox: isSandbox,
|
|
1641
|
+
locale
|
|
1642
|
+
}
|
|
1643
|
+
},
|
|
1644
|
+
body: {
|
|
1645
|
+
persons
|
|
1646
|
+
},
|
|
1647
|
+
headers: {
|
|
1648
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
1649
|
+
}
|
|
1650
|
+
});
|
|
1651
|
+
}
|
|
1652
|
+
async function removeKybCaseUbo({ organizationId, caseId, personId, isSandbox, locale }, opts) {
|
|
1653
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1654
|
+
const client = zypheApiClient(opts);
|
|
1655
|
+
return client.DELETE("/sdk/organizations/{organization_id}/kyb-cases/{case_id}/ubos/{person_id}", {
|
|
1656
|
+
params: {
|
|
1657
|
+
path: {
|
|
1658
|
+
organization_id: organizationId,
|
|
1659
|
+
case_id: caseId,
|
|
1660
|
+
person_id: personId
|
|
1661
|
+
},
|
|
1662
|
+
query: {
|
|
1663
|
+
sandbox: isSandbox,
|
|
1664
|
+
locale
|
|
1665
|
+
}
|
|
1666
|
+
},
|
|
1667
|
+
headers: {
|
|
1668
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
1669
|
+
}
|
|
1670
|
+
});
|
|
1671
|
+
}
|
|
1672
|
+
async function addKybCaseDirectors({ organizationId, caseId, isSandbox, persons, locale }, opts) {
|
|
1673
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1674
|
+
const client = zypheApiClient(opts);
|
|
1675
|
+
return client.POST("/sdk/organizations/{organization_id}/kyb-cases/{case_id}/directors", {
|
|
1676
|
+
params: {
|
|
1677
|
+
path: {
|
|
1678
|
+
organization_id: organizationId,
|
|
1679
|
+
case_id: caseId
|
|
1680
|
+
},
|
|
1681
|
+
query: {
|
|
1682
|
+
sandbox: isSandbox,
|
|
1683
|
+
locale
|
|
1684
|
+
}
|
|
1685
|
+
},
|
|
1686
|
+
body: {
|
|
1687
|
+
persons
|
|
1688
|
+
},
|
|
1689
|
+
headers: {
|
|
1690
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
1691
|
+
}
|
|
1692
|
+
});
|
|
1693
|
+
}
|
|
1694
|
+
async function removeKybCaseDirector({ organizationId, caseId, personId, isSandbox, locale }, opts) {
|
|
1695
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1696
|
+
const client = zypheApiClient(opts);
|
|
1697
|
+
return client.DELETE("/sdk/organizations/{organization_id}/kyb-cases/{case_id}/directors/{person_id}", {
|
|
1698
|
+
params: {
|
|
1699
|
+
path: {
|
|
1700
|
+
organization_id: organizationId,
|
|
1701
|
+
case_id: caseId,
|
|
1702
|
+
person_id: personId
|
|
1703
|
+
},
|
|
1704
|
+
query: {
|
|
1705
|
+
sandbox: isSandbox,
|
|
1706
|
+
locale
|
|
1707
|
+
}
|
|
1708
|
+
},
|
|
1709
|
+
headers: {
|
|
1710
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
1711
|
+
}
|
|
1712
|
+
});
|
|
1713
|
+
}
|
|
1714
|
+
async function requestKybCaseOnDemandDocument({
|
|
1715
|
+
organizationId,
|
|
1716
|
+
caseId,
|
|
1717
|
+
isSandbox,
|
|
1718
|
+
locale,
|
|
1719
|
+
documentKey,
|
|
1720
|
+
recipientEmail,
|
|
1721
|
+
subject,
|
|
1722
|
+
body,
|
|
1723
|
+
description
|
|
1724
|
+
}, opts) {
|
|
1725
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1726
|
+
const client = zypheApiClient(opts);
|
|
1727
|
+
return client.POST("/sdk/organizations/{organization_id}/kyb-cases/{case_id}/document-requests/on-demand", {
|
|
1728
|
+
params: {
|
|
1729
|
+
path: {
|
|
1730
|
+
organization_id: organizationId,
|
|
1731
|
+
case_id: caseId
|
|
1732
|
+
},
|
|
1733
|
+
query: {
|
|
1734
|
+
sandbox: isSandbox,
|
|
1735
|
+
locale
|
|
1736
|
+
}
|
|
1737
|
+
},
|
|
1738
|
+
body: {
|
|
1739
|
+
documentKey,
|
|
1740
|
+
recipientEmail,
|
|
1741
|
+
subject,
|
|
1742
|
+
body,
|
|
1743
|
+
description
|
|
1744
|
+
},
|
|
1745
|
+
headers: {
|
|
1746
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
1747
|
+
}
|
|
1748
|
+
});
|
|
1749
|
+
}
|
|
1750
|
+
async function sendKybCaseUboReminder({ organizationId, caseId, recipientIndex, isSandbox, locale }, opts) {
|
|
1751
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1752
|
+
const client = zypheApiClient(opts);
|
|
1753
|
+
return client.POST("/sdk/organizations/{organization_id}/kyb-cases/{case_id}/reminders/ubo/{recipient_index}", {
|
|
1754
|
+
params: {
|
|
1755
|
+
path: {
|
|
1756
|
+
organization_id: organizationId,
|
|
1757
|
+
case_id: caseId,
|
|
1758
|
+
recipient_index: recipientIndex
|
|
1759
|
+
},
|
|
1760
|
+
query: {
|
|
1761
|
+
sandbox: isSandbox,
|
|
1762
|
+
locale
|
|
1763
|
+
}
|
|
1764
|
+
},
|
|
1765
|
+
headers: {
|
|
1766
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
1767
|
+
}
|
|
1768
|
+
});
|
|
1769
|
+
}
|
|
1529
1770
|
|
|
1530
1771
|
// src/tin-check.ts
|
|
1531
1772
|
async function runTinCheck({ organizationId, isSandbox, name, tin, address, giin, mock, locale }, opts) {
|
|
@@ -1553,7 +1794,7 @@ async function runTinCheck({ organizationId, isSandbox, name, tin, address, giin
|
|
|
1553
1794
|
}
|
|
1554
1795
|
});
|
|
1555
1796
|
}
|
|
1556
|
-
async function listTinChecks({ organizationId, isSandbox, take, skip, locale }, opts) {
|
|
1797
|
+
async function listTinChecks({ organizationId, isSandbox, take, skip, verificationRequestId, flowResultId, locale }, opts) {
|
|
1557
1798
|
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1558
1799
|
const client = zypheApiClient(opts);
|
|
1559
1800
|
return client.GET("/sdk/organizations/{organization_id}/tin-checks", {
|
|
@@ -1564,6 +1805,8 @@ async function listTinChecks({ organizationId, isSandbox, take, skip, locale },
|
|
|
1564
1805
|
query: {
|
|
1565
1806
|
take,
|
|
1566
1807
|
skip,
|
|
1808
|
+
verificationRequestId,
|
|
1809
|
+
flowResultId,
|
|
1567
1810
|
sandbox: isSandbox,
|
|
1568
1811
|
locale
|
|
1569
1812
|
}
|
|
@@ -1611,6 +1854,68 @@ async function getTinCheckQuote({ organizationId, isSandbox, locale }, opts) {
|
|
|
1611
1854
|
});
|
|
1612
1855
|
}
|
|
1613
1856
|
|
|
1857
|
+
// src/transaction-monitoring.ts
|
|
1858
|
+
async function ingestTransaction({ organizationId, isSandbox, transaction, locale }, opts) {
|
|
1859
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1860
|
+
const client = zypheApiClient(opts);
|
|
1861
|
+
return client.POST("/sdk/organizations/{organization_id}/transactions", {
|
|
1862
|
+
params: {
|
|
1863
|
+
path: {
|
|
1864
|
+
organization_id: organizationId
|
|
1865
|
+
},
|
|
1866
|
+
query: {
|
|
1867
|
+
sandbox: isSandbox,
|
|
1868
|
+
locale
|
|
1869
|
+
}
|
|
1870
|
+
},
|
|
1871
|
+
body: transaction,
|
|
1872
|
+
headers: {
|
|
1873
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
1874
|
+
}
|
|
1875
|
+
});
|
|
1876
|
+
}
|
|
1877
|
+
async function getTransaction({ organizationId, transactionId, isSandbox, locale }, opts) {
|
|
1878
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1879
|
+
const client = zypheApiClient(opts);
|
|
1880
|
+
return client.GET("/sdk/organizations/{organization_id}/transactions/{transaction_id}", {
|
|
1881
|
+
params: {
|
|
1882
|
+
path: {
|
|
1883
|
+
organization_id: organizationId,
|
|
1884
|
+
transaction_id: transactionId
|
|
1885
|
+
},
|
|
1886
|
+
query: {
|
|
1887
|
+
sandbox: isSandbox,
|
|
1888
|
+
locale
|
|
1889
|
+
}
|
|
1890
|
+
},
|
|
1891
|
+
headers: {
|
|
1892
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
1893
|
+
}
|
|
1894
|
+
});
|
|
1895
|
+
}
|
|
1896
|
+
async function updateTransactionStatus({ organizationId, transactionId, status, isSandbox, locale }, opts) {
|
|
1897
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1898
|
+
const client = zypheApiClient(opts);
|
|
1899
|
+
return client.PATCH("/sdk/organizations/{organization_id}/transactions/{transaction_id}", {
|
|
1900
|
+
params: {
|
|
1901
|
+
path: {
|
|
1902
|
+
organization_id: organizationId,
|
|
1903
|
+
transaction_id: transactionId
|
|
1904
|
+
},
|
|
1905
|
+
query: {
|
|
1906
|
+
sandbox: isSandbox,
|
|
1907
|
+
locale
|
|
1908
|
+
}
|
|
1909
|
+
},
|
|
1910
|
+
body: {
|
|
1911
|
+
status
|
|
1912
|
+
},
|
|
1913
|
+
headers: {
|
|
1914
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
1915
|
+
}
|
|
1916
|
+
});
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1614
1919
|
// src/types.ts
|
|
1615
1920
|
var DocumentType = {
|
|
1616
1921
|
IDENTITY_CARD: 12,
|
|
@@ -1782,6 +2087,8 @@ export {
|
|
|
1782
2087
|
WebhookSignatureErrorCodes,
|
|
1783
2088
|
WebhookSignatureErrorMessages,
|
|
1784
2089
|
ZypheError,
|
|
2090
|
+
addKybCaseDirectors,
|
|
2091
|
+
addKybCaseUbos,
|
|
1785
2092
|
addKybDirectors,
|
|
1786
2093
|
addKybUbos,
|
|
1787
2094
|
bufferToHex,
|
|
@@ -1790,21 +2097,32 @@ export {
|
|
|
1790
2097
|
completeLivenessStep,
|
|
1791
2098
|
constructVerificationSessionUrl,
|
|
1792
2099
|
createVerificationSession,
|
|
2100
|
+
decideKybCase,
|
|
1793
2101
|
getDvResult,
|
|
1794
2102
|
getFlowResult,
|
|
2103
|
+
getKybCase,
|
|
2104
|
+
getKybCaseOfficers,
|
|
2105
|
+
getKybCaseReport,
|
|
1795
2106
|
getNextStepDetails,
|
|
1796
2107
|
getTinCheck,
|
|
1797
2108
|
getTinCheckQuote,
|
|
2109
|
+
getTransaction,
|
|
1798
2110
|
hexToBytes,
|
|
2111
|
+
ingestTransaction,
|
|
1799
2112
|
listFlowResults,
|
|
1800
2113
|
listTinChecks,
|
|
1801
2114
|
parseSignatureHeader,
|
|
2115
|
+
removeKybCaseDirector,
|
|
2116
|
+
removeKybCaseUbo,
|
|
1802
2117
|
removeKybDirector,
|
|
1803
2118
|
removeKybUbo,
|
|
2119
|
+
requestKybCaseOnDemandDocument,
|
|
1804
2120
|
requestKybOnDemandDocument,
|
|
1805
2121
|
runTinCheck,
|
|
1806
2122
|
screenAml,
|
|
2123
|
+
sendKybCaseUboReminder,
|
|
1807
2124
|
sendKybUboReminder,
|
|
1808
|
-
timingSafeEqual
|
|
2125
|
+
timingSafeEqual,
|
|
2126
|
+
updateTransactionStatus
|
|
1809
2127
|
};
|
|
1810
2128
|
//# sourceMappingURL=index.js.map
|