vesant-sdk 1.8.0-dev.31d63f0 → 1.8.0-dev.32e3a40
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/README.md +5 -3
- package/dist/{client-DUHC-68_.d.ts → client-4oLoc31v.d.ts} +1 -1
- package/dist/{client-5q4whhGu.d.mts → client-CJI8VO1i.d.mts} +1 -1
- package/dist/compliance/index.d.mts +2 -2
- package/dist/compliance/index.d.ts +2 -2
- package/dist/compliance/index.js +19 -3
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +19 -3
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +72 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +71 -15
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.d.mts +2 -2
- package/dist/kyc/core.d.ts +2 -2
- package/dist/kyc/core.js +52 -11
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +52 -12
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +177 -17
- package/dist/kyc/index.d.ts +177 -17
- package/dist/kyc/index.js +52 -11
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +52 -12
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +21 -3
- package/dist/react.d.ts +21 -3
- package/dist/react.js +8 -1
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +8 -1
- package/dist/react.mjs.map +1 -1
- package/dist/risk-profile/index.d.mts +16 -6
- package/dist/risk-profile/index.d.ts +16 -6
- package/dist/risk-profile/index.js +18 -2
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +18 -3
- package/dist/risk-profile/index.mjs.map +1 -1
- package/dist/tax/index.d.mts +1 -1
- package/dist/tax/index.d.ts +1 -1
- package/dist/{types-UGyDl1fd.d.ts → types-1kI4SsKB.d.ts} +44 -1
- package/dist/{types-BOFaMQxI.d.mts → types-DfbnIaW_.d.mts} +44 -1
- package/package.json +1 -1
package/dist/kyc/core.mjs
CHANGED
|
@@ -890,19 +890,26 @@ var KycClient = class extends BaseClient {
|
|
|
890
890
|
}, void 0, requestOptions);
|
|
891
891
|
}
|
|
892
892
|
/**
|
|
893
|
-
* Get a KYC
|
|
893
|
+
* Get a KYC record by ID
|
|
894
894
|
*
|
|
895
|
-
*
|
|
896
|
-
*
|
|
895
|
+
* Works with your tenant API key. Each entry in `proofs` carries a
|
|
896
|
+
* short-lived `link` for downloading that document, and `reference` holds
|
|
897
|
+
* your own customer reference (the `forward_reference`).
|
|
898
|
+
*
|
|
899
|
+
* @param id - KYC record ID (the `kyc_id` returned by `requestKycSubmitLink`)
|
|
900
|
+
* @returns KYC record including proofs (with download links) and alerts
|
|
897
901
|
*
|
|
898
902
|
* @example
|
|
899
903
|
* ```typescript
|
|
900
904
|
* const kyc = await client.getKycRequest("550e8400-e29b-41d4-a716-446655440000");
|
|
901
905
|
* console.log(`Status: ${kyc.status}, ID Verified: ${kyc.id_verified}`);
|
|
906
|
+
* kyc.proofs?.forEach(proof => console.log(`${proof.type}: ${proof.link}`));
|
|
902
907
|
* ```
|
|
903
908
|
*/
|
|
904
909
|
async getKycRequest(id) {
|
|
905
|
-
return this.request(`/api/v1/kyc
|
|
910
|
+
return this.request(`/api/v1/kyc/${encodeURIComponent(id)}`, {
|
|
911
|
+
headers: this.getUserHeaders()
|
|
912
|
+
});
|
|
906
913
|
}
|
|
907
914
|
/**
|
|
908
915
|
* List KYC requests with filters and pagination
|
|
@@ -919,6 +926,10 @@ var KycClient = class extends BaseClient {
|
|
|
919
926
|
* );
|
|
920
927
|
* console.log(`Found ${requests.total} pending requests`);
|
|
921
928
|
* ```
|
|
929
|
+
*
|
|
930
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
931
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
932
|
+
* fails with `AuthenticationError` or a permission error.
|
|
922
933
|
*/
|
|
923
934
|
async listKycRequests(filters, pagination) {
|
|
924
935
|
const params = {};
|
|
@@ -956,6 +967,10 @@ var KycClient = class extends BaseClient {
|
|
|
956
967
|
* reason: "Document expired"
|
|
957
968
|
* });
|
|
958
969
|
* ```
|
|
970
|
+
*
|
|
971
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
972
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
973
|
+
* fails with `AuthenticationError` or a permission error.
|
|
959
974
|
*/
|
|
960
975
|
async updateKycStatus(request) {
|
|
961
976
|
await this.request("/api/v1/kyc/status", {
|
|
@@ -992,22 +1007,24 @@ var KycClient = class extends BaseClient {
|
|
|
992
1007
|
/**
|
|
993
1008
|
* Get downloadable URLs for KYC proofs/documents
|
|
994
1009
|
*
|
|
995
|
-
*
|
|
996
|
-
*
|
|
1010
|
+
* Derived from the `proofs` of `getKycRequest`: the platform attaches a
|
|
1011
|
+
* short-lived download link to every proof on the KYC record, so no
|
|
1012
|
+
* separate endpoint is needed. Proofs without a link are omitted.
|
|
1013
|
+
*
|
|
1014
|
+
* @param kycId - KYC record ID
|
|
1015
|
+
* @returns Array of proof download URLs
|
|
997
1016
|
*
|
|
998
1017
|
* @example
|
|
999
1018
|
* ```typescript
|
|
1000
1019
|
* const proofs = await client.getProofDownloadURLs("550e8400-e29b-41d4-a716-446655440000");
|
|
1001
1020
|
* proofs.forEach(proof => {
|
|
1002
|
-
* console.log(`${proof.type}: ${proof.url}
|
|
1021
|
+
* console.log(`${proof.type}: ${proof.url}`);
|
|
1003
1022
|
* });
|
|
1004
1023
|
* ```
|
|
1005
1024
|
*/
|
|
1006
1025
|
async getProofDownloadURLs(kycId) {
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
{ headers: this.getUserHeaders() }
|
|
1010
|
-
);
|
|
1026
|
+
const kyc = await this.getKycRequest(kycId);
|
|
1027
|
+
return (kyc.proofs ?? []).filter((proof) => typeof proof.link === "string" && proof.link !== "").map((proof) => ({ id: proof.id, type: proof.type, url: proof.link }));
|
|
1011
1028
|
}
|
|
1012
1029
|
// ============================================================================
|
|
1013
1030
|
// KYC Overview & Statistics
|
|
@@ -1028,6 +1045,10 @@ var KycClient = class extends BaseClient {
|
|
|
1028
1045
|
* console.log(`Total: ${overview.total}, Pending: ${overview.pending}`);
|
|
1029
1046
|
* console.log(`Approved: ${overview.approved}, Rejected: ${overview.rejected}`);
|
|
1030
1047
|
* ```
|
|
1048
|
+
*
|
|
1049
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
1050
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
1051
|
+
* fails with `AuthenticationError` or a permission error.
|
|
1031
1052
|
*/
|
|
1032
1053
|
async getOverview(fromDate, toDate) {
|
|
1033
1054
|
const params = {};
|
|
@@ -1045,6 +1066,10 @@ var KycClient = class extends BaseClient {
|
|
|
1045
1066
|
*
|
|
1046
1067
|
* @param alertId - Alert ID
|
|
1047
1068
|
* @returns Alert details
|
|
1069
|
+
*
|
|
1070
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
1071
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
1072
|
+
* fails with `AuthenticationError` or a permission error.
|
|
1048
1073
|
*/
|
|
1049
1074
|
async getAlert(alertId) {
|
|
1050
1075
|
return this.request(`/api/v1/kyc/alerts/${alertId}`);
|
|
@@ -1068,6 +1093,10 @@ var KycClient = class extends BaseClient {
|
|
|
1068
1093
|
* );
|
|
1069
1094
|
* console.log(`Found ${alerts.total} alerts`);
|
|
1070
1095
|
* ```
|
|
1096
|
+
*
|
|
1097
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
1098
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
1099
|
+
* fails with `AuthenticationError` or a permission error.
|
|
1071
1100
|
*/
|
|
1072
1101
|
async listAlerts(filters, pagination) {
|
|
1073
1102
|
const params = {};
|
|
@@ -1114,6 +1143,10 @@ var KycClient = class extends BaseClient {
|
|
|
1114
1143
|
* reason: "Requires senior review - suspicious documents"
|
|
1115
1144
|
* });
|
|
1116
1145
|
* ```
|
|
1146
|
+
*
|
|
1147
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
1148
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
1149
|
+
* fails with `AuthenticationError` or a permission error.
|
|
1117
1150
|
*/
|
|
1118
1151
|
async updateAlert(alertId, update) {
|
|
1119
1152
|
await this.request(`/api/v1/kyc/alerts/${alertId}`, {
|
|
@@ -1136,6 +1169,10 @@ var KycClient = class extends BaseClient {
|
|
|
1136
1169
|
* console.log(`Face verification required: ${prefs.is_face_verification_required}`);
|
|
1137
1170
|
* console.log(`Required documents: ${prefs.required_document_count}`);
|
|
1138
1171
|
* ```
|
|
1172
|
+
*
|
|
1173
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
1174
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
1175
|
+
* fails with `AuthenticationError` or a permission error.
|
|
1139
1176
|
*/
|
|
1140
1177
|
async getPreferences() {
|
|
1141
1178
|
return this.request("/api/v1/kyc/preferences");
|
|
@@ -1309,7 +1346,10 @@ var KYC_DECLINED_DESCRIPTIONS = {
|
|
|
1309
1346
|
function isKycDocumentExpiredCallbackEvent(value) {
|
|
1310
1347
|
return typeof value === "object" && value !== null && value.event === "kyc_document_expired";
|
|
1311
1348
|
}
|
|
1349
|
+
function isProfileChangeCallbackEvent(value) {
|
|
1350
|
+
return typeof value === "object" && value !== null && value.event === "profile_change";
|
|
1351
|
+
}
|
|
1312
1352
|
|
|
1313
|
-
export { KYC_DECLINED_DESCRIPTIONS, KycClient, isKycDocumentExpiredCallbackEvent };
|
|
1353
|
+
export { KYC_DECLINED_DESCRIPTIONS, KycClient, isKycDocumentExpiredCallbackEvent, isProfileChangeCallbackEvent };
|
|
1314
1354
|
//# sourceMappingURL=core.mjs.map
|
|
1315
1355
|
//# sourceMappingURL=core.mjs.map
|