@hahnpro/hpc-api 2026.2.4 → 2026.2.6

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @hahnpro/hpc-api
2
2
 
3
+ # 2026.2.6
4
+ - Updated Search-Interface: SearchResult -> SearchMatchReason -> SearchMatchReasonContentPart
5
+ - Updated search-service search method
6
+ - Update AI-Interface: added ResourceSelectionRejected interface
7
+
8
+ # 2026.2.5
9
+
10
+ ### Patch Changes
11
+
12
+ - Added to Ai-Interface: ResourceSelectionOption abd SelectionMessage
13
+ - Added getLogbookEntriesByIds to task.service
14
+
3
15
  # 2026.2.2
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hahnpro/hpc-api",
3
- "version": "2026.2.4",
3
+ "version": "2026.2.6",
4
4
  "description": "Module for easy access to the HahnPRO Cloud API",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -35,13 +35,15 @@ export declare enum Role {
35
35
  export declare enum ToolType {
36
36
  HANDOFF = "handoff",
37
37
  CHOICE = "choice",
38
- ACTION = "action"
38
+ ACTION = "action",
39
+ BUILT_IN_ACTION = "built_in-action"
39
40
  }
40
41
  export declare enum ReferenceType {
41
42
  ASSET = "asset",
42
43
  ASSET_TYPE = "asset-type",
43
44
  DOCUMENT = "document",
44
45
  EVENT = "event",
46
+ LOGBOOK_ENTRY = "logbook-entry",
45
47
  TASK = "task",
46
48
  WEB_SOURCE = "web-source"
47
49
  }
@@ -53,11 +55,21 @@ export interface AiAssistant {
53
55
  icon?: string;
54
56
  readPermissions?: string[];
55
57
  }
58
+ export interface ResourceSelectionRejected {
59
+ rejected: true;
60
+ message: string;
61
+ }
56
62
  interface AssistantLabels {
57
63
  name: string;
58
64
  description?: string;
59
65
  welcomeMessage?: string;
60
66
  }
67
+ interface SelectionMessage {
68
+ message: string;
69
+ resourceType: ReferenceType;
70
+ moreMatches: boolean;
71
+ choices: ResourceSelectionOption[];
72
+ }
61
73
  interface BaseMessage {
62
74
  id?: string;
63
75
  responseId?: string;
@@ -103,7 +115,7 @@ export interface ToolMessage extends BaseMessage {
103
115
  agentStack?: string[];
104
116
  status?: ToolMessageStatus;
105
117
  result?: any;
106
- args?: any;
118
+ args?: SelectionMessage | any;
107
119
  contextVariables?: Record<string, unknown>;
108
120
  }
109
121
  export interface UserMessage extends BaseMessage {
@@ -132,4 +144,29 @@ export interface ThreadPopulated extends Thread {
132
144
  firstMessage?: Message;
133
145
  lastMessage?: Message;
134
146
  }
147
+ export interface BaseResourceSelectionOption {
148
+ id: string;
149
+ name?: string;
150
+ resourceType: ReferenceType;
151
+ }
152
+ export interface AssetResourceSelectionOption extends BaseResourceSelectionOption {
153
+ resourceType: ReferenceType.ASSET;
154
+ type?: string;
155
+ typeName?: string;
156
+ location?: string;
157
+ factory?: string;
158
+ }
159
+ export interface DocumentResourceSelectionOption extends BaseResourceSelectionOption {
160
+ resourceType: ReferenceType.DOCUMENT;
161
+ mimetype?: string;
162
+ }
163
+ export interface LogbookEntryResourceSelectionOption extends BaseResourceSelectionOption {
164
+ resourceType: ReferenceType.LOGBOOK_ENTRY;
165
+ date: string;
166
+ duration?: number;
167
+ }
168
+ export interface GenericResourceSelectionOption extends BaseResourceSelectionOption {
169
+ resourceType: Exclude<ReferenceType, ReferenceType.ASSET | ReferenceType.DOCUMENT | ReferenceType.LOGBOOK_ENTRY>;
170
+ }
171
+ export type ResourceSelectionOption = AssetResourceSelectionOption | DocumentResourceSelectionOption | LogbookEntryResourceSelectionOption | GenericResourceSelectionOption;
135
172
  export {};
@@ -44,6 +44,7 @@ var ToolType;
44
44
  ToolType["HANDOFF"] = "handoff";
45
45
  ToolType["CHOICE"] = "choice";
46
46
  ToolType["ACTION"] = "action";
47
+ ToolType["BUILT_IN_ACTION"] = "built_in-action";
47
48
  })(ToolType || (exports.ToolType = ToolType = {}));
48
49
  var ReferenceType;
49
50
  (function (ReferenceType) {
@@ -51,6 +52,7 @@ var ReferenceType;
51
52
  ReferenceType["ASSET_TYPE"] = "asset-type";
52
53
  ReferenceType["DOCUMENT"] = "document";
53
54
  ReferenceType["EVENT"] = "event";
55
+ ReferenceType["LOGBOOK_ENTRY"] = "logbook-entry";
54
56
  ReferenceType["TASK"] = "task";
55
57
  ReferenceType["WEB_SOURCE"] = "web-source";
56
58
  })(ReferenceType || (exports.ReferenceType = ReferenceType = {}));
@@ -1,4 +1,4 @@
1
- export type { AiAssistant, AssistantMessage, Message, SpeechToken, SystemMessage, Thread, ThreadPopulated, ToolMessage, UserMessage, } from './ai.interface';
1
+ export type { AiAssistant, AssetResourceSelectionOption, AssistantMessage, DocumentResourceSelectionOption, GenericResourceSelectionOption, LogbookEntryResourceSelectionOption, Message, ResourceSelectionOption, ResourceSelectionRejected, SpeechToken, SystemMessage, Thread, ThreadPopulated, ToolMessage, UserMessage, } from './ai.interface';
2
2
  export type { Alert, AlertCondition, TimeSeriesReference } from './alert.interface';
3
3
  export type { Api } from './api.interface';
4
4
  export type { AddToProperty, Asset, AssetRevision, AssetType, AssetTypeRevision, Attachment, EventCause, EventLevelOverride, RemoveFromProperty, Template, } from './asset.interface';
@@ -19,18 +19,18 @@ export type { NotificationRule, StatusRule, TagRule } from './notification-rule.
19
19
  export type { Notification, NotificationType } from './notification.interface';
20
20
  export type { OrganizationRoleRepresentation } from './organization-role-representation.interface';
21
21
  export { OrganizationMembersInviteOrAdd } from './organization.interface';
22
- export type { Organization, CreateOrganizationDto, OrganizationData, OrganizationDataKind, OrganizationDomain, OrganizationExtraProperties, OrganizationName, OrganizationRolesAdjustment, OrganizationSearchQuery, SubscriptionType, UserWithOrgRoles, } from './organization.interface';
22
+ export type { CreateOrganizationDto, Organization, OrganizationData, OrganizationDataKind, OrganizationDomain, OrganizationExtraProperties, OrganizationName, OrganizationRolesAdjustment, OrganizationSearchQuery, SubscriptionType, UserWithOrgRoles, } from './organization.interface';
23
23
  export type { CreateOrgWithResourcesDto, OrganizationResourcesProgress, OrganizationResourcesProgressDto, OrganizationResourcesProgressErrorDto, } from './organizations-resources.interface';
24
24
  export type { Owner } from './owner.interface';
25
25
  export type { DeleteAssetQuery, DeleteAssetTypeQuery, DeleteQuery } from './query.interface';
26
- export type { ConnectedResources, ConnectedResourceType, OrgResourcePermission, Resource, ResourceReference, SharedResources, } from './resource.interface';
27
26
  export type { CreateReferenceDto, ObjectReference, ReferencesQuery } from './reference.interface';
27
+ export type { ConnectedResources, ConnectedResourceType, OrgResourcePermission, Resource, ResourceReference, SharedResources, } from './resource.interface';
28
28
  export type { JsonSchema, JsonSchemaArray, JsonSchemaForm, JsonSchemaType, JsonSchemaTypeName } from './schema.interface';
29
- export type { SearchOptions, SearchResult, SearchSortOption, SortableField } from './search.interface';
29
+ export type { SearchMatchReason, SearchMatchReasonContentPart, SearchOptions, SearchResult, SearchSortOption, SortableField, } from './search.interface';
30
30
  export type { Secret } from './secret.interface';
31
31
  export type { ServerSentEvent } from './sse.interface';
32
32
  export type { Artifact, FileType, Storage, StorageProvider } from './storage.interface';
33
- export type { LogbookEntry, LogbookEntryDto, Task, Assignee } from './task.interface';
33
+ export type { Assignee, LogbookEntry, LogbookEntryDto, Task } from './task.interface';
34
34
  export type { TimeSeries, TimeSeriesBucket, TimeSeriesCondition, TimeSeriesValue, TS_GROUPS } from './timeseries.interface';
35
35
  export type { Application, Consent, Permission, TableSetting, TableSettingProfile, UserSettings } from './user-settings.interface';
36
36
  export type { VaultSecret } from './vault.interface';
@@ -42,5 +42,5 @@ export { EventLevel } from './event.interface';
42
42
  export { LABEL_COLORS } from './label.interface';
43
43
  export { OwnerType } from './owner.interface';
44
44
  export { ObjectReferenceType } from './reference.interface';
45
- export { PermissionType, ResourceType, ResourceApiPath, resourceApiPathToTypeMap } from './resource.interface';
46
- export { Priority, TaskStatus, AssigneeType } from './task.interface';
45
+ export { PermissionType, ResourceApiPath, resourceApiPathToTypeMap, ResourceType } from './resource.interface';
46
+ export { AssigneeType, Priority, TaskStatus } from './task.interface';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AssigneeType = exports.TaskStatus = exports.Priority = exports.resourceApiPathToTypeMap = exports.ResourceApiPath = exports.ResourceType = exports.PermissionType = exports.ObjectReferenceType = exports.OwnerType = exports.LABEL_COLORS = exports.EventLevel = exports.instanceOfTimePeriod = exports.ReturnType = exports.AlertType = exports.AlertLevel = exports.ToolType = exports.ToolMessageStatus = exports.Role = exports.ReferenceType = exports.FinishReason = exports.AvailableLanguages = exports.AssistantMessageStatus = exports.OrganizationMembersInviteOrAdd = void 0;
3
+ exports.TaskStatus = exports.Priority = exports.AssigneeType = exports.ResourceType = exports.resourceApiPathToTypeMap = exports.ResourceApiPath = exports.PermissionType = exports.ObjectReferenceType = exports.OwnerType = exports.LABEL_COLORS = exports.EventLevel = exports.instanceOfTimePeriod = exports.ReturnType = exports.AlertType = exports.AlertLevel = exports.ToolType = exports.ToolMessageStatus = exports.Role = exports.ReferenceType = exports.FinishReason = exports.AvailableLanguages = exports.AssistantMessageStatus = 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 ai_interface_1 = require("./ai.interface");
@@ -28,10 +28,10 @@ var reference_interface_1 = require("./reference.interface");
28
28
  Object.defineProperty(exports, "ObjectReferenceType", { enumerable: true, get: function () { return reference_interface_1.ObjectReferenceType; } });
29
29
  var resource_interface_1 = require("./resource.interface");
30
30
  Object.defineProperty(exports, "PermissionType", { enumerable: true, get: function () { return resource_interface_1.PermissionType; } });
31
- Object.defineProperty(exports, "ResourceType", { enumerable: true, get: function () { return resource_interface_1.ResourceType; } });
32
31
  Object.defineProperty(exports, "ResourceApiPath", { enumerable: true, get: function () { return resource_interface_1.ResourceApiPath; } });
33
32
  Object.defineProperty(exports, "resourceApiPathToTypeMap", { enumerable: true, get: function () { return resource_interface_1.resourceApiPathToTypeMap; } });
33
+ Object.defineProperty(exports, "ResourceType", { enumerable: true, get: function () { return resource_interface_1.ResourceType; } });
34
34
  var task_interface_1 = require("./task.interface");
35
+ Object.defineProperty(exports, "AssigneeType", { enumerable: true, get: function () { return task_interface_1.AssigneeType; } });
35
36
  Object.defineProperty(exports, "Priority", { enumerable: true, get: function () { return task_interface_1.Priority; } });
36
37
  Object.defineProperty(exports, "TaskStatus", { enumerable: true, get: function () { return task_interface_1.TaskStatus; } });
37
- Object.defineProperty(exports, "AssigneeType", { enumerable: true, get: function () { return task_interface_1.AssigneeType; } });
@@ -12,7 +12,12 @@ export declare enum ObjectReferenceType {
12
12
  * Marks an Object as updated by an AI-Thread.
13
13
  * Object is linked to the AI-Thread's ID.'
14
14
  */
15
- UPDATED_BY_THREAD = "updated_by_thread"
15
+ UPDATED_BY_THREAD = "updated_by_thread",
16
+ /**
17
+ * Marks an Object as being part of the 'Weber Engineering Flange Skill Check Application' to link examinees to an
18
+ * examination, in which they participate.
19
+ */
20
+ FLANGE_SKILL_CHECK_APPLICATION_EXAMINATION_EXAMINEE = "flange_skill_check_application_examination_examinee"
16
21
  }
17
22
  export interface ObjectReference {
18
23
  id: number;
@@ -17,4 +17,9 @@ var ObjectReferenceType;
17
17
  * Object is linked to the AI-Thread's ID.'
18
18
  */
19
19
  ObjectReferenceType["UPDATED_BY_THREAD"] = "updated_by_thread";
20
+ /**
21
+ * Marks an Object as being part of the 'Weber Engineering Flange Skill Check Application' to link examinees to an
22
+ * examination, in which they participate.
23
+ */
24
+ ObjectReferenceType["FLANGE_SKILL_CHECK_APPLICATION_EXAMINATION_EXAMINEE"] = "flange_skill_check_application_examination_examinee";
20
25
  })(ObjectReferenceType || (exports.ObjectReferenceType = ObjectReferenceType = {}));
@@ -14,10 +14,20 @@ export interface SearchSortOption<T> {
14
14
  field: SortableField<T>;
15
15
  order: 'asc' | 'desc';
16
16
  }
17
+ export interface SearchMatchReason {
18
+ field: string;
19
+ content: SearchMatchReasonContentPart[];
20
+ }
21
+ export interface SearchMatchReasonContentPart {
22
+ text: string;
23
+ isHighlighted: boolean;
24
+ }
17
25
  export interface SearchResult<T extends {
18
26
  id?: string;
19
27
  } = any, K extends keyof T & string = keyof T & string> {
20
- docs: Pick<T, K | 'id'>[];
28
+ docs: (Pick<T, K | 'id'> & {
29
+ matchReason?: SearchMatchReason[];
30
+ })[];
21
31
  limit: number;
22
32
  offset: number;
23
33
  total: number;
@@ -1,8 +1,8 @@
1
1
  import { APIBaseMock } from '.';
2
- import type { SearchOptions, SearchResult, TokenOption } from '../interfaces';
2
+ import type { ResourceType, SearchOptions, SearchResult, TokenOption } from '../interfaces';
3
3
  import { SearchService } from '../services';
4
4
  export declare class SearchMockService extends APIBaseMock<never> implements SearchService {
5
5
  search<T extends {
6
6
  id?: string;
7
- }, K extends keyof T & string = keyof T & string>(query: SearchOptions<T, K>, tokenOption?: TokenOption): Promise<SearchResult<T, K>>;
7
+ }, K extends keyof T & string = keyof T & string>(options: SearchOptions<T, K>, targetResourceTypes?: ResourceType[], tokenOption?: TokenOption): Promise<SearchResult<T, K>>;
8
8
  }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SearchMockService = void 0;
4
4
  const _1 = require(".");
5
5
  class SearchMockService extends _1.APIBaseMock {
6
- search(query, tokenOption = {}) {
6
+ search(options, targetResourceTypes = [], tokenOption = {}) {
7
7
  throw new Error('Method not implemented.');
8
8
  }
9
9
  }
@@ -15,6 +15,7 @@ export declare class TaskMockService extends BaseService implements TaskService
15
15
  findByName(name: string, options?: any): Promise<Paginated<Task>>;
16
16
  findByAsset(assetId: string, options?: any): Promise<Paginated<Task>>;
17
17
  getLogbookEntries(taskId: string, limit?: number, offset?: number, _options?: TokenOption): Promise<Paginated<LogbookEntry>>;
18
+ getLogbookEntriesByIds(ids: string[], _options?: TokenOption): Promise<LogbookEntry[]>;
18
19
  addLogbookEntry(taskId: string, dto: LogbookEntryDto, _options?: TokenOption): Promise<LogbookEntry>;
19
20
  updateLogbookEntry(taskId: string, entryId: string, dto: Partial<LogbookEntryDto>, _options?: TokenOption): Promise<LogbookEntry>;
20
21
  deleteLogbookEntry(taskId: string, entryId: string, _options?: TokenOption): Promise<{
@@ -67,6 +67,10 @@ class TaskMockService extends BaseService {
67
67
  pages: Math.max(1, Math.ceil(taskEntries.length / limit)),
68
68
  };
69
69
  }
70
+ getLogbookEntriesByIds(ids, _options = {}) {
71
+ const entries = this.entries.filter((e) => ids.includes(e.id));
72
+ return Promise.resolve(entries);
73
+ }
70
74
  async addLogbookEntry(taskId, dto, _options = {}) {
71
75
  const id = globalThis.crypto?.randomUUID?.() || Math.random().toString(36).slice(2);
72
76
  const now = new Date().toISOString();
@@ -1,9 +1,9 @@
1
1
  import { HttpClientService } from '.';
2
2
  import { APIBase } from '../api-base';
3
- import type { SearchOptions, SearchResult, TokenOption } from '../interfaces';
3
+ import type { ResourceType, SearchOptions, SearchResult, TokenOption } from '../interfaces';
4
4
  export declare class SearchService extends APIBase {
5
5
  constructor(httpClient: HttpClientService);
6
6
  search<T extends {
7
7
  id?: string;
8
- }, K extends keyof T & string = keyof T & string>(query: SearchOptions<T, K>, tokenOption?: TokenOption): Promise<SearchResult<T, K>>;
8
+ }, K extends keyof T & string = keyof T & string>(options: SearchOptions<T, K>, targetResourceTypes?: ResourceType[], tokenOption?: TokenOption): Promise<SearchResult<T, K>>;
9
9
  }
@@ -6,8 +6,8 @@ class SearchService extends api_base_1.APIBase {
6
6
  constructor(httpClient) {
7
7
  super(httpClient, '/search');
8
8
  }
9
- search(query, tokenOption = {}) {
10
- return this.httpClient.post(this.basePath, query, tokenOption);
9
+ search(options, targetResourceTypes = [], tokenOption = {}) {
10
+ return this.httpClient.post(this.basePath, { options, targetResourceTypes }, tokenOption);
11
11
  }
12
12
  }
13
13
  exports.SearchService = SearchService;
@@ -12,6 +12,7 @@ export declare class TaskService extends BaseService {
12
12
  findByName(name: string, options?: TokenOption): Promise<Paginated<Task>>;
13
13
  findByAsset(assetId: string, options?: TokenOption): Promise<Paginated<Task>>;
14
14
  getLogbookEntries(taskId: string, limit?: number, offset?: number, options?: TokenOption): Promise<Paginated<LogbookEntry>>;
15
+ getLogbookEntriesByIds(ids: string[], options?: TokenOption): Promise<LogbookEntry[]>;
15
16
  addLogbookEntry(taskId: string, entry: LogbookEntryDto, options?: TokenOption): Promise<LogbookEntry>;
16
17
  updateLogbookEntry(taskId: string, entryId: string, entry: Partial<LogbookEntryDto>, options?: TokenOption): Promise<LogbookEntry>;
17
18
  deleteLogbookEntry(taskId: string, entryId: string, options?: TokenOption): Promise<{
@@ -21,10 +21,10 @@ class TaskService extends BaseService {
21
21
  return this.httpClient.post(this.basePath, dto, options);
22
22
  }
23
23
  findByName(name, options = {}) {
24
- return this.httpClient.get(`${this.basePath}?name=${encodeURIComponent(name)}`, options);
24
+ return this.httpClient.get(`${this.basePath}`, { ...options, params: { filter: `name==${name}` } });
25
25
  }
26
26
  findByAsset(assetId, options = {}) {
27
- return this.httpClient.get(`${this.basePath}?assetRef=${assetId}`, options);
27
+ return this.httpClient.get(`${this.basePath}`, { ...options, params: { filter: `assetRef==${assetId}` } });
28
28
  }
29
29
  getLogbookEntries(taskId, limit = 50, offset = 0, options = {}) {
30
30
  return this.httpClient.get(`${this.basePath}/${taskId}/logbook`, {
@@ -32,6 +32,14 @@ class TaskService extends BaseService {
32
32
  params: { limit: String(limit), offset: String(offset) },
33
33
  });
34
34
  }
35
+ getLogbookEntriesByIds(ids, options = {}) {
36
+ return this.httpClient.get(`${this.basePath}/logbook`, {
37
+ ...options,
38
+ params: {
39
+ ids: ids.join(','),
40
+ },
41
+ });
42
+ }
35
43
  addLogbookEntry(taskId, entry, options = {}) {
36
44
  return this.httpClient.post(`${this.basePath}/${taskId}/logbook`, entry, options);
37
45
  }