@corsa-labs/sdk 4.13.0 → 4.15.0

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.
@@ -8,6 +8,7 @@ import { CasesService } from './services/CasesService';
8
8
  import { ChecklistsService } from './services/ChecklistsService';
9
9
  import { ClientsService } from './services/ClientsService';
10
10
  import { DepositsService } from './services/DepositsService';
11
+ import { EvaluationService } from './services/EvaluationService';
11
12
  import { MembersService } from './services/MembersService';
12
13
  import { PlatformService } from './services/PlatformService';
13
14
  import { RulesService } from './services/RulesService';
@@ -24,6 +25,7 @@ export declare class ComplianceClient {
24
25
  readonly checklists: ChecklistsService;
25
26
  readonly clients: ClientsService;
26
27
  readonly deposits: DepositsService;
28
+ readonly evaluation: EvaluationService;
27
29
  readonly members: MembersService;
28
30
  readonly platform: PlatformService;
29
31
  readonly rules: RulesService;
@@ -10,6 +10,7 @@ const CasesService_1 = require("./services/CasesService");
10
10
  const ChecklistsService_1 = require("./services/ChecklistsService");
11
11
  const ClientsService_1 = require("./services/ClientsService");
12
12
  const DepositsService_1 = require("./services/DepositsService");
13
+ const EvaluationService_1 = require("./services/EvaluationService");
13
14
  const MembersService_1 = require("./services/MembersService");
14
15
  const PlatformService_1 = require("./services/PlatformService");
15
16
  const RulesService_1 = require("./services/RulesService");
@@ -25,6 +26,7 @@ class ComplianceClient {
25
26
  checklists;
26
27
  clients;
27
28
  deposits;
29
+ evaluation;
28
30
  members;
29
31
  platform;
30
32
  rules;
@@ -52,6 +54,7 @@ class ComplianceClient {
52
54
  this.checklists = new ChecklistsService_1.ChecklistsService(this.request);
53
55
  this.clients = new ClientsService_1.ClientsService(this.request);
54
56
  this.deposits = new DepositsService_1.DepositsService(this.request);
57
+ this.evaluation = new EvaluationService_1.EvaluationService(this.request);
55
58
  this.members = new MembersService_1.MembersService(this.request);
56
59
  this.platform = new PlatformService_1.PlatformService(this.request);
57
60
  this.rules = new RulesService_1.RulesService(this.request);
@@ -1 +1 @@
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G,IAAI,mDAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpE,IAAI,CAAC,KAAK,GAAG,IAAI,2BAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,IAAI,CAAC,UAAU,GAAG,IAAI,qCAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtD,IAAI,CAAC,OAAO,GAAG,IAAI,+BAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,QAAQ,GAAG,IAAI,iCAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,UAAU,GAAG,IAAI,qCAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtD,IAAI,CAAC,OAAO,GAAG,IAAI,+BAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,QAAQ,GAAG,IAAI,iCAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,IAAI,2BAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,IAAI,CAAC,MAAM,GAAG,IAAI,6BAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,CAAC,YAAY,GAAG,IAAI,yCAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1D,IAAI,CAAC,WAAW,GAAG,IAAI,uCAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5D,CAAC;CACJ;AA7CD,4CA6CC"}
@@ -0,0 +1,30 @@
1
+ export type ConditionResultDto = {
2
+ /**
3
+ * Fact name that was evaluated
4
+ */
5
+ fact: string;
6
+ /**
7
+ * label for the fact
8
+ */
9
+ factLabel?: string;
10
+ /**
11
+ * Operator used (greaterThan, lessThan, equal, etc.)
12
+ */
13
+ operator: string;
14
+ /**
15
+ * Expected value from rule condition
16
+ */
17
+ value: Record<string, any>;
18
+ /**
19
+ * Actual value of the fact
20
+ */
21
+ factValue: Record<string, any>;
22
+ /**
23
+ * Whether this condition passed
24
+ */
25
+ result: boolean;
26
+ /**
27
+ * Aggregation definition when fact is an aggregation (present only for agg facts)
28
+ */
29
+ aggregation?: Record<string, any>;
30
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ConditionResultDto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConditionResultDto.js","sourceRoot":"","sources":["../../models/ConditionResultDto.ts"],"names":[],"mappings":""}
@@ -8,4 +8,8 @@ export type CorporateClientIntegrationsDto = {
8
8
  * Sumsub integration information
9
9
  */
10
10
  sumsub?: ClientSumsubDto;
11
+ /**
12
+ * Plain customer ID for the corporate client
13
+ */
14
+ plainCustomerId?: string;
11
15
  };
@@ -0,0 +1,10 @@
1
+ export type EvaluationRequestDto = {
2
+ /**
3
+ * Optional transaction ID for tracking/correlation.
4
+ */
5
+ transactionId?: string;
6
+ /**
7
+ * Transaction data to evaluate. The 'id' field is optional and will be taken from transactionId if provided.
8
+ */
9
+ transactionData: Record<string, any>;
10
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=EvaluationRequestDto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EvaluationRequestDto.js","sourceRoot":"","sources":["../../models/EvaluationRequestDto.ts"],"names":[],"mappings":""}
@@ -0,0 +1,27 @@
1
+ import type { RuleMatchDto } from './RuleMatchDto';
2
+ export type EvaluationResultDto = {
3
+ /**
4
+ * Transaction ID if provided, undefined for anonymous evaluations
5
+ */
6
+ transactionId?: string;
7
+ /**
8
+ * Final decision: FREEZE if any rule would freeze, otherwise ALLOW
9
+ */
10
+ decision: EvaluationResultDto.decision;
11
+ /**
12
+ * List of triggered rule IDs
13
+ */
14
+ triggeredRuleIds: Array<string>;
15
+ matches: Array<RuleMatchDto>;
16
+ evaluatedAt: string;
17
+ latencyMs: number;
18
+ };
19
+ export declare namespace EvaluationResultDto {
20
+ /**
21
+ * Final decision: FREEZE if any rule would freeze, otherwise ALLOW
22
+ */
23
+ enum decision {
24
+ FREEZE = "FREEZE",
25
+ ALLOW = "ALLOW"
26
+ }
27
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EvaluationResultDto = void 0;
4
+ var EvaluationResultDto;
5
+ (function (EvaluationResultDto) {
6
+ /**
7
+ * Final decision: FREEZE if any rule would freeze, otherwise ALLOW
8
+ */
9
+ let decision;
10
+ (function (decision) {
11
+ decision["FREEZE"] = "FREEZE";
12
+ decision["ALLOW"] = "ALLOW";
13
+ })(decision = EvaluationResultDto.decision || (EvaluationResultDto.decision = {}));
14
+ })(EvaluationResultDto || (exports.EvaluationResultDto = EvaluationResultDto = {}));
15
+ //# sourceMappingURL=EvaluationResultDto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EvaluationResultDto.js","sourceRoot":"","sources":["../../models/EvaluationResultDto.ts"],"names":[],"mappings":";;;AAsBA,IAAiB,mBAAmB,CAQnC;AARD,WAAiB,mBAAmB;IAChC;;OAEG;IACH,IAAY,QAGX;IAHD,WAAY,QAAQ;QAChB,6BAAiB,CAAA;QACjB,2BAAe,CAAA;IACnB,CAAC,EAHW,QAAQ,GAAR,4BAAQ,KAAR,4BAAQ,QAGnB;AACL,CAAC,EARgB,mBAAmB,mCAAnB,mBAAmB,QAQnC"}
@@ -12,4 +12,8 @@ export type IndividualClientIntegrationsDto = {
12
12
  * Sumsub integration information
13
13
  */
14
14
  sumsub?: ClientSumsubDto;
15
+ /**
16
+ * Plain customer ID for the individual client
17
+ */
18
+ plainCustomerId?: string;
15
19
  };
@@ -0,0 +1,28 @@
1
+ import type { ConditionResultDto } from './ConditionResultDto';
2
+ export type RuleMatchDto = {
3
+ id: string;
4
+ version: number;
5
+ ruleName: string;
6
+ /**
7
+ * Rule decision: FREEZE if rule has HALT_TRANSACTION action, otherwise ALLOW
8
+ */
9
+ decision: RuleMatchDto.decision;
10
+ actions: Array<Record<string, any>>;
11
+ /**
12
+ * All facts used in evaluation
13
+ */
14
+ explain: Record<string, any>;
15
+ /**
16
+ * Detailed information about which conditions triggered the rule
17
+ */
18
+ conditionResults?: Array<ConditionResultDto>;
19
+ };
20
+ export declare namespace RuleMatchDto {
21
+ /**
22
+ * Rule decision: FREEZE if rule has HALT_TRANSACTION action, otherwise ALLOW
23
+ */
24
+ enum decision {
25
+ FREEZE = "FREEZE",
26
+ ALLOW = "ALLOW"
27
+ }
28
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RuleMatchDto = void 0;
4
+ var RuleMatchDto;
5
+ (function (RuleMatchDto) {
6
+ /**
7
+ * Rule decision: FREEZE if rule has HALT_TRANSACTION action, otherwise ALLOW
8
+ */
9
+ let decision;
10
+ (function (decision) {
11
+ decision["FREEZE"] = "FREEZE";
12
+ decision["ALLOW"] = "ALLOW";
13
+ })(decision = RuleMatchDto.decision || (RuleMatchDto.decision = {}));
14
+ })(RuleMatchDto || (exports.RuleMatchDto = RuleMatchDto = {}));
15
+ //# sourceMappingURL=RuleMatchDto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RuleMatchDto.js","sourceRoot":"","sources":["../../models/RuleMatchDto.ts"],"names":[],"mappings":";;;AAuBA,IAAiB,YAAY,CAQ5B;AARD,WAAiB,YAAY;IACzB;;OAEG;IACH,IAAY,QAGX;IAHD,WAAY,QAAQ;QAChB,6BAAiB,CAAA;QACjB,2BAAe,CAAA;IACnB,CAAC,EAHW,QAAQ,GAAR,qBAAQ,KAAR,qBAAQ,QAGnB;AACL,CAAC,EARgB,YAAY,4BAAZ,YAAY,QAQ5B"}
@@ -0,0 +1,16 @@
1
+ import type { EvaluationRequestDto } from '../models/EvaluationRequestDto';
2
+ import type { EvaluationResultDto } from '../models/EvaluationResultDto';
3
+ import type { CancelablePromise } from '../core/CancelablePromise';
4
+ import type { BaseHttpRequest } from '../core/BaseHttpRequest';
5
+ export declare class EvaluationService {
6
+ readonly httpRequest: BaseHttpRequest;
7
+ constructor(httpRequest: BaseHttpRequest);
8
+ /**
9
+ * Evaluate rules against provided transaction
10
+ * Evaluate rules against provided transaction
11
+ * @param requestBody
12
+ * @returns EvaluationResultDto
13
+ * @throws ApiError
14
+ */
15
+ evaluate(requestBody: EvaluationRequestDto): CancelablePromise<EvaluationResultDto>;
16
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EvaluationService = void 0;
4
+ class EvaluationService {
5
+ httpRequest;
6
+ constructor(httpRequest) {
7
+ this.httpRequest = httpRequest;
8
+ }
9
+ /**
10
+ * Evaluate rules against provided transaction
11
+ * Evaluate rules against provided transaction
12
+ * @param requestBody
13
+ * @returns EvaluationResultDto
14
+ * @throws ApiError
15
+ */
16
+ evaluate(requestBody) {
17
+ return this.httpRequest.request({
18
+ method: 'POST',
19
+ url: '/v1/evaluation/evaluate',
20
+ body: requestBody,
21
+ mediaType: 'application/json',
22
+ });
23
+ }
24
+ }
25
+ exports.EvaluationService = EvaluationService;
26
+ //# sourceMappingURL=EvaluationService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EvaluationService.js","sourceRoot":"","sources":["../../services/EvaluationService.ts"],"names":[],"mappings":";;;AAQA,MAAa,iBAAiB;IACE;IAA5B,YAA4B,WAA4B;QAA5B,gBAAW,GAAX,WAAW,CAAiB;IAAG,CAAC;IAC5D;;;;;;OAMG;IACI,QAAQ,CACX,WAAiC;QAEjC,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;YAC5B,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,yBAAyB;YAC9B,IAAI,EAAE,WAAW;YACjB,SAAS,EAAE,kBAAkB;SAChC,CAAC,CAAC;IACP,CAAC;CACJ;AAnBD,8CAmBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corsa-labs/sdk",
3
- "version": "4.13.0",
3
+ "version": "4.15.0",
4
4
  "description": "SDK for Corsa API",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",