vesant-sdk 1.8.0-dev.31d63f0 → 1.8.0-dev.69578db
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 +156 -12
- package/dist/kyc/index.d.ts +156 -12
- 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/{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/index.js
CHANGED
|
@@ -892,19 +892,26 @@ var KycClient = class extends BaseClient {
|
|
|
892
892
|
}, void 0, requestOptions);
|
|
893
893
|
}
|
|
894
894
|
/**
|
|
895
|
-
* Get a KYC
|
|
895
|
+
* Get a KYC record by ID
|
|
896
896
|
*
|
|
897
|
-
*
|
|
898
|
-
*
|
|
897
|
+
* Works with your tenant API key. Each entry in `proofs` carries a
|
|
898
|
+
* short-lived `link` for downloading that document, and `reference` holds
|
|
899
|
+
* your own customer reference (the `forward_reference`).
|
|
900
|
+
*
|
|
901
|
+
* @param id - KYC record ID (the `kyc_id` returned by `requestKycSubmitLink`)
|
|
902
|
+
* @returns KYC record including proofs (with download links) and alerts
|
|
899
903
|
*
|
|
900
904
|
* @example
|
|
901
905
|
* ```typescript
|
|
902
906
|
* const kyc = await client.getKycRequest("550e8400-e29b-41d4-a716-446655440000");
|
|
903
907
|
* console.log(`Status: ${kyc.status}, ID Verified: ${kyc.id_verified}`);
|
|
908
|
+
* kyc.proofs?.forEach(proof => console.log(`${proof.type}: ${proof.link}`));
|
|
904
909
|
* ```
|
|
905
910
|
*/
|
|
906
911
|
async getKycRequest(id) {
|
|
907
|
-
return this.request(`/api/v1/kyc
|
|
912
|
+
return this.request(`/api/v1/kyc/${encodeURIComponent(id)}`, {
|
|
913
|
+
headers: this.getUserHeaders()
|
|
914
|
+
});
|
|
908
915
|
}
|
|
909
916
|
/**
|
|
910
917
|
* List KYC requests with filters and pagination
|
|
@@ -921,6 +928,10 @@ var KycClient = class extends BaseClient {
|
|
|
921
928
|
* );
|
|
922
929
|
* console.log(`Found ${requests.total} pending requests`);
|
|
923
930
|
* ```
|
|
931
|
+
*
|
|
932
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
933
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
934
|
+
* fails with `AuthenticationError` or a permission error.
|
|
924
935
|
*/
|
|
925
936
|
async listKycRequests(filters, pagination) {
|
|
926
937
|
const params = {};
|
|
@@ -958,6 +969,10 @@ var KycClient = class extends BaseClient {
|
|
|
958
969
|
* reason: "Document expired"
|
|
959
970
|
* });
|
|
960
971
|
* ```
|
|
972
|
+
*
|
|
973
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
974
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
975
|
+
* fails with `AuthenticationError` or a permission error.
|
|
961
976
|
*/
|
|
962
977
|
async updateKycStatus(request) {
|
|
963
978
|
await this.request("/api/v1/kyc/status", {
|
|
@@ -994,22 +1009,24 @@ var KycClient = class extends BaseClient {
|
|
|
994
1009
|
/**
|
|
995
1010
|
* Get downloadable URLs for KYC proofs/documents
|
|
996
1011
|
*
|
|
997
|
-
*
|
|
998
|
-
*
|
|
1012
|
+
* Derived from the `proofs` of `getKycRequest`: the platform attaches a
|
|
1013
|
+
* short-lived download link to every proof on the KYC record, so no
|
|
1014
|
+
* separate endpoint is needed. Proofs without a link are omitted.
|
|
1015
|
+
*
|
|
1016
|
+
* @param kycId - KYC record ID
|
|
1017
|
+
* @returns Array of proof download URLs
|
|
999
1018
|
*
|
|
1000
1019
|
* @example
|
|
1001
1020
|
* ```typescript
|
|
1002
1021
|
* const proofs = await client.getProofDownloadURLs("550e8400-e29b-41d4-a716-446655440000");
|
|
1003
1022
|
* proofs.forEach(proof => {
|
|
1004
|
-
* console.log(`${proof.type}: ${proof.url}
|
|
1023
|
+
* console.log(`${proof.type}: ${proof.url}`);
|
|
1005
1024
|
* });
|
|
1006
1025
|
* ```
|
|
1007
1026
|
*/
|
|
1008
1027
|
async getProofDownloadURLs(kycId) {
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
{ headers: this.getUserHeaders() }
|
|
1012
|
-
);
|
|
1028
|
+
const kyc = await this.getKycRequest(kycId);
|
|
1029
|
+
return (kyc.proofs ?? []).filter((proof) => typeof proof.link === "string" && proof.link !== "").map((proof) => ({ id: proof.id, type: proof.type, url: proof.link }));
|
|
1013
1030
|
}
|
|
1014
1031
|
// ============================================================================
|
|
1015
1032
|
// KYC Overview & Statistics
|
|
@@ -1030,6 +1047,10 @@ var KycClient = class extends BaseClient {
|
|
|
1030
1047
|
* console.log(`Total: ${overview.total}, Pending: ${overview.pending}`);
|
|
1031
1048
|
* console.log(`Approved: ${overview.approved}, Rejected: ${overview.rejected}`);
|
|
1032
1049
|
* ```
|
|
1050
|
+
*
|
|
1051
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
1052
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
1053
|
+
* fails with `AuthenticationError` or a permission error.
|
|
1033
1054
|
*/
|
|
1034
1055
|
async getOverview(fromDate, toDate) {
|
|
1035
1056
|
const params = {};
|
|
@@ -1047,6 +1068,10 @@ var KycClient = class extends BaseClient {
|
|
|
1047
1068
|
*
|
|
1048
1069
|
* @param alertId - Alert ID
|
|
1049
1070
|
* @returns Alert details
|
|
1071
|
+
*
|
|
1072
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
1073
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
1074
|
+
* fails with `AuthenticationError` or a permission error.
|
|
1050
1075
|
*/
|
|
1051
1076
|
async getAlert(alertId) {
|
|
1052
1077
|
return this.request(`/api/v1/kyc/alerts/${alertId}`);
|
|
@@ -1070,6 +1095,10 @@ var KycClient = class extends BaseClient {
|
|
|
1070
1095
|
* );
|
|
1071
1096
|
* console.log(`Found ${alerts.total} alerts`);
|
|
1072
1097
|
* ```
|
|
1098
|
+
*
|
|
1099
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
1100
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
1101
|
+
* fails with `AuthenticationError` or a permission error.
|
|
1073
1102
|
*/
|
|
1074
1103
|
async listAlerts(filters, pagination) {
|
|
1075
1104
|
const params = {};
|
|
@@ -1116,6 +1145,10 @@ var KycClient = class extends BaseClient {
|
|
|
1116
1145
|
* reason: "Requires senior review - suspicious documents"
|
|
1117
1146
|
* });
|
|
1118
1147
|
* ```
|
|
1148
|
+
*
|
|
1149
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
1150
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
1151
|
+
* fails with `AuthenticationError` or a permission error.
|
|
1119
1152
|
*/
|
|
1120
1153
|
async updateAlert(alertId, update) {
|
|
1121
1154
|
await this.request(`/api/v1/kyc/alerts/${alertId}`, {
|
|
@@ -1138,6 +1171,10 @@ var KycClient = class extends BaseClient {
|
|
|
1138
1171
|
* console.log(`Face verification required: ${prefs.is_face_verification_required}`);
|
|
1139
1172
|
* console.log(`Required documents: ${prefs.required_document_count}`);
|
|
1140
1173
|
* ```
|
|
1174
|
+
*
|
|
1175
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
1176
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
1177
|
+
* fails with `AuthenticationError` or a permission error.
|
|
1141
1178
|
*/
|
|
1142
1179
|
async getPreferences() {
|
|
1143
1180
|
return this.request("/api/v1/kyc/preferences");
|
|
@@ -1311,9 +1348,13 @@ var KYC_DECLINED_DESCRIPTIONS = {
|
|
|
1311
1348
|
function isKycDocumentExpiredCallbackEvent(value) {
|
|
1312
1349
|
return typeof value === "object" && value !== null && value.event === "kyc_document_expired";
|
|
1313
1350
|
}
|
|
1351
|
+
function isProfileChangeCallbackEvent(value) {
|
|
1352
|
+
return typeof value === "object" && value !== null && value.event === "profile_change";
|
|
1353
|
+
}
|
|
1314
1354
|
|
|
1315
1355
|
exports.KYC_DECLINED_DESCRIPTIONS = KYC_DECLINED_DESCRIPTIONS;
|
|
1316
1356
|
exports.KycClient = KycClient;
|
|
1317
1357
|
exports.isKycDocumentExpiredCallbackEvent = isKycDocumentExpiredCallbackEvent;
|
|
1358
|
+
exports.isProfileChangeCallbackEvent = isProfileChangeCallbackEvent;
|
|
1318
1359
|
//# sourceMappingURL=index.js.map
|
|
1319
1360
|
//# sourceMappingURL=index.js.map
|