@hahnpro/hpc-api 2025.3.10 → 2025.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/package.json +3 -1
  3. package/src/index.d.ts +2 -16
  4. package/src/index.js +2 -15
  5. package/src/lib/api-base.d.ts +3 -3
  6. package/src/lib/api.d.ts +6 -20
  7. package/src/lib/api.js +18 -32
  8. package/src/lib/interfaces/ai.interface.d.ts +1 -1
  9. package/src/lib/{alert.interface.d.ts → interfaces/alert.interface.d.ts} +1 -1
  10. package/src/lib/interfaces/asset.interface.d.ts +1 -2
  11. package/src/lib/{content.interface.d.ts → interfaces/content.interface.d.ts} +1 -2
  12. package/src/lib/{data.interface.d.ts → interfaces/data.interface.d.ts} +4 -4
  13. package/src/lib/interfaces/event.interface.d.ts +1 -1
  14. package/src/lib/{flow-deployment.interface.d.ts → interfaces/flow-deployment.interface.d.ts} +1 -3
  15. package/src/lib/{flow-module.interface.d.ts → interfaces/flow-module.interface.d.ts} +1 -1
  16. package/src/lib/{flow.interface.d.ts → interfaces/flow.interface.d.ts} +1 -3
  17. package/src/lib/interfaces/http.interface.d.ts +13 -0
  18. package/src/lib/interfaces/index.d.ts +29 -7
  19. package/src/lib/interfaces/index.js +11 -0
  20. package/src/lib/interfaces/invitation-representation.interface.d.ts +48 -0
  21. package/src/lib/interfaces/keycloak-profile.interface.d.ts +12 -0
  22. package/src/lib/interfaces/label.interface.d.ts +1 -1
  23. package/src/lib/{notification-rule.interface.d.ts → interfaces/notification-rule.interface.d.ts} +1 -1
  24. package/src/lib/interfaces/organization-role-representation.interface.d.ts +37 -0
  25. package/src/lib/interfaces/organization.interface.d.ts +74 -0
  26. package/src/lib/interfaces/organizations-resources.interface.d.ts +9 -0
  27. package/src/lib/interfaces/secret.interface.js +2 -0
  28. package/src/lib/interfaces/storage.interface.js +2 -0
  29. package/src/lib/{task.interface.d.ts → interfaces/task.interface.d.ts} +11 -8
  30. package/src/lib/interfaces/task.interface.js +2 -0
  31. package/src/lib/interfaces/user-settings.interface.js +2 -0
  32. package/src/lib/interfaces/vault.interface.js +2 -0
  33. package/src/lib/mock/ai.mock.service.d.ts +5 -8
  34. package/src/lib/mock/ai.mock.service.js +5 -2
  35. package/src/lib/mock/alert.mock.service.d.ts +6 -0
  36. package/src/lib/mock/alert.mock.service.js +11 -0
  37. package/src/lib/mock/api-base.mock.d.ts +5 -3
  38. package/src/lib/mock/api-base.mock.js +8 -2
  39. package/src/lib/mock/api.mock.d.ts +16 -47
  40. package/src/lib/mock/api.mock.js +28 -38
  41. package/src/lib/mock/asset.mock.service.d.ts +6 -12
  42. package/src/lib/mock/asset.mock.service.js +3 -5
  43. package/src/lib/mock/assetTypes.mock.service.d.ts +4 -7
  44. package/src/lib/mock/assetTypes.mock.service.js +3 -5
  45. package/src/lib/mock/content.mock.service.d.ts +4 -7
  46. package/src/lib/mock/content.mock.service.js +10 -12
  47. package/src/lib/mock/data.mock.service.d.ts +10 -13
  48. package/src/lib/mock/data.mock.service.js +21 -36
  49. package/src/lib/mock/endpoint.mock.service.d.ts +3 -3
  50. package/src/lib/mock/endpoint.mock.service.js +2 -2
  51. package/src/lib/mock/event.mock.service.d.ts +1 -1
  52. package/src/lib/mock/event.mock.service.js +2 -2
  53. package/src/lib/mock/flow-deployment.mock.service.d.ts +3 -7
  54. package/src/lib/mock/flow-deployment.mock.service.js +14 -6
  55. package/src/lib/mock/flow-functions.mock.service.d.ts +4 -5
  56. package/src/lib/mock/flow-functions.mock.service.js +2 -2
  57. package/src/lib/mock/flow-modules.mock.service.d.ts +3 -5
  58. package/src/lib/mock/flow-modules.mock.service.js +2 -2
  59. package/src/lib/mock/flow.mock.service.d.ts +5 -9
  60. package/src/lib/mock/flow.mock.service.js +3 -5
  61. package/src/lib/mock/{http.mock.service.d.ts → http-client.mock.service.d.ts} +3 -2
  62. package/src/lib/mock/{http.mock.service.js → http-client.mock.service.js} +4 -4
  63. package/src/lib/mock/index.d.ts +28 -12
  64. package/src/lib/mock/index.js +57 -12
  65. package/src/lib/mock/label.mock.service.d.ts +2 -2
  66. package/src/lib/mock/label.mock.service.js +2 -2
  67. package/src/lib/mock/notification-rules.mock.service.d.ts +5 -0
  68. package/src/lib/mock/notification-rules.mock.service.js +11 -0
  69. package/src/lib/mock/notification.mock.service.d.ts +3 -3
  70. package/src/lib/mock/notification.mock.service.js +2 -2
  71. package/src/lib/mock/organizations-administration.mock.service.d.ts +17 -0
  72. package/src/lib/mock/organizations-administration.mock.service.js +93 -0
  73. package/src/lib/mock/organizations-resources.mock.service.d.ts +12 -0
  74. package/src/lib/mock/organizations-resources.mock.service.js +24 -0
  75. package/src/lib/mock/organizations.mock.service.d.ts +29 -0
  76. package/src/lib/mock/organizations.mock.service.js +90 -0
  77. package/src/lib/mock/search.mock.service.d.ts +3 -4
  78. package/src/lib/mock/search.mock.service.js +2 -2
  79. package/src/lib/mock/secret.mock.service.d.ts +4 -7
  80. package/src/lib/mock/secret.mock.service.js +3 -5
  81. package/src/lib/mock/task.mock.service.d.ts +8 -12
  82. package/src/lib/mock/task.mock.service.js +4 -6
  83. package/src/lib/mock/timeseries.mock.service.d.ts +5 -8
  84. package/src/lib/mock/timeseries.mock.service.js +3 -5
  85. package/src/lib/mock/trash.mock.service.d.ts +6 -8
  86. package/src/lib/mock/trash.mock.service.js +3 -4
  87. package/src/lib/mock/user.mock.service.d.ts +1 -1
  88. package/src/lib/mock/user.mock.service.js +2 -2
  89. package/src/lib/mock/utils/index.d.ts +1 -0
  90. package/src/lib/mock/utils/index.js +5 -0
  91. package/src/lib/mock/utils/sort-data.function.d.ts +1 -0
  92. package/src/lib/mock/utils/sort-data.function.js +17 -0
  93. package/src/lib/mock/vault.mock.service.d.ts +3 -3
  94. package/src/lib/mock/vault.mock.service.js +2 -2
  95. package/src/lib/services/ai.service.d.ts +4 -5
  96. package/src/lib/services/alert.service.d.ts +5 -0
  97. package/src/lib/{alert.service.js → services/alert.service.js} +2 -2
  98. package/src/lib/services/asset.service.d.ts +6 -10
  99. package/src/lib/services/asset.service.js +3 -4
  100. package/src/lib/services/assettypes.service.d.ts +4 -7
  101. package/src/lib/services/assettypes.service.js +2 -3
  102. package/src/lib/{content.service.d.ts → services/content.service.d.ts} +5 -7
  103. package/src/lib/{content.service.js → services/content.service.js} +11 -12
  104. package/src/lib/{data.service.d.ts → services/data.service.d.ts} +4 -6
  105. package/src/lib/{data.service.js → services/data.service.js} +3 -21
  106. package/src/lib/{endpoint.service.d.ts → services/endpoint.service.d.ts} +3 -4
  107. package/src/lib/{endpoint.service.js → services/endpoint.service.js} +2 -2
  108. package/src/lib/services/event.service.d.ts +3 -4
  109. package/src/lib/services/event.service.js +2 -2
  110. package/src/lib/{flow-deployment.service.d.ts → services/flow-deployment.service.d.ts} +4 -7
  111. package/src/lib/{flow-deployment.service.js → services/flow-deployment.service.js} +3 -4
  112. package/src/lib/{flow-function.service.d.ts → services/flow-function.service.d.ts} +4 -6
  113. package/src/lib/{flow-function.service.js → services/flow-function.service.js} +2 -2
  114. package/src/lib/{flow-module.service.d.ts → services/flow-module.service.d.ts} +4 -5
  115. package/src/lib/{flow-module.service.js → services/flow-module.service.js} +3 -3
  116. package/src/lib/{flow.service.d.ts → services/flow.service.d.ts} +6 -10
  117. package/src/lib/{flow.service.js → services/flow.service.js} +3 -4
  118. package/src/lib/{http.service.d.ts → services/http-client.service.d.ts} +8 -16
  119. package/src/lib/{http.service.js → services/http-client.service.js} +42 -6
  120. package/src/lib/services/index.d.ts +20 -0
  121. package/src/lib/services/index.js +41 -1
  122. package/src/lib/services/label.service.d.ts +3 -4
  123. package/src/lib/services/label.service.js +2 -2
  124. package/src/lib/services/notification-rule.service.d.ts +5 -0
  125. package/src/lib/{notification-rule.service.js → services/notification-rule.service.js} +2 -2
  126. package/src/lib/services/notification.service.d.ts +5 -0
  127. package/src/lib/{notification.service.js → services/notification.service.js} +2 -2
  128. package/src/lib/services/organizations-administration.service.d.ts +56 -0
  129. package/src/lib/services/organizations-administration.service.js +84 -0
  130. package/src/lib/services/organizations-resources.service.d.ts +35 -0
  131. package/src/lib/services/organizations-resources.service.js +61 -0
  132. package/src/lib/services/organizations.service.d.ts +167 -0
  133. package/src/lib/services/organizations.service.js +216 -0
  134. package/src/lib/{proxy.service.d.ts → services/proxy.service.d.ts} +3 -2
  135. package/src/lib/services/search.service.d.ts +3 -3
  136. package/src/lib/services/secret.service.d.ts +11 -0
  137. package/src/lib/{secret.service.js → services/secret.service.js} +3 -4
  138. package/src/lib/{task.service.d.ts → services/task.service.d.ts} +8 -11
  139. package/src/lib/{task.service.js → services/task.service.js} +3 -4
  140. package/src/lib/services/timeseries.service.d.ts +4 -7
  141. package/src/lib/services/timeseries.service.js +2 -3
  142. package/src/lib/{trash.service.d.ts → services/trash.service.d.ts} +3 -3
  143. package/src/lib/{trash.service.js → services/trash.service.js} +1 -1
  144. package/src/lib/{user.service.d.ts → services/user.service.d.ts} +3 -3
  145. package/src/lib/services/vault.service.d.ts +6 -0
  146. package/src/lib/{vault.service.js → services/vault.service.js} +2 -2
  147. package/src/lib/utils.d.ts +2 -0
  148. package/src/lib/utils.js +21 -0
  149. package/src/lib/alert.service.d.ts +0 -6
  150. package/src/lib/mock/organization.mock.service.d.ts +0 -10
  151. package/src/lib/mock/organization.mock.service.js +0 -44
  152. package/src/lib/notification-rule.service.d.ts +0 -6
  153. package/src/lib/notification.service.d.ts +0 -6
  154. package/src/lib/organization.interface.d.ts +0 -36
  155. package/src/lib/organization.service.d.ts +0 -10
  156. package/src/lib/organization.service.js +0 -22
  157. package/src/lib/secret.service.d.ts +0 -13
  158. package/src/lib/vault.service.d.ts +0 -7
  159. /package/src/lib/{alert.interface.js → interfaces/alert.interface.js} +0 -0
  160. /package/src/lib/{content.interface.js → interfaces/content.interface.js} +0 -0
  161. /package/src/lib/{data.interface.js → interfaces/data.interface.js} +0 -0
  162. /package/src/lib/{endpoint.interface.d.ts → interfaces/endpoint.interface.d.ts} +0 -0
  163. /package/src/lib/{endpoint.interface.js → interfaces/endpoint.interface.js} +0 -0
  164. /package/src/lib/{flow-deployment.interface.js → interfaces/flow-deployment.interface.js} +0 -0
  165. /package/src/lib/{flow-function.interface.d.ts → interfaces/flow-function.interface.d.ts} +0 -0
  166. /package/src/lib/{flow-function.interface.js → interfaces/flow-function.interface.js} +0 -0
  167. /package/src/lib/{flow-module.interface.js → interfaces/flow-module.interface.js} +0 -0
  168. /package/src/lib/{flow.interface.js → interfaces/flow.interface.js} +0 -0
  169. /package/src/lib/{notification-rule.interface.js → interfaces/http.interface.js} +0 -0
  170. /package/src/lib/{notification.interface.js → interfaces/invitation-representation.interface.js} +0 -0
  171. /package/src/lib/{organization.interface.js → interfaces/keycloak-profile.interface.js} +0 -0
  172. /package/src/lib/{schema.interface.js → interfaces/notification-rule.interface.js} +0 -0
  173. /package/src/lib/{notification.interface.d.ts → interfaces/notification.interface.d.ts} +0 -0
  174. /package/src/lib/{secret.interface.js → interfaces/notification.interface.js} +0 -0
  175. /package/src/lib/{storage.interface.js → interfaces/organization-role-representation.interface.js} +0 -0
  176. /package/src/lib/{task.interface.js → interfaces/organization.interface.js} +0 -0
  177. /package/src/lib/{user-settings.interface.js → interfaces/organizations-resources.interface.js} +0 -0
  178. /package/src/lib/{schema.interface.d.ts → interfaces/schema.interface.d.ts} +0 -0
  179. /package/src/lib/{vault.interface.js → interfaces/schema.interface.js} +0 -0
  180. /package/src/lib/{secret.interface.d.ts → interfaces/secret.interface.d.ts} +0 -0
  181. /package/src/lib/{storage.interface.d.ts → interfaces/storage.interface.d.ts} +0 -0
  182. /package/src/lib/{user-settings.interface.d.ts → interfaces/user-settings.interface.d.ts} +0 -0
  183. /package/src/lib/{vault.interface.d.ts → interfaces/vault.interface.d.ts} +0 -0
  184. /package/src/lib/{Queue.d.ts → queue.d.ts} +0 -0
  185. /package/src/lib/{Queue.js → queue.js} +0 -0
  186. /package/src/lib/{proxy.service.js → services/proxy.service.js} +0 -0
  187. /package/src/lib/{user.service.js → services/user.service.js} +0 -0
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DataService = void 0;
4
- const api_base_1 = require("./api-base");
5
- const data_interface_1 = require("./data.interface");
4
+ const api_base_1 = require("../api-base");
5
+ const utils_1 = require("../utils");
6
6
  class DataService extends api_base_1.APIBase {
7
7
  addOne(dto, options = {}) {
8
8
  return this.httpClient.post(this.basePath, dto, options);
@@ -30,7 +30,7 @@ class DataService extends api_base_1.APIBase {
30
30
  * @param options Parameters for authentication
31
31
  */
32
32
  getManyFiltered(filter, params = {}, options = {}) {
33
- params.filter = this.getFilterString(filter);
33
+ params.filter = (0, utils_1.getFilterString)(filter);
34
34
  return this.getMany(params, options);
35
35
  }
36
36
  updateOne(id, dto, options = {}) {
@@ -39,23 +39,5 @@ class DataService extends api_base_1.APIBase {
39
39
  deleteOne(id, force = false, options = {}) {
40
40
  return this.httpClient.delete(`${this.basePath}/${id}`, { params: { force }, ...options });
41
41
  }
42
- getFilterString(filter) {
43
- const filters = [];
44
- for (const [key, value] of Object.entries(filter)) {
45
- if (value != null && value !== '') {
46
- // filter out null and undefined values and empty strings
47
- if (typeof value === 'object' && (0, data_interface_1.instanceOfTimePeriod)(value)) {
48
- filters.push(`${key}>=${value.from.toISOString()};${key}<=${value.to.toISOString()}`);
49
- }
50
- else if (Array.isArray(value)) {
51
- filters.push(`${key}=@${value.join(',')}`);
52
- }
53
- else {
54
- filters.push(`${key}==${value}`);
55
- }
56
- }
57
- }
58
- return filters.join(';');
59
- }
60
42
  }
61
43
  exports.DataService = DataService;
@@ -1,8 +1,7 @@
1
- import { DataService } from './data.service';
2
- import { Endpoint, EndpointLog, NotificationPayload } from './endpoint.interface';
3
- import { HttpClient, TokenOption } from './http.service';
1
+ import { DataService, HttpClientService } from '.';
2
+ import { Endpoint, EndpointLog, NotificationPayload, TokenOption } from '../interfaces';
4
3
  export declare class EndpointService extends DataService<Endpoint> {
5
- constructor(httpClient: HttpClient);
4
+ constructor(httpClient: HttpClientService);
6
5
  sendNotification(endpointId: string, payload: NotificationPayload, options?: TokenOption): Promise<void>;
7
6
  readLastLogByGroup(endpointId: string, group: string, options?: TokenOption): Promise<EndpointLog>;
8
7
  }
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EndpointService = void 0;
4
- const data_service_1 = require("./data.service");
5
- class EndpointService extends data_service_1.DataService {
4
+ const _1 = require(".");
5
+ class EndpointService extends _1.DataService {
6
6
  constructor(httpClient) {
7
7
  super(httpClient, '/notification/endpoints');
8
8
  }
@@ -1,8 +1,7 @@
1
- import { DataService } from '../data.service';
2
- import { HttpClient, TokenOption } from '../http.service';
3
- import { Event } from '../interfaces';
1
+ import { DataService, HttpClientService } from '.';
2
+ import { Event, TokenOption } from '../interfaces';
4
3
  export declare class EventService extends DataService<Event> {
5
- constructor(httpClient: HttpClient);
4
+ constructor(httpClient: HttpClientService);
6
5
  getLastEventByAssetAndGroup(assetId: string, group: string, options?: TokenOption): Promise<Event>;
7
6
  getLastEventByAssetAndGroups(assetId: string, groups: string[], options?: TokenOption): Promise<Record<string, string>>;
8
7
  }
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EventService = void 0;
4
- const data_service_1 = require("../data.service");
5
- class EventService extends data_service_1.DataService {
4
+ const _1 = require(".");
5
+ class EventService extends _1.DataService {
6
6
  constructor(httpClient) {
7
7
  super(httpClient, '/events');
8
8
  }
@@ -1,15 +1,12 @@
1
- import { APIBase } from './api-base';
2
- import { DataService } from './data.service';
3
- import { FlowDeployment, FlowDeploymentMetrics, FlowDeploymentStatistic, FlowLog } from './flow-deployment.interface';
4
- import { HttpClient, TokenOption } from './http.service';
5
- import { ResourceReference } from './interfaces';
6
- import { TrashService } from './trash.service';
1
+ import { DataService, HttpClientService, TrashService } from '.';
2
+ import { APIBase } from '../api-base';
3
+ import { FlowDeployment, FlowDeploymentMetrics, FlowDeploymentStatistic, FlowLog, ResourceReference, TokenOption } from '../interfaces';
7
4
  interface BaseService extends DataService<FlowDeployment>, TrashService<FlowDeployment> {
8
5
  }
9
6
  declare class BaseService extends APIBase {
10
7
  }
11
8
  export declare class FlowDeploymentService extends BaseService {
12
- constructor(httpClient: HttpClient);
9
+ constructor(httpClient: HttpClientService);
13
10
  addMany(dto: any[], options?: TokenOption): Promise<FlowDeployment[]>;
14
11
  updateOne(id: string, dto: any, options?: TokenOption & {
15
12
  force: boolean;
@@ -3,13 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FlowDeploymentService = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ts_mixer_1 = require("ts-mixer");
6
- const api_base_1 = require("./api-base");
7
- const data_service_1 = require("./data.service");
8
- const trash_service_1 = require("./trash.service");
6
+ const _1 = require(".");
7
+ const api_base_1 = require("../api-base");
9
8
  let BaseService = class BaseService extends api_base_1.APIBase {
10
9
  };
11
10
  BaseService = tslib_1.__decorate([
12
- (0, ts_mixer_1.mix)(data_service_1.DataService, trash_service_1.TrashService)
11
+ (0, ts_mixer_1.mix)(_1.DataService, _1.TrashService)
13
12
  ], BaseService);
14
13
  class FlowDeploymentService extends BaseService {
15
14
  constructor(httpClient) {
@@ -1,11 +1,9 @@
1
- import { Paginated } from './data.interface';
2
- import { DataService } from './data.service';
3
- import { FlowFunctionDto } from './flow-function.interface';
4
- import { HttpClient, TokenOption } from './http.service';
1
+ import { DataService, HttpClientService } from '.';
2
+ import { FlowFunctionDto, Paginated, TokenOption } from '../interfaces';
5
3
  export declare class FlowFunctionService extends DataService<FlowFunctionDto> {
6
- constructor(httpClient: HttpClient);
4
+ constructor(httpClient: HttpClientService);
7
5
  addMany(dto: any[], options?: TokenOption): Promise<FlowFunctionDto[]>;
8
- getRevisions(fqn: string, options?: TokenOption): Promise<Paginated<FlowFunctionDto[]>>;
6
+ getRevisions(fqn: string, options?: TokenOption): Promise<Paginated<FlowFunctionDto>>;
9
7
  rollback(fqn: string, revisionId: string, options?: TokenOption): Promise<FlowFunctionDto>;
10
8
  deleteRevision(fqn: string, revisionId: string, options?: TokenOption): Promise<any>;
11
9
  }
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FlowFunctionService = void 0;
4
- const data_service_1 = require("./data.service");
5
- class FlowFunctionService extends data_service_1.DataService {
4
+ const _1 = require(".");
5
+ class FlowFunctionService extends _1.DataService {
6
6
  constructor(httpClient) {
7
7
  super(httpClient, '/flow/functions');
8
8
  }
@@ -1,9 +1,8 @@
1
- import { DataService } from './data.service';
2
- import { FlowModule } from './flow-module.interface';
3
- import { HttpClient, TokenOption } from './http.service';
4
- import { CrossPlatformFormData } from './utils';
1
+ import { DataService, HttpClientService } from '.';
2
+ import { FlowModule, TokenOption } from '../interfaces';
3
+ import { CrossPlatformFormData } from '../utils';
5
4
  export declare class FlowModuleService extends DataService<FlowModule> {
6
- constructor(httpClient: HttpClient);
5
+ constructor(httpClient: HttpClientService);
7
6
  deleteArtifact(name: string, version: string, options?: TokenOption): Promise<FlowModule>;
8
7
  publish(form: CrossPlatformFormData, options?: TokenOption): Promise<unknown>;
9
8
  addOne(_dto: any): Promise<FlowModule>;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FlowModuleService = void 0;
4
- const data_service_1 = require("./data.service");
5
- const utils_1 = require("./utils");
6
- class FlowModuleService extends data_service_1.DataService {
4
+ const _1 = require(".");
5
+ const utils_1 = require("../utils");
6
+ class FlowModuleService extends _1.DataService {
7
7
  constructor(httpClient) {
8
8
  super(httpClient, '/flow/modules');
9
9
  }
@@ -1,25 +1,21 @@
1
- import { APIBase } from './api-base';
2
- import { Paginated, RequestParameter } from './data.interface';
3
- import { DataService } from './data.service';
4
- import { FlowDeployment } from './flow-deployment.interface';
5
- import { FlowDiagram, FlowDto } from './flow.interface';
6
- import { HttpClient, TokenOption } from './http.service';
7
- import { TrashService } from './trash.service';
1
+ import { DataService, HttpClientService, TrashService } from '.';
2
+ import { APIBase } from '../api-base';
3
+ import { FlowDeployment, FlowDiagram, FlowDto, Paginated, RequestParameter, TokenOption } from '../interfaces';
8
4
  interface BaseService extends DataService<FlowDto>, TrashService<FlowDto> {
9
5
  }
10
6
  declare class BaseService extends APIBase {
11
7
  }
12
8
  export declare class FlowService extends BaseService {
13
- constructor(httpClient: HttpClient);
9
+ constructor(httpClient: HttpClientService);
14
10
  addMany(dto: any[], options?: TokenOption): Promise<FlowDto[]>;
15
- getMany(params?: RequestParameter, options?: TokenOption): Promise<Paginated<FlowDto[]>>;
11
+ getMany(params?: RequestParameter, options?: TokenOption): Promise<Paginated<FlowDto>>;
16
12
  getOne(id: string, options?: TokenOption & {
17
13
  [key: string]: any;
18
14
  }): Promise<FlowDto>;
19
15
  getFlowWithDiagram(diagramId: string, options?: TokenOption): Promise<FlowDto>;
20
16
  getDiagramRevisions(id: string, options?: TokenOption): Promise<FlowDiagram[]>;
21
17
  isDeploymentOnLatestDiagramVersion(depl: FlowDeployment, options?: TokenOption): Promise<boolean>;
22
- getRevisions(id: string, options?: TokenOption): Promise<Paginated<FlowDto[]>>;
18
+ getRevisions(id: string, options?: TokenOption): Promise<Paginated<FlowDto>>;
23
19
  rollback(id: string, revisionId: string, options?: TokenOption): Promise<FlowDto>;
24
20
  deleteRevision(id: string, revisionId: string, options?: TokenOption): Promise<any>;
25
21
  }
@@ -3,13 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FlowService = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ts_mixer_1 = require("ts-mixer");
6
- const api_base_1 = require("./api-base");
7
- const data_service_1 = require("./data.service");
8
- const trash_service_1 = require("./trash.service");
6
+ const _1 = require(".");
7
+ const api_base_1 = require("../api-base");
9
8
  let BaseService = class BaseService extends api_base_1.APIBase {
10
9
  };
11
10
  BaseService = tslib_1.__decorate([
12
- (0, ts_mixer_1.mix)(data_service_1.DataService, trash_service_1.TrashService)
11
+ (0, ts_mixer_1.mix)(_1.DataService, _1.TrashService)
13
12
  ], BaseService);
14
13
  class FlowService extends BaseService {
15
14
  constructor(httpClient) {
@@ -1,12 +1,11 @@
1
- import { AxiosInstance, AxiosRequestConfig, Method } from 'axios';
1
+ import { EventSourceMessage } from '@microsoft/fetch-event-source';
2
+ import { AxiosInstance, Method } from 'axios';
2
3
  import { EventSource } from 'eventsource';
3
- import { Queue } from './Queue';
4
- import { TokenSet } from './token-set';
5
- export type TokenOption = {
6
- token?: string;
7
- };
8
- export type Config = TokenOption & AxiosRequestConfig;
9
- export declare class HttpClient {
4
+ import { Observable, Subject } from 'rxjs';
5
+ import { Config, Issuer, TokenOption } from '../interfaces';
6
+ import { Queue } from '../queue';
7
+ import { TokenSet } from '../token-set';
8
+ export declare class HttpClientService {
10
9
  protected readonly baseURL: string;
11
10
  protected readonly authBaseURL: string;
12
11
  protected readonly realm: string;
@@ -37,6 +36,7 @@ export declare class HttpClient {
37
36
  put: <T>(url: string, data: any, config?: Config) => Promise<T>;
38
37
  patch: <T>(url: string, data: any, config?: Config) => Promise<T>;
39
38
  protected request: <T>(method: Method, url: string, config?: Config, data?: any) => Promise<T>;
39
+ getSseObservable<T>(path: string, onmessage?: (subject: Subject<T>, event: EventSourceMessage) => void): Observable<T>;
40
40
  addEventSource(url: string, listener: (event: MessageEvent) => void, errorListener?: (event: MessageEvent) => void, options?: TokenOption): Promise<string>;
41
41
  destroyEventSource(id: string): void;
42
42
  destroyAllEventSources(): void;
@@ -47,11 +47,3 @@ export declare class HttpClient {
47
47
  protected exchangeAccessToken(accessToken: string): Promise<TokenSet>;
48
48
  provideExternalToken(token: string): Promise<void>;
49
49
  }
50
- export interface Issuer {
51
- issuer: string;
52
- token_endpoint: string;
53
- grant_types_supported: string[];
54
- token_endpoint_auth_methods_supported: string[];
55
- token_endpoint_auth_signing_alg?: string;
56
- token_endpoint_auth_signing_alg_values_supported: string[];
57
- }
@@ -1,13 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HttpClient = void 0;
3
+ exports.HttpClientService = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const fetch_event_source_1 = require("@microsoft/fetch-event-source");
5
6
  const axios_1 = tslib_1.__importDefault(require("axios"));
6
7
  const eventsource_1 = require("eventsource");
7
8
  const jose_1 = require("jose");
8
- const Queue_1 = require("./Queue");
9
- const token_set_1 = require("./token-set");
10
- class HttpClient {
9
+ const rxjs_1 = require("rxjs");
10
+ const queue_1 = require("../queue");
11
+ const token_set_1 = require("../token-set");
12
+ class HttpClientService {
11
13
  constructor(baseURL, authBaseURL, realm, clientId, clientSecret, tokenSubject) {
12
14
  this.baseURL = baseURL;
13
15
  this.authBaseURL = authBaseURL;
@@ -59,7 +61,41 @@ class HttpClient {
59
61
  };
60
62
  this.axiosInstance = axios_1.default.create({ baseURL, timeout: 60000 });
61
63
  this.authAxiosInstance = axios_1.default.create({ baseURL: authBaseURL || baseURL, timeout: 10000 });
62
- this.requestQueue = new Queue_1.Queue({ concurrency: 1, timeout: 70000, throwOnTimeout: true });
64
+ this.requestQueue = new queue_1.Queue({ concurrency: 1, timeout: 70000, throwOnTimeout: true });
65
+ }
66
+ getSseObservable(path, onmessage) {
67
+ const subject = new rxjs_1.Subject();
68
+ this.getAccessToken()
69
+ .then((token) => {
70
+ const ctrl = new AbortController();
71
+ (0, fetch_event_source_1.fetchEventSource)(`${this.baseURL}/${path}`, {
72
+ headers: { authorization: 'Bearer ' + token },
73
+ signal: ctrl.signal,
74
+ onopen: async (response) => {
75
+ if (!response.ok) {
76
+ subject.error(new Error(`HTTP ${response.status}: ${response.statusText}`));
77
+ ctrl.abort();
78
+ }
79
+ },
80
+ onmessage(event) {
81
+ if (onmessage) {
82
+ onmessage(subject, event);
83
+ }
84
+ },
85
+ onclose() {
86
+ subject.complete();
87
+ ctrl.abort();
88
+ },
89
+ onerror(err) {
90
+ subject.error(err);
91
+ ctrl.abort();
92
+ },
93
+ });
94
+ })
95
+ .catch((err) => {
96
+ subject.error(err);
97
+ });
98
+ return subject.asObservable();
63
99
  }
64
100
  async addEventSource(url, listener, errorListener, options = {}) {
65
101
  const id = globalThis.crypto.randomUUID();
@@ -181,4 +217,4 @@ class HttpClient {
181
217
  this.tokenSet = new token_set_1.TokenSet(token, exp - Date.now() / 1000, true);
182
218
  }
183
219
  }
184
- exports.HttpClient = HttpClient;
220
+ exports.HttpClientService = HttpClientService;
@@ -1,7 +1,27 @@
1
+ export { DataService } from './data.service';
2
+ export { TrashService } from './trash.service';
1
3
  export { AiService } from './ai.service';
4
+ export { AlertService } from './alert.service';
2
5
  export { AssetService } from './asset.service';
3
6
  export { AssetTypesService } from './assettypes.service';
7
+ export { ContentService } from './content.service';
8
+ export { EndpointService } from './endpoint.service';
4
9
  export { EventService } from './event.service';
10
+ export { FlowService } from './flow.service';
11
+ export { FlowDeploymentService } from './flow-deployment.service';
12
+ export { FlowFunctionService } from './flow-function.service';
13
+ export { FlowModuleService } from './flow-module.service';
14
+ export { HttpClientService } from './http-client.service';
5
15
  export { LabelService } from './label.service';
16
+ export { NotificationRuleService } from './notification-rule.service';
17
+ export { NotificationService } from './notification.service';
18
+ export { OrganizationsService } from './organizations.service';
19
+ export { OrganizationsAdministrationService } from './organizations-administration.service';
20
+ export { OrganizationsResourcesService } from './organizations-resources.service';
21
+ export { ProxyService } from './proxy.service';
6
22
  export { SearchService } from './search.service';
23
+ export { SecretService } from './secret.service';
24
+ export { TaskService } from './task.service';
7
25
  export { TimeSeriesService } from './timeseries.service';
26
+ export { UserService } from './user.service';
27
+ export { VaultService } from './vault.service';
@@ -1,17 +1,57 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TimeSeriesService = exports.SearchService = exports.LabelService = exports.EventService = exports.AssetTypesService = exports.AssetService = exports.AiService = void 0;
3
+ exports.VaultService = exports.UserService = exports.TimeSeriesService = exports.TaskService = exports.SecretService = exports.SearchService = exports.ProxyService = exports.OrganizationsResourcesService = exports.OrganizationsAdministrationService = exports.OrganizationsService = exports.NotificationService = exports.NotificationRuleService = exports.LabelService = exports.HttpClientService = exports.FlowModuleService = exports.FlowFunctionService = exports.FlowDeploymentService = exports.FlowService = exports.EventService = exports.EndpointService = exports.ContentService = exports.AssetTypesService = exports.AssetService = exports.AlertService = exports.AiService = exports.TrashService = exports.DataService = void 0;
4
+ var data_service_1 = require("./data.service");
5
+ Object.defineProperty(exports, "DataService", { enumerable: true, get: function () { return data_service_1.DataService; } });
6
+ var trash_service_1 = require("./trash.service");
7
+ Object.defineProperty(exports, "TrashService", { enumerable: true, get: function () { return trash_service_1.TrashService; } });
4
8
  var ai_service_1 = require("./ai.service");
5
9
  Object.defineProperty(exports, "AiService", { enumerable: true, get: function () { return ai_service_1.AiService; } });
10
+ var alert_service_1 = require("./alert.service");
11
+ Object.defineProperty(exports, "AlertService", { enumerable: true, get: function () { return alert_service_1.AlertService; } });
6
12
  var asset_service_1 = require("./asset.service");
7
13
  Object.defineProperty(exports, "AssetService", { enumerable: true, get: function () { return asset_service_1.AssetService; } });
8
14
  var assettypes_service_1 = require("./assettypes.service");
9
15
  Object.defineProperty(exports, "AssetTypesService", { enumerable: true, get: function () { return assettypes_service_1.AssetTypesService; } });
16
+ var content_service_1 = require("./content.service");
17
+ Object.defineProperty(exports, "ContentService", { enumerable: true, get: function () { return content_service_1.ContentService; } });
18
+ var endpoint_service_1 = require("./endpoint.service");
19
+ Object.defineProperty(exports, "EndpointService", { enumerable: true, get: function () { return endpoint_service_1.EndpointService; } });
10
20
  var event_service_1 = require("./event.service");
11
21
  Object.defineProperty(exports, "EventService", { enumerable: true, get: function () { return event_service_1.EventService; } });
22
+ var flow_service_1 = require("./flow.service");
23
+ Object.defineProperty(exports, "FlowService", { enumerable: true, get: function () { return flow_service_1.FlowService; } });
24
+ var flow_deployment_service_1 = require("./flow-deployment.service");
25
+ Object.defineProperty(exports, "FlowDeploymentService", { enumerable: true, get: function () { return flow_deployment_service_1.FlowDeploymentService; } });
26
+ var flow_function_service_1 = require("./flow-function.service");
27
+ Object.defineProperty(exports, "FlowFunctionService", { enumerable: true, get: function () { return flow_function_service_1.FlowFunctionService; } });
28
+ var flow_module_service_1 = require("./flow-module.service");
29
+ Object.defineProperty(exports, "FlowModuleService", { enumerable: true, get: function () { return flow_module_service_1.FlowModuleService; } });
30
+ var http_client_service_1 = require("./http-client.service");
31
+ Object.defineProperty(exports, "HttpClientService", { enumerable: true, get: function () { return http_client_service_1.HttpClientService; } });
12
32
  var label_service_1 = require("./label.service");
13
33
  Object.defineProperty(exports, "LabelService", { enumerable: true, get: function () { return label_service_1.LabelService; } });
34
+ var notification_rule_service_1 = require("./notification-rule.service");
35
+ Object.defineProperty(exports, "NotificationRuleService", { enumerable: true, get: function () { return notification_rule_service_1.NotificationRuleService; } });
36
+ var notification_service_1 = require("./notification.service");
37
+ Object.defineProperty(exports, "NotificationService", { enumerable: true, get: function () { return notification_service_1.NotificationService; } });
38
+ var organizations_service_1 = require("./organizations.service");
39
+ Object.defineProperty(exports, "OrganizationsService", { enumerable: true, get: function () { return organizations_service_1.OrganizationsService; } });
40
+ var organizations_administration_service_1 = require("./organizations-administration.service");
41
+ Object.defineProperty(exports, "OrganizationsAdministrationService", { enumerable: true, get: function () { return organizations_administration_service_1.OrganizationsAdministrationService; } });
42
+ var organizations_resources_service_1 = require("./organizations-resources.service");
43
+ Object.defineProperty(exports, "OrganizationsResourcesService", { enumerable: true, get: function () { return organizations_resources_service_1.OrganizationsResourcesService; } });
44
+ var proxy_service_1 = require("./proxy.service");
45
+ Object.defineProperty(exports, "ProxyService", { enumerable: true, get: function () { return proxy_service_1.ProxyService; } });
14
46
  var search_service_1 = require("./search.service");
15
47
  Object.defineProperty(exports, "SearchService", { enumerable: true, get: function () { return search_service_1.SearchService; } });
48
+ var secret_service_1 = require("./secret.service");
49
+ Object.defineProperty(exports, "SecretService", { enumerable: true, get: function () { return secret_service_1.SecretService; } });
50
+ var task_service_1 = require("./task.service");
51
+ Object.defineProperty(exports, "TaskService", { enumerable: true, get: function () { return task_service_1.TaskService; } });
16
52
  var timeseries_service_1 = require("./timeseries.service");
17
53
  Object.defineProperty(exports, "TimeSeriesService", { enumerable: true, get: function () { return timeseries_service_1.TimeSeriesService; } });
54
+ var user_service_1 = require("./user.service");
55
+ Object.defineProperty(exports, "UserService", { enumerable: true, get: function () { return user_service_1.UserService; } });
56
+ var vault_service_1 = require("./vault.service");
57
+ Object.defineProperty(exports, "VaultService", { enumerable: true, get: function () { return vault_service_1.VaultService; } });
@@ -1,8 +1,7 @@
1
- import { DataService } from '../data.service';
2
- import { HttpClient, TokenOption } from '../http.service';
3
- import type { Label, SearchOptions, SearchResult } from '../interfaces';
1
+ import { DataService, HttpClientService } from '.';
2
+ import type { Label, SearchOptions, SearchResult, TokenOption } from '../interfaces';
4
3
  export declare class LabelService extends DataService<Label> {
5
- constructor(httpClient: HttpClient);
4
+ constructor(httpClient: HttpClientService);
6
5
  addMany(dtos: Label[], options?: TokenOption): Promise<Label[]>;
7
6
  getOneByName(name: string, options?: TokenOption): Promise<Label>;
8
7
  count(options?: TokenOption): Promise<number>;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LabelService = void 0;
4
- const data_service_1 = require("../data.service");
5
- class LabelService extends data_service_1.DataService {
4
+ const _1 = require(".");
5
+ class LabelService extends _1.DataService {
6
6
  constructor(httpClient) {
7
7
  super(httpClient, '/labels');
8
8
  }
@@ -0,0 +1,5 @@
1
+ import { DataService, HttpClientService } from '.';
2
+ import { NotificationRule } from '../interfaces';
3
+ export declare class NotificationRuleService extends DataService<NotificationRule> {
4
+ constructor(httpClient: HttpClientService);
5
+ }
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NotificationRuleService = void 0;
4
- const data_service_1 = require("./data.service");
5
- class NotificationRuleService extends data_service_1.DataService {
4
+ const _1 = require(".");
5
+ class NotificationRuleService extends _1.DataService {
6
6
  constructor(httpClient) {
7
7
  super(httpClient, '/notification/rules');
8
8
  }
@@ -0,0 +1,5 @@
1
+ import { DataService, HttpClientService } from '.';
2
+ import { Notification } from '../interfaces';
3
+ export declare class NotificationService extends DataService<Notification> {
4
+ constructor(httpClient: HttpClientService);
5
+ }
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NotificationService = void 0;
4
- const data_service_1 = require("./data.service");
5
- class NotificationService extends data_service_1.DataService {
4
+ const _1 = require(".");
5
+ class NotificationService extends _1.DataService {
6
6
  constructor(httpClient) {
7
7
  super(httpClient, '/notifications');
8
8
  }
@@ -0,0 +1,56 @@
1
+ import { APIBase } from '../api-base';
2
+ import { Filter, Organization, OrganizationCreateDto, OrganizationSearchQuery, Paginated, RequestParameter, SubscriptionType, UserWithOrgRoles } from '../interfaces';
3
+ import { HttpClientService } from './';
4
+ /**
5
+ * Service for managing organizations with administrative privileges (superuser role required).
6
+ */
7
+ export declare class OrganizationsAdministrationService extends APIBase {
8
+ constructor(httpClient: HttpClientService);
9
+ /**
10
+ * Gets one organization by id, combining data from Keycloak and MongoDB.
11
+ *
12
+ * @param {string} id - The ID of the organization to retrieve.
13
+ * @returns {Promise<Organization>} - An promise containing the combined organization data from Keycloak and MongoDB.
14
+ */
15
+ getOneCombined(id: string): Promise<Organization>;
16
+ /**
17
+ * Get many organizations with pagination, filtering, and sorting options.
18
+ *
19
+ * @param {RequestParameter} params - The request parameters for pagination, filtering, and sorting.
20
+ * @returns {Promise<Paginated<Organization>>} - An observable containing the paginated list of organizations.
21
+ */
22
+ getMany(params?: RequestParameter): Promise<Paginated<Organization>>;
23
+ /**
24
+ * Get many organizations filtered by specific properties with pagination, filtering, and sorting options.
25
+ *
26
+ * @param {Filter} filter - The filter object containing properties to filter by.
27
+ * @param {RequestParameter} params - The request parameters for pagination, filtering, and sorting.
28
+ * @returns {Promise<Paginated<Organization>>} - An observable containing the paginated list of organizations.
29
+ */
30
+ getManyFiltered(filter: Filter, params?: RequestParameter): Promise<Paginated<Organization>>;
31
+ /**
32
+ * Searches for all organizations using the organization client.
33
+ *
34
+ * @param {OrganizationSearchQuery} query - The search query object containing optional filters.
35
+ * @param {string} query.name - The name of the organization to filter by (optional).
36
+ * @returns {Promise<Organization[]>} - An observable containing an array of organizations matching the query.
37
+ */
38
+ searchAllOrganizationWithOrganizationClient(query: OrganizationSearchQuery): Promise<Organization[]>;
39
+ /**
40
+ * Creates an organization with a free subscription and invites a user to that organization
41
+ *
42
+ * @param {OrganizationCreateDto} organizationCreateDto - The data transfer object containing the organization details for creation
43
+ * @param {string} userEmail - The email address of the user to be invited to the organization
44
+ * @returns {Promise<Organization>} - An observable containing the created organization
45
+ */
46
+ createFreeOrgAndInviteUser(organizationCreateDto: OrganizationCreateDto, userEmail: string): Promise<Organization>;
47
+ addOrganizationMembers(id: string, usersWithOrgRoles: UserWithOrgRoles[]): Promise<void>;
48
+ addSubscriptionToOrganization(id: string, type: SubscriptionType): Promise<Organization>;
49
+ /**
50
+ * Deletes an organization.
51
+ *
52
+ * @param {string} id - organization id
53
+ * @returns {Promise<void>} - Promise resolving to void
54
+ */
55
+ deleteOne(id: string): Promise<void>;
56
+ }