itrm-tools 1.2.9 → 1.3.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/api/bitso/BitsoApiConnection.d.ts +26 -0
- package/dist/api/bitso/BitsoApiConnection.js +121 -0
- package/dist/api/bitso/BitsoApiConnection.js.map +1 -0
- package/dist/api/bitso/tools/BitsoBalance.d.ts +17 -0
- package/dist/api/bitso/tools/BitsoBalance.js +29 -0
- package/dist/api/bitso/tools/BitsoBalance.js.map +1 -0
- package/dist/api/bitso/tools/BitsoBook.d.ts +38 -0
- package/dist/api/bitso/tools/BitsoBook.js +60 -0
- package/dist/api/bitso/tools/BitsoBook.js.map +1 -0
- package/dist/api/bitso/tools/BitsoOrder.d.ts +42 -0
- package/dist/api/bitso/tools/BitsoOrder.js +30 -0
- package/dist/api/bitso/tools/BitsoOrder.js.map +1 -0
- package/dist/api/bitso/tools/BitsoOrderBook.d.ts +14 -0
- package/dist/api/bitso/tools/BitsoOrderBook.js +24 -0
- package/dist/api/bitso/tools/BitsoOrderBook.js.map +1 -0
- package/dist/api/bitso/tools/BitsoTrade.d.ts +41 -0
- package/dist/api/bitso/tools/BitsoTrade.js +46 -0
- package/dist/api/bitso/tools/BitsoTrade.js.map +1 -0
- package/dist/api/check/RoleServicePermissionsChecker.d.ts +13 -0
- package/dist/api/check/RoleServicePermissionsChecker.js +92 -0
- package/dist/api/check/RoleServicePermissionsChecker.js.map +1 -0
- package/dist/api/check/ServiceSessionChecker.d.ts +28 -0
- package/dist/api/check/ServiceSessionChecker.js +119 -0
- package/dist/api/check/ServiceSessionChecker.js.map +1 -0
- package/dist/api/external/kyc/KycApiManager.d.ts +84 -0
- package/dist/api/external/kyc/KycApiManager.js +148 -0
- package/dist/api/external/kyc/KycApiManager.js.map +1 -0
- package/dist/api/request/crud/cetus/AccountManager.d.ts +36 -0
- package/dist/api/request/crud/cetus/AccountManager.js +82 -0
- package/dist/api/request/crud/cetus/AccountManager.js.map +1 -0
- package/dist/api/request/crud/cetus/AssetsManager.d.ts +38 -0
- package/dist/api/request/crud/cetus/AssetsManager.js +82 -0
- package/dist/api/request/crud/cetus/AssetsManager.js.map +1 -0
- package/dist/api/request/crud/cetus/BalanceChangeLogs.d.ts +38 -0
- package/dist/api/request/crud/cetus/BalanceChangeLogs.js +90 -0
- package/dist/api/request/crud/cetus/BalanceChangeLogs.js.map +1 -0
- package/dist/api/request/crud/cetus/CandleManager.d.ts +32 -0
- package/dist/api/request/crud/cetus/CandleManager.js +17 -0
- package/dist/api/request/crud/cetus/CandleManager.js.map +1 -0
- package/dist/api/request/crud/cetus/ContributorActionManager.d.ts +59 -0
- package/dist/api/request/crud/cetus/ContributorActionManager.js +103 -0
- package/dist/api/request/crud/cetus/ContributorActionManager.js.map +1 -0
- package/dist/api/request/crud/cetus/ContributorManager.d.ts +33 -0
- package/dist/api/request/crud/cetus/ContributorManager.js +75 -0
- package/dist/api/request/crud/cetus/ContributorManager.js.map +1 -0
- package/dist/api/request/crud/cetus/CounterpartyBalances.d.ts +44 -0
- package/dist/api/request/crud/cetus/CounterpartyBalances.js +96 -0
- package/dist/api/request/crud/cetus/CounterpartyBalances.js.map +1 -0
- package/dist/api/request/crud/cetus/ExpenseManager.d.ts +45 -0
- package/dist/api/request/crud/cetus/ExpenseManager.js +88 -0
- package/dist/api/request/crud/cetus/ExpenseManager.js.map +1 -0
- package/dist/api/request/crud/cetus/IntermediaryManager.d.ts +38 -0
- package/dist/api/request/crud/cetus/IntermediaryManager.js +82 -0
- package/dist/api/request/crud/cetus/IntermediaryManager.js.map +1 -0
- package/dist/api/request/crud/cetus/ModificationManager.d.ts +44 -0
- package/dist/api/request/crud/cetus/ModificationManager.js +102 -0
- package/dist/api/request/crud/cetus/ModificationManager.js.map +1 -0
- package/dist/api/request/crud/cetus/NavManager.d.ts +45 -0
- package/dist/api/request/crud/cetus/NavManager.js +88 -0
- package/dist/api/request/crud/cetus/NavManager.js.map +1 -0
- package/dist/api/request/crud/cetus/OperationsManager.d.ts +58 -0
- package/dist/api/request/crud/cetus/OperationsManager.js +98 -0
- package/dist/api/request/crud/cetus/OperationsManager.js.map +1 -0
- package/dist/api/request/crud/cetus/PairsManager.d.ts +40 -0
- package/dist/api/request/crud/cetus/PairsManager.js +84 -0
- package/dist/api/request/crud/cetus/PairsManager.js.map +1 -0
- package/dist/api/request/crud/cetus/PnlManager.d.ts +45 -0
- package/dist/api/request/crud/cetus/PnlManager.js +86 -0
- package/dist/api/request/crud/cetus/PnlManager.js.map +1 -0
- package/dist/api/request/crud/cetus/RatesManager.d.ts +41 -0
- package/dist/api/request/crud/cetus/RatesManager.js +94 -0
- package/dist/api/request/crud/cetus/RatesManager.js.map +1 -0
- package/dist/api/request/crud/cetus/SourceManager.d.ts +35 -0
- package/dist/api/request/crud/cetus/SourceManager.js +84 -0
- package/dist/api/request/crud/cetus/SourceManager.js.map +1 -0
- package/dist/api/request/crud/cetus/StrategyManager.d.ts +42 -0
- package/dist/api/request/crud/cetus/StrategyManager.js +88 -0
- package/dist/api/request/crud/cetus/StrategyManager.js.map +1 -0
- package/dist/api/request/crud/cetus/StrategyOrderManager.d.ts +46 -0
- package/dist/api/request/crud/cetus/StrategyOrderManager.js +92 -0
- package/dist/api/request/crud/cetus/StrategyOrderManager.js.map +1 -0
- package/dist/api/request/crud/cetus/TransactionsManager.d.ts +52 -0
- package/dist/api/request/crud/cetus/TransactionsManager.js +96 -0
- package/dist/api/request/crud/cetus/TransactionsManager.js.map +1 -0
- package/dist/api/request/crud/common/ActivityHistoryManager.d.ts +40 -0
- package/dist/api/request/crud/common/ActivityHistoryManager.js +86 -0
- package/dist/api/request/crud/common/ActivityHistoryManager.js.map +1 -0
- package/dist/api/request/crud/common/AvailablePlatformManager.d.ts +37 -0
- package/dist/api/request/crud/common/AvailablePlatformManager.js +84 -0
- package/dist/api/request/crud/common/AvailablePlatformManager.js.map +1 -0
- package/dist/api/request/crud/common/ComponentManager.d.ts +53 -0
- package/dist/api/request/crud/common/ComponentManager.js +75 -0
- package/dist/api/request/crud/common/ComponentManager.js.map +1 -0
- package/dist/api/request/crud/common/KeyManager.d.ts +39 -0
- package/dist/api/request/crud/common/KeyManager.js +88 -0
- package/dist/api/request/crud/common/KeyManager.js.map +1 -0
- package/dist/api/request/crud/common/PlatformManager.d.ts +45 -0
- package/dist/api/request/crud/common/PlatformManager.js +79 -0
- package/dist/api/request/crud/common/PlatformManager.js.map +1 -0
- package/dist/api/request/crud/common/RoleManager.d.ts +52 -0
- package/dist/api/request/crud/common/RoleManager.js +72 -0
- package/dist/api/request/crud/common/RoleManager.js.map +1 -0
- package/dist/api/request/crud/common/StatusManager.d.ts +34 -0
- package/dist/api/request/crud/common/StatusManager.js +74 -0
- package/dist/api/request/crud/common/StatusManager.js.map +1 -0
- package/dist/api/request/crud/common/TypeManager.d.ts +33 -0
- package/dist/api/request/crud/common/TypeManager.js +76 -0
- package/dist/api/request/crud/common/TypeManager.js.map +1 -0
- package/dist/api/request/crud/common/UserCredentialsManager.d.ts +39 -0
- package/dist/api/request/crud/common/UserCredentialsManager.js +84 -0
- package/dist/api/request/crud/common/UserCredentialsManager.js.map +1 -0
- package/dist/api/request/crud/common/UserManager.d.ts +35 -0
- package/dist/api/request/crud/common/UserManager.js +80 -0
- package/dist/api/request/crud/common/UserManager.js.map +1 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +71 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from "axios";
|
|
2
|
+
import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
|
|
3
|
+
export interface IExpense {
|
|
4
|
+
expenseId?: number;
|
|
5
|
+
sourceId?: number;
|
|
6
|
+
typeId?: number;
|
|
7
|
+
date?: number;
|
|
8
|
+
fromDate?: number;
|
|
9
|
+
toDate?: number;
|
|
10
|
+
amount?: number;
|
|
11
|
+
reason?: string;
|
|
12
|
+
details?: any;
|
|
13
|
+
updatedAt?: string;
|
|
14
|
+
createdAt?: string;
|
|
15
|
+
config?: AxiosRequestConfig;
|
|
16
|
+
}
|
|
17
|
+
export interface IExpenseDetails {
|
|
18
|
+
sourceId?: number;
|
|
19
|
+
typeId?: number;
|
|
20
|
+
date?: number;
|
|
21
|
+
fromDate?: number;
|
|
22
|
+
toDate?: number;
|
|
23
|
+
amount?: number;
|
|
24
|
+
reason?: string;
|
|
25
|
+
details?: any;
|
|
26
|
+
values?: IExpense[];
|
|
27
|
+
limit?: number;
|
|
28
|
+
offset?: number;
|
|
29
|
+
config?: AxiosRequestConfig;
|
|
30
|
+
}
|
|
31
|
+
export declare class ExpenseManager extends CrudServiceManager<IExpenseDetails, IExpense> {
|
|
32
|
+
private url;
|
|
33
|
+
constructor(url: string);
|
|
34
|
+
find(details: IExpenseDetails): Promise<IExpense | undefined>;
|
|
35
|
+
count(details: IExpense): Promise<{
|
|
36
|
+
result: number;
|
|
37
|
+
}>;
|
|
38
|
+
findAll(details: IExpenseDetails): Promise<IExpense[] | undefined>;
|
|
39
|
+
private buildRequestUrl;
|
|
40
|
+
findById(id: StandardIdRequestDefinition): Promise<IExpense | undefined>;
|
|
41
|
+
create(details: IExpenseDetails): Promise<IExpense | undefined>;
|
|
42
|
+
createMany(details: IExpenseDetails): Promise<IExpense[] | undefined>;
|
|
43
|
+
modify(expense: IExpense): Promise<any>;
|
|
44
|
+
destroy(expense: IExpense): Promise<any>;
|
|
45
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ExpenseManager = void 0;
|
|
13
|
+
const CrudServiceManager_1 = require("../CrudServiceManager");
|
|
14
|
+
class ExpenseManager extends CrudServiceManager_1.CrudServiceManager {
|
|
15
|
+
constructor(url) {
|
|
16
|
+
super();
|
|
17
|
+
this.url = url;
|
|
18
|
+
}
|
|
19
|
+
find(details) {
|
|
20
|
+
return this.sendFinding(`${this.url}/expenses?sourceId=${details.sourceId}${details.date ? `&date=${details.date}` : ""}${details.typeId ? `&typeId=${details.typeId}` : ""}`, details.config);
|
|
21
|
+
}
|
|
22
|
+
count(details) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
var _a;
|
|
25
|
+
let url = this.buildRequestUrl(`${this.url}/expenses`, details);
|
|
26
|
+
return (_a = (yield this.sendCounting(url, details.config))) !== null && _a !== void 0 ? _a : { result: 0 };
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
findAll(details) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
var _a;
|
|
32
|
+
let expenses = [];
|
|
33
|
+
let url = this.buildRequestUrl(`${this.url}/expenses`, details);
|
|
34
|
+
if (details.limit) {
|
|
35
|
+
expenses = (_a = (yield this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${details.limit}&offset=${details.offset}`, details.config))) !== null && _a !== void 0 ? _a : [];
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
let limit = 5000, offset = 0, isEmpty = false;
|
|
39
|
+
do {
|
|
40
|
+
let values = yield this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${limit}&offset=${offset}`, details.config);
|
|
41
|
+
if (values)
|
|
42
|
+
expenses = expenses.concat(values);
|
|
43
|
+
isEmpty = values == undefined || values.length == 0;
|
|
44
|
+
offset += limit;
|
|
45
|
+
} while (!isEmpty);
|
|
46
|
+
}
|
|
47
|
+
return expenses;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
buildRequestUrl(url, details) {
|
|
51
|
+
let suffix = `${details.sourceId ? `&sourceId=${details.sourceId}` : ""}${details.date ? `&date=${details.date}` : ""}${details.typeId ? `&typeId=${details.typeId}` : ""}${details.fromDate ? `&fromDate=${details.fromDate}` : ""}${details.toDate ? `&toDate=${details.toDate}` : ""}`;
|
|
52
|
+
return `${url}?${suffix.substring(1)}`;
|
|
53
|
+
}
|
|
54
|
+
findById(id) {
|
|
55
|
+
return this.sendFinding(`${this.url}/expenses?id=${id.id}`, id.config);
|
|
56
|
+
}
|
|
57
|
+
create(details) {
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
return this.sendCreation(`${this.url}/expenses`, {
|
|
60
|
+
sourceId: details.sourceId,
|
|
61
|
+
typeId: details.typeId,
|
|
62
|
+
date: details.date,
|
|
63
|
+
amount: details.amount,
|
|
64
|
+
reason: details.reason,
|
|
65
|
+
details: details.details
|
|
66
|
+
}, details.config);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
createMany(details) {
|
|
70
|
+
var _a;
|
|
71
|
+
return this.sendCreationMany(`${this.url}/expenses`, (_a = details.values) !== null && _a !== void 0 ? _a : [], details.config);
|
|
72
|
+
}
|
|
73
|
+
modify(expense) {
|
|
74
|
+
return this.sendModification(`${this.url}/expenses/${expense.expenseId}`, {
|
|
75
|
+
sourceId: expense.sourceId,
|
|
76
|
+
typeId: expense.typeId,
|
|
77
|
+
date: expense.date,
|
|
78
|
+
amount: expense.amount,
|
|
79
|
+
reason: expense.reason,
|
|
80
|
+
details: expense.details
|
|
81
|
+
}, expense.config);
|
|
82
|
+
}
|
|
83
|
+
destroy(expense) {
|
|
84
|
+
return this.sendDestruction(`${this.url}/expenses/${expense.expenseId}`, expense.config);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.ExpenseManager = ExpenseManager;
|
|
88
|
+
//# sourceMappingURL=ExpenseManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpenseManager.js","sourceRoot":"","sources":["../../../../../src/api/request/crud/cetus/ExpenseManager.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,8DAAwF;AAgCxF,MAAa,cAAe,SAAQ,uCAA6C;IAG7E,YAAY,GAAW;QACnB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACnB,CAAC;IAEM,IAAI,CAAC,OAAwB;QAChC,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,GAAG,sBAAsB,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACnM,CAAC;IAEY,KAAK,CAAC,OAAiB;;;YAChC,IAAI,GAAG,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,GAAG,WAAW,EAAE,OAAO,CAAC,CAAC;YAChE,OAAO,MAAA,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,mCAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;QAC3E,CAAC;KAAA;IAEY,OAAO,CAAC,OAAwB;;;YACzC,IAAI,QAAQ,GAAe,EAAE,CAAC;YAC9B,IAAI,GAAG,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,GAAG,WAAW,EAAE,OAAO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AC,GAAG,IAAI,CAAC,GAAG,aAAa,OAAO,CAAC,SAAS,EAAE,EAAE;YACtE,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,OAAO,EAAE,OAAO,CAAC,OAAO;SAC3B,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAEM,OAAO,CAAC,OAAiB;QAC5B,OAAO,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,GAAG,aAAa,OAAO,CAAC,SAAS,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7F,CAAC;CACJ;AAzED,wCAyEC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
|
|
2
|
+
import { AxiosRequestConfig } from "axios";
|
|
3
|
+
export interface IIntermediary {
|
|
4
|
+
intermediaryId?: number;
|
|
5
|
+
name?: string;
|
|
6
|
+
typeId?: number;
|
|
7
|
+
details?: any;
|
|
8
|
+
updatedAt?: string;
|
|
9
|
+
createdAt?: string;
|
|
10
|
+
config?: AxiosRequestConfig;
|
|
11
|
+
}
|
|
12
|
+
export interface IIntermediaryDetails {
|
|
13
|
+
intermediaryId?: number;
|
|
14
|
+
name?: string;
|
|
15
|
+
typeId?: number | string;
|
|
16
|
+
details?: any;
|
|
17
|
+
values?: IIntermediary[];
|
|
18
|
+
updatedAt?: string;
|
|
19
|
+
createdAt?: string;
|
|
20
|
+
limit?: number;
|
|
21
|
+
offset?: number;
|
|
22
|
+
config?: AxiosRequestConfig;
|
|
23
|
+
}
|
|
24
|
+
export declare class IntermediaryManager extends CrudServiceManager<IIntermediaryDetails, IIntermediary> {
|
|
25
|
+
private url;
|
|
26
|
+
constructor(url: string);
|
|
27
|
+
find(details: IIntermediaryDetails): Promise<IIntermediary | undefined>;
|
|
28
|
+
count(details: IIntermediaryDetails): Promise<{
|
|
29
|
+
result: number;
|
|
30
|
+
}>;
|
|
31
|
+
findAll(details: IIntermediaryDetails): Promise<IIntermediary[] | undefined>;
|
|
32
|
+
private buildRequestUrl;
|
|
33
|
+
findById(id: StandardIdRequestDefinition): Promise<IIntermediary | undefined>;
|
|
34
|
+
create(details: IIntermediaryDetails): Promise<IIntermediary | undefined>;
|
|
35
|
+
createMany(details: IIntermediaryDetails): Promise<IIntermediary[] | undefined>;
|
|
36
|
+
modify(intermediary: IIntermediary): Promise<any>;
|
|
37
|
+
destroy(intermediary: IIntermediary): Promise<any>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.IntermediaryManager = void 0;
|
|
13
|
+
const CrudServiceManager_1 = require("../CrudServiceManager");
|
|
14
|
+
class IntermediaryManager extends CrudServiceManager_1.CrudServiceManager {
|
|
15
|
+
constructor(url) {
|
|
16
|
+
super();
|
|
17
|
+
this.url = url;
|
|
18
|
+
}
|
|
19
|
+
find(details) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
return this.sendFinding(`${this.url}/intermediaries?name=${details.name}`, details.config);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
count(details) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
var _a;
|
|
27
|
+
let url = this.buildRequestUrl(`${this.url}/intermediaries`, details);
|
|
28
|
+
return (_a = (yield this.sendCounting(url, details.config))) !== null && _a !== void 0 ? _a : { result: 0 };
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
findAll(details) {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
var _a;
|
|
34
|
+
let intermediaries = [];
|
|
35
|
+
let url = this.buildRequestUrl(`${this.url}/intermediaries`, details);
|
|
36
|
+
if (details.limit) {
|
|
37
|
+
intermediaries = (_a = (yield this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${details.limit}&offset=${details.offset}`, details.config))) !== null && _a !== void 0 ? _a : [];
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
let limit = 5000, offset = 0, isEmpty = false;
|
|
41
|
+
do {
|
|
42
|
+
let values = yield this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${limit}&offset=${offset}`, details.config);
|
|
43
|
+
if (values)
|
|
44
|
+
intermediaries = intermediaries.concat(values);
|
|
45
|
+
isEmpty = values == undefined || values.length == 0;
|
|
46
|
+
offset += limit;
|
|
47
|
+
} while (!isEmpty);
|
|
48
|
+
}
|
|
49
|
+
return intermediaries;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
buildRequestUrl(url, details) {
|
|
53
|
+
let suffix = `${details.typeId ? `&typeId=${details.typeId}` : ""}${details.name ? `&name=${details.name}` : ""}`;
|
|
54
|
+
return `${url}?${suffix.substring(1)}`;
|
|
55
|
+
}
|
|
56
|
+
findById(id) {
|
|
57
|
+
return this.sendFinding(`${this.url}/intermediaries?id=${id.id}&credentials=true`, id.config);
|
|
58
|
+
}
|
|
59
|
+
create(details) {
|
|
60
|
+
return this.sendCreation(`${this.url}/intermediaries`, {
|
|
61
|
+
name: details.name,
|
|
62
|
+
typeId: details.typeId,
|
|
63
|
+
details: details.details
|
|
64
|
+
}, details.config);
|
|
65
|
+
}
|
|
66
|
+
createMany(details) {
|
|
67
|
+
var _a;
|
|
68
|
+
return this.sendCreationMany(`${this.url}/intermediaries`, (_a = details.values) !== null && _a !== void 0 ? _a : [], details.config);
|
|
69
|
+
}
|
|
70
|
+
modify(intermediary) {
|
|
71
|
+
return this.sendModification(`${this.url}/intermediaries/${intermediary.intermediaryId}`, {
|
|
72
|
+
name: intermediary.name,
|
|
73
|
+
typeId: intermediary.typeId,
|
|
74
|
+
details: intermediary.details
|
|
75
|
+
}, intermediary.config);
|
|
76
|
+
}
|
|
77
|
+
destroy(intermediary) {
|
|
78
|
+
return this.sendDestruction(`${this.url}/intermediaries/${intermediary.intermediaryId}`, intermediary.config);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.IntermediaryManager = IntermediaryManager;
|
|
82
|
+
//# sourceMappingURL=IntermediaryManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IntermediaryManager.js","sourceRoot":"","sources":["../../../../../src/api/request/crud/cetus/IntermediaryManager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8DAAwF;AA0BxF,MAAa,mBAAoB,SAAQ,uCAAuD;IAG5F,YAAY,GAAW;QACnB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACnB,CAAC;IAEY,IAAI,CAAC,OAA6B;;YAC3C,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,GAAG,wBAAwB,OAAO,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAC/F,CAAC;KAAA;IAEY,KAAK,CAAC,OAA6B;;;YAC5C,IAAI,GAAG,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,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,EAAE;YACtF,IAAI,EAAE,YAAY,CAAC,IAAI;YACvB,MAAM,EAAE,YAAY,CAAC,MAAM;YAC3B,OAAO,EAAE,YAAY,CAAC,OAAO;SAChC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAEM,OAAO,CAAC,YAA2B;QACtC,OAAO,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,GAAG,mBAAmB,YAAY,CAAC,cAAc,EAAE,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAClH,CAAC;CACJ;AAnED,kDAmEC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from "axios";
|
|
2
|
+
import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
|
|
3
|
+
export interface IModification {
|
|
4
|
+
modificationId?: number;
|
|
5
|
+
sourceId?: number;
|
|
6
|
+
typeId?: number;
|
|
7
|
+
fromDate?: number;
|
|
8
|
+
toDate?: number;
|
|
9
|
+
value?: number;
|
|
10
|
+
details?: any;
|
|
11
|
+
updatedAt?: string;
|
|
12
|
+
createdAt?: string;
|
|
13
|
+
config?: AxiosRequestConfig;
|
|
14
|
+
}
|
|
15
|
+
export interface IModificationDetails {
|
|
16
|
+
sourceId?: number;
|
|
17
|
+
typeId?: number;
|
|
18
|
+
type?: string;
|
|
19
|
+
fromDate?: number;
|
|
20
|
+
toDate?: number;
|
|
21
|
+
value?: number;
|
|
22
|
+
details?: any;
|
|
23
|
+
values?: IModification[];
|
|
24
|
+
limit?: number;
|
|
25
|
+
offset?: number;
|
|
26
|
+
config?: AxiosRequestConfig;
|
|
27
|
+
}
|
|
28
|
+
export declare class ModificationManager extends CrudServiceManager<IModificationDetails, IModification> {
|
|
29
|
+
private typeManager;
|
|
30
|
+
private url;
|
|
31
|
+
constructor(url: string);
|
|
32
|
+
find(details: IModificationDetails): Promise<IModification | undefined>;
|
|
33
|
+
private findTypeAndInclude;
|
|
34
|
+
count(details: IModification): Promise<{
|
|
35
|
+
result: number;
|
|
36
|
+
}>;
|
|
37
|
+
findAll(details: IModificationDetails): Promise<IModification[] | undefined>;
|
|
38
|
+
private buildRequestUrl;
|
|
39
|
+
findById(id: StandardIdRequestDefinition): Promise<IModification | undefined>;
|
|
40
|
+
create(details: IModificationDetails): Promise<IModification | undefined>;
|
|
41
|
+
createMany(details: IModificationDetails): Promise<IModification[] | undefined>;
|
|
42
|
+
modify(modification: IModification): Promise<any>;
|
|
43
|
+
destroy(modification: IModification): Promise<any>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ModificationManager = void 0;
|
|
13
|
+
const CrudServiceManager_1 = require("../CrudServiceManager");
|
|
14
|
+
const TypeManager_1 = require("../common/TypeManager");
|
|
15
|
+
class ModificationManager extends CrudServiceManager_1.CrudServiceManager {
|
|
16
|
+
constructor(url) {
|
|
17
|
+
super();
|
|
18
|
+
this.url = url;
|
|
19
|
+
this.typeManager = new TypeManager_1.TypeManager(url);
|
|
20
|
+
}
|
|
21
|
+
find(details) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
yield this.findTypeAndInclude(details);
|
|
24
|
+
return this.sendFinding(`${this.url}/modifications?sourceId=${details.sourceId}${details.typeId ? `&typeId=${details.typeId}` : ""}`, details.config);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
findTypeAndInclude(details) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
var _a;
|
|
30
|
+
if (details.type)
|
|
31
|
+
details.typeId = (_a = (yield this.typeManager.find({ type: details.type, config: details.config }))) === null || _a === void 0 ? void 0 : _a.typeId;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
count(details) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
var _a;
|
|
37
|
+
let url = this.buildRequestUrl(`${this.url}/modifications`, details);
|
|
38
|
+
return (_a = (yield this.sendCounting(url, details.config))) !== null && _a !== void 0 ? _a : { result: 0 };
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
findAll(details) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
var _a;
|
|
44
|
+
let modifications = [];
|
|
45
|
+
yield this.findTypeAndInclude(details);
|
|
46
|
+
let url = this.buildRequestUrl(`${this.url}/modifications`, details);
|
|
47
|
+
if (details.limit) {
|
|
48
|
+
modifications = (_a = (yield this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${details.limit}&offset=${details.offset}`, details.config))) !== null && _a !== void 0 ? _a : [];
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
let limit = 5000, offset = 0, isEmpty = false;
|
|
52
|
+
do {
|
|
53
|
+
let values = yield this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${limit}&offset=${offset}`, details.config);
|
|
54
|
+
if (values)
|
|
55
|
+
modifications = modifications.concat(values);
|
|
56
|
+
isEmpty = values == undefined || values.length == 0;
|
|
57
|
+
offset += limit;
|
|
58
|
+
} while (!isEmpty);
|
|
59
|
+
}
|
|
60
|
+
return modifications;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
buildRequestUrl(url, details) {
|
|
64
|
+
let suffix = `${details.sourceId ? `&sourceId=${details.sourceId}` : ""}${details.typeId ? `&typeId=${details.typeId}` : ""}${details.fromDate ? `&fromDate=${details.fromDate}` : ""}${details.toDate ? `&toDate=${details.toDate}` : ""}`;
|
|
65
|
+
return `${url}?${suffix.substring(1)}`;
|
|
66
|
+
}
|
|
67
|
+
findById(id) {
|
|
68
|
+
return this.sendFinding(`${this.url}/modifications?id=${id.id}`, id.config);
|
|
69
|
+
}
|
|
70
|
+
create(details) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
yield this.findTypeAndInclude(details);
|
|
73
|
+
return this.sendCreation(`${this.url}/modifications`, {
|
|
74
|
+
sourceId: details.sourceId,
|
|
75
|
+
typeId: details.typeId,
|
|
76
|
+
fromDate: details.fromDate,
|
|
77
|
+
toDate: details.toDate,
|
|
78
|
+
value: details.value,
|
|
79
|
+
details: details.details
|
|
80
|
+
}, details.config);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
createMany(details) {
|
|
84
|
+
var _a;
|
|
85
|
+
return this.sendCreationMany(`${this.url}/modifications`, (_a = details.values) !== null && _a !== void 0 ? _a : [], details.config);
|
|
86
|
+
}
|
|
87
|
+
modify(modification) {
|
|
88
|
+
return this.sendModification(`${this.url}/modifications/${modification.modificationId}`, {
|
|
89
|
+
sourceId: modification.sourceId,
|
|
90
|
+
typeId: modification.typeId,
|
|
91
|
+
fromDate: modification.fromDate,
|
|
92
|
+
toDate: modification.toDate,
|
|
93
|
+
value: modification.value,
|
|
94
|
+
details: modification.details
|
|
95
|
+
}, modification.config);
|
|
96
|
+
}
|
|
97
|
+
destroy(modification) {
|
|
98
|
+
return this.sendDestruction(`${this.url}/modifications/${modification.modificationId}`, modification.config);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
exports.ModificationManager = ModificationManager;
|
|
102
|
+
//# sourceMappingURL=ModificationManager.js.map
|
|
@@ -0,0 +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,CAAC,GAAG,IAAI,CAAC,GAAG,gBAAgB,EAAE,MAAA,OAAO,CAAC,MAAM,mCAAI,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACpG,CAAC;IAEM,MAAM,CAAC,YAA2B;QACrC,OAAO,IAAI,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,GAAG,kBAAkB,YAAY,CAAC,cAAc,EAAE,EAAE;YACrF,QAAQ,EAAE,YAAY,CAAC,QAAQ;YAC/B,MAAM,EAAE,YAAY,CAAC,MAAM;YAC3B,QAAQ,EAAE,YAAY,CAAC,QAAQ;YAC/B,MAAM,EAAE,YAAY,CAAC,MAAM;YAC3B,KAAK,EAAE,YAAY,CAAC,KAAK;YACzB,OAAO,EAAE,YAAY,CAAC,OAAO;SAChC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAEM,OAAO,CAAC,YAA2B;QACtC,OAAO,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,GAAG,kBAAkB,YAAY,CAAC,cAAc,EAAE,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACjH,CAAC;CACJ;AAnFD,kDAmFC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from "axios";
|
|
2
|
+
import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
|
|
3
|
+
export interface INav {
|
|
4
|
+
navId?: number;
|
|
5
|
+
sourceId?: number;
|
|
6
|
+
typeId?: number;
|
|
7
|
+
date?: number;
|
|
8
|
+
value?: number;
|
|
9
|
+
profitability?: number;
|
|
10
|
+
details?: any;
|
|
11
|
+
fromDate?: number;
|
|
12
|
+
toDate?: number;
|
|
13
|
+
updatedAt?: string;
|
|
14
|
+
createdAt?: string;
|
|
15
|
+
config?: AxiosRequestConfig;
|
|
16
|
+
}
|
|
17
|
+
export interface INavDetails {
|
|
18
|
+
sourceId?: number;
|
|
19
|
+
typeId?: number;
|
|
20
|
+
date?: number;
|
|
21
|
+
value?: number;
|
|
22
|
+
profitability?: number;
|
|
23
|
+
details?: any;
|
|
24
|
+
values?: INav[];
|
|
25
|
+
fromDate?: number;
|
|
26
|
+
toDate?: number;
|
|
27
|
+
limit?: number;
|
|
28
|
+
offset?: number;
|
|
29
|
+
config?: AxiosRequestConfig;
|
|
30
|
+
}
|
|
31
|
+
export declare class NavManager extends CrudServiceManager<INavDetails, INav> {
|
|
32
|
+
private url;
|
|
33
|
+
constructor(url: string);
|
|
34
|
+
find(details: INavDetails): Promise<INav | undefined>;
|
|
35
|
+
count(details: INav): Promise<{
|
|
36
|
+
result: number;
|
|
37
|
+
}>;
|
|
38
|
+
findAll(details: INavDetails): Promise<INav[] | undefined>;
|
|
39
|
+
private buildRequestUrl;
|
|
40
|
+
findById(id: StandardIdRequestDefinition): Promise<INav | undefined>;
|
|
41
|
+
create(details: INavDetails): Promise<INav | undefined>;
|
|
42
|
+
createMany(details: INavDetails): Promise<INav[] | undefined>;
|
|
43
|
+
modify(nav: INav): Promise<any>;
|
|
44
|
+
destroy(nav: INav): Promise<any>;
|
|
45
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.NavManager = void 0;
|
|
13
|
+
const CrudServiceManager_1 = require("../CrudServiceManager");
|
|
14
|
+
class NavManager extends CrudServiceManager_1.CrudServiceManager {
|
|
15
|
+
constructor(url) {
|
|
16
|
+
super();
|
|
17
|
+
this.url = url;
|
|
18
|
+
}
|
|
19
|
+
find(details) {
|
|
20
|
+
return this.sendFinding(`${this.url}/navs?sourceId=${details.sourceId}${details.typeId ? `&typeId=${details.typeId}` : ""}${details.date ? `&date=${details.date}` : ""}${details.profitability ? `&profitability=${details.profitability}` : ""}`, details.config);
|
|
21
|
+
}
|
|
22
|
+
count(details) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
var _a;
|
|
25
|
+
let url = this.buildRequestUrl(`${this.url}/navs`, details);
|
|
26
|
+
return (_a = (yield this.sendCounting(url, details.config))) !== null && _a !== void 0 ? _a : { result: 0 };
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
findAll(details) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
var _a;
|
|
32
|
+
let navs = [];
|
|
33
|
+
let url = this.buildRequestUrl(`${this.url}/navs`, details);
|
|
34
|
+
if (details.limit) {
|
|
35
|
+
navs = (_a = (yield this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${details.limit}&offset=${details.offset}`, details.config))) !== null && _a !== void 0 ? _a : [];
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
let limit = 5000, offset = 0, isEmpty = false;
|
|
39
|
+
do {
|
|
40
|
+
let values = yield this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${limit}&offset=${offset}`, details.config);
|
|
41
|
+
if (values)
|
|
42
|
+
navs = navs.concat(values);
|
|
43
|
+
isEmpty = values == undefined || values.length == 0;
|
|
44
|
+
offset += limit;
|
|
45
|
+
} while (!isEmpty);
|
|
46
|
+
}
|
|
47
|
+
return navs;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
buildRequestUrl(url, details) {
|
|
51
|
+
let suffix = `${details.sourceId ? `&sourceId=${details.sourceId}` : ""}${details.typeId ? `&typeId=${details.typeId}` : ""}${details.date ? `&date=${details.date}` : ""}${details.profitability ? `&profitability=${details.profitability}` : ""}${details.fromDate ? `&fromDate=${details.fromDate}` : ""}${details.toDate ? `&toDate=${details.toDate}` : ""}`;
|
|
52
|
+
return `${url}?${suffix.substring(1)}`;
|
|
53
|
+
}
|
|
54
|
+
findById(id) {
|
|
55
|
+
return this.sendFinding(`${this.url}/navs?id=${id.id}`, id.config);
|
|
56
|
+
}
|
|
57
|
+
create(details) {
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
return this.sendCreation(`${this.url}/navs`, {
|
|
60
|
+
sourceId: details.sourceId,
|
|
61
|
+
typeId: details.typeId,
|
|
62
|
+
date: details.date,
|
|
63
|
+
profitability: details.profitability,
|
|
64
|
+
value: details.value,
|
|
65
|
+
details: details.details
|
|
66
|
+
}, details.config);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
createMany(details) {
|
|
70
|
+
var _a;
|
|
71
|
+
return this.sendCreationMany(`${this.url}/navs`, (_a = details.values) !== null && _a !== void 0 ? _a : [], details.config);
|
|
72
|
+
}
|
|
73
|
+
modify(nav) {
|
|
74
|
+
return this.sendModification(`${this.url}/navs/${nav.navId}`, {
|
|
75
|
+
sourceId: nav.sourceId,
|
|
76
|
+
typeId: nav.typeId,
|
|
77
|
+
date: nav.date,
|
|
78
|
+
profitability: nav.profitability,
|
|
79
|
+
value: nav.value,
|
|
80
|
+
details: nav.details
|
|
81
|
+
}, nav.config);
|
|
82
|
+
}
|
|
83
|
+
destroy(nav) {
|
|
84
|
+
return this.sendDestruction(`${this.url}/navs/${nav.navId}`, nav.config);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.NavManager = NavManager;
|
|
88
|
+
//# sourceMappingURL=NavManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavManager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CAAC,GAAG,SAAS,GAAG,CAAC,KAAK,EAAE,EAAE;YAC1D,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,aAAa,EAAE,GAAG,CAAC,aAAa;YAChC,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,OAAO,EAAE,GAAG,CAAC,OAAO;SACvB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC;IAEM,OAAO,CAAC,GAAS;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,GAAG,SAAS,GAAG,CAAC,KAAK,EAAE,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7E,CAAC;CACJ;AAzED,gCAyEC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
|
|
2
|
+
import { AxiosRequestConfig } from "axios";
|
|
3
|
+
export interface IOperations {
|
|
4
|
+
operationId?: number;
|
|
5
|
+
parentId?: number;
|
|
6
|
+
mainAssetId?: number;
|
|
7
|
+
quoteAssetId?: number;
|
|
8
|
+
intermediaryId?: number;
|
|
9
|
+
sourceId?: number;
|
|
10
|
+
quantity?: number;
|
|
11
|
+
quoteQuantity?: number;
|
|
12
|
+
price?: number;
|
|
13
|
+
side?: string;
|
|
14
|
+
date?: number;
|
|
15
|
+
fromDate?: number;
|
|
16
|
+
toDate?: number;
|
|
17
|
+
details?: any;
|
|
18
|
+
updatedAt?: string;
|
|
19
|
+
createdAt?: string;
|
|
20
|
+
config?: AxiosRequestConfig;
|
|
21
|
+
}
|
|
22
|
+
export interface IOperationsDetails {
|
|
23
|
+
operationId?: number;
|
|
24
|
+
parentId?: number | string;
|
|
25
|
+
mainAssetId?: number | string;
|
|
26
|
+
quoteAssetId?: number | string;
|
|
27
|
+
intermediaryId?: number | string;
|
|
28
|
+
sourceId?: number;
|
|
29
|
+
quantity?: number;
|
|
30
|
+
quoteQuantity?: number;
|
|
31
|
+
price?: number;
|
|
32
|
+
side?: string;
|
|
33
|
+
date?: number;
|
|
34
|
+
fromDate?: number;
|
|
35
|
+
toDate?: number;
|
|
36
|
+
details?: any;
|
|
37
|
+
values?: IOperations[];
|
|
38
|
+
updatedAt?: string;
|
|
39
|
+
createdAt?: string;
|
|
40
|
+
limit?: number;
|
|
41
|
+
offset?: number;
|
|
42
|
+
config?: AxiosRequestConfig;
|
|
43
|
+
}
|
|
44
|
+
export declare class OperationsManager extends CrudServiceManager<IOperationsDetails, IOperations> {
|
|
45
|
+
private url;
|
|
46
|
+
constructor(url: string);
|
|
47
|
+
find(details: IOperationsDetails): Promise<IOperations | undefined>;
|
|
48
|
+
count(details: IOperations): Promise<{
|
|
49
|
+
result: number;
|
|
50
|
+
}>;
|
|
51
|
+
findAll(details: IOperationsDetails): Promise<IOperations[] | undefined>;
|
|
52
|
+
private buildRequestUrl;
|
|
53
|
+
findById(id: StandardIdRequestDefinition): Promise<IOperations | undefined>;
|
|
54
|
+
create(details: IOperationsDetails): Promise<IOperations | undefined>;
|
|
55
|
+
createMany(details: IOperationsDetails): Promise<IOperations[] | undefined>;
|
|
56
|
+
modify(operation: IOperations): Promise<any>;
|
|
57
|
+
destroy(operation: IOperations): Promise<any>;
|
|
58
|
+
}
|