vesant-sdk 1.6.2 → 1.6.3
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/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/index-B04H4xfJ.d.mts +320 -0
- package/dist/index-CItMPmLL.d.ts +320 -0
- package/dist/index.d.mts +7 -107
- package/dist/index.d.ts +7 -107
- package/dist/index.js +104 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +104 -7
- 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 +10 -6
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +10 -6
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +24 -13
- package/dist/kyc/index.d.ts +24 -13
- package/dist/kyc/index.js +10 -6
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +10 -6
- package/dist/kyc/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 +35 -0
- package/dist/tax/index.js.map +1 -1
- package/dist/tax/index.mjs +35 -0
- 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
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import { T as Timestamp, U as UUID, R as RiskLevel } from './types-B4Ezqo7V.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Webhook signature verification utilities.
|
|
5
|
+
*
|
|
6
|
+
* Supports both Web Crypto API (browsers, Deno, Cloudflare Workers)
|
|
7
|
+
* and Node.js crypto module with automatic runtime detection.
|
|
8
|
+
* Uses constant-time comparison to prevent timing attacks.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Verify an HMAC-SHA256 webhook signature.
|
|
12
|
+
*
|
|
13
|
+
* @param payload - The raw request body string
|
|
14
|
+
* @param signature - The signature from the webhook header
|
|
15
|
+
* @param secret - The webhook signing secret
|
|
16
|
+
* @returns true if the signature is valid
|
|
17
|
+
*/
|
|
18
|
+
declare function verifyWebhookSignature(payload: string, signature: string, secret: string): Promise<boolean>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* TypeScript types for the Transaction Monitoring (TM) Service
|
|
22
|
+
*
|
|
23
|
+
* These definitions mirror the Go structs used in
|
|
24
|
+
* services/transaction-monitoring-service/internal/domain/
|
|
25
|
+
*
|
|
26
|
+
* Only a subset of fields is included; additional helpers may be
|
|
27
|
+
* added as the SDK grows.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Supported transaction types.
|
|
32
|
+
* See domain/transaction.go TransactionType constants.
|
|
33
|
+
*/
|
|
34
|
+
type TransactionType = "deposit" | "withdrawal" | "transfer" | "bet" | "payout";
|
|
35
|
+
/**
|
|
36
|
+
* Modes or channels by which the transaction was carried out.
|
|
37
|
+
* See domain/transaction.go TransactionMode constants.
|
|
38
|
+
*/
|
|
39
|
+
type TransactionMode = "wire_transfer" | "crypto" | "swift" | "ach" | "card";
|
|
40
|
+
/**
|
|
41
|
+
* Current status of the transaction record.
|
|
42
|
+
* See domain/transaction.go TransactionStatus constants.
|
|
43
|
+
*/
|
|
44
|
+
type TransactionStatus = "pending" | "completed" | "failed" | "blocked" | "flagged" | "hold";
|
|
45
|
+
/**
|
|
46
|
+
* Payload sent when creating a new transaction via the TM API.
|
|
47
|
+
*
|
|
48
|
+
* Numeric decimal types in Go are represented as strings in the SDK to avoid
|
|
49
|
+
* precision loss in JavaScript. Dates are ISO strings.
|
|
50
|
+
*/
|
|
51
|
+
interface TransactionCreateDTO {
|
|
52
|
+
tx_id: string;
|
|
53
|
+
reference: string;
|
|
54
|
+
tenant_id: string;
|
|
55
|
+
customer_id: string;
|
|
56
|
+
transaction_type: TransactionType;
|
|
57
|
+
transaction_mode: TransactionMode;
|
|
58
|
+
amount: string;
|
|
59
|
+
amount_usd?: number;
|
|
60
|
+
currency: string;
|
|
61
|
+
source_account?: string;
|
|
62
|
+
destination_account?: string;
|
|
63
|
+
country?: string;
|
|
64
|
+
ip_address?: string;
|
|
65
|
+
metadata?: Record<string, any>;
|
|
66
|
+
benificiary_comment?: string;
|
|
67
|
+
transaction_date: Timestamp;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Representation of a transaction record returned from the TM service.
|
|
71
|
+
*/
|
|
72
|
+
type WithholdingType = "none" | "backup_us" | "backup_non_us" | "treaty";
|
|
73
|
+
type WithholdingReason = "customer_tax_form_not_verified" | "tin_not_verified" | "b_notice_backup_withholding";
|
|
74
|
+
type JSONB = Record<string, any>;
|
|
75
|
+
type Transaction = {
|
|
76
|
+
id: string;
|
|
77
|
+
tx_id: string;
|
|
78
|
+
reference: string;
|
|
79
|
+
tenant_id: string;
|
|
80
|
+
customer_id: string;
|
|
81
|
+
transaction_type: TransactionType;
|
|
82
|
+
transaction_mode: TransactionMode;
|
|
83
|
+
amount: string;
|
|
84
|
+
withheld_amount: string;
|
|
85
|
+
released_amount: string;
|
|
86
|
+
withholding_rate: number;
|
|
87
|
+
withholding_reason?: WithholdingReason;
|
|
88
|
+
withholding_type?: WithholdingType;
|
|
89
|
+
amount_usd: number;
|
|
90
|
+
withheld_usd: number;
|
|
91
|
+
released_usd: number;
|
|
92
|
+
tax_year: number;
|
|
93
|
+
currency: string;
|
|
94
|
+
status: TransactionStatus;
|
|
95
|
+
source_account?: string;
|
|
96
|
+
destination_account?: string;
|
|
97
|
+
country?: string;
|
|
98
|
+
ip_address?: string;
|
|
99
|
+
is_first_withdrawal: boolean;
|
|
100
|
+
risk_score: number;
|
|
101
|
+
metadata?: JSONB;
|
|
102
|
+
benificiary_comment?: string;
|
|
103
|
+
transaction_date: string;
|
|
104
|
+
created_at: string;
|
|
105
|
+
updated_at: string;
|
|
106
|
+
deleted_at?: string | null;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Configuration object consumed by {@link TransactionClient}.
|
|
110
|
+
* Currently identical to {@link import('../core/types').BaseClientConfig},
|
|
111
|
+
* exported here for future extensibility.
|
|
112
|
+
*/
|
|
113
|
+
interface TransactionClientConfig {
|
|
114
|
+
baseURL: string;
|
|
115
|
+
tenantId: string;
|
|
116
|
+
apiKey?: string;
|
|
117
|
+
headers?: Record<string, string>;
|
|
118
|
+
timeout?: number;
|
|
119
|
+
retries?: number;
|
|
120
|
+
debug?: boolean;
|
|
121
|
+
environment?: 'production' | 'sandbox';
|
|
122
|
+
}
|
|
123
|
+
type TransactionCreateResponse = {
|
|
124
|
+
transaction: Transaction;
|
|
125
|
+
message: string;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Webhook event types and payload definitions.
|
|
130
|
+
*/
|
|
131
|
+
|
|
132
|
+
type WebhookEventType = 'risk.score.changed' | 'risk.category.changed' | 'profile.created' | 'profile.updated' | 'geolocation.verified' | 'geolocation.blocked' | 'kyc.status.changed' | 'kyc.approved' | 'kyc.declined' | 'decision.recorded' | 'label.applied' | 'location_request.completed' | 'compliance.check.failed' | 'tax.reminder.sent' | 'transaction.callback';
|
|
133
|
+
interface BaseWebhookEvent<T extends WebhookEventType = WebhookEventType, P = unknown> {
|
|
134
|
+
id: UUID;
|
|
135
|
+
type: T;
|
|
136
|
+
tenant_id: string;
|
|
137
|
+
environment: 'production' | 'sandbox';
|
|
138
|
+
customer_id: string;
|
|
139
|
+
payload: P;
|
|
140
|
+
timestamp: Timestamp;
|
|
141
|
+
}
|
|
142
|
+
interface RiskScoreChangedPayload {
|
|
143
|
+
previous_score: number;
|
|
144
|
+
new_score: number;
|
|
145
|
+
risk_level: RiskLevel;
|
|
146
|
+
factors: string[];
|
|
147
|
+
}
|
|
148
|
+
interface RiskCategoryChangedPayload {
|
|
149
|
+
previous_category: string;
|
|
150
|
+
new_category: string;
|
|
151
|
+
risk_level: RiskLevel;
|
|
152
|
+
}
|
|
153
|
+
interface ProfileCreatedPayload {
|
|
154
|
+
customer_id: string;
|
|
155
|
+
entity_type: string;
|
|
156
|
+
source: string;
|
|
157
|
+
}
|
|
158
|
+
interface ProfileUpdatedPayload {
|
|
159
|
+
customer_id: string;
|
|
160
|
+
updated_fields: string[];
|
|
161
|
+
}
|
|
162
|
+
interface GeolocationVerifiedPayload {
|
|
163
|
+
latitude: number;
|
|
164
|
+
longitude: number;
|
|
165
|
+
country: string;
|
|
166
|
+
region?: string;
|
|
167
|
+
is_compliant: boolean;
|
|
168
|
+
}
|
|
169
|
+
interface GeolocationBlockedPayload {
|
|
170
|
+
latitude: number;
|
|
171
|
+
longitude: number;
|
|
172
|
+
country: string;
|
|
173
|
+
region?: string;
|
|
174
|
+
reasons: string[];
|
|
175
|
+
}
|
|
176
|
+
interface KycStatusChangedPayload {
|
|
177
|
+
previous_status: string;
|
|
178
|
+
new_status: string;
|
|
179
|
+
provider?: string;
|
|
180
|
+
}
|
|
181
|
+
interface DecisionRecordedPayload {
|
|
182
|
+
decision_id: string;
|
|
183
|
+
decision_type: string;
|
|
184
|
+
category: string;
|
|
185
|
+
source: string;
|
|
186
|
+
risk_score?: number;
|
|
187
|
+
}
|
|
188
|
+
interface LabelAppliedPayload {
|
|
189
|
+
label_type: string;
|
|
190
|
+
reasons?: string[];
|
|
191
|
+
}
|
|
192
|
+
interface LocationRequestCompletedPayload {
|
|
193
|
+
request_id: string;
|
|
194
|
+
status: string;
|
|
195
|
+
latitude?: number;
|
|
196
|
+
longitude?: number;
|
|
197
|
+
}
|
|
198
|
+
interface ComplianceCheckFailedPayload {
|
|
199
|
+
check_type: string;
|
|
200
|
+
reasons: string[];
|
|
201
|
+
severity: string;
|
|
202
|
+
}
|
|
203
|
+
type TaxReminderType = 'w9_request' | 'w8ben_expiry' | 're_request';
|
|
204
|
+
type TaxFormType = 'W9' | 'W8BEN' | 'W8BENE';
|
|
205
|
+
interface TaxReminderSentPayload {
|
|
206
|
+
customer_id: string;
|
|
207
|
+
profile_id: string;
|
|
208
|
+
form_type: TaxFormType;
|
|
209
|
+
reminder_type: TaxReminderType;
|
|
210
|
+
reminder_number: number;
|
|
211
|
+
message: string;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Fired after every transaction is created. Carries the final transaction
|
|
215
|
+
* state so the client can mirror status, withholding, and amount details.
|
|
216
|
+
* status === "hold" means the client should freeze the transaction.
|
|
217
|
+
*/
|
|
218
|
+
interface TransactionCallbackPayload {
|
|
219
|
+
tx_id: string;
|
|
220
|
+
reference: string;
|
|
221
|
+
customer_id: string;
|
|
222
|
+
transaction_type: TransactionType;
|
|
223
|
+
transaction_mode: TransactionMode;
|
|
224
|
+
status: TransactionStatus;
|
|
225
|
+
amount: string;
|
|
226
|
+
currency: string;
|
|
227
|
+
withheld_amount: string;
|
|
228
|
+
released_amount: string;
|
|
229
|
+
withholding_rate: number;
|
|
230
|
+
withholding_type: WithholdingType;
|
|
231
|
+
withholding_reason?: WithholdingReason;
|
|
232
|
+
amount_usd: number;
|
|
233
|
+
withheld_usd: number;
|
|
234
|
+
released_usd: number;
|
|
235
|
+
is_first_withdrawal: boolean;
|
|
236
|
+
transaction_date: Timestamp;
|
|
237
|
+
}
|
|
238
|
+
type WebhookEvent = BaseWebhookEvent<'risk.score.changed', RiskScoreChangedPayload> | BaseWebhookEvent<'risk.category.changed', RiskCategoryChangedPayload> | BaseWebhookEvent<'profile.created', ProfileCreatedPayload> | BaseWebhookEvent<'profile.updated', ProfileUpdatedPayload> | BaseWebhookEvent<'geolocation.verified', GeolocationVerifiedPayload> | BaseWebhookEvent<'geolocation.blocked', GeolocationBlockedPayload> | BaseWebhookEvent<'kyc.status.changed', KycStatusChangedPayload> | BaseWebhookEvent<'kyc.approved', KycStatusChangedPayload> | BaseWebhookEvent<'kyc.declined', KycStatusChangedPayload> | BaseWebhookEvent<'decision.recorded', DecisionRecordedPayload> | BaseWebhookEvent<'label.applied', LabelAppliedPayload> | BaseWebhookEvent<'location_request.completed', LocationRequestCompletedPayload> | BaseWebhookEvent<'compliance.check.failed', ComplianceCheckFailedPayload> | BaseWebhookEvent<'tax.reminder.sent', TaxReminderSentPayload> | BaseWebhookEvent<'transaction.callback', TransactionCallbackPayload>;
|
|
239
|
+
interface WebhookHandlerConfig {
|
|
240
|
+
/** Webhook signing secret for signature verification */
|
|
241
|
+
secret: string;
|
|
242
|
+
/** Header name containing the signature (default: 'x-webhook-signature') */
|
|
243
|
+
signatureHeader?: string;
|
|
244
|
+
/** Maximum age of webhook event in ms (default: 300000 = 5 minutes) */
|
|
245
|
+
tolerance?: number;
|
|
246
|
+
}
|
|
247
|
+
type WebhookEventHandler<T extends WebhookEventType = WebhookEventType> = (event: Extract<WebhookEvent, {
|
|
248
|
+
type: T;
|
|
249
|
+
}>) => void | Promise<void>;
|
|
250
|
+
type WebhookAnyHandler = (event: WebhookEvent) => void | Promise<void>;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Webhook event handler with signature verification and typed dispatch.
|
|
254
|
+
*/
|
|
255
|
+
|
|
256
|
+
declare class WebhookHandler {
|
|
257
|
+
private handlers;
|
|
258
|
+
private anyHandlers;
|
|
259
|
+
private readonly secret;
|
|
260
|
+
private readonly tolerance;
|
|
261
|
+
constructor(config: WebhookHandlerConfig);
|
|
262
|
+
/**
|
|
263
|
+
* Register a handler for a specific event type.
|
|
264
|
+
*/
|
|
265
|
+
on<T extends WebhookEventType>(eventType: T, handler: WebhookEventHandler<T>): this;
|
|
266
|
+
/**
|
|
267
|
+
* Register a catch-all handler for all event types.
|
|
268
|
+
*/
|
|
269
|
+
onAny(handler: WebhookAnyHandler): this;
|
|
270
|
+
/**
|
|
271
|
+
* Verify signature and parse the webhook body.
|
|
272
|
+
*/
|
|
273
|
+
verifyAndParse(body: string, signature: string): Promise<WebhookEvent>;
|
|
274
|
+
/**
|
|
275
|
+
* Verify signature, parse, and dispatch to registered handlers.
|
|
276
|
+
*/
|
|
277
|
+
handle(body: string, signature: string): Promise<void>;
|
|
278
|
+
/**
|
|
279
|
+
* Parse an event without signature verification (for testing).
|
|
280
|
+
*/
|
|
281
|
+
parseEvent(body: string): WebhookEvent;
|
|
282
|
+
private parseAndValidate;
|
|
283
|
+
private dispatch;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Framework middleware helpers for webhook handling.
|
|
288
|
+
*
|
|
289
|
+
* Provides pre-built integrations for Express/Connect and Next.js App Router.
|
|
290
|
+
*/
|
|
291
|
+
|
|
292
|
+
interface WebhookMiddlewareOptions extends WebhookHandlerConfig {
|
|
293
|
+
/** Event handlers to register */
|
|
294
|
+
handlers?: Partial<Record<WebhookEventType, WebhookEventHandler>>;
|
|
295
|
+
/** Catch-all handler */
|
|
296
|
+
onAny?: WebhookAnyHandler;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Create an Express/Connect-compatible middleware for webhook handling.
|
|
300
|
+
*
|
|
301
|
+
* Expects the raw body to be available as `req.body` (string).
|
|
302
|
+
* Use `express.raw({ type: 'application/json' })` or similar middleware upstream.
|
|
303
|
+
*/
|
|
304
|
+
declare function createWebhookMiddleware(options: WebhookMiddlewareOptions): (req: {
|
|
305
|
+
body: string | Buffer;
|
|
306
|
+
headers: Record<string, string | string[] | undefined>;
|
|
307
|
+
}, res: {
|
|
308
|
+
status(code: number): {
|
|
309
|
+
json(body: unknown): void;
|
|
310
|
+
};
|
|
311
|
+
json?(body: unknown): void;
|
|
312
|
+
}, next?: (err?: unknown) => void) => Promise<void>;
|
|
313
|
+
/**
|
|
314
|
+
* Create a Next.js App Router-compatible webhook handler.
|
|
315
|
+
*
|
|
316
|
+
* Returns an async function `(request: Request) => Promise<Response>`.
|
|
317
|
+
*/
|
|
318
|
+
declare function createNextWebhookHandler(options: WebhookMiddlewareOptions): (request: Request) => Promise<Response>;
|
|
319
|
+
|
|
320
|
+
export { type BaseWebhookEvent as B, type ComplianceCheckFailedPayload as C, type DecisionRecordedPayload as D, type GeolocationVerifiedPayload as G, type JSONB as J, type KycStatusChangedPayload as K, type LabelAppliedPayload as L, type ProfileCreatedPayload as P, type RiskScoreChangedPayload as R, type TransactionCreateDTO as T, WebhookHandler as W, type TransactionCreateResponse as a, type TransactionType as b, type TransactionMode as c, type TransactionStatus as d, type WithholdingType as e, type WithholdingReason as f, type Transaction as g, type TransactionClientConfig as h, type WebhookMiddlewareOptions as i, createWebhookMiddleware as j, createNextWebhookHandler as k, type WebhookEventType as l, type RiskCategoryChangedPayload as m, type ProfileUpdatedPayload as n, type GeolocationBlockedPayload as o, type LocationRequestCompletedPayload as p, type TaxReminderType as q, type TaxFormType as r, type TaxReminderSentPayload as s, type TransactionCallbackPayload as t, type WebhookEvent as u, verifyWebhookSignature as v, type WebhookHandlerConfig as w, type WebhookEventHandler as x, type WebhookAnyHandler as y };
|
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
|
|
@@ -68,107 +69,6 @@ declare const noopLogger: Logger;
|
|
|
68
69
|
*/
|
|
69
70
|
declare const SDK_VERSION = "1.6.2";
|
|
70
71
|
|
|
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
|
-
};
|
|
171
|
-
|
|
172
72
|
/**
|
|
173
73
|
* TransactionClient - TypeScript SDK for the Transaction Monitoring service
|
|
174
74
|
*
|
|
@@ -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
|
|
@@ -68,107 +69,6 @@ declare const noopLogger: Logger;
|
|
|
68
69
|
*/
|
|
69
70
|
declare const SDK_VERSION = "1.6.2";
|
|
70
71
|
|
|
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
|
-
};
|
|
171
|
-
|
|
172
72
|
/**
|
|
173
73
|
* TransactionClient - TypeScript SDK for the Transaction Monitoring service
|
|
174
74
|
*
|
|
@@ -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 };
|