cetus-tools 1.0.7 → 1.0.9
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/tools/BitsoBalance.js +3 -4
- package/dist/api/bitso/tools/BitsoBalance.js.map +1 -1
- package/dist/api/bitso/tools/BitsoBook.js +5 -6
- package/dist/api/bitso/tools/BitsoBook.js.map +1 -1
- package/dist/api/bitso/tools/BitsoOrder.js +2 -3
- package/dist/api/bitso/tools/BitsoOrder.js.map +1 -1
- package/dist/api/bitso/tools/BitsoOrderBook.js +2 -3
- package/dist/api/bitso/tools/BitsoOrderBook.js.map +1 -1
- package/dist/api/bitso/tools/BitsoTrade.js +4 -5
- package/dist/api/bitso/tools/BitsoTrade.js.map +1 -1
- package/dist/api/checkers/ServiceSessionChecker.d.ts +28 -0
- package/dist/api/checkers/ServiceSessionChecker.js +105 -0
- package/dist/api/checkers/ServiceSessionChecker.js.map +1 -0
- package/dist/crud/AvailablePlatformManager.d.ts +18 -0
- package/dist/crud/AvailablePlatformManager.js +3 -0
- package/dist/crud/AvailablePlatformManager.js.map +1 -0
- package/dist/crud/PlatformManager.d.ts +26 -0
- package/dist/crud/{ChatPlatformManager.js → PlatformManager.js} +24 -13
- package/dist/crud/PlatformManager.js.map +1 -0
- package/dist/crud/RoleManager.d.ts +18 -3
- package/dist/crud/RoleManager.js +22 -0
- package/dist/crud/RoleManager.js.map +1 -1
- package/dist/crud/StatusManager.d.ts +26 -0
- package/dist/crud/StatusManager.js +51 -0
- package/dist/crud/StatusManager.js.map +1 -0
- package/dist/crud/TypeManager.d.ts +25 -0
- package/dist/crud/TypeManager.js +53 -0
- package/dist/crud/TypeManager.js.map +1 -0
- package/dist/crud/UserCredentialsManager.d.ts +20 -0
- package/dist/crud/UserCredentialsManager.js +3 -0
- package/dist/crud/UserCredentialsManager.js.map +1 -0
- package/dist/crud/UserManager.d.ts +15 -0
- package/dist/crud/UserManager.js +3 -0
- package/dist/crud/UserManager.js.map +1 -0
- package/dist/crud/test/LoginServiceMock.js +1 -2
- package/dist/crud/test/LoginServiceMock.js.map +1 -1
- package/dist/crud/test/PlatformMocks.d.ts +2 -0
- package/dist/crud/test/PlatformMocks.js +58 -0
- package/dist/crud/test/PlatformMocks.js.map +1 -0
- package/dist/crud/test/RoleMocks.js +1 -2
- package/dist/crud/test/RoleMocks.js.map +1 -1
- package/dist/crud/test/StatusMocks.d.ts +2 -0
- package/dist/crud/test/StatusMocks.js +45 -0
- package/dist/crud/test/StatusMocks.js.map +1 -0
- package/dist/crud/test/TypeMocks.d.ts +2 -0
- package/dist/crud/test/TypeMocks.js +45 -0
- package/dist/crud/test/TypeMocks.js.map +1 -0
- package/dist/index.d.ts +12 -4
- package/dist/index.js +17 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/crud/ChatPlatformManager.d.ts +0 -22
- package/dist/crud/ChatPlatformManager.js.map +0 -1
- package/dist/crud/KeyTypeManager.d.ts +0 -22
- package/dist/crud/KeyTypeManager.js +0 -38
- package/dist/crud/KeyTypeManager.js.map +0 -1
- package/dist/crud/test/KeyTypeMocks.d.ts +0 -2
- package/dist/crud/test/KeyTypeMocks.js +0 -46
- package/dist/crud/test/KeyTypeMocks.js.map +0 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from "axios";
|
|
2
|
+
import { CrudServiceManager, StandardIdRequestDefinition } from "itrm-tools";
|
|
3
|
+
export interface IType {
|
|
4
|
+
typeId?: number;
|
|
5
|
+
type: string;
|
|
6
|
+
details: any;
|
|
7
|
+
updatedAt?: string;
|
|
8
|
+
createdAt?: string;
|
|
9
|
+
config?: AxiosRequestConfig;
|
|
10
|
+
}
|
|
11
|
+
export interface ITypeDetails {
|
|
12
|
+
type: string;
|
|
13
|
+
details?: any;
|
|
14
|
+
config?: AxiosRequestConfig;
|
|
15
|
+
}
|
|
16
|
+
export declare class TypeManager extends CrudServiceManager<ITypeDetails, IType> {
|
|
17
|
+
private url;
|
|
18
|
+
constructor(url: string);
|
|
19
|
+
find(details: ITypeDetails): Promise<IType | undefined>;
|
|
20
|
+
findAll(details: ITypeDetails): Promise<IType[] | undefined>;
|
|
21
|
+
findById(id: StandardIdRequestDefinition): Promise<IType | undefined>;
|
|
22
|
+
create(details: ITypeDetails): Promise<IType | undefined>;
|
|
23
|
+
modify(type: IType): Promise<any>;
|
|
24
|
+
destroy(type: IType): Promise<any>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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.TypeManager = void 0;
|
|
13
|
+
const itrm_tools_1 = require("itrm-tools");
|
|
14
|
+
class TypeManager extends itrm_tools_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}/types?type=${details.type}`, details.config);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
findAll(details) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
let types = [], limit = 100, offset = 0, isEmpty = false;
|
|
27
|
+
do {
|
|
28
|
+
let values = yield this.sendAllFinding(`${this.url}/types?limit=${limit}&offset=${offset}`, details.config);
|
|
29
|
+
if (values)
|
|
30
|
+
types = types.concat(values);
|
|
31
|
+
isEmpty = values != undefined && values.length > 0;
|
|
32
|
+
offset += limit;
|
|
33
|
+
} while (!isEmpty);
|
|
34
|
+
return types;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
findById(id) {
|
|
38
|
+
return this.sendFinding(`${this.url}/types?id=${id.id}`, id.config);
|
|
39
|
+
}
|
|
40
|
+
create(details) {
|
|
41
|
+
var _a;
|
|
42
|
+
return this.sendCreation(`${this.url}/types`, { type: details.type, details: (_a = details.details) !== null && _a !== void 0 ? _a : {} }, details.config);
|
|
43
|
+
}
|
|
44
|
+
modify(type) {
|
|
45
|
+
var _a;
|
|
46
|
+
return this.sendModification(`${this.url}/types/${type.typeId}`, { type: type.type, details: (_a = type.details) !== null && _a !== void 0 ? _a : {} }, type.config);
|
|
47
|
+
}
|
|
48
|
+
destroy(type) {
|
|
49
|
+
return this.sendDestuction(`${this.url}/types/${type.typeId}`, type.config);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.TypeManager = TypeManager;
|
|
53
|
+
//# sourceMappingURL=TypeManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeManager.js","sourceRoot":"","sources":["../../src/crud/TypeManager.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,2CAA6E;AAiB7E,MAAa,WAAY,SAAQ,+BAAuC;IAGpE,YAAY,GAAW;QACnB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACnB,CAAC;IAEY,IAAI,CAAC,OAAqB;;YACnC,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,GAAG,eAAe,OAAO,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACtF,CAAC;KAAA;IAEY,OAAO,CAAC,OAAqB;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,OAAO,CAAC,IAAW;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,GAAG,UAAU,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAChF,CAAC;CACJ;AAvCD,kCAuCC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from "axios";
|
|
2
|
+
export interface IUserCredentials {
|
|
3
|
+
userCredentialId?: number;
|
|
4
|
+
userName: string;
|
|
5
|
+
password: string;
|
|
6
|
+
email: string;
|
|
7
|
+
metadata: any;
|
|
8
|
+
updatedAt?: string;
|
|
9
|
+
createdAt?: string;
|
|
10
|
+
config?: AxiosRequestConfig;
|
|
11
|
+
}
|
|
12
|
+
export interface IUserCredentialsDetails {
|
|
13
|
+
userCredentialId?: number;
|
|
14
|
+
userName?: string;
|
|
15
|
+
password?: string;
|
|
16
|
+
email?: string;
|
|
17
|
+
metadata?: any;
|
|
18
|
+
credentialsId?: number;
|
|
19
|
+
config?: AxiosRequestConfig;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserCredentialsManager.js","sourceRoot":"","sources":["../../src/crud/UserCredentialsManager.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from "axios";
|
|
2
|
+
export interface IUser {
|
|
3
|
+
userId?: number;
|
|
4
|
+
statusId: number;
|
|
5
|
+
credentialsId: number;
|
|
6
|
+
updatedAt?: string;
|
|
7
|
+
createdAt?: string;
|
|
8
|
+
config?: AxiosRequestConfig;
|
|
9
|
+
}
|
|
10
|
+
export interface IUserDetails {
|
|
11
|
+
userId?: number;
|
|
12
|
+
statusId?: number;
|
|
13
|
+
credentialsId?: number;
|
|
14
|
+
config?: AxiosRequestConfig;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserManager.js","sourceRoot":"","sources":["../../src/crud/UserManager.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.applyLoginMocks =
|
|
3
|
+
exports.applyLoginMocks = applyLoginMocks;
|
|
4
4
|
var users = {};
|
|
5
5
|
var credentials = {};
|
|
6
6
|
function applyLoginMocks(mock) {
|
|
@@ -49,5 +49,4 @@ function applyLoginMocks(mock) {
|
|
|
49
49
|
});
|
|
50
50
|
//http://localhost:8102/v1/userCredentials?email=user1@mail.test
|
|
51
51
|
}
|
|
52
|
-
exports.applyLoginMocks = applyLoginMocks;
|
|
53
52
|
//# sourceMappingURL=LoginServiceMock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoginServiceMock.js","sourceRoot":"","sources":["../../../src/crud/test/LoginServiceMock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LoginServiceMock.js","sourceRoot":"","sources":["../../../src/crud/test/LoginServiceMock.ts"],"names":[],"mappings":";;AAKA,0CA+CC;AAlDD,IAAI,KAAK,GAAQ,EAAE,CAAC;AACpB,IAAI,WAAW,GAAQ,EAAE,CAAC;AAE1B,SAAgB,eAAe,CAAC,IAAiB;IAC/C,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,MAAW,EAAE,EAAE;QAC9C,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,IAAI,GAAG;YACT,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC;YACrC,MAAM,EAAE,CAAC;YACT,QAAQ,EAAE,EAAE;SACb,CAAC;QACF,IAAI,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QACl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AAC,CAAC,CAAC,CAAC;QAClD,KAAK,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;YACtC,IAAI,WAAW,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK,aAAa;gBAC1C,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QACjD,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IACH,gEAAgE;AAClE,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyPlatformMocks = applyPlatformMocks;
|
|
4
|
+
var platforms = {};
|
|
5
|
+
function applyPlatformMocks(mock) {
|
|
6
|
+
mock.onGet(/\/platforms\?id=[a-zA-Z0-9]+/).reply((config) => {
|
|
7
|
+
let searchedId = config.url ? config.url.split("id=")[1] : "";
|
|
8
|
+
if (platforms[searchedId])
|
|
9
|
+
return [200, { result: [platforms[searchedId]] }];
|
|
10
|
+
return [200, { result: [] }];
|
|
11
|
+
});
|
|
12
|
+
mock.onGet(/\/platforms\?name=[a-zA-Z0-9]+/).reply((config) => {
|
|
13
|
+
let searchedplatforms = config.url ? config.url.split("name=")[1] : "";
|
|
14
|
+
for (let key of Object.keys(platforms))
|
|
15
|
+
if (platforms[key].name === searchedplatforms)
|
|
16
|
+
return [200, { result: [platforms[key]] }];
|
|
17
|
+
return [200, { result: [] }];
|
|
18
|
+
});
|
|
19
|
+
mock.onPost(/\/platforms/).reply((config) => {
|
|
20
|
+
let data = JSON.parse(config.data);
|
|
21
|
+
for (let key of Object.keys(platforms))
|
|
22
|
+
if (platforms[key].name === data.name)
|
|
23
|
+
return [
|
|
24
|
+
400,
|
|
25
|
+
{
|
|
26
|
+
status: "Error",
|
|
27
|
+
type: "SequelizeUniqueConstraintError",
|
|
28
|
+
error: "Validation error",
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
let item = {
|
|
32
|
+
platformId: Object.keys(platforms).length + 1,
|
|
33
|
+
name: data.name,
|
|
34
|
+
details: data.details,
|
|
35
|
+
};
|
|
36
|
+
platforms["" + item.platformId] = item;
|
|
37
|
+
return [200, { items: [platforms["" + item.platformId]] }];
|
|
38
|
+
});
|
|
39
|
+
mock.onPut(/\/platforms\/[0-9]+/).reply((config) => {
|
|
40
|
+
let platformId = config.url ? config.url.split("platforms/")[1] : "";
|
|
41
|
+
if (platforms[platformId]) {
|
|
42
|
+
let data = JSON.parse(config.data);
|
|
43
|
+
platforms[platformId] = Object.assign(Object.assign({}, platforms[platformId]), data);
|
|
44
|
+
return [200, { status: "Ok", message: "1 items were updated" }];
|
|
45
|
+
}
|
|
46
|
+
return [200, { status: "Ok", message: "0 items were updated" }];
|
|
47
|
+
});
|
|
48
|
+
mock.onDelete(/\/platforms\/[0-9]+/).reply((config) => {
|
|
49
|
+
let searchedplatformId = config.url
|
|
50
|
+
? config.url.split("platforms/")[1]
|
|
51
|
+
: "";
|
|
52
|
+
for (let key of Object.keys(platforms))
|
|
53
|
+
if (platforms[key].platformId == parseInt(searchedplatformId))
|
|
54
|
+
delete platforms[key];
|
|
55
|
+
return [200, { status: "Ok", message: "1 items were deleted" }];
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=PlatformMocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlatformMocks.js","sourceRoot":"","sources":["../../../src/crud/test/PlatformMocks.ts"],"names":[],"mappings":";;AAIA,gDAkDC;AApDD,IAAI,SAAS,GAAQ,EAAE,CAAC;AAExB,SAAgB,kBAAkB,CAAC,IAAiB;IAClD,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC,KAAK,CAAC,CAAC,MAAW,EAAE,EAAE;QAC/D,IAAI,UAAU,G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C,CAAC,CAAC;IACH,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC,KAAK,CAAC,CAAC,MAAW,EAAE,EAAE;QACzD,IAAI,kBAAkB,GAAW,MAAM,CAAC,GAAG;YACzC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YACnC,CAAC,CAAC,EAAE,CAAC;QACP,KAAK,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;YACpC,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU,IAAI,QAAQ,CAAC,kBAAkB,CAAC;gBAAE,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;QACvF,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.applyRoleMocks =
|
|
3
|
+
exports.applyRoleMocks = applyRoleMocks;
|
|
4
4
|
var roles = {};
|
|
5
5
|
function applyRoleMocks(mock) {
|
|
6
6
|
mock.onGet(/\/roles\?id=[a-zA-Z0-9]+/).reply((config) => {
|
|
@@ -55,5 +55,4 @@ function applyRoleMocks(mock) {
|
|
|
55
55
|
return [200, { status: "Ok", message: "1 items were deleted" }];
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
exports.applyRoleMocks = applyRoleMocks;
|
|
59
58
|
//# sourceMappingURL=RoleMocks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoleMocks.js","sourceRoot":"","sources":["../../../src/crud/test/RoleMocks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RoleMocks.js","sourceRoot":"","sources":["../../../src/crud/test/RoleMocks.ts"],"names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C,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC,CAAC;QAClE,CAAC;QACD,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IACH,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,KAAK,CAAC,CAAC,MAAW,EAAE,EAAE;QACrD,IAAI,cAAc,GAAW,MAAM,CAAC,GAAG;YACrC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YAC/B,CAAC,CAAC,EAAE,CAAC;QACP,KAAK,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;YAChC,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,IAAI,QAAQ,CAAC,cAAc,CAAC;gBAAE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC;QACvE,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyStatusMocks = applyStatusMocks;
|
|
4
|
+
var statusList = {};
|
|
5
|
+
function applyStatusMocks(mock) {
|
|
6
|
+
mock.onGet(/\/status\?id=[a-zA-Z0-9]+/).reply((config) => {
|
|
7
|
+
let searchedId = config.url ? config.url.split('id=')[1] : '';
|
|
8
|
+
if (statusList[searchedId])
|
|
9
|
+
return [200, { result: [statusList[searchedId]] }];
|
|
10
|
+
return [200, { result: [] }];
|
|
11
|
+
});
|
|
12
|
+
mock.onGet(/\/status\?status=[a-zA-Z0-9]+/).reply((config) => {
|
|
13
|
+
let searchedStatus = config.url ? config.url.split('status=')[1] : '';
|
|
14
|
+
for (let key of Object.keys(statusList))
|
|
15
|
+
if (statusList[key].status === searchedStatus)
|
|
16
|
+
return [200, { result: [statusList[key]] }];
|
|
17
|
+
return [200, { result: [] }];
|
|
18
|
+
});
|
|
19
|
+
mock.onPost(/\/status/).reply((config) => {
|
|
20
|
+
let data = JSON.parse(config.data);
|
|
21
|
+
for (let key of Object.keys(statusList))
|
|
22
|
+
if (statusList[key].status === data.status)
|
|
23
|
+
return [400, { status: 'Error', type: 'SequelizeUniqueConstraintError', error: 'Validation error' }];
|
|
24
|
+
let item = { statusId: Object.keys(statusList).length + 1, status: data.status, details: data.details };
|
|
25
|
+
statusList["" + item.statusId] = item;
|
|
26
|
+
return [200, { items: [statusList["" + item.statusId]] }];
|
|
27
|
+
});
|
|
28
|
+
mock.onPut(/\/status\/[0-9]+/).reply((config) => {
|
|
29
|
+
let statusId = config.url ? config.url.split('status/')[1] : '';
|
|
30
|
+
if (statusList[statusId]) {
|
|
31
|
+
let data = JSON.parse(config.data);
|
|
32
|
+
statusList[statusId] = Object.assign(Object.assign({}, statusList[statusId]), data);
|
|
33
|
+
return [200, { status: 'Ok', message: '1 items were updated' }];
|
|
34
|
+
}
|
|
35
|
+
return [200, { status: 'Ok', message: '0 items were updated' }];
|
|
36
|
+
});
|
|
37
|
+
mock.onDelete(/\/status\/[0-9]+/).reply((config) => {
|
|
38
|
+
let searchedStatusId = config.url ? config.url.split('status/')[1] : '';
|
|
39
|
+
for (let key of Object.keys(statusList))
|
|
40
|
+
if (statusList[key].statusId == parseInt(searchedStatusId))
|
|
41
|
+
delete statusList[key];
|
|
42
|
+
return [200, { status: 'Ok', message: '1 items were deleted' }];
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=StatusMocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusMocks.js","sourceRoot":"","sources":["../../../src/crud/test/StatusMoc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YAC3D,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC,CAAC;QACpE,CAAC;QACD,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;IACH,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,KAAK,CAAC,CAAC,MAAW,EAAE,EAAE;QACpD,IAAI,gBAAgB,GAAW,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAChF,KAAK,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;YACnC,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,gBAAgB,CAAC;gBACtD,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC;QAC/B,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyTypeMocks = applyTypeMocks;
|
|
4
|
+
var types = {};
|
|
5
|
+
function applyTypeMocks(mock) {
|
|
6
|
+
mock.onGet(/\/types\?id=[a-zA-Z0-9]+/).reply((config) => {
|
|
7
|
+
let searchedId = config.url ? config.url.split('id=')[1] : '';
|
|
8
|
+
if (types[searchedId])
|
|
9
|
+
return [200, { result: [types[searchedId]] }];
|
|
10
|
+
return [200, { result: [] }];
|
|
11
|
+
});
|
|
12
|
+
mock.onGet(/\/types\?type=[a-zA-Z0-9]+/).reply((config) => {
|
|
13
|
+
let searchedType = config.url ? config.url.split('type=')[1] : '';
|
|
14
|
+
for (let key of Object.keys(types))
|
|
15
|
+
if (types[key].type === searchedType)
|
|
16
|
+
return [200, { result: [types[key]] }];
|
|
17
|
+
return [200, { result: [] }];
|
|
18
|
+
});
|
|
19
|
+
mock.onPost(/\/types/).reply((config) => {
|
|
20
|
+
let data = JSON.parse(config.data);
|
|
21
|
+
for (let key of Object.keys(types))
|
|
22
|
+
if (types[key].type === data.type)
|
|
23
|
+
return [400, { status: 'Error', type: 'SequelizeUniqueConstraintError', error: 'Validation error' }];
|
|
24
|
+
let item = { typeId: Object.keys(types).length + 1, type: data.type, details: data.details };
|
|
25
|
+
types["" + item.typeId] = item;
|
|
26
|
+
return [200, { items: [types["" + item.typeId]] }];
|
|
27
|
+
});
|
|
28
|
+
mock.onPut(/\/types\/[0-9]+/).reply((config) => {
|
|
29
|
+
let typeId = config.url ? config.url.split('types/')[1] : '';
|
|
30
|
+
if (types[typeId]) {
|
|
31
|
+
let data = JSON.parse(config.data);
|
|
32
|
+
types[typeId] = Object.assign(Object.assign({}, types[typeId]), data);
|
|
33
|
+
return [200, { status: 'Ok', message: '1 items were updated' }];
|
|
34
|
+
}
|
|
35
|
+
return [200, { status: 'Ok', message: '0 items were updated' }];
|
|
36
|
+
});
|
|
37
|
+
mock.onDelete(/\/types\/[0-9]+/).reply((config) => {
|
|
38
|
+
let searchedTypeId = config.url ? config.url.split('types/')[1] : '';
|
|
39
|
+
for (let key of Object.keys(types))
|
|
40
|
+
if (types[key].typeId == parseInt(searchedTypeId))
|
|
41
|
+
delete types[key];
|
|
42
|
+
return [200, { status: 'Ok', message: '1 items were deleted' }];
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=TypeMocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeMocks.js","sourceRoot":"","sources":["../../../src/crud/test/TypeMocks.ts"],"names":[],"mappings":";;A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,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC,CAAC;QACpE,CAAC;QACD,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;IACH,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,KAAK,CAAC,CAAC,MAAW,EAAE,EAAE;QACnD,IAAI,cAAc,GAAW,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7E,KAAK,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;YAC9B,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,IAAI,QAAQ,CAAC,cAAc,CAAC;gBAC7C,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC;QAC1B,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
export { ExpressLogableConfig as ExpressLogableConfig } from './api/ExpressLogableConfig';
|
|
2
|
+
export { IServiceSessionConfig as IServiceSessionConfig, IServiceCredentials as IServiceCredentials, ServiceSessionChecker as ServiceSessionChecker } from './api/checkers/ServiceSessionChecker';
|
|
2
3
|
export { BitsoApiConfig as BitsoApiConfig, BitsoApiConnection as BitsoApiConnection } from './api/bitso/BitsoApiConnection';
|
|
3
4
|
export { IBitsoBalance as IBitsoBalance, findBalances as findBalances } from './api/bitso/tools/BitsoBalance';
|
|
4
5
|
export { IBitsoBook as IBitsoBook, findBitsoBook as findBitsoBook } from './api/bitso/tools/BitsoBook';
|
|
5
6
|
export { IBitsoOrder as IBitsoOrder, IBitsoOrderDetails as IBitsoOrderDetails } from './api/bitso/tools/BitsoOrder';
|
|
6
7
|
export { IBitsoOrderBook as IBitsoOrderBook, IBitsoBookOrder as IBitsoBookOrder } from './api/bitso/tools/BitsoOrderBook';
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
8
|
+
export { IAvailablePlatform as IAvailablePlatform, IAvailablePlatformDetails as IAvailablePlatformDetails } from './crud/AvailablePlatformManager';
|
|
9
|
+
export { IPlatform as IPlatform, IPlatformsDetails as IPlatformsDetails, PlatformManager as PlatformManager } from "./crud/PlatformManager";
|
|
10
|
+
export { IRole as IRole, IRoleDetails as IRoleDetails, RoleManager as RoleManager } from "./crud/RoleManager";
|
|
11
|
+
export { IStatus as IStatus, IStatusDetails as IStatusDetails, StatusManager as StatusManager } from "./crud/StatusManager";
|
|
12
|
+
export { IType as IType, ITypeDetails as ITypeDetails, TypeManager as TypeManager } from "./crud/TypeManager";
|
|
13
|
+
export { IUserCredentials as IUserCredentials, IUserCredentialsDetails as IUserCredentialsDetails } from "./crud/UserCredentialsManager";
|
|
14
|
+
export { IUser as IUser, IUserDetails as IUserDetails } from "./crud/UserManager";
|
|
11
15
|
export { applyLoginMocks as applyLoginMocks } from "./crud/test/LoginServiceMock";
|
|
16
|
+
export { applyPlatformMocks as applyPlatformMocks } from "./crud/test/PlatformMocks";
|
|
17
|
+
export { applyRoleMocks as applyRoleMocks } from "./crud/test/RoleMocks";
|
|
18
|
+
export { applyStatusMocks as applyStatusMocks } from "./crud/test/StatusMocks";
|
|
19
|
+
export { applyTypeMocks as applyTypeMocks } from "./crud/test/TypeMocks";
|
package/dist/index.js
CHANGED
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.applyTypeMocks = exports.applyStatusMocks = exports.applyRoleMocks = exports.applyPlatformMocks = exports.applyLoginMocks = exports.TypeManager = exports.StatusManager = exports.RoleManager = exports.PlatformManager = exports.findBitsoBook = exports.findBalances = exports.BitsoApiConnection = exports.ServiceSessionChecker = exports.ExpressLogableConfig = void 0;
|
|
4
4
|
var ExpressLogableConfig_1 = require("./api/ExpressLogableConfig");
|
|
5
5
|
Object.defineProperty(exports, "ExpressLogableConfig", { enumerable: true, get: function () { return ExpressLogableConfig_1.ExpressLogableConfig; } });
|
|
6
|
+
var ServiceSessionChecker_1 = require("./api/checkers/ServiceSessionChecker");
|
|
7
|
+
Object.defineProperty(exports, "ServiceSessionChecker", { enumerable: true, get: function () { return ServiceSessionChecker_1.ServiceSessionChecker; } });
|
|
6
8
|
var BitsoApiConnection_1 = require("./api/bitso/BitsoApiConnection");
|
|
7
9
|
Object.defineProperty(exports, "BitsoApiConnection", { enumerable: true, get: function () { return BitsoApiConnection_1.BitsoApiConnection; } });
|
|
8
10
|
var BitsoBalance_1 = require("./api/bitso/tools/BitsoBalance");
|
|
9
11
|
Object.defineProperty(exports, "findBalances", { enumerable: true, get: function () { return BitsoBalance_1.findBalances; } });
|
|
10
12
|
var BitsoBook_1 = require("./api/bitso/tools/BitsoBook");
|
|
11
13
|
Object.defineProperty(exports, "findBitsoBook", { enumerable: true, get: function () { return BitsoBook_1.findBitsoBook; } });
|
|
14
|
+
var PlatformManager_1 = require("./crud/PlatformManager");
|
|
15
|
+
Object.defineProperty(exports, "PlatformManager", { enumerable: true, get: function () { return PlatformManager_1.PlatformManager; } });
|
|
12
16
|
var RoleManager_1 = require("./crud/RoleManager");
|
|
13
17
|
Object.defineProperty(exports, "RoleManager", { enumerable: true, get: function () { return RoleManager_1.RoleManager; } });
|
|
14
|
-
var
|
|
15
|
-
Object.defineProperty(exports, "
|
|
16
|
-
var
|
|
17
|
-
Object.defineProperty(exports, "
|
|
18
|
-
var RoleMocks_1 = require("./crud/test/RoleMocks");
|
|
19
|
-
Object.defineProperty(exports, "applyRoleMocks", { enumerable: true, get: function () { return RoleMocks_1.applyRoleMocks; } });
|
|
18
|
+
var StatusManager_1 = require("./crud/StatusManager");
|
|
19
|
+
Object.defineProperty(exports, "StatusManager", { enumerable: true, get: function () { return StatusManager_1.StatusManager; } });
|
|
20
|
+
var TypeManager_1 = require("./crud/TypeManager");
|
|
21
|
+
Object.defineProperty(exports, "TypeManager", { enumerable: true, get: function () { return TypeManager_1.TypeManager; } });
|
|
20
22
|
var LoginServiceMock_1 = require("./crud/test/LoginServiceMock");
|
|
21
23
|
Object.defineProperty(exports, "applyLoginMocks", { enumerable: true, get: function () { return LoginServiceMock_1.applyLoginMocks; } });
|
|
24
|
+
var PlatformMocks_1 = require("./crud/test/PlatformMocks");
|
|
25
|
+
Object.defineProperty(exports, "applyPlatformMocks", { enumerable: true, get: function () { return PlatformMocks_1.applyPlatformMocks; } });
|
|
26
|
+
var RoleMocks_1 = require("./crud/test/RoleMocks");
|
|
27
|
+
Object.defineProperty(exports, "applyRoleMocks", { enumerable: true, get: function () { return RoleMocks_1.applyRoleMocks; } });
|
|
28
|
+
var StatusMocks_1 = require("./crud/test/StatusMocks");
|
|
29
|
+
Object.defineProperty(exports, "applyStatusMocks", { enumerable: true, get: function () { return StatusMocks_1.applyStatusMocks; } });
|
|
30
|
+
var TypeMocks_1 = require("./crud/test/TypeMocks");
|
|
31
|
+
Object.defineProperty(exports, "applyTypeMocks", { enumerable: true, get: function () { return TypeMocks_1.applyTypeMocks; } });
|
|
22
32
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mEAA0F;AAAjF,4HAAA,oBAAoB,OAAwB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mEAA0F;AAAjF,4HAAA,oBAAoB,OAAwB;AAErD,8EAAkM;AAA7F,8HAAA,qBAAqB,OAAyB;AAEnJ,qEAA4H;AAAjF,wHAAA,kBAAkB,OAAsB;AACnF,+DAA8G;AAArE,4GAAA,YAAY,OAAgB;AACrE,yDAAuG;AAApE,0GAAA,aAAa,OAAiB;AAKjE,0DAA4I;AAAnE,kHAAA,eAAe,OAAmB;AAC3G,kDAA8G;AAAvD,0GAAA,WAAW,OAAe;AACjF,sDAA4H;AAA7D,8GAAA,aAAa,OAAiB;AAC7F,kDAA8G;AAAvD,0GAAA,WAAW,OAAe;AAIjF,iEAAkF;AAAzE,mHAAA,eAAe,OAAmB;AAC3C,2DAAqF;AAA5E,mHAAA,kBAAkB,OAAsB;AACjD,mDAAyE;AAAhE,2GAAA,cAAc,OAAkB;AACzC,uDAA+E;AAAtE,+GAAA,gBAAgB,OAAoB;AAC7C,mDAAyE;AAAhE,2GAAA,cAAc,OAAkB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cetus-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "Librería para elementos comunes de CETUS",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@types/morgan": "^1.9.7",
|
|
36
36
|
"@types/node": "^20.8.7",
|
|
37
37
|
"jest": "^29.7.0",
|
|
38
|
-
"rimraf": "^5.0.
|
|
38
|
+
"rimraf": "^5.0.9",
|
|
39
39
|
"ts-jest": "^29.1.1",
|
|
40
40
|
"typescript": "^5.2.2"
|
|
41
41
|
},
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { AxiosRequestConfig } from "axios";
|
|
2
|
-
import { CrudServiceManager, StandardIdRequestDefinition } from "itrm-tools";
|
|
3
|
-
export interface IChatPlatform {
|
|
4
|
-
chatPlatformId?: number;
|
|
5
|
-
name: string;
|
|
6
|
-
updatedAt?: string;
|
|
7
|
-
createdAt?: string;
|
|
8
|
-
config?: AxiosRequestConfig;
|
|
9
|
-
}
|
|
10
|
-
export interface IChatPlatformDetails {
|
|
11
|
-
name: string;
|
|
12
|
-
config?: AxiosRequestConfig;
|
|
13
|
-
}
|
|
14
|
-
export declare class ChatPlatformManager extends CrudServiceManager<IChatPlatformDetails, IChatPlatform> {
|
|
15
|
-
private url;
|
|
16
|
-
constructor(url: string);
|
|
17
|
-
find(details: IChatPlatformDetails): Promise<IChatPlatform | undefined>;
|
|
18
|
-
findById(id: StandardIdRequestDefinition): Promise<IChatPlatform | undefined>;
|
|
19
|
-
create(details: IChatPlatformDetails): Promise<IChatPlatform | undefined>;
|
|
20
|
-
modify(platform: IChatPlatform): Promise<any>;
|
|
21
|
-
destroy(platform: IChatPlatform): Promise<any>;
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChatPlatformManager.js","sourceRoot":"","sources":["../../src/crud/ChatPlatformManager.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,2CAA6E;AAe7E,MAAa,mBAAoB,SAAQ,+BAAuD;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,mBAAmB,OAAO,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAC1F,CAAC;KAAA;IAEM,QAAQ,CAAC,EAA+B;QAC3C,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,GAAG,iBAAiB,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;IAC5E,CAAC;IAEM,MAAM,CAAC,OAA6B;QACvC,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,GAAG,YAAY,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9F,CAAC;IAEM,MAAM,CAAC,QAAuB;QACjC,OAAO,IAAI,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,GAAG,cAAc,QAAQ,CAAC,cAAc,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/H,CAAC;IAEM,OAAO,CAAC,QAAuB;QAClC,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,GAAG,cAAc,QAAQ,CAAC,cAAc,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACpG,CAAC;CACJ;AA3BD,kDA2BC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { AxiosRequestConfig } from "axios";
|
|
2
|
-
import { CrudServiceManager, StandardIdRequestDefinition } from "itrm-tools";
|
|
3
|
-
export interface IKeyType {
|
|
4
|
-
keyTypeId?: number;
|
|
5
|
-
type: string;
|
|
6
|
-
updatedAt?: string;
|
|
7
|
-
createdAt?: string;
|
|
8
|
-
config?: AxiosRequestConfig;
|
|
9
|
-
}
|
|
10
|
-
export interface IKeyTypeDetails {
|
|
11
|
-
type: string;
|
|
12
|
-
config?: AxiosRequestConfig;
|
|
13
|
-
}
|
|
14
|
-
export declare class KeyTypeManager extends CrudServiceManager<IKeyTypeDetails, IKeyType> {
|
|
15
|
-
private url;
|
|
16
|
-
constructor(url: string);
|
|
17
|
-
find(details: IKeyTypeDetails): Promise<IKeyType | undefined>;
|
|
18
|
-
findById(id: StandardIdRequestDefinition): Promise<IKeyType | undefined>;
|
|
19
|
-
create(details: IKeyTypeDetails): Promise<IKeyType | undefined>;
|
|
20
|
-
modify(keyType: IKeyType): Promise<any>;
|
|
21
|
-
destroy(keyType: IKeyType): Promise<any>;
|
|
22
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
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.KeyTypeManager = void 0;
|
|
13
|
-
const itrm_tools_1 = require("itrm-tools");
|
|
14
|
-
class KeyTypeManager extends itrm_tools_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}/keyTypes?type=${details.type}`, details.config);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
findById(id) {
|
|
25
|
-
return this.sendFinding(`${this.url}/keyTypes?id=${id.id}`, id.config);
|
|
26
|
-
}
|
|
27
|
-
create(details) {
|
|
28
|
-
return this.sendCreation(`${this.url}/keyTypes`, { type: details.type }, details.config);
|
|
29
|
-
}
|
|
30
|
-
modify(keyType) {
|
|
31
|
-
return this.sendModification(`${this.url}/keyTypes/${keyType.keyTypeId}`, { type: keyType.type }, keyType.config);
|
|
32
|
-
}
|
|
33
|
-
destroy(keyType) {
|
|
34
|
-
return this.sendDestuction(`${this.url}/keyTypes/${keyType.keyTypeId}`, keyType.config);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports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