itrm-tools 1.3.17 → 1.3.19-beta.1

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.
Files changed (51) hide show
  1. package/dist/api/alegra/AlegraConnectionManager.d.ts +30 -30
  2. package/dist/api/check/route/CorsCheckApiRouter.js +1 -1
  3. package/dist/api/check/route/CorsCheckApiRouter.js.map +1 -1
  4. package/dist/api/check/route/SimpleCheckableAPIRouter.js +4 -1
  5. package/dist/api/check/route/SimpleCheckableAPIRouter.js.map +1 -1
  6. package/dist/api/express/ExpressStandardConfiguration.js +7 -2
  7. package/dist/api/express/ExpressStandardConfiguration.js.map +1 -1
  8. package/dist/api/request/crud/CrudManager.d.ts +11 -11
  9. package/dist/api/request/crud/CrudServiceManager.d.ts +28 -28
  10. package/dist/api/request/crud/CrudServiceManager.js +98 -98
  11. package/dist/api/request/crud/CrudServiceManager.js.map +1 -1
  12. package/dist/api/request/crud/common/ActivityHistoryManager.d.ts +38 -38
  13. package/dist/api/request/crud/common/ActivityHistoryManager.js +68 -68
  14. package/dist/api/request/crud/common/ApplicationManager.d.ts +37 -37
  15. package/dist/api/request/crud/common/ApplicationManager.js +56 -56
  16. package/dist/api/request/crud/common/AvailablePlatformManager.d.ts +38 -38
  17. package/dist/api/request/crud/common/AvailablePlatformManager.js +68 -68
  18. package/dist/api/request/crud/common/ComponentManager.d.ts +51 -48
  19. package/dist/api/request/crud/common/ComponentManager.js +62 -62
  20. package/dist/api/request/crud/common/ComponentManager.js.map +1 -1
  21. package/dist/api/request/crud/common/KeyManager.d.ts +41 -41
  22. package/dist/api/request/crud/common/KeyManager.js +69 -69
  23. package/dist/api/request/crud/common/PlatformManager.d.ts +44 -41
  24. package/dist/api/request/crud/common/PlatformManager.js +59 -59
  25. package/dist/api/request/crud/common/PlatformManager.js.map +1 -1
  26. package/dist/api/request/crud/common/RoleManager.d.ts +41 -40
  27. package/dist/api/request/crud/common/RoleManager.js +56 -56
  28. package/dist/api/request/crud/common/RoleManager.js.map +1 -1
  29. package/dist/api/request/crud/common/ServiceSessionManager.d.ts +29 -0
  30. package/dist/api/request/crud/common/ServiceSessionManager.js +224 -0
  31. package/dist/api/request/crud/common/ServiceSessionManager.js.map +1 -0
  32. package/dist/api/request/crud/common/StatusManager.d.ts +32 -32
  33. package/dist/api/request/crud/common/StatusManager.js +56 -56
  34. package/dist/api/request/crud/common/TypeManager.d.ts +32 -32
  35. package/dist/api/request/crud/common/TypeManager.js +56 -56
  36. package/dist/api/request/crud/common/UserCredentialsManager.d.ts +37 -37
  37. package/dist/api/request/crud/common/UserCredentialsManager.js +66 -66
  38. package/dist/api/request/crud/common/UserManager.d.ts +38 -38
  39. package/dist/api/request/crud/common/UserManager.js +62 -62
  40. package/dist/api/utils/Response.d.ts +25 -25
  41. package/dist/api/utils/Response.js +85 -85
  42. package/dist/cryptography/jwt/JwtUtils.d.ts +18 -18
  43. package/dist/cryptography/jwt/JwtUtils.js +36 -36
  44. package/dist/cryptography/password/PasswordUtils.d.ts +6 -6
  45. package/dist/cryptography/password/PasswordUtils.js +34 -34
  46. package/dist/index.d.ts +63 -62
  47. package/dist/index.js +128 -126
  48. package/dist/index.js.map +1 -1
  49. package/dist/types/api.d.ts +21 -21
  50. package/dist/types/api.js +2 -2
  51. package/package.json +6 -6
@@ -1,37 +1,37 @@
1
- import { AxiosRequestConfig } from "axios";
2
- import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
3
- export interface IApplication {
4
- applicationId?: number;
5
- name?: string;
6
- details?: IApplicationDetails;
7
- updatedAt?: string;
8
- createdAt?: string;
9
- config?: AxiosRequestConfig;
10
- }
11
- export interface IApplicationDetails {
12
- lang: Record<string, string>;
13
- description?: string;
14
- config?: AxiosRequestConfig;
15
- }
16
- export interface IApplicationSearchDetails {
17
- id?: string | number;
18
- name?: string;
19
- details?: any;
20
- values?: IApplication[];
21
- limit?: number;
22
- offset?: number;
23
- config?: AxiosRequestConfig;
24
- }
25
- export declare class ApplicationManager extends CrudServiceManager<IApplicationSearchDetails, IApplication> {
26
- private readonly url;
27
- constructor(url: string);
28
- find(details: IApplicationSearchDetails): Promise<IApplication | undefined>;
29
- findById(details: StandardIdRequestDefinition): Promise<IApplication | undefined>;
30
- count(details: IApplicationSearchDetails): Promise<number>;
31
- findAll(details: IApplicationSearchDetails): Promise<IApplication[] | undefined>;
32
- private buildRequestUrl;
33
- create(details: IApplicationSearchDetails): Promise<IApplication | undefined>;
34
- createMany(details: IApplicationSearchDetails): Promise<IApplication[] | undefined>;
35
- modify(application: IApplication): Promise<IApplication | undefined>;
36
- destroy(application: IApplication): Promise<void | number>;
37
- }
1
+ import { AxiosRequestConfig } from "axios";
2
+ import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
3
+ export interface IApplication {
4
+ applicationId?: number;
5
+ name?: string;
6
+ details?: IApplicationDetails;
7
+ updatedAt?: string;
8
+ createdAt?: string;
9
+ config?: AxiosRequestConfig;
10
+ }
11
+ export interface IApplicationDetails {
12
+ lang: Record<string, string>;
13
+ description?: string;
14
+ config?: AxiosRequestConfig;
15
+ }
16
+ export interface IApplicationSearchDetails {
17
+ id?: string | number;
18
+ name?: string;
19
+ details?: any;
20
+ values?: IApplication[];
21
+ limit?: number;
22
+ offset?: number;
23
+ config?: AxiosRequestConfig;
24
+ }
25
+ export declare class ApplicationManager extends CrudServiceManager<IApplicationSearchDetails, IApplication> {
26
+ private readonly url;
27
+ constructor(url: string);
28
+ find(details: IApplicationSearchDetails): Promise<IApplication | undefined>;
29
+ findById(details: StandardIdRequestDefinition): Promise<IApplication | undefined>;
30
+ count(details: IApplicationSearchDetails): Promise<number>;
31
+ findAll(details: IApplicationSearchDetails): Promise<IApplication[] | undefined>;
32
+ private buildRequestUrl;
33
+ create(details: IApplicationSearchDetails): Promise<IApplication | undefined>;
34
+ createMany(details: IApplicationSearchDetails): Promise<IApplication[] | undefined>;
35
+ modify(application: IApplication): Promise<IApplication | undefined>;
36
+ destroy(application: IApplication): Promise<void | number>;
37
+ }
@@ -1,57 +1,57 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ApplicationManager = void 0;
4
- const CrudServiceManager_1 = require("../CrudServiceManager");
5
- class ApplicationManager 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}/applications?name=${details.name}`, details.config);
13
- }
14
- findById(details) {
15
- return this.sendFinding(`${this.url}/applications?id=${details.id}`, details.config);
16
- }
17
- async count(details) {
18
- let url = this.buildRequestUrl(`${this.url}/applications`, details);
19
- return (await this.sendCounting(url, details.config)) ?? 0;
20
- }
21
- async findAll(details) {
22
- let applications = [];
23
- let url = this.buildRequestUrl(`${this.url}/applications`, details);
24
- if (details.limit) {
25
- applications = (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
- applications = applications.concat(values);
33
- isEmpty = values == undefined || values.length == 0;
34
- offset += limit;
35
- } while (!isEmpty);
36
- }
37
- return applications;
38
- }
39
- buildRequestUrl(url, details) {
40
- let suffix = `${details.name ? `&name=${details.name}` : ""}${details.id ? `&id=${details.id}` : ""}`;
41
- return `${url}?${suffix.substring(1)}`;
42
- }
43
- create(details) {
44
- return this.sendCreation(`${this.url}/applications`, { name: details.name, details: details.details }, details.config);
45
- }
46
- createMany(details) {
47
- return this.sendCreationMany(`${this.url}/applications`, details.values ?? [], details.config);
48
- }
49
- modify(application) {
50
- return this.sendModification(`${this.url}/applications/${application.applicationId}`, { name: application.name, details: application.details }, application.config);
51
- }
52
- destroy(application) {
53
- return this.sendDestruction(`${this.url}/applications/${application.applicationId}`, application.config);
54
- }
55
- }
56
- exports.ApplicationManager = ApplicationManager;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApplicationManager = void 0;
4
+ const CrudServiceManager_1 = require("../CrudServiceManager");
5
+ class ApplicationManager 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}/applications?name=${details.name}`, details.config);
13
+ }
14
+ findById(details) {
15
+ return this.sendFinding(`${this.url}/applications?id=${details.id}`, details.config);
16
+ }
17
+ async count(details) {
18
+ let url = this.buildRequestUrl(`${this.url}/applications`, details);
19
+ return (await this.sendCounting(url, details.config)) ?? 0;
20
+ }
21
+ async findAll(details) {
22
+ let applications = [];
23
+ let url = this.buildRequestUrl(`${this.url}/applications`, details);
24
+ if (details.limit) {
25
+ applications = (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
+ applications = applications.concat(values);
33
+ isEmpty = values == undefined || values.length == 0;
34
+ offset += limit;
35
+ } while (!isEmpty);
36
+ }
37
+ return applications;
38
+ }
39
+ buildRequestUrl(url, details) {
40
+ let suffix = `${details.name ? `&name=${details.name}` : ""}${details.id ? `&id=${details.id}` : ""}`;
41
+ return `${url}?${suffix.substring(1)}`;
42
+ }
43
+ create(details) {
44
+ return this.sendCreation(`${this.url}/applications`, { name: details.name, details: details.details }, details.config);
45
+ }
46
+ createMany(details) {
47
+ return this.sendCreationMany(`${this.url}/applications`, details.values ?? [], details.config);
48
+ }
49
+ modify(application) {
50
+ return this.sendModification(`${this.url}/applications/${application.applicationId}`, { name: application.name, details: application.details }, application.config);
51
+ }
52
+ destroy(application) {
53
+ return this.sendDestruction(`${this.url}/applications/${application.applicationId}`, application.config);
54
+ }
55
+ }
56
+ exports.ApplicationManager = ApplicationManager;
57
57
  //# sourceMappingURL=ApplicationManager.js.map
@@ -1,38 +1,38 @@
1
- import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
2
- import { AxiosRequestConfig } from "axios";
3
- export interface IAvailablePlatform {
4
- availablePlatformId?: number;
5
- userId?: string;
6
- roleId?: number;
7
- platformId?: number;
8
- applicationId?: number;
9
- restrictions?: any;
10
- updatedAt?: string;
11
- createdAt?: string;
12
- config?: AxiosRequestConfig;
13
- }
14
- export interface IAvailablePlatformSearchDetails {
15
- id?: string | number;
16
- userId?: string;
17
- roleId?: number;
18
- platformId?: number;
19
- applicationId?: number;
20
- restrictions?: any;
21
- values?: IAvailablePlatform[];
22
- limit?: number;
23
- offset?: number;
24
- config?: AxiosRequestConfig;
25
- }
26
- export declare class AvailablePlatformManager extends CrudServiceManager<IAvailablePlatformSearchDetails, IAvailablePlatform> {
27
- private readonly url;
28
- constructor(url: string);
29
- find(details: IAvailablePlatformSearchDetails): Promise<IAvailablePlatform | undefined>;
30
- findById(details: StandardIdRequestDefinition): Promise<IAvailablePlatform | undefined>;
31
- count(details: IAvailablePlatformSearchDetails): Promise<number>;
32
- findAll(details: IAvailablePlatformSearchDetails): Promise<IAvailablePlatform[] | undefined>;
33
- private buildRequestUrl;
34
- create(details: IAvailablePlatformSearchDetails): Promise<IAvailablePlatform | undefined>;
35
- createMany(details: IAvailablePlatformSearchDetails): Promise<IAvailablePlatform[] | undefined>;
36
- modify(availablePlatform: IAvailablePlatform): Promise<IAvailablePlatform | undefined>;
37
- destroy(availablePlatforms: IAvailablePlatform): Promise<void | number>;
38
- }
1
+ import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
2
+ import { AxiosRequestConfig } from "axios";
3
+ export interface IAvailablePlatform {
4
+ availablePlatformId?: number;
5
+ userId?: string;
6
+ roleId?: number;
7
+ platformId?: number;
8
+ applicationId?: number;
9
+ restrictions?: any;
10
+ updatedAt?: string;
11
+ createdAt?: string;
12
+ config?: AxiosRequestConfig;
13
+ }
14
+ export interface IAvailablePlatformSearchDetails {
15
+ id?: string | number;
16
+ userId?: string;
17
+ roleId?: number;
18
+ platformId?: number;
19
+ applicationId?: number;
20
+ restrictions?: any;
21
+ values?: IAvailablePlatform[];
22
+ limit?: number;
23
+ offset?: number;
24
+ config?: AxiosRequestConfig;
25
+ }
26
+ export declare class AvailablePlatformManager extends CrudServiceManager<IAvailablePlatformSearchDetails, IAvailablePlatform> {
27
+ private readonly url;
28
+ constructor(url: string);
29
+ find(details: IAvailablePlatformSearchDetails): Promise<IAvailablePlatform | undefined>;
30
+ findById(details: StandardIdRequestDefinition): Promise<IAvailablePlatform | undefined>;
31
+ count(details: IAvailablePlatformSearchDetails): Promise<number>;
32
+ findAll(details: IAvailablePlatformSearchDetails): Promise<IAvailablePlatform[] | undefined>;
33
+ private buildRequestUrl;
34
+ create(details: IAvailablePlatformSearchDetails): Promise<IAvailablePlatform | undefined>;
35
+ createMany(details: IAvailablePlatformSearchDetails): Promise<IAvailablePlatform[] | undefined>;
36
+ modify(availablePlatform: IAvailablePlatform): Promise<IAvailablePlatform | undefined>;
37
+ destroy(availablePlatforms: IAvailablePlatform): Promise<void | number>;
38
+ }
@@ -1,69 +1,69 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AvailablePlatformManager = void 0;
4
- const CrudServiceManager_1 = require("../CrudServiceManager");
5
- class AvailablePlatformManager 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}/availablePlatforms?userId=${details.userId}&roleId=${details.roleId}&platformId=${details.platformId}`, details.config);
13
- }
14
- findById(details) {
15
- return this.sendFinding(`${this.url}/availablePlatforms?id=${details.id}`, details.config);
16
- }
17
- async count(details) {
18
- let url = this.buildRequestUrl(`${this.url}/availablePlatforms`, details);
19
- return (await this.sendCounting(url, details.config)) ?? 0;
20
- }
21
- async findAll(details) {
22
- let availablePlatforms = [];
23
- let url = this.buildRequestUrl(`${this.url}/availablePlatforms`, details);
24
- if (details.limit) {
25
- availablePlatforms = (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
- availablePlatforms = availablePlatforms.concat(values);
33
- isEmpty = values == undefined || values.length == 0;
34
- offset += limit;
35
- } while (!isEmpty);
36
- }
37
- return availablePlatforms;
38
- }
39
- buildRequestUrl(url, details) {
40
- let suffix = `${details.id ? `&id=${details.id}` : ""}${details.applicationId ? `&applicationId=${details.applicationId}` : ""}${details.platformId ? `&platformId=${details.platformId}` : ""}${details.userId ? `&userId=${details.userId}` : ""}${details.roleId ? `&roleId=${details.roleId}` : ""}`;
41
- return `${url}?${suffix.substring(1)}`;
42
- }
43
- create(details) {
44
- return this.sendCreation(`${this.url}/availablePlatforms`, {
45
- userId: details.userId,
46
- platformId: details.platformId,
47
- roleId: details.roleId,
48
- applicationId: details.applicationId,
49
- restrictions: details.restrictions
50
- }, details.config);
51
- }
52
- createMany(details) {
53
- return this.sendCreationMany(`${this.url}/availablePlatforms`, details.values ?? [], details.config);
54
- }
55
- modify(availablePlatform) {
56
- return this.sendModification(`${this.url}/availablePlatforms/${availablePlatform.availablePlatformId}`, {
57
- userId: availablePlatform.userId,
58
- platformId: availablePlatform.platformId,
59
- roleId: availablePlatform.roleId,
60
- applicationId: availablePlatform.applicationId,
61
- restrictions: availablePlatform.restrictions
62
- }, availablePlatform.config);
63
- }
64
- destroy(availablePlatforms) {
65
- return this.sendDestruction(`${this.url}/availablePlatforms/${availablePlatforms.availablePlatformId}`, availablePlatforms.config);
66
- }
67
- }
68
- exports.AvailablePlatformManager = AvailablePlatformManager;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AvailablePlatformManager = void 0;
4
+ const CrudServiceManager_1 = require("../CrudServiceManager");
5
+ class AvailablePlatformManager 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}/availablePlatforms?userId=${details.userId}&roleId=${details.roleId}&platformId=${details.platformId}`, details.config);
13
+ }
14
+ findById(details) {
15
+ return this.sendFinding(`${this.url}/availablePlatforms?id=${details.id}`, details.config);
16
+ }
17
+ async count(details) {
18
+ let url = this.buildRequestUrl(`${this.url}/availablePlatforms`, details);
19
+ return (await this.sendCounting(url, details.config)) ?? 0;
20
+ }
21
+ async findAll(details) {
22
+ let availablePlatforms = [];
23
+ let url = this.buildRequestUrl(`${this.url}/availablePlatforms`, details);
24
+ if (details.limit) {
25
+ availablePlatforms = (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
+ availablePlatforms = availablePlatforms.concat(values);
33
+ isEmpty = values == undefined || values.length == 0;
34
+ offset += limit;
35
+ } while (!isEmpty);
36
+ }
37
+ return availablePlatforms;
38
+ }
39
+ buildRequestUrl(url, details) {
40
+ let suffix = `${details.id ? `&id=${details.id}` : ""}${details.applicationId ? `&applicationId=${details.applicationId}` : ""}${details.platformId ? `&platformId=${details.platformId}` : ""}${details.userId ? `&userId=${details.userId}` : ""}${details.roleId ? `&roleId=${details.roleId}` : ""}`;
41
+ return `${url}?${suffix.substring(1)}`;
42
+ }
43
+ create(details) {
44
+ return this.sendCreation(`${this.url}/availablePlatforms`, {
45
+ userId: details.userId,
46
+ platformId: details.platformId,
47
+ roleId: details.roleId,
48
+ applicationId: details.applicationId,
49
+ restrictions: details.restrictions
50
+ }, details.config);
51
+ }
52
+ createMany(details) {
53
+ return this.sendCreationMany(`${this.url}/availablePlatforms`, details.values ?? [], details.config);
54
+ }
55
+ modify(availablePlatform) {
56
+ return this.sendModification(`${this.url}/availablePlatforms/${availablePlatform.availablePlatformId}`, {
57
+ userId: availablePlatform.userId,
58
+ platformId: availablePlatform.platformId,
59
+ roleId: availablePlatform.roleId,
60
+ applicationId: availablePlatform.applicationId,
61
+ restrictions: availablePlatform.restrictions
62
+ }, availablePlatform.config);
63
+ }
64
+ destroy(availablePlatforms) {
65
+ return this.sendDestruction(`${this.url}/availablePlatforms/${availablePlatforms.availablePlatformId}`, availablePlatforms.config);
66
+ }
67
+ }
68
+ exports.AvailablePlatformManager = AvailablePlatformManager;
69
69
  //# sourceMappingURL=AvailablePlatformManager.js.map
@@ -1,48 +1,51 @@
1
- import { AxiosRequestConfig } from "axios";
2
- import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
3
- import { IPlatform } from "./PlatformManager";
4
- import { IApplication } from "./ApplicationManager";
5
- export interface IComponent {
6
- componentId?: number;
7
- platformId?: number;
8
- applicationId?: number;
9
- name?: string;
10
- details?: IComponentDetails;
11
- platforms?: IPlatform[];
12
- applications?: IApplication[];
13
- updatedAt?: string;
14
- createdAt?: string;
15
- config?: AxiosRequestConfig;
16
- }
17
- export interface IComponentDetails {
18
- lang: Record<string, string>;
19
- services: Record<string, Record<string, Record<string, boolean>>>;
20
- viewTypes: string[] | string;
21
- config?: AxiosRequestConfig;
22
- }
23
- export interface IComponentSearchDetails {
24
- id?: string | number;
25
- platformId?: number;
26
- applicationId?: number;
27
- name?: string;
28
- details?: IComponentDetails;
29
- values?: IComponent[];
30
- limit?: number;
31
- offset?: number;
32
- config?: AxiosRequestConfig;
33
- }
34
- export declare class ComponentManager extends CrudServiceManager<IComponentDetails, IComponent> {
35
- private readonly url;
36
- constructor(url: string);
37
- find(details: IComponentSearchDetails): Promise<IComponent | undefined>;
38
- findById(details: StandardIdRequestDefinition): Promise<IComponent | undefined>;
39
- findByPlatformId(details: IComponentSearchDetails): Promise<IComponent[] | undefined>;
40
- findByApplicationId(details: IComponentSearchDetails): Promise<IComponent[] | undefined>;
41
- count(details: IComponentSearchDetails): Promise<number>;
42
- findAll(details: IComponentSearchDetails): Promise<IComponent[] | undefined>;
43
- private buildRequestUrl;
44
- create(details: IComponentSearchDetails): Promise<IComponent | undefined>;
45
- createMany(details: IComponentSearchDetails): Promise<IComponent[] | undefined>;
46
- modify(component: IComponent): Promise<IComponent | undefined>;
47
- destroy(component: IComponent): Promise<void | number>;
48
- }
1
+ import { AxiosRequestConfig } from "axios";
2
+ import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
3
+ import { IPlatform } from "./PlatformManager";
4
+ import { IApplication } from "./ApplicationManager";
5
+ export interface IComponent {
6
+ componentId?: number;
7
+ platformId?: number;
8
+ applicationId?: number;
9
+ name?: string;
10
+ details?: IComponentDetails;
11
+ platforms?: IPlatform;
12
+ applications?: IApplication;
13
+ updatedAt?: string;
14
+ createdAt?: string;
15
+ config?: AxiosRequestConfig;
16
+ }
17
+ export interface IComponentDetails {
18
+ lang: Record<string, string>;
19
+ views: {
20
+ name: string;
21
+ services: Record<string, Record<string, Record<string, boolean>>>;
22
+ }[];
23
+ config?: AxiosRequestConfig;
24
+ }
25
+ export interface IComponentSearchDetails {
26
+ id?: string | number;
27
+ platformId?: number;
28
+ applicationId?: number;
29
+ name?: string;
30
+ platform?: boolean;
31
+ details?: IComponentDetails;
32
+ values?: IComponent[];
33
+ limit?: number;
34
+ offset?: number;
35
+ config?: AxiosRequestConfig;
36
+ }
37
+ export declare class ComponentManager extends CrudServiceManager<IComponentDetails, IComponent> {
38
+ private readonly url;
39
+ constructor(url: string);
40
+ find(details: IComponentSearchDetails): Promise<IComponent | undefined>;
41
+ findById(details: StandardIdRequestDefinition): Promise<IComponent | undefined>;
42
+ findByPlatformId(details: IComponentSearchDetails): Promise<IComponent[] | undefined>;
43
+ findByApplicationId(details: IComponentSearchDetails): Promise<IComponent[] | undefined>;
44
+ count(details: IComponentSearchDetails): Promise<number>;
45
+ findAll(details: IComponentSearchDetails): Promise<IComponent[] | undefined>;
46
+ private buildRequestUrl;
47
+ create(details: IComponentSearchDetails): Promise<IComponent | undefined>;
48
+ createMany(details: IComponentSearchDetails): Promise<IComponent[] | undefined>;
49
+ modify(component: IComponent): Promise<IComponent | undefined>;
50
+ destroy(component: IComponent): Promise<void | number>;
51
+ }
@@ -1,63 +1,63 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ComponentManager = void 0;
4
- const CrudServiceManager_1 = require("../CrudServiceManager");
5
- class ComponentManager 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}/components?name=${details.name}`, details.config);
13
- }
14
- findById(details) {
15
- return this.sendFinding(`${this.url}/components?id=${details.id}`, details.config);
16
- }
17
- findByPlatformId(details) {
18
- return this.sendAllFinding(`${this.url}/components?platformId=${details.platformId}`, details.config);
19
- }
20
- findByApplicationId(details) {
21
- return this.sendAllFinding(`${this.url}/components?applicationId=${details.applicationId}`, details.config);
22
- }
23
- async count(details) {
24
- let url = this.buildRequestUrl(`${this.url}/components`, details);
25
- return (await this.sendCounting(url, details.config)) ?? 0;
26
- }
27
- async findAll(details) {
28
- let components = [];
29
- let url = this.buildRequestUrl(`${this.url}/components`, details);
30
- if (details.limit) {
31
- components = (await this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${details.limit}&offset=${details.offset}`, details.config)) ?? [];
32
- }
33
- else {
34
- let limit = 5000, offset = 0, isEmpty = false;
35
- do {
36
- let values = await this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${limit}&offset=${offset}`, details.config);
37
- if (values)
38
- components = components.concat(values);
39
- isEmpty = values == undefined || values.length == 0;
40
- offset += limit;
41
- } while (!isEmpty);
42
- }
43
- return components;
44
- }
45
- buildRequestUrl(url, details) {
46
- let suffix = `${details.id ? `&id=${details.id}` : ""}${details.applicationId ? `&applicationId=${details.applicationId}` : ""}${details.platformId ? `&platformId=${details.platformId}` : ""}${details.name ? `&name=${details.name}` : ""}`;
47
- return `${url}?${suffix.substring(1)}`;
48
- }
49
- create(details) {
50
- return this.sendCreation(`${this.url}/components`, { applicationId: details.applicationId, platformId: details.platformId, name: details.name, details: details.details }, details.config);
51
- }
52
- createMany(details) {
53
- return this.sendCreationMany(`${this.url}/components`, details.values ?? [], details.config);
54
- }
55
- modify(component) {
56
- return this.sendModification(`${this.url}/components/${component.componentId}`, { applicationId: component.applicationId, platformId: component.platformId, name: component.name, details: component.details }, component.config);
57
- }
58
- destroy(component) {
59
- return this.sendDestruction(`${this.url}/components/${component.componentId}`, component.config);
60
- }
61
- }
62
- exports.ComponentManager = ComponentManager;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ComponentManager = void 0;
4
+ const CrudServiceManager_1 = require("../CrudServiceManager");
5
+ class ComponentManager 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}/components?name=${details.name}`, details.config);
13
+ }
14
+ findById(details) {
15
+ return this.sendFinding(`${this.url}/components?id=${details.id}`, details.config);
16
+ }
17
+ findByPlatformId(details) {
18
+ return this.sendAllFinding(`${this.url}/components?platformId=${details.platformId}`, details.config);
19
+ }
20
+ findByApplicationId(details) {
21
+ return this.sendAllFinding(`${this.url}/components?applicationId=${details.applicationId}`, details.config);
22
+ }
23
+ async count(details) {
24
+ let url = this.buildRequestUrl(`${this.url}/components`, details);
25
+ return (await this.sendCounting(url, details.config)) ?? 0;
26
+ }
27
+ async findAll(details) {
28
+ let components = [];
29
+ let url = this.buildRequestUrl(`${this.url}/components`, details);
30
+ if (details.limit) {
31
+ components = (await this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${details.limit}&offset=${details.offset}`, details.config)) ?? [];
32
+ }
33
+ else {
34
+ let limit = 5000, offset = 0, isEmpty = false;
35
+ do {
36
+ let values = await this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${limit}&offset=${offset}`, details.config);
37
+ if (values)
38
+ components = components.concat(values);
39
+ isEmpty = values == undefined || values.length == 0;
40
+ offset += limit;
41
+ } while (!isEmpty);
42
+ }
43
+ return components;
44
+ }
45
+ buildRequestUrl(url, details) {
46
+ let suffix = `${details.id ? `&id=${details.id}` : ""}${details.platform ? `&platform=${details.platform}` : ""}${details.applicationId ? `&applicationId=${details.applicationId}` : ""}${details.platformId ? `&platformId=${details.platformId}` : ""}${details.name ? `&name=${details.name}` : ""}`;
47
+ return `${url}?${suffix.substring(1)}`;
48
+ }
49
+ create(details) {
50
+ return this.sendCreation(`${this.url}/components`, { applicationId: details.applicationId, platformId: details.platformId, name: details.name, details: details.details }, details.config);
51
+ }
52
+ createMany(details) {
53
+ return this.sendCreationMany(`${this.url}/components`, details.values ?? [], details.config);
54
+ }
55
+ modify(component) {
56
+ return this.sendModification(`${this.url}/components/${component.componentId}`, { applicationId: component.applicationId, platformId: component.platformId, name: component.name, details: component.details }, component.config);
57
+ }
58
+ destroy(component) {
59
+ return this.sendDestruction(`${this.url}/components/${component.componentId}`, component.config);
60
+ }
61
+ }
62
+ exports.ComponentManager = ComponentManager;
63
63
  //# sourceMappingURL=ComponentManager.js.map