@hahnpro/hpc-api 2025.3.10 → 2025.4.1-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 (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 +7 -20
  7. package/src/lib/api.js +26 -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} +20 -17
  119. package/src/lib/{http.service.js → services/http-client.service.js} +83 -20
  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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @hahnpro/hpc-api
2
2
 
3
+ ## 2025.4.0
4
+
5
+ ### Major Changes
6
+
7
+ - Restructured the whole package
8
+ - Moved many interfaces to prevent duplication and to make them accessible for other packages
9
+ - Added an organization administration API service to manage organizations administration and separate it from the normal organization calls.
10
+ - Fixed an issue where the organization resources API sse observables did not use the correct base url.
11
+
3
12
  ## 2025.3.9
4
13
 
5
14
  - Updated Content Interface and Task Interface, Added `addElementToProperty` and `removeElementToProperty` mehtods to Asset API service
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hahnpro/hpc-api",
3
- "version": "2025.3.10",
3
+ "version": "2025.4.1-beta.1",
4
4
  "description": "Module for easy access to the HahnPRO Cloud API",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -8,11 +8,13 @@
8
8
  "url": "https://hahnpro.com"
9
9
  },
10
10
  "dependencies": {
11
+ "@microsoft/fetch-event-source": "2.0.1",
11
12
  "axios": "1.12.2",
12
13
  "eventsource": "4.0.0",
13
14
  "jose": "5.10.0",
14
15
  "jwt-decode": "4.0.0",
15
16
  "p-queue": "6.6.2",
17
+ "rxjs": "7.8.2",
16
18
  "ts-mixer": "6.0.4",
17
19
  "tslib": "2.8.1"
18
20
  },
package/src/index.d.ts CHANGED
@@ -1,19 +1,5 @@
1
+ export * from './lib/interfaces';
2
+ export * from './lib/services';
1
3
  export * from './lib/api';
2
- export type * from './lib/interfaces';
3
- export * from './lib/content.interface';
4
- export * from './lib/data.interface';
5
- export * from './lib/data.service';
6
- export * from './lib/endpoint.interface';
7
- export * from './lib/flow.interface';
8
- export * from './lib/flow-deployment.interface';
9
- export * from './lib/flow-function.interface';
10
- export * from './lib/http.service';
11
4
  export * from './lib/mock';
12
- export * from './lib/notification.interface';
13
- export * from './lib/organization.interface';
14
- export * from './lib/schema.interface';
15
- export * from './lib/secret.interface';
16
- export * from './lib/task.interface';
17
- export * from './lib/vault.interface';
18
- export * from './lib/task.service';
19
5
  export * from './lib/utils';
package/src/index.js CHANGED
@@ -1,21 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./lib/interfaces"), exports);
5
+ tslib_1.__exportStar(require("./lib/services"), exports);
4
6
  tslib_1.__exportStar(require("./lib/api"), exports);
5
- tslib_1.__exportStar(require("./lib/content.interface"), exports);
6
- tslib_1.__exportStar(require("./lib/data.interface"), exports);
7
- tslib_1.__exportStar(require("./lib/data.service"), exports);
8
- tslib_1.__exportStar(require("./lib/endpoint.interface"), exports);
9
- tslib_1.__exportStar(require("./lib/flow.interface"), exports);
10
- tslib_1.__exportStar(require("./lib/flow-deployment.interface"), exports);
11
- tslib_1.__exportStar(require("./lib/flow-function.interface"), exports);
12
- tslib_1.__exportStar(require("./lib/http.service"), exports);
13
7
  tslib_1.__exportStar(require("./lib/mock"), exports);
14
- tslib_1.__exportStar(require("./lib/notification.interface"), exports);
15
- tslib_1.__exportStar(require("./lib/organization.interface"), exports);
16
- tslib_1.__exportStar(require("./lib/schema.interface"), exports);
17
- tslib_1.__exportStar(require("./lib/secret.interface"), exports);
18
- tslib_1.__exportStar(require("./lib/task.interface"), exports);
19
- tslib_1.__exportStar(require("./lib/vault.interface"), exports);
20
- tslib_1.__exportStar(require("./lib/task.service"), exports);
21
8
  tslib_1.__exportStar(require("./lib/utils"), exports);
@@ -1,6 +1,6 @@
1
- import { HttpClient } from './http.service';
1
+ import { HttpClientService } from './services';
2
2
  export declare class APIBase {
3
- protected readonly httpClient: HttpClient;
3
+ protected readonly httpClient: HttpClientService;
4
4
  protected readonly basePath: string;
5
- constructor(httpClient: HttpClient, basePath: string);
5
+ constructor(httpClient: HttpClientService, basePath: string);
6
6
  }
package/src/lib/api.d.ts CHANGED
@@ -1,22 +1,6 @@
1
- import { AlertService } from './alert.service';
2
- import { ContentService } from './content.service';
3
- import { EndpointService } from './endpoint.service';
4
- import { FlowDeploymentService } from './flow-deployment.service';
5
- import { FlowFunctionService } from './flow-function.service';
6
- import { FlowModuleService } from './flow-module.service';
7
- import { FlowService } from './flow.service';
8
- import { HttpClient } from './http.service';
9
- import { NotificationRuleService } from './notification-rule.service';
10
- import { NotificationService } from './notification.service';
11
- import { OrganizationService } from './organization.service';
12
- import { ProxyService } from './proxy.service';
13
- import { SecretService } from './secret.service';
14
- import { AiService, AssetService, AssetTypesService, EventService, LabelService, SearchService, TimeSeriesService } from './services';
15
- import { TaskService } from './task.service';
16
- import { UserService } from './user.service';
17
- import { VaultService } from './vault.service';
1
+ import { AiService, AlertService, AssetService, AssetTypesService, ContentService, EndpointService, EventService, FlowDeploymentService, FlowFunctionService, FlowModuleService, FlowService, HttpClientService, LabelService, NotificationRuleService, NotificationService, OrganizationsAdministrationService, OrganizationsResourcesService, OrganizationsService, ProxyService, SearchService, SecretService, TaskService, TimeSeriesService, UserService, VaultService } from './services';
18
2
  export declare class API {
19
- readonly httpClient?: HttpClient;
3
+ readonly httpClient?: HttpClientService;
20
4
  ai: AiService;
21
5
  alerts: AlertService;
22
6
  assets: AssetService;
@@ -29,7 +13,9 @@ export declare class API {
29
13
  flowFunctions: FlowFunctionService;
30
14
  flowModules: FlowModuleService;
31
15
  labels: LabelService;
32
- organizations: OrganizationService;
16
+ organizations: OrganizationsService;
17
+ organizationsAdministration: OrganizationsAdministrationService;
18
+ organizationsResources: OrganizationsResourcesService;
33
19
  proxy: ProxyService;
34
20
  search: SearchService;
35
21
  secrets: SecretService;
@@ -39,7 +25,8 @@ export declare class API {
39
25
  vault: VaultService;
40
26
  notifications: NotificationService;
41
27
  notificationRules: NotificationRuleService;
42
- constructor(httpClient?: HttpClient, context?: {
28
+ constructor(httpClient?: HttpClientService, context?: {
43
29
  tokenSubject?: string;
30
+ activeOrg?: string;
44
31
  });
45
32
  }
package/src/lib/api.js CHANGED
@@ -1,23 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.API = void 0;
4
- const alert_service_1 = require("./alert.service");
5
- const content_service_1 = require("./content.service");
6
- const endpoint_service_1 = require("./endpoint.service");
7
- const flow_deployment_service_1 = require("./flow-deployment.service");
8
- const flow_function_service_1 = require("./flow-function.service");
9
- const flow_module_service_1 = require("./flow-module.service");
10
- const flow_service_1 = require("./flow.service");
11
- const http_service_1 = require("./http.service");
12
- const notification_rule_service_1 = require("./notification-rule.service");
13
- const notification_service_1 = require("./notification.service");
14
- const organization_service_1 = require("./organization.service");
15
- const proxy_service_1 = require("./proxy.service");
16
- const secret_service_1 = require("./secret.service");
17
4
  const services_1 = require("./services");
18
- const task_service_1 = require("./task.service");
19
- const user_service_1 = require("./user.service");
20
- const vault_service_1 = require("./vault.service");
21
5
  class API {
22
6
  constructor(httpClient, context) {
23
7
  this.httpClient = httpClient;
@@ -39,30 +23,40 @@ class API {
39
23
  if (!secret) {
40
24
  throw new Error('"API_BASE_URL", "API_USER", "AUTH_REALM" and "AUTH_SECRET" environment variables must be set');
41
25
  }
42
- this.httpClient = new http_service_1.HttpClient(apiUrl, authUrl, realm, client, secret, context?.tokenSubject);
26
+ this.httpClient = new services_1.HttpClientService({
27
+ baseURL: apiUrl,
28
+ authBaseURL: authUrl,
29
+ realm,
30
+ clientId: client,
31
+ clientSecret: secret,
32
+ tokenSubject: context?.tokenSubject,
33
+ activeOrg: context?.activeOrg,
34
+ });
43
35
  }
44
36
  this.ai = new services_1.AiService(this.httpClient);
45
- this.alerts = new alert_service_1.AlertService(this.httpClient);
37
+ this.alerts = new services_1.AlertService(this.httpClient);
46
38
  this.assets = new services_1.AssetService(this.httpClient);
47
39
  this.assetTypes = new services_1.AssetTypesService(this.httpClient);
48
- this.contents = new content_service_1.ContentService(this.httpClient);
49
- this.endpoints = new endpoint_service_1.EndpointService(this.httpClient);
40
+ this.contents = new services_1.ContentService(this.httpClient);
41
+ this.endpoints = new services_1.EndpointService(this.httpClient);
50
42
  this.events = new services_1.EventService(this.httpClient);
51
- this.flows = new flow_service_1.FlowService(this.httpClient);
52
- this.flowDeployments = new flow_deployment_service_1.FlowDeploymentService(this.httpClient);
53
- this.flowFunctions = new flow_function_service_1.FlowFunctionService(this.httpClient);
54
- this.flowModules = new flow_module_service_1.FlowModuleService(this.httpClient);
43
+ this.flows = new services_1.FlowService(this.httpClient);
44
+ this.flowDeployments = new services_1.FlowDeploymentService(this.httpClient);
45
+ this.flowFunctions = new services_1.FlowFunctionService(this.httpClient);
46
+ this.flowModules = new services_1.FlowModuleService(this.httpClient);
55
47
  this.labels = new services_1.LabelService(this.httpClient);
56
- this.organizations = new organization_service_1.OrganizationService(this.httpClient);
57
- this.proxy = new proxy_service_1.ProxyService(this.httpClient);
48
+ this.organizations = new services_1.OrganizationsService(this.httpClient);
49
+ this.organizationsAdministration = new services_1.OrganizationsAdministrationService(this.httpClient);
50
+ this.organizationsResources = new services_1.OrganizationsResourcesService(this.httpClient);
51
+ this.proxy = new services_1.ProxyService(this.httpClient);
58
52
  this.search = new services_1.SearchService(this.httpClient);
59
- this.secrets = new secret_service_1.SecretService(this.httpClient);
60
- this.tasks = new task_service_1.TaskService(this.httpClient);
53
+ this.secrets = new services_1.SecretService(this.httpClient);
54
+ this.tasks = new services_1.TaskService(this.httpClient);
61
55
  this.timeSeries = new services_1.TimeSeriesService(this.httpClient);
62
- this.users = new user_service_1.UserService(this.httpClient);
63
- this.vault = new vault_service_1.VaultService(this.httpClient);
64
- this.notifications = new notification_service_1.NotificationService(this.httpClient);
65
- this.notificationRules = new notification_rule_service_1.NotificationRuleService(this.httpClient);
56
+ this.users = new services_1.UserService(this.httpClient);
57
+ this.vault = new services_1.VaultService(this.httpClient);
58
+ this.notifications = new services_1.NotificationService(this.httpClient);
59
+ this.notificationRules = new services_1.NotificationRuleService(this.httpClient);
66
60
  }
67
61
  }
68
62
  exports.API = API;
@@ -1,4 +1,4 @@
1
- import { Owner } from './resource.interface';
1
+ import { Owner } from '.';
2
2
  export interface AiAssistant {
3
3
  id: string;
4
4
  agent?: string;
@@ -1,4 +1,4 @@
1
- import { Author, Owner } from './interfaces';
1
+ import { Author, Owner } from '.';
2
2
  export interface Alert {
3
3
  id?: string;
4
4
  name: string;
@@ -1,5 +1,4 @@
1
- import { Content } from '../content.interface';
2
- import { Author, Owner } from './resource.interface';
1
+ import { Author, Content, Owner } from '.';
3
2
  export interface AssetType {
4
3
  id?: string;
5
4
  name: string;
@@ -1,5 +1,4 @@
1
- import { Author, Owner } from './interfaces';
2
- import { Storage } from './storage.interface';
1
+ import { Author, Owner, Storage } from '.';
3
2
  export interface Content {
4
3
  id?: string;
5
4
  fileId: string;
@@ -1,6 +1,6 @@
1
- import { TokenOption } from './http.service';
1
+ import { TokenOption } from '.';
2
2
  export interface Paginated<T> {
3
- docs: T;
3
+ docs: T[];
4
4
  total: number;
5
5
  limit: number;
6
6
  page?: number;
@@ -29,8 +29,8 @@ export interface DataInterface<T> {
29
29
  getOne(id: string, options?: TokenOption & {
30
30
  [key: string]: any;
31
31
  }): Promise<T>;
32
- getMany(params?: RequestParameter, options?: TokenOption): Promise<Paginated<T[]>>;
33
- getManyFiltered(filter: Filter, params?: RequestParameter, options?: TokenOption): Promise<Paginated<T[]>>;
32
+ getMany(params?: RequestParameter, options?: TokenOption): Promise<Paginated<T>>;
33
+ getManyFiltered(filter: Filter, params?: RequestParameter, options?: TokenOption): Promise<Paginated<T>>;
34
34
  updateOne(id: string, dto: any, options?: TokenOption & {
35
35
  [key: string]: any;
36
36
  }): Promise<T>;
@@ -1,4 +1,4 @@
1
- import { Author, Owner, Resource } from './resource.interface';
1
+ import { Author, Owner, Resource } from '.';
2
2
  export interface Event extends Resource {
3
3
  data?: Record<string, any>;
4
4
  assetRef?: string;
@@ -1,6 +1,4 @@
1
- import { FlowDiagram, FlowDto } from './flow.interface';
2
- import { Resource } from './interfaces';
3
- import { Storage } from './storage.interface';
1
+ import { FlowDiagram, FlowDto, Resource, Storage } from '.';
4
2
  export interface FlowDeployment extends Resource {
5
3
  flow: string | FlowDto;
6
4
  diagram: string | FlowDiagram;
@@ -1,4 +1,4 @@
1
- import { Artifact } from './storage.interface';
1
+ import { Artifact } from '.';
2
2
  export interface FlowModule {
3
3
  name: string;
4
4
  description?: string;
@@ -1,6 +1,4 @@
1
- import { FlowDeployment } from './flow-deployment.interface';
2
- import { Resource } from './interfaces';
3
- import { JsonSchemaForm } from './schema.interface';
1
+ import { FlowDeployment, JsonSchemaForm, Resource } from '.';
4
2
  export interface FlowDto extends Resource {
5
3
  diagram: string | FlowDiagram;
6
4
  deployments?: string[] | FlowDeployment[];
@@ -0,0 +1,13 @@
1
+ import { AxiosRequestConfig } from 'axios';
2
+ export type TokenOption = {
3
+ token?: string;
4
+ };
5
+ export type Config = TokenOption & AxiosRequestConfig;
6
+ export interface Issuer {
7
+ issuer: string;
8
+ token_endpoint: string;
9
+ grant_types_supported: string[];
10
+ token_endpoint_auth_methods_supported: string[];
11
+ token_endpoint_auth_signing_alg?: string;
12
+ token_endpoint_auth_signing_alg_values_supported: string[];
13
+ }
@@ -1,7 +1,29 @@
1
- export type { Resource, ResourceReference, Owner, OwnerType, Author } from './resource.interface';
2
- export type { AiAssistant, AssistantMessage, Message, SpeechToken, SystemMessage, Thread, ThreadPopulated, ToolMessage, UserMessage, } from './ai.interface';
3
- export type { Asset, AssetRevision, AssetType, AssetTypeRevision, Attachment, EventCause, EventLevelOverride, Template, } from './asset.interface';
4
- export type { Event, EventLevel, CreateEventDto } from './event.interface';
5
- export type { Label, CreateLabelDto, UpdateLabelDto } from './label.interface';
6
- export type { TimeSeries, TimeSeriesBucket, TimeSeriesCondition, TimeSeriesValue, TS_GROUPS } from './timeseries.interface';
7
- export type { SearchOptions, SearchResult, SearchSortOption, SortableField } from './search.interface';
1
+ export { AiAssistant, AssistantMessage, Message, SpeechToken, SystemMessage, Thread, ThreadPopulated, ToolMessage, UserMessage, } from './ai.interface';
2
+ export { Alert, AlertCondition, AlertLevel, AlertType, TimeSeriesReference } from './alert.interface';
3
+ export { Asset, AssetTypeRevision, AssetRevision, AssetType, Attachment, EventCause, EventLevelOverride, Template, RemoveFromProperty, AddToProperty, } from './asset.interface';
4
+ export { ReturnType, Content, ContentAnalysis } from './content.interface';
5
+ export { Filter, Paginated, RequestParameter, DataInterface, instanceOfTimePeriod } from './data.interface';
6
+ export { Endpoint, EndpointLog, NotificationPayload } from './endpoint.interface';
7
+ export { Event, EventLevel, CreateEventDto } from './event.interface';
8
+ export { FlowDto, FlowDiagram, FlowRevision, DashboardItem } from './flow.interface';
9
+ export { FlowDeployment, FlowDeploymentMetrics, FlowLog, FlowDeploymentStatistic, FlowModel, FlowModelElement, Metrics, FlowConnection, Stats, StatsValues, } from './flow-deployment.interface';
10
+ export { FlowFunctionDto, FlowFunctionRevision } from './flow-function.interface';
11
+ export { FlowModule } from './flow-module.interface';
12
+ export { TokenOption, Issuer, Config } from './http.interface';
13
+ export { InvitationRepresentation } from './invitation-representation.interface';
14
+ export { KeycloakProfile } from './keycloak-profile.interface';
15
+ export { Label, CreateLabelDto, UpdateLabelDto } from './label.interface';
16
+ export { NotificationType, Notification } from './notification.interface';
17
+ export { TagRule, NotificationRule, StatusRule } from './notification-rule.interface';
18
+ export { Organization, OrganizationCreateDto, OrganizationData, OrganizationDataKind, OrganizationDomain, OrganizationName, OrganizationRolesAdjustment, OrganizationSearchQuery, SubscriptionType, UserWithOrgRoles, } from './organization.interface';
19
+ export { OrganizationRoleRepresentation } from './organization-role-representation.interface';
20
+ export { OrganizationResourcesProgress, OrganizationResourcesProgressDto, OrganizationResourcesProgressErrorDto, } from './organizations-resources.interface';
21
+ export { Author, Owner, OwnerType, Resource, ResourceReference } from './resource.interface';
22
+ export { JsonSchema, JsonSchemaArray, JsonSchemaForm, JsonSchemaType, JsonSchemaTypeName } from './schema.interface';
23
+ export { SearchOptions, SearchResult, SearchSortOption, SortableField } from './search.interface';
24
+ export { Secret } from './secret.interface';
25
+ export { FileType, Artifact, Storage, StorageProvider } from './storage.interface';
26
+ export { Task, LogbookEntry, LogbookEntryDto } from './task.interface';
27
+ export { TimeSeries, TimeSeriesBucket, TimeSeriesCondition, TimeSeriesValue, TS_GROUPS } from './timeseries.interface';
28
+ export { Permission, Application, TableSetting, TableSettingProfile, UserSettings } from './user-settings.interface';
29
+ export { VaultSecret } from './vault.interface';
@@ -1,2 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OwnerType = exports.instanceOfTimePeriod = exports.ContentAnalysis = exports.ReturnType = exports.AlertType = exports.AlertLevel = void 0;
4
+ var alert_interface_1 = require("./alert.interface");
5
+ Object.defineProperty(exports, "AlertLevel", { enumerable: true, get: function () { return alert_interface_1.AlertLevel; } });
6
+ Object.defineProperty(exports, "AlertType", { enumerable: true, get: function () { return alert_interface_1.AlertType; } });
7
+ var content_interface_1 = require("./content.interface");
8
+ Object.defineProperty(exports, "ReturnType", { enumerable: true, get: function () { return content_interface_1.ReturnType; } });
9
+ Object.defineProperty(exports, "ContentAnalysis", { enumerable: true, get: function () { return content_interface_1.ContentAnalysis; } });
10
+ var data_interface_1 = require("./data.interface");
11
+ Object.defineProperty(exports, "instanceOfTimePeriod", { enumerable: true, get: function () { return data_interface_1.instanceOfTimePeriod; } });
12
+ var resource_interface_1 = require("./resource.interface");
13
+ Object.defineProperty(exports, "OwnerType", { enumerable: true, get: function () { return resource_interface_1.OwnerType; } });
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Phase Two Admin REST API
3
+ * This is a REST API reference for the Phase Two Keycloak custom resources. These are extensions to the standard [Keycloak Admin REST API](https://www.keycloak.org/docs-api/17.0/rest-api/index.html). ### Base URI format Paths specified in the documentation are relative to the the base URI. - Format: `https://<host>:<port>/auth/realms` - Example: `https://app.phasetwo.io/auth/realms` ### Authentication Authentication is achieved by using the `Authentication: Bearer <token>` header in all requests. This is either the access token received from a normal authentication, or by a request directly to the OpenID Connect token endpoint. It is recommended that you use a Keycloak Admin Client, such as [this one for Javascript](https://github.com/keycloak/keycloak-nodejs-admin-client), as they take care of authentication, getting an access token, and refreshing it when it expires. #### Client credentials grant example ``` POST /auth/realms/test-realm/protocol/openid-connect/token Host: app.phasetwo.io Accept: application/json Content-type: application/x-www-form-urlencoded grant_type=client_credentials&client_id=admin-cli&client_secret=fd649804-3a74-4d69-acaa-8f065c6b7da1 ``` #### Password grant example ``` POST /auth/realms/test-realm/protocol/openid-connect/token Host: app.phasetwo.io Accept: application/json Content-type: application/x-www-form-urlencoded grant_type=password&username=uname@foo.com&password=pwd123AZY&client_id=admin-cli ``` ### SDKs Modern API libraries are available for several common languages. These are available as open source at the links below, or you can choose to generate your own using our [OpenAPI spec file](https://raw.githubusercontent.com/p2-inc/phasetwo-docs/master/openapi.yaml). | Language | Library | | --- | --- | | Java (and other JVM langs) | https://github.com/p2-inc/phasetwo-java | | JavaScript/TypeScript | https://github.com/p2-inc/phasetwo-js | | Python | https://github.com/p2-inc/phasetwo-python |
4
+ *
5
+ * The version of the OpenAPI document: v1
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface InvitationRepresentation
16
+ */
17
+ export interface InvitationRepresentation {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof InvitationRepresentation
22
+ */
23
+ id?: string;
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof InvitationRepresentation
28
+ */
29
+ email?: string;
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof InvitationRepresentation
34
+ */
35
+ inviterId?: string;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof InvitationRepresentation
40
+ */
41
+ organizationId?: string;
42
+ /**
43
+ *
44
+ * @type {Array<string>}
45
+ * @memberof InvitationRepresentation
46
+ */
47
+ roles?: Array<string>;
48
+ }
@@ -0,0 +1,12 @@
1
+ export interface KeycloakProfile {
2
+ id?: string;
3
+ username?: string;
4
+ email?: string;
5
+ firstName?: string;
6
+ lastName?: string;
7
+ enabled?: boolean;
8
+ emailVerified?: boolean;
9
+ totp?: boolean;
10
+ createdTimestamp?: number;
11
+ attributes?: Record<string, unknown>;
12
+ }
@@ -1,4 +1,4 @@
1
- import { Author, Owner } from './resource.interface';
1
+ import { Author, Owner } from '.';
2
2
  export interface Label {
3
3
  id: string;
4
4
  name: string;
@@ -1,4 +1,4 @@
1
- import { Author, Owner } from './interfaces';
1
+ import { Author, Owner } from '.';
2
2
  export interface NotificationRule {
3
3
  id?: string;
4
4
  name: string;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * COPIED FROM:
3
+ * Phase Two Admin REST API
4
+ * This is a REST API reference for the Phase Two Keycloak custom resources. These are extensions to the standard [Keycloak Admin REST API](https://www.keycloak.org/docs-api/17.0/rest-api/index.html). ### Base URI format Paths specified in the documentation are relative to the the base URI. - Format: `https://<host>:<port>/auth/realms` - Example: `https://app.phasetwo.io/auth/realms` ### Authentication Authentication is achieved by using the `Authentication: Bearer <token>` header in all requests. This is either the access token received from a normal authentication, or by a request directly to the OpenID Connect token endpoint. It is recommended that you use a Keycloak Admin Client, such as [this one for Javascript](https://github.com/keycloak/keycloak-nodejs-admin-client), as they take care of authentication, getting an access token, and refreshing it when it expires. #### Client credentials grant example ``` POST /auth/realms/test-realm/protocol/openid-connect/token Host: app.phasetwo.io Accept: application/json Content-type: application/x-www-form-urlencoded grant_type=client_credentials&client_id=admin-cli&client_secret=fd649804-3a74-4d69-acaa-8f065c6b7da1 ``` #### Password grant example ``` POST /auth/realms/test-realm/protocol/openid-connect/token Host: app.phasetwo.io Accept: application/json Content-type: application/x-www-form-urlencoded grant_type=password&username=uname@foo.com&password=pwd123AZY&client_id=admin-cli ``` ### SDKs Modern API libraries are available for several common languages. These are available as open source at the links below, or you can choose to generate your own using our [OpenAPI spec file](https://raw.githubusercontent.com/p2-inc/phasetwo-docs/master/openapi.yaml). | Language | Library | | --- | --- | | Java (and other JVM langs) | https://github.com/p2-inc/phasetwo-java | | JavaScript/TypeScript | https://github.com/p2-inc/phasetwo-js | | Python | https://github.com/p2-inc/phasetwo-python |
5
+ *
6
+ * The version of the OpenAPI document: v1
7
+ *
8
+ *
9
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10
+ * https://openapi-generator.tech
11
+ * Do not edit the class manually.
12
+ */
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface OrganizationRoleRepresentation
17
+ */
18
+ export interface OrganizationRoleRepresentation {
19
+ /**
20
+ *
21
+ * @type {string}
22
+ * @memberof OrganizationRoleRepresentation
23
+ */
24
+ id?: string;
25
+ /**
26
+ *
27
+ * @type {string}
28
+ * @memberof OrganizationRoleRepresentation
29
+ */
30
+ name?: string;
31
+ /**
32
+ *
33
+ * @type {string}
34
+ * @memberof OrganizationRoleRepresentation
35
+ */
36
+ description?: string;
37
+ }
@@ -0,0 +1,74 @@
1
+ import { Author, InvitationRepresentation, KeycloakProfile, OrganizationRoleRepresentation } from '.';
2
+ export interface Organization {
3
+ id?: string;
4
+ name: string;
5
+ description?: string;
6
+ realm?: string;
7
+ domains?: string[];
8
+ logo?: string;
9
+ addressLine?: string;
10
+ zipCode?: string;
11
+ city?: string;
12
+ phoneNumber?: string;
13
+ website?: string;
14
+ vat?: string;
15
+ certificates?: string[];
16
+ services?: string[];
17
+ subscriptionId?: string;
18
+ previousSubscriptions?: string[];
19
+ assetId?: string;
20
+ verified?: boolean;
21
+ deletionRequested?: boolean;
22
+ createdAt?: Date | string;
23
+ updatedAt?: Date | string;
24
+ createdBy?: Author;
25
+ updatedBy?: Author;
26
+ }
27
+ export interface OrganizationCreateDto {
28
+ name: string;
29
+ description?: string;
30
+ domains?: string[];
31
+ logo?: string;
32
+ addressLine?: string;
33
+ zipCode?: string;
34
+ city?: string;
35
+ phoneNumber?: string;
36
+ vat?: string;
37
+ assetId?: string;
38
+ certificates?: string[];
39
+ services?: string[];
40
+ subscriptionId?: string;
41
+ previousSubscriptions?: string[];
42
+ deletionRequested?: boolean;
43
+ }
44
+ export interface OrganizationData {
45
+ members: KeycloakProfile[];
46
+ invitations: InvitationRepresentation[];
47
+ roles: OrganizationRoleRepresentation[];
48
+ userRoles: OrganizationRoleRepresentation[];
49
+ domains: OrganizationDomain[];
50
+ }
51
+ export type OrganizationDataKind = 'members' | 'invitations' | 'roles' | 'domains' | 'userRoles';
52
+ export interface OrganizationDomain {
53
+ domainName: string;
54
+ recordKey?: string;
55
+ recordValue?: string;
56
+ verified: boolean;
57
+ }
58
+ export interface OrganizationName {
59
+ id: string;
60
+ name?: string;
61
+ isDeleted?: boolean;
62
+ }
63
+ export interface OrganizationRolesAdjustment {
64
+ grantRoles?: string[];
65
+ revokeRoles?: string[];
66
+ }
67
+ export interface OrganizationSearchQuery {
68
+ name?: string;
69
+ }
70
+ export interface UserWithOrgRoles {
71
+ username: string;
72
+ orgRoles: string[];
73
+ }
74
+ export type SubscriptionType = 'dev' | 'free' | 'inactive' | 'pro';
@@ -0,0 +1,9 @@
1
+ export type OrganizationResourcesProgress = OrganizationResourcesProgressDto | OrganizationResourcesProgressErrorDto;
2
+ export interface OrganizationResourcesProgressDto {
3
+ step: string;
4
+ stepNumber: number;
5
+ maxSteps: number;
6
+ }
7
+ export interface OrganizationResourcesProgressErrorDto {
8
+ message: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- import { Author } from './interfaces/resource.interface';
1
+ import { Author } from '.';
2
2
  export interface Task {
3
3
  id: string;
4
4
  name: string;
@@ -21,24 +21,26 @@ export interface Task {
21
21
  createdAt?: string;
22
22
  updatedAt?: string;
23
23
  deletedAt?: string;
24
+ logbookSchema?: string;
24
25
  }
25
26
  export interface LogbookEntry {
26
- id: string;
27
+ id?: string;
27
28
  taskId: string;
28
- date: string;
29
+ date: Date;
29
30
  duration: number;
30
- materials: {
31
+ materials?: {
31
32
  name: string;
32
33
  quantity: number;
33
34
  }[];
34
35
  comment?: string;
35
36
  source: 'manual' | 'voice' | 'automatic';
36
- createdBy: Author;
37
- createdAt: string;
38
- updatedAt: string;
37
+ createdBy?: Author;
38
+ createdAt?: string;
39
+ updatedAt?: string;
40
+ data?: Record<string, unknown>;
39
41
  }
40
42
  export interface LogbookEntryDto {
41
- date: string;
43
+ date: Date;
42
44
  duration: number;
43
45
  materials: {
44
46
  name: string;
@@ -48,4 +50,5 @@ export interface LogbookEntryDto {
48
50
  source?: 'manual' | 'voice' | 'automatic';
49
51
  taskId: string;
50
52
  createdBy?: Author;
53
+ data?: Record<string, unknown>;
51
54
  }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });