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,80 @@
|
|
|
1
|
+
import { B as BaseClient, R as RequestOptions } from '../client-ePzhQKp9.mjs';
|
|
2
|
+
import { T as Timestamp, R as RiskLevel } from '../types-B4Ezqo7V.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Fraud scoring types.
|
|
6
|
+
*
|
|
7
|
+
* Types for submitting fraud events and consuming risk decisions from
|
|
8
|
+
* the Vesant fraud scoring service.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
type FraudEventType = '$create_account' | '$verification' | '$login' | '$logout' | '$update_account' | '$update_password' | '$link_session_to_user' | '$security_notification' | '$transaction' | '$wager' | '$chargeback' | '$create_order' | '$update_order' | '$order_status' | '$add_promotion';
|
|
12
|
+
interface FraudScoreRequest {
|
|
13
|
+
customer_id: string;
|
|
14
|
+
sift_user_id: string;
|
|
15
|
+
event_type: FraudEventType;
|
|
16
|
+
transaction_id?: string;
|
|
17
|
+
amount?: number;
|
|
18
|
+
currency?: string;
|
|
19
|
+
ip_address?: string;
|
|
20
|
+
device_id?: string;
|
|
21
|
+
user_agent?: string;
|
|
22
|
+
metadata?: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Server `ReactionType` — tenant-scoped and vesant-scoped fraud rule reactions.
|
|
26
|
+
* Open string allows future server-side additions without a breaking SDK change.
|
|
27
|
+
*/
|
|
28
|
+
type FraudReactionType = 'approve' | 'reject' | 'hold' | 'restrict' | 'block' | 'refund' | 'void_transaction' | 'reverse_transaction' | 'freeze_account' | 'block_withdrawal' | 'limit_withdrawal' | 'disable_payment_method' | 'revoke_session' | 'require_reauth' | 'trigger_alert' | 'no_alert' | 'escalate' | 'increase_priority' | 'create_case' | 'auto_lock_account' | 'notify_team' | (string & {});
|
|
29
|
+
/**
|
|
30
|
+
* Reactions the tenant platform must apply locally (freeze, refund, revoke session, etc.).
|
|
31
|
+
*/
|
|
32
|
+
interface TenantAction {
|
|
33
|
+
type: FraudReactionType;
|
|
34
|
+
params?: Record<string, unknown>;
|
|
35
|
+
}
|
|
36
|
+
type FraudDecision = 'approve' | 'review' | 'block' | 'reject' | (string & {});
|
|
37
|
+
interface FraudScoreResponseData {
|
|
38
|
+
reference: string;
|
|
39
|
+
score: number;
|
|
40
|
+
risk_level: RiskLevel;
|
|
41
|
+
decision: FraudDecision;
|
|
42
|
+
signals: string[];
|
|
43
|
+
matched_rule_ids: string[];
|
|
44
|
+
matched_rule_names: string[];
|
|
45
|
+
applied_reactions: string[];
|
|
46
|
+
alert_created: boolean;
|
|
47
|
+
alert_reference?: string;
|
|
48
|
+
tenant_actions: TenantAction[];
|
|
49
|
+
}
|
|
50
|
+
interface FraudScoreResponseMetadata {
|
|
51
|
+
request_id?: string;
|
|
52
|
+
processing_ms?: number;
|
|
53
|
+
tenant_id?: string;
|
|
54
|
+
version?: string;
|
|
55
|
+
}
|
|
56
|
+
interface FraudScoreResponseEnvelope<T> {
|
|
57
|
+
success: boolean;
|
|
58
|
+
message: string;
|
|
59
|
+
data: T;
|
|
60
|
+
metadata?: FraudScoreResponseMetadata;
|
|
61
|
+
timestamp: Timestamp;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Fraud scoring API client.
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
declare class FraudClient extends BaseClient {
|
|
69
|
+
/**
|
|
70
|
+
* Submit a single fraud event for scoring.
|
|
71
|
+
*/
|
|
72
|
+
scoreEvent(request: FraudScoreRequest, requestOptions?: RequestOptions): Promise<FraudScoreResponseEnvelope<FraudScoreResponseData>>;
|
|
73
|
+
/**
|
|
74
|
+
* Submit multiple fraud events for scoring.
|
|
75
|
+
*/
|
|
76
|
+
scoreEventsBulk(requests: FraudScoreRequest[], requestOptions?: RequestOptions): Promise<FraudScoreResponseEnvelope<FraudScoreResponseData[]>>;
|
|
77
|
+
private validateScoreRequest;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { FraudClient, type FraudDecision, type FraudEventType, type FraudReactionType, type FraudScoreRequest, type FraudScoreResponseData, type FraudScoreResponseEnvelope, type FraudScoreResponseMetadata, type TenantAction };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { B as BaseClient, R as RequestOptions } from '../client-ePzhQKp9.js';
|
|
2
|
+
import { T as Timestamp, R as RiskLevel } from '../types-B4Ezqo7V.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Fraud scoring types.
|
|
6
|
+
*
|
|
7
|
+
* Types for submitting fraud events and consuming risk decisions from
|
|
8
|
+
* the Vesant fraud scoring service.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
type FraudEventType = '$create_account' | '$verification' | '$login' | '$logout' | '$update_account' | '$update_password' | '$link_session_to_user' | '$security_notification' | '$transaction' | '$wager' | '$chargeback' | '$create_order' | '$update_order' | '$order_status' | '$add_promotion';
|
|
12
|
+
interface FraudScoreRequest {
|
|
13
|
+
customer_id: string;
|
|
14
|
+
sift_user_id: string;
|
|
15
|
+
event_type: FraudEventType;
|
|
16
|
+
transaction_id?: string;
|
|
17
|
+
amount?: number;
|
|
18
|
+
currency?: string;
|
|
19
|
+
ip_address?: string;
|
|
20
|
+
device_id?: string;
|
|
21
|
+
user_agent?: string;
|
|
22
|
+
metadata?: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Server `ReactionType` — tenant-scoped and vesant-scoped fraud rule reactions.
|
|
26
|
+
* Open string allows future server-side additions without a breaking SDK change.
|
|
27
|
+
*/
|
|
28
|
+
type FraudReactionType = 'approve' | 'reject' | 'hold' | 'restrict' | 'block' | 'refund' | 'void_transaction' | 'reverse_transaction' | 'freeze_account' | 'block_withdrawal' | 'limit_withdrawal' | 'disable_payment_method' | 'revoke_session' | 'require_reauth' | 'trigger_alert' | 'no_alert' | 'escalate' | 'increase_priority' | 'create_case' | 'auto_lock_account' | 'notify_team' | (string & {});
|
|
29
|
+
/**
|
|
30
|
+
* Reactions the tenant platform must apply locally (freeze, refund, revoke session, etc.).
|
|
31
|
+
*/
|
|
32
|
+
interface TenantAction {
|
|
33
|
+
type: FraudReactionType;
|
|
34
|
+
params?: Record<string, unknown>;
|
|
35
|
+
}
|
|
36
|
+
type FraudDecision = 'approve' | 'review' | 'block' | 'reject' | (string & {});
|
|
37
|
+
interface FraudScoreResponseData {
|
|
38
|
+
reference: string;
|
|
39
|
+
score: number;
|
|
40
|
+
risk_level: RiskLevel;
|
|
41
|
+
decision: FraudDecision;
|
|
42
|
+
signals: string[];
|
|
43
|
+
matched_rule_ids: string[];
|
|
44
|
+
matched_rule_names: string[];
|
|
45
|
+
applied_reactions: string[];
|
|
46
|
+
alert_created: boolean;
|
|
47
|
+
alert_reference?: string;
|
|
48
|
+
tenant_actions: TenantAction[];
|
|
49
|
+
}
|
|
50
|
+
interface FraudScoreResponseMetadata {
|
|
51
|
+
request_id?: string;
|
|
52
|
+
processing_ms?: number;
|
|
53
|
+
tenant_id?: string;
|
|
54
|
+
version?: string;
|
|
55
|
+
}
|
|
56
|
+
interface FraudScoreResponseEnvelope<T> {
|
|
57
|
+
success: boolean;
|
|
58
|
+
message: string;
|
|
59
|
+
data: T;
|
|
60
|
+
metadata?: FraudScoreResponseMetadata;
|
|
61
|
+
timestamp: Timestamp;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Fraud scoring API client.
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
declare class FraudClient extends BaseClient {
|
|
69
|
+
/**
|
|
70
|
+
* Submit a single fraud event for scoring.
|
|
71
|
+
*/
|
|
72
|
+
scoreEvent(request: FraudScoreRequest, requestOptions?: RequestOptions): Promise<FraudScoreResponseEnvelope<FraudScoreResponseData>>;
|
|
73
|
+
/**
|
|
74
|
+
* Submit multiple fraud events for scoring.
|
|
75
|
+
*/
|
|
76
|
+
scoreEventsBulk(requests: FraudScoreRequest[], requestOptions?: RequestOptions): Promise<FraudScoreResponseEnvelope<FraudScoreResponseData[]>>;
|
|
77
|
+
private validateScoreRequest;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { FraudClient, type FraudDecision, type FraudEventType, type FraudReactionType, type FraudScoreRequest, type FraudScoreResponseData, type FraudScoreResponseEnvelope, type FraudScoreResponseMetadata, type TenantAction };
|