@corsa-labs/sdk 4.4.0 → 4.5.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.
- package/dist/ComplianceClient.d.ts +2 -0
- package/dist/ComplianceClient.js +3 -0
- package/dist/ComplianceClient.js.map +1 -1
- package/dist/models/ActionConfigDto.d.ts +19 -0
- package/dist/models/ActionConfigDto.js +15 -0
- package/dist/models/ActionConfigDto.js.map +1 -0
- package/dist/models/ConditionDto.d.ts +47 -0
- package/dist/models/ConditionDto.js +23 -0
- package/dist/models/ConditionDto.js.map +1 -0
- package/dist/models/ConditionsDto.d.ts +11 -0
- package/dist/models/ConditionsDto.js +3 -0
- package/dist/models/ConditionsDto.js.map +1 -0
- package/dist/models/CreateRuleDto.d.ts +38 -0
- package/dist/models/CreateRuleDto.js +16 -0
- package/dist/models/CreateRuleDto.js.map +1 -0
- package/dist/models/DeleteRuleDto.d.ts +6 -0
- package/dist/models/DeleteRuleDto.js +3 -0
- package/dist/models/DeleteRuleDto.js.map +1 -0
- package/dist/models/DisableRuleDto.d.ts +6 -0
- package/dist/models/DisableRuleDto.js +3 -0
- package/dist/models/DisableRuleDto.js.map +1 -0
- package/dist/models/RuleResponseDto.d.ts +25 -0
- package/dist/models/RuleResponseDto.js +19 -0
- package/dist/models/RuleResponseDto.js.map +1 -0
- package/dist/models/UpdateRuleDto.d.ts +20 -0
- package/dist/models/UpdateRuleDto.js +13 -0
- package/dist/models/UpdateRuleDto.js.map +1 -0
- package/dist/services/RulesService.d.ts +249 -0
- package/dist/services/RulesService.js +333 -0
- package/dist/services/RulesService.js.map +1 -0
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ import { ClientsService } from './services/ClientsService';
|
|
|
10
10
|
import { DepositsService } from './services/DepositsService';
|
|
11
11
|
import { MembersService } from './services/MembersService';
|
|
12
12
|
import { PlatformService } from './services/PlatformService';
|
|
13
|
+
import { RulesService } from './services/RulesService';
|
|
13
14
|
import { TradesService } from './services/TradesService';
|
|
14
15
|
import { TransactionsService } from './services/TransactionsService';
|
|
15
16
|
import { WithdrawalsService } from './services/WithdrawalsService';
|
|
@@ -25,6 +26,7 @@ export declare class ComplianceClient {
|
|
|
25
26
|
readonly deposits: DepositsService;
|
|
26
27
|
readonly members: MembersService;
|
|
27
28
|
readonly platform: PlatformService;
|
|
29
|
+
readonly rules: RulesService;
|
|
28
30
|
readonly trades: TradesService;
|
|
29
31
|
readonly transactions: TransactionsService;
|
|
30
32
|
readonly withdrawals: WithdrawalsService;
|
package/dist/ComplianceClient.js
CHANGED
|
@@ -12,6 +12,7 @@ const ClientsService_1 = require("./services/ClientsService");
|
|
|
12
12
|
const DepositsService_1 = require("./services/DepositsService");
|
|
13
13
|
const MembersService_1 = require("./services/MembersService");
|
|
14
14
|
const PlatformService_1 = require("./services/PlatformService");
|
|
15
|
+
const RulesService_1 = require("./services/RulesService");
|
|
15
16
|
const TradesService_1 = require("./services/TradesService");
|
|
16
17
|
const TransactionsService_1 = require("./services/TransactionsService");
|
|
17
18
|
const WithdrawalsService_1 = require("./services/WithdrawalsService");
|
|
@@ -26,6 +27,7 @@ class ComplianceClient {
|
|
|
26
27
|
deposits;
|
|
27
28
|
members;
|
|
28
29
|
platform;
|
|
30
|
+
rules;
|
|
29
31
|
trades;
|
|
30
32
|
transactions;
|
|
31
33
|
withdrawals;
|
|
@@ -52,6 +54,7 @@ class ComplianceClient {
|
|
|
52
54
|
this.deposits = new DepositsService_1.DepositsService(this.request);
|
|
53
55
|
this.members = new MembersService_1.MembersService(this.request);
|
|
54
56
|
this.platform = new PlatformService_1.PlatformService(this.request);
|
|
57
|
+
this.rules = new RulesService_1.RulesService(this.request);
|
|
55
58
|
this.trades = new TradesService_1.TradesService(this.request);
|
|
56
59
|
this.transactions = new TransactionsService_1.TransactionsService(this.request);
|
|
57
60
|
this.withdrawals = new WithdrawalsService_1.WithdrawalsService(this.request);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Complian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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,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;AA3CD,4CA2CC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type ActionConfigDto = {
|
|
2
|
+
/**
|
|
3
|
+
* Action type
|
|
4
|
+
*/
|
|
5
|
+
type: ActionConfigDto.type;
|
|
6
|
+
/**
|
|
7
|
+
* Action-specific configuration
|
|
8
|
+
*/
|
|
9
|
+
config: Record<string, any>;
|
|
10
|
+
};
|
|
11
|
+
export declare namespace ActionConfigDto {
|
|
12
|
+
/**
|
|
13
|
+
* Action type
|
|
14
|
+
*/
|
|
15
|
+
enum type {
|
|
16
|
+
CREATE_ALERT = "CREATE_ALERT",
|
|
17
|
+
HALT_TRANSACTION = "HALT_TRANSACTION"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActionConfigDto = void 0;
|
|
4
|
+
var ActionConfigDto;
|
|
5
|
+
(function (ActionConfigDto) {
|
|
6
|
+
/**
|
|
7
|
+
* Action type
|
|
8
|
+
*/
|
|
9
|
+
let type;
|
|
10
|
+
(function (type) {
|
|
11
|
+
type["CREATE_ALERT"] = "CREATE_ALERT";
|
|
12
|
+
type["HALT_TRANSACTION"] = "HALT_TRANSACTION";
|
|
13
|
+
})(type = ActionConfigDto.type || (ActionConfigDto.type = {}));
|
|
14
|
+
})(ActionConfigDto || (exports.ActionConfigDto = ActionConfigDto = {}));
|
|
15
|
+
//# sourceMappingURL=ActionConfigDto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionConfigDto.js","sourceRoot":"","sources":["../../models/ActionConfigDto.ts"],"names":[],"mappings":";;;AAcA,IAAiB,eAAe,CAQ/B;AARD,WAAiB,eAAe;IAC5B;;OAEG;IACH,IAAY,IAGX;IAHD,WAAY,IAAI;QACZ,qCAA6B,CAAA;QAC7B,6CAAqC,CAAA;IACzC,CAAC,EAHW,IAAI,GAAJ,oBAAI,KAAJ,oBAAI,QAGf;AACL,CAAC,EARgB,eAAe,+BAAf,eAAe,QAQ/B"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export type ConditionDto = {
|
|
2
|
+
/**
|
|
3
|
+
* Label for this condition or condition group
|
|
4
|
+
*/
|
|
5
|
+
label?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Fact name to evaluate
|
|
8
|
+
*/
|
|
9
|
+
fact?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Comparison operator
|
|
12
|
+
*/
|
|
13
|
+
operator?: ConditionDto.operator;
|
|
14
|
+
/**
|
|
15
|
+
* Value to compare against
|
|
16
|
+
*/
|
|
17
|
+
value?: Record<string, any>;
|
|
18
|
+
/**
|
|
19
|
+
* JSONPath for nested object properties
|
|
20
|
+
*/
|
|
21
|
+
path?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Nested ALL conditions (AND logic)
|
|
24
|
+
*/
|
|
25
|
+
all?: Array<Record<string, any>>;
|
|
26
|
+
/**
|
|
27
|
+
* Nested ANY conditions (OR logic)
|
|
28
|
+
*/
|
|
29
|
+
any?: Array<Record<string, any>>;
|
|
30
|
+
};
|
|
31
|
+
export declare namespace ConditionDto {
|
|
32
|
+
/**
|
|
33
|
+
* Comparison operator
|
|
34
|
+
*/
|
|
35
|
+
enum operator {
|
|
36
|
+
EQUAL = "equal",
|
|
37
|
+
NOT_EQUAL = "notEqual",
|
|
38
|
+
GREATER_THAN = "greaterThan",
|
|
39
|
+
GREATER_THAN_INCLUSIVE = "greaterThanInclusive",
|
|
40
|
+
LESS_THAN = "lessThan",
|
|
41
|
+
LESS_THAN_INCLUSIVE = "lessThanInclusive",
|
|
42
|
+
IN = "in",
|
|
43
|
+
NOT_IN = "notIn",
|
|
44
|
+
CONTAINS = "contains",
|
|
45
|
+
DOES_NOT_CONTAIN = "doesNotContain"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConditionDto = void 0;
|
|
4
|
+
var ConditionDto;
|
|
5
|
+
(function (ConditionDto) {
|
|
6
|
+
/**
|
|
7
|
+
* Comparison operator
|
|
8
|
+
*/
|
|
9
|
+
let operator;
|
|
10
|
+
(function (operator) {
|
|
11
|
+
operator["EQUAL"] = "equal";
|
|
12
|
+
operator["NOT_EQUAL"] = "notEqual";
|
|
13
|
+
operator["GREATER_THAN"] = "greaterThan";
|
|
14
|
+
operator["GREATER_THAN_INCLUSIVE"] = "greaterThanInclusive";
|
|
15
|
+
operator["LESS_THAN"] = "lessThan";
|
|
16
|
+
operator["LESS_THAN_INCLUSIVE"] = "lessThanInclusive";
|
|
17
|
+
operator["IN"] = "in";
|
|
18
|
+
operator["NOT_IN"] = "notIn";
|
|
19
|
+
operator["CONTAINS"] = "contains";
|
|
20
|
+
operator["DOES_NOT_CONTAIN"] = "doesNotContain";
|
|
21
|
+
})(operator = ConditionDto.operator || (ConditionDto.operator = {}));
|
|
22
|
+
})(ConditionDto || (exports.ConditionDto = ConditionDto = {}));
|
|
23
|
+
//# sourceMappingURL=ConditionDto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConditionDto.js","sourceRoot":"","sources":["../../models/ConditionDto.ts"],"names":[],"mappings":";;;AAkCA,IAAiB,YAAY,CAgB5B;AAhBD,WAAiB,YAAY;IACzB;;OAEG;IACH,IAAY,QAWX;IAXD,WAAY,QAAQ;QAChB,2BAAe,CAAA;QACf,kCAAsB,CAAA;QACtB,wCAA4B,CAAA;QAC5B,2DAA+C,CAAA;QAC/C,kCAAsB,CAAA;QACtB,qDAAyC,CAAA;QACzC,qBAAS,CAAA;QACT,4BAAgB,CAAA;QAChB,iCAAqB,CAAA;QACrB,+CAAmC,CAAA;IACvC,CAAC,EAXW,QAAQ,GAAR,qBAAQ,KAAR,qBAAQ,QAWnB;AACL,CAAC,EAhBgB,YAAY,4BAAZ,YAAY,QAgB5B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ConditionDto } from './ConditionDto';
|
|
2
|
+
export type ConditionsDto = {
|
|
3
|
+
/**
|
|
4
|
+
* ALL conditions (AND logic) - all must be true
|
|
5
|
+
*/
|
|
6
|
+
all?: Array<ConditionDto>;
|
|
7
|
+
/**
|
|
8
|
+
* ANY conditions (OR logic) - at least one must be true
|
|
9
|
+
*/
|
|
10
|
+
any?: Array<ConditionDto>;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConditionsDto.js","sourceRoot":"","sources":["../../models/ConditionsDto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ActionConfigDto } from './ActionConfigDto';
|
|
2
|
+
import type { ConditionsDto } from './ConditionsDto';
|
|
3
|
+
export type CreateRuleDto = {
|
|
4
|
+
/**
|
|
5
|
+
* User-facing rule name
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
/**
|
|
9
|
+
* Detailed description of what the rule does
|
|
10
|
+
*/
|
|
11
|
+
description: string;
|
|
12
|
+
/**
|
|
13
|
+
* Business priority level
|
|
14
|
+
*/
|
|
15
|
+
priority: CreateRuleDto.priority;
|
|
16
|
+
/**
|
|
17
|
+
* Actions to execute when rule matches
|
|
18
|
+
*/
|
|
19
|
+
actions: Array<ActionConfigDto>;
|
|
20
|
+
/**
|
|
21
|
+
* Scope/cohort filtering
|
|
22
|
+
*/
|
|
23
|
+
scope?: Record<string, any>;
|
|
24
|
+
/**
|
|
25
|
+
* Rule conditions (IF logic)
|
|
26
|
+
*/
|
|
27
|
+
conditions: ConditionsDto;
|
|
28
|
+
};
|
|
29
|
+
export declare namespace CreateRuleDto {
|
|
30
|
+
/**
|
|
31
|
+
* Business priority level
|
|
32
|
+
*/
|
|
33
|
+
enum priority {
|
|
34
|
+
LOW = "LOW",
|
|
35
|
+
MEDIUM = "MEDIUM",
|
|
36
|
+
HIGH = "HIGH"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateRuleDto = void 0;
|
|
4
|
+
var CreateRuleDto;
|
|
5
|
+
(function (CreateRuleDto) {
|
|
6
|
+
/**
|
|
7
|
+
* Business priority level
|
|
8
|
+
*/
|
|
9
|
+
let priority;
|
|
10
|
+
(function (priority) {
|
|
11
|
+
priority["LOW"] = "LOW";
|
|
12
|
+
priority["MEDIUM"] = "MEDIUM";
|
|
13
|
+
priority["HIGH"] = "HIGH";
|
|
14
|
+
})(priority = CreateRuleDto.priority || (CreateRuleDto.priority = {}));
|
|
15
|
+
})(CreateRuleDto || (exports.CreateRuleDto = CreateRuleDto = {}));
|
|
16
|
+
//# sourceMappingURL=CreateRuleDto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateRuleDto.js","sourceRoot":"","sources":["../../models/CreateRuleDto.ts"],"names":[],"mappings":";;;AAgCA,IAAiB,aAAa,CAS7B;AATD,WAAiB,aAAa;IAC1B;;OAEG;IACH,IAAY,QAIX;IAJD,WAAY,QAAQ;QAChB,uBAAW,CAAA;QACX,6BAAiB,CAAA;QACjB,yBAAa,CAAA;IACjB,CAAC,EAJW,QAAQ,GAAR,sBAAQ,KAAR,sBAAQ,QAInB;AACL,CAAC,EATgB,aAAa,6BAAb,aAAa,QAS7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeleteRuleDto.js","sourceRoot":"","sources":["../../models/DeleteRuleDto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DisableRuleDto.js","sourceRoot":"","sources":["../../models/DisableRuleDto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type RuleResponseDto = {
|
|
2
|
+
id: string;
|
|
3
|
+
version: number;
|
|
4
|
+
status: RuleResponseDto.status;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
priority: RuleResponseDto.priority;
|
|
8
|
+
actions: Array<Record<string, any>>;
|
|
9
|
+
scope: Record<string, any>;
|
|
10
|
+
jreRule: Record<string, any>;
|
|
11
|
+
createdBy: string;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
};
|
|
14
|
+
export declare namespace RuleResponseDto {
|
|
15
|
+
enum status {
|
|
16
|
+
DRAFT = "draft",
|
|
17
|
+
ACTIVE = "active",
|
|
18
|
+
DISABLED = "disabled"
|
|
19
|
+
}
|
|
20
|
+
enum priority {
|
|
21
|
+
LOW = "LOW",
|
|
22
|
+
MEDIUM = "MEDIUM",
|
|
23
|
+
HIGH = "HIGH"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RuleResponseDto = void 0;
|
|
4
|
+
var RuleResponseDto;
|
|
5
|
+
(function (RuleResponseDto) {
|
|
6
|
+
let status;
|
|
7
|
+
(function (status) {
|
|
8
|
+
status["DRAFT"] = "draft";
|
|
9
|
+
status["ACTIVE"] = "active";
|
|
10
|
+
status["DISABLED"] = "disabled";
|
|
11
|
+
})(status = RuleResponseDto.status || (RuleResponseDto.status = {}));
|
|
12
|
+
let priority;
|
|
13
|
+
(function (priority) {
|
|
14
|
+
priority["LOW"] = "LOW";
|
|
15
|
+
priority["MEDIUM"] = "MEDIUM";
|
|
16
|
+
priority["HIGH"] = "HIGH";
|
|
17
|
+
})(priority = RuleResponseDto.priority || (RuleResponseDto.priority = {}));
|
|
18
|
+
})(RuleResponseDto || (exports.RuleResponseDto = RuleResponseDto = {}));
|
|
19
|
+
//# sourceMappingURL=RuleResponseDto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RuleResponseDto.js","sourceRoot":"","sources":["../../models/RuleResponseDto.ts"],"names":[],"mappings":";;;AAiBA,IAAiB,eAAe,CAW/B;AAXD,WAAiB,eAAe;IAC5B,IAAY,MAIX;IAJD,WAAY,MAAM;QACd,yBAAe,CAAA;QACf,2BAAiB,CAAA;QACjB,+BAAqB,CAAA;IACzB,CAAC,EAJW,MAAM,GAAN,sBAAM,KAAN,sBAAM,QAIjB;IACD,IAAY,QAIX;IAJD,WAAY,QAAQ;QAChB,uBAAW,CAAA;QACX,6BAAiB,CAAA;QACjB,yBAAa,CAAA;IACjB,CAAC,EAJW,QAAQ,GAAR,wBAAQ,KAAR,wBAAQ,QAInB;AACL,CAAC,EAXgB,eAAe,+BAAf,eAAe,QAW/B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ActionConfigDto } from './ActionConfigDto';
|
|
2
|
+
import type { ConditionsDto } from './ConditionsDto';
|
|
3
|
+
export type UpdateRuleDto = {
|
|
4
|
+
name?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
priority?: UpdateRuleDto.priority;
|
|
7
|
+
actions?: Array<ActionConfigDto>;
|
|
8
|
+
scope?: Record<string, any>;
|
|
9
|
+
/**
|
|
10
|
+
* Rule conditions (IF logic)
|
|
11
|
+
*/
|
|
12
|
+
conditions?: ConditionsDto;
|
|
13
|
+
};
|
|
14
|
+
export declare namespace UpdateRuleDto {
|
|
15
|
+
enum priority {
|
|
16
|
+
LOW = "LOW",
|
|
17
|
+
MEDIUM = "MEDIUM",
|
|
18
|
+
HIGH = "HIGH"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateRuleDto = void 0;
|
|
4
|
+
var UpdateRuleDto;
|
|
5
|
+
(function (UpdateRuleDto) {
|
|
6
|
+
let priority;
|
|
7
|
+
(function (priority) {
|
|
8
|
+
priority["LOW"] = "LOW";
|
|
9
|
+
priority["MEDIUM"] = "MEDIUM";
|
|
10
|
+
priority["HIGH"] = "HIGH";
|
|
11
|
+
})(priority = UpdateRuleDto.priority || (UpdateRuleDto.priority = {}));
|
|
12
|
+
})(UpdateRuleDto || (exports.UpdateRuleDto = UpdateRuleDto = {}));
|
|
13
|
+
//# sourceMappingURL=UpdateRuleDto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpdateRuleDto.js","sourceRoot":"","sources":["../../models/UpdateRuleDto.ts"],"names":[],"mappings":";;;AAiBA,IAAiB,aAAa,CAM7B;AAND,WAAiB,aAAa;IAC1B,IAAY,QAIX;IAJD,WAAY,QAAQ;QAChB,uBAAW,CAAA;QACX,6BAAiB,CAAA;QACjB,yBAAa,CAAA;IACjB,CAAC,EAJW,QAAQ,GAAR,sBAAQ,KAAR,sBAAQ,QAInB;AACL,CAAC,EANgB,aAAa,6BAAb,aAAa,QAM7B"}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import type { CreateRuleDto } from '../models/CreateRuleDto';
|
|
2
|
+
import type { DeleteRuleDto } from '../models/DeleteRuleDto';
|
|
3
|
+
import type { DisableRuleDto } from '../models/DisableRuleDto';
|
|
4
|
+
import type { RuleResponseDto } from '../models/RuleResponseDto';
|
|
5
|
+
import type { UpdateRuleDto } from '../models/UpdateRuleDto';
|
|
6
|
+
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
7
|
+
import type { BaseHttpRequest } from '../core/BaseHttpRequest';
|
|
8
|
+
export declare class RulesService {
|
|
9
|
+
readonly httpRequest: BaseHttpRequest;
|
|
10
|
+
constructor(httpRequest: BaseHttpRequest);
|
|
11
|
+
/**
|
|
12
|
+
* Create a new rule (draft)
|
|
13
|
+
* Create a new rule (draft)
|
|
14
|
+
* @param requestBody
|
|
15
|
+
* @returns RuleResponseDto
|
|
16
|
+
* @throws ApiError
|
|
17
|
+
*/
|
|
18
|
+
createRule(requestBody: CreateRuleDto): CancelablePromise<RuleResponseDto>;
|
|
19
|
+
/**
|
|
20
|
+
* List rules with pagination
|
|
21
|
+
* List rules with pagination
|
|
22
|
+
* @param page Page number to retrieve. If you provide invalid value the default page number will applied
|
|
23
|
+
*
|
|
24
|
+
* **Example:** 1
|
|
25
|
+
*
|
|
26
|
+
*
|
|
27
|
+
* **Default Value:** 1
|
|
28
|
+
*
|
|
29
|
+
*
|
|
30
|
+
* @param limit Number of records per page.
|
|
31
|
+
*
|
|
32
|
+
*
|
|
33
|
+
* **Example:** 20
|
|
34
|
+
*
|
|
35
|
+
*
|
|
36
|
+
*
|
|
37
|
+
* **Default Value:** 20
|
|
38
|
+
*
|
|
39
|
+
*
|
|
40
|
+
*
|
|
41
|
+
* **Max Value:** 100
|
|
42
|
+
*
|
|
43
|
+
*
|
|
44
|
+
* If provided value is greater than max value, max value will be applied.
|
|
45
|
+
*
|
|
46
|
+
* @param filterId Filter by id query param.
|
|
47
|
+
*
|
|
48
|
+
* **Format:** filter.id={$not}:OPERATION:VALUE
|
|
49
|
+
*
|
|
50
|
+
*
|
|
51
|
+
*
|
|
52
|
+
* **Example:** filter.id=$eq:John Doe&filter.id=$in:John Doe
|
|
53
|
+
*
|
|
54
|
+
* **Available Operations**
|
|
55
|
+
* - $eq
|
|
56
|
+
*
|
|
57
|
+
* - $in
|
|
58
|
+
*
|
|
59
|
+
* - $and
|
|
60
|
+
*
|
|
61
|
+
* - $or
|
|
62
|
+
* @param filterName Filter by name query param.
|
|
63
|
+
*
|
|
64
|
+
* **Format:** filter.name={$not}:OPERATION:VALUE
|
|
65
|
+
*
|
|
66
|
+
*
|
|
67
|
+
*
|
|
68
|
+
* **Example:** filter.name=$eq:John Doe&filter.name=$ilike:John Doe
|
|
69
|
+
*
|
|
70
|
+
* **Available Operations**
|
|
71
|
+
* - $eq
|
|
72
|
+
*
|
|
73
|
+
* - $ilike
|
|
74
|
+
*
|
|
75
|
+
* - $in
|
|
76
|
+
*
|
|
77
|
+
* - $and
|
|
78
|
+
*
|
|
79
|
+
* - $or
|
|
80
|
+
* @param filterStatus Filter by status query param.
|
|
81
|
+
*
|
|
82
|
+
* **Format:** filter.status={$not}:OPERATION:VALUE
|
|
83
|
+
*
|
|
84
|
+
*
|
|
85
|
+
*
|
|
86
|
+
* **Example:** filter.status=$eq:John Doe&filter.status=$in:John Doe
|
|
87
|
+
*
|
|
88
|
+
* **Available Operations**
|
|
89
|
+
* - $eq
|
|
90
|
+
*
|
|
91
|
+
* - $in
|
|
92
|
+
*
|
|
93
|
+
* - $and
|
|
94
|
+
*
|
|
95
|
+
* - $or
|
|
96
|
+
* @param filterPriority Filter by priority query param.
|
|
97
|
+
*
|
|
98
|
+
* **Format:** filter.priority={$not}:OPERATION:VALUE
|
|
99
|
+
*
|
|
100
|
+
*
|
|
101
|
+
*
|
|
102
|
+
* **Example:** filter.priority=$eq:John Doe&filter.priority=$in:John Doe
|
|
103
|
+
*
|
|
104
|
+
* **Available Operations**
|
|
105
|
+
* - $eq
|
|
106
|
+
*
|
|
107
|
+
* - $in
|
|
108
|
+
*
|
|
109
|
+
* - $and
|
|
110
|
+
*
|
|
111
|
+
* - $or
|
|
112
|
+
* @param filterUpdatedAt Filter by updatedAt query param.
|
|
113
|
+
*
|
|
114
|
+
* **Format:** filter.updatedAt={$not}:OPERATION:VALUE
|
|
115
|
+
*
|
|
116
|
+
*
|
|
117
|
+
*
|
|
118
|
+
* **Example:** filter.updatedAt=$btw:John Doe&filter.updatedAt=$gte:John Doe
|
|
119
|
+
*
|
|
120
|
+
* **Available Operations**
|
|
121
|
+
* - $gte
|
|
122
|
+
*
|
|
123
|
+
* - $lte
|
|
124
|
+
*
|
|
125
|
+
* - $btw
|
|
126
|
+
*
|
|
127
|
+
* - $and
|
|
128
|
+
*
|
|
129
|
+
* - $or
|
|
130
|
+
* @param filterCreatedAt Filter by createdAt query param.
|
|
131
|
+
*
|
|
132
|
+
* **Format:** filter.createdAt={$not}:OPERATION:VALUE
|
|
133
|
+
*
|
|
134
|
+
*
|
|
135
|
+
*
|
|
136
|
+
* **Example:** filter.createdAt=$btw:John Doe&filter.createdAt=$gte:John Doe
|
|
137
|
+
*
|
|
138
|
+
* **Available Operations**
|
|
139
|
+
* - $gte
|
|
140
|
+
*
|
|
141
|
+
* - $lte
|
|
142
|
+
*
|
|
143
|
+
* - $btw
|
|
144
|
+
*
|
|
145
|
+
* - $and
|
|
146
|
+
*
|
|
147
|
+
* - $or
|
|
148
|
+
* @param sortBy Parameter to sort by.
|
|
149
|
+
* To sort by multiple fields, just provide query param multiple types. The order in url defines an order of sorting
|
|
150
|
+
*
|
|
151
|
+
* **Format:** {fieldName}:{DIRECTION}
|
|
152
|
+
*
|
|
153
|
+
*
|
|
154
|
+
* **Example:** sortBy=id:DESC&sortBy=name:DESC
|
|
155
|
+
*
|
|
156
|
+
*
|
|
157
|
+
* **Default Value:** updatedAt:DESC
|
|
158
|
+
*
|
|
159
|
+
* **Available Fields**
|
|
160
|
+
* - id
|
|
161
|
+
*
|
|
162
|
+
* - name
|
|
163
|
+
*
|
|
164
|
+
* - updatedAt
|
|
165
|
+
*
|
|
166
|
+
* - createdAt
|
|
167
|
+
*
|
|
168
|
+
* - status
|
|
169
|
+
*
|
|
170
|
+
* - priority
|
|
171
|
+
*
|
|
172
|
+
* @param search Search term to filter result values
|
|
173
|
+
*
|
|
174
|
+
* **Example:** John
|
|
175
|
+
*
|
|
176
|
+
*
|
|
177
|
+
* **Default Value:** No default value
|
|
178
|
+
*
|
|
179
|
+
*
|
|
180
|
+
* @param searchBy List of fields to search by term to filter result values
|
|
181
|
+
*
|
|
182
|
+
* **Example:** name,description
|
|
183
|
+
*
|
|
184
|
+
*
|
|
185
|
+
* **Default Value:** By default all fields mentioned below will be used to search by term
|
|
186
|
+
*
|
|
187
|
+
* **Available Fields**
|
|
188
|
+
* - name
|
|
189
|
+
*
|
|
190
|
+
* - description
|
|
191
|
+
*
|
|
192
|
+
* @returns any
|
|
193
|
+
* @throws ApiError
|
|
194
|
+
*/
|
|
195
|
+
listRules(page?: number, limit?: number, filterId?: Array<string>, filterName?: Array<string>, filterStatus?: Array<string>, filterPriority?: Array<string>, filterUpdatedAt?: Array<string>, filterCreatedAt?: Array<string>, sortBy?: Array<'id:ASC' | 'id:DESC' | 'name:ASC' | 'name:DESC' | 'updatedAt:ASC' | 'updatedAt:DESC' | 'createdAt:ASC' | 'createdAt:DESC' | 'status:ASC' | 'status:DESC' | 'priority:ASC' | 'priority:DESC'>, search?: string, searchBy?: Array<string>): CancelablePromise<any>;
|
|
196
|
+
/**
|
|
197
|
+
* Update a draft rule
|
|
198
|
+
* Update a draft rule
|
|
199
|
+
* @param id
|
|
200
|
+
* @param requestBody
|
|
201
|
+
* @returns RuleResponseDto
|
|
202
|
+
* @throws ApiError
|
|
203
|
+
*/
|
|
204
|
+
updateRule(id: string, requestBody: UpdateRuleDto): CancelablePromise<RuleResponseDto>;
|
|
205
|
+
/**
|
|
206
|
+
* Get a rule by ID
|
|
207
|
+
* Get a rule by ID
|
|
208
|
+
* @param id
|
|
209
|
+
* @param version
|
|
210
|
+
* @returns RuleResponseDto
|
|
211
|
+
* @throws ApiError
|
|
212
|
+
*/
|
|
213
|
+
getRule(id: string, version?: number): CancelablePromise<RuleResponseDto>;
|
|
214
|
+
/**
|
|
215
|
+
* Update an active rule
|
|
216
|
+
* Update an active rule
|
|
217
|
+
* @param id
|
|
218
|
+
* @param requestBody
|
|
219
|
+
* @returns RuleResponseDto
|
|
220
|
+
* @throws ApiError
|
|
221
|
+
*/
|
|
222
|
+
updateActiveRule(id: string, requestBody: UpdateRuleDto): CancelablePromise<RuleResponseDto>;
|
|
223
|
+
/**
|
|
224
|
+
* Activate a rule
|
|
225
|
+
* Activate a rule
|
|
226
|
+
* @param id
|
|
227
|
+
* @returns RuleResponseDto
|
|
228
|
+
* @throws ApiError
|
|
229
|
+
*/
|
|
230
|
+
activateRule(id: string): CancelablePromise<RuleResponseDto>;
|
|
231
|
+
/**
|
|
232
|
+
* Disable an active rule
|
|
233
|
+
* Disable an active rule
|
|
234
|
+
* @param id
|
|
235
|
+
* @param requestBody
|
|
236
|
+
* @returns RuleResponseDto
|
|
237
|
+
* @throws ApiError
|
|
238
|
+
*/
|
|
239
|
+
disableRule(id: string, requestBody: DisableRuleDto): CancelablePromise<RuleResponseDto>;
|
|
240
|
+
/**
|
|
241
|
+
* Delete a non-active rule (soft delete)
|
|
242
|
+
* Delete a non-active rule (soft delete)
|
|
243
|
+
* @param id
|
|
244
|
+
* @param requestBody
|
|
245
|
+
* @returns any
|
|
246
|
+
* @throws ApiError
|
|
247
|
+
*/
|
|
248
|
+
deleteRule(id: string, requestBody: DeleteRuleDto): CancelablePromise<any>;
|
|
249
|
+
}
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RulesService = void 0;
|
|
4
|
+
class RulesService {
|
|
5
|
+
httpRequest;
|
|
6
|
+
constructor(httpRequest) {
|
|
7
|
+
this.httpRequest = httpRequest;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Create a new rule (draft)
|
|
11
|
+
* Create a new rule (draft)
|
|
12
|
+
* @param requestBody
|
|
13
|
+
* @returns RuleResponseDto
|
|
14
|
+
* @throws ApiError
|
|
15
|
+
*/
|
|
16
|
+
createRule(requestBody) {
|
|
17
|
+
return this.httpRequest.request({
|
|
18
|
+
method: 'POST',
|
|
19
|
+
url: '/rules',
|
|
20
|
+
body: requestBody,
|
|
21
|
+
mediaType: 'application/json',
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* List rules with pagination
|
|
26
|
+
* List rules with pagination
|
|
27
|
+
* @param page Page number to retrieve. If you provide invalid value the default page number will applied
|
|
28
|
+
*
|
|
29
|
+
* **Example:** 1
|
|
30
|
+
*
|
|
31
|
+
*
|
|
32
|
+
* **Default Value:** 1
|
|
33
|
+
*
|
|
34
|
+
*
|
|
35
|
+
* @param limit Number of records per page.
|
|
36
|
+
*
|
|
37
|
+
*
|
|
38
|
+
* **Example:** 20
|
|
39
|
+
*
|
|
40
|
+
*
|
|
41
|
+
*
|
|
42
|
+
* **Default Value:** 20
|
|
43
|
+
*
|
|
44
|
+
*
|
|
45
|
+
*
|
|
46
|
+
* **Max Value:** 100
|
|
47
|
+
*
|
|
48
|
+
*
|
|
49
|
+
* If provided value is greater than max value, max value will be applied.
|
|
50
|
+
*
|
|
51
|
+
* @param filterId Filter by id query param.
|
|
52
|
+
*
|
|
53
|
+
* **Format:** filter.id={$not}:OPERATION:VALUE
|
|
54
|
+
*
|
|
55
|
+
*
|
|
56
|
+
*
|
|
57
|
+
* **Example:** filter.id=$eq:John Doe&filter.id=$in:John Doe
|
|
58
|
+
*
|
|
59
|
+
* **Available Operations**
|
|
60
|
+
* - $eq
|
|
61
|
+
*
|
|
62
|
+
* - $in
|
|
63
|
+
*
|
|
64
|
+
* - $and
|
|
65
|
+
*
|
|
66
|
+
* - $or
|
|
67
|
+
* @param filterName Filter by name query param.
|
|
68
|
+
*
|
|
69
|
+
* **Format:** filter.name={$not}:OPERATION:VALUE
|
|
70
|
+
*
|
|
71
|
+
*
|
|
72
|
+
*
|
|
73
|
+
* **Example:** filter.name=$eq:John Doe&filter.name=$ilike:John Doe
|
|
74
|
+
*
|
|
75
|
+
* **Available Operations**
|
|
76
|
+
* - $eq
|
|
77
|
+
*
|
|
78
|
+
* - $ilike
|
|
79
|
+
*
|
|
80
|
+
* - $in
|
|
81
|
+
*
|
|
82
|
+
* - $and
|
|
83
|
+
*
|
|
84
|
+
* - $or
|
|
85
|
+
* @param filterStatus Filter by status query param.
|
|
86
|
+
*
|
|
87
|
+
* **Format:** filter.status={$not}:OPERATION:VALUE
|
|
88
|
+
*
|
|
89
|
+
*
|
|
90
|
+
*
|
|
91
|
+
* **Example:** filter.status=$eq:John Doe&filter.status=$in:John Doe
|
|
92
|
+
*
|
|
93
|
+
* **Available Operations**
|
|
94
|
+
* - $eq
|
|
95
|
+
*
|
|
96
|
+
* - $in
|
|
97
|
+
*
|
|
98
|
+
* - $and
|
|
99
|
+
*
|
|
100
|
+
* - $or
|
|
101
|
+
* @param filterPriority Filter by priority query param.
|
|
102
|
+
*
|
|
103
|
+
* **Format:** filter.priority={$not}:OPERATION:VALUE
|
|
104
|
+
*
|
|
105
|
+
*
|
|
106
|
+
*
|
|
107
|
+
* **Example:** filter.priority=$eq:John Doe&filter.priority=$in:John Doe
|
|
108
|
+
*
|
|
109
|
+
* **Available Operations**
|
|
110
|
+
* - $eq
|
|
111
|
+
*
|
|
112
|
+
* - $in
|
|
113
|
+
*
|
|
114
|
+
* - $and
|
|
115
|
+
*
|
|
116
|
+
* - $or
|
|
117
|
+
* @param filterUpdatedAt Filter by updatedAt query param.
|
|
118
|
+
*
|
|
119
|
+
* **Format:** filter.updatedAt={$not}:OPERATION:VALUE
|
|
120
|
+
*
|
|
121
|
+
*
|
|
122
|
+
*
|
|
123
|
+
* **Example:** filter.updatedAt=$btw:John Doe&filter.updatedAt=$gte:John Doe
|
|
124
|
+
*
|
|
125
|
+
* **Available Operations**
|
|
126
|
+
* - $gte
|
|
127
|
+
*
|
|
128
|
+
* - $lte
|
|
129
|
+
*
|
|
130
|
+
* - $btw
|
|
131
|
+
*
|
|
132
|
+
* - $and
|
|
133
|
+
*
|
|
134
|
+
* - $or
|
|
135
|
+
* @param filterCreatedAt Filter by createdAt query param.
|
|
136
|
+
*
|
|
137
|
+
* **Format:** filter.createdAt={$not}:OPERATION:VALUE
|
|
138
|
+
*
|
|
139
|
+
*
|
|
140
|
+
*
|
|
141
|
+
* **Example:** filter.createdAt=$btw:John Doe&filter.createdAt=$gte:John Doe
|
|
142
|
+
*
|
|
143
|
+
* **Available Operations**
|
|
144
|
+
* - $gte
|
|
145
|
+
*
|
|
146
|
+
* - $lte
|
|
147
|
+
*
|
|
148
|
+
* - $btw
|
|
149
|
+
*
|
|
150
|
+
* - $and
|
|
151
|
+
*
|
|
152
|
+
* - $or
|
|
153
|
+
* @param sortBy Parameter to sort by.
|
|
154
|
+
* To sort by multiple fields, just provide query param multiple types. The order in url defines an order of sorting
|
|
155
|
+
*
|
|
156
|
+
* **Format:** {fieldName}:{DIRECTION}
|
|
157
|
+
*
|
|
158
|
+
*
|
|
159
|
+
* **Example:** sortBy=id:DESC&sortBy=name:DESC
|
|
160
|
+
*
|
|
161
|
+
*
|
|
162
|
+
* **Default Value:** updatedAt:DESC
|
|
163
|
+
*
|
|
164
|
+
* **Available Fields**
|
|
165
|
+
* - id
|
|
166
|
+
*
|
|
167
|
+
* - name
|
|
168
|
+
*
|
|
169
|
+
* - updatedAt
|
|
170
|
+
*
|
|
171
|
+
* - createdAt
|
|
172
|
+
*
|
|
173
|
+
* - status
|
|
174
|
+
*
|
|
175
|
+
* - priority
|
|
176
|
+
*
|
|
177
|
+
* @param search Search term to filter result values
|
|
178
|
+
*
|
|
179
|
+
* **Example:** John
|
|
180
|
+
*
|
|
181
|
+
*
|
|
182
|
+
* **Default Value:** No default value
|
|
183
|
+
*
|
|
184
|
+
*
|
|
185
|
+
* @param searchBy List of fields to search by term to filter result values
|
|
186
|
+
*
|
|
187
|
+
* **Example:** name,description
|
|
188
|
+
*
|
|
189
|
+
*
|
|
190
|
+
* **Default Value:** By default all fields mentioned below will be used to search by term
|
|
191
|
+
*
|
|
192
|
+
* **Available Fields**
|
|
193
|
+
* - name
|
|
194
|
+
*
|
|
195
|
+
* - description
|
|
196
|
+
*
|
|
197
|
+
* @returns any
|
|
198
|
+
* @throws ApiError
|
|
199
|
+
*/
|
|
200
|
+
listRules(page, limit, filterId, filterName, filterStatus, filterPriority, filterUpdatedAt, filterCreatedAt, sortBy, search, searchBy) {
|
|
201
|
+
return this.httpRequest.request({
|
|
202
|
+
method: 'GET',
|
|
203
|
+
url: '/rules',
|
|
204
|
+
query: {
|
|
205
|
+
'page': page,
|
|
206
|
+
'limit': limit,
|
|
207
|
+
'filter.id': filterId,
|
|
208
|
+
'filter.name': filterName,
|
|
209
|
+
'filter.status': filterStatus,
|
|
210
|
+
'filter.priority': filterPriority,
|
|
211
|
+
'filter.updatedAt': filterUpdatedAt,
|
|
212
|
+
'filter.createdAt': filterCreatedAt,
|
|
213
|
+
'sortBy': sortBy,
|
|
214
|
+
'search': search,
|
|
215
|
+
'searchBy': searchBy,
|
|
216
|
+
},
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Update a draft rule
|
|
221
|
+
* Update a draft rule
|
|
222
|
+
* @param id
|
|
223
|
+
* @param requestBody
|
|
224
|
+
* @returns RuleResponseDto
|
|
225
|
+
* @throws ApiError
|
|
226
|
+
*/
|
|
227
|
+
updateRule(id, requestBody) {
|
|
228
|
+
return this.httpRequest.request({
|
|
229
|
+
method: 'PUT',
|
|
230
|
+
url: '/rules/{id}',
|
|
231
|
+
path: {
|
|
232
|
+
'id': id,
|
|
233
|
+
},
|
|
234
|
+
body: requestBody,
|
|
235
|
+
mediaType: 'application/json',
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Get a rule by ID
|
|
240
|
+
* Get a rule by ID
|
|
241
|
+
* @param id
|
|
242
|
+
* @param version
|
|
243
|
+
* @returns RuleResponseDto
|
|
244
|
+
* @throws ApiError
|
|
245
|
+
*/
|
|
246
|
+
getRule(id, version) {
|
|
247
|
+
return this.httpRequest.request({
|
|
248
|
+
method: 'GET',
|
|
249
|
+
url: '/rules/{id}',
|
|
250
|
+
path: {
|
|
251
|
+
'id': id,
|
|
252
|
+
},
|
|
253
|
+
query: {
|
|
254
|
+
'version': version,
|
|
255
|
+
},
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Update an active rule
|
|
260
|
+
* Update an active rule
|
|
261
|
+
* @param id
|
|
262
|
+
* @param requestBody
|
|
263
|
+
* @returns RuleResponseDto
|
|
264
|
+
* @throws ApiError
|
|
265
|
+
*/
|
|
266
|
+
updateActiveRule(id, requestBody) {
|
|
267
|
+
return this.httpRequest.request({
|
|
268
|
+
method: 'PUT',
|
|
269
|
+
url: '/rules/{id}/update-active',
|
|
270
|
+
path: {
|
|
271
|
+
'id': id,
|
|
272
|
+
},
|
|
273
|
+
body: requestBody,
|
|
274
|
+
mediaType: 'application/json',
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Activate a rule
|
|
279
|
+
* Activate a rule
|
|
280
|
+
* @param id
|
|
281
|
+
* @returns RuleResponseDto
|
|
282
|
+
* @throws ApiError
|
|
283
|
+
*/
|
|
284
|
+
activateRule(id) {
|
|
285
|
+
return this.httpRequest.request({
|
|
286
|
+
method: 'POST',
|
|
287
|
+
url: '/rules/{id}/activate',
|
|
288
|
+
path: {
|
|
289
|
+
'id': id,
|
|
290
|
+
},
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Disable an active rule
|
|
295
|
+
* Disable an active rule
|
|
296
|
+
* @param id
|
|
297
|
+
* @param requestBody
|
|
298
|
+
* @returns RuleResponseDto
|
|
299
|
+
* @throws ApiError
|
|
300
|
+
*/
|
|
301
|
+
disableRule(id, requestBody) {
|
|
302
|
+
return this.httpRequest.request({
|
|
303
|
+
method: 'POST',
|
|
304
|
+
url: '/rules/{id}/disable',
|
|
305
|
+
path: {
|
|
306
|
+
'id': id,
|
|
307
|
+
},
|
|
308
|
+
body: requestBody,
|
|
309
|
+
mediaType: 'application/json',
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Delete a non-active rule (soft delete)
|
|
314
|
+
* Delete a non-active rule (soft delete)
|
|
315
|
+
* @param id
|
|
316
|
+
* @param requestBody
|
|
317
|
+
* @returns any
|
|
318
|
+
* @throws ApiError
|
|
319
|
+
*/
|
|
320
|
+
deleteRule(id, requestBody) {
|
|
321
|
+
return this.httpRequest.request({
|
|
322
|
+
method: 'POST',
|
|
323
|
+
url: '/rules/{id}/delete',
|
|
324
|
+
path: {
|
|
325
|
+
'id': id,
|
|
326
|
+
},
|
|
327
|
+
body: requestBody,
|
|
328
|
+
mediaType: 'application/json',
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
exports.RulesService = RulesService;
|
|
333
|
+
//# sourceMappingURL=RulesService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RulesService.js","sourceRoot":"","sources":["../../services/RulesService.ts"],"names":[],"mappings":";;;AAWA,MAAa,YAAY;IACO;IAA5B,YAA4B,WAA4B;QAA5B,gBAAW,GAAX,WAAW,CAAiB;IAAG,CAAC;IAC5D;;;;;;OAMG;IACI,UAAU,CACb,WAA0B;QAE1B,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;YAC5B,MAAM,EAAE,MAAM;YACd,G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