itrm-tools 1.3.16 → 1.3.17
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/alegra/AlegraConnectionManager.d.ts +30 -30
- package/dist/api/request/crud/CrudManager.d.ts +11 -11
- package/dist/api/request/crud/CrudServiceManager.d.ts +28 -28
- package/dist/api/request/crud/CrudServiceManager.js +98 -98
- package/dist/api/request/crud/common/ActivityHistoryManager.d.ts +38 -38
- package/dist/api/request/crud/common/ActivityHistoryManager.js +68 -68
- package/dist/api/request/crud/common/ApplicationManager.d.ts +37 -37
- package/dist/api/request/crud/common/ApplicationManager.js +56 -56
- package/dist/api/request/crud/common/AvailablePlatformManager.d.ts +38 -38
- package/dist/api/request/crud/common/AvailablePlatformManager.js +68 -68
- package/dist/api/request/crud/common/ComponentManager.d.ts +48 -48
- package/dist/api/request/crud/common/ComponentManager.js +62 -62
- package/dist/api/request/crud/common/KeyManager.d.ts +41 -41
- package/dist/api/request/crud/common/KeyManager.js +69 -69
- package/dist/api/request/crud/common/PlatformManager.d.ts +41 -41
- package/dist/api/request/crud/common/PlatformManager.js +59 -59
- package/dist/api/request/crud/common/RoleManager.d.ts +40 -40
- package/dist/api/request/crud/common/RoleManager.js +56 -56
- package/dist/api/request/crud/common/StatusManager.d.ts +32 -32
- package/dist/api/request/crud/common/StatusManager.js +56 -56
- package/dist/api/request/crud/common/TypeManager.d.ts +32 -32
- package/dist/api/request/crud/common/TypeManager.js +56 -56
- package/dist/api/request/crud/common/UserCredentialsManager.d.ts +37 -37
- package/dist/api/request/crud/common/UserCredentialsManager.js +66 -66
- package/dist/api/request/crud/common/UserManager.d.ts +38 -38
- package/dist/api/request/crud/common/UserManager.js +62 -62
- package/dist/api/utils/Response.d.ts +25 -25
- package/dist/api/utils/Response.js +85 -85
- package/dist/cryptography/jwt/JwtUtils.d.ts +18 -18
- package/dist/cryptography/jwt/JwtUtils.js +36 -36
- package/dist/cryptography/password/PasswordUtils.d.ts +6 -6
- package/dist/cryptography/password/PasswordUtils.js +34 -34
- package/dist/index.d.ts +62 -62
- package/dist/index.js +126 -126
- package/dist/types/api.d.ts +21 -21
- package/dist/types/api.js +2 -2
- package/package.json +4 -4
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KeyManager = void 0;
|
|
4
|
-
const CrudServiceManager_1 = require("../CrudServiceManager");
|
|
5
|
-
class KeyManager extends CrudServiceManager_1.CrudServiceManager {
|
|
6
|
-
url;
|
|
7
|
-
constructor(url) {
|
|
8
|
-
super();
|
|
9
|
-
this.url = url;
|
|
10
|
-
}
|
|
11
|
-
find(details) {
|
|
12
|
-
return this.sendFinding(`${this.url}/keys?publicKey=${details.publicKey}`, details.config);
|
|
13
|
-
}
|
|
14
|
-
findById(details) {
|
|
15
|
-
return this.sendFinding(`${this.url}/keys?id=${details.id}`, details.config);
|
|
16
|
-
}
|
|
17
|
-
findByUserId(details) {
|
|
18
|
-
return this.sendAllFinding(`${this.url}/keys?userId=${details.userId}`, details.config);
|
|
19
|
-
}
|
|
20
|
-
async findAll(details) {
|
|
21
|
-
let keys = [];
|
|
22
|
-
let url = this.buildRequestUrl(`${this.url}/keys`, details);
|
|
23
|
-
if (details.limit) {
|
|
24
|
-
keys = (await this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${details.limit}&offset=${details.offset}`, details.config)) ?? [];
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
let limit = 5000, offset = 0, isEmpty = false;
|
|
28
|
-
do {
|
|
29
|
-
let values = await this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${limit}&offset=${offset}`, details.config);
|
|
30
|
-
if (values)
|
|
31
|
-
keys = keys.concat(values);
|
|
32
|
-
isEmpty = values == undefined || values.length == 0;
|
|
33
|
-
offset += limit;
|
|
34
|
-
} while (!isEmpty);
|
|
35
|
-
}
|
|
36
|
-
return keys;
|
|
37
|
-
}
|
|
38
|
-
buildRequestUrl(url, details) {
|
|
39
|
-
let suffix = `${details.id ? `&id=${details.id}` : ""}${details.publicKey ? `&publicKey=${details.publicKey}` : ""}${details.userId ? `&userId=${details.userId}` : ""}`;
|
|
40
|
-
return `${url}?${suffix.substring(1)}`;
|
|
41
|
-
}
|
|
42
|
-
async count(details) {
|
|
43
|
-
let url = this.buildRequestUrl(`${this.url}/keys`, details);
|
|
44
|
-
return (await this.sendCounting(url, details.config)) ?? 0;
|
|
45
|
-
}
|
|
46
|
-
create(details) {
|
|
47
|
-
return this.sendCreation(`${this.url}/keys`, {
|
|
48
|
-
userId: details.userId,
|
|
49
|
-
lastNonce: details.lastNonce,
|
|
50
|
-
publicKey: details.publicKey,
|
|
51
|
-
secretKey: details.secretKey,
|
|
52
|
-
signKey: details.signKey,
|
|
53
|
-
details: details.details
|
|
54
|
-
}, details.config);
|
|
55
|
-
}
|
|
56
|
-
createMany(details) {
|
|
57
|
-
return this.sendCreationMany(`${this.url}/keys`, details.values ?? [], details.config);
|
|
58
|
-
}
|
|
59
|
-
modify(key) {
|
|
60
|
-
return this.sendModification(`${this.url}/keys/${key.keyId}`, {
|
|
61
|
-
lastNonce: key.lastNonce,
|
|
62
|
-
details: key.details
|
|
63
|
-
}, key.config);
|
|
64
|
-
}
|
|
65
|
-
destroy(key) {
|
|
66
|
-
return this.sendDestruction(`${this.url}/keys/${key.keyId}`, key.config);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
exports.KeyManager = KeyManager;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KeyManager = void 0;
|
|
4
|
+
const CrudServiceManager_1 = require("../CrudServiceManager");
|
|
5
|
+
class KeyManager extends CrudServiceManager_1.CrudServiceManager {
|
|
6
|
+
url;
|
|
7
|
+
constructor(url) {
|
|
8
|
+
super();
|
|
9
|
+
this.url = url;
|
|
10
|
+
}
|
|
11
|
+
find(details) {
|
|
12
|
+
return this.sendFinding(`${this.url}/keys?publicKey=${details.publicKey}`, details.config);
|
|
13
|
+
}
|
|
14
|
+
findById(details) {
|
|
15
|
+
return this.sendFinding(`${this.url}/keys?id=${details.id}`, details.config);
|
|
16
|
+
}
|
|
17
|
+
findByUserId(details) {
|
|
18
|
+
return this.sendAllFinding(`${this.url}/keys?userId=${details.userId}`, details.config);
|
|
19
|
+
}
|
|
20
|
+
async findAll(details) {
|
|
21
|
+
let keys = [];
|
|
22
|
+
let url = this.buildRequestUrl(`${this.url}/keys`, details);
|
|
23
|
+
if (details.limit) {
|
|
24
|
+
keys = (await this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${details.limit}&offset=${details.offset}`, details.config)) ?? [];
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
let limit = 5000, offset = 0, isEmpty = false;
|
|
28
|
+
do {
|
|
29
|
+
let values = await this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${limit}&offset=${offset}`, details.config);
|
|
30
|
+
if (values)
|
|
31
|
+
keys = keys.concat(values);
|
|
32
|
+
isEmpty = values == undefined || values.length == 0;
|
|
33
|
+
offset += limit;
|
|
34
|
+
} while (!isEmpty);
|
|
35
|
+
}
|
|
36
|
+
return keys;
|
|
37
|
+
}
|
|
38
|
+
buildRequestUrl(url, details) {
|
|
39
|
+
let suffix = `${details.id ? `&id=${details.id}` : ""}${details.publicKey ? `&publicKey=${details.publicKey}` : ""}${details.userId ? `&userId=${details.userId}` : ""}`;
|
|
40
|
+
return `${url}?${suffix.substring(1)}`;
|
|
41
|
+
}
|
|
42
|
+
async count(details) {
|
|
43
|
+
let url = this.buildRequestUrl(`${this.url}/keys`, details);
|
|
44
|
+
return (await this.sendCounting(url, details.config)) ?? 0;
|
|
45
|
+
}
|
|
46
|
+
create(details) {
|
|
47
|
+
return this.sendCreation(`${this.url}/keys`, {
|
|
48
|
+
userId: details.userId,
|
|
49
|
+
lastNonce: details.lastNonce,
|
|
50
|
+
publicKey: details.publicKey,
|
|
51
|
+
secretKey: details.secretKey,
|
|
52
|
+
signKey: details.signKey,
|
|
53
|
+
details: details.details
|
|
54
|
+
}, details.config);
|
|
55
|
+
}
|
|
56
|
+
createMany(details) {
|
|
57
|
+
return this.sendCreationMany(`${this.url}/keys`, details.values ?? [], details.config);
|
|
58
|
+
}
|
|
59
|
+
modify(key) {
|
|
60
|
+
return this.sendModification(`${this.url}/keys/${key.keyId}`, {
|
|
61
|
+
lastNonce: key.lastNonce,
|
|
62
|
+
details: key.details
|
|
63
|
+
}, key.config);
|
|
64
|
+
}
|
|
65
|
+
destroy(key) {
|
|
66
|
+
return this.sendDestruction(`${this.url}/keys/${key.keyId}`, key.config);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.KeyManager = KeyManager;
|
|
70
70
|
//# sourceMappingURL=KeyManager.js.map
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { AxiosRequestConfig } from "axios";
|
|
2
|
-
import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
|
|
3
|
-
export interface IPlatform {
|
|
4
|
-
platformId?: number;
|
|
5
|
-
applicationId?: number;
|
|
6
|
-
name?: string;
|
|
7
|
-
details?: IPlatformDetails;
|
|
8
|
-
updatedAt?: string;
|
|
9
|
-
createdAt?: string;
|
|
10
|
-
config?: AxiosRequestConfig;
|
|
11
|
-
}
|
|
12
|
-
export interface IPlatformDetails {
|
|
13
|
-
lang: Record<string, string>;
|
|
14
|
-
description?: string;
|
|
15
|
-
platformUrl: string;
|
|
16
|
-
config?: AxiosRequestConfig;
|
|
17
|
-
}
|
|
18
|
-
export interface IPlatformSearchDetails {
|
|
19
|
-
id?: string | number;
|
|
20
|
-
applicationId?: number;
|
|
21
|
-
name?: string;
|
|
22
|
-
details?: any;
|
|
23
|
-
values?: IPlatform[];
|
|
24
|
-
limit?: number;
|
|
25
|
-
offset?: number;
|
|
26
|
-
config?: AxiosRequestConfig;
|
|
27
|
-
}
|
|
28
|
-
export declare class PlatformManager extends CrudServiceManager<IPlatformSearchDetails, IPlatform> {
|
|
29
|
-
private readonly url;
|
|
30
|
-
constructor(url: string);
|
|
31
|
-
find(details: IPlatformSearchDetails): Promise<IPlatform | undefined>;
|
|
32
|
-
findById(details: StandardIdRequestDefinition): Promise<IPlatform | undefined>;
|
|
33
|
-
findByApplicationId(details: IPlatformSearchDetails): Promise<IPlatform[] | undefined>;
|
|
34
|
-
count(details: IPlatformSearchDetails): Promise<number>;
|
|
35
|
-
findAll(details: IPlatformSearchDetails): Promise<IPlatform[] | undefined>;
|
|
36
|
-
private buildRequestUrl;
|
|
37
|
-
create(details: IPlatformSearchDetails): Promise<IPlatform | undefined>;
|
|
38
|
-
createMany(details: IPlatformSearchDetails): Promise<IPlatform[] | undefined>;
|
|
39
|
-
modify(platform: IPlatform): Promise<IPlatform | undefined>;
|
|
40
|
-
destroy(platform: IPlatform): Promise<void | number>;
|
|
41
|
-
}
|
|
1
|
+
import { AxiosRequestConfig } from "axios";
|
|
2
|
+
import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
|
|
3
|
+
export interface IPlatform {
|
|
4
|
+
platformId?: number;
|
|
5
|
+
applicationId?: number;
|
|
6
|
+
name?: string;
|
|
7
|
+
details?: IPlatformDetails;
|
|
8
|
+
updatedAt?: string;
|
|
9
|
+
createdAt?: string;
|
|
10
|
+
config?: AxiosRequestConfig;
|
|
11
|
+
}
|
|
12
|
+
export interface IPlatformDetails {
|
|
13
|
+
lang: Record<string, string>;
|
|
14
|
+
description?: string;
|
|
15
|
+
platformUrl: string;
|
|
16
|
+
config?: AxiosRequestConfig;
|
|
17
|
+
}
|
|
18
|
+
export interface IPlatformSearchDetails {
|
|
19
|
+
id?: string | number;
|
|
20
|
+
applicationId?: number;
|
|
21
|
+
name?: string;
|
|
22
|
+
details?: any;
|
|
23
|
+
values?: IPlatform[];
|
|
24
|
+
limit?: number;
|
|
25
|
+
offset?: number;
|
|
26
|
+
config?: AxiosRequestConfig;
|
|
27
|
+
}
|
|
28
|
+
export declare class PlatformManager extends CrudServiceManager<IPlatformSearchDetails, IPlatform> {
|
|
29
|
+
private readonly url;
|
|
30
|
+
constructor(url: string);
|
|
31
|
+
find(details: IPlatformSearchDetails): Promise<IPlatform | undefined>;
|
|
32
|
+
findById(details: StandardIdRequestDefinition): Promise<IPlatform | undefined>;
|
|
33
|
+
findByApplicationId(details: IPlatformSearchDetails): Promise<IPlatform[] | undefined>;
|
|
34
|
+
count(details: IPlatformSearchDetails): Promise<number>;
|
|
35
|
+
findAll(details: IPlatformSearchDetails): Promise<IPlatform[] | undefined>;
|
|
36
|
+
private buildRequestUrl;
|
|
37
|
+
create(details: IPlatformSearchDetails): Promise<IPlatform | undefined>;
|
|
38
|
+
createMany(details: IPlatformSearchDetails): Promise<IPlatform[] | undefined>;
|
|
39
|
+
modify(platform: IPlatform): Promise<IPlatform | undefined>;
|
|
40
|
+
destroy(platform: IPlatform): Promise<void | number>;
|
|
41
|
+
}
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PlatformManager = void 0;
|
|
4
|
-
const CrudServiceManager_1 = require("../CrudServiceManager");
|
|
5
|
-
class PlatformManager extends CrudServiceManager_1.CrudServiceManager {
|
|
6
|
-
url;
|
|
7
|
-
constructor(url) {
|
|
8
|
-
super();
|
|
9
|
-
this.url = url;
|
|
10
|
-
}
|
|
11
|
-
find(details) {
|
|
12
|
-
return this.sendFinding(`${this.url}/platforms?name=${details.name}&applicationId=${details.applicationId}`, details.config);
|
|
13
|
-
}
|
|
14
|
-
findById(details) {
|
|
15
|
-
return this.sendFinding(`${this.url}/platforms?id=${details.id}`, details.config);
|
|
16
|
-
}
|
|
17
|
-
findByApplicationId(details) {
|
|
18
|
-
return this.sendAllFinding(`${this.url}/platforms?applicationId=${details.applicationId}`, details.config);
|
|
19
|
-
}
|
|
20
|
-
async count(details) {
|
|
21
|
-
let url = this.buildRequestUrl(`${this.url}/platforms`, details);
|
|
22
|
-
return (await this.sendCounting(url, details.config)) ?? 0;
|
|
23
|
-
}
|
|
24
|
-
async findAll(details) {
|
|
25
|
-
let platforms = [];
|
|
26
|
-
let url = this.buildRequestUrl(`${this.url}/platforms`, details);
|
|
27
|
-
if (details.limit) {
|
|
28
|
-
platforms = (await this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${details.limit}&offset=${details.offset}`, details.config)) ?? [];
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
let limit = 5000, offset = 0, isEmpty = false;
|
|
32
|
-
do {
|
|
33
|
-
let values = await this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${limit}&offset=${offset}`, details.config);
|
|
34
|
-
if (values)
|
|
35
|
-
platforms = platforms.concat(values);
|
|
36
|
-
isEmpty = values == undefined || values.length == 0;
|
|
37
|
-
offset += limit;
|
|
38
|
-
} while (!isEmpty);
|
|
39
|
-
}
|
|
40
|
-
return platforms;
|
|
41
|
-
}
|
|
42
|
-
buildRequestUrl(url, details) {
|
|
43
|
-
let suffix = `${details.id ? `&id=${details.id}` : ""}${details.applicationId ? `&applicationId=${details.applicationId}` : ""}${details.name ? `&name=${details.name}` : ""}`;
|
|
44
|
-
return `${url}?${suffix.substring(1)}`;
|
|
45
|
-
}
|
|
46
|
-
create(details) {
|
|
47
|
-
return this.sendCreation(`${this.url}/platforms`, { applicationId: details.applicationId, name: details.name, details: details.details }, details.config);
|
|
48
|
-
}
|
|
49
|
-
createMany(details) {
|
|
50
|
-
return this.sendCreationMany(`${this.url}/platforms`, details.values ?? [], details.config);
|
|
51
|
-
}
|
|
52
|
-
modify(platform) {
|
|
53
|
-
return this.sendModification(`${this.url}/platforms/${platform.platformId}`, { applicationId: platform.applicationId, name: platform.name, details: platform.details }, platform.config);
|
|
54
|
-
}
|
|
55
|
-
destroy(platform) {
|
|
56
|
-
return this.sendDestruction(`${this.url}/platforms/${platform.platformId}`, platform.config);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
exports.PlatformManager = PlatformManager;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PlatformManager = void 0;
|
|
4
|
+
const CrudServiceManager_1 = require("../CrudServiceManager");
|
|
5
|
+
class PlatformManager extends CrudServiceManager_1.CrudServiceManager {
|
|
6
|
+
url;
|
|
7
|
+
constructor(url) {
|
|
8
|
+
super();
|
|
9
|
+
this.url = url;
|
|
10
|
+
}
|
|
11
|
+
find(details) {
|
|
12
|
+
return this.sendFinding(`${this.url}/platforms?name=${details.name}&applicationId=${details.applicationId}`, details.config);
|
|
13
|
+
}
|
|
14
|
+
findById(details) {
|
|
15
|
+
return this.sendFinding(`${this.url}/platforms?id=${details.id}`, details.config);
|
|
16
|
+
}
|
|
17
|
+
findByApplicationId(details) {
|
|
18
|
+
return this.sendAllFinding(`${this.url}/platforms?applicationId=${details.applicationId}`, details.config);
|
|
19
|
+
}
|
|
20
|
+
async count(details) {
|
|
21
|
+
let url = this.buildRequestUrl(`${this.url}/platforms`, details);
|
|
22
|
+
return (await this.sendCounting(url, details.config)) ?? 0;
|
|
23
|
+
}
|
|
24
|
+
async findAll(details) {
|
|
25
|
+
let platforms = [];
|
|
26
|
+
let url = this.buildRequestUrl(`${this.url}/platforms`, details);
|
|
27
|
+
if (details.limit) {
|
|
28
|
+
platforms = (await this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${details.limit}&offset=${details.offset}`, details.config)) ?? [];
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
let limit = 5000, offset = 0, isEmpty = false;
|
|
32
|
+
do {
|
|
33
|
+
let values = await this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${limit}&offset=${offset}`, details.config);
|
|
34
|
+
if (values)
|
|
35
|
+
platforms = platforms.concat(values);
|
|
36
|
+
isEmpty = values == undefined || values.length == 0;
|
|
37
|
+
offset += limit;
|
|
38
|
+
} while (!isEmpty);
|
|
39
|
+
}
|
|
40
|
+
return platforms;
|
|
41
|
+
}
|
|
42
|
+
buildRequestUrl(url, details) {
|
|
43
|
+
let suffix = `${details.id ? `&id=${details.id}` : ""}${details.applicationId ? `&applicationId=${details.applicationId}` : ""}${details.name ? `&name=${details.name}` : ""}`;
|
|
44
|
+
return `${url}?${suffix.substring(1)}`;
|
|
45
|
+
}
|
|
46
|
+
create(details) {
|
|
47
|
+
return this.sendCreation(`${this.url}/platforms`, { applicationId: details.applicationId, name: details.name, details: details.details }, details.config);
|
|
48
|
+
}
|
|
49
|
+
createMany(details) {
|
|
50
|
+
return this.sendCreationMany(`${this.url}/platforms`, details.values ?? [], details.config);
|
|
51
|
+
}
|
|
52
|
+
modify(platform) {
|
|
53
|
+
return this.sendModification(`${this.url}/platforms/${platform.platformId}`, { applicationId: platform.applicationId, name: platform.name, details: platform.details }, platform.config);
|
|
54
|
+
}
|
|
55
|
+
destroy(platform) {
|
|
56
|
+
return this.sendDestruction(`${this.url}/platforms/${platform.platformId}`, platform.config);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.PlatformManager = PlatformManager;
|
|
60
60
|
//# sourceMappingURL=PlatformManager.js.map
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { AxiosRequestConfig } from "axios";
|
|
2
|
-
import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
|
|
3
|
-
import { IComponent } from "./ComponentManager";
|
|
4
|
-
export interface IRole {
|
|
5
|
-
roleId?: number;
|
|
6
|
-
name?: string;
|
|
7
|
-
permissions?: IRolePermissions;
|
|
8
|
-
updatedAt?: string;
|
|
9
|
-
createdAt?: string;
|
|
10
|
-
config?: AxiosRequestConfig;
|
|
11
|
-
}
|
|
12
|
-
export interface IRolePermissions {
|
|
13
|
-
roleType?: string;
|
|
14
|
-
url?: string;
|
|
15
|
-
components?: Record<string, Record<string, string | string[]>>;
|
|
16
|
-
services?: Record<string, Record<string, Record<string, boolean>>>;
|
|
17
|
-
schema?: IComponent[];
|
|
18
|
-
}
|
|
19
|
-
export interface IRoleSearchDetails {
|
|
20
|
-
id?: string | number;
|
|
21
|
-
name?: string;
|
|
22
|
-
permissions?: IRolePermissions;
|
|
23
|
-
values?: IRole[];
|
|
24
|
-
limit?: number;
|
|
25
|
-
offset?: number;
|
|
26
|
-
config?: AxiosRequestConfig;
|
|
27
|
-
}
|
|
28
|
-
export declare class RoleManager extends CrudServiceManager<IRoleSearchDetails, IRole> {
|
|
29
|
-
private readonly url;
|
|
30
|
-
constructor(url: string);
|
|
31
|
-
find(details: IRoleSearchDetails): Promise<IRole | undefined>;
|
|
32
|
-
findById(details: StandardIdRequestDefinition): Promise<IRole | undefined>;
|
|
33
|
-
count(details: IRoleSearchDetails): Promise<number>;
|
|
34
|
-
findAll(details: IRoleSearchDetails): Promise<IRole[] | undefined>;
|
|
35
|
-
private buildRequestUrl;
|
|
36
|
-
create(details: IRoleSearchDetails): Promise<IRole | undefined>;
|
|
37
|
-
createMany(details: IRoleSearchDetails): Promise<IRole[] | undefined>;
|
|
38
|
-
modify(role: IRole): Promise<IRole | undefined>;
|
|
39
|
-
destroy(role: IRole): Promise<void | number>;
|
|
40
|
-
}
|
|
1
|
+
import { AxiosRequestConfig } from "axios";
|
|
2
|
+
import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
|
|
3
|
+
import { IComponent } from "./ComponentManager";
|
|
4
|
+
export interface IRole {
|
|
5
|
+
roleId?: number;
|
|
6
|
+
name?: string;
|
|
7
|
+
permissions?: IRolePermissions;
|
|
8
|
+
updatedAt?: string;
|
|
9
|
+
createdAt?: string;
|
|
10
|
+
config?: AxiosRequestConfig;
|
|
11
|
+
}
|
|
12
|
+
export interface IRolePermissions {
|
|
13
|
+
roleType?: string;
|
|
14
|
+
url?: string;
|
|
15
|
+
components?: Record<string, Record<string, string | string[]>>;
|
|
16
|
+
services?: Record<string, Record<string, Record<string, boolean>>>;
|
|
17
|
+
schema?: IComponent[];
|
|
18
|
+
}
|
|
19
|
+
export interface IRoleSearchDetails {
|
|
20
|
+
id?: string | number;
|
|
21
|
+
name?: string;
|
|
22
|
+
permissions?: IRolePermissions;
|
|
23
|
+
values?: IRole[];
|
|
24
|
+
limit?: number;
|
|
25
|
+
offset?: number;
|
|
26
|
+
config?: AxiosRequestConfig;
|
|
27
|
+
}
|
|
28
|
+
export declare class RoleManager extends CrudServiceManager<IRoleSearchDetails, IRole> {
|
|
29
|
+
private readonly url;
|
|
30
|
+
constructor(url: string);
|
|
31
|
+
find(details: IRoleSearchDetails): Promise<IRole | undefined>;
|
|
32
|
+
findById(details: StandardIdRequestDefinition): Promise<IRole | undefined>;
|
|
33
|
+
count(details: IRoleSearchDetails): Promise<number>;
|
|
34
|
+
findAll(details: IRoleSearchDetails): Promise<IRole[] | undefined>;
|
|
35
|
+
private buildRequestUrl;
|
|
36
|
+
create(details: IRoleSearchDetails): Promise<IRole | undefined>;
|
|
37
|
+
createMany(details: IRoleSearchDetails): Promise<IRole[] | undefined>;
|
|
38
|
+
modify(role: IRole): Promise<IRole | undefined>;
|
|
39
|
+
destroy(role: IRole): Promise<void | number>;
|
|
40
|
+
}
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RoleManager = void 0;
|
|
4
|
-
const CrudServiceManager_1 = require("../CrudServiceManager");
|
|
5
|
-
class RoleManager extends CrudServiceManager_1.CrudServiceManager {
|
|
6
|
-
url;
|
|
7
|
-
constructor(url) {
|
|
8
|
-
super();
|
|
9
|
-
this.url = url;
|
|
10
|
-
}
|
|
11
|
-
find(details) {
|
|
12
|
-
return this.sendFinding(`${this.url}/roles?name=${details.name}`, details.config);
|
|
13
|
-
}
|
|
14
|
-
findById(details) {
|
|
15
|
-
return this.sendFinding(`${this.url}/roles?id=${details.id}`, details.config);
|
|
16
|
-
}
|
|
17
|
-
async count(details) {
|
|
18
|
-
let url = this.buildRequestUrl(`${this.url}/roles`, details);
|
|
19
|
-
return (await this.sendCounting(url, details.config)) ?? 0;
|
|
20
|
-
}
|
|
21
|
-
async findAll(details) {
|
|
22
|
-
let roles = [];
|
|
23
|
-
let url = this.buildRequestUrl(`${this.url}/roles`, details);
|
|
24
|
-
if (details.limit) {
|
|
25
|
-
roles = (await this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${details.limit}&offset=${details.offset}`, details.config)) ?? [];
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
let limit = 5000, offset = 0, isEmpty = false;
|
|
29
|
-
do {
|
|
30
|
-
let values = await this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${limit}&offset=${offset}`, details.config);
|
|
31
|
-
if (values)
|
|
32
|
-
roles = roles.concat(values);
|
|
33
|
-
isEmpty = values == undefined || values.length == 0;
|
|
34
|
-
offset += limit;
|
|
35
|
-
} while (!isEmpty);
|
|
36
|
-
}
|
|
37
|
-
return roles;
|
|
38
|
-
}
|
|
39
|
-
buildRequestUrl(url, details) {
|
|
40
|
-
let suffix = `${details.id ? `&id=${details.id}` : ""}${details.name ? `&name=${details.name}` : ""}`;
|
|
41
|
-
return `${url}?${suffix.substring(1)}`;
|
|
42
|
-
}
|
|
43
|
-
create(details) {
|
|
44
|
-
return this.sendCreation(`${this.url}/roles`, { name: details.name, permissions: details.permissions }, details.config);
|
|
45
|
-
}
|
|
46
|
-
createMany(details) {
|
|
47
|
-
return this.sendCreationMany(`${this.url}/roles`, details.values ?? [], details.config);
|
|
48
|
-
}
|
|
49
|
-
modify(role) {
|
|
50
|
-
return this.sendModification(`${this.url}/roles/${role.roleId}`, { name: role.name, permissions: role.permissions }, role.config);
|
|
51
|
-
}
|
|
52
|
-
destroy(role) {
|
|
53
|
-
return this.sendDestruction(`${this.url}/roles/${role.roleId}`, role.config);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.RoleManager = RoleManager;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RoleManager = void 0;
|
|
4
|
+
const CrudServiceManager_1 = require("../CrudServiceManager");
|
|
5
|
+
class RoleManager extends CrudServiceManager_1.CrudServiceManager {
|
|
6
|
+
url;
|
|
7
|
+
constructor(url) {
|
|
8
|
+
super();
|
|
9
|
+
this.url = url;
|
|
10
|
+
}
|
|
11
|
+
find(details) {
|
|
12
|
+
return this.sendFinding(`${this.url}/roles?name=${details.name}`, details.config);
|
|
13
|
+
}
|
|
14
|
+
findById(details) {
|
|
15
|
+
return this.sendFinding(`${this.url}/roles?id=${details.id}`, details.config);
|
|
16
|
+
}
|
|
17
|
+
async count(details) {
|
|
18
|
+
let url = this.buildRequestUrl(`${this.url}/roles`, details);
|
|
19
|
+
return (await this.sendCounting(url, details.config)) ?? 0;
|
|
20
|
+
}
|
|
21
|
+
async findAll(details) {
|
|
22
|
+
let roles = [];
|
|
23
|
+
let url = this.buildRequestUrl(`${this.url}/roles`, details);
|
|
24
|
+
if (details.limit) {
|
|
25
|
+
roles = (await this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${details.limit}&offset=${details.offset}`, details.config)) ?? [];
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
let limit = 5000, offset = 0, isEmpty = false;
|
|
29
|
+
do {
|
|
30
|
+
let values = await this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${limit}&offset=${offset}`, details.config);
|
|
31
|
+
if (values)
|
|
32
|
+
roles = roles.concat(values);
|
|
33
|
+
isEmpty = values == undefined || values.length == 0;
|
|
34
|
+
offset += limit;
|
|
35
|
+
} while (!isEmpty);
|
|
36
|
+
}
|
|
37
|
+
return roles;
|
|
38
|
+
}
|
|
39
|
+
buildRequestUrl(url, details) {
|
|
40
|
+
let suffix = `${details.id ? `&id=${details.id}` : ""}${details.name ? `&name=${details.name}` : ""}`;
|
|
41
|
+
return `${url}?${suffix.substring(1)}`;
|
|
42
|
+
}
|
|
43
|
+
create(details) {
|
|
44
|
+
return this.sendCreation(`${this.url}/roles`, { name: details.name, permissions: details.permissions }, details.config);
|
|
45
|
+
}
|
|
46
|
+
createMany(details) {
|
|
47
|
+
return this.sendCreationMany(`${this.url}/roles`, details.values ?? [], details.config);
|
|
48
|
+
}
|
|
49
|
+
modify(role) {
|
|
50
|
+
return this.sendModification(`${this.url}/roles/${role.roleId}`, { name: role.name, permissions: role.permissions }, role.config);
|
|
51
|
+
}
|
|
52
|
+
destroy(role) {
|
|
53
|
+
return this.sendDestruction(`${this.url}/roles/${role.roleId}`, role.config);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.RoleManager = RoleManager;
|
|
57
57
|
//# sourceMappingURL=RoleManager.js.map
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
|
|
2
|
-
import { AxiosRequestConfig } from "axios";
|
|
3
|
-
export interface IStatus {
|
|
4
|
-
statusId?: number;
|
|
5
|
-
status?: string;
|
|
6
|
-
details?: Record<string, Record<string, string>>;
|
|
7
|
-
updatedAt?: string;
|
|
8
|
-
createdAt?: string;
|
|
9
|
-
config?: AxiosRequestConfig;
|
|
10
|
-
}
|
|
11
|
-
export interface IStatusSearchDetails {
|
|
12
|
-
id?: string | number;
|
|
13
|
-
status?: string;
|
|
14
|
-
details?: any;
|
|
15
|
-
values?: IStatus[];
|
|
16
|
-
limit?: number;
|
|
17
|
-
offset?: number;
|
|
18
|
-
config?: AxiosRequestConfig;
|
|
19
|
-
}
|
|
20
|
-
export declare class StatusManager extends CrudServiceManager<IStatusSearchDetails, IStatus> {
|
|
21
|
-
private readonly url;
|
|
22
|
-
constructor(url: string);
|
|
23
|
-
find(details: IStatusSearchDetails): Promise<IStatus | undefined>;
|
|
24
|
-
findById(details: StandardIdRequestDefinition): Promise<IStatus | undefined>;
|
|
25
|
-
count(details: IStatusSearchDetails): Promise<number>;
|
|
26
|
-
findAll(details: IStatusSearchDetails): Promise<IStatus[] | undefined>;
|
|
27
|
-
private buildRequestUrl;
|
|
28
|
-
create(details: IStatusSearchDetails): Promise<IStatus | undefined>;
|
|
29
|
-
createMany(details: IStatusSearchDetails): Promise<IStatus[] | undefined>;
|
|
30
|
-
modify(status: IStatus): Promise<IStatus | undefined>;
|
|
31
|
-
destroy(status: IStatus): Promise<void | number>;
|
|
32
|
-
}
|
|
1
|
+
import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
|
|
2
|
+
import { AxiosRequestConfig } from "axios";
|
|
3
|
+
export interface IStatus {
|
|
4
|
+
statusId?: number;
|
|
5
|
+
status?: string;
|
|
6
|
+
details?: Record<string, Record<string, string>>;
|
|
7
|
+
updatedAt?: string;
|
|
8
|
+
createdAt?: string;
|
|
9
|
+
config?: AxiosRequestConfig;
|
|
10
|
+
}
|
|
11
|
+
export interface IStatusSearchDetails {
|
|
12
|
+
id?: string | number;
|
|
13
|
+
status?: string;
|
|
14
|
+
details?: any;
|
|
15
|
+
values?: IStatus[];
|
|
16
|
+
limit?: number;
|
|
17
|
+
offset?: number;
|
|
18
|
+
config?: AxiosRequestConfig;
|
|
19
|
+
}
|
|
20
|
+
export declare class StatusManager extends CrudServiceManager<IStatusSearchDetails, IStatus> {
|
|
21
|
+
private readonly url;
|
|
22
|
+
constructor(url: string);
|
|
23
|
+
find(details: IStatusSearchDetails): Promise<IStatus | undefined>;
|
|
24
|
+
findById(details: StandardIdRequestDefinition): Promise<IStatus | undefined>;
|
|
25
|
+
count(details: IStatusSearchDetails): Promise<number>;
|
|
26
|
+
findAll(details: IStatusSearchDetails): Promise<IStatus[] | undefined>;
|
|
27
|
+
private buildRequestUrl;
|
|
28
|
+
create(details: IStatusSearchDetails): Promise<IStatus | undefined>;
|
|
29
|
+
createMany(details: IStatusSearchDetails): Promise<IStatus[] | undefined>;
|
|
30
|
+
modify(status: IStatus): Promise<IStatus | undefined>;
|
|
31
|
+
destroy(status: IStatus): Promise<void | number>;
|
|
32
|
+
}
|