vesant-sdk 1.7.2 → 1.8.0-dev.00f6233
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 +3 -3
- package/dist/{client-B3DCAHlg.d.ts → client-BPALLldd.d.ts} +2 -2
- package/dist/{client-fy3trF2K.d.ts → client-BaUekQT8.d.ts} +32 -10
- package/dist/{client-BwXMQA2a.d.mts → client-XDEhh9VN.d.mts} +32 -10
- package/dist/{client-D23KhWeh.d.mts → client-_OhkfnyJ.d.mts} +2 -2
- package/dist/compliance/index.d.mts +3 -3
- package/dist/compliance/index.d.ts +3 -3
- package/dist/compliance/index.js +66 -11
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +66 -11
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/decisions/index.js +8 -7
- package/dist/decisions/index.js.map +1 -1
- package/dist/decisions/index.mjs +8 -7
- package/dist/decisions/index.mjs.map +1 -1
- package/dist/geolocation/index.d.mts +2 -2
- package/dist/geolocation/index.d.ts +2 -2
- package/dist/geolocation/index.js +47 -8
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +47 -8
- package/dist/geolocation/index.mjs.map +1 -1
- package/dist/{index-DSDgS09k.d.ts → index-BosFSGan.d.ts} +57 -2
- package/dist/{index-C3zUKydT.d.mts → index-C49a7fg2.d.mts} +57 -2
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +104 -169
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +101 -170
- 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 +39 -165
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +38 -166
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +219 -218
- package/dist/kyc/index.d.ts +219 -218
- package/dist/kyc/index.js +39 -165
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +38 -166
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +24 -115
- package/dist/react.d.ts +24 -115
- package/dist/react.js +23 -196
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +24 -194
- 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 +26 -9
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +26 -10
- package/dist/risk-profile/index.mjs.map +1 -1
- package/dist/scores/index.js +8 -7
- package/dist/scores/index.js.map +1 -1
- package/dist/scores/index.mjs +8 -7
- package/dist/scores/index.mjs.map +1 -1
- package/dist/tax/index.d.mts +1 -1
- package/dist/tax/index.d.ts +1 -1
- package/dist/tax/index.js +8 -7
- package/dist/tax/index.js.map +1 -1
- package/dist/tax/index.mjs +8 -7
- package/dist/tax/index.mjs.map +1 -1
- package/dist/{types-BOFaMQxI.d.mts → types-DbvVph_0.d.mts} +45 -2
- package/dist/{types-UGyDl1fd.d.ts → types-qXamJr2q.d.ts} +45 -2
- package/dist/webhooks/index.d.mts +1 -1
- package/dist/webhooks/index.d.ts +1 -1
- package/dist/webhooks/index.js +6 -0
- package/dist/webhooks/index.js.map +1 -1
- package/dist/webhooks/index.mjs +6 -1
- package/dist/webhooks/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/kyc/core.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CheckKycStatusRequest, CheckKycStatusResponse, CreateEventBasedFaceVerificationSessionRequest, CreateEventBasedFaceVerificationSessionResponse, DocumentType, DocumentVerificationRequest, DocumentVerificationResponse, EventBasedFaceVerificationCallback, EventBasedFaceVerificationDeviceType, EventBasedFaceVerificationEvent, EventBasedFaceVerificationFrequencyTrigger, EventBasedFaceVerificationReactionResult, EventBasedFaceVerificationReactions, EventBasedFaceVerificationThresholdTrigger, EventBasedFaceVerificationTriggers, FaceProof, KYC_DECLINED_DESCRIPTIONS, KycAlert, KycAlertFilters, KycAlertListResponse, KycAlertStatus, KycAlertType, KycClient, KycClientConfig, KycCustomerData, KycCustomerProfile, KycDeclinedCode, KycDisclosureConsent, KycDocumentExpiredCallbackEvent, KycHandoffSession, KycOtherReason,
|
|
2
|
-
export { a as CreateCustomerProfileRequest, C as CustomerProfile, P as CustomerProfileFilters, b as CustomerProfileListResponse } from '../types-
|
|
1
|
+
export { AccountSensitiveActionTrigger, CheckKycStatusRequest, CheckKycStatusResponse, CreateEventBasedFaceVerificationSessionRequest, CreateEventBasedFaceVerificationSessionResponse, DocumentType, DocumentVerificationRequest, DocumentVerificationResponse, EventBasedFaceVerificationCallback, EventBasedFaceVerificationDeviceType, EventBasedFaceVerificationEvent, EventBasedFaceVerificationFrequencyTrigger, EventBasedFaceVerificationReactionResult, EventBasedFaceVerificationReactions, EventBasedFaceVerificationThresholdTrigger, EventBasedFaceVerificationTriggers, FaceProof, KYC_DECLINED_DESCRIPTIONS, KycAlert, KycAlertFilters, KycAlertListResponse, KycAlertStatus, KycAlertType, KycCallbackReactions, KycClient, KycClientConfig, KycCustomerData, KycCustomerProfile, KycDeclinedCode, KycDisclosureConsent, KycDocumentExpiredCallbackEvent, KycHandoffSession, KycOtherReason, KycPagination, KycPreferences, KycRequest, KycRequestReason, KycRequestReasonCode, KycSkipOptions, KycStatus, KycStatusCallbackEvent, KycTriggerEvent, KycVerificationTriggers, Name, ProfileChangeCallbackEvent, ProfileChangeField, ProfileChangeStatus, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitEventBasedFaceVerificationSessionRequest, SubmittedDocument, SupportedAddressDocumentType, SupportedDocumentType, UpdateKycPreferencesRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycSubmissionOptions, UseKycSubmissionResult, isKycDocumentExpiredCallbackEvent, isKycStatusCallbackEvent, isProfileChangeCallbackEvent } from './index.mjs';
|
|
2
|
+
export { a as CreateCustomerProfileRequest, C as CustomerProfile, P as CustomerProfileFilters, b as CustomerProfileListResponse } from '../types-DbvVph_0.mjs';
|
|
3
3
|
export { P as PaginationParams, R as RiskLevel } from '../types-CBQRNL-l.mjs';
|
|
4
4
|
import '../client-q9fN8Hhf.mjs';
|
package/dist/kyc/core.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CheckKycStatusRequest, CheckKycStatusResponse, CreateEventBasedFaceVerificationSessionRequest, CreateEventBasedFaceVerificationSessionResponse, DocumentType, DocumentVerificationRequest, DocumentVerificationResponse, EventBasedFaceVerificationCallback, EventBasedFaceVerificationDeviceType, EventBasedFaceVerificationEvent, EventBasedFaceVerificationFrequencyTrigger, EventBasedFaceVerificationReactionResult, EventBasedFaceVerificationReactions, EventBasedFaceVerificationThresholdTrigger, EventBasedFaceVerificationTriggers, FaceProof, KYC_DECLINED_DESCRIPTIONS, KycAlert, KycAlertFilters, KycAlertListResponse, KycAlertStatus, KycAlertType, KycClient, KycClientConfig, KycCustomerData, KycCustomerProfile, KycDeclinedCode, KycDisclosureConsent, KycDocumentExpiredCallbackEvent, KycHandoffSession, KycOtherReason,
|
|
2
|
-
export { a as CreateCustomerProfileRequest, C as CustomerProfile, P as CustomerProfileFilters, b as CustomerProfileListResponse } from '../types-
|
|
1
|
+
export { AccountSensitiveActionTrigger, CheckKycStatusRequest, CheckKycStatusResponse, CreateEventBasedFaceVerificationSessionRequest, CreateEventBasedFaceVerificationSessionResponse, DocumentType, DocumentVerificationRequest, DocumentVerificationResponse, EventBasedFaceVerificationCallback, EventBasedFaceVerificationDeviceType, EventBasedFaceVerificationEvent, EventBasedFaceVerificationFrequencyTrigger, EventBasedFaceVerificationReactionResult, EventBasedFaceVerificationReactions, EventBasedFaceVerificationThresholdTrigger, EventBasedFaceVerificationTriggers, FaceProof, KYC_DECLINED_DESCRIPTIONS, KycAlert, KycAlertFilters, KycAlertListResponse, KycAlertStatus, KycAlertType, KycCallbackReactions, KycClient, KycClientConfig, KycCustomerData, KycCustomerProfile, KycDeclinedCode, KycDisclosureConsent, KycDocumentExpiredCallbackEvent, KycHandoffSession, KycOtherReason, KycPagination, KycPreferences, KycRequest, KycRequestReason, KycRequestReasonCode, KycSkipOptions, KycStatus, KycStatusCallbackEvent, KycTriggerEvent, KycVerificationTriggers, Name, ProfileChangeCallbackEvent, ProfileChangeField, ProfileChangeStatus, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitEventBasedFaceVerificationSessionRequest, SubmittedDocument, SupportedAddressDocumentType, SupportedDocumentType, UpdateKycPreferencesRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycSubmissionOptions, UseKycSubmissionResult, isKycDocumentExpiredCallbackEvent, isKycStatusCallbackEvent, isProfileChangeCallbackEvent } from './index.js';
|
|
2
|
+
export { a as CreateCustomerProfileRequest, C as CustomerProfile, P as CustomerProfileFilters, b as CustomerProfileListResponse } from '../types-qXamJr2q.js';
|
|
3
3
|
export { P as PaginationParams, R as RiskLevel } from '../types-CBQRNL-l.js';
|
|
4
4
|
import '../client-q9fN8Hhf.js';
|
package/dist/kyc/core.js
CHANGED
|
@@ -229,7 +229,7 @@ function createConsoleLogger() {
|
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
// src/core/version.ts
|
|
232
|
-
var SDK_VERSION = "1.
|
|
232
|
+
var SDK_VERSION = "1.8.0";
|
|
233
233
|
|
|
234
234
|
// src/shared/browser-utils.ts
|
|
235
235
|
function generateUUID() {
|
|
@@ -507,19 +507,20 @@ var BaseClient = class {
|
|
|
507
507
|
* Handle error responses from API
|
|
508
508
|
*/
|
|
509
509
|
handleErrorResponse(status, data, requestId) {
|
|
510
|
-
const
|
|
510
|
+
const structured = data.error && typeof data.error === "object" && !Array.isArray(data.error) ? data.error : void 0;
|
|
511
|
+
const message = typeof data.error === "string" && data.error || typeof structured?.message === "string" && structured.message || typeof data.message === "string" && data.message || `HTTP ${status}`;
|
|
511
512
|
const createError = () => {
|
|
512
513
|
switch (status) {
|
|
513
514
|
case 400:
|
|
514
|
-
return new VesantError(message, "BAD_REQUEST", 400);
|
|
515
|
+
return new VesantError(message, "BAD_REQUEST", 400, structured);
|
|
515
516
|
case 401:
|
|
516
517
|
return new AuthenticationError(message);
|
|
517
518
|
case 403:
|
|
518
|
-
return new VesantError(message, "FORBIDDEN", 403);
|
|
519
|
+
return new VesantError(message, "FORBIDDEN", 403, structured);
|
|
519
520
|
case 404:
|
|
520
|
-
return new VesantError(message, "NOT_FOUND", 404);
|
|
521
|
+
return new VesantError(message, "NOT_FOUND", 404, structured);
|
|
521
522
|
case 409:
|
|
522
|
-
return new VesantError(message, "DUPLICATE_PROFILE", 409);
|
|
523
|
+
return new VesantError(message, "DUPLICATE_PROFILE", 409, structured);
|
|
523
524
|
case 429: {
|
|
524
525
|
const retryAfter = data.retry_after || data.retryAfter;
|
|
525
526
|
return new RateLimitError(retryAfter);
|
|
@@ -530,7 +531,7 @@ var BaseClient = class {
|
|
|
530
531
|
case 504:
|
|
531
532
|
return new ServiceUnavailableError(message);
|
|
532
533
|
default:
|
|
533
|
-
return new VesantError(message, "UNKNOWN_ERROR", status);
|
|
534
|
+
return new VesantError(message, "UNKNOWN_ERROR", status, structured);
|
|
534
535
|
}
|
|
535
536
|
};
|
|
536
537
|
const error = createError();
|
|
@@ -892,77 +893,24 @@ var KycClient = class extends BaseClient {
|
|
|
892
893
|
}, void 0, requestOptions);
|
|
893
894
|
}
|
|
894
895
|
/**
|
|
895
|
-
* Get a KYC
|
|
896
|
+
* Get a KYC record by ID
|
|
896
897
|
*
|
|
897
|
-
*
|
|
898
|
-
*
|
|
898
|
+
* Works with your tenant API key. Each entry in `proofs` carries a
|
|
899
|
+
* short-lived `link` for downloading that document, and `reference` holds
|
|
900
|
+
* your own customer reference (the `forward_reference`).
|
|
901
|
+
*
|
|
902
|
+
* @param id - KYC record ID (the `kyc_id` returned by `requestKycSubmitLink`)
|
|
903
|
+
* @returns KYC record including proofs (with download links) and alerts
|
|
899
904
|
*
|
|
900
905
|
* @example
|
|
901
906
|
* ```typescript
|
|
902
907
|
* const kyc = await client.getKycRequest("550e8400-e29b-41d4-a716-446655440000");
|
|
903
908
|
* console.log(`Status: ${kyc.status}, ID Verified: ${kyc.id_verified}`);
|
|
909
|
+
* kyc.proofs?.forEach(proof => console.log(`${proof.type}: ${proof.link}`));
|
|
904
910
|
* ```
|
|
905
911
|
*/
|
|
906
912
|
async getKycRequest(id) {
|
|
907
|
-
return this.request(`/api/v1/kyc
|
|
908
|
-
}
|
|
909
|
-
/**
|
|
910
|
-
* List KYC requests with filters and pagination
|
|
911
|
-
*
|
|
912
|
-
* @param filters - Optional filters (status, search, date range)
|
|
913
|
-
* @param pagination - Optional pagination (page, page_size)
|
|
914
|
-
* @returns Paginated list of KYC requests
|
|
915
|
-
*
|
|
916
|
-
* @example
|
|
917
|
-
* ```typescript
|
|
918
|
-
* const requests = await client.listKycRequests(
|
|
919
|
-
* { status: "pending", search: "john" },
|
|
920
|
-
* { page: 1, page_size: 20 }
|
|
921
|
-
* );
|
|
922
|
-
* console.log(`Found ${requests.total} pending requests`);
|
|
923
|
-
* ```
|
|
924
|
-
*/
|
|
925
|
-
async listKycRequests(filters, pagination) {
|
|
926
|
-
const params = {};
|
|
927
|
-
if (filters) {
|
|
928
|
-
addFilterParam(params, "status", filters.status);
|
|
929
|
-
addSimpleParams(params, filters, ["search", "fromDate", "toDate", "sortBy", "order"]);
|
|
930
|
-
}
|
|
931
|
-
if (pagination) {
|
|
932
|
-
if (pagination.page) params.page = pagination.page;
|
|
933
|
-
if (pagination.page_size) params.limit = pagination.page_size;
|
|
934
|
-
}
|
|
935
|
-
return this.request(
|
|
936
|
-
`/api/v1/kyc/requests${this.buildQueryString(params)}`,
|
|
937
|
-
{ headers: this.getUserHeaders() }
|
|
938
|
-
);
|
|
939
|
-
}
|
|
940
|
-
/**
|
|
941
|
-
* Update KYC request status (accept/decline)
|
|
942
|
-
*
|
|
943
|
-
* @param request - Status update request with reference, status, and reason
|
|
944
|
-
*
|
|
945
|
-
* @example
|
|
946
|
-
* ```typescript
|
|
947
|
-
* // Accept a KYC request
|
|
948
|
-
* await client.updateKycStatus({
|
|
949
|
-
* reference: "kyc-ref-123",
|
|
950
|
-
* status: "accepted",
|
|
951
|
-
* reason: "All documents verified successfully"
|
|
952
|
-
* });
|
|
953
|
-
*
|
|
954
|
-
* // Decline a KYC request
|
|
955
|
-
* await client.updateKycStatus({
|
|
956
|
-
* reference: "kyc-ref-456",
|
|
957
|
-
* status: "declined",
|
|
958
|
-
* reason: "Document expired"
|
|
959
|
-
* });
|
|
960
|
-
* ```
|
|
961
|
-
*/
|
|
962
|
-
async updateKycStatus(request) {
|
|
963
|
-
await this.request("/api/v1/kyc/status", {
|
|
964
|
-
method: "PUT",
|
|
965
|
-
body: JSON.stringify(request),
|
|
913
|
+
return this.request(`/api/v1/kyc/${encodeURIComponent(id)}`, {
|
|
966
914
|
headers: this.getUserHeaders()
|
|
967
915
|
});
|
|
968
916
|
}
|
|
@@ -994,63 +942,28 @@ var KycClient = class extends BaseClient {
|
|
|
994
942
|
/**
|
|
995
943
|
* Get downloadable URLs for KYC proofs/documents
|
|
996
944
|
*
|
|
997
|
-
*
|
|
998
|
-
*
|
|
945
|
+
* Derived from the `proofs` of `getKycRequest`: the platform attaches a
|
|
946
|
+
* short-lived download link to every proof on the KYC record, so no
|
|
947
|
+
* separate endpoint is needed. Proofs without a link are omitted.
|
|
948
|
+
*
|
|
949
|
+
* @param kycId - KYC record ID
|
|
950
|
+
* @returns Array of proof download URLs
|
|
999
951
|
*
|
|
1000
952
|
* @example
|
|
1001
953
|
* ```typescript
|
|
1002
954
|
* const proofs = await client.getProofDownloadURLs("550e8400-e29b-41d4-a716-446655440000");
|
|
1003
955
|
* proofs.forEach(proof => {
|
|
1004
|
-
* console.log(`${proof.type}: ${proof.url}
|
|
956
|
+
* console.log(`${proof.type}: ${proof.url}`);
|
|
1005
957
|
* });
|
|
1006
958
|
* ```
|
|
1007
959
|
*/
|
|
1008
960
|
async getProofDownloadURLs(kycId) {
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
{ headers: this.getUserHeaders() }
|
|
1012
|
-
);
|
|
1013
|
-
}
|
|
1014
|
-
// ============================================================================
|
|
1015
|
-
// KYC Overview & Statistics
|
|
1016
|
-
// ============================================================================
|
|
1017
|
-
/**
|
|
1018
|
-
* Get KYC overview statistics
|
|
1019
|
-
*
|
|
1020
|
-
* @param fromDate - Optional start date (ISO 8601)
|
|
1021
|
-
* @param toDate - Optional end date (ISO 8601)
|
|
1022
|
-
* @returns KYC statistics including counts by status
|
|
1023
|
-
*
|
|
1024
|
-
* @example
|
|
1025
|
-
* ```typescript
|
|
1026
|
-
* const overview = await client.getOverview(
|
|
1027
|
-
* "2024-01-01T00:00:00Z",
|
|
1028
|
-
* "2024-12-31T23:59:59Z"
|
|
1029
|
-
* );
|
|
1030
|
-
* console.log(`Total: ${overview.total}, Pending: ${overview.pending}`);
|
|
1031
|
-
* console.log(`Approved: ${overview.approved}, Rejected: ${overview.rejected}`);
|
|
1032
|
-
* ```
|
|
1033
|
-
*/
|
|
1034
|
-
async getOverview(fromDate, toDate) {
|
|
1035
|
-
const params = {};
|
|
1036
|
-
if (fromDate) params.fromDate = fromDate;
|
|
1037
|
-
if (toDate) params.toDate = toDate;
|
|
1038
|
-
return this.request(
|
|
1039
|
-
`/api/v1/kyc/overview${this.buildQueryString(params)}`
|
|
1040
|
-
);
|
|
961
|
+
const kyc = await this.getKycRequest(kycId);
|
|
962
|
+
return (kyc.proofs ?? []).filter((proof) => typeof proof.link === "string" && proof.link !== "").map((proof) => ({ id: proof.id, type: proof.type, url: proof.link }));
|
|
1041
963
|
}
|
|
1042
964
|
// ============================================================================
|
|
1043
965
|
// Alert Management
|
|
1044
966
|
// ============================================================================
|
|
1045
|
-
/**
|
|
1046
|
-
* Get a KYC alert by ID
|
|
1047
|
-
*
|
|
1048
|
-
* @param alertId - Alert ID
|
|
1049
|
-
* @returns Alert details
|
|
1050
|
-
*/
|
|
1051
|
-
async getAlert(alertId) {
|
|
1052
|
-
return this.request(`/api/v1/kyc/alerts/${alertId}`);
|
|
1053
|
-
}
|
|
1054
967
|
/**
|
|
1055
968
|
* List KYC alerts with filters and pagination
|
|
1056
969
|
*
|
|
@@ -1070,6 +983,10 @@ var KycClient = class extends BaseClient {
|
|
|
1070
983
|
* );
|
|
1071
984
|
* console.log(`Found ${alerts.total} alerts`);
|
|
1072
985
|
* ```
|
|
986
|
+
*
|
|
987
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
988
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
989
|
+
* fails with `AuthenticationError` or a permission error.
|
|
1073
990
|
*/
|
|
1074
991
|
async listAlerts(filters, pagination) {
|
|
1075
992
|
const params = {};
|
|
@@ -1089,66 +1006,15 @@ var KycClient = class extends BaseClient {
|
|
|
1089
1006
|
`/api/v1/kyc/alerts${this.buildQueryString(params)}`
|
|
1090
1007
|
);
|
|
1091
1008
|
}
|
|
1092
|
-
/**
|
|
1093
|
-
* Update a KYC alert
|
|
1094
|
-
*
|
|
1095
|
-
* @param alertId - Alert ID
|
|
1096
|
-
* @param update - Fields to update (status, assigned_for, reason, alert_type)
|
|
1097
|
-
*
|
|
1098
|
-
* @example
|
|
1099
|
-
* ```typescript
|
|
1100
|
-
* // Assign an alert
|
|
1101
|
-
* await client.updateAlert("alert_123", {
|
|
1102
|
-
* assigned_for: "analyst_user_id",
|
|
1103
|
-
* status: "in_progress"
|
|
1104
|
-
* });
|
|
1105
|
-
*
|
|
1106
|
-
* // Resolve an alert
|
|
1107
|
-
* await client.updateAlert("alert_123", {
|
|
1108
|
-
* status: "resolved",
|
|
1109
|
-
* reason: "Customer verified via phone call"
|
|
1110
|
-
* });
|
|
1111
|
-
*
|
|
1112
|
-
* // Escalate an alert
|
|
1113
|
-
* await client.updateAlert("alert_123", {
|
|
1114
|
-
* status: "escalated",
|
|
1115
|
-
* assigned_for: "manager_user_id",
|
|
1116
|
-
* reason: "Requires senior review - suspicious documents"
|
|
1117
|
-
* });
|
|
1118
|
-
* ```
|
|
1119
|
-
*/
|
|
1120
|
-
async updateAlert(alertId, update) {
|
|
1121
|
-
await this.request(`/api/v1/kyc/alerts/${alertId}`, {
|
|
1122
|
-
method: "PUT",
|
|
1123
|
-
body: JSON.stringify(update),
|
|
1124
|
-
headers: this.getUserHeaders()
|
|
1125
|
-
});
|
|
1126
|
-
}
|
|
1127
1009
|
// ============================================================================
|
|
1128
1010
|
// KYC Preferences
|
|
1129
1011
|
// ============================================================================
|
|
1130
|
-
/**
|
|
1131
|
-
* Get KYC preferences for the tenant
|
|
1132
|
-
*
|
|
1133
|
-
* @returns KYC preferences configuration
|
|
1134
|
-
*
|
|
1135
|
-
* @example
|
|
1136
|
-
* ```typescript
|
|
1137
|
-
* const prefs = await client.getPreferences();
|
|
1138
|
-
* console.log(`Face verification required: ${prefs.is_face_verification_required}`);
|
|
1139
|
-
* console.log(`Required documents: ${prefs.required_document_count}`);
|
|
1140
|
-
* ```
|
|
1141
|
-
*/
|
|
1142
|
-
async getPreferences() {
|
|
1143
|
-
return this.request("/api/v1/kyc/preferences");
|
|
1144
|
-
}
|
|
1145
1012
|
/**
|
|
1146
1013
|
* Update KYC preferences for the tenant
|
|
1147
1014
|
*
|
|
1148
1015
|
* @deprecated KYC preferences are managed in the Vesant console; the
|
|
1149
1016
|
* platform exposes no update operation to the SDK, so this call always
|
|
1150
|
-
* fails.
|
|
1151
|
-
* in a future release.
|
|
1017
|
+
* fails. This method will be removed in a future release.
|
|
1152
1018
|
*
|
|
1153
1019
|
* @param update - Fields to update
|
|
1154
1020
|
* @returns Updated preferences
|
|
@@ -1311,9 +1177,17 @@ var KYC_DECLINED_DESCRIPTIONS = {
|
|
|
1311
1177
|
function isKycDocumentExpiredCallbackEvent(value) {
|
|
1312
1178
|
return typeof value === "object" && value !== null && value.event === "kyc_document_expired";
|
|
1313
1179
|
}
|
|
1180
|
+
function isKycStatusCallbackEvent(value) {
|
|
1181
|
+
return typeof value === "object" && value !== null && value.event === "kyc";
|
|
1182
|
+
}
|
|
1183
|
+
function isProfileChangeCallbackEvent(value) {
|
|
1184
|
+
return typeof value === "object" && value !== null && value.event === "profile_change";
|
|
1185
|
+
}
|
|
1314
1186
|
|
|
1315
1187
|
exports.KYC_DECLINED_DESCRIPTIONS = KYC_DECLINED_DESCRIPTIONS;
|
|
1316
1188
|
exports.KycClient = KycClient;
|
|
1317
1189
|
exports.isKycDocumentExpiredCallbackEvent = isKycDocumentExpiredCallbackEvent;
|
|
1190
|
+
exports.isKycStatusCallbackEvent = isKycStatusCallbackEvent;
|
|
1191
|
+
exports.isProfileChangeCallbackEvent = isProfileChangeCallbackEvent;
|
|
1318
1192
|
//# sourceMappingURL=core.js.map
|
|
1319
1193
|
//# sourceMappingURL=core.js.map
|