itrm-tools 1.3.16-beta.9 → 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/CrudServiceManager.js.map +1 -1
- 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 -51
- package/dist/api/request/crud/common/ComponentManager.js +62 -62
- package/dist/api/request/crud/common/ComponentManager.js.map +1 -1
- 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 -44
- package/dist/api/request/crud/common/PlatformManager.js +59 -59
- package/dist/api/request/crud/common/PlatformManager.js.map +1 -1
- package/dist/api/request/crud/common/RoleManager.d.ts +40 -41
- package/dist/api/request/crud/common/RoleManager.js +56 -56
- package/dist/api/request/crud/common/RoleManager.js.map +1 -1
- 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 -63
- package/dist/index.js +126 -128
- package/dist/index.js.map +1 -1
- package/dist/types/api.d.ts +21 -21
- package/dist/types/api.js +2 -2
- package/package.json +1 -1
- package/dist/api/request/crud/common/ServiceSessionManager.d.ts +0 -24
- package/dist/api/request/crud/common/ServiceSessionManager.js +0 -109
- package/dist/api/request/crud/common/ServiceSessionManager.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentManager.js","sourceRoot":"","sources":["../../../../../src/api/request/crud/common/ComponentManager.ts"],"names":[],"mappings":";;;AACA,8DAAwF;
|
|
1
|
+
{"version":3,"file":"ComponentManager.js","sourceRoot":"","sources":["../../../../../src/api/request/crud/common/ComponentManager.ts"],"names":[],"mappings":";;;AACA,8DAAwF;AAoCxF,MAAa,gBAAiB,SAAQ,uCAAiD;IACpE,GAAG,CAAS;IAE7B,YAAY,GAAW;QACrB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAEM,IAAI,CAAC,OAAgC;QAC1C,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,GAAG,oBAAoB,OAAO,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACzF,CAAC;IAEM,QAAQ,CAAC,OAAoC;QAClD,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,GAAG,kBAAkB,OAAO,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACrF,CAAC;IAEM,gBAAgB,CAAC,OAAgC;QACtD,OAAO,IAAI,CAAC,cAAc,CAA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CAAC,OAAO,EAAE,EACtH,OAAO,CAAC,MAAM,CACf,CAAC;IACJ,CAAC;IAEM,UAAU,CAAC,OAAgC;QAChD,OAAO,IAAI,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,GAAG,aAAa,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/F,CAAC;IAEM,MAAM,CAAC,SAAqB;QACjC,OAAO,IAAI,CAAC,gBAAgB,CAC1B,GAAG,IAAI,CAAC,GAAG,eAAe,SAAS,CAAC,WAAW,EAAE,EACjD,EAAE,aAAa,EAAE,SAAS,CAAC,aAAa,EAAE,UAAU,EAAE,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE,EAC9H,SAAS,CAAC,MAAM,CACjB,CAAC;IACJ,CAAC;IAEM,OAAO,CAAC,SAAqB;QAClC,OAAO,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,GAAG,eAAe,SAAS,CAAC,WAAW,EAAE,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACnG,CAAC;CAEF;AA5ED,4CA4EC"}
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
|
|
2
|
-
import { AxiosRequestConfig } from "axios";
|
|
3
|
-
export interface IKey {
|
|
4
|
-
keyId?: number;
|
|
5
|
-
userId?: string;
|
|
6
|
-
lastNonce?: number;
|
|
7
|
-
publicKey?: string;
|
|
8
|
-
secretKey?: string;
|
|
9
|
-
signKey?: string;
|
|
10
|
-
details?: any;
|
|
11
|
-
updatedAt?: string;
|
|
12
|
-
createdAt?: string;
|
|
13
|
-
config?: AxiosRequestConfig;
|
|
14
|
-
}
|
|
15
|
-
export interface IKeySearchDetails {
|
|
16
|
-
id?: string | number;
|
|
17
|
-
userId?: string;
|
|
18
|
-
lastNonce?: number;
|
|
19
|
-
publicKey?: string;
|
|
20
|
-
secretKey?: string;
|
|
21
|
-
signKey?: string;
|
|
22
|
-
details?: any;
|
|
23
|
-
limit?: number;
|
|
24
|
-
offset?: number;
|
|
25
|
-
values?: IKey[];
|
|
26
|
-
config?: AxiosRequestConfig;
|
|
27
|
-
}
|
|
28
|
-
export declare class KeyManager extends CrudServiceManager<IKeySearchDetails, IKey> {
|
|
29
|
-
private readonly url;
|
|
30
|
-
constructor(url: string);
|
|
31
|
-
find(details: IKeySearchDetails): Promise<IKey | undefined>;
|
|
32
|
-
findById(details: StandardIdRequestDefinition): Promise<IKey | undefined>;
|
|
33
|
-
findByUserId(details: IKeySearchDetails): Promise<IKey[] | undefined>;
|
|
34
|
-
findAll(details: IKeySearchDetails): Promise<IKey[] | undefined>;
|
|
35
|
-
private buildRequestUrl;
|
|
36
|
-
count(details: IKeySearchDetails): Promise<number>;
|
|
37
|
-
create(details: IKeySearchDetails): Promise<IKey | undefined>;
|
|
38
|
-
createMany(details: IKeySearchDetails): Promise<IKey[] | undefined>;
|
|
39
|
-
modify(key: IKey): Promise<IKey | undefined>;
|
|
40
|
-
destroy(key: IKey): Promise<void | number>;
|
|
41
|
-
}
|
|
1
|
+
import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
|
|
2
|
+
import { AxiosRequestConfig } from "axios";
|
|
3
|
+
export interface IKey {
|
|
4
|
+
keyId?: number;
|
|
5
|
+
userId?: string;
|
|
6
|
+
lastNonce?: number;
|
|
7
|
+
publicKey?: string;
|
|
8
|
+
secretKey?: string;
|
|
9
|
+
signKey?: string;
|
|
10
|
+
details?: any;
|
|
11
|
+
updatedAt?: string;
|
|
12
|
+
createdAt?: string;
|
|
13
|
+
config?: AxiosRequestConfig;
|
|
14
|
+
}
|
|
15
|
+
export interface IKeySearchDetails {
|
|
16
|
+
id?: string | number;
|
|
17
|
+
userId?: string;
|
|
18
|
+
lastNonce?: number;
|
|
19
|
+
publicKey?: string;
|
|
20
|
+
secretKey?: string;
|
|
21
|
+
signKey?: string;
|
|
22
|
+
details?: any;
|
|
23
|
+
limit?: number;
|
|
24
|
+
offset?: number;
|
|
25
|
+
values?: IKey[];
|
|
26
|
+
config?: AxiosRequestConfig;
|
|
27
|
+
}
|
|
28
|
+
export declare class KeyManager extends CrudServiceManager<IKeySearchDetails, IKey> {
|
|
29
|
+
private readonly url;
|
|
30
|
+
constructor(url: string);
|
|
31
|
+
find(details: IKeySearchDetails): Promise<IKey | undefined>;
|
|
32
|
+
findById(details: StandardIdRequestDefinition): Promise<IKey | undefined>;
|
|
33
|
+
findByUserId(details: IKeySearchDetails): Promise<IKey[] | undefined>;
|
|
34
|
+
findAll(details: IKeySearchDetails): Promise<IKey[] | undefined>;
|
|
35
|
+
private buildRequestUrl;
|
|
36
|
+
count(details: IKeySearchDetails): Promise<number>;
|
|
37
|
+
create(details: IKeySearchDetails): Promise<IKey | undefined>;
|
|
38
|
+
createMany(details: IKeySearchDetails): Promise<IKey[] | undefined>;
|
|
39
|
+
modify(key: IKey): Promise<IKey | undefined>;
|
|
40
|
+
destroy(key: IKey): Promise<void | number>;
|
|
41
|
+
}
|
|
@@ -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,44 +1,41 @@
|
|
|
1
|
-
import { AxiosRequestConfig } from "axios";
|
|
2
|
-
import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
modify(platform: IPlatform): Promise<IPlatform | undefined>;
|
|
43
|
-
destroy(platform: IPlatform): Promise<void | number>;
|
|
44
|
-
}
|
|
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.
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformManager.js","sourceRoot":"","sources":["../../../../../src/api/request/crud/common/PlatformManager.ts"],"names":[],"mappings":";;;AACA,8DAAwF;
|
|
1
|
+
{"version":3,"file":"PlatformManager.js","sourceRoot":"","sources":["../../../../../src/api/request/crud/common/PlatformManager.ts"],"names":[],"mappings":";;;AACA,8DAAwF;AA8BxF,MAAa,eAAgB,SAAQ,uCAAqD;IACvE,GAAG,CAAS;IAE7B,YAAY,GAAW;QACrB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAEM,IAAI,CAAC,OAA+B;QACzC,OAAO,IAAI,CAAC,WAAW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C,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,EACtF,OAAO,CAAC,MAAM,CACf,CAAC;IACJ,CAAC;IAEM,UAAU,CAAC,OAA+B;QAC/C,OAAO,IAAI,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,GAAG,YAAY,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9F,CAAC;IAEM,MAAM,CAAC,QAAmB;QAC/B,OAAO,IAAI,CAAC,gBAAgB,CAC1B,GAAG,IAAI,CAAC,GAAG,cAAc,QAAQ,CAAC,UAAU,EAAE,EAC9C,EAAE,aAAa,EAAE,QAAQ,CAAC,aAAa,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,EACzF,QAAQ,CAAC,MAAM,CAChB,CAAC;IACJ,CAAC;IAEM,OAAO,CAAC,QAAmB;QAChC,OAAO,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,GAAG,cAAc,QAAQ,CAAC,UAAU,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/F,CAAC;CACF;AAvED,0CAuEC"}
|
|
@@ -1,41 +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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
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
|
+
}
|