@hahnpro/hpc-api 2025.11.4 → 2025.12.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 (76) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/package.json +2 -2
  3. package/src/lib/interfaces/index.d.ts +19 -18
  4. package/src/lib/interfaces/index.js +4 -1
  5. package/src/lib/interfaces/organization.interface.d.ts +4 -0
  6. package/src/lib/interfaces/organization.interface.js +6 -0
  7. package/src/lib/interfaces/resource.interface.d.ts +21 -0
  8. package/src/lib/interfaces/resource.interface.js +7 -1
  9. package/src/lib/mock/alert.mock.service.d.ts +2 -2
  10. package/src/lib/mock/alert.mock.service.js +2 -2
  11. package/src/lib/mock/asset.mock.service.d.ts +3 -2
  12. package/src/lib/mock/asset.mock.service.js +2 -1
  13. package/src/lib/mock/assetTypes.mock.service.d.ts +3 -2
  14. package/src/lib/mock/assetTypes.mock.service.js +2 -1
  15. package/src/lib/mock/content.mock.service.d.ts +3 -2
  16. package/src/lib/mock/content.mock.service.js +2 -1
  17. package/src/lib/mock/endpoint.mock.service.d.ts +2 -2
  18. package/src/lib/mock/endpoint.mock.service.js +2 -2
  19. package/src/lib/mock/event.mock.service.d.ts +2 -2
  20. package/src/lib/mock/event.mock.service.js +2 -2
  21. package/src/lib/mock/flow-deployment.mock.service.d.ts +3 -2
  22. package/src/lib/mock/flow-deployment.mock.service.js +2 -1
  23. package/src/lib/mock/flow-functions.mock.service.d.ts +2 -2
  24. package/src/lib/mock/flow-functions.mock.service.js +2 -2
  25. package/src/lib/mock/flow-modules.mock.service.d.ts +3 -2
  26. package/src/lib/mock/flow-modules.mock.service.js +2 -2
  27. package/src/lib/mock/flow.mock.service.d.ts +3 -2
  28. package/src/lib/mock/flow.mock.service.js +2 -1
  29. package/src/lib/mock/index.d.ts +5 -4
  30. package/src/lib/mock/index.js +10 -8
  31. package/src/lib/mock/notification-rules.mock.service.d.ts +2 -2
  32. package/src/lib/mock/notification-rules.mock.service.js +2 -2
  33. package/src/lib/mock/organizations-administration.mock.service.d.ts +5 -3
  34. package/src/lib/mock/organizations-administration.mock.service.js +5 -2
  35. package/src/lib/mock/organizations-resources.mock.service.d.ts +0 -1
  36. package/src/lib/mock/organizations-resources.mock.service.js +0 -3
  37. package/src/lib/mock/share.mock.service.d.ts +9 -0
  38. package/src/lib/mock/share.mock.service.js +19 -0
  39. package/src/lib/mock/task.mock.service.d.ts +3 -2
  40. package/src/lib/mock/task.mock.service.js +2 -1
  41. package/src/lib/mock/timeseries.mock.service.d.ts +3 -2
  42. package/src/lib/mock/timeseries.mock.service.js +2 -1
  43. package/src/lib/services/alert.service.d.ts +3 -2
  44. package/src/lib/services/alert.service.js +2 -2
  45. package/src/lib/services/asset.service.d.ts +3 -2
  46. package/src/lib/services/asset.service.js +2 -1
  47. package/src/lib/services/assettypes.service.d.ts +4 -2
  48. package/src/lib/services/assettypes.service.js +3 -2
  49. package/src/lib/services/content.service.d.ts +3 -2
  50. package/src/lib/services/content.service.js +2 -1
  51. package/src/lib/services/endpoint.service.d.ts +3 -2
  52. package/src/lib/services/endpoint.service.js +2 -2
  53. package/src/lib/services/event.service.d.ts +3 -2
  54. package/src/lib/services/event.service.js +2 -2
  55. package/src/lib/services/flow-deployment.service.d.ts +3 -2
  56. package/src/lib/services/flow-deployment.service.js +2 -1
  57. package/src/lib/services/flow-function.service.d.ts +3 -2
  58. package/src/lib/services/flow-function.service.js +2 -2
  59. package/src/lib/services/flow-module.service.d.ts +3 -2
  60. package/src/lib/services/flow-module.service.js +2 -2
  61. package/src/lib/services/flow.service.d.ts +3 -2
  62. package/src/lib/services/flow.service.js +2 -1
  63. package/src/lib/services/index.d.ts +1 -0
  64. package/src/lib/services/index.js +3 -1
  65. package/src/lib/services/notification-rule.service.d.ts +3 -2
  66. package/src/lib/services/notification-rule.service.js +2 -2
  67. package/src/lib/services/organizations-administration.service.d.ts +19 -8
  68. package/src/lib/services/organizations-administration.service.js +21 -7
  69. package/src/lib/services/organizations-resources.service.d.ts +0 -8
  70. package/src/lib/services/organizations-resources.service.js +2 -12
  71. package/src/lib/services/share.service.d.ts +7 -0
  72. package/src/lib/services/share.service.js +16 -0
  73. package/src/lib/services/task.service.d.ts +3 -2
  74. package/src/lib/services/task.service.js +3 -2
  75. package/src/lib/services/timeseries.service.d.ts +3 -2
  76. package/src/lib/services/timeseries.service.js +2 -1
@@ -23,8 +23,5 @@ class OrganizationsResourcesMockService extends _1.APIBaseMock {
23
23
  getResourceDeletionProgress(organizationId) {
24
24
  throw new Error('Method not implemented.');
25
25
  }
26
- getSseObservable(organizationId, path) {
27
- throw new Error('Method not implemented.');
28
- }
29
26
  }
30
27
  exports.OrganizationsResourcesMockService = OrganizationsResourcesMockService;
@@ -0,0 +1,9 @@
1
+ import { DataMockService } from '.';
2
+ import { OrgResourcePermission, SharedResources } from '../interfaces/resource.interface';
3
+ import { ShareService } from '../services/share.service';
4
+ export declare class ShareMockService<T> extends DataMockService<T> implements ShareService<T> {
5
+ constructor();
6
+ getBasePath(): string;
7
+ cancelAccess(id: string): Promise<void>;
8
+ share(ids: string[], orgResourcePermissions: OrgResourcePermission[], connectedResourcesToShare?: SharedResources, sourceIds?: string[], sourceType?: string): Promise<void>;
9
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ShareMockService = void 0;
4
+ const _1 = require(".");
5
+ class ShareMockService extends _1.DataMockService {
6
+ constructor() {
7
+ super();
8
+ }
9
+ getBasePath() {
10
+ return this.basePath;
11
+ }
12
+ async cancelAccess(id) {
13
+ throw new Error('Method not implemented.');
14
+ }
15
+ async share(ids, orgResourcePermissions, connectedResourcesToShare, sourceIds, sourceType) {
16
+ throw new Error('Method not implemented.');
17
+ }
18
+ }
19
+ exports.ShareMockService = ShareMockService;
@@ -1,7 +1,8 @@
1
- import { APIBaseMock, DataMockService, TrashMockService } from '.';
1
+ import { APIBaseMock, TrashMockService } from '.';
2
2
  import { DeleteQuery, LogbookEntry, LogbookEntryDto, Paginated, RequestParameter, Task, TokenOption } from '../interfaces';
3
3
  import { TaskService } from '../services';
4
- interface BaseService extends DataMockService<Task>, TrashMockService<Task> {
4
+ import { ShareMockService } from './share.mock.service';
5
+ interface BaseService extends ShareMockService<Task>, TrashMockService<Task> {
5
6
  }
6
7
  declare class BaseService extends APIBaseMock<Task> {
7
8
  }
@@ -4,10 +4,11 @@ exports.TaskMockService = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ts_mixer_1 = require("ts-mixer");
6
6
  const _1 = require(".");
7
+ const share_mock_service_1 = require("./share.mock.service");
7
8
  let BaseService = class BaseService extends _1.APIBaseMock {
8
9
  };
9
10
  BaseService = tslib_1.__decorate([
10
- (0, ts_mixer_1.mix)(_1.DataMockService, _1.TrashMockService)
11
+ (0, ts_mixer_1.mix)(share_mock_service_1.ShareMockService, _1.TrashMockService)
11
12
  ], BaseService);
12
13
  class TaskMockService extends BaseService {
13
14
  constructor(tasks, logbookEntries = []) {
@@ -1,7 +1,8 @@
1
- import { APIBaseMock, DataMockService, TrashMockService } from '.';
1
+ import { APIBaseMock, TrashMockService } from '.';
2
2
  import { DeleteQuery, Paginated, RequestParameter, TimeSeries, TimeSeriesValue, TS_GROUPS } from '../interfaces';
3
3
  import { TimeSeriesService } from '../services';
4
- interface BaseService extends DataMockService<TimeSeries & {
4
+ import { ShareMockService } from './share.mock.service';
5
+ interface BaseService extends ShareMockService<TimeSeries & {
5
6
  data: TimeSeriesValue[];
6
7
  }>, TrashMockService<TimeSeries & {
7
8
  data: TimeSeriesValue[];
@@ -4,10 +4,11 @@ exports.TimeseriesMockService = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ts_mixer_1 = require("ts-mixer");
6
6
  const _1 = require(".");
7
+ const share_mock_service_1 = require("./share.mock.service");
7
8
  let BaseService = class BaseService extends _1.APIBaseMock {
8
9
  };
9
10
  BaseService = tslib_1.__decorate([
10
- (0, ts_mixer_1.mix)(_1.DataMockService, _1.TrashMockService)
11
+ (0, ts_mixer_1.mix)(share_mock_service_1.ShareMockService, _1.TrashMockService)
11
12
  ], BaseService);
12
13
  class TimeseriesMockService extends BaseService {
13
14
  constructor(timeseries, timeseriesValues) {
@@ -1,5 +1,6 @@
1
- import { DataService, HttpClientService } from '.';
2
1
  import { Alert } from '../interfaces';
3
- export declare class AlertService extends DataService<Alert> {
2
+ import { HttpClientService } from './http-client.service';
3
+ import { ShareService } from './share.service';
4
+ export declare class AlertService extends ShareService<Alert> {
4
5
  constructor(httpClient: HttpClientService);
5
6
  }
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AlertService = void 0;
4
- const _1 = require(".");
5
- class AlertService extends _1.DataService {
4
+ const share_service_1 = require("./share.service");
5
+ class AlertService extends share_service_1.ShareService {
6
6
  constructor(httpClient) {
7
7
  super(httpClient, '/alerts');
8
8
  }
@@ -1,8 +1,9 @@
1
- import { DataService, HttpClientService, TrashService } from '.';
1
+ import { HttpClientService, TrashService } from '.';
2
2
  import { APIBase } from '../api-base';
3
3
  import { AddToProperty, Asset, AssetRevision, Attachment, DeleteAssetQuery, EventCause, EventLevelOverride, Filter, Paginated, RemoveFromProperty, RequestParameter, TokenOption } from '../interfaces';
4
4
  import { CrossPlatformFormData } from '../utils';
5
- interface BaseService extends DataService<Asset>, TrashService<Asset> {
5
+ import { ShareService } from './share.service';
6
+ interface BaseService extends ShareService<Asset>, TrashService<Asset> {
6
7
  }
7
8
  declare class BaseService extends APIBase {
8
9
  }
@@ -6,10 +6,11 @@ const ts_mixer_1 = require("ts-mixer");
6
6
  const _1 = require(".");
7
7
  const api_base_1 = require("../api-base");
8
8
  const utils_1 = require("../utils");
9
+ const share_service_1 = require("./share.service");
9
10
  let BaseService = class BaseService extends api_base_1.APIBase {
10
11
  };
11
12
  BaseService = tslib_1.__decorate([
12
- (0, ts_mixer_1.mix)(_1.DataService, _1.TrashService)
13
+ (0, ts_mixer_1.mix)(share_service_1.ShareService, _1.TrashService)
13
14
  ], BaseService);
14
15
  class AssetService extends BaseService {
15
16
  constructor(httpClient) {
@@ -1,7 +1,9 @@
1
- import { DataService, HttpClientService, TrashService } from '.';
2
1
  import { APIBase } from '../api-base';
3
2
  import { AssetType, DeleteAssetTypeQuery, Paginated, Template, TokenOption } from '../interfaces';
4
- interface BaseService extends DataService<AssetType>, TrashService<AssetType> {
3
+ import { HttpClientService } from './http-client.service';
4
+ import { ShareService } from './share.service';
5
+ import { TrashService } from './trash.service';
6
+ interface BaseService extends ShareService<AssetType>, TrashService<AssetType> {
5
7
  }
6
8
  declare class BaseService extends APIBase {
7
9
  }
@@ -3,12 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AssetTypesService = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ts_mixer_1 = require("ts-mixer");
6
- const _1 = require(".");
7
6
  const api_base_1 = require("../api-base");
7
+ const share_service_1 = require("./share.service");
8
+ const trash_service_1 = require("./trash.service");
8
9
  let BaseService = class BaseService extends api_base_1.APIBase {
9
10
  };
10
11
  BaseService = tslib_1.__decorate([
11
- (0, ts_mixer_1.mix)(_1.DataService, _1.TrashService)
12
+ (0, ts_mixer_1.mix)(share_service_1.ShareService, trash_service_1.TrashService)
12
13
  ], BaseService);
13
14
  class AssetTypesService extends BaseService {
14
15
  constructor(httpClient) {
@@ -1,8 +1,9 @@
1
- import { DataService, HttpClientService, TrashService } from '.';
1
+ import { HttpClientService, TrashService } from '.';
2
2
  import { APIBase } from '../api-base';
3
3
  import { Config, Content, ReturnType, TokenOption } from '../interfaces';
4
4
  import { CrossPlatformFormData } from '../utils';
5
- interface BaseService extends DataService<Content>, TrashService<Content> {
5
+ import { ShareService } from './share.service';
6
+ interface BaseService extends ShareService<Content>, TrashService<Content> {
6
7
  }
7
8
  declare class BaseService extends APIBase {
8
9
  }
@@ -7,10 +7,11 @@ const _1 = require(".");
7
7
  const api_base_1 = require("../api-base");
8
8
  const interfaces_1 = require("../interfaces");
9
9
  const utils_1 = require("../utils");
10
+ const share_service_1 = require("./share.service");
10
11
  let BaseService = class BaseService extends api_base_1.APIBase {
11
12
  };
12
13
  BaseService = tslib_1.__decorate([
13
- (0, ts_mixer_1.mix)(_1.DataService, _1.TrashService)
14
+ (0, ts_mixer_1.mix)(share_service_1.ShareService, _1.TrashService)
14
15
  ], BaseService);
15
16
  class ContentService extends BaseService {
16
17
  constructor(httpClient) {
@@ -1,6 +1,7 @@
1
- import { DataService, HttpClientService } from '.';
1
+ import { HttpClientService } from '.';
2
2
  import { Endpoint, EndpointLog, NotificationPayload, TokenOption } from '../interfaces';
3
- export declare class EndpointService extends DataService<Endpoint> {
3
+ import { ShareService } from './share.service';
4
+ export declare class EndpointService extends ShareService<Endpoint> {
4
5
  constructor(httpClient: HttpClientService);
5
6
  sendNotification(endpointId: string, payload: NotificationPayload, options?: TokenOption): Promise<void>;
6
7
  readLastLogByGroup(endpointId: string, group: string, options?: TokenOption): Promise<EndpointLog>;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EndpointService = void 0;
4
- const _1 = require(".");
5
- class EndpointService extends _1.DataService {
4
+ const share_service_1 = require("./share.service");
5
+ class EndpointService extends share_service_1.ShareService {
6
6
  constructor(httpClient) {
7
7
  super(httpClient, '/notification/endpoints');
8
8
  }
@@ -1,6 +1,7 @@
1
- import { DataService, HttpClientService } from '.';
1
+ import { HttpClientService } from '.';
2
2
  import { Event, TokenOption } from '../interfaces';
3
- export declare class EventService extends DataService<Event> {
3
+ import { ShareService } from './share.service';
4
+ export declare class EventService extends ShareService<Event> {
4
5
  constructor(httpClient: HttpClientService);
5
6
  getLastEventByAssetAndGroup(assetId: string, group: string, options?: TokenOption): Promise<Event>;
6
7
  getLastEventByAssetAndGroups(assetId: string, groups: string[], options?: TokenOption): Promise<Record<string, string>>;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EventService = void 0;
4
- const _1 = require(".");
5
- class EventService extends _1.DataService {
4
+ const share_service_1 = require("./share.service");
5
+ class EventService extends share_service_1.ShareService {
6
6
  constructor(httpClient) {
7
7
  super(httpClient, '/events');
8
8
  }
@@ -1,7 +1,8 @@
1
- import { DataService, HttpClientService, TrashService } from '.';
1
+ import { HttpClientService, TrashService } from '.';
2
2
  import { APIBase } from '../api-base';
3
3
  import { DeleteQuery, FlowDeployment, FlowDeploymentMetrics, FlowDeploymentStatistic, FlowLog, ResourceReference, TokenOption } from '../interfaces';
4
- interface BaseService extends DataService<FlowDeployment>, TrashService<FlowDeployment> {
4
+ import { ShareService } from './share.service';
5
+ interface BaseService extends ShareService<FlowDeployment>, TrashService<FlowDeployment> {
5
6
  }
6
7
  declare class BaseService extends APIBase {
7
8
  }
@@ -5,10 +5,11 @@ const tslib_1 = require("tslib");
5
5
  const ts_mixer_1 = require("ts-mixer");
6
6
  const _1 = require(".");
7
7
  const api_base_1 = require("../api-base");
8
+ const share_service_1 = require("./share.service");
8
9
  let BaseService = class BaseService extends api_base_1.APIBase {
9
10
  };
10
11
  BaseService = tslib_1.__decorate([
11
- (0, ts_mixer_1.mix)(_1.DataService, _1.TrashService)
12
+ (0, ts_mixer_1.mix)(share_service_1.ShareService, _1.TrashService)
12
13
  ], BaseService);
13
14
  class FlowDeploymentService extends BaseService {
14
15
  constructor(httpClient) {
@@ -1,6 +1,7 @@
1
- import { DataService, HttpClientService } from '.';
1
+ import { HttpClientService } from '.';
2
2
  import { FlowFunctionDto, Paginated, TokenOption } from '../interfaces';
3
- export declare class FlowFunctionService extends DataService<FlowFunctionDto> {
3
+ import { ShareService } from './share.service';
4
+ export declare class FlowFunctionService extends ShareService<FlowFunctionDto> {
4
5
  constructor(httpClient: HttpClientService);
5
6
  addMany(dto: any[], options?: TokenOption): Promise<FlowFunctionDto[]>;
6
7
  getRevisions(fqn: string, options?: TokenOption): Promise<Paginated<FlowFunctionDto>>;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FlowFunctionService = void 0;
4
- const _1 = require(".");
5
- class FlowFunctionService extends _1.DataService {
4
+ const share_service_1 = require("./share.service");
5
+ class FlowFunctionService extends share_service_1.ShareService {
6
6
  constructor(httpClient) {
7
7
  super(httpClient, '/flow/functions');
8
8
  }
@@ -1,7 +1,8 @@
1
- import { DataService, HttpClientService } from '.';
1
+ import { HttpClientService } from '.';
2
2
  import { FlowModule, TokenOption } from '../interfaces';
3
3
  import { CrossPlatformFormData } from '../utils';
4
- export declare class FlowModuleService extends DataService<FlowModule> {
4
+ import { ShareService } from './share.service';
5
+ export declare class FlowModuleService extends ShareService<FlowModule> {
5
6
  constructor(httpClient: HttpClientService);
6
7
  deleteArtifact(name: string, version: string, options?: TokenOption): Promise<FlowModule>;
7
8
  publish(form: CrossPlatformFormData, options?: TokenOption): Promise<unknown>;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FlowModuleService = void 0;
4
- const _1 = require(".");
5
4
  const utils_1 = require("../utils");
6
- class FlowModuleService extends _1.DataService {
5
+ const share_service_1 = require("./share.service");
6
+ class FlowModuleService extends share_service_1.ShareService {
7
7
  constructor(httpClient) {
8
8
  super(httpClient, '/flow/modules');
9
9
  }
@@ -1,7 +1,8 @@
1
- import { DataService, HttpClientService, TrashService } from '.';
1
+ import { HttpClientService, TrashService } from '.';
2
2
  import { APIBase } from '../api-base';
3
3
  import { FlowDeployment, FlowDiagram, FlowDto, Paginated, RequestParameter, TokenOption } from '../interfaces';
4
- interface BaseService extends DataService<FlowDto>, TrashService<FlowDto> {
4
+ import { ShareService } from './share.service';
5
+ interface BaseService extends ShareService<FlowDto>, TrashService<FlowDto> {
5
6
  }
6
7
  declare class BaseService extends APIBase {
7
8
  }
@@ -5,10 +5,11 @@ const tslib_1 = require("tslib");
5
5
  const ts_mixer_1 = require("ts-mixer");
6
6
  const _1 = require(".");
7
7
  const api_base_1 = require("../api-base");
8
+ const share_service_1 = require("./share.service");
8
9
  let BaseService = class BaseService extends api_base_1.APIBase {
9
10
  };
10
11
  BaseService = tslib_1.__decorate([
11
- (0, ts_mixer_1.mix)(_1.DataService, _1.TrashService)
12
+ (0, ts_mixer_1.mix)(share_service_1.ShareService, _1.TrashService)
12
13
  ], BaseService);
13
14
  class FlowService extends BaseService {
14
15
  constructor(httpClient) {
@@ -20,6 +20,7 @@ export { OrganizationsAdministrationService } from './organizations-administrati
20
20
  export { OrganizationsResourcesService } from './organizations-resources.service';
21
21
  export { ProxyService } from './proxy.service';
22
22
  export { SearchService } from './search.service';
23
+ export { ShareService } from './share.service';
23
24
  export { TaskService } from './task.service';
24
25
  export { TimeSeriesService } from './timeseries.service';
25
26
  export { UserService } from './user.service';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VaultService = exports.UserService = exports.TimeSeriesService = exports.TaskService = 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;
3
+ exports.VaultService = exports.UserService = exports.TimeSeriesService = exports.TaskService = exports.ShareService = 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
4
  var data_service_1 = require("./data.service");
5
5
  Object.defineProperty(exports, "DataService", { enumerable: true, get: function () { return data_service_1.DataService; } });
6
6
  var trash_service_1 = require("./trash.service");
@@ -45,6 +45,8 @@ var proxy_service_1 = require("./proxy.service");
45
45
  Object.defineProperty(exports, "ProxyService", { enumerable: true, get: function () { return proxy_service_1.ProxyService; } });
46
46
  var search_service_1 = require("./search.service");
47
47
  Object.defineProperty(exports, "SearchService", { enumerable: true, get: function () { return search_service_1.SearchService; } });
48
+ var share_service_1 = require("./share.service");
49
+ Object.defineProperty(exports, "ShareService", { enumerable: true, get: function () { return share_service_1.ShareService; } });
48
50
  var task_service_1 = require("./task.service");
49
51
  Object.defineProperty(exports, "TaskService", { enumerable: true, get: function () { return task_service_1.TaskService; } });
50
52
  var timeseries_service_1 = require("./timeseries.service");
@@ -1,5 +1,6 @@
1
- import { DataService, HttpClientService } from '.';
1
+ import { HttpClientService } from '.';
2
2
  import { NotificationRule } from '../interfaces';
3
- export declare class NotificationRuleService extends DataService<NotificationRule> {
3
+ import { ShareService } from './share.service';
4
+ export declare class NotificationRuleService extends ShareService<NotificationRule> {
4
5
  constructor(httpClient: HttpClientService);
5
6
  }
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NotificationRuleService = void 0;
4
- const _1 = require(".");
5
- class NotificationRuleService extends _1.DataService {
4
+ const share_service_1 = require("./share.service");
5
+ class NotificationRuleService extends share_service_1.ShareService {
6
6
  constructor(httpClient) {
7
7
  super(httpClient, '/notification/rules');
8
8
  }
@@ -1,5 +1,6 @@
1
+ import { Observable } from 'rxjs';
1
2
  import { APIBase } from '../api-base';
2
- import { Filter, Organization, OrganizationCreateDto, OrganizationSearchQuery, Paginated, RequestParameter, SubscriptionType, UserWithOrgRoles } from '../interfaces';
3
+ import { Filter, Organization, OrganizationCreateDto, OrganizationMembersInviteOrAdd, OrganizationResourcesProgress, OrganizationSearchQuery, Paginated, RequestParameter, ServerSentEvent, SubscriptionType, UserWithOrgRoles } from '../interfaces';
3
4
  import { HttpClientService } from './';
4
5
  /**
5
6
  * Service for managing organizations with administrative privileges (superuser role required).
@@ -37,20 +38,30 @@ export declare class OrganizationsAdministrationService extends APIBase {
37
38
  */
38
39
  searchAllOrganizationWithOrganizationClient(query: OrganizationSearchQuery): Promise<Organization[]>;
39
40
  /**
40
- * Creates an organization with a free subscription and invites a user to that organization
41
+ * Creates an organization with a free subscription and invites or adds a user to it.
42
+ * The owner of the organization can be either the user or the service account 'organization-client', depending on the 'createOrgAsOwner' flag in the OrganizationCreateFlowDto.
41
43
  *
42
44
  * @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
+ * @param {string} userEmail - The email address of the user to be invited or added to the organization
46
+ * @param {OrganizationMembersInviteOrAdd} inviteOrAdd - Specifies whether to invite the user or add them directly to the organization
47
+ * @param {boolean} createOrgAsOwner - Whether to create the organization with the user as the owner
48
+ * @returns {Promise<Organization>} - An promise of the created organization
45
49
  */
46
- createFreeOrgAndInviteUser(organizationCreateDto: OrganizationCreateDto, userEmail: string): Promise<Organization>;
50
+ createOrganization(organizationCreateDto: OrganizationCreateDto, userEmail: string, inviteOrAdd: OrganizationMembersInviteOrAdd, createOrgAsOwner?: boolean): Promise<Organization>;
47
51
  addOrganizationMembers(id: string, usersWithOrgRoles: UserWithOrgRoles[]): Promise<void>;
48
52
  addSubscriptionToOrganization(id: string, type: SubscriptionType): Promise<Organization>;
49
53
  /**
50
- * Deletes an organization.
54
+ * Starts the deletion of an organization by id.
51
55
  *
52
56
  * @param {string} id - organization id
53
- * @returns {Promise<void>} - Promise resolving to void
57
+ * @returns {Promise<string>} - Promise resolving to string containing the id of the organization deletion task
54
58
  */
55
- deleteOne(id: string): Promise<void>;
59
+ deleteOne(id: string): Promise<string>;
60
+ /**
61
+ * Subscribes to server-sent events to receive real-time progress updates on the resource creation task for a specific organization
62
+ *
63
+ * @param {string} id - The ID of the organization to monitor the resource creation progress for.
64
+ * @returns {Observable<OrganizationResourcesProgress>} An observable that emits progress updates.
65
+ */
66
+ getOrganizationDeletionProgress(id: string): Observable<ServerSentEvent<OrganizationResourcesProgress>>;
56
67
  }
@@ -53,16 +53,21 @@ class OrganizationsAdministrationService extends api_base_1.APIBase {
53
53
  return this.httpClient.get(`${this.basePath}/search`, { params });
54
54
  }
55
55
  /**
56
- * Creates an organization with a free subscription and invites a user to that organization
56
+ * Creates an organization with a free subscription and invites or adds a user to it.
57
+ * The owner of the organization can be either the user or the service account 'organization-client', depending on the 'createOrgAsOwner' flag in the OrganizationCreateFlowDto.
57
58
  *
58
59
  * @param {OrganizationCreateDto} organizationCreateDto - The data transfer object containing the organization details for creation
59
- * @param {string} userEmail - The email address of the user to be invited to the organization
60
- * @returns {Promise<Organization>} - An observable containing the created organization
60
+ * @param {string} userEmail - The email address of the user to be invited or added to the organization
61
+ * @param {OrganizationMembersInviteOrAdd} inviteOrAdd - Specifies whether to invite the user or add them directly to the organization
62
+ * @param {boolean} createOrgAsOwner - Whether to create the organization with the user as the owner
63
+ * @returns {Promise<Organization>} - An promise of the created organization
61
64
  */
62
- createFreeOrgAndInviteUser(organizationCreateDto, userEmail) {
63
- return this.httpClient.post(`${this.basePath}/create-free-org-invite-users`, {
65
+ createOrganization(organizationCreateDto, userEmail, inviteOrAdd, createOrgAsOwner = false) {
66
+ return this.httpClient.post(`${this.basePath}/create-org`, {
64
67
  organizationDto: organizationCreateDto,
65
68
  userEmail,
69
+ inviteOrAdd,
70
+ createOrgAsOwner,
66
71
  });
67
72
  }
68
73
  async addOrganizationMembers(id, usersWithOrgRoles) {
@@ -72,13 +77,22 @@ class OrganizationsAdministrationService extends api_base_1.APIBase {
72
77
  return this.httpClient.post(`${this.basePath}/${id}/subscription`, { type });
73
78
  }
74
79
  /**
75
- * Deletes an organization.
80
+ * Starts the deletion of an organization by id.
76
81
  *
77
82
  * @param {string} id - organization id
78
- * @returns {Promise<void>} - Promise resolving to void
83
+ * @returns {Promise<string>} - Promise resolving to string containing the id of the organization deletion task
79
84
  */
80
85
  deleteOne(id) {
81
86
  return this.httpClient.delete(`${this.basePath}/${id}`);
82
87
  }
88
+ /**
89
+ * Subscribes to server-sent events to receive real-time progress updates on the resource creation task for a specific organization
90
+ *
91
+ * @param {string} id - The ID of the organization to monitor the resource creation progress for.
92
+ * @returns {Observable<OrganizationResourcesProgress>} An observable that emits progress updates.
93
+ */
94
+ getOrganizationDeletionProgress(id) {
95
+ return this.httpClient.getSseObservable(`${this.basePath}/deletionTask/${id}`);
96
+ }
83
97
  }
84
98
  exports.OrganizationsAdministrationService = OrganizationsAdministrationService;
@@ -28,14 +28,6 @@ export declare class OrganizationsResourcesService extends APIBase {
28
28
  * @returns {Promise<string>} A promise that resolves to the id of the resource deletion task.
29
29
  */
30
30
  deleteResourcesForOrganization(organizationId: string): Promise<string>;
31
- /**
32
- * Subscribes to server-sent events to receive real-time progress updates on the resource tasks for a specific organization.
33
- *
34
- * @param {string} organizationId - The ID of the organization to monitor the resources progress updates for.
35
- * @param {string} path - The API path segment for the SSE endpoint
36
- * @returns {Observable<ServerSentEvent<OrganizationResourcesProgress>>} An observable that emits progress updates.
37
- */
38
- getSseObservable(organizationId: string, path: 'creationTask' | 'deletionTask'): Observable<ServerSentEvent<OrganizationResourcesProgress>>;
39
31
  /**
40
32
  * Subscribes to server-sent events to receive real-time progress updates on the resource creation task for a specific organization
41
33
  *
@@ -36,16 +36,6 @@ class OrganizationsResourcesService extends api_base_1.APIBase {
36
36
  deleteResourcesForOrganization(organizationId) {
37
37
  return this.httpClient.delete(`${this.basePath}/${organizationId}`);
38
38
  }
39
- /**
40
- * Subscribes to server-sent events to receive real-time progress updates on the resource tasks for a specific organization.
41
- *
42
- * @param {string} organizationId - The ID of the organization to monitor the resources progress updates for.
43
- * @param {string} path - The API path segment for the SSE endpoint
44
- * @returns {Observable<ServerSentEvent<OrganizationResourcesProgress>>} An observable that emits progress updates.
45
- */
46
- getSseObservable(organizationId, path) {
47
- return this.httpClient.getSseObservable(`${this.basePath}/${path}/${organizationId}`);
48
- }
49
39
  /**
50
40
  * Subscribes to server-sent events to receive real-time progress updates on the resource creation task for a specific organization
51
41
  *
@@ -53,7 +43,7 @@ class OrganizationsResourcesService extends api_base_1.APIBase {
53
43
  * @returns {Observable<OrganizationResourcesProgress>} An observable that emits progress updates.
54
44
  */
55
45
  getResourceCreationProgress(organizationId) {
56
- return this.getSseObservable(organizationId, 'creationTask');
46
+ return this.httpClient.getSseObservable(`${this.basePath}/creationTask/${organizationId}`);
57
47
  }
58
48
  /**
59
49
  * Subscribes to server-sent events to receive real-time progress updates on the resource deletion task for a specific organization.
@@ -62,7 +52,7 @@ class OrganizationsResourcesService extends api_base_1.APIBase {
62
52
  * @returns {Observable<ServerSentEvent<OrganizationResourcesProgress>>} An observable that emits progress updates.
63
53
  */
64
54
  getResourceDeletionProgress(organizationId) {
65
- return this.getSseObservable(organizationId, 'deletionTask');
55
+ return this.httpClient.getSseObservable(`${this.basePath}/deletionTask/${organizationId}`);
66
56
  }
67
57
  }
68
58
  exports.OrganizationsResourcesService = OrganizationsResourcesService;
@@ -0,0 +1,7 @@
1
+ import { OrgResourcePermission, SharedResources, TokenOption } from '../interfaces';
2
+ import { DataService } from './data.service';
3
+ export declare class ShareService<T> extends DataService<T> {
4
+ getBasePath(): string;
5
+ cancelAccess(id: string, options?: TokenOption): Promise<void>;
6
+ share(ids: string[], orgResourcePermissions: OrgResourcePermission[], connectedResourcesToShare?: SharedResources, sourceIds?: string[], sourceType?: string, options?: TokenOption): Promise<void>;
7
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ShareService = void 0;
4
+ const data_service_1 = require("./data.service");
5
+ class ShareService extends data_service_1.DataService {
6
+ getBasePath() {
7
+ return this.basePath;
8
+ }
9
+ cancelAccess(id, options = {}) {
10
+ return this.httpClient.put(`${this.basePath}/${id}/access`, {}, options);
11
+ }
12
+ share(ids, orgResourcePermissions, connectedResourcesToShare, sourceIds, sourceType, options = {}) {
13
+ return this.httpClient.post(`${this.basePath}/share`, { ids, orgResourcePermissions, connectedResourcesToShare, sourceIds, sourceType }, options);
14
+ }
15
+ }
16
+ exports.ShareService = ShareService;
@@ -1,7 +1,8 @@
1
- import { DataService, HttpClientService, TrashService } from '.';
1
+ import { HttpClientService, TrashService } from '.';
2
2
  import { APIBase } from '../api-base';
3
3
  import { LogbookEntry, LogbookEntryDto, Paginated, Task, TokenOption } from '../interfaces';
4
- interface BaseService extends DataService<Task>, TrashService<Task> {
4
+ import { ShareService } from './share.service';
5
+ interface BaseService extends ShareService<Task>, TrashService<Task> {
5
6
  }
6
7
  declare class BaseService extends APIBase {
7
8
  }
@@ -5,16 +5,17 @@ const tslib_1 = require("tslib");
5
5
  const ts_mixer_1 = require("ts-mixer");
6
6
  const _1 = require(".");
7
7
  const api_base_1 = require("../api-base");
8
+ const share_service_1 = require("./share.service");
8
9
  let BaseService = class BaseService extends api_base_1.APIBase {
9
10
  };
10
11
  BaseService = tslib_1.__decorate([
11
- (0, ts_mixer_1.mix)(_1.DataService, _1.TrashService)
12
+ (0, ts_mixer_1.mix)(share_service_1.ShareService, _1.TrashService)
12
13
  ], BaseService);
13
14
  class TaskService extends BaseService {
14
15
  constructor(httpClient) {
15
16
  super(httpClient, '/tasks');
16
17
  }
17
- // we may not need this method (already have the addOne method from DataService)
18
+ // we may not need this method (already have the addOne method from ShareService)
18
19
  createTaskAttachedToAsset(dto, options = {}) {
19
20
  return this.httpClient.post(this.basePath, dto, options);
20
21
  }