vesant-sdk 1.6.6 → 2.0.0-dev.40d1c39

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.
Files changed (86) hide show
  1. package/README.md +14 -4
  2. package/dist/client-BJ87_Vv5.d.ts +430 -0
  3. package/dist/{client-ePzhQKp9.d.mts → client-BolQlL5e.d.mts} +1 -1
  4. package/dist/{client-ePzhQKp9.d.ts → client-BolQlL5e.d.ts} +1 -1
  5. package/dist/{client-BlCxjbY2.d.mts → client-Bvp-f05-.d.ts} +7 -7
  6. package/dist/{client-C_A7QLcB.d.ts → client-CIEa7xYG.d.mts} +7 -7
  7. package/dist/client-IAOGCBfm.d.mts +430 -0
  8. package/dist/compliance/index.d.mts +25 -429
  9. package/dist/compliance/index.d.ts +25 -429
  10. package/dist/compliance/index.js +137 -58
  11. package/dist/compliance/index.js.map +1 -1
  12. package/dist/compliance/index.mjs +137 -59
  13. package/dist/compliance/index.mjs.map +1 -1
  14. package/dist/decisions/index.d.mts +2 -2
  15. package/dist/decisions/index.d.ts +2 -2
  16. package/dist/decisions/index.js +1 -1
  17. package/dist/decisions/index.js.map +1 -1
  18. package/dist/decisions/index.mjs +1 -1
  19. package/dist/decisions/index.mjs.map +1 -1
  20. package/dist/geolocation/index.d.mts +4 -4
  21. package/dist/geolocation/index.d.ts +4 -4
  22. package/dist/geolocation/index.js +6 -24
  23. package/dist/geolocation/index.js.map +1 -1
  24. package/dist/geolocation/index.mjs +6 -24
  25. package/dist/geolocation/index.mjs.map +1 -1
  26. package/dist/index.d.mts +14 -71
  27. package/dist/index.d.ts +14 -71
  28. package/dist/index.js +190 -237
  29. package/dist/index.js.map +1 -1
  30. package/dist/index.mjs +189 -236
  31. package/dist/index.mjs.map +1 -1
  32. package/dist/kyc/core.d.mts +4 -4
  33. package/dist/kyc/core.d.ts +4 -4
  34. package/dist/kyc/core.js +24 -13
  35. package/dist/kyc/core.js.map +1 -1
  36. package/dist/kyc/core.mjs +24 -14
  37. package/dist/kyc/core.mjs.map +1 -1
  38. package/dist/kyc/index.d.mts +20 -27
  39. package/dist/kyc/index.d.ts +20 -27
  40. package/dist/kyc/index.js +24 -13
  41. package/dist/kyc/index.js.map +1 -1
  42. package/dist/kyc/index.mjs +24 -14
  43. package/dist/kyc/index.mjs.map +1 -1
  44. package/dist/react.d.mts +6 -6
  45. package/dist/react.d.ts +6 -6
  46. package/dist/react.js +18 -5
  47. package/dist/react.js.map +1 -1
  48. package/dist/react.mjs +18 -5
  49. package/dist/react.mjs.map +1 -1
  50. package/dist/risk-profile/index.d.mts +4 -4
  51. package/dist/risk-profile/index.d.ts +4 -4
  52. package/dist/risk-profile/index.js +1 -1
  53. package/dist/risk-profile/index.js.map +1 -1
  54. package/dist/risk-profile/index.mjs +1 -1
  55. package/dist/risk-profile/index.mjs.map +1 -1
  56. package/dist/scores/index.d.mts +2 -2
  57. package/dist/scores/index.d.ts +2 -2
  58. package/dist/scores/index.js +1 -1
  59. package/dist/scores/index.js.map +1 -1
  60. package/dist/scores/index.mjs +1 -1
  61. package/dist/scores/index.mjs.map +1 -1
  62. package/dist/tax/index.d.mts +6 -41
  63. package/dist/tax/index.d.ts +6 -41
  64. package/dist/tax/index.js +1 -36
  65. package/dist/tax/index.js.map +1 -1
  66. package/dist/tax/index.mjs +1 -36
  67. package/dist/tax/index.mjs.map +1 -1
  68. package/dist/{types-X5Md_dD_.d.ts → types-2utj53GK.d.ts} +2 -2
  69. package/dist/{types-1RzYeSal.d.mts → types-C4Zx0d_u.d.mts} +2 -2
  70. package/dist/{types-B4Ezqo7V.d.mts → types-QUCWam16.d.mts} +7 -1
  71. package/dist/{types-B4Ezqo7V.d.ts → types-QUCWam16.d.ts} +7 -1
  72. package/dist/webhooks/index.d.mts +181 -2
  73. package/dist/webhooks/index.d.ts +181 -2
  74. package/dist/webhooks/index.js +49 -7
  75. package/dist/webhooks/index.js.map +1 -1
  76. package/dist/webhooks/index.mjs +49 -7
  77. package/dist/webhooks/index.mjs.map +1 -1
  78. package/package.json +16 -13
  79. package/dist/fraud/index.d.mts +0 -80
  80. package/dist/fraud/index.d.ts +0 -80
  81. package/dist/fraud/index.js +0 -606
  82. package/dist/fraud/index.js.map +0 -1
  83. package/dist/fraud/index.mjs +0 -604
  84. package/dist/fraud/index.mjs.map +0 -1
  85. package/dist/index-B04H4xfJ.d.mts +0 -320
  86. package/dist/index-CItMPmLL.d.ts +0 -320
package/package.json CHANGED
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "name": "vesant-sdk",
3
- "version": "1.6.6",
3
+ "version": "2.0.0-dev.40d1c39",
4
+ "workspaces": [
5
+ "packages/*"
6
+ ],
4
7
  "description": "TypeScript SDK for Vesant Compliance Platform - Geolocation, KYC, Risk Profiling, CipherText, and Compliance Orchestration",
5
8
  "main": "./dist/index.js",
6
9
  "module": "./dist/index.mjs",
@@ -60,11 +63,6 @@
60
63
  "types": "./dist/tax/index.d.ts",
61
64
  "import": "./dist/tax/index.mjs",
62
65
  "require": "./dist/tax/index.js"
63
- },
64
- "./fraud": {
65
- "types": "./dist/fraud/index.d.ts",
66
- "import": "./dist/fraud/index.mjs",
67
- "require": "./dist/fraud/index.js"
68
66
  }
69
67
  },
70
68
  "files": [
@@ -77,7 +75,9 @@
77
75
  "test:watch": "vitest",
78
76
  "test:coverage": "vitest run --coverage",
79
77
  "lint": "eslint src --ext .ts,.tsx",
80
- "type-check": "tsc --noEmit"
78
+ "type-check": "tsc --noEmit",
79
+ "docs:api": "typedoc",
80
+ "prepare": "cd .. && node typescript/node_modules/husky/bin.js"
81
81
  },
82
82
  "keywords": [
83
83
  "compliance",
@@ -104,28 +104,31 @@
104
104
  }
105
105
  },
106
106
  "devDependencies": {
107
+ "@commitlint/cli": "^21.0.0",
108
+ "@commitlint/config-conventional": "^21.0.0",
107
109
  "@types/node": "^20.0.0",
108
110
  "@types/react": "^18.2.0",
109
- "@types/react-dom": "^19",
111
+ "@types/react-dom": "^18.2.0",
110
112
  "@typescript-eslint/eslint-plugin": "^6.0.0",
111
113
  "@typescript-eslint/parser": "^6.0.0",
112
114
  "@vitest/coverage-v8": "^2.0.0",
113
115
  "eslint": "^8.0.0",
116
+ "husky": "^9.1.7",
114
117
  "jsdom": "^28.0.0",
115
118
  "msw": "^2.4.0",
116
119
  "ts-node": "^10.9.2",
117
120
  "tsup": "^8.0.0",
118
121
  "tsx": "^4.21.0",
122
+ "typedoc": "^0.28.0",
123
+ "typedoc-plugin-markdown": "^4.0.0",
119
124
  "typescript": "^5.3.0",
120
125
  "vitest": "^2.0.0"
121
126
  },
122
127
  "sideEffects": false,
128
+ "homepage": "https://github.com/botcalm-compliance/vesant-sdk#readme",
123
129
  "repository": {
124
130
  "type": "git",
125
- "url": "https://github.com/botcalm-compliance/cgs-server.git",
126
- "directory": "sdk/typescript"
127
- },
128
- "dependencies": {
129
- "react-dom": "^19.2.4"
131
+ "url": "https://github.com/botcalm-compliance/vesant-sdk.git",
132
+ "directory": "typescript"
130
133
  }
131
134
  }
@@ -1,80 +0,0 @@
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 };
@@ -1,80 +0,0 @@
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 };