vesant-sdk 1.6.2 → 1.6.4
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/compliance/index.js +1 -1
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +1 -1
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/decisions/index.js +1 -1
- package/dist/decisions/index.js.map +1 -1
- package/dist/decisions/index.mjs +1 -1
- package/dist/decisions/index.mjs.map +1 -1
- package/dist/fraud/index.d.mts +80 -0
- package/dist/fraud/index.d.ts +80 -0
- package/dist/fraud/index.js +606 -0
- package/dist/fraud/index.js.map +1 -0
- package/dist/fraud/index.mjs +604 -0
- package/dist/fraud/index.mjs.map +1 -0
- package/dist/geolocation/index.js +1 -1
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +1 -1
- package/dist/geolocation/index.mjs.map +1 -1
- package/dist/index-B04H4xfJ.d.mts +320 -0
- package/dist/index-CItMPmLL.d.ts +320 -0
- package/dist/index.d.mts +8 -108
- package/dist/index.d.ts +8 -108
- package/dist/index.js +105 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +105 -8
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.d.mts +1 -1
- package/dist/kyc/core.d.ts +1 -1
- package/dist/kyc/core.js +11 -7
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +11 -7
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +51 -21
- package/dist/kyc/index.d.ts +51 -21
- package/dist/kyc/index.js +11 -7
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +11 -7
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +1 -1
- package/dist/react.mjs.map +1 -1
- package/dist/risk-profile/index.js +1 -1
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +1 -1
- package/dist/risk-profile/index.mjs.map +1 -1
- package/dist/scores/index.js +1 -1
- package/dist/scores/index.js.map +1 -1
- package/dist/scores/index.mjs +1 -1
- package/dist/scores/index.mjs.map +1 -1
- package/dist/tax/index.d.mts +36 -1
- package/dist/tax/index.d.ts +36 -1
- package/dist/tax/index.js +36 -1
- package/dist/tax/index.js.map +1 -1
- package/dist/tax/index.mjs +36 -1
- package/dist/tax/index.mjs.map +1 -1
- package/dist/webhooks/index.d.mts +2 -177
- package/dist/webhooks/index.d.ts +2 -177
- package/package.json +6 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { L as Logger, B as BaseClient, a as BaseClientConfig, R as RequestOptions } from './client-ePzhQKp9.mjs';
|
|
2
2
|
export { d as CGSConfig, i as CircuitBreaker, C as CircuitBreakerConfig, g as CircuitBreakerState, h as CircuitBreakerStatus, j as RateLimitStatus, k as RateLimitTracker, b as RequestInterceptor, f as RequiredBaseClientConfig, e as RequiredCGSConfig, c as RequiredVesantConfig, V as VesantConfig } from './client-ePzhQKp9.mjs';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { BaseWebhookEvent, ComplianceCheckFailedPayload, DecisionRecordedPayload, GeolocationBlockedPayload, GeolocationVerifiedPayload, KycStatusChangedPayload, LabelAppliedPayload, LocationRequestCompletedPayload, ProfileCreatedPayload, ProfileUpdatedPayload, RiskCategoryChangedPayload, RiskScoreChangedPayload, WebhookAnyHandler, WebhookEvent, WebhookEventHandler, WebhookEventType, WebhookHandler, WebhookHandlerConfig, WebhookMiddlewareOptions, createNextWebhookHandler, createWebhookMiddleware, verifyWebhookSignature } from './
|
|
3
|
+
export { A as APIResponse, C as CustomerStatus, E as EntityType, b as ErrorResponse, L as LocationCompliance, a as PaginatedResponse, P as PaginationParams, c as Result, R as RiskLevel, S as SuccessResponse, T as Timestamp, U as UUID, V as VerificationEventType } from './types-B4Ezqo7V.mjs';
|
|
4
|
+
import { T as TransactionCreateDTO, a as TransactionCreateResponse } from './index-B04H4xfJ.mjs';
|
|
5
|
+
export { B as BaseWebhookEvent, C as ComplianceCheckFailedPayload, D as DecisionRecordedPayload, o as GeolocationBlockedPayload, G as GeolocationVerifiedPayload, J as JSONB, K as KycStatusChangedPayload, L as LabelAppliedPayload, p as LocationRequestCompletedPayload, P as ProfileCreatedPayload, n as ProfileUpdatedPayload, m as RiskCategoryChangedPayload, R as RiskScoreChangedPayload, r as TaxFormType, s as TaxReminderSentPayload, q as TaxReminderType, g as Transaction, t as TransactionCallbackPayload, h as TransactionClientConfig, c as TransactionMode, d as TransactionStatus, b as TransactionType, y as WebhookAnyHandler, u as WebhookEvent, x as WebhookEventHandler, l as WebhookEventType, W as WebhookHandler, w as WebhookHandlerConfig, i as WebhookMiddlewareOptions, f as WithholdingReason, e as WithholdingType, k as createNextWebhookHandler, j as createWebhookMiddleware, v as verifyWebhookSignature } from './index-B04H4xfJ.mjs';
|
|
6
6
|
export { B as APIError, p as AlertFilters, q as AlertListResponse, m as AlertSeverity, A as AlertStatus, n as AlertType, e as CipherTextCustomerData, b as CipherTextOptions, C as CipherTextPayload, a as CipherTextReason, c as CipherTextResult, l as ComplianceCheckResponse, w as CreateGeofenceRuleRequest, s as CreateJurisdictionRequest, Q as CreateLocationRequestRequest, r as DashboardMetrics, d as DecryptedCipherText, j as DeviceFingerprint, D as DeviceFingerprintRequest, k as DeviceTrustResult, h as GeoIPResult, u as GeofenceAction, i as GeofenceEvaluation, v as GeofenceRule, t as GeofenceRuleType, o as GeolocationAlert, G as GeolocationClient, F as GeolocationClientConfig, E as GeolocationConfigResponse, z as GeolocationRecord, J as JurisdictionConfig, Y as LocationCaptureRequest, _ as LocationCaptureResponse, P as LocationRequest, O as LocationRequestChannel, S as LocationRequestFilters, T as LocationRequestListResponse, R as LocationRequestResult, N as LocationRequestStatus, Z as LocationShareInfo, L as LocationVerification, W as ResendLocationRequestRequest, y as UpdateDeviceTrustRequest, x as UpdateGeofenceRuleRequest, U as UpdateJurisdictionRequest, K as UseAlertsOptions, M as UseAlertsResult, H as UseGeolocationOptions, I as UseGeolocationResult, a1 as UseLocationCaptureOptions, a2 as UseLocationCaptureResult, $ as UseLocationRequestsOptions, a0 as UseLocationRequestsResult, V as ValidateCipherTextRequest, f as ValidateCipherTextResponse, g as VerifyIPRequest, X as WiFiNetwork } from './client-BlCxjbY2.mjs';
|
|
7
7
|
export { decodeCipherText, generateCipherText, isCipherTextExpired } from './geolocation/index.mjs';
|
|
8
8
|
export { RiskProfileClient } from './risk-profile/index.mjs';
|
|
9
9
|
export { d as CreateCustomerProfileRequest, d as CreateProfileRequest, C as CustomerProfile, e as CustomerProfileFilters, f as CustomerProfileListResponse, E as EmploymentType, L as LegalForm, P as ProfileDetailsResponse, e as ProfileFilters, f as ProfileListResponse, R as RiskCategory, h as RiskConfiguration, g as RiskDashboardMetrics, a as RiskFactor, b as RiskFactorType, c as RiskHistory, S as ScreeningStatus, U as UpdateProfileRequest } from './types-1RzYeSal.mjs';
|
|
10
10
|
export { ComplianceClient, ComplianceLocationRequestInput, ComplianceLocationRequestResult, CurrencyRates, DEFAULT_CURRENCY_RATES, EventVerificationRequest, EventVerificationResponse, LoginVerificationRequest, LoginVerificationResponse, RegistrationVerificationRequest, RegistrationVerificationResponse, TransactionRiskResult, TransactionVerificationRequest, TransactionVerificationResponse } from './compliance/index.mjs';
|
|
11
|
-
export { CheckKycStatusRequest, CheckKycStatusResponse, CreateReuseKycSessionRequest, CreateReuseKycSessionResponse, DocumentType, DocumentVerificationRequest, DocumentVerificationResponse, FaceProof, KycAlert, KycAlertFilters, KycAlertListResponse, KycAlertStatus, KycAlertType, KycClient, KycClientConfig, KycCustomerProfile, KycOverview, KycPagination, KycPreferences, KycRequest, KycRequestFilters, KycRequestListResponse, KycStatus, Name, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitReuseKycSessionRequest, SubmittedDocument, SupportedDocumentType, UpdateKycAlertRequest, UpdateKycPreferencesRequest, UpdateKycStatusRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult } from './kyc/index.mjs';
|
|
12
|
-
export { CTPFormStatus, CTPTINStatus, ComplianceStats, ComplianceStatsFilters, CustomerTaxProfileRecord, CustomerType, DocumentRequestBreakdown, EmailSendingMethod, EnableWithholdingInput, EnableWithholdingResponse, GlobalTaxRule, ReRequestTaxFormInput, TINCheckResult, TINStatusBreakdown, TaxClient, TaxClientConfig, TaxRuleApprovalStatus, TaxRuleVersion, TaxRules, TransactionAction, TreatyCountry, TreatyCountryListResponse, UpdateTaxRulesInput, WFormCountBreakdown, WFormStatusBreakdown } from './tax/index.mjs';
|
|
11
|
+
export { CheckKycStatusRequest, CheckKycStatusResponse, CreateReuseKycSessionRequest, CreateReuseKycSessionResponse, DocumentType, DocumentVerificationRequest, DocumentVerificationResponse, FaceProof, KycAlert, KycAlertFilters, KycAlertListResponse, KycAlertStatus, KycAlertType, KycClient, KycClientConfig, KycCustomerProfile, KycOverview, KycPagination, KycPreferences, KycRequest, KycRequestFilters, KycRequestListResponse, KycStatus, KycTriggerEvent, Name, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitReuseKycSessionRequest, SubmittedDocument, SupportedDocumentType, UpdateKycAlertRequest, UpdateKycPreferencesRequest, UpdateKycStatusRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult } from './kyc/index.mjs';
|
|
12
|
+
export { CTPFormStatus, CTPTINStatus, ComplianceStats, ComplianceStatsFilters, CustomerTaxProfileRecord, CustomerType, DocumentRequestBreakdown, EmailSendingMethod, EnableWithholdingInput, EnableWithholdingResponse, GlobalTaxRule, ReRequestTaxFormInput, RunRemindersResponse, TINCheckResult, TINStatusBreakdown, TaxClient, TaxClientConfig, TaxRuleApprovalStatus, TaxRuleVersion, TaxRules, TransactionAction, TreatyCountry, TreatyCountryListResponse, UpdateReminderConfigInput, UpdateTaxRulesInput, WFormCountBreakdown, WFormStatusBreakdown } from './tax/index.mjs';
|
|
13
|
+
export { FraudClient, FraudDecision, FraudEventType, FraudReactionType, FraudScoreRequest, FraudScoreResponseData, FraudScoreResponseEnvelope, FraudScoreResponseMetadata, TenantAction } from './fraud/index.mjs';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Error hierarchy for Vesant SDK
|
|
@@ -66,108 +67,7 @@ declare const noopLogger: Logger;
|
|
|
66
67
|
/**
|
|
67
68
|
* Single source of truth for the SDK version.
|
|
68
69
|
*/
|
|
69
|
-
declare const SDK_VERSION = "1.6.
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* TypeScript types for the Transaction Monitoring (TM) Service
|
|
73
|
-
*
|
|
74
|
-
* These definitions mirror the Go structs used in
|
|
75
|
-
* services/transaction-monitoring-service/internal/domain/
|
|
76
|
-
*
|
|
77
|
-
* Only a subset of fields is included; additional helpers may be
|
|
78
|
-
* added as the SDK grows.
|
|
79
|
-
*/
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Supported transaction types.
|
|
83
|
-
* See domain/transaction.go TransactionType constants.
|
|
84
|
-
*/
|
|
85
|
-
type TransactionType = "deposit" | "withdrawal" | "transfer" | "payment" | "refund" | "fee" | "adjustment";
|
|
86
|
-
/**
|
|
87
|
-
* Modes or channels by which the transaction was carried out.
|
|
88
|
-
*/
|
|
89
|
-
type TransactionMode = "fiat" | "crypto" | "bank_transfer" | "card" | "wallet";
|
|
90
|
-
/**
|
|
91
|
-
* Current status of the transaction record.
|
|
92
|
-
*/
|
|
93
|
-
type TransactionStatus = "pending" | "processing" | "completed" | "failed" | "cancelled" | "reversed";
|
|
94
|
-
/**
|
|
95
|
-
* Payload sent when creating a new transaction via the TM API.
|
|
96
|
-
*
|
|
97
|
-
* Numeric decimal types in Go are represented as strings in the SDK to avoid
|
|
98
|
-
* precision loss in JavaScript. Dates are ISO strings.
|
|
99
|
-
*/
|
|
100
|
-
interface TransactionCreateDTO {
|
|
101
|
-
tx_id: string;
|
|
102
|
-
reference: string;
|
|
103
|
-
tenant_id: string;
|
|
104
|
-
customer_id: string;
|
|
105
|
-
transaction_type: TransactionType;
|
|
106
|
-
transaction_mode: TransactionMode;
|
|
107
|
-
amount: string;
|
|
108
|
-
currency: string;
|
|
109
|
-
status: TransactionStatus;
|
|
110
|
-
source_account: string;
|
|
111
|
-
destination_account: string;
|
|
112
|
-
country: string;
|
|
113
|
-
ip_address: string;
|
|
114
|
-
metadata: Record<string, any>;
|
|
115
|
-
benificiary_comment: string;
|
|
116
|
-
transaction_date: Timestamp;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Representation of a transaction record returned from the TM service.
|
|
120
|
-
*/
|
|
121
|
-
type WithholdingType = "none" | "backup_us" | "backup_non_us" | "treaty";
|
|
122
|
-
type JSONB = Record<string, any>;
|
|
123
|
-
type Transaction = {
|
|
124
|
-
id: string;
|
|
125
|
-
tx_id: string;
|
|
126
|
-
reference: string;
|
|
127
|
-
tenant_id: string;
|
|
128
|
-
customer_id: string;
|
|
129
|
-
transaction_type: TransactionType;
|
|
130
|
-
transaction_mode: TransactionMode;
|
|
131
|
-
amount: string;
|
|
132
|
-
withheld_amount: string;
|
|
133
|
-
released_amount: string;
|
|
134
|
-
withholding_rate: number;
|
|
135
|
-
withholding_reason?: string;
|
|
136
|
-
withholding_type?: WithholdingType;
|
|
137
|
-
tax_year: number;
|
|
138
|
-
currency: string;
|
|
139
|
-
status: TransactionStatus;
|
|
140
|
-
source_account?: string;
|
|
141
|
-
destination_account?: string;
|
|
142
|
-
country?: string;
|
|
143
|
-
ip_address?: string;
|
|
144
|
-
risk_score: number;
|
|
145
|
-
metadata?: JSONB;
|
|
146
|
-
benificiary_comment?: string;
|
|
147
|
-
transaction_date: string;
|
|
148
|
-
created_at: string;
|
|
149
|
-
updated_at: string;
|
|
150
|
-
deleted_at?: string | null;
|
|
151
|
-
};
|
|
152
|
-
/**
|
|
153
|
-
* Configuration object consumed by {@link TransactionClient}.
|
|
154
|
-
* Currently identical to {@link import('../core/types').BaseClientConfig},
|
|
155
|
-
* exported here for future extensibility.
|
|
156
|
-
*/
|
|
157
|
-
interface TransactionClientConfig {
|
|
158
|
-
baseURL: string;
|
|
159
|
-
tenantId: string;
|
|
160
|
-
apiKey?: string;
|
|
161
|
-
headers?: Record<string, string>;
|
|
162
|
-
timeout?: number;
|
|
163
|
-
retries?: number;
|
|
164
|
-
debug?: boolean;
|
|
165
|
-
environment?: 'production' | 'sandbox';
|
|
166
|
-
}
|
|
167
|
-
type TransactionCreateResponse = {
|
|
168
|
-
transaction: Transaction;
|
|
169
|
-
message: string;
|
|
170
|
-
};
|
|
70
|
+
declare const SDK_VERSION = "1.6.4";
|
|
171
71
|
|
|
172
72
|
/**
|
|
173
73
|
* TransactionClient - TypeScript SDK for the Transaction Monitoring service
|
|
@@ -226,4 +126,4 @@ declare class TransactionClient extends BaseClient {
|
|
|
226
126
|
getTransaction(transactionId: string, requestOptions?: RequestOptions): Promise<void>;
|
|
227
127
|
}
|
|
228
128
|
|
|
229
|
-
export { AuthenticationError, BaseClient, BaseClientConfig, CGSError, CircuitBreakerOpenError, ComplianceBlockedError, ComplianceError,
|
|
129
|
+
export { AuthenticationError, BaseClient, BaseClientConfig, CGSError, CircuitBreakerOpenError, ComplianceBlockedError, ComplianceError, Logger, NetworkError, RateLimitError, RequestOptions, SDK_VERSION, ServiceUnavailableError, TimeoutError, TransactionClient, TransactionCreateDTO, TransactionCreateResponse, ValidationError, VesantError, createConsoleLogger, noopLogger };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { L as Logger, B as BaseClient, a as BaseClientConfig, R as RequestOptions } from './client-ePzhQKp9.js';
|
|
2
2
|
export { d as CGSConfig, i as CircuitBreaker, C as CircuitBreakerConfig, g as CircuitBreakerState, h as CircuitBreakerStatus, j as RateLimitStatus, k as RateLimitTracker, b as RequestInterceptor, f as RequiredBaseClientConfig, e as RequiredCGSConfig, c as RequiredVesantConfig, V as VesantConfig } from './client-ePzhQKp9.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { BaseWebhookEvent, ComplianceCheckFailedPayload, DecisionRecordedPayload, GeolocationBlockedPayload, GeolocationVerifiedPayload, KycStatusChangedPayload, LabelAppliedPayload, LocationRequestCompletedPayload, ProfileCreatedPayload, ProfileUpdatedPayload, RiskCategoryChangedPayload, RiskScoreChangedPayload, WebhookAnyHandler, WebhookEvent, WebhookEventHandler, WebhookEventType, WebhookHandler, WebhookHandlerConfig, WebhookMiddlewareOptions, createNextWebhookHandler, createWebhookMiddleware, verifyWebhookSignature } from './
|
|
3
|
+
export { A as APIResponse, C as CustomerStatus, E as EntityType, b as ErrorResponse, L as LocationCompliance, a as PaginatedResponse, P as PaginationParams, c as Result, R as RiskLevel, S as SuccessResponse, T as Timestamp, U as UUID, V as VerificationEventType } from './types-B4Ezqo7V.js';
|
|
4
|
+
import { T as TransactionCreateDTO, a as TransactionCreateResponse } from './index-CItMPmLL.js';
|
|
5
|
+
export { B as BaseWebhookEvent, C as ComplianceCheckFailedPayload, D as DecisionRecordedPayload, o as GeolocationBlockedPayload, G as GeolocationVerifiedPayload, J as JSONB, K as KycStatusChangedPayload, L as LabelAppliedPayload, p as LocationRequestCompletedPayload, P as ProfileCreatedPayload, n as ProfileUpdatedPayload, m as RiskCategoryChangedPayload, R as RiskScoreChangedPayload, r as TaxFormType, s as TaxReminderSentPayload, q as TaxReminderType, g as Transaction, t as TransactionCallbackPayload, h as TransactionClientConfig, c as TransactionMode, d as TransactionStatus, b as TransactionType, y as WebhookAnyHandler, u as WebhookEvent, x as WebhookEventHandler, l as WebhookEventType, W as WebhookHandler, w as WebhookHandlerConfig, i as WebhookMiddlewareOptions, f as WithholdingReason, e as WithholdingType, k as createNextWebhookHandler, j as createWebhookMiddleware, v as verifyWebhookSignature } from './index-CItMPmLL.js';
|
|
6
6
|
export { B as APIError, p as AlertFilters, q as AlertListResponse, m as AlertSeverity, A as AlertStatus, n as AlertType, e as CipherTextCustomerData, b as CipherTextOptions, C as CipherTextPayload, a as CipherTextReason, c as CipherTextResult, l as ComplianceCheckResponse, w as CreateGeofenceRuleRequest, s as CreateJurisdictionRequest, Q as CreateLocationRequestRequest, r as DashboardMetrics, d as DecryptedCipherText, j as DeviceFingerprint, D as DeviceFingerprintRequest, k as DeviceTrustResult, h as GeoIPResult, u as GeofenceAction, i as GeofenceEvaluation, v as GeofenceRule, t as GeofenceRuleType, o as GeolocationAlert, G as GeolocationClient, F as GeolocationClientConfig, E as GeolocationConfigResponse, z as GeolocationRecord, J as JurisdictionConfig, Y as LocationCaptureRequest, _ as LocationCaptureResponse, P as LocationRequest, O as LocationRequestChannel, S as LocationRequestFilters, T as LocationRequestListResponse, R as LocationRequestResult, N as LocationRequestStatus, Z as LocationShareInfo, L as LocationVerification, W as ResendLocationRequestRequest, y as UpdateDeviceTrustRequest, x as UpdateGeofenceRuleRequest, U as UpdateJurisdictionRequest, K as UseAlertsOptions, M as UseAlertsResult, H as UseGeolocationOptions, I as UseGeolocationResult, a1 as UseLocationCaptureOptions, a2 as UseLocationCaptureResult, $ as UseLocationRequestsOptions, a0 as UseLocationRequestsResult, V as ValidateCipherTextRequest, f as ValidateCipherTextResponse, g as VerifyIPRequest, X as WiFiNetwork } from './client-C_A7QLcB.js';
|
|
7
7
|
export { decodeCipherText, generateCipherText, isCipherTextExpired } from './geolocation/index.js';
|
|
8
8
|
export { RiskProfileClient } from './risk-profile/index.js';
|
|
9
9
|
export { d as CreateCustomerProfileRequest, d as CreateProfileRequest, C as CustomerProfile, e as CustomerProfileFilters, f as CustomerProfileListResponse, E as EmploymentType, L as LegalForm, P as ProfileDetailsResponse, e as ProfileFilters, f as ProfileListResponse, R as RiskCategory, h as RiskConfiguration, g as RiskDashboardMetrics, a as RiskFactor, b as RiskFactorType, c as RiskHistory, S as ScreeningStatus, U as UpdateProfileRequest } from './types-X5Md_dD_.js';
|
|
10
10
|
export { ComplianceClient, ComplianceLocationRequestInput, ComplianceLocationRequestResult, CurrencyRates, DEFAULT_CURRENCY_RATES, EventVerificationRequest, EventVerificationResponse, LoginVerificationRequest, LoginVerificationResponse, RegistrationVerificationRequest, RegistrationVerificationResponse, TransactionRiskResult, TransactionVerificationRequest, TransactionVerificationResponse } from './compliance/index.js';
|
|
11
|
-
export { CheckKycStatusRequest, CheckKycStatusResponse, CreateReuseKycSessionRequest, CreateReuseKycSessionResponse, DocumentType, DocumentVerificationRequest, DocumentVerificationResponse, FaceProof, KycAlert, KycAlertFilters, KycAlertListResponse, KycAlertStatus, KycAlertType, KycClient, KycClientConfig, KycCustomerProfile, KycOverview, KycPagination, KycPreferences, KycRequest, KycRequestFilters, KycRequestListResponse, KycStatus, Name, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitReuseKycSessionRequest, SubmittedDocument, SupportedDocumentType, UpdateKycAlertRequest, UpdateKycPreferencesRequest, UpdateKycStatusRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult } from './kyc/index.js';
|
|
12
|
-
export { CTPFormStatus, CTPTINStatus, ComplianceStats, ComplianceStatsFilters, CustomerTaxProfileRecord, CustomerType, DocumentRequestBreakdown, EmailSendingMethod, EnableWithholdingInput, EnableWithholdingResponse, GlobalTaxRule, ReRequestTaxFormInput, TINCheckResult, TINStatusBreakdown, TaxClient, TaxClientConfig, TaxRuleApprovalStatus, TaxRuleVersion, TaxRules, TransactionAction, TreatyCountry, TreatyCountryListResponse, UpdateTaxRulesInput, WFormCountBreakdown, WFormStatusBreakdown } from './tax/index.js';
|
|
11
|
+
export { CheckKycStatusRequest, CheckKycStatusResponse, CreateReuseKycSessionRequest, CreateReuseKycSessionResponse, DocumentType, DocumentVerificationRequest, DocumentVerificationResponse, FaceProof, KycAlert, KycAlertFilters, KycAlertListResponse, KycAlertStatus, KycAlertType, KycClient, KycClientConfig, KycCustomerProfile, KycOverview, KycPagination, KycPreferences, KycRequest, KycRequestFilters, KycRequestListResponse, KycStatus, KycTriggerEvent, Name, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitReuseKycSessionRequest, SubmittedDocument, SupportedDocumentType, UpdateKycAlertRequest, UpdateKycPreferencesRequest, UpdateKycStatusRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult } from './kyc/index.js';
|
|
12
|
+
export { CTPFormStatus, CTPTINStatus, ComplianceStats, ComplianceStatsFilters, CustomerTaxProfileRecord, CustomerType, DocumentRequestBreakdown, EmailSendingMethod, EnableWithholdingInput, EnableWithholdingResponse, GlobalTaxRule, ReRequestTaxFormInput, RunRemindersResponse, TINCheckResult, TINStatusBreakdown, TaxClient, TaxClientConfig, TaxRuleApprovalStatus, TaxRuleVersion, TaxRules, TransactionAction, TreatyCountry, TreatyCountryListResponse, UpdateReminderConfigInput, UpdateTaxRulesInput, WFormCountBreakdown, WFormStatusBreakdown } from './tax/index.js';
|
|
13
|
+
export { FraudClient, FraudDecision, FraudEventType, FraudReactionType, FraudScoreRequest, FraudScoreResponseData, FraudScoreResponseEnvelope, FraudScoreResponseMetadata, TenantAction } from './fraud/index.js';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Error hierarchy for Vesant SDK
|
|
@@ -66,108 +67,7 @@ declare const noopLogger: Logger;
|
|
|
66
67
|
/**
|
|
67
68
|
* Single source of truth for the SDK version.
|
|
68
69
|
*/
|
|
69
|
-
declare const SDK_VERSION = "1.6.
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* TypeScript types for the Transaction Monitoring (TM) Service
|
|
73
|
-
*
|
|
74
|
-
* These definitions mirror the Go structs used in
|
|
75
|
-
* services/transaction-monitoring-service/internal/domain/
|
|
76
|
-
*
|
|
77
|
-
* Only a subset of fields is included; additional helpers may be
|
|
78
|
-
* added as the SDK grows.
|
|
79
|
-
*/
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Supported transaction types.
|
|
83
|
-
* See domain/transaction.go TransactionType constants.
|
|
84
|
-
*/
|
|
85
|
-
type TransactionType = "deposit" | "withdrawal" | "transfer" | "payment" | "refund" | "fee" | "adjustment";
|
|
86
|
-
/**
|
|
87
|
-
* Modes or channels by which the transaction was carried out.
|
|
88
|
-
*/
|
|
89
|
-
type TransactionMode = "fiat" | "crypto" | "bank_transfer" | "card" | "wallet";
|
|
90
|
-
/**
|
|
91
|
-
* Current status of the transaction record.
|
|
92
|
-
*/
|
|
93
|
-
type TransactionStatus = "pending" | "processing" | "completed" | "failed" | "cancelled" | "reversed";
|
|
94
|
-
/**
|
|
95
|
-
* Payload sent when creating a new transaction via the TM API.
|
|
96
|
-
*
|
|
97
|
-
* Numeric decimal types in Go are represented as strings in the SDK to avoid
|
|
98
|
-
* precision loss in JavaScript. Dates are ISO strings.
|
|
99
|
-
*/
|
|
100
|
-
interface TransactionCreateDTO {
|
|
101
|
-
tx_id: string;
|
|
102
|
-
reference: string;
|
|
103
|
-
tenant_id: string;
|
|
104
|
-
customer_id: string;
|
|
105
|
-
transaction_type: TransactionType;
|
|
106
|
-
transaction_mode: TransactionMode;
|
|
107
|
-
amount: string;
|
|
108
|
-
currency: string;
|
|
109
|
-
status: TransactionStatus;
|
|
110
|
-
source_account: string;
|
|
111
|
-
destination_account: string;
|
|
112
|
-
country: string;
|
|
113
|
-
ip_address: string;
|
|
114
|
-
metadata: Record<string, any>;
|
|
115
|
-
benificiary_comment: string;
|
|
116
|
-
transaction_date: Timestamp;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Representation of a transaction record returned from the TM service.
|
|
120
|
-
*/
|
|
121
|
-
type WithholdingType = "none" | "backup_us" | "backup_non_us" | "treaty";
|
|
122
|
-
type JSONB = Record<string, any>;
|
|
123
|
-
type Transaction = {
|
|
124
|
-
id: string;
|
|
125
|
-
tx_id: string;
|
|
126
|
-
reference: string;
|
|
127
|
-
tenant_id: string;
|
|
128
|
-
customer_id: string;
|
|
129
|
-
transaction_type: TransactionType;
|
|
130
|
-
transaction_mode: TransactionMode;
|
|
131
|
-
amount: string;
|
|
132
|
-
withheld_amount: string;
|
|
133
|
-
released_amount: string;
|
|
134
|
-
withholding_rate: number;
|
|
135
|
-
withholding_reason?: string;
|
|
136
|
-
withholding_type?: WithholdingType;
|
|
137
|
-
tax_year: number;
|
|
138
|
-
currency: string;
|
|
139
|
-
status: TransactionStatus;
|
|
140
|
-
source_account?: string;
|
|
141
|
-
destination_account?: string;
|
|
142
|
-
country?: string;
|
|
143
|
-
ip_address?: string;
|
|
144
|
-
risk_score: number;
|
|
145
|
-
metadata?: JSONB;
|
|
146
|
-
benificiary_comment?: string;
|
|
147
|
-
transaction_date: string;
|
|
148
|
-
created_at: string;
|
|
149
|
-
updated_at: string;
|
|
150
|
-
deleted_at?: string | null;
|
|
151
|
-
};
|
|
152
|
-
/**
|
|
153
|
-
* Configuration object consumed by {@link TransactionClient}.
|
|
154
|
-
* Currently identical to {@link import('../core/types').BaseClientConfig},
|
|
155
|
-
* exported here for future extensibility.
|
|
156
|
-
*/
|
|
157
|
-
interface TransactionClientConfig {
|
|
158
|
-
baseURL: string;
|
|
159
|
-
tenantId: string;
|
|
160
|
-
apiKey?: string;
|
|
161
|
-
headers?: Record<string, string>;
|
|
162
|
-
timeout?: number;
|
|
163
|
-
retries?: number;
|
|
164
|
-
debug?: boolean;
|
|
165
|
-
environment?: 'production' | 'sandbox';
|
|
166
|
-
}
|
|
167
|
-
type TransactionCreateResponse = {
|
|
168
|
-
transaction: Transaction;
|
|
169
|
-
message: string;
|
|
170
|
-
};
|
|
70
|
+
declare const SDK_VERSION = "1.6.4";
|
|
171
71
|
|
|
172
72
|
/**
|
|
173
73
|
* TransactionClient - TypeScript SDK for the Transaction Monitoring service
|
|
@@ -226,4 +126,4 @@ declare class TransactionClient extends BaseClient {
|
|
|
226
126
|
getTransaction(transactionId: string, requestOptions?: RequestOptions): Promise<void>;
|
|
227
127
|
}
|
|
228
128
|
|
|
229
|
-
export { AuthenticationError, BaseClient, BaseClientConfig, CGSError, CircuitBreakerOpenError, ComplianceBlockedError, ComplianceError,
|
|
129
|
+
export { AuthenticationError, BaseClient, BaseClientConfig, CGSError, CircuitBreakerOpenError, ComplianceBlockedError, ComplianceError, Logger, NetworkError, RateLimitError, RequestOptions, SDK_VERSION, ServiceUnavailableError, TimeoutError, TransactionClient, TransactionCreateDTO, TransactionCreateResponse, ValidationError, VesantError, createConsoleLogger, noopLogger };
|
package/dist/index.js
CHANGED
|
@@ -242,7 +242,7 @@ var noopLogger = {
|
|
|
242
242
|
};
|
|
243
243
|
|
|
244
244
|
// src/core/version.ts
|
|
245
|
-
var SDK_VERSION = "1.6.
|
|
245
|
+
var SDK_VERSION = "1.6.4";
|
|
246
246
|
|
|
247
247
|
// src/shared/browser-utils.ts
|
|
248
248
|
function generateUUID() {
|
|
@@ -2606,19 +2606,23 @@ var KycClient = class extends BaseClient {
|
|
|
2606
2606
|
*
|
|
2607
2607
|
* Generates a link that the user can visit to submit their KYC documents.
|
|
2608
2608
|
*
|
|
2609
|
-
* @param request - Request containing the user ID,
|
|
2610
|
-
* @returns Response containing the redirect link and KYC ID
|
|
2609
|
+
* @param request - Request containing the user ID, redirect URL, callback URL, and trigger event
|
|
2610
|
+
* @returns Response containing kyc_required, can_skip, and optionally the redirect link and KYC ID
|
|
2611
2611
|
*
|
|
2612
2612
|
* @example
|
|
2613
2613
|
* ```typescript
|
|
2614
2614
|
* const result = await client.requestKycSubmitLink({
|
|
2615
2615
|
* user_id: "user_123",
|
|
2616
|
-
* redirect_url: "https://merchant.com/kyc-complete",
|
|
2617
|
-
* callback_url: "https://merchant.com/api/kyc-webhook"
|
|
2616
|
+
* redirect_url: "https://merchant.com/kyc-complete",
|
|
2617
|
+
* callback_url: "https://merchant.com/api/kyc-webhook",
|
|
2618
|
+
* trigger_event: "onboarding"
|
|
2618
2619
|
* });
|
|
2619
2620
|
*
|
|
2620
|
-
*
|
|
2621
|
-
*
|
|
2621
|
+
* if (result.kyc_required && result.link) {
|
|
2622
|
+
* console.log(`Redirect user to: ${result.link}`);
|
|
2623
|
+
* } else if (result.can_skip) {
|
|
2624
|
+
* console.log("KYC not required, user can proceed");
|
|
2625
|
+
* }
|
|
2622
2626
|
* ```
|
|
2623
2627
|
*/
|
|
2624
2628
|
async requestKycSubmitLink(request) {
|
|
@@ -3195,6 +3199,41 @@ var TaxClient = class extends BaseClient {
|
|
|
3195
3199
|
{ ...requestOptions, responseType: "arraybuffer" }
|
|
3196
3200
|
);
|
|
3197
3201
|
}
|
|
3202
|
+
async runReminders() {
|
|
3203
|
+
return this.request("/api/v1/tax/reminders/run", {
|
|
3204
|
+
method: "POST"
|
|
3205
|
+
});
|
|
3206
|
+
}
|
|
3207
|
+
/**
|
|
3208
|
+
* Update only the reminder configuration (frequency + max count) without
|
|
3209
|
+
* touching any other tax rule settings. Fetches current rules first and
|
|
3210
|
+
* merges the reminder fields before sending the update.
|
|
3211
|
+
*
|
|
3212
|
+
* Requires the caller to be authenticated as a Tenant Super Admin.
|
|
3213
|
+
* Throws VesantError with status 403 if the role requirement is not met.
|
|
3214
|
+
*/
|
|
3215
|
+
async updateReminderConfig(input) {
|
|
3216
|
+
const current = await this.getTaxRules();
|
|
3217
|
+
return this.updateTaxRules({
|
|
3218
|
+
trigger_account_creation: current.trigger_account_creation,
|
|
3219
|
+
trigger_first_withdrawal: current.trigger_first_withdrawal,
|
|
3220
|
+
trigger_threshold: current.trigger_threshold,
|
|
3221
|
+
trigger_manual: current.trigger_manual,
|
|
3222
|
+
trigger_tin_invalid: current.trigger_tin_invalid,
|
|
3223
|
+
trigger_w8ben_expiry: current.trigger_w8ben_expiry,
|
|
3224
|
+
trigger_tin_expired: current.trigger_tin_expired,
|
|
3225
|
+
us_withholding_enabled: current.us_withholding_enabled,
|
|
3226
|
+
non_us_withholding_enabled: current.non_us_withholding_enabled,
|
|
3227
|
+
transaction_action: current.transaction_action,
|
|
3228
|
+
w8ben_expiry_warning_days: current.w8ben_expiry_warning_days,
|
|
3229
|
+
tin_verification_due_date: current.tin_verification_due_date,
|
|
3230
|
+
email_sending_method: current.email_sending_method,
|
|
3231
|
+
display_tin_links_on_platform: current.display_tin_links_on_platform,
|
|
3232
|
+
tax_treaty_support: current.tax_treaty_support,
|
|
3233
|
+
reminder_frequency_days: input.reminder_frequency_days,
|
|
3234
|
+
reminder_max_count: input.reminder_max_count
|
|
3235
|
+
});
|
|
3236
|
+
}
|
|
3198
3237
|
// ==========================================================================
|
|
3199
3238
|
// P2 — Tenant Tax Rules
|
|
3200
3239
|
// ==========================================================================
|
|
@@ -3303,6 +3342,64 @@ var TransactionClient = class extends BaseClient {
|
|
|
3303
3342
|
}
|
|
3304
3343
|
};
|
|
3305
3344
|
|
|
3345
|
+
// src/fraud/client.ts
|
|
3346
|
+
var FraudClient = class extends BaseClient {
|
|
3347
|
+
/**
|
|
3348
|
+
* Submit a single fraud event for scoring.
|
|
3349
|
+
*/
|
|
3350
|
+
async scoreEvent(request, requestOptions) {
|
|
3351
|
+
this.validateScoreRequest(request);
|
|
3352
|
+
return this.requestWithRetry(
|
|
3353
|
+
"/api/v1/fraud/score",
|
|
3354
|
+
{
|
|
3355
|
+
method: "POST",
|
|
3356
|
+
body: JSON.stringify(request)
|
|
3357
|
+
},
|
|
3358
|
+
void 0,
|
|
3359
|
+
void 0,
|
|
3360
|
+
requestOptions
|
|
3361
|
+
);
|
|
3362
|
+
}
|
|
3363
|
+
/**
|
|
3364
|
+
* Submit multiple fraud events for scoring.
|
|
3365
|
+
*/
|
|
3366
|
+
async scoreEventsBulk(requests, requestOptions) {
|
|
3367
|
+
if (!Array.isArray(requests) || requests.length === 0) {
|
|
3368
|
+
throw new ValidationError(
|
|
3369
|
+
"Invalid bulk score request: at least one score request is required",
|
|
3370
|
+
["requests"]
|
|
3371
|
+
);
|
|
3372
|
+
}
|
|
3373
|
+
requests.forEach((request, index) => this.validateScoreRequest(request, index));
|
|
3374
|
+
return this.requestWithRetry(
|
|
3375
|
+
"/api/v1/fraud/score/bulk",
|
|
3376
|
+
{
|
|
3377
|
+
method: "POST",
|
|
3378
|
+
body: JSON.stringify(requests)
|
|
3379
|
+
},
|
|
3380
|
+
void 0,
|
|
3381
|
+
void 0,
|
|
3382
|
+
requestOptions
|
|
3383
|
+
);
|
|
3384
|
+
}
|
|
3385
|
+
validateScoreRequest(request, index) {
|
|
3386
|
+
const errors = [];
|
|
3387
|
+
const prefix = index === void 0 ? "" : `requests[${index}].`;
|
|
3388
|
+
if (!request.customer_id?.trim()) {
|
|
3389
|
+
errors.push(`${prefix}customer_id is required`);
|
|
3390
|
+
}
|
|
3391
|
+
if (!request.sift_user_id?.trim()) {
|
|
3392
|
+
errors.push(`${prefix}sift_user_id is required`);
|
|
3393
|
+
}
|
|
3394
|
+
if (!request.event_type?.trim()) {
|
|
3395
|
+
errors.push(`${prefix}event_type is required`);
|
|
3396
|
+
}
|
|
3397
|
+
if (errors.length > 0) {
|
|
3398
|
+
throw new ValidationError(`Invalid fraud score request: ${errors.join(", ")}`, errors);
|
|
3399
|
+
}
|
|
3400
|
+
}
|
|
3401
|
+
};
|
|
3402
|
+
|
|
3306
3403
|
// src/webhooks/handler.ts
|
|
3307
3404
|
var WebhookHandler = class {
|
|
3308
3405
|
constructor(config) {
|
|
@@ -3455,6 +3552,7 @@ exports.ComplianceBlockedError = ComplianceBlockedError;
|
|
|
3455
3552
|
exports.ComplianceClient = ComplianceClient;
|
|
3456
3553
|
exports.ComplianceError = ComplianceError;
|
|
3457
3554
|
exports.DEFAULT_CURRENCY_RATES = DEFAULT_CURRENCY_RATES;
|
|
3555
|
+
exports.FraudClient = FraudClient;
|
|
3458
3556
|
exports.GeolocationClient = GeolocationClient;
|
|
3459
3557
|
exports.KycClient = KycClient;
|
|
3460
3558
|
exports.NetworkError = NetworkError;
|