@hahnpro/hpc-api 2025.12.0 → 2026.1.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.
- package/CHANGELOG.md +5 -0
- package/package.json +1 -1
- package/src/lib/api.d.ts +3 -0
- package/src/lib/api.js +2 -1
- package/src/lib/interfaces/index.d.ts +4 -2
- package/src/lib/interfaces/index.js +8 -1
- package/src/lib/interfaces/label.interface.d.ts +3 -1
- package/src/lib/interfaces/label.interface.js +2 -0
- package/src/lib/interfaces/resource.interface.d.ts +18 -0
- package/src/lib/interfaces/resource.interface.js +36 -1
- package/src/lib/interfaces/task.interface.d.ts +31 -12
- package/src/lib/interfaces/task.interface.js +21 -0
- package/src/lib/mock/alert.mock.service.d.ts +7 -1
- package/src/lib/mock/alert.mock.service.js +10 -1
- package/src/lib/mock/api.mock.js +3 -1
- package/src/lib/mock/asset.mock.service.d.ts +2 -2
- package/src/lib/mock/asset.mock.service.js +2 -1
- package/src/lib/mock/assetTypes.mock.service.d.ts +2 -2
- package/src/lib/mock/assetTypes.mock.service.js +2 -1
- package/src/lib/mock/content.mock.service.d.ts +2 -2
- package/src/lib/mock/content.mock.service.js +2 -1
- package/src/lib/mock/endpoint.mock.service.d.ts +8 -1
- package/src/lib/mock/endpoint.mock.service.js +11 -1
- package/src/lib/mock/event.mock.service.d.ts +8 -1
- package/src/lib/mock/event.mock.service.js +11 -1
- package/src/lib/mock/flow-deployment.mock.service.d.ts +2 -2
- package/src/lib/mock/flow-deployment.mock.service.js +2 -1
- package/src/lib/mock/flow-functions.mock.service.d.ts +7 -1
- package/src/lib/mock/flow-functions.mock.service.js +10 -1
- package/src/lib/mock/flow-modules.mock.service.d.ts +6 -2
- package/src/lib/mock/flow-modules.mock.service.js +10 -1
- package/src/lib/mock/flow.mock.service.d.ts +2 -2
- package/src/lib/mock/flow.mock.service.js +2 -1
- package/src/lib/mock/notification-rules.mock.service.d.ts +8 -1
- package/src/lib/mock/notification-rules.mock.service.js +11 -1
- package/src/lib/mock/organizations-administration.mock.service.d.ts +2 -2
- package/src/lib/mock/organizations-administration.mock.service.js +2 -2
- package/src/lib/mock/share.mock.service.d.ts +2 -2
- package/src/lib/mock/share.mock.service.js +1 -1
- package/src/lib/mock/task.mock.service.d.ts +2 -2
- package/src/lib/mock/task.mock.service.js +3 -2
- package/src/lib/mock/timeseries.mock.service.d.ts +4 -2
- package/src/lib/mock/timeseries.mock.service.js +1 -1
- package/src/lib/mock/trash.mock.service.d.ts +1 -0
- package/src/lib/mock/trash.mock.service.js +3 -3
- package/src/lib/services/alert.service.d.ts +8 -1
- package/src/lib/services/alert.service.js +11 -1
- package/src/lib/services/asset.service.d.ts +2 -2
- package/src/lib/services/asset.service.js +2 -1
- package/src/lib/services/assettypes.service.d.ts +2 -1
- package/src/lib/services/assettypes.service.js +3 -1
- package/src/lib/services/content.service.d.ts +2 -2
- package/src/lib/services/content.service.js +2 -1
- package/src/lib/services/endpoint.service.d.ts +8 -2
- package/src/lib/services/endpoint.service.js +11 -1
- package/src/lib/services/event.service.d.ts +8 -2
- package/src/lib/services/event.service.js +11 -1
- package/src/lib/services/flow-deployment.service.d.ts +2 -2
- package/src/lib/services/flow-deployment.service.js +2 -1
- package/src/lib/services/flow-function.service.d.ts +8 -2
- package/src/lib/services/flow-function.service.js +11 -1
- package/src/lib/services/flow-module.service.d.ts +8 -2
- package/src/lib/services/flow-module.service.js +11 -1
- package/src/lib/services/flow.service.d.ts +2 -2
- package/src/lib/services/flow.service.js +2 -1
- package/src/lib/services/http-client.service.d.ts +11 -2
- package/src/lib/services/http-client.service.js +33 -14
- package/src/lib/services/notification-rule.service.d.ts +8 -2
- package/src/lib/services/notification-rule.service.js +11 -1
- package/src/lib/services/organizations-administration.service.d.ts +4 -4
- package/src/lib/services/organizations-administration.service.js +5 -5
- package/src/lib/services/share.service.d.ts +2 -2
- package/src/lib/services/share.service.js +2 -2
- package/src/lib/services/task.service.d.ts +2 -2
- package/src/lib/services/task.service.js +2 -1
- package/src/lib/services/timeseries.service.d.ts +2 -2
- package/src/lib/services/timeseries.service.js +2 -1
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { NotificationRule } from '../interfaces';
|
|
2
|
+
import { APIBaseMock } from './api-base.mock';
|
|
3
|
+
import { DataMockService } from './data.mock.service';
|
|
2
4
|
import { ShareMockService } from './share.mock.service';
|
|
3
|
-
|
|
5
|
+
interface BaseService extends DataMockService<NotificationRule>, ShareMockService<NotificationRule> {
|
|
6
|
+
}
|
|
7
|
+
declare class BaseService extends APIBaseMock<NotificationRule> {
|
|
8
|
+
}
|
|
9
|
+
export declare class NotificationRulesMockService extends BaseService {
|
|
4
10
|
constructor(notificationRules: NotificationRule[]);
|
|
5
11
|
}
|
|
12
|
+
export {};
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NotificationRulesMockService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const ts_mixer_1 = require("ts-mixer");
|
|
6
|
+
const api_base_mock_1 = require("./api-base.mock");
|
|
7
|
+
const data_mock_service_1 = require("./data.mock.service");
|
|
4
8
|
const share_mock_service_1 = require("./share.mock.service");
|
|
5
|
-
class
|
|
9
|
+
let BaseService = class BaseService extends api_base_mock_1.APIBaseMock {
|
|
10
|
+
};
|
|
11
|
+
BaseService = tslib_1.__decorate([
|
|
12
|
+
(0, ts_mixer_1.mix)(data_mock_service_1.DataMockService, share_mock_service_1.ShareMockService)
|
|
13
|
+
], BaseService);
|
|
14
|
+
/* eslint-enable @typescript-eslint/no-unsafe-declaration-merging */
|
|
15
|
+
class NotificationRulesMockService extends BaseService {
|
|
6
16
|
constructor(notificationRules) {
|
|
7
17
|
super();
|
|
8
18
|
this.data = notificationRules;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { APIBaseMock, OrganizationsMockService } from '.';
|
|
3
|
-
import { Filter, Organization, OrganizationCreateDto,
|
|
3
|
+
import { Filter, Organization, OrganizationCreateDto, OrganizationResourcesProgress, OrganizationSearchQuery, Paginated, RequestParameter, ServerSentEvent, SubscriptionType, UserWithOrgRoles } from '../interfaces';
|
|
4
4
|
import { OrganizationsAdministrationService } from '../services';
|
|
5
5
|
export declare class OrganizationsAdministrationMockService extends APIBaseMock<Organization> implements OrganizationsAdministrationService {
|
|
6
6
|
private readonly organizationMockService;
|
|
@@ -14,6 +14,6 @@ export declare class OrganizationsAdministrationMockService extends APIBaseMock<
|
|
|
14
14
|
getMany(params?: RequestParameter): Promise<Paginated<Organization>>;
|
|
15
15
|
getManyFiltered(filter: Filter, params?: RequestParameter): Promise<Paginated<Organization>>;
|
|
16
16
|
search(query: OrganizationSearchQuery): Promise<Organization[]>;
|
|
17
|
-
createOrganization(organizationCreateDto: OrganizationCreateDto,
|
|
17
|
+
createOrganization(organizationCreateDto: OrganizationCreateDto, emailsToInvite: string[], emailsToAdd: string[], createOrgAsOwner?: boolean): Promise<Organization>;
|
|
18
18
|
getOrganizationDeletionProgress(organizationId: string): Observable<ServerSentEvent<OrganizationResourcesProgress>>;
|
|
19
19
|
}
|
|
@@ -76,9 +76,9 @@ class OrganizationsAdministrationMockService extends _1.APIBaseMock {
|
|
|
76
76
|
async search(query) {
|
|
77
77
|
return Promise.resolve(this.data.filter((entry) => entry.name === query.name || entry.name.startsWith(query.name)));
|
|
78
78
|
}
|
|
79
|
-
createOrganization(organizationCreateDto,
|
|
79
|
+
createOrganization(organizationCreateDto, emailsToInvite, emailsToAdd, createOrgAsOwner = false) {
|
|
80
80
|
if (!organizationCreateDto?.name ||
|
|
81
|
-
!
|
|
81
|
+
([...emailsToInvite, ...emailsToAdd].length === 0 && !createOrgAsOwner) ||
|
|
82
82
|
this.data.some((org) => org.name === organizationCreateDto.name)) {
|
|
83
83
|
return Promise.reject('Bad Request');
|
|
84
84
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { APIBaseMock } from '.';
|
|
2
2
|
import { OrgResourcePermission, SharedResources } from '../interfaces/resource.interface';
|
|
3
3
|
import { ShareService } from '../services/share.service';
|
|
4
|
-
export declare class ShareMockService<T> extends
|
|
4
|
+
export declare class ShareMockService<T> extends APIBaseMock<T> implements ShareService {
|
|
5
5
|
constructor();
|
|
6
6
|
getBasePath(): string;
|
|
7
7
|
cancelAccess(id: string): Promise<void>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { APIBaseMock, TrashMockService } from '.';
|
|
1
|
+
import { APIBaseMock, DataMockService, TrashMockService } from '.';
|
|
2
2
|
import { DeleteQuery, LogbookEntry, LogbookEntryDto, Paginated, RequestParameter, Task, TokenOption } from '../interfaces';
|
|
3
3
|
import { TaskService } from '../services';
|
|
4
4
|
import { ShareMockService } from './share.mock.service';
|
|
5
|
-
interface BaseService extends ShareMockService<Task>, TrashMockService<Task> {
|
|
5
|
+
interface BaseService extends DataMockService<Task>, ShareMockService<Task>, TrashMockService<Task> {
|
|
6
6
|
}
|
|
7
7
|
declare class BaseService extends APIBaseMock<Task> {
|
|
8
8
|
}
|
|
@@ -8,8 +8,9 @@ const share_mock_service_1 = require("./share.mock.service");
|
|
|
8
8
|
let BaseService = class BaseService extends _1.APIBaseMock {
|
|
9
9
|
};
|
|
10
10
|
BaseService = tslib_1.__decorate([
|
|
11
|
-
(0, ts_mixer_1.mix)(share_mock_service_1.ShareMockService, _1.TrashMockService)
|
|
11
|
+
(0, ts_mixer_1.mix)(_1.DataMockService, share_mock_service_1.ShareMockService, _1.TrashMockService)
|
|
12
12
|
], BaseService);
|
|
13
|
+
/* eslint-enable @typescript-eslint/no-unsafe-declaration-merging */
|
|
13
14
|
class TaskMockService extends BaseService {
|
|
14
15
|
constructor(tasks, logbookEntries = []) {
|
|
15
16
|
super(tasks);
|
|
@@ -72,7 +73,7 @@ class TaskMockService extends BaseService {
|
|
|
72
73
|
const entry = {
|
|
73
74
|
id,
|
|
74
75
|
taskId,
|
|
75
|
-
date: dto.date ||
|
|
76
|
+
date: dto.date || now,
|
|
76
77
|
duration: dto.duration ?? 0,
|
|
77
78
|
materials: dto.materials || [],
|
|
78
79
|
comment: dto.comment || '',
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { APIBaseMock, TrashMockService } from '.';
|
|
1
|
+
import { APIBaseMock, DataMockService, TrashMockService } from '.';
|
|
2
2
|
import { DeleteQuery, Paginated, RequestParameter, TimeSeries, TimeSeriesValue, TS_GROUPS } from '../interfaces';
|
|
3
3
|
import { TimeSeriesService } from '../services';
|
|
4
4
|
import { ShareMockService } from './share.mock.service';
|
|
5
|
-
interface BaseService extends
|
|
5
|
+
interface BaseService extends DataMockService<TimeSeries & {
|
|
6
|
+
data: TimeSeriesValue[];
|
|
7
|
+
}>, ShareMockService<TimeSeries & {
|
|
6
8
|
data: TimeSeriesValue[];
|
|
7
9
|
}>, TrashMockService<TimeSeries & {
|
|
8
10
|
data: TimeSeriesValue[];
|
|
@@ -8,7 +8,7 @@ const share_mock_service_1 = require("./share.mock.service");
|
|
|
8
8
|
let BaseService = class BaseService extends _1.APIBaseMock {
|
|
9
9
|
};
|
|
10
10
|
BaseService = tslib_1.__decorate([
|
|
11
|
-
(0, ts_mixer_1.mix)(share_mock_service_1.ShareMockService, _1.TrashMockService)
|
|
11
|
+
(0, ts_mixer_1.mix)(_1.DataMockService, share_mock_service_1.ShareMockService, _1.TrashMockService)
|
|
12
12
|
], BaseService);
|
|
13
13
|
class TimeseriesMockService extends BaseService {
|
|
14
14
|
constructor(timeseries, timeseriesValues) {
|
|
@@ -3,6 +3,7 @@ import { Paginated, RequestParameter } from '../interfaces';
|
|
|
3
3
|
import { TrashService } from '../services';
|
|
4
4
|
export declare class TrashMockService<T extends {
|
|
5
5
|
id?: string;
|
|
6
|
+
fqn?: string;
|
|
6
7
|
}> extends APIBaseMock<T> implements TrashService<T> {
|
|
7
8
|
constructor();
|
|
8
9
|
trashRestoreAll(): Promise<T[]>;
|
|
@@ -14,15 +14,15 @@ class TrashMockService extends _1.APIBaseMock {
|
|
|
14
14
|
return Promise.resolve(deleted);
|
|
15
15
|
}
|
|
16
16
|
trashRestoreOne(id) {
|
|
17
|
-
const deleted = this.data.find((v) => v['id'] === id);
|
|
17
|
+
const deleted = this.data.find((v) => (v['id'] ? v['id'] === id : v['fqn'] === id));
|
|
18
18
|
delete deleted['deletedAt'];
|
|
19
19
|
return Promise.resolve(deleted);
|
|
20
20
|
}
|
|
21
21
|
async emptyTrash(offset) {
|
|
22
22
|
const dateOffsSeconds = Math.round(new Date().getTime() / 1000) - offset;
|
|
23
23
|
const date = new Date(dateOffsSeconds * 1000);
|
|
24
|
-
const trashIds = this.data.filter((v) => new Date(v['deletedAt']) < date).map((v) => v.id);
|
|
25
|
-
this.data = this.data.filter((item) => !trashIds.includes(item.id));
|
|
24
|
+
const trashIds = this.data.filter((v) => new Date(v['deletedAt']) < date).map((v) => (v.id ? v.id : v.fqn));
|
|
25
|
+
this.data = this.data.filter((item) => !trashIds.includes(item.id ? item.id : item.fqn));
|
|
26
26
|
return Promise.resolve({ acknowledged: true, deletedCount: trashIds.length });
|
|
27
27
|
}
|
|
28
28
|
getTrash(params) {
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import { APIBase } from '../api-base';
|
|
1
2
|
import { Alert } from '../interfaces';
|
|
3
|
+
import { DataService } from './data.service';
|
|
2
4
|
import { HttpClientService } from './http-client.service';
|
|
3
5
|
import { ShareService } from './share.service';
|
|
4
|
-
|
|
6
|
+
interface BaseService extends DataService<Alert>, ShareService {
|
|
7
|
+
}
|
|
8
|
+
declare class BaseService extends APIBase {
|
|
9
|
+
}
|
|
10
|
+
export declare class AlertService extends BaseService {
|
|
5
11
|
constructor(httpClient: HttpClientService);
|
|
6
12
|
}
|
|
13
|
+
export {};
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AlertService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const ts_mixer_1 = require("ts-mixer");
|
|
6
|
+
const api_base_1 = require("../api-base");
|
|
7
|
+
const data_service_1 = require("./data.service");
|
|
4
8
|
const share_service_1 = require("./share.service");
|
|
5
|
-
class
|
|
9
|
+
let BaseService = class BaseService extends api_base_1.APIBase {
|
|
10
|
+
};
|
|
11
|
+
BaseService = tslib_1.__decorate([
|
|
12
|
+
(0, ts_mixer_1.mix)(data_service_1.DataService, share_service_1.ShareService)
|
|
13
|
+
], BaseService);
|
|
14
|
+
/* eslint-enable @typescript-eslint/no-unsafe-declaration-merging */
|
|
15
|
+
class AlertService extends BaseService {
|
|
6
16
|
constructor(httpClient) {
|
|
7
17
|
super(httpClient, '/alerts');
|
|
8
18
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { HttpClientService, TrashService } from '.';
|
|
1
|
+
import { DataService, 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
5
|
import { ShareService } from './share.service';
|
|
6
|
-
interface BaseService extends
|
|
6
|
+
interface BaseService extends DataService<Asset>, ShareService, TrashService<Asset> {
|
|
7
7
|
}
|
|
8
8
|
declare class BaseService extends APIBase {
|
|
9
9
|
}
|
|
@@ -10,8 +10,9 @@ const share_service_1 = require("./share.service");
|
|
|
10
10
|
let BaseService = class BaseService extends api_base_1.APIBase {
|
|
11
11
|
};
|
|
12
12
|
BaseService = tslib_1.__decorate([
|
|
13
|
-
(0, ts_mixer_1.mix)(share_service_1.ShareService, _1.TrashService)
|
|
13
|
+
(0, ts_mixer_1.mix)(_1.DataService, share_service_1.ShareService, _1.TrashService)
|
|
14
14
|
], BaseService);
|
|
15
|
+
/* eslint-enable @typescript-eslint/no-unsafe-declaration-merging */
|
|
15
16
|
class AssetService extends BaseService {
|
|
16
17
|
constructor(httpClient) {
|
|
17
18
|
super(httpClient, '/assets');
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { APIBase } from '../api-base';
|
|
2
2
|
import { AssetType, DeleteAssetTypeQuery, Paginated, Template, TokenOption } from '../interfaces';
|
|
3
|
+
import { DataService } from './data.service';
|
|
3
4
|
import { HttpClientService } from './http-client.service';
|
|
4
5
|
import { ShareService } from './share.service';
|
|
5
6
|
import { TrashService } from './trash.service';
|
|
6
|
-
interface BaseService extends
|
|
7
|
+
interface BaseService extends DataService<AssetType>, ShareService, TrashService<AssetType> {
|
|
7
8
|
}
|
|
8
9
|
declare class BaseService extends APIBase {
|
|
9
10
|
}
|
|
@@ -4,13 +4,15 @@ exports.AssetTypesService = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const ts_mixer_1 = require("ts-mixer");
|
|
6
6
|
const api_base_1 = require("../api-base");
|
|
7
|
+
const data_service_1 = require("./data.service");
|
|
7
8
|
const share_service_1 = require("./share.service");
|
|
8
9
|
const trash_service_1 = require("./trash.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)(share_service_1.ShareService, trash_service_1.TrashService)
|
|
13
|
+
(0, ts_mixer_1.mix)(data_service_1.DataService, share_service_1.ShareService, trash_service_1.TrashService)
|
|
13
14
|
], BaseService);
|
|
15
|
+
/* eslint-enable @typescript-eslint/no-unsafe-declaration-merging */
|
|
14
16
|
class AssetTypesService extends BaseService {
|
|
15
17
|
constructor(httpClient) {
|
|
16
18
|
super(httpClient, '/assettypes');
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { HttpClientService, TrashService } from '.';
|
|
1
|
+
import { DataService, 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
5
|
import { ShareService } from './share.service';
|
|
6
|
-
interface BaseService extends
|
|
6
|
+
interface BaseService extends DataService<Content>, ShareService, TrashService<Content> {
|
|
7
7
|
}
|
|
8
8
|
declare class BaseService extends APIBase {
|
|
9
9
|
}
|
|
@@ -11,8 +11,9 @@ const share_service_1 = require("./share.service");
|
|
|
11
11
|
let BaseService = class BaseService extends api_base_1.APIBase {
|
|
12
12
|
};
|
|
13
13
|
BaseService = tslib_1.__decorate([
|
|
14
|
-
(0, ts_mixer_1.mix)(share_service_1.ShareService, _1.TrashService)
|
|
14
|
+
(0, ts_mixer_1.mix)(_1.DataService, share_service_1.ShareService, _1.TrashService)
|
|
15
15
|
], BaseService);
|
|
16
|
+
/* eslint-enable @typescript-eslint/no-unsafe-declaration-merging */
|
|
16
17
|
class ContentService extends BaseService {
|
|
17
18
|
constructor(httpClient) {
|
|
18
19
|
super(httpClient, '/contents');
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import { HttpClientService } from '.';
|
|
1
|
+
import { DataService, HttpClientService } from '.';
|
|
2
|
+
import { APIBase } from '../api-base';
|
|
2
3
|
import { Endpoint, EndpointLog, NotificationPayload, TokenOption } from '../interfaces';
|
|
3
4
|
import { ShareService } from './share.service';
|
|
4
|
-
|
|
5
|
+
interface BaseService extends DataService<Endpoint>, ShareService {
|
|
6
|
+
}
|
|
7
|
+
declare class BaseService extends APIBase {
|
|
8
|
+
}
|
|
9
|
+
export declare class EndpointService extends BaseService {
|
|
5
10
|
constructor(httpClient: HttpClientService);
|
|
6
11
|
sendNotification(endpointId: string, payload: NotificationPayload, options?: TokenOption): Promise<void>;
|
|
7
12
|
readLastLogByGroup(endpointId: string, group: string, options?: TokenOption): Promise<EndpointLog>;
|
|
8
13
|
}
|
|
14
|
+
export {};
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EndpointService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const ts_mixer_1 = require("ts-mixer");
|
|
6
|
+
const _1 = require(".");
|
|
7
|
+
const api_base_1 = require("../api-base");
|
|
4
8
|
const share_service_1 = require("./share.service");
|
|
5
|
-
class
|
|
9
|
+
let BaseService = class BaseService extends api_base_1.APIBase {
|
|
10
|
+
};
|
|
11
|
+
BaseService = tslib_1.__decorate([
|
|
12
|
+
(0, ts_mixer_1.mix)(_1.DataService, share_service_1.ShareService)
|
|
13
|
+
], BaseService);
|
|
14
|
+
/* eslint-enable @typescript-eslint/no-unsafe-declaration-merging */
|
|
15
|
+
class EndpointService extends BaseService {
|
|
6
16
|
constructor(httpClient) {
|
|
7
17
|
super(httpClient, '/notification/endpoints');
|
|
8
18
|
}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import { HttpClientService } from '.';
|
|
1
|
+
import { DataService, HttpClientService } from '.';
|
|
2
|
+
import { APIBase } from '../api-base';
|
|
2
3
|
import { Event, TokenOption } from '../interfaces';
|
|
3
4
|
import { ShareService } from './share.service';
|
|
4
|
-
|
|
5
|
+
interface BaseService extends DataService<Event>, ShareService {
|
|
6
|
+
}
|
|
7
|
+
declare class BaseService extends APIBase {
|
|
8
|
+
}
|
|
9
|
+
export declare class EventService extends BaseService {
|
|
5
10
|
constructor(httpClient: HttpClientService);
|
|
6
11
|
getLastEventByAssetAndGroup(assetId: string, group: string, options?: TokenOption): Promise<Event>;
|
|
7
12
|
getLastEventByAssetAndGroups(assetId: string, groups: string[], options?: TokenOption): Promise<Record<string, string>>;
|
|
8
13
|
}
|
|
14
|
+
export {};
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EventService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const ts_mixer_1 = require("ts-mixer");
|
|
6
|
+
const _1 = require(".");
|
|
7
|
+
const api_base_1 = require("../api-base");
|
|
4
8
|
const share_service_1 = require("./share.service");
|
|
5
|
-
class
|
|
9
|
+
let BaseService = class BaseService extends api_base_1.APIBase {
|
|
10
|
+
};
|
|
11
|
+
BaseService = tslib_1.__decorate([
|
|
12
|
+
(0, ts_mixer_1.mix)(_1.DataService, share_service_1.ShareService)
|
|
13
|
+
], BaseService);
|
|
14
|
+
/* eslint-enable @typescript-eslint/no-unsafe-declaration-merging */
|
|
15
|
+
class EventService extends BaseService {
|
|
6
16
|
constructor(httpClient) {
|
|
7
17
|
super(httpClient, '/events');
|
|
8
18
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { HttpClientService, TrashService } from '.';
|
|
1
|
+
import { DataService, HttpClientService, TrashService } from '.';
|
|
2
2
|
import { APIBase } from '../api-base';
|
|
3
3
|
import { DeleteQuery, FlowDeployment, FlowDeploymentMetrics, FlowDeploymentStatistic, FlowLog, ResourceReference, TokenOption } from '../interfaces';
|
|
4
4
|
import { ShareService } from './share.service';
|
|
5
|
-
interface BaseService extends
|
|
5
|
+
interface BaseService extends DataService<FlowDeployment>, ShareService, TrashService<FlowDeployment> {
|
|
6
6
|
}
|
|
7
7
|
declare class BaseService extends APIBase {
|
|
8
8
|
}
|
|
@@ -9,8 +9,9 @@ const share_service_1 = require("./share.service");
|
|
|
9
9
|
let BaseService = class BaseService extends api_base_1.APIBase {
|
|
10
10
|
};
|
|
11
11
|
BaseService = tslib_1.__decorate([
|
|
12
|
-
(0, ts_mixer_1.mix)(share_service_1.ShareService, _1.TrashService)
|
|
12
|
+
(0, ts_mixer_1.mix)(_1.DataService, share_service_1.ShareService, _1.TrashService)
|
|
13
13
|
], BaseService);
|
|
14
|
+
/* eslint-enable @typescript-eslint/no-unsafe-declaration-merging */
|
|
14
15
|
class FlowDeploymentService extends BaseService {
|
|
15
16
|
constructor(httpClient) {
|
|
16
17
|
super(httpClient, '/flow/deployments');
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { HttpClientService } from '.';
|
|
1
|
+
import { DataService, HttpClientService, TrashService } from '.';
|
|
2
|
+
import { APIBase } from '../api-base';
|
|
2
3
|
import { FlowFunctionDto, Paginated, TokenOption } from '../interfaces';
|
|
3
4
|
import { ShareService } from './share.service';
|
|
4
|
-
|
|
5
|
+
interface BaseService extends DataService<FlowFunctionDto>, ShareService, TrashService<FlowFunctionDto> {
|
|
6
|
+
}
|
|
7
|
+
declare class BaseService extends APIBase {
|
|
8
|
+
}
|
|
9
|
+
export declare class FlowFunctionService extends BaseService {
|
|
5
10
|
constructor(httpClient: HttpClientService);
|
|
6
11
|
addMany(dto: any[], options?: TokenOption): Promise<FlowFunctionDto[]>;
|
|
7
12
|
getRevisions(fqn: string, options?: TokenOption): Promise<Paginated<FlowFunctionDto>>;
|
|
8
13
|
rollback(fqn: string, revisionId: string, options?: TokenOption): Promise<FlowFunctionDto>;
|
|
9
14
|
deleteRevision(fqn: string, revisionId: string, options?: TokenOption): Promise<any>;
|
|
10
15
|
}
|
|
16
|
+
export {};
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlowFunctionService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const ts_mixer_1 = require("ts-mixer");
|
|
6
|
+
const _1 = require(".");
|
|
7
|
+
const api_base_1 = require("../api-base");
|
|
4
8
|
const share_service_1 = require("./share.service");
|
|
5
|
-
class
|
|
9
|
+
let BaseService = class BaseService extends api_base_1.APIBase {
|
|
10
|
+
};
|
|
11
|
+
BaseService = tslib_1.__decorate([
|
|
12
|
+
(0, ts_mixer_1.mix)(_1.DataService, share_service_1.ShareService, _1.TrashService)
|
|
13
|
+
], BaseService);
|
|
14
|
+
/* eslint-enable @typescript-eslint/no-unsafe-declaration-merging */
|
|
15
|
+
class FlowFunctionService extends BaseService {
|
|
6
16
|
constructor(httpClient) {
|
|
7
17
|
super(httpClient, '/flow/functions');
|
|
8
18
|
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import { HttpClientService } from '.';
|
|
1
|
+
import { DataService, HttpClientService } from '.';
|
|
2
|
+
import { APIBase } from '../api-base';
|
|
2
3
|
import { FlowModule, TokenOption } from '../interfaces';
|
|
3
4
|
import { CrossPlatformFormData } from '../utils';
|
|
4
5
|
import { ShareService } from './share.service';
|
|
5
|
-
|
|
6
|
+
interface BaseService extends DataService<FlowModule>, ShareService {
|
|
7
|
+
}
|
|
8
|
+
declare class BaseService extends APIBase {
|
|
9
|
+
}
|
|
10
|
+
export declare class FlowModuleService extends BaseService {
|
|
6
11
|
constructor(httpClient: HttpClientService);
|
|
7
12
|
deleteArtifact(name: string, version: string, options?: TokenOption): Promise<FlowModule>;
|
|
8
13
|
publish(form: CrossPlatformFormData, options?: TokenOption): Promise<unknown>;
|
|
9
14
|
addOne(_dto: any): Promise<FlowModule>;
|
|
10
15
|
addMany(_dto: any[]): Promise<FlowModule[]>;
|
|
11
16
|
}
|
|
17
|
+
export {};
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlowModuleService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const ts_mixer_1 = require("ts-mixer");
|
|
6
|
+
const _1 = require(".");
|
|
7
|
+
const api_base_1 = require("../api-base");
|
|
4
8
|
const utils_1 = require("../utils");
|
|
5
9
|
const share_service_1 = require("./share.service");
|
|
6
|
-
class
|
|
10
|
+
let BaseService = class BaseService extends api_base_1.APIBase {
|
|
11
|
+
};
|
|
12
|
+
BaseService = tslib_1.__decorate([
|
|
13
|
+
(0, ts_mixer_1.mix)(_1.DataService, share_service_1.ShareService)
|
|
14
|
+
], BaseService);
|
|
15
|
+
/* eslint-enable @typescript-eslint/no-unsafe-declaration-merging */
|
|
16
|
+
class FlowModuleService extends BaseService {
|
|
7
17
|
constructor(httpClient) {
|
|
8
18
|
super(httpClient, '/flow/modules');
|
|
9
19
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { HttpClientService, TrashService } from '.';
|
|
1
|
+
import { DataService, HttpClientService, TrashService } from '.';
|
|
2
2
|
import { APIBase } from '../api-base';
|
|
3
3
|
import { FlowDeployment, FlowDiagram, FlowDto, Paginated, RequestParameter, TokenOption } from '../interfaces';
|
|
4
4
|
import { ShareService } from './share.service';
|
|
5
|
-
interface BaseService extends
|
|
5
|
+
interface BaseService extends DataService<FlowDto>, ShareService, TrashService<FlowDto> {
|
|
6
6
|
}
|
|
7
7
|
declare class BaseService extends APIBase {
|
|
8
8
|
}
|
|
@@ -9,8 +9,9 @@ const share_service_1 = require("./share.service");
|
|
|
9
9
|
let BaseService = class BaseService extends api_base_1.APIBase {
|
|
10
10
|
};
|
|
11
11
|
BaseService = tslib_1.__decorate([
|
|
12
|
-
(0, ts_mixer_1.mix)(share_service_1.ShareService, _1.TrashService)
|
|
12
|
+
(0, ts_mixer_1.mix)(_1.DataService, share_service_1.ShareService, _1.TrashService)
|
|
13
13
|
], BaseService);
|
|
14
|
+
/* eslint-enable @typescript-eslint/no-unsafe-declaration-merging */
|
|
14
15
|
class FlowService extends BaseService {
|
|
15
16
|
constructor(httpClient) {
|
|
16
17
|
super(httpClient, '/flows');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AxiosInstance, Method } from 'axios';
|
|
1
|
+
import { AxiosInstance, AxiosResponse, Method } from 'axios';
|
|
2
2
|
import { EventSource } from 'eventsource';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { Config, Issuer, ServerSentEvent, TokenOption } from '../interfaces';
|
|
5
|
-
import { Queue } from '../queue';
|
|
5
|
+
import { Queue, QueueOptions } from '../queue';
|
|
6
6
|
import { TokenSet } from '../token-set';
|
|
7
7
|
export interface HttpClientConfig {
|
|
8
8
|
baseURL: string;
|
|
@@ -12,6 +12,7 @@ export interface HttpClientConfig {
|
|
|
12
12
|
clientSecret?: string;
|
|
13
13
|
tokenSubject?: string;
|
|
14
14
|
activeOrg?: string;
|
|
15
|
+
queueOptions?: QueueOptions;
|
|
15
16
|
}
|
|
16
17
|
export declare class HttpClientService {
|
|
17
18
|
protected readonly baseURL: string;
|
|
@@ -39,6 +40,13 @@ export declare class HttpClientService {
|
|
|
39
40
|
size: number;
|
|
40
41
|
total: number;
|
|
41
42
|
};
|
|
43
|
+
/**
|
|
44
|
+
* Add a response interceptor to the axios instance.
|
|
45
|
+
* @param onFulfilled Function to handle successful responses
|
|
46
|
+
* @param onRejected Function to handle response errors
|
|
47
|
+
* @returns Interceptor ID that can be used to remove the interceptor
|
|
48
|
+
*/
|
|
49
|
+
addResponseInterceptor(onFulfilled?: ((value: AxiosResponse) => AxiosResponse | Promise<AxiosResponse>) | null, onRejected?: ((error: any) => any) | null): number;
|
|
42
50
|
delete: <T>(url: string, config?: Config) => Promise<T>;
|
|
43
51
|
get: <T>(url: string, config?: Config) => Promise<T>;
|
|
44
52
|
post: <T>(url: string, data: any, config?: Config) => Promise<T>;
|
|
@@ -55,4 +63,5 @@ export declare class HttpClientService {
|
|
|
55
63
|
protected requestAccessToken(additionalOpts?: {}): Promise<TokenSet>;
|
|
56
64
|
protected exchangeAccessToken(accessToken: string): Promise<TokenSet>;
|
|
57
65
|
provideExternalToken(token: string): Promise<void>;
|
|
66
|
+
private requestPromise;
|
|
58
67
|
}
|
|
@@ -21,19 +21,12 @@ class HttpClientService {
|
|
|
21
21
|
this.put = (url, data, config) => this.request('PUT', url, config, data);
|
|
22
22
|
this.patch = (url, data, config) => this.request('PATCH', url, config, data);
|
|
23
23
|
this.request = (method, url, config = {}, data) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
headers[constants_1.ACTIVE_ORG_ID_HEADER] = this.activeOrg;
|
|
31
|
-
}
|
|
32
|
-
return this.axiosInstance.request({ ...config, headers, method, url, data });
|
|
33
|
-
})
|
|
34
|
-
.then((response) => resolve(response.data))
|
|
35
|
-
.catch(reject);
|
|
36
|
-
}));
|
|
24
|
+
if (this.requestQueue) {
|
|
25
|
+
return this.requestQueue.add(() => this.requestPromise(method, url, config, data));
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return this.requestPromise(method, url, config, data);
|
|
29
|
+
}
|
|
37
30
|
};
|
|
38
31
|
this.getAccessToken = async (forceRefresh = false) => {
|
|
39
32
|
let accessToken;
|
|
@@ -57,6 +50,21 @@ class HttpClientService {
|
|
|
57
50
|
return accessToken;
|
|
58
51
|
}
|
|
59
52
|
};
|
|
53
|
+
this.requestPromise = (method, url, config = {}, data) => {
|
|
54
|
+
return new Promise((resolve, reject) => {
|
|
55
|
+
const tokenP = config.token ? Promise.resolve(config.token) : this.getAccessToken();
|
|
56
|
+
tokenP
|
|
57
|
+
.then((token) => {
|
|
58
|
+
const headers = { Authorization: `Bearer ${token}`, ...config.headers };
|
|
59
|
+
if (this.activeOrg) {
|
|
60
|
+
headers[constants_1.ACTIVE_ORG_ID_HEADER] = this.activeOrg;
|
|
61
|
+
}
|
|
62
|
+
return this.axiosInstance.request({ ...config, headers, method, url, data });
|
|
63
|
+
})
|
|
64
|
+
.then((response) => resolve(response.data))
|
|
65
|
+
.catch(reject);
|
|
66
|
+
});
|
|
67
|
+
};
|
|
60
68
|
this.baseURL = config.baseURL;
|
|
61
69
|
this.authBaseURL = config.authBaseURL || config.baseURL;
|
|
62
70
|
this.realm = config.realm;
|
|
@@ -66,7 +74,18 @@ class HttpClientService {
|
|
|
66
74
|
this.activeOrg = config.activeOrg;
|
|
67
75
|
this.axiosInstance = axios_1.default.create({ baseURL: this.baseURL, timeout: 60000 });
|
|
68
76
|
this.authAxiosInstance = axios_1.default.create({ baseURL: this.authBaseURL, timeout: 10000 });
|
|
69
|
-
|
|
77
|
+
if (config.queueOptions) {
|
|
78
|
+
this.requestQueue = new queue_1.Queue(config.queueOptions);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Add a response interceptor to the axios instance.
|
|
83
|
+
* @param onFulfilled Function to handle successful responses
|
|
84
|
+
* @param onRejected Function to handle response errors
|
|
85
|
+
* @returns Interceptor ID that can be used to remove the interceptor
|
|
86
|
+
*/
|
|
87
|
+
addResponseInterceptor(onFulfilled, onRejected) {
|
|
88
|
+
return this.axiosInstance.interceptors.response.use(onFulfilled, onRejected);
|
|
70
89
|
}
|
|
71
90
|
getSseObservable(path) {
|
|
72
91
|
return new rxjs_1.Observable((subscriber) => {
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import { HttpClientService } from '.';
|
|
1
|
+
import { DataService, HttpClientService } from '.';
|
|
2
|
+
import { APIBase } from '../api-base';
|
|
2
3
|
import { NotificationRule } from '../interfaces';
|
|
3
4
|
import { ShareService } from './share.service';
|
|
4
|
-
|
|
5
|
+
interface BaseService extends DataService<NotificationRule>, ShareService {
|
|
6
|
+
}
|
|
7
|
+
declare class BaseService extends APIBase {
|
|
8
|
+
}
|
|
9
|
+
export declare class NotificationRuleService extends BaseService {
|
|
5
10
|
constructor(httpClient: HttpClientService);
|
|
6
11
|
}
|
|
12
|
+
export {};
|