@hahnpro/hpc-api 2026.1.1 → 2026.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hahnpro/hpc-api",
3
- "version": "2026.1.1",
3
+ "version": "2026.2.0",
4
4
  "description": "Module for easy access to the HahnPRO Cloud API",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "dependencies": {
11
11
  "@microsoft/fetch-event-source": "2.0.1",
12
- "axios": "1.13.2",
12
+ "axios": "1.13.5",
13
13
  "eventsource": "4.1.0",
14
14
  "jose": "5.10.0",
15
15
  "jwt-decode": "4.0.0",
package/src/lib/api.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { QueueOptions } from './queue';
2
- import { AiService, AlertService, AssetService, AssetTypesService, ContentService, EndpointService, EventService, FlowDeploymentService, FlowFunctionService, FlowModuleService, FlowService, HttpClientService, LabelService, NotificationRuleService, NotificationService, OrganizationsAdministrationService, OrganizationsResourcesService, OrganizationsService, ProxyService, SearchService, TaskService, TimeSeriesService, UserService, VaultService } from './services';
2
+ import { AiService, AlertService, AssetService, AssetTypesService, ContentService, EndpointService, EventService, FlowDeploymentService, FlowFunctionService, FlowModuleService, FlowService, HttpClientService, LabelService, NotificationRuleService, NotificationService, ObjectReferenceService, OrganizationsAdministrationService, OrganizationsResourcesService, OrganizationsService, ProxyService, SearchService, TaskService, TimeSeriesService, UserService, VaultService } from './services';
3
3
  export declare class API {
4
4
  readonly httpClient?: HttpClientService;
5
5
  ai: AiService;
@@ -14,6 +14,7 @@ export declare class API {
14
14
  flowFunctions: FlowFunctionService;
15
15
  flowModules: FlowModuleService;
16
16
  labels: LabelService;
17
+ objectReferences: ObjectReferenceService;
17
18
  organizations: OrganizationsService;
18
19
  organizationsAdministration: OrganizationsAdministrationService;
19
20
  organizationsResources: OrganizationsResourcesService;
package/src/lib/api.js CHANGED
@@ -46,6 +46,7 @@ class API {
46
46
  this.flowFunctions = new services_1.FlowFunctionService(this.httpClient);
47
47
  this.flowModules = new services_1.FlowModuleService(this.httpClient);
48
48
  this.labels = new services_1.LabelService(this.httpClient);
49
+ this.objectReferences = new services_1.ObjectReferenceService(this.httpClient);
49
50
  this.organizations = new services_1.OrganizationsService(this.httpClient);
50
51
  this.organizationsAdministration = new services_1.OrganizationsAdministrationService(this.httpClient);
51
52
  this.organizationsResources = new services_1.OrganizationsResourcesService(this.httpClient);
@@ -56,7 +56,7 @@ export interface ToolMessage extends BaseMessage {
56
56
  toolName?: string;
57
57
  toolType?: 'handoff' | 'choice' | 'action';
58
58
  agentStack?: string[];
59
- status?: 'pending' | 'processing' | 'completed' | 'failed';
59
+ status?: 'pending' | 'processing' | 'completed' | 'failed' | 'awaitingUserInteraction';
60
60
  result?: any;
61
61
  args?: any;
62
62
  contextVariables?: Record<string, unknown>;
@@ -13,6 +13,7 @@ export interface AssetType {
13
13
  uiSchema: any;
14
14
  author?: string;
15
15
  revision?: number;
16
+ templateVersion?: number;
16
17
  templates?: string[] | Template[];
17
18
  owner?: Owner;
18
19
  createdBy?: Author;
@@ -22,12 +22,14 @@ export interface FlowDeploymentStatistic {
22
22
  export interface FlowModel {
23
23
  elements: FlowModelElement[];
24
24
  connections: FlowConnection[];
25
- modules?: string[];
25
+ modules?: any;
26
+ refs?: any;
26
27
  properties?: Record<string, any>;
27
28
  }
28
29
  export interface FlowModelElement {
29
30
  id: string;
30
31
  name?: string;
32
+ type?: string;
31
33
  properties?: Record<string, any>;
32
34
  module: string;
33
35
  functionFqn: string;
@@ -24,12 +24,13 @@ export type { CreateOrgWithResourcesDto, OrganizationResourcesProgress, Organiza
24
24
  export type { Owner } from './owner.interface';
25
25
  export type { DeleteAssetQuery, DeleteAssetTypeQuery, DeleteQuery } from './query.interface';
26
26
  export type { ConnectedResources, ConnectedResourceType, OrgResourcePermission, Resource, ResourceReference, SharedResources, } from './resource.interface';
27
+ export type { CreateReferenceDto, ObjectReference, ReferencesQuery } from './reference.interface';
27
28
  export type { JsonSchema, JsonSchemaArray, JsonSchemaForm, JsonSchemaType, JsonSchemaTypeName } from './schema.interface';
28
29
  export type { SearchOptions, SearchResult, SearchSortOption, SortableField } from './search.interface';
29
30
  export type { Secret } from './secret.interface';
30
31
  export type { ServerSentEvent } from './sse.interface';
31
32
  export type { Artifact, FileType, Storage, StorageProvider } from './storage.interface';
32
- export type { LogbookEntry, LogbookEntryDto, Task } from './task.interface';
33
+ export type { LogbookEntry, LogbookEntryDto, Task, Assignee } from './task.interface';
33
34
  export type { TimeSeries, TimeSeriesBucket, TimeSeriesCondition, TimeSeriesValue, TS_GROUPS } from './timeseries.interface';
34
35
  export type { Application, Consent, Permission, TableSetting, TableSettingProfile, UserSettings } from './user-settings.interface';
35
36
  export type { VaultSecret } from './vault.interface';
@@ -38,5 +39,6 @@ export { ReturnType } from './content.interface';
38
39
  export { instanceOfTimePeriod } from './data.interface';
39
40
  export { LABEL_COLORS } from './label.interface';
40
41
  export { OwnerType } from './owner.interface';
42
+ export { ObjectReferenceType } from './reference.interface';
41
43
  export { PermissionType, ResourceType, ResourceApiPath, resourceApiPathToTypeMap } from './resource.interface';
42
- export { Priority, TaskStatus } from './task.interface';
44
+ export { Priority, TaskStatus, AssigneeType } from './task.interface';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TaskStatus = exports.Priority = exports.resourceApiPathToTypeMap = exports.ResourceApiPath = exports.ResourceType = exports.PermissionType = exports.OwnerType = exports.LABEL_COLORS = exports.instanceOfTimePeriod = exports.ReturnType = exports.AlertType = exports.AlertLevel = exports.OrganizationMembersInviteOrAdd = void 0;
3
+ exports.AssigneeType = exports.TaskStatus = exports.Priority = exports.resourceApiPathToTypeMap = exports.ResourceApiPath = exports.ResourceType = exports.PermissionType = exports.ObjectReferenceType = exports.OwnerType = exports.LABEL_COLORS = exports.instanceOfTimePeriod = exports.ReturnType = exports.AlertType = exports.AlertLevel = exports.OrganizationMembersInviteOrAdd = void 0;
4
4
  var organization_interface_1 = require("./organization.interface");
5
5
  Object.defineProperty(exports, "OrganizationMembersInviteOrAdd", { enumerable: true, get: function () { return organization_interface_1.OrganizationMembersInviteOrAdd; } });
6
6
  var alert_interface_1 = require("./alert.interface");
@@ -14,6 +14,8 @@ var label_interface_1 = require("./label.interface");
14
14
  Object.defineProperty(exports, "LABEL_COLORS", { enumerable: true, get: function () { return label_interface_1.LABEL_COLORS; } });
15
15
  var owner_interface_1 = require("./owner.interface");
16
16
  Object.defineProperty(exports, "OwnerType", { enumerable: true, get: function () { return owner_interface_1.OwnerType; } });
17
+ var reference_interface_1 = require("./reference.interface");
18
+ Object.defineProperty(exports, "ObjectReferenceType", { enumerable: true, get: function () { return reference_interface_1.ObjectReferenceType; } });
17
19
  var resource_interface_1 = require("./resource.interface");
18
20
  Object.defineProperty(exports, "PermissionType", { enumerable: true, get: function () { return resource_interface_1.PermissionType; } });
19
21
  Object.defineProperty(exports, "ResourceType", { enumerable: true, get: function () { return resource_interface_1.ResourceType; } });
@@ -22,3 +24,4 @@ Object.defineProperty(exports, "resourceApiPathToTypeMap", { enumerable: true, g
22
24
  var task_interface_1 = require("./task.interface");
23
25
  Object.defineProperty(exports, "Priority", { enumerable: true, get: function () { return task_interface_1.Priority; } });
24
26
  Object.defineProperty(exports, "TaskStatus", { enumerable: true, get: function () { return task_interface_1.TaskStatus; } });
27
+ Object.defineProperty(exports, "AssigneeType", { enumerable: true, get: function () { return task_interface_1.AssigneeType; } });
@@ -4,6 +4,7 @@ export interface NotificationRule {
4
4
  name: string;
5
5
  description?: string;
6
6
  endpointRef: string;
7
+ endpointRef$name?: string;
7
8
  status: string;
8
9
  every: string;
9
10
  offset?: string;
@@ -0,0 +1,37 @@
1
+ export declare enum ObjectReferenceType {
2
+ TEST_REFERENCE = "test_reference"
3
+ }
4
+ export interface ObjectReference {
5
+ id: number;
6
+ src: string;
7
+ tgt: string;
8
+ srcType: string;
9
+ tgtType: string;
10
+ relType: string;
11
+ createdAt: number;
12
+ updatedAt: number;
13
+ createdBy: string;
14
+ relSrc: string;
15
+ displayData: Record<string, unknown>;
16
+ tgtDeleted: boolean;
17
+ }
18
+ export interface CreateReferenceDto {
19
+ srcId: string;
20
+ tgtId: string;
21
+ srcType: string;
22
+ tgtType: string;
23
+ relSrc: string;
24
+ relType: ObjectReferenceType;
25
+ displayData: Record<string, unknown>;
26
+ tgtDeleted?: boolean;
27
+ }
28
+ export interface ReferencesQuery {
29
+ objId: string;
30
+ types?: ObjectReferenceType[];
31
+ connectedObjType?: string;
32
+ objIsTgt?: boolean;
33
+ objIsSrc?: boolean;
34
+ limit?: number;
35
+ page?: number;
36
+ sort?: string;
37
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ObjectReferenceType = void 0;
4
+ var ObjectReferenceType;
5
+ (function (ObjectReferenceType) {
6
+ ObjectReferenceType["TEST_REFERENCE"] = "test_reference";
7
+ })(ObjectReferenceType || (exports.ObjectReferenceType = ObjectReferenceType = {}));
@@ -1,4 +1,12 @@
1
1
  import { Api, Author } from '.';
2
+ export declare enum AssigneeType {
3
+ USER = "user",
4
+ ORG = "org"
5
+ }
6
+ export interface Assignee {
7
+ id: string;
8
+ type: AssigneeType;
9
+ }
2
10
  export declare enum TaskStatus {
3
11
  OPENED = "OPENED",
4
12
  CLOSED = "CLOSED",
@@ -22,7 +30,6 @@ export interface Task extends Api {
22
30
  description?: string;
23
31
  priority: Priority;
24
32
  tags?: string[];
25
- author?: string;
26
33
  readPermissions: string[];
27
34
  readWritePermissions: string[];
28
35
  assetRef?: string;
@@ -35,9 +42,9 @@ export interface Task extends Api {
35
42
  parent?: string;
36
43
  parent$name?: string;
37
44
  subTasks?: string[];
38
- assignedTo: string[];
39
- status?: TaskStatus;
45
+ assignedTo: Assignee[];
40
46
  acceptedBy?: string;
47
+ status?: TaskStatus;
41
48
  reason?: string;
42
49
  statusHistoryLog?: TaskStatus[];
43
50
  logbookSchema?: string;
@@ -1,6 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Priority = exports.TaskStatus = void 0;
3
+ exports.Priority = exports.TaskStatus = exports.AssigneeType = void 0;
4
+ var AssigneeType;
5
+ (function (AssigneeType) {
6
+ AssigneeType["USER"] = "user";
7
+ AssigneeType["ORG"] = "org";
8
+ })(AssigneeType || (exports.AssigneeType = AssigneeType = {}));
4
9
  var TaskStatus;
5
10
  (function (TaskStatus) {
6
11
  TaskStatus["OPENED"] = "OPENED";
@@ -1,6 +1,7 @@
1
1
  import { AiMockService, AlertMockService, AssetMockService, AssetTypesMockService, ContentMockService, EndpointMockService, EventMockService, FlowDeploymentMockService, FlowFunctionsMockService, FlowMockService, FlowModulesMockService, HttpClientMockService, LabelMockService, NotificationMockService, NotificationRulesMockService, OrganizationsAdministrationMockService, OrganizationsMockService, OrganizationsResourcesMockService, SearchMockService, TaskMockService, TimeseriesMockService, UserMockService, VaultMockService } from '.';
2
2
  import { API } from '../api';
3
3
  import { Artifact, Asset, AssetRevision, AssetType, Content, Endpoint, Event, FlowDeployment, FlowDiagram, FlowDto, FlowFunctionDto, FlowFunctionRevision, FlowModule, FlowRevision, Label, Notification, Organization, Secret, Task, TimeSeries, TimeSeriesValue, VaultSecret } from '../interfaces';
4
+ import { ObjectReferenceService } from '../services/reference.service';
4
5
  export interface MockAPIInitData {
5
6
  assets?: AssetInit[];
6
7
  assetRevisions?: AssetRevisionInit[];
@@ -49,6 +50,7 @@ export declare class MockAPI implements API {
49
50
  timeSeries: TimeseriesMockService;
50
51
  users: UserMockService;
51
52
  vault: VaultMockService;
53
+ objectReferences: ObjectReferenceService;
52
54
  constructor(initData: MockAPIInitData);
53
55
  getEverything(): Promise<{}>;
54
56
  }
@@ -6,6 +6,7 @@ const interfaces_1 = require("../interfaces");
6
6
  class MockAPI {
7
7
  constructor(initData) {
8
8
  this.proxy = null;
9
+ this.objectReferences = null;
9
10
  const { assets = [], assetRevisions = [], contents = [], endpoints = [], secrets = [], timeSeries = [], tasks = [], events = [], users, flows = [], flowRevisions = [], deployments = [], functions = [], functionRevisions = [], modules = [], diagrams = [], labels = [], vault = [], notifications = [], organizations = [], resourceSetNames = [], } = initData;
10
11
  // convert init data to normal data that the services usually use
11
12
  const assetTypes = assets
@@ -26,6 +27,7 @@ class MockAPI {
26
27
  readPermissions: v.readPermissions ?? [],
27
28
  readWritePermissions: v.readWritePermissions ?? [],
28
29
  type: assetTypes[index],
30
+ attachments: [],
29
31
  }));
30
32
  const assetRevisions1 = assetRevisions.map((v, index) => ({
31
33
  ...v,
@@ -14,7 +14,7 @@ export declare class OrganizationsMockService extends APIBaseMock<Organization>
14
14
  getActiveOrganizationOfUser(): Promise<Organization>;
15
15
  getMyOrganizations(): Promise<Organization[]>;
16
16
  getOrganizationData(id: string, kinds?: OrganizationDataKind[]): Promise<OrganizationData>;
17
- getOrganizationMemberById(id: string, userId: string): Promise<KeycloakProfile>;
17
+ getMemberById(id: string, userId: string): Promise<KeycloakProfile>;
18
18
  getOrganizationNamesByIds(ids: string[]): Promise<OrganizationName[]>;
19
19
  getUserOrganizationRoles(ids: string[], userId: string): Promise<Record<string, OrganizationRoleRepresentation[]>>;
20
20
  getUserOrganizations(userId: string): Promise<Organization[]>;
@@ -50,7 +50,7 @@ class OrganizationsMockService extends _1.APIBaseMock {
50
50
  getOrganizationData(id, kinds) {
51
51
  return Promise.resolve(undefined);
52
52
  }
53
- getOrganizationMemberById(id, userId) {
53
+ getMemberById(id, userId) {
54
54
  return Promise.resolve(undefined);
55
55
  }
56
56
  getOrganizationNamesByIds(ids) {
@@ -19,6 +19,7 @@ export { OrganizationsService } from './organizations.service';
19
19
  export { OrganizationsAdministrationService } from './organizations-administration.service';
20
20
  export { OrganizationsResourcesService } from './organizations-resources.service';
21
21
  export { ProxyService } from './proxy.service';
22
+ export { ObjectReferenceService } from './reference.service';
22
23
  export { SearchService } from './search.service';
23
24
  export { ShareService } from './share.service';
24
25
  export { TaskService } from './task.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.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;
3
+ exports.VaultService = exports.UserService = exports.TimeSeriesService = exports.TaskService = exports.ShareService = exports.SearchService = exports.ObjectReferenceService = 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");
@@ -43,6 +43,8 @@ var organizations_resources_service_1 = require("./organizations-resources.servi
43
43
  Object.defineProperty(exports, "OrganizationsResourcesService", { enumerable: true, get: function () { return organizations_resources_service_1.OrganizationsResourcesService; } });
44
44
  var proxy_service_1 = require("./proxy.service");
45
45
  Object.defineProperty(exports, "ProxyService", { enumerable: true, get: function () { return proxy_service_1.ProxyService; } });
46
+ var reference_service_1 = require("./reference.service");
47
+ Object.defineProperty(exports, "ObjectReferenceService", { enumerable: true, get: function () { return reference_service_1.ObjectReferenceService; } });
46
48
  var search_service_1 = require("./search.service");
47
49
  Object.defineProperty(exports, "SearchService", { enumerable: true, get: function () { return search_service_1.SearchService; } });
48
50
  var share_service_1 = require("./share.service");
@@ -104,7 +104,7 @@ export declare class OrganizationsService extends APIBase {
104
104
  * @param {string} userId - user id of requested member
105
105
  * @returns {Promise<KeycloakProfile>} member
106
106
  */
107
- getOrganizationMemberById(id: string, userId: string): Promise<KeycloakProfile>;
107
+ getMemberById(id: string, userId: string): Promise<KeycloakProfile>;
108
108
  /**
109
109
  * Returns the names of organizations with the provided ids.
110
110
  *
@@ -134,8 +134,8 @@ class OrganizationsService extends api_base_1.APIBase {
134
134
  * @param {string} userId - user id of requested member
135
135
  * @returns {Promise<KeycloakProfile>} member
136
136
  */
137
- getOrganizationMemberById(id, userId) {
138
- return this.httpClient.get(`${this.basePath}/${id}/data/employees/${userId}`);
137
+ getMemberById(id, userId) {
138
+ return this.httpClient.get(`${this.basePath}/${id}/data/members/${userId}`);
139
139
  }
140
140
  /**
141
141
  * Returns the names of organizations with the provided ids.
@@ -0,0 +1,13 @@
1
+ import { CreateReferenceDto, ObjectReference, ObjectReferenceType, ReferencesQuery } from '../interfaces';
2
+ import { HttpClientService } from './http-client.service';
3
+ export declare class ObjectReferenceService {
4
+ private readonly httpClient;
5
+ constructor(httpClient: HttpClientService);
6
+ find(query: ReferencesQuery): Promise<ObjectReference[]>;
7
+ findAll(objId: string): Promise<ObjectReference[]>;
8
+ create(dto: CreateReferenceDto): Promise<ObjectReference>;
9
+ update(referenceId: number, updateData: Partial<Omit<ObjectReference, 'id' | 'createdAt'>>): Promise<ObjectReference>;
10
+ deleteById(refId: string): Promise<void>;
11
+ deleteByReference(src: string, tgt: string, relType: ObjectReferenceType): Promise<void>;
12
+ checkConnection(srcId: string, tgtId: string, type?: ObjectReferenceType): Promise<boolean>;
13
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ObjectReferenceService = void 0;
4
+ class ObjectReferenceService {
5
+ constructor(httpClient) {
6
+ this.httpClient = httpClient;
7
+ }
8
+ async find(query) {
9
+ const params = new URLSearchParams();
10
+ params.append('objId', query.objId);
11
+ if (query.types) {
12
+ params.append('type', query.types.join(','));
13
+ }
14
+ if (query.connectedObjType) {
15
+ params.append('connectedObjType', query.connectedObjType.toString());
16
+ }
17
+ if (query.objIsTgt !== undefined) {
18
+ params.append('objIsTgt', query.objIsTgt.toString());
19
+ }
20
+ if (query.objIsSrc !== undefined) {
21
+ params.append('objIsSrc', query.objIsSrc.toString());
22
+ }
23
+ return await this.httpClient.get(`/references?${params.toString()}`);
24
+ }
25
+ async findAll(objId) {
26
+ return await this.httpClient.get(`/references/${objId}`);
27
+ }
28
+ async create(dto) {
29
+ return await this.httpClient.post('/references', dto);
30
+ }
31
+ async update(referenceId, updateData) {
32
+ return await this.httpClient.put(`/references/${referenceId}`, updateData);
33
+ }
34
+ async deleteById(refId) {
35
+ await this.httpClient.delete(`/references/${refId}`);
36
+ }
37
+ async deleteByReference(src, tgt, relType) {
38
+ await this.httpClient.delete(`/references/${src}/${tgt}/${relType}`);
39
+ }
40
+ async checkConnection(srcId, tgtId, type) {
41
+ const params = new URLSearchParams();
42
+ if (type) {
43
+ params.append('type', type.toString());
44
+ }
45
+ const queryString = params.toString();
46
+ const url = `/references/connected/${srcId}/${tgtId}${queryString ? `?${queryString}` : ''}`;
47
+ return await this.httpClient.get(url);
48
+ }
49
+ }
50
+ exports.ObjectReferenceService = ObjectReferenceService;